function sllwSetupList(t){t(".simple-link-list").sortable({items:".list-item",opacity:.6,cursor:"n-resize",axis:"y",handle:".moving-handle",placeholder:"sortable-placeholder",start:function(t,e){e.placeholder.height(e.helper.height())}}),t(".simple-link-list .moving-handle").disableSelection()}function sllwSetupHandlers(t){t("body").on("click.sllw",".sllw-delete",function(){t(this).parent().parent().fadeOut(500,function(){var e=t(this).parents(".widget-content");t(this).remove();var i=e.find(".simple-link-list .list-item").length,l=e.find(".amount");l.val(i)})}),t("body").on("click.sllw",".sllw-add",function(){var e=t(this).parent().parent(),i=e.find(".simple-link-list .list-item").length+1;e.find(".amount").val(i);var l=e.find(".simple-link-list .list-item:last-child").clone(),n=l.attr("id");l.attr("id",increment_last_num(n)),t(".toggled-off",l).removeClass("toggled-off"),t(".number",l).html(i),t(".item-title",l).html(""),t("label",l).each(function(){var e=t(this).attr("for");t(this).attr("for",increment_last_num(e))}),t("input",l).each(function(){var e=t(this).attr("id"),i=t(this).attr("name");t(this).attr("id",increment_last_num(e)),t(this).attr("name",increment_last_num(i)),t(":checked",this)&&t(this).removeAttr("checked"),t(this).val("")}),e.find(".simple-link-list").append(l)}),t("body").on("click.sllw",".moving-handle",function(){t(this).parent().find(".sllw-edit-item").slideToggle(200)})}function increment_last_num(t){return t.replace(/[0-9]+(?!.*[0-9])/,function(t){return parseInt(t,10)+1})}function updateOrder(t){t.parents(".widget-content")}jQuery(document).ready(function(t){t("body").hasClass("widgets_access")||(sllwSetupList(t),t(".sllw-edit-item").addClass("toggled-off"),sllwSetupHandlers(t)),t(document).ajaxSuccess(function(){sllwSetupList(t),t(".sllw-edit-item").addClass("toggled-off")})});