define([
  "jquery",
  "lib/utils/debounce",
  "lib/components/slider",
  "lib/analytics/analytics",
  "lib/utils/on_transition_end"
], function($, debounce, Slider, Analytics, onTransitionEnd) {

  "use strict";

  var defaults = {
    el: "#js-gallery",
    listener: "#js-row--content",
    sliderConfig: {}
  };

  function Gallery(args) {
    this.config = $.extend({}, defaults, args);

    this.$listener = $(this.config.listener);
    this.$gallery = this.$listener.find(this.config.el);
    this.analytics = new Analytics();
    this.slug = this.$gallery.data("href");
    this.init();
  }

  Gallery.prototype.init = function() {
    this.slider = new Slider($.extend({
      el: this.$gallery,
      $listener: this.$listener,
      assetBalance: 4,
      assetReveal: true,
      createControls: false,
      keyboardControls: true
    }, this.config.sliderConfig));

    if (!(this.slider && this.slider.$currentSlide)) return;

    this._gatherElements();
    this._handleEvents();
  };

  Gallery.prototype._gatherElements = function() {
    this.galleryTitle = this.$gallery.find(".js-gallery-title");
    this.galleryPoi = this.$gallery.find(".js-gallery-poi");
    this.galleryBreadcrumb = this.$gallery.find(".js-gallery-breadcrumb");
  };

  Gallery.prototype._updateImageInfo = function() {
    var slideDetails = this.slider.$currentSlide.find(".js-slide-details"),
        caption = slideDetails.find(".caption").text(),
        poi = slideDetails.find(".poi").html(),
        breadcrumb = slideDetails.find(".breadcrumb").html();

    this.galleryTitle.text(caption);
    this.galleryPoi.html(poi);
    this.galleryBreadcrumb.html(breadcrumb);
  };

  Gallery.prototype._updateSlug = function(partial) {
    window.history.pushState && window.history.pushState({}, "", this.slug + "/" + partial);
  };

  /* jshint ignore:start */
  Gallery.prototype._updateGoogleAnalytics = function(partial, ga) {
    if (ga.dataLayer.summaryTag && ga.dataLayer.summaryTag.content_id) {
      ga.dataLayer.summaryTag.content_id = partial;
      ga.api.trackPageView(ga.dataLayer);
    }
  };
  /* jshint ignore:end */

  Gallery.prototype._afterNavigation = function(event) {
    // Ensure we're handling the correct transitionend event
    if (window.lp.supports.transform.css.indexOf(event.originalEvent.propertyName) < 0) return;

    var partial = this.slider.$currentSlide.data("partial-slug");
    this.analytics.track();
    this._updateImageInfo();
    this._updateSlug(partial);
    this._updateGoogleAnalytics(partial, window.lp.analytics);
    this.$listener.trigger(":ads/refresh");
  };

  Gallery.prototype._handleEvents = function() {

    onTransitionEnd({
      $listener: this.slider.$slides,
      fn: debounce(this._afterNavigation.bind(this), 200)
    });

    this.$gallery.on("click", ".is-previous", function() {
      this.slider._previousSlide();
    }.bind(this));

    this.$gallery.on("click", ".is-next", function() {
      this.slider._nextSlide();
    }.bind(this));
  };

  return Gallery;
});

@@ -1243,24 +1243,91 @@
 eadcrumb%22);%0A
+    this.gallerySocial = this.$gallery.find(%22.js-gallery-social%22);%0A
   %7D;%0A%0A  Gall
@@ -1612,16 +1612,70 @@
 ).html()
+,%0A        social = slideDetails.find(%22.social%22).html()
 ;%0A%0A    t
@@ -1782,16 +1782,53 @@
 crumb);%0A
+    this.gallerySocial.html(social);%0A
   %7D;%0A%0A  

add the social icons to the details that are refreshed by new slides