function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b * @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL * @license https://opensource.org/licenses/MIT The MIT License * * Don't forget to prefix your containers with your own identifier * to avoid any conflicts with others containers. */$(function(){function a(a){if(this.idStorageKey="retailCRM_uploadOrdersIds",this.form=$("input[name=RETAILCRM_UPLOAD_ORDERS_ID]").closest("form").get(0),"undefined"==typeof this.form)return!1;this.input=$(this.form).find("input[name=\"RETAILCRM_UPLOAD_ORDERS_ID\"]").get(0),this.submitButton=$(this.form).find("button[id=\"upload-orders-submit\"]").get(0),this.submitAction=this.submitAction.bind(this),this.partitionId=this.partitionId.bind(this),this.setLoading=this.setLoading.bind(this),this.tabController=a,$(this.submitButton).click(this.submitAction);var b=localStorage.getItem(this.idStorageKey);null!==b&&($(this.input).val(b),localStorage.removeItem(this.idStorageKey))}a.prototype.submitAction=function(a){a.preventDefault();var b=$(this.input).val(),c=this.partitionId(b.toString().replace(/\s+/g,""));return 0!==c.length&&void(this.setLoading(!0),localStorage.setItem(this.idStorageKey,b),this.tabController.storeTabInAction(this.form),$(this.form).submit())},a.prototype.setLoading=function(a){var b=$("#retailcrm-loading-fade");0===b.length&&($("body").append("\n
\n
\n
\n ").trim()),b=$("#retailcrm-loading-fade")),b.css("visibility",a?"visible":"hidden")},a.prototype.partitionId=function(a){if(""===a)return[];var b=a.split(","),c=b.filter(function(a){return-1===a.toString().indexOf("-")}),d=b.filter(function(a){return-1!==a.toString().indexOf("-")}),e=[];return d.forEach(function(a){var b=a.split("-");e=[].concat(_toConsumableArray(e),_toConsumableArray(_toConsumableArray(Array(+b[1]+1).keys()).slice(+b[0],+b[1]+1)))}),[].concat(_toConsumableArray(c),_toConsumableArray(e)).map(function(a){return+a}).sort(function(c,a){return c-a})},window.RetailcrmUploadForm=a});