!function t(e,i,n){function o(r,a){if(!i[r]){if(!e[r]){var l="function"==typeof require&&require;if(!a&&l)return l(r,!0);if(s)return s(r,!0);var d=new Error("Cannot find module '"+r+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[r]={exports:{}};e[r][0].call(h.exports,function(t){var i=e[r][1][t];return o(i?i:t)},h,h.exports,t,e,i,n)}return i[r].exports}for(var s="function"==typeof require&&require,r=0;r<n.length;r++)o(n[r]);return o}({1:[function(t,e,i){(function(n){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),a="undefined"!=typeof window?window.django.jQuery:"undefined"!=typeof n?n.django.jQuery:null,l=o(a),d=t("./regexquote"),h=o(d),u=t("./utils"),f=o(u),c="undefined"!=typeof window?window.grappelli:"undefined"!=typeof n?n.grappelli:null,p=o(c),m="djangoFormset",g=function(){function t(e){s(this,t),this.opts={emptyClass:"empty-form grp-empty-form djn-empty-form",predeleteClass:"grp-predelete"},this.$inline=(0,l["default"])(e),this.prefix=this.$inline.djangoFormsetPrefix(),this._$totalForms=this.$inline.find("#id_"+this.prefix+"-TOTAL_FORMS"),this._$totalForms.attr("autocomplete","off"),this._$template=(0,l["default"])("#"+this.prefix+"-empty");var i=this.$inline.djnData("inlineModel");this.opts=l["default"].extend({},this.opts,{addButtonSelector:".djn-add-handler.djn-model-"+i,removeButtonSelector:".djn-remove-handler.djn-model-"+i,deleteButtonSelector:".djn-delete-handler.djn-model-"+i,formClass:"dynamic-form grp-dynamic-form djn-dynamic-form-"+i,formClassSelector:".djn-dynamic-form-"+i}),f["default"].initRelatedFields(this.prefix,this.$inline.djnData()),f["default"].initAutocompleteFields(this.prefix,this.$inline.djnData()),this._bindEvents(),this._initializeForms(),this.$inline.find('.djn-items:not([id*="-empty"])').trigger("djnesting:init"),this.$inline.find('.djn-group[id$="-group"][id^="'+this.prefix+'"][data-inline-formset]:not([id*="-empty"])').each(function(){(0,l["default"])(this)[m]()}),this.$inline.is(".djn-group-root")&&f["default"].createSortable(this.$inline),(0,l["default"])(document).trigger("djnesting:initialized",[this.$inline,this])}return r(t,[{key:"_initializeForms",value:function(){var t=this.mgmtVal("TOTAL_FORMS"),e=this.mgmtVal("MAX_NUM_FORMS");e<=t&&this.$inline.find(this.opts.addButtonSelector).parents(".djn-add-item").hide();for(var i=0;i<t;i++)this._initializeForm("#"+this.prefix+"-"+i)}},{key:"_initializeForm",value:function(t){var e=(0,l["default"])(t),i=e.djangoFormPrefix();e.addClass(this.opts.formClass),e.hasClass("has_original")&&(0,l["default"])("#id_"+i+"DELETE:checked").toggleClass(this.opts.predeleteClass);var n=this.mgmtVal("MIN_NUM_FORMS"),o=this.mgmtVal("TOTAL_FORMS"),s=this,r=o<=n;this.$inline.djangoFormsetForms().each(function(){var t=r?"hide":"show";(0,l["default"])(this).find(s.opts.removeButtonSelector)[t]()})}},{key:"_bindEvents",value:function(t){var e=this;"undefined"==typeof t&&(t=this.$inline),t.find(this.opts.addButtonSelector).off("click.djnesting").on("click.djnesting",function(t){t.preventDefault(),t.stopPropagation(),e.add()}),t.find(this.opts.removeButtonSelector).filter(function(){return!(0,l["default"])(this).closest(".djn-empty-form").length}).off("click.djnesting").on("click.djnesting",function(t){t.preventDefault(),t.stopPropagation();var i=(0,l["default"])(this).closest(e.opts.formClassSelector);e.remove(i)});var i=function(t){t.preventDefault(),t.stopImmediatePropagation();var i=(0,l["default"])(this).closest(e.opts.formClassSelector),n=(0,l["default"])("#id_"+i.djangoFormPrefix()+"DELETE");n.is(":checked")?e.undelete(i):e["delete"](i)},n=t.find(this.opts.deleteButtonSelector).filter(function(){return!(0,l["default"])(this).closest(".djn-empty-form").length});n.off("click.djnesting").on("click.djnesting",i),n.find('[id$="-DELETE"]').on("mousedown.djnesting",i)}},{key:"remove",value:function(t){var e=(0,l["default"])(t),i=this.mgmtVal("TOTAL_FORMS"),n=this.mgmtVal("MIN_NUM_FORMS"),o=this.mgmtVal("MAX_NUM_FORMS"),s=e.djangoFormIndex(),r=e.data("isInitial");e.remove(),i-=1,this.mgmtVal("TOTAL_FORMS",i),o-i>=0&&this.$inline.find(this.opts.addButtonSelector).parents(".djn-add-item").show(),this._fillGap(s,r);var a=this,d=i<=n;this.$inline.djangoFormsetForms().each(function(){var t=d?"hide":"show";(0,l["default"])(this).find(a.opts.removeButtonSelector)[t]()}),f["default"].updatePositions(this.prefix),(0,l["default"])(document).trigger("djnesting:mutate",[this.$inline]),(0,l["default"])(document).trigger("formset:removed",[e,this.prefix])}},{key:"delete",value:function(t){var e=this,i=(0,l["default"])(t),n=i.djangoFormPrefix(),o=(0,l["default"])("#id_"+n+"DELETE");i.hasClass(this.opts.predeleteClass)||i.data("isInitial")&&(o.attr("checked","checked"),o.length&&(o[0].checked=!0),i.addClass(this.opts.predeleteClass),i.find(".djn-group").each(function(){var t=(0,l["default"])(this),i=t.djangoFormset();t.djangoFormsetForms().each(function(){(0,l["default"])(this).hasClass(e.opts.predeleteClass)?(0,l["default"])(this).data("alreadyDeleted",!0):i["delete"](this)})}),i.find(".cropduster-form").each(function(){var t=(0,l["default"])(this).djangoFormsetPrefix()+"-0-",e=(0,l["default"])("#id_"+t+"DELETE");e.attr("checked","checked"),e.length&&(e[0].checked=!0)}),f["default"].updatePositions(this.prefix),(0,l["default"])(document).trigger("djnesting:mutate",[this.$inline]),(0,l["default"])(document).trigger("formset:deleted",[i,this.prefix]))}},{key:"undelete",value:function(t){var e=(0,l["default"])(t),i=e.djangoFormPrefix(),n=(0,l["default"])("#id_"+i+"DELETE");e.parent().closest("."+this.opts.predeleteClass).length||(e.hasClass("has_original")&&(n.removeAttr("checked"),n.length&&(n[0].checked=!1),e.removeClass(this.opts.predeleteClass)),e.data("alreadyDeleted",!1),e.find(".djn-group").each(function(){var t=(0,l["default"])(this),e=t.djangoFormset();t.djangoFormsetForms().each(function(){(0,l["default"])(this).data("alreadyDeleted")?(0,l["default"])(this).data("alreadyDeleted",!1):e.undelete(this)})}),e.find(".cropduster-form").each(function(){var t=(0,l["default"])(this).djangoFormsetPrefix()+"-0-",e=(0,l["default"])("#id_"+t+"DELETE");e.removeAttr("checked"),e.length&&(e[0].checked=!1)}),f["default"].updatePositions(this.prefix),(0,l["default"])(document).trigger("djnesting:mutate",[this.$inline]),(0,l["default"])(document).trigger("formset:undeleted",[e,this.prefix]))}},{key:"add",value:function(t){var e=this,i=this._$template.clone(!0),n=this.mgmtVal("TOTAL_FORMS"),o=this.mgmtVal("MAX_NUM_FORMS"),s=this.$inline.hasClass("djn-group-nested");return(0,l["default"])(document).trigger("djnesting:beforeadded",[this.$inline,i]),i.removeClass(this.opts.emptyClass),i.addClass("djn-item"),i.attr("id",i.attr("id").replace("-empty","-"+n)),s&&i.append(f["default"].createContainerElement()),f["default"].updateFormAttributes(i,new RegExp("([\\#_]|^)"+(0,h["default"])(this.prefix)+"\\-(?:__prefix__|empty)\\-","g"),"$1"+this.prefix+"-"+n+"-"),i.insertBefore(this._$template),this.mgmtVal("TOTAL_FORMS",n+1),o-(n+1)<=0&&this.$inline.find(this.opts.addButtonSelector).parents(".djn-add-item").hide(),f["default"].updatePositions(this.prefix),l["default"].isNumeric(t)?this.spliceInto(i,t,!0):(0,l["default"])(document).trigger("djnesting:mutate",[this.$inline]),p["default"]&&p["default"].reinitDateTimeFields(i),f["default"].DjangoInlines.initPrepopulatedFields(i),f["default"].DjangoInlines.reinitDateTimeShortCuts(),f["default"].DjangoInlines.updateSelectFilter(i),f["default"].initRelatedFields(this.prefix),f["default"].initAutocompleteFields(this.prefix),l["default"].fn.grp_collapsible&&i.find(".collapse").andSelf().grp_collapsible({toggle_handler_slctr:".grp-collapse-handler:first",closed_css:"closed grp-closed",open_css:"open grp-open",on_toggle:function(){(0,l["default"])(document).trigger("djnesting:toggle",[e.$inline])}}),"function"==typeof l["default"].fn.curated_content_type&&i.find(".curated-content-type-select").each(function(){(0,l["default"])(this).curated_content_type()}),this._initializeForm(i),this._bindEvents(i),i.find('.djn-group[id$="-group"][id^="'+this.prefix+'"][data-inline-formset]:not([id*="-empty"])').each(function(){(0,l["default"])(this)[m]()}),(0,l["default"])(document).trigger("djnesting:added",[this.$inline,i]),(0,l["default"])(document).trigger("formset:added",[i,this.prefix]),i}},{key:"_fillGap",value:function(t,e){var i,n,o=this.$inline.djangoFormsetForms().toArray();o.sort(function(t,e){return(0,l["default"])(t).djangoFormIndex()-(0,l["default"])(e).djangoFormIndex()}),o.forEach(function(e){var o=(0,l["default"])(e),s=o.djangoFormIndex();s<=t||(o.data("isInitial")?i=o:n=o)});var s=e?i||n:n;if(s){var r=s.djangoFormIndex(),a=new RegExp("([\\#_]|^)"+(0,h["default"])(this.prefix+"-"+r)+"(?!\\-\\d)");s.attr("id",this.prefix+"-"+t),f["default"].updateFormAttributes(s,a,"$1"+this.prefix+"-"+t),s.find(".djn-group").each(function(){var t=(0,l["default"])(this),e=t.djangoFormset();e.prefix=t.djangoFormsetPrefix()}),(0,l["default"])(document).trigger("djnesting:attrchange",[this.$inline,s]),e&&i&&n&&this._fillGap(r,!1)}}},{key:"_makeRoomForInsert",value:function(){var t=this.mgmtVal("INITIAL_FORMS"),e=this.mgmtVal("TOTAL_FORMS"),i=t,n=(0,l["default"])("#"+this.prefix+"-"+i);if(n.length){var o=new RegExp("([\\#_]|^)"+(0,h["default"])(this.prefix)+"-"+i+"(?!\\-\\d)");n.attr("id",this.prefix+"-"+e),f["default"].updateFormAttributes(n,o,"$1"+this.prefix+"-"+e),n.find(".djn-group").each(function(){var t=(0,l["default"])(this),e=t.djangoFormset();e.prefix=t.djangoFormsetPrefix()}),(0,l["default"])(document).trigger("djnesting:attrchange",[this.$inline,n])}}},{key:"spliceInto",value:function(t,e,i){var n,o,s=this.mgmtVal("INITIAL_FORMS"),r=this.mgmtVal("TOTAL_FORMS"),a=t.djangoFormsetPrefix(),d=this.prefix,u=t.data("isInitial");if(t.djangoFormsetPrefix()==this.prefix){var c=t.prevAll(".djn-item:not(.djn-no-drag,.djn-thead)").length;if(c===e||"undefined"==typeof e)return void f["default"].updatePositions(d);o=this.$inline.find("> .djn-items, > .tabular > .module > .djn-items").find("> .djn-item:not(#"+t.attr("id")+")").eq(e),o.after(t)}else{var p=(0,l["default"])("#"+a+"-group"),m=t.closest(".djn-group");m.djangoFormsetPrefix()!=d&&(o=this.$inline.find("> .djn-items, > .tabular > .module > .djn-items").find("> .djn-item").eq(e),o.after(t));var g=p.djangoFormset();if(g.mgmtVal("TOTAL_FORMS",g.mgmtVal("TOTAL_FORMS")-1),g._fillGap(t.djangoFormIndex(),u),u){g.mgmtVal("INITIAL_FORMS",g.mgmtVal("INITIAL_FORMS")-1);var v=this.$inline.parent().closest(".djn-group");if(v.length){var _=this.$inline.closest(".djn-inline-form"),y=(v.djnData("fieldNames")||{}).pk,b=_.djangoFormField(y);b.val()||(t.data("isInitial",!1),t.attr("data-is-initial","false"),u=!1,setTimeout(function(){t.find('[name^="'+t.djangoFormPrefix()+'"][name$="-INITIAL_FORMS"]').val("0").trigger("change")},0))}}u&&this._makeRoomForInsert();var w=new RegExp("([\\#_]|^)"+(0,h["default"])(t.attr("id"))+"(?!\\-\\d)");n=u?s:r,t.attr("id",d+"-"+n),f["default"].updateFormAttributes(t,w,"$1"+d+"-"+n),t.find(".djn-group").each(function(){var t=(0,l["default"])(this),e=t.djangoFormset();e.prefix=t.djangoFormsetPrefix()}),(0,l["default"])(document).trigger("djnesting:attrchange",[this.$inline,t]),u&&this.mgmtVal("INITIAL_FORMS",s+1),this.mgmtVal("TOTAL_FORMS",r+1),f["default"].updatePositions(a),(0,l["default"])(document).trigger("djnesting:mutate",[p])}f["default"].updatePositions(d),i||(0,l["default"])(document).trigger("djnesting:mutate",[this.$inline])}},{key:"mgmtVal",value:function(t,e){var i=this.$inline.find("#id_"+this.prefix+"-"+t);return"undefined"==typeof e?parseInt(i.val(),10):parseInt(i.val(e).trigger("change").val(),10)}}]),t}();l["default"].fn[m]=function(){var t,e,i,n=this.eq(0);if(0===arguments.length||1===arguments.length&&"string"!=l["default"].type(arguments[0])){t=arguments[0];var o=n.data(m);return o||(o=new g(n,t),n.data(m,o)),o}if(e=arguments[0],i=l["default"].makeArray(arguments).slice(1),e in g.prototype)return n.data(m)[e](i);throw new Error("Unknown function call "+e+" for $.fn."+m)},i["default"]=g,e.exports=i["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./regexquote":5,"./utils":7}],2:[function(t,e,i){(function(t){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(){function t(t,e){var i=[],n=!0,o=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(n=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(l){o=!0,s=l}finally{try{!n&&a["return"]&&a["return"]()}finally{if(o)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o="undefined"!=typeof window?window.django.jQuery:"undefined"!=typeof t?t.django.jQuery:null,s=e(o),r={};s["default"].fn.djnData=function(t){var e=(0,s["default"])(this).data("inlineFormset")||{},i=e.nestedOptions||{};return t?i[t]:i},s["default"].fn.djangoPrefixIndex=function(){var t,e,i,o,s,a,l,d=this.length>1?this.first():this,h=d.attr("id"),u=d.attr("name"),f=d.attr("for");if((a=r[h])||(a=r[u])||(a=r[f]))return a;if(h&&!t&&(t=(h.match(/^(.*)\-group$/)||[null,null])[1]),h&&!t&&d.is(".djn-item")&&h.match(/\d+$/)){var c=h.match(/(.*?)\-(\d+)$/)||[null,null,null],p=n(c,3);s=p[0],t=p[1],l=p[2]}if(t){if("id_"==t.substr(0,3)&&(t=t.substr(3)),!document.getElementById(t+"-group"))return null}else if(e=d.closest(".djn-inline-form"),e.length){var m=e.attr("id").match(/(.*?)\-(\d+)$/)||[null,null,null],g=n(m,3);s=g[0],t=g[1],l=g[2]}else{if(i=d.closest(".djn-group"),!i.length)return null;o=i.attr("id")||"",t=(o.match(/^(.*)\-group$/)||[null,null])[1]}return s&&(r[s]=[t,l]),[t,l]},s["default"].fn.djangoFormPrefix=function(){var t=this.djangoPrefixIndex();return t&&t[1]?t[0]+"-"+t[1]+"-":null},s["default"].fn.djangoFormIndex=function(){var t=this.djangoPrefixIndex();return t&&t[1]?parseInt(t[1],10):null},s["default"].fn.djangoFormsetPrefix=function(){var t=this.djangoPrefixIndex();return t?t[0]:null};var a=function(t,e,i){var n=t.getAttribute("id"),o=n.substr(i.length+1);return 0===n.indexOf(i)&&!o.match(/\D/)};if(s["default"].fn.djangoFormsetForms=function(){var t=[];return this.each(function(){var e,i=(0,s["default"])(this),n=i.djangoFormsetPrefix(),o=n?(0,s["default"])("#"+n+"-group"):null;if(n&&o.length){e=o.find(".djn-inline-form").filter(function(){return a(this,o,n)});var r=e.toArray().sort(function(t,e){return(0,s["default"])(t).djangoFormIndex()-(0,s["default"])(e).djangoFormIndex});Array.prototype.push.apply(t,r)}}),this.pushStack(t)},"function"!=typeof s["default"].djangoFormField&&(s["default"].djangoFormField=function(t,e,i){var n,o=(0,s["default"])([]);if((n=e.match(/^(.+)\-(\d+)\-$/))&&(e=n[1],i=n[2]),i=parseInt(i,10),isNaN(i))return o;var r=e+"-"+i+"-";if("*"==t)return(0,s["default"])('*[name^="'+r+'"]').filter(function(){var t=(0,s["default"])(this).attr("name").substring(r.length);return t.indexOf("-")===-1});var a=(0,s["default"])("#id_"+r+t);if(!a.length&&("pk"==t||"position"==t)){var l=(0,s["default"])("#"+e+"-group"),d=l.djnData("fieldNames")||{};if(t=d[t],!t)return o;a=(0,s["default"])("#id_"+r+t)}return a}),"function"!=typeof s["default"].fn.djangoFormField&&(s["default"].fn.djangoFormField=function(t,e){var i=this.djangoPrefixIndex(),n=(0,s["default"])([]);if(!i)return n;var o=i[0];return"undefined"==typeof e&&(e=i[1],"undefined"==typeof e)?n:s["default"].djangoFormField(t,o,e)}),"function"!=typeof s["default"].fn.filterDjangoField){var l={};s["default"].fn.filterDjangoField=function(t,e,n){var o,r;if("undefined"!=typeof n){if("string"==typeof n&&(n=parseInt(n,10)),"number"==typeof n&&!isNaN(n)){var a="id_"+t+"-"+n+"-"+e;o=(0,s["default"])("#"+a)}}else"object"!=i(l[t])&&(l[t]={}),"undefined"==typeof l[t][e]&&(l[t][e]=new RegExp("^"+t+"-\\d+-"+e+"$")),o=this.find('input[name$="'+e+'"]').filter(function(){return this.getAttribute("name").match(l[t][e])});return o.length||"pk"!=e&&"position"!=e||(r=(0,s["default"])("#"+t+"-group").djnData("fieldNames")||{},i(r[e])&&r[e]!=e&&(o=(0,s["default"])(this).filterDjangoField(t,r[e],n))),o}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(t,e,i){(function(t){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}var i="undefined"!=typeof window?window.django.jQuery:"undefined"!=typeof t?t.django.jQuery:null,n=e(i);if(void 0===n["default"].ui){var o=n["default"];!function(t,e){function i(e,i){var o,s,r,a=e.nodeName.toLowerCase();return"area"===a?(o=e.parentNode,s=o.name,!(!e.href||!s||"map"!==o.nodeName.toLowerCase())&&(r=t("img[usemap=#"+s+"]")[0],!!r&&n(r))):(/input|select|textarea|button|object/.test(a)?!e.disabled:"a"===a?e.href||i:i)&&n(e)}function n(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var o=0,s=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(i,n){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),n&&n.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var n,o,s=t(this[0]);s.length&&s[0]!==document;){if(n=s.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(o=parseInt(s.css("zIndex"),10),!isNaN(o)&&0!==o))return o;s=s.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++o)})},removeUniqueId:function(){return this.each(function(){s.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,n){return!!t.data(e,n[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var n=t.attr(e,"tabindex"),o=isNaN(n);return(o||n>=0)&&i(e,!o)}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(i,n){function o(e,i,n,o){return t.each(s,function(){i-=parseFloat(t.css(e,"padding"+this))||0,n&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var s="Width"===n?["Left","Right"]:["Top","Bottom"],r=n.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+n]=function(i){return i===e?a["inner"+n].call(this):this.each(function(){t(this).css(r,o(this,i)+"px")})},t.fn["outer"+n]=function(e,i){return"number"!=typeof e?a["outer"+n].call(this,e):this.each(function(){t(this).css(r,o(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,n){var o,s=t.ui[e].prototype;for(o in n)s.plugins[o]=s.plugins[o]||[],s.plugins[o].push([i,n[o]])},call:function(t,e,i){var n,o=t.plugins[e];if(o&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",o=!1;return e[n]>0||(e[n]=1,o=e[n]>0,e[n]=0,o)}})}(o),function(t,e){var i=0,n=Array.prototype.slice,o=t.cleanData;t.cleanData=function(e){for(var i,n=0;null!=(i=e[n]);n++)try{t(i).triggerHandler("remove")}catch(s){}o(e)},t.widget=function(i,n,o){var s,r,a,l,d={},h=i.split(".")[0];i=i.split(".")[1],s=h+"-"+i,o||(o=n,n=t.Widget),t.expr[":"][s.toLowerCase()]=function(e){return!!t.data(e,s)},t[h]=t[h]||{},r=t[h][i],a=t[h][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new a(t,i)},t.extend(a,r,{version:o.version,_proto:t.extend({},o),_childConstructors:[]}),l=new n,l.options=t.widget.extend({},l.options),t.each(o,function(i,o){return t.isFunction(o)?(d[i]=function(){var t=function(){return n.prototype[i].apply(this,arguments)},e=function(t){return n.prototype[i].apply(this,t)};return function(){var i,n=this._super,s=this._superApply;return this._super=t,this._superApply=e,i=o.apply(this,arguments),this._super=n,this._superApply=s,i}}(),e):(d[i]=o,e)}),a.prototype=t.widget.extend(l,{widgetEventPrefix:r?l.widgetEventPrefix:i},d,{constructor:a,namespace:h,widgetName:i,widgetFullName:s}),r?(t.each(r._childConstructors,function(e,i){var n=i.prototype;t.widget(n.namespace+"."+n.widgetName,a,i._proto)}),delete r._childConstructors):n._childConstructors.push(a),t.widget.bridge(i,a)},t.widget.extend=function(i){for(var o,s,r=n.call(arguments,1),a=0,l=r.length;l>a;a++)for(o in r[a])s=r[a][o],r[a].hasOwnProperty(o)&&s!==e&&(i[o]=t.isPlainObject(s)?t.isPlainObject(i[o])?t.widget.extend({},i[o],s):t.widget.extend({},s):s);return i},t.widget.bridge=function(i,o){var s=o.prototype.widgetFullName||i;t.fn[i]=function(r){var a="string"==typeof r,l=n.call(arguments,1),d=this;return r=!a&&l.length?t.widget.extend.apply(null,[r].concat(l)):r,a?this.each(function(){var n,o=t.data(this,s);return o?t.isFunction(o[r])&&"_"!==r.charAt(0)?(n=o[r].apply(o,l),n!==o&&n!==e?(d=n&&n.jquery?d.pushStack(n.get()):n,!1):e):t.error("no such method '"+r+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+r+"'")}):this.each(function(){var e=t.data(this,s);e?e.option(r||{})._init():t.data(this,s,new o(r,this))}),d}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,n){n=t(n||this.defaultElement||this)[0],this.element=t(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),n!==this&&(t.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===n&&this.destroy()}}),this.document=t(n.style?n.ownerDocument:n.document||n),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,n){var o,s,r,a=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(a={},o=i.split("."),i=o.shift(),o.length){for(s=a[i]=t.widget.extend({},this.options[i]),r=0;o.length-1>r;r++)s[o[r]]=s[o[r]]||{},s=s[o[r]];if(i=o.pop(),n===e)return s[i]===e?null:s[i];s[i]=n}else{if(n===e)return this.options[i]===e?null:this.options[i];a[i]=n}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,n,o){var s,r=this;"boolean"!=typeof i&&(o=n,n=i,i=!1),o?(n=s=t(n),this.bindings=this.bindings.add(n)):(o=n,n=this.element,s=this.widget()),t.each(o,function(o,a){function l(){return i||r.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?r[a]:a).apply(r,arguments):e}"string"!=typeof a&&(l.guid=a.guid=a.guid||l.guid||t.guid++);var d=o.match(/^(\w+)\s*(.*)$/),h=d[1]+r.eventNamespace,u=d[2];u?s.delegate(u,h,l):n.bind(h,l)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?n[t]:t).apply(n,arguments)}var n=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,n){var o,s,r=this.options[e];if(n=n||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],s=i.originalEvent)for(o in s)o in i||(i[o]=s[o]);return this.element.trigger(i,n),!(t.isFunction(r)&&r.apply(this.element[0],[i].concat(n))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(n,o,s){"string"==typeof o&&(o={effect:o});var r,a=o?o===!0||"number"==typeof o?i:o.effect||i:e;o=o||{},"number"==typeof o&&(o={duration:o}),r=!t.isEmptyObject(o),o.complete=s,o.delay&&n.delay(o.delay),r&&t.effects&&t.effects.effect[a]?n[e](o):a!==e&&n[a]?n[a](o.duration,o.easing,s):n.queue(function(i){t(this)[e](),s&&s.call(n[0]),i()})}})}(o),function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var n=this,o=1===i.which,s=!("string"!=typeof this.options.cancel||!i.target.nodeName)&&t(i.target).closest(this.options.cancel).length;return!(o&&!s&&this._mouseCapture(i))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return n._mouseMove(t)},this._mouseUpDelegate=function(t){return n._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0))}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(o),function(t,e){function i(t,e,i){return[parseFloat(t[0])*(c.test(t[0])?e/100:1),parseFloat(t[1])*(c.test(t[1])?i/100:1)]}function n(e,i){return parseInt(t.css(e,i),10)||0}function o(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var s,r=Math.max,a=Math.abs,l=Math.round,d=/left|center|right/,h=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,f=/^\w+/,c=/%$/,p=t.fn.position;t.position={scrollbarWidth:function(){if(s!==e)return s;var i,n,o=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),r=o.children()[0];return t("body").append(o),i=r.offsetWidth,o.css("overflow","scroll"),n=r.offsetWidth,i===n&&(n=o[0].clientWidth),o.remove(),s=i-n},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),n=e.isWindow?"":e.element.css("overflow-y"),o="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,s="scroll"===n||"auto"===n&&e.height<e.element[0].scrollHeight;return{width:s?t.position.scrollbarWidth():0,height:o?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),n=t.isWindow(i[0]);return{element:i,isWindow:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:n?i.width():i.outerWidth(),height:n?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return p.apply(this,arguments);e=t.extend({},e);var s,c,m,g,v,_,y=t(e.of),b=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(b),j=(e.collision||"flip").split(" "),x={};
return _=o(y),y[0].preventDefault&&(e.at="left top"),c=_.width,m=_.height,g=_.offset,v=t.extend({},g),t.each(["my","at"],function(){var t,i,n=(e[this]||"").split(" ");1===n.length&&(n=d.test(n[0])?n.concat(["center"]):h.test(n[0])?["center"].concat(n):["center","center"]),n[0]=d.test(n[0])?n[0]:"center",n[1]=h.test(n[1])?n[1]:"center",t=u.exec(n[0]),i=u.exec(n[1]),x[this]=[t?t[0]:0,i?i[0]:0],e[this]=[f.exec(n[0])[0],f.exec(n[1])[0]]}),1===j.length&&(j[1]=j[0]),"right"===e.at[0]?v.left+=c:"center"===e.at[0]&&(v.left+=c/2),"bottom"===e.at[1]?v.top+=m:"center"===e.at[1]&&(v.top+=m/2),s=i(x.at,c,m),v.left+=s[0],v.top+=s[1],this.each(function(){var o,d,h=t(this),u=h.outerWidth(),f=h.outerHeight(),p=n(this,"marginLeft"),_=n(this,"marginTop"),P=u+p+n(this,"marginRight")+w.width,S=f+_+n(this,"marginBottom")+w.height,I=t.extend({},v),C=i(x.my,h.outerWidth(),h.outerHeight());"right"===e.my[0]?I.left-=u:"center"===e.my[0]&&(I.left-=u/2),"bottom"===e.my[1]?I.top-=f:"center"===e.my[1]&&(I.top-=f/2),I.left+=C[0],I.top+=C[1],t.support.offsetFractions||(I.left=l(I.left),I.top=l(I.top)),o={marginLeft:p,marginTop:_},t.each(["left","top"],function(i,n){t.ui.position[j[i]]&&t.ui.position[j[i]][n](I,{targetWidth:c,targetHeight:m,elemWidth:u,elemHeight:f,collisionPosition:o,collisionWidth:P,collisionHeight:S,offset:[s[0]+C[0],s[1]+C[1]],my:e.my,at:e.at,within:b,elem:h})}),e.using&&(d=function(t){var i=g.left-I.left,n=i+c-u,o=g.top-I.top,s=o+m-f,l={target:{element:y,left:g.left,top:g.top,width:c,height:m},element:{element:h,left:I.left,top:I.top,width:u,height:f},horizontal:0>n?"left":i>0?"right":"center",vertical:0>s?"top":o>0?"bottom":"middle"};u>c&&c>a(i+n)&&(l.horizontal="center"),f>m&&m>a(o+s)&&(l.vertical="middle"),l.important=r(a(i),a(n))>r(a(o),a(s))?"horizontal":"vertical",e.using.call(this,t,l)}),h.offset(t.extend(I,{using:d}))})},t.ui.position={fit:{left:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,a=t.left-e.collisionPosition.marginLeft,l=o-a,d=a+e.collisionWidth-s-o;e.collisionWidth>s?l>0&&0>=d?(i=t.left+l+e.collisionWidth-s-o,t.left+=l-i):t.left=d>0&&0>=l?o:l>d?o+s-e.collisionWidth:o:l>0?t.left+=l:d>0?t.left-=d:t.left=r(t.left-a,t.left)},top:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollTop:n.offset.top,s=e.within.height,a=t.top-e.collisionPosition.marginTop,l=o-a,d=a+e.collisionHeight-s-o;e.collisionHeight>s?l>0&&0>=d?(i=t.top+l+e.collisionHeight-s-o,t.top+=l-i):t.top=d>0&&0>=l?o:l>d?o+s-e.collisionHeight:o:l>0?t.top+=l:d>0?t.top-=d:t.top=r(t.top-a,t.top)}},flip:{left:function(t,e){var i,n,o=e.within,s=o.offset.left+o.scrollLeft,r=o.width,l=o.isWindow?o.scrollLeft:o.offset.left,d=t.left-e.collisionPosition.marginLeft,h=d-l,u=d+e.collisionWidth-r-l,f="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,c="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];0>h?(i=t.left+f+c+p+e.collisionWidth-r-s,(0>i||a(h)>i)&&(t.left+=f+c+p)):u>0&&(n=t.left-e.collisionPosition.marginLeft+f+c+p-l,(n>0||u>a(n))&&(t.left+=f+c+p))},top:function(t,e){var i,n,o=e.within,s=o.offset.top+o.scrollTop,r=o.height,l=o.isWindow?o.scrollTop:o.offset.top,d=t.top-e.collisionPosition.marginTop,h=d-l,u=d+e.collisionHeight-r-l,f="top"===e.my[1],c=f?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,p="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>h?(n=t.top+c+p+m+e.collisionHeight-r-s,t.top+c+p+m>h&&(0>n||a(h)>n)&&(t.top+=c+p+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+c+p+m-l,t.top+c+p+m>u&&(i>0||u>a(i))&&(t.top+=c+p+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,n,o,s,r=document.getElementsByTagName("body")[0],a=document.createElement("div");e=document.createElement(r?"div":"body"),n={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&t.extend(n,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in n)e.style[s]=n[s];e.appendChild(a),i=r||document.documentElement,i.insertBefore(e,i.firstChild),a.style.cssText="position: absolute; left: 10.7432222px;",o=t(a).offset().left,t.support.offsetFractions=o>10&&11>o,e.innerHTML="",i.removeChild(e)}()}(o)}n["default"].widget("ui.djnsortable",n["default"].ui.mouse,{version:"@VERSION",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_isOverAxis:function(t,e,i){return t>=e&&t<e+i},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===t.axis||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display"))),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,e){"disabled"===t?(this.options[t]=e,this.widget().toggleClass("ui-sortable-disabled",!!e)):n["default"].Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,e){var i=this;if(this.reverting)return!1;if(this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(t);var o=null;(0,n["default"])(t.target).parents().each(function(){if(n["default"].data(this,i.widgetName+"-item")==i)return o=(0,n["default"])(this),!1});if(n["default"].data(t.target,i.widgetName+"-item")==i&&(o=(0,n["default"])(t.target)),!o)return!1;if(this.options.handle&&!e){var s=!1;if((0,n["default"])(this.options.handle,o).find("*").andSelf().each(function(){this==t.target&&(s=!0)}),!s)return!1}return this.currentItem=o,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,e,i){var o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},n["default"].extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&((0,n["default"])("body").css("cursor")&&(this._storedCursor=(0,n["default"])("body").css("cursor")),(0,n["default"])("body").css("cursor",o.cursor)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(var s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return n["default"].ui.ddmanager&&(n["default"].ui.ddmanager.current=this),n["default"].ui.ddmanager&&!o.dropBehaviour&&n["default"].ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){if(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll){var e=this.options,i=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<e.scrollSensitivity?this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+e.scrollSpeed:t.pageY-this.overflowOffset.top<e.scrollSensitivity&&(this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-e.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<e.scrollSensitivity?this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+e.scrollSpeed:t.pageX-this.overflowOffset.left<e.scrollSensitivity&&(this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-e.scrollSpeed)):(t.pageY-(0,n["default"])(document).scrollTop()<e.scrollSensitivity?i=(0,n["default"])(document).scrollTop((0,n["default"])(document).scrollTop()-e.scrollSpeed):(0,n["default"])(window).height()-(t.pageY-(0,n["default"])(document).scrollTop())<e.scrollSensitivity&&(i=(0,n["default"])(document).scrollTop((0,n["default"])(document).scrollTop()+e.scrollSpeed)),t.pageX-(0,n["default"])(document).scrollLeft()<e.scrollSensitivity?i=(0,n["default"])(document).scrollLeft((0,n["default"])(document).scrollLeft()-e.scrollSpeed):(0,n["default"])(window).width()-(t.pageX-(0,n["default"])(document).scrollLeft())<e.scrollSensitivity&&(i=(0,n["default"])(document).scrollLeft((0,n["default"])(document).scrollLeft()+e.scrollSpeed))),i!==!1&&n["default"].ui.ddmanager&&!e.dropBehaviour&&n["default"].ui.ddmanager.prepareOffsets(this,t)}this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(var o=this.items.length-1;o>=0;o--){var s=this.items[o],r=s.item[0],a=this._intersectsWithPointer(s);if(a&&s.instance===this.currentContainer&&!(r==this.currentItem[0]||this.placeholder[1==a?"next":"prev"]()[0]==r||n["default"].contains(this.placeholder[0],r)||"semi-dynamic"==this.options.type&&n["default"].contains(this.element[0],r))){if(this.direction=1==a?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),n["default"].ui.ddmanager&&n["default"].ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){if(t){if(n["default"].ui.ddmanager&&!this.options.dropBehaviour&&n["default"].ui.ddmanager.drop(this,t),this.options.revert){var i=this,o=this.placeholder.offset();this.reverting=!0,(0,n["default"])(this.helper).animate({left:o.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:o.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){i._clear(t)})}else this._clear(t,e);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),n["default"].extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?(0,n["default"])(this.domPosition.prev).after(this.currentItem):(0,n["default"])(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},(0,n["default"])(e).each(function(){var e=((0,n["default"])(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);e&&i.push((t.key||e[1]+"[]")+"="+(t.key&&t.expression?e[1]:e[2]))}),!i.length&&t.key&&i.push(t.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push((0,n["default"])(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,n=this.positionAbs.top,o=n+this.helperProportions.height,s=t.left,r=s+t.width,a=t.top,l=a+Math.max(10,t.height),d=this.offset.click.top,h=this.offset.click.left,u=n+d>a&&n+d<l&&e+h>s&&e+h<r;return"pointer"==this.options.tolerance||this.options.forcePointerForContainers||"pointer"!=this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?u:s<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<r&&a<n+this.helperProportions.height/2&&o-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,Math.max(10,t.height)),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=e&&i,o=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return!!n&&(this.floating?s&&"right"==s||"down"==o?2:1:o&&("down"==o?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+Math.max(10,t.height)/2,Math.max(10,t.height)),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"==o&&i||"left"==o&&!i:n&&("down"==n&&e||"up"==n&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e=[],i=[],o=this._connectWith();if(o&&t)for(var s=o.length-1;s>=0;s--)for(var r=(0,n["default"])(o[s]),a=r.length-1;a>=0;a--){var l=n["default"].data(r[a],this.widgetName);l&&l!=this&&!l.options.disabled&&i.push([n["default"].isFunction(l.options.items)?l.options.items.call(l.element):(0,n["default"])(l.options.items,l.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),l])}i.push([n["default"].isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):(0,n["default"])(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var s=i.length-1;s>=0;s--)i[s][0].each(function(){e.push(this)});return(0,n["default"])(e)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=n["default"].grep(this.items,function(e){for(var i=0;i<t.length;i++)if(t[i]==e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e=this.items,i=[[n["default"].isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):(0,n["default"])(this.options.items,this.element),this]],o=this._connectWith();if(o&&this.ready)for(var s=o.length-1;s>=0;s--)for(var r=(0,n["default"])(o[s]),a=r.length-1;a>=0;a--){var l=n["default"].data(r[a],this.widgetName);l&&l!=this&&!l.options.disabled&&(i.push([n["default"].isFunction(l.options.items)?l.options.items.call(l.element[0],t,{item:this.currentItem}):(0,n["default"])(l.options.items,l.element),l]),this.containers.push(l))}for(var s=i.length-1;s>=0;s--)for(var d=i[s][1],h=i[s][0],a=0,u=h.length;a<u;a++){var f=(0,n["default"])(h[a]);f.data(this.widgetName+"-item",d),e.push({item:f,instance:d,width:0,height:0,left:0,top:0})}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var e=this.items.length-1;e>=0;e--){var i=this.items[e];if(i.instance==this.currentContainer||!this.currentContainer||i.item[0]==this.currentItem[0]){var o=this.options.toleranceElement?(0,n["default"])(this.options.toleranceElement,i.item):i.item;t||(i.width=o.outerWidth(),i.height=o.outerHeight());var s=o.offset();i.left=s.left,i.top=s.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var e=this.containers.length-1;e>=0;e--){var s=this.containers[e].element.offset();this.containers[e].containerCache.left=s.left,this.containers[e].containerCache.top=s.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight()}return this},_createPlaceholder:function(t){t=t||this;var e=t.options;if(!e.placeholder||e.placeholder.constructor==String){var i=e.placeholder;e.placeholder={element:function(){var e=(0,n["default"])(document.createElement(t.currentItem[0].nodeName)).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return i||(e.style.visibility="hidden"),e},update:function(n,o){i&&!e.forcePlaceholderSize||(o.height()||o.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),o.width()||o.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}}t.placeholder=(0,n["default"])(e.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),e.placeholder.update(t,t.placeholder)},_contactContainers:function(t){for(var e=null,i=null,o=this.containers.length-1;o>=0;o--)if(!n["default"].contains(this.currentItem[0],this.containers[o].element[0]))if(this._intersectsWith(this.containers[o].containerCache)){if(e&&n["default"].contains(this.containers[o].element[0],e.element[0]))continue;e=this.containers[o],i=o}else this.containers[o].containerCache.over&&(this.containers[o]._trigger("out",t,this._uiHash(this)),this.containers[o].containerCache.over=0);if(e)if(1===this.containers.length)this.containers[i]._trigger("over",t,this._uiHash(this)),this.containers[i].containerCache.over=1;else{for(var s=1e4,r=null,a=this.containers[i].floating?"left":"top",l=this.containers[i].floating?"width":"height",d=this.positionAbs[a]+this.offset.click[a],h=this.items.length-1;h>=0;h--)if(n["default"].contains(this.containers[i].element[0],this.items[h].item[0])&&this.items[h].item[0]!=this.currentItem[0]){var u=this.items[h].item.offset()[a],f=!1;Math.abs(u-d)>Math.abs(u+Math.max(10,this.items[h][l])-d)&&(f=!0,u+=this.items[h][l]),Math.abs(u-d)<s&&(s=Math.abs(u-d),r=this.items[h],this.direction=f?"up":"down")}if(!r&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[i],r?this._rearrange(t,r,null,!0):this._rearrange(t,null,this.containers[i].element,!0),this._trigger("change",t,this._uiHash()),this.containers[i]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[i]._trigger("over",t,this._uiHash(this)),this.containers[i].containerCache.over=1}},_createHelper:function(t){var e=this.options,i=n["default"].isFunction(e.helper)?(0,n["default"])(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"==e.helper?this.currentItem.clone():this.currentItem;return i.parents("body").length||(0,n["default"])("parent"!=e.appendTo?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0]),i[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(""==i[0].style.width||e.forceHelperSize)&&i.width(this.currentItem.width()),(""==i[0].style.height||e.forceHelperSize)&&i.height(this.currentItem.height()),i},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),n["default"].isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&n["default"].contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&n["default"].ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;if("parent"==t.containment&&(t.containment=this.helper[0].parentNode),"document"!=t.containment&&"window"!=t.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,(0,n["default"])("document"==t.containment?document:window).width()-this.helperProportions.width-this.margins.left,((0,n["default"])("document"==t.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),!/^(document|window|parent)$/.test(t.containment)){var e=(0,n["default"])(t.containment)[0],i=(0,n["default"])(t.containment).offset(),o="hidden"!=(0,n["default"])(e).css("overflow");this.containment=[i.left+(parseInt((0,n["default"])(e).css("borderLeftWidth"),10)||0)+(parseInt((0,n["default"])(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt((0,n["default"])(e).css("borderTopWidth"),10)||0)+(parseInt((0,n["default"])(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(o?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt((0,n["default"])(e).css("borderLeftWidth"),10)||0)-(parseInt((0,n["default"])(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(o?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt((0,n["default"])(e).css("borderTopWidth"),10)||0)-(parseInt((0,n["default"])(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"==t?1:-1,o=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&n["default"].contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),s=/(html|body)/i.test(o[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"==this.cssPosition?-this.scrollParent.scrollTop():s?0:o.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():s?0:o.scrollLeft())*i}},_generatePosition:function(t){var e=this.options,i="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&n["default"].contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(i[0].tagName);"relative"!=this.cssPosition||this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());var s=t.pageX,r=t.pageY;if(this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(r=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(r=this.containment[3]+this.offset.click.top)),e.grid)){var a=this.originalPageY+Math.round((r-this.originalPageY)/e.grid[1])*e.grid[1];r=this.containment&&(a-this.offset.click.top<this.containment[1]||a-this.offset.click.top>this.containment[3])?a-this.offset.click.top<this.containment[1]?a+e.grid[1]:a-e.grid[1]:a;var l=this.originalPageX+Math.round((s-this.originalPageX)/e.grid[0])*e.grid[0];s=this.containment&&(l-this.offset.click.left<this.containment[0]||l-this.offset.click.left>this.containment[2])?l-this.offset.click.left<this.containment[0]?l+e.grid[0]:l-e.grid[0]:l}return{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"==this.cssPosition?-this.scrollParent.scrollTop():o?0:i.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():o?0:i.scrollLeft())}},_rearrange:function(t,e,i,n){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"==this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o==this.counter&&this.refreshPositions(!n)})},_clear:function(t,e){this.reverting=!1;var i=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]==this.currentItem[0]){for(var o in this._storedCSS)"auto"!=this._storedCSS[o]&&"static"!=this._storedCSS[o]||(this._storedCSS[o]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!e&&i.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev==this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent==this.currentItem.parent()[0]||e||i.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(i.push(function(t){this._trigger("remove",t,this._uiHash())}),i.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),i.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer))));for(var o=this.containers.length-1;o>=0;o--)e||i.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[o])),this.containers[o].containerCache.over&&(i.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[o])),this.containers[o].containerCache.over=0);if(this._storedCursor&&(0,n["default"])("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",t,this._uiHash());for(var o=0;o<i.length;o++)i[o].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(var o=0;o<i.length;o++)i[o].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){n["default"].Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_delay:function(t,e){function i(){return("string"==typeof t?n[t]:t).apply(n,arguments)}var n=this;return setTimeout(i,e||0)},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||(0,n["default"])([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(t,e,i){(function(e){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o="undefined"!=typeof window?window.django.jQuery:"undefined"!=typeof e?e.django.jQuery:null,s=i(o);t("./jquery.ui.djnsortable"),"function"!=typeof s["default"].fn.nearest&&(s["default"].fn.nearest=function(t){var e=(0,s["default"])([]),i=this,n=1e4;return i.find(t).each(function(){var t=(0,s["default"])(this),o=t.parentsUntil(i).size();o<n?(n=o,e=t):o==n&&e.add(this)}),this.pushStack(e.get())});var r=0,a="djn"+(""+Math.random()).replace(/\D/g,""),l=function(t,e){if(!t||!t.element||t.element[0]!=e){var i=(0,s["default"])(e),n=s["default"].extend({},t.options);if(n.connectWith=[t.element],!i.data(t.widgetName)){var o=i[t.widgetName];o.call(i,n);for(var r=i.data(t.widgetName),a=0;a<t.options.connectWith.length;a++){var l=t.options.connectWith[a];r.addToConnectWith(l);var d=l.data(t.widgetName);d&&d.addToConnectWith(i)}return t.addToConnectWith(i),r}}};s["default"].widget("ui.nestedSortable",s["default"].ui.djnsortable,{options:{tabSize:20,disableNesting:"ui-nestedSortable-no-nesting",errorClass:"ui-nestedSortable-error",nestedContainerSelector:":not(*)",doNotClear:!1,createContainerElement:function(t){return(0,s["default"])(document.createElement("ol"))},containerElementSelector:"ol",listItemSelector:"li",items:"> li",maxLevels:0,revertOnError:1,protectRoot:!1,rootID:null,rtl:!1,fixedNestingDepth:!1,showErrorDiv:!0,keepInParent:!1,isAllowed:function(t,e){return!0},canConnectWith:function(t,e,i){var n=e.data(i.widgetName);if(!(i.options.fixedNestingDepth||n&&n.options.fixedNestingDepth))return!0;var o=i._getLevel(t),s=i._getLevel(e);return o===s}},_createWidget:function(t,e){var i=(0,s["default"])(e||this.defaultElement||this),n=i.data("djnsortableOptions");return e=i[0],n&&(t=s["default"].extend({},t,n)),s["default"].ui.djnsortable.prototype._createWidget.call(this,t,e)},_create:function(){this.element.data("uiNestedSortable")&&this.element.data("nestedSortable",this.element.data("uiNestedSortable")),this.element.data("ui-nestedSortable")&&this.element.data("nestedSortable",this.element.data("ui-nestedSortable")),this.element.data("djnsortable",this.element.data("nestedSortable")),this.element.data("uiNestedSortable")&&this.element.data("uiSortable",this.element.data("nestedSortable")),s["default"].ui.djnsortable.prototype._create.apply(this,arguments),this._connectWithMap={};var t=this,e=this.options,i=(0,s["default"])(document),n=e.connectWith;if(!n||"string"==typeof n){if(this.options.connectWith=[],"string"==typeof n)for(var o=this._connectWith(),r=0;r<o.length;r++)this.addToConnectWith((0,
s["default"])(o[r]));i.on("djnesting:init.nestedSortable",e.containerElementSelector,function(e){l(t,this)}),this.element.find(e.containerElementSelector+":not(.subarticle-wrapper)").each(function(e,i){(0,s["default"])(i).closest("[data-inline-formset]").attr("id").indexOf("-empty")>-1||l(t,i)})}i.trigger("nestedSortable:created",[this]),i.on("nestedSortable:created.nestedSortable",function(e,i){i.addToConnectWith(t.element),t.addToConnectWith(i.element)})},addToConnectWith:function(t){var e,i=this,n="undefined"!=typeof t.selector?t:(0,s["default"])(t);return n.length>1?void n.each(function(t,e){i.addToConnectWith((0,s["default"])(e))}):(e=t[0][a],"undefined"==typeof e&&(e=t[0][a]=++r),void("string"!=typeof this.options.connectWith&&(this._connectWithMap[e]||(this.options.connectWith.push(t),this._connectWithMap[e]=1))))},_destroy:function(){return this.element.removeData("nestedSortable").unbind(".nestedSortable"),(0,s["default"])(document).unbind(".nestedSortable"),s["default"].ui.djnsortable.prototype.destroy.apply(this,arguments)},_intersectsWithPointer:function(t){var e=t.item[0],i=this.options,n=s["default"].ui.djnsortable.prototype._intersectsWithPointer.apply(this,arguments);if(this.lastItemElement=null,!n)return n;if(t.instance!==this.currentContainer)return!1;var o=(0,s["default"])(e);return i.fixedNestingDepth&&this._getLevel(this.currentItem)===1+this._getLevel(o)&&(o=function(){var t=i.containerElementSelector,e=o.find(".djn-item");if(1!=e.length)return o;if(!e.is(".djn-no-drag,.djn-thead"))return o;var n=o.closest(t);return n.length?n[0]!=e.closest(t).closest(t)[0]?o:(0,s["default"])(e[0]):o}(),e=o[0]),!(e==this.currentItem[0]||this.placeholder[1==n?"next":"prev"]()[0]==e||s["default"].contains(this.placeholder[0],e)||"semi-dynamic"==this.options.type&&s["default"].contains(this.element[0],e)||i.keepInParent&&e.parentNode!=this.placeholder[0].parentNode||i.fixedNestingDepth&&this._getLevel(this.currentItem)!==this._getLevel(o)||!i.showErrorDiv&&!i.isAllowed.call(this,this.currentItem[0],e.parentNode,this.placeholder))&&(this.lastItemElement=e,n)},_contactContainers:function(t){if(this.lastItemElement&&this._clearEmpty(this.lastItemElement),this.options.fixedNestingDepth)return s["default"].ui.djnsortable.prototype._contactContainers.apply(this,arguments);var e=this.options,i=this.placeholder.closest(e.listItemSelector),n=i.length&&i.closest(".ui-sortable").length?i:null,o=this._getLevel(this.placeholder),r=this._getChildLevels(this.helper),a=this.placeholder.attr("class"),d=" "+a+" ";if(d.indexOf(" ui-sortable-nested-level-"+o+" ")==-1){var h,u=d.indexOf(" ui-sortable-nested-level-")-1;h=u>-1?a.substring(0,u):a,this.placeholder.attr("class",h+" ui-sortable-nested-level-"+o)}var f=this.placeholder[0].previousSibling?(0,s["default"])(this.placeholder[0].previousSibling):null;if(null!=f)for(;!f.is(this.options.listItemSelector)||f[0]==this.currentItem[0]||f[0]==this.helper[0];){if(!f[0].previousSibling){f=null;break}f=(0,s["default"])(f[0].previousSibling)}var c=this.placeholder[0].nextSibling?(0,s["default"])(this.placeholder[0].nextSibling):null;if(null!=c)for(;!c.is(this.options.listItemSelector)||c[0]==this.currentItem[0]||c[0]==this.helper[0];){if(!c[0].nextSibling){c=null;break}c=(0,s["default"])(c[0].nextSibling)}this.beyondMaxLevels=0;var p=this;if(this.refreshPositions(),!e.fixedNestingDepth&&null!=n&&null==c&&(e.rtl&&this.positionAbs.left+this.helper.outerWidth()>n.offset().left+n.outerWidth()||!e.rtl&&this.positionAbs.left<n.offset().left))n.after(this.placeholder[0]),p=n.closest(e.containerElementSelector).data(this.widgetName)||p,this._clearEmpty(n[0]),this.refreshPositions(),this._trigger("change",t,this._uiHash());else if(e.fixedNestingDepth||null==f||f.is(".djn-no-drag,.djn-thead")||!(e.rtl&&this.positionAbs.left+this.helper.outerWidth()<f.offset().left+f.outerWidth()-e.tabSize||!e.rtl&&this.positionAbs.left>f.offset().left+e.tabSize))this._isAllowed(n,o,o+r);else{if(this._isAllowed(f,o,o+r),this.beyondMaxLevels>0)return s["default"].ui.djnsortable.prototype._contactContainers.apply(this,arguments);var m;m=f.nearest(e.containerElementSelector).first(),m.length||f.closest(e.nestedContainerSelector).length||(m=this.options.createContainerElement(f[0]),f.append(m)),m.length&&(m.append(this.placeholder),p=m.data(this.widgetName),p||(p=l(this,m[0])),this.refreshPositions()),this._trigger("change",t,this._uiHash())}s["default"].ui.djnsortable.prototype._contactContainers.call(this,t)},_rearrange:function(t,e,i,o){var r=this.options;if(e&&"object"==("undefined"==typeof e?"undefined":n(e))&&e.item&&(this.lastRearrangedElement=e.item[0]),e&&"object"==("undefined"==typeof e?"undefined":n(e))&&e.item&&this.placeholder.closest(r.nestedContainerSelector).length){var a=this.placeholder.closest(r.listItemSelector),l="down"==this.direction?a.next(r.nestedContainerSelector):a;if(l.length&&l[0]==e.item[0]){this.counter=this.counter?++this.counter:1;var d=this.counter;return void this._delay(function(){d==this.counter&&this.refreshPositions(!o)})}}s["default"].ui.djnsortable.prototype._rearrange.apply(this,arguments)},_convertPositionTo:function(t,e){return this.previousTopOffset=this.placeholder.offset().top,s["default"].ui.djnsortable.prototype._convertPositionTo.apply(this,arguments)},_clear:function(){s["default"].ui.djnsortable.prototype._clear.apply(this,arguments),"object"==n(this.lastRearrangedElement)&&this.lastRearrangedElement.ownerDocument&&this._clearEmpty(this.lastRearrangedElement)},_mouseStop:function(t,e){this.beyondMaxLevels&&(this.placeholder.removeClass(this.options.errorClass),this.domPosition.prev?(0,s["default"])(this.domPosition.prev).after(this.placeholder):(0,s["default"])(this.domPosition.parent).prepend(this.placeholder),this._trigger("revert",t,this._uiHash()));for(var i=this.items.length-1;i>=0;i--){var n=this.items[i].item[0];this._clearEmpty(n)}s["default"].ui.djnsortable.prototype._mouseStop.apply(this,arguments)},toArray:function(t){t=s["default"].extend(!0,{},this.options,t||{});var e=t.startDepthCount||0,i=[],n=2;i.push({item_id:t.rootID,parent_id:"none",depth:e,left:"1",right:2*((0,s["default"])(t.listItemSelector,this.element).length+1)});var o=function r(n,o,a){var l,d,h=a+1,u=(0,s["default"])(n).children(t.containerElementSelector).find(t.items);if(u.length>0&&(o++,u.each(function(){h=r((0,s["default"])(this),o,h)}),o--),l=(0,s["default"])(n).attr(t.attribute||"id").match(t.expression||/(.+)[-=_](.+)/),o===e+1)d=t.rootID;else{var f=(0,s["default"])(n).parent(t.containerElementSelector).parent(t.items).attr(t.attribute||"id").match(t.expression||/(.+)[-=_](.+)/);d=f[2]}return l&&i.push({item_id:l[2],parent_id:d,depth:o,left:a,right:h}),a=h+1};return(0,s["default"])(this.element).children(t.listItemSelector).each(function(){n=o(this,e+1,n)}),i=i.sort(function(t,e){return t.left-e.left})},_clearEmpty:function(t){if(!this.options.doNotClear){var e=(0,s["default"])(t),i=e.nearest(this.options.containerElementSelector);i.each(function(t,e){var i=(0,s["default"])(e);if(!i.children().length){var o=i.data(this.widgetName);"object"==("undefined"==typeof o?"undefined":n(o))&&o.destroy&&o.destroy(),i.remove()}}),e.children().length||e.remove()}},_getLevel:function(t){var e,i=1,n=this.options;if(n.containerElementSelector)for(e=t.closest(n.containerElementSelector);e&&e.length>0&&!e.parent().is(".djn-group-root");)i++,e=e.parent().closest(n.containerElementSelector);return i},_getChildLevels:function(t,e){var i=this,n=this.options,o=0;return e=e||0,(0,s["default"])(t).nearest(n.containerElementSelector).find(n.items).each(function(t,n){(0,s["default"])(n).is(".djn-no-drag,.djn-thead")||(o=Math.max(i._getChildLevels(n,e+1),o))}),e?o+1:o},_isAllowed:function(t,e,i){var o=this.options,r=!!(0,s["default"])(this.domPosition.parent).hasClass("ui-sortable"),a=o.maxLevels;t&&"object"==("undefined"==typeof t?"undefined":n(t))&&"undefined"==typeof t.selector&&(t=(0,s["default"])(t)),!o.isAllowed.call(this,this.currentItem,t,this.placeholder)||t&&t.hasClass(o.disableNesting)||o.protectRoot&&(null==t&&!r||r&&e>1)?(this.placeholder.addClass(o.errorClass),a<i&&0!=a?this.beyondMaxLevels=i-a:this.beyondMaxLevels=1):a<i&&0!=a?(this.placeholder.addClass(o.errorClass),this.beyondMaxLevels=i-a):(this.placeholder.removeClass(o.errorClass),this.beyondMaxLevels=0)},_connectWith:function(){for(var t=s["default"].ui.djnsortable.prototype._connectWith.apply(this,arguments),e=[],i=this,n=0;n<t.length;n++){var o=(0,s["default"])(t[n]);o.each(function(t,n){n!=i.element[0]&&i.options.canConnectWith(i.element,(0,s["default"])(n),i)&&e.push(n)})}return e},_removeCurrentsFromItems:function(){for(var t=this.currentItem.find(":data(sortable-item)"),e=0;e<this.items.length;e++)for(var i=0;i<t.length&&!(t[i]==this.items[e].item[0]&&(this.items.splice(e,1),e>=this.items.length));i++);},createContainerElement:function(t){if(!t.childNodes)throw new Error("Invalid element 'parent' passed to createContainerElement.");var e=this.options.createContainerElement.apply(this,arguments);return t.appendChild(e[0]),(0,s["default"])(e)}}),s["default"].ui.nestedSortable.prototype.options=s["default"].extend({},s["default"].ui.djnsortable.prototype.options,s["default"].ui.nestedSortable.prototype.options)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./jquery.ui.djnsortable":3}],5:[function(t,e,i){"use strict";function n(t){return(t+"").replace(/([\.\?\*\+\^\$\[\]\\\(\)\{\}\|\-])/g,"\\$1")}Object.defineProperty(i,"__esModule",{value:!0}),i["default"]=n,e.exports=i["default"]},{}],6:[function(t,e,i){(function(e){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e,i=0,n=1,o=(0,l["default"])("#"+t+"-group"),s=o.djnData(),a=s.fieldNames,d=s.formsetFkName,u=t.match(/^(.*)\-(\d+)-[^\-]+(?:\-\d+)?$/)||[],f=r(u,3),c=f[1],p=f[2],m=s.sortableOptions,g=(m||{}).sortableExcludes||[];if(g.push(d),c){var v=(0,l["default"])("#"+c+"-group"),_=v.djnData("fieldNames"),y=_.pk,b=v.filterDjangoField(c,y,p);e=b.val()}d&&"undefined"!=typeof e&&o.filterDjangoField(t,d).val(e).trigger("change"),o.find(".djn-inline-form").each(function(){if(!this.id||"-empty"==this.id.substr(-6))return!0;var e=new RegExp("^(?:id_)?"+(0,h["default"])(t)+"\\-\\d+$");if(!this.id.match(e))return!0;var o=(0,l["default"])(this),s=o.djangoPrefixIndex()||[null,null],d=r(s,2),u=d[0],f=d[1],c=u+"-"+f+"-";if(u){var p=o.find("> h3 > .inline_label");p.length&&p.html(p.html().replace(/(#\d+)/g,"#"+n)),n++;var m,v=o.djangoFormField("*"),_=!1;v.each(function(){var t=(0,l["default"])(this);if(t.is(":input[type!=radio][type!=checkbox],input:checked")){var e=t.val()||"file"==t.attr("type")&&t.siblings("a").length,i=t.attr("name").substring(c.length);i==a.position&&(m=t),e&&l["default"].inArray(i,g)===-1&&(_=!0)}}),_&&m&&(m.val(i).trigger("change"),i++)}})}function s(t){return t.find("> .djn-items, > .djn-fieldset > .djn-items, > .tabular > .module > .djn-items").nestedSortable({handle:["> h3.djn-drag-handler","> .djn-tools .drag-handler","> .djn-td > .djn-tools .djn-drag-handler","> .djn-tr > .is-sortable > .djn-drag-handler","> .djn-tr > .grp-tools-container .djn-drag-handler"].join(", "),items:"> .djn-item",forcePlaceholderSize:!0,placeholder:{element:function(t){var e=(0,l["default"])(document.createElement(t[0].nodeName)).addClass(t[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(t.is(".djn-tbody")){var i=t.children(".djn-tr").eq(0),n=i.prop("tagName").toLowerCase(),o=(0,l["default"])("<"+n+"></"+n+">");o.addClass(i.attr("class"));var s=i.children(".djn-td").eq(0),r=s.prop("tagName").toLowerCase(),a=0;i.children(".djn-td").each(function(t,e){a+=parseInt((0,l["default"])(e).attr("colspan"),10)||1}),o.append((0,l["default"])("<"+r+' colspan="'+a+'" class="djn-td grp-td"></'+r+">")),e.appendChild(o[0])}return e},update:function(t,e){var i=t.currentItem,n=t.options;if(!n.className||n.forcePlaceholderSize){if(e.is(".djn-tbody")&&(e=e.children(".djn-tr").eq(0).children(".djn-td").eq(0)),!e.height()){var o=i.innerHeight(),s=parseInt(i.css("paddingTop")||0,10),r=parseInt(i.css("paddingBottom")||0,10);e.height(o-s-r)}if(!e.width()){var a=i.innerWidth(),l=parseInt(i.css("paddingLeft")||0,10),d=parseInt(i.css("paddingRight")||0,10);e.width(a-l-d)}}}},helper:"clone",opacity:.6,maxLevels:3,connectWith:".djn-items",tolerance:"intersection",isAllowed:function(t,e){return!e||!e.hasClass("predelete")},fixedNestingDepth:!0,containerElementSelector:".djn-items",listItemSelector:".djn-item",start:function(t,e){e.item.addClass("djn-item-dragging"),e.item.show()},stop:function(t,e){e.item.removeClass("djn-item-dragging")},receive:function(t,e){var i=(0,l["default"])(this).closest(".djn-group");i.djangoFormset().spliceInto(e.item),o(e.item.djangoFormsetPrefix())},update:function(t,e){var i=e.item.nextAll(".djn-item").first();if(i.is(".djn-no-drag,.djn-thead")){var n=i[0],s=n.parentNode;s.insertBefore(n,s.firstChild)}var r=(0,l["default"])(t.target).closest(".djn-group").attr("id"),a=e.item,d=a.closest("#"+r);"removed"==a.data("updateOperation")?a.removeAttr("data-update-operation"):d.length||a.attr("data-update-operation","removed"),o(a.djangoFormsetPrefix()),(0,l["default"])(document).trigger("djnesting:mutate",[(0,l["default"])("#"+a.djangoFormsetPrefix()+"-group")])}})}Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function t(t,e){var i=[],n=!0,o=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(n=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(l){o=!0,s=l}finally{try{!n&&a["return"]&&a["return"]()}finally{if(o)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();i.updatePositions=o,i.createSortable=s;var a="undefined"!=typeof window?window.django.jQuery:"undefined"!=typeof e?e.django.jQuery:null,l=n(a),d=t("./regexquote"),h=n(d);t("./jquery.ui.nestedsortable")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./jquery.ui.nestedsortable":4,"./regexquote":5}],7:[function(t,e,i){(function(n){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){var i=[],n=!0,o=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(n=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);n=!0);}catch(l){o=!0,s=l}finally{try{!n&&a["return"]&&a["return"]()}finally{if(o)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a="undefined"!=typeof window?window.django.jQuery:"undefined"!=typeof n?n.django.jQuery:null,l=o(a);t("./jquery.djnutils.js");var d=t("./sortable"),h=t("./regexquote"),u=o(h),f="undefined"!=typeof window?window.DateTimeShortcuts:"undefined"!=typeof n?n.DateTimeShortcuts:null,c=o(f),p="undefined"!=typeof window?window.SelectFilter:"undefined"!=typeof n?n.SelectFilter:null,m=o(p),g="undefined"!=typeof window.DJNesting?window.DJNesting:{};g.regexQuote=u["default"],g.createSortable=d.createSortable,g.updatePositions=d.updatePositions,g.updateFormAttributes=function(t,e,i,n){n||(n=[":input","span","table","iframe","label","a","ul","p","img",".djn-group",".djn-inline-form",".cropduster-form",".dal-forward-conf"].join(",")),t.find(n).andSelf().each(function(){var t=(0,l["default"])(this),n=["id","name","for","href","class","onclick"];l["default"].each(n,function(n,o){var s=t.attr(o);s&&t.attr(o,s.replace(e,i))})}),t.find(".prepopulated_field").each(function(){var t=(0,l["default"])(this),n=l["default"].makeArray(t.data("dependency_ids")||[]);t.data("dependency_ids",l["default"].map(n,function(t){return t.replace(e,i)}))})},g.createContainerElement=function(){},g.initRelatedFields=function(t,e){if("object"==r(g.LOOKUP_URLS)&&g.LOOKUP_URLS.related){var i=g.LOOKUP_URLS,n=(0,l["default"])("#"+t+"-group");e||(e=n.djnData());var o=e.lookupRelated;n.djangoFormsetForms().each(function(e,n){l["default"].each(o.fk||[],function(t,e){(0,l["default"])(n).djangoFormField(e).each(function(){(0,l["default"])(this).grp_related_fk({lookup_url:i.related})})}),l["default"].each(o.m2m||[],function(t,e){(0,l["default"])(n).djangoFormField(e).each(function(){(0,l["default"])(this).grp_related_m2m({lookup_url:i.m2m})})}),l["default"].each(o.generic||[],function(){var e=s(this,2),o=e[0],r=e[1];(0,l["default"])(n).djangoFormField(r).each(function(){var e=(0,l["default"])(this),n=e.djangoFormIndex();e.hasClass("grp-has-related-lookup")&&(e.parent().find("a.related-lookup").remove(),e.parent().find(".grp-placeholder-related-generic").remove()),e.grp_related_generic({content_type:"#id_"+t+n+o,object_id:"#id_"+t+n+r,lookup_url:i.related})})})})}},g.initAutocompleteFields=function(t,e){if("object"==r(g.LOOKUP_URLS)&&g.LOOKUP_URLS.related){var i=g.LOOKUP_URLS,n=(0,l["default"])("#"+t+"-group");e||(e=n.djnData());var o=e.lookupAutocomplete;n.djangoFormsetForms().each(function(e,n){l["default"].each(o.fk||[],function(t,e){(0,l["default"])(n).djangoFormField(e).each(function(){var t=(0,l["default"])(this),e=t.attr("id");(0,l["default"])("#"+e+"-autocomplete").length||t.grp_autocomplete_fk({lookup_url:i.related,autocomplete_lookup_url:i.autocomplete})})}),l["default"].each(o.m2m||[],function(t,e){(0,l["default"])(n).djangoFormField(e).each(function(){var t=(0,l["default"])(this),e=t.attr("id");(0,l["default"])("#"+e+"-autocomplete").length||t.grp_autocomplete_m2m({lookup_url:i.m2m,autocomplete_lookup_url:i.autocomplete})})}),l["default"].each(o.generic||[],function(){var e=s(this,2),o=e[0],r=e[1];(0,l["default"])(n).djangoFormField(r).each(function(){var e=(0,l["default"])(this),n=e.djangoFormIndex();(0,l["default"])("#"+e.attr("id")+"-autocomplete").length||e.grp_autocomplete_generic({content_type:"#id_"+t+n+o,object_id:"#id_"+t+n+r,lookup_url:i.related,autocomplete_lookup_url:i.m2m})})})})}},g.DjangoInlines={initPrepopulatedFields:function(t){t.find(".prepopulated_field").each(function(){var t=(0,l["default"])(this),e=t.is(":input")?t:t.find(":input"),i=e.data("dependency_list")||[],n=e.djangoFormPrefix(),o=[];n&&!n.match(/__prefix__/)&&(l["default"].each(i,function(t,e){o.push("#id_"+n+e)}),o.length&&e.prepopulate(o,e.attr("maxlength")))})},reinitDateTimeShortCuts:function(){"undefined"!=typeof c["default"]&&((0,l["default"])(".datetimeshortcuts").remove(),c["default"].init())},updateSelectFilter:function(t){"undefined"!=typeof m["default"]&&(t.find(".selectfilter").each(function(t,e){var i=e.name.split("-");m["default"].init(e.id,i[i.length-1],!1,g.adminStaticPrefix)}),t.find(".selectfilterstacked").each(function(t,e){var i=e.name.split("-");m["default"].init(e.id,i[i.length-1],!0,g.adminStaticPrefix)}))}},window.DJNesting=g,i["default"]=g,e.exports=i["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./jquery.djnutils.js":2,"./regexquote":5,"./sortable":6}],8:[function(t,e,i){(function(e){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var n="undefined"!=typeof window?window.django.jQuery:"undefined"!=typeof e?e.django.jQuery:null,o=i(n);t("./nested-admin/jquery.djangoformset");var s=t("./nested-admin/utils"),r=i(s);(0,o["default"])(document).ready(function(){(0,o["default"])("fieldset.grp-module, fieldset.module").filter(function(t,e){return 0==e.childNodes.length}).css("border-width","0"),(0,o["default"])('input[name$="-DELETE"]:checked').not('[name*="__prefix__"]').closest(".djn-inline-form").addClass("grp-predelete"),(0,o["default"])(document).on("djnesting:initialized djnesting:mutate",function(t,e){var i=e.find("> .djn-items, > .tabular > .module > .djn-items"),n=i.children(".djn-tbody");n.removeClass("row1 row2"),n.each(function(t,e){var i=1+t%2;(0,o["default"])(e).addClass("row"+i)})}),(0,o["default"])(".djn-group-root").each(function(t,e){(0,o["default"])(e).djangoFormset()}),(0,o["default"])("form").on("submit.djnesting",function(t){(0,o["default"])(".djn-group").each(function(){r["default"].updatePositions((0,o["default"])(this).djangoFormsetPrefix()),(0,o["default"])(document).trigger("djnesting:mutate",[(0,o["default"])(this).djangoFormset().$inline])})})})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./nested-admin/jquery.djangoformset":1,"./nested-admin/utils":7}]},{},[8]);
//# sourceMappingURL=nested_admin.min.js.map
