<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">(function ($, Drupal) {
    'use strict';
  
    Drupal.behaviors.attach_utm_cookies = {
      attach: function (context, settings) {
        const ExpireDays = 30;

        let qstr = document.location.search;
        qstr = qstr.substring(1, qstr.length);

        function SetCookie(cookieName, cookieValue, nDays) {
          const domain = get_top_domain(window.location.host); // TODO: Could we change this to just use du.edu? Leaving as is for now since it allows the cookies to be set even in local environments. 
          const today = new Date();
          let expire = new Date();

          if (nDays == null || nDays == 0) nDays = 1;

          expire.setTime(today.getTime() + 3600000 * 24 * nDays);
          document.cookie = cookieName + "=" + encodeURIComponent(cookieValue) + "; expires=" + expire.toGMTString() + "; path=/; domain=." + domain + ";";
        }

        const thevars = qstr.split("&amp;");

        for (let i = 0; i &lt; thevars.length; i++) {
          const cookiecase = thevars[i].split("=");

          switch (cookiecase[0]) {
            case "utm_source":
              const utm_source = cookiecase[1];
              SetCookie("STYXKEY-utm_source", utm_source, ExpireDays);
              break;
            case "utm_medium":
              const utm_medium = cookiecase[1];
              SetCookie("STYXKEY-utm_medium", utm_medium, ExpireDays);
              break;
            case "utm_campaign":
              const utm_campaign = cookiecase[1];
              SetCookie("STYXKEY-utm_campaign", utm_campaign, ExpireDays);
              break;
            case "gad_source":
              const gad_source = cookiecase[1];
              SetCookie("STYXKEY-gad_source", gad_source, ExpireDays);
              break;
            case "gclid":
              const gclid = cookiecase[1];
              SetCookie("STYXKEY-gclid", gclid, ExpireDays);
              break;
            default:
              break;
          }
        }

        function get_top_domain() {
          let i, h,
            weird_cookie = 'weird_get_top_level_domain=cookie',
            hostname = document.location.hostname.split('.');

          for (i = hostname.length - 1; i &gt;= 0; i--) {
            h = hostname.slice(i).join('.');
            document.cookie = weird_cookie + ';domain=.' + h + ';';
            if (document.cookie.indexOf(weird_cookie) &gt; -1) {
              document.cookie = weird_cookie.split('=')[0] + '=;domain=.' + h + ';expires=Thu, 01 Jan 1970 00:00:01 GMT;';
              return h;
            }
          }
        }

        function getCookie(cname) {
          const name = cname + "=";
          const decodedCookie = decodeURIComponent(document.cookie);
          const ca = decodedCookie.split(';');
          for (let i = 0; i &lt; ca.length; i++) {
            let c = ca[i];
            while (c.charAt(0) == ' ') {
              c = c.substring(1);
            }
            if (c.indexOf(name) == 0) {
              return c.substring(name.length, c.length);
            }
          }
          return "";
        }
      }
    };
  
  })(jQuery, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol &amp;&amp; "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj &amp;&amp; "function" == typeof Symbol &amp;&amp; obj.constructor === Symbol &amp;&amp; obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i &lt; props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
(function (Modernizr, Drupal, once) {
  Drupal.behaviors.date = {
    attach: function attach(context, settings) {
      if (Modernizr.inputtypes.date === false) {
        once('datepicker', '[data-drupal-field-elements="date-time"]').forEach(function (dateTime) {
          var dateInput = dateTime.querySelector('input[type="date"]');
          var timeInput = dateTime.querySelector('input[type="time"]');
          var help = Drupal.theme.dateTimeHelp({
            dateId: "".concat(dateInput.id, "--description"),
            dateDesc: dateInput.dataset.help,
            timeId: "".concat(timeInput.id, "--description"),
            timeDesc: timeInput.dataset.help
          });
          [dateInput, timeInput].forEach(function (input) {
            input.setAttribute('aria-describedby', "".concat(input.id, "--description"));
            input.setAttribute('type', 'text');
          });
          Drupal.DatepickerPolyfill.attachDescription(dateTime, help);
        });
        once('datepicker', '[data-drupal-field-elements="date"]').forEach(function (date) {
          var dateInput = date.querySelector('input[type="date"]');
          var help = Drupal.theme.dateHelp({
            dateDesc: dateInput.dataset.help
          });
          var id = "".concat(date.id, "--description");
          dateInput.setAttribute('aria-describedby', id);
          dateInput.setAttribute('type', 'text');
          Drupal.DatepickerPolyfill.attachDescription(date, help, id);
        });
      }
    }
  };
  Drupal.DatepickerPolyfill = function () {
    function _class() {
      _classCallCheck(this, _class);
    }
    _createClass(_class, null, [{
      key: "attachDescription",
      value: function attachDescription(element, help, id) {
        var description = element.nextElementSibling;
        if (!(description &amp;&amp; description.getAttribute('data-drupal-field-elements') === 'description')) {
          description = Drupal.DatepickerPolyfill.descriptionWrapperElement(id);
          element.parentNode.insertBefore(description, element.nextSibling);
        }
        description.insertAdjacentHTML('beforeend', help);
      }
    }, {
      key: "descriptionWrapperElement",
      value: function descriptionWrapperElement(id) {
        var description = document.createElement('div');
        description.classList.add('description');
        description.setAttribute('data-drupal-field-elements', 'description');
        if (id) {
          description.setAttribute('id', id);
        }
        return description;
      }
    }]);
    return _class;
  }();
  Drupal.theme.dateHelp = function (_ref) {
    var dateDesc = _ref.dateDesc;
    return "&lt;div class=\"no-native-datepicker-help\"&gt;".concat(dateDesc, "&lt;/div&gt;");
  };
  Drupal.theme.dateTimeHelp = function (_ref2) {
    var dateId = _ref2.dateId,
      timeId = _ref2.timeId,
      dateDesc = _ref2.dateDesc,
      timeDesc = _ref2.timeDesc;
    return "&lt;div class=\"no-native-datepicker-help\"&gt;\n       &lt;span id=\"".concat(dateId, "\"&gt;").concat(dateDesc, "&lt;/span&gt; &lt;span id=\"").concat(timeId, "\"&gt;").concat(timeDesc, "&lt;/span&gt;\n     &lt;/div&gt;");
  };
})(Modernizr, Drupal, once);;
var duElevateDisplayApiUrl,
  duElevateDisplayCourseListUrl;

(function ($, Drupal, drupalSettings) {
  Drupal.behaviors.DUElevateCheckout = {
    attach: function (context, settings) {
      // Set up Elevate;
      var elevateSettings = {
        courses_list: drupalSettings.du_elevate_display.du_elevate_displayJS_checkout.courses_list,
        api_url: drupalSettings.du_elevate_display.du_elevate_displayJS_checkout.api_url
      };
      duElevateDisplayApiUrl = elevateSettings.api_url;
      duElevateDisplayCourseListUrl = elevateSettings.courses_list;

      var courses = $.du_elevate_display_get_courses();
      $.du_elevate_display_build_cart(courses);
      $.du_elevate_display_update_cart_number(courses);

      elevateButtonCheck();
    }
  };

  $.extend({
    du_elevate_display_get_courses: function () {
      var courses = {};
      if ($.cookie('elevate_cart')) {
        courses = JSON.parse($.cookie('elevate_cart'));
      }
      return courses;
    },
    du_elevate_display_check_for_course: function (courseId) {
      var courses = $.du_elevate_display_get_courses();
      if (courses[courseId]) {
        return true;
      }
      return false;
    },
    du_elevate_display_add_course: function (course) {
      var courses = $.du_elevate_display_get_courses();
      if (courses[course.id]) {
        return false;
      }
      else {
        courses[course.id] = course;
        $.du_elevate_display_update_cart(courses);
        $.du_elevate_display_build_cart(courses);
        $.du_elevate_display_update_cart_number(courses);
        return true;
      }
    },
    du_elevate_display_remove_course: function (courseId) {
      var courses = $.du_elevate_display_get_courses();
      if (courses[courseId]) {
        delete courses[courseId];
        $.du_elevate_display_update_cart(courses);
        $.du_elevate_display_build_cart(courses);
        $.du_elevate_display_update_cart_number(courses);
        return true;
      }
      else {
        return false;
      }
    },
    du_elevate_display_update_cart: function (courses) {
      var elevateDate = new Date();
      elevateDate.setTime(elevateDate.getTime() + (240 * 60 * 1000));
      $.cookie('elevate_cart', JSON.stringify(courses), { expires: elevateDate, path: '/' });
    },
    du_elevate_display_build_cart: function (courses) {
      if (Object.keys(courses).length) {
        var course_output = '',
            course_total = 0,
            course_link = '',
            course_link_count = 1;
        $.each( courses, function( key, course ) {
          // Format date for display.
          const course_date_format = course.date.split(' - ');
          const course_date_updated = [];

          // Loop through all dates and set the formatting for each.
          for (let i = 0; i &lt; course_date_format.length; i++) {

            // Check that the date is not empty.
            if (course_date_format[i] !== '') {
              // Replace all dashes with slashes.
              course_date_format[i] = course_date_format[i].replace(/-/g, '/');

              // Format date using DateTimeFormat.
              const dateFormat = new Intl.DateTimeFormat('en', { year: 'numeric', month: 'numeric', day: '2-digit' });

              // Push formatted date to array.
              course_date_updated.push(dateFormat.format(new Date(course_date_format[i])));
            }
          }

          // Cart output.
          course_output += '&lt;div class="elevate-cart-item" id="elevate-cart-item-' + course.id + '"&gt;';
          course_output += '&lt;span class="icon-du-cancel" data-elevateid="' + course.id + '"&gt;&lt;/span&gt;';
          course_output += '&lt;span class="remove-me-text" data-elevateid="' + course.id + '"&gt;' + 'Remove' + '&lt;/span&gt;';
          course_output += '&lt;div class="elevate-cart-item-info"&gt;&lt;strong&gt;' + course.name + '&lt;/strong&gt;';
          course_output += '&lt;div class="elevate-cart-item-info-details"&gt;&lt;span class="elevate-cart-price"&gt;$' + course.price.toFixed(2) + '&lt;/span&gt;';
          course_output += '&lt;span class="elevate-cart-date"&gt;' + course_date_updated.join(' - ') + '&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;';

          // Course total.
          course_total += parseFloat(course.price);

          // Course link.
          course_link += 'id' + course_link_count + '=' + course.id + '&amp;';
          course_link_count++;
        });
        $('#elevate-cart-courses').html(course_output);
        $('#elevate-cart-total span').html('$' + course_total.toFixed(2));
        $('a#elevate-cart-checkout')
          .prop('href', duElevateDisplayApiUrl + '!solar.qsl.addtocart?' + course_link)
          .show();
      }
      else {
        $('#elevate-cart-courses').html('The cart is empty.');
        $('#elevate-cart-total span').html('$0.00');
        $('a#elevate-cart-checkout')
          .prop('href', duElevateDisplayApiUrl + '!solar.qsl.addtocart?')
          .hide();
      }
      $('a#elevate-checkout-search-courses').prop('href', duElevateDisplayCourseListUrl);
    },
    du_elevate_display_update_cart_number: function (courses) {
      var in_cart = Object.keys(courses).length;
      $('.items-in-cart').html(in_cart);
      if (in_cart &gt; 0) {
        $('.items-in-cart').attr('style', '');
      }
      else {
        $('.items-in-cart').attr('style', 'display: none !important;');
      }
    }
  });

  $(document).on('click', '.elevate-cart-item .icon-du-cancel', function() {
    var id = $(this).data('elevateid');
    if (id) {
      if (confirm('Are you sure you want to remove this course?')) {
        $.du_elevate_display_remove_course(id);
      }
    }
    else {
      alert('Something went wrong.');
    }
  });

  if (Foundation.MediaQuery.current == 'small') {
    $('.elevate-cards-list').find('.js-form-item-search').after('&lt;a class="show-elevate-filters" style="text-transform:uppercase; text-decoration:none; color:#525252; font-size:14px; line-height:1; position:relative; top: -22px; left: 8px;"&gt;Show &lt;/br&gt;Filters&lt;/a&gt;');
    $('.elevate-cards-list .show-elevate-filters').click(function(){
      $('.elevate-cards-list .du-elevate-filters').slideToggle("fast");
    });
  }

  $(document).on('click', '.cart-item a.unit-utility-menu__cart-button', function(e) {
    e.preventDefault();
    $('.meta-navigation li .unit-utility-menu__cart-button').trigger('click');
    $('#unit-main-menu-toggler button').addClass('open');
  });

  // For core/inline functionality, menu systems differ so we bypass a step or two.
  $('.core-utility-menu__cart-button, .core-elevate-wrapper .close-panel, #elevate-cart-show-cart-btn').on('click', function(e) {
    e.preventDefault();
    $('.unit-elevate-cart-popup').toggleClass('expanded');
  });

  // Show the View Cart button as soon as "Add to Cart" has been clicked.
  $('#elevate-cart-btn').on('click', function() {
    $('#elevate-cart-show-cart-btn').show();
  });

  const elevateButtonCheck = () =&gt; {
    $('#elevate-cart-courses').children().length &gt; 0 ? $('#elevate-cart-show-cart-btn').show() : $('#elevate-cart-show-cart-btn').hide();
  }
})(jQuery, Drupal, drupalSettings);
;
</pre></body></html>