${SVG.check.replace("Cancel${SVG.edit.replace("
`;
const cont = tmp.firstElementChild as HTMLElement;
mainInner.appendChild(cont);
const ta = cont.querySelector(".pub_key_textarea") as HTMLTextAreaElement;
const cancelBtn = cont.querySelector(".cancel_pub_key") as HTMLElement;
const confirmBtn = cont.querySelector(".confirm_pub_key") as HTMLElement;
const editBtn = cont.querySelector(".edit_pub_key") as HTMLElement;
const grow = () => { ta.style.height = "auto"; ta.style.height = ta.scrollHeight + "px"; }; // auto-size to fit the (wrapping) key
grow();
const renderPicker = (filter = "") => {
const all = Contacts.listContacts();
if (!all.length) { picker.style.display = "none"; picker.innerHTML = ""; return; }
const f = filter.trim().toLowerCase();
const matches = (f ? all.filter((c) => (c.nickname || "").toLowerCase().includes(f) || c.key.toLowerCase().includes(f)) : all).slice(0, 8);
picker.style.display = "flex";
picker.innerHTML = `