export function aestheticMedicineCalculator(form: FormTs) {
form.addRow(row => {
row.addTextPanel('header', {
computedValue: () => 'Aesthetic Medicine Calculator',
customStyles: { 'font-size': '1.5rem', 'font-weight': '600', 'color': '#1e293b' }
});
});
form.addSpacer({ height: 20 });
// Neuromodulators Section (Botox, etc.)
const botoxSection = form.addSubform('botox', { title: '๐ Neuromodulators (Botox/Dysport)' });
botoxSection.addRow(row => {
row.addCheckbox('botoxTreatment', {
label: 'Add Neuromodulator Treatment',
defaultValue: true
}, '1fr');
row.addDropdown('botoxBrand', {
label: 'Product',
options: [
{ id: 'botox', name: 'Botox Cosmetic' },
{ id: 'dysport', name: 'Dysport' },
{ id: 'xeomin', name: 'Xeomin' },
{ id: 'jeuveau', name: 'Jeuveau' }
],
defaultValue: 'botox',
isVisible: () => botoxSection.checkbox('botoxTreatment')?.value() === true
}, '1fr');
});
botoxSection.addRow(row => {
row.addTextPanel('areasLabel', {
computedValue: () => 'Treatment Areas:',
customStyles: { 'font-weight': '500', 'color': '#475569' },
isVisible: () => botoxSection.checkbox('botoxTreatment')?.value() === true
});
});
botoxSection.addRow(row => {
row.addCheckbox('forehead', {
label: 'Forehead Lines (10-30 units)',
defaultValue: true,
isVisible: () => botoxSection.checkbox('botoxTreatment')?.value() === true
}, '1fr');
row.addCheckbox('frown', {
label: 'Frown Lines/11s (20-40 units)',
defaultValue: false,
isVisible: () => botoxSection.checkbox('botoxTreatment')?.value() === true
}, '1fr');
});
botoxSection.addRow(row => {
row.addCheckbox('crowsFeet', {
label: "Crow's Feet (12-24 units)",
defaultValue: false,
isVisible: () => botoxSection.checkbox('botoxTreatment')?.value() === true
}, '1fr');
row.addCheckbox('bunnyLines', {
label: 'Bunny Lines (5-10 units)',
defaultValue: false,
isVisible: () => botoxSection.checkbox('botoxTreatment')?.value() === true
}, '1fr');
});
botoxSection.addRow(row => {
row.addCheckbox('lipFlip', {
label: 'Lip Flip (4-8 units)',
defaultValue: false,
isVisible: () => botoxSection.checkbox('botoxTreatment')?.value() === true
}, '1fr');
row.addCheckbox('chinDimpling', {
label: 'Chin Dimpling (6-10 units)',
defaultValue: false,
isVisible: () => botoxSection.checkbox('botoxTreatment')?.value() === true
}, '1fr');
});
botoxSection.addRow(row => {
row.addCheckbox('neckBands', {
label: 'Neck Bands (25-50 units)',
defaultValue: false,
isVisible: () => botoxSection.checkbox('botoxTreatment')?.value() === true
}, '1fr');
row.addCheckbox('masseter', {
label: 'Masseter/Jaw Slimming (40-60 units)',
defaultValue: false,
isVisible: () => botoxSection.checkbox('botoxTreatment')?.value() === true
}, '1fr');
});
// Dermal Fillers Section
const fillersSection = form.addSubform('fillers', { title: 'โจ Dermal Fillers' });
fillersSection.addRow(row => {
row.addCheckbox('fillerTreatment', {
label: 'Add Dermal Filler Treatment',
defaultValue: false
}, '1fr');
row.addDropdown('fillerBrand', {
label: 'Product Line',
options: [
{ id: 'juvederm', name: 'Juvederm' },
{ id: 'restylane', name: 'Restylane' },
{ id: 'radiesse', name: 'Radiesse' },
{ id: 'sculptra', name: 'Sculptra' },
{ id: 'versa', name: 'Revanesse Versa' }
],
defaultValue: 'juvederm',
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
}, '1fr');
});
fillersSection.addRow(row => {
row.addTextPanel('fillerAreasLabel', {
computedValue: () => 'Treatment Areas (syringes):',
customStyles: { 'font-weight': '500', 'color': '#475569' },
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
});
});
fillersSection.addRow(row => {
row.addCheckbox('lips', {
label: 'Lips',
defaultValue: false,
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
}, '1fr');
row.addDropdown('lipsSyringes', {
label: 'Syringes',
options: [
{ id: '0.5', name: '0.5 syringe (subtle)' },
{ id: '1', name: '1 syringe (natural)' },
{ id: '2', name: '2 syringes (full)' }
],
defaultValue: '1',
isVisible: () => fillersSection.checkbox('lips')?.value() === true
}, '1fr');
});
fillersSection.addRow(row => {
row.addCheckbox('cheeks', {
label: 'Cheeks',
defaultValue: false,
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
}, '1fr');
row.addDropdown('cheeksSyringes', {
label: 'Syringes',
options: [
{ id: '1', name: '1 syringe (subtle)' },
{ id: '2', name: '2 syringes (moderate)' },
{ id: '4', name: '4 syringes (full)' }
],
defaultValue: '2',
isVisible: () => fillersSection.checkbox('cheeks')?.value() === true
}, '1fr');
});
fillersSection.addRow(row => {
row.addCheckbox('jawline', {
label: 'Jawline',
defaultValue: false,
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
}, '1fr');
row.addDropdown('jawlineSyringes', {
label: 'Syringes',
options: [
{ id: '2', name: '2 syringes (subtle)' },
{ id: '4', name: '4 syringes (defined)' },
{ id: '6', name: '6 syringes (dramatic)' }
],
defaultValue: '4',
isVisible: () => fillersSection.checkbox('jawline')?.value() === true
}, '1fr');
});
fillersSection.addRow(row => {
row.addCheckbox('nasolabial', {
label: 'Nasolabial Folds',
defaultValue: false,
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
}, '1fr');
row.addCheckbox('marionette', {
label: 'Marionette Lines',
defaultValue: false,
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
}, '1fr');
});
fillersSection.addRow(row => {
row.addCheckbox('underEyes', {
label: 'Under Eyes/Tear Troughs',
defaultValue: false,
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
}, '1fr');
row.addCheckbox('chin', {
label: 'Chin Augmentation',
defaultValue: false,
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
}, '1fr');
});
fillersSection.addRow(row => {
row.addCheckbox('nose', {
label: 'Non-Surgical Nose Job',
defaultValue: false,
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
}, '1fr');
row.addCheckbox('temples', {
label: 'Temples',
defaultValue: false,
isVisible: () => fillersSection.checkbox('fillerTreatment')?.value() === true
}, '1fr');
});
// Skin Treatments Section
const skinSection = form.addSubform('skin', { title: '๐ Skin Treatments' });
skinSection.addRow(row => {
row.addCheckbox('chemicalPeel', {
label: 'Chemical Peel',
defaultValue: false
}, '1fr');
row.addDropdown('peelType', {
label: 'Peel Strength',
options: [
{ id: 'light', name: 'Light (Glycolic/Lactic)' },
{ id: 'medium', name: 'Medium (TCA)' },
{ id: 'deep', name: 'Deep (Phenol)' }
],
defaultValue: 'light',
isVisible: () => skinSection.checkbox('chemicalPeel')?.value() === true
}, '1fr');
});
skinSection.addRow(row => {
row.addCheckbox('microneedling', {
label: 'Microneedling',
defaultValue: false
}, '1fr');
row.addCheckbox('prp', {
label: 'Add PRP (Vampire Facial)',
defaultValue: false,
isVisible: () => skinSection.checkbox('microneedling')?.value() === true
}, '1fr');
});
skinSection.addRow(row => {
row.addCheckbox('hydrafacial', {
label: 'HydraFacial',
defaultValue: false
}, '1fr');
row.addDropdown('hydraType', {
label: 'Treatment Level',
options: [
{ id: 'signature', name: 'Signature' },
{ id: 'deluxe', name: 'Deluxe' },
{ id: 'platinum', name: 'Platinum' }
],
defaultValue: 'deluxe',
isVisible: () => skinSection.checkbox('hydrafacial')?.value() === true
}, '1fr');
});
skinSection.addRow(row => {
row.addCheckbox('laserResurfacing', {
label: 'Laser Skin Resurfacing',
defaultValue: false
}, '1fr');
row.addCheckbox('ipl', {
label: 'IPL Photofacial',
defaultValue: false
}, '1fr');
});
// Add-ons Section
const addonsSection = form.addSubform('addons', { title: 'โ Additional Services' });
addonsSection.addRow(row => {
row.addCheckbox('consultation', {
label: 'Initial Consultation',
defaultValue: false
}, '1fr');
row.addCheckbox('followUp', {
label: '2-Week Follow-Up',
defaultValue: false
}, '1fr');
});
addonsSection.addRow(row => {
row.addCheckbox('skincare', {
label: 'Post-Treatment Skincare Kit',
defaultValue: false
}, '1fr');
row.addCheckbox('numbing', {
label: 'Premium Numbing',
defaultValue: false
}, '1fr');
});
form.addSpacer({ height: 20, showLine: true, lineStyle: 'dashed' });
// Pricing Section
const pricingSection = form.addSubform('pricing', { title: '๐ฐ Pricing', isCollapsible: false });
const calculatePrice = () => {
const hasBotox = botoxSection.checkbox('botoxTreatment')?.value();
const hasFillers = fillersSection.checkbox('fillerTreatment')?.value();
const botoxBrand = botoxSection.dropdown('botoxBrand')?.value() || 'botox';
const fillerBrand = fillersSection.dropdown('fillerBrand')?.value() || 'juvederm';
let botoxPrice = 0;
let fillerPrice = 0;
let skinPrice = 0;
let addonsPrice = 0;
let totalUnits = 0;
// Botox pricing (per unit)
const botoxPricePerUnit: Record<string, number> = {
'botox': 14,
'dysport': 5, // 3:1 ratio, so effectively similar
'xeomin': 12,
'jeuveau': 11
};
const unitPrice = botoxPricePerUnit[botoxBrand] || 14;
const dysportMultiplier = botoxBrand === 'dysport' ? 2.5 : 1;
if (hasBotox) {
const areas: Record<string, number> = {
'forehead': 20,
'frown': 30,
'crowsFeet': 18,
'bunnyLines': 8,
'lipFlip': 6,
'chinDimpling': 8,
'neckBands': 40,
'masseter': 50
};
Object.keys(areas).forEach(area => {
if (botoxSection.checkbox(area)?.value()) {
const units = (areas[area] || 0) * dysportMultiplier;
totalUnits += units;
botoxPrice += units * unitPrice;
}
});
}
// Filler pricing (per syringe)
const fillerPricePerSyringe: Record<string, number> = {
'juvederm': 700,
'restylane': 650,
'radiesse': 750,
'sculptra': 850,
'versa': 550
};
const syringePrice = fillerPricePerSyringe[fillerBrand] || 700;
if (hasFillers) {
if (fillersSection.checkbox('lips')?.value()) {
const syringes = parseFloat(fillersSection.dropdown('lipsSyringes')?.value() || '1');
fillerPrice += syringes * syringePrice;
}
if (fillersSection.checkbox('cheeks')?.value()) {
const syringes = parseFloat(fillersSection.dropdown('cheeksSyringes')?.value() || '2');
fillerPrice += syringes * syringePrice;
}
if (fillersSection.checkbox('jawline')?.value()) {
const syringes = parseFloat(fillersSection.dropdown('jawlineSyringes')?.value() || '4');
fillerPrice += syringes * syringePrice;
}
if (fillersSection.checkbox('nasolabial')?.value()) fillerPrice += syringePrice * 1.5;
if (fillersSection.checkbox('marionette')?.value()) fillerPrice += syringePrice * 1.5;
if (fillersSection.checkbox('underEyes')?.value()) fillerPrice += syringePrice * 1;
if (fillersSection.checkbox('chin')?.value()) fillerPrice += syringePrice * 1.5;
if (fillersSection.checkbox('nose')?.value()) fillerPrice += syringePrice * 1;
if (fillersSection.checkbox('temples')?.value()) fillerPrice += syringePrice * 2;
}
// Skin treatments
if (skinSection.checkbox('chemicalPeel')?.value()) {
const peelType = skinSection.dropdown('peelType')?.value() || 'light';
const peelPrices: Record<string, number> = { 'light': 150, 'medium': 350, 'deep': 700 };
skinPrice += peelPrices[peelType] || 150;
}
if (skinSection.checkbox('microneedling')?.value()) {
skinPrice += 350;
if (skinSection.checkbox('prp')?.value()) skinPrice += 350;
}
if (skinSection.checkbox('hydrafacial')?.value()) {
const hydraType = skinSection.dropdown('hydraType')?.value() || 'deluxe';
const hydraPrices: Record<string, number> = { 'signature': 175, 'deluxe': 275, 'platinum': 400 };
skinPrice += hydraPrices[hydraType] || 275;
}
if (skinSection.checkbox('laserResurfacing')?.value()) skinPrice += 1200;
if (skinSection.checkbox('ipl')?.value()) skinPrice += 400;
// Add-ons
if (addonsSection.checkbox('consultation')?.value()) addonsPrice += 100;
if (addonsSection.checkbox('followUp')?.value()) addonsPrice += 0; // Usually complimentary
if (addonsSection.checkbox('skincare')?.value()) addonsPrice += 125;
if (addonsSection.checkbox('numbing')?.value()) addonsPrice += 50;
// Package discount for combining treatments
let discount = 0;
const treatmentCount = (hasBotox ? 1 : 0) + (hasFillers ? 1 : 0) + (skinPrice > 0 ? 1 : 0);
if (treatmentCount >= 3) discount = 0.15;
else if (treatmentCount >= 2) discount = 0.10;
const subtotal = botoxPrice + fillerPrice + skinPrice;
const discountAmount = subtotal * discount;
const total = subtotal - discountAmount + addonsPrice;
return {
botoxPrice: Math.round(botoxPrice),
fillerPrice: Math.round(fillerPrice),
skinPrice: Math.round(skinPrice),
addonsPrice: Math.round(addonsPrice),
discount: Math.round(discount * 100),
discountAmount: Math.round(discountAmount),
total: Math.round(total),
totalUnits: Math.round(totalUnits)
};
};
pricingSection.addRow(row => {
row.addPriceDisplay('botox', {
label: 'Neuromodulators',
computedValue: () => calculatePrice().botoxPrice,
variant: 'default',
isVisible: () => calculatePrice().botoxPrice > 0
}, '1fr');
row.addTextPanel('units', {
computedValue: () => `(${calculatePrice().totalUnits} units)`,
customStyles: { 'font-size': '0.9rem', 'color': '#64748b', 'align-self': 'center' },
isVisible: () => calculatePrice().totalUnits > 0
}, '1fr');
});
pricingSection.addRow(row => {
row.addPriceDisplay('fillers', {
label: 'Dermal Fillers',
computedValue: () => calculatePrice().fillerPrice,
variant: 'default',
isVisible: () => calculatePrice().fillerPrice > 0
}, '1fr');
row.addPriceDisplay('skin', {
label: 'Skin Treatments',
computedValue: () => calculatePrice().skinPrice,
variant: 'default',
isVisible: () => calculatePrice().skinPrice > 0
}, '1fr');
});
pricingSection.addRow(row => {
row.addTextPanel('discount', {
computedValue: () => {
const price = calculatePrice();
if (price.discount > 0) {
return `Combination Discount: ${price.discount}% off (-$${price.discountAmount})`;
}
return '';
},
customStyles: { 'font-size': '0.95rem', 'color': '#16a34a', 'font-weight': '500' },
isVisible: () => calculatePrice().discount > 0
});
});
// Summary Section
const summarySection = form.addSubform('summary', {
title: '๐งพ Summary',
isCollapsible: false,
sticky: 'bottom'
});
summarySection.addRow(row => {
row.addPriceDisplay('total', {
label: 'Total',
computedValue: () => calculatePrice().total,
variant: 'large'
}, '1fr');
});
summarySection.addRow(row => {
row.addTextPanel('note', {
computedValue: () => 'Prices are estimates. Final pricing determined during consultation based on individual needs. Results vary. Financing options available.',
customStyles: { 'font-size': '0.85rem', 'color': '#64748b', 'text-align': 'center' }
});
});
form.configureSubmitButton({
label: 'Book Consultation'
});
}