import { createPartialOptions } from "./partial.js"; import { createButtonElement, createAnchorElement, } from "../utils/dom.js"; import { pushHistory, resetParams } from "../utils/url.js"; import { readStored, writeToStorage } from "../utils/storage.js"; import { stringToId } from "../utils/format.js"; import { collect, markUsed, logUnused } from "./unused.js"; /** * @param {Object} args * @param {Colors} args.colors * @param {Signals} args.signals * @param {BrkClient} args.brk * @param {Signal} args.qrcode */ export function initOptions({ colors, signals, brk, qrcode }) { collect(brk.metrics); const LS_SELECTED_KEY = `selected_path`; const urlPath_ = window.document.location.pathname .split("/") .filter((v) => v); const urlPath = urlPath_.length ? urlPath_ : undefined; const savedPath = /** @type {string[]} */ ( JSON.parse(readStored(LS_SELECTED_KEY) || "[]") || [] ).filter((v) => v); console.log(savedPath); /** @type {Signal