chrome-devtools-frontend
Version:
Chrome DevTools UI
1,028 lines (930 loc) • 292 kB
JavaScript
/**
* @license
* Copyright 2017 The Lighthouse Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** @template T @typedef {import('./i18n').I18n<T>} I18n */
const ELLIPSIS = '\u2026';
const NBSP = '\xa0';
const PASS_THRESHOLD = 0.9;
const SCREENSHOT_PREFIX = 'data:image/jpeg;base64,';
const RATINGS = {
PASS: {label: 'pass', minScore: PASS_THRESHOLD},
AVERAGE: {label: 'average', minScore: 0.5},
FAIL: {label: 'fail'},
ERROR: {label: 'error'},
};
// 25 most used tld plus one domains (aka public suffixes) from http archive.
// @see https://github.com/GoogleChrome/lighthouse/pull/5065#discussion_r191926212
// The canonical list is https://publicsuffix.org/learn/ but we're only using subset to conserve bytes
const listOfTlds = [
'com', 'co', 'gov', 'edu', 'ac', 'org', 'go', 'gob', 'or', 'net', 'in', 'ne', 'nic', 'gouv',
'web', 'spb', 'blog', 'jus', 'kiev', 'mil', 'wi', 'qc', 'ca', 'bel', 'on',
];
class Util {
/** @type {I18n<typeof UIStrings>} */
// @ts-expect-error: Is set in report renderer.
static i18n = null;
static get PASS_THRESHOLD() {
return PASS_THRESHOLD;
}
static get MS_DISPLAY_VALUE() {
return `%10d${NBSP}ms`;
}
/**
* Returns a new LHR that's reshaped for slightly better ergonomics within the report rendereer.
* Also, sets up the localized UI strings used within renderer and makes changes to old LHRs to be
* compatible with current renderer.
* The LHR passed in is not mutated.
* TODO(team): we all agree the LHR shape change is technical debt we should fix
* @param {LH.Result} result
* @return {LH.ReportResult}
*/
static prepareReportResult(result) {
// If any mutations happen to the report within the renderers, we want the original object untouched
const clone = /** @type {LH.ReportResult} */ (JSON.parse(JSON.stringify(result)));
// If LHR is older (≤3.0.3), it has no locale setting. Set default.
if (!clone.configSettings.locale) {
clone.configSettings.locale = 'en';
}
if (!clone.configSettings.formFactor) {
// @ts-expect-error fallback handling for emulatedFormFactor
clone.configSettings.formFactor = clone.configSettings.emulatedFormFactor;
}
for (const audit of Object.values(clone.audits)) {
// Turn 'not-applicable' (LHR <4.0) and 'not_applicable' (older proto versions)
// into 'notApplicable' (LHR ≥4.0).
// @ts-expect-error tsc rightly flags that these values shouldn't occur.
// eslint-disable-next-line max-len
if (audit.scoreDisplayMode === 'not_applicable' || audit.scoreDisplayMode === 'not-applicable') {
audit.scoreDisplayMode = 'notApplicable';
}
if (audit.details) {
// Turn `auditDetails.type` of undefined (LHR <4.2) and 'diagnostic' (LHR <5.0)
// into 'debugdata' (LHR ≥5.0).
// @ts-expect-error tsc rightly flags that these values shouldn't occur.
if (audit.details.type === undefined || audit.details.type === 'diagnostic') {
// @ts-expect-error details is of type never.
audit.details.type = 'debugdata';
}
// Add the jpg data URL prefix to filmstrip screenshots without them (LHR <5.0).
if (audit.details.type === 'filmstrip') {
for (const screenshot of audit.details.items) {
if (!screenshot.data.startsWith(SCREENSHOT_PREFIX)) {
screenshot.data = SCREENSHOT_PREFIX + screenshot.data;
}
}
}
}
}
// For convenience, smoosh all AuditResults into their auditRef (which has just weight & group)
if (typeof clone.categories !== 'object') throw new Error('No categories provided.');
/** @type {Map<string, Array<LH.ReportResult.AuditRef>>} */
const relevantAuditToMetricsMap = new Map();
// This backcompat converts old LHRs (<9.0.0) to use the new "hidden" group.
// Old LHRs used "no group" to identify audits that should be hidden in performance instead of the "hidden" group.
// Newer LHRs use "no group" to identify opportunities and diagnostics whose groups are assigned by details type.
const [majorVersion] = clone.lighthouseVersion.split('.').map(Number);
const perfCategory = clone.categories['performance'];
if (majorVersion < 9 && perfCategory) {
if (!clone.categoryGroups) clone.categoryGroups = {};
clone.categoryGroups['hidden'] = {title: ''};
for (const auditRef of perfCategory.auditRefs) {
if (!auditRef.group) {
auditRef.group = 'hidden';
} else if (['load-opportunities', 'diagnostics'].includes(auditRef.group)) {
delete auditRef.group;
}
}
}
for (const category of Object.values(clone.categories)) {
// Make basic lookup table for relevantAudits
category.auditRefs.forEach(metricRef => {
if (!metricRef.relevantAudits) return;
metricRef.relevantAudits.forEach(auditId => {
const arr = relevantAuditToMetricsMap.get(auditId) || [];
arr.push(metricRef);
relevantAuditToMetricsMap.set(auditId, arr);
});
});
category.auditRefs.forEach(auditRef => {
const result = clone.audits[auditRef.id];
auditRef.result = result;
// Attach any relevantMetric auditRefs
if (relevantAuditToMetricsMap.has(auditRef.id)) {
auditRef.relevantMetrics = relevantAuditToMetricsMap.get(auditRef.id);
}
// attach the stackpacks to the auditRef object
if (clone.stackPacks) {
clone.stackPacks.forEach(pack => {
if (pack.descriptions[auditRef.id]) {
auditRef.stackPacks = auditRef.stackPacks || [];
auditRef.stackPacks.push({
title: pack.title,
iconDataURL: pack.iconDataURL,
description: pack.descriptions[auditRef.id],
});
}
});
}
});
}
return clone;
}
/**
* Used to determine if the "passed" for the purposes of showing up in the "failed" or "passed"
* sections of the report.
*
* @param {{score: (number|null), scoreDisplayMode: string}} audit
* @return {boolean}
*/
static showAsPassed(audit) {
switch (audit.scoreDisplayMode) {
case 'manual':
case 'notApplicable':
return true;
case 'error':
case 'informative':
return false;
case 'numeric':
case 'binary':
default:
return Number(audit.score) >= RATINGS.PASS.minScore;
}
}
/**
* Convert a score to a rating label.
* TODO: Return `'error'` for `score === null && !scoreDisplayMode`.
*
* @param {number|null} score
* @param {string=} scoreDisplayMode
* @return {string}
*/
static calculateRating(score, scoreDisplayMode) {
// Handle edge cases first, manual and not applicable receive 'pass', errored audits receive 'error'
if (scoreDisplayMode === 'manual' || scoreDisplayMode === 'notApplicable') {
return RATINGS.PASS.label;
} else if (scoreDisplayMode === 'error') {
return RATINGS.ERROR.label;
} else if (score === null) {
return RATINGS.FAIL.label;
}
// At this point, we're rating a standard binary/numeric audit
let rating = RATINGS.FAIL.label;
if (score >= RATINGS.PASS.minScore) {
rating = RATINGS.PASS.label;
} else if (score >= RATINGS.AVERAGE.minScore) {
rating = RATINGS.AVERAGE.label;
}
return rating;
}
/**
* Split a string by markdown code spans (enclosed in `backticks`), splitting
* into segments that were enclosed in backticks (marked as `isCode === true`)
* and those that outside the backticks (`isCode === false`).
* @param {string} text
* @return {Array<{isCode: true, text: string}|{isCode: false, text: string}>}
*/
static splitMarkdownCodeSpans(text) {
/** @type {Array<{isCode: true, text: string}|{isCode: false, text: string}>} */
const segments = [];
// Split on backticked code spans.
const parts = text.split(/`(.*?)`/g);
for (let i = 0; i < parts.length; i ++) {
const text = parts[i];
// Empty strings are an artifact of splitting, not meaningful.
if (!text) continue;
// Alternates between plain text and code segments.
const isCode = i % 2 !== 0;
segments.push({
isCode,
text,
});
}
return segments;
}
/**
* Split a string on markdown links (e.g. [some link](https://...)) into
* segments of plain text that weren't part of a link (marked as
* `isLink === false`), and segments with text content and a URL that did make
* up a link (marked as `isLink === true`).
* @param {string} text
* @return {Array<{isLink: true, text: string, linkHref: string}|{isLink: false, text: string}>}
*/
static splitMarkdownLink(text) {
/** @type {Array<{isLink: true, text: string, linkHref: string}|{isLink: false, text: string}>} */
const segments = [];
const parts = text.split(/\[([^\]]+?)\]\((https?:\/\/.*?)\)/g);
while (parts.length) {
// Shift off the same number of elements as the pre-split and capture groups.
const [preambleText, linkText, linkHref] = parts.splice(0, 3);
if (preambleText) { // Skip empty text as it's an artifact of splitting, not meaningful.
segments.push({
isLink: false,
text: preambleText,
});
}
// Append link if there are any.
if (linkText && linkHref) {
segments.push({
isLink: true,
text: linkText,
linkHref,
});
}
}
return segments;
}
/**
* @param {URL} parsedUrl
* @param {{numPathParts?: number, preserveQuery?: boolean, preserveHost?: boolean}=} options
* @return {string}
*/
static getURLDisplayName(parsedUrl, options) {
// Closure optional properties aren't optional in tsc, so fallback needs undefined values.
options = options || {numPathParts: undefined, preserveQuery: undefined,
preserveHost: undefined};
const numPathParts = options.numPathParts !== undefined ? options.numPathParts : 2;
const preserveQuery = options.preserveQuery !== undefined ? options.preserveQuery : true;
const preserveHost = options.preserveHost || false;
let name;
if (parsedUrl.protocol === 'about:' || parsedUrl.protocol === 'data:') {
// Handle 'about:*' and 'data:*' URLs specially since they have no path.
name = parsedUrl.href;
} else {
name = parsedUrl.pathname;
const parts = name.split('/').filter(part => part.length);
if (numPathParts && parts.length > numPathParts) {
name = ELLIPSIS + parts.slice(-1 * numPathParts).join('/');
}
if (preserveHost) {
name = `${parsedUrl.host}/${name.replace(/^\//, '')}`;
}
if (preserveQuery) {
name = `${name}${parsedUrl.search}`;
}
}
const MAX_LENGTH = 64;
if (parsedUrl.protocol !== 'data:') {
// Always elide hexadecimal hash
name = name.replace(/([a-f0-9]{7})[a-f0-9]{13}[a-f0-9]*/g, `$1${ELLIPSIS}`);
// Also elide other hash-like mixed-case strings
name = name.replace(/([a-zA-Z0-9-_]{9})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9-_]{10,}/g,
`$1${ELLIPSIS}`);
// Also elide long number sequences
name = name.replace(/(\d{3})\d{6,}/g, `$1${ELLIPSIS}`);
// Merge any adjacent ellipses
name = name.replace(/\u2026+/g, ELLIPSIS);
// Elide query params first
if (name.length > MAX_LENGTH && name.includes('?')) {
// Try to leave the first query parameter intact
name = name.replace(/\?([^=]*)(=)?.*/, `?$1$2${ELLIPSIS}`);
// Remove it all if it's still too long
if (name.length > MAX_LENGTH) {
name = name.replace(/\?.*/, `?${ELLIPSIS}`);
}
}
}
// Elide too long names next
if (name.length > MAX_LENGTH) {
const dotIndex = name.lastIndexOf('.');
if (dotIndex >= 0) {
name = name.slice(0, MAX_LENGTH - 1 - (name.length - dotIndex)) +
// Show file extension
`${ELLIPSIS}${name.slice(dotIndex)}`;
} else {
name = name.slice(0, MAX_LENGTH - 1) + ELLIPSIS;
}
}
return name;
}
/**
* Split a URL into a file, hostname and origin for easy display.
* @param {string} url
* @return {{file: string, hostname: string, origin: string}}
*/
static parseURL(url) {
const parsedUrl = new URL(url);
return {
file: Util.getURLDisplayName(parsedUrl),
hostname: parsedUrl.hostname,
origin: parsedUrl.origin,
};
}
/**
* @param {string|URL} value
* @return {!URL}
*/
static createOrReturnURL(value) {
if (value instanceof URL) {
return value;
}
return new URL(value);
}
/**
* Gets the tld of a domain
*
* @param {string} hostname
* @return {string} tld
*/
static getTld(hostname) {
const tlds = hostname.split('.').slice(-2);
if (!listOfTlds.includes(tlds[0])) {
return `.${tlds[tlds.length - 1]}`;
}
return `.${tlds.join('.')}`;
}
/**
* Returns a primary domain for provided hostname (e.g. www.example.com -> example.com).
* @param {string|URL} url hostname or URL object
* @return {string}
*/
static getRootDomain(url) {
const hostname = Util.createOrReturnURL(url).hostname;
const tld = Util.getTld(hostname);
// tld is .com or .co.uk which means we means that length is 1 to big
// .com => 2 & .co.uk => 3
const splitTld = tld.split('.');
// get TLD + root domain
return hostname.split('.').slice(-splitTld.length).join('.');
}
/**
* @param {LH.Result['configSettings']} settings
* @return {!{deviceEmulation: string, networkThrottling: string, cpuThrottling: string, summary: string}}
*/
static getEmulationDescriptions(settings) {
let cpuThrottling;
let networkThrottling;
let summary;
const throttling = settings.throttling;
switch (settings.throttlingMethod) {
case 'provided':
summary = networkThrottling = cpuThrottling = Util.i18n.strings.throttlingProvided;
break;
case 'devtools': {
const {cpuSlowdownMultiplier, requestLatencyMs} = throttling;
cpuThrottling = `${Util.i18n.formatNumber(cpuSlowdownMultiplier)}x slowdown (DevTools)`;
networkThrottling = `${Util.i18n.formatNumber(requestLatencyMs)}${NBSP}ms HTTP RTT, ` +
`${Util.i18n.formatNumber(throttling.downloadThroughputKbps)}${NBSP}Kbps down, ` +
`${Util.i18n.formatNumber(throttling.uploadThroughputKbps)}${NBSP}Kbps up (DevTools)`;
const isSlow4G = () => {
return requestLatencyMs === 150 * 3.75 &&
throttling.downloadThroughputKbps === 1.6 * 1024 * 0.9 &&
throttling.uploadThroughputKbps === 750 * 0.9;
};
summary = isSlow4G() ? Util.i18n.strings.runtimeSlow4g : Util.i18n.strings.runtimeCustom;
break;
}
case 'simulate': {
const {cpuSlowdownMultiplier, rttMs, throughputKbps} = throttling;
cpuThrottling = `${Util.i18n.formatNumber(cpuSlowdownMultiplier)}x slowdown (Simulated)`;
networkThrottling = `${Util.i18n.formatNumber(rttMs)}${NBSP}ms TCP RTT, ` +
`${Util.i18n.formatNumber(throughputKbps)}${NBSP}Kbps throughput (Simulated)`;
const isSlow4G = () => {
return rttMs === 150 && throughputKbps === 1.6 * 1024;
};
summary = isSlow4G() ? Util.i18n.strings.runtimeSlow4g : Util.i18n.strings.runtimeCustom;
break;
}
default:
summary = cpuThrottling = networkThrottling = Util.i18n.strings.runtimeUnknown;
}
// TODO(paulirish): revise Runtime Settings strings: https://github.com/GoogleChrome/lighthouse/pull/11796
const deviceEmulation = {
mobile: Util.i18n.strings.runtimeMobileEmulation,
desktop: Util.i18n.strings.runtimeDesktopEmulation,
}[settings.formFactor] || Util.i18n.strings.runtimeNoEmulation;
return {
deviceEmulation,
cpuThrottling,
networkThrottling,
summary,
};
}
/**
* Returns only lines that are near a message, or the first few lines if there are
* no line messages.
* @param {LH.Audit.Details.SnippetValue['lines']} lines
* @param {LH.Audit.Details.SnippetValue['lineMessages']} lineMessages
* @param {number} surroundingLineCount Number of lines to include before and after
* the message. If this is e.g. 2 this function might return 5 lines.
*/
static filterRelevantLines(lines, lineMessages, surroundingLineCount) {
if (lineMessages.length === 0) {
// no lines with messages, just return the first bunch of lines
return lines.slice(0, surroundingLineCount * 2 + 1);
}
const minGapSize = 3;
const lineNumbersToKeep = new Set();
// Sort messages so we can check lineNumbersToKeep to see how big the gap to
// the previous line is.
lineMessages = lineMessages.sort((a, b) => (a.lineNumber || 0) - (b.lineNumber || 0));
lineMessages.forEach(({lineNumber}) => {
let firstSurroundingLineNumber = lineNumber - surroundingLineCount;
let lastSurroundingLineNumber = lineNumber + surroundingLineCount;
while (firstSurroundingLineNumber < 1) {
// make sure we still show (surroundingLineCount * 2 + 1) lines in total
firstSurroundingLineNumber++;
lastSurroundingLineNumber++;
}
// If only a few lines would be omitted normally then we prefer to include
// extra lines to avoid the tiny gap
if (lineNumbersToKeep.has(firstSurroundingLineNumber - minGapSize - 1)) {
firstSurroundingLineNumber -= minGapSize;
}
for (let i = firstSurroundingLineNumber; i <= lastSurroundingLineNumber; i++) {
const surroundingLineNumber = i;
lineNumbersToKeep.add(surroundingLineNumber);
}
});
return lines.filter(line => lineNumbersToKeep.has(line.lineNumber));
}
/**
* @param {string} categoryId
*/
static isPluginCategory(categoryId) {
return categoryId.startsWith('lighthouse-plugin-');
}
/**
* @param {LH.Result.GatherMode} gatherMode
*/
static shouldDisplayAsFraction(gatherMode) {
return gatherMode === 'timespan' || gatherMode === 'snapshot';
}
/**
* @param {LH.ReportResult.Category} category
*/
static calculateCategoryFraction(category) {
let numPassableAudits = 0;
let numPassed = 0;
let numInformative = 0;
let totalWeight = 0;
for (const auditRef of category.auditRefs) {
const auditPassed = Util.showAsPassed(auditRef.result);
// Don't count the audit if it's manual, N/A, or isn't displayed.
if (auditRef.group === 'hidden' ||
auditRef.result.scoreDisplayMode === 'manual' ||
auditRef.result.scoreDisplayMode === 'notApplicable') {
continue;
} else if (auditRef.result.scoreDisplayMode === 'informative') {
if (!auditPassed) {
++numInformative;
}
continue;
}
++numPassableAudits;
totalWeight += auditRef.weight;
if (auditPassed) numPassed++;
}
return {numPassed, numPassableAudits, numInformative, totalWeight};
}
}
/**
* Some parts of the report renderer require data found on the LHR. Instead of wiring it
* through, we have this global.
* @type {LH.ReportResult | null}
*/
Util.reportJson = null;
/**
* An always-increasing counter for making unique SVG ID suffixes.
*/
Util.getUniqueSuffix = (() => {
let svgSuffix = 0;
return function() {
return svgSuffix++;
};
})();
/**
* Report-renderer-specific strings.
*/
const UIStrings = {
/** Disclaimer shown to users below the metric values (First Contentful Paint, Time to Interactive, etc) to warn them that the numbers they see will likely change slightly the next time they run Lighthouse. */
varianceDisclaimer: 'Values are estimated and may vary. The [performance score is calculated](https://web.dev/performance-scoring/) directly from these metrics.',
/** Text link pointing to an interactive calculator that explains Lighthouse scoring. The link text should be fairly short. */
calculatorLink: 'See calculator.',
/** Label preceding a radio control for filtering the list of audits. The radio choices are various performance metrics (FCP, LCP, TBT), and if chosen, the audits in the report are hidden if they are not relevant to the selected metric. */
showRelevantAudits: 'Show audits relevant to:',
/** Column heading label for the listing of opportunity audits. Each audit title represents an opportunity. There are only 2 columns, so no strict character limit. */
opportunityResourceColumnLabel: 'Opportunity',
/** Column heading label for the estimated page load savings of opportunity audits. Estimated Savings is the total amount of time (in seconds) that Lighthouse computed could be reduced from the total page load time, if the suggested action is taken. There are only 2 columns, so no strict character limit. */
opportunitySavingsColumnLabel: 'Estimated Savings',
/** An error string displayed next to a particular audit when it has errored, but not provided any specific error message. */
errorMissingAuditInfo: 'Report error: no audit information',
/** A label, shown next to an audit title or metric title, indicating that there was an error computing it. The user can hover on the label to reveal a tooltip with the extended error message. Translation should be short (< 20 characters). */
errorLabel: 'Error!',
/** This label is shown above a bulleted list of warnings. It is shown directly below an audit that produced warnings. Warnings describe situations the user should be aware of, as Lighthouse was unable to complete all the work required on this audit. For example, The 'Unable to decode image (biglogo.jpg)' warning may show up below an image encoding audit. */
warningHeader: 'Warnings: ',
/** Section heading shown above a list of passed audits that contain warnings. Audits under this section do not negatively impact the score, but Lighthouse has generated some potentially actionable suggestions that should be reviewed. This section is expanded by default and displays after the failing audits. */
warningAuditsGroupTitle: 'Passed audits but with warnings',
/** Section heading shown above a list of audits that are passing. 'Passed' here refers to a passing grade. This section is collapsed by default, as the user should be focusing on the failed audits instead. Users can click this heading to reveal the list. */
passedAuditsGroupTitle: 'Passed audits',
/** Section heading shown above a list of audits that do not apply to the page. For example, if an audit is 'Are images optimized?', but the page has no images on it, the audit will be marked as not applicable. This is neither passing or failing. This section is collapsed by default, as the user should be focusing on the failed audits instead. Users can click this heading to reveal the list. */
notApplicableAuditsGroupTitle: 'Not applicable',
/** Section heading shown above a list of audits that were not computed by Lighthouse. They serve as a list of suggestions for the user to go and manually check. For example, Lighthouse can't automate testing cross-browser compatibility, so that is listed within this section, so the user is reminded to test it themselves. This section is collapsed by default, as the user should be focusing on the failed audits instead. Users can click this heading to reveal the list. */
manualAuditsGroupTitle: 'Additional items to manually check',
/** Label shown preceding any important warnings that may have invalidated the entire report. For example, if the user has Chrome extensions installed, they may add enough performance overhead that Lighthouse's performance metrics are unreliable. If shown, this will be displayed at the top of the report UI. */
toplevelWarningsMessage: 'There were issues affecting this run of Lighthouse:',
/** String of text shown in a graphical representation of the flow of network requests for the web page. This label represents the initial network request that fetches an HTML page. This navigation may be redirected (eg. Initial navigation to http://example.com redirects to https://www.example.com). */
crcInitialNavigation: 'Initial Navigation',
/** Label of value shown in the summary of critical request chains. Refers to the total amount of time (milliseconds) of the longest critical path chain/sequence of network requests. Example value: 2310 ms */
crcLongestDurationLabel: 'Maximum critical path latency:',
/** Label for button that shows all lines of the snippet when clicked */
snippetExpandButtonLabel: 'Expand snippet',
/** Label for button that only shows a few lines of the snippet when clicked */
snippetCollapseButtonLabel: 'Collapse snippet',
/** Explanation shown to users below performance results to inform them that the test was done with a 4G network connection and to warn them that the numbers they see will likely change slightly the next time they run Lighthouse. 'Lighthouse' becomes link text to additional documentation. */
lsPerformanceCategoryDescription: '[Lighthouse](https://developers.google.com/web/tools/lighthouse/) analysis of the current page on an emulated mobile network. Values are estimated and may vary.',
/** Title of the lab data section of the Performance category. Within this section are various speed metrics which quantify the pageload performance into values presented in seconds and milliseconds. "Lab" is an abbreviated form of "laboratory", and refers to the fact that the data is from a controlled test of a website, not measurements from real users visiting that site. */
labDataTitle: 'Lab Data',
/** This label is for a checkbox above a table of items loaded by a web page. The checkbox is used to show or hide third-party (or "3rd-party") resources in the table, where "third-party resources" refers to items loaded by a web page from URLs that aren't controlled by the owner of the web page. */
thirdPartyResourcesLabel: 'Show 3rd-party resources',
/** This label is for a button that opens a new tab to a webapp called "Treemap", which is a nested visual representation of a heierarchy of data related to the reports (script bytes and coverage, resource breakdown, etc.) */
viewTreemapLabel: 'View Treemap',
/** This label is for a button that will show the user a trace of the page. */
viewTraceLabel: 'View Trace',
/** This label is for a button that will show the user a trace of the page. */
viewOriginalTraceLabel: 'View Original Trace',
/** Option in a dropdown menu that opens a small, summary report in a print dialog. */
dropdownPrintSummary: 'Print Summary',
/** Option in a dropdown menu that opens a full Lighthouse report in a print dialog. */
dropdownPrintExpanded: 'Print Expanded',
/** Option in a dropdown menu that copies the Lighthouse JSON object to the system clipboard. */
dropdownCopyJSON: 'Copy JSON',
/** Option in a dropdown menu that saves the Lighthouse report HTML locally to the system as a '.html' file. */
dropdownSaveHTML: 'Save as HTML',
/** Option in a dropdown menu that saves the Lighthouse JSON object to the local system as a '.json' file. */
dropdownSaveJSON: 'Save as JSON',
/** Option in a dropdown menu that opens the current report in the Lighthouse Viewer Application. */
dropdownViewer: 'Open in Viewer',
/** Option in a dropdown menu that saves the current report as a new GitHub Gist. */
dropdownSaveGist: 'Save as Gist',
/** Option in a dropdown menu that toggles the themeing of the report between Light(default) and Dark themes. */
dropdownDarkTheme: 'Toggle Dark Theme',
/** Label for a row in a table that describes the kind of device that was emulated for the Lighthouse run. Example values for row elements: 'No Emulation', 'Emulated Desktop', etc. */
runtimeSettingsDevice: 'Device',
/** Label for a row in a table that describes the network throttling conditions that were used during a Lighthouse run, if any. */
runtimeSettingsNetworkThrottling: 'Network throttling',
/** Label for a row in a table that describes the CPU throttling conditions that were used during a Lighthouse run, if any.*/
runtimeSettingsCPUThrottling: 'CPU throttling',
/** Label for a row in a table that shows the User Agent that was used to send out all network requests during the Lighthouse run. */
runtimeSettingsUANetwork: 'User agent (network)',
/** Label for a row in a table that shows the estimated CPU power of the machine running Lighthouse. Example row values: 532, 1492, 783. */
runtimeSettingsBenchmark: 'CPU/Memory Power',
/** Label for a row in a table that shows the version of the Axe library used. Example row values: 2.1.0, 3.2.3 */
runtimeSettingsAxeVersion: 'Axe version',
/** Label for button to create an issue against the Lighthouse GitHub project. */
footerIssue: 'File an issue',
/** Descriptive explanation for emulation setting when no device emulation is set. */
runtimeNoEmulation: 'No emulation',
/** Descriptive explanation for emulation setting when emulating a Moto G4 mobile device. */
runtimeMobileEmulation: 'Emulated Moto G4',
/** Descriptive explanation for emulation setting when emulating a generic desktop form factor, as opposed to a mobile-device like form factor. */
runtimeDesktopEmulation: 'Emulated Desktop',
/** Descriptive explanation for a runtime setting that is set to an unknown value. */
runtimeUnknown: 'Unknown',
/** Descriptive label that this analysis run was from a single pageload of a browser (not a summary of hundreds of loads) */
runtimeSingleLoad: 'Single page load',
/** Descriptive label that this analysis only considers the initial load of the page, and no interaction beyond when the page had "fully loaded" */
runtimeAnalysisWindow: 'Initial page load',
/** Descriptive explanation that this analysis run was from a single pageload of a browser, whereas field data often summarizes hundreds+ of page loads */
runtimeSingleLoadTooltip: 'This data is taken from a single page load, as opposed to field data summarizing many sessions.', // eslint-disable-line max-len
/** Descriptive explanation for environment throttling that was provided by the runtime environment instead of provided by Lighthouse throttling. */
throttlingProvided: 'Provided by environment',
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Show' and 'Hide'. */
show: 'Show',
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Show' and 'Hide'. */
hide: 'Hide',
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Expand view' and 'Collapse view'. */
expandView: 'Expand view',
/** Label for an interactive control that will reveal or hide a group of content. This control toggles between the text 'Expand view' and 'Collapse view'. */
collapseView: 'Collapse view',
/** Label indicating that Lighthouse throttled the page to emulate a slow 4G network connection. */
runtimeSlow4g: 'Slow 4G throttling',
/** Label indicating that Lighthouse throttled the page using custom throttling settings. */
runtimeCustom: 'Custom throttling',
};
Util.UIStrings = UIStrings;
// auto-generated by build/build-report-components.js
/** @typedef {import('./dom.js').DOM} DOM */
/* eslint-disable max-len */
/**
* @param {DOM} dom
*/
function create3pFilterComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('style');
el1.append('\n .lh-3p-filter {\n color: var(--color-gray-600);\n float: right;\n padding: 6px var(--stackpack-padding-horizontal);\n }\n .lh-3p-filter-label, .lh-3p-filter-input {\n vertical-align: middle;\n user-select: none;\n }\n .lh-3p-filter-input:disabled + .lh-3p-ui-string {\n text-decoration: line-through;\n }\n ');
el0.append(el1);
const el2 = dom.createElement('div', 'lh-3p-filter');
const el3 = dom.createElement('label', 'lh-3p-filter-label');
const el4 = dom.createElement('input', 'lh-3p-filter-input');
el4.setAttribute('type', 'checkbox');
el4.setAttribute('checked', '');
const el5 = dom.createElement('span', 'lh-3p-ui-string');
el5.append('Show 3rd party resources');
const el6 = dom.createElement('span', 'lh-3p-filter-count');
el3.append(' ', el4, ' ', el5, ' (', el6, ') ');
el2.append(' ', el3, ' ');
el0.append(el2);
return el0;
}
/**
* @param {DOM} dom
*/
function createAuditComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('div', 'lh-audit');
const el2 = dom.createElement('details', 'lh-expandable-details');
const el3 = dom.createElement('summary');
const el4 = dom.createElement('div', 'lh-audit__header lh-expandable-details__summary');
const el5 = dom.createElement('span', 'lh-audit__score-icon');
const el6 = dom.createElement('span', 'lh-audit__title-and-text');
const el7 = dom.createElement('span', 'lh-audit__title');
const el8 = dom.createElement('span', 'lh-audit__display-text');
el6.append(' ', el7, ' ', el8, ' ');
const el9 = dom.createElement('div', 'lh-chevron-container');
el4.append(' ', el5, ' ', el6, ' ', el9, ' ');
el3.append(' ', el4, ' ');
const el10 = dom.createElement('div', 'lh-audit__description');
const el11 = dom.createElement('div', 'lh-audit__stackpacks');
el2.append(' ', el3, ' ', el10, ' ', el11, ' ');
el1.append(' ', el2, ' ');
el0.append(el1);
return el0;
}
/**
* @param {DOM} dom
*/
function createCategoryHeaderComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('div', 'lh-category-header');
const el2 = dom.createElement('div', 'lh-score__gauge');
el2.setAttribute('role', 'heading');
el2.setAttribute('aria-level', '2');
const el3 = dom.createElement('div', 'lh-category-header__description');
el1.append(' ', el2, ' ', el3, ' ');
el0.append(el1);
return el0;
}
/**
* @param {DOM} dom
*/
function createChevronComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElementNS('http://www.w3.org/2000/svg', 'svg', 'lh-chevron');
el1.setAttribute('viewBox', '0 0 100 100');
const el2 = dom.createElementNS('http://www.w3.org/2000/svg', 'g', 'lh-chevron__lines');
const el3 = dom.createElementNS('http://www.w3.org/2000/svg', 'path', 'lh-chevron__line lh-chevron__line-left');
el3.setAttribute('d', 'M10 50h40');
const el4 = dom.createElementNS('http://www.w3.org/2000/svg', 'path', 'lh-chevron__line lh-chevron__line-right');
el4.setAttribute('d', 'M90 50H50');
el2.append(' ', el3, ' ', el4, ' ');
el1.append(' ', el2, ' ');
el0.append(el1);
return el0;
}
/**
* @param {DOM} dom
*/
function createClumpComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('div', 'lh-audit-group');
const el2 = dom.createElement('details', 'lh-clump');
const el3 = dom.createElement('summary');
const el4 = dom.createElement('div', 'lh-audit-group__summary');
const el5 = dom.createElement('div', 'lh-audit-group__header');
const el6 = dom.createElement('span', 'lh-audit-group__title');
const el7 = dom.createElement('span', 'lh-audit-group__itemcount');
el5.append(' ', el6, ' ', el7, ' ', ' ', ' ');
const el8 = dom.createElement('div', 'lh-clump-toggle');
const el9 = dom.createElement('span', 'lh-clump-toggletext--show');
const el10 = dom.createElement('span', 'lh-clump-toggletext--hide');
el8.append(' ', el9, ' ', el10, ' ');
el4.append(' ', el5, ' ', el8, ' ');
el3.append(' ', el4, ' ');
el2.append(' ', el3, ' ');
el1.append(' ', ' ', el2, ' ');
el0.append(el1);
return el0;
}
/**
* @param {DOM} dom
*/
function createCrcComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('div', 'lh-crc-container');
const el2 = dom.createElement('style');
el2.append('\n .lh-crc .lh-tree-marker {\n width: 12px;\n height: 26px;\n display: block;\n float: left;\n background-position: top left;\n }\n .lh-crc .lh-horiz-down {\n background: url(\'data:image/svg+xml;utf8,<svg width="16" height="26" viewBox="0 0 16 26" xmlns="http://www.w3.org/2000/svg"><g fill="%23D8D8D8" fill-rule="evenodd"><path d="M16 12v2H-2v-2z"/><path d="M9 12v14H7V12z"/></g></svg>\');\n }\n .lh-crc .lh-right {\n background: url(\'data:image/svg+xml;utf8,<svg width="16" height="26" viewBox="0 0 16 26" xmlns="http://www.w3.org/2000/svg"><path d="M16 12v2H0v-2z" fill="%23D8D8D8" fill-rule="evenodd"/></svg>\');\n }\n .lh-crc .lh-up-right {\n background: url(\'data:image/svg+xml;utf8,<svg width="16" height="26" viewBox="0 0 16 26" xmlns="http://www.w3.org/2000/svg"><path d="M7 0h2v14H7zm2 12h7v2H9z" fill="%23D8D8D8" fill-rule="evenodd"/></svg>\');\n }\n .lh-crc .lh-vert-right {\n background: url(\'data:image/svg+xml;utf8,<svg width="16" height="26" viewBox="0 0 16 26" xmlns="http://www.w3.org/2000/svg"><path d="M7 0h2v27H7zm2 12h7v2H9z" fill="%23D8D8D8" fill-rule="evenodd"/></svg>\');\n }\n .lh-crc .lh-vert {\n background: url(\'data:image/svg+xml;utf8,<svg width="16" height="26" viewBox="0 0 16 26" xmlns="http://www.w3.org/2000/svg"><path d="M7 0h2v26H7z" fill="%23D8D8D8" fill-rule="evenodd"/></svg>\');\n }\n .lh-crc .lh-crc-tree {\n font-size: 14px;\n width: 100%;\n overflow-x: auto;\n }\n .lh-crc .lh-crc-node {\n height: 26px;\n line-height: 26px;\n white-space: nowrap;\n }\n .lh-crc .lh-crc-node__tree-value {\n margin-left: 10px;\n }\n .lh-crc .lh-crc-node__tree-value div {\n display: inline;\n }\n .lh-crc .lh-crc-node__chain-duration {\n font-weight: 700;\n }\n .lh-crc .lh-crc-initial-nav {\n color: #595959;\n font-style: italic;\n }\n .lh-crc__summary-value {\n margin-bottom: 10px;\n }\n ');
const el3 = dom.createElement('div');
const el4 = dom.createElement('div', 'lh-crc__summary-value');
const el5 = dom.createElement('span', 'lh-crc__longest_duration_label');
const el6 = dom.createElement('b', 'lh-crc__longest_duration');
el4.append(' ', el5, ' ', el6, ' ');
el3.append(' ', el4, ' ');
const el7 = dom.createElement('div', 'lh-crc');
const el8 = dom.createElement('div', 'lh-crc-initial-nav');
el7.append(' ', el8, ' ', ' ');
el1.append(' ', el2, ' ', el3, ' ', el7, ' ');
el0.append(el1);
return el0;
}
/**
* @param {DOM} dom
*/
function createCrcChainComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('div', 'lh-crc-node');
const el2 = dom.createElement('span', 'lh-crc-node__tree-marker');
const el3 = dom.createElement('span', 'lh-crc-node__tree-value');
el1.append(' ', el2, ' ', el3, ' ');
el0.append(el1);
return el0;
}
/**
* @param {DOM} dom
*/
function createElementScreenshotComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('div', 'lh-element-screenshot');
const el2 = dom.createElement('div', 'lh-element-screenshot__content');
const el3 = dom.createElement('div', 'lh-element-screenshot__mask');
const el4 = dom.createElementNS('http://www.w3.org/2000/svg', 'svg');
el4.setAttribute('height', '0');
el4.setAttribute('width', '0');
const el5 = dom.createElementNS('http://www.w3.org/2000/svg', 'defs');
const el6 = dom.createElementNS('http://www.w3.org/2000/svg', 'clipPath');
el6.setAttribute('clipPathUnits', 'objectBoundingBox');
el5.append(' ', el6, ' ', ' ');
el4.append(' ', el5, ' ');
el3.append(' ', el4, ' ');
const el7 = dom.createElement('div', 'lh-element-screenshot__image');
const el8 = dom.createElement('div', 'lh-element-screenshot__element-marker');
el2.append(' ', el3, ' ', el7, ' ', el8, ' ');
el1.append(' ', el2, ' ');
el0.append(el1);
return el0;
}
/**
* @param {DOM} dom
*/
function createFooterComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('style');
el1.append('\n .lh-footer {\n padding: var(--footer-padding-vertical) calc(var(--default-padding) * 2);\n max-width: var(--report-content-max-width);\n margin: 0 auto;\n }\n .lh-footer .lh-generated {\n text-align: center;\n }\n ');
el0.append(el1);
const el2 = dom.createElement('footer', 'lh-footer');
const el3 = dom.createElement('ul', 'lh-meta__items');
el3.append(' ');
const el4 = dom.createElement('div', 'lh-generated');
const el5 = dom.createElement('b');
el5.append('Lighthouse');
const el6 = dom.createElement('span', 'lh-footer__version');
const el7 = dom.createElement('a', 'lh-footer__version_issue');
el7.setAttribute('href', 'https://github.com/GoogleChrome/Lighthouse/issues');
el7.setAttribute('target', '_blank');
el7.setAttribute('rel', 'noopener');
el7.append('File an issue');
el4.append(' ', ' Generated by ', el5, ' ', el6, ' | ', el7, ' ');
el2.append(' ', el3, ' ', el4, ' ');
el0.append(el2);
return el0;
}
/**
* @param {DOM} dom
*/
function createFractionComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('a', 'lh-fraction__wrapper');
const el2 = dom.createElement('div', 'lh-fraction__content-wrapper');
const el3 = dom.createElement('div', 'lh-fraction__content');
const el4 = dom.createElement('div', 'lh-fraction__background');
el3.append(' ', el4, ' ');
el2.append(' ', el3, ' ');
const el5 = dom.createElement('div', 'lh-fraction__label');
el1.append(' ', el2, ' ', el5, ' ');
el0.append(el1);
return el0;
}
/**
* @param {DOM} dom
*/
function createGaugeComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('a', 'lh-gauge__wrapper');
const el2 = dom.createElement('div', 'lh-gauge__svg-wrapper');
const el3 = dom.createElementNS('http://www.w3.org/2000/svg', 'svg', 'lh-gauge');
el3.setAttribute('viewBox', '0 0 120 120');
const el4 = dom.createElementNS('http://www.w3.org/2000/svg', 'circle', 'lh-gauge-base');
el4.setAttribute('r', '56');
el4.setAttribute('cx', '60');
el4.setAttribute('cy', '60');
el4.setAttribute('stroke-width', '8');
const el5 = dom.createElementNS('http://www.w3.org/2000/svg', 'circle', 'lh-gauge-arc');
el5.setAttribute('r', '56');
el5.setAttribute('cx', '60');
el5.setAttribute('cy', '60');
el5.setAttribute('stroke-width', '8');
el3.append(' ', el4, ' ', el5, ' ');
el2.append(' ', el3, ' ');
const el6 = dom.createElement('div', 'lh-gauge__percentage');
const el7 = dom.createElement('div', 'lh-gauge__label');
el1.append(' ', ' ', el2, ' ', el6, ' ', ' ', el7, ' ');
el0.append(el1);
return el0;
}
/**
* @param {DOM} dom
*/
function createGaugePwaComponent(dom) {
const el0 = dom.createFragment();
const el1 = dom.createElement('style');
el1.append('\n .lh-gauge--pwa .lh-gauge--pwa__component {\n display: none;\n }\n .lh-gauge--pwa__wrapper:not(.lh-badged--all) .lh-gauge--pwa__logo > path {\n /* Gray logo unless everything is passing. */\n fill: #B0B0B0;\n }\n\n .lh-gauge--pwa__disc {\n fill: var(--color-gray-200);\n }\n\n .lh-gauge--pwa__logo--primary-color {\n fill: #304FFE;\n }\n\n .lh-gauge--pwa__logo--secondary-color {\n fill: #3D3D3D;\n }\n .lh-dark .lh-gauge--pwa__logo--secondary-color {\n fill: #D8B6B6;\n }\n\n /* No passing groups. */\n .lh-gauge--pwa__wrapper:not([class*=\'lh-badged--\']) .lh-gauge--pwa__na-line {\n display: inline;\n }\n /* Just optimized. Same n/a line as no passing groups. */\n .lh-gauge--pwa__wrapper.lh-badged--pwa-optimized:not(.lh-badged--pwa-installable) .lh-gauge--pwa__na-line {\n display: inline;\n }\n\n /* Just installable. */\n .lh-gauge--pwa__wrapper.lh-badged--pwa-installable .lh-gauge--pwa__installable-badge {\n display: inline;\n }\n\n /* All passing groups. */\n .lh-gauge--pwa__wrapper.lh-badged--all .lh-gauge--pwa__check-circle {\n display: inline;\n }\n ');
el0.append(el1);
const el2 = dom.createElement('a', 'lh-gauge__wrapper lh-gauge--pwa__wrapper');
const el3 = dom.createElementNS('http://www.w3.org/2000/svg', 'svg', 'lh-gauge lh-gauge--pwa');
el3.setAttribute('viewBox', '0 0 60 60');
const el4 = dom.createElementNS('http://www.w3.org/2000/svg', 'defs');
const el5 = dom.createElementNS('http://www.w3.org/2000/svg', 'linearGradient');
el5.setAttribute('id', 'lh-gauge--pwa__check-circle__gradient');
el5.setAttribute('x1', '50%');
el5.setAttribute('y1', '0%');
el5.setAttribute('x2', '50%');
el5.setAttribute('y2', '100%');
const el6 = dom.createElementNS('http://www.w3.org/2000/svg', 'stop');
el6.setAttribute('stop-color', '#00C852');
el6.setAttribute('offset', '0%');
const el7 = dom.createElementNS('http://www.w3.org/2000/svg', 'stop');
el7.setAttribute('stop-color', '#009688');
el7.setAttribute('offset', '100%');
el5.append(' ', el6, ' ', el7, ' ');
const el8 = dom.createElementNS('http://www.w3.org/2000/svg', 'linearGradient');
el8.setAttribute('id', 'lh-gauge--pwa__installable__shadow-gradient');
el8.setAttribute('x1', '76.056%');
el8.setAttribute('x2', '24.111%');
el8.setAttribute('y1', '82.995%');
el8.setAttribute('y2', '24.735%');
const el9 = dom.createElementNS('http://www.w3.org/2000/svg', 'stop');
el9.setAttribute('stop-color', '#A5D6A7');
el9.setAttribute('offset', '0%');
const el10 = dom.createElementNS('http://www.w3.org/2000/svg', 'stop');
el10.setAttribute('stop-color', '#80CBC4');
el10.setAttribute('offset', '100%');
el8.append(' ', el9, ' ', el10, ' ');
const el11 = dom.createElementNS('http://www.w3.org/2000/svg', 'g');
el11.setAttribute('id', 'lh-gauge--pwa__installable-badge');
const el12 = dom.createElementNS('http://www.w3.org/2000/svg', 'circle');
el12.setAttribute('fill', '#FFFFFF');
el12.setAttribute('cx', '10');
el12.setAttribute('cy', '10');
el12.setAttribute('r', '10');
const el13 = dom.createElementNS('http://www.w3.org/2000/svg', 'path');
el13.setAttribute('fill', '#009688');
el13.setAttribute('d', 'M10 4.167A5.835 5.835 0 0 0 4.167 10 5.835 5.835 0 0 0 10 15.833 5.835 5.835 0 0 0 15.833 10 5.835 5.835 0 0 0 10 4.167zm2.917 6.416h-2.334v2.334H9.417v-2.334H7.083V9.417h2.334V7.083h1.166v2.334h2.334v1.166z');
el11.append(' ', el12, ' ', el13, ' ');
el4.append(' ', el5, ' ', el8, ' ', el11, ' ');
const el14 = dom.createElementNS('http://www.w3.org/2000/svg', 'g');
el14.setAttribute('stroke', 'none');
el14.setAttribute('fill-rule', 'nonzero');
const el15 = dom.createElementNS('http://www.w3.org/2000/svg', 'circle', 'lh-gauge--pwa__disc');
el15.setAttribute('cx', '30');
el15.setAttribute('cy', '30');
el15.setAttribute('r', '30');
const el16 = dom.createElementNS('http://www.w3.org/2000/svg', 'g', 'lh-gauge--pwa__logo');
const el17 = dom.createElementNS('http://www.w3.org/2000/svg', 'path', 'lh-gauge--pwa__logo--secondary-color');
el17.setAttribute('d', 'M35.66 19.39l.7-1.75h2L37.4 15 38.6 12l3.4 9h-2.51l-.58-1.61z');
const el18 = dom.createElementNS('http://www.w3.org/2000/svg', 'path', 'lh-gauge--pwa__logo--primary-color');
el18.setAttribute('d', 'M33.52 21l3.65-9h-2.42l-2.5 5.82L30.5 12h-1.86l-1.9 5.82-1.35-2.65-1.21 3.72L25.4 21h2.38l1.72-5.2 1.64 5.2z');
const el19 = dom.createElementNS('http://www.w3.org/2000/svg', 'path', 'lh-gauge--pwa__logo--secondary-color');
el19.setAttribute('fill-rule', 'nonzero');
el19.setAttribute('d', 'M20.3 17.91h1.48c.45 0 .85-.05 1.2-.15l.39-1.18 1.07-3.3a2.64 2.64 0 0 0-.28-.37c-.55-.6-1.36-.91-2.42-.91H18v9h2.3V17.9zm1.96-3.84c.22.22.33.5.33.87 0 .36-.1.65-.29.87-.2.23-.59.35-1.15.35h-.86v-2.41h.87c.52 0 .89.1 1.1.32z');
el16.append(' ', el17, ' ', el18, ' ', el19, ' ');
const el20 = dom.createElementNS('http://www.w3.org/2000/svg', 'rect', 'lh-gauge--pwa__component lh-gauge--pwa__na-line');
el20.setAttribute('fill', '#FFFFFF');
el20.setAttribute('x', '20');
el20.setAttribute('y', '32');
el20.setAttribute('width', '20');
el20.setAttribute('height', '4');
el20.setAttribute('rx', '2');
const el21 = dom.createElementNS('http://www.w3.org/2000/svg', 'g', 'lh-gauge--pwa__component lh-gauge--pwa__installable-badge');
el21.setAttribute('transform', 'translate(20, 29)');
const el22 = dom.createElementNS('http://www.w3.org/2000/svg', 'path');
el22.setAttribute('fill', 'url(#lh-gauge--pwa__installable__shadow-gradient)');
el22.setAttribute('d', 'M33.629 19.487c-4.272 5.453-10.391 9.39-17.415 10.869L3 17.142 17.142 3 33.63 19.487z');
const el23 = dom.createElementNS('http://www.w3.org/2000/svg', 'use');
el23.setAttribute('href', '#lh-gauge--pwa__installable-badge');
el21.append(' ', el22, ' ', el23, ' ');
const el24 = dom.createElementNS('http://www.w3.org/2000/svg', 'g', 'lh-gauge--pwa__component lh-gauge--pwa__check-circle');
el24.setAttribute('transform', 'translate(18, 28)');
const el25 = dom.createElementNS('http://www.w3.org/2000/svg', 'circle');
el25.se