'use strict'; // The chat view's page: a fixed skeleton with a strict Content-Security-Policy. Nothing a model // or a server writes is ever part of this text; it reaches the page as messages and is drawn // with `textContent`. No `vscode` here. /** * @param {{ cspSource: string, nonce: string, scriptUri: string, styleUri: string }} o */ function chatHtml(o) { for (const v of [o.cspSource, o.nonce, o.scriptUri, o.styleUri]) { if (typeof v !== 'string' || /["<>\s]/.test(v)) throw new Error('unsafe value for the chat page'); } const csp = [ "default-src 'none'", `img-src ${o.cspSource}`, `style-src ${o.cspSource}`, `script-src 'nonce-${o.nonce}'`, "base-uri 'none'", "form-action 'none'", ].join('; '); return `