/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (function() { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./admin/assets/js/components/pixelio_cart_abandon_recovery_more_update_popup.js":
/*!***************************************************************************************!*\
  !*** ./admin/assets/js/components/pixelio_cart_abandon_recovery_more_update_popup.js ***!
  \***************************************************************************************/
/***/ (function() {

eval("(function ($) {\n  const STORAGE_KEY = 'pixelio_update_popup_hidden_until';\n  $(document).on('click', '.pixelio-cart-abandon-recovery-more-close-update-popup', function (e) {\n    e.preventDefault();\n    localStorage.setItem(STORAGE_KEY, Date.now() + 60 * 60 * 1000 // 1 heure\n    );\n    $('#pixelio-cart-abandon-recovery-more-update-popup-container').fadeOut(200);\n  });\n  $(function () {\n    const hiddenUntil = parseInt(localStorage.getItem(STORAGE_KEY) || '0', 10);\n    if (hiddenUntil > Date.now()) {\n      $('#pixelio-cart-abandon-recovery-more-update-popup-container').hide();\n    }\n  });\n})(jQuery);\n\n//# sourceURL=webpack://pixelio-cart-abandon-recovery-more/./admin/assets/js/components/pixelio_cart_abandon_recovery_more_update_popup.js?");

/***/ }),

/***/ "./admin/assets/js/pages/pixelio_cart_abandon_recovery_more_admin_rgpd.js":
/*!********************************************************************************!*\
  !*** ./admin/assets/js/pages/pixelio_cart_abandon_recovery_more_admin_rgpd.js ***!
  \********************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _components_pixelio_cart_abandon_recovery_more_update_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/pixelio_cart_abandon_recovery_more_update_popup */ \"./admin/assets/js/components/pixelio_cart_abandon_recovery_more_update_popup.js\");\n/* harmony import */ var _components_pixelio_cart_abandon_recovery_more_update_popup__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_components_pixelio_cart_abandon_recovery_more_update_popup__WEBPACK_IMPORTED_MODULE_0__);\n\njQuery(function ($) {\n  const table = $('#pixelio-rgpd-table');\n  if (table.length && $.fn.DataTable) {\n    table.DataTable({\n      order: [[3, 'desc']],\n      pageLength: 25\n    });\n  }\n  function showLoader() {\n    $('#pixelio-cart-abandon-recovery-more-loader-overlay').css('display', 'flex');\n  }\n  function hideLoader() {\n    $('#pixelio-cart-abandon-recovery-more-loader-overlay').hide();\n  }\n  function runRgpdAction(action, contactId, confirmMessage) {\n    if (!window.confirm(confirmMessage)) {\n      return;\n    }\n    console.log(action, contactId);\n    showLoader();\n    $.post(pixelioRgpd.ajaxUrl, {\n      action: action,\n      contact_id: contactId,\n      nonce: pixelioRgpd.nonce\n    }).done(function (response) {\n      if (!response || !response.success) {\n        alert(response?.data?.message || 'Unexpected error.');\n        return;\n      }\n      if (action === 'pixelio_rgpd_export_contact') {\n        const blob = new Blob([JSON.stringify(response.data, null, 2)], {\n          type: 'application/json'\n        });\n        const url = URL.createObjectURL(blob);\n        const link = document.createElement('a');\n        link.href = url;\n        link.download = 'rivio-gdpr-export-contact-' + contactId + '.json';\n        document.body.appendChild(link);\n        link.click();\n        document.body.removeChild(link);\n        URL.revokeObjectURL(url);\n        return;\n      }\n      alert(response.data.message || 'Done.');\n      window.location.reload();\n    }).fail(function () {\n      alert('Request failed.');\n    }).always(function () {\n      hideLoader();\n    });\n  }\n  $(document).on('click', '.pixelio-rgpd-export', function () {\n    runRgpdAction('pixelio_rgpd_export_contact', $(this).data('contact-id'), 'Export all personal data for this contact?');\n  });\n  $(document).on('click', '.pixelio-rgpd-unsubscribe', function () {\n    runRgpdAction('pixelio_rgpd_unsubscribe_contact', $(this).data('contact-id'), 'Unsubscribe this contact from all marketing emails?');\n  });\n  $(document).on('click', '.pixelio-rgpd-anonymize', function () {\n    runRgpdAction('pixelio_rgpd_anonymize_contact', $(this).data('contact-id'), 'Anonymize this contact? This action cannot be undone.');\n  });\n});\n\n//# sourceURL=webpack://pixelio-cart-abandon-recovery-more/./admin/assets/js/pages/pixelio_cart_abandon_recovery_more_admin_rgpd.js?");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// 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 });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	var __webpack_exports__ = __webpack_require__("./admin/assets/js/pages/pixelio_cart_abandon_recovery_more_admin_rgpd.js");
/******/ 	
/******/ })()
;