/* Minification failed. Returning unminified contents.
(96,48-49): run-time error JS1195: Expected expression: )
(96,51-52): run-time error JS1195: Expected expression: >
(121,19-20): run-time error JS1014: Invalid character: `
(121,54-55): run-time error JS1004: Expected ';': {
(121,78-79): run-time error JS1195: Expected expression: /
(121,87-88): run-time error JS1014: Invalid character: `
(125,3-4): run-time error JS1002: Syntax error: }
(138,55-56): run-time error JS1004: Expected ';': {
(143,8-9): run-time error JS1195: Expected expression: )
(150,67-68): run-time error JS1004: Expected ';': {
(157,48-49): run-time error JS1195: Expected expression: )
(157,51-52): run-time error JS1195: Expected expression: >
(227,2-3): run-time error JS1195: Expected expression: )
(229,8-9): run-time error JS1195: Expected expression: )
(236,67-68): run-time error JS1004: Expected ';': {
(498,8-9): run-time error JS1195: Expected expression: )
(505,55-56): run-time error JS1004: Expected ';': {
(509,8-9): run-time error JS1195: Expected expression: )
 */
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = "./Source/Evoqua.Web/Scripts/src/templates/ODP.js");
/******/ })
/************************************************************************/
/******/ ({

/***/ "./Source/Evoqua.Web/Scripts/src/integrations/ODP/init.js":
/*!****************************************************************!*\
  !*** ./Source/Evoqua.Web/Scripts/src/integrations/ODP/init.js ***!
  \****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

document.addEventListener("DOMContentLoaded", () => {
  var zaius = window['zaius'] || (window['zaius'] = []);
  zaius.methods = ['initialize', 'onload', 'customer', 'entity', 'event', 'subscribe', 'unsubscribe', 'consent', 'identify', 'anonymize', 'dispatch'];

  // build queueing methods
  zaius.factory = function (method) {
    return function() {
      var args = Array.prototype.slice.call(arguments);
      args.unshift(method);
      zaius.push(args);
      return zaius;
    };
  };

  (function() {
    for (var i = 0; i < zaius.methods.length; i++) {
      var method = zaius.methods[i];
      zaius[method] = zaius.factory(method);
    }

    let odpElement = document.getElementById('odp');
    var script   = document.createElement('script');
    script.type  = 'text/javascript';
    script.async = true;
    script.src   = ('https:' === document.location.protocol ? 'https://' : 'http://') +
                  `d1igp3oop3iho5.cloudfront.net/v2/${odpElement.dataset.key}/zaius.js`;

    var firstScript = document.getElementsByTagName('script')[0];
    firstScript.parentNode.insertBefore(script, firstScript);
  })();

  // Edits to this script should only be made below this line.
  zaius.event('pageview');
});

/***/ }),

/***/ "./Source/Evoqua.Web/Scripts/src/integrations/ODP/main.js":
/*!****************************************************************!*\
  !*** ./Source/Evoqua.Web/Scripts/src/integrations/ODP/main.js ***!
  \****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(/*! ./init */ "./Source/Evoqua.Web/Scripts/src/integrations/ODP/init.js");
__webpack_require__(/*! ./on-site-tracking */ "./Source/Evoqua.Web/Scripts/src/integrations/ODP/on-site-tracking.js");

/***/ }),

/***/ "./Source/Evoqua.Web/Scripts/src/integrations/ODP/on-site-tracking.js":
/*!****************************************************************************!*\
  !*** ./Source/Evoqua.Web/Scripts/src/integrations/ODP/on-site-tracking.js ***!
  \****************************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./Source/Evoqua.Web/Scripts/src/integrations/ODP/utils.js");


document.addEventListener("DOMContentLoaded", () => {

    // Product detail page (PDP) view
    if (document.getElementById('product-detail-page-odp')) {
        let element = document.getElementById('material-number');
        let materialCode = element.dataset.material;

        let eventPayload = { 
            action: 'detail',
            product_id: materialCode,
            event_customer_id: _utils__WEBPACK_IMPORTED_MODULE_0__["GetSiteUserId"](),
            event_commerce_cloud_id: _utils__WEBPACK_IMPORTED_MODULE_0__["GetCustomerContactId"](),
            event_email: _utils__WEBPACK_IMPORTED_MODULE_0__["GetSiteUserEmail"]()
        }

        zaius.event('product', eventPayload);
    }

    // Checkout start for guest users
    if (document.getElementById('checkout-billing')) {
        let eventPayload = { 
            action: 'start',
            event_customer_id: _utils__WEBPACK_IMPORTED_MODULE_0__["GetSiteUserId"](),
            event_commerce_cloud_id: _utils__WEBPACK_IMPORTED_MODULE_0__["GetCustomerContactId"](),
            event_email: _utils__WEBPACK_IMPORTED_MODULE_0__["GetSiteUserEmail"]()
        }

        zaius.event('checkout', eventPayload);
    }

    // Checkout start for single page checkout (Authenticated users)
    if (document.getElementById('checkout-single')) {
        let eventPayload = { 
            action: 'start',
            event_customer_id: _utils__WEBPACK_IMPORTED_MODULE_0__["GetSiteUserId"](),
            event_commerce_cloud_id: _utils__WEBPACK_IMPORTED_MODULE_0__["GetCustomerContactId"](),
            event_email: _utils__WEBPACK_IMPORTED_MODULE_0__["GetSiteUserEmail"]()
        }

        zaius.event('checkout', eventPayload);
    }
    
    // Checkout complete
    if (document.getElementById('checkout-confirmation'))
    {
        let eventPayload = { 
            action: 'complete',
            event_customer_id: _utils__WEBPACK_IMPORTED_MODULE_0__["GetSiteUserId"](),
            event_commerce_cloud_id: _utils__WEBPACK_IMPORTED_MODULE_0__["GetCustomerContactId"](),
            event_email: _utils__WEBPACK_IMPORTED_MODULE_0__["GetSiteUserEmail"]()
        }

        zaius.event('checkout', eventPayload);
    }

    // Track signout
    if (document.getElementById('sign-out'))
    {
        let eventPayload = { 
            action: 'logout',
            event_customer_id: _utils__WEBPACK_IMPORTED_MODULE_0__["GetSiteUserId"](),
            event_commerce_cloud_id: _utils__WEBPACK_IMPORTED_MODULE_0__["GetCustomerContactId"](),
            event_email: _utils__WEBPACK_IMPORTED_MODULE_0__["GetSiteUserEmail"]()
        }

        document.getElementById('sign-out')
        .addEventListener('click', function (event) {
            zaius.event('account', eventPayload);
        });
    }
});

/***/ }),

/***/ "./Source/Evoqua.Web/Scripts/src/integrations/ODP/utils.js":
/*!*****************************************************************!*\
  !*** ./Source/Evoqua.Web/Scripts/src/integrations/ODP/utils.js ***!
  \*****************************************************************/
/*! exports provided: TrackAddToWishlist, TrackRemoveFromWishlist, TrackCreateWishListFromQuickCart, TrackAddFromCartToWishlist, TrackAddFromWishlistToCart, TrackAddMaterialFromWishlistToCart, TrackAddToCartFromWishlist, TrackAddToCart, TrackRemoveFromCart, TrackSearch, TrackSearchSorting, TrackSearchFilter, TrackLogin, TrackRegister, TrackCustomerInformation, TrackCustomerChangeMarketInformation, GetCustomerContactId, GetSiteUserId, GetSiteUserEmail, GetSalesOrganization, GetDistChannel, GetMarket */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackAddToWishlist", function() { return TrackAddToWishlist; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackRemoveFromWishlist", function() { return TrackRemoveFromWishlist; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackCreateWishListFromQuickCart", function() { return TrackCreateWishListFromQuickCart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackAddFromCartToWishlist", function() { return TrackAddFromCartToWishlist; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackAddFromWishlistToCart", function() { return TrackAddFromWishlistToCart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackAddMaterialFromWishlistToCart", function() { return TrackAddMaterialFromWishlistToCart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackAddToCartFromWishlist", function() { return TrackAddToCartFromWishlist; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackAddToCart", function() { return TrackAddToCart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackRemoveFromCart", function() { return TrackRemoveFromCart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackSearch", function() { return TrackSearch; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackSearchSorting", function() { return TrackSearchSorting; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackSearchFilter", function() { return TrackSearchFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackLogin", function() { return TrackLogin; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackRegister", function() { return TrackRegister; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackCustomerInformation", function() { return TrackCustomerInformation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackCustomerChangeMarketInformation", function() { return TrackCustomerChangeMarketInformation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetCustomerContactId", function() { return GetCustomerContactId; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetSiteUserId", function() { return GetSiteUserId; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetSiteUserEmail", function() { return GetSiteUserEmail; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetSalesOrganization", function() { return GetSalesOrganization; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetDistChannel", function() { return GetDistChannel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetMarket", function() { return GetMarket; });
// ==================================================================
// Tracking Utils
// ==================================================================
function TrackAddToWishlist(materialCode, wishlist) {
    let eventPayload = { 
        action: 'add_to_wishlist',
        wishlist_name: wishlist,
        product_id: materialCode,
        event_customer_id: GetSiteUserId(),
        event_commerce_cloud_id: GetCustomerContactId(),
        event_email: GetSiteUserEmail()
    }
    zaius.event('product', eventPayload);
}

function TrackRemoveFromWishlist(materialCode, wishlist) {
    let eventPayload = { 
        action: 'remove_from_wishlist', 
        product_id: materialCode,
        wishlist_name: wishlist,
        event_customer_id: GetSiteUserId(),
        event_commerce_cloud_id: GetCustomerContactId(),
        event_email: GetSiteUserEmail()
    }
    zaius.event('product', eventPayload);
}

function TrackCreateWishListFromQuickCart(materialCode, wishlist) {
    let eventPayload = { 
        action: 'create_wishlist_from_quick_cart',
        product_id: materialCode,
        wishlist_name: wishlist,
        create_wishlist_from_quick_cart_name: wishlist,
        create_wishlist_from_quick_cart_material: materialCode,
        event_customer_id: GetSiteUserId(),
        event_commerce_cloud_id: GetCustomerContactId(),
        event_email: GetSiteUserEmail()
    }
    zaius.event('product', eventPayload);
}

function TrackAddFromCartToWishlist(wishlist) {
    let eventPayload = { 
        action: 'add_from_cart_to_wishlist', 
        wishlist_name: wishlist,
        product_id: wishlist,
        create_wishlist_from_cart_name: wishlist,
        event_customer_id: GetSiteUserId(),
        event_commerce_cloud_id: GetCustomerContactId(),
        event_email: GetSiteUserEmail()
    }
    zaius.event('product', eventPayload);
}

function TrackAddFromWishlistToCart(wishlist) {
    let eventPayload = { 
        action: 'add_from_wishlist_to_cart', 
        wishlist_name: wishlist,
        product_id: wishlist,
        add_to_cart_from_wishlist_name: wishlist,
        event_customer_id: GetSiteUserId(),
        event_commerce_cloud_id: GetCustomerContactId(),
        event_email: GetSiteUserEmail()
    }
    zaius.event('product', eventPayload);
}

function TrackAddMaterialFromWishlistToCart(wishlist, materialCode) {
    let eventPayload = { 
        action: 'add_material_from_wishlist_to_cart', 
        wishlist_name: wishlist,
        product_id: materialCode,
        add_to_cart_from_wishlist_name: wishlist,
        event_customer_id: GetSiteUserId(),
        event_commerce_cloud_id: GetCustomerContactId(),
        event_email: GetSiteUserEmail()
    }
    zaius.event('product', eventPayload);
}

function TrackAddToCartFromWishlist(materialCode, wishlist) {
    let eventPayload = { 
        action: 'add_to_cart_from_wishlist',
        product_id: materialCode,
        wishlist_name: wishlist,
        create_wishlist_from_quick_cart_name: wishlist,
        create_wishlist_from_quick_cart_material: materialCode,
        event_customer_id: GetSiteUserId(),
        event_commerce_cloud_id: GetCustomerContactId(),
        event_email: GetSiteUserEmail()
    }
    zaius.event('product', eventPayload);
}

function TrackAddToCart(materialCode) {
    let eventPayload = { 
        action: 'add_to_cart', 
        product_id: materialCode,
        event_customer_id: GetSiteUserId(),
        event_commerce_cloud_id: GetCustomerContactId(),
        event_email: GetSiteUserEmail()
    }

    zaius.event('product', eventPayload);
}

function TrackRemoveFromCart(materialCode) {
    let eventPayload = { 
        action: 'remove_from_cart', 
        product_id: materialCode,
        event_customer_id: GetSiteUserId(),
        event_commerce_cloud_id: GetCustomerContactId(),
        event_email: GetSiteUserEmail()
    }

    zaius.event('product', eventPayload);
}

function TrackSearch(searchTerm,category) {
    let eventPayload = {
        action: 'search',
        search_term: searchTerm,
        category: category
    }

    zaius.event('navigation', eventPayload);
}

function TrackSearchSorting() {
    let eventPayload = {
        action: 'sort'
    }

    zaius.event('navigation', eventPayload);
}

function TrackSearchFilter() {
    let eventPayload = {
        action: 'filter'
    }

    zaius.event('navigation', eventPayload);
}

function TrackLogin(email, siteUserId, customerContactId) {
    let eventPayload = {  
        action: "login",
        event_customer_id: siteUserId,
        event_commerce_cloud_id: customerContactId,
        event_email: email
    }
    
    zaius.event('customer', eventPayload);
    zaius.customer("update customer info");
}

function TrackRegister(email, siteUserId, customerContactId) {
    let eventPayload = {  
        action: "register",
        event_customer_id: siteUserId,
        event_commerce_cloud_id: customerContactId,
        event_email: email
    }
    
    zaius.event('customer', eventPayload);
}

function TrackCustomerInformation(email, siteUserId, customerContactId, salesOrg, distChannel, market){
    let existingUserInformation = {
        customer_id: siteUserId ? siteUserId : GetSiteUserId(),
        commerce_cloud_id: customerContactId ? customerContactId : customerContactId(),
        email: email ? email : GetSiteUserEmail()
    };
    let customUserInformation = {
        sales_organization: salesOrg ? salesOrg : GetSalesOrganization(),
        distribution_channel: distChannel ? distChannel : GetDistChannel(),
        market: market ? market : GetMarket()
    }

    zaius.customer(existingUserInformation, customUserInformation);
}

function TrackCustomerChangeMarketInformation(marketId){
    let existingUserInformation = {
        customer_id: GetSiteUserId(),
        commerce_cloud_id: GetCustomerContactId(),
        email: GetSiteUserEmail()
    };
    let customUserInformation = {
        sales_organization: GetSalesOrganization(),
        distribution_channel: GetDistChannel(),
        market: marketId
    }

    zaius.customer(existingUserInformation, customUserInformation);
}

// ==================================================================
// DOM Utils
// ==================================================================
function GetCustomerContactId(){
    let userIdElem = document.getElementById('user-info');

    return userIdElem.dataset.customerContactId;
}

function GetSiteUserId(){
    let userIdElem = document.getElementById('user-info');

    return userIdElem.dataset.siteUserId;
}

function GetSiteUserEmail(){
    let userIdElem = document.getElementById('user-info');

    return userIdElem.dataset.email;
}

function GetSalesOrganization(){
    let userIdElem = document.getElementById('user-info');

    return userIdElem.dataset.salesOrg;
}

function GetDistChannel(){
    let userIdElem = document.getElementById('user-info');

    return userIdElem.dataset.distChannel;
}

function GetMarket(){
    let userIdElem = document.getElementById('user-info');

    return userIdElem.dataset.market;
}

/***/ }),

/***/ "./Source/Evoqua.Web/Scripts/src/templates/ODP.js":
/*!********************************************************!*\
  !*** ./Source/Evoqua.Web/Scripts/src/templates/ODP.js ***!
  \********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(/*! ../integrations/ODP/main */ "./Source/Evoqua.Web/Scripts/src/integrations/ODP/main.js");

/***/ })

/******/ });
//# sourceMappingURL=ODP.bundle.js.map;
