(function(api) {

    api.sectionConstructor['veterinary-services-upsell'] = api.Section.extend({
        attachEvents: function() {},
        isContextuallyActive: function() {
            return true;
        }
    });

    const veterinary_services_section_lists = ['banner', 'service'];
    veterinary_services_section_lists.forEach(veterinary_services_homepage_scroll);

    function veterinary_services_homepage_scroll(item, index) {
        item = item.replace(/-/g, '_');
        wp.customize.section('veterinary_services_' + item + '_section', function(section) {
            section.expanded.bind(function(isExpanding) {
                wp.customize.previewer.send(item, { expanded: isExpanding });
            });
        });
    }
})(wp.customize);