playlist-data-engine 1.4.1 → 1.4.3
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/core/parser/PlaylistParser.d.ts.map +1 -1
- package/dist/core/types/Playlist.d.ts +14 -16
- package/dist/core/types/Playlist.d.ts.map +1 -1
- package/dist/playlist-data-engine.js +38 -38
- package/dist/playlist-data-engine.mjs +352 -355
- package/dist/utils/playlistUtils.d.ts +2 -2
- package/dist/utils/playlistUtils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -12155,8 +12155,8 @@ const U = class U {
|
|
|
12155
12155
|
throw new Error(`Unknown enemy template ID: ${a}`);
|
|
12156
12156
|
h = j;
|
|
12157
12157
|
} else {
|
|
12158
|
-
const j = e.category,
|
|
12159
|
-
h = U.selectTemplate(d, j,
|
|
12158
|
+
const j = e.category, X = e.archetype;
|
|
12159
|
+
h = U.selectTemplate(d, j, X, c);
|
|
12160
12160
|
}
|
|
12161
12161
|
const m = i ?? U.getCRForRarity(r), f = n ?? U.getLevelFromCR(m);
|
|
12162
12162
|
let g = U.scaleStatsForRarity(
|
|
@@ -12196,21 +12196,21 @@ const U = class U {
|
|
|
12196
12196
|
archetype: h.archetype,
|
|
12197
12197
|
cr: m,
|
|
12198
12198
|
rng: j
|
|
12199
|
-
}), I = D.actions.map((
|
|
12200
|
-
id:
|
|
12201
|
-
name:
|
|
12202
|
-
description:
|
|
12199
|
+
}), I = D.actions.map((X) => ({
|
|
12200
|
+
id: X.id,
|
|
12201
|
+
name: X.name,
|
|
12202
|
+
description: X.description,
|
|
12203
12203
|
type: "active",
|
|
12204
12204
|
class: "Enemy",
|
|
12205
12205
|
level: 1,
|
|
12206
12206
|
source: "legendary",
|
|
12207
|
-
tags:
|
|
12207
|
+
tags: X.tags || ["legendary"],
|
|
12208
12208
|
effects: [],
|
|
12209
12209
|
// Include legendary-specific data
|
|
12210
|
-
legendary_cost:
|
|
12211
|
-
legendary_effect:
|
|
12212
|
-
legendary_damage:
|
|
12213
|
-
legendary_damage_type:
|
|
12210
|
+
legendary_cost: X.cost,
|
|
12211
|
+
legendary_effect: X.effect,
|
|
12212
|
+
legendary_damage: X.damage,
|
|
12213
|
+
legendary_damage_type: X.damageType
|
|
12214
12214
|
})), _.push(...I);
|
|
12215
12215
|
}
|
|
12216
12216
|
const R = Ct.generate({
|
|
@@ -12218,22 +12218,22 @@ const U = class U {
|
|
|
12218
12218
|
rarity: r,
|
|
12219
12219
|
seed: `${t}-equipment`
|
|
12220
12220
|
});
|
|
12221
|
-
let q,
|
|
12221
|
+
let q, O;
|
|
12222
12222
|
if (u?.attackLevel !== void 0) {
|
|
12223
12223
|
const j = mi(g, u.attackLevel, r, h.archetype);
|
|
12224
|
-
q = j.damageDie,
|
|
12224
|
+
q = j.damageDie, O = j.damageModifier;
|
|
12225
12225
|
} else {
|
|
12226
12226
|
const j = mi(g, f, r, h.archetype);
|
|
12227
|
-
q = j.damageDie,
|
|
12227
|
+
q = j.damageDie, O = j.damageModifier;
|
|
12228
12228
|
}
|
|
12229
12229
|
const W = [];
|
|
12230
12230
|
if (R.weapon) {
|
|
12231
|
-
const j = Ct.getEquipmentName(R.weapon.id),
|
|
12232
|
-
|
|
12231
|
+
const j = Ct.getEquipmentName(R.weapon.id), X = Vt[j];
|
|
12232
|
+
X && W.push({
|
|
12233
12233
|
name: j,
|
|
12234
|
-
damage: `${q} + ${
|
|
12234
|
+
damage: `${q} + ${O}`,
|
|
12235
12235
|
damage_dice: q,
|
|
12236
|
-
damage_type:
|
|
12236
|
+
damage_type: X.damage?.damageType || h.signatureAbility.damageType,
|
|
12237
12237
|
type: h.signatureAbility.attackType,
|
|
12238
12238
|
range: h.signatureAbility.range,
|
|
12239
12239
|
properties: R.weapon.properties || [],
|
|
@@ -12242,7 +12242,7 @@ const U = class U {
|
|
|
12242
12242
|
}
|
|
12243
12243
|
W.length === 0 && W.push({
|
|
12244
12244
|
name: h.signatureAbility.name,
|
|
12245
|
-
damage: `${q} + ${
|
|
12245
|
+
damage: `${q} + ${O}`,
|
|
12246
12246
|
damage_dice: q,
|
|
12247
12247
|
damage_type: h.signatureAbility.damageType,
|
|
12248
12248
|
type: h.signatureAbility.attackType,
|
|
@@ -12250,24 +12250,24 @@ const U = class U {
|
|
|
12250
12250
|
properties: h.signatureAbility.properties || [],
|
|
12251
12251
|
equipped: !0
|
|
12252
12252
|
});
|
|
12253
|
-
const
|
|
12254
|
-
let
|
|
12253
|
+
const Z = [];
|
|
12254
|
+
let Q = 0;
|
|
12255
12255
|
if (R.armor) {
|
|
12256
12256
|
const j = Ct.getEquipmentName(R.armor.id);
|
|
12257
|
-
|
|
12257
|
+
Z.push(j), R.armor.acBonus && (Q = R.armor.acBonus - h.baseAC);
|
|
12258
12258
|
}
|
|
12259
12259
|
if (R.shield) {
|
|
12260
12260
|
const j = Ct.getEquipmentName(R.shield.id);
|
|
12261
|
-
|
|
12261
|
+
Z.push(j), R.shield.acBonus && (Q += R.shield.acBonus);
|
|
12262
12262
|
}
|
|
12263
12263
|
let se;
|
|
12264
12264
|
if (u?.defenseLevel !== void 0 ? se = bs(g, u.defenseLevel, h.baseAC, R) : se = bs(g, f, h.baseAC, R), i !== void 0) {
|
|
12265
|
-
const j = h.archetype === "brute" ? "STR" : h.archetype === "archer" ? "DEX" : "CHA",
|
|
12265
|
+
const j = h.archetype === "brute" ? "STR" : h.archetype === "archer" ? "DEX" : "CHA", X = U.estimateWeaponDPR(
|
|
12266
12266
|
q,
|
|
12267
|
-
|
|
12267
|
+
O,
|
|
12268
12268
|
v,
|
|
12269
12269
|
p[j]
|
|
12270
|
-
), fe = U.getMinHPRatio(i), ge = Math.ceil(
|
|
12270
|
+
), fe = U.getMinHPRatio(i), ge = Math.ceil(X * fe);
|
|
12271
12271
|
y < ge && (y = ge);
|
|
12272
12272
|
}
|
|
12273
12273
|
return {
|
|
@@ -12314,7 +12314,7 @@ const U = class U {
|
|
|
12314
12314
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12315
12315
|
weapons: W,
|
|
12316
12316
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12317
|
-
armor:
|
|
12317
|
+
armor: Z,
|
|
12318
12318
|
items: [],
|
|
12319
12319
|
totalWeight: 0,
|
|
12320
12320
|
equippedWeight: 0
|
|
@@ -12324,9 +12324,9 @@ const U = class U {
|
|
|
12324
12324
|
// for future use but are not active in boss combat (boss uses ultimate abilities)
|
|
12325
12325
|
spells: T ? {
|
|
12326
12326
|
spell_slots: Object.fromEntries(
|
|
12327
|
-
Object.entries(T.slots).map(([j,
|
|
12327
|
+
Object.entries(T.slots).map(([j, X]) => [
|
|
12328
12328
|
Number(j),
|
|
12329
|
-
{ total:
|
|
12329
|
+
{ total: X, used: 0 }
|
|
12330
12330
|
])
|
|
12331
12331
|
),
|
|
12332
12332
|
known_spells: T.spells.map((j) => j.name),
|
|
@@ -12534,11 +12534,11 @@ const U = class U {
|
|
|
12534
12534
|
throw new Error(
|
|
12535
12535
|
`Boss encounters must have count=1. Requested count=${n} with baseRarity='boss'. Boss enemies are designed for solo encounters against a party. Use a lower rarity (common/uncommon/elite) for multi-enemy encounters, or set count=1 for a boss encounter.`
|
|
12536
12536
|
);
|
|
12537
|
-
const y = e.map((
|
|
12537
|
+
const y = e.map((Z) => Z.level), v = Yn(y, a), S = Math.round(v * c), T = ki(n), _ = Math.round(S / T / n);
|
|
12538
12538
|
let I = Pr(_);
|
|
12539
12539
|
const D = U.getSeededRNG(i), R = D.random();
|
|
12540
12540
|
R < 0.25 ? I = Math.min(I * 1.5, 30) : R > 0.75 && (I = Math.max(I * 0.67, 0.125));
|
|
12541
|
-
const q = o ? U.getRarityDistribution(n, I) : Array(n).fill(r),
|
|
12541
|
+
const q = o ? U.getRarityDistribution(n, I) : Array(n).fill(r), O = U.selectTemplatesForMix(
|
|
12542
12542
|
n,
|
|
12543
12543
|
D,
|
|
12544
12544
|
h,
|
|
@@ -12547,16 +12547,16 @@ const U = class U {
|
|
|
12547
12547
|
u,
|
|
12548
12548
|
f
|
|
12549
12549
|
), W = [];
|
|
12550
|
-
for (let
|
|
12551
|
-
const
|
|
12552
|
-
if (!
|
|
12553
|
-
throw new Error(`No template available for enemy at index ${
|
|
12550
|
+
for (let Z = 0; Z < n; Z++) {
|
|
12551
|
+
const Q = O[Z];
|
|
12552
|
+
if (!Q)
|
|
12553
|
+
throw new Error(`No template available for enemy at index ${Z}`);
|
|
12554
12554
|
const se = U.generate({
|
|
12555
|
-
seed: `${i}-${
|
|
12556
|
-
templateId:
|
|
12555
|
+
seed: `${i}-${Z}`,
|
|
12556
|
+
templateId: Q.id,
|
|
12557
12557
|
cr: I,
|
|
12558
12558
|
// Pass CR for proper level scaling (Task 1.4)
|
|
12559
|
-
rarity: q[
|
|
12559
|
+
rarity: q[Z],
|
|
12560
12560
|
// Use distributed rarity (Task 2.3)
|
|
12561
12561
|
difficultyMultiplier: c,
|
|
12562
12562
|
audioProfile: f,
|
|
@@ -13815,10 +13815,10 @@ const Me = class Me {
|
|
|
13815
13815
|
const g = e.map((oe) => oe.level), p = Yn(g, i), y = ki(u), v = p / y, S = Pr(v);
|
|
13816
13816
|
let T = Me.CR_FLOOR, _ = Me.CR_CEILING, I = Math.max(T, Math.min(_, S));
|
|
13817
13817
|
const D = Vr[i];
|
|
13818
|
-
let R = !1, q = null,
|
|
13818
|
+
let R = !1, q = null, O = !1;
|
|
13819
13819
|
for (let oe = 0; oe < l; oe++) {
|
|
13820
13820
|
if (d?.aborted) {
|
|
13821
|
-
|
|
13821
|
+
O = !0;
|
|
13822
13822
|
break;
|
|
13823
13823
|
}
|
|
13824
13824
|
h?.(oe + 1, l, I);
|
|
@@ -13834,30 +13834,30 @@ const Me = class Me {
|
|
|
13834
13834
|
oe
|
|
13835
13835
|
);
|
|
13836
13836
|
f += c;
|
|
13837
|
-
const
|
|
13837
|
+
const X = {
|
|
13838
13838
|
cr: I,
|
|
13839
13839
|
winRate: j.playerWinRate,
|
|
13840
13840
|
totalRuns: j.totalRuns,
|
|
13841
13841
|
averageRounds: j.averageRounds,
|
|
13842
13842
|
averageHPRemaining: j.averagePlayerHPPercentRemaining
|
|
13843
13843
|
};
|
|
13844
|
-
m.push(
|
|
13844
|
+
m.push(X);
|
|
13845
13845
|
const fe = (D.min + D.max) / 2;
|
|
13846
|
-
if ((!q || Math.abs(
|
|
13846
|
+
if ((!q || Math.abs(X.winRate - fe) < Math.abs(q.winRate - fe)) && (q = X), X.winRate >= D.min && X.winRate <= D.max) {
|
|
13847
13847
|
R = !0;
|
|
13848
13848
|
break;
|
|
13849
13849
|
}
|
|
13850
|
-
|
|
13850
|
+
X.winRate > D.max ? T = I : _ = I;
|
|
13851
13851
|
const ge = (T + _) / 2;
|
|
13852
13852
|
if (Math.abs(ge - I) < Me.CR_STEP_MIN) {
|
|
13853
|
-
if (
|
|
13853
|
+
if (X.winRate > D.max ? I = Math.min(Me.CR_CEILING, I + Me.CR_STEP_MIN) : I = Math.max(Me.CR_FLOOR, I - Me.CR_STEP_MIN), I === m[m.length - 1].cr)
|
|
13854
13854
|
break;
|
|
13855
13855
|
} else
|
|
13856
13856
|
I = ge;
|
|
13857
13857
|
}
|
|
13858
|
-
const W = q?.cr ?? I,
|
|
13858
|
+
const W = q?.cr ?? I, Z = this.generateEnemy(t, W, o), Q = this.calculateMarginOfError(q?.totalRuns ?? c), se = this.formatConfidenceInterval(
|
|
13859
13859
|
q?.winRate ?? 0,
|
|
13860
|
-
|
|
13860
|
+
Q
|
|
13861
13861
|
);
|
|
13862
13862
|
return {
|
|
13863
13863
|
targetDifficulty: i,
|
|
@@ -13865,14 +13865,14 @@ const Me = class Me {
|
|
|
13865
13865
|
winRate: q?.winRate ?? 0,
|
|
13866
13866
|
expectedWinRateRange: D,
|
|
13867
13867
|
confidenceInterval: se,
|
|
13868
|
-
marginOfError:
|
|
13868
|
+
marginOfError: Q,
|
|
13869
13869
|
converged: R,
|
|
13870
13870
|
totalSimulationsRun: f,
|
|
13871
13871
|
iterationsUsed: m.length,
|
|
13872
13872
|
probes: m,
|
|
13873
13873
|
initialCREstimate: this.roundCR(S),
|
|
13874
|
-
suggestedEnemy:
|
|
13875
|
-
wasCancelled:
|
|
13874
|
+
suggestedEnemy: Z,
|
|
13875
|
+
wasCancelled: O
|
|
13876
13876
|
};
|
|
13877
13877
|
}
|
|
13878
13878
|
/**
|
|
@@ -17195,7 +17195,7 @@ class Se {
|
|
|
17195
17195
|
function Bb(s) {
|
|
17196
17196
|
return Se.for(s);
|
|
17197
17197
|
}
|
|
17198
|
-
class
|
|
17198
|
+
class ee {
|
|
17199
17199
|
/**
|
|
17200
17200
|
* Extract primary (compressed) audio URL with priority:
|
|
17201
17201
|
* 1. mp3_url (Standard web audio - preferred)
|
|
@@ -17362,9 +17362,9 @@ function ra(s) {
|
|
|
17362
17362
|
if ("audio_url" in s && typeof s.audio_url == "string")
|
|
17363
17363
|
return s.audio_url;
|
|
17364
17364
|
if ("metadata" in s) {
|
|
17365
|
-
const e =
|
|
17365
|
+
const e = ee.parseMetadata(s.metadata);
|
|
17366
17366
|
if (e)
|
|
17367
|
-
return
|
|
17367
|
+
return ee.extractAudioUrl(e);
|
|
17368
17368
|
}
|
|
17369
17369
|
return null;
|
|
17370
17370
|
}
|
|
@@ -17372,9 +17372,9 @@ function Tg(s) {
|
|
|
17372
17372
|
if ("audio_url_lossless" in s && typeof s.audio_url_lossless == "string")
|
|
17373
17373
|
return s.audio_url_lossless;
|
|
17374
17374
|
if ("metadata" in s) {
|
|
17375
|
-
const e =
|
|
17375
|
+
const e = ee.parseMetadata(s.metadata);
|
|
17376
17376
|
if (e)
|
|
17377
|
-
return
|
|
17377
|
+
return ee.extractAudioUrlLossless(e);
|
|
17378
17378
|
}
|
|
17379
17379
|
return null;
|
|
17380
17380
|
}
|
|
@@ -17382,9 +17382,11 @@ function oa(s) {
|
|
|
17382
17382
|
if ("image_url" in s && typeof s.image_url == "string")
|
|
17383
17383
|
return s.image_url;
|
|
17384
17384
|
if ("metadata" in s) {
|
|
17385
|
-
|
|
17385
|
+
if ("artwork_url" in s && typeof s.artwork_url == "string")
|
|
17386
|
+
return s.artwork_url;
|
|
17387
|
+
const e = ee.parseMetadata(s.metadata);
|
|
17386
17388
|
if (e)
|
|
17387
|
-
return
|
|
17389
|
+
return ee.extractImageUrl(e);
|
|
17388
17390
|
}
|
|
17389
17391
|
return null;
|
|
17390
17392
|
}
|
|
@@ -17392,9 +17394,9 @@ function Co(s) {
|
|
|
17392
17394
|
if ("image_thumb_url" in s && typeof s.image_thumb_url == "string")
|
|
17393
17395
|
return s.image_thumb_url;
|
|
17394
17396
|
if ("metadata" in s) {
|
|
17395
|
-
const e =
|
|
17397
|
+
const e = ee.parseMetadata(s.metadata);
|
|
17396
17398
|
if (e)
|
|
17397
|
-
return
|
|
17399
|
+
return ee.extractImageThumbUrl(e);
|
|
17398
17400
|
}
|
|
17399
17401
|
return null;
|
|
17400
17402
|
}
|
|
@@ -17402,7 +17404,7 @@ function Mo(s) {
|
|
|
17402
17404
|
if ("audio_url" in s)
|
|
17403
17405
|
return null;
|
|
17404
17406
|
if ("metadata" in s) {
|
|
17405
|
-
const e =
|
|
17407
|
+
const e = ee.parseMetadata(s.metadata);
|
|
17406
17408
|
if (e && typeof e.vrm == "string" && e.vrm)
|
|
17407
17409
|
return e.vrm;
|
|
17408
17410
|
}
|
|
@@ -17432,9 +17434,9 @@ function $b(s) {
|
|
|
17432
17434
|
continue;
|
|
17433
17435
|
}
|
|
17434
17436
|
if ("metadata" in t) {
|
|
17435
|
-
const i =
|
|
17437
|
+
const i = ee.parseMetadata(t.metadata);
|
|
17436
17438
|
if (i) {
|
|
17437
|
-
const n =
|
|
17439
|
+
const n = ee.extractTitle(i);
|
|
17438
17440
|
n && e.push(n);
|
|
17439
17441
|
}
|
|
17440
17442
|
}
|
|
@@ -17449,9 +17451,9 @@ function Ob(s) {
|
|
|
17449
17451
|
continue;
|
|
17450
17452
|
}
|
|
17451
17453
|
if ("metadata" in t) {
|
|
17452
|
-
const i =
|
|
17454
|
+
const i = ee.parseMetadata(t.metadata);
|
|
17453
17455
|
if (i) {
|
|
17454
|
-
const n =
|
|
17456
|
+
const n = ee.extractArtist(i);
|
|
17455
17457
|
n && e.push(n);
|
|
17456
17458
|
}
|
|
17457
17459
|
}
|
|
@@ -17466,7 +17468,7 @@ function zb(s) {
|
|
|
17466
17468
|
continue;
|
|
17467
17469
|
}
|
|
17468
17470
|
if ("metadata" in t) {
|
|
17469
|
-
const i =
|
|
17471
|
+
const i = ee.parseMetadata(t.metadata);
|
|
17470
17472
|
i && typeof i.genre == "string" && i.genre && e.add(i.genre);
|
|
17471
17473
|
}
|
|
17472
17474
|
}
|
|
@@ -17481,7 +17483,7 @@ function Lb(s) {
|
|
|
17481
17483
|
continue;
|
|
17482
17484
|
}
|
|
17483
17485
|
if ("metadata" in t) {
|
|
17484
|
-
const i =
|
|
17486
|
+
const i = ee.parseMetadata(t.metadata);
|
|
17485
17487
|
if (i && Array.isArray(i.tags))
|
|
17486
17488
|
for (const n of i.tags)
|
|
17487
17489
|
n && e.add(String(n).toLowerCase());
|
|
@@ -17497,7 +17499,7 @@ function Wb(s) {
|
|
|
17497
17499
|
continue;
|
|
17498
17500
|
}
|
|
17499
17501
|
if ("metadata" in t) {
|
|
17500
|
-
const i =
|
|
17502
|
+
const i = ee.parseMetadata(t.metadata);
|
|
17501
17503
|
i && typeof i.duration == "number" && (e += i.duration);
|
|
17502
17504
|
}
|
|
17503
17505
|
}
|
|
@@ -17514,8 +17516,8 @@ function qb(s) {
|
|
|
17514
17516
|
if ("title" in t)
|
|
17515
17517
|
r = t.title || "", o = t.artist || "";
|
|
17516
17518
|
else if ("metadata" in t) {
|
|
17517
|
-
const c =
|
|
17518
|
-
c && (r =
|
|
17519
|
+
const c = ee.parseMetadata(t.metadata);
|
|
17520
|
+
c && (r = ee.extractTitle(c) || "", o = ee.extractArtist(c) || "");
|
|
17519
17521
|
}
|
|
17520
17522
|
if (i) {
|
|
17521
17523
|
const c = {
|
|
@@ -17524,7 +17526,7 @@ function qb(s) {
|
|
|
17524
17526
|
audio_url: i,
|
|
17525
17527
|
image_url: n || ""
|
|
17526
17528
|
}, l = Tg(t);
|
|
17527
|
-
l && l !== i && (c.audio_url_lossless = l), a && (c.image_thumb_url = a), "
|
|
17529
|
+
l && l !== i && (c.audio_url_lossless = l), a && (c.image_thumb_url = a), "audio_ipfs_hash" in t && typeof t.audio_ipfs_hash == "string" && (c.audio_ipfs_hash = t.audio_ipfs_hash), "artwork_ipfs_hash" in t && typeof t.artwork_ipfs_hash == "string" && (c.artwork_ipfs_hash = t.artwork_ipfs_hash), e.push(c);
|
|
17528
17530
|
}
|
|
17529
17531
|
}
|
|
17530
17532
|
return e;
|
|
@@ -17537,9 +17539,9 @@ function Gb(s) {
|
|
|
17537
17539
|
continue;
|
|
17538
17540
|
}
|
|
17539
17541
|
if ("metadata" in t) {
|
|
17540
|
-
const i =
|
|
17542
|
+
const i = ee.parseMetadata(t.metadata);
|
|
17541
17543
|
if (i) {
|
|
17542
|
-
const n =
|
|
17544
|
+
const n = ee.extractAudioUrlLossless(i), a = ee.extractAudioUrl(i);
|
|
17543
17545
|
e.push({
|
|
17544
17546
|
id: t.chain_name === "AR" ? `AR-${t.tx_id}` : `${t.chain_name}-${t.token_address}-${t.token_id}`,
|
|
17545
17547
|
chain_name: t.chain_name,
|
|
@@ -17547,11 +17549,11 @@ function Gb(s) {
|
|
|
17547
17549
|
token_id: t.token_id,
|
|
17548
17550
|
tx_id: t.tx_id,
|
|
17549
17551
|
platform: t.platform,
|
|
17550
|
-
title:
|
|
17551
|
-
artist:
|
|
17552
|
+
title: ee.extractTitle(i),
|
|
17553
|
+
artist: ee.extractArtist(i),
|
|
17552
17554
|
audio_url: a,
|
|
17553
|
-
image_url:
|
|
17554
|
-
image_thumb_url:
|
|
17555
|
+
image_url: ee.extractImageUrl(i),
|
|
17556
|
+
image_thumb_url: ee.extractImageThumbUrl(i),
|
|
17555
17557
|
duration: i.duration,
|
|
17556
17558
|
genre: i.genre,
|
|
17557
17559
|
tags: i.tags,
|
|
@@ -17559,17 +17561,11 @@ function Gb(s) {
|
|
|
17559
17561
|
key: i.key,
|
|
17560
17562
|
album: i.album,
|
|
17561
17563
|
description: i.description,
|
|
17562
|
-
attributes:
|
|
17564
|
+
attributes: ee.convertAttributes(i.attributes),
|
|
17563
17565
|
...n && n !== a ? { audio_url_lossless: n } : {},
|
|
17564
|
-
// v0.4 fields from raw track
|
|
17565
|
-
...t.
|
|
17566
|
-
...t.
|
|
17567
|
-
...t.audioIpfsHash ? { audioIpfsHash: t.audioIpfsHash } : {},
|
|
17568
|
-
...t.artworkIpfsHash ? { artworkIpfsHash: t.artworkIpfsHash } : {},
|
|
17569
|
-
...t["Mint-Function"] ? { "Mint-Function": t["Mint-Function"] } : {},
|
|
17570
|
-
...t["Mint-Price"] ? { "Mint-Price": t["Mint-Price"] } : {},
|
|
17571
|
-
...t["Mint-Snapshot-Time"] != null ? { "Mint-Snapshot-Time": t["Mint-Snapshot-Time"] } : {},
|
|
17572
|
-
...t["Mint-Token"] ? { "Mint-Token": t["Mint-Token"] } : {}
|
|
17566
|
+
// v0.4 IPFS hash fields from raw track (mint fields live only in metadata interior)
|
|
17567
|
+
...t.audio_ipfs_hash ? { audio_ipfs_hash: t.audio_ipfs_hash } : {},
|
|
17568
|
+
...t.artwork_ipfs_hash ? { artwork_ipfs_hash: t.artwork_ipfs_hash } : {}
|
|
17573
17569
|
});
|
|
17574
17570
|
}
|
|
17575
17571
|
}
|
|
@@ -17594,8 +17590,8 @@ function Vb(s) {
|
|
|
17594
17590
|
if ("title" in t)
|
|
17595
17591
|
o = t.title || "", c = t.artist || "";
|
|
17596
17592
|
else if ("metadata" in t) {
|
|
17597
|
-
const u =
|
|
17598
|
-
u && (o =
|
|
17593
|
+
const u = ee.parseMetadata(t.metadata);
|
|
17594
|
+
u && (o = ee.extractTitle(u) || "", c = ee.extractArtist(u) || "");
|
|
17599
17595
|
}
|
|
17600
17596
|
const l = {
|
|
17601
17597
|
title: o,
|
|
@@ -18812,7 +18808,7 @@ function Rg() {
|
|
|
18812
18808
|
g(_, R);
|
|
18813
18809
|
else {
|
|
18814
18810
|
_.state = l, _.outcome = I;
|
|
18815
|
-
for (var q = -1,
|
|
18811
|
+
for (var q = -1, O = _.queue.length; ++q < O; )
|
|
18816
18812
|
_.queue[q].callFulfilled(I);
|
|
18817
18813
|
}
|
|
18818
18814
|
return _;
|
|
@@ -18831,16 +18827,16 @@ function Rg() {
|
|
|
18831
18827
|
}
|
|
18832
18828
|
function g(_, I) {
|
|
18833
18829
|
var D = !1;
|
|
18834
|
-
function R(
|
|
18835
|
-
D || (D = !0, o.reject(_,
|
|
18830
|
+
function R(Z) {
|
|
18831
|
+
D || (D = !0, o.reject(_, Z));
|
|
18836
18832
|
}
|
|
18837
|
-
function q(
|
|
18838
|
-
D || (D = !0, o.resolve(_,
|
|
18833
|
+
function q(Z) {
|
|
18834
|
+
D || (D = !0, o.resolve(_, Z));
|
|
18839
18835
|
}
|
|
18840
|
-
function
|
|
18836
|
+
function O() {
|
|
18841
18837
|
I(q, R);
|
|
18842
18838
|
}
|
|
18843
|
-
var W = p(
|
|
18839
|
+
var W = p(O);
|
|
18844
18840
|
W.status === "error" && R(W.value);
|
|
18845
18841
|
}
|
|
18846
18842
|
function p(_, I) {
|
|
@@ -18869,15 +18865,15 @@ function Rg() {
|
|
|
18869
18865
|
var D = _.length, R = !1;
|
|
18870
18866
|
if (!D)
|
|
18871
18867
|
return this.resolve([]);
|
|
18872
|
-
for (var q = new Array(D),
|
|
18873
|
-
|
|
18874
|
-
return
|
|
18875
|
-
function
|
|
18876
|
-
I.resolve(se).then(j, function(
|
|
18877
|
-
R || (R = !0, o.reject(
|
|
18868
|
+
for (var q = new Array(D), O = 0, W = -1, Z = new this(r); ++W < D; )
|
|
18869
|
+
Q(_[W], W);
|
|
18870
|
+
return Z;
|
|
18871
|
+
function Q(se, oe) {
|
|
18872
|
+
I.resolve(se).then(j, function(X) {
|
|
18873
|
+
R || (R = !0, o.reject(Z, X));
|
|
18878
18874
|
});
|
|
18879
|
-
function j(
|
|
18880
|
-
q[oe] =
|
|
18875
|
+
function j(X) {
|
|
18876
|
+
q[oe] = X, ++O === D && !R && (R = !0, o.resolve(Z, q));
|
|
18881
18877
|
}
|
|
18882
18878
|
}
|
|
18883
18879
|
}
|
|
@@ -18889,14 +18885,14 @@ function Rg() {
|
|
|
18889
18885
|
var D = _.length, R = !1;
|
|
18890
18886
|
if (!D)
|
|
18891
18887
|
return this.resolve([]);
|
|
18892
|
-
for (var q = -1,
|
|
18888
|
+
for (var q = -1, O = new this(r); ++q < D; )
|
|
18893
18889
|
W(_[q]);
|
|
18894
|
-
return
|
|
18895
|
-
function W(
|
|
18896
|
-
I.resolve(
|
|
18897
|
-
R || (R = !0, o.resolve(
|
|
18898
|
-
}, function(
|
|
18899
|
-
R || (R = !0, o.reject(
|
|
18890
|
+
return O;
|
|
18891
|
+
function W(Z) {
|
|
18892
|
+
I.resolve(Z).then(function(Q) {
|
|
18893
|
+
R || (R = !0, o.resolve(O, Q));
|
|
18894
|
+
}, function(Q) {
|
|
18895
|
+
R || (R = !0, o.reject(O, Q));
|
|
18900
18896
|
});
|
|
18901
18897
|
}
|
|
18902
18898
|
}
|
|
@@ -19008,7 +19004,7 @@ function Rg() {
|
|
|
19008
19004
|
return w.promise;
|
|
19009
19005
|
}) : C.dbReady = w.promise;
|
|
19010
19006
|
}
|
|
19011
|
-
function
|
|
19007
|
+
function O(b) {
|
|
19012
19008
|
var C = v[b.name], w = C.deferredOperations.pop();
|
|
19013
19009
|
if (w)
|
|
19014
19010
|
return w.resolve(), w.promise;
|
|
@@ -19018,7 +19014,7 @@ function Rg() {
|
|
|
19018
19014
|
if (A)
|
|
19019
19015
|
return A.reject(C), A.promise;
|
|
19020
19016
|
}
|
|
19021
|
-
function
|
|
19017
|
+
function Z(b, C) {
|
|
19022
19018
|
return new d(function(w, A) {
|
|
19023
19019
|
if (v[b.name] = v[b.name] || le(), b.db)
|
|
19024
19020
|
if (C)
|
|
@@ -19044,15 +19040,15 @@ function Rg() {
|
|
|
19044
19040
|
var x = M.result;
|
|
19045
19041
|
x.onversionchange = function(P) {
|
|
19046
19042
|
P.target.close();
|
|
19047
|
-
}, w(x),
|
|
19043
|
+
}, w(x), O(b);
|
|
19048
19044
|
};
|
|
19049
19045
|
});
|
|
19050
19046
|
}
|
|
19051
|
-
function
|
|
19052
|
-
return
|
|
19047
|
+
function Q(b) {
|
|
19048
|
+
return Z(b, !1);
|
|
19053
19049
|
}
|
|
19054
19050
|
function se(b) {
|
|
19055
|
-
return
|
|
19051
|
+
return Z(b, !0);
|
|
19056
19052
|
}
|
|
19057
19053
|
function oe(b, C) {
|
|
19058
19054
|
if (!b.db)
|
|
@@ -19080,7 +19076,7 @@ function Rg() {
|
|
|
19080
19076
|
}, A.readAsBinaryString(b);
|
|
19081
19077
|
});
|
|
19082
19078
|
}
|
|
19083
|
-
function
|
|
19079
|
+
function X(b) {
|
|
19084
19080
|
var C = I(atob(b.data));
|
|
19085
19081
|
return u([C], { type: b.type });
|
|
19086
19082
|
}
|
|
@@ -19101,7 +19097,7 @@ function Rg() {
|
|
|
19101
19097
|
var k = w[A];
|
|
19102
19098
|
k._dbInfo.db && (k._dbInfo.db.close(), k._dbInfo.db = null);
|
|
19103
19099
|
}
|
|
19104
|
-
return b.db = null,
|
|
19100
|
+
return b.db = null, Q(b).then(function(M) {
|
|
19105
19101
|
return b.db = M, oe(b) ? se(b) : M;
|
|
19106
19102
|
}).then(function(M) {
|
|
19107
19103
|
b.db = C.db = M;
|
|
@@ -19111,7 +19107,7 @@ function Rg() {
|
|
|
19111
19107
|
throw W(b, M), M;
|
|
19112
19108
|
});
|
|
19113
19109
|
}
|
|
19114
|
-
function
|
|
19110
|
+
function J(b, C, w, A) {
|
|
19115
19111
|
A === void 0 && (A = 1);
|
|
19116
19112
|
try {
|
|
19117
19113
|
var k = b.db.transaction(b.storeName, C);
|
|
@@ -19123,7 +19119,7 @@ function Rg() {
|
|
|
19123
19119
|
return b.db && (b.version = b.db.version + 1), se(b);
|
|
19124
19120
|
}).then(function() {
|
|
19125
19121
|
return Qt(b).then(function() {
|
|
19126
|
-
|
|
19122
|
+
J(b, C, w, A - 1);
|
|
19127
19123
|
});
|
|
19128
19124
|
}).catch(w);
|
|
19129
19125
|
w(M);
|
|
@@ -19160,14 +19156,14 @@ function Rg() {
|
|
|
19160
19156
|
}
|
|
19161
19157
|
var N = k.forages.slice(0);
|
|
19162
19158
|
return d.all(M).then(function() {
|
|
19163
|
-
return w.db = k.db,
|
|
19164
|
-
}).then(function(
|
|
19165
|
-
return w.db =
|
|
19166
|
-
}).then(function(
|
|
19167
|
-
w.db = k.db =
|
|
19159
|
+
return w.db = k.db, Q(w);
|
|
19160
|
+
}).then(function($) {
|
|
19161
|
+
return w.db = $, oe(w, C._defaultConfig.version) ? se(w) : $;
|
|
19162
|
+
}).then(function($) {
|
|
19163
|
+
w.db = k.db = $, C._dbInfo = w;
|
|
19168
19164
|
for (var V = 0; V < N.length; V++) {
|
|
19169
|
-
var
|
|
19170
|
-
|
|
19165
|
+
var te = N[V];
|
|
19166
|
+
te !== C && (te._dbInfo.db = w.db, te._dbInfo.version = w.version);
|
|
19171
19167
|
}
|
|
19172
19168
|
});
|
|
19173
19169
|
}
|
|
@@ -19176,19 +19172,19 @@ function Rg() {
|
|
|
19176
19172
|
b = f(b);
|
|
19177
19173
|
var A = new d(function(k, M) {
|
|
19178
19174
|
w.ready().then(function() {
|
|
19179
|
-
|
|
19175
|
+
J(w._dbInfo, T, function(x, P) {
|
|
19180
19176
|
if (x)
|
|
19181
19177
|
return M(x);
|
|
19182
19178
|
try {
|
|
19183
19179
|
var B = P.objectStore(w._dbInfo.storeName), N = B.get(b);
|
|
19184
19180
|
N.onsuccess = function() {
|
|
19185
|
-
var
|
|
19186
|
-
|
|
19181
|
+
var $ = N.result;
|
|
19182
|
+
$ === void 0 && ($ = null), fe($) && ($ = X($)), k($);
|
|
19187
19183
|
}, N.onerror = function() {
|
|
19188
19184
|
M(N.error);
|
|
19189
19185
|
};
|
|
19190
|
-
} catch (
|
|
19191
|
-
M(
|
|
19186
|
+
} catch ($) {
|
|
19187
|
+
M($);
|
|
19192
19188
|
}
|
|
19193
19189
|
});
|
|
19194
19190
|
}).catch(M);
|
|
@@ -19198,17 +19194,17 @@ function Rg() {
|
|
|
19198
19194
|
function Sa(b, C) {
|
|
19199
19195
|
var w = this, A = new d(function(k, M) {
|
|
19200
19196
|
w.ready().then(function() {
|
|
19201
|
-
|
|
19197
|
+
J(w._dbInfo, T, function(x, P) {
|
|
19202
19198
|
if (x)
|
|
19203
19199
|
return M(x);
|
|
19204
19200
|
try {
|
|
19205
|
-
var B = P.objectStore(w._dbInfo.storeName), N = B.openCursor(),
|
|
19201
|
+
var B = P.objectStore(w._dbInfo.storeName), N = B.openCursor(), $ = 1;
|
|
19206
19202
|
N.onsuccess = function() {
|
|
19207
19203
|
var V = N.result;
|
|
19208
19204
|
if (V) {
|
|
19209
|
-
var
|
|
19210
|
-
fe(
|
|
19211
|
-
var ie = b(
|
|
19205
|
+
var te = V.value;
|
|
19206
|
+
fe(te) && (te = X(te));
|
|
19207
|
+
var ie = b(te, V.key, $++);
|
|
19212
19208
|
ie !== void 0 ? k(ie) : V.continue();
|
|
19213
19209
|
} else
|
|
19214
19210
|
k();
|
|
@@ -19233,17 +19229,17 @@ function Rg() {
|
|
|
19233
19229
|
return B ? C : j(C);
|
|
19234
19230
|
}) : C;
|
|
19235
19231
|
}).then(function(B) {
|
|
19236
|
-
|
|
19232
|
+
J(A._dbInfo, _, function(N, $) {
|
|
19237
19233
|
if (N)
|
|
19238
19234
|
return x(N);
|
|
19239
19235
|
try {
|
|
19240
|
-
var V =
|
|
19236
|
+
var V = $.objectStore(A._dbInfo.storeName);
|
|
19241
19237
|
B === null && (B = void 0);
|
|
19242
|
-
var
|
|
19243
|
-
|
|
19238
|
+
var te = V.put(B, b);
|
|
19239
|
+
$.oncomplete = function() {
|
|
19244
19240
|
B === void 0 && (B = null), M(B);
|
|
19245
|
-
},
|
|
19246
|
-
var ie =
|
|
19241
|
+
}, $.onabort = $.onerror = function() {
|
|
19242
|
+
var ie = te.error ? te.error : te.transaction.error;
|
|
19247
19243
|
x(ie);
|
|
19248
19244
|
};
|
|
19249
19245
|
} catch (ie) {
|
|
@@ -19259,7 +19255,7 @@ function Rg() {
|
|
|
19259
19255
|
b = f(b);
|
|
19260
19256
|
var A = new d(function(k, M) {
|
|
19261
19257
|
w.ready().then(function() {
|
|
19262
|
-
|
|
19258
|
+
J(w._dbInfo, _, function(x, P) {
|
|
19263
19259
|
if (x)
|
|
19264
19260
|
return M(x);
|
|
19265
19261
|
try {
|
|
@@ -19269,11 +19265,11 @@ function Rg() {
|
|
|
19269
19265
|
}, P.onerror = function() {
|
|
19270
19266
|
M(N.error);
|
|
19271
19267
|
}, P.onabort = function() {
|
|
19272
|
-
var
|
|
19273
|
-
M(
|
|
19268
|
+
var $ = N.error ? N.error : N.transaction.error;
|
|
19269
|
+
M($);
|
|
19274
19270
|
};
|
|
19275
|
-
} catch (
|
|
19276
|
-
M(
|
|
19271
|
+
} catch ($) {
|
|
19272
|
+
M($);
|
|
19277
19273
|
}
|
|
19278
19274
|
});
|
|
19279
19275
|
}).catch(M);
|
|
@@ -19283,7 +19279,7 @@ function Rg() {
|
|
|
19283
19279
|
function Sc(b) {
|
|
19284
19280
|
var C = this, w = new d(function(A, k) {
|
|
19285
19281
|
C.ready().then(function() {
|
|
19286
|
-
|
|
19282
|
+
J(C._dbInfo, _, function(M, x) {
|
|
19287
19283
|
if (M)
|
|
19288
19284
|
return k(M);
|
|
19289
19285
|
try {
|
|
@@ -19305,7 +19301,7 @@ function Rg() {
|
|
|
19305
19301
|
function _c(b) {
|
|
19306
19302
|
var C = this, w = new d(function(A, k) {
|
|
19307
19303
|
C.ready().then(function() {
|
|
19308
|
-
|
|
19304
|
+
J(C._dbInfo, T, function(M, x) {
|
|
19309
19305
|
if (M)
|
|
19310
19306
|
return k(M);
|
|
19311
19307
|
try {
|
|
@@ -19330,20 +19326,20 @@ function Rg() {
|
|
|
19330
19326
|
return;
|
|
19331
19327
|
}
|
|
19332
19328
|
w.ready().then(function() {
|
|
19333
|
-
|
|
19329
|
+
J(w._dbInfo, T, function(x, P) {
|
|
19334
19330
|
if (x)
|
|
19335
19331
|
return M(x);
|
|
19336
19332
|
try {
|
|
19337
|
-
var B = P.objectStore(w._dbInfo.storeName), N = !1,
|
|
19338
|
-
|
|
19339
|
-
var V =
|
|
19333
|
+
var B = P.objectStore(w._dbInfo.storeName), N = !1, $ = B.openKeyCursor();
|
|
19334
|
+
$.onsuccess = function() {
|
|
19335
|
+
var V = $.result;
|
|
19340
19336
|
if (!V) {
|
|
19341
19337
|
k(null);
|
|
19342
19338
|
return;
|
|
19343
19339
|
}
|
|
19344
19340
|
b === 0 || N ? k(V.key) : (N = !0, V.advance(b));
|
|
19345
|
-
},
|
|
19346
|
-
M(
|
|
19341
|
+
}, $.onerror = function() {
|
|
19342
|
+
M($.error);
|
|
19347
19343
|
};
|
|
19348
19344
|
} catch (V) {
|
|
19349
19345
|
M(V);
|
|
@@ -19356,23 +19352,23 @@ function Rg() {
|
|
|
19356
19352
|
function Cc(b) {
|
|
19357
19353
|
var C = this, w = new d(function(A, k) {
|
|
19358
19354
|
C.ready().then(function() {
|
|
19359
|
-
|
|
19355
|
+
J(C._dbInfo, T, function(M, x) {
|
|
19360
19356
|
if (M)
|
|
19361
19357
|
return k(M);
|
|
19362
19358
|
try {
|
|
19363
19359
|
var P = x.objectStore(C._dbInfo.storeName), B = P.openKeyCursor(), N = [];
|
|
19364
19360
|
B.onsuccess = function() {
|
|
19365
|
-
var
|
|
19366
|
-
if (
|
|
19361
|
+
var $ = B.result;
|
|
19362
|
+
if (!$) {
|
|
19367
19363
|
A(N);
|
|
19368
19364
|
return;
|
|
19369
19365
|
}
|
|
19370
|
-
N.push(
|
|
19366
|
+
N.push($.key), $.continue();
|
|
19371
19367
|
}, B.onerror = function() {
|
|
19372
19368
|
k(B.error);
|
|
19373
19369
|
};
|
|
19374
|
-
} catch (
|
|
19375
|
-
k(
|
|
19370
|
+
} catch ($) {
|
|
19371
|
+
k($);
|
|
19376
19372
|
}
|
|
19377
19373
|
});
|
|
19378
19374
|
}).catch(k);
|
|
@@ -19387,22 +19383,22 @@ function Rg() {
|
|
|
19387
19383
|
if (!b.name)
|
|
19388
19384
|
k = d.reject("Invalid arguments");
|
|
19389
19385
|
else {
|
|
19390
|
-
var M = b.name === w.name && A._dbInfo.db, x = M ? d.resolve(A._dbInfo.db) :
|
|
19386
|
+
var M = b.name === w.name && A._dbInfo.db, x = M ? d.resolve(A._dbInfo.db) : Q(b).then(function(P) {
|
|
19391
19387
|
var B = v[b.name], N = B.forages;
|
|
19392
19388
|
B.db = P;
|
|
19393
|
-
for (var
|
|
19394
|
-
N[
|
|
19389
|
+
for (var $ = 0; $ < N.length; $++)
|
|
19390
|
+
N[$]._dbInfo.db = P;
|
|
19395
19391
|
return P;
|
|
19396
19392
|
});
|
|
19397
19393
|
b.storeName ? k = x.then(function(P) {
|
|
19398
19394
|
if (P.objectStoreNames.contains(b.storeName)) {
|
|
19399
19395
|
var B = P.version + 1;
|
|
19400
19396
|
q(b);
|
|
19401
|
-
var N = v[b.name],
|
|
19397
|
+
var N = v[b.name], $ = N.forages;
|
|
19402
19398
|
P.close();
|
|
19403
|
-
for (var V = 0; V <
|
|
19404
|
-
var
|
|
19405
|
-
|
|
19399
|
+
for (var V = 0; V < $.length; V++) {
|
|
19400
|
+
var te = $[V];
|
|
19401
|
+
te._dbInfo.db = null, te._dbInfo.version = B;
|
|
19406
19402
|
}
|
|
19407
19403
|
var ie = new d(function(ne, ve) {
|
|
19408
19404
|
var pe = c.open(b.name, B);
|
|
@@ -19419,9 +19415,9 @@ function Rg() {
|
|
|
19419
19415
|
});
|
|
19420
19416
|
return ie.then(function(ne) {
|
|
19421
19417
|
N.db = ne;
|
|
19422
|
-
for (var ve = 0; ve <
|
|
19423
|
-
var pe =
|
|
19424
|
-
pe._dbInfo.db = ne,
|
|
19418
|
+
for (var ve = 0; ve < $.length; ve++) {
|
|
19419
|
+
var pe = $[ve];
|
|
19420
|
+
pe._dbInfo.db = ne, O(pe._dbInfo);
|
|
19425
19421
|
}
|
|
19426
19422
|
}).catch(function(ne) {
|
|
19427
19423
|
throw (W(b, ne) || d.resolve()).catch(function() {
|
|
@@ -19432,11 +19428,11 @@ function Rg() {
|
|
|
19432
19428
|
q(b);
|
|
19433
19429
|
var B = v[b.name], N = B.forages;
|
|
19434
19430
|
P.close();
|
|
19435
|
-
for (var
|
|
19436
|
-
var V = N[
|
|
19431
|
+
for (var $ = 0; $ < N.length; $++) {
|
|
19432
|
+
var V = N[$];
|
|
19437
19433
|
V._dbInfo.db = null;
|
|
19438
19434
|
}
|
|
19439
|
-
var
|
|
19435
|
+
var te = new d(function(ie, ne) {
|
|
19440
19436
|
var ve = c.deleteDatabase(b.name);
|
|
19441
19437
|
ve.onerror = function() {
|
|
19442
19438
|
var pe = ve.result;
|
|
@@ -19448,11 +19444,11 @@ function Rg() {
|
|
|
19448
19444
|
pe && pe.close(), ie(pe);
|
|
19449
19445
|
};
|
|
19450
19446
|
});
|
|
19451
|
-
return
|
|
19447
|
+
return te.then(function(ie) {
|
|
19452
19448
|
B.db = ie;
|
|
19453
19449
|
for (var ne = 0; ne < N.length; ne++) {
|
|
19454
19450
|
var ve = N[ne];
|
|
19455
|
-
|
|
19451
|
+
O(ve._dbInfo);
|
|
19456
19452
|
}
|
|
19457
19453
|
}).catch(function(ie) {
|
|
19458
19454
|
throw (W(b, ie) || d.resolve()).catch(function() {
|
|
@@ -19483,9 +19479,9 @@ function Rg() {
|
|
|
19483
19479
|
function Ba(b) {
|
|
19484
19480
|
var C = b.length * 0.75, w = b.length, A, k = 0, M, x, P, B;
|
|
19485
19481
|
b[b.length - 1] === "=" && (C--, b[b.length - 2] === "=" && C--);
|
|
19486
|
-
var N = new ArrayBuffer(C),
|
|
19482
|
+
var N = new ArrayBuffer(C), $ = new Uint8Array(N);
|
|
19487
19483
|
for (A = 0; A < w; A += 4)
|
|
19488
|
-
M = Xe.indexOf(b[A]), x = Xe.indexOf(b[A + 1]), P = Xe.indexOf(b[A + 2]), B = Xe.indexOf(b[A + 3]),
|
|
19484
|
+
M = Xe.indexOf(b[A]), x = Xe.indexOf(b[A + 1]), P = Xe.indexOf(b[A + 2]), B = Xe.indexOf(b[A + 3]), $[k++] = M << 2 | x >> 4, $[k++] = (x & 15) << 4 | P >> 2, $[k++] = (P & 3) << 6 | B & 63;
|
|
19489
19485
|
return N;
|
|
19490
19486
|
}
|
|
19491
19487
|
function Ki(b) {
|
|
@@ -19597,8 +19593,8 @@ function Rg() {
|
|
|
19597
19593
|
var x = w._dbInfo;
|
|
19598
19594
|
x.db.transaction(function(P) {
|
|
19599
19595
|
Je(P, x, "SELECT * FROM " + x.storeName + " WHERE key = ? LIMIT 1", [b], function(B, N) {
|
|
19600
|
-
var
|
|
19601
|
-
|
|
19596
|
+
var $ = N.rows.length ? N.rows.item(0).value : null;
|
|
19597
|
+
$ && ($ = x.serializer.deserialize($)), k($);
|
|
19602
19598
|
}, function(B, N) {
|
|
19603
19599
|
M(N);
|
|
19604
19600
|
});
|
|
@@ -19613,9 +19609,9 @@ function Rg() {
|
|
|
19613
19609
|
var x = w._dbInfo;
|
|
19614
19610
|
x.db.transaction(function(P) {
|
|
19615
19611
|
Je(P, x, "SELECT * FROM " + x.storeName, [], function(B, N) {
|
|
19616
|
-
for (var
|
|
19617
|
-
var ie =
|
|
19618
|
-
if (ne && (ne = x.serializer.deserialize(ne)), ne = b(ne, ie.key,
|
|
19612
|
+
for (var $ = N.rows, V = $.length, te = 0; te < V; te++) {
|
|
19613
|
+
var ie = $.item(te), ne = ie.value;
|
|
19614
|
+
if (ne && (ne = x.serializer.deserialize(ne)), ne = b(ne, ie.key, te + 1), ne !== void 0) {
|
|
19619
19615
|
k(ne);
|
|
19620
19616
|
return;
|
|
19621
19617
|
}
|
|
@@ -19636,20 +19632,20 @@ function Rg() {
|
|
|
19636
19632
|
k.ready().then(function() {
|
|
19637
19633
|
C === void 0 && (C = null);
|
|
19638
19634
|
var B = C, N = k._dbInfo;
|
|
19639
|
-
N.serializer.serialize(C, function(
|
|
19640
|
-
V ? P(V) : N.db.transaction(function(
|
|
19641
|
-
Je(
|
|
19635
|
+
N.serializer.serialize(C, function($, V) {
|
|
19636
|
+
V ? P(V) : N.db.transaction(function(te) {
|
|
19637
|
+
Je(te, N, "INSERT OR REPLACE INTO " + N.storeName + " (key, value) VALUES (?, ?)", [b, $], function() {
|
|
19642
19638
|
x(B);
|
|
19643
19639
|
}, function(ie, ne) {
|
|
19644
19640
|
P(ne);
|
|
19645
19641
|
});
|
|
19646
|
-
}, function(
|
|
19647
|
-
if (
|
|
19642
|
+
}, function(te) {
|
|
19643
|
+
if (te.code === te.QUOTA_ERR) {
|
|
19648
19644
|
if (A > 0) {
|
|
19649
19645
|
x(Fa.apply(k, [b, B, w, A - 1]));
|
|
19650
19646
|
return;
|
|
19651
19647
|
}
|
|
19652
|
-
P(
|
|
19648
|
+
P(te);
|
|
19653
19649
|
}
|
|
19654
19650
|
});
|
|
19655
19651
|
});
|
|
@@ -19714,8 +19710,8 @@ function Rg() {
|
|
|
19714
19710
|
var x = w._dbInfo;
|
|
19715
19711
|
x.db.transaction(function(P) {
|
|
19716
19712
|
Je(P, x, "SELECT key FROM " + x.storeName + " WHERE id = ? LIMIT 1", [b + 1], function(B, N) {
|
|
19717
|
-
var
|
|
19718
|
-
k(
|
|
19713
|
+
var $ = N.rows.length ? N.rows.item(0).key : null;
|
|
19714
|
+
k($);
|
|
19719
19715
|
}, function(B, N) {
|
|
19720
19716
|
M(N);
|
|
19721
19717
|
});
|
|
@@ -19730,8 +19726,8 @@ function Rg() {
|
|
|
19730
19726
|
var M = C._dbInfo;
|
|
19731
19727
|
M.db.transaction(function(x) {
|
|
19732
19728
|
Je(x, M, "SELECT key FROM " + M.storeName, [], function(P, B) {
|
|
19733
|
-
for (var N = [],
|
|
19734
|
-
N.push(B.rows.item(
|
|
19729
|
+
for (var N = [], $ = 0; $ < B.rows.length; $++)
|
|
19730
|
+
N.push(B.rows.item($).key);
|
|
19735
19731
|
A(N);
|
|
19736
19732
|
}, function(P, B) {
|
|
19737
19733
|
k(B);
|
|
@@ -19782,9 +19778,9 @@ function Rg() {
|
|
|
19782
19778
|
});
|
|
19783
19779
|
});
|
|
19784
19780
|
}
|
|
19785
|
-
for (var
|
|
19786
|
-
|
|
19787
|
-
d.all(
|
|
19781
|
+
for (var $ = [], V = 0, te = M.storeNames.length; V < te; V++)
|
|
19782
|
+
$.push(N(M.storeNames[V]));
|
|
19783
|
+
d.all($).then(function() {
|
|
19788
19784
|
x();
|
|
19789
19785
|
}).catch(function(ie) {
|
|
19790
19786
|
P(ie);
|
|
@@ -19860,10 +19856,10 @@ function Rg() {
|
|
|
19860
19856
|
function Yc(b, C) {
|
|
19861
19857
|
var w = this, A = w.ready().then(function() {
|
|
19862
19858
|
for (var k = w._dbInfo, M = k.keyPrefix, x = M.length, P = localStorage.length, B = 1, N = 0; N < P; N++) {
|
|
19863
|
-
var
|
|
19864
|
-
if (
|
|
19865
|
-
var V = localStorage.getItem(
|
|
19866
|
-
if (V && (V = k.serializer.deserialize(V)), V = b(V,
|
|
19859
|
+
var $ = localStorage.key(N);
|
|
19860
|
+
if ($.indexOf(M) === 0) {
|
|
19861
|
+
var V = localStorage.getItem($);
|
|
19862
|
+
if (V && (V = k.serializer.deserialize(V)), V = b(V, $.substring(x), B++), V !== void 0)
|
|
19867
19863
|
return V;
|
|
19868
19864
|
}
|
|
19869
19865
|
}
|
|
@@ -19915,9 +19911,9 @@ function Rg() {
|
|
|
19915
19911
|
var M = C;
|
|
19916
19912
|
return new d(function(x, P) {
|
|
19917
19913
|
var B = A._dbInfo;
|
|
19918
|
-
B.serializer.serialize(C, function(N,
|
|
19919
|
-
if (
|
|
19920
|
-
P(
|
|
19914
|
+
B.serializer.serialize(C, function(N, $) {
|
|
19915
|
+
if ($)
|
|
19916
|
+
P($);
|
|
19921
19917
|
else
|
|
19922
19918
|
try {
|
|
19923
19919
|
localStorage.setItem(B.keyPrefix + b, N), x(M);
|
|
@@ -20029,8 +20025,8 @@ function Rg() {
|
|
|
20029
20025
|
P(N);
|
|
20030
20026
|
return;
|
|
20031
20027
|
}
|
|
20032
|
-
for (var
|
|
20033
|
-
var ie =
|
|
20028
|
+
for (var $ = Zi.concat("_initStorage"), V = 0, te = $.length; V < te; V++) {
|
|
20029
|
+
var ie = $[V], ne = !al(ti, ie);
|
|
20034
20030
|
if ((ne || w[ie]) && typeof w[ie] != "function") {
|
|
20035
20031
|
P(N);
|
|
20036
20032
|
return;
|
|
@@ -20082,11 +20078,11 @@ function Rg() {
|
|
|
20082
20078
|
}
|
|
20083
20079
|
function N(V) {
|
|
20084
20080
|
return function() {
|
|
20085
|
-
var
|
|
20081
|
+
var te = 0;
|
|
20086
20082
|
function ie() {
|
|
20087
|
-
for (;
|
|
20088
|
-
var ne = V[
|
|
20089
|
-
return
|
|
20083
|
+
for (; te < V.length; ) {
|
|
20084
|
+
var ne = V[te];
|
|
20085
|
+
return te++, M._dbInfo = null, M._ready = null, M.getDriver(ne).then(B).catch(ie);
|
|
20090
20086
|
}
|
|
20091
20087
|
P();
|
|
20092
20088
|
var ve = new Error("No available storage method found.");
|
|
@@ -20095,13 +20091,13 @@ function Rg() {
|
|
|
20095
20091
|
return ie();
|
|
20096
20092
|
};
|
|
20097
20093
|
}
|
|
20098
|
-
var
|
|
20094
|
+
var $ = this._driverSet !== null ? this._driverSet.catch(function() {
|
|
20099
20095
|
return d.resolve();
|
|
20100
20096
|
}) : d.resolve();
|
|
20101
|
-
return this._driverSet =
|
|
20097
|
+
return this._driverSet = $.then(function() {
|
|
20102
20098
|
var V = x[0];
|
|
20103
|
-
return M._dbInfo = null, M._ready = null, M.getDriver(V).then(function(
|
|
20104
|
-
M._driver =
|
|
20099
|
+
return M._dbInfo = null, M._ready = null, M.getDriver(V).then(function(te) {
|
|
20100
|
+
M._driver = te._driver, P(), M._wrapLibraryMethodsWithReady(), M._initDriver = N(x);
|
|
20105
20101
|
});
|
|
20106
20102
|
}).catch(function() {
|
|
20107
20103
|
P();
|
|
@@ -23420,23 +23416,23 @@ class fp {
|
|
|
23420
23416
|
*/
|
|
23421
23417
|
static generate(e, t, i) {
|
|
23422
23418
|
Eo();
|
|
23423
|
-
const n = new Ue(e), a = Y.getInstance(), r = a.get("appearance.bodyTypes"), o = a.getWeights("appearance.bodyTypes"), c = a.getMode("appearance.bodyTypes") || "default", l = a.get("appearance.skinTones"), u = a.getWeights("appearance.skinTones"), d = a.getMode("appearance.skinTones") || "default", h = a.get("appearance.hairStyles"), m = a.getWeights("appearance.hairStyles"), f = a.getMode("appearance.hairStyles") || "default", g = a.get("appearance.hairColors"), p = a.getWeights("appearance.hairColors"), y = a.getMode("appearance.hairColors") || "default", v = a.get("appearance.eyeColors"), S = a.getWeights("appearance.eyeColors"), T = a.getMode("appearance.eyeColors") || "default", _ = a.get("appearance.facialFeatures"), I = a.getWeights("appearance.facialFeatures"), D = a.getMode("appearance.facialFeatures") || "default", R = ze.select(r, o, n, c), q = ze.select(l, u, n, d),
|
|
23419
|
+
const n = new Ue(e), a = Y.getInstance(), r = a.get("appearance.bodyTypes"), o = a.getWeights("appearance.bodyTypes"), c = a.getMode("appearance.bodyTypes") || "default", l = a.get("appearance.skinTones"), u = a.getWeights("appearance.skinTones"), d = a.getMode("appearance.skinTones") || "default", h = a.get("appearance.hairStyles"), m = a.getWeights("appearance.hairStyles"), f = a.getMode("appearance.hairStyles") || "default", g = a.get("appearance.hairColors"), p = a.getWeights("appearance.hairColors"), y = a.getMode("appearance.hairColors") || "default", v = a.get("appearance.eyeColors"), S = a.getWeights("appearance.eyeColors"), T = a.getMode("appearance.eyeColors") || "default", _ = a.get("appearance.facialFeatures"), I = a.getWeights("appearance.facialFeatures"), D = a.getMode("appearance.facialFeatures") || "default", R = ze.select(r, o, n, c), q = ze.select(l, u, n, d), O = ze.select(h, m, n, f), W = ze.select(g, p, n, y), Z = ze.select(v, S, n, T), Q = n.randomInt(1, 4), se = ze.selectMultiple(
|
|
23424
23420
|
_,
|
|
23425
23421
|
I,
|
|
23426
23422
|
n,
|
|
23427
|
-
|
|
23423
|
+
Q,
|
|
23428
23424
|
D
|
|
23429
|
-
), oe = i.color_palette, j = oe?.primary_color,
|
|
23425
|
+
), oe = i.color_palette, j = oe?.primary_color, X = oe?.secondary_color, fe = oe?.accent_color;
|
|
23430
23426
|
let ge;
|
|
23431
23427
|
return mp.includes(t) && (ge = this.generateAuraColor(t, oe?.primary_color)), {
|
|
23432
23428
|
body_type: R,
|
|
23433
23429
|
skin_tone: q,
|
|
23434
|
-
hair_style:
|
|
23430
|
+
hair_style: O,
|
|
23435
23431
|
hair_color: W,
|
|
23436
|
-
eye_color:
|
|
23432
|
+
eye_color: Z,
|
|
23437
23433
|
facial_features: se,
|
|
23438
23434
|
primary_color: j,
|
|
23439
|
-
secondary_color:
|
|
23435
|
+
secondary_color: X,
|
|
23440
23436
|
accent_color: fe,
|
|
23441
23437
|
aura_color: ge
|
|
23442
23438
|
};
|
|
@@ -24937,19 +24933,19 @@ class la {
|
|
|
24937
24933
|
if (n.forceRace)
|
|
24938
24934
|
l = u, d = n.forceRace;
|
|
24939
24935
|
else {
|
|
24940
|
-
const
|
|
24941
|
-
if (!
|
|
24936
|
+
const J = c.getRaceForSubrace(u);
|
|
24937
|
+
if (!J)
|
|
24942
24938
|
throw new Error(
|
|
24943
24939
|
`Cannot determine race for subrace "${u}". Either specify forceRace or ensure the subrace is registered in racial traits. Example: { forceRace: 'Elf', subrace: 'High Elf' }`
|
|
24944
24940
|
);
|
|
24945
|
-
d =
|
|
24941
|
+
d = J, l = u;
|
|
24946
24942
|
}
|
|
24947
24943
|
const h = d || dp.select(a);
|
|
24948
24944
|
if (l !== void 0 && u !== "pure") {
|
|
24949
|
-
const
|
|
24950
|
-
if (!
|
|
24945
|
+
const J = c.getAvailableSubraces(h);
|
|
24946
|
+
if (!J.includes(l))
|
|
24951
24947
|
throw new Error(
|
|
24952
|
-
`Invalid subrace "${l}" for race "${h}". Available subraces: ${
|
|
24948
|
+
`Invalid subrace "${l}" for race "${h}". Available subraces: ${J.length > 0 ? J.join(", ") : "none"}`
|
|
24953
24949
|
);
|
|
24954
24950
|
} else if (l === void 0 && u === void 0) {
|
|
24955
24951
|
const le = ["pure", ...c.getAvailableSubraces(h)], dt = a.randomChoice(le);
|
|
@@ -24964,14 +24960,14 @@ class la {
|
|
|
24964
24960
|
), g = gn.calculateBaseScores(t, a), p = gn.applyRacialBonuses(g, h), y = gn.calculateModifiers(p), v = zr(m);
|
|
24965
24961
|
if (!v)
|
|
24966
24962
|
throw new Error(`Unknown class: ${m}. Cannot generate character.`);
|
|
24967
|
-
const T = Zn(h)?.speed ?? 30, _ = v.hit_die + y.CON, I = 10 + y.DEX, D = y.DEX, R = Lr[r], q = hp.assignSkills(m, a),
|
|
24963
|
+
const T = Zn(h)?.speed ?? 30, _ = v.hit_die + y.CON, I = 10 + y.DEX, D = y.DEX, R = Lr[r], q = hp.assignSkills(m, a), O = {
|
|
24968
24964
|
STR: v.saving_throws.includes("STR"),
|
|
24969
24965
|
DEX: v.saving_throws.includes("DEX"),
|
|
24970
24966
|
CON: v.saving_throws.includes("CON"),
|
|
24971
24967
|
INT: v.saving_throws.includes("INT"),
|
|
24972
24968
|
WIS: v.saving_throws.includes("WIS"),
|
|
24973
24969
|
CHA: v.saving_throws.includes("CHA")
|
|
24974
|
-
}, W = fp.generate(e, m, t),
|
|
24970
|
+
}, W = fp.generate(e, m, t), Z = c.getClassFeatures(m, r), Q = l ? c.getRacialTraitsForSubrace(h, l) : c.getBaseRacialTraits(h), se = Pi.initializeEquipment(m), oe = {
|
|
24975
24971
|
name: f,
|
|
24976
24972
|
race: h,
|
|
24977
24973
|
subrace: l,
|
|
@@ -24986,7 +24982,7 @@ class la {
|
|
|
24986
24982
|
initiative: D,
|
|
24987
24983
|
speed: T,
|
|
24988
24984
|
skills: q,
|
|
24989
|
-
saving_throws:
|
|
24985
|
+
saving_throws: O,
|
|
24990
24986
|
racial_traits: [],
|
|
24991
24987
|
// Empty for now, will populate after validation
|
|
24992
24988
|
class_features: [],
|
|
@@ -25003,15 +24999,15 @@ class la {
|
|
|
25003
24999
|
seed: e,
|
|
25004
25000
|
generated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
25005
25001
|
gameMode: o
|
|
25006
|
-
}, j = er.initializeSpells(m, r, oe),
|
|
25007
|
-
for (const
|
|
25008
|
-
const le = c.validatePrerequisites(
|
|
25009
|
-
le.valid || console.warn(`Feature "${
|
|
25002
|
+
}, j = er.initializeSpells(m, r, oe), X = [];
|
|
25003
|
+
for (const J of Z) {
|
|
25004
|
+
const le = c.validatePrerequisites(J, oe);
|
|
25005
|
+
le.valid || console.warn(`Feature "${J.name}" (${J.id}) failed prerequisite validation:`, le.errors), X.push(J);
|
|
25010
25006
|
}
|
|
25011
25007
|
const fe = [];
|
|
25012
|
-
for (const
|
|
25013
|
-
const le = c.validatePrerequisites(
|
|
25014
|
-
le.valid || console.warn(`Trait "${
|
|
25008
|
+
for (const J of Q) {
|
|
25009
|
+
const le = c.validatePrerequisites(J, oe);
|
|
25010
|
+
le.valid || console.warn(`Trait "${J.name}" (${J.id}) failed prerequisite validation:`, le.errors), fe.push(J);
|
|
25015
25011
|
}
|
|
25016
25012
|
const ge = {
|
|
25017
25013
|
name: f,
|
|
@@ -25032,9 +25028,9 @@ class la {
|
|
|
25032
25028
|
initiative: D,
|
|
25033
25029
|
speed: T,
|
|
25034
25030
|
skills: q,
|
|
25035
|
-
saving_throws:
|
|
25036
|
-
racial_traits: fe.map((
|
|
25037
|
-
class_features:
|
|
25031
|
+
saving_throws: O,
|
|
25032
|
+
racial_traits: fe.map((J) => J.id),
|
|
25033
|
+
class_features: X.map((J) => J.id),
|
|
25038
25034
|
appearance: W,
|
|
25039
25035
|
spells: j,
|
|
25040
25036
|
equipment: se,
|
|
@@ -25046,13 +25042,13 @@ class la {
|
|
|
25046
25042
|
generated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
25047
25043
|
gameMode: o
|
|
25048
25044
|
};
|
|
25049
|
-
if (Bi.applyMultipleEffects(ge, fe), Bi.applyMultipleEffects(ge,
|
|
25050
|
-
const
|
|
25045
|
+
if (Bi.applyMultipleEffects(ge, fe), Bi.applyMultipleEffects(ge, X), se) {
|
|
25046
|
+
const J = [
|
|
25051
25047
|
...se.weapons.filter((le) => le.equipped),
|
|
25052
25048
|
...se.armor.filter((le) => le.equipped),
|
|
25053
25049
|
...se.items.filter((le) => le.equipped)
|
|
25054
25050
|
];
|
|
25055
|
-
for (const le of
|
|
25051
|
+
for (const le of J) {
|
|
25056
25052
|
const dt = Pi.getEquipmentDataStatic(le.name);
|
|
25057
25053
|
if (dt) {
|
|
25058
25054
|
const Gi = le.instanceId;
|
|
@@ -28099,11 +28095,11 @@ class Gn {
|
|
|
28099
28095
|
y.push(R);
|
|
28100
28096
|
continue;
|
|
28101
28097
|
}
|
|
28102
|
-
const q = o?.get(R.beatIndex),
|
|
28103
|
-
if (
|
|
28104
|
-
if (y.push(
|
|
28098
|
+
const q = o?.get(R.beatIndex), O = this.convertBeatGridType(R, t, i, r, q, f);
|
|
28099
|
+
if (O)
|
|
28100
|
+
if (y.push(O), R.gridType === "straight_16th") {
|
|
28105
28101
|
if (d.sixteenthToEighth++, this.config.logConversions) {
|
|
28106
|
-
const W =
|
|
28102
|
+
const W = O.gridType === "straight_4th" ? "quarter" : "8th";
|
|
28107
28103
|
console.log(
|
|
28108
28104
|
`[DifficultyVariantGenerator] Converted 16th note at beat ${R.beatIndex} position ${R.gridPosition} to ${W} note`
|
|
28109
28105
|
);
|
|
@@ -28483,20 +28479,20 @@ class Gn {
|
|
|
28483
28479
|
const I = T === f;
|
|
28484
28480
|
let D, R, q = !1;
|
|
28485
28481
|
T === 1 ? (D = 1 - this.config.densityReductionMinIntensity, R = this.config.moderateSimplificationIntensityThreshold) : T === 2 ? (D = 1 - this.config.densityReductionMinIntensity - 0.15, R = this.config.moderateSimplificationIntensityThreshold - 0.1) : (q = !0, D = 0, R = 0);
|
|
28486
|
-
for (const { beat:
|
|
28487
|
-
if (!h.has(
|
|
28482
|
+
for (const { beat: O, priority: W } of d)
|
|
28483
|
+
if (!h.has(O)) {
|
|
28488
28484
|
if (r !== void 0) {
|
|
28489
28485
|
if (m - 1 <= r)
|
|
28490
28486
|
break;
|
|
28491
28487
|
} else if ((m - 1) / o <= c.max)
|
|
28492
28488
|
break;
|
|
28493
28489
|
if (q) {
|
|
28494
|
-
if (this.isStrongBeat(
|
|
28490
|
+
if (this.isStrongBeat(O.beatIndex))
|
|
28495
28491
|
continue;
|
|
28496
|
-
} else if (W >= D ||
|
|
28492
|
+
} else if (W >= D || O.intensity >= R)
|
|
28497
28493
|
continue;
|
|
28498
|
-
h.add(
|
|
28499
|
-
`[DifficultyVariantGenerator] Pass ${T}: Removed beat at index ${
|
|
28494
|
+
h.add(O), m--, _++, this.config.logConversions && console.log(
|
|
28495
|
+
`[DifficultyVariantGenerator] Pass ${T}: Removed beat at index ${O.beatIndex} position ${O.gridPosition} (priority: ${W.toFixed(2)}, intensity: ${O.intensity.toFixed(2)})`
|
|
28500
28496
|
);
|
|
28501
28497
|
}
|
|
28502
28498
|
if (this.config.logConversions && console.log(
|
|
@@ -28728,27 +28724,27 @@ class Gn {
|
|
|
28728
28724
|
patternsInserted: 0,
|
|
28729
28725
|
interpolatedBeats: 0,
|
|
28730
28726
|
insertedPatternIds: []
|
|
28731
|
-
}, m = (
|
|
28727
|
+
}, m = (O) => {
|
|
28732
28728
|
if (l) {
|
|
28733
|
-
if (l.includes(
|
|
28734
|
-
const W = ["straight_16th", "triplet_8th", "straight_8th", "quarter_triplet", "straight_4th"],
|
|
28735
|
-
for (let
|
|
28736
|
-
if (l.includes(W[
|
|
28737
|
-
return l[l.length - 1] ??
|
|
28729
|
+
if (l.includes(O)) return O;
|
|
28730
|
+
const W = ["straight_16th", "triplet_8th", "straight_8th", "quarter_triplet", "straight_4th"], Z = W.indexOf(O);
|
|
28731
|
+
for (let Q = Z + 1; Q < W.length; Q++)
|
|
28732
|
+
if (l.includes(W[Q])) return W[Q];
|
|
28733
|
+
return l[l.length - 1] ?? O;
|
|
28738
28734
|
}
|
|
28739
|
-
return qn(
|
|
28735
|
+
return qn(O, t, i);
|
|
28740
28736
|
};
|
|
28741
28737
|
if (e.length === 0)
|
|
28742
28738
|
return h.totalBeatsAfter = 0, { beats: [], metadata: h };
|
|
28743
28739
|
let f = c ? e : this.enforceSingleGridPerBeat(e);
|
|
28744
28740
|
if (l && f.some((W) => !l.includes(W.gridType))) {
|
|
28745
28741
|
const W = [];
|
|
28746
|
-
for (const
|
|
28747
|
-
if (l.includes(
|
|
28748
|
-
W.push(
|
|
28742
|
+
for (const Q of f)
|
|
28743
|
+
if (l.includes(Q.gridType))
|
|
28744
|
+
W.push(Q);
|
|
28749
28745
|
else {
|
|
28750
28746
|
const se = this.convertBeatGridType(
|
|
28751
|
-
|
|
28747
|
+
Q,
|
|
28752
28748
|
t,
|
|
28753
28749
|
o,
|
|
28754
28750
|
i,
|
|
@@ -28764,8 +28760,8 @@ class Gn {
|
|
|
28764
28760
|
const g = this.groupBeatsByIndex(f), p = Math.max(...Array.from(g.keys()));
|
|
28765
28761
|
let y;
|
|
28766
28762
|
if (u !== void 0) {
|
|
28767
|
-
const
|
|
28768
|
-
y = Math.max(0,
|
|
28763
|
+
const O = Math.round(u * d);
|
|
28764
|
+
y = Math.max(0, O - f.length);
|
|
28769
28765
|
const W = Math.max(0, 3 * f.length);
|
|
28770
28766
|
y = Math.min(y, W);
|
|
28771
28767
|
} else
|
|
@@ -28783,66 +28779,66 @@ class Gn {
|
|
|
28783
28779
|
v,
|
|
28784
28780
|
l
|
|
28785
28781
|
// Pass through for max beats per index calculation
|
|
28786
|
-
), T = [], _ = /* @__PURE__ */ new Map(), I = (
|
|
28787
|
-
for (const
|
|
28788
|
-
const W = I(
|
|
28789
|
-
_.has(W) || _.set(W,
|
|
28790
|
-
}
|
|
28791
|
-
for (let
|
|
28792
|
-
const W = g.get(
|
|
28793
|
-
if (W.length >=
|
|
28782
|
+
), T = [], _ = /* @__PURE__ */ new Map(), I = (O, W) => `${O}:${W}`;
|
|
28783
|
+
for (const O of f) {
|
|
28784
|
+
const W = I(O.beatIndex, O.gridPosition);
|
|
28785
|
+
_.has(W) || _.set(W, O.gridType);
|
|
28786
|
+
}
|
|
28787
|
+
for (let O = 0; O <= p; O++) {
|
|
28788
|
+
const W = g.get(O) ?? [], Z = S.get(O) ?? 0;
|
|
28789
|
+
if (W.length >= Z) {
|
|
28794
28790
|
T.push(...W);
|
|
28795
28791
|
continue;
|
|
28796
28792
|
}
|
|
28797
|
-
const
|
|
28793
|
+
const Q = Z - W.length;
|
|
28798
28794
|
if (W.length === 0) {
|
|
28799
|
-
const
|
|
28800
|
-
|
|
28801
|
-
|
|
28795
|
+
const X = c?.get(O), fe = X ? m(X) : void 0, ge = this.createBeatsForEmptyIndex(
|
|
28796
|
+
O,
|
|
28797
|
+
Q,
|
|
28802
28798
|
n,
|
|
28803
28799
|
r,
|
|
28804
28800
|
o,
|
|
28805
28801
|
g,
|
|
28806
28802
|
_,
|
|
28807
28803
|
fe
|
|
28808
|
-
), Qt = fe ?? this.getGridForBeatIndex(
|
|
28809
|
-
for (const
|
|
28810
|
-
const le = I(
|
|
28811
|
-
!_.has(le) &&
|
|
28804
|
+
), Qt = fe ?? this.getGridForBeatIndex(O, ge, r);
|
|
28805
|
+
for (const J of ge) {
|
|
28806
|
+
const le = I(J.beatIndex, J.gridPosition);
|
|
28807
|
+
!_.has(le) && J.gridType === Qt && (_.set(le, J.gridType), T.push(J), h.interpolatedBeats++);
|
|
28812
28808
|
}
|
|
28813
28809
|
continue;
|
|
28814
28810
|
}
|
|
28815
|
-
const se = c?.get(
|
|
28811
|
+
const se = c?.get(O) ?? W[0].gridType, oe = m(se);
|
|
28816
28812
|
let j = 0;
|
|
28817
28813
|
if (this.config.preferPatternInsertion && a) {
|
|
28818
|
-
const
|
|
28814
|
+
const X = this.tryInsertPattern(
|
|
28819
28815
|
W,
|
|
28820
|
-
|
|
28821
|
-
|
|
28816
|
+
O,
|
|
28817
|
+
Q,
|
|
28822
28818
|
a,
|
|
28823
28819
|
_,
|
|
28824
28820
|
oe
|
|
28825
28821
|
);
|
|
28826
|
-
j =
|
|
28822
|
+
j = X.beatsAdded, X.patternId && (h.patternsInserted++, h.insertedPatternIds.push(X.patternId));
|
|
28827
28823
|
}
|
|
28828
|
-
if (j <
|
|
28829
|
-
const
|
|
28824
|
+
if (j < Q) {
|
|
28825
|
+
const X = this.interpolateBeats(
|
|
28830
28826
|
W,
|
|
28831
|
-
|
|
28832
|
-
|
|
28827
|
+
O,
|
|
28828
|
+
Q - j,
|
|
28833
28829
|
o,
|
|
28834
28830
|
_,
|
|
28835
28831
|
oe,
|
|
28836
28832
|
n
|
|
28837
28833
|
);
|
|
28838
|
-
for (const fe of
|
|
28834
|
+
for (const fe of X) {
|
|
28839
28835
|
const ge = I(fe.beatIndex, fe.gridPosition);
|
|
28840
28836
|
_.has(ge) || (_.set(ge, fe.gridType), T.push(fe), h.interpolatedBeats++);
|
|
28841
28837
|
}
|
|
28842
28838
|
}
|
|
28843
28839
|
T.push(...W);
|
|
28844
28840
|
}
|
|
28845
|
-
const D = T.sort((
|
|
28841
|
+
const D = T.sort((O, W) => O.beatIndex !== W.beatIndex ? O.beatIndex - W.beatIndex : O.gridPosition - W.gridPosition);
|
|
28846
28842
|
let R;
|
|
28847
28843
|
c ? (this.validateSingleGridPerBeat(D).isValid, R = D) : R = this.enforceSingleGridPerBeat(D);
|
|
28848
28844
|
const q = this.deduplicateEnhancedBeats(R);
|
|
@@ -35680,6 +35676,7 @@ class C0 {
|
|
|
35680
35676
|
playlist_type: e.playlist_type,
|
|
35681
35677
|
original_playlist_tx_id: e.original_playlist_tx_id,
|
|
35682
35678
|
playlist_artist: e.playlist_artist,
|
|
35679
|
+
platform: e.platform,
|
|
35683
35680
|
tracks: u
|
|
35684
35681
|
};
|
|
35685
35682
|
}
|
|
@@ -35698,26 +35695,26 @@ class C0 {
|
|
|
35698
35695
|
* See specs/001-core-engine/SPEC.md
|
|
35699
35696
|
*/
|
|
35700
35697
|
async parseTrack(e, t) {
|
|
35701
|
-
const i =
|
|
35698
|
+
const i = ee.parseMetadata(e.metadata);
|
|
35702
35699
|
if (!i && this.options.strict)
|
|
35703
35700
|
throw new Error(`Failed to parse metadata for track at index ${t}`);
|
|
35704
|
-
const n = e.chain_name, a = e.token_address, r = e.token_id, o = e.tx_id, c = e.platform, l = e.id || (n === "AR" ? `AR-${o}` : `${n}-${a}-${r}`), u = e.uuid || Vy(), d =
|
|
35705
|
-
if (!
|
|
35701
|
+
const n = e.chain_name, a = e.token_address, r = e.token_id, o = e.tx_id, c = e.platform, l = e.id || (n === "AR" ? `AR-${o}` : `${n}-${a}-${r}`), u = e.uuid || Vy(), d = ee.extractTitle(i || {}), h = ee.extractArtist(i || {}), f = typeof e.artwork_url == "string" && e.artwork_url || typeof e.image_url == "string" && e.image_url || null || ee.extractImageUrl(i || {}), g = ee.extractImageThumbUrl(i || {}), y = typeof e.audio_url == "string" && e.audio_url || null || ee.extractAudioUrl(i || {}), v = ee.extractAudioUrlLossless(i || {});
|
|
35702
|
+
if (!y) {
|
|
35706
35703
|
if (this.options.strict)
|
|
35707
35704
|
throw new Error(`No audio URL found for track: ${d || l}`);
|
|
35708
35705
|
return console.warn(`Track ${l} has no audio URL - marked as Unsummonable`), null;
|
|
35709
35706
|
}
|
|
35710
|
-
if (this.options.validateAudioUrls && !await this.validateAudioUrl(
|
|
35707
|
+
if (this.options.validateAudioUrls && !await this.validateAudioUrl(y)) {
|
|
35711
35708
|
if (this.options.strict)
|
|
35712
35709
|
throw new Error(`Audio URL validation failed for track: ${d || l}`);
|
|
35713
35710
|
return console.warn(`Track ${l} has invalid audio URL - marked as Unsummonable`), null;
|
|
35714
35711
|
}
|
|
35715
|
-
if (!d || !h || !
|
|
35712
|
+
if (!d || !h || !f) {
|
|
35716
35713
|
if (this.options.strict)
|
|
35717
|
-
throw new Error(`Missing required fields for track: ${JSON.stringify({ title: d, artist: h, imageUrl:
|
|
35714
|
+
throw new Error(`Missing required fields for track: ${JSON.stringify({ title: d, artist: h, imageUrl: f })}`);
|
|
35718
35715
|
return null;
|
|
35719
35716
|
}
|
|
35720
|
-
const
|
|
35717
|
+
const S = typeof i?.description == "string" ? i.description : void 0, T = typeof i?.album == "string" ? i.album : void 0, _ = i?.duration ? Number(i.duration) : 0, I = ee.extractGenre(i || {}), D = i?.tags || [], R = i?.bpm ? Number(i.bpm) : void 0, q = typeof i?.key == "string" ? i.key : void 0, O = ee.convertAttributes(i?.attributes), W = zg(i || {}), Z = {
|
|
35721
35718
|
id: l,
|
|
35722
35719
|
uuid: u,
|
|
35723
35720
|
playlist_index: t,
|
|
@@ -35725,20 +35722,20 @@ class C0 {
|
|
|
35725
35722
|
platform: c,
|
|
35726
35723
|
title: d,
|
|
35727
35724
|
artist: h,
|
|
35728
|
-
description:
|
|
35729
|
-
album:
|
|
35730
|
-
image_url:
|
|
35731
|
-
audio_url:
|
|
35732
|
-
audio_url_lossless:
|
|
35733
|
-
duration:
|
|
35734
|
-
genre:
|
|
35735
|
-
tags: Array.isArray(
|
|
35736
|
-
bpm:
|
|
35737
|
-
key:
|
|
35738
|
-
attributes:
|
|
35739
|
-
extras:
|
|
35740
|
-
};
|
|
35741
|
-
return
|
|
35725
|
+
description: S,
|
|
35726
|
+
album: T,
|
|
35727
|
+
image_url: f,
|
|
35728
|
+
audio_url: y,
|
|
35729
|
+
audio_url_lossless: v && v !== y ? v : void 0,
|
|
35730
|
+
duration: _,
|
|
35731
|
+
genre: I,
|
|
35732
|
+
tags: Array.isArray(D) ? D.map((Q) => String(Q).toLowerCase()) : [],
|
|
35733
|
+
bpm: R,
|
|
35734
|
+
key: q,
|
|
35735
|
+
attributes: O || void 0,
|
|
35736
|
+
extras: W
|
|
35737
|
+
};
|
|
35738
|
+
return g && (Z.image_thumb_url = g), typeof i?.audio_ipfs_hash == "string" ? Z.audio_ipfs_hash = e.audio_ipfs_hash || i.audio_ipfs_hash : e.audio_ipfs_hash && (Z.audio_ipfs_hash = e.audio_ipfs_hash), typeof i?.artwork_ipfs_hash == "string" ? Z.artwork_ipfs_hash = e.artwork_ipfs_hash || i.artwork_ipfs_hash : e.artwork_ipfs_hash && (Z.artwork_ipfs_hash = e.artwork_ipfs_hash), n !== "AR" ? (Z.token_address = a, Z.token_id = r) : o && (Z.tx_id = o), Z;
|
|
35742
35739
|
}
|
|
35743
35740
|
/**
|
|
35744
35741
|
* Validate that an audio URL is accessible
|
|
@@ -47251,7 +47248,7 @@ class Ev {
|
|
|
47251
47248
|
return e;
|
|
47252
47249
|
}
|
|
47253
47250
|
}
|
|
47254
|
-
const
|
|
47251
|
+
const F = {
|
|
47255
47252
|
reset: "\x1B[0m",
|
|
47256
47253
|
bright: "\x1B[1m",
|
|
47257
47254
|
dim: "\x1B[2m",
|
|
@@ -47269,25 +47266,25 @@ function pa(s) {
|
|
|
47269
47266
|
return s.useColors === !1 ? !1 : typeof process < "u" && process.stdout?.isTTY === !0;
|
|
47270
47267
|
}
|
|
47271
47268
|
function H(s, e, t) {
|
|
47272
|
-
return t ? `${e}${s}${
|
|
47269
|
+
return t ? `${e}${s}${F.reset}` : s;
|
|
47273
47270
|
}
|
|
47274
47271
|
function xv(s, e) {
|
|
47275
47272
|
switch (s) {
|
|
47276
47273
|
case "healthy":
|
|
47277
|
-
return H("●",
|
|
47274
|
+
return H("●", F.green, e);
|
|
47278
47275
|
case "degraded":
|
|
47279
|
-
return H("●",
|
|
47276
|
+
return H("●", F.yellow, e);
|
|
47280
47277
|
case "failed":
|
|
47281
|
-
return H("●",
|
|
47278
|
+
return H("●", F.red, e);
|
|
47282
47279
|
default:
|
|
47283
|
-
return H("○",
|
|
47280
|
+
return H("○", F.dim, e);
|
|
47284
47281
|
}
|
|
47285
47282
|
}
|
|
47286
47283
|
function Rv(s, e) {
|
|
47287
|
-
return s ? H("✓ Granted",
|
|
47284
|
+
return s ? H("✓ Granted", F.green, e) : H("✗ Denied", F.red, e);
|
|
47288
47285
|
}
|
|
47289
47286
|
function Pv(s, e) {
|
|
47290
|
-
return s ? H("Available",
|
|
47287
|
+
return s ? H("Available", F.green, e) : H("Unavailable", F.red, e);
|
|
47291
47288
|
}
|
|
47292
47289
|
function ya(s) {
|
|
47293
47290
|
const e = new Date(s), t = e.getHours().toString().padStart(2, "0"), i = e.getMinutes().toString().padStart(2, "0"), n = e.getSeconds().toString().padStart(2, "0");
|
|
@@ -47303,7 +47300,7 @@ function wr(s, e) {
|
|
|
47303
47300
|
function Fi(s, e) {
|
|
47304
47301
|
const t = [], i = s.totalCalls > 0;
|
|
47305
47302
|
if (t.push(` Calls: ${s.totalCalls}`), t.push(` Success: ${i ? `${s.successRate.toFixed(1)}%` : "N/A"}`), i) {
|
|
47306
|
-
const n = s.average < 500 ?
|
|
47303
|
+
const n = s.average < 500 ? F.green : s.average < 1500 ? F.yellow : F.red;
|
|
47307
47304
|
t.push(` Avg Time: ${H(`${s.average}ms`, n, e)}`), t.push(` Min/Avg/Max: ${s.min}/${s.average}/${s.max}ms`), t.push(` P95/P99: ${s.p95}/${s.p99}ms`);
|
|
47308
47305
|
} else
|
|
47309
47306
|
t.push(" Avg Time: N/A");
|
|
@@ -47313,7 +47310,7 @@ function Pe(s, e = "─") {
|
|
|
47313
47310
|
return e.repeat(s);
|
|
47314
47311
|
}
|
|
47315
47312
|
function va(s, e, t) {
|
|
47316
|
-
const i = Math.max(0, e - s.length - 2), n = Math.floor(i / 2), a = i - n, r = Pe(e), o = t ?
|
|
47313
|
+
const i = Math.max(0, e - s.length - 2), n = Math.floor(i / 2), a = i - n, r = Pe(e), o = t ? F.bright + F.cyan + s + F.reset : s;
|
|
47317
47314
|
return `
|
|
47318
47315
|
${r}
|
|
47319
47316
|
${" ".repeat(n)}${o}${" ".repeat(a)}
|
|
@@ -47322,17 +47319,17 @@ ${r}
|
|
|
47322
47319
|
}
|
|
47323
47320
|
function pc(s, e = {}) {
|
|
47324
47321
|
const t = { ...ga, ...e }, i = pa(t), n = 60;
|
|
47325
|
-
console.log(va("ENVIRONMENTAL SENSORS", n, i)), t.showTimestamp && (console.log(`${H("Timestamp:",
|
|
47322
|
+
console.log(va("ENVIRONMENTAL SENSORS", n, i)), t.showTimestamp && (console.log(`${H("Timestamp:", F.dim, i)} ${ya(s.timestamp)}`), console.log(`${H("Diagnostic Mode:", F.dim, i)} ${s.diagnosticMode ? H("ENABLED", F.yellow, i) : "Disabled"}`), console.log("")), console.log(H("┌─ SENSOR STATUS", F.cyan, i)), console.log(Pe(22) + (i ? F.reset : ""));
|
|
47326
47323
|
for (const o of s.sensors) {
|
|
47327
47324
|
const c = xv(o.status.health, i), l = H(
|
|
47328
47325
|
o.status.health.toUpperCase().padEnd(8),
|
|
47329
|
-
o.status.health === "healthy" ?
|
|
47326
|
+
o.status.health === "healthy" ? F.green : o.status.health === "failed" ? F.red : F.yellow,
|
|
47330
47327
|
i
|
|
47331
47328
|
);
|
|
47332
47329
|
if (console.log(`
|
|
47333
|
-
${H(o.type.toUpperCase().padEnd(12),
|
|
47330
|
+
${H(o.type.toUpperCase().padEnd(12), F.bright, i)}`), console.log(` Health: ${c} ${l}`), console.log(` Permission: ${Rv(o.permission, i)}`), console.log(` Availability:${Pv(o.availability, i)}`), o.status.consecutiveFailures > 0 && console.log(` Failures: ${H(o.status.consecutiveFailures.toString(), F.red, i)} consecutive`), o.status.lastError) {
|
|
47334
47331
|
const u = o.status.lastError.length > 40 ? o.status.lastError.substring(0, 37) + "..." : o.status.lastError;
|
|
47335
|
-
console.log(` Last Error: ${H(u,
|
|
47332
|
+
console.log(` Last Error: ${H(u, F.red, i)}`);
|
|
47336
47333
|
}
|
|
47337
47334
|
if (o.status.lastSuccessTimestamp) {
|
|
47338
47335
|
const u = Date.now() - o.status.lastSuccessTimestamp;
|
|
@@ -47340,58 +47337,58 @@ function pc(s, e = {}) {
|
|
|
47340
47337
|
}
|
|
47341
47338
|
}
|
|
47342
47339
|
console.log(`
|
|
47343
|
-
${H("┌─ CACHE STATISTICS",
|
|
47344
|
-
${H("GEOLOCATION",
|
|
47345
|
-
${H("WEATHER API",
|
|
47346
|
-
${H("┌─ API PERFORMANCE",
|
|
47347
|
-
${H("WEATHER API",
|
|
47340
|
+
${H("┌─ CACHE STATISTICS", F.cyan, i)}`), console.log(Pe(22) + (i ? F.reset : "")), console.log(`
|
|
47341
|
+
${H("GEOLOCATION", F.bright, i)}`), console.log(` Cache Age: ${s.cache.geolocation.age !== null ? Gt(s.cache.geolocation.age) : "N/A"}`), console.log(` Expired: ${s.cache.geolocation.isExpired ? H("Yes", F.red, i) : H("No", F.green, i)}`), console.log(` Hit Rate: ${wr(s.cache.geolocation.stats.hits, s.cache.geolocation.stats.misses)} (${s.cache.geolocation.stats.hits}h/${s.cache.geolocation.stats.misses}m)`), console.log(`
|
|
47342
|
+
${H("WEATHER API", F.bright, i)}`), console.log(` Cache Size: ${s.cache.weather.size} entries`), console.log(" TTL: 12 minutes"), console.log(` Hit Rate: ${wr(s.cache.weather.stats.hits, s.cache.weather.stats.misses)} (${s.cache.weather.stats.hits}h/${s.cache.weather.stats.misses}m)`), console.log(`
|
|
47343
|
+
${H("┌─ API PERFORMANCE", F.cyan, i)}`), console.log(Pe(20) + (i ? F.reset : "")), console.log(`
|
|
47344
|
+
${H("WEATHER API", F.bright, i)}`);
|
|
47348
47345
|
const a = Fi(s.performance.weatherApi, i);
|
|
47349
47346
|
for (const o of a)
|
|
47350
47347
|
console.log(o);
|
|
47351
47348
|
console.log(`
|
|
47352
|
-
${H("FORECAST API",
|
|
47349
|
+
${H("FORECAST API", F.bright, i)}`);
|
|
47353
47350
|
const r = Fi(s.performance.forecastApi, i);
|
|
47354
47351
|
for (const o of r)
|
|
47355
47352
|
console.log(o);
|
|
47356
47353
|
if (s.recentFailures.length > 0) {
|
|
47357
47354
|
const o = s.recentFailures.slice(0, t.maxFailures);
|
|
47358
47355
|
console.log(`
|
|
47359
|
-
${H("┌─ RECENT FAILURES",
|
|
47356
|
+
${H("┌─ RECENT FAILURES", F.red, i)}`), console.log(Pe(22) + (i ? F.reset : ""));
|
|
47360
47357
|
for (const c of o) {
|
|
47361
47358
|
const l = Gt(Date.now() - c.timestamp);
|
|
47362
47359
|
console.log(`
|
|
47363
|
-
${H(c.sensorType.toUpperCase(),
|
|
47360
|
+
${H(c.sensorType.toUpperCase(), F.bright, i)} - ${H(l, F.dim, i)} ago`), console.log(` Error: ${H(c.error, F.red, i)}`), console.log(` Retry: ${c.retryAttempt}${c.willRetry ? " (will retry)" : " (final)"}`);
|
|
47364
47361
|
}
|
|
47365
47362
|
}
|
|
47366
47363
|
console.log(`
|
|
47367
|
-
${H("┌─ CONTEXT DATA",
|
|
47368
|
-
Geolocation: ${s.context.hasGeolocation ? H("✓",
|
|
47364
|
+
${H("┌─ CONTEXT DATA", F.cyan, i)}`), console.log(Pe(17) + (i ? F.reset : "")), console.log(`
|
|
47365
|
+
Geolocation: ${s.context.hasGeolocation ? H("✓", F.green, i) : H("✗", F.red, i)}`), console.log(` Motion: ${s.context.hasMotion ? H("✓", F.green, i) : H("✗", F.red, i)}`), console.log(` Weather: ${s.context.hasWeather ? H("✓", F.green, i) : H("✗", F.red, i)}`), console.log(` Biome: ${s.context.hasBiome ? H("✓", F.green, i) : H("✗", F.red, i)}`), console.log(`
|
|
47369
47366
|
${Pe(n)}
|
|
47370
47367
|
`);
|
|
47371
47368
|
}
|
|
47372
47369
|
function yc(s, e = {}) {
|
|
47373
47370
|
const t = { ...ga, ...e }, i = pa(t), n = 60;
|
|
47374
|
-
console.log(va("GAMING PLATFORM SENSORS", n, i)), t.showTimestamp && console.log(`${H("Timestamp:",
|
|
47375
|
-
`), console.log(H("┌─ PLATFORM STATUS",
|
|
47376
|
-
${H("STEAM",
|
|
47377
|
-
${H("┌─ GAMING CONTEXT",
|
|
47371
|
+
console.log(va("GAMING PLATFORM SENSORS", n, i)), t.showTimestamp && console.log(`${H("Timestamp:", F.dim, i)} ${ya(s.timestamp)}
|
|
47372
|
+
`), console.log(H("┌─ PLATFORM STATUS", F.cyan, i)), console.log(Pe(22) + (i ? F.reset : "")), console.log(`
|
|
47373
|
+
${H("STEAM", F.bright, i)}`), console.log(` Authenticated: ${s.steam.isAuthenticated ? H("✓", F.green, i) : H("✗", F.red, i)}`), console.log(` API Key: ${s.steam.apiKey ? H("✓ Configured", F.green, i) : H("✗ Missing", F.red, i)}`), s.steam.userId && console.log(` User ID: ${s.steam.userId}`), console.log(`
|
|
47374
|
+
${H("┌─ GAMING CONTEXT", F.cyan, i)}`), console.log(Pe(20) + (i ? F.reset : ""));
|
|
47378
47375
|
const a = s.gamingContext.isActivelyGaming;
|
|
47379
47376
|
if (console.log(`
|
|
47380
|
-
Active Gaming: ${a ? H("✓ Yes",
|
|
47377
|
+
Active Gaming: ${a ? H("✓ Yes", F.green, i) : H("✗ No", F.dim, i)}`), console.log(` Platform: ${H(s.gamingContext.platformSource.toUpperCase(), a ? F.green : F.dim, i)}`), s.gamingContext.currentGame) {
|
|
47381
47378
|
const c = s.gamingContext.currentGame;
|
|
47382
47379
|
console.log(`
|
|
47383
|
-
${H("Current Game:",
|
|
47380
|
+
${H("Current Game:", F.bright, i)}`), console.log(` Name: ${H(c.name, F.cyan, i)}`), console.log(` Source: ${c.source}`), c.genre && c.genre.length > 0 && console.log(` Genre: ${c.genre.join(", ")}`), c.sessionDuration && console.log(` Session: ${Gt(c.sessionDuration * 1e3 * 60)}`), c.partySize && console.log(` Party: ${c.partySize} player${c.partySize > 1 ? "s" : ""}`);
|
|
47384
47381
|
}
|
|
47385
47382
|
if (s.gamingContext.gamesPlayedWhileListening.length > 0) {
|
|
47386
47383
|
console.log(`
|
|
47387
|
-
${H("Games While Listening:",
|
|
47384
|
+
${H("Games While Listening:", F.bright, i)}`);
|
|
47388
47385
|
for (const c of s.gamingContext.gamesPlayedWhileListening)
|
|
47389
47386
|
console.log(` • ${c}`);
|
|
47390
47387
|
}
|
|
47391
47388
|
if (console.log(`
|
|
47392
|
-
${H("┌─ POLLING STATUS",
|
|
47393
|
-
Active: ${s.polling.isActive ? H("✓",
|
|
47394
|
-
${H("┌─ CACHE",
|
|
47389
|
+
${H("┌─ POLLING STATUS", F.cyan, i)}`), console.log(Pe(19) + (i ? F.reset : "")), console.log(`
|
|
47390
|
+
Active: ${s.polling.isActive ? H("✓", F.green, i) : H("✗", F.dim, i)}`), console.log(` Interval: ${Gt(s.polling.intervalMs)}`), s.polling.exponentialBackoff > 1 && console.log(` Backoff: ${H(`${s.polling.exponentialBackoff}x`, F.yellow, i)}`), console.log(`
|
|
47391
|
+
${H("┌─ CACHE", F.cyan, i)}`), console.log(Pe(10) + (i ? F.reset : "")), console.log(`
|
|
47395
47392
|
Game Metadata: ${s.cache.gameMetadataCacheSize} entries`), s.cache.cachedGames.length > 0) {
|
|
47396
47393
|
console.log(" Cached Games:");
|
|
47397
47394
|
for (const c of s.cache.cachedGames.slice(0, 5))
|
|
@@ -47399,13 +47396,13 @@ ${H("┌─ CACHE", $.cyan, i)}`), console.log(Pe(10) + (i ? $.reset : "")), con
|
|
|
47399
47396
|
s.cache.cachedGames.length > 5 && console.log(` ... and ${s.cache.cachedGames.length - 5} more`);
|
|
47400
47397
|
}
|
|
47401
47398
|
console.log(`
|
|
47402
|
-
${H("┌─ API PERFORMANCE",
|
|
47403
|
-
${H("CURRENT GAME API",
|
|
47399
|
+
${H("┌─ API PERFORMANCE", F.cyan, i)}`), console.log(Pe(20) + (i ? F.reset : "")), console.log(`
|
|
47400
|
+
${H("CURRENT GAME API", F.bright, i)}`);
|
|
47404
47401
|
const r = Fi(s.performance.currentGameApi, i);
|
|
47405
47402
|
for (const c of r)
|
|
47406
47403
|
console.log(c);
|
|
47407
47404
|
console.log(`
|
|
47408
|
-
${H("METADATA API",
|
|
47405
|
+
${H("METADATA API", F.bright, i)}`);
|
|
47409
47406
|
const o = Fi(s.performance.metadataApi, i);
|
|
47410
47407
|
for (const c of o)
|
|
47411
47408
|
console.log(c);
|
|
@@ -47417,20 +47414,20 @@ function Bv(s, e = {}) {
|
|
|
47417
47414
|
const t = { ...ga, ...e }, i = pa(t);
|
|
47418
47415
|
if (console.log(va("SENSOR SYSTEM DASHBOARD", 70, i)), t.showTimestamp) {
|
|
47419
47416
|
const a = s.environmental?.timestamp || s.gaming?.timestamp || Date.now();
|
|
47420
|
-
console.log(`${H("Generated:",
|
|
47417
|
+
console.log(`${H("Generated:", F.dim, i)} ${ya(a)}
|
|
47421
47418
|
`);
|
|
47422
47419
|
}
|
|
47423
|
-
if (console.log(H("┌─ QUICK HEALTH SUMMARY",
|
|
47420
|
+
if (console.log(H("┌─ QUICK HEALTH SUMMARY", F.cyan, i)), console.log(Pe(26) + (i ? F.reset : "")), s.environmental) {
|
|
47424
47421
|
let a = 0;
|
|
47425
47422
|
for (const o of s.environmental.sensors)
|
|
47426
47423
|
o.status.health === "healthy" && a++;
|
|
47427
47424
|
const r = a === s.environmental.sensors.length;
|
|
47428
47425
|
console.log(`
|
|
47429
|
-
Environmental: ${r ? H(`✓ ${a}/${a} Healthy`,
|
|
47426
|
+
Environmental: ${r ? H(`✓ ${a}/${a} Healthy`, F.green, i) : H(`⚠ ${a}/${s.environmental.sensors.length} Healthy`, F.yellow, i)}`);
|
|
47430
47427
|
}
|
|
47431
47428
|
if (s.gaming) {
|
|
47432
47429
|
const a = s.gaming.steam.isAuthenticated;
|
|
47433
|
-
console.log(` Gaming: ${a ? H("✓ Connected",
|
|
47430
|
+
console.log(` Gaming: ${a ? H("✓ Connected", F.green, i) : H("✗ Disconnected", F.dim, i)}`);
|
|
47434
47431
|
}
|
|
47435
47432
|
console.log(""), s.environmental && pc(s.environmental, t), s.gaming && yc(s.gaming, t);
|
|
47436
47433
|
}
|
|
@@ -51291,7 +51288,7 @@ export {
|
|
|
51291
51288
|
Wa as MIN_BEATS_PER_MEASURE,
|
|
51292
51289
|
rc as MOOD_PRESETS,
|
|
51293
51290
|
Sv as ManualStrategy,
|
|
51294
|
-
|
|
51291
|
+
ee as MetadataExtractor,
|
|
51295
51292
|
Og as ModelCache,
|
|
51296
51293
|
Ap as MultiBandAnalyzer,
|
|
51297
51294
|
A0 as MusicClassifier,
|