Detects when user changes same config setting 3+ times within 24 hours. Shows non-intrusive prompt offering help with guided calibration flow. Guided calibration features: - Test for false positives (walk around room) - Test for missed motion (sit still) - Suggest optimal value based on diurnal baseline SNR and link health - Apply suggested value button Files: - dashboard/js/proactive.js: Complete implementation with localStorage tracking Acceptance: - Help prompt fires after 3+ changes in 24h - Calibration flow tests both directions - Suggests value based on system data - Apply button works
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping';
|
|
|
|
import type { GenMapping } from '@jridgewell/gen-mapping';
|
|
import type { DecodedSourceMap, EncodedSourceMap, Options } from './types';
|
|
|
|
/**
|
|
* A SourceMap v3 compatible sourcemap, which only includes fields that were
|
|
* provided to it.
|
|
*/
|
|
export default class SourceMap {
|
|
declare file?: string | null;
|
|
declare mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings'];
|
|
declare sourceRoot?: string;
|
|
declare names: string[];
|
|
declare sources: (string | null)[];
|
|
declare sourcesContent?: (string | null)[];
|
|
declare version: 3;
|
|
declare ignoreList: number[] | undefined;
|
|
|
|
constructor(map: GenMapping, options: Options) {
|
|
const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);
|
|
this.version = out.version; // SourceMap spec says this should be first.
|
|
this.file = out.file;
|
|
this.mappings = out.mappings as SourceMap['mappings'];
|
|
this.names = out.names as SourceMap['names'];
|
|
this.ignoreList = out.ignoreList as SourceMap['ignoreList'];
|
|
this.sourceRoot = out.sourceRoot;
|
|
|
|
this.sources = out.sources as SourceMap['sources'];
|
|
if (!options.excludeContent) {
|
|
this.sourcesContent = out.sourcesContent as SourceMap['sourcesContent'];
|
|
}
|
|
}
|
|
|
|
toString(): string {
|
|
return JSON.stringify(this);
|
|
}
|
|
}
|