function init() { $(".generalcontent.privacypolicy").length != 0 && $(".banner").addClass("small"); $(".varb .listingItemLI .listingImage a").click(function () { $(this).addClass("played"); $(this).find("img").hide(); $(this).find(".videoHolder").show(); $(this).find(".videoHolder").get(0).play(); }); $(".greyListing .video").each(function () { $(this).get(0).play(); }); } function initToolkit() { $(".listingImage").each(function () { var n = $(this); $(".listingHolder").imagesLoaded(function () { n.removeClass("listingImageLoad"); }); }); /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent ) ? $("body").addClass("mobile") : $("body").addClass("desktop"); $(".menusMain").before("
"); $(".mobileMenuToggler").click(function () { $(this).toggleClass("active"); $(".menusMain").toggleClass("active"); }); $(".mainMenu ul li.hasSubmenu").each(function () { $(this).append(""); }); $(".subMenuToggle").click(function () { $(this).parent().find(".ddSecondLevel").slideToggle(); $(this).parent().toggleClass("openSubmenu"); }); $(".menusMain").click(function (n) { $(n.target).closest(".mainMenu ul").length === 0 && ($(".mobileMenuToggler").toggleClass("active"), $(".menusMain").removeClass("active")); }); $(".toggleTitle").click(function () { $(this).parent().find($(".toggleContent")).slideToggle(); $(this).toggleClass("active"); $(".toggleContent") .not($(this).parent().find($(".toggleContent"))) .slideUp(); $(".toggleTitle").not($(this)).removeClass("active"); }); } function initFullPage() { var n = new fullpage("#fullpage", { licenseKey: "A97B5839-3513426B-B862B69D-AC6E52A5", navigation: !0, navigationPosition: "left", slidesNavigation: !0, responsiveWidth: 992, afterSlideLoad: function () { $("#section0 .bgHolder img").each(function () { $(this).css("opacity", 0); }); $( "#section0 .bgHolder img:eq(" + fullpage_api.getActiveSlide().index + ")" ).css("opacity", 1); }, afterLoad: function () { slideNumber = $(".section.active").index() + 0; $(".section.active").hasClass("darkbg") ? $(".navBar").removeClass("dark") : $(".navBar").addClass("dark"); $(".fp-section.active .listingItemLI.aos-init").each(function () { $(this).addClass("aos-animate fixopacity"); }); }, afterRender: function () { var n, t, i; for ( $("#section0").prepend('
'), t = $("#section0 .fp-slides .fp-slidesContainer .fp-slide").length, n = 0; n < t; n++ ) (i = $("#section0 .fp-slides .fp-slide:eq(" + n + ")").data("bg")), $("#section0 .bgHolder").append( "" ); $("#section0 .bgHolder img").each(function () { $(this).css("opacity", 0); $(this).css("height", $("#section0").height()); }); $("#section0 .bgHolder img:eq(0)").css("opacity", 1); }, afterResize: function () { slideNumber = $(".section.active").index() + 0; $(".section.active").hasClass("darkbg") ? $(".navBar").removeClass("dark") : $(".navBar").addClass("dark"); $(".fp-section.active .listingItemLI.aos-init").each(function () { $(this).addClass("aos-animate fixopacity"); }); }, }); $( ".section .listingVar3 .listingItem .listingInfos .listingTitle" ).matchHeight(); } function initFullPageNavigation() { $("#fp-nav").detach().insertAfter(".sidebar .burgerMenuToggle"); $(".fp-slidesNav").detach().appendTo(".section0 .container .fp-slides"); } function toggleSearch() { $(".searchPopup").hasClass("show") ? ($(".searchPopup").removeClass("show"), $(".searchPopup").fadeOut()) : ($(".searchPopup").addClass("show"), $(".searchPopup").fadeIn(), $(".searchPopup").find("input[type=text]").focus()); $(document).mouseup(function (n) { var t = $(".searchPopup .innerSearch"); t.is(n.target) || t.has(n.target).length !== 0 || ($(".searchPopup").removeClass("show"), $(".searchPopup").fadeOut()); }); } function initSliders() { $(".listingVar1 .listingHolder").owlCarousel({ margin: 10, items: 3, center: !1, dots: !1, nav: !0, autoWidth: !0, loop: !0, }); $(".listingVar3 .listingHolder.owl-carousel").owlCarousel({ margin: 10, items: 3, center: !1, dots: !1, nav: !0, autoWidth: !0, loop: !0, }); $(".listingVar4 .listingHolder.owl-carousel").owlCarousel({ margin: 10, items: 3, center: !1, dots: !1, nav: !0, autoWidth: !0, loop: !0, }); $(".timeline .listingHolder").owlCarousel({ margin: 0, items: 4, center: !1, dots: !1, nav: !0, autoWidth: !0, stagePadding: 200, }); $( ".listingVar4 .listingHolder.owl-carousel .listingItem .listingInfos .listingTitle" ).matchHeight(); } function initSliderVar1Navigation() { $(window).width() > 992 && ($(".listingVar1 .owl-nav").detach().appendTo($(".section1 .left")), $(".listingVar3 .owl-nav").detach().appendTo($(".section3 .left")), $(".listingVar4 .owl-nav").detach().appendTo($(".section4 .left"))); $(".timeline .owl-nav").detach().appendTo($(".timeline >div")); $(".timeline .owl-nav").css( "padding-left", $(".container").css("margin-left") ); } function initPromotionsLandingHeight() { $(".promotionsListing.landing .listingTitle").matchHeight(); $(".promotionsListing.landing .listingInfos").matchHeight(); } function setFakeContainer() { var n = $(".container").css("margin-left"), i, t; $(".section1").css("padding-left", n); $(".section4").css("padding-left", n); $(".listingVar5 .listingInfos").css("padding-left", n); $(".timeline .blockHead").css("padding-left", n); $(".menu").css("padding-left", n); $(window).width() > 992 && ((i = $(".navBar .logo").offset()), $(".menu").css("width", i.left + $(".navBar .logo").width())); $(".timeline .owl-item:first-child").css("padding-left", n); t = $(".timeline .owl-stage").css("width"); console.log(t); $(".timeline .owl-stage").css("width", parseInt(t) + parseInt(n) + 10 + "px"); } function initSmallBanner() { $(".banner").hasClass("small") && $(".banner .container .back").length && $(".banner").addClass("withBack"); } function toggleHiddenMenu() { $(".menu").toggleClass("show"); $("body").toggleClass("fix"); $(".burgerMenuToggle").toggleClass("toggled"); $(".navBar .container .left").toggleClass("fix"); $("body").hasClass("fix") ? (fullpage_api.setMouseWheelScrolling(!1), fullpage_api.setAllowScrolling(!1)) : (fullpage_api.setMouseWheelScrolling(!0), fullpage_api.setAllowScrolling(!0)); $(document).mouseup(function (n) { var t = $(".menu,.burgerMenuToggle"); t.is(n.target) || t.has(n.target).length !== 0 || ($(".menu").removeClass("show"), $("body").removeClass("fix"), $(".burgerMenuToggle").removeClass("toggled"), $(".navBar .container .left").removeClass("fix"), $("body").hasClass("fix") ? (fullpage_api.setMouseWheelScrolling(!1), fullpage_api.setAllowScrolling(!1)) : (fullpage_api.setMouseWheelScrolling(!0), fullpage_api.setAllowScrolling(!0))); }); } function nextFullpage() { fullpage_api.moveSectionDown(); } function hideEndDate() { $(".eventsListing").length > 0 && $(".listingItem .listingInfo .listingDate").each(function () { var t = $(this).find(".startDate"), n = $(this).find(".endDate"); t.html() == n.html() && $(n).hide(); }); } function hideEmptyNewsLink() { $(".newsListing").length > 0 && $(".newsListing .listingItem").each(function () { $(this).find("a[href='']").hide(); var n = $(this).find(".pdfLink").attr("href"); n.length > 0 && $(this).find(".pageLink").hide(); }); } function initAOS() { AOS.init(); $(".fp-section.section1 .listingHolder .owl-item").each(function () { $(this) .find(".listingItemLI") .attr("data-aos-delay", $(this).index() * 200); }); $(".fp-section.section3 .listingHolder .listingItemLI").each(function () { $(this).attr("data-aos-delay", $(this).index() * 200); }); $(".fp-section.section2 .listingHolder .col1 .listingItemLI").each( function () { $(this).attr("data-aos-delay", $(this).index() * 200); } ); $(".fp-section.section2 .listingHolder .col2 .listingItemLI").each( function () { $(this).attr("data-aos-delay", $(this).index() * 200 + 400); } ); $(".fp-section.section4 .listingHolder .owl-item").each(function () { $(this) .find(".listingItemLI") .attr("data-aos-delay", $(this).index() * 200); }); } function responsive() { $(window).width() <= 992 && ($(".navBar .right .burgerMenu").length == 0 && $(".navBar .right").append( '
' ), $(".menu .close").length == 0 && $(".menu").prepend( '' ), $(".menu .headerSearch").length == 0 && $(".searchPopup .headerSearch").clone().insertAfter(".menu .close"), $(".menu .socialLinks").length == 0 && $(".sidebar .socialLinks").clone().insertAfter(".menu .menusMain"), $("footer .middle").detach().insertAfter("footer .left span"), $(".partnerDetails .right").detach().insertBefore(".partnerDetails .left")); } function openMenu() { $(".menu").fadeIn(); } function closeMenu() { $(".menu").fadeOut(); } function initCounterUp() { $(".numbersSection .numbersList .numberLI .number .count").counterUp({ delay: 10, time: 2e3, }); } (function (n) { "function" == typeof define && define.amd ? define(["jquery"], n) : n(jQuery); })(function (n) { function b(n) { for (var t = n.css("visibility"); "inherit" === t; ) (n = n.parent()), (t = n.css("visibility")); return "hidden" !== t; } function k(n) { for (var t, i; n.length && n[0] !== document; ) { if ( ((t = n.css("position")), ("absolute" === t || "relative" === t || "fixed" === t) && ((i = parseInt(n.css("zIndex"), 10)), !isNaN(i) && 0 !== i)) ) return i; n = n.parent(); } return 0; } function c() { this._curInst = null; this._keyEvent = !1; this._disabledInputs = []; this._datepickerShowing = !1; this._inDialog = !1; this._mainDivId = "ui-datepicker-div"; this._inlineClass = "ui-datepicker-inline"; this._appendClass = "ui-datepicker-append"; this._triggerClass = "ui-datepicker-trigger"; this._dialogClass = "ui-datepicker-dialog"; this._disableClass = "ui-datepicker-disabled"; this._unselectableClass = "ui-datepicker-unselectable"; this._currentClass = "ui-datepicker-current-day"; this._dayOverClass = "ui-datepicker-days-cell-over"; this.regional = []; this.regional[""] = { closeText: "Done", prevText: "Prev", nextText: "Next", currentText: "Today", monthNames: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ], monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ], dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", ], dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], weekHeader: "Wk", dateFormat: "mm/dd/yy", firstDay: 0, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "", }; this._defaults = { showOn: "focus", showAnim: "fadeIn", showOptions: {}, defaultDate: null, appendText: "", buttonText: "...", buttonImage: "", buttonImageOnly: !1, hideIfNoPrevNext: !1, navigationAsDateFormat: !1, gotoCurrent: !1, changeMonth: !1, changeYear: !1, yearRange: "c-10:c+10", showOtherMonths: !1, selectOtherMonths: !1, showWeek: !1, calculateWeek: this.iso8601Week, shortYearCutoff: "+10", minDate: null, maxDate: null, duration: "fast", beforeShowDay: null, beforeShow: null, onSelect: null, onChangeMonthYear: null, onClose: null, numberOfMonths: 1, showCurrentAtPos: 0, stepMonths: 1, stepBigMonths: 12, altField: "", altFormat: "", constrainInput: !0, showButtonPanel: !1, autoSize: !1, disabled: !1, }; n.extend(this._defaults, this.regional[""]); this.regional.en = n.extend(!0, {}, this.regional[""]); this.regional["en-US"] = n.extend(!0, {}, this.regional.en); this.dpDiv = l( n( "
" ) ); } function l(t) { var i = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; return t .on("mouseout", i, function () { n(this).removeClass("ui-state-hover"); -1 !== this.className.indexOf("ui-datepicker-prev") && n(this).removeClass("ui-datepicker-prev-hover"); -1 !== this.className.indexOf("ui-datepicker-next") && n(this).removeClass("ui-datepicker-next-hover"); }) .on("mouseover", i, a); } function a() { n.datepicker._isDisabledDatepicker( i.inline ? i.dpDiv.parent()[0] : i.input[0] ) || (n(this) .parents(".ui-datepicker-calendar") .find("a") .removeClass("ui-state-hover"), n(this).addClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && n(this).addClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && n(this).addClass("ui-datepicker-next-hover")); } function u(t, i) { n.extend(t, i); for (var r in i) null == i[r] && (t[r] = i[r]); return t; } function t(n) { return function () { var t = this.element.val(); n.apply(this, arguments); this._refresh(); t !== this.element.val() && this._trigger("change"); }; } var v, o, r, f, y, i, w; n.ui = n.ui || {}; n.ui.version = "1.12.1"; v = 0; o = Array.prototype.slice; n.cleanData = (function (t) { return function (i) { for (var r, u, f = 0; null != (u = i[f]); f++) try { r = n._data(u, "events"); r && r.remove && n(u).triggerHandler("remove"); } catch (e) {} t(i); }; })(n.cleanData); n.widget = function (t, i, r) { var f, u, o, h = {}, e = t.split(".")[0], s; return ( (t = t.split(".")[1]), (s = e + "-" + t), r || ((r = i), (i = n.Widget)), n.isArray(r) && (r = n.extend.apply(null, [{}].concat(r))), (n.expr[":"][s.toLowerCase()] = function (t) { return !!n.data(t, s); }), (n[e] = n[e] || {}), (f = n[e][t]), (u = n[e][t] = function (n, t) { return this._createWidget ? (arguments.length && this._createWidget(n, t), void 0) : new u(n, t); }), n.extend(u, f, { version: r.version, _proto: n.extend({}, r), _childConstructors: [], }), (o = new i()), (o.options = n.widget.extend({}, o.options)), n.each(r, function (t, r) { return n.isFunction(r) ? ((h[t] = (function () { function n() { return i.prototype[t].apply(this, arguments); } function u(n) { return i.prototype[t].apply(this, n); } return function () { var t, i = this._super, f = this._superApply; return ( (this._super = n), (this._superApply = u), (t = r.apply(this, arguments)), (this._super = i), (this._superApply = f), t ); }; })()), void 0) : ((h[t] = r), void 0); }), (u.prototype = n.widget.extend( o, { widgetEventPrefix: f ? o.widgetEventPrefix || t : t }, h, { constructor: u, namespace: e, widgetName: t, widgetFullName: s } )), f ? (n.each(f._childConstructors, function (t, i) { var r = i.prototype; n.widget(r.namespace + "." + r.widgetName, u, i._proto); }), delete f._childConstructors) : i._childConstructors.push(u), n.widget.bridge(t, u), u ); }; n.widget.extend = function (t) { for (var i, r, f = o.call(arguments, 1), u = 0, e = f.length; e > u; u++) for (i in f[u]) (r = f[u][i]), f[u].hasOwnProperty(i) && void 0 !== r && (t[i] = n.isPlainObject(r) ? n.isPlainObject(t[i]) ? n.widget.extend({}, t[i], r) : n.widget.extend({}, r) : r); return t; }; n.widget.bridge = function (t, i) { var r = i.prototype.widgetFullName || t; n.fn[t] = function (u) { var s = "string" == typeof u, e = o.call(arguments, 1), f = this; return ( s ? this.length || "instance" !== u ? this.each(function () { var i, o = n.data(this, r); return "instance" === u ? ((f = o), !1) : o ? n.isFunction(o[u]) && "_" !== u.charAt(0) ? ((i = o[u].apply(o, e)), i !== o && void 0 !== i ? ((f = i && i.jquery ? f.pushStack(i.get()) : i), !1) : void 0) : n.error( "no such method '" + u + "' for " + t + " widget instance" ) : n.error( "cannot call methods on " + t + " prior to initialization; attempted to call method '" + u + "'" ); }) : (f = void 0) : (e.length && (u = n.widget.extend.apply(null, [u].concat(e))), this.each(function () { var t = n.data(this, r); t ? (t.option(u || {}), t._init && t._init()) : n.data(this, r, new i(u, this)); })), f ); }; }; n.Widget = function () {}; n.Widget._childConstructors = []; n.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "
", options: { classes: {}, disabled: !1, create: null }, _createWidget: function (t, i) { i = n(i || this.defaultElement || this)[0]; this.element = n(i); this.uuid = v++; this.eventNamespace = "." + this.widgetName + this.uuid; this.bindings = n(); this.hoverable = n(); this.focusable = n(); this.classesElementLookup = {}; i !== this && (n.data(i, this.widgetFullName, this), this._on(!0, this.element, { remove: function (n) { n.target === i && this.destroy(); }, }), (this.document = n(i.style ? i.ownerDocument : i.document || i)), (this.window = n( this.document[0].defaultView || this.document[0].parentWindow ))); this.options = n.widget.extend( {}, this.options, this._getCreateOptions(), t ); this._create(); this.options.disabled && this._setOptionDisabled(this.options.disabled); this._trigger("create", null, this._getCreateEventData()); this._init(); }, _getCreateOptions: function () { return {}; }, _getCreateEventData: n.noop, _create: n.noop, _init: n.noop, destroy: function () { var t = this; this._destroy(); n.each(this.classesElementLookup, function (n, i) { t._removeClass(i, n); }); this.element.off(this.eventNamespace).removeData(this.widgetFullName); this.widget().off(this.eventNamespace).removeAttr("aria-disabled"); this.bindings.off(this.eventNamespace); }, _destroy: n.noop, widget: function () { return this.element; }, option: function (t, i) { var r, u, f, e = t; if (0 === arguments.length) return n.widget.extend({}, this.options); if ("string" == typeof t) if (((e = {}), (r = t.split(".")), (t = r.shift()), r.length)) { for ( u = e[t] = n.widget.extend({}, this.options[t]), f = 0; r.length - 1 > f; f++ ) (u[r[f]] = u[r[f]] || {}), (u = u[r[f]]); if (((t = r.pop()), 1 === arguments.length)) return void 0 === u[t] ? null : u[t]; u[t] = i; } else { if (1 === arguments.length) return void 0 === this.options[t] ? null : this.options[t]; e[t] = i; } return this._setOptions(e), this; }, _setOptions: function (n) { for (var t in n) this._setOption(t, n[t]); return this; }, _setOption: function (n, t) { return ( "classes" === n && this._setOptionClasses(t), (this.options[n] = t), "disabled" === n && this._setOptionDisabled(t), this ); }, _setOptionClasses: function (t) { var i, u, r; for (i in t) (r = this.classesElementLookup[i]), t[i] !== this.options.classes[i] && r && r.length && ((u = n(r.get())), this._removeClass(r, i), u.addClass( this._classes({ element: u, keys: i, classes: t, add: !0 }) )); }, _setOptionDisabled: function (n) { this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!n ); n && (this._removeClass(this.hoverable, null, "ui-state-hover"), this._removeClass(this.focusable, null, "ui-state-focus")); }, enable: function () { return this._setOptions({ disabled: !1 }); }, disable: function () { return this._setOptions({ disabled: !0 }); }, _classes: function (t) { function r(r, f) { for (var o, e = 0; r.length > e; e++) (o = u.classesElementLookup[r[e]] || n()), (o = t.add ? n(n.unique(o.get().concat(t.element.get()))) : n(o.not(t.element).get())), (u.classesElementLookup[r[e]] = o), i.push(r[e]), f && t.classes[r[e]] && i.push(t.classes[r[e]]); } var i = [], u = this; return ( (t = n.extend( { element: this.element, classes: this.options.classes || {} }, t )), this._on(t.element, { remove: "_untrackClassesElement" }), t.keys && r(t.keys.match(/\S+/g) || [], !0), t.extra && r(t.extra.match(/\S+/g) || []), i.join(" ") ); }, _untrackClassesElement: function (t) { var i = this; n.each(i.classesElementLookup, function (r, u) { -1 !== n.inArray(t.target, u) && (i.classesElementLookup[r] = n(u.not(t.target).get())); }); }, _removeClass: function (n, t, i) { return this._toggleClass(n, t, i, !1); }, _addClass: function (n, t, i) { return this._toggleClass(n, t, i, !0); }, _toggleClass: function (n, t, i, r) { r = "boolean" == typeof r ? r : i; var u = "string" == typeof n || null === n, f = { extra: u ? t : i, keys: u ? n : t, element: u ? this.element : n, add: r, }; return f.element.toggleClass(this._classes(f), r), this; }, _on: function (t, i, r) { var f, u = this; "boolean" != typeof t && ((r = i), (i = t), (t = !1)); r ? ((i = f = n(i)), (this.bindings = this.bindings.add(i))) : ((r = i), (i = this.element), (f = this.widget())); n.each(r, function (r, e) { function o() { if ( t || (u.options.disabled !== !0 && !n(this).hasClass("ui-state-disabled")) ) return ("string" == typeof e ? u[e] : e).apply(u, arguments); } "string" != typeof e && (o.guid = e.guid = e.guid || o.guid || n.guid++); var s = r.match(/^([\w:-]*)\s*(.*)$/), h = s[1] + u.eventNamespace, c = s[2]; c ? f.on(h, c, o) : i.on(h, o); }); }, _off: function (t, i) { i = (i || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace; t.off(i).off(i); this.bindings = n(this.bindings.not(t).get()); this.focusable = n(this.focusable.not(t).get()); this.hoverable = n(this.hoverable.not(t).get()); }, _delay: function (n, t) { function r() { return ("string" == typeof n ? i[n] : n).apply(i, arguments); } var i = this; return setTimeout(r, t || 0); }, _hoverable: function (t) { this.hoverable = this.hoverable.add(t); this._on(t, { mouseenter: function (t) { this._addClass(n(t.currentTarget), null, "ui-state-hover"); }, mouseleave: function (t) { this._removeClass(n(t.currentTarget), null, "ui-state-hover"); }, }); }, _focusable: function (t) { this.focusable = this.focusable.add(t); this._on(t, { focusin: function (t) { this._addClass(n(t.currentTarget), null, "ui-state-focus"); }, focusout: function (t) { this._removeClass(n(t.currentTarget), null, "ui-state-focus"); }, }); }, _trigger: function (t, i, r) { var u, f, e = this.options[t]; if ( ((r = r || {}), (i = n.Event(i)), (i.type = ( t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t ).toLowerCase()), (i.target = this.element[0]), (f = i.originalEvent)) ) for (u in f) u in i || (i[u] = f[u]); return ( this.element.trigger(i, r), !( (n.isFunction(e) && e.apply(this.element[0], [i].concat(r)) === !1) || i.isDefaultPrevented() ) ); }, }; n.each({ show: "fadeIn", hide: "fadeOut" }, function (t, i) { n.Widget.prototype["_" + t] = function (r, u, f) { "string" == typeof u && (u = { effect: u }); var o, e = u ? (u === !0 || "number" == typeof u ? i : u.effect || i) : t; u = u || {}; "number" == typeof u && (u = { duration: u }); o = !n.isEmptyObject(u); u.complete = f; u.delay && r.delay(u.delay); o && n.effects && n.effects.effect[e] ? r[t](u) : e !== t && r[e] ? r[e](u.duration, u.easing, f) : r.queue(function (i) { n(this)[t](); f && f.call(r[0]); i(); }); }; }); n.widget, (function () { function f(n, t, i) { return [ parseFloat(n[0]) * (c.test(n[0]) ? t / 100 : 1), parseFloat(n[1]) * (c.test(n[1]) ? i / 100 : 1), ]; } function i(t, i) { return parseInt(n.css(t, i), 10) || 0; } function l(t) { var i = t[0]; return 9 === i.nodeType ? { width: t.width(), height: t.height(), offset: { top: 0, left: 0 }, } : n.isWindow(i) ? { width: t.width(), height: t.height(), offset: { top: t.scrollTop(), left: t.scrollLeft() }, } : i.preventDefault ? { width: 0, height: 0, offset: { top: i.pageY, left: i.pageX } } : { width: t.outerWidth(), height: t.outerHeight(), offset: t.offset(), }; } var u, r = Math.max, t = Math.abs, e = /left|center|right/, o = /top|center|bottom/, s = /[\+\-]\d+(\.[\d]+)?%?/, h = /^\w+/, c = /%$/, a = n.fn.position; n.position = { scrollbarWidth: function () { if (void 0 !== u) return u; var r, i, t = n( "
" ), f = t.children()[0]; return ( n("body").append(t), (r = f.offsetWidth), t.css("overflow", "scroll"), (i = f.offsetWidth), r === i && (i = t[0].clientWidth), t.remove(), (u = r - i) ); }, getScrollInfo: function (t) { var i = t.isWindow || t.isDocument ? "" : t.element.css("overflow-x"), r = t.isWindow || t.isDocument ? "" : t.element.css("overflow-y"), u = "scroll" === i || ("auto" === i && t.width < t.element[0].scrollWidth), f = "scroll" === r || ("auto" === r && t.height < t.element[0].scrollHeight); return { width: f ? n.position.scrollbarWidth() : 0, height: u ? n.position.scrollbarWidth() : 0, }; }, getWithinInfo: function (t) { var i = n(t || window), r = n.isWindow(i[0]), u = !!i[0] && 9 === i[0].nodeType, f = !r && !u; return { element: i, isWindow: r, isDocument: u, offset: f ? n(t).offset() : { left: 0, top: 0 }, scrollLeft: i.scrollLeft(), scrollTop: i.scrollTop(), width: i.outerWidth(), height: i.outerHeight(), }; }, }; n.fn.position = function (u) { if (!u || !u.of) return a.apply(this, arguments); u = n.extend({}, u); var w, c, v, p, y, k, d = n(u.of), nt = n.position.getWithinInfo(u.within), tt = n.position.getScrollInfo(nt), b = (u.collision || "flip").split(" "), g = {}; return ( (k = l(d)), d[0].preventDefault && (u.at = "left top"), (c = k.width), (v = k.height), (p = k.offset), (y = n.extend({}, p)), n.each(["my", "at"], function () { var t, i, n = (u[this] || "").split(" "); 1 === n.length && (n = e.test(n[0]) ? n.concat(["center"]) : o.test(n[0]) ? ["center"].concat(n) : ["center", "center"]); n[0] = e.test(n[0]) ? n[0] : "center"; n[1] = o.test(n[1]) ? n[1] : "center"; t = s.exec(n[0]); i = s.exec(n[1]); g[this] = [t ? t[0] : 0, i ? i[0] : 0]; u[this] = [h.exec(n[0])[0], h.exec(n[1])[0]]; }), 1 === b.length && (b[1] = b[0]), "right" === u.at[0] ? (y.left += c) : "center" === u.at[0] && (y.left += c / 2), "bottom" === u.at[1] ? (y.top += v) : "center" === u.at[1] && (y.top += v / 2), (w = f(g.at, c, v)), (y.left += w[0]), (y.top += w[1]), this.each(function () { var a, k, o = n(this), s = o.outerWidth(), h = o.outerHeight(), it = i(this, "marginLeft"), rt = i(this, "marginTop"), ut = s + it + i(this, "marginRight") + tt.width, ft = h + rt + i(this, "marginBottom") + tt.height, e = n.extend({}, y), l = f(g.my, o.outerWidth(), o.outerHeight()); "right" === u.my[0] ? (e.left -= s) : "center" === u.my[0] && (e.left -= s / 2); "bottom" === u.my[1] ? (e.top -= h) : "center" === u.my[1] && (e.top -= h / 2); e.left += l[0]; e.top += l[1]; a = { marginLeft: it, marginTop: rt }; n.each(["left", "top"], function (t, i) { n.ui.position[b[t]] && n.ui.position[b[t]][i](e, { targetWidth: c, targetHeight: v, elemWidth: s, elemHeight: h, collisionPosition: a, collisionWidth: ut, collisionHeight: ft, offset: [w[0] + l[0], w[1] + l[1]], my: u.my, at: u.at, within: nt, elem: o, }); }); u.using && (k = function (n) { var i = p.left - e.left, a = i + c - s, f = p.top - e.top, y = f + v - h, l = { target: { element: d, left: p.left, top: p.top, width: c, height: v, }, element: { element: o, left: e.left, top: e.top, width: s, height: h, }, horizontal: 0 > a ? "left" : i > 0 ? "right" : "center", vertical: 0 > y ? "top" : f > 0 ? "bottom" : "middle", }; s > c && c > t(i + a) && (l.horizontal = "center"); h > v && v > t(f + y) && (l.vertical = "middle"); l.important = r(t(i), t(a)) > r(t(f), t(y)) ? "horizontal" : "vertical"; u.using.call(this, n, l); }); o.offset(n.extend(e, { using: k })); }) ); }; n.ui.position = { fit: { left: function (n, t) { var h, e = t.within, u = e.isWindow ? e.scrollLeft : e.offset.left, o = e.width, s = n.left - t.collisionPosition.marginLeft, i = u - s, f = s + t.collisionWidth - o - u; t.collisionWidth > o ? i > 0 && 0 >= f ? ((h = n.left + i + t.collisionWidth - o - u), (n.left += i - h)) : (n.left = f > 0 && 0 >= i ? u : i > f ? u + o - t.collisionWidth : u) : i > 0 ? (n.left += i) : f > 0 ? (n.left -= f) : (n.left = r(n.left - s, n.left)); }, top: function (n, t) { var h, o = t.within, u = o.isWindow ? o.scrollTop : o.offset.top, e = t.within.height, s = n.top - t.collisionPosition.marginTop, i = u - s, f = s + t.collisionHeight - e - u; t.collisionHeight > e ? i > 0 && 0 >= f ? ((h = n.top + i + t.collisionHeight - e - u), (n.top += i - h)) : (n.top = f > 0 && 0 >= i ? u : i > f ? u + e - t.collisionHeight : u) : i > 0 ? (n.top += i) : f > 0 ? (n.top -= f) : (n.top = r(n.top - s, n.top)); }, }, flip: { left: function (n, i) { var o, s, r = i.within, y = r.offset.left + r.scrollLeft, c = r.width, h = r.isWindow ? r.scrollLeft : r.offset.left, l = n.left - i.collisionPosition.marginLeft, a = l - h, v = l + i.collisionWidth - c - h, u = "left" === i.my[0] ? -i.elemWidth : "right" === i.my[0] ? i.elemWidth : 0, f = "left" === i.at[0] ? i.targetWidth : "right" === i.at[0] ? -i.targetWidth : 0, e = -2 * i.offset[0]; 0 > a ? ((o = n.left + u + f + e + i.collisionWidth - c - y), (0 > o || t(a) > o) && (n.left += u + f + e)) : v > 0 && ((s = n.left - i.collisionPosition.marginLeft + u + f + e - h), (s > 0 || v > t(s)) && (n.left += u + f + e)); }, top: function (n, i) { var o, s, r = i.within, y = r.offset.top + r.scrollTop, c = r.height, h = r.isWindow ? r.scrollTop : r.offset.top, l = n.top - i.collisionPosition.marginTop, a = l - h, v = l + i.collisionHeight - c - h, p = "top" === i.my[1], u = p ? -i.elemHeight : "bottom" === i.my[1] ? i.elemHeight : 0, f = "top" === i.at[1] ? i.targetHeight : "bottom" === i.at[1] ? -i.targetHeight : 0, e = -2 * i.offset[1]; 0 > a ? ((s = n.top + u + f + e + i.collisionHeight - c - y), (0 > s || t(a) > s) && (n.top += u + f + e)) : v > 0 && ((o = n.top - i.collisionPosition.marginTop + u + f + e - h), (o > 0 || v > t(o)) && (n.top += u + f + e)); }, }, flipfit: { left: function () { n.ui.position.flip.left.apply(this, arguments); n.ui.position.fit.left.apply(this, arguments); }, top: function () { n.ui.position.flip.top.apply(this, arguments); n.ui.position.fit.top.apply(this, arguments); }, }, }; })(); n.ui.position; n.extend(n.expr[":"], { data: n.expr.createPseudo ? n.expr.createPseudo(function (t) { return function (i) { return !!n.data(i, t); }; }) : function (t, i, r) { return !!n.data(t, r[3]); }, }); n.fn.extend({ disableSelection: (function () { var n = "onselectstart" in document.createElement("div") ? "selectstart" : "mousedown"; return function () { return this.on(n + ".ui-disableSelection", function (n) { n.preventDefault(); }); }; })(), enableSelection: function () { return this.off(".ui-disableSelection"); }, }); n.ui.focusable = function (t, i) { var u, f, e, r, o, s = t.nodeName.toLowerCase(); return "area" === s ? ((u = t.parentNode), (f = u.name), t.href && f && "map" === u.nodeName.toLowerCase() ? ((e = n("img[usemap='#" + f + "']")), e.length > 0 && e.is(":visible")) : !1) : (/^(input|select|textarea|button|object)$/.test(s) ? ((r = !t.disabled), r && ((o = n(t).closest("fieldset")[0]), o && (r = !o.disabled))) : (r = "a" === s ? t.href || i : i), r && n(t).is(":visible") && b(n(t))); }; n.extend(n.expr[":"], { focusable: function (t) { return n.ui.focusable(t, null != n.attr(t, "tabindex")); }, }); n.ui.focusable; n.fn.form = function () { return "string" == typeof this[0].form ? this.closest("form") : n(this[0].form); }; n.ui.formResetMixin = { _formResetHandler: function () { var t = n(this); setTimeout(function () { var i = t.data("ui-form-reset-instances"); n.each(i, function () { this.refresh(); }); }); }, _bindFormResetHandler: function () { if (((this.form = this.element.form()), this.form.length)) { var n = this.form.data("ui-form-reset-instances") || []; n.length || this.form.on("reset.ui-form-reset", this._formResetHandler); n.push(this); this.form.data("ui-form-reset-instances", n); } }, _unbindFormResetHandler: function () { if (this.form.length) { var t = this.form.data("ui-form-reset-instances"); t.splice(n.inArray(this, t), 1); t.length ? this.form.data("ui-form-reset-instances", t) : this.form .removeData("ui-form-reset-instances") .off("reset.ui-form-reset"); } }, }; "1.7" === n.fn.jquery.substring(0, 3) && (n.each(["Width", "Height"], function (t, i) { function r(t, i, r, u) { return ( n.each(e, function () { i -= parseFloat(n.css(t, "padding" + this)) || 0; r && (i -= parseFloat(n.css(t, "border" + this + "Width")) || 0); u && (i -= parseFloat(n.css(t, "margin" + this)) || 0); }), i ); } var e = "Width" === i ? ["Left", "Right"] : ["Top", "Bottom"], u = i.toLowerCase(), f = { innerWidth: n.fn.innerWidth, innerHeight: n.fn.innerHeight, outerWidth: n.fn.outerWidth, outerHeight: n.fn.outerHeight, }; n.fn["inner" + i] = function (t) { return void 0 === t ? f["inner" + i].call(this) : this.each(function () { n(this).css(u, r(this, t) + "px"); }); }; n.fn["outer" + i] = function (t, e) { return "number" != typeof t ? f["outer" + i].call(this, t) : this.each(function () { n(this).css(u, r(this, t, !0, e) + "px"); }); }; }), (n.fn.addBack = function (n) { return this.add(null == n ? this.prevObject : this.prevObject.filter(n)); })); n.ui.keyCode = { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38, }; n.ui.escapeSelector = (function () { var n = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g; return function (t) { return t.replace(n, "\\$1"); }; })(); n.fn.labels = function () { var t, r, u, i, f; return this[0].labels && this[0].labels.length ? this.pushStack(this[0].labels) : ((i = this.eq(0).parents("label")), (u = this.attr("id")), u && ((t = this.eq(0).parents().last()), (f = t.add(t.length ? t.siblings() : this.siblings())), (r = "label[for='" + n.ui.escapeSelector(u) + "']"), (i = i.add(f.find(r).addBack(r)))), this.pushStack(i)); }; n.fn.scrollParent = function (t) { var i = this.css("position"), u = "absolute" === i, f = t ? /(auto|scroll|hidden)/ : /(auto|scroll)/, r = this.parents() .filter(function () { var t = n(this); return u && "static" === t.css("position") ? !1 : f.test( t.css("overflow") + t.css("overflow-y") + t.css("overflow-x") ); }) .eq(0); return "fixed" !== i && r.length ? r : n(this[0].ownerDocument || document); }; n.extend(n.expr[":"], { tabbable: function (t) { var i = n.attr(t, "tabindex"), r = null != i; return (!r || i >= 0) && n.ui.focusable(t, r); }, }); n.fn.extend({ uniqueId: (function () { var n = 0; return function () { return this.each(function () { this.id || (this.id = "ui-id-" + ++n); }); }; })(), removeUniqueId: function () { return this.each(function () { /^ui-id-\d+$/.test(this.id) && n(this).removeAttr("id"); }); }, }); n.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()); r = !1; n(document).on("mouseup", function () { r = !1; }); n.widget("ui.mouse", { version: "1.12.1", options: { cancel: "input, textarea, button, select, option", distance: 1, delay: 0, }, _mouseInit: function () { var t = this; this.element .on("mousedown." + this.widgetName, function (n) { return t._mouseDown(n); }) .on("click." + this.widgetName, function (i) { if (!0 === n.data(i.target, t.widgetName + ".preventClickEvent")) return ( n.removeData(i.target, t.widgetName + ".preventClickEvent"), i.stopImmediatePropagation(), !1 ); }); this.started = !1; }, _mouseDestroy: function () { this.element.off("." + this.widgetName); this._mouseMoveDelegate && this.document .off("mousemove." + this.widgetName, this._mouseMoveDelegate) .off("mouseup." + this.widgetName, this._mouseUpDelegate); }, _mouseDown: function (t) { if (!r) { this._mouseMoved = !1; this._mouseStarted && this._mouseUp(t); this._mouseDownEvent = t; var i = this, u = 1 === t.which, f = "string" == typeof this.options.cancel && t.target.nodeName ? n(t.target).closest(this.options.cancel).length : !1; return u && !f && this._mouseCapture(t) ? ((this.mouseDelayMet = !this.options.delay), this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () { i.mouseDelayMet = !0; }, this.options.delay)), this._mouseDistanceMet(t) && this._mouseDelayMet(t) && ((this._mouseStarted = this._mouseStart(t) !== !1), !this._mouseStarted) ? (t.preventDefault(), !0) : (!0 === n.data(t.target, this.widgetName + ".preventClickEvent") && n.removeData( t.target, this.widgetName + ".preventClickEvent" ), (this._mouseMoveDelegate = function (n) { return i._mouseMove(n); }), (this._mouseUpDelegate = function (n) { return i._mouseUp(n); }), this.document .on("mousemove." + this.widgetName, this._mouseMoveDelegate) .on("mouseup." + this.widgetName, this._mouseUpDelegate), t.preventDefault(), (r = !0), !0)) : !0; } }, _mouseMove: function (t) { if (this._mouseMoved) { if ( n.ui.ie && (!document.documentMode || 9 > document.documentMode) && !t.button ) return this._mouseUp(t); if (!t.which) if ( t.originalEvent.altKey || t.originalEvent.ctrlKey || t.originalEvent.metaKey || t.originalEvent.shiftKey ) this.ignoreMissingWhich = !0; else if (!this.ignoreMissingWhich) return this._mouseUp(t); } return ( (t.which || t.button) && (this._mouseMoved = !0), this._mouseStarted ? (this._mouseDrag(t), t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && ((this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1), this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted) ); }, _mouseUp: function (t) { this.document .off("mousemove." + this.widgetName, this._mouseMoveDelegate) .off("mouseup." + this.widgetName, this._mouseUpDelegate); this._mouseStarted && ((this._mouseStarted = !1), t.target === this._mouseDownEvent.target && n.data(t.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(t)); this._mouseDelayTimer && (clearTimeout(this._mouseDelayTimer), delete this._mouseDelayTimer); this.ignoreMissingWhich = !1; r = !1; t.preventDefault(); }, _mouseDistanceMet: function (n) { return ( Math.max( Math.abs(this._mouseDownEvent.pageX - n.pageX), Math.abs(this._mouseDownEvent.pageY - n.pageY) ) >= this.options.distance ); }, _mouseDelayMet: function () { return this.mouseDelayMet; }, _mouseStart: function () {}, _mouseDrag: function () {}, _mouseStop: function () {}, _mouseCapture: function () { return !0; }, }); n.ui.plugin = { add: function (t, i, r) { var u, f = n.ui[t].prototype; for (u in r) (f.plugins[u] = f.plugins[u] || []), f.plugins[u].push([i, r[u]]); }, call: function (n, t, i, r) { var u, f = n.plugins[t]; if ( f && (r || (n.element[0].parentNode && 11 !== n.element[0].parentNode.nodeType)) ) for (u = 0; f.length > u; u++) n.options[f[u][0]] && f[u][1].apply(n.element, i); }, }; n.ui.safeActiveElement = function (n) { var t; try { t = n.activeElement; } catch (i) { t = n.body; } return t || (t = n.body), t.nodeName || (t = n.body), t; }; n.ui.safeBlur = function (t) { t && "body" !== t.nodeName.toLowerCase() && n(t).trigger("blur"); }; n.widget("ui.draggable", n.ui.mouse, { version: "1.12.1", widgetEventPrefix: "drag", options: { addClasses: !0, appendTo: "parent", axis: !1, connectToSortable: !1, containment: !1, cursor: "auto", cursorAt: !1, grid: !1, handle: !1, helper: "original", iframeFix: !1, opacity: !1, refreshPositions: !1, revert: !1, revertDuration: 500, scope: "default", scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, snap: !1, snapMode: "both", snapTolerance: 20, stack: !1, zIndex: !1, drag: null, start: null, stop: null, }, _create: function () { "original" === this.options.helper && this._setPositionRelative(); this.options.addClasses && this._addClass("ui-draggable"); this._setHandleClassName(); this._mouseInit(); }, _setOption: function (n, t) { this._super(n, t); "handle" === n && (this._removeHandleClassName(), this._setHandleClassName()); }, _destroy: function () { return (this.helper || this.element).is(".ui-draggable-dragging") ? ((this.destroyOnClear = !0), void 0) : (this._removeHandleClassName(), this._mouseDestroy(), void 0); }, _mouseCapture: function (t) { var i = this.options; return this.helper || i.disabled || n(t.target).closest(".ui-resizable-handle").length > 0 ? !1 : ((this.handle = this._getHandle(t)), this.handle ? (this._blurActiveElement(t), this._blockFrames(i.iframeFix === !0 ? "iframe" : i.iframeFix), !0) : !1); }, _blockFrames: function (t) { this.iframeBlocks = this.document.find(t).map(function () { var t = n(this); return n("
") .css("position", "absolute") .appendTo(t.parent()) .outerWidth(t.outerWidth()) .outerHeight(t.outerHeight()) .offset(t.offset())[0]; }); }, _unblockFrames: function () { this.iframeBlocks && (this.iframeBlocks.remove(), delete this.iframeBlocks); }, _blurActiveElement: function (t) { var i = n.ui.safeActiveElement(this.document[0]), r = n(t.target); r.closest(i).length || n.ui.safeBlur(i); }, _mouseStart: function (t) { var i = this.options; return ( (this.helper = this._createHelper(t)), this._addClass(this.helper, "ui-draggable-dragging"), this._cacheHelperProportions(), n.ui.ddmanager && (n.ui.ddmanager.current = this), this._cacheMargins(), (this.cssPosition = this.helper.css("position")), (this.scrollParent = this.helper.scrollParent(!0)), (this.offsetParent = this.helper.offsetParent()), (this.hasFixedAncestor = this.helper.parents().filter(function () { return "fixed" === n(this).css("position"); }).length > 0), (this.positionAbs = this.element.offset()), this._refreshOffsets(t), (this.originalPosition = this.position = this._generatePosition(t, !1)), (this.originalPageX = t.pageX), (this.originalPageY = t.pageY), i.cursorAt && this._adjustOffsetFromHelper(i.cursorAt), this._setContainment(), this._trigger("start", t) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), n.ui.ddmanager && !i.dropBehaviour && n.ui.ddmanager.prepareOffsets(this, t), this._mouseDrag(t, !0), n.ui.ddmanager && n.ui.ddmanager.dragStart(this, t), !0) ); }, _refreshOffsets: function (n) { this.offset = { top: this.positionAbs.top - this.margins.top, left: this.positionAbs.left - this.margins.left, scroll: !1, parent: this._getParentOffset(), relative: this._getRelativeOffset(), }; this.offset.click = { left: n.pageX - this.offset.left, top: n.pageY - this.offset.top, }; }, _mouseDrag: function (t, i) { if ( (this.hasFixedAncestor && (this.offset.parent = this._getParentOffset()), (this.position = this._generatePosition(t, !0)), (this.positionAbs = this._convertPositionTo("absolute")), !i) ) { var r = this._uiHash(); if (this._trigger("drag", t, r) === !1) return this._mouseUp(new n.Event("mouseup", t)), !1; this.position = r.position; } return ( (this.helper[0].style.left = this.position.left + "px"), (this.helper[0].style.top = this.position.top + "px"), n.ui.ddmanager && n.ui.ddmanager.drag(this, t), !1 ); }, _mouseStop: function (t) { var r = this, i = !1; return ( n.ui.ddmanager && !this.options.dropBehaviour && (i = n.ui.ddmanager.drop(this, t)), this.dropped && ((i = this.dropped), (this.dropped = !1)), ("invalid" === this.options.revert && !i) || ("valid" === this.options.revert && i) || this.options.revert === !0 || (n.isFunction(this.options.revert) && this.options.revert.call(this.element, i)) ? n(this.helper).animate( this.originalPosition, parseInt(this.options.revertDuration, 10), function () { r._trigger("stop", t) !== !1 && r._clear(); } ) : this._trigger("stop", t) !== !1 && this._clear(), !1 ); }, _mouseUp: function (t) { return ( this._unblockFrames(), n.ui.ddmanager && n.ui.ddmanager.dragStop(this, t), this.handleElement.is(t.target) && this.element.trigger("focus"), n.ui.mouse.prototype._mouseUp.call(this, t) ); }, cancel: function () { return ( this.helper.is(".ui-draggable-dragging") ? this._mouseUp(new n.Event("mouseup", { target: this.element[0] })) : this._clear(), this ); }, _getHandle: function (t) { return this.options.handle ? !!n(t.target).closest(this.element.find(this.options.handle)).length : !0; }, _setHandleClassName: function () { this.handleElement = this.options.handle ? this.element.find(this.options.handle) : this.element; this._addClass(this.handleElement, "ui-draggable-handle"); }, _removeHandleClassName: function () { this._removeClass(this.handleElement, "ui-draggable-handle"); }, _createHelper: function (t) { var r = this.options, u = n.isFunction(r.helper), i = u ? n(r.helper.apply(this.element[0], [t])) : "clone" === r.helper ? this.element.clone().removeAttr("id") : this.element; return ( i.parents("body").length || i.appendTo( "parent" === r.appendTo ? this.element[0].parentNode : r.appendTo ), u && i[0] === this.element[0] && this._setPositionRelative(), i[0] === this.element[0] || /(fixed|absolute)/.test(i.css("position")) || i.css("position", "absolute"), i ); }, _setPositionRelative: function () { /^(?:r|a|f)/.test(this.element.css("position")) || (this.element[0].style.position = "relative"); }, _adjustOffsetFromHelper: function (t) { "string" == typeof t && (t = t.split(" ")); n.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); }, _isRootNode: function (n) { return /(html|body)/i.test(n.tagName) || n === this.document[0]; }, _getParentOffset: function () { var t = this.offsetParent.offset(), i = this.document[0]; return ( "absolute" === this.cssPosition && this.scrollParent[0] !== i && n.contains(this.scrollParent[0], this.offsetParent[0]) && ((t.left += this.scrollParent.scrollLeft()), (t.top += this.scrollParent.scrollTop())), this._isRootNode(this.offsetParent[0]) && (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) return { top: 0, left: 0 }; var n = this.element.position(), t = this._isRootNode(this.scrollParent[0]); return { top: n.top - (parseInt(this.helper.css("top"), 10) || 0) + (t ? 0 : this.scrollParent.scrollTop()), left: n.left - (parseInt(this.helper.css("left"), 10) || 0) + (t ? 0 : this.scrollParent.scrollLeft()), }; }, _cacheMargins: function () { this.margins = { left: parseInt(this.element.css("marginLeft"), 10) || 0, top: parseInt(this.element.css("marginTop"), 10) || 0, right: parseInt(this.element.css("marginRight"), 10) || 0, bottom: parseInt(this.element.css("marginBottom"), 10) || 0, }; }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight(), }; }, _setContainment: function () { var f, t, i, r = this.options, u = this.document[0]; return ( (this.relativeContainer = null), r.containment ? "window" === r.containment ? ((this.containment = [ n(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, n(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, n(window).scrollLeft() + n(window).width() - this.helperProportions.width - this.margins.left, n(window).scrollTop() + (n(window).height() || u.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top, ]), void 0) : "document" === r.containment ? ((this.containment = [ 0, 0, n(u).width() - this.helperProportions.width - this.margins.left, (n(u).height() || u.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top, ]), void 0) : r.containment.constructor === Array ? ((this.containment = r.containment), void 0) : ("parent" === r.containment && (r.containment = this.helper[0].parentNode), (t = n(r.containment)), (i = t[0]), i && ((f = /(scroll|auto)/.test(t.css("overflow"))), (this.containment = [ (parseInt(t.css("borderLeftWidth"), 10) || 0) + (parseInt(t.css("paddingLeft"), 10) || 0), (parseInt(t.css("borderTopWidth"), 10) || 0) + (parseInt(t.css("paddingTop"), 10) || 0), (f ? Math.max(i.scrollWidth, i.offsetWidth) : i.offsetWidth) - (parseInt(t.css("borderRightWidth"), 10) || 0) - (parseInt(t.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (f ? Math.max(i.scrollHeight, i.offsetHeight) : i.offsetHeight) - (parseInt(t.css("borderBottomWidth"), 10) || 0) - (parseInt(t.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom, ]), (this.relativeContainer = t)), void 0) : ((this.containment = null), void 0) ); }, _convertPositionTo: function (n, t) { t || (t = this.position); var i = "absolute" === n ? 1 : -1, r = this._isRootNode(this.scrollParent[0]); return { top: t.top + this.offset.relative.top * i + this.offset.parent.top * i - ("fixed" === this.cssPosition ? -this.offset.scroll.top : r ? 0 : this.offset.scroll.top) * i, left: t.left + this.offset.relative.left * i + this.offset.parent.left * i - ("fixed" === this.cssPosition ? -this.offset.scroll.left : r ? 0 : this.offset.scroll.left) * i, }; }, _generatePosition: function (n, t) { var i, s, u, f, r = this.options, h = this._isRootNode(this.scrollParent[0]), e = n.pageX, o = n.pageY; return ( (h && this.offset.scroll) || (this.offset.scroll = { top: this.scrollParent.scrollTop(), left: this.scrollParent.scrollLeft(), }), t && (this.containment && (this.relativeContainer ? ((s = this.relativeContainer.offset()), (i = [ this.containment[0] + s.left, this.containment[1] + s.top, this.containment[2] + s.left, this.containment[3] + s.top, ])) : (i = this.containment), n.pageX - this.offset.click.left < i[0] && (e = i[0] + this.offset.click.left), n.pageY - this.offset.click.top < i[1] && (o = i[1] + this.offset.click.top), n.pageX - this.offset.click.left > i[2] && (e = i[2] + this.offset.click.left), n.pageY - this.offset.click.top > i[3] && (o = i[3] + this.offset.click.top)), r.grid && ((u = r.grid[1] ? this.originalPageY + Math.round((o - this.originalPageY) / r.grid[1]) * r.grid[1] : this.originalPageY), (o = i ? u - this.offset.click.top >= i[1] || u - this.offset.click.top > i[3] ? u : u - this.offset.click.top >= i[1] ? u - r.grid[1] : u + r.grid[1] : u), (f = r.grid[0] ? this.originalPageX + Math.round((e - this.originalPageX) / r.grid[0]) * r.grid[0] : this.originalPageX), (e = i ? f - this.offset.click.left >= i[0] || f - this.offset.click.left > i[2] ? f : f - this.offset.click.left >= i[0] ? f - r.grid[0] : f + r.grid[0] : f)), "y" === r.axis && (e = this.originalPageX), "x" === r.axis && (o = this.originalPageY)), { top: o - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.offset.scroll.top : h ? 0 : this.offset.scroll.top), left: e - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.offset.scroll.left : h ? 0 : this.offset.scroll.left), } ); }, _clear: function () { this._removeClass(this.helper, "ui-draggable-dragging"); this.helper[0] === this.element[0] || this.cancelHelperRemoval || this.helper.remove(); this.helper = null; this.cancelHelperRemoval = !1; this.destroyOnClear && this.destroy(); }, _trigger: function (t, i, r) { return ( (r = r || this._uiHash()), n.ui.plugin.call(this, t, [i, r, this], !0), /^(drag|start|stop)/.test(t) && ((this.positionAbs = this._convertPositionTo("absolute")), (r.offset = this.positionAbs)), n.Widget.prototype._trigger.call(this, t, i, r) ); }, plugins: {}, _uiHash: function () { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs, }; }, }); n.ui.plugin.add("draggable", "connectToSortable", { start: function (t, i, r) { var u = n.extend({}, i, { item: r.element }); r.sortables = []; n(r.options.connectToSortable).each(function () { var i = n(this).sortable("instance"); i && !i.options.disabled && (r.sortables.push(i), i.refreshPositions(), i._trigger("activate", t, u)); }); }, stop: function (t, i, r) { var u = n.extend({}, i, { item: r.element }); r.cancelHelperRemoval = !1; n.each(r.sortables, function () { var n = this; n.isOver ? ((n.isOver = 0), (r.cancelHelperRemoval = !0), (n.cancelHelperRemoval = !1), (n._storedCSS = { position: n.placeholder.css("position"), top: n.placeholder.css("top"), left: n.placeholder.css("left"), }), n._mouseStop(t), (n.options.helper = n.options._helper)) : ((n.cancelHelperRemoval = !0), n._trigger("deactivate", t, u)); }); }, drag: function (t, i, r) { n.each(r.sortables, function () { var f = !1, u = this; u.positionAbs = r.positionAbs; u.helperProportions = r.helperProportions; u.offset.click = r.offset.click; u._intersectsWith(u.containerCache) && ((f = !0), n.each(r.sortables, function () { return ( (this.positionAbs = r.positionAbs), (this.helperProportions = r.helperProportions), (this.offset.click = r.offset.click), this !== u && this._intersectsWith(this.containerCache) && n.contains(u.element[0], this.element[0]) && (f = !1), f ); })); f ? (u.isOver || ((u.isOver = 1), (r._parent = i.helper.parent()), (u.currentItem = i.helper .appendTo(u.element) .data("ui-sortable-item", !0)), (u.options._helper = u.options.helper), (u.options.helper = function () { return i.helper[0]; }), (t.target = u.currentItem[0]), u._mouseCapture(t, !0), u._mouseStart(t, !0, !0), (u.offset.click.top = r.offset.click.top), (u.offset.click.left = r.offset.click.left), (u.offset.parent.left -= r.offset.parent.left - u.offset.parent.left), (u.offset.parent.top -= r.offset.parent.top - u.offset.parent.top), r._trigger("toSortable", t), (r.dropped = u.element), n.each(r.sortables, function () { this.refreshPositions(); }), (r.currentItem = r.element), (u.fromOutside = r)), u.currentItem && (u._mouseDrag(t), (i.position = u.position))) : u.isOver && ((u.isOver = 0), (u.cancelHelperRemoval = !0), (u.options._revert = u.options.revert), (u.options.revert = !1), u._trigger("out", t, u._uiHash(u)), u._mouseStop(t, !0), (u.options.revert = u.options._revert), (u.options.helper = u.options._helper), u.placeholder && u.placeholder.remove(), i.helper.appendTo(r._parent), r._refreshOffsets(t), (i.position = r._generatePosition(t, !0)), r._trigger("fromSortable", t), (r.dropped = !1), n.each(r.sortables, function () { this.refreshPositions(); })); }); }, }); n.ui.plugin.add("draggable", "cursor", { start: function (t, i, r) { var u = n("body"), f = r.options; u.css("cursor") && (f._cursor = u.css("cursor")); u.css("cursor", f.cursor); }, stop: function (t, i, r) { var u = r.options; u._cursor && n("body").css("cursor", u._cursor); }, }); n.ui.plugin.add("draggable", "opacity", { start: function (t, i, r) { var u = n(i.helper), f = r.options; u.css("opacity") && (f._opacity = u.css("opacity")); u.css("opacity", f.opacity); }, stop: function (t, i, r) { var u = r.options; u._opacity && n(i.helper).css("opacity", u._opacity); }, }); n.ui.plugin.add("draggable", "scroll", { start: function (n, t, i) { i.scrollParentNotHidden || (i.scrollParentNotHidden = i.helper.scrollParent(!1)); i.scrollParentNotHidden[0] !== i.document[0] && "HTML" !== i.scrollParentNotHidden[0].tagName && (i.overflowOffset = i.scrollParentNotHidden.offset()); }, drag: function (t, i, r) { var u = r.options, o = !1, e = r.scrollParentNotHidden[0], f = r.document[0]; e !== f && "HTML" !== e.tagName ? ((u.axis && "x" === u.axis) || (r.overflowOffset.top + e.offsetHeight - t.pageY < u.scrollSensitivity ? (e.scrollTop = o = e.scrollTop + u.scrollSpeed) : t.pageY - r.overflowOffset.top < u.scrollSensitivity && (e.scrollTop = o = e.scrollTop - u.scrollSpeed)), (u.axis && "y" === u.axis) || (r.overflowOffset.left + e.offsetWidth - t.pageX < u.scrollSensitivity ? (e.scrollLeft = o = e.scrollLeft + u.scrollSpeed) : t.pageX - r.overflowOffset.left < u.scrollSensitivity && (e.scrollLeft = o = e.scrollLeft - u.scrollSpeed))) : ((u.axis && "x" === u.axis) || (t.pageY - n(f).scrollTop() < u.scrollSensitivity ? (o = n(f).scrollTop(n(f).scrollTop() - u.scrollSpeed)) : n(window).height() - (t.pageY - n(f).scrollTop()) < u.scrollSensitivity && (o = n(f).scrollTop(n(f).scrollTop() + u.scrollSpeed))), (u.axis && "y" === u.axis) || (t.pageX - n(f).scrollLeft() < u.scrollSensitivity ? (o = n(f).scrollLeft(n(f).scrollLeft() - u.scrollSpeed)) : n(window).width() - (t.pageX - n(f).scrollLeft()) < u.scrollSensitivity && (o = n(f).scrollLeft(n(f).scrollLeft() + u.scrollSpeed)))); o !== !1 && n.ui.ddmanager && !u.dropBehaviour && n.ui.ddmanager.prepareOffsets(r, t); }, }); n.ui.plugin.add("draggable", "snap", { start: function (t, i, r) { var u = r.options; r.snapElements = []; n( u.snap.constructor !== String ? u.snap.items || ":data(ui-draggable)" : u.snap ).each(function () { var t = n(this), i = t.offset(); this !== r.element[0] && r.snapElements.push({ item: this, width: t.outerWidth(), height: t.outerHeight(), top: i.top, left: i.left, }); }); }, drag: function (t, i, r) { for ( var e, o, s, h, c, a, l, v, w, b = r.options, f = b.snapTolerance, y = i.offset.left, k = y + r.helperProportions.width, p = i.offset.top, d = p + r.helperProportions.height, u = r.snapElements.length - 1; u >= 0; u-- ) (c = r.snapElements[u].left - r.margins.left), (a = c + r.snapElements[u].width), (l = r.snapElements[u].top - r.margins.top), (v = l + r.snapElements[u].height), c - f > k || y > a + f || l - f > d || p > v + f || !n.contains( r.snapElements[u].item.ownerDocument, r.snapElements[u].item ) ? (r.snapElements[u].snapping && r.options.snap.release && r.options.snap.release.call( r.element, t, n.extend(r._uiHash(), { snapItem: r.snapElements[u].item }) ), (r.snapElements[u].snapping = !1)) : ("inner" !== b.snapMode && ((e = f >= Math.abs(l - d)), (o = f >= Math.abs(v - p)), (s = f >= Math.abs(c - k)), (h = f >= Math.abs(a - y)), e && (i.position.top = r._convertPositionTo("relative", { top: l - r.helperProportions.height, left: 0, }).top), o && (i.position.top = r._convertPositionTo("relative", { top: v, left: 0, }).top), s && (i.position.left = r._convertPositionTo("relative", { top: 0, left: c - r.helperProportions.width, }).left), h && (i.position.left = r._convertPositionTo("relative", { top: 0, left: a, }).left)), (w = e || o || s || h), "outer" !== b.snapMode && ((e = f >= Math.abs(l - p)), (o = f >= Math.abs(v - d)), (s = f >= Math.abs(c - y)), (h = f >= Math.abs(a - k)), e && (i.position.top = r._convertPositionTo("relative", { top: l, left: 0, }).top), o && (i.position.top = r._convertPositionTo("relative", { top: v - r.helperProportions.height, left: 0, }).top), s && (i.position.left = r._convertPositionTo("relative", { top: 0, left: c, }).left), h && (i.position.left = r._convertPositionTo("relative", { top: 0, left: a - r.helperProportions.width, }).left)), !r.snapElements[u].snapping && (e || o || s || h || w) && r.options.snap.snap && r.options.snap.snap.call( r.element, t, n.extend(r._uiHash(), { snapItem: r.snapElements[u].item }) ), (r.snapElements[u].snapping = e || o || s || h || w)); }, }); n.ui.plugin.add("draggable", "stack", { start: function (t, i, r) { var f, e = r.options, u = n.makeArray(n(e.stack)).sort(function (t, i) { return ( (parseInt(n(t).css("zIndex"), 10) || 0) - (parseInt(n(i).css("zIndex"), 10) || 0) ); }); u.length && ((f = parseInt(n(u[0]).css("zIndex"), 10) || 0), n(u).each(function (t) { n(this).css("zIndex", f + t); }), this.css("zIndex", f + u.length)); }, }); n.ui.plugin.add("draggable", "zIndex", { start: function (t, i, r) { var u = n(i.helper), f = r.options; u.css("zIndex") && (f._zIndex = u.css("zIndex")); u.css("zIndex", f.zIndex); }, stop: function (t, i, r) { var u = r.options; u._zIndex && n(i.helper).css("zIndex", u._zIndex); }, }); n.ui.draggable; n.widget("ui.droppable", { version: "1.12.1", widgetEventPrefix: "drop", options: { accept: "*", addClasses: !0, greedy: !1, scope: "default", tolerance: "intersect", activate: null, deactivate: null, drop: null, out: null, over: null, }, _create: function () { var t, i = this.options, r = i.accept; this.isover = !1; this.isout = !0; this.accept = n.isFunction(r) ? r : function (n) { return n.is(r); }; this.proportions = function () { return arguments.length ? ((t = arguments[0]), void 0) : t ? t : (t = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight, }); }; this._addToManager(i.scope); i.addClasses && this._addClass("ui-droppable"); }, _addToManager: function (t) { n.ui.ddmanager.droppables[t] = n.ui.ddmanager.droppables[t] || []; n.ui.ddmanager.droppables[t].push(this); }, _splice: function (n) { for (var t = 0; n.length > t; t++) n[t] === this && n.splice(t, 1); }, _destroy: function () { var t = n.ui.ddmanager.droppables[this.options.scope]; this._splice(t); }, _setOption: function (t, i) { if ("accept" === t) this.accept = n.isFunction(i) ? i : function (n) { return n.is(i); }; else if ("scope" === t) { var r = n.ui.ddmanager.droppables[this.options.scope]; this._splice(r); this._addToManager(i); } this._super(t, i); }, _activate: function (t) { var i = n.ui.ddmanager.current; this._addActiveClass(); i && this._trigger("activate", t, this.ui(i)); }, _deactivate: function (t) { var i = n.ui.ddmanager.current; this._removeActiveClass(); i && this._trigger("deactivate", t, this.ui(i)); }, _over: function (t) { var i = n.ui.ddmanager.current; i && (i.currentItem || i.element)[0] !== this.element[0] && this.accept.call(this.element[0], i.currentItem || i.element) && (this._addHoverClass(), this._trigger("over", t, this.ui(i))); }, _out: function (t) { var i = n.ui.ddmanager.current; i && (i.currentItem || i.element)[0] !== this.element[0] && this.accept.call(this.element[0], i.currentItem || i.element) && (this._removeHoverClass(), this._trigger("out", t, this.ui(i))); }, _drop: function (t, i) { var r = i || n.ui.ddmanager.current, u = !1; return r && (r.currentItem || r.element)[0] !== this.element[0] ? (this.element .find(":data(ui-droppable)") .not(".ui-draggable-dragging") .each(function () { var i = n(this).droppable("instance"); if ( i.options.greedy && !i.options.disabled && i.options.scope === r.options.scope && i.accept.call(i.element[0], r.currentItem || r.element) && f( r, n.extend(i, { offset: i.element.offset() }), i.options.tolerance, t ) ) return (u = !0), !1; }), u ? !1 : this.accept.call(this.element[0], r.currentItem || r.element) ? (this._removeActiveClass(), this._removeHoverClass(), this._trigger("drop", t, this.ui(r)), this.element) : !1) : !1; }, ui: function (n) { return { draggable: n.currentItem || n.element, helper: n.helper, position: n.position, offset: n.positionAbs, }; }, _addHoverClass: function () { this._addClass("ui-droppable-hover"); }, _removeHoverClass: function () { this._removeClass("ui-droppable-hover"); }, _addActiveClass: function () { this._addClass("ui-droppable-active"); }, _removeActiveClass: function () { this._removeClass("ui-droppable-active"); }, }); f = n.ui.intersect = (function () { function n(n, t, i) { return n >= t && t + i > n; } return function (t, i, r, u) { if (!i.offset) return !1; var o = (t.positionAbs || t.position.absolute).left + t.margins.left, s = (t.positionAbs || t.position.absolute).top + t.margins.top, h = o + t.helperProportions.width, c = s + t.helperProportions.height, f = i.offset.left, e = i.offset.top, l = f + i.proportions().width, a = e + i.proportions().height; switch (r) { case "fit": return o >= f && l >= h && s >= e && a >= c; case "intersect": return ( o + t.helperProportions.width / 2 > f && l > h - t.helperProportions.width / 2 && s + t.helperProportions.height / 2 > e && a > c - t.helperProportions.height / 2 ); case "pointer": return ( n(u.pageY, e, i.proportions().height) && n(u.pageX, f, i.proportions().width) ); case "touch": return ( ((s >= e && a >= s) || (c >= e && a >= c) || (e > s && c > a)) && ((o >= f && l >= o) || (h >= f && l >= h) || (f > o && h > l)) ); default: return !1; } }; })(); n.ui.ddmanager = { current: null, droppables: { default: [] }, prepareOffsets: function (t, i) { var r, f, u = n.ui.ddmanager.droppables[t.options.scope] || [], o = i ? i.type : null, e = (t.currentItem || t.element).find(":data(ui-droppable)").addBack(); n: for (r = 0; u.length > r; r++) if ( !( u[r].options.disabled || (t && !u[r].accept.call(u[r].element[0], t.currentItem || t.element)) ) ) { for (f = 0; e.length > f; f++) if (e[f] === u[r].element[0]) { u[r].proportions().height = 0; continue n; } u[r].visible = "none" !== u[r].element.css("display"); u[r].visible && ("mousedown" === o && u[r]._activate.call(u[r], i), (u[r].offset = u[r].element.offset()), u[r].proportions({ width: u[r].element[0].offsetWidth, height: u[r].element[0].offsetHeight, })); } }, drop: function (t, i) { var r = !1; return ( n.each( (n.ui.ddmanager.droppables[t.options.scope] || []).slice(), function () { this.options && (!this.options.disabled && this.visible && f(t, this, this.options.tolerance, i) && (r = this._drop.call(this, i) || r), !this.options.disabled && this.visible && this.accept.call(this.element[0], t.currentItem || t.element) && ((this.isout = !0), (this.isover = !1), this._deactivate.call(this, i))); } ), r ); }, dragStart: function (t, i) { t.element.parentsUntil("body").on("scroll.droppable", function () { t.options.refreshPositions || n.ui.ddmanager.prepareOffsets(t, i); }); }, drag: function (t, i) { t.options.refreshPositions && n.ui.ddmanager.prepareOffsets(t, i); n.each(n.ui.ddmanager.droppables[t.options.scope] || [], function () { if (!this.options.disabled && !this.greedyChild && this.visible) { var r, o, e, s = f(t, this, this.options.tolerance, i), u = !s && this.isover ? "isout" : s && !this.isover ? "isover" : null; u && (this.options.greedy && ((o = this.options.scope), (e = this.element .parents(":data(ui-droppable)") .filter(function () { return n(this).droppable("instance").options.scope === o; })), e.length && ((r = n(e[0]).droppable("instance")), (r.greedyChild = "isover" === u))), r && "isover" === u && ((r.isover = !1), (r.isout = !0), r._out.call(r, i)), (this[u] = !0), (this["isout" === u ? "isover" : "isout"] = !1), this["isover" === u ? "_over" : "_out"].call(this, i), r && "isout" === u && ((r.isout = !1), (r.isover = !0), r._over.call(r, i))); } }); }, dragStop: function (t, i) { t.element.parentsUntil("body").off("scroll.droppable"); t.options.refreshPositions || n.ui.ddmanager.prepareOffsets(t, i); }, }; n.uiBackCompat !== !1 && n.widget("ui.droppable", n.ui.droppable, { options: { hoverClass: !1, activeClass: !1 }, _addActiveClass: function () { this._super(); this.options.activeClass && this.element.addClass(this.options.activeClass); }, _removeActiveClass: function () { this._super(); this.options.activeClass && this.element.removeClass(this.options.activeClass); }, _addHoverClass: function () { this._super(); this.options.hoverClass && this.element.addClass(this.options.hoverClass); }, _removeHoverClass: function () { this._super(); this.options.hoverClass && this.element.removeClass(this.options.hoverClass); }, }); n.ui.droppable; n.widget("ui.resizable", n.ui.mouse, { version: "1.12.1", widgetEventPrefix: "resize", options: { alsoResize: !1, animate: !1, animateDuration: "slow", animateEasing: "swing", aspectRatio: !1, autoHide: !1, classes: { "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se" }, containment: !1, ghost: !1, grid: !1, handles: "e,s,se", helper: !1, maxHeight: null, maxWidth: null, minHeight: 10, minWidth: 10, zIndex: 90, resize: null, start: null, stop: null, }, _num: function (n) { return parseFloat(n) || 0; }, _isNumber: function (n) { return !isNaN(parseFloat(n)); }, _hasScroll: function (t, i) { if ("hidden" === n(t).css("overflow")) return !1; var r = i && "left" === i ? "scrollLeft" : "scrollTop", u = !1; return t[r] > 0 ? !0 : ((t[r] = 1), (u = t[r] > 0), (t[r] = 0), u); }, _create: function () { var r, t = this.options, i = this; this._addClass("ui-resizable"); n.extend(this, { _aspectRatio: !!t.aspectRatio, aspectRatio: t.aspectRatio, originalElement: this.element, _proportionallyResizeElements: [], _helper: t.helper || t.ghost || t.animate ? t.helper || "ui-resizable-helper" : null, }); this.element[0].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) && (this.element.wrap( n("
").css({ position: this.element.css("position"), width: this.element.outerWidth(), height: this.element.outerHeight(), top: this.element.css("top"), left: this.element.css("left"), }) ), (this.element = this.element .parent() .data("ui-resizable", this.element.resizable("instance"))), (this.elementIsWrapper = !0), (r = { marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom"), marginLeft: this.originalElement.css("marginLeft"), }), this.element.css(r), this.originalElement.css("margin", 0), (this.originalResizeStyle = this.originalElement.css("resize")), this.originalElement.css("resize", "none"), this._proportionallyResizeElements.push( this.originalElement.css({ position: "static", zoom: 1, display: "block", }) ), this.originalElement.css(r), this._proportionallyResize()); this._setupHandles(); t.autoHide && n(this.element) .on("mouseenter", function () { t.disabled || (i._removeClass("ui-resizable-autohide"), i._handles.show()); }) .on("mouseleave", function () { t.disabled || i.resizing || (i._addClass("ui-resizable-autohide"), i._handles.hide()); }); this._mouseInit(); }, _destroy: function () { this._mouseDestroy(); var t, i = function (t) { n(t) .removeData("resizable") .removeData("ui-resizable") .off(".resizable") .find(".ui-resizable-handle") .remove(); }; return ( this.elementIsWrapper && (i(this.element), (t = this.element), this.originalElement .css({ position: t.css("position"), width: t.outerWidth(), height: t.outerHeight(), top: t.css("top"), left: t.css("left"), }) .insertAfter(t), t.remove()), this.originalElement.css("resize", this.originalResizeStyle), i(this.originalElement), this ); }, _setOption: function (n, t) { switch ((this._super(n, t), n)) { case "handles": this._removeHandles(); this._setupHandles(); } }, _setupHandles: function () { var i, r, u, o, t, f = this.options, e = this; if ( ((this.handles = f.handles || (n(".ui-resizable-handle", this.element).length ? { n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw", } : "e,s,se")), (this._handles = n()), this.handles.constructor === String) ) for ( "all" === this.handles && (this.handles = "n,e,s,w,se,sw,ne,nw"), u = this.handles.split(","), this.handles = {}, r = 0; u.length > r; r++ ) (i = n.trim(u[r])), (o = "ui-resizable-" + i), (t = n("
")), this._addClass(t, "ui-resizable-handle " + o), t.css({ zIndex: f.zIndex }), (this.handles[i] = ".ui-resizable-" + i), this.element.append(t); this._renderAxis = function (t) { var i, r, u, f; t = t || this.element; for (i in this.handles) this.handles[i].constructor === String ? (this.handles[i] = this.element .children(this.handles[i]) .first() .show()) : (this.handles[i].jquery || this.handles[i].nodeType) && ((this.handles[i] = n(this.handles[i])), this._on(this.handles[i], { mousedown: e._mouseDown })), this.elementIsWrapper && this.originalElement[0].nodeName.match( /^(textarea|input|select|button)$/i ) && ((r = n(this.handles[i], this.element)), (f = /sw|ne|nw|se|n|s/.test(i) ? r.outerHeight() : r.outerWidth()), (u = [ "padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right" : "Left", ].join("")), t.css(u, f), this._proportionallyResize()), (this._handles = this._handles.add(this.handles[i])); }; this._renderAxis(this.element); this._handles = this._handles.add( this.element.find(".ui-resizable-handle") ); this._handles.disableSelection(); this._handles.on("mouseover", function () { e.resizing || (this.className && (t = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)), (e.axis = t && t[1] ? t[1] : "se")); }); f.autoHide && (this._handles.hide(), this._addClass("ui-resizable-autohide")); }, _removeHandles: function () { this._handles.remove(); }, _mouseCapture: function (t) { var r, i, u = !1; for (r in this.handles) (i = n(this.handles[r])[0]), (i === t.target || n.contains(i, t.target)) && (u = !0); return !this.options.disabled && u; }, _mouseStart: function (t) { var u, f, e, r = this.options, i = this.element; return ( (this.resizing = !0), this._renderProxy(), (u = this._num(this.helper.css("left"))), (f = this._num(this.helper.css("top"))), r.containment && ((u += n(r.containment).scrollLeft() || 0), (f += n(r.containment).scrollTop() || 0)), (this.offset = this.helper.offset()), (this.position = { left: u, top: f }), (this.size = this._helper ? { width: this.helper.width(), height: this.helper.height() } : { width: i.width(), height: i.height() }), (this.originalSize = this._helper ? { width: i.outerWidth(), height: i.outerHeight() } : { width: i.width(), height: i.height() }), (this.sizeDiff = { width: i.outerWidth() - i.width(), height: i.outerHeight() - i.height(), }), (this.originalPosition = { left: u, top: f }), (this.originalMousePosition = { left: t.pageX, top: t.pageY }), (this.aspectRatio = "number" == typeof r.aspectRatio ? r.aspectRatio : this.originalSize.width / this.originalSize.height || 1), (e = n(".ui-resizable-" + this.axis).css("cursor")), n("body").css("cursor", "auto" === e ? this.axis + "-resize" : e), this._addClass("ui-resizable-resizing"), this._propagate("start", t), !0 ); }, _mouseDrag: function (t) { var i, r, u = this.originalMousePosition, e = this.axis, o = t.pageX - u.left || 0, s = t.pageY - u.top || 0, f = this._change[e]; return ( this._updatePrevProperties(), f ? ((i = f.apply(this, [t, o, s])), this._updateVirtualBoundaries(t.shiftKey), (this._aspectRatio || t.shiftKey) && (i = this._updateRatio(i, t)), (i = this._respectSize(i, t)), this._updateCache(i), this._propagate("resize", t), (r = this._applyChanges()), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), n.isEmptyObject(r) || (this._updatePrevProperties(), this._trigger("resize", t, this.ui()), this._applyChanges()), !1) : !1 ); }, _mouseStop: function (t) { this.resizing = !1; var r, u, f, e, o, s, h, c = this.options, i = this; return ( this._helper && ((r = this._proportionallyResizeElements), (u = r.length && /textarea/i.test(r[0].nodeName)), (f = u && this._hasScroll(r[0], "left") ? 0 : i.sizeDiff.height), (e = u ? 0 : i.sizeDiff.width), (o = { width: i.helper.width() - e, height: i.helper.height() - f }), (s = parseFloat(i.element.css("left")) + (i.position.left - i.originalPosition.left) || null), (h = parseFloat(i.element.css("top")) + (i.position.top - i.originalPosition.top) || null), c.animate || this.element.css(n.extend(o, { top: h, left: s })), i.helper.height(i.size.height), i.helper.width(i.size.width), this._helper && !c.animate && this._proportionallyResize()), n("body").css("cursor", "auto"), this._removeClass("ui-resizable-resizing"), this._propagate("stop", t), this._helper && this.helper.remove(), !1 ); }, _updatePrevProperties: function () { this.prevPosition = { top: this.position.top, left: this.position.left }; this.prevSize = { width: this.size.width, height: this.size.height }; }, _applyChanges: function () { var n = {}; return ( this.position.top !== this.prevPosition.top && (n.top = this.position.top + "px"), this.position.left !== this.prevPosition.left && (n.left = this.position.left + "px"), this.size.width !== this.prevSize.width && (n.width = this.size.width + "px"), this.size.height !== this.prevSize.height && (n.height = this.size.height + "px"), this.helper.css(n), n ); }, _updateVirtualBoundaries: function (n) { var r, u, f, e, t, i = this.options; t = { minWidth: this._isNumber(i.minWidth) ? i.minWidth : 0, maxWidth: this._isNumber(i.maxWidth) ? i.maxWidth : 1 / 0, minHeight: this._isNumber(i.minHeight) ? i.minHeight : 0, maxHeight: this._isNumber(i.maxHeight) ? i.maxHeight : 1 / 0, }; (this._aspectRatio || n) && ((r = t.minHeight * this.aspectRatio), (f = t.minWidth / this.aspectRatio), (u = t.maxHeight * this.aspectRatio), (e = t.maxWidth / this.aspectRatio), r > t.minWidth && (t.minWidth = r), f > t.minHeight && (t.minHeight = f), t.maxWidth > u && (t.maxWidth = u), t.maxHeight > e && (t.maxHeight = e)); this._vBoundaries = t; }, _updateCache: function (n) { this.offset = this.helper.offset(); this._isNumber(n.left) && (this.position.left = n.left); this._isNumber(n.top) && (this.position.top = n.top); this._isNumber(n.height) && (this.size.height = n.height); this._isNumber(n.width) && (this.size.width = n.width); }, _updateRatio: function (n) { var t = this.position, i = this.size, r = this.axis; return ( this._isNumber(n.height) ? (n.width = n.height * this.aspectRatio) : this._isNumber(n.width) && (n.height = n.width / this.aspectRatio), "sw" === r && ((n.left = t.left + (i.width - n.width)), (n.top = null)), "nw" === r && ((n.top = t.top + (i.height - n.height)), (n.left = t.left + (i.width - n.width))), n ); }, _respectSize: function (n) { var t = this._vBoundaries, i = this.axis, r = this._isNumber(n.width) && t.maxWidth && t.maxWidth < n.width, u = this._isNumber(n.height) && t.maxHeight && t.maxHeight < n.height, f = this._isNumber(n.width) && t.minWidth && t.minWidth > n.width, e = this._isNumber(n.height) && t.minHeight && t.minHeight > n.height, o = this.originalPosition.left + this.originalSize.width, s = this.originalPosition.top + this.originalSize.height, h = /sw|nw|w/.test(i), c = /nw|ne|n/.test(i); return ( f && (n.width = t.minWidth), e && (n.height = t.minHeight), r && (n.width = t.maxWidth), u && (n.height = t.maxHeight), f && h && (n.left = o - t.minWidth), r && h && (n.left = o - t.maxWidth), e && c && (n.top = s - t.minHeight), u && c && (n.top = s - t.maxHeight), n.width || n.height || n.left || !n.top ? n.width || n.height || n.top || !n.left || (n.left = null) : (n.top = null), n ); }, _getPaddingPlusBorderDimensions: function (n) { for ( var t = 0, i = [], r = [ n.css("borderTopWidth"), n.css("borderRightWidth"), n.css("borderBottomWidth"), n.css("borderLeftWidth"), ], u = [ n.css("paddingTop"), n.css("paddingRight"), n.css("paddingBottom"), n.css("paddingLeft"), ]; 4 > t; t++ ) (i[t] = parseFloat(r[t]) || 0), (i[t] += parseFloat(u[t]) || 0); return { height: i[0] + i[2], width: i[1] + i[3] }; }, _proportionallyResize: function () { if (this._proportionallyResizeElements.length) for ( var n, t = 0, i = this.helper || this.element; this._proportionallyResizeElements.length > t; t++ ) (n = this._proportionallyResizeElements[t]), this.outerDimensions || (this.outerDimensions = this._getPaddingPlusBorderDimensions(n)), n.css({ height: i.height() - this.outerDimensions.height || 0, width: i.width() - this.outerDimensions.width || 0, }); }, _renderProxy: function () { var t = this.element, i = this.options; this.elementOffset = t.offset(); this._helper ? ((this.helper = this.helper || n("
")), this._addClass(this.helper, this._helper), this.helper.css({ width: this.element.outerWidth(), height: this.element.outerHeight(), position: "absolute", left: this.elementOffset.left + "px", top: this.elementOffset.top + "px", zIndex: ++i.zIndex, }), this.helper.appendTo("body").disableSelection()) : (this.helper = this.element); }, _change: { e: function (n, t) { return { width: this.originalSize.width + t }; }, w: function (n, t) { var i = this.originalSize, r = this.originalPosition; return { left: r.left + t, width: i.width - t }; }, n: function (n, t, i) { var r = this.originalSize, u = this.originalPosition; return { top: u.top + i, height: r.height - i }; }, s: function (n, t, i) { return { height: this.originalSize.height + i }; }, se: function (t, i, r) { return n.extend( this._change.s.apply(this, arguments), this._change.e.apply(this, [t, i, r]) ); }, sw: function (t, i, r) { return n.extend( this._change.s.apply(this, arguments), this._change.w.apply(this, [t, i, r]) ); }, ne: function (t, i, r) { return n.extend( this._change.n.apply(this, arguments), this._change.e.apply(this, [t, i, r]) ); }, nw: function (t, i, r) { return n.extend( this._change.n.apply(this, arguments), this._change.w.apply(this, [t, i, r]) ); }, }, _propagate: function (t, i) { n.ui.plugin.call(this, t, [i, this.ui()]); "resize" !== t && this._trigger(t, i, this.ui()); }, plugins: {}, ui: function () { return { originalElement: this.originalElement, element: this.element, helper: this.helper, position: this.position, size: this.size, originalSize: this.originalSize, originalPosition: this.originalPosition, }; }, }); n.ui.plugin.add("resizable", "animate", { stop: function (t) { var i = n(this).resizable("instance"), u = i.options, r = i._proportionallyResizeElements, f = r.length && /textarea/i.test(r[0].nodeName), s = f && i._hasScroll(r[0], "left") ? 0 : i.sizeDiff.height, h = f ? 0 : i.sizeDiff.width, c = { width: i.size.width - h, height: i.size.height - s }, e = parseFloat(i.element.css("left")) + (i.position.left - i.originalPosition.left) || null, o = parseFloat(i.element.css("top")) + (i.position.top - i.originalPosition.top) || null; i.element.animate(n.extend(c, o && e ? { top: o, left: e } : {}), { duration: u.animateDuration, easing: u.animateEasing, step: function () { var u = { width: parseFloat(i.element.css("width")), height: parseFloat(i.element.css("height")), top: parseFloat(i.element.css("top")), left: parseFloat(i.element.css("left")), }; r && r.length && n(r[0]).css({ width: u.width, height: u.height }); i._updateCache(u); i._propagate("resize", t); }, }); }, }); n.ui.plugin.add("resizable", "containment", { start: function () { var r, f, e, o, s, h, c, t = n(this).resizable("instance"), l = t.options, a = t.element, u = l.containment, i = u instanceof n ? u.get(0) : /parent/.test(u) ? a.parent().get(0) : u; i && ((t.containerElement = n(i)), /document/.test(u) || u === document ? ((t.containerOffset = { left: 0, top: 0 }), (t.containerPosition = { left: 0, top: 0 }), (t.parentData = { element: n(document), left: 0, top: 0, width: n(document).width(), height: n(document).height() || document.body.parentNode.scrollHeight, })) : ((r = n(i)), (f = []), n(["Top", "Right", "Left", "Bottom"]).each(function (n, i) { f[n] = t._num(r.css("padding" + i)); }), (t.containerOffset = r.offset()), (t.containerPosition = r.position()), (t.containerSize = { height: r.innerHeight() - f[3], width: r.innerWidth() - f[1], }), (e = t.containerOffset), (o = t.containerSize.height), (s = t.containerSize.width), (h = t._hasScroll(i, "left") ? i.scrollWidth : s), (c = t._hasScroll(i) ? i.scrollHeight : o), (t.parentData = { element: i, left: e.left, top: e.top, width: h, height: c, }))); }, resize: function (t) { var o, s, h, c, i = n(this).resizable("instance"), v = i.options, r = i.containerOffset, l = i.position, f = i._aspectRatio || t.shiftKey, e = { top: 0, left: 0 }, a = i.containerElement, u = !0; a[0] !== document && /static/.test(a.css("position")) && (e = r); l.left < (i._helper ? r.left : 0) && ((i.size.width = i.size.width + (i._helper ? i.position.left - r.left : i.position.left - e.left)), f && ((i.size.height = i.size.width / i.aspectRatio), (u = !1)), (i.position.left = v.helper ? r.left : 0)); l.top < (i._helper ? r.top : 0) && ((i.size.height = i.size.height + (i._helper ? i.position.top - r.top : i.position.top)), f && ((i.size.width = i.size.height * i.aspectRatio), (u = !1)), (i.position.top = i._helper ? r.top : 0)); h = i.containerElement.get(0) === i.element.parent().get(0); c = /relative|absolute/.test(i.containerElement.css("position")); h && c ? ((i.offset.left = i.parentData.left + i.position.left), (i.offset.top = i.parentData.top + i.position.top)) : ((i.offset.left = i.element.offset().left), (i.offset.top = i.element.offset().top)); o = Math.abs( i.sizeDiff.width + (i._helper ? i.offset.left - e.left : i.offset.left - r.left) ); s = Math.abs( i.sizeDiff.height + (i._helper ? i.offset.top - e.top : i.offset.top - r.top) ); o + i.size.width >= i.parentData.width && ((i.size.width = i.parentData.width - o), f && ((i.size.height = i.size.width / i.aspectRatio), (u = !1))); s + i.size.height >= i.parentData.height && ((i.size.height = i.parentData.height - s), f && ((i.size.width = i.size.height * i.aspectRatio), (u = !1))); u || ((i.position.left = i.prevPosition.left), (i.position.top = i.prevPosition.top), (i.size.width = i.prevSize.width), (i.size.height = i.prevSize.height)); }, stop: function () { var t = n(this).resizable("instance"), r = t.options, u = t.containerOffset, f = t.containerPosition, e = t.containerElement, i = n(t.helper), o = i.offset(), s = i.outerWidth() - t.sizeDiff.width, h = i.outerHeight() - t.sizeDiff.height; t._helper && !r.animate && /relative/.test(e.css("position")) && n(this).css({ left: o.left - f.left - u.left, width: s, height: h }); t._helper && !r.animate && /static/.test(e.css("position")) && n(this).css({ left: o.left - f.left - u.left, width: s, height: h }); }, }); n.ui.plugin.add("resizable", "alsoResize", { start: function () { var t = n(this).resizable("instance"), i = t.options; n(i.alsoResize).each(function () { var t = n(this); t.data("ui-resizable-alsoresize", { width: parseFloat(t.width()), height: parseFloat(t.height()), left: parseFloat(t.css("left")), top: parseFloat(t.css("top")), }); }); }, resize: function (t, i) { var r = n(this).resizable("instance"), e = r.options, u = r.originalSize, f = r.originalPosition, o = { height: r.size.height - u.height || 0, width: r.size.width - u.width || 0, top: r.position.top - f.top || 0, left: r.position.left - f.left || 0, }; n(e.alsoResize).each(function () { var t = n(this), u = n(this).data("ui-resizable-alsoresize"), r = {}, f = t.parents(i.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"]; n.each(f, function (n, t) { var i = (u[t] || 0) + (o[t] || 0); i && i >= 0 && (r[t] = i || null); }); t.css(r); }); }, stop: function () { n(this).removeData("ui-resizable-alsoresize"); }, }); n.ui.plugin.add("resizable", "ghost", { start: function () { var t = n(this).resizable("instance"), i = t.size; t.ghost = t.originalElement.clone(); t.ghost.css({ opacity: 0.25, display: "block", position: "relative", height: i.height, width: i.width, margin: 0, left: 0, top: 0, }); t._addClass(t.ghost, "ui-resizable-ghost"); n.uiBackCompat !== !1 && "string" == typeof t.options.ghost && t.ghost.addClass(this.options.ghost); t.ghost.appendTo(t.helper); }, resize: function () { var t = n(this).resizable("instance"); t.ghost && t.ghost.css({ position: "relative", height: t.size.height, width: t.size.width, }); }, stop: function () { var t = n(this).resizable("instance"); t.ghost && t.helper && t.helper.get(0).removeChild(t.ghost.get(0)); }, }); n.ui.plugin.add("resizable", "grid", { resize: function () { var h, t = n(this).resizable("instance"), i = t.options, y = t.size, o = t.originalSize, s = t.originalPosition, c = t.axis, l = "number" == typeof i.grid ? [i.grid, i.grid] : i.grid, f = l[0] || 1, e = l[1] || 1, a = Math.round((y.width - o.width) / f) * f, v = Math.round((y.height - o.height) / e) * e, r = o.width + a, u = o.height + v, p = i.maxWidth && r > i.maxWidth, w = i.maxHeight && u > i.maxHeight, b = i.minWidth && i.minWidth > r, k = i.minHeight && i.minHeight > u; i.grid = l; b && (r += f); k && (u += e); p && (r -= f); w && (u -= e); /^(se|s|e)$/.test(c) ? ((t.size.width = r), (t.size.height = u)) : /^(ne)$/.test(c) ? ((t.size.width = r), (t.size.height = u), (t.position.top = s.top - v)) : /^(sw)$/.test(c) ? ((t.size.width = r), (t.size.height = u), (t.position.left = s.left - a)) : ((0 >= u - e || 0 >= r - f) && (h = t._getPaddingPlusBorderDimensions(this)), u - e > 0 ? ((t.size.height = u), (t.position.top = s.top - v)) : ((u = e - h.height), (t.size.height = u), (t.position.top = s.top + o.height - u)), r - f > 0 ? ((t.size.width = r), (t.position.left = s.left - a)) : ((r = f - h.width), (t.size.width = r), (t.position.left = s.left + o.width - r))); }, }); n.ui.resizable; n.widget("ui.selectable", n.ui.mouse, { version: "1.12.1", options: { appendTo: "body", autoRefresh: !0, distance: 0, filter: "*", tolerance: "touch", selected: null, selecting: null, start: null, stop: null, unselected: null, unselecting: null, }, _create: function () { var t = this; this._addClass("ui-selectable"); this.dragged = !1; this.refresh = function () { t.elementPos = n(t.element[0]).offset(); t.selectees = n(t.options.filter, t.element[0]); t._addClass(t.selectees, "ui-selectee"); t.selectees.each(function () { var i = n(this), u = i.offset(), r = { left: u.left - t.elementPos.left, top: u.top - t.elementPos.top, }; n.data(this, "selectable-item", { element: this, $element: i, left: r.left, top: r.top, right: r.left + i.outerWidth(), bottom: r.top + i.outerHeight(), startselected: !1, selected: i.hasClass("ui-selected"), selecting: i.hasClass("ui-selecting"), unselecting: i.hasClass("ui-unselecting"), }); }); }; this.refresh(); this._mouseInit(); this.helper = n("
"); this._addClass(this.helper, "ui-selectable-helper"); }, _destroy: function () { this.selectees.removeData("selectable-item"); this._mouseDestroy(); }, _mouseStart: function (t) { var i = this, r = this.options; this.opos = [t.pageX, t.pageY]; this.elementPos = n(this.element[0]).offset(); this.options.disabled || ((this.selectees = n(r.filter, this.element[0])), this._trigger("start", t), n(r.appendTo).append(this.helper), this.helper.css({ left: t.pageX, top: t.pageY, width: 0, height: 0 }), r.autoRefresh && this.refresh(), this.selectees.filter(".ui-selected").each(function () { var r = n.data(this, "selectable-item"); r.startselected = !0; t.metaKey || t.ctrlKey || (i._removeClass(r.$element, "ui-selected"), (r.selected = !1), i._addClass(r.$element, "ui-unselecting"), (r.unselecting = !0), i._trigger("unselecting", t, { unselecting: r.element })); }), n(t.target) .parents() .addBack() .each(function () { var u, r = n.data(this, "selectable-item"); if (r) return ( (u = (!t.metaKey && !t.ctrlKey) || !r.$element.hasClass("ui-selected")), i ._removeClass( r.$element, u ? "ui-unselecting" : "ui-selected" ) ._addClass(r.$element, u ? "ui-selecting" : "ui-unselecting"), (r.unselecting = !u), (r.selecting = u), (r.selected = u), u ? i._trigger("selecting", t, { selecting: r.element }) : i._trigger("unselecting", t, { unselecting: r.element }), !1 ); })); }, _mouseDrag: function (t) { if (((this.dragged = !0), !this.options.disabled)) { var o, i = this, s = this.options, r = this.opos[0], u = this.opos[1], f = t.pageX, e = t.pageY; return ( r > f && ((o = f), (f = r), (r = o)), u > e && ((o = e), (e = u), (u = o)), this.helper.css({ left: r, top: u, width: f - r, height: e - u }), this.selectees.each(function () { var o = n.data(this, "selectable-item"), c = !1, h = {}; o && o.element !== i.element[0] && ((h.left = o.left + i.elementPos.left), (h.right = o.right + i.elementPos.left), (h.top = o.top + i.elementPos.top), (h.bottom = o.bottom + i.elementPos.top), "touch" === s.tolerance ? (c = !( h.left > f || r > h.right || h.top > e || u > h.bottom )) : "fit" === s.tolerance && (c = h.left > r && f > h.right && h.top > u && e > h.bottom), c ? (o.selected && (i._removeClass(o.$element, "ui-selected"), (o.selected = !1)), o.unselecting && (i._removeClass(o.$element, "ui-unselecting"), (o.unselecting = !1)), o.selecting || (i._addClass(o.$element, "ui-selecting"), (o.selecting = !0), i._trigger("selecting", t, { selecting: o.element }))) : (o.selecting && ((t.metaKey || t.ctrlKey) && o.startselected ? (i._removeClass(o.$element, "ui-selecting"), (o.selecting = !1), i._addClass(o.$element, "ui-selected"), (o.selected = !0)) : (i._removeClass(o.$element, "ui-selecting"), (o.selecting = !1), o.startselected && (i._addClass(o.$element, "ui-unselecting"), (o.unselecting = !0)), i._trigger("unselecting", t, { unselecting: o.element, }))), o.selected && (t.metaKey || t.ctrlKey || o.startselected || (i._removeClass(o.$element, "ui-selected"), (o.selected = !1), i._addClass(o.$element, "ui-unselecting"), (o.unselecting = !0), i._trigger("unselecting", t, { unselecting: o.element, }))))); }), !1 ); } }, _mouseStop: function (t) { var i = this; return ( (this.dragged = !1), n(".ui-unselecting", this.element[0]).each(function () { var r = n.data(this, "selectable-item"); i._removeClass(r.$element, "ui-unselecting"); r.unselecting = !1; r.startselected = !1; i._trigger("unselected", t, { unselected: r.element }); }), n(".ui-selecting", this.element[0]).each(function () { var r = n.data(this, "selectable-item"); i._removeClass(r.$element, "ui-selecting")._addClass( r.$element, "ui-selected" ); r.selecting = !1; r.selected = !0; r.startselected = !0; i._trigger("selected", t, { selected: r.element }); }), this._trigger("stop", t), this.helper.remove(), !1 ); }, }); n.widget("ui.sortable", n.ui.mouse, { version: "1.12.1", 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, activate: null, beforeStop: null, change: null, deactivate: null, out: null, over: null, receive: null, remove: null, sort: null, start: null, stop: null, update: null, }, _isOverAxis: function (n, t, i) { return n >= t && t + i > n; }, _isFloating: function (n) { return ( /left|right/.test(n.css("float")) || /inline|table-cell/.test(n.css("display")) ); }, _create: function () { this.containerCache = {}; this._addClass("ui-sortable"); this.refresh(); this.offset = this.element.offset(); this._mouseInit(); this._setHandleClassName(); this.ready = !0; }, _setOption: function (n, t) { this._super(n, t); "handle" === n && this._setHandleClassName(); }, _setHandleClassName: function () { var t = this; this._removeClass( this.element.find(".ui-sortable-handle"), "ui-sortable-handle" ); n.each(this.items, function () { t._addClass( this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item, "ui-sortable-handle" ); }); }, _destroy: function () { this._mouseDestroy(); for (var n = this.items.length - 1; n >= 0; n--) this.items[n].item.removeData(this.widgetName + "-item"); return this; }, _mouseCapture: function (t, i) { var r = null, f = !1, u = this; return this.reverting ? !1 : this.options.disabled || "static" === this.options.type ? !1 : (this._refreshItems(t), n(t.target) .parents() .each(function () { if (n.data(this, u.widgetName + "-item") === u) return (r = n(this)), !1; }), n.data(t.target, u.widgetName + "-item") === u && (r = n(t.target)), r ? !this.options.handle || i || (n(this.options.handle, r) .find("*") .addBack() .each(function () { this === t.target && (f = !0); }), f) ? ((this.currentItem = r), this._removeCurrentsFromItems(), !0) : !1 : !1); }, _mouseStart: function (t, i, r) { var f, e, u = 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.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), u.cursorAt && this._adjustOffsetFromHelper(u.cursorAt), (this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0], }), this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), u.containment && this._setContainment(), u.cursor && "auto" !== u.cursor && ((e = this.document.find("body")), (this.storedCursor = e.css("cursor")), e.css("cursor", u.cursor), (this.storedStylesheet = n( "" ).appendTo(e))), u.opacity && (this.helper.css("opacity") && (this._storedOpacity = this.helper.css("opacity")), this.helper.css("opacity", u.opacity)), u.zIndex && (this.helper.css("zIndex") && (this._storedZIndex = this.helper.css("zIndex")), this.helper.css("zIndex", u.zIndex)), this.scrollParent[0] !== this.document[0] && "HTML" !== this.scrollParent[0].tagName && (this.overflowOffset = this.scrollParent.offset()), this._trigger("start", t, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(), !r) ) for (f = this.containers.length - 1; f >= 0; f--) this.containers[f]._trigger("activate", t, this._uiHash(this)); return ( n.ui.ddmanager && (n.ui.ddmanager.current = this), n.ui.ddmanager && !u.dropBehaviour && n.ui.ddmanager.prepareOffsets(this, t), (this.dragging = !0), this._addClass(this.helper, "ui-sortable-helper"), this._mouseDrag(t), !0 ); }, _mouseDrag: function (t) { var e, u, f, o, i = this.options, r = !1; for ( this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo("absolute"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== this.document[0] && "HTML" !== this.scrollParent[0].tagName ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - t.pageY < i.scrollSensitivity ? (this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop + i.scrollSpeed) : t.pageY - this.overflowOffset.top < i.scrollSensitivity && (this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop - i.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - t.pageX < i.scrollSensitivity ? (this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft + i.scrollSpeed) : t.pageX - this.overflowOffset.left < i.scrollSensitivity && (this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft - i.scrollSpeed)) : (t.pageY - this.document.scrollTop() < i.scrollSensitivity ? (r = this.document.scrollTop( this.document.scrollTop() - i.scrollSpeed )) : this.window.height() - (t.pageY - this.document.scrollTop()) < i.scrollSensitivity && (r = this.document.scrollTop( this.document.scrollTop() + i.scrollSpeed )), t.pageX - this.document.scrollLeft() < i.scrollSensitivity ? (r = this.document.scrollLeft( this.document.scrollLeft() - i.scrollSpeed )) : this.window.width() - (t.pageX - this.document.scrollLeft()) < i.scrollSensitivity && (r = this.document.scrollLeft( this.document.scrollLeft() + i.scrollSpeed ))), r !== !1 && n.ui.ddmanager && !i.dropBehaviour && n.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"), e = this.items.length - 1; e >= 0; e-- ) if ( ((u = this.items[e]), (f = u.item[0]), (o = this._intersectsWithPointer(u)), o && u.instance === this.currentContainer && f !== this.currentItem[0] && this.placeholder[1 === o ? "next" : "prev"]()[0] !== f && !n.contains(this.placeholder[0], f) && ("semi-dynamic" === this.options.type ? !n.contains(this.element[0], f) : !0)) ) { if ( ((this.direction = 1 === o ? "down" : "up"), "pointer" !== this.options.tolerance && !this._intersectsWithSides(u)) ) break; this._rearrange(t, u); this._trigger("change", t, this._uiHash()); break; } return ( this._contactContainers(t), n.ui.ddmanager && n.ui.ddmanager.drag(this, t), this._trigger("sort", t, this._uiHash()), (this.lastPositionAbs = this.positionAbs), !1 ); }, _mouseStop: function (t, i) { if (t) { if ( (n.ui.ddmanager && !this.options.dropBehaviour && n.ui.ddmanager.drop(this, t), this.options.revert) ) { var e = this, f = this.placeholder.offset(), r = this.options.axis, u = {}; (r && "x" !== r) || (u.left = f.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft)); (r && "y" !== r) || (u.top = f.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop)); this.reverting = !0; n(this.helper).animate( u, parseInt(this.options.revert, 10) || 500, function () { e._clear(t); } ); } else this._clear(t, i); return !1; } }, cancel: function () { if (this.dragging) { this._mouseUp(new n.Event("mouseup", { target: null })); "original" === this.options.helper ? (this.currentItem.css(this._storedCSS), this._removeClass(this.currentItem, "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.extend(this, { helper: null, dragging: !1, reverting: !1, _noFinalSort: null, }), this.domPosition.prev ? n(this.domPosition.prev).after(this.currentItem) : n(this.domPosition.parent).prepend(this.currentItem)), this ); }, serialize: function (t) { var r = this._getItemsAsjQuery(t && t.connected), i = []; return ( (t = t || {}), n(r).each(function () { var r = (n(t.item || this).attr(t.attribute || "id") || "").match( t.expression || /(.+)[\-=_](.+)/ ); r && i.push( (t.key || r[1] + "[]") + "=" + (t.key && t.expression ? r[1] : r[2]) ); }), !i.length && t.key && i.push(t.key + "="), i.join("&") ); }, toArray: function (t) { var r = this._getItemsAsjQuery(t && t.connected), i = []; return ( (t = t || {}), r.each(function () { i.push(n(t.item || this).attr(t.attribute || "id") || ""); }), i ); }, _intersectsWith: function (n) { var t = this.positionAbs.left, h = t + this.helperProportions.width, i = this.positionAbs.top, c = i + this.helperProportions.height, r = n.left, f = r + n.width, u = n.top, e = u + n.height, o = this.offset.click.top, s = this.offset.click.left, l = "x" === this.options.axis || (i + o > u && e > i + o), a = "y" === this.options.axis || (t + s > r && f > t + s), v = l && a; return "pointer" === this.options.tolerance || this.options.forcePointerForContainers || ("pointer" !== this.options.tolerance && this.helperProportions[this.floating ? "width" : "height"] > n[this.floating ? "width" : "height"]) ? v : t + this.helperProportions.width / 2 > r && f > h - this.helperProportions.width / 2 && i + this.helperProportions.height / 2 > u && e > c - this.helperProportions.height / 2; }, _intersectsWithPointer: function (n) { var t, i, r = "x" === this.options.axis || this._isOverAxis( this.positionAbs.top + this.offset.click.top, n.top, n.height ), u = "y" === this.options.axis || this._isOverAxis( this.positionAbs.left + this.offset.click.left, n.left, n.width ), f = r && u; return f ? ((t = this._getDragVerticalDirection()), (i = this._getDragHorizontalDirection()), this.floating ? "right" === i || "down" === t ? 2 : 1 : t && ("down" === t ? 2 : 1)) : !1; }, _intersectsWithSides: function (n) { var r = this._isOverAxis( this.positionAbs.top + this.offset.click.top, n.top + n.height / 2, n.height ), u = this._isOverAxis( this.positionAbs.left + this.offset.click.left, n.left + n.width / 2, n.width ), t = this._getDragVerticalDirection(), i = this._getDragHorizontalDirection(); return this.floating && i ? ("right" === i && u) || ("left" === i && !u) : t && (("down" === t && r) || ("up" === t && !r)); }, _getDragVerticalDirection: function () { var n = this.positionAbs.top - this.lastPositionAbs.top; return 0 !== n && (n > 0 ? "down" : "up"); }, _getDragHorizontalDirection: function () { var n = this.positionAbs.left - this.lastPositionAbs.left; return 0 !== n && (n > 0 ? "right" : "left"); }, refresh: function (n) { return ( this._refreshItems(n), this._setHandleClassName(), this.refreshPositions(), this ); }, _connectWith: function () { var n = this.options; return n.connectWith.constructor === String ? [n.connectWith] : n.connectWith; }, _getItemsAsjQuery: function (t) { function h() { s.push(this); } var r, u, e, i, s = [], f = [], o = this._connectWith(); if (o && t) for (r = o.length - 1; r >= 0; r--) for (e = n(o[r], this.document[0]), u = e.length - 1; u >= 0; u--) (i = n.data(e[u], this.widgetFullName)), i && i !== this && !i.options.disabled && f.push([ n.isFunction(i.options.items) ? i.options.items.call(i.element) : n(i.options.items, i.element) .not(".ui-sortable-helper") .not(".ui-sortable-placeholder"), i, ]); for ( f.push([ n.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem, }) : n(this.options.items, this.element) .not(".ui-sortable-helper") .not(".ui-sortable-placeholder"), this, ]), r = f.length - 1; r >= 0; r-- ) f[r][0].each(h); return n(s); }, _removeCurrentsFromItems: function () { var t = this.currentItem.find(":data(" + this.widgetName + "-item)"); this.items = n.grep(this.items, function (n) { for (var i = 0; t.length > i; i++) if (t[i] === n.item[0]) return !1; return !0; }); }, _refreshItems: function (t) { this.items = []; this.containers = [this]; var r, u, e, i, o, s, h, l, a = this.items, f = [ [ n.isFunction(this.options.items) ? this.options.items.call(this.element[0], t, { item: this.currentItem, }) : n(this.options.items, this.element), this, ], ], c = this._connectWith(); if (c && this.ready) for (r = c.length - 1; r >= 0; r--) for (e = n(c[r], this.document[0]), u = e.length - 1; u >= 0; u--) (i = n.data(e[u], this.widgetFullName)), i && i !== this && !i.options.disabled && (f.push([ n.isFunction(i.options.items) ? i.options.items.call(i.element[0], t, { item: this.currentItem, }) : n(i.options.items, i.element), i, ]), this.containers.push(i)); for (r = f.length - 1; r >= 0; r--) for (o = f[r][1], s = f[r][0], u = 0, l = s.length; l > u; u++) (h = n(s[u])), h.data(this.widgetName + "-item", o), a.push({ item: h, instance: o, width: 0, height: 0, left: 0, top: 0, }); }, refreshPositions: function (t) { this.floating = this.items.length ? "x" === this.options.axis || this._isFloating(this.items[0].item) : !1; this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset()); for (var r, f, u, i = this.items.length - 1; i >= 0; i--) (r = this.items[i]), (r.instance !== this.currentContainer && this.currentContainer && r.item[0] !== this.currentItem[0]) || ((f = this.options.toleranceElement ? n(this.options.toleranceElement, r.item) : r.item), t || ((r.width = f.outerWidth()), (r.height = f.outerHeight())), (u = f.offset()), (r.left = u.left), (r.top = u.top)); if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this); else for (i = this.containers.length - 1; i >= 0; i--) (u = this.containers[i].element.offset()), (this.containers[i].containerCache.left = u.left), (this.containers[i].containerCache.top = u.top), (this.containers[i].containerCache.width = this.containers[i].element.outerWidth()), (this.containers[i].containerCache.height = this.containers[i].element.outerHeight()); return this; }, _createPlaceholder: function (t) { t = t || this; var r, i = t.options; (i.placeholder && i.placeholder.constructor !== String) || ((r = i.placeholder), (i.placeholder = { element: function () { var u = t.currentItem[0].nodeName.toLowerCase(), i = n("<" + u + ">", t.document[0]); return ( t ._addClass( i, "ui-sortable-placeholder", r || t.currentItem[0].className ) ._removeClass(i, "ui-sortable-helper"), "tbody" === u ? t._createTrPlaceholder( t.currentItem.find("tr").eq(0), n("", t.document[0]).appendTo(i) ) : "tr" === u ? t._createTrPlaceholder(t.currentItem, i) : "img" === u && i.attr("src", t.currentItem.attr("src")), r || i.css("visibility", "hidden"), i ); }, update: function (n, u) { (!r || i.forcePlaceholderSize) && (u.height() || u.height( t.currentItem.innerHeight() - parseInt(t.currentItem.css("paddingTop") || 0, 10) - parseInt(t.currentItem.css("paddingBottom") || 0, 10) ), u.width() || u.width( t.currentItem.innerWidth() - parseInt(t.currentItem.css("paddingLeft") || 0, 10) - parseInt(t.currentItem.css("paddingRight") || 0, 10) )); }, })); t.placeholder = n(i.placeholder.element.call(t.element, t.currentItem)); t.currentItem.after(t.placeholder); i.placeholder.update(t, t.placeholder); }, _createTrPlaceholder: function (t, i) { var r = this; t.children().each(function () { n(" ", r.document[0]) .attr("colspan", n(this).attr("colspan") || 1) .appendTo(i); }); }, _contactContainers: function (t) { for ( var u, c, f, a, v, o, l, s, h, e = null, i = null, r = this.containers.length - 1; r >= 0; r-- ) if (!n.contains(this.currentItem[0], this.containers[r].element[0])) if (this._intersectsWith(this.containers[r].containerCache)) { if (e && n.contains(this.containers[r].element[0], e.element[0])) continue; e = this.containers[r]; i = r; } else this.containers[r].containerCache.over && (this.containers[r]._trigger("out", t, this._uiHash(this)), (this.containers[r].containerCache.over = 0)); if (e) if (1 === this.containers.length) this.containers[i].containerCache.over || (this.containers[i]._trigger("over", t, this._uiHash(this)), (this.containers[i].containerCache.over = 1)); else { for ( c = 1e4, f = null, s = e.floating || this._isFloating(this.currentItem), a = s ? "left" : "top", v = s ? "width" : "height", h = s ? "pageX" : "pageY", u = this.items.length - 1; u >= 0; u-- ) n.contains(this.containers[i].element[0], this.items[u].item[0]) && this.items[u].item[0] !== this.currentItem[0] && ((o = this.items[u].item.offset()[a]), (l = !1), t[h] - o > this.items[u][v] / 2 && (l = !0), c > Math.abs(t[h] - o) && ((c = Math.abs(t[h] - o)), (f = this.items[u]), (this.direction = l ? "up" : "down"))); if (!f && !this.options.dropOnEmpty) return; if (this.currentContainer === this.containers[i]) return ( this.currentContainer.containerCache.over || (this.containers[i]._trigger("over", t, this._uiHash()), (this.currentContainer.containerCache.over = 1)), void 0 ); f ? this._rearrange(t, f, 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.currentContainer = this.containers[i]; 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 r = this.options, i = n.isFunction(r.helper) ? n(r.helper.apply(this.element[0], [t, this.currentItem])) : "clone" === r.helper ? this.currentItem.clone() : this.currentItem; return ( i.parents("body").length || n( "parent" !== r.appendTo ? r.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 || r.forceHelperSize) && i.width(this.currentItem.width()), (!i[0].style.height || r.forceHelperSize) && i.height(this.currentItem.height()), i ); }, _adjustOffsetFromHelper: function (t) { "string" == typeof t && (t = t.split(" ")); n.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] !== this.document[0] && n.contains(this.scrollParent[0], this.offsetParent[0]) && ((t.left += this.scrollParent.scrollLeft()), (t.top += this.scrollParent.scrollTop())), (this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && n.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 n = this.currentItem.position(); return { top: n.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: n.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, r, u, i = this.options; "parent" === i.containment && (i.containment = this.helper[0].parentNode); ("document" === i.containment || "window" === i.containment) && (this.containment = [ 0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, "document" === i.containment ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, ("document" === i.containment ? this.document.height() || document.body.parentNode.scrollHeight : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top, ]); /^(document|window|parent)$/.test(i.containment) || ((t = n(i.containment)[0]), (r = n(i.containment).offset()), (u = "hidden" !== n(t).css("overflow")), (this.containment = [ r.left + (parseInt(n(t).css("borderLeftWidth"), 10) || 0) + (parseInt(n(t).css("paddingLeft"), 10) || 0) - this.margins.left, r.top + (parseInt(n(t).css("borderTopWidth"), 10) || 0) + (parseInt(n(t).css("paddingTop"), 10) || 0) - this.margins.top, r.left + (u ? Math.max(t.scrollWidth, t.offsetWidth) : t.offsetWidth) - (parseInt(n(t).css("borderLeftWidth"), 10) || 0) - (parseInt(n(t).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, r.top + (u ? Math.max(t.scrollHeight, t.offsetHeight) : t.offsetHeight) - (parseInt(n(t).css("borderTopWidth"), 10) || 0) - (parseInt(n(t).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top, ])); }, _convertPositionTo: function (t, i) { i || (i = this.position); var r = "absolute" === t ? 1 : -1, u = "absolute" !== this.cssPosition || (this.scrollParent[0] !== this.document[0] && n.contains(this.scrollParent[0], this.offsetParent[0])) ? this.scrollParent : this.offsetParent, f = /(html|body)/i.test(u[0].tagName); return { top: i.top + this.offset.relative.top * r + this.offset.parent.top * r - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : f ? 0 : u.scrollTop()) * r, left: i.left + this.offset.relative.left * r + this.offset.parent.left * r - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : f ? 0 : u.scrollLeft()) * r, }; }, _generatePosition: function (t) { var r, u, i = this.options, f = t.pageX, e = t.pageY, o = "absolute" !== this.cssPosition || (this.scrollParent[0] !== this.document[0] && n.contains(this.scrollParent[0], this.offsetParent[0])) ? this.scrollParent : this.offsetParent, s = /(html|body)/i.test(o[0].tagName); return ( "relative" !== this.cssPosition || (this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0]) || (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (t.pageX - this.offset.click.left < this.containment[0] && (f = this.containment[0] + this.offset.click.left), t.pageY - this.offset.click.top < this.containment[1] && (e = this.containment[1] + this.offset.click.top), t.pageX - this.offset.click.left > this.containment[2] && (f = this.containment[2] + this.offset.click.left), t.pageY - this.offset.click.top > this.containment[3] && (e = this.containment[3] + this.offset.click.top)), i.grid && ((r = this.originalPageY + Math.round((e - this.originalPageY) / i.grid[1]) * i.grid[1]), (e = this.containment ? r - this.offset.click.top >= this.containment[1] && r - this.offset.click.top <= this.containment[3] ? r : r - this.offset.click.top >= this.containment[1] ? r - i.grid[1] : r + i.grid[1] : r), (u = this.originalPageX + Math.round((f - this.originalPageX) / i.grid[0]) * i.grid[0]), (f = this.containment ? u - this.offset.click.left >= this.containment[0] && u - this.offset.click.left <= this.containment[2] ? u : u - this.offset.click.left >= this.containment[0] ? u - i.grid[0] : u + i.grid[0] : u))), { top: e - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : s ? 0 : o.scrollTop()), left: f - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : s ? 0 : o.scrollLeft()), } ); }, _rearrange: function (n, t, i, r) { i ? i[0].appendChild(this.placeholder[0]) : t.item[0].parentNode.insertBefore( this.placeholder[0], "down" === this.direction ? t.item[0] : t.item[0].nextSibling ); this.counter = this.counter ? ++this.counter : 1; var u = this.counter; this._delay(function () { u === this.counter && this.refreshPositions(!r); }); }, _clear: function (n, t) { function u(n, t, i) { return function (r) { i._trigger(n, r, t._uiHash(t)); }; } this.reverting = !1; var i, r = []; if ( (!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), (this._noFinalSort = null), this.helper[0] === this.currentItem[0]) ) { for (i in this._storedCSS) ("auto" === this._storedCSS[i] || "static" === this._storedCSS[i]) && (this._storedCSS[i] = ""); this.currentItem.css(this._storedCSS); this._removeClass(this.currentItem, "ui-sortable-helper"); } else this.currentItem.show(); for ( this.fromOutside && !t && r.push(function (n) { this._trigger("receive", n, this._uiHash(this.fromOutside)); }), (!this.fromOutside && this.domPosition.prev === this.currentItem.prev().not(".ui-sortable-helper")[0] && this.domPosition.parent === this.currentItem.parent()[0]) || t || r.push(function (n) { this._trigger("update", n, this._uiHash()); }), this !== this.currentContainer && (t || (r.push(function (n) { this._trigger("remove", n, this._uiHash()); }), r.push( function (n) { return function (t) { n._trigger("receive", t, this._uiHash(this)); }; }.call(this, this.currentContainer) ), r.push( function (n) { return function (t) { n._trigger("update", t, this._uiHash(this)); }; }.call(this, this.currentContainer) ))), i = this.containers.length - 1; i >= 0; i-- ) t || r.push(u("deactivate", this, this.containers[i])), this.containers[i].containerCache.over && (r.push(u("out", this, this.containers[i])), (this.containers[i].containerCache.over = 0)); if ( (this.storedCursor && (this.document.find("body").css("cursor", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css("opacity", this._storedOpacity), this._storedZIndex && this.helper.css( "zIndex", "auto" === this._storedZIndex ? "" : this._storedZIndex ), (this.dragging = !1), t || this._trigger("beforeStop", n, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.cancelHelperRemoval || (this.helper[0] !== this.currentItem[0] && this.helper.remove(), (this.helper = null)), !t) ) { for (i = 0; r.length > i; i++) r[i].call(this, n); this._trigger("stop", n, this._uiHash()); } return (this.fromOutside = !1), !this.cancelHelperRemoval; }, _trigger: function () { n.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel(); }, _uiHash: function (t) { var i = t || this; return { helper: i.helper, placeholder: i.placeholder || n([]), position: i.position, originalPosition: i.originalPosition, offset: i.positionAbs, item: i.currentItem, sender: t ? t.element : null, }; }, }); n.widget("ui.accordion", { version: "1.12.1", options: { active: 0, animate: {}, classes: { "ui-accordion-header": "ui-corner-top", "ui-accordion-header-collapsed": "ui-corner-all", "ui-accordion-content": "ui-corner-bottom", }, collapsible: !1, event: "click", header: "> li > :first-child, > :not(li):even", heightStyle: "auto", icons: { activeHeader: "ui-icon-triangle-1-s", header: "ui-icon-triangle-1-e", }, activate: null, beforeActivate: null, }, hideProps: { borderTopWidth: "hide", borderBottomWidth: "hide", paddingTop: "hide", paddingBottom: "hide", height: "hide", }, showProps: { borderTopWidth: "show", borderBottomWidth: "show", paddingTop: "show", paddingBottom: "show", height: "show", }, _create: function () { var t = this.options; this.prevShow = this.prevHide = n(); this._addClass("ui-accordion", "ui-widget ui-helper-reset"); this.element.attr("role", "tablist"); t.collapsible || (t.active !== !1 && null != t.active) || (t.active = 0); this._processPanels(); 0 > t.active && (t.active += this.headers.length); this._refresh(); }, _getCreateEventData: function () { return { header: this.active, panel: this.active.length ? this.active.next() : n(), }; }, _createIcons: function () { var i, r, t = this.options.icons; t && ((i = n("")), this._addClass(i, "ui-accordion-header-icon", "ui-icon " + t.header), i.prependTo(this.headers), (r = this.active.children(".ui-accordion-header-icon")), this._removeClass(r, t.header) ._addClass(r, null, t.activeHeader) ._addClass(this.headers, "ui-accordion-icons")); }, _destroyIcons: function () { this._removeClass(this.headers, "ui-accordion-icons"); this.headers.children(".ui-accordion-header-icon").remove(); }, _destroy: function () { var n; this.element.removeAttr("role"); this.headers .removeAttr("role aria-expanded aria-selected aria-controls tabIndex") .removeUniqueId(); this._destroyIcons(); n = this.headers .next() .css("display", "") .removeAttr("role aria-hidden aria-labelledby") .removeUniqueId(); "content" !== this.options.heightStyle && n.css("height", ""); }, _setOption: function (n, t) { return "active" === n ? (this._activate(t), void 0) : ("event" === n && (this.options.event && this._off(this.headers, this.options.event), this._setupEvents(t)), this._super(n, t), "collapsible" !== n || t || this.options.active !== !1 || this._activate(0), "icons" === n && (this._destroyIcons(), t && this._createIcons()), void 0); }, _setOptionDisabled: function (n) { this._super(n); this.element.attr("aria-disabled", n); this._toggleClass(null, "ui-state-disabled", !!n); this._toggleClass( this.headers.add(this.headers.next()), null, "ui-state-disabled", !!n ); }, _keydown: function (t) { if (!t.altKey && !t.ctrlKey) { var i = n.ui.keyCode, u = this.headers.length, f = this.headers.index(t.target), r = !1; switch (t.keyCode) { case i.RIGHT: case i.DOWN: r = this.headers[(f + 1) % u]; break; case i.LEFT: case i.UP: r = this.headers[(f - 1 + u) % u]; break; case i.SPACE: case i.ENTER: this._eventHandler(t); break; case i.HOME: r = this.headers[0]; break; case i.END: r = this.headers[u - 1]; } r && (n(t.target).attr("tabIndex", -1), n(r).attr("tabIndex", 0), n(r).trigger("focus"), t.preventDefault()); } }, _panelKeyDown: function (t) { t.keyCode === n.ui.keyCode.UP && t.ctrlKey && n(t.currentTarget).prev().trigger("focus"); }, refresh: function () { var t = this.options; this._processPanels(); (t.active === !1 && t.collapsible === !0) || !this.headers.length ? ((t.active = !1), (this.active = n())) : t.active === !1 ? this._activate(0) : this.active.length && !n.contains(this.element[0], this.active[0]) ? this.headers.length === this.headers.find(".ui-state-disabled").length ? ((t.active = !1), (this.active = n())) : this._activate(Math.max(0, t.active - 1)) : (t.active = this.headers.index(this.active)); this._destroyIcons(); this._refresh(); }, _processPanels: function () { var t = this.headers, n = this.panels; this.headers = this.element.find(this.options.header); this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed", "ui-state-default" ); this.panels = this.headers .next() .filter(":not(.ui-accordion-content-active)") .hide(); this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" ); n && (this._off(t.not(this.headers)), this._off(n.not(this.panels))); }, _refresh: function () { var t, i = this.options, r = i.heightStyle, u = this.element.parent(); this.active = this._findActive(i.active); this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" )._removeClass(this.active, "ui-accordion-header-collapsed"); this._addClass(this.active.next(), "ui-accordion-content-active"); this.active.next().show(); this.headers .attr("role", "tab") .each(function () { var t = n(this), r = t.uniqueId().attr("id"), i = t.next(), u = i.uniqueId().attr("id"); t.attr("aria-controls", u); i.attr("aria-labelledby", r); }) .next() .attr("role", "tabpanel"); this.headers .not(this.active) .attr({ "aria-selected": "false", "aria-expanded": "false", tabIndex: -1, }) .next() .attr({ "aria-hidden": "true" }) .hide(); this.active.length ? this.active .attr({ "aria-selected": "true", "aria-expanded": "true", tabIndex: 0, }) .next() .attr({ "aria-hidden": "false" }) : this.headers.eq(0).attr("tabIndex", 0); this._createIcons(); this._setupEvents(i.event); "fill" === r ? ((t = u.height()), this.element.siblings(":visible").each(function () { var i = n(this), r = i.css("position"); "absolute" !== r && "fixed" !== r && (t -= i.outerHeight(!0)); }), this.headers.each(function () { t -= n(this).outerHeight(!0); }), this.headers .next() .each(function () { n(this).height( Math.max(0, t - n(this).innerHeight() + n(this).height()) ); }) .css("overflow", "auto")) : "auto" === r && ((t = 0), this.headers .next() .each(function () { var i = n(this).is(":visible"); i || n(this).show(); t = Math.max(t, n(this).css("height", "").height()); i || n(this).hide(); }) .height(t)); }, _activate: function (t) { var i = this._findActive(t)[0]; i !== this.active[0] && ((i = i || this.active[0]), this._eventHandler({ target: i, currentTarget: i, preventDefault: n.noop, })); }, _findActive: function (t) { return "number" == typeof t ? this.headers.eq(t) : n(); }, _setupEvents: function (t) { var i = { keydown: "_keydown" }; t && n.each(t.split(" "), function (n, t) { i[t] = "_eventHandler"; }); this._off(this.headers.add(this.headers.next())); this._on(this.headers, i); this._on(this.headers.next(), { keydown: "_panelKeyDown" }); this._hoverable(this.headers); this._focusable(this.headers); }, _eventHandler: function (t) { var e, o, i = this.options, u = this.active, r = n(t.currentTarget), f = r[0] === u[0], s = f && i.collapsible, c = s ? n() : r.next(), l = u.next(), h = { oldHeader: u, oldPanel: l, newHeader: s ? n() : r, newPanel: c }; t.preventDefault(); (f && !i.collapsible) || this._trigger("beforeActivate", t, h) === !1 || ((i.active = s ? !1 : this.headers.index(r)), (this.active = f ? n() : r), this._toggle(h), this._removeClass(u, "ui-accordion-header-active", "ui-state-active"), i.icons && ((e = u.children(".ui-accordion-header-icon")), this._removeClass(e, null, i.icons.activeHeader)._addClass( e, null, i.icons.header )), f || (this._removeClass(r, "ui-accordion-header-collapsed")._addClass( r, "ui-accordion-header-active", "ui-state-active" ), i.icons && ((o = r.children(".ui-accordion-header-icon")), this._removeClass(o, null, i.icons.header)._addClass( o, null, i.icons.activeHeader )), this._addClass(r.next(), "ui-accordion-content-active"))); }, _toggle: function (t) { var r = t.newPanel, i = this.prevShow.length ? this.prevShow : t.oldPanel; this.prevShow.add(this.prevHide).stop(!0, !0); this.prevShow = r; this.prevHide = i; this.options.animate ? this._animate(r, i, t) : (i.hide(), r.show(), this._toggleComplete(t)); i.attr({ "aria-hidden": "true" }); i.prev().attr({ "aria-selected": "false", "aria-expanded": "false" }); r.length && i.length ? i.prev().attr({ tabIndex: -1, "aria-expanded": "false" }) : r.length && this.headers .filter(function () { return 0 === parseInt(n(this).attr("tabIndex"), 10); }) .attr("tabIndex", -1); r.attr("aria-hidden", "false") .prev() .attr({ "aria-selected": "true", "aria-expanded": "true", tabIndex: 0, }); }, _animate: function (n, t, i) { var h, r, u, c = this, o = 0, l = n.css("box-sizing"), a = n.length && (!t.length || n.index() < t.index()), e = this.options.animate || {}, f = (a && e.down) || e, s = function () { c._toggleComplete(i); }; return ( "number" == typeof f && (u = f), "string" == typeof f && (r = f), (r = r || f.easing || e.easing), (u = u || f.duration || e.duration), t.length ? n.length ? ((h = n.show().outerHeight()), t.animate(this.hideProps, { duration: u, easing: r, step: function (n, t) { t.now = Math.round(n); }, }), n.hide().animate(this.showProps, { duration: u, easing: r, complete: s, step: function (n, i) { i.now = Math.round(n); "height" !== i.prop ? "content-box" === l && (o += i.now) : "content" !== c.options.heightStyle && ((i.now = Math.round(h - t.outerHeight() - o)), (o = 0)); }, }), void 0) : t.animate(this.hideProps, u, r, s) : n.animate(this.showProps, u, r, s) ); }, _toggleComplete: function (n) { var t = n.oldPanel, i = t.prev(); this._removeClass(t, "ui-accordion-content-active"); this._removeClass(i, "ui-accordion-header-active")._addClass( i, "ui-accordion-header-collapsed" ); t.length && (t.parent()[0].className = t.parent()[0].className); this._trigger("activate", null, n); }, }); n.widget("ui.menu", { version: "1.12.1", defaultElement: "