`;
// Also need to close the IIFE
const OLD_BUTTONS_CLOSE = `
\r\n )}\r\n
`;
const NEW_BUTTONS_CLOSE = ` \r\n )\r\n })()}\r\n `;
if (src.includes(OLD_BUTTONS_CONDITION)) {
src = src.replace(OLD_BUTTONS_CONDITION, NEW_BUTTONS_CONDITION);
console.log('Fix 1a: buttons condition updated');
} else {
console.error('Fix 1a: OLD_BUTTONS_CONDITION not found!');
process.exit(1);
}
if (src.includes(OLD_BUTTONS_CLOSE)) {
src = src.replace(OLD_BUTTONS_CLOSE, NEW_BUTTONS_CLOSE);
console.log('Fix 1b: buttons IIFE close updated');
} else {
console.error('Fix 1b: OLD_BUTTONS_CLOSE not found!');
process.exit(1);
}
// ─── FIX 2: Move preview panel OUTSIDE the scrollable div ────────────────────
// The scrollable div ends with: messagesEndRef then
// We need to:
// A) Remove the preview block from inside the scrollable area (already was removed in previous sessions since it was added after messagesEndRef)
// B) Add preview as shrink-0 panel between the scroll div and controls
// Find the closing of the scrollable area + start of controls
const OLD_SCROLL_END = ` \r\n \r\n\r\n {/* Scope & Tone Control Area */}`;
const NEW_SCROLL_END = ` \r\n \r\n\r\n {/* \u2550\u2550 Inject Preview Panel \u2014 fixed, always visible, NO scroll needed \u2550\u2550 */}\r\n {resourceEnriching && (\r\n