@validate.qa/runner 1.0.85 → 1.0.87
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/cli.js +602 -2348
- package/dist/cli.mjs +602 -2348
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -975,10 +975,11 @@ var require_mobile_source_parser = __commonJS({
|
|
|
975
975
|
function extractIOS(attrs) {
|
|
976
976
|
const role = nonEmpty3(attrs.type) ?? "XCUIElementTypeOther";
|
|
977
977
|
const name = nonEmpty3(attrs.name);
|
|
978
|
+
const identifier = nonEmpty3(attrs.identifier) ?? nonEmpty3(attrs.accessibilityIdentifier);
|
|
978
979
|
const labelAttr = nonEmpty3(attrs.label);
|
|
979
980
|
const value = nonEmpty3(attrs.value);
|
|
980
981
|
const label = name ?? labelAttr ?? value;
|
|
981
|
-
const accessibilityId = name;
|
|
982
|
+
const accessibilityId = identifier ?? name;
|
|
982
983
|
const text = labelAttr ?? (isStateValueRole(role) ? void 0 : value);
|
|
983
984
|
const bounds = parseIOSBounds(attrs);
|
|
984
985
|
const enabled = attrBoolDefaultTrue(attrs.enabled);
|
|
@@ -75942,6 +75943,34 @@ ${existingScreens.slice(0, 100).map((s) => `- ${s.screenId}${s.name ? ` "${s.nam
|
|
|
75942
75943
|
latest = boundaryResolved;
|
|
75943
75944
|
lastSnapshotIteration = iterationForObservation;
|
|
75944
75945
|
if (boundary.kind === "transient_external") {
|
|
75946
|
+
const isHostHomeShell = /springboard|systemui/i.test(boundary.owner);
|
|
75947
|
+
if (isHostHomeShell) {
|
|
75948
|
+
log2(` Host shell detected from ${source}: ${boundary.owner}; activating ${boundary.targetAppId} so exploration can continue.`);
|
|
75949
|
+
try {
|
|
75950
|
+
await driver.launchApp();
|
|
75951
|
+
const snap = await driver.snapshot();
|
|
75952
|
+
const recovered = buildResolved(snap.xml, snap.windowSize, snap.screenSignal);
|
|
75953
|
+
if (recovered) {
|
|
75954
|
+
const recoveredBoundary = (0, mobile_boundary_js_1.classifyMobileScreenBoundary)(recovered.signal, targetAppId, platform3);
|
|
75955
|
+
if (recoveredBoundary.kind === "target" || recoveredBoundary.kind === "unknown") {
|
|
75956
|
+
const enriched = await enrichResolvedSnapshotWithHybridWeb(recovered, driver, credentialValuesForRedaction, log2, platform3, targetAppId, hybridContextCache, true, source !== "seed snapshot" && source !== "mobile_snapshot");
|
|
75957
|
+
latest = enriched;
|
|
75958
|
+
lastSnapshotIteration = iterationForObservation;
|
|
75959
|
+
const screenId = ingestSnapshot(enriched, iterationForObservation);
|
|
75960
|
+
captureScreenshot(enriched.replacementScreenshot ?? snap.screenshot, screenId);
|
|
75961
|
+
return {
|
|
75962
|
+
observation: enriched.observation,
|
|
75963
|
+
screenId,
|
|
75964
|
+
transientExternal: true,
|
|
75965
|
+
externalOwner: boundary.owner
|
|
75966
|
+
};
|
|
75967
|
+
}
|
|
75968
|
+
}
|
|
75969
|
+
} catch (err) {
|
|
75970
|
+
(0, mobile_driver_errors_js_1.rethrowIfTerminalMobileDriverError)(err);
|
|
75971
|
+
log2(` Failed to recover from host shell ${boundary.owner}: ${err instanceof Error ? err.message : String(err)}`);
|
|
75972
|
+
}
|
|
75973
|
+
}
|
|
75945
75974
|
log2(` System overlay detected from ${source}: ${boundary.owner}; not adding it to target-app survey evidence.`);
|
|
75946
75975
|
return {
|
|
75947
75976
|
observation: `${boundaryResolved.observation}${(0, mobile_boundary_js_1.mobileBoundaryNote)(boundary)}`,
|
|
@@ -76159,6 +76188,7 @@ ${existingScreens.slice(0, 100).map((s) => `- ${s.screenId}${s.name ? ` "${s.nam
|
|
|
76159
76188
|
let summary = "";
|
|
76160
76189
|
let truncated = false;
|
|
76161
76190
|
let truncatedReason;
|
|
76191
|
+
const emptyUiTreeStreak = { count: 0 };
|
|
76162
76192
|
let finishRedirects = 0;
|
|
76163
76193
|
let lastFinishBreadthRemainingItems = null;
|
|
76164
76194
|
let lastFinishBreadthProgressMark = null;
|
|
@@ -76497,10 +76527,17 @@ Exploration complete: ${summary}`);
|
|
|
76497
76527
|
redactionCredentials: credentialValuesForRedaction,
|
|
76498
76528
|
authTracker,
|
|
76499
76529
|
inbox: inboxEnabled && inboxState && inboxReader ? { state: inboxState, reader: inboxReader } : null,
|
|
76500
|
-
allowRelaunch: !preserveAppDataForTools
|
|
76530
|
+
allowRelaunch: !preserveAppDataForTools,
|
|
76531
|
+
emptyUiTreeStreak
|
|
76501
76532
|
});
|
|
76502
76533
|
pushResult(handled);
|
|
76503
76534
|
const handledRecord = handled && typeof handled === "object" ? handled : null;
|
|
76535
|
+
if (handledRecord?.permanent === true && handledRecord?.emptyUiTreeStreak) {
|
|
76536
|
+
explorationComplete = true;
|
|
76537
|
+
summary = typeof handledRecord.reason === "string" && handledRecord.reason.trim() ? handledRecord.reason : "Accessibility tree remained empty after repeated Appium observations; exploration stopped early.";
|
|
76538
|
+
log2(`
|
|
76539
|
+
Stopping Phase 1 early: empty UI tree thrash (streak=${handledRecord.emptyUiTreeStreak}).`);
|
|
76540
|
+
}
|
|
76504
76541
|
const navigationWasAttempted = handledRecord?.ok !== false || Object.prototype.hasOwnProperty.call(handledRecord ?? {}, "screenId") || Object.prototype.hasOwnProperty.call(handledRecord ?? {}, "observation");
|
|
76505
76542
|
if (DEVICE_MUTATION_BARRIER_TOOLS.has(toolName) && navigationWasAttempted) {
|
|
76506
76543
|
navigationBarrierTool = toolName;
|
|
@@ -76589,14 +76626,24 @@ Exploration complete: ${summary}`);
|
|
|
76589
76626
|
}
|
|
76590
76627
|
return result;
|
|
76591
76628
|
}
|
|
76629
|
+
var MAX_EMPTY_UI_TREE_STREAK = 3;
|
|
76592
76630
|
async function dispatchMobileTool(args) {
|
|
76593
|
-
const { toolName, toolArgs, iteration, driver, state: state2, enableRecordJourney, latest, buildResolved, absorbResolvedObservation, resolveRef, resolveHybridRef, currentBoundary, collectedTransitions, counters, journeys, log: log2, credentials, redactionCredentials, authTracker, inbox, allowRelaunch } = args;
|
|
76631
|
+
const { toolName, toolArgs, iteration, driver, state: state2, enableRecordJourney, latest, buildResolved, absorbResolvedObservation, resolveRef, resolveHybridRef, currentBoundary, collectedTransitions, counters, journeys, log: log2, credentials, redactionCredentials, authTracker, inbox, allowRelaunch, emptyUiTreeStreak } = args;
|
|
76632
|
+
const noteEmptyUiTree = () => {
|
|
76633
|
+
emptyUiTreeStreak.count += 1;
|
|
76634
|
+
return emptyUiTreeStreak.count;
|
|
76635
|
+
};
|
|
76636
|
+
const clearEmptyUiTreeStreak = () => {
|
|
76637
|
+
emptyUiTreeStreak.count = 0;
|
|
76638
|
+
};
|
|
76594
76639
|
const absorbActionResult = (actionResult, source, preferCredentialSecondary = false) => {
|
|
76595
76640
|
(0, mobile_driver_errors_js_1.throwIfTerminalMobileActionFailure)(actionResult, source);
|
|
76596
76641
|
const resolved = buildResolved(actionResult.source, latest()?.screen.windowSize ?? null, actionResult.screenSignal);
|
|
76597
76642
|
if (!resolved) {
|
|
76643
|
+
noteEmptyUiTree();
|
|
76598
76644
|
return Promise.resolve({ observation: "(no UI tree returned)", screenId: null });
|
|
76599
76645
|
}
|
|
76646
|
+
clearEmptyUiTreeStreak();
|
|
76600
76647
|
return absorbResolvedObservation(resolved, actionResult.screenshot, iteration, source, preferCredentialSecondary);
|
|
76601
76648
|
};
|
|
76602
76649
|
const currentAuthSurface = () => {
|
|
@@ -76626,8 +76673,17 @@ Exploration complete: ${summary}`);
|
|
|
76626
76673
|
const snap = await driver.snapshot();
|
|
76627
76674
|
const resolved = buildResolved(snap.xml, snap.windowSize, snap.screenSignal);
|
|
76628
76675
|
if (!resolved) {
|
|
76629
|
-
|
|
76676
|
+
const streak = noteEmptyUiTree();
|
|
76677
|
+
log2(` Snapshot returned no UI tree (empty streak ${streak}/${MAX_EMPTY_UI_TREE_STREAK}).`);
|
|
76678
|
+
return {
|
|
76679
|
+
ok: false,
|
|
76680
|
+
error: "snapshot returned no UI tree",
|
|
76681
|
+
emptyUiTreeStreak: streak,
|
|
76682
|
+
permanent: streak >= MAX_EMPTY_UI_TREE_STREAK,
|
|
76683
|
+
reason: streak >= MAX_EMPTY_UI_TREE_STREAK ? "Appium repeatedly returned an empty accessibility tree after settle/activate. Stop relaunch thrash \u2014 call finish_exploration with evidence you have, or abort. This is almost always a session/device/app-start failure, not missing product screens." : "No accessibility tree yet. Prefer one mobile_snapshot after a short wait over repeated relaunches."
|
|
76684
|
+
};
|
|
76630
76685
|
}
|
|
76686
|
+
clearEmptyUiTreeStreak();
|
|
76631
76687
|
const absorbed = await absorbResolvedObservation(resolved, snap.screenshot, iteration, "mobile_snapshot");
|
|
76632
76688
|
if (absorbed.screenId) {
|
|
76633
76689
|
const elementCount = state2.getScreen(absorbed.screenId)?.elements.length ?? resolved.screen.elements.length;
|
|
@@ -77000,14 +77056,30 @@ Exploration complete: ${summary}`);
|
|
|
77000
77056
|
note: "Relaunch refused under preserve policy."
|
|
77001
77057
|
};
|
|
77002
77058
|
}
|
|
77059
|
+
if (emptyUiTreeStreak.count >= MAX_EMPTY_UI_TREE_STREAK) {
|
|
77060
|
+
return {
|
|
77061
|
+
ok: false,
|
|
77062
|
+
error: `mobile_relaunch refused: accessibility tree has been empty for ${emptyUiTreeStreak.count} consecutive observations. Call finish_exploration or stop \u2014 further relaunches will not recover a dead session/app paint.`,
|
|
77063
|
+
permanent: true,
|
|
77064
|
+
emptyUiTreeStreak: emptyUiTreeStreak.count
|
|
77065
|
+
};
|
|
77066
|
+
}
|
|
77003
77067
|
authTracker?.noteInterveningMutation(iteration);
|
|
77004
77068
|
await driver.relaunch();
|
|
77005
77069
|
log2(" Relaunched app for hermetic reset.");
|
|
77006
77070
|
const snap = await driver.snapshot();
|
|
77007
77071
|
const resolved = buildResolved(snap.xml, snap.windowSize, snap.screenSignal);
|
|
77008
77072
|
if (!resolved) {
|
|
77009
|
-
|
|
77073
|
+
const streak = noteEmptyUiTree();
|
|
77074
|
+
log2(` Relaunch yielded no UI tree (empty streak ${streak}/${MAX_EMPTY_UI_TREE_STREAK}).`);
|
|
77075
|
+
return {
|
|
77076
|
+
ok: true,
|
|
77077
|
+
note: "relaunched; no UI tree returned \u2014 call mobile_snapshot.",
|
|
77078
|
+
emptyUiTreeStreak: streak,
|
|
77079
|
+
permanent: streak >= MAX_EMPTY_UI_TREE_STREAK
|
|
77080
|
+
};
|
|
77010
77081
|
}
|
|
77082
|
+
clearEmptyUiTreeStreak();
|
|
77011
77083
|
const absorbed = await absorbResolvedObservation(resolved, snap.screenshot, iteration, "mobile_relaunch");
|
|
77012
77084
|
return {
|
|
77013
77085
|
ok: true,
|
|
@@ -80239,6 +80311,10 @@ var require_mobile_discovery_prompts = __commonJS({
|
|
|
80239
80311
|
"use strict";
|
|
80240
80312
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
80241
80313
|
exports2.MOBILE_SCENARIO_SYSTEM_PROMPT = exports2.MOBILE_SURVEY_SYSTEM_PROMPT = void 0;
|
|
80314
|
+
exports2.isScrubbedPlaceholderName = isScrubbedPlaceholderName;
|
|
80315
|
+
exports2.isOpaqueMobileScreenName = isOpaqueMobileScreenName;
|
|
80316
|
+
exports2.isPackageLeafAppCatchAll = isPackageLeafAppCatchAll;
|
|
80317
|
+
exports2.isLowValueMobileAutoDeepFeature = isLowValueMobileAutoDeepFeature;
|
|
80242
80318
|
exports2.formatMobileEvidenceForPlanner = formatMobileEvidenceForPlanner;
|
|
80243
80319
|
exports2.transitionSourceLabel = transitionSourceLabel;
|
|
80244
80320
|
exports2.buildMobileSiteMap = buildMobileSiteMap;
|
|
@@ -80519,6 +80595,32 @@ Each entry is exactly one of:
|
|
|
80519
80595
|
}
|
|
80520
80596
|
return /^[a-z][\w$]*(?:\.[a-z][\w$]*)+(?:#[a-z0-9_. -]+)?$/i.test(trimmed);
|
|
80521
80597
|
}
|
|
80598
|
+
function isPackageLeafAppCatchAll(name, appId) {
|
|
80599
|
+
const trimmed = name.trim();
|
|
80600
|
+
if (!trimmed || !appId?.trim())
|
|
80601
|
+
return false;
|
|
80602
|
+
const match = trimmed.match(/^(.+?)\s+app$/i);
|
|
80603
|
+
if (!match)
|
|
80604
|
+
return false;
|
|
80605
|
+
const brand = match[1].trim();
|
|
80606
|
+
if (!brand || /\s/.test(brand))
|
|
80607
|
+
return false;
|
|
80608
|
+
const leaf = appId.split(".").map((p) => p.trim()).filter(Boolean).pop();
|
|
80609
|
+
if (!leaf)
|
|
80610
|
+
return false;
|
|
80611
|
+
const normalize = (s) => s.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
80612
|
+
return normalize(brand) === normalize(leaf);
|
|
80613
|
+
}
|
|
80614
|
+
function isLowValueMobileAutoDeepFeature(name, appId) {
|
|
80615
|
+
const trimmed = name.trim();
|
|
80616
|
+
if (!trimmed)
|
|
80617
|
+
return true;
|
|
80618
|
+
if (isScrubbedPlaceholderName(trimmed) || isOpaqueMobileScreenName(trimmed, appId))
|
|
80619
|
+
return true;
|
|
80620
|
+
if (isPackageLeafAppCatchAll(trimmed, appId))
|
|
80621
|
+
return true;
|
|
80622
|
+
return false;
|
|
80623
|
+
}
|
|
80522
80624
|
function humanizeToken(token) {
|
|
80523
80625
|
const spaced = token.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").trim();
|
|
80524
80626
|
if (!spaced)
|
|
@@ -81550,6 +81652,7 @@ var require_mobile_generator = __commonJS({
|
|
|
81550
81652
|
exports2.coalesceRepeatedTaps = coalesceRepeatedTaps;
|
|
81551
81653
|
exports2.elideNoOpDetours = elideNoOpDetours;
|
|
81552
81654
|
exports2.mobileActionsToPseudoPlaywright = mobileActionsToPseudoPlaywright;
|
|
81655
|
+
exports2.isEphemeralContentAssertText = isEphemeralContentAssertText;
|
|
81553
81656
|
exports2.evaluateMobileAssertionStrength = evaluateMobileAssertionStrength;
|
|
81554
81657
|
exports2.prepareMobileScenarioAppState = prepareMobileScenarioAppState;
|
|
81555
81658
|
exports2.runMobileGeneratePhase = runMobileGeneratePhase;
|
|
@@ -82010,15 +82113,20 @@ ${hybridSkeleton.join("\n")}`;
|
|
|
82010
82113
|
- Every element is addressed by a ref like e1, e2. Refs are ONLY valid for the most recent mobile_snapshot. Re-snapshot after every action that changes the screen, then use the NEW refs.
|
|
82011
82114
|
- mobile_tap/mobile_type/mobile_clear take a ref; the loop resolves it to coordinates AND records the durable locator for replay \u2014 you never pass coordinates.
|
|
82012
82115
|
|
|
82013
|
-
## Your job
|
|
82116
|
+
## Your job \u2014 feature fidelity (non-negotiable)
|
|
82117
|
+
The scenario name + goal + steps describe ONE product behavior from survey/discovery. The generated test MUST implement that behavior on THIS app \u2014 not a random walk through tabs.
|
|
82118
|
+
|
|
82014
82119
|
1. mobile_snapshot the current screen.
|
|
82015
|
-
2. Execute the scenario's steps using the real UI: tap
|
|
82016
|
-
3. COMPLETE THE ACTION the scenario is about \u2014 do not stop half-way
|
|
82017
|
-
|
|
82018
|
-
-
|
|
82019
|
-
-
|
|
82020
|
-
|
|
82021
|
-
|
|
82120
|
+
2. Execute the scenario's steps using the real UI: tap the controls that perform the goal, fill fields (mobile_type), submit, navigate to the destination named in the goal.
|
|
82121
|
+
3. COMPLETE THE ACTION the scenario is about \u2014 do not stop half-way:
|
|
82122
|
+
- Form scenarios (sign in, sign up, search, create, change password, edit profile): you MUST commit \u2014 tap submit/primary OR mobile_submit_keyboard. Filling alone is NOT enough. Opening a form without typing is NOT enough for mutation goals.
|
|
82123
|
+
- Content actions (like, share, follow, bookmark, download, \u2026): you MUST tap the control that performs that action \u2014 tab thrash / swipes alone are WRONG.
|
|
82124
|
+
- Navigation scenarios: you MUST land on the destination and assert something unique to it.
|
|
82125
|
+
4. PROVE the outcome with an assert tool that matches the scenario \u2014 not ambient chrome:
|
|
82126
|
+
- mobile_assert_visible({ref}) / mobile_assert_text({ref, expected})
|
|
82127
|
+
- After sign-in \u2192 signed-in product signal; after like \u2192 liked/unlike control or durable like state; after open Settings \u2192 a settings-specific control.
|
|
82128
|
+
- Do NOT assert bottom-nav tab labels alone, notification badge counts ("N unread"), or one-time empty-state CTAs as the scenario outcome.
|
|
82129
|
+
5. Call finish_generate with verified:true ONLY if you completed the goal AND asserted a matching durable outcome. If the app cannot complete the goal, finish with verified:false and explain \u2014 never invent a green path from unrelated screens.
|
|
82022
82130
|
|
|
82023
82131
|
## Rules
|
|
82024
82132
|
- Re-snapshot before every assertion so the ref is fresh.
|
|
@@ -82069,7 +82177,7 @@ ${stepLines || " (no explicit steps \u2014 explore the goal directly)"}
|
|
|
82069
82177
|
Expected outcomes to PROVE with assert tools:
|
|
82070
82178
|
${outcomeLines || " - The target screen is reached and a stable element is visible."}
|
|
82071
82179
|
|
|
82072
|
-
Start by calling mobile_snapshot, then execute the steps
|
|
82180
|
+
Start by calling mobile_snapshot, then execute ONLY the steps needed for this goal \u2014 no tab thrash, no unrelated screens. Every recorded action becomes a permanent test step. Finish with at least one assert that proves THIS goal's outcome (from Expected outcomes), then finish_generate. If you cannot perform the goal on this app build, finish_generate with verified:false rather than a fake green path.`;
|
|
82073
82181
|
}
|
|
82074
82182
|
function buildStatePacket(input) {
|
|
82075
82183
|
const { scenario, iteration, maxIterations, latestObservation, assertCount, actionCount } = input;
|
|
@@ -83536,6 +83644,84 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83536
83644
|
"element-hidden",
|
|
83537
83645
|
"screen-visible"
|
|
83538
83646
|
]);
|
|
83647
|
+
var CONTENT_ACTION_VERB_RE = /\b(like|unlike|favorite|favourite|unfavorite|unfavourite|heart|unheart|follow|unfollow|share|repost|retweet|bookmark|unbookmark|save\s+to|download|subscribe|unsubscribe|block|report|unpin|pin\s+(?:post|item|message|tweet)|mute|unmute|react|upvote|downvote|clap|boost)\b/i;
|
|
83648
|
+
var NAV_CHROME_TAP_RE = /\b(home|you|profile|search|settings|notifications?|inbox|messages?|explore|library|more|menu|tab|bottom\s*nav|videos?|create|feed)\b/i;
|
|
83649
|
+
var VOLATILE_BADGE_ASSERT_RE = /\b\d+\s*(unread|notifications?|messages?|likes?|followers?|comments?|views?)\b|\bunread\b.*\b\d+\b/i;
|
|
83650
|
+
function isContentActionScenario(scenario) {
|
|
83651
|
+
const text = scenarioText(scenario);
|
|
83652
|
+
if (!CONTENT_ACTION_VERB_RE.test(text))
|
|
83653
|
+
return false;
|
|
83654
|
+
if (/\b(view|see|show|open|browse|list|count)\s+(the\s+)?(likes?|followers?|shares?|bookmarks?)\b/i.test(text)) {
|
|
83655
|
+
return false;
|
|
83656
|
+
}
|
|
83657
|
+
return true;
|
|
83658
|
+
}
|
|
83659
|
+
function isContentActionTap(action) {
|
|
83660
|
+
if (action.type !== "TAP")
|
|
83661
|
+
return false;
|
|
83662
|
+
const textForAction = actionText(action);
|
|
83663
|
+
if (NAV_CHROME_TAP_RE.test(textForAction) && !CONTENT_ACTION_VERB_RE.test(textForAction)) {
|
|
83664
|
+
return false;
|
|
83665
|
+
}
|
|
83666
|
+
return CONTENT_ACTION_VERB_RE.test(textForAction);
|
|
83667
|
+
}
|
|
83668
|
+
function isProductiveScenarioAction(action, scenarioTextLower = "") {
|
|
83669
|
+
if (action.type === "TYPE" || action.type === "CLEAR")
|
|
83670
|
+
return true;
|
|
83671
|
+
if (action.type === "TAP") {
|
|
83672
|
+
const t = actionText(action);
|
|
83673
|
+
if (CONTENT_ACTION_VERB_RE.test(t) || isFormCommitAction(action) || isCredentialSubmitTap(action)) {
|
|
83674
|
+
return true;
|
|
83675
|
+
}
|
|
83676
|
+
if (NAV_CHROME_TAP_RE.test(t)) {
|
|
83677
|
+
if (!scenarioTextLower)
|
|
83678
|
+
return false;
|
|
83679
|
+
const chromeWords = t.match(/\b(home|you|profile|search|settings|notifications?|inbox|messages?|explore|library|more|menu|videos?|create|feed)\b/gi) ?? [];
|
|
83680
|
+
return chromeWords.some((w) => scenarioTextLower.includes(w.toLowerCase()));
|
|
83681
|
+
}
|
|
83682
|
+
return true;
|
|
83683
|
+
}
|
|
83684
|
+
return false;
|
|
83685
|
+
}
|
|
83686
|
+
function isNavChromeThrashTrace(actions) {
|
|
83687
|
+
const meaningful = actions.filter((a) => a.type !== "WAIT_FOR_ELEMENT");
|
|
83688
|
+
if (meaningful.length === 0)
|
|
83689
|
+
return false;
|
|
83690
|
+
const hasNavOrGesture = meaningful.some((a) => a.type === "TAP" || a.type === "SWIPE" || a.type === "BACK" || a.type === "HOME");
|
|
83691
|
+
if (!hasNavOrGesture)
|
|
83692
|
+
return false;
|
|
83693
|
+
return meaningful.every((a) => {
|
|
83694
|
+
if (a.type === "SWIPE" || a.type === "BACK" || a.type === "HOME")
|
|
83695
|
+
return true;
|
|
83696
|
+
if (a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT") {
|
|
83697
|
+
const t = actionText(a);
|
|
83698
|
+
return NAV_CHROME_TAP_RE.test(t) || VOLATILE_BADGE_ASSERT_RE.test(t) || isStructuralOnlyAssert(a);
|
|
83699
|
+
}
|
|
83700
|
+
if (a.type === "TAP") {
|
|
83701
|
+
return NAV_CHROME_TAP_RE.test(actionText(a)) && !CONTENT_ACTION_VERB_RE.test(actionText(a));
|
|
83702
|
+
}
|
|
83703
|
+
return false;
|
|
83704
|
+
});
|
|
83705
|
+
}
|
|
83706
|
+
function isHarnessOrVisibilityScenario(scenario) {
|
|
83707
|
+
const text = scenarioText(scenario);
|
|
83708
|
+
return /\b(avoid|recover|guard|remain|stay\s+in|does\s+not\s+record|external|outside\s+the\s+app|inspect|visibility\s+proof|landing\s+screen|smoke|structural\s+assert|skip\s+link|global\s+navigation\s+anchors?)\b/i.test(text);
|
|
83709
|
+
}
|
|
83710
|
+
function requiresFeatureProgress(scenario) {
|
|
83711
|
+
if (isNavigationFocusedScenario(scenario))
|
|
83712
|
+
return false;
|
|
83713
|
+
if (isCancelDiscardScenario(scenario))
|
|
83714
|
+
return false;
|
|
83715
|
+
if (isContentActionScenario(scenario))
|
|
83716
|
+
return true;
|
|
83717
|
+
if (isHarnessOrVisibilityScenario(scenario))
|
|
83718
|
+
return false;
|
|
83719
|
+
const text = scenarioText(scenario);
|
|
83720
|
+
const behaviorClaim = scenario.type === "HAPPY_PATH" || scenario.type === "USER_JOURNEY" || /\b(happy\s*path|successful|success|complete|user\s+can|should\s+be\s+able)\b/i.test(text);
|
|
83721
|
+
if (!behaviorClaim)
|
|
83722
|
+
return false;
|
|
83723
|
+
return /\b(like|unlike|share|follow|bookmark|download|subscribe|create|save|send|submit|edit|delete|remove|add|play|search|type|fill|login|sign\s*in|log\s*in|register|checkout|update|change|open|view|browse|filter|sort|upload|invite|join)\b/i.test(text);
|
|
83724
|
+
}
|
|
83539
83725
|
function isInspectionOnlyScenario(scenario, actions) {
|
|
83540
83726
|
if (actions.length === 0 || scenario.expectedOutcomes.length === 0)
|
|
83541
83727
|
return false;
|
|
@@ -83545,16 +83731,28 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83545
83731
|
if (actions.some((a) => a.type === "TYPE" || a.type === "CLEAR")) {
|
|
83546
83732
|
return false;
|
|
83547
83733
|
}
|
|
83734
|
+
if (isContentActionScenario(scenario)) {
|
|
83735
|
+
return false;
|
|
83736
|
+
}
|
|
83737
|
+
if (isFormValidationScenario(scenario)) {
|
|
83738
|
+
return false;
|
|
83739
|
+
}
|
|
83548
83740
|
const text = scenarioText(scenario);
|
|
83549
|
-
const visibilityOnlyGoal = (/\b(entry\s+points?|providers?|
|
|
83741
|
+
const visibilityOnlyGoal = (/\b(entry\s+points?|providers?|provider\s+buttons?|sign[- ]?in\s+options|auth(?:entication)?\s+options|available\s+options)\b/.test(text) || /\b(show|display)\s+(all\s+)?(the\s+)?(providers?|options|buttons?|links?|entry\s+points?)\b/.test(text) || /\b(all\s+(three\s+)?providers?)\b/.test(text)) && !/\b(change|update|create|save|send|register|edit|with\s+valid|successful\s+(sign|log)|complete\s+(the\s+)?(login|sign[- ]?in)|submit\s+(the\s+)?(form|credentials)|enter\s+(an?\s+)?(email|password))\b/.test(text);
|
|
83550
83742
|
if (visibilityOnlyGoal) {
|
|
83551
83743
|
const assertCount2 = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT").length;
|
|
83552
83744
|
return assertCount2 > 0;
|
|
83553
83745
|
}
|
|
83554
|
-
const completionIntent = scenario.type === "HAPPY_PATH" || /\b(happy\s*path|successful|with\s+valid|complete\s+(the\s+)?(login|sign[- ]?in|registration|checkout|purchase))\b/.test(text);
|
|
83746
|
+
const completionIntent = scenario.type === "HAPPY_PATH" || scenario.type === "USER_JOURNEY" || /\b(happy\s*path|successful|with\s+valid|complete\s+(the\s+)?(login|sign[- ]?in|registration|checkout|purchase)|user\s+can|should\s+be\s+able)\b/.test(text);
|
|
83555
83747
|
const formIntent = /\b(sign\s*in|log\s*in|login|authenticate|register|sign\s*up|checkout|create|save|submit|send|change|update|edit)\b/.test(text);
|
|
83556
83748
|
if (completionIntent && formIntent)
|
|
83557
83749
|
return false;
|
|
83750
|
+
if (completionIntent && /\b(like|unlike|share|follow|bookmark|download|subscribe|create|save|send|post|delete|remove|add|play|pause)\b/i.test(text)) {
|
|
83751
|
+
return false;
|
|
83752
|
+
}
|
|
83753
|
+
if (completionIntent) {
|
|
83754
|
+
return false;
|
|
83755
|
+
}
|
|
83558
83756
|
const assertCount = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT").length;
|
|
83559
83757
|
return assertCount > 0;
|
|
83560
83758
|
}
|
|
@@ -83564,7 +83762,18 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83564
83762
|
const completesFlow = /\b(happy\s*path|successful|complete\s+(the\s+)?(login|sign[- ]?in|registration|checkout)|with\s+valid)\b/.test(text);
|
|
83565
83763
|
return navigates && !completesFlow;
|
|
83566
83764
|
}
|
|
83765
|
+
function isCancelDiscardScenario(scenario) {
|
|
83766
|
+
const text = scenarioText(scenario);
|
|
83767
|
+
if (/\bcancel\s+(?:the|my|a|an|this|your|their)?\s*(subscription|order|booking|trip|reservation|membership|plan|purchase|payment|appointment|ticket|flight|ride)\b/i.test(text)) {
|
|
83768
|
+
return false;
|
|
83769
|
+
}
|
|
83770
|
+
const cancelEditPhrase = /\b(cancel|discard|revert|undo)\s+(?:(?:the|my|a|an|this|your|their|all)\s+)?(?:unsaved\s+)?(change|changes|edit|edits|update|updates|draft|input|inputs)\b/i.test(text) || /\b(change|changes|edit|edits|update|updates|draft)\s+(?:are\s+)?(cancelled|canceled|discarded|reverted|undone)\b/i.test(text) || /\breject\s+(?:(?:the|my|a|an|this|your|their|all)\s+)?(change|changes|edit|edits|update|updates|draft)\b/i.test(text);
|
|
83771
|
+
const discardWithoutSave = /\b(without\s+saving|do\s+not\s+save|don't\s+save)\b/i.test(text) && /\b(cancel|discard|revert|undo|leave|exit|back|dismiss)\b/i.test(text);
|
|
83772
|
+
return cancelEditPhrase || discardWithoutSave;
|
|
83773
|
+
}
|
|
83567
83774
|
function isFormValidationScenario(scenario) {
|
|
83775
|
+
if (isCancelDiscardScenario(scenario))
|
|
83776
|
+
return false;
|
|
83568
83777
|
if (scenario.variant === "validation")
|
|
83569
83778
|
return true;
|
|
83570
83779
|
if (scenario.type !== "EDGE_CASE")
|
|
@@ -83575,6 +83784,8 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83575
83784
|
function isFormMutationHappyPath(scenario) {
|
|
83576
83785
|
if (isNavigationFocusedScenario(scenario))
|
|
83577
83786
|
return false;
|
|
83787
|
+
if (isCancelDiscardScenario(scenario))
|
|
83788
|
+
return false;
|
|
83578
83789
|
if (isFormValidationScenario(scenario))
|
|
83579
83790
|
return false;
|
|
83580
83791
|
const text = scenarioText(scenario);
|
|
@@ -83587,9 +83798,14 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83587
83798
|
if (/\b(show|display|visible|options?|providers?|links?)\b/.test(text) && !/\b(change|update|create|save|send|register|edit|post|write|compose|delete|add|set)\b/.test(text)) {
|
|
83588
83799
|
return false;
|
|
83589
83800
|
}
|
|
83590
|
-
|
|
83591
|
-
|
|
83592
|
-
|
|
83801
|
+
if (/\b(play|pause|resume|playback|seek|volume|mute|unmute|shuffle|repeat|now\s+playing|mini\s*player)\b/.test(text) && !/\b(playlist\s+name|edit\s+(track|song|clip)|upload|caption|comment|description|save\s+to|add\s+to\s+(a\s+)?playlist|create\s+(a\s+)?playlist|rename)\b/.test(text)) {
|
|
83802
|
+
return false;
|
|
83803
|
+
}
|
|
83804
|
+
const formObject = "password|email|profile|message|post|item|record|form|settings|account|name|title|description|comment|bio|phone|address|payment|card|user|note|task|entry";
|
|
83805
|
+
const mutationVerb = "change|update|create|save|send|register|sign\\s*up|checkout|edit|post|write|compose|set|add|delete|remove";
|
|
83806
|
+
const determiner = "(?:(?:the|a|an|my|your|their|this|that)\\s+)?(?:new\\s+)?";
|
|
83807
|
+
const mutatesFormObject = new RegExp(`\\b(?:${mutationVerb})\\s+${determiner}(?:${formObject})\\b`).test(text) || new RegExp(`\\b(?:${formObject})\\s+(?:${mutationVerb})\\b`).test(text);
|
|
83808
|
+
return mutatesFormObject;
|
|
83593
83809
|
}
|
|
83594
83810
|
function isNavigationChromeTap(action) {
|
|
83595
83811
|
if (action.type !== "TAP")
|
|
@@ -83678,24 +83894,61 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83678
83894
|
}
|
|
83679
83895
|
function scenarioIntentMismatchReason(scenario, actions) {
|
|
83680
83896
|
const text = scenarioText(scenario);
|
|
83897
|
+
if (isContentActionScenario(scenario)) {
|
|
83898
|
+
const hasActionTap = actions.some((a) => isContentActionTap(a));
|
|
83899
|
+
if (!hasActionTap) {
|
|
83900
|
+
return "content-action scenario (like/share/follow/\u2026) did not record a tap on a matching control";
|
|
83901
|
+
}
|
|
83902
|
+
if (isNavChromeThrashTrace(actions)) {
|
|
83903
|
+
return "content-action scenario only recorded tab thrash / swipes \u2014 no product action";
|
|
83904
|
+
}
|
|
83905
|
+
const asserts2 = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT");
|
|
83906
|
+
if (asserts2.length > 0 && asserts2.every((a) => VOLATILE_BADGE_ASSERT_RE.test(actionText(a)) || NAV_CHROME_TAP_RE.test(actionText(a)) && !CONTENT_ACTION_VERB_RE.test(actionText(a)))) {
|
|
83907
|
+
return "content-action scenario only asserted tab chrome or a volatile badge count \u2014 assert the action outcome instead";
|
|
83908
|
+
}
|
|
83909
|
+
return null;
|
|
83910
|
+
}
|
|
83681
83911
|
if (isInspectionOnlyScenario(scenario, actions)) {
|
|
83682
83912
|
return null;
|
|
83683
83913
|
}
|
|
83684
83914
|
if (isNavigationFocusedScenario(scenario)) {
|
|
83685
83915
|
return null;
|
|
83686
83916
|
}
|
|
83917
|
+
if (isCancelDiscardScenario(scenario)) {
|
|
83918
|
+
const hasCancelTap = actions.some((a) => {
|
|
83919
|
+
if (a.type !== "TAP")
|
|
83920
|
+
return false;
|
|
83921
|
+
return /\b(cancel|discard|close|dismiss|revert|undo|not\s+now)\b/.test(actionText(a));
|
|
83922
|
+
});
|
|
83923
|
+
const lastNavIdx = (() => {
|
|
83924
|
+
for (let i = actions.length - 1; i >= 0; i--) {
|
|
83925
|
+
const t = actions[i].type;
|
|
83926
|
+
if (t === "TAP" || t === "BACK" || t === "TYPE" || t === "CLEAR")
|
|
83927
|
+
return i;
|
|
83928
|
+
}
|
|
83929
|
+
return -1;
|
|
83930
|
+
})();
|
|
83931
|
+
const backAsDismiss = lastNavIdx >= 0 && actions[lastNavIdx].type === "BACK" && /\b(back|leave|exit|dismiss)\b/i.test(text) && /\b(without\s+saving|do\s+not\s+save|don't\s+save|discard|cancel)\b/i.test(text);
|
|
83932
|
+
if (!hasCancelTap && !backAsDismiss) {
|
|
83933
|
+
return "cancel/discard scenario did not record a cancel/dismiss action";
|
|
83934
|
+
}
|
|
83935
|
+
return null;
|
|
83936
|
+
}
|
|
83687
83937
|
if (isFormValidationScenario(scenario)) {
|
|
83688
83938
|
const typedFields = actions.some((a) => a.type === "TYPE");
|
|
83689
83939
|
const hasCommit = actions.some((a) => isFormCommitAction(a));
|
|
83690
83940
|
const hasValidationAssert = actions.some((a) => {
|
|
83691
83941
|
if (a.type !== "ASSERT_VISIBLE" && a.type !== "ASSERT_TEXT")
|
|
83692
83942
|
return false;
|
|
83693
|
-
return /\b(error|required|invalid|empty|missing|incorrect|wrong|try again|mismatch|does not match|must match)\b/.test(actionText(a));
|
|
83943
|
+
return /\b(error|required|invalid|empty|missing|incorrect|wrong|try again|mismatch|does not match|must match|cannot be empty|please enter|fill out|is required)\b/.test(actionText(a));
|
|
83694
83944
|
});
|
|
83695
83945
|
const emptyFieldIntent = /\b(empty|required|missing|blank)\b/.test(text);
|
|
83696
83946
|
const invalidValueIntent = /\b(wrong|incorrect|invalid|mismatch|reject)\b/.test(text);
|
|
83947
|
+
if (!hasValidationAssert) {
|
|
83948
|
+
return "validation scenario did not assert a validation/error outcome (commit alone is not proof)";
|
|
83949
|
+
}
|
|
83697
83950
|
if (emptyFieldIntent && !invalidValueIntent) {
|
|
83698
|
-
if (!hasCommit
|
|
83951
|
+
if (!hasCommit) {
|
|
83699
83952
|
return "validation scenario did not record a form commit or validation outcome";
|
|
83700
83953
|
}
|
|
83701
83954
|
return null;
|
|
@@ -83703,7 +83956,7 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83703
83956
|
if (typedFields && !hasCommit) {
|
|
83704
83957
|
return "validation scenario filled fields but never committed the form";
|
|
83705
83958
|
}
|
|
83706
|
-
if (!hasCommit
|
|
83959
|
+
if (!hasCommit) {
|
|
83707
83960
|
return "validation scenario did not record a form commit or validation outcome";
|
|
83708
83961
|
}
|
|
83709
83962
|
return null;
|
|
@@ -83717,6 +83970,10 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83717
83970
|
if (!hasCommit) {
|
|
83718
83971
|
return "form-mutation happy path did not record a form commit";
|
|
83719
83972
|
}
|
|
83973
|
+
const asserts2 = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT");
|
|
83974
|
+
if (asserts2.length > 0 && asserts2.every((a) => NAV_CHROME_TAP_RE.test(actionText(a)) || VOLATILE_BADGE_ASSERT_RE.test(actionText(a)) || isStructuralOnlyAssert(a) || isEphemeralContentAssertText(assertIdentityText(a)))) {
|
|
83975
|
+
return "form-mutation happy path only asserted tab chrome or ephemeral content \u2014 assert the saved/updated product outcome";
|
|
83976
|
+
}
|
|
83720
83977
|
}
|
|
83721
83978
|
const isCredentialSignIn = /\b(sign\s*in|log\s*in|login|authenticate|auth)\b/.test(text) && /\b(email|e-mail|password|credential|valid credentials?)\b/.test(text) && !/\b(reset|forgot|recover|logout|log\s*out|sign\s*out|change\s+password|update\s+password)\b/.test(text);
|
|
83722
83979
|
const typedEmailIndexes = [];
|
|
@@ -83777,33 +84034,102 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83777
84034
|
}
|
|
83778
84035
|
}
|
|
83779
84036
|
const isHappyPath = /\b(happy\s*path|successful|success|create|save|submit|complete|checkout|send|post)\b/.test(text) || scenario.type === "HAPPY_PATH";
|
|
83780
|
-
if (
|
|
83781
|
-
|
|
83782
|
-
|
|
83783
|
-
|
|
83784
|
-
|
|
83785
|
-
|
|
83786
|
-
|
|
83787
|
-
|
|
83788
|
-
|
|
83789
|
-
|
|
83790
|
-
|
|
83791
|
-
|
|
83792
|
-
|
|
83793
|
-
|
|
83794
|
-
|
|
83795
|
-
|
|
83796
|
-
|
|
83797
|
-
|
|
83798
|
-
|
|
83799
|
-
|
|
83800
|
-
|
|
83801
|
-
|
|
83802
|
-
|
|
83803
|
-
|
|
84037
|
+
if (isHappyPath) {
|
|
84038
|
+
let lastTypeIndex = -1;
|
|
84039
|
+
let lastAssertIndex = -1;
|
|
84040
|
+
actions.forEach((action, index) => {
|
|
84041
|
+
if (action.type === "TYPE")
|
|
84042
|
+
lastTypeIndex = index;
|
|
84043
|
+
if (action.type === "ASSERT_VISIBLE" || action.type === "ASSERT_TEXT")
|
|
84044
|
+
lastAssertIndex = index;
|
|
84045
|
+
});
|
|
84046
|
+
if (lastTypeIndex >= 0 && lastAssertIndex > lastTypeIndex) {
|
|
84047
|
+
const typeScreen = actions[lastTypeIndex]?.metadata?.screenName?.trim() ?? "";
|
|
84048
|
+
const assertScreen = actions[lastAssertIndex]?.metadata?.screenName?.trim() ?? "";
|
|
84049
|
+
const screensDiffer = typeScreen !== "" && assertScreen !== "" && typeScreen !== assertScreen;
|
|
84050
|
+
const lastTypeAction = actions[lastTypeIndex];
|
|
84051
|
+
const keyboardCommitOnLastType = lastTypeAction != null && isKeyboardFormCommit(lastTypeAction);
|
|
84052
|
+
const commitAfterType = keyboardCommitOnLastType || actions.some((action, index) => {
|
|
84053
|
+
if (index <= lastTypeIndex || index >= lastAssertIndex)
|
|
84054
|
+
return false;
|
|
84055
|
+
return isFormCommitAction(action);
|
|
84056
|
+
});
|
|
84057
|
+
if (screensDiffer && !commitAfterType) {
|
|
84058
|
+
return "form fields were filled then a success assert was recorded without a commit/submit tap between them";
|
|
84059
|
+
}
|
|
84060
|
+
}
|
|
84061
|
+
}
|
|
84062
|
+
if (isNavChromeThrashTrace(actions) && !isNavigationFocusedScenario(scenario) && !isFormMutationHappyPath(scenario) && !isFormValidationScenario(scenario) && !isCredentialSignIn && !isAuthLikeScenario && !isHarnessOrVisibilityScenario(scenario)) {
|
|
84063
|
+
return "recording is only bottom-nav thrash and swipes \u2014 does not execute the scenario goal";
|
|
84064
|
+
}
|
|
84065
|
+
if (requiresFeatureProgress(scenario) && !isFormValidationScenario(scenario) && !isCredentialSignIn && !isAuthLikeScenario) {
|
|
84066
|
+
if (!actions.some((a) => isProductiveScenarioAction(a, text))) {
|
|
84067
|
+
return "happy-path / user-journey scenario did not record a productive product action (only chrome, gestures, or empty work)";
|
|
84068
|
+
}
|
|
84069
|
+
const asserts2 = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT");
|
|
84070
|
+
if (asserts2.length > 0 && asserts2.every((a) => VOLATILE_BADGE_ASSERT_RE.test(actionText(a)) || isStructuralOnlyAssert(a))) {
|
|
84071
|
+
return "happy-path / user-journey scenario only asserted volatile badges or structural roots \u2014 assert a durable feature outcome";
|
|
84072
|
+
}
|
|
84073
|
+
}
|
|
84074
|
+
const goalFidelity = scenarioGoalActionFidelityReason(text, actions);
|
|
84075
|
+
if (goalFidelity)
|
|
84076
|
+
return goalFidelity;
|
|
84077
|
+
if (actions.some((a) => isBareHierarchyFieldAction(a))) {
|
|
84078
|
+
return "typed or tapped a bare hierarchy/container target with no accessible label \u2014 use a labeled field/control";
|
|
84079
|
+
}
|
|
84080
|
+
const asserts = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT");
|
|
84081
|
+
if (asserts.length > 0 && asserts.every((a) => isEphemeralContentAssertText(assertIdentityText(a)))) {
|
|
84082
|
+
return "only asserted ephemeral feed/catalog content (session-specific titles/ids) \u2014 assert durable product chrome or stable outcome";
|
|
84083
|
+
}
|
|
84084
|
+
return null;
|
|
84085
|
+
}
|
|
84086
|
+
function scenarioGoalActionFidelityReason(scenarioTextLower, actions) {
|
|
84087
|
+
const actionBlob = actions.map((a) => actionText(a)).join(" ").toLowerCase();
|
|
84088
|
+
if (/\b(pick|choose|select)\b.*\b(library|gallery|photos?|camera\s*roll|device)\b|\bfrom\s+(the\s+)?(library|gallery|photos?)\b/.test(scenarioTextLower)) {
|
|
84089
|
+
if (!/\b(library|gallery|photos?|camera\s*roll|pick\s+a\s+video|choose\s+(a\s+)?(video|photo|file)|from\s+library|document\s*picker|media\s*picker)\b/i.test(actionBlob)) {
|
|
84090
|
+
return "scenario claims pick-from-library but recording never tapped a library/gallery/picker control";
|
|
84091
|
+
}
|
|
84092
|
+
}
|
|
84093
|
+
if (/\b(style|styles)\b/.test(scenarioTextLower) && /\b(format|aspect|ratio|quality|reels?|9:16|16:9)\b/.test(scenarioTextLower)) {
|
|
84094
|
+
const pickedStyle = /\b(style|cinematic|anime|realistic|no\s*style|cartoon|oil\s*paint)\b/i.test(actionBlob);
|
|
84095
|
+
const pickedFormat = /\b(9:16|16:9|1:1|reels?|aspect|quality|format|720|1080)\b/i.test(actionBlob);
|
|
84096
|
+
if (!pickedStyle || !pickedFormat) {
|
|
84097
|
+
return "scenario claims style+format selection but recording did not select both a style and a format/aspect control";
|
|
84098
|
+
}
|
|
84099
|
+
}
|
|
84100
|
+
if (/\b(open|launch|start)\b.*\b(camera|recording)\b|\brecord\s+a\s+video\b/.test(scenarioTextLower)) {
|
|
84101
|
+
if (!/\b(camera|record|recording|flash|flip\s+camera|capture|shutter)\b/i.test(actionBlob)) {
|
|
84102
|
+
return "scenario claims open/record camera but recording never reached camera controls";
|
|
84103
|
+
}
|
|
83804
84104
|
}
|
|
83805
84105
|
return null;
|
|
83806
84106
|
}
|
|
84107
|
+
function isBareHierarchyFieldAction(action) {
|
|
84108
|
+
if (action.type !== "TYPE" && action.type !== "CLEAR")
|
|
84109
|
+
return false;
|
|
84110
|
+
const sel = (action.selector ?? "").trim();
|
|
84111
|
+
if (!/^\/hierarchy/i.test(sel))
|
|
84112
|
+
return false;
|
|
84113
|
+
const bundle = action.metadata.locatorBundle;
|
|
84114
|
+
const label = (action.metadata.targetLabel ?? "").trim();
|
|
84115
|
+
if (label && !/^element$/i.test(label))
|
|
84116
|
+
return false;
|
|
84117
|
+
const inner = nonEmpty3(action.innerText);
|
|
84118
|
+
if (inner && !/^element$/i.test(inner))
|
|
84119
|
+
return false;
|
|
84120
|
+
if (nonEmpty3(bundle?.text) || nonEmpty3(bundle?.contentDesc) || nonEmpty3(bundle?.accessibilityId)) {
|
|
84121
|
+
return false;
|
|
84122
|
+
}
|
|
84123
|
+
if (nonEmpty3(bundle?.resourceId) && !isStructuralAssertionIdentity(bundle?.resourceId)) {
|
|
84124
|
+
return false;
|
|
84125
|
+
}
|
|
84126
|
+
if (action.type === "TYPE") {
|
|
84127
|
+
const v = (action.value ?? "").replace(/\s+/g, "");
|
|
84128
|
+
if (v.length > 0)
|
|
84129
|
+
return false;
|
|
84130
|
+
}
|
|
84131
|
+
return true;
|
|
84132
|
+
}
|
|
83807
84133
|
function actionCycleKey(action) {
|
|
83808
84134
|
return `${action.type}|${action.selector}|${action.value ?? ""}`;
|
|
83809
84135
|
}
|
|
@@ -84055,6 +84381,38 @@ ${statePacket}`, redactionCredentials) },
|
|
|
84055
84381
|
lines.push("});");
|
|
84056
84382
|
return lines.join("\n");
|
|
84057
84383
|
}
|
|
84384
|
+
function isEphemeralContentAssertText(text) {
|
|
84385
|
+
const t = text.trim();
|
|
84386
|
+
if (!t)
|
|
84387
|
+
return false;
|
|
84388
|
+
if (/\b\d+\s*(s|sec|secs|second|seconds|m|min|mins|minute|minutes|h|hr|hrs|hour|hours|d|day|days|w|wk|wks|week|weeks|mo|mos|month|months|y|yr|yrs|year|years)\s+ago\b/i.test(t)) {
|
|
84389
|
+
return true;
|
|
84390
|
+
}
|
|
84391
|
+
if (/\b(just\s+now|moments?\s+ago|yesterday)\b/i.test(t))
|
|
84392
|
+
return true;
|
|
84393
|
+
if (/\btoday\s+at\s+\d{1,2}:\d{2}\b/i.test(t))
|
|
84394
|
+
return true;
|
|
84395
|
+
const feedish = /\b(followed|liked|commented|replied|mentioned|shared|posted|unread|notification|message from|new follower)\b/i.test(t) || /\b\d+\s*(s|m|h|d|w)\s+ago\b/i.test(t);
|
|
84396
|
+
if (feedish && t.length >= 70 && /[.!?].+\s/.test(t) && t.split(/\s+/).length >= 10) {
|
|
84397
|
+
return true;
|
|
84398
|
+
}
|
|
84399
|
+
if (t.length >= 40 && /\b(error\s+\d{3,}|generation failed|rate limit|quota exceeded)\b/i.test(t)) {
|
|
84400
|
+
return true;
|
|
84401
|
+
}
|
|
84402
|
+
if (/\b(harness|seed|fixture|demo\s*data|test\s*artist|qa\s*published)\b/i.test(t) && /\d{6,}/.test(t)) {
|
|
84403
|
+
return true;
|
|
84404
|
+
}
|
|
84405
|
+
if (/\bplay\b.+\bby\b.+/i.test(t) && (t.length >= 40 || /\d{6,}/.test(t))) {
|
|
84406
|
+
return true;
|
|
84407
|
+
}
|
|
84408
|
+
if (/^play\s+/i.test(t) && t.length >= 35 && !/\b(home|search|settings|profile|library|playlist|sign\s*in|log\s*in)\b/i.test(t)) {
|
|
84409
|
+
return true;
|
|
84410
|
+
}
|
|
84411
|
+
return false;
|
|
84412
|
+
}
|
|
84413
|
+
function assertIdentityText(action) {
|
|
84414
|
+
return [action.selector, action.value, action.innerText, action.metadata?.targetLabel].filter((v) => typeof v === "string" && v.trim().length > 0).join(" ");
|
|
84415
|
+
}
|
|
84058
84416
|
function evaluateMobileAssertionStrength(actions) {
|
|
84059
84417
|
const modelAsserts = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT");
|
|
84060
84418
|
if (modelAsserts.length === 0) {
|
|
@@ -84090,6 +84448,24 @@ ${statePacket}`, redactionCredentials) },
|
|
|
84090
84448
|
}
|
|
84091
84449
|
};
|
|
84092
84450
|
}
|
|
84451
|
+
const ephemeral = modelAsserts.filter((a) => isEphemeralContentAssertText(assertIdentityText(a)));
|
|
84452
|
+
const durable = modelAsserts.filter((a) => !isEphemeralContentAssertText(assertIdentityText(a)));
|
|
84453
|
+
if (ephemeral.length > 0 && durable.length === 0) {
|
|
84454
|
+
return {
|
|
84455
|
+
ok: false,
|
|
84456
|
+
severity: "block",
|
|
84457
|
+
reason: "only ephemeral content assertions (relative times, long feed/notification copy, or backend error strings) \u2014 assert durable chrome or run-scoped data instead",
|
|
84458
|
+
signals: {
|
|
84459
|
+
apiTest: false,
|
|
84460
|
+
interacted: true,
|
|
84461
|
+
mutated: actions.some((a) => a.type === "TYPE"),
|
|
84462
|
+
navOnly: false,
|
|
84463
|
+
hasOutcomeProof: false,
|
|
84464
|
+
errorBanner: false,
|
|
84465
|
+
terminal: null
|
|
84466
|
+
}
|
|
84467
|
+
};
|
|
84468
|
+
}
|
|
84093
84469
|
const code = mobileActionsToPseudoPlaywright(actions);
|
|
84094
84470
|
const interacted = actions.some((a) => a.type === "TAP" || a.type === "TYPE" || a.type === "CLEAR");
|
|
84095
84471
|
return (0, shared_1.validateAssertionStrength)(code, { interactionPerformed: interacted });
|
|
@@ -84965,6 +85341,7 @@ Reason over steps + error + tree + registry and return working healed steps. Do
|
|
|
84965
85341
|
For a fix, return the COMPLETE steps array (not a diff).`;
|
|
84966
85342
|
var DEFAULT_SCRIPT_MAX_ATTEMPTS = 6;
|
|
84967
85343
|
var RECOVERABLE_MAX = 3;
|
|
85344
|
+
var MAX_CONSECUTIVE_INVALID_VERDICTS = 3;
|
|
84968
85345
|
var BONUS_ATTEMPTS_CEIL = 4;
|
|
84969
85346
|
var DEFAULT_BONUS_ATTEMPTS = 2;
|
|
84970
85347
|
var MAX_LOG_CHARS = 4096;
|
|
@@ -85570,6 +85947,7 @@ ${args.directive}`);
|
|
|
85570
85947
|
const triedLocators = [];
|
|
85571
85948
|
let sameErrorCount = 0;
|
|
85572
85949
|
let lastErrorSignature = null;
|
|
85950
|
+
let consecutiveInvalidVerdicts = 0;
|
|
85573
85951
|
const markRecoverableTurn = () => {
|
|
85574
85952
|
if (recoverableUsed < RECOVERABLE_MAX) {
|
|
85575
85953
|
attemptCap += 1;
|
|
@@ -85643,11 +86021,22 @@ ${args.directive}`);
|
|
|
85643
86021
|
aiResponseCount += 1;
|
|
85644
86022
|
const parsed = parseHealVerdict(content);
|
|
85645
86023
|
if (!parsed) {
|
|
85646
|
-
|
|
86024
|
+
consecutiveInvalidVerdicts += 1;
|
|
86025
|
+
options.onProgress?.(`Phase 1 attempt ${attempt}: response was not a valid verdict (${content.length} chars, finish=${finishReason ?? "unknown"}) \u2014 granting a recovery turn (${consecutiveInvalidVerdicts}/${MAX_CONSECUTIVE_INVALID_VERDICTS} consecutive)`);
|
|
86026
|
+
if (consecutiveInvalidVerdicts >= MAX_CONSECUTIVE_INVALID_VERDICTS) {
|
|
86027
|
+
options.onProgress?.(`Phase 1 aborted: ${consecutiveInvalidVerdicts} consecutive invalid verdicts \u2014 freeing device`);
|
|
86028
|
+
return {
|
|
86029
|
+
passed: false,
|
|
86030
|
+
verdict: "config_issue",
|
|
86031
|
+
healReason: `heal model returned ${consecutiveInvalidVerdicts} consecutive non-verdict responses (last ${content.length} chars, finish=${finishReason ?? "unknown"}) \u2014 aborting to free the device`,
|
|
86032
|
+
attemptsUsed: attempt
|
|
86033
|
+
};
|
|
86034
|
+
}
|
|
85647
86035
|
markRecoverableTurn();
|
|
85648
|
-
pendingDirective = "Your last response was not valid JSON matching the verdict schema. Return exactly one JSON verdict object.";
|
|
86036
|
+
pendingDirective = "Your last response was not valid JSON matching the verdict schema. Return exactly one JSON verdict object \u2014 no prose, no markdown fences.";
|
|
85649
86037
|
continue;
|
|
85650
86038
|
}
|
|
86039
|
+
consecutiveInvalidVerdicts = 0;
|
|
85651
86040
|
if (TERMINAL_VERDICTS.has(parsed.verdict)) {
|
|
85652
86041
|
return { passed: false, verdict: parsed.verdict, healReason: parsed.reason, attemptsUsed: attempt };
|
|
85653
86042
|
}
|
|
@@ -101142,2285 +101531,6 @@ var require_rate_limit_detector = __commonJS({
|
|
|
101142
101531
|
}
|
|
101143
101532
|
});
|
|
101144
101533
|
|
|
101145
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/base64.js
|
|
101146
|
-
var require_base64 = __commonJS({
|
|
101147
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/base64.js"(exports2) {
|
|
101148
|
-
"use strict";
|
|
101149
|
-
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
101150
|
-
exports2.encode = function(number) {
|
|
101151
|
-
if (0 <= number && number < intToCharMap.length) {
|
|
101152
|
-
return intToCharMap[number];
|
|
101153
|
-
}
|
|
101154
|
-
throw new TypeError("Must be between 0 and 63: " + number);
|
|
101155
|
-
};
|
|
101156
|
-
exports2.decode = function(charCode) {
|
|
101157
|
-
var bigA = 65;
|
|
101158
|
-
var bigZ = 90;
|
|
101159
|
-
var littleA = 97;
|
|
101160
|
-
var littleZ = 122;
|
|
101161
|
-
var zero = 48;
|
|
101162
|
-
var nine = 57;
|
|
101163
|
-
var plus = 43;
|
|
101164
|
-
var slash = 47;
|
|
101165
|
-
var littleOffset = 26;
|
|
101166
|
-
var numberOffset = 52;
|
|
101167
|
-
if (bigA <= charCode && charCode <= bigZ) {
|
|
101168
|
-
return charCode - bigA;
|
|
101169
|
-
}
|
|
101170
|
-
if (littleA <= charCode && charCode <= littleZ) {
|
|
101171
|
-
return charCode - littleA + littleOffset;
|
|
101172
|
-
}
|
|
101173
|
-
if (zero <= charCode && charCode <= nine) {
|
|
101174
|
-
return charCode - zero + numberOffset;
|
|
101175
|
-
}
|
|
101176
|
-
if (charCode == plus) {
|
|
101177
|
-
return 62;
|
|
101178
|
-
}
|
|
101179
|
-
if (charCode == slash) {
|
|
101180
|
-
return 63;
|
|
101181
|
-
}
|
|
101182
|
-
return -1;
|
|
101183
|
-
};
|
|
101184
|
-
}
|
|
101185
|
-
});
|
|
101186
|
-
|
|
101187
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/base64-vlq.js
|
|
101188
|
-
var require_base64_vlq = __commonJS({
|
|
101189
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/base64-vlq.js"(exports2) {
|
|
101190
|
-
"use strict";
|
|
101191
|
-
var base64 = require_base64();
|
|
101192
|
-
var VLQ_BASE_SHIFT = 5;
|
|
101193
|
-
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
101194
|
-
var VLQ_BASE_MASK = VLQ_BASE - 1;
|
|
101195
|
-
var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
|
101196
|
-
function toVLQSigned(aValue) {
|
|
101197
|
-
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
|
|
101198
|
-
}
|
|
101199
|
-
function fromVLQSigned(aValue) {
|
|
101200
|
-
var isNegative = (aValue & 1) === 1;
|
|
101201
|
-
var shifted = aValue >> 1;
|
|
101202
|
-
return isNegative ? -shifted : shifted;
|
|
101203
|
-
}
|
|
101204
|
-
exports2.encode = function base64VLQ_encode(aValue) {
|
|
101205
|
-
var encoded = "";
|
|
101206
|
-
var digit;
|
|
101207
|
-
var vlq = toVLQSigned(aValue);
|
|
101208
|
-
do {
|
|
101209
|
-
digit = vlq & VLQ_BASE_MASK;
|
|
101210
|
-
vlq >>>= VLQ_BASE_SHIFT;
|
|
101211
|
-
if (vlq > 0) {
|
|
101212
|
-
digit |= VLQ_CONTINUATION_BIT;
|
|
101213
|
-
}
|
|
101214
|
-
encoded += base64.encode(digit);
|
|
101215
|
-
} while (vlq > 0);
|
|
101216
|
-
return encoded;
|
|
101217
|
-
};
|
|
101218
|
-
exports2.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
|
101219
|
-
var strLen = aStr.length;
|
|
101220
|
-
var result = 0;
|
|
101221
|
-
var shift = 0;
|
|
101222
|
-
var continuation, digit;
|
|
101223
|
-
do {
|
|
101224
|
-
if (aIndex >= strLen) {
|
|
101225
|
-
throw new Error("Expected more digits in base 64 VLQ value.");
|
|
101226
|
-
}
|
|
101227
|
-
digit = base64.decode(aStr.charCodeAt(aIndex++));
|
|
101228
|
-
if (digit === -1) {
|
|
101229
|
-
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
|
101230
|
-
}
|
|
101231
|
-
continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
|
101232
|
-
digit &= VLQ_BASE_MASK;
|
|
101233
|
-
result = result + (digit << shift);
|
|
101234
|
-
shift += VLQ_BASE_SHIFT;
|
|
101235
|
-
} while (continuation);
|
|
101236
|
-
aOutParam.value = fromVLQSigned(result);
|
|
101237
|
-
aOutParam.rest = aIndex;
|
|
101238
|
-
};
|
|
101239
|
-
}
|
|
101240
|
-
});
|
|
101241
|
-
|
|
101242
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/util.js
|
|
101243
|
-
var require_util4 = __commonJS({
|
|
101244
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/util.js"(exports2) {
|
|
101245
|
-
"use strict";
|
|
101246
|
-
function getArg(aArgs, aName, aDefaultValue) {
|
|
101247
|
-
if (aName in aArgs) {
|
|
101248
|
-
return aArgs[aName];
|
|
101249
|
-
} else if (arguments.length === 3) {
|
|
101250
|
-
return aDefaultValue;
|
|
101251
|
-
} else {
|
|
101252
|
-
throw new Error('"' + aName + '" is a required argument.');
|
|
101253
|
-
}
|
|
101254
|
-
}
|
|
101255
|
-
exports2.getArg = getArg;
|
|
101256
|
-
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
|
|
101257
|
-
var dataUrlRegexp = /^data:.+\,.+$/;
|
|
101258
|
-
function urlParse(aUrl) {
|
|
101259
|
-
var match = aUrl.match(urlRegexp);
|
|
101260
|
-
if (!match) {
|
|
101261
|
-
return null;
|
|
101262
|
-
}
|
|
101263
|
-
return {
|
|
101264
|
-
scheme: match[1],
|
|
101265
|
-
auth: match[2],
|
|
101266
|
-
host: match[3],
|
|
101267
|
-
port: match[4],
|
|
101268
|
-
path: match[5]
|
|
101269
|
-
};
|
|
101270
|
-
}
|
|
101271
|
-
exports2.urlParse = urlParse;
|
|
101272
|
-
function urlGenerate(aParsedUrl) {
|
|
101273
|
-
var url = "";
|
|
101274
|
-
if (aParsedUrl.scheme) {
|
|
101275
|
-
url += aParsedUrl.scheme + ":";
|
|
101276
|
-
}
|
|
101277
|
-
url += "//";
|
|
101278
|
-
if (aParsedUrl.auth) {
|
|
101279
|
-
url += aParsedUrl.auth + "@";
|
|
101280
|
-
}
|
|
101281
|
-
if (aParsedUrl.host) {
|
|
101282
|
-
url += aParsedUrl.host;
|
|
101283
|
-
}
|
|
101284
|
-
if (aParsedUrl.port) {
|
|
101285
|
-
url += ":" + aParsedUrl.port;
|
|
101286
|
-
}
|
|
101287
|
-
if (aParsedUrl.path) {
|
|
101288
|
-
url += aParsedUrl.path;
|
|
101289
|
-
}
|
|
101290
|
-
return url;
|
|
101291
|
-
}
|
|
101292
|
-
exports2.urlGenerate = urlGenerate;
|
|
101293
|
-
function normalize(aPath) {
|
|
101294
|
-
var path = aPath;
|
|
101295
|
-
var url = urlParse(aPath);
|
|
101296
|
-
if (url) {
|
|
101297
|
-
if (!url.path) {
|
|
101298
|
-
return aPath;
|
|
101299
|
-
}
|
|
101300
|
-
path = url.path;
|
|
101301
|
-
}
|
|
101302
|
-
var isAbsolute2 = exports2.isAbsolute(path);
|
|
101303
|
-
var parts = path.split(/\/+/);
|
|
101304
|
-
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
|
101305
|
-
part = parts[i];
|
|
101306
|
-
if (part === ".") {
|
|
101307
|
-
parts.splice(i, 1);
|
|
101308
|
-
} else if (part === "..") {
|
|
101309
|
-
up++;
|
|
101310
|
-
} else if (up > 0) {
|
|
101311
|
-
if (part === "") {
|
|
101312
|
-
parts.splice(i + 1, up);
|
|
101313
|
-
up = 0;
|
|
101314
|
-
} else {
|
|
101315
|
-
parts.splice(i, 2);
|
|
101316
|
-
up--;
|
|
101317
|
-
}
|
|
101318
|
-
}
|
|
101319
|
-
}
|
|
101320
|
-
path = parts.join("/");
|
|
101321
|
-
if (path === "") {
|
|
101322
|
-
path = isAbsolute2 ? "/" : ".";
|
|
101323
|
-
}
|
|
101324
|
-
if (url) {
|
|
101325
|
-
url.path = path;
|
|
101326
|
-
return urlGenerate(url);
|
|
101327
|
-
}
|
|
101328
|
-
return path;
|
|
101329
|
-
}
|
|
101330
|
-
exports2.normalize = normalize;
|
|
101331
|
-
function join8(aRoot, aPath) {
|
|
101332
|
-
if (aRoot === "") {
|
|
101333
|
-
aRoot = ".";
|
|
101334
|
-
}
|
|
101335
|
-
if (aPath === "") {
|
|
101336
|
-
aPath = ".";
|
|
101337
|
-
}
|
|
101338
|
-
var aPathUrl = urlParse(aPath);
|
|
101339
|
-
var aRootUrl = urlParse(aRoot);
|
|
101340
|
-
if (aRootUrl) {
|
|
101341
|
-
aRoot = aRootUrl.path || "/";
|
|
101342
|
-
}
|
|
101343
|
-
if (aPathUrl && !aPathUrl.scheme) {
|
|
101344
|
-
if (aRootUrl) {
|
|
101345
|
-
aPathUrl.scheme = aRootUrl.scheme;
|
|
101346
|
-
}
|
|
101347
|
-
return urlGenerate(aPathUrl);
|
|
101348
|
-
}
|
|
101349
|
-
if (aPathUrl || aPath.match(dataUrlRegexp)) {
|
|
101350
|
-
return aPath;
|
|
101351
|
-
}
|
|
101352
|
-
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
|
101353
|
-
aRootUrl.host = aPath;
|
|
101354
|
-
return urlGenerate(aRootUrl);
|
|
101355
|
-
}
|
|
101356
|
-
var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
|
|
101357
|
-
if (aRootUrl) {
|
|
101358
|
-
aRootUrl.path = joined;
|
|
101359
|
-
return urlGenerate(aRootUrl);
|
|
101360
|
-
}
|
|
101361
|
-
return joined;
|
|
101362
|
-
}
|
|
101363
|
-
exports2.join = join8;
|
|
101364
|
-
exports2.isAbsolute = function(aPath) {
|
|
101365
|
-
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
101366
|
-
};
|
|
101367
|
-
function relative(aRoot, aPath) {
|
|
101368
|
-
if (aRoot === "") {
|
|
101369
|
-
aRoot = ".";
|
|
101370
|
-
}
|
|
101371
|
-
aRoot = aRoot.replace(/\/$/, "");
|
|
101372
|
-
var level = 0;
|
|
101373
|
-
while (aPath.indexOf(aRoot + "/") !== 0) {
|
|
101374
|
-
var index = aRoot.lastIndexOf("/");
|
|
101375
|
-
if (index < 0) {
|
|
101376
|
-
return aPath;
|
|
101377
|
-
}
|
|
101378
|
-
aRoot = aRoot.slice(0, index);
|
|
101379
|
-
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
|
|
101380
|
-
return aPath;
|
|
101381
|
-
}
|
|
101382
|
-
++level;
|
|
101383
|
-
}
|
|
101384
|
-
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
101385
|
-
}
|
|
101386
|
-
exports2.relative = relative;
|
|
101387
|
-
var supportsNullProto = (function() {
|
|
101388
|
-
var obj = /* @__PURE__ */ Object.create(null);
|
|
101389
|
-
return !("__proto__" in obj);
|
|
101390
|
-
})();
|
|
101391
|
-
function identity(s) {
|
|
101392
|
-
return s;
|
|
101393
|
-
}
|
|
101394
|
-
function toSetString(aStr) {
|
|
101395
|
-
if (isProtoString(aStr)) {
|
|
101396
|
-
return "$" + aStr;
|
|
101397
|
-
}
|
|
101398
|
-
return aStr;
|
|
101399
|
-
}
|
|
101400
|
-
exports2.toSetString = supportsNullProto ? identity : toSetString;
|
|
101401
|
-
function fromSetString(aStr) {
|
|
101402
|
-
if (isProtoString(aStr)) {
|
|
101403
|
-
return aStr.slice(1);
|
|
101404
|
-
}
|
|
101405
|
-
return aStr;
|
|
101406
|
-
}
|
|
101407
|
-
exports2.fromSetString = supportsNullProto ? identity : fromSetString;
|
|
101408
|
-
function isProtoString(s) {
|
|
101409
|
-
if (!s) {
|
|
101410
|
-
return false;
|
|
101411
|
-
}
|
|
101412
|
-
var length = s.length;
|
|
101413
|
-
if (length < 9) {
|
|
101414
|
-
return false;
|
|
101415
|
-
}
|
|
101416
|
-
if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
|
|
101417
|
-
return false;
|
|
101418
|
-
}
|
|
101419
|
-
for (var i = length - 10; i >= 0; i--) {
|
|
101420
|
-
if (s.charCodeAt(i) !== 36) {
|
|
101421
|
-
return false;
|
|
101422
|
-
}
|
|
101423
|
-
}
|
|
101424
|
-
return true;
|
|
101425
|
-
}
|
|
101426
|
-
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
|
101427
|
-
var cmp = strcmp(mappingA.source, mappingB.source);
|
|
101428
|
-
if (cmp !== 0) {
|
|
101429
|
-
return cmp;
|
|
101430
|
-
}
|
|
101431
|
-
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
101432
|
-
if (cmp !== 0) {
|
|
101433
|
-
return cmp;
|
|
101434
|
-
}
|
|
101435
|
-
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
101436
|
-
if (cmp !== 0 || onlyCompareOriginal) {
|
|
101437
|
-
return cmp;
|
|
101438
|
-
}
|
|
101439
|
-
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
101440
|
-
if (cmp !== 0) {
|
|
101441
|
-
return cmp;
|
|
101442
|
-
}
|
|
101443
|
-
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
101444
|
-
if (cmp !== 0) {
|
|
101445
|
-
return cmp;
|
|
101446
|
-
}
|
|
101447
|
-
return strcmp(mappingA.name, mappingB.name);
|
|
101448
|
-
}
|
|
101449
|
-
exports2.compareByOriginalPositions = compareByOriginalPositions;
|
|
101450
|
-
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
|
101451
|
-
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
101452
|
-
if (cmp !== 0) {
|
|
101453
|
-
return cmp;
|
|
101454
|
-
}
|
|
101455
|
-
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
101456
|
-
if (cmp !== 0 || onlyCompareGenerated) {
|
|
101457
|
-
return cmp;
|
|
101458
|
-
}
|
|
101459
|
-
cmp = strcmp(mappingA.source, mappingB.source);
|
|
101460
|
-
if (cmp !== 0) {
|
|
101461
|
-
return cmp;
|
|
101462
|
-
}
|
|
101463
|
-
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
101464
|
-
if (cmp !== 0) {
|
|
101465
|
-
return cmp;
|
|
101466
|
-
}
|
|
101467
|
-
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
101468
|
-
if (cmp !== 0) {
|
|
101469
|
-
return cmp;
|
|
101470
|
-
}
|
|
101471
|
-
return strcmp(mappingA.name, mappingB.name);
|
|
101472
|
-
}
|
|
101473
|
-
exports2.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
|
101474
|
-
function strcmp(aStr1, aStr2) {
|
|
101475
|
-
if (aStr1 === aStr2) {
|
|
101476
|
-
return 0;
|
|
101477
|
-
}
|
|
101478
|
-
if (aStr1 === null) {
|
|
101479
|
-
return 1;
|
|
101480
|
-
}
|
|
101481
|
-
if (aStr2 === null) {
|
|
101482
|
-
return -1;
|
|
101483
|
-
}
|
|
101484
|
-
if (aStr1 > aStr2) {
|
|
101485
|
-
return 1;
|
|
101486
|
-
}
|
|
101487
|
-
return -1;
|
|
101488
|
-
}
|
|
101489
|
-
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
|
101490
|
-
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
101491
|
-
if (cmp !== 0) {
|
|
101492
|
-
return cmp;
|
|
101493
|
-
}
|
|
101494
|
-
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
101495
|
-
if (cmp !== 0) {
|
|
101496
|
-
return cmp;
|
|
101497
|
-
}
|
|
101498
|
-
cmp = strcmp(mappingA.source, mappingB.source);
|
|
101499
|
-
if (cmp !== 0) {
|
|
101500
|
-
return cmp;
|
|
101501
|
-
}
|
|
101502
|
-
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
101503
|
-
if (cmp !== 0) {
|
|
101504
|
-
return cmp;
|
|
101505
|
-
}
|
|
101506
|
-
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
101507
|
-
if (cmp !== 0) {
|
|
101508
|
-
return cmp;
|
|
101509
|
-
}
|
|
101510
|
-
return strcmp(mappingA.name, mappingB.name);
|
|
101511
|
-
}
|
|
101512
|
-
exports2.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
|
101513
|
-
function parseSourceMapInput(str) {
|
|
101514
|
-
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
|
|
101515
|
-
}
|
|
101516
|
-
exports2.parseSourceMapInput = parseSourceMapInput;
|
|
101517
|
-
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
|
101518
|
-
sourceURL = sourceURL || "";
|
|
101519
|
-
if (sourceRoot) {
|
|
101520
|
-
if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
|
|
101521
|
-
sourceRoot += "/";
|
|
101522
|
-
}
|
|
101523
|
-
sourceURL = sourceRoot + sourceURL;
|
|
101524
|
-
}
|
|
101525
|
-
if (sourceMapURL) {
|
|
101526
|
-
var parsed = urlParse(sourceMapURL);
|
|
101527
|
-
if (!parsed) {
|
|
101528
|
-
throw new Error("sourceMapURL could not be parsed");
|
|
101529
|
-
}
|
|
101530
|
-
if (parsed.path) {
|
|
101531
|
-
var index = parsed.path.lastIndexOf("/");
|
|
101532
|
-
if (index >= 0) {
|
|
101533
|
-
parsed.path = parsed.path.substring(0, index + 1);
|
|
101534
|
-
}
|
|
101535
|
-
}
|
|
101536
|
-
sourceURL = join8(urlGenerate(parsed), sourceURL);
|
|
101537
|
-
}
|
|
101538
|
-
return normalize(sourceURL);
|
|
101539
|
-
}
|
|
101540
|
-
exports2.computeSourceURL = computeSourceURL;
|
|
101541
|
-
}
|
|
101542
|
-
});
|
|
101543
|
-
|
|
101544
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/array-set.js
|
|
101545
|
-
var require_array_set = __commonJS({
|
|
101546
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/array-set.js"(exports2) {
|
|
101547
|
-
"use strict";
|
|
101548
|
-
var util = require_util4();
|
|
101549
|
-
var has = Object.prototype.hasOwnProperty;
|
|
101550
|
-
var hasNativeMap = typeof Map !== "undefined";
|
|
101551
|
-
function ArraySet() {
|
|
101552
|
-
this._array = [];
|
|
101553
|
-
this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
|
|
101554
|
-
}
|
|
101555
|
-
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
|
101556
|
-
var set = new ArraySet();
|
|
101557
|
-
for (var i = 0, len = aArray.length; i < len; i++) {
|
|
101558
|
-
set.add(aArray[i], aAllowDuplicates);
|
|
101559
|
-
}
|
|
101560
|
-
return set;
|
|
101561
|
-
};
|
|
101562
|
-
ArraySet.prototype.size = function ArraySet_size() {
|
|
101563
|
-
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
|
101564
|
-
};
|
|
101565
|
-
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
|
101566
|
-
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
|
|
101567
|
-
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
|
101568
|
-
var idx = this._array.length;
|
|
101569
|
-
if (!isDuplicate || aAllowDuplicates) {
|
|
101570
|
-
this._array.push(aStr);
|
|
101571
|
-
}
|
|
101572
|
-
if (!isDuplicate) {
|
|
101573
|
-
if (hasNativeMap) {
|
|
101574
|
-
this._set.set(aStr, idx);
|
|
101575
|
-
} else {
|
|
101576
|
-
this._set[sStr] = idx;
|
|
101577
|
-
}
|
|
101578
|
-
}
|
|
101579
|
-
};
|
|
101580
|
-
ArraySet.prototype.has = function ArraySet_has(aStr) {
|
|
101581
|
-
if (hasNativeMap) {
|
|
101582
|
-
return this._set.has(aStr);
|
|
101583
|
-
} else {
|
|
101584
|
-
var sStr = util.toSetString(aStr);
|
|
101585
|
-
return has.call(this._set, sStr);
|
|
101586
|
-
}
|
|
101587
|
-
};
|
|
101588
|
-
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
|
101589
|
-
if (hasNativeMap) {
|
|
101590
|
-
var idx = this._set.get(aStr);
|
|
101591
|
-
if (idx >= 0) {
|
|
101592
|
-
return idx;
|
|
101593
|
-
}
|
|
101594
|
-
} else {
|
|
101595
|
-
var sStr = util.toSetString(aStr);
|
|
101596
|
-
if (has.call(this._set, sStr)) {
|
|
101597
|
-
return this._set[sStr];
|
|
101598
|
-
}
|
|
101599
|
-
}
|
|
101600
|
-
throw new Error('"' + aStr + '" is not in the set.');
|
|
101601
|
-
};
|
|
101602
|
-
ArraySet.prototype.at = function ArraySet_at(aIdx) {
|
|
101603
|
-
if (aIdx >= 0 && aIdx < this._array.length) {
|
|
101604
|
-
return this._array[aIdx];
|
|
101605
|
-
}
|
|
101606
|
-
throw new Error("No element indexed by " + aIdx);
|
|
101607
|
-
};
|
|
101608
|
-
ArraySet.prototype.toArray = function ArraySet_toArray() {
|
|
101609
|
-
return this._array.slice();
|
|
101610
|
-
};
|
|
101611
|
-
exports2.ArraySet = ArraySet;
|
|
101612
|
-
}
|
|
101613
|
-
});
|
|
101614
|
-
|
|
101615
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/mapping-list.js
|
|
101616
|
-
var require_mapping_list = __commonJS({
|
|
101617
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/mapping-list.js"(exports2) {
|
|
101618
|
-
"use strict";
|
|
101619
|
-
var util = require_util4();
|
|
101620
|
-
function generatedPositionAfter(mappingA, mappingB) {
|
|
101621
|
-
var lineA = mappingA.generatedLine;
|
|
101622
|
-
var lineB = mappingB.generatedLine;
|
|
101623
|
-
var columnA = mappingA.generatedColumn;
|
|
101624
|
-
var columnB = mappingB.generatedColumn;
|
|
101625
|
-
return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
|
101626
|
-
}
|
|
101627
|
-
function MappingList() {
|
|
101628
|
-
this._array = [];
|
|
101629
|
-
this._sorted = true;
|
|
101630
|
-
this._last = { generatedLine: -1, generatedColumn: 0 };
|
|
101631
|
-
}
|
|
101632
|
-
MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
|
|
101633
|
-
this._array.forEach(aCallback, aThisArg);
|
|
101634
|
-
};
|
|
101635
|
-
MappingList.prototype.add = function MappingList_add(aMapping) {
|
|
101636
|
-
if (generatedPositionAfter(this._last, aMapping)) {
|
|
101637
|
-
this._last = aMapping;
|
|
101638
|
-
this._array.push(aMapping);
|
|
101639
|
-
} else {
|
|
101640
|
-
this._sorted = false;
|
|
101641
|
-
this._array.push(aMapping);
|
|
101642
|
-
}
|
|
101643
|
-
};
|
|
101644
|
-
MappingList.prototype.toArray = function MappingList_toArray() {
|
|
101645
|
-
if (!this._sorted) {
|
|
101646
|
-
this._array.sort(util.compareByGeneratedPositionsInflated);
|
|
101647
|
-
this._sorted = true;
|
|
101648
|
-
}
|
|
101649
|
-
return this._array;
|
|
101650
|
-
};
|
|
101651
|
-
exports2.MappingList = MappingList;
|
|
101652
|
-
}
|
|
101653
|
-
});
|
|
101654
|
-
|
|
101655
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/source-map-generator.js
|
|
101656
|
-
var require_source_map_generator = __commonJS({
|
|
101657
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/source-map-generator.js"(exports2) {
|
|
101658
|
-
"use strict";
|
|
101659
|
-
var base64VLQ = require_base64_vlq();
|
|
101660
|
-
var util = require_util4();
|
|
101661
|
-
var ArraySet = require_array_set().ArraySet;
|
|
101662
|
-
var MappingList = require_mapping_list().MappingList;
|
|
101663
|
-
function SourceMapGenerator(aArgs) {
|
|
101664
|
-
if (!aArgs) {
|
|
101665
|
-
aArgs = {};
|
|
101666
|
-
}
|
|
101667
|
-
this._file = util.getArg(aArgs, "file", null);
|
|
101668
|
-
this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
|
|
101669
|
-
this._skipValidation = util.getArg(aArgs, "skipValidation", false);
|
|
101670
|
-
this._sources = new ArraySet();
|
|
101671
|
-
this._names = new ArraySet();
|
|
101672
|
-
this._mappings = new MappingList();
|
|
101673
|
-
this._sourcesContents = null;
|
|
101674
|
-
}
|
|
101675
|
-
SourceMapGenerator.prototype._version = 3;
|
|
101676
|
-
SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
|
|
101677
|
-
var sourceRoot = aSourceMapConsumer.sourceRoot;
|
|
101678
|
-
var generator = new SourceMapGenerator({
|
|
101679
|
-
file: aSourceMapConsumer.file,
|
|
101680
|
-
sourceRoot
|
|
101681
|
-
});
|
|
101682
|
-
aSourceMapConsumer.eachMapping(function(mapping) {
|
|
101683
|
-
var newMapping = {
|
|
101684
|
-
generated: {
|
|
101685
|
-
line: mapping.generatedLine,
|
|
101686
|
-
column: mapping.generatedColumn
|
|
101687
|
-
}
|
|
101688
|
-
};
|
|
101689
|
-
if (mapping.source != null) {
|
|
101690
|
-
newMapping.source = mapping.source;
|
|
101691
|
-
if (sourceRoot != null) {
|
|
101692
|
-
newMapping.source = util.relative(sourceRoot, newMapping.source);
|
|
101693
|
-
}
|
|
101694
|
-
newMapping.original = {
|
|
101695
|
-
line: mapping.originalLine,
|
|
101696
|
-
column: mapping.originalColumn
|
|
101697
|
-
};
|
|
101698
|
-
if (mapping.name != null) {
|
|
101699
|
-
newMapping.name = mapping.name;
|
|
101700
|
-
}
|
|
101701
|
-
}
|
|
101702
|
-
generator.addMapping(newMapping);
|
|
101703
|
-
});
|
|
101704
|
-
aSourceMapConsumer.sources.forEach(function(sourceFile) {
|
|
101705
|
-
var sourceRelative = sourceFile;
|
|
101706
|
-
if (sourceRoot !== null) {
|
|
101707
|
-
sourceRelative = util.relative(sourceRoot, sourceFile);
|
|
101708
|
-
}
|
|
101709
|
-
if (!generator._sources.has(sourceRelative)) {
|
|
101710
|
-
generator._sources.add(sourceRelative);
|
|
101711
|
-
}
|
|
101712
|
-
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
101713
|
-
if (content != null) {
|
|
101714
|
-
generator.setSourceContent(sourceFile, content);
|
|
101715
|
-
}
|
|
101716
|
-
});
|
|
101717
|
-
return generator;
|
|
101718
|
-
};
|
|
101719
|
-
SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
|
|
101720
|
-
var generated = util.getArg(aArgs, "generated");
|
|
101721
|
-
var original = util.getArg(aArgs, "original", null);
|
|
101722
|
-
var source = util.getArg(aArgs, "source", null);
|
|
101723
|
-
var name = util.getArg(aArgs, "name", null);
|
|
101724
|
-
if (!this._skipValidation) {
|
|
101725
|
-
this._validateMapping(generated, original, source, name);
|
|
101726
|
-
}
|
|
101727
|
-
if (source != null) {
|
|
101728
|
-
source = String(source);
|
|
101729
|
-
if (!this._sources.has(source)) {
|
|
101730
|
-
this._sources.add(source);
|
|
101731
|
-
}
|
|
101732
|
-
}
|
|
101733
|
-
if (name != null) {
|
|
101734
|
-
name = String(name);
|
|
101735
|
-
if (!this._names.has(name)) {
|
|
101736
|
-
this._names.add(name);
|
|
101737
|
-
}
|
|
101738
|
-
}
|
|
101739
|
-
this._mappings.add({
|
|
101740
|
-
generatedLine: generated.line,
|
|
101741
|
-
generatedColumn: generated.column,
|
|
101742
|
-
originalLine: original != null && original.line,
|
|
101743
|
-
originalColumn: original != null && original.column,
|
|
101744
|
-
source,
|
|
101745
|
-
name
|
|
101746
|
-
});
|
|
101747
|
-
};
|
|
101748
|
-
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
|
101749
|
-
var source = aSourceFile;
|
|
101750
|
-
if (this._sourceRoot != null) {
|
|
101751
|
-
source = util.relative(this._sourceRoot, source);
|
|
101752
|
-
}
|
|
101753
|
-
if (aSourceContent != null) {
|
|
101754
|
-
if (!this._sourcesContents) {
|
|
101755
|
-
this._sourcesContents = /* @__PURE__ */ Object.create(null);
|
|
101756
|
-
}
|
|
101757
|
-
this._sourcesContents[util.toSetString(source)] = aSourceContent;
|
|
101758
|
-
} else if (this._sourcesContents) {
|
|
101759
|
-
delete this._sourcesContents[util.toSetString(source)];
|
|
101760
|
-
if (Object.keys(this._sourcesContents).length === 0) {
|
|
101761
|
-
this._sourcesContents = null;
|
|
101762
|
-
}
|
|
101763
|
-
}
|
|
101764
|
-
};
|
|
101765
|
-
SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
|
|
101766
|
-
var sourceFile = aSourceFile;
|
|
101767
|
-
if (aSourceFile == null) {
|
|
101768
|
-
if (aSourceMapConsumer.file == null) {
|
|
101769
|
-
throw new Error(
|
|
101770
|
-
`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
|
|
101771
|
-
);
|
|
101772
|
-
}
|
|
101773
|
-
sourceFile = aSourceMapConsumer.file;
|
|
101774
|
-
}
|
|
101775
|
-
var sourceRoot = this._sourceRoot;
|
|
101776
|
-
if (sourceRoot != null) {
|
|
101777
|
-
sourceFile = util.relative(sourceRoot, sourceFile);
|
|
101778
|
-
}
|
|
101779
|
-
var newSources = new ArraySet();
|
|
101780
|
-
var newNames = new ArraySet();
|
|
101781
|
-
this._mappings.unsortedForEach(function(mapping) {
|
|
101782
|
-
if (mapping.source === sourceFile && mapping.originalLine != null) {
|
|
101783
|
-
var original = aSourceMapConsumer.originalPositionFor({
|
|
101784
|
-
line: mapping.originalLine,
|
|
101785
|
-
column: mapping.originalColumn
|
|
101786
|
-
});
|
|
101787
|
-
if (original.source != null) {
|
|
101788
|
-
mapping.source = original.source;
|
|
101789
|
-
if (aSourceMapPath != null) {
|
|
101790
|
-
mapping.source = util.join(aSourceMapPath, mapping.source);
|
|
101791
|
-
}
|
|
101792
|
-
if (sourceRoot != null) {
|
|
101793
|
-
mapping.source = util.relative(sourceRoot, mapping.source);
|
|
101794
|
-
}
|
|
101795
|
-
mapping.originalLine = original.line;
|
|
101796
|
-
mapping.originalColumn = original.column;
|
|
101797
|
-
if (original.name != null) {
|
|
101798
|
-
mapping.name = original.name;
|
|
101799
|
-
}
|
|
101800
|
-
}
|
|
101801
|
-
}
|
|
101802
|
-
var source = mapping.source;
|
|
101803
|
-
if (source != null && !newSources.has(source)) {
|
|
101804
|
-
newSources.add(source);
|
|
101805
|
-
}
|
|
101806
|
-
var name = mapping.name;
|
|
101807
|
-
if (name != null && !newNames.has(name)) {
|
|
101808
|
-
newNames.add(name);
|
|
101809
|
-
}
|
|
101810
|
-
}, this);
|
|
101811
|
-
this._sources = newSources;
|
|
101812
|
-
this._names = newNames;
|
|
101813
|
-
aSourceMapConsumer.sources.forEach(function(sourceFile2) {
|
|
101814
|
-
var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
|
|
101815
|
-
if (content != null) {
|
|
101816
|
-
if (aSourceMapPath != null) {
|
|
101817
|
-
sourceFile2 = util.join(aSourceMapPath, sourceFile2);
|
|
101818
|
-
}
|
|
101819
|
-
if (sourceRoot != null) {
|
|
101820
|
-
sourceFile2 = util.relative(sourceRoot, sourceFile2);
|
|
101821
|
-
}
|
|
101822
|
-
this.setSourceContent(sourceFile2, content);
|
|
101823
|
-
}
|
|
101824
|
-
}, this);
|
|
101825
|
-
};
|
|
101826
|
-
SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
|
|
101827
|
-
if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
|
|
101828
|
-
throw new Error(
|
|
101829
|
-
"original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
|
|
101830
|
-
);
|
|
101831
|
-
}
|
|
101832
|
-
if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
|
|
101833
|
-
return;
|
|
101834
|
-
} else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
|
|
101835
|
-
return;
|
|
101836
|
-
} else {
|
|
101837
|
-
throw new Error("Invalid mapping: " + JSON.stringify({
|
|
101838
|
-
generated: aGenerated,
|
|
101839
|
-
source: aSource,
|
|
101840
|
-
original: aOriginal,
|
|
101841
|
-
name: aName
|
|
101842
|
-
}));
|
|
101843
|
-
}
|
|
101844
|
-
};
|
|
101845
|
-
SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
|
|
101846
|
-
var previousGeneratedColumn = 0;
|
|
101847
|
-
var previousGeneratedLine = 1;
|
|
101848
|
-
var previousOriginalColumn = 0;
|
|
101849
|
-
var previousOriginalLine = 0;
|
|
101850
|
-
var previousName = 0;
|
|
101851
|
-
var previousSource = 0;
|
|
101852
|
-
var result = "";
|
|
101853
|
-
var next;
|
|
101854
|
-
var mapping;
|
|
101855
|
-
var nameIdx;
|
|
101856
|
-
var sourceIdx;
|
|
101857
|
-
var mappings = this._mappings.toArray();
|
|
101858
|
-
for (var i = 0, len = mappings.length; i < len; i++) {
|
|
101859
|
-
mapping = mappings[i];
|
|
101860
|
-
next = "";
|
|
101861
|
-
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
101862
|
-
previousGeneratedColumn = 0;
|
|
101863
|
-
while (mapping.generatedLine !== previousGeneratedLine) {
|
|
101864
|
-
next += ";";
|
|
101865
|
-
previousGeneratedLine++;
|
|
101866
|
-
}
|
|
101867
|
-
} else {
|
|
101868
|
-
if (i > 0) {
|
|
101869
|
-
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
|
|
101870
|
-
continue;
|
|
101871
|
-
}
|
|
101872
|
-
next += ",";
|
|
101873
|
-
}
|
|
101874
|
-
}
|
|
101875
|
-
next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
|
|
101876
|
-
previousGeneratedColumn = mapping.generatedColumn;
|
|
101877
|
-
if (mapping.source != null) {
|
|
101878
|
-
sourceIdx = this._sources.indexOf(mapping.source);
|
|
101879
|
-
next += base64VLQ.encode(sourceIdx - previousSource);
|
|
101880
|
-
previousSource = sourceIdx;
|
|
101881
|
-
next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
|
|
101882
|
-
previousOriginalLine = mapping.originalLine - 1;
|
|
101883
|
-
next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
|
|
101884
|
-
previousOriginalColumn = mapping.originalColumn;
|
|
101885
|
-
if (mapping.name != null) {
|
|
101886
|
-
nameIdx = this._names.indexOf(mapping.name);
|
|
101887
|
-
next += base64VLQ.encode(nameIdx - previousName);
|
|
101888
|
-
previousName = nameIdx;
|
|
101889
|
-
}
|
|
101890
|
-
}
|
|
101891
|
-
result += next;
|
|
101892
|
-
}
|
|
101893
|
-
return result;
|
|
101894
|
-
};
|
|
101895
|
-
SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
|
101896
|
-
return aSources.map(function(source) {
|
|
101897
|
-
if (!this._sourcesContents) {
|
|
101898
|
-
return null;
|
|
101899
|
-
}
|
|
101900
|
-
if (aSourceRoot != null) {
|
|
101901
|
-
source = util.relative(aSourceRoot, source);
|
|
101902
|
-
}
|
|
101903
|
-
var key = util.toSetString(source);
|
|
101904
|
-
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
|
|
101905
|
-
}, this);
|
|
101906
|
-
};
|
|
101907
|
-
SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
|
|
101908
|
-
var map2 = {
|
|
101909
|
-
version: this._version,
|
|
101910
|
-
sources: this._sources.toArray(),
|
|
101911
|
-
names: this._names.toArray(),
|
|
101912
|
-
mappings: this._serializeMappings()
|
|
101913
|
-
};
|
|
101914
|
-
if (this._file != null) {
|
|
101915
|
-
map2.file = this._file;
|
|
101916
|
-
}
|
|
101917
|
-
if (this._sourceRoot != null) {
|
|
101918
|
-
map2.sourceRoot = this._sourceRoot;
|
|
101919
|
-
}
|
|
101920
|
-
if (this._sourcesContents) {
|
|
101921
|
-
map2.sourcesContent = this._generateSourcesContent(map2.sources, map2.sourceRoot);
|
|
101922
|
-
}
|
|
101923
|
-
return map2;
|
|
101924
|
-
};
|
|
101925
|
-
SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
|
|
101926
|
-
return JSON.stringify(this.toJSON());
|
|
101927
|
-
};
|
|
101928
|
-
exports2.SourceMapGenerator = SourceMapGenerator;
|
|
101929
|
-
}
|
|
101930
|
-
});
|
|
101931
|
-
|
|
101932
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/binary-search.js
|
|
101933
|
-
var require_binary_search = __commonJS({
|
|
101934
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/binary-search.js"(exports2) {
|
|
101935
|
-
"use strict";
|
|
101936
|
-
exports2.GREATEST_LOWER_BOUND = 1;
|
|
101937
|
-
exports2.LEAST_UPPER_BOUND = 2;
|
|
101938
|
-
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
|
101939
|
-
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
|
101940
|
-
var cmp = aCompare(aNeedle, aHaystack[mid], true);
|
|
101941
|
-
if (cmp === 0) {
|
|
101942
|
-
return mid;
|
|
101943
|
-
} else if (cmp > 0) {
|
|
101944
|
-
if (aHigh - mid > 1) {
|
|
101945
|
-
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
|
101946
|
-
}
|
|
101947
|
-
if (aBias == exports2.LEAST_UPPER_BOUND) {
|
|
101948
|
-
return aHigh < aHaystack.length ? aHigh : -1;
|
|
101949
|
-
} else {
|
|
101950
|
-
return mid;
|
|
101951
|
-
}
|
|
101952
|
-
} else {
|
|
101953
|
-
if (mid - aLow > 1) {
|
|
101954
|
-
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
|
101955
|
-
}
|
|
101956
|
-
if (aBias == exports2.LEAST_UPPER_BOUND) {
|
|
101957
|
-
return mid;
|
|
101958
|
-
} else {
|
|
101959
|
-
return aLow < 0 ? -1 : aLow;
|
|
101960
|
-
}
|
|
101961
|
-
}
|
|
101962
|
-
}
|
|
101963
|
-
exports2.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
|
101964
|
-
if (aHaystack.length === 0) {
|
|
101965
|
-
return -1;
|
|
101966
|
-
}
|
|
101967
|
-
var index = recursiveSearch(
|
|
101968
|
-
-1,
|
|
101969
|
-
aHaystack.length,
|
|
101970
|
-
aNeedle,
|
|
101971
|
-
aHaystack,
|
|
101972
|
-
aCompare,
|
|
101973
|
-
aBias || exports2.GREATEST_LOWER_BOUND
|
|
101974
|
-
);
|
|
101975
|
-
if (index < 0) {
|
|
101976
|
-
return -1;
|
|
101977
|
-
}
|
|
101978
|
-
while (index - 1 >= 0) {
|
|
101979
|
-
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
|
|
101980
|
-
break;
|
|
101981
|
-
}
|
|
101982
|
-
--index;
|
|
101983
|
-
}
|
|
101984
|
-
return index;
|
|
101985
|
-
};
|
|
101986
|
-
}
|
|
101987
|
-
});
|
|
101988
|
-
|
|
101989
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/quick-sort.js
|
|
101990
|
-
var require_quick_sort = __commonJS({
|
|
101991
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/quick-sort.js"(exports2) {
|
|
101992
|
-
"use strict";
|
|
101993
|
-
function swap(ary, x, y) {
|
|
101994
|
-
var temp = ary[x];
|
|
101995
|
-
ary[x] = ary[y];
|
|
101996
|
-
ary[y] = temp;
|
|
101997
|
-
}
|
|
101998
|
-
function randomIntInRange(low, high) {
|
|
101999
|
-
return Math.round(low + Math.random() * (high - low));
|
|
102000
|
-
}
|
|
102001
|
-
function doQuickSort(ary, comparator, p, r) {
|
|
102002
|
-
if (p < r) {
|
|
102003
|
-
var pivotIndex = randomIntInRange(p, r);
|
|
102004
|
-
var i = p - 1;
|
|
102005
|
-
swap(ary, pivotIndex, r);
|
|
102006
|
-
var pivot = ary[r];
|
|
102007
|
-
for (var j = p; j < r; j++) {
|
|
102008
|
-
if (comparator(ary[j], pivot) <= 0) {
|
|
102009
|
-
i += 1;
|
|
102010
|
-
swap(ary, i, j);
|
|
102011
|
-
}
|
|
102012
|
-
}
|
|
102013
|
-
swap(ary, i + 1, j);
|
|
102014
|
-
var q = i + 1;
|
|
102015
|
-
doQuickSort(ary, comparator, p, q - 1);
|
|
102016
|
-
doQuickSort(ary, comparator, q + 1, r);
|
|
102017
|
-
}
|
|
102018
|
-
}
|
|
102019
|
-
exports2.quickSort = function(ary, comparator) {
|
|
102020
|
-
doQuickSort(ary, comparator, 0, ary.length - 1);
|
|
102021
|
-
};
|
|
102022
|
-
}
|
|
102023
|
-
});
|
|
102024
|
-
|
|
102025
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js
|
|
102026
|
-
var require_source_map_consumer = __commonJS({
|
|
102027
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js"(exports2) {
|
|
102028
|
-
"use strict";
|
|
102029
|
-
var util = require_util4();
|
|
102030
|
-
var binarySearch = require_binary_search();
|
|
102031
|
-
var ArraySet = require_array_set().ArraySet;
|
|
102032
|
-
var base64VLQ = require_base64_vlq();
|
|
102033
|
-
var quickSort = require_quick_sort().quickSort;
|
|
102034
|
-
function SourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
102035
|
-
var sourceMap = aSourceMap;
|
|
102036
|
-
if (typeof aSourceMap === "string") {
|
|
102037
|
-
sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
102038
|
-
}
|
|
102039
|
-
return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
|
|
102040
|
-
}
|
|
102041
|
-
SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
|
|
102042
|
-
return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
|
|
102043
|
-
};
|
|
102044
|
-
SourceMapConsumer.prototype._version = 3;
|
|
102045
|
-
SourceMapConsumer.prototype.__generatedMappings = null;
|
|
102046
|
-
Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
|
|
102047
|
-
configurable: true,
|
|
102048
|
-
enumerable: true,
|
|
102049
|
-
get: function() {
|
|
102050
|
-
if (!this.__generatedMappings) {
|
|
102051
|
-
this._parseMappings(this._mappings, this.sourceRoot);
|
|
102052
|
-
}
|
|
102053
|
-
return this.__generatedMappings;
|
|
102054
|
-
}
|
|
102055
|
-
});
|
|
102056
|
-
SourceMapConsumer.prototype.__originalMappings = null;
|
|
102057
|
-
Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
|
|
102058
|
-
configurable: true,
|
|
102059
|
-
enumerable: true,
|
|
102060
|
-
get: function() {
|
|
102061
|
-
if (!this.__originalMappings) {
|
|
102062
|
-
this._parseMappings(this._mappings, this.sourceRoot);
|
|
102063
|
-
}
|
|
102064
|
-
return this.__originalMappings;
|
|
102065
|
-
}
|
|
102066
|
-
});
|
|
102067
|
-
SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
|
|
102068
|
-
var c = aStr.charAt(index);
|
|
102069
|
-
return c === ";" || c === ",";
|
|
102070
|
-
};
|
|
102071
|
-
SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
102072
|
-
throw new Error("Subclasses must implement _parseMappings");
|
|
102073
|
-
};
|
|
102074
|
-
SourceMapConsumer.GENERATED_ORDER = 1;
|
|
102075
|
-
SourceMapConsumer.ORIGINAL_ORDER = 2;
|
|
102076
|
-
SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
|
|
102077
|
-
SourceMapConsumer.LEAST_UPPER_BOUND = 2;
|
|
102078
|
-
SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
|
|
102079
|
-
var context = aContext || null;
|
|
102080
|
-
var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
|
|
102081
|
-
var mappings;
|
|
102082
|
-
switch (order) {
|
|
102083
|
-
case SourceMapConsumer.GENERATED_ORDER:
|
|
102084
|
-
mappings = this._generatedMappings;
|
|
102085
|
-
break;
|
|
102086
|
-
case SourceMapConsumer.ORIGINAL_ORDER:
|
|
102087
|
-
mappings = this._originalMappings;
|
|
102088
|
-
break;
|
|
102089
|
-
default:
|
|
102090
|
-
throw new Error("Unknown order of iteration.");
|
|
102091
|
-
}
|
|
102092
|
-
var sourceRoot = this.sourceRoot;
|
|
102093
|
-
mappings.map(function(mapping) {
|
|
102094
|
-
var source = mapping.source === null ? null : this._sources.at(mapping.source);
|
|
102095
|
-
source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
|
|
102096
|
-
return {
|
|
102097
|
-
source,
|
|
102098
|
-
generatedLine: mapping.generatedLine,
|
|
102099
|
-
generatedColumn: mapping.generatedColumn,
|
|
102100
|
-
originalLine: mapping.originalLine,
|
|
102101
|
-
originalColumn: mapping.originalColumn,
|
|
102102
|
-
name: mapping.name === null ? null : this._names.at(mapping.name)
|
|
102103
|
-
};
|
|
102104
|
-
}, this).forEach(aCallback, context);
|
|
102105
|
-
};
|
|
102106
|
-
SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
|
|
102107
|
-
var line = util.getArg(aArgs, "line");
|
|
102108
|
-
var needle = {
|
|
102109
|
-
source: util.getArg(aArgs, "source"),
|
|
102110
|
-
originalLine: line,
|
|
102111
|
-
originalColumn: util.getArg(aArgs, "column", 0)
|
|
102112
|
-
};
|
|
102113
|
-
needle.source = this._findSourceIndex(needle.source);
|
|
102114
|
-
if (needle.source < 0) {
|
|
102115
|
-
return [];
|
|
102116
|
-
}
|
|
102117
|
-
var mappings = [];
|
|
102118
|
-
var index = this._findMapping(
|
|
102119
|
-
needle,
|
|
102120
|
-
this._originalMappings,
|
|
102121
|
-
"originalLine",
|
|
102122
|
-
"originalColumn",
|
|
102123
|
-
util.compareByOriginalPositions,
|
|
102124
|
-
binarySearch.LEAST_UPPER_BOUND
|
|
102125
|
-
);
|
|
102126
|
-
if (index >= 0) {
|
|
102127
|
-
var mapping = this._originalMappings[index];
|
|
102128
|
-
if (aArgs.column === void 0) {
|
|
102129
|
-
var originalLine = mapping.originalLine;
|
|
102130
|
-
while (mapping && mapping.originalLine === originalLine) {
|
|
102131
|
-
mappings.push({
|
|
102132
|
-
line: util.getArg(mapping, "generatedLine", null),
|
|
102133
|
-
column: util.getArg(mapping, "generatedColumn", null),
|
|
102134
|
-
lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
|
|
102135
|
-
});
|
|
102136
|
-
mapping = this._originalMappings[++index];
|
|
102137
|
-
}
|
|
102138
|
-
} else {
|
|
102139
|
-
var originalColumn = mapping.originalColumn;
|
|
102140
|
-
while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
|
|
102141
|
-
mappings.push({
|
|
102142
|
-
line: util.getArg(mapping, "generatedLine", null),
|
|
102143
|
-
column: util.getArg(mapping, "generatedColumn", null),
|
|
102144
|
-
lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
|
|
102145
|
-
});
|
|
102146
|
-
mapping = this._originalMappings[++index];
|
|
102147
|
-
}
|
|
102148
|
-
}
|
|
102149
|
-
}
|
|
102150
|
-
return mappings;
|
|
102151
|
-
};
|
|
102152
|
-
exports2.SourceMapConsumer = SourceMapConsumer;
|
|
102153
|
-
function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
102154
|
-
var sourceMap = aSourceMap;
|
|
102155
|
-
if (typeof aSourceMap === "string") {
|
|
102156
|
-
sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
102157
|
-
}
|
|
102158
|
-
var version = util.getArg(sourceMap, "version");
|
|
102159
|
-
var sources = util.getArg(sourceMap, "sources");
|
|
102160
|
-
var names = util.getArg(sourceMap, "names", []);
|
|
102161
|
-
var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
|
|
102162
|
-
var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
|
|
102163
|
-
var mappings = util.getArg(sourceMap, "mappings");
|
|
102164
|
-
var file = util.getArg(sourceMap, "file", null);
|
|
102165
|
-
if (version != this._version) {
|
|
102166
|
-
throw new Error("Unsupported version: " + version);
|
|
102167
|
-
}
|
|
102168
|
-
if (sourceRoot) {
|
|
102169
|
-
sourceRoot = util.normalize(sourceRoot);
|
|
102170
|
-
}
|
|
102171
|
-
sources = sources.map(String).map(util.normalize).map(function(source) {
|
|
102172
|
-
return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
|
|
102173
|
-
});
|
|
102174
|
-
this._names = ArraySet.fromArray(names.map(String), true);
|
|
102175
|
-
this._sources = ArraySet.fromArray(sources, true);
|
|
102176
|
-
this._absoluteSources = this._sources.toArray().map(function(s) {
|
|
102177
|
-
return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
|
|
102178
|
-
});
|
|
102179
|
-
this.sourceRoot = sourceRoot;
|
|
102180
|
-
this.sourcesContent = sourcesContent;
|
|
102181
|
-
this._mappings = mappings;
|
|
102182
|
-
this._sourceMapURL = aSourceMapURL;
|
|
102183
|
-
this.file = file;
|
|
102184
|
-
}
|
|
102185
|
-
BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
102186
|
-
BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
|
|
102187
|
-
BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
|
|
102188
|
-
var relativeSource = aSource;
|
|
102189
|
-
if (this.sourceRoot != null) {
|
|
102190
|
-
relativeSource = util.relative(this.sourceRoot, relativeSource);
|
|
102191
|
-
}
|
|
102192
|
-
if (this._sources.has(relativeSource)) {
|
|
102193
|
-
return this._sources.indexOf(relativeSource);
|
|
102194
|
-
}
|
|
102195
|
-
var i;
|
|
102196
|
-
for (i = 0; i < this._absoluteSources.length; ++i) {
|
|
102197
|
-
if (this._absoluteSources[i] == aSource) {
|
|
102198
|
-
return i;
|
|
102199
|
-
}
|
|
102200
|
-
}
|
|
102201
|
-
return -1;
|
|
102202
|
-
};
|
|
102203
|
-
BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
|
|
102204
|
-
var smc = Object.create(BasicSourceMapConsumer.prototype);
|
|
102205
|
-
var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
|
|
102206
|
-
var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
|
|
102207
|
-
smc.sourceRoot = aSourceMap._sourceRoot;
|
|
102208
|
-
smc.sourcesContent = aSourceMap._generateSourcesContent(
|
|
102209
|
-
smc._sources.toArray(),
|
|
102210
|
-
smc.sourceRoot
|
|
102211
|
-
);
|
|
102212
|
-
smc.file = aSourceMap._file;
|
|
102213
|
-
smc._sourceMapURL = aSourceMapURL;
|
|
102214
|
-
smc._absoluteSources = smc._sources.toArray().map(function(s) {
|
|
102215
|
-
return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
|
|
102216
|
-
});
|
|
102217
|
-
var generatedMappings = aSourceMap._mappings.toArray().slice();
|
|
102218
|
-
var destGeneratedMappings = smc.__generatedMappings = [];
|
|
102219
|
-
var destOriginalMappings = smc.__originalMappings = [];
|
|
102220
|
-
for (var i = 0, length = generatedMappings.length; i < length; i++) {
|
|
102221
|
-
var srcMapping = generatedMappings[i];
|
|
102222
|
-
var destMapping = new Mapping();
|
|
102223
|
-
destMapping.generatedLine = srcMapping.generatedLine;
|
|
102224
|
-
destMapping.generatedColumn = srcMapping.generatedColumn;
|
|
102225
|
-
if (srcMapping.source) {
|
|
102226
|
-
destMapping.source = sources.indexOf(srcMapping.source);
|
|
102227
|
-
destMapping.originalLine = srcMapping.originalLine;
|
|
102228
|
-
destMapping.originalColumn = srcMapping.originalColumn;
|
|
102229
|
-
if (srcMapping.name) {
|
|
102230
|
-
destMapping.name = names.indexOf(srcMapping.name);
|
|
102231
|
-
}
|
|
102232
|
-
destOriginalMappings.push(destMapping);
|
|
102233
|
-
}
|
|
102234
|
-
destGeneratedMappings.push(destMapping);
|
|
102235
|
-
}
|
|
102236
|
-
quickSort(smc.__originalMappings, util.compareByOriginalPositions);
|
|
102237
|
-
return smc;
|
|
102238
|
-
};
|
|
102239
|
-
BasicSourceMapConsumer.prototype._version = 3;
|
|
102240
|
-
Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
|
|
102241
|
-
get: function() {
|
|
102242
|
-
return this._absoluteSources.slice();
|
|
102243
|
-
}
|
|
102244
|
-
});
|
|
102245
|
-
function Mapping() {
|
|
102246
|
-
this.generatedLine = 0;
|
|
102247
|
-
this.generatedColumn = 0;
|
|
102248
|
-
this.source = null;
|
|
102249
|
-
this.originalLine = null;
|
|
102250
|
-
this.originalColumn = null;
|
|
102251
|
-
this.name = null;
|
|
102252
|
-
}
|
|
102253
|
-
BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
102254
|
-
var generatedLine = 1;
|
|
102255
|
-
var previousGeneratedColumn = 0;
|
|
102256
|
-
var previousOriginalLine = 0;
|
|
102257
|
-
var previousOriginalColumn = 0;
|
|
102258
|
-
var previousSource = 0;
|
|
102259
|
-
var previousName = 0;
|
|
102260
|
-
var length = aStr.length;
|
|
102261
|
-
var index = 0;
|
|
102262
|
-
var cachedSegments = {};
|
|
102263
|
-
var temp = {};
|
|
102264
|
-
var originalMappings = [];
|
|
102265
|
-
var generatedMappings = [];
|
|
102266
|
-
var mapping, str, segment, end, value;
|
|
102267
|
-
while (index < length) {
|
|
102268
|
-
if (aStr.charAt(index) === ";") {
|
|
102269
|
-
generatedLine++;
|
|
102270
|
-
index++;
|
|
102271
|
-
previousGeneratedColumn = 0;
|
|
102272
|
-
} else if (aStr.charAt(index) === ",") {
|
|
102273
|
-
index++;
|
|
102274
|
-
} else {
|
|
102275
|
-
mapping = new Mapping();
|
|
102276
|
-
mapping.generatedLine = generatedLine;
|
|
102277
|
-
for (end = index; end < length; end++) {
|
|
102278
|
-
if (this._charIsMappingSeparator(aStr, end)) {
|
|
102279
|
-
break;
|
|
102280
|
-
}
|
|
102281
|
-
}
|
|
102282
|
-
str = aStr.slice(index, end);
|
|
102283
|
-
segment = cachedSegments[str];
|
|
102284
|
-
if (segment) {
|
|
102285
|
-
index += str.length;
|
|
102286
|
-
} else {
|
|
102287
|
-
segment = [];
|
|
102288
|
-
while (index < end) {
|
|
102289
|
-
base64VLQ.decode(aStr, index, temp);
|
|
102290
|
-
value = temp.value;
|
|
102291
|
-
index = temp.rest;
|
|
102292
|
-
segment.push(value);
|
|
102293
|
-
}
|
|
102294
|
-
if (segment.length === 2) {
|
|
102295
|
-
throw new Error("Found a source, but no line and column");
|
|
102296
|
-
}
|
|
102297
|
-
if (segment.length === 3) {
|
|
102298
|
-
throw new Error("Found a source and line, but no column");
|
|
102299
|
-
}
|
|
102300
|
-
cachedSegments[str] = segment;
|
|
102301
|
-
}
|
|
102302
|
-
mapping.generatedColumn = previousGeneratedColumn + segment[0];
|
|
102303
|
-
previousGeneratedColumn = mapping.generatedColumn;
|
|
102304
|
-
if (segment.length > 1) {
|
|
102305
|
-
mapping.source = previousSource + segment[1];
|
|
102306
|
-
previousSource += segment[1];
|
|
102307
|
-
mapping.originalLine = previousOriginalLine + segment[2];
|
|
102308
|
-
previousOriginalLine = mapping.originalLine;
|
|
102309
|
-
mapping.originalLine += 1;
|
|
102310
|
-
mapping.originalColumn = previousOriginalColumn + segment[3];
|
|
102311
|
-
previousOriginalColumn = mapping.originalColumn;
|
|
102312
|
-
if (segment.length > 4) {
|
|
102313
|
-
mapping.name = previousName + segment[4];
|
|
102314
|
-
previousName += segment[4];
|
|
102315
|
-
}
|
|
102316
|
-
}
|
|
102317
|
-
generatedMappings.push(mapping);
|
|
102318
|
-
if (typeof mapping.originalLine === "number") {
|
|
102319
|
-
originalMappings.push(mapping);
|
|
102320
|
-
}
|
|
102321
|
-
}
|
|
102322
|
-
}
|
|
102323
|
-
quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
|
|
102324
|
-
this.__generatedMappings = generatedMappings;
|
|
102325
|
-
quickSort(originalMappings, util.compareByOriginalPositions);
|
|
102326
|
-
this.__originalMappings = originalMappings;
|
|
102327
|
-
};
|
|
102328
|
-
BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
|
|
102329
|
-
if (aNeedle[aLineName] <= 0) {
|
|
102330
|
-
throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
|
|
102331
|
-
}
|
|
102332
|
-
if (aNeedle[aColumnName] < 0) {
|
|
102333
|
-
throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
|
|
102334
|
-
}
|
|
102335
|
-
return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
|
|
102336
|
-
};
|
|
102337
|
-
BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
|
|
102338
|
-
for (var index = 0; index < this._generatedMappings.length; ++index) {
|
|
102339
|
-
var mapping = this._generatedMappings[index];
|
|
102340
|
-
if (index + 1 < this._generatedMappings.length) {
|
|
102341
|
-
var nextMapping = this._generatedMappings[index + 1];
|
|
102342
|
-
if (mapping.generatedLine === nextMapping.generatedLine) {
|
|
102343
|
-
mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
|
|
102344
|
-
continue;
|
|
102345
|
-
}
|
|
102346
|
-
}
|
|
102347
|
-
mapping.lastGeneratedColumn = Infinity;
|
|
102348
|
-
}
|
|
102349
|
-
};
|
|
102350
|
-
BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
|
|
102351
|
-
var needle = {
|
|
102352
|
-
generatedLine: util.getArg(aArgs, "line"),
|
|
102353
|
-
generatedColumn: util.getArg(aArgs, "column")
|
|
102354
|
-
};
|
|
102355
|
-
var index = this._findMapping(
|
|
102356
|
-
needle,
|
|
102357
|
-
this._generatedMappings,
|
|
102358
|
-
"generatedLine",
|
|
102359
|
-
"generatedColumn",
|
|
102360
|
-
util.compareByGeneratedPositionsDeflated,
|
|
102361
|
-
util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
|
|
102362
|
-
);
|
|
102363
|
-
if (index >= 0) {
|
|
102364
|
-
var mapping = this._generatedMappings[index];
|
|
102365
|
-
if (mapping.generatedLine === needle.generatedLine) {
|
|
102366
|
-
var source = util.getArg(mapping, "source", null);
|
|
102367
|
-
if (source !== null) {
|
|
102368
|
-
source = this._sources.at(source);
|
|
102369
|
-
source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
|
|
102370
|
-
}
|
|
102371
|
-
var name = util.getArg(mapping, "name", null);
|
|
102372
|
-
if (name !== null) {
|
|
102373
|
-
name = this._names.at(name);
|
|
102374
|
-
}
|
|
102375
|
-
return {
|
|
102376
|
-
source,
|
|
102377
|
-
line: util.getArg(mapping, "originalLine", null),
|
|
102378
|
-
column: util.getArg(mapping, "originalColumn", null),
|
|
102379
|
-
name
|
|
102380
|
-
};
|
|
102381
|
-
}
|
|
102382
|
-
}
|
|
102383
|
-
return {
|
|
102384
|
-
source: null,
|
|
102385
|
-
line: null,
|
|
102386
|
-
column: null,
|
|
102387
|
-
name: null
|
|
102388
|
-
};
|
|
102389
|
-
};
|
|
102390
|
-
BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
|
|
102391
|
-
if (!this.sourcesContent) {
|
|
102392
|
-
return false;
|
|
102393
|
-
}
|
|
102394
|
-
return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
|
|
102395
|
-
return sc == null;
|
|
102396
|
-
});
|
|
102397
|
-
};
|
|
102398
|
-
BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
|
|
102399
|
-
if (!this.sourcesContent) {
|
|
102400
|
-
return null;
|
|
102401
|
-
}
|
|
102402
|
-
var index = this._findSourceIndex(aSource);
|
|
102403
|
-
if (index >= 0) {
|
|
102404
|
-
return this.sourcesContent[index];
|
|
102405
|
-
}
|
|
102406
|
-
var relativeSource = aSource;
|
|
102407
|
-
if (this.sourceRoot != null) {
|
|
102408
|
-
relativeSource = util.relative(this.sourceRoot, relativeSource);
|
|
102409
|
-
}
|
|
102410
|
-
var url;
|
|
102411
|
-
if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
|
|
102412
|
-
var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
|
|
102413
|
-
if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
|
|
102414
|
-
return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
|
|
102415
|
-
}
|
|
102416
|
-
if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) {
|
|
102417
|
-
return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
|
|
102418
|
-
}
|
|
102419
|
-
}
|
|
102420
|
-
if (nullOnMissing) {
|
|
102421
|
-
return null;
|
|
102422
|
-
} else {
|
|
102423
|
-
throw new Error('"' + relativeSource + '" is not in the SourceMap.');
|
|
102424
|
-
}
|
|
102425
|
-
};
|
|
102426
|
-
BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
|
|
102427
|
-
var source = util.getArg(aArgs, "source");
|
|
102428
|
-
source = this._findSourceIndex(source);
|
|
102429
|
-
if (source < 0) {
|
|
102430
|
-
return {
|
|
102431
|
-
line: null,
|
|
102432
|
-
column: null,
|
|
102433
|
-
lastColumn: null
|
|
102434
|
-
};
|
|
102435
|
-
}
|
|
102436
|
-
var needle = {
|
|
102437
|
-
source,
|
|
102438
|
-
originalLine: util.getArg(aArgs, "line"),
|
|
102439
|
-
originalColumn: util.getArg(aArgs, "column")
|
|
102440
|
-
};
|
|
102441
|
-
var index = this._findMapping(
|
|
102442
|
-
needle,
|
|
102443
|
-
this._originalMappings,
|
|
102444
|
-
"originalLine",
|
|
102445
|
-
"originalColumn",
|
|
102446
|
-
util.compareByOriginalPositions,
|
|
102447
|
-
util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
|
|
102448
|
-
);
|
|
102449
|
-
if (index >= 0) {
|
|
102450
|
-
var mapping = this._originalMappings[index];
|
|
102451
|
-
if (mapping.source === needle.source) {
|
|
102452
|
-
return {
|
|
102453
|
-
line: util.getArg(mapping, "generatedLine", null),
|
|
102454
|
-
column: util.getArg(mapping, "generatedColumn", null),
|
|
102455
|
-
lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
|
|
102456
|
-
};
|
|
102457
|
-
}
|
|
102458
|
-
}
|
|
102459
|
-
return {
|
|
102460
|
-
line: null,
|
|
102461
|
-
column: null,
|
|
102462
|
-
lastColumn: null
|
|
102463
|
-
};
|
|
102464
|
-
};
|
|
102465
|
-
exports2.BasicSourceMapConsumer = BasicSourceMapConsumer;
|
|
102466
|
-
function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
102467
|
-
var sourceMap = aSourceMap;
|
|
102468
|
-
if (typeof aSourceMap === "string") {
|
|
102469
|
-
sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
102470
|
-
}
|
|
102471
|
-
var version = util.getArg(sourceMap, "version");
|
|
102472
|
-
var sections = util.getArg(sourceMap, "sections");
|
|
102473
|
-
if (version != this._version) {
|
|
102474
|
-
throw new Error("Unsupported version: " + version);
|
|
102475
|
-
}
|
|
102476
|
-
this._sources = new ArraySet();
|
|
102477
|
-
this._names = new ArraySet();
|
|
102478
|
-
var lastOffset = {
|
|
102479
|
-
line: -1,
|
|
102480
|
-
column: 0
|
|
102481
|
-
};
|
|
102482
|
-
this._sections = sections.map(function(s) {
|
|
102483
|
-
if (s.url) {
|
|
102484
|
-
throw new Error("Support for url field in sections not implemented.");
|
|
102485
|
-
}
|
|
102486
|
-
var offset = util.getArg(s, "offset");
|
|
102487
|
-
var offsetLine = util.getArg(offset, "line");
|
|
102488
|
-
var offsetColumn = util.getArg(offset, "column");
|
|
102489
|
-
if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
|
|
102490
|
-
throw new Error("Section offsets must be ordered and non-overlapping.");
|
|
102491
|
-
}
|
|
102492
|
-
lastOffset = offset;
|
|
102493
|
-
return {
|
|
102494
|
-
generatedOffset: {
|
|
102495
|
-
// The offset fields are 0-based, but we use 1-based indices when
|
|
102496
|
-
// encoding/decoding from VLQ.
|
|
102497
|
-
generatedLine: offsetLine + 1,
|
|
102498
|
-
generatedColumn: offsetColumn + 1
|
|
102499
|
-
},
|
|
102500
|
-
consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
|
|
102501
|
-
};
|
|
102502
|
-
});
|
|
102503
|
-
}
|
|
102504
|
-
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
102505
|
-
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
|
|
102506
|
-
IndexedSourceMapConsumer.prototype._version = 3;
|
|
102507
|
-
Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
|
|
102508
|
-
get: function() {
|
|
102509
|
-
var sources = [];
|
|
102510
|
-
for (var i = 0; i < this._sections.length; i++) {
|
|
102511
|
-
for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
|
|
102512
|
-
sources.push(this._sections[i].consumer.sources[j]);
|
|
102513
|
-
}
|
|
102514
|
-
}
|
|
102515
|
-
return sources;
|
|
102516
|
-
}
|
|
102517
|
-
});
|
|
102518
|
-
IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
|
|
102519
|
-
var needle = {
|
|
102520
|
-
generatedLine: util.getArg(aArgs, "line"),
|
|
102521
|
-
generatedColumn: util.getArg(aArgs, "column")
|
|
102522
|
-
};
|
|
102523
|
-
var sectionIndex = binarySearch.search(
|
|
102524
|
-
needle,
|
|
102525
|
-
this._sections,
|
|
102526
|
-
function(needle2, section2) {
|
|
102527
|
-
var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
|
|
102528
|
-
if (cmp) {
|
|
102529
|
-
return cmp;
|
|
102530
|
-
}
|
|
102531
|
-
return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
|
|
102532
|
-
}
|
|
102533
|
-
);
|
|
102534
|
-
var section = this._sections[sectionIndex];
|
|
102535
|
-
if (!section) {
|
|
102536
|
-
return {
|
|
102537
|
-
source: null,
|
|
102538
|
-
line: null,
|
|
102539
|
-
column: null,
|
|
102540
|
-
name: null
|
|
102541
|
-
};
|
|
102542
|
-
}
|
|
102543
|
-
return section.consumer.originalPositionFor({
|
|
102544
|
-
line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
|
|
102545
|
-
column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
102546
|
-
bias: aArgs.bias
|
|
102547
|
-
});
|
|
102548
|
-
};
|
|
102549
|
-
IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
|
|
102550
|
-
return this._sections.every(function(s) {
|
|
102551
|
-
return s.consumer.hasContentsOfAllSources();
|
|
102552
|
-
});
|
|
102553
|
-
};
|
|
102554
|
-
IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
|
|
102555
|
-
for (var i = 0; i < this._sections.length; i++) {
|
|
102556
|
-
var section = this._sections[i];
|
|
102557
|
-
var content = section.consumer.sourceContentFor(aSource, true);
|
|
102558
|
-
if (content) {
|
|
102559
|
-
return content;
|
|
102560
|
-
}
|
|
102561
|
-
}
|
|
102562
|
-
if (nullOnMissing) {
|
|
102563
|
-
return null;
|
|
102564
|
-
} else {
|
|
102565
|
-
throw new Error('"' + aSource + '" is not in the SourceMap.');
|
|
102566
|
-
}
|
|
102567
|
-
};
|
|
102568
|
-
IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
|
|
102569
|
-
for (var i = 0; i < this._sections.length; i++) {
|
|
102570
|
-
var section = this._sections[i];
|
|
102571
|
-
if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) {
|
|
102572
|
-
continue;
|
|
102573
|
-
}
|
|
102574
|
-
var generatedPosition = section.consumer.generatedPositionFor(aArgs);
|
|
102575
|
-
if (generatedPosition) {
|
|
102576
|
-
var ret = {
|
|
102577
|
-
line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
|
|
102578
|
-
column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
|
|
102579
|
-
};
|
|
102580
|
-
return ret;
|
|
102581
|
-
}
|
|
102582
|
-
}
|
|
102583
|
-
return {
|
|
102584
|
-
line: null,
|
|
102585
|
-
column: null
|
|
102586
|
-
};
|
|
102587
|
-
};
|
|
102588
|
-
IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
102589
|
-
this.__generatedMappings = [];
|
|
102590
|
-
this.__originalMappings = [];
|
|
102591
|
-
for (var i = 0; i < this._sections.length; i++) {
|
|
102592
|
-
var section = this._sections[i];
|
|
102593
|
-
var sectionMappings = section.consumer._generatedMappings;
|
|
102594
|
-
for (var j = 0; j < sectionMappings.length; j++) {
|
|
102595
|
-
var mapping = sectionMappings[j];
|
|
102596
|
-
var source = section.consumer._sources.at(mapping.source);
|
|
102597
|
-
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
|
|
102598
|
-
this._sources.add(source);
|
|
102599
|
-
source = this._sources.indexOf(source);
|
|
102600
|
-
var name = null;
|
|
102601
|
-
if (mapping.name) {
|
|
102602
|
-
name = section.consumer._names.at(mapping.name);
|
|
102603
|
-
this._names.add(name);
|
|
102604
|
-
name = this._names.indexOf(name);
|
|
102605
|
-
}
|
|
102606
|
-
var adjustedMapping = {
|
|
102607
|
-
source,
|
|
102608
|
-
generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
|
|
102609
|
-
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
102610
|
-
originalLine: mapping.originalLine,
|
|
102611
|
-
originalColumn: mapping.originalColumn,
|
|
102612
|
-
name
|
|
102613
|
-
};
|
|
102614
|
-
this.__generatedMappings.push(adjustedMapping);
|
|
102615
|
-
if (typeof adjustedMapping.originalLine === "number") {
|
|
102616
|
-
this.__originalMappings.push(adjustedMapping);
|
|
102617
|
-
}
|
|
102618
|
-
}
|
|
102619
|
-
}
|
|
102620
|
-
quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
|
|
102621
|
-
quickSort(this.__originalMappings, util.compareByOriginalPositions);
|
|
102622
|
-
};
|
|
102623
|
-
exports2.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
|
|
102624
|
-
}
|
|
102625
|
-
});
|
|
102626
|
-
|
|
102627
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/source-node.js
|
|
102628
|
-
var require_source_node = __commonJS({
|
|
102629
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/source-node.js"(exports2) {
|
|
102630
|
-
"use strict";
|
|
102631
|
-
var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
|
|
102632
|
-
var util = require_util4();
|
|
102633
|
-
var REGEX_NEWLINE = /(\r?\n)/;
|
|
102634
|
-
var NEWLINE_CODE = 10;
|
|
102635
|
-
var isSourceNode = "$$$isSourceNode$$$";
|
|
102636
|
-
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
|
|
102637
|
-
this.children = [];
|
|
102638
|
-
this.sourceContents = {};
|
|
102639
|
-
this.line = aLine == null ? null : aLine;
|
|
102640
|
-
this.column = aColumn == null ? null : aColumn;
|
|
102641
|
-
this.source = aSource == null ? null : aSource;
|
|
102642
|
-
this.name = aName == null ? null : aName;
|
|
102643
|
-
this[isSourceNode] = true;
|
|
102644
|
-
if (aChunks != null) this.add(aChunks);
|
|
102645
|
-
}
|
|
102646
|
-
SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
|
|
102647
|
-
var node = new SourceNode();
|
|
102648
|
-
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
|
|
102649
|
-
var remainingLinesIndex = 0;
|
|
102650
|
-
var shiftNextLine = function() {
|
|
102651
|
-
var lineContents = getNextLine();
|
|
102652
|
-
var newLine = getNextLine() || "";
|
|
102653
|
-
return lineContents + newLine;
|
|
102654
|
-
function getNextLine() {
|
|
102655
|
-
return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
|
|
102656
|
-
}
|
|
102657
|
-
};
|
|
102658
|
-
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
|
|
102659
|
-
var lastMapping = null;
|
|
102660
|
-
aSourceMapConsumer.eachMapping(function(mapping) {
|
|
102661
|
-
if (lastMapping !== null) {
|
|
102662
|
-
if (lastGeneratedLine < mapping.generatedLine) {
|
|
102663
|
-
addMappingWithCode(lastMapping, shiftNextLine());
|
|
102664
|
-
lastGeneratedLine++;
|
|
102665
|
-
lastGeneratedColumn = 0;
|
|
102666
|
-
} else {
|
|
102667
|
-
var nextLine = remainingLines[remainingLinesIndex] || "";
|
|
102668
|
-
var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
|
|
102669
|
-
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
|
|
102670
|
-
lastGeneratedColumn = mapping.generatedColumn;
|
|
102671
|
-
addMappingWithCode(lastMapping, code);
|
|
102672
|
-
lastMapping = mapping;
|
|
102673
|
-
return;
|
|
102674
|
-
}
|
|
102675
|
-
}
|
|
102676
|
-
while (lastGeneratedLine < mapping.generatedLine) {
|
|
102677
|
-
node.add(shiftNextLine());
|
|
102678
|
-
lastGeneratedLine++;
|
|
102679
|
-
}
|
|
102680
|
-
if (lastGeneratedColumn < mapping.generatedColumn) {
|
|
102681
|
-
var nextLine = remainingLines[remainingLinesIndex] || "";
|
|
102682
|
-
node.add(nextLine.substr(0, mapping.generatedColumn));
|
|
102683
|
-
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
|
|
102684
|
-
lastGeneratedColumn = mapping.generatedColumn;
|
|
102685
|
-
}
|
|
102686
|
-
lastMapping = mapping;
|
|
102687
|
-
}, this);
|
|
102688
|
-
if (remainingLinesIndex < remainingLines.length) {
|
|
102689
|
-
if (lastMapping) {
|
|
102690
|
-
addMappingWithCode(lastMapping, shiftNextLine());
|
|
102691
|
-
}
|
|
102692
|
-
node.add(remainingLines.splice(remainingLinesIndex).join(""));
|
|
102693
|
-
}
|
|
102694
|
-
aSourceMapConsumer.sources.forEach(function(sourceFile) {
|
|
102695
|
-
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
102696
|
-
if (content != null) {
|
|
102697
|
-
if (aRelativePath != null) {
|
|
102698
|
-
sourceFile = util.join(aRelativePath, sourceFile);
|
|
102699
|
-
}
|
|
102700
|
-
node.setSourceContent(sourceFile, content);
|
|
102701
|
-
}
|
|
102702
|
-
});
|
|
102703
|
-
return node;
|
|
102704
|
-
function addMappingWithCode(mapping, code) {
|
|
102705
|
-
if (mapping === null || mapping.source === void 0) {
|
|
102706
|
-
node.add(code);
|
|
102707
|
-
} else {
|
|
102708
|
-
var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
|
|
102709
|
-
node.add(new SourceNode(
|
|
102710
|
-
mapping.originalLine,
|
|
102711
|
-
mapping.originalColumn,
|
|
102712
|
-
source,
|
|
102713
|
-
code,
|
|
102714
|
-
mapping.name
|
|
102715
|
-
));
|
|
102716
|
-
}
|
|
102717
|
-
}
|
|
102718
|
-
};
|
|
102719
|
-
SourceNode.prototype.add = function SourceNode_add(aChunk) {
|
|
102720
|
-
if (Array.isArray(aChunk)) {
|
|
102721
|
-
aChunk.forEach(function(chunk) {
|
|
102722
|
-
this.add(chunk);
|
|
102723
|
-
}, this);
|
|
102724
|
-
} else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
|
102725
|
-
if (aChunk) {
|
|
102726
|
-
this.children.push(aChunk);
|
|
102727
|
-
}
|
|
102728
|
-
} else {
|
|
102729
|
-
throw new TypeError(
|
|
102730
|
-
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
|
102731
|
-
);
|
|
102732
|
-
}
|
|
102733
|
-
return this;
|
|
102734
|
-
};
|
|
102735
|
-
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
|
|
102736
|
-
if (Array.isArray(aChunk)) {
|
|
102737
|
-
for (var i = aChunk.length - 1; i >= 0; i--) {
|
|
102738
|
-
this.prepend(aChunk[i]);
|
|
102739
|
-
}
|
|
102740
|
-
} else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
|
102741
|
-
this.children.unshift(aChunk);
|
|
102742
|
-
} else {
|
|
102743
|
-
throw new TypeError(
|
|
102744
|
-
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
|
102745
|
-
);
|
|
102746
|
-
}
|
|
102747
|
-
return this;
|
|
102748
|
-
};
|
|
102749
|
-
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
|
|
102750
|
-
var chunk;
|
|
102751
|
-
for (var i = 0, len = this.children.length; i < len; i++) {
|
|
102752
|
-
chunk = this.children[i];
|
|
102753
|
-
if (chunk[isSourceNode]) {
|
|
102754
|
-
chunk.walk(aFn);
|
|
102755
|
-
} else {
|
|
102756
|
-
if (chunk !== "") {
|
|
102757
|
-
aFn(chunk, {
|
|
102758
|
-
source: this.source,
|
|
102759
|
-
line: this.line,
|
|
102760
|
-
column: this.column,
|
|
102761
|
-
name: this.name
|
|
102762
|
-
});
|
|
102763
|
-
}
|
|
102764
|
-
}
|
|
102765
|
-
}
|
|
102766
|
-
};
|
|
102767
|
-
SourceNode.prototype.join = function SourceNode_join(aSep) {
|
|
102768
|
-
var newChildren;
|
|
102769
|
-
var i;
|
|
102770
|
-
var len = this.children.length;
|
|
102771
|
-
if (len > 0) {
|
|
102772
|
-
newChildren = [];
|
|
102773
|
-
for (i = 0; i < len - 1; i++) {
|
|
102774
|
-
newChildren.push(this.children[i]);
|
|
102775
|
-
newChildren.push(aSep);
|
|
102776
|
-
}
|
|
102777
|
-
newChildren.push(this.children[i]);
|
|
102778
|
-
this.children = newChildren;
|
|
102779
|
-
}
|
|
102780
|
-
return this;
|
|
102781
|
-
};
|
|
102782
|
-
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
|
|
102783
|
-
var lastChild = this.children[this.children.length - 1];
|
|
102784
|
-
if (lastChild[isSourceNode]) {
|
|
102785
|
-
lastChild.replaceRight(aPattern, aReplacement);
|
|
102786
|
-
} else if (typeof lastChild === "string") {
|
|
102787
|
-
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
|
|
102788
|
-
} else {
|
|
102789
|
-
this.children.push("".replace(aPattern, aReplacement));
|
|
102790
|
-
}
|
|
102791
|
-
return this;
|
|
102792
|
-
};
|
|
102793
|
-
SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
|
|
102794
|
-
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
|
|
102795
|
-
};
|
|
102796
|
-
SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
|
|
102797
|
-
for (var i = 0, len = this.children.length; i < len; i++) {
|
|
102798
|
-
if (this.children[i][isSourceNode]) {
|
|
102799
|
-
this.children[i].walkSourceContents(aFn);
|
|
102800
|
-
}
|
|
102801
|
-
}
|
|
102802
|
-
var sources = Object.keys(this.sourceContents);
|
|
102803
|
-
for (var i = 0, len = sources.length; i < len; i++) {
|
|
102804
|
-
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
|
|
102805
|
-
}
|
|
102806
|
-
};
|
|
102807
|
-
SourceNode.prototype.toString = function SourceNode_toString() {
|
|
102808
|
-
var str = "";
|
|
102809
|
-
this.walk(function(chunk) {
|
|
102810
|
-
str += chunk;
|
|
102811
|
-
});
|
|
102812
|
-
return str;
|
|
102813
|
-
};
|
|
102814
|
-
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
|
|
102815
|
-
var generated = {
|
|
102816
|
-
code: "",
|
|
102817
|
-
line: 1,
|
|
102818
|
-
column: 0
|
|
102819
|
-
};
|
|
102820
|
-
var map2 = new SourceMapGenerator(aArgs);
|
|
102821
|
-
var sourceMappingActive = false;
|
|
102822
|
-
var lastOriginalSource = null;
|
|
102823
|
-
var lastOriginalLine = null;
|
|
102824
|
-
var lastOriginalColumn = null;
|
|
102825
|
-
var lastOriginalName = null;
|
|
102826
|
-
this.walk(function(chunk, original) {
|
|
102827
|
-
generated.code += chunk;
|
|
102828
|
-
if (original.source !== null && original.line !== null && original.column !== null) {
|
|
102829
|
-
if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
|
|
102830
|
-
map2.addMapping({
|
|
102831
|
-
source: original.source,
|
|
102832
|
-
original: {
|
|
102833
|
-
line: original.line,
|
|
102834
|
-
column: original.column
|
|
102835
|
-
},
|
|
102836
|
-
generated: {
|
|
102837
|
-
line: generated.line,
|
|
102838
|
-
column: generated.column
|
|
102839
|
-
},
|
|
102840
|
-
name: original.name
|
|
102841
|
-
});
|
|
102842
|
-
}
|
|
102843
|
-
lastOriginalSource = original.source;
|
|
102844
|
-
lastOriginalLine = original.line;
|
|
102845
|
-
lastOriginalColumn = original.column;
|
|
102846
|
-
lastOriginalName = original.name;
|
|
102847
|
-
sourceMappingActive = true;
|
|
102848
|
-
} else if (sourceMappingActive) {
|
|
102849
|
-
map2.addMapping({
|
|
102850
|
-
generated: {
|
|
102851
|
-
line: generated.line,
|
|
102852
|
-
column: generated.column
|
|
102853
|
-
}
|
|
102854
|
-
});
|
|
102855
|
-
lastOriginalSource = null;
|
|
102856
|
-
sourceMappingActive = false;
|
|
102857
|
-
}
|
|
102858
|
-
for (var idx = 0, length = chunk.length; idx < length; idx++) {
|
|
102859
|
-
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
|
|
102860
|
-
generated.line++;
|
|
102861
|
-
generated.column = 0;
|
|
102862
|
-
if (idx + 1 === length) {
|
|
102863
|
-
lastOriginalSource = null;
|
|
102864
|
-
sourceMappingActive = false;
|
|
102865
|
-
} else if (sourceMappingActive) {
|
|
102866
|
-
map2.addMapping({
|
|
102867
|
-
source: original.source,
|
|
102868
|
-
original: {
|
|
102869
|
-
line: original.line,
|
|
102870
|
-
column: original.column
|
|
102871
|
-
},
|
|
102872
|
-
generated: {
|
|
102873
|
-
line: generated.line,
|
|
102874
|
-
column: generated.column
|
|
102875
|
-
},
|
|
102876
|
-
name: original.name
|
|
102877
|
-
});
|
|
102878
|
-
}
|
|
102879
|
-
} else {
|
|
102880
|
-
generated.column++;
|
|
102881
|
-
}
|
|
102882
|
-
}
|
|
102883
|
-
});
|
|
102884
|
-
this.walkSourceContents(function(sourceFile, sourceContent) {
|
|
102885
|
-
map2.setSourceContent(sourceFile, sourceContent);
|
|
102886
|
-
});
|
|
102887
|
-
return { code: generated.code, map: map2 };
|
|
102888
|
-
};
|
|
102889
|
-
exports2.SourceNode = SourceNode;
|
|
102890
|
-
}
|
|
102891
|
-
});
|
|
102892
|
-
|
|
102893
|
-
// ../../node_modules/source-map-support/node_modules/source-map/source-map.js
|
|
102894
|
-
var require_source_map = __commonJS({
|
|
102895
|
-
"../../node_modules/source-map-support/node_modules/source-map/source-map.js"(exports2) {
|
|
102896
|
-
"use strict";
|
|
102897
|
-
exports2.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
|
|
102898
|
-
exports2.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
|
|
102899
|
-
exports2.SourceNode = require_source_node().SourceNode;
|
|
102900
|
-
}
|
|
102901
|
-
});
|
|
102902
|
-
|
|
102903
|
-
// ../../node_modules/buffer-from/index.js
|
|
102904
|
-
var require_buffer_from = __commonJS({
|
|
102905
|
-
"../../node_modules/buffer-from/index.js"(exports2, module2) {
|
|
102906
|
-
"use strict";
|
|
102907
|
-
var toString = Object.prototype.toString;
|
|
102908
|
-
var isModern = typeof Buffer !== "undefined" && typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function";
|
|
102909
|
-
function isArrayBuffer(input) {
|
|
102910
|
-
return toString.call(input).slice(8, -1) === "ArrayBuffer";
|
|
102911
|
-
}
|
|
102912
|
-
function fromArrayBuffer(obj, byteOffset, length) {
|
|
102913
|
-
byteOffset >>>= 0;
|
|
102914
|
-
var maxLength = obj.byteLength - byteOffset;
|
|
102915
|
-
if (maxLength < 0) {
|
|
102916
|
-
throw new RangeError("'offset' is out of bounds");
|
|
102917
|
-
}
|
|
102918
|
-
if (length === void 0) {
|
|
102919
|
-
length = maxLength;
|
|
102920
|
-
} else {
|
|
102921
|
-
length >>>= 0;
|
|
102922
|
-
if (length > maxLength) {
|
|
102923
|
-
throw new RangeError("'length' is out of bounds");
|
|
102924
|
-
}
|
|
102925
|
-
}
|
|
102926
|
-
return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)));
|
|
102927
|
-
}
|
|
102928
|
-
function fromString(string, encoding) {
|
|
102929
|
-
if (typeof encoding !== "string" || encoding === "") {
|
|
102930
|
-
encoding = "utf8";
|
|
102931
|
-
}
|
|
102932
|
-
if (!Buffer.isEncoding(encoding)) {
|
|
102933
|
-
throw new TypeError('"encoding" must be a valid string encoding');
|
|
102934
|
-
}
|
|
102935
|
-
return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding);
|
|
102936
|
-
}
|
|
102937
|
-
function bufferFrom(value, encodingOrOffset, length) {
|
|
102938
|
-
if (typeof value === "number") {
|
|
102939
|
-
throw new TypeError('"value" argument must not be a number');
|
|
102940
|
-
}
|
|
102941
|
-
if (isArrayBuffer(value)) {
|
|
102942
|
-
return fromArrayBuffer(value, encodingOrOffset, length);
|
|
102943
|
-
}
|
|
102944
|
-
if (typeof value === "string") {
|
|
102945
|
-
return fromString(value, encodingOrOffset);
|
|
102946
|
-
}
|
|
102947
|
-
return isModern ? Buffer.from(value) : new Buffer(value);
|
|
102948
|
-
}
|
|
102949
|
-
module2.exports = bufferFrom;
|
|
102950
|
-
}
|
|
102951
|
-
});
|
|
102952
|
-
|
|
102953
|
-
// ../../node_modules/source-map-support/source-map-support.js
|
|
102954
|
-
var require_source_map_support = __commonJS({
|
|
102955
|
-
"../../node_modules/source-map-support/source-map-support.js"(exports2, module2) {
|
|
102956
|
-
"use strict";
|
|
102957
|
-
var SourceMapConsumer = require_source_map().SourceMapConsumer;
|
|
102958
|
-
var path = require("path");
|
|
102959
|
-
var fs;
|
|
102960
|
-
try {
|
|
102961
|
-
fs = require("fs");
|
|
102962
|
-
if (!fs.existsSync || !fs.readFileSync) {
|
|
102963
|
-
fs = null;
|
|
102964
|
-
}
|
|
102965
|
-
} catch (err) {
|
|
102966
|
-
}
|
|
102967
|
-
var bufferFrom = require_buffer_from();
|
|
102968
|
-
function dynamicRequire(mod, request) {
|
|
102969
|
-
return mod.require(request);
|
|
102970
|
-
}
|
|
102971
|
-
var errorFormatterInstalled = false;
|
|
102972
|
-
var uncaughtShimInstalled = false;
|
|
102973
|
-
var emptyCacheBetweenOperations = false;
|
|
102974
|
-
var environment = "auto";
|
|
102975
|
-
var fileContentsCache = {};
|
|
102976
|
-
var sourceMapCache = {};
|
|
102977
|
-
var reSourceMap = /^data:application\/json[^,]+base64,/;
|
|
102978
|
-
var retrieveFileHandlers = [];
|
|
102979
|
-
var retrieveMapHandlers = [];
|
|
102980
|
-
function isInBrowser() {
|
|
102981
|
-
if (environment === "browser")
|
|
102982
|
-
return true;
|
|
102983
|
-
if (environment === "node")
|
|
102984
|
-
return false;
|
|
102985
|
-
return typeof window !== "undefined" && typeof XMLHttpRequest === "function" && !(window.require && window.module && window.process && window.process.type === "renderer");
|
|
102986
|
-
}
|
|
102987
|
-
function hasGlobalProcessEventEmitter() {
|
|
102988
|
-
return typeof process === "object" && process !== null && typeof process.on === "function";
|
|
102989
|
-
}
|
|
102990
|
-
function globalProcessVersion() {
|
|
102991
|
-
if (typeof process === "object" && process !== null) {
|
|
102992
|
-
return process.version;
|
|
102993
|
-
} else {
|
|
102994
|
-
return "";
|
|
102995
|
-
}
|
|
102996
|
-
}
|
|
102997
|
-
function globalProcessStderr() {
|
|
102998
|
-
if (typeof process === "object" && process !== null) {
|
|
102999
|
-
return process.stderr;
|
|
103000
|
-
}
|
|
103001
|
-
}
|
|
103002
|
-
function globalProcessExit(code) {
|
|
103003
|
-
if (typeof process === "object" && process !== null && typeof process.exit === "function") {
|
|
103004
|
-
return process.exit(code);
|
|
103005
|
-
}
|
|
103006
|
-
}
|
|
103007
|
-
function handlerExec(list) {
|
|
103008
|
-
return function(arg) {
|
|
103009
|
-
for (var i = 0; i < list.length; i++) {
|
|
103010
|
-
var ret = list[i](arg);
|
|
103011
|
-
if (ret) {
|
|
103012
|
-
return ret;
|
|
103013
|
-
}
|
|
103014
|
-
}
|
|
103015
|
-
return null;
|
|
103016
|
-
};
|
|
103017
|
-
}
|
|
103018
|
-
var retrieveFile = handlerExec(retrieveFileHandlers);
|
|
103019
|
-
retrieveFileHandlers.push(function(path2) {
|
|
103020
|
-
path2 = path2.trim();
|
|
103021
|
-
if (/^file:/.test(path2)) {
|
|
103022
|
-
path2 = path2.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
|
|
103023
|
-
return drive ? "" : (
|
|
103024
|
-
// file:///C:/dir/file -> C:/dir/file
|
|
103025
|
-
"/"
|
|
103026
|
-
);
|
|
103027
|
-
});
|
|
103028
|
-
}
|
|
103029
|
-
if (path2 in fileContentsCache) {
|
|
103030
|
-
return fileContentsCache[path2];
|
|
103031
|
-
}
|
|
103032
|
-
var contents = "";
|
|
103033
|
-
try {
|
|
103034
|
-
if (!fs) {
|
|
103035
|
-
var xhr = new XMLHttpRequest();
|
|
103036
|
-
xhr.open(
|
|
103037
|
-
"GET",
|
|
103038
|
-
path2,
|
|
103039
|
-
/** async */
|
|
103040
|
-
false
|
|
103041
|
-
);
|
|
103042
|
-
xhr.send(null);
|
|
103043
|
-
if (xhr.readyState === 4 && xhr.status === 200) {
|
|
103044
|
-
contents = xhr.responseText;
|
|
103045
|
-
}
|
|
103046
|
-
} else if (fs.existsSync(path2)) {
|
|
103047
|
-
contents = fs.readFileSync(path2, "utf8");
|
|
103048
|
-
}
|
|
103049
|
-
} catch (er) {
|
|
103050
|
-
}
|
|
103051
|
-
return fileContentsCache[path2] = contents;
|
|
103052
|
-
});
|
|
103053
|
-
function supportRelativeURL(file, url) {
|
|
103054
|
-
if (!file) return url;
|
|
103055
|
-
var dir = path.dirname(file);
|
|
103056
|
-
var match = /^\w+:\/\/[^\/]*/.exec(dir);
|
|
103057
|
-
var protocol = match ? match[0] : "";
|
|
103058
|
-
var startPath = dir.slice(protocol.length);
|
|
103059
|
-
if (protocol && /^\/\w\:/.test(startPath)) {
|
|
103060
|
-
protocol += "/";
|
|
103061
|
-
return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
|
|
103062
|
-
}
|
|
103063
|
-
return protocol + path.resolve(dir.slice(protocol.length), url);
|
|
103064
|
-
}
|
|
103065
|
-
function retrieveSourceMapURL(source) {
|
|
103066
|
-
var fileData;
|
|
103067
|
-
if (isInBrowser()) {
|
|
103068
|
-
try {
|
|
103069
|
-
var xhr = new XMLHttpRequest();
|
|
103070
|
-
xhr.open("GET", source, false);
|
|
103071
|
-
xhr.send(null);
|
|
103072
|
-
fileData = xhr.readyState === 4 ? xhr.responseText : null;
|
|
103073
|
-
var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap");
|
|
103074
|
-
if (sourceMapHeader) {
|
|
103075
|
-
return sourceMapHeader;
|
|
103076
|
-
}
|
|
103077
|
-
} catch (e) {
|
|
103078
|
-
}
|
|
103079
|
-
}
|
|
103080
|
-
fileData = retrieveFile(source);
|
|
103081
|
-
var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
|
|
103082
|
-
var lastMatch, match;
|
|
103083
|
-
while (match = re.exec(fileData)) lastMatch = match;
|
|
103084
|
-
if (!lastMatch) return null;
|
|
103085
|
-
return lastMatch[1];
|
|
103086
|
-
}
|
|
103087
|
-
var retrieveSourceMap = handlerExec(retrieveMapHandlers);
|
|
103088
|
-
retrieveMapHandlers.push(function(source) {
|
|
103089
|
-
var sourceMappingURL = retrieveSourceMapURL(source);
|
|
103090
|
-
if (!sourceMappingURL) return null;
|
|
103091
|
-
var sourceMapData;
|
|
103092
|
-
if (reSourceMap.test(sourceMappingURL)) {
|
|
103093
|
-
var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
|
|
103094
|
-
sourceMapData = bufferFrom(rawData, "base64").toString();
|
|
103095
|
-
sourceMappingURL = source;
|
|
103096
|
-
} else {
|
|
103097
|
-
sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
|
|
103098
|
-
sourceMapData = retrieveFile(sourceMappingURL);
|
|
103099
|
-
}
|
|
103100
|
-
if (!sourceMapData) {
|
|
103101
|
-
return null;
|
|
103102
|
-
}
|
|
103103
|
-
return {
|
|
103104
|
-
url: sourceMappingURL,
|
|
103105
|
-
map: sourceMapData
|
|
103106
|
-
};
|
|
103107
|
-
});
|
|
103108
|
-
function mapSourcePosition(position) {
|
|
103109
|
-
var sourceMap = sourceMapCache[position.source];
|
|
103110
|
-
if (!sourceMap) {
|
|
103111
|
-
var urlAndMap = retrieveSourceMap(position.source);
|
|
103112
|
-
if (urlAndMap) {
|
|
103113
|
-
sourceMap = sourceMapCache[position.source] = {
|
|
103114
|
-
url: urlAndMap.url,
|
|
103115
|
-
map: new SourceMapConsumer(urlAndMap.map)
|
|
103116
|
-
};
|
|
103117
|
-
if (sourceMap.map.sourcesContent) {
|
|
103118
|
-
sourceMap.map.sources.forEach(function(source, i) {
|
|
103119
|
-
var contents = sourceMap.map.sourcesContent[i];
|
|
103120
|
-
if (contents) {
|
|
103121
|
-
var url = supportRelativeURL(sourceMap.url, source);
|
|
103122
|
-
fileContentsCache[url] = contents;
|
|
103123
|
-
}
|
|
103124
|
-
});
|
|
103125
|
-
}
|
|
103126
|
-
} else {
|
|
103127
|
-
sourceMap = sourceMapCache[position.source] = {
|
|
103128
|
-
url: null,
|
|
103129
|
-
map: null
|
|
103130
|
-
};
|
|
103131
|
-
}
|
|
103132
|
-
}
|
|
103133
|
-
if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === "function") {
|
|
103134
|
-
var originalPosition = sourceMap.map.originalPositionFor(position);
|
|
103135
|
-
if (originalPosition.source !== null) {
|
|
103136
|
-
originalPosition.source = supportRelativeURL(
|
|
103137
|
-
sourceMap.url,
|
|
103138
|
-
originalPosition.source
|
|
103139
|
-
);
|
|
103140
|
-
return originalPosition;
|
|
103141
|
-
}
|
|
103142
|
-
}
|
|
103143
|
-
return position;
|
|
103144
|
-
}
|
|
103145
|
-
function mapEvalOrigin(origin) {
|
|
103146
|
-
var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
|
|
103147
|
-
if (match) {
|
|
103148
|
-
var position = mapSourcePosition({
|
|
103149
|
-
source: match[2],
|
|
103150
|
-
line: +match[3],
|
|
103151
|
-
column: match[4] - 1
|
|
103152
|
-
});
|
|
103153
|
-
return "eval at " + match[1] + " (" + position.source + ":" + position.line + ":" + (position.column + 1) + ")";
|
|
103154
|
-
}
|
|
103155
|
-
match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
|
|
103156
|
-
if (match) {
|
|
103157
|
-
return "eval at " + match[1] + " (" + mapEvalOrigin(match[2]) + ")";
|
|
103158
|
-
}
|
|
103159
|
-
return origin;
|
|
103160
|
-
}
|
|
103161
|
-
function CallSiteToString() {
|
|
103162
|
-
var fileName;
|
|
103163
|
-
var fileLocation = "";
|
|
103164
|
-
if (this.isNative()) {
|
|
103165
|
-
fileLocation = "native";
|
|
103166
|
-
} else {
|
|
103167
|
-
fileName = this.getScriptNameOrSourceURL();
|
|
103168
|
-
if (!fileName && this.isEval()) {
|
|
103169
|
-
fileLocation = this.getEvalOrigin();
|
|
103170
|
-
fileLocation += ", ";
|
|
103171
|
-
}
|
|
103172
|
-
if (fileName) {
|
|
103173
|
-
fileLocation += fileName;
|
|
103174
|
-
} else {
|
|
103175
|
-
fileLocation += "<anonymous>";
|
|
103176
|
-
}
|
|
103177
|
-
var lineNumber = this.getLineNumber();
|
|
103178
|
-
if (lineNumber != null) {
|
|
103179
|
-
fileLocation += ":" + lineNumber;
|
|
103180
|
-
var columnNumber = this.getColumnNumber();
|
|
103181
|
-
if (columnNumber) {
|
|
103182
|
-
fileLocation += ":" + columnNumber;
|
|
103183
|
-
}
|
|
103184
|
-
}
|
|
103185
|
-
}
|
|
103186
|
-
var line = "";
|
|
103187
|
-
var functionName = this.getFunctionName();
|
|
103188
|
-
var addSuffix = true;
|
|
103189
|
-
var isConstructor = this.isConstructor();
|
|
103190
|
-
var isMethodCall = !(this.isToplevel() || isConstructor);
|
|
103191
|
-
if (isMethodCall) {
|
|
103192
|
-
var typeName = this.getTypeName();
|
|
103193
|
-
if (typeName === "[object Object]") {
|
|
103194
|
-
typeName = "null";
|
|
103195
|
-
}
|
|
103196
|
-
var methodName = this.getMethodName();
|
|
103197
|
-
if (functionName) {
|
|
103198
|
-
if (typeName && functionName.indexOf(typeName) != 0) {
|
|
103199
|
-
line += typeName + ".";
|
|
103200
|
-
}
|
|
103201
|
-
line += functionName;
|
|
103202
|
-
if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) {
|
|
103203
|
-
line += " [as " + methodName + "]";
|
|
103204
|
-
}
|
|
103205
|
-
} else {
|
|
103206
|
-
line += typeName + "." + (methodName || "<anonymous>");
|
|
103207
|
-
}
|
|
103208
|
-
} else if (isConstructor) {
|
|
103209
|
-
line += "new " + (functionName || "<anonymous>");
|
|
103210
|
-
} else if (functionName) {
|
|
103211
|
-
line += functionName;
|
|
103212
|
-
} else {
|
|
103213
|
-
line += fileLocation;
|
|
103214
|
-
addSuffix = false;
|
|
103215
|
-
}
|
|
103216
|
-
if (addSuffix) {
|
|
103217
|
-
line += " (" + fileLocation + ")";
|
|
103218
|
-
}
|
|
103219
|
-
return line;
|
|
103220
|
-
}
|
|
103221
|
-
function cloneCallSite(frame) {
|
|
103222
|
-
var object = {};
|
|
103223
|
-
Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
|
|
103224
|
-
object[name] = /^(?:is|get)/.test(name) ? function() {
|
|
103225
|
-
return frame[name].call(frame);
|
|
103226
|
-
} : frame[name];
|
|
103227
|
-
});
|
|
103228
|
-
object.toString = CallSiteToString;
|
|
103229
|
-
return object;
|
|
103230
|
-
}
|
|
103231
|
-
function wrapCallSite(frame, state2) {
|
|
103232
|
-
if (state2 === void 0) {
|
|
103233
|
-
state2 = { nextPosition: null, curPosition: null };
|
|
103234
|
-
}
|
|
103235
|
-
if (frame.isNative()) {
|
|
103236
|
-
state2.curPosition = null;
|
|
103237
|
-
return frame;
|
|
103238
|
-
}
|
|
103239
|
-
var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
|
|
103240
|
-
if (source) {
|
|
103241
|
-
var line = frame.getLineNumber();
|
|
103242
|
-
var column = frame.getColumnNumber() - 1;
|
|
103243
|
-
var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
|
|
103244
|
-
var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62;
|
|
103245
|
-
if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
|
|
103246
|
-
column -= headerLength;
|
|
103247
|
-
}
|
|
103248
|
-
var position = mapSourcePosition({
|
|
103249
|
-
source,
|
|
103250
|
-
line,
|
|
103251
|
-
column
|
|
103252
|
-
});
|
|
103253
|
-
state2.curPosition = position;
|
|
103254
|
-
frame = cloneCallSite(frame);
|
|
103255
|
-
var originalFunctionName = frame.getFunctionName;
|
|
103256
|
-
frame.getFunctionName = function() {
|
|
103257
|
-
if (state2.nextPosition == null) {
|
|
103258
|
-
return originalFunctionName();
|
|
103259
|
-
}
|
|
103260
|
-
return state2.nextPosition.name || originalFunctionName();
|
|
103261
|
-
};
|
|
103262
|
-
frame.getFileName = function() {
|
|
103263
|
-
return position.source;
|
|
103264
|
-
};
|
|
103265
|
-
frame.getLineNumber = function() {
|
|
103266
|
-
return position.line;
|
|
103267
|
-
};
|
|
103268
|
-
frame.getColumnNumber = function() {
|
|
103269
|
-
return position.column + 1;
|
|
103270
|
-
};
|
|
103271
|
-
frame.getScriptNameOrSourceURL = function() {
|
|
103272
|
-
return position.source;
|
|
103273
|
-
};
|
|
103274
|
-
return frame;
|
|
103275
|
-
}
|
|
103276
|
-
var origin = frame.isEval() && frame.getEvalOrigin();
|
|
103277
|
-
if (origin) {
|
|
103278
|
-
origin = mapEvalOrigin(origin);
|
|
103279
|
-
frame = cloneCallSite(frame);
|
|
103280
|
-
frame.getEvalOrigin = function() {
|
|
103281
|
-
return origin;
|
|
103282
|
-
};
|
|
103283
|
-
return frame;
|
|
103284
|
-
}
|
|
103285
|
-
return frame;
|
|
103286
|
-
}
|
|
103287
|
-
function prepareStackTrace(error2, stack) {
|
|
103288
|
-
if (emptyCacheBetweenOperations) {
|
|
103289
|
-
fileContentsCache = {};
|
|
103290
|
-
sourceMapCache = {};
|
|
103291
|
-
}
|
|
103292
|
-
var name = error2.name || "Error";
|
|
103293
|
-
var message = error2.message || "";
|
|
103294
|
-
var errorString = name + ": " + message;
|
|
103295
|
-
var state2 = { nextPosition: null, curPosition: null };
|
|
103296
|
-
var processedStack = [];
|
|
103297
|
-
for (var i = stack.length - 1; i >= 0; i--) {
|
|
103298
|
-
processedStack.push("\n at " + wrapCallSite(stack[i], state2));
|
|
103299
|
-
state2.nextPosition = state2.curPosition;
|
|
103300
|
-
}
|
|
103301
|
-
state2.curPosition = state2.nextPosition = null;
|
|
103302
|
-
return errorString + processedStack.reverse().join("");
|
|
103303
|
-
}
|
|
103304
|
-
function getErrorSource(error2) {
|
|
103305
|
-
var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error2.stack);
|
|
103306
|
-
if (match) {
|
|
103307
|
-
var source = match[1];
|
|
103308
|
-
var line = +match[2];
|
|
103309
|
-
var column = +match[3];
|
|
103310
|
-
var contents = fileContentsCache[source];
|
|
103311
|
-
if (!contents && fs && fs.existsSync(source)) {
|
|
103312
|
-
try {
|
|
103313
|
-
contents = fs.readFileSync(source, "utf8");
|
|
103314
|
-
} catch (er) {
|
|
103315
|
-
contents = "";
|
|
103316
|
-
}
|
|
103317
|
-
}
|
|
103318
|
-
if (contents) {
|
|
103319
|
-
var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
|
|
103320
|
-
if (code) {
|
|
103321
|
-
return source + ":" + line + "\n" + code + "\n" + new Array(column).join(" ") + "^";
|
|
103322
|
-
}
|
|
103323
|
-
}
|
|
103324
|
-
}
|
|
103325
|
-
return null;
|
|
103326
|
-
}
|
|
103327
|
-
function printErrorAndExit(error2) {
|
|
103328
|
-
var source = getErrorSource(error2);
|
|
103329
|
-
var stderr = globalProcessStderr();
|
|
103330
|
-
if (stderr && stderr._handle && stderr._handle.setBlocking) {
|
|
103331
|
-
stderr._handle.setBlocking(true);
|
|
103332
|
-
}
|
|
103333
|
-
if (source) {
|
|
103334
|
-
console.error();
|
|
103335
|
-
console.error(source);
|
|
103336
|
-
}
|
|
103337
|
-
console.error(error2.stack);
|
|
103338
|
-
globalProcessExit(1);
|
|
103339
|
-
}
|
|
103340
|
-
function shimEmitUncaughtException() {
|
|
103341
|
-
var origEmit = process.emit;
|
|
103342
|
-
process.emit = function(type) {
|
|
103343
|
-
if (type === "uncaughtException") {
|
|
103344
|
-
var hasStack = arguments[1] && arguments[1].stack;
|
|
103345
|
-
var hasListeners = this.listeners(type).length > 0;
|
|
103346
|
-
if (hasStack && !hasListeners) {
|
|
103347
|
-
return printErrorAndExit(arguments[1]);
|
|
103348
|
-
}
|
|
103349
|
-
}
|
|
103350
|
-
return origEmit.apply(this, arguments);
|
|
103351
|
-
};
|
|
103352
|
-
}
|
|
103353
|
-
var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
|
|
103354
|
-
var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
|
|
103355
|
-
exports2.wrapCallSite = wrapCallSite;
|
|
103356
|
-
exports2.getErrorSource = getErrorSource;
|
|
103357
|
-
exports2.mapSourcePosition = mapSourcePosition;
|
|
103358
|
-
exports2.retrieveSourceMap = retrieveSourceMap;
|
|
103359
|
-
exports2.install = function(options) {
|
|
103360
|
-
options = options || {};
|
|
103361
|
-
if (options.environment) {
|
|
103362
|
-
environment = options.environment;
|
|
103363
|
-
if (["node", "browser", "auto"].indexOf(environment) === -1) {
|
|
103364
|
-
throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}");
|
|
103365
|
-
}
|
|
103366
|
-
}
|
|
103367
|
-
if (options.retrieveFile) {
|
|
103368
|
-
if (options.overrideRetrieveFile) {
|
|
103369
|
-
retrieveFileHandlers.length = 0;
|
|
103370
|
-
}
|
|
103371
|
-
retrieveFileHandlers.unshift(options.retrieveFile);
|
|
103372
|
-
}
|
|
103373
|
-
if (options.retrieveSourceMap) {
|
|
103374
|
-
if (options.overrideRetrieveSourceMap) {
|
|
103375
|
-
retrieveMapHandlers.length = 0;
|
|
103376
|
-
}
|
|
103377
|
-
retrieveMapHandlers.unshift(options.retrieveSourceMap);
|
|
103378
|
-
}
|
|
103379
|
-
if (options.hookRequire && !isInBrowser()) {
|
|
103380
|
-
var Module = dynamicRequire(module2, "module");
|
|
103381
|
-
var $compile = Module.prototype._compile;
|
|
103382
|
-
if (!$compile.__sourceMapSupport) {
|
|
103383
|
-
Module.prototype._compile = function(content, filename) {
|
|
103384
|
-
fileContentsCache[filename] = content;
|
|
103385
|
-
sourceMapCache[filename] = void 0;
|
|
103386
|
-
return $compile.call(this, content, filename);
|
|
103387
|
-
};
|
|
103388
|
-
Module.prototype._compile.__sourceMapSupport = true;
|
|
103389
|
-
}
|
|
103390
|
-
}
|
|
103391
|
-
if (!emptyCacheBetweenOperations) {
|
|
103392
|
-
emptyCacheBetweenOperations = "emptyCacheBetweenOperations" in options ? options.emptyCacheBetweenOperations : false;
|
|
103393
|
-
}
|
|
103394
|
-
if (!errorFormatterInstalled) {
|
|
103395
|
-
errorFormatterInstalled = true;
|
|
103396
|
-
Error.prepareStackTrace = prepareStackTrace;
|
|
103397
|
-
}
|
|
103398
|
-
if (!uncaughtShimInstalled) {
|
|
103399
|
-
var installHandler = "handleUncaughtExceptions" in options ? options.handleUncaughtExceptions : true;
|
|
103400
|
-
try {
|
|
103401
|
-
var worker_threads = dynamicRequire(module2, "worker_threads");
|
|
103402
|
-
if (worker_threads.isMainThread === false) {
|
|
103403
|
-
installHandler = false;
|
|
103404
|
-
}
|
|
103405
|
-
} catch (e) {
|
|
103406
|
-
}
|
|
103407
|
-
if (installHandler && hasGlobalProcessEventEmitter()) {
|
|
103408
|
-
uncaughtShimInstalled = true;
|
|
103409
|
-
shimEmitUncaughtException();
|
|
103410
|
-
}
|
|
103411
|
-
}
|
|
103412
|
-
};
|
|
103413
|
-
exports2.resetRetrieveHandlers = function() {
|
|
103414
|
-
retrieveFileHandlers.length = 0;
|
|
103415
|
-
retrieveMapHandlers.length = 0;
|
|
103416
|
-
retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
|
|
103417
|
-
retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
|
|
103418
|
-
retrieveSourceMap = handlerExec(retrieveMapHandlers);
|
|
103419
|
-
retrieveFile = handlerExec(retrieveFileHandlers);
|
|
103420
|
-
};
|
|
103421
|
-
}
|
|
103422
|
-
});
|
|
103423
|
-
|
|
103424
101534
|
// ../../node_modules/typescript/lib/typescript.js
|
|
103425
101535
|
var require_typescript = __commonJS({
|
|
103426
101536
|
"../../node_modules/typescript/lib/typescript.js"(exports2, module2) {
|
|
@@ -112077,7 +110187,7 @@ ${lanes.join("\n")}
|
|
|
112077
110187
|
debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some(process.execArgv, (arg) => /^--(?:inspect|debug)(?:-brk)?(?:=\d+)?$/i.test(arg)) || !!process.recordreplay,
|
|
112078
110188
|
tryEnableSourceMapsForHost() {
|
|
112079
110189
|
try {
|
|
112080
|
-
|
|
110190
|
+
require("source-map-support").install();
|
|
112081
110191
|
} catch {
|
|
112082
110192
|
}
|
|
112083
110193
|
},
|
|
@@ -340612,7 +338722,7 @@ var require_decoder = __commonJS({
|
|
|
340612
338722
|
});
|
|
340613
338723
|
|
|
340614
338724
|
// ../../node_modules/adm-zip/util/index.js
|
|
340615
|
-
var
|
|
338725
|
+
var require_util4 = __commonJS({
|
|
340616
338726
|
"../../node_modules/adm-zip/util/index.js"(exports2, module2) {
|
|
340617
338727
|
"use strict";
|
|
340618
338728
|
module2.exports = require_utils2();
|
|
@@ -340627,7 +338737,7 @@ var require_util5 = __commonJS({
|
|
|
340627
338737
|
var require_entryHeader = __commonJS({
|
|
340628
338738
|
"../../node_modules/adm-zip/headers/entryHeader.js"(exports2, module2) {
|
|
340629
338739
|
"use strict";
|
|
340630
|
-
var Utils =
|
|
338740
|
+
var Utils = require_util4();
|
|
340631
338741
|
var Constants = Utils.Constants;
|
|
340632
338742
|
module2.exports = function() {
|
|
340633
338743
|
var _verMade = 20, _version = 10, _flags = 0, _method = 0, _time = 0, _crc = 0, _compressedSize = 0, _size = 0, _fnameLen = 0, _extraLen = 0, _comLen = 0, _diskStart = 0, _inattr = 0, _attr = 0, _offset = 0;
|
|
@@ -340898,7 +339008,7 @@ var require_entryHeader = __commonJS({
|
|
|
340898
339008
|
var require_mainHeader = __commonJS({
|
|
340899
339009
|
"../../node_modules/adm-zip/headers/mainHeader.js"(exports2, module2) {
|
|
340900
339010
|
"use strict";
|
|
340901
|
-
var Utils =
|
|
339011
|
+
var Utils = require_util4();
|
|
340902
339012
|
var Constants = Utils.Constants;
|
|
340903
339013
|
module2.exports = function() {
|
|
340904
339014
|
var _volumeEntries = 0, _totalEntries = 0, _size = 0, _offset = 0, _commentLength = 0;
|
|
@@ -341196,7 +339306,7 @@ var require_methods = __commonJS({
|
|
|
341196
339306
|
var require_zipEntry = __commonJS({
|
|
341197
339307
|
"../../node_modules/adm-zip/zipEntry.js"(exports2, module2) {
|
|
341198
339308
|
"use strict";
|
|
341199
|
-
var Utils =
|
|
339309
|
+
var Utils = require_util4();
|
|
341200
339310
|
var Headers = require_headers3();
|
|
341201
339311
|
var Constants = Utils.Constants;
|
|
341202
339312
|
var Methods = require_methods();
|
|
@@ -341530,7 +339640,7 @@ var require_zipFile = __commonJS({
|
|
|
341530
339640
|
"use strict";
|
|
341531
339641
|
var ZipEntry = require_zipEntry();
|
|
341532
339642
|
var Headers = require_headers3();
|
|
341533
|
-
var Utils =
|
|
339643
|
+
var Utils = require_util4();
|
|
341534
339644
|
module2.exports = function(inBuffer, options) {
|
|
341535
339645
|
var entryList = [], entryTable = {}, _comment = Buffer.alloc(0), mainHeader = new Headers.MainHeader(), loadedEntries = false;
|
|
341536
339646
|
var password = null;
|
|
@@ -341875,7 +339985,7 @@ var require_zipFile = __commonJS({
|
|
|
341875
339985
|
var require_adm_zip = __commonJS({
|
|
341876
339986
|
"../../node_modules/adm-zip/adm-zip.js"(exports2, module2) {
|
|
341877
339987
|
"use strict";
|
|
341878
|
-
var Utils =
|
|
339988
|
+
var Utils = require_util4();
|
|
341879
339989
|
var pth = require("path");
|
|
341880
339990
|
var ZipEntry = require_zipEntry();
|
|
341881
339991
|
var ZipFile = require_zipFile();
|
|
@@ -353034,9 +351144,9 @@ var require_dist2 = __commonJS({
|
|
|
353034
351144
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
353035
351145
|
};
|
|
353036
351146
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
353037
|
-
exports2.
|
|
353038
|
-
exports2.
|
|
353039
|
-
exports2.BrokeredInboxReader = exports2.applyPlusTag = exports2.deriveProjectInboxTag = exports2.deriveInboxTag = exports2.loadVerificationInboxConfig = exports2.VerificationInboxReader = exports2.UNSUPPORTED_RENDERER_PREFIX = exports2.UnsupportedRendererError = exports2.buildCanvasModeAuthoringAddendum = exports2.buildUnsupportedRendererMessage = exports2.modelSupportsVision = exports2.decideCanvasStrategy = exports2.decideAppRenderType = exports2.detectCanvasApp = exports2.detectRateLimitBlock = exports2.isSafeCanonicalRedirect = exports2.resolveBaseUrlPreflight = exports2.checkBaseUrlRedirect = exports2.truncateAtLine = exports2.neutralizeUntrustedBlock = exports2.renderUntrustedKnowledgeBlock = exports2.stripJsonFences = exports2.scrubCredentials = exports2.withAIRetry = exports2.snapshotMatchingChildren = exports2.findNewChromiumChildPid = exports2.killProcessTree = exports2.gracefulCloseWithTreeKill = exports2.liveBrowserRegistry = exports2.REPO_SWITCH_REMOVED_FRACTION = void 0;
|
|
351147
|
+
exports2.filterLoginCaptureCredentials = exports2.buildLoginCaptureCredentials = exports2.isReservedRunnerEnvVar = exports2.RESERVED_RUNNER_ENV_VARS = exports2.AUTH_MARKER_VERSION = exports2.buildHealAuthStamp = exports2.extractAuthRegion = exports2.upsertAuthBlock = exports2.buildAuthRecipe = exports2.commandToReplayStep = exports2.buildReplayPlan = exports2.absoluteRoute = exports2.renderReplaySettleArrow = exports2.renderReplayClickArrow = exports2.renderAuthFn = exports2.filterFeatureGroupsToPathScope = exports2.isAuthFlowRoute = exports2.deriveSurveyPathScope = exports2.canonicalizeRoute = exports2.codeUsesInboxHelper = exports2.codeUsesTestInboxIdentity = exports2.codeSelfProvisionsRegistration = exports2.executeGrokPerBatchHeal = exports2.executeGrokPerTestHeal = exports2.headerVal = exports2.classifyAuthType = exports2.isTextExcerptable = exports2.isStaticAssetByExt = exports2.isApiCall = exports2.buildApiCallSummary = exports2.computeMobileHealOutcome = exports2.detectMobileStepSecretLeak = exports2.redactMobileSecretsFromText = exports2.MOBILE_LIVE_HEAL_SYSTEM_PROMPT = exports2.MOBILE_SCRIPT_HEAL_SYSTEM_PROMPT = exports2.executeMobileLiveHeal = exports2.executeMobileTestWithHealing = exports2.executeMobileScriptDrivenHeal = exports2.prepareMobileScenarioAppState = exports2.runMobileGeneratePhase = exports2.isLowValueMobileAutoDeepFeature = exports2.isPackageLeafAppCatchAll = exports2.isOpaqueMobileScreenName = exports2.isScrubbedPlaceholderName = exports2.runMobileAIPlanner = exports2.buildMobileSiteMap = exports2.formatMobileEvidenceForPlanner = exports2.MOBILE_SCENARIO_SYSTEM_PROMPT = exports2.MOBILE_SURVEY_SYSTEM_PROMPT = exports2.runMobileExplorePhase = void 0;
|
|
351148
|
+
exports2.sha256Hex = exports2.hashFiles = exports2.enumerateTestFiles = exports2.buildNextManifest = exports2.detectRepoSwitch = exports2.classifyImportDiff = exports2.parseImportManifest = exports2.validateAuthoredMobileTest = exports2.buildMobileRepoAuthorSystemRules = exports2.buildMobileRepoAuthorKickoff = exports2.buildMobileRepoAuthorContractMd = exports2.REPO_ANALYSIS_SCHEMA_VERSION = exports2.validateSourceEndpoints = exports2.validateAuthoredTest = exports2.validateRepoMapFile = exports2.validateRepoMemoryFile = exports2.buildTestingStandardsSection = exports2.buildRepoAuthorSystemRules = exports2.buildRepoAuthorKickoff = exports2.buildRepoAuthorContractMd = exports2.buildRepoMapSystemRules = exports2.buildRepoMapKickoff = exports2.buildRepoMapContractMd = exports2.buildRepoMemorySystemRules = exports2.buildRepoMemoryKickoff = exports2.buildRepoMemoryContractMd = exports2.runRepoAnalysisOnRunner = exports2.MOBILE_IMPORT_SCHEMA_VERSION = exports2.validateImportedMobileTest = exports2.buildMobileImportSystemRules = exports2.buildMobileImportKickoff = exports2.buildMobileImportContractMd = exports2.IMPORT_SCHEMA_VERSION = exports2.validateImportResultFile = exports2.validateImportedTest = exports2.buildImportSystemRules = exports2.buildImportKickoff = exports2.buildImportContractMd = exports2.MAX_ARCHIVE_BYTES = exports2.isUnsafeEntryName = exports2.extractZipSafely = exports2.downloadArchiveCapped = exports2.detectArchiveKind = exports2.acquireRepoForImport = exports2.runFrameworkImportOnRunner = exports2.getAgenticEngine = exports2.resolveRefFromSnapshot = exports2.replayAuthRecipeIntoBrowser = exports2.runRegisterCaptureRun = exports2.runLoginCaptureRun = void 0;
|
|
351149
|
+
exports2.BrokeredInboxReader = exports2.applyPlusTag = exports2.deriveProjectInboxTag = exports2.deriveInboxTag = exports2.loadVerificationInboxConfig = exports2.VerificationInboxReader = exports2.UNSUPPORTED_RENDERER_PREFIX = exports2.UnsupportedRendererError = exports2.buildCanvasModeAuthoringAddendum = exports2.buildUnsupportedRendererMessage = exports2.modelSupportsVision = exports2.decideCanvasStrategy = exports2.decideAppRenderType = exports2.detectCanvasApp = exports2.detectRateLimitBlock = exports2.isSafeCanonicalRedirect = exports2.resolveBaseUrlPreflight = exports2.checkBaseUrlRedirect = exports2.truncateAtLine = exports2.neutralizeUntrustedBlock = exports2.renderUntrustedKnowledgeBlock = exports2.stripJsonFences = exports2.scrubCredentials = exports2.withAIRetry = exports2.snapshotMatchingChildren = exports2.findNewChromiumChildPid = exports2.killProcessTree = exports2.gracefulCloseWithTreeKill = exports2.liveBrowserRegistry = exports2.REPO_SWITCH_REMOVED_FRACTION = exports2.MAX_MANIFEST_FILES = exports2.toDiffSummary = exports2.isLikelyTestFile = exports2.sanitizeRepoRelPath = void 0;
|
|
353040
351150
|
__exportStar(require_ai_provider(), exports2);
|
|
353041
351151
|
__exportStar(require_mobile_types(), exports2);
|
|
353042
351152
|
__exportStar(require_mobile_source_parser(), exports2);
|
|
@@ -353061,6 +351171,18 @@ var require_dist2 = __commonJS({
|
|
|
353061
351171
|
Object.defineProperty(exports2, "runMobileAIPlanner", { enumerable: true, get: function() {
|
|
353062
351172
|
return mobile_discovery_prompts_js_1.runMobileAIPlanner;
|
|
353063
351173
|
} });
|
|
351174
|
+
Object.defineProperty(exports2, "isScrubbedPlaceholderName", { enumerable: true, get: function() {
|
|
351175
|
+
return mobile_discovery_prompts_js_1.isScrubbedPlaceholderName;
|
|
351176
|
+
} });
|
|
351177
|
+
Object.defineProperty(exports2, "isOpaqueMobileScreenName", { enumerable: true, get: function() {
|
|
351178
|
+
return mobile_discovery_prompts_js_1.isOpaqueMobileScreenName;
|
|
351179
|
+
} });
|
|
351180
|
+
Object.defineProperty(exports2, "isPackageLeafAppCatchAll", { enumerable: true, get: function() {
|
|
351181
|
+
return mobile_discovery_prompts_js_1.isPackageLeafAppCatchAll;
|
|
351182
|
+
} });
|
|
351183
|
+
Object.defineProperty(exports2, "isLowValueMobileAutoDeepFeature", { enumerable: true, get: function() {
|
|
351184
|
+
return mobile_discovery_prompts_js_1.isLowValueMobileAutoDeepFeature;
|
|
351185
|
+
} });
|
|
353064
351186
|
var mobile_generator_js_1 = require_mobile_generator();
|
|
353065
351187
|
Object.defineProperty(exports2, "runMobileGeneratePhase", { enumerable: true, get: function() {
|
|
353066
351188
|
return mobile_generator_js_1.runMobileGeneratePhase;
|
|
@@ -353496,7 +351618,7 @@ var require_package4 = __commonJS({
|
|
|
353496
351618
|
"package.json"(exports2, module2) {
|
|
353497
351619
|
module2.exports = {
|
|
353498
351620
|
name: "@validate.qa/runner",
|
|
353499
|
-
version: "1.0.
|
|
351621
|
+
version: "1.0.87",
|
|
353500
351622
|
description: "validate local test runner - execute Playwright tests on your machine, connected to validate.qa cloud.",
|
|
353501
351623
|
bin: {
|
|
353502
351624
|
"validate-runner": "dist/cli.js"
|
|
@@ -355408,7 +353530,7 @@ async function pressHome(sessionPath, platform3) {
|
|
|
355408
353530
|
// src/services/device-quarantine.ts
|
|
355409
353531
|
var QUARANTINE_MAX_MS = (() => {
|
|
355410
353532
|
const raw = Number(process.env.VALIDATEQA_DEVICE_QUARANTINE_MAX_MS);
|
|
355411
|
-
return Number.isFinite(raw) && raw > 0 ? raw :
|
|
353533
|
+
return Number.isFinite(raw) && raw > 0 ? raw : 2 * 60 * 1e3;
|
|
355412
353534
|
})();
|
|
355413
353535
|
var quarantinedAt = /* @__PURE__ */ new Map();
|
|
355414
353536
|
var nextQuarantineToken = 1;
|
|
@@ -356905,6 +355027,12 @@ async function createSession(target) {
|
|
|
356905
355027
|
// Scoped to simulator UDIDs (a physical iOS device has no such step);
|
|
356906
355028
|
// override with APPIUM_IOS_HEADLESS=false to force a visible Simulator run.
|
|
356907
355029
|
...isIosSimulatorUdid(target.deviceId) && process.env.APPIUM_IOS_HEADLESS !== "false" ? { "appium:isHeadless": true } : {},
|
|
355030
|
+
// WDA cold-start is flaky under dual-sim load (xcodebuild 65/75, SIGTERM).
|
|
355031
|
+
// Retry startup instead of failing the whole discovery session once.
|
|
355032
|
+
"appium:wdaStartupRetries": 4,
|
|
355033
|
+
"appium:wdaStartupRetryInterval": 2e3,
|
|
355034
|
+
"appium:wdaLaunchTimeout": 12e4,
|
|
355035
|
+
"appium:wdaConnectionTimeout": 12e4,
|
|
356908
355036
|
...parallelCaps,
|
|
356909
355037
|
...realCaps
|
|
356910
355038
|
} : {
|
|
@@ -356916,6 +355044,12 @@ async function createSession(target) {
|
|
|
356916
355044
|
"appium:noReset": true,
|
|
356917
355045
|
// See the iOS branch: the 60s default kills AI-driven discovery sessions.
|
|
356918
355046
|
"appium:newCommandTimeout": MOBILE_NEW_COMMAND_TIMEOUT_SECONDS,
|
|
355047
|
+
// Default UIA2 server launch is 30s — under dual-emu / post-quarantine
|
|
355048
|
+
// stress instrumentation often needs longer or the session never binds
|
|
355049
|
+
// ("instrumentation process cannot be initialized within 30000ms").
|
|
355050
|
+
"appium:uiautomator2ServerLaunchTimeout": 12e4,
|
|
355051
|
+
"appium:uiautomator2ServerInstallTimeout": 12e4,
|
|
355052
|
+
"appium:adbExecTimeout": 12e4,
|
|
356919
355053
|
"appium:chromedriverExecutableDir": ensureWritableChromedriverExecutableDir(),
|
|
356920
355054
|
...parallelCaps,
|
|
356921
355055
|
...realCaps
|
|
@@ -359694,6 +357828,12 @@ async function startSession(validated, res) {
|
|
|
359694
357828
|
// overrides. Verified live: without this, recorder/mirror sessions on iOS
|
|
359695
357829
|
// die with "Simulator.app does not exist" while executor sessions work.
|
|
359696
357830
|
...isIosSimulatorUdid(deviceId) && process.env.APPIUM_IOS_HEADLESS !== "false" ? { "appium:isHeadless": true } : {},
|
|
357831
|
+
// Match executor createSession: tolerate WDA cold-start flakes.
|
|
357832
|
+
"appium:newCommandTimeout": Number(process.env.VALIDATEQA_MOBILE_NEW_COMMAND_TIMEOUT) > 0 ? Math.floor(Number(process.env.VALIDATEQA_MOBILE_NEW_COMMAND_TIMEOUT)) : 600,
|
|
357833
|
+
"appium:wdaStartupRetries": 4,
|
|
357834
|
+
"appium:wdaStartupRetryInterval": 2e3,
|
|
357835
|
+
"appium:wdaLaunchTimeout": 12e4,
|
|
357836
|
+
"appium:wdaConnectionTimeout": 12e4,
|
|
359697
357837
|
...realCaps
|
|
359698
357838
|
} : {
|
|
359699
357839
|
platformName: "Android",
|
|
@@ -359702,6 +357842,10 @@ async function startSession(validated, res) {
|
|
|
359702
357842
|
...deviceId ? { "appium:udid": deviceId } : {},
|
|
359703
357843
|
...platformVersion ? { "appium:platformVersion": platformVersion } : {},
|
|
359704
357844
|
"appium:noReset": true,
|
|
357845
|
+
"appium:newCommandTimeout": Number(process.env.VALIDATEQA_MOBILE_NEW_COMMAND_TIMEOUT) > 0 ? Math.floor(Number(process.env.VALIDATEQA_MOBILE_NEW_COMMAND_TIMEOUT)) : 600,
|
|
357846
|
+
"appium:uiautomator2ServerLaunchTimeout": 12e4,
|
|
357847
|
+
"appium:uiautomator2ServerInstallTimeout": 12e4,
|
|
357848
|
+
"appium:adbExecTimeout": 12e4,
|
|
359705
357849
|
"appium:chromedriverExecutableDir": ensureWritableChromedriverExecutableDir(),
|
|
359706
357850
|
...realCaps
|
|
359707
357851
|
};
|
|
@@ -360793,11 +358937,33 @@ var MobileBridgeDriver = class {
|
|
|
360793
358937
|
*/
|
|
360794
358938
|
async snapshot() {
|
|
360795
358939
|
return this.withSessionRecovery("snapshot", async () => {
|
|
360796
|
-
|
|
360797
|
-
|
|
360798
|
-
|
|
360799
|
-
|
|
360800
|
-
|
|
358940
|
+
let xml = await getPageSource(this.sessionPath);
|
|
358941
|
+
let screenshot = await getScreenshot(this.sessionPath);
|
|
358942
|
+
let windowSize = await getWindowSize(this.sessionPath);
|
|
358943
|
+
if (!xml) {
|
|
358944
|
+
try {
|
|
358945
|
+
await waitForUiSettle(this.sessionPath, {
|
|
358946
|
+
timeoutMs: 8e3,
|
|
358947
|
+
minStableFrames: 2,
|
|
358948
|
+
pollMs: 300,
|
|
358949
|
+
minElements: 1
|
|
358950
|
+
});
|
|
358951
|
+
} catch (err) {
|
|
358952
|
+
if (isRecoverableAppiumSessionFailure(err)) throw err;
|
|
358953
|
+
}
|
|
358954
|
+
xml = await getPageSource(this.sessionPath);
|
|
358955
|
+
}
|
|
358956
|
+
if (!xml) {
|
|
358957
|
+
try {
|
|
358958
|
+
await this.executeScript("mobile: activateApp", [this.appLifecycleArgs()]);
|
|
358959
|
+
await waitForColdBootSettle(this.sessionPath);
|
|
358960
|
+
} catch (err) {
|
|
358961
|
+
if (isRecoverableAppiumSessionFailure(err)) throw err;
|
|
358962
|
+
}
|
|
358963
|
+
xml = await getPageSource(this.sessionPath);
|
|
358964
|
+
if (!screenshot) screenshot = await getScreenshot(this.sessionPath);
|
|
358965
|
+
if (!windowSize) windowSize = await getWindowSize(this.sessionPath);
|
|
358966
|
+
}
|
|
360801
358967
|
if (!xml && !screenshot && !windowSize) {
|
|
360802
358968
|
await this.assertSessionReachable();
|
|
360803
358969
|
}
|
|
@@ -361795,8 +359961,13 @@ var RunnerUpgradeRequiredError = class extends Error {
|
|
|
361795
359961
|
this.latestVersion = latestVersion;
|
|
361796
359962
|
}
|
|
361797
359963
|
};
|
|
359964
|
+
var PENDING_POLL_TIMEOUT_MS = Math.max(15e3, envInt("VALIDATE_RUNNER_PENDING_TIMEOUT_MS", 9e4));
|
|
359965
|
+
var POLL_STUCK_RECYCLE_MS = Math.max(6e4, envInt("VALIDATE_RUNNER_POLL_STUCK_MS", 5 * 6e4));
|
|
361798
359966
|
async function fetchPendingRuns(serverUrl, headers) {
|
|
361799
|
-
const res = await fetch(`${serverUrl}/api/runner/pending`, {
|
|
359967
|
+
const res = await fetch(`${serverUrl}/api/runner/pending`, {
|
|
359968
|
+
headers,
|
|
359969
|
+
signal: AbortSignal.timeout(PENDING_POLL_TIMEOUT_MS)
|
|
359970
|
+
});
|
|
361800
359971
|
if (!res.ok) {
|
|
361801
359972
|
if (res.status === 401) throw new Error("Runner token is invalid or expired. Run: validate.qa-runner login");
|
|
361802
359973
|
if (res.status === 426) {
|
|
@@ -363737,14 +361908,17 @@ ${finalVerifyResult.logs ?? ""}`;
|
|
|
363737
361908
|
// Android default) — a personal physical device must never have
|
|
363738
361909
|
// its app data wiped.
|
|
363739
361910
|
allowAppReset: mobileTarget.resetPolicy !== "PRESERVE_APP_DATA" && shouldResetMobileAppData(platform3, session.deviceId),
|
|
363740
|
-
|
|
361911
|
+
// Dual-device discovery + long AI turns can lose WDA/UIA2 more than
|
|
361912
|
+
// once per run. One recovery was too tight — the next snapshot
|
|
361913
|
+
// failed as "no UI tree" after a single WDA death.
|
|
361914
|
+
maxSessionRecoveries: 3,
|
|
363741
361915
|
recoverSession: async (cause) => {
|
|
363742
361916
|
if (discoveryTeardownStarted) {
|
|
363743
361917
|
throw new Error("discovery teardown already started \u2014 not recreating the Appium session");
|
|
363744
361918
|
}
|
|
363745
361919
|
const lost = session;
|
|
363746
361920
|
mobileOnLog(
|
|
363747
|
-
`[appium] discovery session lost (${cause.message}); recreating
|
|
361921
|
+
`[appium] discovery session lost (${cause.message}); recreating on the leased device`
|
|
363748
361922
|
);
|
|
363749
361923
|
if (lost) {
|
|
363750
361924
|
detachMirrorSession(lost.deviceId);
|
|
@@ -365206,10 +363380,12 @@ async function startRunner(opts) {
|
|
|
365206
363380
|
log.dim(line);
|
|
365207
363381
|
};
|
|
365208
363382
|
let lastPendingSummary = "";
|
|
363383
|
+
let lastSuccessfulPollAt = Date.now();
|
|
365209
363384
|
while (!shuttingDown) {
|
|
365210
363385
|
try {
|
|
365211
363386
|
if (activeRuns < MAX_CONCURRENT) {
|
|
365212
363387
|
const pending = await fetchPendingRuns(serverUrl, headers);
|
|
363388
|
+
lastSuccessfulPollAt = Date.now();
|
|
365213
363389
|
{
|
|
365214
363390
|
const pendingIds = new Set(pending.map((r) => r.runId));
|
|
365215
363391
|
for (const id of [...deferralLogged.keys()]) {
|
|
@@ -365414,6 +363590,8 @@ async function startRunner(opts) {
|
|
|
365414
363590
|
}
|
|
365415
363591
|
}
|
|
365416
363592
|
consecutivePollErrors = 0;
|
|
363593
|
+
} else {
|
|
363594
|
+
lastSuccessfulPollAt = Date.now();
|
|
365417
363595
|
}
|
|
365418
363596
|
} catch (err) {
|
|
365419
363597
|
if (err instanceof RunnerUpgradeRequiredError) {
|
|
@@ -365422,6 +363600,13 @@ async function startRunner(opts) {
|
|
|
365422
363600
|
}
|
|
365423
363601
|
const message = err instanceof Error ? err.message : String(err);
|
|
365424
363602
|
consecutivePollErrors++;
|
|
363603
|
+
const stuckForMs = Date.now() - lastSuccessfulPollAt;
|
|
363604
|
+
if (stuckForMs >= POLL_STUCK_RECYCLE_MS) {
|
|
363605
|
+
log.warn(
|
|
363606
|
+
`Poll stuck for ${Math.round(stuckForMs / 1e3)}s (>= ${Math.round(POLL_STUCK_RECYCLE_MS / 1e3)}s) after error: ${message}. Recycling runner process so the supervisor can restart with a clean loop; orphaned work is re-queued server-side.`
|
|
363607
|
+
);
|
|
363608
|
+
process.exit(78);
|
|
363609
|
+
}
|
|
365425
363610
|
const backoffMs = Math.min(pollIntervalMs * Math.pow(2, consecutivePollErrors - 1), MAX_BACKOFF_MS);
|
|
365426
363611
|
if (consecutivePollErrors > 1) {
|
|
365427
363612
|
log.warn(`Poll error #${consecutivePollErrors} (${message}) - backing off for ${(backoffMs / 1e3).toFixed(1)}s`);
|
|
@@ -365474,7 +363659,76 @@ program.command("login").description("Save runner credentials for future use").r
|
|
|
365474
363659
|
console.log("");
|
|
365475
363660
|
console.log("Run: validate-runner start");
|
|
365476
363661
|
});
|
|
365477
|
-
|
|
363662
|
+
async function superviseRunnerStart(argv) {
|
|
363663
|
+
const { spawn: spawn2 } = await import("child_process");
|
|
363664
|
+
const minBackoffMs = 2e3;
|
|
363665
|
+
const maxBackoffMs = 6e4;
|
|
363666
|
+
let backoffMs = minBackoffMs;
|
|
363667
|
+
let restarts = 0;
|
|
363668
|
+
const windowStart = Date.now();
|
|
363669
|
+
const maxRestartsPerHour = Math.max(1, Number(process.env.VALIDATE_RUNNER_MAX_RESTARTS_PER_HOUR || 30));
|
|
363670
|
+
const childEnv = { ...process.env, VALIDATE_RUNNER_SUPERVISED_CHILD: "1" };
|
|
363671
|
+
const runOnce = () => new Promise((resolve2) => {
|
|
363672
|
+
const child = spawn2(process.execPath, argv, {
|
|
363673
|
+
stdio: "inherit",
|
|
363674
|
+
env: childEnv
|
|
363675
|
+
});
|
|
363676
|
+
const onSignal = (sig) => {
|
|
363677
|
+
try {
|
|
363678
|
+
child.kill(sig);
|
|
363679
|
+
} catch {
|
|
363680
|
+
}
|
|
363681
|
+
};
|
|
363682
|
+
process.once("SIGINT", onSignal);
|
|
363683
|
+
process.once("SIGTERM", onSignal);
|
|
363684
|
+
child.on("exit", (code, signal) => {
|
|
363685
|
+
process.removeListener("SIGINT", onSignal);
|
|
363686
|
+
process.removeListener("SIGTERM", onSignal);
|
|
363687
|
+
if (signal === "SIGINT" || signal === "SIGTERM") {
|
|
363688
|
+
resolve2(0);
|
|
363689
|
+
return;
|
|
363690
|
+
}
|
|
363691
|
+
resolve2(code ?? 1);
|
|
363692
|
+
});
|
|
363693
|
+
});
|
|
363694
|
+
const childArgv = argv.filter((a) => a !== "--supervise" && a !== "--no-supervise");
|
|
363695
|
+
console.log("\u{1F6E1} Runner supervisor enabled \u2014 will auto-restart on crash/stuck exit");
|
|
363696
|
+
console.log(" (disable with --no-supervise or VALIDATE_RUNNER_SUPERVISE=0)");
|
|
363697
|
+
for (; ; ) {
|
|
363698
|
+
const code = await runOnce();
|
|
363699
|
+
if (code === 0) {
|
|
363700
|
+
process.exit(0);
|
|
363701
|
+
}
|
|
363702
|
+
restarts += 1;
|
|
363703
|
+
const elapsedH = (Date.now() - windowStart) / 36e5;
|
|
363704
|
+
if (elapsedH < 1 && restarts > maxRestartsPerHour) {
|
|
363705
|
+
console.error(
|
|
363706
|
+
`\u2717 Supervisor: ${restarts} restarts in under 1h (cap ${maxRestartsPerHour}). Stopping to avoid a crash loop. Fix the underlying issue and re-run start.`
|
|
363707
|
+
);
|
|
363708
|
+
process.exit(1);
|
|
363709
|
+
}
|
|
363710
|
+
console.warn(
|
|
363711
|
+
`\u26A0 Runner exited with code ${code} \u2014 restarting in ${(backoffMs / 1e3).toFixed(1)}s (restart #${restarts}). Server will re-queue orphaned work; pending jobs resume automatically.`
|
|
363712
|
+
);
|
|
363713
|
+
await new Promise((r) => setTimeout(r, backoffMs));
|
|
363714
|
+
backoffMs = Math.min(maxBackoffMs, Math.round(backoffMs * 1.5));
|
|
363715
|
+
}
|
|
363716
|
+
}
|
|
363717
|
+
function shouldSupervise(opts) {
|
|
363718
|
+
if (opts.supervise === false) return false;
|
|
363719
|
+
if (opts.supervise === true) return true;
|
|
363720
|
+
if (process.env.VALIDATE_RUNNER_SUPERVISED_CHILD === "1") return false;
|
|
363721
|
+
if (process.env.RUNNER_CLOUD === "true") return false;
|
|
363722
|
+
const env = (process.env.VALIDATE_RUNNER_SUPERVISE ?? "1").trim().toLowerCase();
|
|
363723
|
+
return env !== "0" && env !== "false" && env !== "off" && env !== "no";
|
|
363724
|
+
}
|
|
363725
|
+
program.command("start").description("Start the local test runner").option("--token <token>", "Runner token (overrides saved credentials)").option("--server <url>", "Server URL (overrides saved credentials)").option("--project <id>", "Project ID (overrides saved credentials)").option("--mode <mode>", "Runner mode: playwright-native (default)", "playwright-native").option("--poll-interval <ms>", "Poll interval in milliseconds", "2000").option("--mobile", "Enable mobile testing (Appium + mobile bridge server)").option("--tunnel", "Enable ngrok tunnel for mobile bridge (allows HTTPS dashboard to connect)").option("--supervise", "Auto-restart the runner if it crashes or self-recycles (default for local)").option("--no-supervise", "Disable auto-restart supervisor").action(async (opts) => {
|
|
363726
|
+
if (shouldSupervise(opts)) {
|
|
363727
|
+
const argv = [...process.argv.slice(1)];
|
|
363728
|
+
if (!argv.includes("--no-supervise")) argv.push("--no-supervise");
|
|
363729
|
+
await superviseRunnerStart(argv);
|
|
363730
|
+
return;
|
|
363731
|
+
}
|
|
365478
363732
|
await requireLatestRunner();
|
|
365479
363733
|
const saved = loadCredentials();
|
|
365480
363734
|
const authToken = opts.token || process.env.AUTH_TOKEN || saved?.token;
|