${sanitizedContent}
`; + } + + return html; + } + + function addUTMParameters(url) { + try { + const urlObj = new URL(url); + urlObj.searchParams.set('utm_campaign', '215266513-FlowFuse Expert'); + return urlObj.toString(); + } catch (e) { + // If URL parsing fails, return original URL + return url; + } + } + + function renderRichContent(richAnswer) { + let html = ''; + + // Setup Guide label for guide messages + let headerText = 'Result' + + if (richAnswer.kind === 'guide') headerText = 'Setup Guide' + if (richAnswer.kind === 'resources') headerText = 'Resources'; + + html += `${richAnswer.summary}
`; + } + + // Content text (if any) + if (richAnswer.content) { // typically a resources response has this field + html += `${richAnswer.content}
`; + } + + // Steps + if (richAnswer.steps && richAnswer.steps.length > 0) { + html += '${step.detail}
+${nodeUrl}
+${url}
++ Category: + ${flow.metadata?.category} +
+