(()=>{function t(t,a){for(var e=0;e<a.length;e++){var n=a[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=function(){function a(){!function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,a)}var e,n;return e=a,(n=[{key:"init",value:function(){$(document).on("click",".shipment-actions .applist-menu a",(function(t){t.preventDefault();var a=$(t.currentTarget);$("#confirm-change-shipment-status-button").data("target",a.data("target")).data("status",a.data("value"));var e=$("#confirm-change-status-modal");e.find(".shipment-status-label").text(a.text().toLowerCase()),e.modal("show")})),$(document).on("click","#confirm-change-shipment-status-button",(function(t){t.preventDefault();var a=$(t.currentTarget);a.addClass("button-loading"),$.ajax({type:"POST",cache:!1,url:a.data("target"),data:{status:a.data("status")},success:function(t){t.error?(Botble.showError(t.message),a.removeClass("button-loading")):(Botble.showSuccess(t.message),$(".max-width-1200").load(window.location.href+" .max-width-1200 > *",(function(){$("#confirm-change-status-modal").modal("hide"),a.removeClass("button-loading")})))},error:function(t){Botble.handleError(t),a.removeClass("button-loading")}})}))}}])&&t(e.prototype,n),a}();$(document).ready((function(){(new a).init()}))})();
