'; var bestMatches=selectedArr.length>1?matched.filter(function(t){return t.matchCount>1}):[]; var singleMatches=selectedArr.length>1?matched.filter(function(t){return t.matchCount===1}):matched; var html=''; if(bestMatches.length>0){ html+='
Best Matches \u2014 Addresses Multiple Concerns
'; bestMatches.forEach(function(t){html+=buildCard(t,true)}); if(singleMatches.length>0){html+='
Also Recommended
'} } singleMatches.forEach(function(t){html+=buildCard(t,false)}); document.getElementById('treatmentResults').innerHTML=html; document.getElementById('resultsTitle').textContent=selectedArr.length>1?'Your Recommended Treatments':'Treatments for '+concernLabels[selectedArr[0]]; document.getElementById('alsoConsider').innerHTML=selectedArr.length>1?'
Pro Tip: Combination Approach
Treating multiple concerns together often delivers better results than addressing them individually. During your consultation, Angelica will create a sequenced treatment timeline so each treatment complements the others. View all services \u2192
':''; step1.classList.add('hidden'); step2.classList.remove('hidden'); dot1.classList.remove('active'); dot2.classList.add('active'); document.getElementById('reviveMatcher').scrollIntoView({behavior:'smooth',block:'start'}); } function buildCard(t,isBest){ var hl=t.highlights.map(function(h){return '
'+h+''}).join(''); var ct=t.matchedConcerns.map(function(c){return '
\u2713 '+concernLabels[c]+''}).join(''); var badge=isBest?'
Best Match
':''; return '
'+badge+'
'+ct+'
'+t.desc+'
'+hl+'
Book AppointmentLearn More
'; } /* ═══════════════════════════════════════════════════ BOULEVARD BOOKING WIDGET — DIRECT INTEGRATION Maps each booking class to its Boulevard path so we can call blvd.openBookingWidget() directly on dynamically created buttons. ═══════════════════════════════════════════════════ */ var BLVD_LOCATION = 'c5f43d7f-1305-48c8-b5f5-ca537fc986ca'; var BLVD_PATHS = { 'open-blvd-widget': '/cart/menu/Biostimulators/s_02ed4e4b-bdd7-4f63-8c13-d631383ac9ed', 'open-biostim2': '/cart/menu/Biostimulators/s_7b4712ff-8294-4ebe-8331-147fbd3245ac', 'open-injectables': '/cart/menu/Vitamins', 'open-iv-drip': '/cart/menu/IV%20Hydration', 'open-microneedling': '/cart/menu/Microneedling', 'open-laser-hair': '/cart/menu/Laser%20Hair%20Removal', 'open-permanent-makeup': '/cart/menu/Permanent%20Make-up', 'open-revive-drip': '/cart/menu/IV%20Hydration/s_70c65dcd-e6cc-47af-8989-38fa6fbc16a3', 'open-meyer-cocktail': '/cart/menu/IV%20Hydration/s_4883526f-6726-4730-bd57-404cead442e7', 'open-hangover-infusion':'/cart/menu/IV%20Hydration/s_08783d74-3fdb-43a2-abae-c04535e31f2e', 'open-vitamin-c': '/cart/menu/IV%20Hydration/s_c8842d98-6296-4296-b900-313adaffe306', 'open-erbium-yag': '/cart/menu/Laser%20Skin%20Resurfacing/s_eed3ecca-5274-44ef-8d49-852d779784a6', 'b-complex-injections': '/cart/menu/Vitamins/s_15d2333a-cda2-434c-9ad1-e24b3b309a43', 'open-smooth-threads': '/cart/menu/Smooth%20Threads/s_2bfe1ed4-a9c3-415b-82b5-3c6314efeaab', 'open-prf': '/cart/menu/PRF%20(Platelet%20Rich%20Fibrin', 'open-consultation': '/cart/menu/Consultations/s_45e373b9-cae6-4002-9298-8766a2fc7c91', 'open-welness': '/cart/menu/Vitamins', 'open-tattoo-removal': '/cart/menu/Tattoo%20Removal' }; function openBlvdBooking(bookClass){ var path = BLVD_PATHS[bookClass]; if(path && typeof blvd !== 'undefined' && blvd.openBookingWidget){ blvd.openBookingWidget({ urlParams: { locationId: BLVD_LOCATION, path: path, visitType: 'SELF_VISIT' } }); } } /* ═══════════════════════════════════════════════════ EVENT DELEGATION FOR DYNAMICALLY CREATED BUTTONS ═══════════════════════════════════════════════════ */ document.addEventListener('click', function(e){ // Handle Book Appointment clicks var bookBtn = e.target.closest('.btn-primary[data-book-class]'); if(bookBtn){ e.preventDefault(); e.stopPropagation(); // GA4 tracking trackEvent('book_appointment_click',{ treatment_id: bookBtn.getAttribute('data-treatment-key'), treatment_name: bookBtn.getAttribute('data-treatment-name'), concerns: Array.from(selectedConcerns).join(', '), event_category: 'treatment_matcher' }); // Open Boulevard booking widget directly var bookClass = bookBtn.getAttribute('data-book-class'); if(bookClass) openBlvdBooking(bookClass); return; } // Handle Learn More clicks (GA4 only — link opens normally) var learnBtn = e.target.closest('.btn-secondary[data-treatment-key]'); if(learnBtn){ trackEvent('learn_more_click',{ treatment_id: learnBtn.getAttribute('data-treatment-key'), treatment_name: learnBtn.getAttribute('data-treatment-name'), concerns: Array.from(selectedConcerns).join(', '), event_category: 'treatment_matcher' }); } }); function goBack(){ // GA4: Track going back to edit trackEvent('edit_concerns',{ previous_concerns: Array.from(selectedConcerns).join(', '), event_category: 'treatment_matcher' }); step2.classList.add('hidden'); step1.classList.remove('hidden'); dot2.classList.remove('active'); dot1.classList.add('active'); document.getElementById('reviveMatcher').scrollIntoView({behavior:'smooth',block:'start'}); }