FINRA WSP Snippet Customizer
Required Firm Details
How often is the CCO or Principal required to review? (e.g., Daily, Monthly, Quarterly)
Select Required Supervisory Topics
Check the topics you need included in this section of your WSP.
Draft Written Supervisory Procedures
Review and edit the generated text below before exporting. This text can be copied directly into your manual.
Click "Next" or "Refresh" to generate the WSP text.
Final Export
Download the final WSP section below.
Documentation of the meeting, including the agenda, attendees, and training materials, must be retained for at least three (3) years.
`; } // 4. Cybersecurity if (data.topics.cyber) { html += `V. CYBERSECURITY AND DATA PROTECTION
Procedure:
1. The firm maintains an ongoing risk assessment to identify vulnerabilities in systems protecting customer data.
2. All employees must complete mandatory annual cybersecurity training. Access to customer data is limited via multi-factor authentication (MFA) and least-privilege access controls.
3. In the event of a breach, the CCO will enact the firm's documented Incident Response Plan immediately.
`; } // 5. AML if (data.topics.aml) { html += `VI. ANTI-MONEY LAUNDERING (AML)
Procedure:
1. The AML Officer (who may be the CCO) is responsible for monitoring transactions for suspicious activity.
2. Suspicious activity (as defined by the Bank Secrecy Act and FINRA rules) must be reported via a Suspicious Activity Report (SAR) filed with FinCEN within 30 days of detection.
`; } // 6. Training if (data.topics.training) { html += `VII. CONTINUING EDUCATION & TRAINING
Procedure:
The firm ensures all registered individuals satisfy the Regulatory Element and Firm Element requirements of FINRA Rule 1240. Records documenting completion must be maintained.
`; } summaryPreview.innerHTML = html; }; // --- Download Functions --- const downloadTxt = () => { if (!summaryPreview.textContent || summaryPreview.textContent.includes('generate the WSP')) { return alert('Please generate the WSP draft first by clicking "Refresh Preview" or navigating to Tab 3.'); } let content = ''; const tempDiv = document.createElement('div'); tempDiv.innerHTML = summaryPreview.innerHTML; tempDiv.querySelectorAll('p, h2, h4, h5').forEach(el => { let text = el.textContent.trim(); if (el.tagName === 'H2' || el.tagName === 'H4') { text = `\n${text.toUpperCase()}\n------------------------------------------------------`; } else if (el.tagName === 'H5') { text = `\n** ${text}`; } content += `${text}\n`; }); const data = getReportData(); const blob = new Blob([content], { type: 'text/plain;charset=utf-8' }); const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = `${data.firmName.replace(/ /g, '_')}_WSP_Snippet.txt`; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(a.href); }; const downloadPDF = () => { if (typeof window.jspdf === 'undefined' || typeof window.jspdf.jsPDF === 'undefined') { alert('Error: jsPDF library not loaded.'); return; } if (!summaryPreview.textContent || summaryPreview.textContent.includes('generate the WSP')) { return alert('Please generate the WSP draft first by clicking "Refresh Preview" or navigating to Tab 3.'); } const { jsPDF } = window.jspdf; const doc = new jsPDF('p', 'mm', 'a4'); const margin = 15; const pageWidth = doc.internal.pageSize.getWidth(); const usableWidth = pageWidth - margin * 2; let yPos = 15; // --- PDF Helper --- const addText = (text, size, style, color = [52, 73, 94], align = 'left', indent = 0) => { doc.setFontSize(size); doc.setFont('times', style); doc.setTextColor(color[0], color[1], color[2]); const splitText = doc.splitTextToSize(text, usableWidth - indent); if (yPos + (splitText.length * 5) > 280) { doc.addPage(); yPos = 20; } doc.text(splitText, margin + indent, yPos); yPos += (splitText.length * 5) + (size > 12 ? 3 : 1); }; // 1. Convert HTML content to PDF sections const tempDiv = document.createElement('div'); tempDiv.innerHTML = summaryPreview.innerHTML; tempDiv.childNodes.forEach(node => { const text = node.textContent.trim(); if (node.tagName === 'P') { if (node.classList.contains('title')) { addText(text, 16, 'bold', [44, 62, 80], 'center'); yPos += 2; } else if (node.parentNode.tagName === 'BODY' || node.parentNode.tagName === 'DIV') { // General Paragraphs addText(text, 10, 'normal', [44, 62, 80], 'left', 5); } } else if (node.tagName === 'H4') { yPos += 5; addText(text.toUpperCase(), 12, 'bold', [26, 115, 232], 'left'); // Blue doc.setDrawColor(224, 224, 224); doc.line(margin, yPos, pageWidth - margin, yPos); yPos += 5; } else if (node.tagName === 'H5') { yPos += 2; addText(text, 11, 'bold', [44, 62, 80], 'left', 5); yPos += 2; } }); doc.save('WSP_compliance_snippet.pdf'); }; // --- Event Listeners --- // Global Navigation tabButtons.forEach((btn, index) => { btn.addEventListener('click', () => showTab(index + 1)); }); nextBtn.addEventListener('click', () => showTab(currentTab + 1)); prevBtn.addEventListener('click', () => showTab(currentTab - 1)); // Tab 3 & 4 Actions refreshBtn.addEventListener('click', generateWSP); downloadPdfBtn.addEventListener('click', downloadPDF); downloadTxtBtn.addEventListener('click', downloadTxt); // --- Initialization --- showTab(1); // Set initial state });