/******/ (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 = "./assets/src/js/dokan-pro.js");
/******/ })
/************************************************************************/
/******/ ({

/***/ "./assets/src/js/announcement.js":
/*!***************************************!*\
  !*** ./assets/src/js/announcement.js ***!
  \***************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("// For Announcement scripts;\n(function ($) {\n  $(document).ready(function () {\n    $('.dokan-announcement-wrapper').on('click', 'a.remove_announcement', function (e) {\n      e.preventDefault();\n\n      if (confirm(dokan.delete_confirm)) {\n        var self = $(this),\n            data = {\n          'action': 'dokan_announcement_remove_row',\n          'row_id': self.data('notice_row'),\n          '_wpnonce': dokan.nonce\n        };\n        self.closest('.dokan-announcement-wrapper-item').append('<span class=\"dokan-loading\" style=\"position:absolute;top:2px; right:15px\"> </span>');\n        var row_count = $('.dokan-announcement-wrapper-item').length;\n        $.post(dokan.ajaxurl, data, function (response) {\n          if (response.success) {\n            self.closest('.dokan-announcement-wrapper-item').find('span.dokan-loading').remove();\n            self.closest('.dokan-announcement-wrapper-item').fadeOut(function () {\n              $(this).remove();\n\n              if (row_count == 1) {\n                $('.dokan-announcement-wrapper').html(response.data);\n              }\n            });\n          } else {\n            alert(dokan.wrong_message);\n          }\n        });\n      }\n    });\n  });\n})(jQuery);\n\n//# sourceURL=webpack:///./assets/src/js/announcement.js?");

/***/ }),

/***/ "./assets/src/js/coupon.js":
/*!*********************************!*\
  !*** ./assets/src/js/coupon.js ***!
  \*********************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("// Coupon\n(function ($) {\n  $.validator.setDefaults({\n    ignore: \":hidden\"\n  });\n\n  var validatorError = function validatorError(error, element) {\n    var form_group = $(element).closest('.form-group');\n    form_group.addClass('has-error').append(error);\n  };\n\n  var validatorSuccess = function validatorSuccess(label, element) {\n    $(element).closest('.form-group').removeClass('has-error');\n  };\n\n  var Dokan_Coupons = {\n    init: function init() {\n      var self = this;\n      this.couponsValidation(self);\n      $('select#discount_type').on('change', this.type_options).change();\n    },\n    couponsValidation: function couponsValidation(self) {\n      $(\"form.coupons\").validate({\n        errorElement: 'span',\n        errorClass: 'error',\n        errorPlacement: validatorError,\n        success: validatorSuccess\n      });\n    },\n    type_options: function type_options() {\n      // Get value\n      var select_val = $(this).val();\n\n      if (select_val.indexOf('percent') >= 0) {\n        $('#coupon_amount').removeClass('wc_input_price').addClass('wc_input_decimal');\n      } else {\n        $('#coupon_amount').removeClass('wc_input_decimal').addClass('wc_input_price');\n      }\n    }\n  };\n  Dokan_Coupons.init();\n})(jQuery);\n\n//# sourceURL=webpack:///./assets/src/js/coupon.js?");

/***/ }),

/***/ "./assets/src/js/dokan-pro.js":
/*!************************************!*\
  !*** ./assets/src/js/dokan-pro.js ***!
  \************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _less_dokan_pro_less__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../less/dokan-pro.less */ \"./assets/src/less/dokan-pro.less\");\n/* harmony import */ var _less_dokan_pro_less__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_less_dokan_pro_less__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _announcement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./announcement */ \"./assets/src/js/announcement.js\");\n/* harmony import */ var _announcement__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_announcement__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _coupon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./coupon */ \"./assets/src/js/coupon.js\");\n/* harmony import */ var _coupon__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_coupon__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _inline_editable_table__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inline-editable-table */ \"./assets/src/js/inline-editable-table.js\");\n/* harmony import */ var _inline_editable_table__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_inline_editable_table__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _product_variation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./product-variation */ \"./assets/src/js/product-variation.js\");\n/* harmony import */ var _product_variation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_product_variation__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _product__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./product */ \"./assets/src/js/product.js\");\n/* harmony import */ var _product__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_product__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _reviews__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./reviews */ \"./assets/src/js/reviews.js\");\n/* harmony import */ var _reviews__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_reviews__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _reviews_min__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./reviews.min */ \"./assets/src/js/reviews.min.js\");\n/* harmony import */ var _reviews_min__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_reviews_min__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _shipping__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./shipping */ \"./assets/src/js/shipping.js\");\n/* harmony import */ var _shipping__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_shipping__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _store_lists__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./store-lists */ \"./assets/src/js/store-lists.js\");\n/* harmony import */ var _store_seo__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./store-seo */ \"./assets/src/js/store-seo.js\");\n/* harmony import */ var _store_seo__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_seo__WEBPACK_IMPORTED_MODULE_10__);\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./assets/src/js/dokan-pro.js?");

/***/ }),

/***/ "./assets/src/js/inline-editable-table.js":
/*!************************************************!*\
  !*** ./assets/src/js/inline-editable-table.js ***!
  \************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("jQuery(document).ready(function ($) {\n  'use strict';\n\n  function InlineEditableTable(table) {\n    this.$table = $(table);\n    this.current_tr = null;\n    this.current_tr_posX = 0;\n    this.edit_form = null;\n    this.current_product_id = 0;\n    this.bindElements();\n  }\n\n  InlineEditableTable.prototype.bindElements = function () {\n    var self = this;\n    self.$table.on('click', '.item-inline-edit', function (e) {\n      e.preventDefault();\n\n      if (!dokan.is_vendor_enabled) {\n        return alert(dokan.not_enable_message);\n      }\n\n      self.$table.find('tr.dokan-product-list-inline-edit-form').addClass('dokan-hide');\n      var anchor = $(this).children('a');\n      self.current_product_id = anchor.data('product-id');\n      self.current_tr = anchor.parents('tr');\n      self.current_tr_posX = self.current_tr.offset().top;\n      self.current_tr.addClass('dokan-hide');\n      self.edit_form = self.current_tr.next('.dokan-product-list-inline-edit-form');\n      self.edit_form.removeClass('dokan-hide');\n      self.bindSelect2();\n      self.scrollTop();\n    });\n    self.$table.on('click', '.inline-edit-cancel', function (e) {\n      e.preventDefault();\n      self.current_tr.removeClass('dokan-hide').next('.dokan-product-list-inline-edit-form').addClass('dokan-hide');\n      self.scrollTop();\n    });\n    self.$table.on('click', '.inline-edit-update', function (e) {\n      e.preventDefault();\n      var btn = $(this),\n          wrapper = btn.parent(),\n          fieldset = btn.parents('fieldset');\n      wrapper.addClass('show-loading-animation');\n      fieldset.attr('disabled', 'disabled');\n      var data = {};\n      self.edit_form.find('[data-field-name]').each(function () {\n        if ($(this).attr('type') === 'checkbox') {\n          data[$(this).data('field-name')] = $(this).is(':checked');\n        } else {\n          data[$(this).data('field-name')] = $(this).val();\n        }\n      });\n      $.ajax({\n        url: dokan.ajaxurl,\n        method: 'post',\n        dataType: 'json',\n        data: {\n          action: 'dokan_product_inline_edit',\n          security: dokan.product_inline_edit_nonce,\n          data: data\n        }\n      }).done(function (response) {\n        if (response.data && response.data.row) {\n          self.scrollTop(self.current_tr);\n          self.edit_form.addClass('dokan-hide').prev().replaceWith(response.data.row);\n        }\n      }).fail(function (response) {\n        if (response.responseJSON && typeof response.responseJSON.data === 'string') {\n          alert(response.responseJSON.data);\n        }\n      }).always(function () {\n        wrapper.removeClass('show-loading-animation');\n        fieldset.removeAttr('disabled');\n      });\n    });\n    self.$table.on('click', '[data-field-toggler]', function (e) {\n      var name = $(this).data('field-name'),\n          is_checked = $(this).is(':checked');\n      self.edit_form.find('[data-field-toggle=\"' + name + '\"]').each(function () {\n        var el = $(this);\n        var compare_value = el.data('field-show-on');\n\n        if (is_checked == compare_value) {\n          // not comparing data type\n          el.removeClass('dokan-hide');\n        } else {\n          el.addClass('dokan-hide');\n        }\n\n        el.find('.dokan-select2').select2('destroy').removeClass('dokan-select2');\n        self.bindSelect2();\n      });\n    });\n  };\n\n  InlineEditableTable.prototype.bindSelect2 = function () {\n    this.edit_form.find('select:not(.dokan-select2)').addClass('dokan-select2').select2();\n  };\n\n  InlineEditableTable.prototype.scrollTop = function () {\n    $('html, body').scrollTop(this.current_tr_posX - 50);\n  };\n\n  $('.dokan-inline-editable-table').each(function () {\n    new InlineEditableTable(this);\n  });\n});\n\n//# sourceURL=webpack:///./assets/src/js/inline-editable-table.js?");

/***/ }),

/***/ "./assets/src/js/product-variation.js":
/*!********************************************!*\
  !*** ./assets/src/js/product-variation.js ***!
  \********************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("/* global wp, dokan, dokan_refund, accounting */\njQuery(function ($) {\n  /**\n   * Variations actions\n   */\n  var Dokan_Product_Variation_Actions = {\n    /**\n     * Initialize variations actions\n     */\n    init: function init() {\n      $('#dokan-variable-product-options').on('change', 'input.variable_is_downloadable', this.variable_is_downloadable).on('change', 'input.variable_is_virtual', this.variable_is_virtual).on('change', 'input.variable_manage_stock', this.variable_manage_stock).on('click', '.expand_all', this.expand_all).on('click', '.close_all', this.close_all) // .on( 'click', 'button.notice-dismiss', this.notice_dismiss )\n      .on('click', '.dokan-product-variation-itmes .sort', this.set_menu_order).on('reload', this.reload);\n      $('input.variable_is_downloadable, input.variable_is_virtual, input.variable_manage_stock').change();\n      $('.dokan-product-variation-wrapper').on('dokan_variations_loaded', this.variations_loaded);\n      $(document.body).on('dokan_variations_added', this.variation_added);\n      this.variation_toggle_init();\n    },\n\n    /**\n     * Reload UI\n     *\n     * @param {Object} event\n     * @param {Int} qty\n     */\n    reload: function reload() {\n      Dokan_Product_Variation_Ajax.load_variations(1);\n      Dokan_Product_Variation_PageNav.set_paginav(0);\n    },\n\n    /**\n     * Check if variation is downloadable and show/hide elements\n     */\n    variable_is_downloadable: function variable_is_downloadable() {\n      $(this).closest('.dokan-product-variation-itmes').find('.show_if_variation_downloadable').hide();\n\n      if ($(this).is(':checked')) {\n        $(this).closest('.dokan-product-variation-itmes').find('.show_if_variation_downloadable').show();\n      }\n    },\n\n    /**\n     * Check if variation is virtual and show/hide elements\n     */\n    variable_is_virtual: function variable_is_virtual() {\n      $(this).closest('.dokan-product-variation-itmes').find('.hide_if_variation_virtual').show();\n\n      if ($(this).is(':checked')) {\n        $(this).closest('.dokan-product-variation-itmes').find('.hide_if_variation_virtual').hide();\n      }\n    },\n\n    /**\n     * Check if variation manage stock and show/hide elements\n     */\n    variable_manage_stock: function variable_manage_stock() {\n      $(this).closest('.dokan-product-variation-itmes').find('.show_if_variation_manage_stock').hide();\n\n      if ($(this).is(':checked')) {\n        $(this).closest('.dokan-product-variation-itmes').find('.show_if_variation_manage_stock').show();\n      }\n    },\n    expand_all: function expand_all(e) {\n      $(this).closest('#dokan-variable-product-options-inner').find('.dokan-product-variation-itmes > .dokan-variable-attributes').show();\n      return false;\n    },\n    close_all: function close_all(e) {\n      $(this).closest('#dokan-variable-product-options-inner').find('.dokan-product-variation-itmes > .dokan-variable-attributes').hide();\n      return false;\n    },\n    variation_toggle_init: function variation_toggle_init() {\n      $('.dokan-attribute-variation-options').on('click', 'h3.variation-topbar-heading', function (e) {\n        e.preventDefault();\n        var self = $(this);\n        self.closest('.dokan-product-variation-itmes').find('.dokan-variable-attributes').slideToggle(300, function () {\n          if ($(this).is(':visible')) {\n            self.closest('.dokan-product-variation-itmes').find('i.fa-sort-desc').removeClass('fa-flip-horizointal').addClass('fa-flip-vertical');\n          } else {\n            self.closest('.dokan-product-variation-itmes').find('i.fa-sort-desc').removeClass('fa-flip-vertical').addClass('fa-flip-horizointal');\n          }\n        });\n      });\n      $('.dokan-attribute-variation-options').on('click', '.toggle-variation-content', function (e) {\n        e.preventDefault();\n        var self = $(this);\n        self.closest('.dokan-product-variation-itmes').find('.dokan-variable-attributes').slideToggle(300, function () {\n          if ($(this).is(':visible')) {\n            self.removeClass('fa-flip-horizointal').addClass('fa-flip-vertical');\n          } else {\n            self.removeClass('fa-flip-vertical').addClass('fa-flip-horizointal');\n          }\n        });\n        return false;\n      });\n    },\n\n    /**\n     * Run actions when variations is loaded\n     *\n     * @param {Object} event\n     * @param {Int} needsUpdate\n     */\n    variations_loaded: function variations_loaded(event, needsUpdate) {\n      needsUpdate = needsUpdate || false;\n      var wrapper = $('.dokan-attribute-variation-options');\n\n      if (!needsUpdate) {\n        // Show/hide downloadable, virtual and stock fields\n        $('input.variable_is_downloadable, input.variable_is_virtual, input.variable_manage_stock', wrapper).change(); // Open sale schedule fields when have some sale price date\n\n        $('.dokan-product-variation-itmes', wrapper).each(function (index, el) {\n          var $el = $(el),\n              date_from = $('.sale_price_dates_from', $el).val(),\n              date_to = $('.sale_price_dates_to', $el).val();\n\n          if ('' !== date_from || '' !== date_to) {\n            $('a.sale_schedule', $el).click();\n          }\n        }); // Remove variation-needs-update classes\n\n        $('.dokan-variations-container .variation-needs-update', wrapper).removeClass('variation-needs-update'); // Disable cancel and save buttons\n\n        $('button.cancel-variation-changes, button.save-variation-changes', wrapper).attr('disabled', 'disabled');\n      }\n\n      $('.tips').tooltip(); // disable saving button for variable product\n\n      function dokan_disable_variable_saving_button($element) {\n        if (Number($element.closest('.variable_pricing').find('span.vendor-price').text()) < 0) {\n          $element.closest('.variable_pricing').find('.save-variation-changes').attr('disabled', 'disabled');\n          $element.closest('.variable_pricing').find('.dokan-product-less-price-alert').removeClass('dokan-hide');\n          $('input[type=submit]').attr('disabled', 'disabled');\n        } else {\n          $element.closest('.variable_pricing').find('.dokan-product-less-price-alert').addClass('dokan-hide');\n          $element.closest('.variable_pricing').find('.save-variation-changes').removeAttr('disabled');\n          $('input[type=submit]').removeAttr('disabled');\n        }\n      } // variable product price error checking\n\n\n      function dokan_show_variable_product_earning_suggestion(callback) {\n        var selectedCategoryWrapper = $('select#product_cat').find('option:selected');\n\n        if (selectedCategoryWrapper.data('commission') != '') {\n          var commission = selectedCategoryWrapper.data('commission');\n          var product_id = selectedCategoryWrapper.data('product-id');\n        } else {\n          var commission = $('span.vendor-earning').data('commission');\n          var product_id = $('span.vendor-earning').data('product-id');\n        }\n\n        if ($('input.dokan-product-sales-price-variable').val() == '') {\n          $('input.dokan-product-regular-price-variable').each(function (i, elm) {\n            var $element = $(elm);\n            var earning_suggestion = $element.closest('.content-half-part').find('span.vendor-price');\n            var sale_price = $(this).closest(elm).val();\n            earning_suggestion.html('Calculating');\n            $.get(dokan.ajaxurl, {\n              action: 'get_vendor_earning',\n              product_id: product_id,\n              product_price: sale_price,\n              _wpnonce: dokan.nonce\n            }).done(function (response) {\n              earning_suggestion.html(response);\n              dokan_disable_variable_saving_button($element);\n\n              if (typeof callback === 'function') {\n                callback();\n              }\n            });\n          });\n        } else {\n          $('input.dokan-product-sales-price-variable').each(function (i, elm) {\n            var $element = $(elm);\n            var earning_suggestion = $element.closest('.variable_pricing').find('span.vendor-price');\n            var sale_price = $(this).closest(elm).val();\n            earning_suggestion.html('Calculating');\n            $.get(dokan.ajaxurl, {\n              action: 'get_vendor_earning',\n              product_id: product_id,\n              product_price: sale_price ? sale_price : 0,\n              _wpnonce: dokan.nonce\n            }).done(function (response) {\n              earning_suggestion.html(response);\n              dokan_disable_variable_saving_button($element);\n\n              if (typeof callback === 'function') {\n                callback();\n              }\n            });\n            dokan_disable_variable_saving_button($element);\n          });\n        }\n      }\n\n      $(\"input.dokan-product-regular-price-variable, input.dokan-product-sales-price-variable\").on('keyup', _.debounce(function () {\n        dokan_show_variable_product_earning_suggestion();\n      }, 750)); // Datepicker fields\n\n      $('.dokan-start-date').datepicker({\n        defaultDate: '',\n        dateFormat: 'yy-mm-dd',\n        numberOfMonths: 1,\n        onSelect: function onSelect(selectedDate) {\n          var date = new Date(selectedDate);\n          date.setDate(date.getDate() + 1);\n          $('.dokan-end-date').datepicker('option', {\n            minDate: date\n          });\n        }\n      });\n      $('.dokan-end-date').datepicker({\n        defaultDate: '',\n        dateFormat: 'yy-mm-dd',\n        numberOfMonths: 1,\n        onSelect: function onSelect(selectedDate) {\n          var date = new Date(selectedDate);\n          date.setDate(date.getDate() - 1);\n          $('dokan-start-date').datepicker('option', {\n            maxDate: date\n          });\n        }\n      }); // Allow sorting\n\n      $('.dokan-variations-container', wrapper).sortable({\n        items: '.dokan-product-variation-itmes',\n        cursor: 'move',\n        axis: 'y',\n        handle: '.sort',\n        scrollSensitivity: 40,\n        forcePlaceholderSize: true,\n        helper: 'clone',\n        opacity: 0.65,\n        stop: function stop() {\n          Dokan_Product_Variation_Actions.variation_row_indexes();\n        }\n      });\n    },\n\n    /**\n     * Run actions when added a variation\n     *\n     * @param {Object} event\n     * @param {Int} qty\n     */\n    variation_added: function variation_added(event, qty) {\n      if (1 === qty) {\n        Dokan_Product_Variation_Actions.variations_loaded(null, true);\n      }\n    },\n\n    /**\n     * Lets the user manually input menu order to move items around pages\n     */\n    set_menu_order: function set_menu_order(event) {\n      event.preventDefault();\n      var $menu_order = $(this).closest('.dokan-product-variation-itmes').find('.variation_menu_order');\n      var value = window.prompt(dokan.i18n_enter_menu_order, $menu_order.val());\n\n      if (value != null) {\n        // Set value, save changes and reload view\n        $menu_order.val(parseInt(value, 10)).change();\n        Dokan_Product_Variation_Ajax.save_variations();\n      }\n    },\n\n    /**\n     * Set menu order\n     */\n    variation_row_indexes: function variation_row_indexes() {\n      var wrapper = $('#dokan-variable-product-options').find('.dokan-variations-container'),\n          current_page = parseInt(wrapper.attr('data-page'), 10),\n          offset = parseInt((current_page - 1) * dokan.variations_per_page, 10);\n      $('.dokan-variations-container .dokan-product-variation-itmes').each(function (index, el) {\n        $('.variation_menu_order', el).val(parseInt($(el).index('.dokan-variations-container .dokan-product-variation-itmes'), 10) + 1 + offset).change();\n      });\n    }\n  };\n  /**\n   * Product variations metabox ajax methods\n   */\n\n  var Dokan_Product_Variation_Ajax = {\n    /**\n     * Initialize variations ajax methods\n     */\n    init: function init() {\n      this.load_variations();\n      this.initial_load();\n      $('#dokan-variable-product-options').on('click', 'button.save-variation-changes', this.save_variations).on('click', 'button.cancel-variation-changes', this.cancel_variations).on('click', '.remove_variation', this.remove_variation);\n      $(document.body).on('change', '#dokan-variable-product-options .dokan-variations-container :input', this.input_changed).on('change', '.dokan-variations-defaults select', this.defaults_changed);\n      $('form.dokan-product-edit-form').on('submit', this.save_on_submit);\n      $('#dokan-variable-product-options').on('click', 'a.do_variation_action', this.do_variation_action);\n    },\n\n    /**\n     * Check if have some changes before leave the page\n     *\n     * @return {Bool}\n     */\n    check_for_changes: function check_for_changes() {\n      var need_update = $('#dokan-variable-product-options').find('.dokan-variations-container .variation-needs-update');\n\n      if (0 < need_update.length) {\n        if (window.confirm(dokan.i18n_edited_variations)) {\n          Dokan_Product_Variation_Ajax.save_changes();\n        } else {\n          need_update.removeClass('variation-needs-update');\n          return false;\n        }\n      }\n\n      return true;\n    },\n\n    /**\n     * Block edit screen\n     */\n    block: function block() {\n      $('.dokan-product-variation-wrapper').block({\n        message: null,\n        fadeIn: 100,\n        fadeOut: 2000,\n        overlayCSS: {\n          background: '#fff',\n          opacity: 0.6\n        }\n      });\n    },\n\n    /**\n     * Unblock edit screen\n     */\n    unblock: function unblock() {\n      $('.dokan-product-variation-wrapper').unblock();\n    },\n\n    /**\n     * Initial load variations\n     *\n     * @return {Bool}\n     */\n    initial_load: function initial_load() {\n      if (0 === $('#dokan-variable-product-options').find('.dokan-variations-container .dokan-product-variation-itmes').length) {\n        Dokan_Product_Variation_PageNav.go_to_page();\n      }\n    },\n\n    /**\n     * Load variations via Ajax\n     *\n     * @param {Int} page (default: 1)\n     * @param {Int} per_page (default: 10)\n     */\n    load_variations: function load_variations(page, per_page) {\n      page = page || 1;\n      per_page = per_page || dokan.variations_per_page;\n      var wrapper = $('#dokan-variable-product-options').find('.dokan-variations-container');\n      Dokan_Product_Variation_Ajax.block();\n      $.ajax({\n        url: dokan.ajaxurl,\n        data: {\n          action: 'dokan_load_variations',\n          security: dokan.load_variations_nonce,\n          product_id: $('#dokan-edit-product-id').val(),\n          attributes: wrapper.data('attributes'),\n          page: page,\n          per_page: per_page\n        },\n        type: 'POST',\n        success: function success(response) {\n          wrapper.empty().append(response).attr('data-page', page);\n          $('.dokan-product-variation-wrapper').trigger('dokan_variations_loaded'); // $( '.dokan-product-variation-wrapper' ).trigger( 'dokan_variations_toggle_init' );\n\n          Dokan_Product_Variation_Ajax.unblock();\n        }\n      });\n    },\n\n    /**\n     * Ger variations fields and convert to object\n     *\n     * @param  {Object} fields\n     *\n     * @return {Object}\n     */\n    get_variations_fields: function get_variations_fields(fields) {\n      var data = $(':input', fields).serializeJSON();\n      $('.dokan-variations-defaults select').each(function (index, element) {\n        var select = $(element);\n        data[select.attr('name')] = select.val();\n      });\n      return data;\n    },\n\n    /**\n     * Save variations changes\n     *\n     * @param {Function} callback Called once saving is complete\n     */\n    save_changes: function save_changes(callback) {\n      var wrapper = $('#dokan-variable-product-options').find('.dokan-variations-container'),\n          need_update = $('.variation-needs-update', wrapper),\n          data = {}; // Save only with products need update.\n\n      if (0 < need_update.length) {\n        Dokan_Product_Variation_Ajax.block();\n        data = Dokan_Product_Variation_Ajax.get_variations_fields(need_update);\n        data.action = 'dokan_save_variations';\n        data.security = dokan.save_variations_nonce;\n        data.product_id = $('#dokan-edit-product-id').val();\n        data['product_type'] = $('#product_type').val();\n        $.ajax({\n          url: dokan.ajaxurl,\n          data: data,\n          type: 'POST',\n          success: function success(response) {\n            // Allow change page, delete and add new variations\n            need_update.removeClass('variation-needs-update');\n            $('button.cancel-variation-changes, button.save-variation-changes').attr('disabled', 'disabled');\n            $('.dokan-product-variation-wrapper').trigger('dokan_variations_saved');\n\n            if (typeof callback === 'function') {\n              callback(response);\n            }\n\n            Dokan_Product_Variation_Ajax.unblock();\n          }\n        });\n      }\n    },\n\n    /**\n     * Save variations\n     *\n     * @return {Bool}\n     */\n    save_variations: function save_variations() {\n      $('#dokan-variable-product-options').trigger('dokan_variations_save_variations_button');\n      Dokan_Product_Variation_Ajax.save_changes(function (error) {\n        var wrapper = $('#dokan-variable-product-options').find('.dokan-variations-container'),\n            current = wrapper.attr('data-page');\n        $('#dokan-variable-product-options').find('#dokan_errors').remove();\n\n        if (error) {\n          wrapper.before(error);\n        }\n\n        $('.dokan-variations-defaults select').each(function () {\n          $(this).attr('data-current', $(this).val());\n        });\n        Dokan_Product_Variation_PageNav.go_to_page(current);\n      });\n      return false;\n    },\n\n    /**\n     * Save on post form submit\n     */\n    save_on_submit: function save_on_submit(e) {\n      var need_update = $('#dokan-variable-product-options').find('.dokan-variations-container .variation-needs-update');\n\n      if (0 < need_update.length) {\n        e.preventDefault();\n        $('#dokan-variable-product-options').trigger('dokan_variations_save_variations_on_submit');\n        Dokan_Product_Variation_Ajax.save_changes(Dokan_Product_Variation_Ajax.save_on_submit_done);\n      }\n    },\n\n    /**\n     * After saved, continue with form submission\n     */\n    save_on_submit_done: function save_on_submit_done() {\n      $('form.dokan-product-edit-form').submit();\n    },\n\n    /**\n     * Discart changes.\n     *\n     * @return {Bool}\n     */\n    cancel_variations: function cancel_variations() {\n      var current = parseInt($('#dokan-variable-product-options').find('.dokan-variations-container').attr('data-page'), 10);\n      $('#dokan-variable-product-options').find('.dokan-variations-container .variation-needs-update').removeClass('variation-needs-update');\n      $('.dokan-variations-defaults select').each(function () {\n        $(this).val($(this).attr('data-current'));\n      });\n      Dokan_Product_Variation_PageNav.go_to_page(current);\n      return false;\n    },\n\n    /**\n     * Add variation\n     *\n     * @return {Bool}\n     */\n    add_variation: function add_variation() {\n      Dokan_Product_Variation_Ajax.block();\n      var data = {\n        action: 'dokan_add_variation',\n        post_id: $('#dokan-edit-product-id').val(),\n        loop: $('.dokan-product-variation-itmes').length,\n        security: dokan.add_variation_nonce\n      };\n      $.post(dokan.ajaxurl, data, function (response) {\n        var variation = $(response);\n        variation.addClass('variation-needs-update');\n        $('#dokan-variable-product-options').find('.dokan-variations-container').prepend(variation);\n        $('button.cancel-variation-changes, button.save-variation-changes').removeAttr('disabled');\n        $('.dokan-product-variation-wrapper').trigger('dokan_variations_added', 1);\n        var product_type = $('#product_type').val();\n        var is_virtual = $('input#_virtual:checked').length;\n        var is_downloadable = $('input#_downloadable:checked').length; // Hide/Show all with rules.\n\n        var hide_classes = '.hide_if_downloadable, .hide_if_virtual';\n        var show_classes = '.show_if_downloadable, .show_if_virtual';\n        $.each(['simple', 'external', 'variable', 'grouped', 'subscription', 'variable-subscription'], function (index, value) {\n          hide_classes = hide_classes + ', .hide_if_' + value;\n          show_classes = show_classes + ', .show_if_' + value;\n        });\n        $(hide_classes).show();\n        $(show_classes).hide();\n        $('.show_if_' + product_type).show();\n        $('.hide_if_' + product_type).hide();\n        Dokan_Product_Variation_Ajax.unblock();\n      });\n      return false;\n    },\n\n    /**\n     * Remove variation\n     *\n     * @return {Bool}\n     */\n    remove_variation: function remove_variation(e) {\n      e.preventDefault();\n      Dokan_Product_Variation_Ajax.check_for_changes();\n\n      if (window.confirm(dokan.i18n_remove_variation)) {\n        var variation = $(this).attr('rel'),\n            variation_ids = [],\n            data = {\n          action: 'dokan_remove_variation'\n        };\n        Dokan_Product_Variation_Ajax.block();\n\n        if (0 < variation) {\n          variation_ids.push(variation);\n          data.variation_ids = variation_ids;\n          data.security = dokan.delete_variations_nonce;\n          $.post(dokan.ajaxurl, data, function () {\n            var wrapper = $('#dokan-variable-product-options').find('.dokan-variations-container'),\n                current_page = parseInt(wrapper.attr('data-page'), 10),\n                total_pages = Math.ceil((parseInt(wrapper.attr('data-total'), 10) - 1) / dokan.variations_per_page),\n                page = 1;\n            $('.dokan-product-variation-wrapper').trigger('dokan_variations_removed');\n\n            if (current_page === total_pages || current_page <= total_pages) {\n              page = current_page;\n            } else if (current_page > total_pages && 0 !== total_pages) {\n              page = total_pages;\n            }\n\n            Dokan_Product_Variation_PageNav.go_to_page(page, -1);\n          });\n        } else {\n          Dokan_Product_Variation_Ajax.unblock();\n        }\n      }\n\n      return false;\n    },\n\n    /**\n     * Link all variations (or at least try :p)\n     *\n     * @return {Bool}\n     */\n    link_all_variations: function link_all_variations() {\n      Dokan_Product_Variation_Ajax.check_for_changes();\n\n      if (window.confirm(dokan.i18n_link_all_variations)) {\n        Dokan_Product_Variation_Ajax.block();\n        var data = {\n          action: 'dokan_link_all_variations',\n          post_id: $('#dokan-edit-product-id').val(),\n          security: dokan.link_variation_nonce\n        };\n        $.post(dokan.ajaxurl, data, function (response) {\n          var count = parseInt(response, 10);\n\n          if (1 === count) {\n            window.alert(count + ' ' + dokan.i18n_variation_added);\n          } else if (0 === count || count > 1) {\n            window.alert(count + ' ' + dokan.i18n_variations_added);\n          } else {\n            window.alert(dokan.i18n_no_variations_added);\n          }\n\n          if (count > 0) {\n            Dokan_Product_Variation_PageNav.go_to_page(1, count);\n            $('.dokan-product-variation-wrapper').trigger('dokan_variations_added', count);\n          } else {\n            Dokan_Product_Variation_Ajax.unblock();\n          }\n        });\n      }\n\n      return false;\n    },\n\n    /**\n     * Add new class when have changes in some input\n     */\n    input_changed: function input_changed() {\n      $(this).closest('.dokan-product-variation-itmes').addClass('variation-needs-update');\n      $('button.cancel-variation-changes, button.save-variation-changes').removeAttr('disabled');\n      $('.dokan-product-variation-wrapper').trigger('dokan_variations_input_changed');\n    },\n\n    /**\n     * Added new .variation-needs-update class when defaults is changed\n     */\n    defaults_changed: function defaults_changed() {\n      $(this).closest('#dokan-variable-product-options').find('.dokan-product-variation-itmes:first').addClass('variation-needs-update');\n      $('button.cancel-variation-changes, button.save-variation-changes').removeAttr('disabled');\n      $('#dokan-variable-product-options').trigger('dokan_variations_defaults_changed');\n    },\n\n    /**\n     * Actions\n     */\n    do_variation_action: function do_variation_action() {\n      var do_variation_action = $('select.variation-actions').val(),\n          data = {},\n          changes = 0,\n          value;\n\n      switch (do_variation_action) {\n        case 'add_variation':\n          Dokan_Product_Variation_Ajax.add_variation();\n          return;\n\n        case 'link_all_variations':\n          Dokan_Product_Variation_Ajax.link_all_variations();\n          return;\n\n        case 'delete_all':\n          if (window.confirm(dokan.i18n_delete_all_variations)) {\n            if (window.confirm(dokan.i18n_last_warning)) {\n              data.allowed = true;\n              changes = parseInt($('#dokan-variable-product-options').find('.dokan-variations-container').attr('data-total'), 10) * -1;\n            }\n          }\n\n          break;\n\n        case 'variable_regular_price_increase':\n        case 'variable_regular_price_decrease':\n        case 'variable_sale_price_increase':\n        case 'variable_sale_price_decrease':\n          value = window.prompt(dokan.i18n_enter_a_value_fixed_or_percent);\n\n          if (value != null) {\n            if (value.indexOf('%') >= 0) {\n              data.value = accounting.unformat(value.replace(/\\%/, ''), dokan_refund.mon_decimal_point) + '%';\n            } else {\n              data.value = accounting.unformat(value, dokan_refund.mon_decimal_point);\n            }\n          }\n\n          break;\n\n        case 'variable_regular_price':\n        case 'variable_sale_price':\n        case 'variable_stock':\n        case 'variable_weight':\n        case 'variable_length':\n        case 'variable_width':\n        case 'variable_height':\n        case 'variable_download_limit':\n        case 'variable_download_expiry':\n          value = window.prompt(dokan.i18n_enter_a_value);\n\n          if (value != null) {\n            data.value = value;\n          }\n\n          break;\n\n        case 'variable_sale_schedule':\n          data.date_from = window.prompt(dokan.i18n_scheduled_sale_start);\n          data.date_to = window.prompt(dokan.i18n_scheduled_sale_end);\n\n          if (null === data.date_from) {\n            data.date_from = false;\n          }\n\n          if (null === data.date_to) {\n            data.date_to = false;\n          }\n\n          break;\n\n        default:\n          $('select.variation-actions').trigger(do_variation_action);\n          data = $('select.variation-actions').triggerHandler(do_variation_action + '_ajax_data', data);\n          break;\n      }\n\n      if ('delete_all' === do_variation_action && data.allowed) {\n        $('#dokan-variable-product-options').find('.variation-needs-update').removeClass('variation-needs-update');\n      } else {\n        Dokan_Product_Variation_Ajax.check_for_changes();\n      }\n\n      Dokan_Product_Variation_Ajax.block();\n      $.ajax({\n        url: dokan.ajaxurl,\n        data: {\n          action: 'dokan_bulk_edit_variations',\n          security: dokan.bulk_edit_variations_nonce,\n          product_id: $('#dokan-edit-product-id').val(),\n          product_type: $('#product_type').val(),\n          bulk_action: do_variation_action,\n          data: data\n        },\n        type: 'POST',\n        success: function success() {\n          Dokan_Product_Variation_PageNav.go_to_page(1, changes);\n        }\n      });\n    }\n  };\n  /**\n   * Product variations pagenav\n   */\n\n  var Dokan_Product_Variation_PageNav = {\n    /**\n     * Initialize products variations meta box\n     */\n    init: function init() {\n      $(document.body).on('dokan_variations_added', this.update_single_quantity).on('change', '.dokan-variations-pagenav .page-selector', this.page_selector).on('click', '.dokan-variations-pagenav .first-page', this.first_page).on('click', '.dokan-variations-pagenav .prev-page', this.prev_page).on('click', '.dokan-variations-pagenav .next-page', this.next_page).on('click', '.dokan-variations-pagenav .last-page', this.last_page);\n    },\n\n    /**\n     * Set variations count\n     *\n     * @param {Int} qty\n     *\n     * @return {Int}\n     */\n    update_variations_count: function update_variations_count(qty) {\n      var wrapper = $('#dokan-variable-product-options').find('.dokan-variations-container'),\n          total = parseInt(wrapper.attr('data-total'), 10) + qty,\n          displaying_num = $('.dokan-variations-pagenav .displaying-num'); // Set the new total of variations\n\n      wrapper.attr('data-total', total);\n\n      if (1 === total) {\n        displaying_num.text(dokan.i18n_variation_count_single.replace('%qty%', total));\n      } else {\n        displaying_num.text(dokan.i18n_variation_count_plural.replace('%qty%', total));\n      }\n\n      return total;\n    },\n\n    /**\n     * Update variations quantity when add a new variation\n     *\n     * @param {Object} event\n     * @param {Int} qty\n     */\n    update_single_quantity: function update_single_quantity(event, qty) {\n      if (1 === qty) {\n        var page_nav = $('.dokan-variations-pagenav');\n        Dokan_Product_Variation_PageNav.update_variations_count(qty);\n\n        if (page_nav.is(':hidden')) {\n          $('option, optgroup', 'select.variation-actions').show();\n          $('select.variation-actions').val('add_variation');\n          $('#dokan-variable-product-options').find('.dokan-variation-action-toolbar').show();\n          page_nav.show();\n          $('.pagination-links', page_nav).hide();\n        }\n      }\n    },\n\n    /**\n     * Set the pagenav fields\n     *\n     * @param {Int} qty\n     */\n    set_paginav: function set_paginav(qty) {\n      var wrapper = $('#dokan-variable-product-options').find('.dokan-variations-container'),\n          new_qty = Dokan_Product_Variation_PageNav.update_variations_count(qty),\n          toolbar = $('#dokan-variable-product-options').find('.dokan-variation-action-toolbar'),\n          variation_action = $('select.variation-actions'),\n          page_nav = $('.dokan-variations-pagenav'),\n          displaying_links = $('.pagination-links', page_nav),\n          total_pages = Math.ceil(new_qty / dokan.variations_per_page),\n          options = ''; // Set the new total of pages\n\n      wrapper.attr('data-total_pages', total_pages);\n      $('.total-pages', page_nav).text(total_pages); // Set the new pagenav options\n\n      for (var i = 1; i <= total_pages; i++) {\n        options += '<option value=\"' + i + '\">' + i + '</option>';\n      }\n\n      $('.page-selector', page_nav).empty().html(options); // Show/hide pagenav\n\n      if (0 === new_qty) {\n        toolbar.not('.toolbar-top, .toolbar-buttons').hide();\n        page_nav.hide();\n        $('option, optgroup', variation_action).hide();\n        $('select.variation-actions').val('add_variation');\n        $('option[data-global=\"true\"]', variation_action).show();\n      } else {\n        toolbar.show();\n        page_nav.show();\n        $('option, optgroup', variation_action).show();\n        $('select.variation-actions').val('add_variation'); // Show/hide links\n\n        if (1 === total_pages) {\n          displaying_links.hide();\n        } else {\n          displaying_links.show();\n        }\n      }\n    },\n\n    /**\n     * Check button if enabled and if don't have changes\n     *\n     * @return {Bool}\n     */\n    check_is_enabled: function check_is_enabled(current) {\n      return !$(current).hasClass('disabled');\n    },\n\n    /**\n     * Change \"disabled\" class on pagenav\n     */\n    change_classes: function change_classes(selected, total) {\n      var first_page = $('.dokan-variations-pagenav .first-page'),\n          prev_page = $('.dokan-variations-pagenav .prev-page'),\n          next_page = $('.dokan-variations-pagenav .next-page'),\n          last_page = $('.dokan-variations-pagenav .last-page');\n\n      if (1 === selected) {\n        first_page.addClass('disabled');\n        prev_page.addClass('disabled');\n      } else {\n        first_page.removeClass('disabled');\n        prev_page.removeClass('disabled');\n      }\n\n      if (total === selected) {\n        next_page.addClass('disabled');\n        last_page.addClass('disabled');\n      } else {\n        next_page.removeClass('disabled');\n        last_page.removeClass('disabled');\n      }\n    },\n\n    /**\n     * Set page\n     */\n    set_page: function set_page(page) {\n      $('.dokan-variations-pagenav .page-selector').val(page).first().change();\n    },\n\n    /**\n     * Navigate on variations pages\n     *\n     * @param {Int} page\n     * @param {Int} qty\n     */\n    go_to_page: function go_to_page(page, qty) {\n      page = page || 1;\n      qty = qty || 0;\n      Dokan_Product_Variation_PageNav.set_paginav(qty);\n      Dokan_Product_Variation_PageNav.set_page(page);\n    },\n\n    /**\n     * Paginav pagination selector\n     */\n    page_selector: function page_selector() {\n      var selected = parseInt($(this).val(), 10),\n          wrapper = $('#dokan-variable-product-options').find('.dokan-variations-container');\n      $('.dokan-variations-pagenav .page-selector').val(selected);\n      Dokan_Product_Variation_Ajax.check_for_changes();\n      Dokan_Product_Variation_PageNav.change_classes(selected, parseInt(wrapper.attr('data-total_pages'), 10));\n      Dokan_Product_Variation_Ajax.load_variations(selected);\n    },\n\n    /**\n     * Go to first page\n     *\n     * @return {Bool}\n     */\n    first_page: function first_page() {\n      if (Dokan_Product_Variation_PageNav.check_is_enabled(this)) {\n        Dokan_Product_Variation_PageNav.set_page(1);\n      }\n\n      return false;\n    },\n\n    /**\n     * Go to previous page\n     *\n     * @return {Bool}\n     */\n    prev_page: function prev_page() {\n      if (Dokan_Product_Variation_PageNav.check_is_enabled(this)) {\n        var wrapper = $('#dokan-variable-product-options').find('.dokan-variations-container'),\n            prev_page = parseInt(wrapper.attr('data-page'), 10) - 1,\n            new_page = 0 < prev_page ? prev_page : 1;\n        Dokan_Product_Variation_PageNav.set_page(new_page);\n      }\n\n      return false;\n    },\n\n    /**\n     * Go to next page\n     *\n     * @return {Bool}\n     */\n    next_page: function next_page() {\n      if (Dokan_Product_Variation_PageNav.check_is_enabled(this)) {\n        var wrapper = $('#dokan-variable-product-options').find('.dokan-variations-container'),\n            total_pages = parseInt(wrapper.attr('data-total_pages'), 10),\n            next_page = parseInt(wrapper.attr('data-page'), 10) + 1,\n            new_page = total_pages >= next_page ? next_page : total_pages;\n        Dokan_Product_Variation_PageNav.set_page(new_page);\n      }\n\n      return false;\n    },\n\n    /**\n     * Go to last page\n     *\n     * @return {Bool}\n     */\n    last_page: function last_page() {\n      if (Dokan_Product_Variation_PageNav.check_is_enabled(this)) {\n        var last_page = $('#dokan-variable-product-options').find('.dokan-variations-container').attr('data-total_pages');\n        Dokan_Product_Variation_PageNav.set_page(last_page);\n      }\n\n      return false;\n    }\n  }; // On DOM ready\n\n  $(function () {\n    if ($('#dokan-variable-product-options').length) {\n      Dokan_Product_Variation_Actions.init();\n      Dokan_Product_Variation_Ajax.init();\n      Dokan_Product_Variation_PageNav.init();\n    }\n  });\n});\n\n//# sourceURL=webpack:///./assets/src/js/product-variation.js?");

/***/ }),

/***/ "./assets/src/js/product.js":
/*!**********************************!*\
  !*** ./assets/src/js/product.js ***!
  \**********************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval(";\n\n(function ($) {\n  var variantsHolder = $('#variants-holder');\n  var Dokan_Editor = {\n    init: function init() {\n      var product_type = 'simple'; // post status change\n\n      $('.dokan-toggle-sidebar').on('click', 'a.dokan-toggle-edit', this.sidebarToggle.showStatus);\n      $('.dokan-toggle-sidebar').on('click', 'a.dokan-toggle-save', this.sidebarToggle.saveStatus);\n      $('.dokan-toggle-sidebar').on('click', 'a.dokan-toggle-cacnel', this.sidebarToggle.cancel); // Tab view variants\n\n      $('#product-attributes').on('click', '.add-variant-category', this.variants.addCategory);\n      $('#variants-holder').on('click', '.box-header .row-remove', this.variants.removeCategory);\n      $('#variants-holder').on('click', '.item-action a.row-add', this.variants.addItem);\n      $('#variants-holder').on('click', '.item-action a.row-remove', this.variants.removeItem);\n      $('body, #variable_product_options').on('click', '.sale_schedule', this.variants.saleSchedule);\n      $('body, #variable_product_options').on('click', '.cancel_sale_schedule', this.variants.cancelSchedule);\n      $('#variable_product_options').on('woocommerce_variations_added', this.variants.onVariantAdded);\n      $('.save_attributes').on('click', this.variants.save);\n      this.variants.dates();\n      this.variants.initSaleSchedule(); //seo\n\n      $('.product-edit-new-container').on('click', '.snippet-btn', this.editProduct.seo.toggleSnippet);\n      $('.product-edit-new-container').on('input', 'input.wpseo-title-input, textarea.wpseo-meta-input', this.editProduct.seo.dataRender);\n      $('.product-edit-new-container').on('input', '#post_title', this.editProduct.seo.onChangePostTitle);\n      $('.product-edit-new-container').on('change', 'select#wpseo_title_shortcode, select#wpseo_meta_shortcode', this.editProduct.seo.shortcodeRender);\n      $('input.wpseo-title-input').trigger('input');\n      $('textarea.wpseo-meta-input').trigger('input'); // shipping\n\n      $('.product-edit-new-container, #product-shipping').on('change', 'input[type=checkbox]#_overwrite_shipping', this.editProduct.shipping.showHideOverride);\n      $('.product-edit-new-container').on('change', 'input[type=checkbox]#_disable_shipping', this.editProduct.shipping.disableOverride);\n      $('#product-shipping').on('click', '#_disable_shipping', this.shipping.disableOverride);\n      $('.product-edit-new-container, .product_lot_discount').on('change', 'input[type=checkbox]#_is_lot_discount', this.editProduct.showLotDiscountWrapper);\n      $('body').on('click', '.upload_image_button', this.editProduct.loadVariationImage);\n      this.editProduct.shipping.showHideOverride();\n      this.editProduct.shipping.disableOverride();\n      this.shipping.disableOverride();\n      $('#_disable_shipping').trigger('change');\n      $('#_overwrite_shipping').trigger('change');\n      $('.hide_if_lot_discount').hide();\n      $('.hide_if_order_discount').hide(); // save attributes\n\n      $('body').on('dokan-product-editor-loaded', this.bindProductTagDropdown);\n      +$('body').on('dokan-product-editor-popup-opened', this.bindProductTagDropdown);\n    },\n    editProduct: {\n      showLotDiscountWrapper: function showLotDiscountWrapper() {\n        if ($(this).is(':checked')) {\n          $('.show_if_needs_lot_discount').slideDown('fast');\n        } else {\n          $('.show_if_needs_lot_discount').slideUp('fast');\n        }\n      },\n      loadVariationImage: function loadVariationImage(e) {\n        e.preventDefault();\n        var variable_image_frame;\n        var $button = $(this);\n        var post_id = $button.attr('rel');\n        var $parent = $button.closest('.upload_image');\n        setting_variation_image = $parent;\n        placeholder_iamge = dokan.dokan_placeholder_img_src;\n        setting_variation_image_id = post_id;\n        e.preventDefault();\n\n        if ($button.is('.dokan-img-remove')) {\n          setting_variation_image.find('.upload_image_id').val('');\n          setting_variation_image.find('img').attr('src', placeholder_iamge);\n          setting_variation_image.find('.upload_image_button').removeClass('dokan-img-remove');\n          $button.closest('.dokan-product-variation-itmes').addClass('variation-needs-update');\n          $('button.cancel-variation-changes, button.save-variation-changes').removeAttr('disabled');\n          $('.dokan-product-variation-wrapper').trigger('dokan_variations_input_changed');\n        } else {\n          // If the media frame already exists, reopen it.\n          if (variable_image_frame) {\n            variable_image_frame.uploader.uploader.param('post_id', setting_variation_image_id);\n            variable_image_frame.open();\n            return;\n          } else {\n            wp.media.model.settings.post.id = setting_variation_image_id;\n            wp.media.model.settings.type = 'dokan';\n          } // Create the media frame.\n\n\n          variable_image_frame = wp.media.frames.variable_image = wp.media({\n            // Set the title of the modal.\n            title: dokan.i18n_choose_image,\n            button: {\n              text: dokan.i18n_set_image\n            }\n          }); // When an image is selected, run a callback.\n\n          variable_image_frame.on('select', function () {\n            attachment = variable_image_frame.state().get('selection').first().toJSON();\n            setting_variation_image.find('.upload_image_id').val(attachment.id);\n            setting_variation_image.find('.upload_image_button').addClass('dokan-img-remove');\n            setting_variation_image.find('img').attr('src', attachment.url);\n            $button.closest('.dokan-product-variation-itmes').addClass('variation-needs-update');\n            $('button.cancel-variation-changes, button.save-variation-changes').removeAttr('disabled');\n            $('.dokan-product-variation-wrapper').trigger('dokan_variations_input_changed');\n            wp.media.model.settings.post.id = setting_variation_image_id;\n          }); // Finally, open the modal.\n\n          variable_image_frame.open();\n        }\n      },\n      seo: {\n        toggleSnippet: function toggleSnippet() {\n          $(\".dokan-seo-snippet-edit-wrap\").toggle();\n        },\n        replaceShortCodes: function replaceShortCodes(str, shortCodes) {\n          var codes = Object.keys(shortCodes),\n              i = 0;\n\n          for (i = 0; i < codes.length; i++) {\n            var escapedCode = codes[i].replace(/\\[/g, '\\\\[').replace(/\\]/g, '\\\\]'),\n                re = new RegExp(escapedCode, 'gi');\n\n            if (str) {\n              str = str.replace(re, shortCodes[codes[i]]);\n            }\n          }\n\n          return str;\n        },\n        dataRender: function dataRender() {\n          var self = $(this),\n              val = self.val(),\n              shortCodes = {\n            '[title]': self.data('title'),\n            '[sep]': self.data('sep'),\n            '[sitename]': self.data('sitename')\n          };\n\n          if (val == '') {\n            if ('text' == self[0].type) {\n              val = '[title] [sep] [sitename]';\n              self.val(val);\n            }\n\n            if ('textarea' == self[0].type) {\n              val = $('.seo-snippet').find('.seo-meta').data('default');\n              self.val(val);\n            }\n          }\n\n          var convertedString = Dokan_Editor.editProduct.seo.replaceShortCodes(val, shortCodes);\n          $('.dokan-seo-product-options').find(self.data('class')).html(convertedString);\n        },\n        shortcodeRender: function shortcodeRender() {\n          var self = $(this),\n              val = self.val();\n\n          if ('' == val) {\n            return;\n          }\n\n          var $txt = jQuery(self.data('class'));\n          var caretPos = $txt[0].selectionStart;\n          var textAreaTxt = $txt.val();\n          $txt.val(textAreaTxt.substring(0, caretPos) + ' ' + val + ' ' + textAreaTxt.substring(caretPos));\n          $txt.trigger('input').trigger('focus');\n        },\n        onChangePostTitle: function onChangePostTitle() {\n          var input = $(this),\n              title = input.val();\n          $('[name=\"_yoast_wpseo_title\"], [name=\"_yoast_wpseo_metadesc\"]').data('title', title).trigger('input');\n        }\n      },\n      shipping: {\n        showHideOverride: function showHideOverride() {\n          if ($('#_overwrite_shipping').is(':checked')) {\n            $('.show_if_override').show();\n          } else {\n            $('.show_if_override').hide();\n          }\n        },\n        disableOverride: function disableOverride() {\n          if ($('#_disable_shipping').is(':checked')) {\n            $('.show_if_needs_shipping').show();\n            $('#_overwrite_shipping').trigger('change');\n          } else {\n            $('.show_if_needs_shipping').hide();\n          }\n        }\n      }\n    },\n    variants: {\n      addCategory: function addCategory(e) {\n        e.preventDefault();\n        var product_types = $('#product_type').val();\n        var check = $(this).closest('p.toolbar').find('select.select-attribute').val();\n        var row = $('.inputs-box').length;\n\n        if (check == '') {\n          var category = wp.template('sc-category');\n          variantsHolder.append(category({\n            row: row\n          })).children(':last').hide().fadeIn();\n        } else {\n          var data = {\n            row: row,\n            name: check,\n            type: product_types,\n            action: 'dokan_pre_define_attribute'\n          };\n          $('#product-attributes .toolbar').block({\n            message: null,\n            overlayCSS: {\n              background: '#fff',\n              opacity: 0.6\n            }\n          });\n          $.post(dokan.ajaxurl, data, function (resp) {\n            if (resp.success) {\n              variantsHolder.append(resp.data).children(':last').hide().fadeIn();\n            }\n\n            $('#product-attributes .toolbar').unblock();\n          });\n        }\n\n        if (product_type === 'simple') {\n          variantsHolder.find('.show_if_variable').hide();\n        }\n      },\n      removeCategory: function removeCategory(e) {\n        e.preventDefault();\n\n        if (confirm('Sure?')) {\n          $(this).parents('.inputs-box').fadeOut(function () {\n            $(this).remove();\n          });\n        }\n      },\n      addItem: function addItem(e) {\n        e.preventDefault();\n        var self = $(this),\n            wrap = self.closest('.inputs-box'),\n            list = self.closest('ul.option-couplet');\n        var col = list.find('li').length,\n            row = wrap.data('count');\n\n        var template = _.template($('#tmpl-sc-category-item').html());\n\n        self.closest('li').after(template({\n          'row': row,\n          'col': col\n        }));\n      },\n      removeItem: function removeItem(e) {\n        e.preventDefault();\n        var options = $(this).parents('ul').find('li'); // don't remove if only one option is there\n\n        if (options.length > 1) {\n          $(this).parents('li').fadeOut(function () {\n            $(this).remove();\n          });\n        }\n      },\n      save: function save() {\n        var data = {\n          post_id: $(this).data('id'),\n          data: $('.woocommerce_attributes').find('input, select, textarea').serialize(),\n          action: 'dokan_save_attributes'\n        };\n        var this_page = window.location.toString();\n        $('#variants-holder').block({\n          message: null,\n          overlayCSS: {\n            background: '#fff',\n            opacity: 0.6\n          }\n        });\n        $.post(ajaxurl, data, function (resp) {\n          $('#variable_product_options').block({\n            message: null,\n            overlayCSS: {\n              background: '#fff',\n              opacity: 0.6\n            }\n          });\n          $('#variable_product_options').load(this_page + ' #variable_product_options_inner', function () {\n            $('#variable_product_options').unblock();\n          }); // fire change events for varaiations\n\n          $('input.variable_is_downloadable, input.variable_is_virtual, input.variable_manage_stock').trigger('change');\n          $('#variants-holder').unblock();\n        });\n      },\n      initSaleSchedule: function initSaleSchedule() {\n        // Sale price schedule\n        $('.sale_price_dates_fields').each(function () {\n          var $these_sale_dates = $(this);\n          var sale_schedule_set = false;\n          var $wrap = $these_sale_dates.closest('div, table');\n          $these_sale_dates.find('input').each(function () {\n            if ($(this).val() != '') sale_schedule_set = true;\n          });\n\n          if (sale_schedule_set) {\n            $wrap.find('.sale_schedule').hide();\n            $wrap.find('.cancel_sale_schedule').show();\n            $wrap.find('.sale_price_dates_fields').show();\n          } else {\n            $wrap.find('.sale_schedule').show();\n            $wrap.find('.cancel_sale_schedule').hide();\n            $wrap.find('.sale_price_dates_fields').hide();\n          }\n        });\n      },\n      saleSchedule: function saleSchedule() {\n        var $wrap = $(this).closest('div, table');\n        $(this).hide();\n        $wrap.find('.cancel_sale_schedule').show();\n        $wrap.find('.sale_price_dates_fields').show();\n        return false;\n      },\n      cancelSchedule: function cancelSchedule() {\n        var $wrap = $(this).closest('div, table');\n        $(this).hide();\n        $wrap.find('.sale_schedule').show();\n        $wrap.find('.sale_price_dates_fields').hide();\n        $wrap.find('.sale_price_dates_fields').find('input').val('');\n        return false;\n      },\n      dates: function dates() {\n        $('.sale_price_dates_fields input[name=\"_sale_price_dates_from\"]').datepicker({\n          defaultDate: \"\",\n          dateFormat: \"yy-mm-dd\",\n          numberOfMonths: 1,\n          onSelect: function onSelect(selectedDate) {\n            var date = new Date(selectedDate);\n            date.setDate(date.getDate() + 1);\n            $('input[name=\"_sale_price_dates_to\"]').datepicker('option', {\n              'minDate': date\n            });\n          }\n        });\n        $('.sale_price_dates_fields input[name=\"_sale_price_dates_to\"]').datepicker({\n          defaultDate: \"\",\n          dateFormat: \"yy-mm-dd\",\n          numberOfMonths: 1,\n          onSelect: function onSelect(selectedDate) {\n            var date = new Date(selectedDate);\n            date.setDate(date.getDate() - 1); // $('input[name=\"_sale_price_dates_from\"]').datepicker('option', {'maxDate': date})\n          }\n        });\n      },\n      onVariantAdded: function onVariantAdded() {\n        Dokan_Editor.variants.dates();\n      }\n    },\n    sidebarToggle: {\n      showStatus: function showStatus(e) {\n        var container = $(this).siblings('.dokan-toggle-select-container');\n\n        if (container.is(':hidden')) {\n          container.slideDown('fast');\n          $(this).hide();\n        }\n\n        return false;\n      },\n      saveStatus: function saveStatus(e) {\n        var container = $(this).closest('.dokan-toggle-select-container');\n        container.slideUp('fast');\n        container.siblings('a.dokan-toggle-edit').show(); // update the text\n\n        var text = $('option:selected', container.find('select.dokan-toggle-select')).text();\n        container.siblings('.dokan-toggle-selected-display').html(text);\n        return false;\n      },\n      cancel: function cancel(e) {\n        var container = $(this).closest('.dokan-toggle-select-container');\n        container.slideUp('fast');\n        container.siblings('a.dokan-toggle-edit').show();\n        return false;\n      }\n    },\n    shipping: {\n      disableOverride: function disableOverride() {\n        if ($('#_disable_shipping').is(':checked')) {\n          $('.hide_if_disable').hide();\n        } else {\n          $('.hide_if_disable').show();\n          Dokan_Editor.editProduct.shipping.showHideOverride();\n        }\n      }\n    },\n    bindProductTagDropdown: function bindProductTagDropdown() {\n      if (!(dokan.product_vendors_can_create_tags && 'on' === dokan.product_vendors_can_create_tags)) {\n        return;\n      }\n\n      $('#product_tag').select2({\n        tags: true,\n        language: {\n          noResults: function noResults() {\n            return dokan.i18n_no_result_found;\n          }\n        }\n      });\n    }\n  };\n  Dokan_Editor.init();\n})(jQuery);\n\n//# sourceURL=webpack:///./assets/src/js/product.js?");

/***/ }),

/***/ "./assets/src/js/reviews.js":
/*!**********************************!*\
  !*** ./assets/src/js/reviews.js ***!
  \**********************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval(";\n\n(function ($) {\n  var Dokan_Comments = {\n    init: function init() {\n      $('#dokan-comments-table').on('click', '.dokan-cmt-action', this.setCommentStatus);\n      $('.dokan-check-all').on('click', this.toggleCheckbox);\n    },\n    toggleCheckbox: function toggleCheckbox() {\n      $(\".dokan-check-col\").prop('checked', $(this).prop('checked'));\n    },\n    setCommentStatus: function setCommentStatus(e) {\n      e.preventDefault();\n      var self = $(this),\n          comment_id = self.data('comment_id'),\n          comment_status = self.data('cmt_status'),\n          page_status = self.data('page_status'),\n          post_type = self.data('post_type'),\n          curr_page = self.data('curr_page'),\n          tr = self.closest('tr'),\n          data = {\n        'action': 'dokan_comment_status',\n        'comment_id': comment_id,\n        'comment_status': comment_status,\n        'page_status': page_status,\n        'post_type': post_type,\n        'curr_page': curr_page,\n        'nonce': dokan.nonce\n      };\n      $.post(dokan.ajaxurl, data, function (resp) {\n        if (resp.success == false) {\n          alert(resp.data);\n        } else {\n          if (page_status === 1) {\n            if (comment_status === 1 || comment_status === 0) {\n              tr.fadeOut(function () {\n                tr.replaceWith(resp.data['content']).fadeIn();\n              });\n            } else {\n              tr.fadeOut(function () {\n                $(this).remove();\n              });\n            }\n          } else {\n            tr.fadeOut(function () {\n              $(this).remove();\n            });\n          }\n\n          if (resp.data['pending'] == null) resp.data['pending'] = 0;\n          if (resp.data['spam'] == null) resp.data['spam'] = 0;\n          if (resp.data['trash'] == null) resp.data['trash'] = 0;\n          if (resp.data['approved'] == null) resp.data['approved'] = 0;\n          $('.comments-menu-approved').text(resp.data['approved']);\n          $('.comments-menu-pending').text(resp.data['pending']);\n          $('.comments-menu-spam').text(resp.data['spam']);\n          $('.comments-menu-trash').text(resp.data['trash']);\n        }\n      });\n    }\n  };\n  $(function () {\n    Dokan_Comments.init();\n  });\n})(jQuery);\n\n//# sourceURL=webpack:///./assets/src/js/reviews.js?");

/***/ }),

/***/ "./assets/src/js/reviews.min.js":
/*!**************************************!*\
  !*** ./assets/src/js/reviews.min.js ***!
  \**************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("!function (a) {\n  var b = {\n    init: function init() {\n      a(\"#dokan-comments-table\").on(\"click\", \".dokan-cmt-action\", this.setCommentStatus), a(\"#dokan-comments-table\").on(\"click\", \"button.dokan-cmt-close-form\", this.closeForm), a(\"#dokan-comments-table\").on(\"click\", \"button.dokan-cmt-submit-form\", this.submitForm), a(\"#dokan-comments-table\").on(\"click\", \".dokan-cmt-edit\", this.populateForm), a(\".dokan-check-all\").on(\"click\", this.toggleCheckbox);\n    },\n    toggleCheckbox: function toggleCheckbox() {\n      a(\".dokan-check-col\").prop(\"checked\", a(this).prop(\"checked\"));\n    },\n    setCommentStatus: function setCommentStatus(b) {\n      b.preventDefault();\n      var c = a(this),\n          d = c.data(\"comment_id\"),\n          e = c.data(\"cmt_status\"),\n          f = c.data(\"page_status\"),\n          g = c.data(\"post_type\"),\n          h = c.data(\"curr_page\"),\n          i = c.closest(\"tr\"),\n          j = {\n        action: \"dokan_comment_status\",\n        comment_id: d,\n        comment_status: e,\n        page_status: f,\n        post_type: g,\n        curr_page: h,\n        nonce: dokan.nonce\n      };\n      a.post(dokan.ajaxurl, j, function (b) {\n        1 === f && (1 === e || 0 === e) ? i.fadeOut(function () {\n          i.replaceWith(b.data.content).fadeIn();\n        }) : i.fadeOut(function () {\n          a(this).remove();\n        }), null == b.data.pending && (b.data.pending = 0), null == b.data.spam && (b.data.spam = 0), null == b.data.trash && (b.data.trash = 0), a(\".comments-menu-pending\").text(b.data.pending), a(\".comments-menu-spam\").text(b.data.spam), a(\".comments-menu-trash\").text(b.data.trash);\n      });\n    },\n    populateForm: function populateForm(b) {\n      b.preventDefault();\n      var c = a(this).closest(\"tr\");\n      if (c.next().hasClass(\"dokan-comment-edit-row\")) return void c.next().remove();\n      var d = a(\"#dokan-edit-comment-row\").html(),\n          e = {\n        author: c.find(\".dokan-cmt-hid-author\").text(),\n        email: c.find(\".dokan-cmt-hid-email\").text(),\n        url: c.find(\".dokan-cmt-hid-url\").text(),\n        body: c.find(\".dokan-cmt-hid-body\").text(),\n        id: c.find(\".dokan-cmt-hid-id\").text(),\n        status: c.find(\".dokan-cmt-hid-status\").text()\n      };\n      c.after(_.template(d, e));\n    },\n    closeForm: function closeForm(b) {\n      b.preventDefault(), a(this).closest(\"tr.dokan-comment-edit-row\").remove();\n    },\n    submitForm: function submitForm(b) {\n      b.preventDefault();\n      var c = a(this),\n          d = c.closest(\"tr.dokan-comment-edit-row\"),\n          e = {\n        action: \"dokan_update_comment\",\n        comment_id: d.find(\"input.dokan-cmt-id\").val(),\n        content: d.find(\"textarea.dokan-cmt-body\").val(),\n        author: d.find(\"input.dokan-cmt-author\").val(),\n        email: d.find(\"input.dokan-cmt-author-email\").val(),\n        url: d.find(\"input.dokan-cmt-author-url\").val(),\n        status: d.find(\"input.dokan-cmt-status\").val(),\n        nonce: dokan.nonce,\n        post_type: d.find(\"input.dokan-cmt-post-type\").val()\n      };\n      a.post(dokan.ajaxurl, e, function (a) {\n        a.success === !0 ? (d.prev().replaceWith(a.data), d.remove()) : alert(a.data);\n      });\n    }\n  };\n  a(function () {\n    b.init();\n  });\n}(jQuery);\n\n//# sourceURL=webpack:///./assets/src/js/reviews.min.js?");

/***/ }),

/***/ "./assets/src/js/shipping.js":
/*!***********************************!*\
  !*** ./assets/src/js/shipping.js ***!
  \***********************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("// Shipping tab js\n(function ($) {\n  $(document).ready(function () {\n    $('.dokan-shipping-location-wrapper').on('change', '.dps_country_selection', function () {\n      var self = $(this),\n          data = {\n        country_id: self.find(':selected').val(),\n        action: 'dps_select_state_by_country'\n      };\n\n      if (self.val() == '' || self.val() == 'everywhere') {\n        self.closest('.dps-shipping-location-content').find('table.dps-shipping-states tbody').html('');\n      } else {\n        $.post(dokan.ajaxurl, data, function (response) {\n          if (response.success) {\n            self.closest('.dps-shipping-location-content').find('table.dps-shipping-states tbody').html(response.data);\n          }\n        });\n      }\n    });\n    $('.dps-main-wrapper').on('click', 'a.dps-shipping-add', function (e) {\n      e.preventDefault();\n      var html = $('#dps-shipping-hidden-lcoation-content');\n      var row = $(html).first().clone().appendTo($('.dokan-shipping-location-wrapper')).show();\n      $('.dokan-shipping-location-wrapper').find('.dps-shipping-location-content').first().find('a.dps-shipping-remove').show();\n      $('.tips').tooltip();\n      row.removeAttr('id');\n      row.find('input,select').val('');\n      row.find('a.dps-shipping-remove').show();\n    });\n    $('.dokan-shipping-location-wrapper').on('click', 'a.dps-shipping-remove', function (e) {\n      e.preventDefault();\n      $(this).closest('.dps-shipping-location-content').remove();\n      $dpsElm = $('.dokan-shipping-location-wrapper').find('.dps-shipping-location-content');\n\n      if ($dpsElm.length == 1) {\n        $dpsElm.first().find('a.dps-shipping-remove').hide();\n      }\n    });\n    $('.dokan-shipping-location-wrapper').on('click', 'a.dps-add', function (e) {\n      e.preventDefault();\n      var row = $(this).closest('tr').first().clone().appendTo($(this).closest('table.dps-shipping-states'));\n      row.find('input,select').val('');\n      row.find('a.dps-remove').show();\n      $('.tips').tooltip();\n    });\n    $('.dokan-shipping-location-wrapper').on('click', 'a.dps-remove', function (e) {\n      e.preventDefault();\n\n      if ($(this).closest('table.dps-shipping-states').find('tr').length == 1) {\n        $(this).closest('.dps-shipping-location-content').find('td.dps_shipping_location_cost').show();\n      }\n\n      $(this).closest('tr').remove();\n    });\n    $('.dokan-shipping-location-wrapper').on('change keyup', '.dps_state_selection', function () {\n      var self = $(this);\n\n      if (self.val() == '' || self.val() == '-1') {\n        self.closest('.dps-shipping-location-content').find('td.dps_shipping_location_cost').show();\n      } else {\n        self.closest('.dps-shipping-location-content').find('td.dps_shipping_location_cost').hide();\n      }\n    });\n    $('.dokan-shipping-location-wrapper .dps_state_selection').trigger('change');\n    $('.dokan-shipping-location-wrapper .dps_state_selection').trigger('keyup');\n    var $wrap = $('.dokan-shipping-location-wrapper').find('.dps-shipping-location-content');\n\n    if ($wrap.length == 1) {\n      $wrap.first().find('a.dps-shipping-remove').hide();\n    }\n  });\n})(jQuery);\n\n//# sourceURL=webpack:///./assets/src/js/shipping.js?");

/***/ }),

/***/ "./assets/src/js/store-lists.js":
/*!**************************************!*\
  !*** ./assets/src/js/store-lists.js ***!
  \**************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);\n\n;\n\n(function ($) {\n  var storeListsPro = {\n    /**\n     * Item array holder\n     *\n     * @type array\n     */\n    itemArray: [],\n\n    /**\n     * Item ID holder\n     *\n     * @type array\n     */\n    itemSlugs: [],\n\n    /**\n     * Selected category text holder\n     *\n     * @type string\n     */\n    itemString: '',\n\n    /**\n     * Init all the methods\n     *\n     * @return void\n     */\n    init: function init() {\n      $('#dokan-store-listing-filter-form-wrap .store-lists-category .category-input').on('click', this.toggleCategory);\n      $('#dokan-store-listing-filter-form-wrap .store-lists-category .category-box ul li').on('click', this.selectCategory);\n      $('#dokan-store-listing-filter-form-wrap .featured.item #featured').on('change', this.toggleFeatured);\n      $('#dokan-store-listing-filter-form-wrap .open-now.item #open-now').on('change', this.toggleIsOpen);\n      $('#dokan-store-listing-filter-form-wrap .store-ratings.item i').on('click', this.setRatings);\n      var params = dokan.storeLists.getParams();\n\n      if (params.length) {\n        params.forEach(function (param) {\n          storeListsPro.setParams(Object.keys(param), Object.values(param));\n        });\n      }\n\n      this.makeStyleAdjustment();\n    },\n\n    /**\n     * Toggle category\n     *\n     * @return void\n     */\n    toggleCategory: function toggleCategory() {\n      $('.store-lists-category .category-box').slideToggle();\n      $('.store-lists-category .category-input .dokan-icon').toggleClass('dashicons-arrow-down-alt2 dashicons-arrow-up-alt2');\n    },\n\n    /**\n     * Select Category\n     *\n     * @param  string event\n     *\n     * @return void\n     */\n    selectCategory: function selectCategory(event) {\n      var item = $(event.target);\n      var currentItem = item.text().trim();\n      var currentItemSlug = item.data('slug');\n      var self = storeListsPro;\n      item.toggleClass('dokan-btn-theme');\n\n      if (!self.itemSlugs.includes(currentItemSlug)) {\n        self.itemArray.push(currentItem);\n        self.itemSlugs.push(currentItemSlug);\n      } else {\n        var itemToRemove = self.itemSlugs.indexOf(currentItemSlug);\n        self.itemArray.splice(itemToRemove, 1);\n        self.itemSlugs.splice(itemToRemove, 1);\n      }\n\n      dokan.storeLists.query.store_categories = self.itemSlugs;\n      var itemString = self.itemArray.join(', ');\n      self.setCategoryHolder(itemString);\n    },\n\n    /**\n     * Toggle Featured\n     *\n     * @param  string\n     *\n     * @return void\n     */\n    toggleFeatured: function toggleFeatured(event) {\n      delete dokan.storeLists.query.featured;\n\n      if (event.target.checked) {\n        dokan.storeLists.query.featured = 'yes';\n      }\n    },\n\n    /**\n     * Toogle is Open\n     *\n     * @param  string\n     *\n     * @return void\n     */\n    toggleIsOpen: function toggleIsOpen(event) {\n      delete dokan.storeLists.query.open_now;\n\n      if (event.target.checked) {\n        dokan.storeLists.query.open_now = 'yes';\n      }\n    },\n\n    /**\n     * Set Ratings\n     *\n     * @param string\n     *\n     * @return void\n     */\n    setRatings: function setRatings(event) {\n      event.preventDefault();\n      var currentItem = $(event.target);\n      var parent = currentItem.parent();\n      parent.addClass('selected');\n\n      _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(parent.find('i')).forEach(function (item) {\n        if (currentItem.is(item)) {\n          if ($(item).hasClass('active')) {\n            parent.removeClass('selected');\n            $(item).removeClass('active');\n          } else {\n            $(item).addClass('active');\n          }\n        } else {\n          $(item).removeClass('active');\n        }\n      });\n\n      var rating = dokan.storeLists.query.rating;\n\n      if (rating != currentItem.data('rating')) {\n        dokan.storeLists.query.rating = currentItem.data('rating');\n      } else {\n        delete dokan.storeLists.query.rating;\n      }\n    },\n\n    /**\n     * Set Parrams\n     *\n     * @param string key\n     * @param mix value\n     */\n    setParams: function setParams(key, value) {\n      var self = storeListsPro;\n      var dokan = window.dokan.storeLists;\n      key.forEach(function (param, index) {\n        var charIndex = param.indexOf('['); // If charIndex is greater than 0, then it's an array; ei: category[]=cat_1\n\n        if (charIndex > 0) {\n          self.itemSlugs.push(value[index]);\n          dokan.query[param.substr(0, charIndex)] = self.itemSlugs;\n        }\n      });\n      var categoryHolder = $('.category-items');\n\n      if (dokan.cateItemStringArray.length) {\n        self.itemArray = dokan.cateItemStringArray;\n        var strings = self.itemArray.join(', ');\n        self.setCategoryHolder(strings);\n      }\n    },\n\n    /**\n     * Set Category Holder\n     *\n     * @param string\n     *\n     * @return void\n     */\n    setCategoryHolder: function setCategoryHolder(string) {\n      var categoryHolder = $('.category-items');\n\n      if (!string) {\n        return categoryHolder.text(dokan.all_categories);\n      }\n\n      if (string.length > 15) {\n        categoryHolder.text(' ').append(string.substr(0, 15) + '...');\n      } else {\n        categoryHolder.text(' ').append(string);\n      }\n    },\n\n    /**\n     * If only 2 elments found, make them stay closer ( open now and featured )\n     *\n     * Push apply button a little down\n     *\n     * @return void\n     */\n    makeStyleAdjustment: function makeStyleAdjustment() {\n      var element = $('.store-lists-other-filter-wrap');\n\n      if (element && element.children() && element.children().length === 2) {\n        if (element.children().first() && element.children().first().hasClass('featured')) {\n          $('#dokan-store-listing-filter-form-wrap .apply-filter').css('margin-top', '15px');\n        }\n      }\n    }\n  };\n\n  if (window.dokan && window.dokan.storeLists) {\n    storeListsPro.init();\n  }\n})(jQuery);\n\n//# sourceURL=webpack:///./assets/src/js/store-lists.js?");

/***/ }),

/***/ "./assets/src/js/store-seo.js":
/*!************************************!*\
  !*** ./assets/src/js/store-seo.js ***!
  \************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("//dokan store seo form submit\n(function ($) {\n  var wrapper = $('.dokan-store-seo-wrapper');\n  var Dokan_Store_SEO = {\n    init: function init() {\n      wrapper.on('submit', 'form#dokan-store-seo-form', this.form.validate);\n    },\n    form: {\n      validate: function validate(e) {\n        e.preventDefault();\n        var self = $(this),\n            data = {\n          action: 'dokan_seo_form_handler',\n          data: self.serialize()\n        };\n        Dokan_Store_SEO.form.submit(data);\n        return false;\n      },\n      submit: function submit(data) {\n        var feedback = $('#dokan-seo-feedback');\n        feedback.fadeOut();\n        $.post(dokan.ajaxurl, data, function (resp) {\n          if (resp.success) {\n            feedback.html(resp.data);\n            feedback.removeClass('dokan-hide');\n            feedback.addClass('dokan-alert-success');\n            feedback.fadeIn();\n          } else {\n            feedback.html(resp.data);\n            feedback.addClass('dokan-alert-danger');\n            feedback.removeClass('dokan-hide');\n            feedback.fadeIn();\n          }\n        });\n      }\n    }\n  };\n  $(function () {\n    Dokan_Store_SEO.init();\n  });\n})(jQuery);\n\n//# sourceURL=webpack:///./assets/src/js/store-seo.js?");

/***/ }),

/***/ "./assets/src/less/dokan-pro.less":
/*!****************************************!*\
  !*** ./assets/src/less/dokan-pro.less ***!
  \****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./assets/src/less/dokan-pro.less?");

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  \*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("function _arrayLikeToArray(arr, len) {\n  if (len == null || len > arr.length) len = arr.length;\n\n  for (var i = 0, arr2 = new Array(len); i < len; i++) {\n    arr2[i] = arr[i];\n  }\n\n  return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayLikeToArray.js?");

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":
/*!******************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  \******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

eval("var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ \"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js\");\n\nfunction _arrayWithoutHoles(arr) {\n  if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js?");

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js":
/*!****************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  \****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("function _iterableToArray(iter) {\n  if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/iterableToArray.js?");

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js":
/*!******************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  \******************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("function _nonIterableSpread() {\n  throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/nonIterableSpread.js?");

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js":
/*!******************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  \******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

eval("var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ \"./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js\");\n\nvar iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ \"./node_modules/@babel/runtime/helpers/iterableToArray.js\");\n\nvar unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ \"./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js\");\n\nvar nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ \"./node_modules/@babel/runtime/helpers/nonIterableSpread.js\");\n\nfunction _toConsumableArray(arr) {\n  return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/toConsumableArray.js?");

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
/*!***************************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  \***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

eval("var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ \"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n  if (!o) return;\n  if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n  var n = Object.prototype.toString.call(o).slice(8, -1);\n  if (n === \"Object\" && o.constructor) n = o.constructor.name;\n  if (n === \"Map\" || n === \"Set\") return Array.from(o);\n  if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js?");

/***/ })

/******/ });