/******/!function(t){function e(a){if(n[a])return n[a].exports;var i=n[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,e),i.l=!0,i.exports}// webpackBootstrap
/******/
var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,a){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=15)}([,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(10),i=n.n(a),o=n(7),r=n.n(o),s=n(6),l=n.n(s),d=n(9),u=n.n(d),c=n(8),f=n.n(c);(0,window.$)(function(){document.querySelectorAll(".js-grid").forEach(function(t){var e=new i.a(t.dataset.gridId);e.addExtension(new u.a),e.addExtension(new r.a),e.addExtension(new l.a),e.addExtension(new f.a)})})},function(t,e){/*! jquery.tablednd.js 30-12-2017 */
!function(t,e,n,a){var i="touchstart mousedown",o="touchmove mousemove",r="touchend mouseup";t(n).ready(function(){function e(t){for(var e={},n=t.match(/([^;:]+)/g)||[];n.length;)e[n.shift()]=n.shift().trim();return e}t("table").each(function(){"dnd"===t(this).data("table")&&t(this).tableDnD({onDragStyle:t(this).data("ondragstyle")&&e(t(this).data("ondragstyle"))||null,onDropStyle:t(this).data("ondropstyle")&&e(t(this).data("ondropstyle"))||null,onDragClass:void 0===t(this).data("ondragclass")&&"tDnD_whileDrag"||t(this).data("ondragclass"),onDrop:t(this).data("ondrop")&&new Function("table","row",t(this).data("ondrop")),onDragStart:t(this).data("ondragstart")&&new Function("table","row",t(this).data("ondragstart")),onDragStop:t(this).data("ondragstop")&&new Function("table","row",t(this).data("ondragstop")),scrollAmount:t(this).data("scrollamount")||5,sensitivity:t(this).data("sensitivity")||10,hierarchyLevel:t(this).data("hierarchylevel")||0,indentArtifact:t(this).data("indentartifact")||'
',autoWidthAdjust:t(this).data("autowidthadjust")||!0,autoCleanRelations:t(this).data("autocleanrelations")||!0,jsonPretifySeparator:t(this).data("jsonpretifyseparator")||"\t",serializeRegexp:t(this).data("serializeregexp")&&new RegExp(t(this).data("serializeregexp"))||/[^\-]*$/,serializeParamName:t(this).data("serializeparamname")||!1,dragHandle:t(this).data("draghandle")||null})})}),jQuery.tableDnD={currentTable:null,dragObject:null,mouseOffset:null,oldX:0,oldY:0,build:function(e){return this.each(function(){this.tableDnDConfig=t.extend({onDragStyle:null,onDropStyle:null,onDragClass:"tDnD_whileDrag",onDrop:null,onDragStart:null,onDragStop:null,scrollAmount:5,sensitivity:10,hierarchyLevel:0,indentArtifact:'
',autoWidthAdjust:!0,autoCleanRelations:!0,jsonPretifySeparator:"\t",serializeRegexp:/[^\-]*$/,serializeParamName:!1,dragHandle:null},e||{}),t.tableDnD.makeDraggable(this),this.tableDnDConfig.hierarchyLevel&&t.tableDnD.makeIndented(this)}),this},makeIndented:function(e){var n,a,i=e.tableDnDConfig,o=e.rows,r=t(o).first().find("td:first")[0],s=0,l=0;if(t(e).hasClass("indtd"))return null;a=t(e).addClass("indtd").attr("style"),t(e).css({whiteSpace:"nowrap"});for(var d=0;dt.vertical&&this.dragObject.parentNode.insertBefore(this.dragObject,e.nextSibling)||00&&t(n).find("td:first").children(":first").remove()&&t(n).data("level",--a),0>e.horizontal&&a=a&&t(n).children(":first").prepend(i.indentArtifact)&&t(n).data("level",++a)},mousemove:function(e){var n,a,i,o,r,s=t(t.tableDnD.dragObject),l=t.tableDnD.currentTable.tableDnDConfig;return e&&e.preventDefault(),!!t.tableDnD.dragObject&&("touchmove"===e.type&&event.preventDefault(),l.onDragClass&&s.addClass(l.onDragClass)||s.css(l.onDragStyle),a=t.tableDnD.mouseCoords(e),o=a.x-t.tableDnD.mouseOffset.x,r=a.y-t.tableDnD.mouseOffset.y,t.tableDnD.autoScroll(a),n=t.tableDnD.findDropTargetRow(s,r),i=t.tableDnD.findDragDirection(o,r),t.tableDnD.moveVerticle(i,n),t.tableDnD.moveHorizontal(i,n),!1)},findDragDirection:function(t,e){var n=this.currentTable.tableDnDConfig.sensitivity,a=this.oldX,i=this.oldY,o=a-n,r=a+n,s=i-n,l=i+n,d={horizontal:t>=o&&t<=r?0:t>a?-1:1,vertical:e>=s&&e<=l?0:e>i?-1:1};return 0!==d.horizontal&&(this.oldX=t),0!==d.vertical&&(this.oldY=e),d},findDropTargetRow:function(e,n){for(var a=0,i=this.currentTable.rows,o=this.currentTable.tableDnDConfig,r=0,s=null,l=0;lr-a&&n1&&t(this.currentTable.rows).each(function(){if((s=t(this).data("level"))>1)for(i=t(this).prev().data("level");s>i+1;)t(this).find("td:first").children(":first").remove(),t(this).data("level",--s)}),e.onDragClass&&t(a).removeClass(e.onDragClass)||t(a).css(e.onDropStyle),this.dragObject=null,e.onDrop&&this.originalOrder!==this.currentOrder()&&t(a).hide().fadeIn("fast")&&e.onDrop(this.currentTable,a),e.onDragStop&&e.onDragStop(this.currentTable,a),this.currentTable=null},mouseup:function(e){return e&&e.preventDefault(),t.tableDnD.processMouseup(),!1},jsonize:function(t){var e=this.currentTable;return t?JSON.stringify(this.tableData(e),null,e.tableDnDConfig.jsonPretifySeparator):JSON.stringify(this.tableData(e))},serialize:function(){return t.param(this.tableData(this.currentTable))},serializeTable:function(t){for(var e="",n=t.tableDnDConfig.serializeParamName||t.id,a=t.rows,i=0;i0&&(e+="&");var o=a[i].id;o&&t.tableDnDConfig&&t.tableDnDConfig.serializeRegexp&&(o=o.match(t.tableDnDConfig.serializeRegexp)[0],e+=n+"[]="+o)}return e},serializeTables:function(){var e=[];return t("table").each(function(){this.id&&e.push(t.param(t.tableDnD.tableData(this)))}),e.join("&")},tableData:function(e){var n,a,i,o,r=e.tableDnDConfig,s=[],l=0,d=0,u=null,c={};if(e||(e=this.currentTable),!e||!e.rows||!e.rows.length)return{error:{code:500,message:"Not a valid table."}};if(!e.id&&!r.serializeParamName)return{error:{code:500,message:"No serializable unique id provided."}};o=r.autoCleanRelations&&e.rows||t.makeArray(e.rows),a=r.serializeParamName||e.id,i=a,n=function(t){return t&&r&&r.serializeRegexp?t.match(r.serializeRegexp)[0]:t},c[i]=[],!r.autoCleanRelations&&t(o[0]).data("level")&&o.unshift({id:"undefined"});for(var f=0;fl)s.push([i,l]),i=n(o[f-1].id);else if(d=l&&(s[h][1]=0);l=d,t.isArray(c[i])||(c[i]=[]),(u=n(o[f].id))&&c[i].push(u)}else(u=n(o[f].id))&&c[i].push(u);return c}},jQuery.fn.extend({tableDnD:t.tableDnD.build,tableDnDUpdate:t.tableDnD.updateTables,tableDnDSerialize:t.proxy(t.tableDnD.serialize,t.tableDnD),tableDnDSerializeAll:t.tableDnD.serializeTables,tableDnDData:t.proxy(t.tableDnD.tableData,t.tableDnD)})}(jQuery,window,window.document)},function(t,e,n){"use strict";function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n",{action:t.data("url"),method:n?e:"POST"}).appendTo("body");n||a.append(l("",{type:"_hidden",name:"_method",value:e})),a.submit()}},{key:"showConfirmModal",value:function(t,e,n,a,i){var o=this,s=t.data("confirmButtonLabel"),l=t.data("closeButtonLabel"),d=t.data("confirmButtonClass");new r.default({id:e.getId()+"-grid-confirm-modal",confirmTitle:a,confirmMessage:n,confirmButtonLabel:s,closeButtonLabel:l,confirmButtonClass:d},function(){return o.postForm(t,i)}).show()}}]),t}();e.default=d},function(t,e,n){"use strict";function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
n(2);var r=window,s=r.$,l=function(){function t(){var e=this;return a(this,t),{extend:function(t){return e.extend(t)}}}return o(t,[{key:"extend",value:function(t){var e=this;this.grid=t,this.addIdsToGridTableRows(),t.getContainer().find(".js-grid-table").tableDnD({onDragClass:"position-row-while-drag",dragHandle:".js-drag-handle",onDrop:function(t,n){return e.handlePositionChange(n)}}),t.getContainer().find(".js-drag-handle").hover(function(){s(this).closest("tr").addClass("hover")},function(){s(this).closest("tr").removeClass("hover")})}},{key:"handlePositionChange",value:function(t){var e=s(t).find(".js-"+this.grid.getId()+"-position:first"),n=e.data("update-url"),a=e.data("update-method"),i=this.getRowsPositions(),o={positions:i};this.updatePosition(n,o,a)}},{key:"getRowsPositions",value:function(){for(var t=JSON.parse(s.tableDnD.jsonize()),e=t[this.grid.getId()+"_grid_table"],n=[],a=void 0,i=0;i",{action:t,method:a?n:"POST"}).appendTo("body"),o=e.positions.length,r=void 0,l=0;l",{type:"hidden",name:"positions["+l+"][rowId]",value:r.rowId}),s("",{type:"hidden",name:"positions["+l+"][oldPosition]",value:r.oldPosition}),s("",{type:"hidden",name:"positions["+l+"][newPosition]",value:r.newPosition}));a||i.append(s("",{type:"hidden",name:"_method",value:n})),i.submit()}},{key:"computeMappingBetweenOldAndNewPositions",value:function(t){for(var e=/^row_(\d+)_(\d+)$/,n=Array(t.length).fill().map(Object),a=0;a
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
var r=window,s=r.$},,,,function(t,e,n){t.exports=n(1)}]);