PageSourceSearch

https://baby-place.com/wp-content/plugins/pregnancy-calculator/js/jquery-ui.js?ver=7.1.2

js baby-place.com collected 2026-10-01 14:55:29 UTC 636,365 bytes, 20,644 lines download raw bytes

vendor: 4,248 bytes, lines 1-107
1/*! jQuery UI - v1.13.2 - 2022-07-14
2 * http://jqueryui.com
3 * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
4 * Copyright jQuery Foundation and other contributors; Licensed MIT */
5
6(function (factory) {
7  "use strict";
8
9  if (typeof define === "function" && define.amd) {
10    // AMD. Register as an anonymous module.
11    define(["jquery"], factory);
12  } else {
13    // Browser globals
14    factory(jQuery);
15  }
16})(function ($) {
17  "use strict";
18
19  $.ui = $.ui || {};
20
21  var version = ($.ui.version = "1.13.2");
22
23  /*!
24   * jQuery UI Widget 1.13.2
25   * http://jqueryui.com
26   *
27   * Copyright jQuery Foundation and other contributors
28   * Released under the MIT license.
29   * http://jquery.org/license
30   */
31
32  //>>label: Widget
33  //>>group: Core
34  //>>description: Provides a factory for creating stateful widgets with a common API.
35  //>>docs: http://api.jqueryui.com/jQuery.widget/
36  //>>demos: http://jqueryui.com/widget/
37
38  var widgetUuid = 0;
39  var widgetHasOwnProperty = Array.prototype.hasOwnProperty;
40  var widgetSlice = Array.prototype.slice;
41
42  $.cleanData = (function (orig) {
43    return function (elems) {
44      var events, elem, i;
45      for (i = 0; (elem = elems[i]) != null; i++) {
46        // Only trigger remove when necessary to save time
47        events = $._data(elem, "events");
48        if (events && events.remove) {
49          $(elem).triggerHandler("remove");
50        }
51      }
52      orig(elems);
53    };
54  })($.cleanData);
55
56  $.widget = function (name, base, prototype) {
57    var existingConstructor, constructor, basePrototype;
58
59    // ProxiedPrototype allows the provided prototype to remain unmodified
60    // so that it can be used as a mixin for multiple widgets (#8876)
61    var proxiedPrototype = {};
62
63    var namespace = name.split(".")[0];
64    name = name.split(".")[1];
65    var fullName = namespace + "-" + name;
66
67    if (!prototype) {
68      prototype = base;
69      base = $.Widget;
70    }
71
72    if (Array.isArray(prototype)) {
73      prototype = $.extend.apply(null, [{}].concat(prototype));
74    }
75
76    // Create selector for plugin
77    $.expr.pseudos[fullName.toLowerCase()] = function (elem) {
78      return !!$.data(elem, fullName);
79    };
80
81    $[namespace] = $[namespace] || {};
82    existingConstructor = $[namespace][name];
83    constructor = $[namespace][name] = function (options, element) {
84      // Allow instantiation without "new" keyword
85      if (!this || !this._createWidget) {
86        return new constructor(options, element);
87      }
88
89      // Allow instantiation without initializing for simple inheritance
90      // must use "new" keyword (the code above always passes args)
91      if (arguments.length) {
92        this._createWidget(options, element);
93      }
94    };
95
96    // Extend with the existing constructor to carry over any static properties
97    $.extend(constructor, existingConstructor, {
98      version: prototype.version,
99
100      // Copy the object used to create the prototype in case we need to
101      // redefine the widget later
102      _proto: $.extend({}, prototype),
103
104      // Track widgets that inherit from this widget in case this widget is
105      // redefined after a widget inherits from it
106      _childConstructors: [],
107    });
vendor: 20,807 bytes, lines 108-801
108
109    basePrototype = new base();
110
111    // We need to make the options hash a property directly on the new instance
112    // otherwise we'll modify the options hash on the prototype that we're
113    // inheriting from
114    basePrototype.options = $.widget.extend({}, basePrototype.options);
115    $.each(prototype, function (prop, value) {
116      if (typeof value !== "function") {
117        proxiedPrototype[prop] = value;
118        return;
119      }
120      proxiedPrototype[prop] = (function () {
121        function _super() {
122          return base.prototype[prop].apply(this, arguments);
123        }
124
125        function _superApply(args) {
126          return base.prototype[prop].apply(this, args);
127        }
128
129        return function () {
130          var __super = this._super;
131          var __superApply = this._superApply;
132          var returnValue;
133
134          this._super = _super;
135          this._superApply = _superApply;
136
137          returnValue = value.apply(this, arguments);
138
139          this._super = __super;
140          this._superApply = __superApply;
141
142          return returnValue;
143        };
144      })();
145    });
146    constructor.prototype = $.widget.extend(
147      basePrototype,
148      {
149        // TODO: remove support for widgetEventPrefix
150        // always use the name + a colon as the prefix, e.g., draggable:start
151        // don't prefix for widgets that aren't DOM-based
152        widgetEventPrefix: existingConstructor
153          ? basePrototype.widgetEventPrefix || name
154          : name,
155      },
156      proxiedPrototype,
157      {
158        constructor: constructor,
159        namespace: namespace,
160        widgetName: name,
161        widgetFullName: fullName,
162      }
163    );
164
165    // If this widget is being redefined then we need to find all widgets that
166    // are inheriting from it and redefine all of them so that they inherit from
167    // the new version of this widget. We're essentially trying to replace one
168    // level in the prototype chain.
169    if (existingConstructor) {
170      $.each(existingConstructor._childConstructors, function (i, child) {
171        var childPrototype = child.prototype;
172
173        // Redefine the child widget using the same prototype that was
174        // originally used, but inherit from the new version of the base
175        $.widget(
176          childPrototype.namespace + "." + childPrototype.widgetName,
177          constructor,
178          child._proto
179        );
180      });
181
182      // Remove the list of existing child constructors from the old constructor
183      // so the old child constructors can be garbage collected
184      delete existingConstructor._childConstructors;
185    } else {
186      base._childConstructors.push(constructor);
187    }
188
189    $.widget.bridge(name, constructor);
190
191    return constructor;
192  };
193
194  $.widget.extend = function (target) {
195    var input = widgetSlice.call(arguments, 1);
196    var inputIndex = 0;
197    var inputLength = input.length;
198    var key;
199    var value;
200
201    for (; inputIndex < inputLength; inputIndex++) {
202      for (key in input[inputIndex]) {
203        value = input[inputIndex][key];
204        if (
205          widgetHasOwnProperty.call(input[inputIndex], key) &&
206          value !== undefined
207        ) {
208          // Clone objects
209          if ($.isPlainObject(value)) {
210            target[key] = $.isPlainObject(target[key])
211              ? $.widget.extend({}, target[key], value)
212              : // Don't extend strings, arrays, etc. with objects
213                $.widget.extend({}, value);
214
215            // Copy everything else by reference
216          } else {
217            target[key] = value;
218          }
219        }
220      }
221    }
222    return target;
223  };
224
225  $.widget.bridge = function (name, object) {
226    var fullName = object.prototype.widgetFullName || name;
227    $.fn[name] = function (options) {
228      var isMethodCall = typeof options === "string";
229      var args = widgetSlice.call(arguments, 1);
230      var returnValue = this;
231
232      if (isMethodCall) {
233        // If this is an empty collection, we need to have the instance method
234        // return undefined instead of the jQuery instance
235        if (!this.length && options === "instance") {
236          returnValue = undefined;
237        } else {
238          this.each(function () {
239            var methodValue;
240            var instance = $.data(this, fullName);
241
242            if (options === "instance") {
243              returnValue = instance;
244              return false;
245            }
246
247            if (!instance) {
248              return $.error(
249                "cannot call methods on " +
250                  name +
251                  " prior to initialization; " +
252                  "attempted to call method '" +
253                  options +
254                  "'"
255              );
256            }
257
258            if (
259              typeof instance[options] !== "function" ||
260              options.charAt(0) === "_"
261            ) {
262              return $.error(
263                "no such method '" +
264                  options +
265                  "' for " +
266                  name +
267                  " widget instance"
268              );
269            }
270
271            methodValue = instance[options].apply(instance, args);
272
273            if (methodValue !== instance && methodValue !== undefined) {
274              returnValue =
275                methodValue && methodValue.jquery
276                  ? returnValue.pushStack(methodValue.get())
277                  : methodValue;
278              return false;
279            }
280          });
281        }
282      } else {
283        // Allow multiple hashes to be passed on init
284        if (args.length) {
285          options = $.widget.extend.apply(null, [options].concat(args));
286        }
287
288        this.each(function () {
289          var instance = $.data(this, fullName);
290          if (instance) {
291            instance.option(options || {});
292            if (instance._init) {
293              instance._init();
294            }
295          } else {
296            $.data(this, fullName, new object(options, this));
297          }
298        });
299      }
300
301      return returnValue;
302    };
303  };
304
305  $.Widget = function (/* options, element */) {};
306  $.Widget._childConstructors = [];
307
308  $.Widget.prototype = {
309    widgetName: "widget",
310    widgetEventPrefix: "",
311    defaultElement: "<div>",
312
313    options: {
314      classes: {},
315      disabled: false,
316
317      // Callbacks
318      create: null,
319    },
320
321    _createWidget: function (options, element) {
322      element = $(element || this.defaultElement || this)[0];
323      this.element = $(element);
324      this.uuid = widgetUuid++;
325      this.eventNamespace = "." + this.widgetName + this.uuid;
326
327      this.bindings = $();
328      this.hoverable = $();
329      this.focusable = $();
330      this.classesElementLookup = {};
331
332      if (element !== this) {
333        $.data(element, this.widgetFullName, this);
334        this._on(true, this.element, {
335          remove: function (event) {
336            if (event.target === element) {
337              this.destroy();
338            }
339          },
340        });
341        this.document = $(
342          element.style
343            ? // Element within the document
344              element.ownerDocument
345            : // Element is window or document
346              element.document || element
347        );
348        this.window = $(
349          this.document[0].defaultView || this.document[0].parentWindow
350        );
351      }
352
353      this.options = $.widget.extend(
354        {},
355        this.options,
356        this._getCreateOptions(),
357        options
358      );
359
360      this._create();
361
362      if (this.options.disabled) {
363        this._setOptionDisabled(this.options.disabled);
364      }
365
366      this._trigger("create", null, this._getCreateEventData());
367      this._init();
368    },
369
370    _getCreateOptions: function () {
371      return {};
372    },
373
374    _getCreateEventData: $.noop,
375
376    _create: $.noop,
377
378    _init: $.noop,
379
380    destroy: function () {
381      var that = this;
382
383      this._destroy();
384      $.each(this.classesElementLookup, function (key, value) {
385        that._removeClass(value, key);
386      });
387
388      // We can probably remove the unbind calls in 2.0
389      // all event bindings should go through this._on()
390      this.element.off(this.eventNamespace).removeData(this.widgetFullName);
391      this.widget().off(this.eventNamespace).removeAttr("aria-disabled");
392
393      // Clean up events and states
394      this.bindings.off(this.eventNamespace);
395    },
396
397    _destroy: $.noop,
398
399    widget: function () {
400      return this.element;
401    },
402
403    option: function (key, value) {
404      var options = key;
405      var parts;
406      var curOption;
407      var i;
408
409      if (arguments.length === 0) {
410        // Don't return a reference to the internal hash
411        return $.widget.extend({}, this.options);
412      }
413
414      if (typeof key === "string") {
415        // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
416        options = {};
417        parts = key.split(".");
418        key = parts.shift();
419        if (parts.length) {
420          curOption = options[key] = $.widget.extend({}, this.options[key]);
421          for (i = 0; i < parts.length - 1; i++) {
422            curOption[parts[i]] = curOption[parts[i]] || {};
423            curOption = curOption[parts[i]];
424          }
425          key = parts.pop();
426          if (arguments.length === 1) {
427            return curOption[key] === undefined ? null : curOption[key];
428          }
429          curOption[key] = value;
430        } else {
431          if (arguments.length === 1) {
432            return this.options[key] === undefined ? null : this.options[key];
433          }
434          options[key] = value;
435        }
436      }
437
438      this._setOptions(options);
439
440      return this;
441    },
442
443    _setOptions: function (options) {
444      var key;
445
446      for (key in options) {
447        this._setOption(key, options[key]);
448      }
449
450      return this;
451    },
452
453    _setOption: function (key, value) {
454      if (key === "classes") {
455        this._setOptionClasses(value);
456      }
457
458      this.options[key] = value;
459
460      if (key === "disabled") {
461        this._setOptionDisabled(value);
462      }
463
464      return this;
465    },
466
467    _setOptionClasses: function (value) {
468      var classKey, elements, currentElements;
469
470      for (classKey in value) {
471        currentElements = this.classesElementLookup[classKey];
472        if (
473          value[classKey] === this.options.classes[classKey] ||
474          !currentElements ||
475          !currentElements.length
476        ) {
477          continue;
478        }
479
480        // We are doing this to create a new jQuery object because the _removeClass() call
481        // on the next line is going to destroy the reference to the current elements being
482        // tracked. We need to save a copy of this collection so that we can add the new classes
483        // below.
484        elements = $(currentElements.get());
485        this._removeClass(currentElements, classKey);
486
487        // We don't use _addClass() here, because that uses this.options.classes
488        // for generating the string of classes. We want to use the value passed in from
489        // _setOption(), this is the new value of the classes option which was passed to
490        // _setOption(). We pass this value directly to _classes().
491        elements.addClass(
492          this._classes({
493            element: elements,
494            keys: classKey,
495            classes: value,
496            add: true,
497          })
498        );
499      }
500    },
501
502    _setOptionDisabled: function (value) {
503      this._toggleClass(
504        this.widget(),
505        this.widgetFullName + "-disabled",
506        null,
507        !!value
508      );
509
510      // If the widget is becoming disabled, then nothing is interactive
511      if (value) {
512        this._removeClass(this.hoverable, null, "ui-state-hover");
513        this._removeClass(this.focusable, null, "ui-state-focus");
514      }
515    },
516
517    enable: function () {
518      return this._setOptions({ disabled: false });
519    },
520
521    disable: function () {
522      return this._setOptions({ disabled: true });
523    },
524
525    _classes: function (options) {
526      var full = [];
527      var that = this;
528
529      options = $.extend(
530        {
531          element: this.element,
532          classes: this.options.classes || {},
533        },
534        options
535      );
536
537      function bindRemoveEvent() {
538        var nodesToBind = [];
539
540        options.element.each(function (_, element) {
541          var isTracked = $.map(that.classesElementLookup, function (elements) {
542            return elements;
543          }).some(function (elements) {
544            return elements.is(element);
545          });
546
547          if (!isTracked) {
548            nodesToBind.push(element);
549          }
550        });
551
552        that._on($(nodesToBind), {
553          remove: "_untrackClassesElement",
554        });
555      }
556
557      function processClassString(classes, checkOption) {
558        var current, i;
559        for (i = 0; i < classes.length; i++) {
560          current = that.classesElementLookup[classes[i]] || $();
561          if (options.add) {
562            bindRemoveEvent();
563            current = $(
564              $.uniqueSort(current.get().concat(options.element.get()))
565            );
566          } else {
567            current = $(current.not(options.element).get());
568          }
569          that.classesElementLookup[classes[i]] = current;
570          full.push(classes[i]);
571          if (checkOption && options.classes[classes[i]]) {
572            full.push(options.classes[classes[i]]);
573          }
574        }
575      }
576
577      if (options.keys) {
578        processClassString(options.keys.match(/\S+/g) || [], true);
579      }
580      if (options.extra) {
581        processClassString(options.extra.match(/\S+/g) || []);
582      }
583
584      return full.join(" ");
585    },
586
587    _untrackClassesElement: function (event) {
588      var that = this;
589      $.each(that.classesElementLookup, function (key, value) {
590        if ($.inArray(event.target, value) !== -1) {
591          that.classesElementLookup[key] = $(value.not(event.target).get());
592        }
593      });
594
595      this._off($(event.target));
596    },
597
598    _removeClass: function (element, keys, extra) {
599      return this._toggleClass(element, keys, extra, false);
600    },
601
602    _addClass: function (element, keys, extra) {
603      return this._toggleClass(element, keys, extra, true);
604    },
605
606    _toggleClass: function (element, keys, extra, add) {
607      add = typeof add === "boolean" ? add : extra;
608      var shift = typeof element === "string" || element === null,
609        options = {
610          extra: shift ? keys : extra,
611          keys: shift ? element : keys,
612          element: shift ? this.element : element,
613          add: add,
614        };
615      options.element.toggleClass(this._classes(options), add);
616      return this;
617    },
618
619    _on: function (suppressDisabledCheck, element, handlers) {
620      var delegateElement;
621      var instance = this;
622
623      // No suppressDisabledCheck flag, shuffle arguments
624      if (typeof suppressDisabledCheck !== "boolean") {
625        handlers = element;
626        element = suppressDisabledCheck;
627        suppressDisabledCheck = false;
628      }
629
630      // No element argument, shuffle and use this.element
631      if (!handlers) {
632        handlers = element;
633        element = this.element;
634        delegateElement = this.widget();
635      } else {
636        element = delegateElement = $(element);
637        this.bindings = this.bindings.add(element);
638      }
639
640      $.each(handlers, function (event, handler) {
641        function handlerProxy() {
642          // Allow widgets to customize the disabled handling
643          // - disabled as an array instead of boolean
644          // - disabled class as method for disabling individual parts
645          if (
646            !suppressDisabledCheck &&
647            (instance.options.disabled === true ||
648              $(this).hasClass("ui-state-disabled"))
649          ) {
650            return;
651          }
652          return (
653            typeof handler === "string" ? instance[handler] : handler
654          ).apply(instance, arguments);
655        }
656
657        // Copy the guid so direct unbinding works
658        if (typeof handler !== "string") {
659          handlerProxy.guid = handler.guid =
660            handler.guid || handlerProxy.guid || $.guid++;
661        }
662
663        var match = event.match(/^([\w:-]*)\s*(.*)$/);
664        var eventName = match[1] + instance.eventNamespace;
665        var selector = match[2];
666
667        if (selector) {
668          delegateElement.on(eventName, selector, handlerProxy);
669        } else {
670          element.on(eventName, handlerProxy);
671        }
672      });
673    },
674
675    _off: function (element, eventName) {
676      eventName =
677        (eventName || "").split(" ").join(this.eventNamespace + " ") +
678        this.eventNamespace;
679      element.off(eventName);
680
681      // Clear the stack to avoid memory leaks (#10056)
682      this.bindings = $(this.bindings.not(element).get());
683      this.focusable = $(this.focusable.not(element).get());
684      this.hoverable = $(this.hoverable.not(element).get());
685    },
686
687    _delay: function (handler, delay) {
688      function handlerProxy() {
689        return (
690          typeof handler === "string" ? instance[handler] : handler
691        ).apply(instance, arguments);
692      }
693      var instance = this;
694      return setTimeout(handlerProxy, delay || 0);
695    },
696
697    _hoverable: function (element) {
698      this.hoverable = this.hoverable.add(element);
699      this._on(element, {
700        mouseenter: function (event) {
701          this._addClass($(event.currentTarget), null, "ui-state-hover");
702        },
703        mouseleave: function (event) {
704          this._removeClass($(event.currentTarget), null, "ui-state-hover");
705        },
706      });
707    },
708
709    _focusable: function (element) {
710      this.focusable = this.focusable.add(element);
711      this._on(element, {
712        focusin: function (event) {
713          this._addClass($(event.currentTarget), null, "ui-state-focus");
714        },
715        focusout: function (event) {
716          this._removeClass($(event.currentTarget), null, "ui-state-focus");
717        },
718      });
719    },
720
721    _trigger: function (type, event, data) {
722      var prop, orig;
723      var callback = this.options[type];
724
725      data = data || {};
726      event = $.Event(event);
727      event.type = (
728        type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type
729      ).toLowerCase();
730
731      // The original event may come from any element
732      // so we need to reset the target on the new event
733      event.target = this.element[0];
734
735      // Copy original event properties over to the new event
736      orig = event.originalEvent;
737      if (orig) {
738        for (prop in orig) {
739          if (!(prop in event)) {
740            event[prop] = orig[prop];
741          }
742        }
743      }
744
745      this.element.trigger(event, data);
746      return !(
747        (typeof callback === "function" &&
748          callback.apply(this.element[0], [event].concat(data)) === false) ||
749        event.isDefaultPrevented()
750      );
751    },
752  };
753
754  $.each({ show: "fadeIn", hide: "fadeOut" }, function (method, defaultEffect) {
755    $.Widget.prototype["_" + method] = function (element, options, callback) {
756      if (typeof options === "string") {
757        options = { effect: options };
758      }
759
760      var hasOptions;
761      var effectName = !options
762        ? method
763        : options === true || typeof options === "number"
764        ? defaultEffect
765        : options.effect || defaultEffect;
766
767      options = options || {};
768      if (typeof options === "number") {
769        options = { duration: options };
770      } else if (options === true) {
771        options = {};
772      }
773
774      hasOptions = !$.isEmptyObject(options);
775      options.complete = callback;
776
777      if (options.delay) {
778        element.delay(options.delay);
779      }
780
781      if (hasOptions && $.effects && $.effects.effect[effectName]) {
782        element[method](options);
783      } else if (effectName !== method && element[effectName]) {
784        element[effectName](options.duration, options.easing, callback);
785      } else {
786        element.queue(function (next) {
787          $(this)[method]();
788          if (callback) {
789            callback.call(element[0]);
790          }
791          next();
792        });
793      }
794    };
795  });
796
797  var widget = $.widget;
798
799  /*!
800   * jQuery UI Position 1.13.2
801   * http://jqueryui.com
vendor: 6,480 bytes, lines 802-1004
802   *
803   * Copyright jQuery Foundation and other contributors
804   * Released under the MIT license.
805   * http://jquery.org/license
806   *
807   * http://api.jqueryui.com/position/
808   */
809
810  //>>label: Position
811  //>>group: Core
812  //>>description: Positions elements relative to other elements.
813  //>>docs: http://api.jqueryui.com/position/
814  //>>demos: http://jqueryui.com/position/
815
816  (function () {
817    var cachedScrollbarWidth,
818      max = Math.max,
819      abs = Math.abs,
820      rhorizontal = /left|center|right/,
821      rvertical = /top|center|bottom/,
822      roffset = /[\+\-]\d+(\.[\d]+)?%?/,
823      rposition = /^\w+/,
824      rpercent = /%$/,
825      _position = $.fn.position;
826
827    function getOffsets(offsets, width, height) {
828      return [
829        parseFloat(offsets[0]) * (rpercent.test(offsets[0]) ? width / 100 : 1),
830        parseFloat(offsets[1]) * (rpercent.test(offsets[1]) ? height / 100 : 1),
831      ];
832    }
833
834    function parseCss(element, property) {
835      return parseInt($.css(element, property), 10) || 0;
836    }
837
838    function isWindow(obj) {
839      return obj != null && obj === obj.window;
840    }
841
842    function getDimensions(elem) {
843      var raw = elem[0];
844      if (raw.nodeType === 9) {
845        return {
846          width: elem.width(),
847          height: elem.height(),
848          offset: { top: 0, left: 0 },
849        };
850      }
851      if (isWindow(raw)) {
852        return {
853          width: elem.width(),
854          height: elem.height(),
855          offset: { top: elem.scrollTop(), left: elem.scrollLeft() },
856        };
857      }
858      if (raw.preventDefault) {
859        return {
860          width: 0,
861          height: 0,
862          offset: { top: raw.pageY, left: raw.pageX },
863        };
864      }
865      return {
866        width: elem.outerWidth(),
867        height: elem.outerHeight(),
868        offset: elem.offset(),
869      };
870    }
871
872    $.position = {
873      scrollbarWidth: function () {
874        if (cachedScrollbarWidth !== undefined) {
875          return cachedScrollbarWidth;
876        }
877        var w1,
878          w2,
879          div = $(
880            "<div style=" +
881              "'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>" +
882              "<div style='height:300px;width:auto;'></div></div>"
883          ),
884          innerDiv = div.children()[0];
885
886        $("body").append(div);
887        w1 = innerDiv.offsetWidth;
888        div.css("overflow", "scroll");
889
890        w2 = innerDiv.offsetWidth;
891
892        if (w1 === w2) {
893          w2 = div[0].clientWidth;
894        }
895
896        div.remove();
897
898        return (cachedScrollbarWidth = w1 - w2);
899      },
900      getScrollInfo: function (within) {
901        var overflowX =
902            within.isWindow || within.isDocument
903              ? ""
904              : within.element.css("overflow-x"),
905          overflowY =
906            within.isWindow || within.isDocument
907              ? ""
908              : within.element.css("overflow-y"),
909          hasOverflowX =
910            overflowX === "scroll" ||
911            (overflowX === "auto" &&
912              within.width < within.element[0].scrollWidth),
913          hasOverflowY =
914            overflowY === "scroll" ||
915            (overflowY === "auto" &&
916              within.height < within.element[0].scrollHeight);
917        return {
918          width: hasOverflowY ? $.position.scrollbarWidth() : 0,
919          height: hasOverflowX ? $.position.scrollbarWidth() : 0,
920        };
921      },
922      getWithinInfo: function (element) {
923        var withinElement = $(element || window),
924          isElemWindow = isWindow(withinElement[0]),
925          isDocument = !!withinElement[0] && withinElement[0].nodeType === 9,
926          hasOffset = !isElemWindow && !isDocument;
927        return {
928          element: withinElement,
929          isWindow: isElemWindow,
930          isDocument: isDocument,
931          offset: hasOffset ? $(element).offset() : { left: 0, top: 0 },
932          scrollLeft: withinElement.scrollLeft(),
933          scrollTop: withinElement.scrollTop(),
934          width: withinElement.outerWidth(),
935          height: withinElement.outerHeight(),
936        };
937      },
938    };
939
940    $.fn.position = function (options) {
941      if (!options || !options.of) {
942        return _position.apply(this, arguments);
943      }
944
945      // Make a copy, we don't want to modify arguments
946      options = $.extend({}, options);
947
948      var atOffset,
949        targetWidth,
950        targetHeight,
951        targetOffset,
952        basePosition,
953        dimensions,
954        // Make sure string options are treated as CSS selectors
955        target =
956          typeof options.of === "string"
957            ? $(document).find(options.of)
958            : $(options.of),
959        within = $.position.getWithinInfo(options.within),
960        scrollInfo = $.position.getScrollInfo(within),
961        collision = (options.collision || "flip").split(" "),
962        offsets = {};
963
964      dimensions = getDimensions(target);
965      if (target[0].preventDefault) {
966        // Force left top to allow flipping
967        options.at = "left top";
968      }
969      targetWidth = dimensions.width;
970      targetHeight = dimensions.height;
971      targetOffset = dimensions.offset;
972
973      // Clone to reuse original targetOffset later
974      basePosition = $.extend({}, targetOffset);
975
976      // Force my and at to have valid horizontal and vertical positions
977      // if a value is missing or invalid, it will be converted to center
978      $.each(["my", "at"], function () {
979        var pos = (options[this] || "").split(" "),
980          horizontalOffset,
981          verticalOffset;
982
983        if (pos.length === 1) {
984          pos = rhorizontal.test(pos[0])
985            ? pos.concat(["center"])
986            : rvertical.test(pos[0])
987            ? ["center"].concat(pos)
988            : ["center", "center"];
989        }
990        pos[0] = rhorizontal.test(pos[0]) ? pos[0] : "center";
991        pos[1] = rvertical.test(pos[1]) ? pos[1] : "center";
992
993        // Calculate offsets
994        horizontalOffset = roffset.exec(pos[0]);
995        verticalOffset = roffset.exec(pos[1]);
996        offsets[this] = [
997          horizontalOffset ? horizontalOffset[0] : 0,
998          verticalOffset ? verticalOffset[0] : 0,
999        ];
1000
1001        // Reduce to just the positions without the offsets
1002        options[this] = [rposition.exec(pos[0])[0], rposition.exec(pos[1])[0]];
1003      });
1004
vendor: 12,585 bytes, lines 1005-1363
1005      // Normalize collision option
1006      if (collision.length === 1) {
1007        collision[1] = collision[0];
1008      }
1009
1010      if (options.at[0] === "right") {
1011        basePosition.left += targetWidth;
1012      } else if (options.at[0] === "center") {
1013        basePosition.left += targetWidth / 2;
1014      }
1015
1016      if (options.at[1] === "bottom") {
1017        basePosition.top += targetHeight;
1018      } else if (options.at[1] === "center") {
1019        basePosition.top += targetHeight / 2;
1020      }
1021
1022      atOffset = getOffsets(offsets.at, targetWidth, targetHeight);
1023      basePosition.left += atOffset[0];
1024      basePosition.top += atOffset[1];
1025
1026      return this.each(function () {
1027        var collisionPosition,
1028          using,
1029          elem = $(this),
1030          elemWidth = elem.outerWidth(),
1031          elemHeight = elem.outerHeight(),
1032          marginLeft = parseCss(this, "marginLeft"),
1033          marginTop = parseCss(this, "marginTop"),
1034          collisionWidth =
1035            elemWidth +
1036            marginLeft +
1037            parseCss(this, "marginRight") +
1038            scrollInfo.width,
1039          collisionHeight =
1040            elemHeight +
1041            marginTop +
1042            parseCss(this, "marginBottom") +
1043            scrollInfo.height,
1044          position = $.extend({}, basePosition),
1045          myOffset = getOffsets(
1046            offsets.my,
1047            elem.outerWidth(),
1048            elem.outerHeight()
1049          );
1050
1051        if (options.my[0] === "right") {
1052          position.left -= elemWidth;
1053        } else if (options.my[0] === "center") {
1054          position.left -= elemWidth / 2;
1055        }
1056
1057        if (options.my[1] === "bottom") {
1058          position.top -= elemHeight;
1059        } else if (options.my[1] === "center") {
1060          position.top -= elemHeight / 2;
1061        }
1062
1063        position.left += myOffset[0];
1064        position.top += myOffset[1];
1065
1066        collisionPosition = {
1067          marginLeft: marginLeft,
1068          marginTop: marginTop,
1069        };
1070
1071        $.each(["left", "top"], function (i, dir) {
1072          if ($.ui.position[collision[i]]) {
1073            $.ui.position[collision[i]][dir](position, {
1074              targetWidth: targetWidth,
1075              targetHeight: targetHeight,
1076              elemWidth: elemWidth,
1077              elemHeight: elemHeight,
1078              collisionPosition: collisionPosition,
1079              collisionWidth: collisionWidth,
1080              collisionHeight: collisionHeight,
1081              offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]],
1082              my: options.my,
1083              at: options.at,
1084              within: within,
1085              elem: elem,
1086            });
1087          }
1088        });
1089
1090        if (options.using) {
1091          // Adds feedback as second argument to using callback, if present
1092          using = function (props) {
1093            var left = targetOffset.left - position.left,
1094              right = left + targetWidth - elemWidth,
1095              top = targetOffset.top - position.top,
1096              bottom = top + targetHeight - elemHeight,
1097              feedback = {
1098                target: {
1099                  element: target,
1100                  left: targetOffset.left,
1101                  top: targetOffset.top,
1102                  width: targetWidth,
1103                  height: targetHeight,
1104                },
1105                element: {
1106                  element: elem,
1107                  left: position.left,
1108                  top: position.top,
1109                  width: elemWidth,
1110                  height: elemHeight,
1111                },
1112                horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
1113                vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle",
1114              };
1115            if (targetWidth < elemWidth && abs(left + right) < targetWidth) {
1116              feedback.horizontal = "center";
1117            }
1118            if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) {
1119              feedback.vertical = "middle";
1120            }
1121            if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) {
1122              feedback.important = "horizontal";
1123            } else {
1124              feedback.important = "vertical";
1125            }
1126            options.using.call(this, props, feedback);
1127          };
1128        }
1129
1130        elem.offset($.extend(position, { using: using }));
1131      });
1132    };
1133
1134    $.ui.position = {
1135      fit: {
1136        left: function (position, data) {
1137          var within = data.within,
1138            withinOffset = within.isWindow
1139              ? within.scrollLeft
1140              : within.offset.left,
1141            outerWidth = within.width,
1142            collisionPosLeft =
1143              position.left - data.collisionPosition.marginLeft,
1144            overLeft = withinOffset - collisionPosLeft,
1145            overRight =
1146              collisionPosLeft +
1147              data.collisionWidth -
1148              outerWidth -
1149              withinOffset,
1150            newOverRight;
1151
1152          // Element is wider than within
1153          if (data.collisionWidth > outerWidth) {
1154            // Element is initially over the left side of within
1155            if (overLeft > 0 && overRight <= 0) {
1156              newOverRight =
1157                position.left +
1158                overLeft +
1159                data.collisionWidth -
1160                outerWidth -
1161                withinOffset;
1162              position.left += overLeft - newOverRight;
1163
1164              // Element is initially over right side of within
1165            } else if (overRight > 0 && overLeft <= 0) {
1166              position.left = withinOffset;
1167
1168              // Element is initially over both left and right sides of within
1169            } else {
1170              if (overLeft > overRight) {
1171                position.left = withinOffset + outerWidth - data.collisionWidth;
1172              } else {
1173                position.left = withinOffset;
1174              }
1175            }
1176
1177            // Too far left -> align with left edge
1178          } else if (overLeft > 0) {
1179            position.left += overLeft;
1180
1181            // Too far right -> align with right edge
1182          } else if (overRight > 0) {
1183            position.left -= overRight;
1184
1185            // Adjust based on position and margin
1186          } else {
1187            position.left = max(
1188              position.left - collisionPosLeft,
1189              position.left
1190            );
1191          }
1192        },
1193        top: function (position, data) {
1194          var within = data.within,
1195            withinOffset = within.isWindow
1196              ? within.scrollTop
1197              : within.offset.top,
1198            outerHeight = data.within.height,
1199            collisionPosTop = position.top - data.collisionPosition.marginTop,
1200            overTop = withinOffset - collisionPosTop,
1201            overBottom =
1202              collisionPosTop +
1203              data.collisionHeight -
1204              outerHeight -
1205              withinOffset,
1206            newOverBottom;
1207
1208          // Element is taller than within
1209          if (data.collisionHeight > outerHeight) {
1210            // Element is initially over the top of within
1211            if (overTop > 0 && overBottom <= 0) {
1212              newOverBottom =
1213                position.top +
1214                overTop +
1215                data.collisionHeight -
1216                outerHeight -
1217                withinOffset;
1218              position.top += overTop - newOverBottom;
1219
1220              // Element is initially over bottom of within
1221            } else if (overBottom > 0 && overTop <= 0) {
1222              position.top = withinOffset;
1223
1224              // Element is initially over both top and bottom of within
1225            } else {
1226              if (overTop > overBottom) {
1227                position.top =
1228                  withinOffset + outerHeight - data.collisionHeight;
1229              } else {
1230                position.top = withinOffset;
1231              }
1232            }
1233
1234            // Too far up -> align with top
1235          } else if (overTop > 0) {
1236            position.top += overTop;
1237
1238            // Too far down -> align with bottom edge
1239          } else if (overBottom > 0) {
1240            position.top -= overBottom;
1241
1242            // Adjust based on position and margin
1243          } else {
1244            position.top = max(position.top - collisionPosTop, position.top);
1245          }
1246        },
1247      },
1248      flip: {
1249        left: function (position, data) {
1250          var within = data.within,
1251            withinOffset = within.offset.left + within.scrollLeft,
1252            outerWidth = within.width,
1253            offsetLeft = within.isWindow
1254              ? within.scrollLeft
1255              : within.offset.left,
1256            collisionPosLeft =
1257              position.left - data.collisionPosition.marginLeft,
1258            overLeft = collisionPosLeft - offsetLeft,
1259            overRight =
1260              collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
1261            myOffset =
1262              data.my[0] === "left"
1263                ? -data.elemWidth
1264                : data.my[0] === "right"
1265                ? data.elemWidth
1266                : 0,
1267            atOffset =
1268              data.at[0] === "left"
1269                ? data.targetWidth
1270                : data.at[0] === "right"
1271                ? -data.targetWidth
1272                : 0,
1273            offset = -2 * data.offset[0],
1274            newOverRight,
1275            newOverLeft;
1276
1277          if (overLeft < 0) {
1278            newOverRight =
1279              position.left +
1280              myOffset +
1281              atOffset +
1282              offset +
1283              data.collisionWidth -
1284              outerWidth -
1285              withinOffset;
1286            if (newOverRight < 0 || newOverRight < abs(overLeft)) {
1287              position.left += myOffset + atOffset + offset;
1288            }
1289          } else if (overRight > 0) {
1290            newOverLeft =
1291              position.left -
1292              data.collisionPosition.marginLeft +
1293              myOffset +
1294              atOffset +
1295              offset -
1296              offsetLeft;
1297            if (newOverLeft > 0 || abs(newOverLeft) < overRight) {
1298              position.left += myOffset + atOffset + offset;
1299            }
1300          }
1301        },
1302        top: function (position, data) {
1303          var within = data.within,
1304            withinOffset = within.offset.top + within.scrollTop,
1305            outerHeight = within.height,
1306            offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
1307            collisionPosTop = position.top - data.collisionPosition.marginTop,
1308            overTop = collisionPosTop - offsetTop,
1309            overBottom =
1310              collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
1311            top = data.my[1] === "top",
1312            myOffset = top
1313              ? -data.elemHeight
1314              : data.my[1] === "bottom"
1315              ? data.elemHeight
1316              : 0,
1317            atOffset =
1318              data.at[1] === "top"
1319                ? data.targetHeight
1320                : data.at[1] === "bottom"
1321                ? -data.targetHeight
1322                : 0,
1323            offset = -2 * data.offset[1],
1324            newOverTop,
1325            newOverBottom;
1326          if (overTop < 0) {
1327            newOverBottom =
1328              position.top +
1329              myOffset +
1330              atOffset +
1331              offset +
1332              data.collisionHeight -
1333              outerHeight -
1334              withinOffset;
1335            if (newOverBottom < 0 || newOverBottom < abs(overTop)) {
1336              position.top += myOffset + atOffset + offset;
1337            }
1338          } else if (overBottom > 0) {
1339            newOverTop =
1340              position.top -
1341              data.collisionPosition.marginTop +
1342              myOffset +
1343              atOffset +
1344              offset -
1345              offsetTop;
1346            if (newOverTop > 0 || abs(newOverTop) < overBottom) {
1347              position.top += myOffset + atOffset + offset;
1348            }
1349          }
1350        },
1351      },
1352      flipfit: {
1353        left: function () {
1354          $.ui.position.flip.left.apply(this, arguments);
1355          $.ui.position.fit.left.apply(this, arguments);
1356        },
1357        top: function () {
1358          $.ui.position.flip.top.apply(this, arguments);
1359          $.ui.position.fit.top.apply(this, arguments);
1360        },
1361      },
1362    };
1363  })();
vendor: 34,508 bytes, lines 1364-2547
1364
1365  var position = $.ui.position;
1366
1367  /*!
1368   * jQuery UI :data 1.13.2
1369   * http://jqueryui.com
1370   *
1371   * Copyright jQuery Foundation and other contributors
1372   * Released under the MIT license.
1373   * http://jquery.org/license
1374   */
1375
1376  //>>label: :data Selector
1377  //>>group: Core
1378  //>>description: Selects elements which have data stored under the specified key.
1379  //>>docs: http://api.jqueryui.com/data-selector/
1380
1381  var data = $.extend($.expr.pseudos, {
1382    data: $.expr.createPseudo
1383      ? $.expr.createPseudo(function (dataName) {
1384          return function (elem) {
1385            return !!$.data(elem, dataName);
1386          };
1387        })
1388      : // Support: jQuery <1.8
1389        function (elem, i, match) {
1390          return !!$.data(elem, match[3]);
1391        },
1392  });
1393
1394  /*!
1395   * jQuery UI Disable Selection 1.13.2
1396   * http://jqueryui.com
1397   *
1398   * Copyright jQuery Foundation and other contributors
1399   * Released under the MIT license.
1400   * http://jquery.org/license
1401   */
1402
1403  //>>label: disableSelection
1404  //>>group: Core
1405  //>>description: Disable selection of text content within the set of matched elements.
1406  //>>docs: http://api.jqueryui.com/disableSelection/
1407
1408  // This file is deprecated
1409
1410  var disableSelection = $.fn.extend({
1411    disableSelection: (function () {
1412      var eventType =
1413        "onselectstart" in document.createElement("div")
1414          ? "selectstart"
1415          : "mousedown";
1416
1417      return function () {
1418        return this.on(eventType + ".ui-disableSelection", function (event) {
1419          event.preventDefault();
1420        });
1421      };
1422    })(),
1423
1424    enableSelection: function () {
1425      return this.off(".ui-disableSelection");
1426    },
1427  });
1428
1429  // Create a local jQuery because jQuery Color relies on it and the
1430  // global may not exist with AMD and a custom build (#10199).
1431  // This module is a noop if used as a regular AMD module.
1432  // eslint-disable-next-line no-unused-vars
1433  var jQuery = $;
1434
1435  /*!
1436   * jQuery Color Animations v2.2.0
1437   * https://github.com/jquery/jquery-color
1438   *
1439   * Copyright OpenJS Foundation and other contributors
1440   * Released under the MIT license.
1441   * http://jquery.org/license
1442   *
1443   * Date: Sun May 10 09:02:36 2020 +0200
1444   */
1445
1446  var stepHooks =
1447      "backgroundColor borderBottomColor borderLeftColor borderRightColor " +
1448      "borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
1449    class2type = {},
1450    toString = class2type.toString,
1451    // plusequals test for += 100 -= 100
1452    rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
1453    // a set of RE's that can match strings and generate color tuples.
1454    stringParsers = [
1455      {
1456        re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
1457        parse: function (execResult) {
1458          return [execResult[1], execResult[2], execResult[3], execResult[4]];
1459        },
1460      },
1461      {
1462        re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
1463        parse: function (execResult) {
1464          return [
1465            execResult[1] * 2.55,
1466            execResult[2] * 2.55,
1467            execResult[3] * 2.55,
1468            execResult[4],
1469          ];
1470        },
1471      },
1472      {
1473        // this regex ignores A-F because it's compared against an already lowercased string
1474        re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,
1475        parse: function (execResult) {
1476          return [
1477            parseInt(execResult[1], 16),
1478            parseInt(execResult[2], 16),
1479            parseInt(execResult[3], 16),
1480            execResult[4] ? (parseInt(execResult[4], 16) / 255).toFixed(2) : 1,
1481          ];
1482        },
1483      },
1484      {
1485        // this regex ignores A-F because it's compared against an already lowercased string
1486        re: /#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,
1487        parse: function (execResult) {
1488          return [
1489            parseInt(execResult[1] + execResult[1], 16),
1490            parseInt(execResult[2] + execResult[2], 16),
1491            parseInt(execResult[3] + execResult[3], 16),
1492            execResult[4]
1493              ? (parseInt(execResult[4] + execResult[4], 16) / 255).toFixed(2)
1494              : 1,
1495          ];
1496        },
1497      },
1498      {
1499        re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
1500        space: "hsla",
1501        parse: function (execResult) {
1502          return [
1503            execResult[1],
1504            execResult[2] / 100,
1505            execResult[3] / 100,
1506            execResult[4],
1507          ];
1508        },
1509      },
1510    ],
1511    // jQuery.Color( )
1512    color = (jQuery.Color = function (color, green, blue, alpha) {
1513      return new jQuery.Color.fn.parse(color, green, blue, alpha);
1514    }),
1515    spaces = {
1516      rgba: {
1517        props: {
1518          red: {
1519            idx: 0,
1520            type: "byte",
1521          },
1522          green: {
1523            idx: 1,
1524            type: "byte",
1525          },
1526          blue: {
1527            idx: 2,
1528            type: "byte",
1529          },
1530        },
1531      },
1532
1533      hsla: {
1534        props: {
1535          hue: {
1536            idx: 0,
1537            type: "degrees",
1538          },
1539          saturation: {
1540            idx: 1,
1541            type: "percent",
1542          },
1543          lightness: {
1544            idx: 2,
1545            type: "percent",
1546          },
1547        },
1548      },
1549    },
1550    propTypes = {
1551      byte: {
1552        floor: true,
1553        max: 255,
1554      },
1555      percent: {
1556        max: 1,
1557      },
1558      degrees: {
1559        mod: 360,
1560        floor: true,
1561      },
1562    },
1563    support = (color.support = {}),
1564    // element for support tests
1565    supportElem = jQuery("<p>")[0],
1566    // colors = jQuery.Color.names
1567    colors,
1568    // local aliases of functions called often
1569    each = jQuery.each;
1570
1571  // determine rgba support immediately
1572  supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
1573  support.rgba = supportElem.style.backgroundColor.indexOf("rgba") > -1;
1574
1575  // define cache name and alpha properties
1576  // for rgba and hsla spaces
1577  each(spaces, function (spaceName, space) {
1578    space.cache = "_" + spaceName;
1579    space.props.alpha = {
1580      idx: 3,
1581      type: "percent",
1582      def: 1,
1583    };
1584  });
1585
1586  // Populate the class2type map
1587  jQuery.each(
1588    "Boolean Number String Function Array Date RegExp Object Error Symbol".split(
1589      " "
1590    ),
1591    function (_i, name) {
1592      class2type["[object " + name + "]"] = name.toLowerCase();
1593    }
1594  );
1595
1596  function getType(obj) {
1597    if (obj == null) {
1598      return obj + "";
1599    }
1600
1601    return typeof obj === "object"
1602      ? class2type[toString.call(obj)] || "object"
1603      : typeof obj;
1604  }
1605
1606  function clamp(value, prop, allowEmpty) {
1607    var type = propTypes[prop.type] || {};
1608
1609    if (value == null) {
1610      return allowEmpty || !prop.def ? null : prop.def;
1611    }
1612
1613    // ~~ is an short way of doing floor for positive numbers
1614    value = type.floor ? ~~value : parseFloat(value);
1615
1616    // IE will pass in empty strings as value for alpha,
1617    // which will hit this case
1618    if (isNaN(value)) {
1619      return prop.def;
1620    }
1621
1622    if (type.mod) {
1623      // we add mod before modding to make sure that negatives values
1624      // get converted properly: -10 -> 350
1625      return (value + type.mod) % type.mod;
1626    }
1627
1628    // for now all property types without mod have min and max
1629    return Math.min(type.max, Math.max(0, value));
1630  }
1631
1632  function stringParse(string) {
1633    var inst = color(),
1634      rgba = (inst._rgba = []);
1635
1636    string = string.toLowerCase();
1637
1638    each(stringParsers, function (_i, parser) {
1639      var parsed,
1640        match = parser.re.exec(string),
1641        values = match && parser.parse(match),
1642        spaceName = parser.space || "rgba";
1643
1644      if (values) {
1645        parsed = inst[spaceName](values);
1646
1647        // if this was an rgba parse the assignment might happen twice
1648        // oh well....
1649        inst[spaces[spaceName].cache] = parsed[spaces[spaceName].cache];
1650        rgba = inst._rgba = parsed._rgba;
1651
1652        // exit each( stringParsers ) here because we matched
1653        return false;
1654      }
1655    });
1656
1657    // Found a stringParser that handled it
1658    if (rgba.length) {
1659      // if this came from a parsed string, force "transparent" when alpha is 0
1660      // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
1661      if (rgba.join() === "0,0,0,0") {
1662        jQuery.extend(rgba, colors.transparent);
1663      }
1664      return inst;
1665    }
1666
1667    // named colors
1668    return colors[string];
1669  }
1670
1671  color.fn = jQuery.extend(color.prototype, {
1672    parse: function (red, green, blue, alpha) {
1673      if (red === undefined) {
1674        this._rgba = [null, null, null, null];
1675        return this;
1676      }
1677      if (red.jquery || red.nodeType) {
1678        red = jQuery(red).css(green);
1679        green = undefined;
1680      }
1681
1682      var inst = this,
1683        type = getType(red),
1684        rgba = (this._rgba = []);
1685
1686      // more than 1 argument specified - assume ( red, green, blue, alpha )
1687      if (green !== undefined) {
1688        red = [red, green, blue, alpha];
1689        type = "array";
1690      }
1691
1692      if (type === "string") {
1693        return this.parse(stringParse(red) || colors._default);
1694      }
1695
1696      if (type === "array") {
1697        each(spaces.rgba.props, function (_key, prop) {
1698          rgba[prop.idx] = clamp(red[prop.idx], prop);
1699        });
1700        return this;
1701      }
1702
1703      if (type === "object") {
1704        if (red instanceof color) {
1705          each(spaces, function (_spaceName, space) {
1706            if (red[space.cache]) {
1707              inst[space.cache] = red[space.cache].slice();
1708            }
1709          });
1710        } else {
1711          each(spaces, function (_spaceName, space) {
1712            var cache = space.cache;
1713            each(space.props, function (key, prop) {
1714              // if the cache doesn't exist, and we know how to convert
1715              if (!inst[cache] && space.to) {
1716                // if the value was null, we don't need to copy it
1717                // if the key was alpha, we don't need to copy it either
1718                if (key === "alpha" || red[key] == null) {
1719                  return;
1720                }
1721                inst[cache] = space.to(inst._rgba);
1722              }
1723
1724              // this is the only case where we allow nulls for ALL properties.
1725              // call clamp with alwaysAllowEmpty
1726              inst[cache][prop.idx] = clamp(red[key], prop, true);
1727            });
1728
1729            // everything defined but alpha?
1730            if (
1731              inst[cache] &&
1732              jQuery.inArray(null, inst[cache].slice(0, 3)) < 0
1733            ) {
1734              // use the default of 1
1735              if (inst[cache][3] == null) {
1736                inst[cache][3] = 1;
1737              }
1738
1739              if (space.from) {
1740                inst._rgba = space.from(inst[cache]);
1741              }
1742            }
1743          });
1744        }
1745        return this;
1746      }
1747    },
1748    is: function (compare) {
1749      var is = color(compare),
1750        same = true,
1751        inst = this;
1752
1753      each(spaces, function (_, space) {
1754        var localCache,
1755          isCache = is[space.cache];
1756        if (isCache) {
1757          localCache =
1758            inst[space.cache] || (space.to && space.to(inst._rgba)) || [];
1759          each(space.props, function (_, prop) {
1760            if (isCache[prop.idx] != null) {
1761              same = isCache[prop.idx] === localCache[prop.idx];
1762              return same;
1763            }
1764          });
1765        }
1766        return same;
1767      });
1768      return same;
1769    },
1770    _space: function () {
1771      var used = [],
1772        inst = this;
1773      each(spaces, function (spaceName, space) {
1774        if (inst[space.cache]) {
1775          used.push(spaceName);
1776        }
1777      });
1778      return used.pop();
1779    },
1780    transition: function (other, distance) {
1781      var end = color(other),
1782        spaceName = end._space(),
1783        space = spaces[spaceName],
1784        startColor = this.alpha() === 0 ? color("transparent") : this,
1785        start = startColor[space.cache] || space.to(startColor._rgba),
1786        result = start.slice();
1787
1788      end = end[space.cache];
1789      each(space.props, function (_key, prop) {
1790        var index = prop.idx,
1791          startValue = start[index],
1792          endValue = end[index],
1793          type = propTypes[prop.type] || {};
1794
1795        // if null, don't override start value
1796        if (endValue === null) {
1797          return;
1798        }
1799
1800        // if null - use end
1801        if (startValue === null) {
1802          result[index] = endValue;
1803        } else {
1804          if (type.mod) {
1805            if (endValue - startValue > type.mod / 2) {
1806              startValue += type.mod;
1807            } else if (startValue - endValue > type.mod / 2) {
1808              startValue -= type.mod;
1809            }
1810          }
1811          result[index] = clamp(
1812            (endValue - startValue) * distance + startValue,
1813            prop
1814          );
1815        }
1816      });
1817      return this[spaceName](result);
1818    },
1819    blend: function (opaque) {
1820      // if we are already opaque - return ourself
1821      if (this._rgba[3] === 1) {
1822        return this;
1823      }
1824
1825      var rgb = this._rgba.slice(),
1826        a = rgb.pop(),
1827        blend = color(opaque)._rgba;
1828
1829      return color(
1830        jQuery.map(rgb, function (v, i) {
1831          return (1 - a) * blend[i] + a * v;
1832        })
1833      );
1834    },
1835    toRgbaString: function () {
1836      var prefix = "rgba(",
1837        rgba = jQuery.map(this._rgba, function (v, i) {
1838          if (v != null) {
1839            return v;
1840          }
1841          return i > 2 ? 1 : 0;
1842        });
1843
1844      if (rgba[3] === 1) {
1845        rgba.pop();
1846        prefix = "rgb(";
1847      }
1848
1849      return prefix + rgba.join() + ")";
1850    },
1851    toHslaString: function () {
1852      var prefix = "hsla(",
1853        hsla = jQuery.map(this.hsla(), function (v, i) {
1854          if (v == null) {
1855            v = i > 2 ? 1 : 0;
1856          }
1857
1858          // catch 1 and 2
1859          if (i && i < 3) {
1860            v = Math.round(v * 100) + "%";
1861          }
1862          return v;
1863        });
1864
1865      if (hsla[3] === 1) {
1866        hsla.pop();
1867        prefix = "hsl(";
1868      }
1869      return prefix + hsla.join() + ")";
1870    },
1871    toHexString: function (includeAlpha) {
1872      var rgba = this._rgba.slice(),
1873        alpha = rgba.pop();
1874
1875      if (includeAlpha) {
1876        rgba.push(~~(alpha * 255));
1877      }
1878
1879      return (
1880        "#" +
1881        jQuery
1882          .map(rgba, function (v) {
1883            // default to 0 when nulls exist
1884            v = (v || 0).toString(16);
1885            return v.length === 1 ? "0" + v : v;
1886          })
1887          .join("")
1888      );
1889    },
1890    toString: function () {
1891      return this._rgba[3] === 0 ? "transparent" : this.toRgbaString();
1892    },
1893  });
1894  color.fn.parse.prototype = color.fn;
1895
1896  // hsla conversions adapted from:
1897  // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
1898
1899  function hue2rgb(p, q, h) {
1900    h = (h + 1) % 1;
1901    if (h * 6 < 1) {
1902      return p + (q - p) * h * 6;
1903    }
1904    if (h * 2 < 1) {
1905      return q;
1906    }
1907    if (h * 3 < 2) {
1908      return p + (q - p) * (2 / 3 - h) * 6;
1909    }
1910    return p;
1911  }
1912
1913  spaces.hsla.to = function (rgba) {
1914    if (rgba[0] == null || rgba[1] == null || rgba[2] == null) {
1915      return [null, null, null, rgba[3]];
1916    }
1917    var r = rgba[0] / 255,
1918      g = rgba[1] / 255,
1919      b = rgba[2] / 255,
1920      a = rgba[3],
1921      max = Math.max(r, g, b),
1922      min = Math.min(r, g, b),
1923      diff = max - min,
1924      add = max + min,
1925      l = add * 0.5,
1926      h,
1927      s;
1928
1929    if (min === max) {
1930      h = 0;
1931    } else if (r === max) {
1932      h = (60 * (g - b)) / diff + 360;
1933    } else if (g === max) {
1934      h = (60 * (b - r)) / diff + 120;
1935    } else {
1936      h = (60 * (r - g)) / diff + 240;
1937    }
1938
1939    // chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
1940    // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
1941    if (diff === 0) {
1942      s = 0;
1943    } else if (l <= 0.5) {
1944      s = diff / add;
1945    } else {
1946      s = diff / (2 - add);
1947    }
1948    return [Math.round(h) % 360, s, l, a == null ? 1 : a];
1949  };
1950
1951  spaces.hsla.from = function (hsla) {
1952    if (hsla[0] == null || hsla[1] == null || hsla[2] == null) {
1953      return [null, null, null, hsla[3]];
1954    }
1955    var h = hsla[0] / 360,
1956      s = hsla[1],
1957      l = hsla[2],
1958      a = hsla[3],
1959      q = l <= 0.5 ? l * (1 + s) : l + s - l * s,
1960      p = 2 * l - q;
1961
1962    return [
1963      Math.round(hue2rgb(p, q, h + 1 / 3) * 255),
1964      Math.round(hue2rgb(p, q, h) * 255),
1965      Math.round(hue2rgb(p, q, h - 1 / 3) * 255),
1966      a,
1967    ];
1968  };
1969
1970  each(spaces, function (spaceName, space) {
1971    var props = space.props,
1972      cache = space.cache,
1973      to = space.to,
1974      from = space.from;
1975
1976    // makes rgba() and hsla()
1977    color.fn[spaceName] = function (value) {
1978      // generate a cache for this space if it doesn't exist
1979      if (to && !this[cache]) {
1980        this[cache] = to(this._rgba);
1981      }
1982      if (value === undefined) {
1983        return this[cache].slice();
1984      }
1985
1986      var ret,
1987        type = getType(value),
1988        arr = type === "array" || type === "object" ? value : arguments,
1989        local = this[cache].slice();
1990
1991      each(props, function (key, prop) {
1992        var val = arr[type === "object" ? key : prop.idx];
1993        if (val == null) {
1994          val = local[prop.idx];
1995        }
1996        local[prop.idx] = clamp(val, prop);
1997      });
1998
1999      if (from) {
2000        ret = color(from(local));
2001        ret[cache] = local;
2002        return ret;
2003      } else {
2004        return color(local);
2005      }
2006    };
2007
2008    // makes red() green() blue() alpha() hue() saturation() lightness()
2009    each(props, function (key, prop) {
2010      // alpha is included in more than one space
2011      if (color.fn[key]) {
2012        return;
2013      }
2014      color.fn[key] = function (value) {
2015        var local,
2016          cur,
2017          match,
2018          fn,
2019          vtype = getType(value);
2020
2021        if (key === "alpha") {
2022          fn = this._hsla ? "hsla" : "rgba";
2023        } else {
2024          fn = spaceName;
2025        }
2026        local = this[fn]();
2027        cur = local[prop.idx];
2028
2029        if (vtype === "undefined") {
2030          return cur;
2031        }
2032
2033        if (vtype === "function") {
2034          value = value.call(this, cur);
2035          vtype = getType(value);
2036        }
2037        if (value == null && prop.empty) {
2038          return this;
2039        }
2040        if (vtype === "string") {
2041          match = rplusequals.exec(value);
2042          if (match) {
2043            value = cur + parseFloat(match[2]) * (match[1] === "+" ? 1 : -1);
2044          }
2045        }
2046        local[prop.idx] = value;
2047        return this[fn](local);
2048      };
2049    });
2050  });
2051
2052  // add cssHook and .fx.step function for each named hook.
2053  // accept a space separated string of properties
2054  color.hook = function (hook) {
2055    var hooks = hook.split(" ");
2056    each(hooks, function (_i, hook) {
2057      jQuery.cssHooks[hook] = {
2058        set: function (elem, value) {
2059          var parsed,
2060            curElem,
2061            backgroundColor = "";
2062
2063          if (
2064            value !== "transparent" &&
2065            (getType(value) !== "string" || (parsed = stringParse(value)))
2066          ) {
2067            value = color(parsed || value);
2068            if (!support.rgba && value._rgba[3] !== 1) {
2069              curElem = hook === "backgroundColor" ? elem.parentNode : elem;
2070              while (
2071                (backgroundColor === "" || backgroundColor === "transparent") &&
2072                curElem &&
2073                curElem.style
2074              ) {
2075                try {
2076                  backgroundColor = jQuery.css(curElem, "backgroundColor");
2077                  curElem = curElem.parentNode;
2078                } catch (e) {}
2079              }
2080
2081              value = value.blend(
2082                backgroundColor && backgroundColor !== "transparent"
2083                  ? backgroundColor
2084                  : "_default"
2085              );
2086            }
2087
2088            value = value.toRgbaString();
2089          }
2090          try {
2091            elem.style[hook] = value;
2092          } catch (e) {
2093            // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
2094          }
2095        },
2096      };
2097      jQuery.fx.step[hook] = function (fx) {
2098        if (!fx.colorInit) {
2099          fx.start = color(fx.elem, hook);
2100          fx.end = color(fx.end);
2101          fx.colorInit = true;
2102        }
2103        jQuery.cssHooks[hook].set(fx.elem, fx.start.transition(fx.end, fx.pos));
2104      };
2105    });
2106  };
2107
2108  color.hook(stepHooks);
2109
2110  jQuery.cssHooks.borderColor = {
2111    expand: function (value) {
2112      var expanded = {};
2113
2114      each(["Top", "Right", "Bottom", "Left"], function (_i, part) {
2115        expanded["border" + part + "Color"] = value;
2116      });
2117      return expanded;
2118    },
2119  };
2120
2121  // Basic color names only.
2122  // Usage of any of the other color names requires adding yourself or including
2123  // jquery.color.svg-names.js.
2124  colors = jQuery.Color.names = {
2125    // 4.1. Basic color keywords
2126    aqua: "#00ffff",
2127    black: "#000000",
2128    blue: "#0000ff",
2129    fuchsia: "#ff00ff",
2130    gray: "#808080",
2131    green: "#008000",
2132    lime: "#00ff00",
2133    maroon: "#800000",
2134    navy: "#000080",
2135    olive: "#808000",
2136    purple: "#800080",
2137    red: "#ff0000",
2138    silver: "#c0c0c0",
2139    teal: "#008080",
2140    white: "#ffffff",
2141    yellow: "#ffff00",
2142
2143    // 4.2.3. "transparent" color keyword
2144    transparent: [null, null, null, 0],
2145
2146    _default: "#ffffff",
2147  };
2148
2149  /*!
2150   * jQuery UI Effects 1.13.2
2151   * http://jqueryui.com
2152   *
2153   * Copyright jQuery Foundation and other contributors
2154   * Released under the MIT license.
2155   * http://jquery.org/license
2156   */
2157
2158  //>>label: Effects Core
2159  //>>group: Effects
2160  /* eslint-disable max-len */
2161  //>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.
2162  /* eslint-enable max-len */
2163  //>>docs: http://api.jqueryui.com/category/effects-core/
2164  //>>demos: http://jqueryui.com/effect/
2165
2166  var dataSpace = "ui-effects-",
2167    dataSpaceStyle = "ui-effects-style",
2168    dataSpaceAnimated = "ui-effects-animated";
2169
2170  $.effects = {
2171    effect: {},
2172  };
2173
2174  /******************************************************************************/
2175  /****************************** CLASS ANIMATIONS ******************************/
2176  /******************************************************************************/
2177  (function () {
2178    var classAnimationActions = ["add", "remove", "toggle"],
2179      shorthandStyles = {
2180        border: 1,
2181        borderBottom: 1,
2182        borderColor: 1,
2183        borderLeft: 1,
2184        borderRight: 1,
2185        borderTop: 1,
2186        borderWidth: 1,
2187        margin: 1,
2188        padding: 1,
2189      };
2190
2191    $.each(
2192      [
2193        "borderLeftStyle",
2194        "borderRightStyle",
2195        "borderBottomStyle",
2196        "borderTopStyle",
2197      ],
2198      function (_, prop) {
2199        $.fx.step[prop] = function (fx) {
2200          if (
2201            (fx.end !== "none" && !fx.setAttr) ||
2202            (fx.pos === 1 && !fx.setAttr)
2203          ) {
2204            jQuery.style(fx.elem, prop, fx.end);
2205            fx.setAttr = true;
2206          }
2207        };
2208      }
2209    );
2210
2211    function camelCase(string) {
2212      return string.replace(/-([\da-z])/gi, function (all, letter) {
2213        return letter.toUpperCase();
2214      });
2215    }
2216
2217    function getElementStyles(elem) {
2218      var key,
2219        len,
2220        style = elem.ownerDocument.defaultView
2221          ? elem.ownerDocument.defaultView.getComputedStyle(elem, null)
2222          : elem.currentStyle,
2223        styles = {};
2224
2225      if (style && style.length && style[0] && style[style[0]]) {
2226        len = style.length;
2227        while (len--) {
2228          key = style[len];
2229          if (typeof style[key] === "string") {
2230            styles[camelCase(key)] = style[key];
2231          }
2232        }
2233
2234        // Support: Opera, IE <9
2235      } else {
2236        for (key in style) {
2237          if (typeof style[key] === "string") {
2238            styles[key] = style[key];
2239          }
2240        }
2241      }
2242
2243      return styles;
2244    }
2245
2246    function styleDifference(oldStyle, newStyle) {
2247      var diff = {},
2248        name,
2249        value;
2250
2251      for (name in newStyle) {
2252        value = newStyle[name];
2253        if (oldStyle[name] !== value) {
2254          if (!shorthandStyles[name]) {
2255            if ($.fx.step[name] || !isNaN(parseFloat(value))) {
2256              diff[name] = value;
2257            }
2258          }
2259        }
2260      }
2261
2262      return diff;
2263    }
2264
2265    // Support: jQuery <1.8
2266    if (!$.fn.addBack) {
2267      $.fn.addBack = function (selector) {
2268        return this.add(
2269          selector == null ? this.prevObject : this.prevObject.filter(selector)
2270        );
2271      };
2272    }
2273
2274    $.effects.animateClass = function (value, duration, easing, callback) {
2275      var o = $.speed(duration, easing, callback);
2276
2277      return this.queue(function () {
2278        var animated = $(this),
2279          baseClass = animated.attr("class") || "",
2280          applyClassChange,
2281          allAnimations = o.children ? animated.find("*").addBack() : animated;
2282
2283        // Map the animated objects to store the original styles.
2284        allAnimations = allAnimations.map(function () {
2285          var el = $(this);
2286          return {
2287            el: el,
2288            start: getElementStyles(this),
2289          };
2290        });
2291
2292        // Apply class change
2293        applyClassChange = function () {
2294          $.each(classAnimationActions, function (i, action) {
2295            if (value[action]) {
2296              animated[action + "Class"](value[action]);
2297            }
2298          });
2299        };
2300        applyClassChange();
2301
2302        // Map all animated objects again - calculate new styles and diff
2303        allAnimations = allAnimations.map(function () {
2304          this.end = getElementStyles(this.el[0]);
2305          this.diff = styleDifference(this.start, this.end);
2306          return this;
2307        });
2308
2309        // Apply original class
2310        animated.attr("class", baseClass);
2311
2312        // Map all animated objects again - this time collecting a promise
2313        allAnimations = allAnimations.map(function () {
2314          var styleInfo = this,
2315            dfd = $.Deferred(),
2316            opts = $.extend({}, o, {
2317              queue: false,
2318              complete: function () {
2319                dfd.resolve(styleInfo);
2320              },
2321            });
2322
2323          this.el.animate(this.diff, opts);
2324          return dfd.promise();
2325        });
2326
2327        // Once all animations have completed:
2328        $.when.apply($, allAnimations.get()).done(function () {
2329          // Set the final class
2330          applyClassChange();
2331
2332          // For each animated element,
2333          // clear all css properties that were animated
2334          $.each(arguments, function () {
2335            var el = this.el;
2336            $.each(this.diff, function (key) {
2337              el.css(key, "");
2338            });
2339          });
2340
2341          // This is guarnteed to be there if you use jQuery.speed()
2342          // it also handles dequeuing the next anim...
2343          o.complete.call(animated[0]);
2344        });
2345      });
2346    };
2347
2348    $.fn.extend({
2349      addClass: (function (orig) {
2350        return function (classNames, speed, easing, callback) {
2351          return speed
2352            ? $.effects.animateClass.call(
2353                this,
2354                { add: classNames },
2355                speed,
2356                easing,
2357                callback
2358              )
2359            : orig.apply(this, arguments);
2360        };
2361      })($.fn.addClass),
2362
2363      removeClass: (function (orig) {
2364        return function (classNames, speed, easing, callback) {
2365          return arguments.length > 1
2366            ? $.effects.animateClass.call(
2367                this,
2368                { remove: classNames },
2369                speed,
2370                easing,
2371                callback
2372              )
2373            : orig.apply(this, arguments);
2374        };
2375      })($.fn.removeClass),
2376
2377      toggleClass: (function (orig) {
2378        return function (classNames, force, speed, easing, callback) {
2379          if (typeof force === "boolean" || force === undefined) {
2380            if (!speed) {
2381              // Without speed parameter
2382              return orig.apply(this, arguments);
2383            } else {
2384              return $.effects.animateClass.call(
2385                this,
2386                force ? { add: classNames } : { remove: classNames },
2387                speed,
2388                easing,
2389                callback
2390              );
2391            }
2392          } else {
2393            // Without force parameter
2394            return $.effects.animateClass.call(
2395              this,
2396              { toggle: classNames },
2397              force,
2398              speed,
2399              easing
2400            );
2401          }
2402        };
2403      })($.fn.toggleClass),
2404
2405      switchClass: function (remove, add, speed, easing, callback) {
2406        return $.effects.animateClass.call(
2407          this,
2408          {
2409            add: add,
2410            remove: remove,
2411          },
2412          speed,
2413          easing,
2414          callback
2415        );
2416      },
2417    });
2418  })();
2419
2420  /******************************************************************************/
2421  /*********************************** EFFECTS **********************************/
2422  /******************************************************************************/
2423
2424  (function () {
2425    if ($.expr && $.expr.pseudos && $.expr.pseudos.animated) {
2426      $.expr.pseudos.animated = (function (orig) {
2427        return function (elem) {
2428          return !!$(elem).data(dataSpaceAnimated) || orig(elem);
2429        };
2430      })($.expr.pseudos.animated);
2431    }
2432
2433    if ($.uiBackCompat !== false) {
2434      $.extend($.effects, {
2435        // Saves a set of properties in a data storage
2436        save: function (element, set) {
2437          var i = 0,
2438            length = set.length;
2439          for (; i < length; i++) {
2440            if (set[i] !== null) {
2441              element.data(dataSpace + set[i], element[0].style[set[i]]);
2442            }
2443          }
2444        },
2445
2446        // Restores a set of previously saved properties from a data storage
2447        restore: function (element, set) {
2448          var val,
2449            i = 0,
2450            length = set.length;
2451          for (; i < length; i++) {
2452            if (set[i] !== null) {
2453              val = element.data(dataSpace + set[i]);
2454              element.css(set[i], val);
2455            }
2456          }
2457        },
2458
2459        setMode: function (el, mode) {
2460          if (mode === "toggle") {
2461            mode = el.is(":hidden") ? "show" : "hide";
2462          }
2463          return mode;
2464        },
2465
2466        // Wraps the element around a wrapper that copies position properties
2467        createWrapper: function (element) {
2468          // If the element is already wrapped, return it
2469          if (element.parent().is(".ui-effects-wrapper")) {
2470            return element.parent();
2471          }
2472
2473          // Wrap the element
2474          var props = {
2475              width: element.outerWidth(true),
2476              height: element.outerHeight(true),
2477              float: element.css("float"),
2478            },
2479            wrapper = $("<div></div>").addClass("ui-effects-wrapper").css({
2480              fontSize: "100%",
2481              background: "transparent",
2482              border: "none",
2483              margin: 0,
2484              padding: 0,
2485            }),
2486            // Store the size in case width/height are defined in % - Fixes #5245
2487            size = {
2488              width: element.width(),
2489              height: element.height(),
2490            },
2491            active = document.activeElement;
2492
2493          // Support: Firefox
2494          // Firefox incorrectly exposes anonymous content
2495          // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
2496          try {
2497            // eslint-disable-next-line no-unused-expressions
2498            active.id;
2499          } catch (e) {
2500            active = document.body;
2501          }
2502
2503          element.wrap(wrapper);
2504
2505          // Fixes #7595 - Elements lose focus when wrapped.
2506          if (element[0] === active || $.contains(element[0], active)) {
2507            $(active).trigger("focus");
2508          }
2509
2510          // Hotfix for jQuery 1.4 since some change in wrap() seems to actually
2511          // lose the reference to the wrapped element
2512          wrapper = element.parent();
2513
2514          // Transfer positioning properties to the wrapper
2515          if (element.css("position") === "static") {
2516            wrapper.css({ position: "relative" });
2517            element.css({ position: "relative" });
2518          } else {
2519            $.extend(props, {
2520              position: element.css("position"),
2521              zIndex: element.css("z-index"),
2522            });
2523            $.each(["top", "left", "bottom", "right"], function (i, pos) {
2524              props[pos] = element.css(pos);
2525              if (isNaN(parseInt(props[pos], 10))) {
2526                props[pos] = "auto";
2527              }
2528            });
2529            element.css({
2530              position: "relative",
2531              top: 0,
2532              left: 0,
2533              right: "auto",
2534              bottom: "auto",
2535            });
2536          }
2537          element.css(size);
2538
2539          return wrapper.css(props).show();
2540        },
2541
2542        removeWrapper: function (element) {
2543          var active = document.activeElement;
2544
2545          if (element.parent().is(".ui-effects-wrapper")) {
2546            element.parent().replaceWith(element);
2547
vendor: 6,301 bytes, lines 2548-2759
2548            // Fixes #7595 - Elements lose focus when wrapped.
2549            if (element[0] === active || $.contains(element[0], active)) {
2550              $(active).trigger("focus");
2551            }
2552          }
2553
2554          return element;
2555        },
2556      });
2557    }
2558
2559    $.extend($.effects, {
2560      version: "1.13.2",
2561
2562      define: function (name, mode, effect) {
2563        if (!effect) {
2564          effect = mode;
2565          mode = "effect";
2566        }
2567
2568        $.effects.effect[name] = effect;
2569        $.effects.effect[name].mode = mode;
2570
2571        return effect;
2572      },
2573
2574      scaledDimensions: function (element, percent, direction) {
2575        if (percent === 0) {
2576          return {
2577            height: 0,
2578            width: 0,
2579            outerHeight: 0,
2580            outerWidth: 0,
2581          };
2582        }
2583
2584        var x = direction !== "horizontal" ? (percent || 100) / 100 : 1,
2585          y = direction !== "vertical" ? (percent || 100) / 100 : 1;
2586
2587        return {
2588          height: element.height() * y,
2589          width: element.width() * x,
2590          outerHeight: element.outerHeight() * y,
2591          outerWidth: element.outerWidth() * x,
2592        };
2593      },
2594
2595      clipToBox: function (animation) {
2596        return {
2597          width: animation.clip.right - animation.clip.left,
2598          height: animation.clip.bottom - animation.clip.top,
2599          left: animation.clip.left,
2600          top: animation.clip.top,
2601        };
2602      },
2603
2604      // Injects recently queued functions to be first in line (after "inprogress")
2605      unshift: function (element, queueLength, count) {
2606        var queue = element.queue();
2607
2608        if (queueLength > 1) {
2609          queue.splice.apply(
2610            queue,
2611            [1, 0].concat(queue.splice(queueLength, count))
2612          );
2613        }
2614        element.dequeue();
2615      },
2616
2617      saveStyle: function (element) {
2618        element.data(dataSpaceStyle, element[0].style.cssText);
2619      },
2620
2621      restoreStyle: function (element) {
2622        element[0].style.cssText = element.data(dataSpaceStyle) || "";
2623        element.removeData(dataSpaceStyle);
2624      },
2625
2626      mode: function (element, mode) {
2627        var hidden = element.is(":hidden");
2628
2629        if (mode === "toggle") {
2630          mode = hidden ? "show" : "hide";
2631        }
2632        if (hidden ? mode === "hide" : mode === "show") {
2633          mode = "none";
2634        }
2635        return mode;
2636      },
2637
2638      // Translates a [top,left] array into a baseline value
2639      getBaseline: function (origin, original) {
2640        var y, x;
2641
2642        switch (origin[0]) {
2643          case "top":
2644            y = 0;
2645            break;
2646          case "middle":
2647            y = 0.5;
2648            break;
2649          case "bottom":
2650            y = 1;
2651            break;
2652          default:
2653            y = origin[0] / original.height;
2654        }
2655
2656        switch (origin[1]) {
2657          case "left":
2658            x = 0;
2659            break;
2660          case "center":
2661            x = 0.5;
2662            break;
2663          case "right":
2664            x = 1;
2665            break;
2666          default:
2667            x = origin[1] / original.width;
2668        }
2669
2670        return {
2671          x: x,
2672          y: y,
2673        };
2674      },
2675
2676      // Creates a placeholder element so that the original element can be made absolute
2677      createPlaceholder: function (element) {
2678        var placeholder,
2679          cssPosition = element.css("position"),
2680          position = element.position();
2681
2682        // Lock in margins first to account for form elements, which
2683        // will change margin if you explicitly set height
2684        // see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
2685        // Support: Safari
2686        element
2687          .css({
2688            marginTop: element.css("marginTop"),
2689            marginBottom: element.css("marginBottom"),
2690            marginLeft: element.css("marginLeft"),
2691            marginRight: element.css("marginRight"),
2692          })
2693          .outerWidth(element.outerWidth())
2694          .outerHeight(element.outerHeight());
2695
2696        if (/^(static|relative)/.test(cssPosition)) {
2697          cssPosition = "absolute";
2698
2699          placeholder = $("<" + element[0].nodeName + ">")
2700            .insertAfter(element)
2701            .css({
2702              // Convert inline to inline block to account for inline elements
2703              // that turn to inline block based on content (like img)
2704              display: /^(inline|ruby)/.test(element.css("display"))
2705                ? "inline-block"
2706                : "block",
2707              visibility: "hidden",
2708
2709              // Margins need to be set to account for margin collapse
2710              marginTop: element.css("marginTop"),
2711              marginBottom: element.css("marginBottom"),
2712              marginLeft: element.css("marginLeft"),
2713              marginRight: element.css("marginRight"),
2714              float: element.css("float"),
2715            })
2716            .outerWidth(element.outerWidth())
2717            .outerHeight(element.outerHeight())
2718            .addClass("ui-effects-placeholder");
2719
2720          element.data(dataSpace + "placeholder", placeholder);
2721        }
2722
2723        element.css({
2724          position: cssPosition,
2725          left: position.left,
2726          top: position.top,
2727        });
2728
2729        return placeholder;
2730      },
2731
2732      removePlaceholder: function (element) {
2733        var dataKey = dataSpace + "placeholder",
2734          placeholder = element.data(dataKey);
2735
2736        if (placeholder) {
2737          placeholder.remove();
2738          element.removeData(dataKey);
2739        }
2740      },
2741
2742      // Removes a placeholder if it exists and restores
2743      // properties that were modified during placeholder creation
2744      cleanUp: function (element) {
2745        $.effects.restoreStyle(element);
2746        $.effects.removePlaceholder(element);
2747      },
2748
2749      setTransition: function (element, list, factor, value) {
2750        value = value || {};
2751        $.each(list, function (i, x) {
2752          var unit = element.cssUnit(x);
2753          if (unit[0] > 0) {
2754            value[x] = unit[0] * factor + unit[1];
2755          }
2756        });
2757        return value;
2758      },
2759    });
vendor: 8,061 bytes, lines 2760-3026
2760
2761    // Return an effect options object for the given parameters:
2762    function _normalizeArguments(effect, options, speed, callback) {
2763      // Allow passing all options as the first parameter
2764      if ($.isPlainObject(effect)) {
2765        options = effect;
2766        effect = effect.effect;
2767      }
2768
2769      // Convert to an object
2770      effect = { effect: effect };
2771
2772      // Catch (effect, null, ...)
2773      if (options == null) {
2774        options = {};
2775      }
2776
2777      // Catch (effect, callback)
2778      if (typeof options === "function") {
2779        callback = options;
2780        speed = null;
2781        options = {};
2782      }
2783
2784      // Catch (effect, speed, ?)
2785      if (typeof options === "number" || $.fx.speeds[options]) {
2786        callback = speed;
2787        speed = options;
2788        options = {};
2789      }
2790
2791      // Catch (effect, options, callback)
2792      if (typeof speed === "function") {
2793        callback = speed;
2794        speed = null;
2795      }
2796
2797      // Add options to effect
2798      if (options) {
2799        $.extend(effect, options);
2800      }
2801
2802      speed = speed || options.duration;
2803      effect.duration = $.fx.off
2804        ? 0
2805        : typeof speed === "number"
2806        ? speed
2807        : speed in $.fx.speeds
2808        ? $.fx.speeds[speed]
2809        : $.fx.speeds._default;
2810
2811      effect.complete = callback || options.complete;
2812
2813      return effect;
2814    }
2815
2816    function standardAnimationOption(option) {
2817      // Valid standard speeds (nothing, number, named speed)
2818      if (!option || typeof option === "number" || $.fx.speeds[option]) {
2819        return true;
2820      }
2821
2822      // Invalid strings - treat as "normal" speed
2823      if (typeof option === "string" && !$.effects.effect[option]) {
2824        return true;
2825      }
2826
2827      // Complete callback
2828      if (typeof option === "function") {
2829        return true;
2830      }
2831
2832      // Options hash (but not naming an effect)
2833      if (typeof option === "object" && !option.effect) {
2834        return true;
2835      }
2836
2837      // Didn't match any standard API
2838      return false;
2839    }
2840
2841    $.fn.extend({
2842      effect: function (/* effect, options, speed, callback */) {
2843        var args = _normalizeArguments.apply(this, arguments),
2844          effectMethod = $.effects.effect[args.effect],
2845          defaultMode = effectMethod.mode,
2846          queue = args.queue,
2847          queueName = queue || "fx",
2848          complete = args.complete,
2849          mode = args.mode,
2850          modes = [],
2851          prefilter = function (next) {
2852            var el = $(this),
2853              normalizedMode = $.effects.mode(el, mode) || defaultMode;
2854
2855            // Sentinel for duck-punching the :animated pseudo-selector
2856            el.data(dataSpaceAnimated, true);
2857
2858            // Save effect mode for later use,
2859            // we can't just call $.effects.mode again later,
2860            // as the .show() below destroys the initial state
2861            modes.push(normalizedMode);
2862
2863            // See $.uiBackCompat inside of run() for removal of defaultMode in 1.14
2864            if (
2865              defaultMode &&
2866              (normalizedMode === "show" ||
2867                (normalizedMode === defaultMode && normalizedMode === "hide"))
2868            ) {
2869              el.show();
2870            }
2871
2872            if (!defaultMode || normalizedMode !== "none") {
2873              $.effects.saveStyle(el);
2874            }
2875
2876            if (typeof next === "function") {
2877              next();
2878            }
2879          };
2880
2881        if ($.fx.off || !effectMethod) {
2882          // Delegate to the original method (e.g., .show()) if possible
2883          if (mode) {
2884            return this[mode](args.duration, complete);
2885          } else {
2886            return this.each(function () {
2887              if (complete) {
2888                complete.call(this);
2889              }
2890            });
2891          }
2892        }
2893
2894        function run(next) {
2895          var elem = $(this);
2896
2897          function cleanup() {
2898            elem.removeData(dataSpaceAnimated);
2899
2900            $.effects.cleanUp(elem);
2901
2902            if (args.mode === "hide") {
2903              elem.hide();
2904            }
2905
2906            done();
2907          }
2908
2909          function done() {
2910            if (typeof complete === "function") {
2911              complete.call(elem[0]);
2912            }
2913
2914            if (typeof next === "function") {
2915              next();
2916            }
2917          }
2918
2919          // Override mode option on a per element basis,
2920          // as toggle can be either show or hide depending on element state
2921          args.mode = modes.shift();
2922
2923          if ($.uiBackCompat !== false && !defaultMode) {
2924            if (elem.is(":hidden") ? mode === "hide" : mode === "show") {
2925              // Call the core method to track "olddisplay" properly
2926              elem[mode]();
2927              done();
2928            } else {
2929              effectMethod.call(elem[0], args, done);
2930            }
2931          } else {
2932            if (args.mode === "none") {
2933              // Call the core method to track "olddisplay" properly
2934              elem[mode]();
2935              done();
2936            } else {
2937              effectMethod.call(elem[0], args, cleanup);
2938            }
2939          }
2940        }
2941
2942        // Run prefilter on all elements first to ensure that
2943        // any showing or hiding happens before placeholder creation,
2944        // which ensures that any layout changes are correctly captured.
2945        return queue === false
2946          ? this.each(prefilter).each(run)
2947          : this.queue(queueName, prefilter).queue(queueName, run);
2948      },
2949
2950      show: (function (orig) {
2951        return function (option) {
2952          if (standardAnimationOption(option)) {
2953            return orig.apply(this, arguments);
2954          } else {
2955            var args = _normalizeArguments.apply(this, arguments);
2956            args.mode = "show";
2957            return this.effect.call(this, args);
2958          }
2959        };
2960      })($.fn.show),
2961
2962      hide: (function (orig) {
2963        return function (option) {
2964          if (standardAnimationOption(option)) {
2965            return orig.apply(this, arguments);
2966          } else {
2967            var args = _normalizeArguments.apply(this, arguments);
2968            args.mode = "hide";
2969            return this.effect.call(this, args);
2970          }
2971        };
2972      })($.fn.hide),
2973
2974      toggle: (function (orig) {
2975        return function (option) {
2976          if (standardAnimationOption(option) || typeof option === "boolean") {
2977            return orig.apply(this, arguments);
2978          } else {
2979            var args = _normalizeArguments.apply(this, arguments);
2980            args.mode = "toggle";
2981            return this.effect.call(this, args);
2982          }
2983        };
2984      })($.fn.toggle),
2985
2986      cssUnit: function (key) {
2987        var style = this.css(key),
2988          val = [];
2989
2990        $.each(["em", "px", "%", "pt"], function (i, unit) {
2991          if (style.indexOf(unit) > 0) {
2992            val = [parseFloat(style), unit];
2993          }
2994        });
2995        return val;
2996      },
2997
2998      cssClip: function (clipObj) {
2999        if (clipObj) {
3000          return this.css(
3001            "clip",
3002            "rect(" +
3003              clipObj.top +
3004              "px " +
3005              clipObj.right +
3006              "px " +
3007              clipObj.bottom +
3008              "px " +
3009              clipObj.left +
3010              "px)"
3011          );
3012        }
3013        return parseClip(this.css("clip"), this);
3014      },
3015
3016      transfer: function (options, done) {
3017        var element = $(this),
3018          target = $(options.to),
3019          targetFixed = target.css("position") === "fixed",
3020          body = $("body"),
3021          fixTop = targetFixed ? body.scrollTop() : 0,
3022          fixLeft = targetFixed ? body.scrollLeft() : 0,
3023          endPosition = target.offset(),
3024          animation = {
3025            top: endPosition.top - fixTop,
3026            left: endPosition.left - fixLeft,
vendor: 18,911 bytes, lines 3027-3670
3027            height: target.innerHeight(),
3028            width: target.innerWidth(),
3029          },
3030          startPosition = element.offset(),
3031          transfer = $("<div class='ui-effects-transfer'></div>");
3032
3033        transfer
3034          .appendTo("body")
3035          .addClass(options.className)
3036          .css({
3037            top: startPosition.top - fixTop,
3038            left: startPosition.left - fixLeft,
3039            height: element.innerHeight(),
3040            width: element.innerWidth(),
3041            position: targetFixed ? "fixed" : "absolute",
3042          })
3043          .animate(animation, options.duration, options.easing, function () {
3044            transfer.remove();
3045            if (typeof done === "function") {
3046              done();
3047            }
3048          });
3049      },
3050    });
3051
3052    function parseClip(str, element) {
3053      var outerWidth = element.outerWidth(),
3054        outerHeight = element.outerHeight(),
3055        clipRegex =
3056          /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
3057        values = clipRegex.exec(str) || ["", 0, outerWidth, outerHeight, 0];
3058
3059      return {
3060        top: parseFloat(values[1]) || 0,
3061        right: values[2] === "auto" ? outerWidth : parseFloat(values[2]),
3062        bottom: values[3] === "auto" ? outerHeight : parseFloat(values[3]),
3063        left: parseFloat(values[4]) || 0,
3064      };
3065    }
3066
3067    $.fx.step.clip = function (fx) {
3068      if (!fx.clipInit) {
3069        fx.start = $(fx.elem).cssClip();
3070        if (typeof fx.end === "string") {
3071          fx.end = parseClip(fx.end, fx.elem);
3072        }
3073        fx.clipInit = true;
3074      }
3075
3076      $(fx.elem).cssClip({
3077        top: fx.pos * (fx.end.top - fx.start.top) + fx.start.top,
3078        right: fx.pos * (fx.end.right - fx.start.right) + fx.start.right,
3079        bottom: fx.pos * (fx.end.bottom - fx.start.bottom) + fx.start.bottom,
3080        left: fx.pos * (fx.end.left - fx.start.left) + fx.start.left,
3081      });
3082    };
3083  })();
3084
3085  /******************************************************************************/
3086  /*********************************** EASING ***********************************/
3087  /******************************************************************************/
3088
3089  (function () {
3090    // Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
3091
3092    var baseEasings = {};
3093
3094    $.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function (i, name) {
3095      baseEasings[name] = function (p) {
3096        return Math.pow(p, i + 2);
3097      };
3098    });
3099
3100    $.extend(baseEasings, {
3101      Sine: function (p) {
3102        return 1 - Math.cos((p * Math.PI) / 2);
3103      },
3104      Circ: function (p) {
3105        return 1 - Math.sqrt(1 - p * p);
3106      },
3107      Elastic: function (p) {
3108        return p === 0 || p === 1
3109          ? p
3110          : -Math.pow(2, 8 * (p - 1)) *
3111              Math.sin((((p - 1) * 80 - 7.5) * Math.PI) / 15);
3112      },
3113      Back: function (p) {
3114        return p * p * (3 * p - 2);
3115      },
3116      Bounce: function (p) {
3117        var pow2,
3118          bounce = 4;
3119
3120        while (p < ((pow2 = Math.pow(2, --bounce)) - 1) / 11) {}
3121        return (
3122          1 / Math.pow(4, 3 - bounce) -
3123          7.5625 * Math.pow((pow2 * 3 - 2) / 22 - p, 2)
3124        );
3125      },
3126    });
3127
3128    $.each(baseEasings, function (name, easeIn) {
3129      $.easing["easeIn" + name] = easeIn;
3130      $.easing["easeOut" + name] = function (p) {
3131        return 1 - easeIn(1 - p);
3132      };
3133      $.easing["easeInOut" + name] = function (p) {
3134        return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn(p * -2 + 2) / 2;
3135      };
3136    });
3137  })();
3138
3139  var effect = $.effects;
3140
3141  /*!
3142   * jQuery UI Effects Blind 1.13.2
3143   * http://jqueryui.com
3144   *
3145   * Copyright jQuery Foundation and other contributors
3146   * Released under the MIT license.
3147   * http://jquery.org/license
3148   */
3149
3150  //>>label: Blind Effect
3151  //>>group: Effects
3152  //>>description: Blinds the element.
3153  //>>docs: http://api.jqueryui.com/blind-effect/
3154  //>>demos: http://jqueryui.com/effect/
3155
3156  var effectsEffectBlind = $.effects.define(
3157    "blind",
3158    "hide",
3159    function (options, done) {
3160      var map = {
3161          up: ["bottom", "top"],
3162          vertical: ["bottom", "top"],
3163          down: ["top", "bottom"],
3164          left: ["right", "left"],
3165          horizontal: ["right", "left"],
3166          right: ["left", "right"],
3167        },
3168        element = $(this),
3169        direction = options.direction || "up",
3170        start = element.cssClip(),
3171        animate = { clip: $.extend({}, start) },
3172        placeholder = $.effects.createPlaceholder(element);
3173
3174      animate.clip[map[direction][0]] = animate.clip[map[direction][1]];
3175
3176      if (options.mode === "show") {
3177        element.cssClip(animate.clip);
3178        if (placeholder) {
3179          placeholder.css($.effects.clipToBox(animate));
3180        }
3181
3182        animate.clip = start;
3183      }
3184
3185      if (placeholder) {
3186        placeholder.animate(
3187          $.effects.clipToBox(animate),
3188          options.duration,
3189          options.easing
3190        );
3191      }
3192
3193      element.animate(animate, {
3194        queue: false,
3195        duration: options.duration,
3196        easing: options.easing,
3197        complete: done,
3198      });
3199    }
3200  );
3201
3202  /*!
3203   * jQuery UI Effects Bounce 1.13.2
3204   * http://jqueryui.com
3205   *
3206   * Copyright jQuery Foundation and other contributors
3207   * Released under the MIT license.
3208   * http://jquery.org/license
3209   */
3210
3211  //>>label: Bounce Effect
3212  //>>group: Effects
3213  //>>description: Bounces an element horizontally or vertically n times.
3214  //>>docs: http://api.jqueryui.com/bounce-effect/
3215  //>>demos: http://jqueryui.com/effect/
3216
3217  var effectsEffectBounce = $.effects.define(
3218    "bounce",
3219    function (options, done) {
3220      var upAnim,
3221        downAnim,
3222        refValue,
3223        element = $(this),
3224        // Defaults:
3225        mode = options.mode,
3226        hide = mode === "hide",
3227        show = mode === "show",
3228        direction = options.direction || "up",
3229        distance = options.distance,
3230        times = options.times || 5,
3231        // Number of internal animations
3232        anims = times * 2 + (show || hide ? 1 : 0),
3233        speed = options.duration / anims,
3234        easing = options.easing,
3235        // Utility:
3236        ref = direction === "up" || direction === "down" ? "top" : "left",
3237        motion = direction === "up" || direction === "left",
3238        i = 0,
3239        queuelen = element.queue().length;
3240
3241      $.effects.createPlaceholder(element);
3242
3243      refValue = element.css(ref);
3244
3245      // Default distance for the BIGGEST bounce is the outer Distance / 3
3246      if (!distance) {
3247        distance = element[ref === "top" ? "outerHeight" : "outerWidth"]() / 3;
3248      }
3249
3250      if (show) {
3251        downAnim = { opacity: 1 };
3252        downAnim[ref] = refValue;
3253
3254        // If we are showing, force opacity 0 and set the initial position
3255        // then do the "first" animation
3256        element
3257          .css("opacity", 0)
3258          .css(ref, motion ? -distance * 2 : distance * 2)
3259          .animate(downAnim, speed, easing);
3260      }
3261
3262      // Start at the smallest distance if we are hiding
3263      if (hide) {
3264        distance = distance / Math.pow(2, times - 1);
3265      }
3266
3267      downAnim = {};
3268      downAnim[ref] = refValue;
3269
3270      // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
3271      for (; i < times; i++) {
3272        upAnim = {};
3273        upAnim[ref] = (motion ? "-=" : "+=") + distance;
3274
3275        element.animate(upAnim, speed, easing).animate(downAnim, speed, easing);
3276
3277        distance = hide ? distance * 2 : distance / 2;
3278      }
3279
3280      // Last Bounce when Hiding
3281      if (hide) {
3282        upAnim = { opacity: 0 };
3283        upAnim[ref] = (motion ? "-=" : "+=") + distance;
3284
3285        element.animate(upAnim, speed, easing);
3286      }
3287
3288      element.queue(done);
3289
3290      $.effects.unshift(element, queuelen, anims + 1);
3291    }
3292  );
3293
3294  /*!
3295   * jQuery UI Effects Clip 1.13.2
3296   * http://jqueryui.com
3297   *
3298   * Copyright jQuery Foundation and other contributors
3299   * Released under the MIT license.
3300   * http://jquery.org/license
3301   */
3302
3303  //>>label: Clip Effect
3304  //>>group: Effects
3305  //>>description: Clips the element on and off like an old TV.
3306  //>>docs: http://api.jqueryui.com/clip-effect/
3307  //>>demos: http://jqueryui.com/effect/
3308
3309  var effectsEffectClip = $.effects.define(
3310    "clip",
3311    "hide",
3312    function (options, done) {
3313      var start,
3314        animate = {},
3315        element = $(this),
3316        direction = options.direction || "vertical",
3317        both = direction === "both",
3318        horizontal = both || direction === "horizontal",
3319        vertical = both || direction === "vertical";
3320
3321      start = element.cssClip();
3322      animate.clip = {
3323        top: vertical ? (start.bottom - start.top) / 2 : start.top,
3324        right: horizontal ? (start.right - start.left) / 2 : start.right,
3325        bottom: vertical ? (start.bottom - start.top) / 2 : start.bottom,
3326        left: horizontal ? (start.right - start.left) / 2 : start.left,
3327      };
3328
3329      $.effects.createPlaceholder(element);
3330
3331      if (options.mode === "show") {
3332        element.cssClip(animate.clip);
3333        animate.clip = start;
3334      }
3335
3336      element.animate(animate, {
3337        queue: false,
3338        duration: options.duration,
3339        easing: options.easing,
3340        complete: done,
3341      });
3342    }
3343  );
3344
3345  /*!
3346   * jQuery UI Effects Drop 1.13.2
3347   * http://jqueryui.com
3348   *
3349   * Copyright jQuery Foundation and other contributors
3350   * Released under the MIT license.
3351   * http://jquery.org/license
3352   */
3353
3354  //>>label: Drop Effect
3355  //>>group: Effects
3356  //>>description: Moves an element in one direction and hides it at the same time.
3357  //>>docs: http://api.jqueryui.com/drop-effect/
3358  //>>demos: http://jqueryui.com/effect/
3359
3360  var effectsEffectDrop = $.effects.define(
3361    "drop",
3362    "hide",
3363    function (options, done) {
3364      var distance,
3365        element = $(this),
3366        mode = options.mode,
3367        show = mode === "show",
3368        direction = options.direction || "left",
3369        ref = direction === "up" || direction === "down" ? "top" : "left",
3370        motion = direction === "up" || direction === "left" ? "-=" : "+=",
3371        oppositeMotion = motion === "+=" ? "-=" : "+=",
3372        animation = {
3373          opacity: 0,
3374        };
3375
3376      $.effects.createPlaceholder(element);
3377
3378      distance =
3379        options.distance ||
3380        element[ref === "top" ? "outerHeight" : "outerWidth"](true) / 2;
3381
3382      animation[ref] = motion + distance;
3383
3384      if (show) {
3385        element.css(animation);
3386
3387        animation[ref] = oppositeMotion + distance;
3388        animation.opacity = 1;
3389      }
3390
3391      // Animate
3392      element.animate(animation, {
3393        queue: false,
3394        duration: options.duration,
3395        easing: options.easing,
3396        complete: done,
3397      });
3398    }
3399  );
3400
3401  /*!
3402   * jQuery UI Effects Explode 1.13.2
3403   * http://jqueryui.com
3404   *
3405   * Copyright jQuery Foundation and other contributors
3406   * Released under the MIT license.
3407   * http://jquery.org/license
3408   */
3409
3410  //>>label: Explode Effect
3411  //>>group: Effects
3412  /* eslint-disable max-len */
3413  //>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.
3414  /* eslint-enable max-len */
3415  //>>docs: http://api.jqueryui.com/explode-effect/
3416  //>>demos: http://jqueryui.com/effect/
3417
3418  var effectsEffectExplode = $.effects.define(
3419    "explode",
3420    "hide",
3421    function (options, done) {
3422      var i,
3423        j,
3424        left,
3425        top,
3426        mx,
3427        my,
3428        rows = options.pieces ? Math.round(Math.sqrt(options.pieces)) : 3,
3429        cells = rows,
3430        element = $(this),
3431        mode = options.mode,
3432        show = mode === "show",
3433        // Show and then visibility:hidden the element before calculating offset
3434        offset = element.show().css("visibility", "hidden").offset(),
3435        // Width and height of a piece
3436        width = Math.ceil(element.outerWidth() / cells),
3437        height = Math.ceil(element.outerHeight() / rows),
3438        pieces = [];
3439
3440      // Children animate complete:
3441      function childComplete() {
3442        pieces.push(this);
3443        if (pieces.length === rows * cells) {
3444          animComplete();
3445        }
3446      }
3447
3448      // Clone the element for each row and cell.
3449      for (i = 0; i < rows; i++) {
3450        // ===>
3451        top = offset.top + i * height;
3452        my = i - (rows - 1) / 2;
3453
3454        for (j = 0; j < cells; j++) {
3455          // |||
3456          left = offset.left + j * width;
3457          mx = j - (cells - 1) / 2;
3458
3459          // Create a clone of the now hidden main element that will be absolute positioned
3460          // within a wrapper div off the -left and -top equal to size of our pieces
3461          element
3462            .clone()
3463            .appendTo("body")
3464            .wrap("<div></div>")
3465            .css({
3466              position: "absolute",
3467              visibility: "visible",
3468              left: -j * width,
3469              top: -i * height,
3470            })
3471
3472            // Select the wrapper - make it overflow: hidden and absolute positioned based on
3473            // where the original was located +left and +top equal to the size of pieces
3474            .parent()
3475            .addClass("ui-effects-explode")
3476            .css({
3477              position: "absolute",
3478              overflow: "hidden",
3479              width: width,
3480              height: height,
3481              left: left + (show ? mx * width : 0),
3482              top: top + (show ? my * height : 0),
3483              opacity: show ? 0 : 1,
3484            })
3485            .animate(
3486              {
3487                left: left + (show ? 0 : mx * width),
3488                top: top + (show ? 0 : my * height),
3489                opacity: show ? 1 : 0,
3490              },
3491              options.duration || 500,
3492              options.easing,
3493              childComplete
3494            );
3495        }
3496      }
3497
3498      function animComplete() {
3499        element.css({
3500          visibility: "visible",
3501        });
3502        $(pieces).remove();
3503        done();
3504      }
3505    }
3506  );
3507
3508  /*!
3509   * jQuery UI Effects Fade 1.13.2
3510   * http://jqueryui.com
3511   *
3512   * Copyright jQuery Foundation and other contributors
3513   * Released under the MIT license.
3514   * http://jquery.org/license
3515   */
3516
3517  //>>label: Fade Effect
3518  //>>group: Effects
3519  //>>description: Fades the element.
3520  //>>docs: http://api.jqueryui.com/fade-effect/
3521  //>>demos: http://jqueryui.com/effect/
3522
3523  var effectsEffectFade = $.effects.define(
3524    "fade",
3525    "toggle",
3526    function (options, done) {
3527      var show = options.mode === "show";
3528
3529      $(this)
3530        .css("opacity", show ? 0 : 1)
3531        .animate(
3532          {
3533            opacity: show ? 1 : 0,
3534          },
3535          {
3536            queue: false,
3537            duration: options.duration,
3538            easing: options.easing,
3539            complete: done,
3540          }
3541        );
3542    }
3543  );
3544
3545  /*!
3546   * jQuery UI Effects Fold 1.13.2
3547   * http://jqueryui.com
3548   *
3549   * Copyright jQuery Foundation and other contributors
3550   * Released under the MIT license.
3551   * http://jquery.org/license
3552   */
3553
3554  //>>label: Fold Effect
3555  //>>group: Effects
3556  //>>description: Folds an element first horizontally and then vertically.
3557  //>>docs: http://api.jqueryui.com/fold-effect/
3558  //>>demos: http://jqueryui.com/effect/
3559
3560  var effectsEffectFold = $.effects.define(
3561    "fold",
3562    "hide",
3563    function (options, done) {
3564      // Create element
3565      var element = $(this),
3566        mode = options.mode,
3567        show = mode === "show",
3568        hide = mode === "hide",
3569        size = options.size || 15,
3570        percent = /([0-9]+)%/.exec(size),
3571        horizFirst = !!options.horizFirst,
3572        ref = horizFirst ? ["right", "bottom"] : ["bottom", "right"],
3573        duration = options.duration / 2,
3574        placeholder = $.effects.createPlaceholder(element),
3575        start = element.cssClip(),
3576        animation1 = { clip: $.extend({}, start) },
3577        animation2 = { clip: $.extend({}, start) },
3578        distance = [start[ref[0]], start[ref[1]]],
3579        queuelen = element.queue().length;
3580
3581      if (percent) {
3582        size = (parseInt(percent[1], 10) / 100) * distance[hide ? 0 : 1];
3583      }
3584      animation1.clip[ref[0]] = size;
3585      animation2.clip[ref[0]] = size;
3586      animation2.clip[ref[1]] = 0;
3587
3588      if (show) {
3589        element.cssClip(animation2.clip);
3590        if (placeholder) {
3591          placeholder.css($.effects.clipToBox(animation2));
3592        }
3593
3594        animation2.clip = start;
3595      }
3596
3597      // Animate
3598      element
3599        .queue(function (next) {
3600          if (placeholder) {
3601            placeholder
3602              .animate(
3603                $.effects.clipToBox(animation1),
3604                duration,
3605                options.easing
3606              )
3607              .animate(
3608                $.effects.clipToBox(animation2),
3609                duration,
3610                options.easing
3611              );
3612          }
3613
3614          next();
3615        })
3616        .animate(animation1, duration, options.easing)
3617        .animate(animation2, duration, options.easing)
3618        .queue(done);
3619
3620      $.effects.unshift(element, queuelen, 4);
3621    }
3622  );
3623
3624  /*!
3625   * jQuery UI Effects Highlight 1.13.2
3626   * http://jqueryui.com
3627   *
3628   * Copyright jQuery Foundation and other contributors
3629   * Released under the MIT license.
3630   * http://jquery.org/license
3631   */
3632
3633  //>>label: Highlight Effect
3634  //>>group: Effects
3635  //>>description: Highlights the background of an element in a defined color for a custom duration.
3636  //>>docs: http://api.jqueryui.com/highlight-effect/
3637  //>>demos: http://jqueryui.com/effect/
3638
3639  var effectsEffectHighlight = $.effects.define(
3640    "highlight",
3641    "show",
3642    function (options, done) {
3643      var element = $(this),
3644        animation = {
3645          backgroundColor: element.css("backgroundColor"),
3646        };
3647
3648      if (options.mode === "hide") {
3649        animation.opacity = 0;
3650      }
3651
3652      $.effects.saveStyle(element);
3653
3654      element
3655        .css({
3656          backgroundImage: "none",
3657          backgroundColor: options.color || "#ffff99",
3658        })
3659        .animate(animation, {
3660          queue: false,
3661          duration: options.duration,
3662          easing: options.easing,
3663          complete: done,
3664        });
3665    }
3666  );
3667
3668  /*!
3669   * jQuery UI Effects Size 1.13.2
3670   * http://jqueryui.com
3671   *
3672   * Copyright jQuery Foundation and other contributors
3673   * Released under the MIT license.
3674   * http://jquery.org/license
3675   */
3676
3677  //>>label: Size Effect
3678  //>>group: Effects
3679  //>>description: Resize an element to a specified width and height.
3680  //>>docs: http://api.jqueryui.com/size-effect/
3681  //>>demos: http://jqueryui.com/effect/
3682
3683  var effectsEffectSize = $.effects.define("size", function (options, done) {
3684    // Create element
3685    var baseline,
3686      factor,
3687      temp,
3688      element = $(this),
3689      // Copy for children
3690      cProps = ["fontSize"],
3691      vProps = [
3692        "borderTopWidth",
3693        "borderBottomWidth",
3694        "paddingTop",
3695        "paddingBottom",
3696      ],
3697      hProps = [
3698        "borderLeftWidth",
3699        "borderRightWidth",
3700        "paddingLeft",
3701        "paddingRight",
3702      ],
3703      // Set options
3704      mode = options.mode,
3705      restore = mode !== "effect",
3706      scale = options.scale || "both",
3707      origin = options.origin || ["middle", "center"],
3708      position = element.css("position"),
3709      pos = element.position(),
3710      original = $.effects.scaledDimensions(element),
3711      from = options.from || original,
3712      to = options.to || $.effects.scaledDimensions(element, 0);
3713
3714    $.effects.createPlaceholder(element);
3715
3716    if (mode === "show") {
3717      temp = from;
3718      from = to;
3719      to = temp;
3720    }
3721
3722    // Set scaling factor
3723    factor = {
3724      from: {
3725        y: from.height / original.height,
3726        x: from.width / original.width,
3727      },
3728      to: {
3729        y: to.height / original.height,
3730        x: to.width / original.width,
3731      },
3732    };
3733
3734    // Scale the css box
3735    if (scale === "box" || scale === "both") {
3736      // Vertical props scaling
3737      if (factor.from.y !== factor.to.y) {
3738        from = $.effects.setTransition(element, vProps, factor.from.y, from);
3739        to = $.effects.setTransition(element, vProps, factor.to.y, to);
3740      }
3741
3742      // Horizontal props scaling
3743      if (factor.from.x !== factor.to.x) {
3744        from = $.effects.setTransition(element, hProps, factor.from.x, from);
3745        to = $.effects.setTransition(element, hProps, factor.to.x, to);
3746      }
3747    }
3748
3749    // Scale the content
3750    if (scale === "content" || scale === "both") {
3751      // Vertical props scaling
3752      if (factor.from.y !== factor.to.y) {
3753        from = $.effects.setTransition(element, cProps, factor.from.y, from);
3754        to = $.effects.setTransition(element, cProps, factor.to.y, to);
3755      }
3756    }
3757
3758    // Adjust the position properties based on the provided origin points
3759    if (origin) {
3760      baseline = $.effects.getBaseline(origin, original);
3761      from.top =
3762        (original.outerHeight - from.outerHeight) * baseline.y + pos.top;
3763      from.left =
3764        (original.outerWidth - from.outerWidth) * baseline.x + pos.left;
3765      to.top = (original.outerHeight - to.outerHeight) * baseline.y + pos.top;
3766      to.left = (original.outerWidth - to.outerWidth) * baseline.x + pos.left;
3767    }
3768    delete from.outerHeight;
3769    delete from.outerWidth;
3770    element.css(from);
3771
3772    // Animate the children if desired
3773    if (scale === "content" || scale === "both") {
3774      vProps = vProps.concat(["marginTop", "marginBottom"]).concat(cProps);
3775      hProps = hProps.concat(["marginLeft", "marginRight"]);
3776
3777      // Only animate children with width attributes specified
3778      // TODO: is this right? should we include anything with css width specified as well
3779      element.find("*[width]").each(function () {
3780        var child = $(this),
3781          childOriginal = $.effects.scaledDimensions(child),
3782          childFrom = {
3783            height: childOriginal.height * factor.from.y,
3784            width: childOriginal.width * factor.from.x,
3785            outerHeight: childOriginal.outerHeight * factor.from.y,
3786            outerWidth: childOriginal.outerWidth * factor.from.x,
3787          },
3788          childTo = {
3789            height: childOriginal.height * factor.to.y,
3790            width: childOriginal.width * factor.to.x,
3791            outerHeight: childOriginal.height * factor.to.y,
3792            outerWidth: childOriginal.width * factor.to.x,
3793          };
3794
3795        // Vertical props scaling
3796        if (factor.from.y !== factor.to.y) {
3797          childFrom = $.effects.setTransition(
3798            child,
3799            vProps,
3800            factor.from.y,
3801            childFrom
3802          );
3803          childTo = $.effects.setTransition(
3804            child,
3805            vProps,
3806            factor.to.y,
3807            childTo
3808          );
3809        }
3810
3811        // Horizontal props scaling
3812        if (factor.from.x !== factor.to.x) {
3813          childFrom = $.effects.setTransition(
3814            child,
3815            hProps,
3816            factor.from.x,
3817            childFrom
3818          );
3819          childTo = $.effects.setTransition(
3820            child,
3821            hProps,
3822            factor.to.x,
3823            childTo
3824          );
3825        }
3826
3827        if (restore) {
3828          $.effects.saveStyle(child);
3829        }
3830
3831        // Animate children
3832        child.css(childFrom);
vendor: 4,514 bytes, lines 3833-3994
3833        child.animate(childTo, options.duration, options.easing, function () {
3834          // Restore children
3835          if (restore) {
3836            $.effects.restoreStyle(child);
3837          }
3838        });
3839      });
3840    }
3841
3842    // Animate
3843    element.animate(to, {
3844      queue: false,
3845      duration: options.duration,
3846      easing: options.easing,
3847      complete: function () {
3848        var offset = element.offset();
3849
3850        if (to.opacity === 0) {
3851          element.css("opacity", from.opacity);
3852        }
3853
3854        if (!restore) {
3855          element
3856            .css("position", position === "static" ? "relative" : position)
3857            .offset(offset);
3858
3859          // Need to save style here so that automatic style restoration
3860          // doesn't restore to the original styles from before the animation.
3861          $.effects.saveStyle(element);
3862        }
3863
3864        done();
3865      },
3866    });
3867  });
3868
3869  /*!
3870   * jQuery UI Effects Scale 1.13.2
3871   * http://jqueryui.com
3872   *
3873   * Copyright jQuery Foundation and other contributors
3874   * Released under the MIT license.
3875   * http://jquery.org/license
3876   */
3877
3878  //>>label: Scale Effect
3879  //>>group: Effects
3880  //>>description: Grows or shrinks an element and its content.
3881  //>>docs: http://api.jqueryui.com/scale-effect/
3882  //>>demos: http://jqueryui.com/effect/
3883
3884  var effectsEffectScale = $.effects.define("scale", function (options, done) {
3885    // Create element
3886    var el = $(this),
3887      mode = options.mode,
3888      percent =
3889        parseInt(options.percent, 10) ||
3890        (parseInt(options.percent, 10) === 0 ? 0 : mode !== "effect" ? 0 : 100),
3891      newOptions = $.extend(
3892        true,
3893        {
3894          from: $.effects.scaledDimensions(el),
3895          to: $.effects.scaledDimensions(
3896            el,
3897            percent,
3898            options.direction || "both"
3899          ),
3900          origin: options.origin || ["middle", "center"],
3901        },
3902        options
3903      );
3904
3905    // Fade option to support puff
3906    if (options.fade) {
3907      newOptions.from.opacity = 1;
3908      newOptions.to.opacity = 0;
3909    }
3910
3911    $.effects.effect.size.call(this, newOptions, done);
3912  });
3913
3914  /*!
3915   * jQuery UI Effects Puff 1.13.2
3916   * http://jqueryui.com
3917   *
3918   * Copyright jQuery Foundation and other contributors
3919   * Released under the MIT license.
3920   * http://jquery.org/license
3921   */
3922
3923  //>>label: Puff Effect
3924  //>>group: Effects
3925  //>>description: Creates a puff effect by scaling the element up and hiding it at the same time.
3926  //>>docs: http://api.jqueryui.com/puff-effect/
3927  //>>demos: http://jqueryui.com/effect/
3928
3929  var effectsEffectPuff = $.effects.define(
3930    "puff",
3931    "hide",
3932    function (options, done) {
3933      var newOptions = $.extend(true, {}, options, {
3934        fade: true,
3935        percent: parseInt(options.percent, 10) || 150,
3936      });
3937
3938      $.effects.effect.scale.call(this, newOptions, done);
3939    }
3940  );
3941
3942  /*!
3943   * jQuery UI Effects Pulsate 1.13.2
3944   * http://jqueryui.com
3945   *
3946   * Copyright jQuery Foundation and other contributors
3947   * Released under the MIT license.
3948   * http://jquery.org/license
3949   */
3950
3951  //>>label: Pulsate Effect
3952  //>>group: Effects
3953  //>>description: Pulsates an element n times by changing the opacity to zero and back.
3954  //>>docs: http://api.jqueryui.com/pulsate-effect/
3955  //>>demos: http://jqueryui.com/effect/
3956
3957  var effectsEffectPulsate = $.effects.define(
3958    "pulsate",
3959    "show",
3960    function (options, done) {
3961      var element = $(this),
3962        mode = options.mode,
3963        show = mode === "show",
3964        hide = mode === "hide",
3965        showhide = show || hide,
3966        // Showing or hiding leaves off the "last" animation
3967        anims = (options.times || 5) * 2 + (showhide ? 1 : 0),
3968        duration = options.duration / anims,
3969        animateTo = 0,
3970        i = 1,
3971        queuelen = element.queue().length;
3972
3973      if (show || !element.is(":visible")) {
3974        element.css("opacity", 0).show();
3975        animateTo = 1;
3976      }
3977
3978      // Anims - 1 opacity "toggles"
3979      for (; i < anims; i++) {
3980        element.animate({ opacity: animateTo }, duration, options.easing);
3981        animateTo = 1 - animateTo;
3982      }
3983
3984      element.animate({ opacity: animateTo }, duration, options.easing);
3985
3986      element.queue(done);
3987
3988      $.effects.unshift(element, queuelen, anims + 1);
3989    }
3990  );
3991
3992  /*!
3993   * jQuery UI Effects Shake 1.13.2
3994   * http://jqueryui.com
vendor: 9,016 bytes, lines 3995-4292
3995   *
3996   * Copyright jQuery Foundation and other contributors
3997   * Released under the MIT license.
3998   * http://jquery.org/license
3999   */
4000
4001  //>>label: Shake Effect
4002  //>>group: Effects
4003  //>>description: Shakes an element horizontally or vertically n times.
4004  //>>docs: http://api.jqueryui.com/shake-effect/
4005  //>>demos: http://jqueryui.com/effect/
4006
4007  var effectsEffectShake = $.effects.define("shake", function (options, done) {
4008    var i = 1,
4009      element = $(this),
4010      direction = options.direction || "left",
4011      distance = options.distance || 20,
4012      times = options.times || 3,
4013      anims = times * 2 + 1,
4014      speed = Math.round(options.duration / anims),
4015      ref = direction === "up" || direction === "down" ? "top" : "left",
4016      positiveMotion = direction === "up" || direction === "left",
4017      animation = {},
4018      animation1 = {},
4019      animation2 = {},
4020      queuelen = element.queue().length;
4021
4022    $.effects.createPlaceholder(element);
4023
4024    // Animation
4025    animation[ref] = (positiveMotion ? "-=" : "+=") + distance;
4026    animation1[ref] = (positiveMotion ? "+=" : "-=") + distance * 2;
4027    animation2[ref] = (positiveMotion ? "-=" : "+=") + distance * 2;
4028
4029    // Animate
4030    element.animate(animation, speed, options.easing);
4031
4032    // Shakes
4033    for (; i < times; i++) {
4034      element
4035        .animate(animation1, speed, options.easing)
4036        .animate(animation2, speed, options.easing);
4037    }
4038
4039    element
4040      .animate(animation1, speed, options.easing)
4041      .animate(animation, speed / 2, options.easing)
4042      .queue(done);
4043
4044    $.effects.unshift(element, queuelen, anims + 1);
4045  });
4046
4047  /*!
4048   * jQuery UI Effects Slide 1.13.2
4049   * http://jqueryui.com
4050   *
4051   * Copyright jQuery Foundation and other contributors
4052   * Released under the MIT license.
4053   * http://jquery.org/license
4054   */
4055
4056  //>>label: Slide Effect
4057  //>>group: Effects
4058  //>>description: Slides an element in and out of the viewport.
4059  //>>docs: http://api.jqueryui.com/slide-effect/
4060  //>>demos: http://jqueryui.com/effect/
4061
4062  var effectsEffectSlide = $.effects.define(
4063    "slide",
4064    "show",
4065    function (options, done) {
4066      var startClip,
4067        startRef,
4068        element = $(this),
4069        map = {
4070          up: ["bottom", "top"],
4071          down: ["top", "bottom"],
4072          left: ["right", "left"],
4073          right: ["left", "right"],
4074        },
4075        mode = options.mode,
4076        direction = options.direction || "left",
4077        ref = direction === "up" || direction === "down" ? "top" : "left",
4078        positiveMotion = direction === "up" || direction === "left",
4079        distance =
4080          options.distance ||
4081          element[ref === "top" ? "outerHeight" : "outerWidth"](true),
4082        animation = {};
4083
4084      $.effects.createPlaceholder(element);
4085
4086      startClip = element.cssClip();
4087      startRef = element.position()[ref];
4088
4089      // Define hide animation
4090      animation[ref] = (positiveMotion ? -1 : 1) * distance + startRef;
4091      animation.clip = element.cssClip();
4092      animation.clip[map[direction][1]] = animation.clip[map[direction][0]];
4093
4094      // Reverse the animation if we're showing
4095      if (mode === "show") {
4096        element.cssClip(animation.clip);
4097        element.css(ref, animation[ref]);
4098        animation.clip = startClip;
4099        animation[ref] = startRef;
4100      }
4101
4102      // Actually animate
4103      element.animate(animation, {
4104        queue: false,
4105        duration: options.duration,
4106        easing: options.easing,
4107        complete: done,
4108      });
4109    }
4110  );
4111
4112  /*!
4113   * jQuery UI Effects Transfer 1.13.2
4114   * http://jqueryui.com
4115   *
4116   * Copyright jQuery Foundation and other contributors
4117   * Released under the MIT license.
4118   * http://jquery.org/license
4119   */
4120
4121  //>>label: Transfer Effect
4122  //>>group: Effects
4123  //>>description: Displays a transfer effect from one element to another.
4124  //>>docs: http://api.jqueryui.com/transfer-effect/
4125  //>>demos: http://jqueryui.com/effect/
4126
4127  var effect;
4128  if ($.uiBackCompat !== false) {
4129    effect = $.effects.define("transfer", function (options, done) {
4130      $(this).transfer(options, done);
4131    });
4132  }
4133  var effectsEffectTransfer = effect;
4134
4135  /*!
4136   * jQuery UI Focusable 1.13.2
4137   * http://jqueryui.com
4138   *
4139   * Copyright jQuery Foundation and other contributors
4140   * Released under the MIT license.
4141   * http://jquery.org/license
4142   */
4143
4144  //>>label: :focusable Selector
4145  //>>group: Core
4146  //>>description: Selects elements which can be focused.
4147  //>>docs: http://api.jqueryui.com/focusable-selector/
4148
4149  // Selectors
4150  $.ui.focusable = function (element, hasTabindex) {
4151    var map,
4152      mapName,
4153      img,
4154      focusableIfVisible,
4155      fieldset,
4156      nodeName = element.nodeName.toLowerCase();
4157
4158    if ("area" === nodeName) {
4159      map = element.parentNode;
4160      mapName = map.name;
4161      if (!element.href || !mapName || map.nodeName.toLowerCase() !== "map") {
4162        return false;
4163      }
4164      img = $("img[usemap='#" + mapName + "']");
4165      return img.length > 0 && img.is(":visible");
4166    }
4167
4168    if (/^(input|select|textarea|button|object)$/.test(nodeName)) {
4169      focusableIfVisible = !element.disabled;
4170
4171      if (focusableIfVisible) {
4172        // Form controls within a disabled fieldset are disabled.
4173        // However, controls within the fieldset's legend do not get disabled.
4174        // Since controls generally aren't placed inside legends, we skip
4175        // this portion of the check.
4176        fieldset = $(element).closest("fieldset")[0];
4177        if (fieldset) {
4178          focusableIfVisible = !fieldset.disabled;
4179        }
4180      }
4181    } else if ("a" === nodeName) {
4182      focusableIfVisible = element.href || hasTabindex;
4183    } else {
4184      focusableIfVisible = hasTabindex;
4185    }
4186
4187    return (
4188      focusableIfVisible && $(element).is(":visible") && visible($(element))
4189    );
4190  };
4191
4192  // Support: IE 8 only
4193  // IE 8 doesn't resolve inherit to visible/hidden for computed values
4194  function visible(element) {
4195    var visibility = element.css("visibility");
4196    while (visibility === "inherit") {
4197      element = element.parent();
4198      visibility = element.css("visibility");
4199    }
4200    return visibility === "visible";
4201  }
4202
4203  $.extend($.expr.pseudos, {
4204    focusable: function (element) {
4205      return $.ui.focusable(element, $.attr(element, "tabindex") != null);
4206    },
4207  });
4208
4209  var focusable = $.ui.focusable;
4210
4211  // Support: IE8 Only
4212  // IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
4213  // with a string, so we need to find the proper form.
4214  var form = ($.fn._form = function () {
4215    return typeof this[0].form === "string"
4216      ? this.closest("form")
4217      : $(this[0].form);
4218  });
4219
4220  /*!
4221   * jQuery UI Form Reset Mixin 1.13.2
4222   * http://jqueryui.com
4223   *
4224   * Copyright jQuery Foundation and other contributors
4225   * Released under the MIT license.
4226   * http://jquery.org/license
4227   */
4228
4229  //>>label: Form Reset Mixin
4230  //>>group: Core
4231  //>>description: Refresh input widgets when their form is reset
4232  //>>docs: http://api.jqueryui.com/form-reset-mixin/
4233
4234  var formResetMixin = ($.ui.formResetMixin = {
4235    _formResetHandler: function () {
4236      var form = $(this);
4237
4238      // Wait for the form reset to actually happen before refreshing
4239      setTimeout(function () {
4240        var instances = form.data("ui-form-reset-instances");
4241        $.each(instances, function () {
4242          this.refresh();
4243        });
4244      });
4245    },
4246
4247    _bindFormResetHandler: function () {
4248      this.form = this.element._form();
4249      if (!this.form.length) {
4250        return;
4251      }
4252
4253      var instances = this.form.data("ui-form-reset-instances") || [];
4254      if (!instances.length) {
4255        // We don't use _on() here because we use a single event handler per form
4256        this.form.on("reset.ui-form-reset", this._formResetHandler);
4257      }
4258      instances.push(this);
4259      this.form.data("ui-form-reset-instances", instances);
4260    },
4261
4262    _unbindFormResetHandler: function () {
4263      if (!this.form.length) {
4264        return;
4265      }
4266
4267      var instances = this.form.data("ui-form-reset-instances");
4268      instances.splice($.inArray(this, instances), 1);
4269      if (instances.length) {
4270        this.form.data("ui-form-reset-instances", instances);
4271      } else {
4272        this.form
4273          .removeData("ui-form-reset-instances")
4274          .off("reset.ui-form-reset");
4275      }
4276    },
4277  });
4278
4279  /*!
4280   * jQuery UI Support for jQuery core 1.8.x and newer 1.13.2
4281   * http://jqueryui.com
4282   *
4283   * Copyright jQuery Foundation and other contributors
4284   * Released under the MIT license.
4285   * http://jquery.org/license
4286   *
4287   */
4288
4289  //>>label: jQuery 1.8+ Support
4290  //>>group: Core
4291  //>>description: Support version 1.8.x and newer of jQuery core
4292
4293  // Support: jQuery 1.9.x or older
4294  // $.expr[ ":" ] is deprecated.
4295  if (!$.expr.pseudos) {
4296    $.expr.pseudos = $.expr[":"];
4297  }
4298
4299  // Support: jQuery 1.11.x or older
4300  // $.unique has been renamed to $.uniqueSort
4301  if (!$.uniqueSort) {
4302    $.uniqueSort = $.unique;
4303  }
4304
4305  // Support: jQuery 2.2.x or older.
4306  // This method has been defined in jQuery 3.0.0.
4307  // Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js
4308  if (!$.escapeSelector) {
4309    // CSS string/identifier serialization
4310    // https://drafts.csswg.org/cssom/#common-serializing-idioms
4311    var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
4312
4313    var fcssescape = function (ch, asCodePoint) {
4314      if (asCodePoint) {
4315        // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
4316        if (ch === "\0") {
4317          return "\uFFFD";
4318        }
4319
4320        // Control characters and (dependent upon position) numbers get escaped as code points
4321        return (
4322          ch.slice(0, -1) +
4323          "\\" +
4324          ch.charCodeAt(ch.length - 1).toString(16) +
4325          " "
4326        );
4327      }
4328
4329      // Other potentially-special ASCII characters get backslash-escaped
4330      return "\\" + ch;
4331    };
4332
4333    $.escapeSelector = function (sel) {
4334      return (sel + "").replace(rcssescape, fcssescape);
4335    };
4336  }
4337
vendor: 4,642 bytes, lines 4338-4504
4338  // Support: jQuery 3.4.x or older
4339  // These methods have been defined in jQuery 3.5.0.
4340  if (!$.fn.even || !$.fn.odd) {
4341    $.fn.extend({
4342      even: function () {
4343        return this.filter(function (i) {
4344          return i % 2 === 0;
4345        });
4346      },
4347      odd: function () {
4348        return this.filter(function (i) {
4349          return i % 2 === 1;
4350        });
4351      },
4352    });
4353  }
4354
4355  /*!
4356   * jQuery UI Keycode 1.13.2
4357   * http://jqueryui.com
4358   *
4359   * Copyright jQuery Foundation and other contributors
4360   * Released under the MIT license.
4361   * http://jquery.org/license
4362   */
4363
4364  //>>label: Keycode
4365  //>>group: Core
4366  //>>description: Provide keycodes as keynames
4367  //>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/
4368
4369  var keycode = ($.ui.keyCode = {
4370    BACKSPACE: 8,
4371    COMMA: 188,
4372    DELETE: 46,
4373    DOWN: 40,
4374    END: 35,
4375    ENTER: 13,
4376    ESCAPE: 27,
4377    HOME: 36,
4378    LEFT: 37,
4379    PAGE_DOWN: 34,
4380    PAGE_UP: 33,
4381    PERIOD: 190,
4382    RIGHT: 39,
4383    SPACE: 32,
4384    TAB: 9,
4385    UP: 38,
4386  });
4387
4388  /*!
4389   * jQuery UI Labels 1.13.2
4390   * http://jqueryui.com
4391   *
4392   * Copyright jQuery Foundation and other contributors
4393   * Released under the MIT license.
4394   * http://jquery.org/license
4395   */
4396
4397  //>>label: labels
4398  //>>group: Core
4399  //>>description: Find all the labels associated with a given input
4400  //>>docs: http://api.jqueryui.com/labels/
4401
4402  var labels = ($.fn.labels = function () {
4403    var ancestor, selector, id, labels, ancestors;
4404
4405    if (!this.length) {
4406      return this.pushStack([]);
4407    }
4408
4409    // Check control.labels first
4410    if (this[0].labels && this[0].labels.length) {
4411      return this.pushStack(this[0].labels);
4412    }
4413
4414    // Support: IE <= 11, FF <= 37, Android <= 2.3 only
4415    // Above browsers do not support control.labels. Everything below is to support them
4416    // as well as document fragments. control.labels does not work on document fragments
4417    labels = this.eq(0).parents("label");
4418
4419    // Look for the label based on the id
4420    id = this.attr("id");
4421    if (id) {
4422      // We don't search against the document in case the element
4423      // is disconnected from the DOM
4424      ancestor = this.eq(0).parents().last();
4425
4426      // Get a full set of top level ancestors
4427      ancestors = ancestor.add(
4428        ancestor.length ? ancestor.siblings() : this.siblings()
4429      );
4430
4431      // Create a selector for the label based on the id
4432      selector = "label[for='" + $.escapeSelector(id) + "']";
4433
4434      labels = labels.add(ancestors.find(selector).addBack(selector));
4435    }
4436
4437    // Return whatever we have found for labels
4438    return this.pushStack(labels);
4439  });
4440
4441  /*!
4442   * jQuery UI Scroll Parent 1.13.2
4443   * http://jqueryui.com
4444   *
4445   * Copyright jQuery Foundation and other contributors
4446   * Released under the MIT license.
4447   * http://jquery.org/license
4448   */
4449
4450  //>>label: scrollParent
4451  //>>group: Core
4452  //>>description: Get the closest ancestor element that is scrollable.
4453  //>>docs: http://api.jqueryui.com/scrollParent/
4454
4455  var scrollParent = ($.fn.scrollParent = function (includeHidden) {
4456    var position = this.css("position"),
4457      excludeStaticParent = position === "absolute",
4458      overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
4459      scrollParent = this.parents()
4460        .filter(function () {
4461          var parent = $(this);
4462          if (excludeStaticParent && parent.css("position") === "static") {
4463            return false;
4464          }
4465          return overflowRegex.test(
4466            parent.css("overflow") +
4467              parent.css("overflow-y") +
4468              parent.css("overflow-x")
4469          );
4470        })
4471        .eq(0);
4472
4473    return position === "fixed" || !scrollParent.length
4474      ? $(this[0].ownerDocument || document)
4475      : scrollParent;
4476  });
4477
4478  /*!
4479   * jQuery UI Tabbable 1.13.2
4480   * http://jqueryui.com
4481   *
4482   * Copyright jQuery Foundation and other contributors
4483   * Released under the MIT license.
4484   * http://jquery.org/license
4485   */
4486
4487  //>>label: :tabbable Selector
4488  //>>group: Core
4489  //>>description: Selects elements which can be tabbed to.
4490  //>>docs: http://api.jqueryui.com/tabbable-selector/
4491
4492  var tabbable = $.extend($.expr.pseudos, {
4493    tabbable: function (element) {
4494      var tabIndex = $.attr(element, "tabindex"),
4495        hasTabindex = tabIndex != null;
4496      return (
4497        (!hasTabindex || tabIndex >= 0) && $.ui.focusable(element, hasTabindex)
4498      );
4499    },
4500  });
4501
4502  /*!
4503   * jQuery UI Unique ID 1.13.2
4504   * http://jqueryui.com
vendor: 24,201 bytes, lines 4505-5332
4505   *
4506   * Copyright jQuery Foundation and other contributors
4507   * Released under the MIT license.
4508   * http://jquery.org/license
4509   */
4510
4511  //>>label: uniqueId
4512  //>>group: Core
4513  //>>description: Functions to generate and remove uniqueId's
4514  //>>docs: http://api.jqueryui.com/uniqueId/
4515
4516  var uniqueId = $.fn.extend({
4517    uniqueId: (function () {
4518      var uuid = 0;
4519
4520      return function () {
4521        return this.each(function () {
4522          if (!this.id) {
4523            this.id = "ui-id-" + ++uuid;
4524          }
4525        });
4526      };
4527    })(),
4528
4529    removeUniqueId: function () {
4530      return this.each(function () {
4531        if (/^ui-id-\d+$/.test(this.id)) {
4532          $(this).removeAttr("id");
4533        }
4534      });
4535    },
4536  });
4537
4538  /*!
4539   * jQuery UI Accordion 1.13.2
4540   * http://jqueryui.com
4541   *
4542   * Copyright jQuery Foundation and other contributors
4543   * Released under the MIT license.
4544   * http://jquery.org/license
4545   */
4546
4547  //>>label: Accordion
4548  //>>group: Widgets
4549  /* eslint-disable max-len */
4550  //>>description: Displays collapsible content panels for presenting information in a limited amount of space.
4551  /* eslint-enable max-len */
4552  //>>docs: http://api.jqueryui.com/accordion/
4553  //>>demos: http://jqueryui.com/accordion/
4554  //>>css.structure: ../../themes/base/core.css
4555  //>>css.structure: ../../themes/base/accordion.css
4556  //>>css.theme: ../../themes/base/theme.css
4557
4558  var widgetsAccordion = $.widget("ui.accordion", {
4559    version: "1.13.2",
4560    options: {
4561      active: 0,
4562      animate: {},
4563      classes: {
4564        "ui-accordion-header": "ui-corner-top",
4565        "ui-accordion-header-collapsed": "ui-corner-all",
4566        "ui-accordion-content": "ui-corner-bottom",
4567      },
4568      collapsible: false,
4569      event: "click",
4570      header: function (elem) {
4571        return elem
4572          .find("> li > :first-child")
4573          .add(elem.find("> :not(li)").even());
4574      },
4575      heightStyle: "auto",
4576      icons: {
4577        activeHeader: "ui-icon-triangle-1-s",
4578        header: "ui-icon-triangle-1-e",
4579      },
4580
4581      // Callbacks
4582      activate: null,
4583      beforeActivate: null,
4584    },
4585
4586    hideProps: {
4587      borderTopWidth: "hide",
4588      borderBottomWidth: "hide",
4589      paddingTop: "hide",
4590      paddingBottom: "hide",
4591      height: "hide",
4592    },
4593
4594    showProps: {
4595      borderTopWidth: "show",
4596      borderBottomWidth: "show",
4597      paddingTop: "show",
4598      paddingBottom: "show",
4599      height: "show",
4600    },
4601
4602    _create: function () {
4603      var options = this.options;
4604
4605      this.prevShow = this.prevHide = $();
4606      this._addClass("ui-accordion", "ui-widget ui-helper-reset");
4607      this.element.attr("role", "tablist");
4608
4609      // Don't allow collapsible: false and active: false / null
4610      if (
4611        !options.collapsible &&
4612        (options.active === false || options.active == null)
4613      ) {
4614        options.active = 0;
4615      }
4616
4617      this._processPanels();
4618
4619      // handle negative values
4620      if (options.active < 0) {
4621        options.active += this.headers.length;
4622      }
4623      this._refresh();
4624    },
4625
4626    _getCreateEventData: function () {
4627      return {
4628        header: this.active,
4629        panel: !this.active.length ? $() : this.active.next(),
4630      };
4631    },
4632
4633    _createIcons: function () {
4634      var icon,
4635        children,
4636        icons = this.options.icons;
4637
4638      if (icons) {
4639        icon = $("<span>");
4640        this._addClass(
4641          icon,
4642          "ui-accordion-header-icon",
4643          "ui-icon " + icons.header
4644        );
4645        icon.prependTo(this.headers);
4646        children = this.active.children(".ui-accordion-header-icon");
4647        this._removeClass(children, icons.header)
4648          ._addClass(children, null, icons.activeHeader)
4649          ._addClass(this.headers, "ui-accordion-icons");
4650      }
4651    },
4652
4653    _destroyIcons: function () {
4654      this._removeClass(this.headers, "ui-accordion-icons");
4655      this.headers.children(".ui-accordion-header-icon").remove();
4656    },
4657
4658    _destroy: function () {
4659      var contents;
4660
4661      // Clean up main element
4662      this.element.removeAttr("role");
4663
4664      // Clean up headers
4665      this.headers
4666        .removeAttr("role aria-expanded aria-selected aria-controls tabIndex")
4667        .removeUniqueId();
4668
4669      this._destroyIcons();
4670
4671      // Clean up content panels
4672      contents = this.headers
4673        .next()
4674        .css("display", "")
4675        .removeAttr("role aria-hidden aria-labelledby")
4676        .removeUniqueId();
4677
4678      if (this.options.heightStyle !== "content") {
4679        contents.css("height", "");
4680      }
4681    },
4682
4683    _setOption: function (key, value) {
4684      if (key === "active") {
4685        // _activate() will handle invalid values and update this.options
4686        this._activate(value);
4687        return;
4688      }
4689
4690      if (key === "event") {
4691        if (this.options.event) {
4692          this._off(this.headers, this.options.event);
4693        }
4694        this._setupEvents(value);
4695      }
4696
4697      this._super(key, value);
4698
4699      // Setting collapsible: false while collapsed; open first panel
4700      if (key === "collapsible" && !value && this.options.active === false) {
4701        this._activate(0);
4702      }
4703
4704      if (key === "icons") {
4705        this._destroyIcons();
4706        if (value) {
4707          this._createIcons();
4708        }
4709      }
4710    },
4711
4712    _setOptionDisabled: function (value) {
4713      this._super(value);
4714
4715      this.element.attr("aria-disabled", value);
4716
4717      // Support: IE8 Only
4718      // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
4719      // so we need to add the disabled class to the headers and panels
4720      this._toggleClass(null, "ui-state-disabled", !!value);
4721      this._toggleClass(
4722        this.headers.add(this.headers.next()),
4723        null,
4724        "ui-state-disabled",
4725        !!value
4726      );
4727    },
4728
4729    _keydown: function (event) {
4730      if (event.altKey || event.ctrlKey) {
4731        return;
4732      }
4733
4734      var keyCode = $.ui.keyCode,
4735        length = this.headers.length,
4736        currentIndex = this.headers.index(event.target),
4737        toFocus = false;
4738
4739      switch (event.keyCode) {
4740        case keyCode.RIGHT:
4741        case keyCode.DOWN:
4742          toFocus = this.headers[(currentIndex + 1) % length];
4743          break;
4744        case keyCode.LEFT:
4745        case keyCode.UP:
4746          toFocus = this.headers[(currentIndex - 1 + length) % length];
4747          break;
4748        case keyCode.SPACE:
4749        case keyCode.ENTER:
4750          this._eventHandler(event);
4751          break;
4752        case keyCode.HOME:
4753          toFocus = this.headers[0];
4754          break;
4755        case keyCode.END:
4756          toFocus = this.headers[length - 1];
4757          break;
4758      }
4759
4760      if (toFocus) {
4761        $(event.target).attr("tabIndex", -1);
4762        $(toFocus).attr("tabIndex", 0);
4763        $(toFocus).trigger("focus");
4764        event.preventDefault();
4765      }
4766    },
4767
4768    _panelKeyDown: function (event) {
4769      if (event.keyCode === $.ui.keyCode.UP && event.ctrlKey) {
4770        $(event.currentTarget).prev().trigger("focus");
4771      }
4772    },
4773
4774    refresh: function () {
4775      var options = this.options;
4776      this._processPanels();
4777
4778      // Was collapsed or no panel
4779      if (
4780        (options.active === false && options.collapsible === true) ||
4781        !this.headers.length
4782      ) {
4783        options.active = false;
4784        this.active = $();
4785
4786        // active false only when collapsible is true
4787      } else if (options.active === false) {
4788        this._activate(0);
4789
4790        // was active, but active panel is gone
4791      } else if (
4792        this.active.length &&
4793        !$.contains(this.element[0], this.active[0])
4794      ) {
4795        // all remaining panel are disabled
4796        if (
4797          this.headers.length === this.headers.find(".ui-state-disabled").length
4798        ) {
4799          options.active = false;
4800          this.active = $();
4801
4802          // activate previous panel
4803        } else {
4804          this._activate(Math.max(0, options.active - 1));
4805        }
4806
4807        // was active, active panel still exists
4808      } else {
4809        // make sure active index is correct
4810        options.active = this.headers.index(this.active);
4811      }
4812
4813      this._destroyIcons();
4814
4815      this._refresh();
4816    },
4817
4818    _processPanels: function () {
4819      var prevHeaders = this.headers,
4820        prevPanels = this.panels;
4821
4822      if (typeof this.options.header === "function") {
4823        this.headers = this.options.header(this.element);
4824      } else {
4825        this.headers = this.element.find(this.options.header);
4826      }
4827      this._addClass(
4828        this.headers,
4829        "ui-accordion-header ui-accordion-header-collapsed",
4830        "ui-state-default"
4831      );
4832
4833      this.panels = this.headers
4834        .next()
4835        .filter(":not(.ui-accordion-content-active)")
4836        .hide();
4837      this._addClass(
4838        this.panels,
4839        "ui-accordion-content",
4840        "ui-helper-reset ui-widget-content"
4841      );
4842
4843      // Avoid memory leaks (#10056)
4844      if (prevPanels) {
4845        this._off(prevHeaders.not(this.headers));
4846        this._off(prevPanels.not(this.panels));
4847      }
4848    },
4849
4850    _refresh: function () {
4851      var maxHeight,
4852        options = this.options,
4853        heightStyle = options.heightStyle,
4854        parent = this.element.parent();
4855
4856      this.active = this._findActive(options.active);
4857      this._addClass(
4858        this.active,
4859        "ui-accordion-header-active",
4860        "ui-state-active"
4861      )._removeClass(this.active, "ui-accordion-header-collapsed");
4862      this._addClass(this.active.next(), "ui-accordion-content-active");
4863      this.active.next().show();
4864
4865      this.headers
4866        .attr("role", "tab")
4867        .each(function () {
4868          var header = $(this),
4869            headerId = header.uniqueId().attr("id"),
4870            panel = header.next(),
4871            panelId = panel.uniqueId().attr("id");
4872          header.attr("aria-controls", panelId);
4873          panel.attr("aria-labelledby", headerId);
4874        })
4875        .next()
4876        .attr("role", "tabpanel");
4877
4878      this.headers
4879        .not(this.active)
4880        .attr({
4881          "aria-selected": "false",
4882          "aria-expanded": "false",
4883          tabIndex: -1,
4884        })
4885        .next()
4886        .attr({
4887          "aria-hidden": "true",
4888        })
4889        .hide();
4890
4891      // Make sure at least one header is in the tab order
4892      if (!this.active.length) {
4893        this.headers.eq(0).attr("tabIndex", 0);
4894      } else {
4895        this.active
4896          .attr({
4897            "aria-selected": "true",
4898            "aria-expanded": "true",
4899            tabIndex: 0,
4900          })
4901          .next()
4902          .attr({
4903            "aria-hidden": "false",
4904          });
4905      }
4906
4907      this._createIcons();
4908
4909      this._setupEvents(options.event);
4910
4911      if (heightStyle === "fill") {
4912        maxHeight = parent.height();
4913        this.element.siblings(":visible").each(function () {
4914          var elem = $(this),
4915            position = elem.css("position");
4916
4917          if (position === "absolute" || position === "fixed") {
4918            return;
4919          }
4920          maxHeight -= elem.outerHeight(true);
4921        });
4922
4923        this.headers.each(function () {
4924          maxHeight -= $(this).outerHeight(true);
4925        });
4926
4927        this.headers
4928          .next()
4929          .each(function () {
4930            $(this).height(
4931              Math.max(0, maxHeight - $(this).innerHeight() + $(this).height())
4932            );
4933          })
4934          .css("overflow", "auto");
4935      } else if (heightStyle === "auto") {
4936        maxHeight = 0;
4937        this.headers
4938          .next()
4939          .each(function () {
4940            var isVisible = $(this).is(":visible");
4941            if (!isVisible) {
4942              $(this).show();
4943            }
4944            maxHeight = Math.max(maxHeight, $(this).css("height", "").height());
4945            if (!isVisible) {
4946              $(this).hide();
4947            }
4948          })
4949          .height(maxHeight);
4950      }
4951    },
4952
4953    _activate: function (index) {
4954      var active = this._findActive(index)[0];
4955
4956      // Trying to activate the already active panel
4957      if (active === this.active[0]) {
4958        return;
4959      }
4960
4961      // Trying to collapse, simulate a click on the currently active header
4962      active = active || this.active[0];
4963
4964      this._eventHandler({
4965        target: active,
4966        currentTarget: active,
4967        preventDefault: $.noop,
4968      });
4969    },
4970
4971    _findActive: function (selector) {
4972      return typeof selector === "number" ? this.headers.eq(selector) : $();
4973    },
4974
4975    _setupEvents: function (event) {
4976      var events = {
4977        keydown: "_keydown",
4978      };
4979      if (event) {
4980        $.each(event.split(" "), function (index, eventName) {
4981          events[eventName] = "_eventHandler";
4982        });
4983      }
4984
4985      this._off(this.headers.add(this.headers.next()));
4986      this._on(this.headers, events);
4987      this._on(this.headers.next(), { keydown: "_panelKeyDown" });
4988      this._hoverable(this.headers);
4989      this._focusable(this.headers);
4990    },
4991
4992    _eventHandler: function (event) {
4993      var activeChildren,
4994        clickedChildren,
4995        options = this.options,
4996        active = this.active,
4997        clicked = $(event.currentTarget),
4998        clickedIsActive = clicked[0] === active[0],
4999        collapsing = clickedIsActive && options.collapsible,
5000        toShow = collapsing ? $() : clicked.next(),
5001        toHide = active.next(),
5002        eventData = {
5003          oldHeader: active,
5004          oldPanel: toHide,
5005          newHeader: collapsing ? $() : clicked,
5006          newPanel: toShow,
5007        };
5008
5009      event.preventDefault();
5010
5011      if (
5012        // click on active header, but not collapsible
5013        (clickedIsActive && !options.collapsible) ||
5014        // allow canceling activation
5015        this._trigger("beforeActivate", event, eventData) === false
5016      ) {
5017        return;
5018      }
5019
5020      options.active = collapsing ? false : this.headers.index(clicked);
5021
5022      // When the call to ._toggle() comes after the class changes
5023      // it causes a very odd bug in IE 8 (see #6720)
5024      this.active = clickedIsActive ? $() : clicked;
5025      this._toggle(eventData);
5026
5027      // Switch classes
5028      // corner classes on the previously active header stay after the animation
5029      this._removeClass(
5030        active,
5031        "ui-accordion-header-active",
5032        "ui-state-active"
5033      );
5034      if (options.icons) {
5035        activeChildren = active.children(".ui-accordion-header-icon");
5036        this._removeClass(
5037          activeChildren,
5038          null,
5039          options.icons.activeHeader
5040        )._addClass(activeChildren, null, options.icons.header);
5041      }
5042
5043      if (!clickedIsActive) {
5044        this._removeClass(clicked, "ui-accordion-header-collapsed")._addClass(
5045          clicked,
5046          "ui-accordion-header-active",
5047          "ui-state-active"
5048        );
5049        if (options.icons) {
5050          clickedChildren = clicked.children(".ui-accordion-header-icon");
5051          this._removeClass(
5052            clickedChildren,
5053            null,
5054            options.icons.header
5055          )._addClass(clickedChildren, null, options.icons.activeHeader);
5056        }
5057
5058        this._addClass(clicked.next(), "ui-accordion-content-active");
5059      }
5060    },
5061
5062    _toggle: function (data) {
5063      var toShow = data.newPanel,
5064        toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
5065
5066      // Handle activating a panel during the animation for another activation
5067      this.prevShow.add(this.prevHide).stop(true, true);
5068      this.prevShow = toShow;
5069      this.prevHide = toHide;
5070
5071      if (this.options.animate) {
5072        this._animate(toShow, toHide, data);
5073      } else {
5074        toHide.hide();
5075        toShow.show();
5076        this._toggleComplete(data);
5077      }
5078
5079      toHide.attr({
5080        "aria-hidden": "true",
5081      });
5082      toHide.prev().attr({
5083        "aria-selected": "false",
5084        "aria-expanded": "false",
5085      });
5086
5087      // if we're switching panels, remove the old header from the tab order
5088      // if we're opening from collapsed state, remove the previous header from the tab order
5089      // if we're collapsing, then keep the collapsing header in the tab order
5090      if (toShow.length && toHide.length) {
5091        toHide.prev().attr({
5092          tabIndex: -1,
5093          "aria-expanded": "false",
5094        });
5095      } else if (toShow.length) {
5096        this.headers
5097          .filter(function () {
5098            return parseInt($(this).attr("tabIndex"), 10) === 0;
5099          })
5100          .attr("tabIndex", -1);
5101      }
5102
5103      toShow.attr("aria-hidden", "false").prev().attr({
5104        "aria-selected": "true",
5105        "aria-expanded": "true",
5106        tabIndex: 0,
5107      });
5108    },
5109
5110    _animate: function (toShow, toHide, data) {
5111      var total,
5112        easing,
5113        duration,
5114        that = this,
5115        adjust = 0,
5116        boxSizing = toShow.css("box-sizing"),
5117        down =
5118          toShow.length && (!toHide.length || toShow.index() < toHide.index()),
5119        animate = this.options.animate || {},
5120        options = (down && animate.down) || animate,
5121        complete = function () {
5122          that._toggleComplete(data);
5123        };
5124
5125      if (typeof options === "number") {
5126        duration = options;
5127      }
5128      if (typeof options === "string") {
5129        easing = options;
5130      }
5131
5132      // fall back from options to animation in case of partial down settings
5133      easing = easing || options.easing || animate.easing;
5134      duration = duration || options.duration || animate.duration;
5135
5136      if (!toHide.length) {
5137        return toShow.animate(this.showProps, duration, easing, complete);
5138      }
5139      if (!toShow.length) {
5140        return toHide.animate(this.hideProps, duration, easing, complete);
5141      }
5142
5143      total = toShow.show().outerHeight();
5144      toHide.animate(this.hideProps, {
5145        duration: duration,
5146        easing: easing,
5147        step: function (now, fx) {
5148          fx.now = Math.round(now);
5149        },
5150      });
5151      toShow.hide().animate(this.showProps, {
5152        duration: duration,
5153        easing: easing,
5154        complete: complete,
5155        step: function (now, fx) {
5156          fx.now = Math.round(now);
5157          if (fx.prop !== "height") {
5158            if (boxSizing === "content-box") {
5159              adjust += fx.now;
5160            }
5161          } else if (that.options.heightStyle !== "content") {
5162            fx.now = Math.round(total - toHide.outerHeight() - adjust);
5163            adjust = 0;
5164          }
5165        },
5166      });
5167    },
5168
5169    _toggleComplete: function (data) {
5170      var toHide = data.oldPanel,
5171        prev = toHide.prev();
5172
5173      this._removeClass(toHide, "ui-accordion-content-active");
5174      this._removeClass(prev, "ui-accordion-header-active")._addClass(
5175        prev,
5176        "ui-accordion-header-collapsed"
5177      );
5178
5179      // Work around for rendering bug in IE (#5421)
5180      if (toHide.length) {
5181        toHide.parent()[0].className = toHide.parent()[0].className;
5182      }
5183      this._trigger("activate", null, data);
5184    },
5185  });
5186
5187  var safeActiveElement = ($.ui.safeActiveElement = function (document) {
5188    var activeElement;
5189
5190    // Support: IE 9 only
5191    // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
5192    try {
5193      activeElement = document.activeElement;
5194    } catch (error) {
5195      activeElement = document.body;
5196    }
5197
5198    // Support: IE 9 - 11 only
5199    // IE may return null instead of an element
5200    // Interestingly, this only seems to occur when NOT in an iframe
5201    if (!activeElement) {
5202      activeElement = document.body;
5203    }
5204
5205    // Support: IE 11 only
5206    // IE11 returns a seemingly empty object in some cases when accessing
5207    // document.activeElement from an <iframe>
5208    if (!activeElement.nodeName) {
5209      activeElement = document.body;
5210    }
5211
5212    return activeElement;
5213  });
5214
5215  /*!
5216   * jQuery UI Menu 1.13.2
5217   * http://jqueryui.com
5218   *
5219   * Copyright jQuery Foundation and other contributors
5220   * Released under the MIT license.
5221   * http://jquery.org/license
5222   */
5223
5224  //>>label: Menu
5225  //>>group: Widgets
5226  //>>description: Creates nestable menus.
5227  //>>docs: http://api.jqueryui.com/menu/
5228  //>>demos: http://jqueryui.com/menu/
5229  //>>css.structure: ../../themes/base/core.css
5230  //>>css.structure: ../../themes/base/menu.css
5231  //>>css.theme: ../../themes/base/theme.css
5232
5233  var widgetsMenu = $.widget("ui.menu", {
5234    version: "1.13.2",
5235    defaultElement: "<ul>",
5236    delay: 300,
5237    options: {
5238      icons: {
5239        submenu: "ui-icon-caret-1-e",
5240      },
5241      items: "> *",
5242      menus: "ul",
5243      position: {
5244        my: "left top",
5245        at: "right top",
5246      },
5247      role: "menu",
5248
5249      // Callbacks
5250      blur: null,
5251      focus: null,
5252      select: null,
5253    },
5254
5255    _create: function () {
5256      this.activeMenu = this.element;
5257
5258      // Flag used to prevent firing of the click handler
5259      // as the event bubbles up through nested menus
5260      this.mouseHandled = false;
5261      this.lastMousePosition = { x: null, y: null };
5262      this.element.uniqueId().attr({
5263        role: this.options.role,
5264        tabIndex: 0,
5265      });
5266
5267      this._addClass("ui-menu", "ui-widget ui-widget-content");
5268      this._on({
5269        // Prevent focus from sticking to links inside menu after clicking
5270        // them (focus should always stay on UL during navigation).
5271        "mousedown .ui-menu-item": function (event) {
5272          event.preventDefault();
5273
5274          this._activateItem(event);
5275        },
5276        "click .ui-menu-item": function (event) {
5277          var target = $(event.target);
5278          var active = $($.ui.safeActiveElement(this.document[0]));
5279          if (!this.mouseHandled && target.not(".ui-state-disabled").length) {
5280            this.select(event);
5281
5282            // Only set the mouseHandled flag if the event will bubble, see #9469.
5283            if (!event.isPropagationStopped()) {
5284              this.mouseHandled = true;
5285            }
5286
5287            // Open submenu on click
5288            if (target.has(".ui-menu").length) {
5289              this.expand(event);
5290            } else if (
5291              !this.element.is(":focus") &&
5292              active.closest(".ui-menu").length
5293            ) {
5294              // Redirect focus to the menu
5295              this.element.trigger("focus", [true]);
5296
5297              // If the active item is on the top level, let it stay active.
5298              // Otherwise, blur the active item since it is no longer visible.
5299              if (this.active && this.active.parents(".ui-menu").length === 1) {
5300                clearTimeout(this.timer);
5301              }
5302            }
5303          }
5304        },
5305        "mouseenter .ui-menu-item": "_activateItem",
5306        "mousemove .ui-menu-item": "_activateItem",
5307        mouseleave: "collapseAll",
5308        "mouseleave .ui-menu": "collapseAll",
5309        focus: function (event, keepActiveItem) {
5310          // If there's already an active item, keep it active
5311          // If not, activate the first item
5312          var item = this.active || this._menuItems().first();
5313
5314          if (!keepActiveItem) {
5315            this.focus(event, item);
5316          }
5317        },
5318        blur: function (event) {
5319          this._delay(function () {
5320            var notContained = !$.contains(
5321              this.element[0],
5322              $.ui.safeActiveElement(this.document[0])
5323            );
5324            if (notContained) {
5325              this.collapseAll(event);
5326            }
5327          });
5328        },
5329        keydown: "_keydown",
5330      });
5331
5332      this.refresh();
vendor: 24,441 bytes, lines 5333-6140
5333
5334      // Clicks outside of a menu collapse any open menus
5335      this._on(this.document, {
5336        click: function (event) {
5337          if (this._closeOnDocumentClick(event)) {
5338            this.collapseAll(event, true);
5339          }
5340
5341          // Reset the mouseHandled flag
5342          this.mouseHandled = false;
5343        },
5344      });
5345    },
5346
5347    _activateItem: function (event) {
5348      // Ignore mouse events while typeahead is active, see #10458.
5349      // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
5350      // is over an item in the menu
5351      if (this.previousFilter) {
5352        return;
5353      }
5354
5355      // If the mouse didn't actually move, but the page was scrolled, ignore the event (#9356)
5356      if (
5357        event.clientX === this.lastMousePosition.x &&
5358        event.clientY === this.lastMousePosition.y
5359      ) {
5360        return;
5361      }
5362
5363      this.lastMousePosition = {
5364        x: event.clientX,
5365        y: event.clientY,
5366      };
5367
5368      var actualTarget = $(event.target).closest(".ui-menu-item"),
5369        target = $(event.currentTarget);
5370
5371      // Ignore bubbled events on parent items, see #11641
5372      if (actualTarget[0] !== target[0]) {
5373        return;
5374      }
5375
5376      // If the item is already active, there's nothing to do
5377      if (target.is(".ui-state-active")) {
5378        return;
5379      }
5380
5381      // Remove ui-state-active class from siblings of the newly focused menu item
5382      // to avoid a jump caused by adjacent elements both having a class with a border
5383      this._removeClass(
5384        target.siblings().children(".ui-state-active"),
5385        null,
5386        "ui-state-active"
5387      );
5388      this.focus(event, target);
5389    },
5390
5391    _destroy: function () {
5392      var items = this.element
5393          .find(".ui-menu-item")
5394          .removeAttr("role aria-disabled"),
5395        submenus = items
5396          .children(".ui-menu-item-wrapper")
5397          .removeUniqueId()
5398          .removeAttr("tabIndex role aria-haspopup");
5399
5400      // Destroy (sub)menus
5401      this.element
5402        .removeAttr("aria-activedescendant")
5403        .find(".ui-menu")
5404        .addBack()
5405        .removeAttr(
5406          "role aria-labelledby aria-expanded aria-hidden aria-disabled " +
5407            "tabIndex"
5408        )
5409        .removeUniqueId()
5410        .show();
5411
5412      submenus.children().each(function () {
5413        var elem = $(this);
5414        if (elem.data("ui-menu-submenu-caret")) {
5415          elem.remove();
5416        }
5417      });
5418    },
5419
5420    _keydown: function (event) {
5421      var match,
5422        prev,
5423        character,
5424        skip,
5425        preventDefault = true;
5426
5427      switch (event.keyCode) {
5428        case $.ui.keyCode.PAGE_UP:
5429          this.previousPage(event);
5430          break;
5431        case $.ui.keyCode.PAGE_DOWN:
5432          this.nextPage(event);
5433          break;
5434        case $.ui.keyCode.HOME:
5435          this._move("first", "first", event);
5436          break;
5437        case $.ui.keyCode.END:
5438          this._move("last", "last", event);
5439          break;
5440        case $.ui.keyCode.UP:
5441          this.previous(event);
5442          break;
5443        case $.ui.keyCode.DOWN:
5444          this.next(event);
5445          break;
5446        case $.ui.keyCode.LEFT:
5447          this.collapse(event);
5448          break;
5449        case $.ui.keyCode.RIGHT:
5450          if (this.active && !this.active.is(".ui-state-disabled")) {
5451            this.expand(event);
5452          }
5453          break;
5454        case $.ui.keyCode.ENTER:
5455        case $.ui.keyCode.SPACE:
5456          this._activate(event);
5457          break;
5458        case $.ui.keyCode.ESCAPE:
5459          this.collapse(event);
5460          break;
5461        default:
5462          preventDefault = false;
5463          prev = this.previousFilter || "";
5464          skip = false;
5465
5466          // Support number pad values
5467          character =
5468            event.keyCode >= 96 && event.keyCode <= 105
5469              ? (event.keyCode - 96).toString()
5470              : String.fromCharCode(event.keyCode);
5471
5472          clearTimeout(this.filterTimer);
5473
5474          if (character === prev) {
5475            skip = true;
5476          } else {
5477            character = prev + character;
5478          }
5479
5480          match = this._filterMenuItems(character);
5481          match =
5482            skip && match.index(this.active.next()) !== -1
5483              ? this.active.nextAll(".ui-menu-item")
5484              : match;
5485
5486          // If no matches on the current filter, reset to the last character pressed
5487          // to move down the menu to the first item that starts with that character
5488          if (!match.length) {
5489            character = String.fromCharCode(event.keyCode);
5490            match = this._filterMenuItems(character);
5491          }
5492
5493          if (match.length) {
5494            this.focus(event, match);
5495            this.previousFilter = character;
5496            this.filterTimer = this._delay(function () {
5497              delete this.previousFilter;
5498            }, 1000);
5499          } else {
5500            delete this.previousFilter;
5501          }
5502      }
5503
5504      if (preventDefault) {
5505        event.preventDefault();
5506      }
5507    },
5508
5509    _activate: function (event) {
5510      if (this.active && !this.active.is(".ui-state-disabled")) {
5511        if (this.active.children("[aria-haspopup='true']").length) {
5512          this.expand(event);
5513        } else {
5514          this.select(event);
5515        }
5516      }
5517    },
5518
5519    refresh: function () {
5520      var menus,
5521        items,
5522        newSubmenus,
5523        newItems,
5524        newWrappers,
5525        that = this,
5526        icon = this.options.icons.submenu,
5527        submenus = this.element.find(this.options.menus);
5528
5529      this._toggleClass(
5530        "ui-menu-icons",
5531        null,
5532        !!this.element.find(".ui-icon").length
5533      );
5534
5535      // Initialize nested menus
5536      newSubmenus = submenus
5537        .filter(":not(.ui-menu)")
5538        .hide()
5539        .attr({
5540          role: this.options.role,
5541          "aria-hidden": "true",
5542          "aria-expanded": "false",
5543        })
5544        .each(function () {
5545          var menu = $(this),
5546            item = menu.prev(),
5547            submenuCaret = $("<span>").data("ui-menu-submenu-caret", true);
5548
5549          that._addClass(submenuCaret, "ui-menu-icon", "ui-icon " + icon);
5550          item.attr("aria-haspopup", "true").prepend(submenuCaret);
5551          menu.attr("aria-labelledby", item.attr("id"));
5552        });
5553
5554      this._addClass(
5555        newSubmenus,
5556        "ui-menu",
5557        "ui-widget ui-widget-content ui-front"
5558      );
5559
5560      menus = submenus.add(this.element);
5561      items = menus.find(this.options.items);
5562
5563      // Initialize menu-items containing spaces and/or dashes only as dividers
5564      items.not(".ui-menu-item").each(function () {
5565        var item = $(this);
5566        if (that._isDivider(item)) {
5567          that._addClass(item, "ui-menu-divider", "ui-widget-content");
5568        }
5569      });
5570
5571      // Don't refresh list items that are already adapted
5572      newItems = items.not(".ui-menu-item, .ui-menu-divider");
5573      newWrappers = newItems.children().not(".ui-menu").uniqueId().attr({
5574        tabIndex: -1,
5575        role: this._itemRole(),
5576      });
5577      this._addClass(newItems, "ui-menu-item")._addClass(
5578        newWrappers,
5579        "ui-menu-item-wrapper"
5580      );
5581
5582      // Add aria-disabled attribute to any disabled menu item
5583      items.filter(".ui-state-disabled").attr("aria-disabled", "true");
5584
5585      // If the active item has been removed, blur the menu
5586      if (this.active && !$.contains(this.element[0], this.active[0])) {
5587        this.blur();
5588      }
5589    },
5590
5591    _itemRole: function () {
5592      return {
5593        menu: "menuitem",
5594        listbox: "option",
5595      }[this.options.role];
5596    },
5597
5598    _setOption: function (key, value) {
5599      if (key === "icons") {
5600        var icons = this.element.find(".ui-menu-icon");
5601        this._removeClass(icons, null, this.options.icons.submenu)._addClass(
5602          icons,
5603          null,
5604          value.submenu
5605        );
5606      }
5607      this._super(key, value);
5608    },
5609
5610    _setOptionDisabled: function (value) {
5611      this._super(value);
5612
5613      this.element.attr("aria-disabled", String(value));
5614      this._toggleClass(null, "ui-state-disabled", !!value);
5615    },
5616
5617    focus: function (event, item) {
5618      var nested, focused, activeParent;
5619      this.blur(event, event && event.type === "focus");
5620
5621      this._scrollIntoView(item);
5622
5623      this.active = item.first();
5624
5625      focused = this.active.children(".ui-menu-item-wrapper");
5626      this._addClass(focused, null, "ui-state-active");
5627
5628      // Only update aria-activedescendant if there's a role
5629      // otherwise we assume focus is managed elsewhere
5630      if (this.options.role) {
5631        this.element.attr("aria-activedescendant", focused.attr("id"));
5632      }
5633
5634      // Highlight active parent menu item, if any
5635      activeParent = this.active
5636        .parent()
5637        .closest(".ui-menu-item")
5638        .children(".ui-menu-item-wrapper");
5639      this._addClass(activeParent, null, "ui-state-active");
5640
5641      if (event && event.type === "keydown") {
5642        this._close();
5643      } else {
5644        this.timer = this._delay(function () {
5645          this._close();
5646        }, this.delay);
5647      }
5648
5649      nested = item.children(".ui-menu");
5650      if (nested.length && event && /^mouse/.test(event.type)) {
5651        this._startOpening(nested);
5652      }
5653      this.activeMenu = item.parent();
5654
5655      this._trigger("focus", event, { item: item });
5656    },
5657
5658    _scrollIntoView: function (item) {
5659      var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
5660      if (this._hasScroll()) {
5661        borderTop =
5662          parseFloat($.css(this.activeMenu[0], "borderTopWidth")) || 0;
5663        paddingTop = parseFloat($.css(this.activeMenu[0], "paddingTop")) || 0;
5664        offset =
5665          item.offset().top -
5666          this.activeMenu.offset().top -
5667          borderTop -
5668          paddingTop;
5669        scroll = this.activeMenu.scrollTop();
5670        elementHeight = this.activeMenu.height();
5671        itemHeight = item.outerHeight();
5672
5673        if (offset < 0) {
5674          this.activeMenu.scrollTop(scroll + offset);
5675        } else if (offset + itemHeight > elementHeight) {
5676          this.activeMenu.scrollTop(
5677            scroll + offset - elementHeight + itemHeight
5678          );
5679        }
5680      }
5681    },
5682
5683    blur: function (event, fromFocus) {
5684      if (!fromFocus) {
5685        clearTimeout(this.timer);
5686      }
5687
5688      if (!this.active) {
5689        return;
5690      }
5691
5692      this._removeClass(
5693        this.active.children(".ui-menu-item-wrapper"),
5694        null,
5695        "ui-state-active"
5696      );
5697
5698      this._trigger("blur", event, { item: this.active });
5699      this.active = null;
5700    },
5701
5702    _startOpening: function (submenu) {
5703      clearTimeout(this.timer);
5704
5705      // Don't open if already open fixes a Firefox bug that caused a .5 pixel
5706      // shift in the submenu position when mousing over the caret icon
5707      if (submenu.attr("aria-hidden") !== "true") {
5708        return;
5709      }
5710
5711      this.timer = this._delay(function () {
5712        this._close();
5713        this._open(submenu);
5714      }, this.delay);
5715    },
5716
5717    _open: function (submenu) {
5718      var position = $.extend(
5719        {
5720          of: this.active,
5721        },
5722        this.options.position
5723      );
5724
5725      clearTimeout(this.timer);
5726      this.element
5727        .find(".ui-menu")
5728        .not(submenu.parents(".ui-menu"))
5729        .hide()
5730        .attr("aria-hidden", "true");
5731
5732      submenu
5733        .show()
5734        .removeAttr("aria-hidden")
5735        .attr("aria-expanded", "true")
5736        .position(position);
5737    },
5738
5739    collapseAll: function (event, all) {
5740      clearTimeout(this.timer);
5741      this.timer = this._delay(
5742        function () {
5743          // If we were passed an event, look for the submenu that contains the event
5744          var currentMenu = all
5745            ? this.element
5746            : $(event && event.target).closest(this.element.find(".ui-menu"));
5747
5748          // If we found no valid submenu ancestor, use the main menu to close all
5749          // sub menus anyway
5750          if (!currentMenu.length) {
5751            currentMenu = this.element;
5752          }
5753
5754          this._close(currentMenu);
5755
5756          this.blur(event);
5757
5758          // Work around active item staying active after menu is blurred
5759          this._removeClass(
5760            currentMenu.find(".ui-state-active"),
5761            null,
5762            "ui-state-active"
5763          );
5764
5765          this.activeMenu = currentMenu;
5766        },
5767        all ? 0 : this.delay
5768      );
5769    },
5770
5771    // With no arguments, closes the currently active menu - if nothing is active
5772    // it closes all menus.  If passed an argument, it will search for menus BELOW
5773    _close: function (startMenu) {
5774      if (!startMenu) {
5775        startMenu = this.active ? this.active.parent() : this.element;
5776      }
5777
5778      startMenu
5779        .find(".ui-menu")
5780        .hide()
5781        .attr("aria-hidden", "true")
5782        .attr("aria-expanded", "false");
5783    },
5784
5785    _closeOnDocumentClick: function (event) {
5786      return !$(event.target).closest(".ui-menu").length;
5787    },
5788
5789    _isDivider: function (item) {
5790      // Match hyphen, em dash, en dash
5791      return !/[^\-\u2014\u2013\s]/.test(item.text());
5792    },
5793
5794    collapse: function (event) {
5795      var newItem =
5796        this.active &&
5797        this.active.parent().closest(".ui-menu-item", this.element);
5798      if (newItem && newItem.length) {
5799        this._close();
5800        this.focus(event, newItem);
5801      }
5802    },
5803
5804    expand: function (event) {
5805      var newItem =
5806        this.active &&
5807        this._menuItems(this.active.children(".ui-menu")).first();
5808
5809      if (newItem && newItem.length) {
5810        this._open(newItem.parent());
5811
5812        // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
5813        this._delay(function () {
5814          this.focus(event, newItem);
5815        });
5816      }
5817    },
5818
5819    next: function (event) {
5820      this._move("next", "first", event);
5821    },
5822
5823    previous: function (event) {
5824      this._move("prev", "last", event);
5825    },
5826
5827    isFirstItem: function () {
5828      return this.active && !this.active.prevAll(".ui-menu-item").length;
5829    },
5830
5831    isLastItem: function () {
5832      return this.active && !this.active.nextAll(".ui-menu-item").length;
5833    },
5834
5835    _menuItems: function (menu) {
5836      return (menu || this.element)
5837        .find(this.options.items)
5838        .filter(".ui-menu-item");
5839    },
5840
5841    _move: function (direction, filter, event) {
5842      var next;
5843      if (this.active) {
5844        if (direction === "first" || direction === "last") {
5845          next =
5846            this.active[direction === "first" ? "prevAll" : "nextAll"](
5847              ".ui-menu-item"
5848            ).last();
5849        } else {
5850          next = this.active[direction + "All"](".ui-menu-item").first();
5851        }
5852      }
5853      if (!next || !next.length || !this.active) {
5854        next = this._menuItems(this.activeMenu)[filter]();
5855      }
5856
5857      this.focus(event, next);
5858    },
5859
5860    nextPage: function (event) {
5861      var item, base, height;
5862
5863      if (!this.active) {
5864        this.next(event);
5865        return;
5866      }
5867      if (this.isLastItem()) {
5868        return;
5869      }
5870      if (this._hasScroll()) {
5871        base = this.active.offset().top;
5872        height = this.element.innerHeight();
5873
5874        // jQuery 3.2 doesn't include scrollbars in innerHeight, add it back.
5875        if ($.fn.jquery.indexOf("3.2.") === 0) {
5876          height += this.element[0].offsetHeight - this.element.outerHeight();
5877        }
5878
5879        this.active.nextAll(".ui-menu-item").each(function () {
5880          item = $(this);
5881          return item.offset().top - base - height < 0;
5882        });
5883
5884        this.focus(event, item);
5885      } else {
5886        this.focus(
5887          event,
5888          this._menuItems(this.activeMenu)[!this.active ? "first" : "last"]()
5889        );
5890      }
5891    },
5892
5893    previousPage: function (event) {
5894      var item, base, height;
5895      if (!this.active) {
5896        this.next(event);
5897        return;
5898      }
5899      if (this.isFirstItem()) {
5900        return;
5901      }
5902      if (this._hasScroll()) {
5903        base = this.active.offset().top;
5904        height = this.element.innerHeight();
5905
5906        // jQuery 3.2 doesn't include scrollbars in innerHeight, add it back.
5907        if ($.fn.jquery.indexOf("3.2.") === 0) {
5908          height += this.element[0].offsetHeight - this.element.outerHeight();
5909        }
5910
5911        this.active.prevAll(".ui-menu-item").each(function () {
5912          item = $(this);
5913          return item.offset().top - base + height > 0;
5914        });
5915
5916        this.focus(event, item);
5917      } else {
5918        this.focus(event, this._menuItems(this.activeMenu).first());
5919      }
5920    },
5921
5922    _hasScroll: function () {
5923      return this.element.outerHeight() < this.element.prop("scrollHeight");
5924    },
5925
5926    select: function (event) {
5927      // TODO: It should never be possible to not have an active item at this
5928      // point, but the tests don't trigger mouseenter before click.
5929      this.active = this.active || $(event.target).closest(".ui-menu-item");
5930      var ui = { item: this.active };
5931      if (!this.active.has(".ui-menu").length) {
5932        this.collapseAll(event, true);
5933      }
5934      this._trigger("select", event, ui);
5935    },
5936
5937    _filterMenuItems: function (character) {
5938      var escapedCharacter = character.replace(
5939          /[\-\[\]{}()*+?.,\\\^$|#\s]/g,
5940          "\\$&"
5941        ),
5942        regex = new RegExp("^" + escapedCharacter, "i");
5943
5944      return (
5945        this.activeMenu
5946          .find(this.options.items)
5947
5948          // Only match on items, not dividers or other content (#10571)
5949          .filter(".ui-menu-item")
5950          .filter(function () {
5951            return regex.test(
5952              String.prototype.trim.call(
5953                $(this).children(".ui-menu-item-wrapper").text()
5954              )
5955            );
5956          })
5957      );
5958    },
5959  });
5960
5961  /*!
5962   * jQuery UI Autocomplete 1.13.2
5963   * http://jqueryui.com
5964   *
5965   * Copyright jQuery Foundation and other contributors
5966   * Released under the MIT license.
5967   * http://jquery.org/license
5968   */
5969
5970  //>>label: Autocomplete
5971  //>>group: Widgets
5972  //>>description: Lists suggested words as the user is typing.
5973  //>>docs: http://api.jqueryui.com/autocomplete/
5974  //>>demos: http://jqueryui.com/autocomplete/
5975  //>>css.structure: ../../themes/base/core.css
5976  //>>css.structure: ../../themes/base/autocomplete.css
5977  //>>css.theme: ../../themes/base/theme.css
5978
5979  $.widget("ui.autocomplete", {
5980    version: "1.13.2",
5981    defaultElement: "<input>",
5982    options: {
5983      appendTo: null,
5984      autoFocus: false,
5985      delay: 300,
5986      minLength: 1,
5987      position: {
5988        my: "left top",
5989        at: "left bottom",
5990        collision: "none",
5991      },
5992      source: null,
5993
5994      // Callbacks
5995      change: null,
5996      close: null,
5997      focus: null,
5998      open: null,
5999      response: null,
6000      search: null,
6001      select: null,
6002    },
6003
6004    requestIndex: 0,
6005    pending: 0,
6006    liveRegionTimer: null,
6007
6008    _create: function () {
6009      // Some browsers only repeat keydown events, not keypress events,
6010      // so we use the suppressKeyPress flag to determine if we've already
6011      // handled the keydown event. #7269
6012      // Unfortunately the code for & in keypress is the same as the up arrow,
6013      // so we use the suppressKeyPressRepeat flag to avoid handling keypress
6014      // events when we know the keydown event was used to modify the
6015      // search term. #7799
6016      var suppressKeyPress,
6017        suppressKeyPressRepeat,
6018        suppressInput,
6019        nodeName = this.element[0].nodeName.toLowerCase(),
6020        isTextarea = nodeName === "textarea",
6021        isInput = nodeName === "input";
6022
6023      // Textareas are always multi-line
6024      // Inputs are always single-line, even if inside a contentEditable element
6025      // IE also treats inputs as contentEditable
6026      // All other element types are determined by whether or not they're contentEditable
6027      this.isMultiLine =
6028        isTextarea || (!isInput && this._isContentEditable(this.element));
6029
6030      this.valueMethod = this.element[isTextarea || isInput ? "val" : "text"];
6031      this.isNewMenu = true;
6032
6033      this._addClass("ui-autocomplete-input");
6034      this.element.attr("autocomplete", "off");
6035
6036      this._on(this.element, {
6037        keydown: function (event) {
6038          if (this.element.prop("readOnly")) {
6039            suppressKeyPress = true;
6040            suppressInput = true;
6041            suppressKeyPressRepeat = true;
6042            return;
6043          }
6044
6045          suppressKeyPress = false;
6046          suppressInput = false;
6047          suppressKeyPressRepeat = false;
6048          var keyCode = $.ui.keyCode;
6049          switch (event.keyCode) {
6050            case keyCode.PAGE_UP:
6051              suppressKeyPress = true;
6052              this._move("previousPage", event);
6053              break;
6054            case keyCode.PAGE_DOWN:
6055              suppressKeyPress = true;
6056              this._move("nextPage", event);
6057              break;
6058            case keyCode.UP:
6059              suppressKeyPress = true;
6060              this._keyEvent("previous", event);
6061              break;
6062            case keyCode.DOWN:
6063              suppressKeyPress = true;
6064              this._keyEvent("next", event);
6065              break;
6066            case keyCode.ENTER:
6067              // when menu is open and has focus
6068              if (this.menu.active) {
6069                // #6055 - Opera still allows the keypress to occur
6070                // which causes forms to submit
6071                suppressKeyPress = true;
6072                event.preventDefault();
6073                this.menu.select(event);
6074              }
6075              break;
6076            case keyCode.TAB:
6077              if (this.menu.active) {
6078                this.menu.select(event);
6079              }
6080              break;
6081            case keyCode.ESCAPE:
6082              if (this.menu.element.is(":visible")) {
6083                if (!this.isMultiLine) {
6084                  this._value(this.term);
6085                }
6086                this.close(event);
6087
6088                // Different browsers have different default behavior for escape
6089                // Single press can mean undo or clear
6090                // Double press in IE means clear the whole form
6091                event.preventDefault();
6092              }
6093              break;
6094            default:
6095              suppressKeyPressRepeat = true;
6096
6097              // search timeout should be triggered before the input value is changed
6098              this._searchTimeout(event);
6099              break;
6100          }
6101        },
6102        keypress: function (event) {
6103          if (suppressKeyPress) {
6104            suppressKeyPress = false;
6105            if (!this.isMultiLine || this.menu.element.is(":visible")) {
6106              event.preventDefault();
6107            }
6108            return;
6109          }
6110          if (suppressKeyPressRepeat) {
6111            return;
6112          }
6113
6114          // Replicate some key handlers to allow them to repeat in Firefox and Opera
6115          var keyCode = $.ui.keyCode;
6116          switch (event.keyCode) {
6117            case keyCode.PAGE_UP:
6118              this._move("previousPage", event);
6119              break;
6120            case keyCode.PAGE_DOWN:
6121              this._move("nextPage", event);
6122              break;
6123            case keyCode.UP:
6124              this._keyEvent("previous", event);
6125              break;
6126            case keyCode.DOWN:
6127              this._keyEvent("next", event);
6128              break;
6129          }
6130        },
6131        input: function (event) {
6132          if (suppressInput) {
6133            suppressInput = false;
6134            event.preventDefault();
6135            return;
6136          }
6137          this._searchTimeout(event);
6138        },
6139        focus: function () {
6140          this.selectedItem = null;
vendor: 6,325 bytes, lines 6141-6335
6141          this.previous = this._value();
6142        },
6143        blur: function (event) {
6144          clearTimeout(this.searching);
6145          this.close(event);
6146          this._change(event);
6147        },
6148      });
6149
6150      this._initSource();
6151      this.menu = $("<ul>")
6152        .appendTo(this._appendTo())
6153        .menu({
6154          // disable ARIA support, the live region takes care of that
6155          role: null,
6156        })
6157        .hide()
6158
6159        // Support: IE 11 only, Edge <= 14
6160        // For other browsers, we preventDefault() on the mousedown event
6161        // to keep the dropdown from taking focus from the input. This doesn't
6162        // work for IE/Edge, causing problems with selection and scrolling (#9638)
6163        // Happily, IE and Edge support an "unselectable" attribute that
6164        // prevents an element from receiving focus, exactly what we want here.
6165        .attr({
6166          unselectable: "on",
6167        })
6168        .menu("instance");
6169
6170      this._addClass(this.menu.element, "ui-autocomplete", "ui-front");
6171      this._on(this.menu.element, {
6172        mousedown: function (event) {
6173          // Prevent moving focus out of the text field
6174          event.preventDefault();
6175        },
6176        menufocus: function (event, ui) {
6177          var label, item;
6178
6179          // support: Firefox
6180          // Prevent accidental activation of menu items in Firefox (#7024 #9118)
6181          if (this.isNewMenu) {
6182            this.isNewMenu = false;
6183            if (
6184              event.originalEvent &&
6185              /^mouse/.test(event.originalEvent.type)
6186            ) {
6187              this.menu.blur();
6188
6189              this.document.one("mousemove", function () {
6190                $(event.target).trigger(event.originalEvent);
6191              });
6192
6193              return;
6194            }
6195          }
6196
6197          item = ui.item.data("ui-autocomplete-item");
6198          if (false !== this._trigger("focus", event, { item: item })) {
6199            // use value to match what will end up in the input, if it was a key event
6200            if (event.originalEvent && /^key/.test(event.originalEvent.type)) {
6201              this._value(item.value);
6202            }
6203          }
6204
6205          // Announce the value in the liveRegion
6206          label = ui.item.attr("aria-label") || item.value;
6207          if (label && String.prototype.trim.call(label).length) {
6208            clearTimeout(this.liveRegionTimer);
6209            this.liveRegionTimer = this._delay(function () {
6210              this.liveRegion.html($("<div>").text(label));
6211            }, 100);
6212          }
6213        },
6214        menuselect: function (event, ui) {
6215          var item = ui.item.data("ui-autocomplete-item"),
6216            previous = this.previous;
6217
6218          // Only trigger when focus was lost (click on menu)
6219          if (this.element[0] !== $.ui.safeActiveElement(this.document[0])) {
6220            this.element.trigger("focus");
6221            this.previous = previous;
6222
6223            // #6109 - IE triggers two focus events and the second
6224            // is asynchronous, so we need to reset the previous
6225            // term synchronously and asynchronously :-(
6226            this._delay(function () {
6227              this.previous = previous;
6228              this.selectedItem = item;
6229            });
6230          }
6231
6232          if (false !== this._trigger("select", event, { item: item })) {
6233            this._value(item.value);
6234          }
6235
6236          // reset the term after the select event
6237          // this allows custom select handling to work properly
6238          this.term = this._value();
6239
6240          this.close(event);
6241          this.selectedItem = item;
6242        },
6243      });
6244
6245      this.liveRegion = $("<div>", {
6246        role: "status",
6247        "aria-live": "assertive",
6248        "aria-relevant": "additions",
6249      }).appendTo(this.document[0].body);
6250
6251      this._addClass(this.liveRegion, null, "ui-helper-hidden-accessible");
6252
6253      // Turning off autocomplete prevents the browser from remembering the
6254      // value when navigating through history, so we re-enable autocomplete
6255      // if the page is unloaded before the widget is destroyed. #7790
6256      this._on(this.window, {
6257        beforeunload: function () {
6258          this.element.removeAttr("autocomplete");
6259        },
6260      });
6261    },
6262
6263    _destroy: function () {
6264      clearTimeout(this.searching);
6265      this.element.removeAttr("autocomplete");
6266      this.menu.element.remove();
6267      this.liveRegion.remove();
6268    },
6269
6270    _setOption: function (key, value) {
6271      this._super(key, value);
6272      if (key === "source") {
6273        this._initSource();
6274      }
6275      if (key === "appendTo") {
6276        this.menu.element.appendTo(this._appendTo());
6277      }
6278      if (key === "disabled" && value && this.xhr) {
6279        this.xhr.abort();
6280      }
6281    },
6282
6283    _isEventTargetInWidget: function (event) {
6284      var menuElement = this.menu.element[0];
6285
6286      return (
6287        event.target === this.element[0] ||
6288        event.target === menuElement ||
6289        $.contains(menuElement, event.target)
6290      );
6291    },
6292
6293    _closeOnClickOutside: function (event) {
6294      if (!this._isEventTargetInWidget(event)) {
6295        this.close();
6296      }
6297    },
6298
6299    _appendTo: function () {
6300      var element = this.options.appendTo;
6301
6302      if (element) {
6303        element =
6304          element.jquery || element.nodeType
6305            ? $(element)
6306            : this.document.find(element).eq(0);
6307      }
6308
6309      if (!element || !element[0]) {
6310        element = this.element.closest(".ui-front, dialog");
6311      }
6312
6313      if (!element.length) {
6314        element = this.document[0].body;
6315      }
6316
6317      return element;
6318    },
6319
6320    _initSource: function () {
6321      var array,
6322        url,
6323        that = this;
6324      if (Array.isArray(this.options.source)) {
6325        array = this.options.source;
6326        this.source = function (request, response) {
6327          response($.ui.autocomplete.filter(array, request.term));
6328        };
6329      } else if (typeof this.options.source === "string") {
6330        url = this.options.source;
6331        this.source = function (request, response) {
6332          if (that.xhr) {
6333            that.xhr.abort();
6334          }
6335          that.xhr = $.ajax({
vendor: 6,035 bytes, lines 6336-6559
6336            url: url,
6337            data: request,
6338            dataType: "json",
6339            success: function (data) {
6340              response(data);
6341            },
6342            error: function () {
6343              response([]);
6344            },
6345          });
6346        };
6347      } else {
6348        this.source = this.options.source;
6349      }
6350    },
6351
6352    _searchTimeout: function (event) {
6353      clearTimeout(this.searching);
6354      this.searching = this._delay(function () {
6355        // Search if the value has changed, or if the user retypes the same value (see #7434)
6356        var equalValues = this.term === this._value(),
6357          menuVisible = this.menu.element.is(":visible"),
6358          modifierKey =
6359            event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
6360
6361        if (!equalValues || (equalValues && !menuVisible && !modifierKey)) {
6362          this.selectedItem = null;
6363          this.search(null, event);
6364        }
6365      }, this.options.delay);
6366    },
6367
6368    search: function (value, event) {
6369      value = value != null ? value : this._value();
6370
6371      // Always save the actual value, not the one passed as an argument
6372      this.term = this._value();
6373
6374      if (value.length < this.options.minLength) {
6375        return this.close(event);
6376      }
6377
6378      if (this._trigger("search", event) === false) {
6379        return;
6380      }
6381
6382      return this._search(value);
6383    },
6384
6385    _search: function (value) {
6386      this.pending++;
6387      this._addClass("ui-autocomplete-loading");
6388      this.cancelSearch = false;
6389
6390      this.source({ term: value }, this._response());
6391    },
6392
6393    _response: function () {
6394      var index = ++this.requestIndex;
6395
6396      return function (content) {
6397        if (index === this.requestIndex) {
6398          this.__response(content);
6399        }
6400
6401        this.pending--;
6402        if (!this.pending) {
6403          this._removeClass("ui-autocomplete-loading");
6404        }
6405      }.bind(this);
6406    },
6407
6408    __response: function (content) {
6409      if (content) {
6410        content = this._normalize(content);
6411      }
6412      this._trigger("response", null, { content: content });
6413      if (
6414        !this.options.disabled &&
6415        content &&
6416        content.length &&
6417        !this.cancelSearch
6418      ) {
6419        this._suggest(content);
6420        this._trigger("open");
6421      } else {
6422        // use ._close() instead of .close() so we don't cancel future searches
6423        this._close();
6424      }
6425    },
6426
6427    close: function (event) {
6428      this.cancelSearch = true;
6429      this._close(event);
6430    },
6431
6432    _close: function (event) {
6433      // Remove the handler that closes the menu on outside clicks
6434      this._off(this.document, "mousedown");
6435
6436      if (this.menu.element.is(":visible")) {
6437        this.menu.element.hide();
6438        this.menu.blur();
6439        this.isNewMenu = true;
6440        this._trigger("close", event);
6441      }
6442    },
6443
6444    _change: function (event) {
6445      if (this.previous !== this._value()) {
6446        this._trigger("change", event, { item: this.selectedItem });
6447      }
6448    },
6449
6450    _normalize: function (items) {
6451      // assume all items have the right format when the first item is complete
6452      if (items.length && items[0].label && items[0].value) {
6453        return items;
6454      }
6455      return $.map(items, function (item) {
6456        if (typeof item === "string") {
6457          return {
6458            label: item,
6459            value: item,
6460          };
6461        }
6462        return $.extend({}, item, {
6463          label: item.label || item.value,
6464          value: item.value || item.label,
6465        });
6466      });
6467    },
6468
6469    _suggest: function (items) {
6470      var ul = this.menu.element.empty();
6471      this._renderMenu(ul, items);
6472      this.isNewMenu = true;
6473      this.menu.refresh();
6474
6475      // Size and position menu
6476      ul.show();
6477      this._resizeMenu();
6478      ul.position(
6479        $.extend(
6480          {
6481            of: this.element,
6482          },
6483          this.options.position
6484        )
6485      );
6486
6487      if (this.options.autoFocus) {
6488        this.menu.next();
6489      }
6490
6491      // Listen for interactions outside of the widget (#6642)
6492      this._on(this.document, {
6493        mousedown: "_closeOnClickOutside",
6494      });
6495    },
6496
6497    _resizeMenu: function () {
6498      var ul = this.menu.element;
6499      ul.outerWidth(
6500        Math.max(
6501          // Firefox wraps long text (possibly a rounding bug)
6502          // so we add 1px to avoid the wrapping (#7513)
6503          ul.width("").outerWidth() + 1,
6504          this.element.outerWidth()
6505        )
6506      );
6507    },
6508
6509    _renderMenu: function (ul, items) {
6510      var that = this;
6511      $.each(items, function (index, item) {
6512        that._renderItemData(ul, item);
6513      });
6514    },
6515
6516    _renderItemData: function (ul, item) {
6517      return this._renderItem(ul, item).data("ui-autocomplete-item", item);
6518    },
6519
6520    _renderItem: function (ul, item) {
6521      return $("<li>").append($("<div>").text(item.label)).appendTo(ul);
6522    },
6523
6524    _move: function (direction, event) {
6525      if (!this.menu.element.is(":visible")) {
6526        this.search(null, event);
6527        return;
6528      }
6529      if (
6530        (this.menu.isFirstItem() && /^previous/.test(direction)) ||
6531        (this.menu.isLastItem() && /^next/.test(direction))
6532      ) {
6533        if (!this.isMultiLine) {
6534          this._value(this.term);
6535        }
6536
6537        this.menu.blur();
6538        return;
6539      }
6540      this.menu[direction](event);
6541    },
6542
6543    widget: function () {
6544      return this.menu.element;
6545    },
6546
6547    _value: function () {
6548      return this.valueMethod.apply(this.element, arguments);
6549    },
6550
6551    _keyEvent: function (keyEvent, event) {
6552      if (!this.isMultiLine || this.menu.element.is(":visible")) {
6553        this._move(keyEvent, event);
6554
6555        // Prevents moving cursor to beginning/end of the text field in some browsers
6556        event.preventDefault();
6557      }
6558    },
6559
vendor: 5,126 bytes, lines 6560-6727
6560    // Support: Chrome <=50
6561    // We should be able to just use this.element.prop( "isContentEditable" )
6562    // but hidden elements always report false in Chrome.
6563    // https://code.google.com/p/chromium/issues/detail?id=313082
6564    _isContentEditable: function (element) {
6565      if (!element.length) {
6566        return false;
6567      }
6568
6569      var editable = element.prop("contentEditable");
6570
6571      if (editable === "inherit") {
6572        return this._isContentEditable(element.parent());
6573      }
6574
6575      return editable === "true";
6576    },
6577  });
6578
6579  $.extend($.ui.autocomplete, {
6580    escapeRegex: function (value) {
6581      return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
6582    },
6583    filter: function (array, term) {
6584      var matcher = new RegExp($.ui.autocomplete.escapeRegex(term), "i");
6585      return $.grep(array, function (value) {
6586        return matcher.test(value.label || value.value || value);
6587      });
6588    },
6589  });
6590
6591  // Live region extension, adding a `messages` option
6592  // NOTE: This is an experimental API. We are still investigating
6593  // a full solution for string manipulation and internationalization.
6594  $.widget("ui.autocomplete", $.ui.autocomplete, {
6595    options: {
6596      messages: {
6597        noResults: "No search results.",
6598        results: function (amount) {
6599          return (
6600            amount +
6601            (amount > 1 ? " results are" : " result is") +
6602            " available, use up and down arrow keys to navigate."
6603          );
6604        },
6605      },
6606    },
6607
6608    __response: function (content) {
6609      var message;
6610      this._superApply(arguments);
6611      if (this.options.disabled || this.cancelSearch) {
6612        return;
6613      }
6614      if (content && content.length) {
6615        message = this.options.messages.results(content.length);
6616      } else {
6617        message = this.options.messages.noResults;
6618      }
6619      clearTimeout(this.liveRegionTimer);
6620      this.liveRegionTimer = this._delay(function () {
6621        this.liveRegion.html($("<div>").text(message));
6622      }, 100);
6623    },
6624  });
6625
6626  var widgetsAutocomplete = $.ui.autocomplete;
6627
6628  /*!
6629   * jQuery UI Controlgroup 1.13.2
6630   * http://jqueryui.com
6631   *
6632   * Copyright jQuery Foundation and other contributors
6633   * Released under the MIT license.
6634   * http://jquery.org/license
6635   */
6636
6637  //>>label: Controlgroup
6638  //>>group: Widgets
6639  //>>description: Visually groups form control widgets
6640  //>>docs: http://api.jqueryui.com/controlgroup/
6641  //>>demos: http://jqueryui.com/controlgroup/
6642  //>>css.structure: ../../themes/base/core.css
6643  //>>css.structure: ../../themes/base/controlgroup.css
6644  //>>css.theme: ../../themes/base/theme.css
6645
6646  var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
6647
6648  var widgetsControlgroup = $.widget("ui.controlgroup", {
6649    version: "1.13.2",
6650    defaultElement: "<div>",
6651    options: {
6652      direction: "horizontal",
6653      disabled: null,
6654      onlyVisible: true,
6655      items: {
6656        button:
6657          "input[type=button], input[type=submit], input[type=reset], button, a",
6658        controlgroupLabel: ".ui-controlgroup-label",
6659        checkboxradio: "input[type='checkbox'], input[type='radio']",
6660        selectmenu: "select",
6661        spinner: ".ui-spinner-input",
6662      },
6663    },
6664
6665    _create: function () {
6666      this._enhance();
6667    },
6668
6669    // To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
6670    _enhance: function () {
6671      this.element.attr("role", "toolbar");
6672      this.refresh();
6673    },
6674
6675    _destroy: function () {
6676      this._callChildMethod("destroy");
6677      this.childWidgets.removeData("ui-controlgroup-data");
6678      this.element.removeAttr("role");
6679      if (this.options.items.controlgroupLabel) {
6680        this.element
6681          .find(this.options.items.controlgroupLabel)
6682          .find(".ui-controlgroup-label-contents")
6683          .contents()
6684          .unwrap();
6685      }
6686    },
6687
6688    _initWidgets: function () {
6689      var that = this,
6690        childWidgets = [];
6691
6692      // First we iterate over each of the items options
6693      $.each(this.options.items, function (widget, selector) {
6694        var labels;
6695        var options = {};
6696
6697        // Make sure the widget has a selector set
6698        if (!selector) {
6699          return;
6700        }
6701
6702        if (widget === "controlgroupLabel") {
6703          labels = that.element.find(selector);
6704          labels.each(function () {
6705            var element = $(this);
6706
6707            if (element.children(".ui-controlgroup-label-contents").length) {
6708              return;
6709            }
6710            element
6711              .contents()
6712              .wrapAll("<span class='ui-controlgroup-label-contents'></span>");
6713          });
6714          that._addClass(
6715            labels,
6716            null,
6717            "ui-widget ui-widget-content ui-state-default"
6718          );
6719          childWidgets = childWidgets.concat(labels.get());
6720          return;
6721        }
6722
6723        // Make sure the widget actually exists
6724        if (!$.fn[widget]) {
6725          return;
6726        }
6727
vendor: 9,929 bytes, lines 6728-7026
6728        // We assume everything is in the middle to start because we can't determine
6729        // first / last elements until all enhancments are done.
6730        if (that["_" + widget + "Options"]) {
6731          options = that["_" + widget + "Options"]("middle");
6732        } else {
6733          options = { classes: {} };
6734        }
6735
6736        // Find instances of this widget inside controlgroup and init them
6737        that.element.find(selector).each(function () {
6738          var element = $(this);
6739          var instance = element[widget]("instance");
6740
6741          // We need to clone the default options for this type of widget to avoid
6742          // polluting the variable options which has a wider scope than a single widget.
6743          var instanceOptions = $.widget.extend({}, options);
6744
6745          // If the button is the child of a spinner ignore it
6746          // TODO: Find a more generic solution
6747          if (widget === "button" && element.parent(".ui-spinner").length) {
6748            return;
6749          }
6750
6751          // Create the widget if it doesn't exist
6752          if (!instance) {
6753            instance = element[widget]()[widget]("instance");
6754          }
6755          if (instance) {
6756            instanceOptions.classes = that._resolveClassesValues(
6757              instanceOptions.classes,
6758              instance
6759            );
6760          }
6761          element[widget](instanceOptions);
6762
6763          // Store an instance of the controlgroup to be able to reference
6764          // from the outermost element for changing options and refresh
6765          var widgetElement = element[widget]("widget");
6766          $.data(
6767            widgetElement[0],
6768            "ui-controlgroup-data",
6769            instance ? instance : element[widget]("instance")
6770          );
6771
6772          childWidgets.push(widgetElement[0]);
6773        });
6774      });
6775
6776      this.childWidgets = $($.uniqueSort(childWidgets));
6777      this._addClass(this.childWidgets, "ui-controlgroup-item");
6778    },
6779
6780    _callChildMethod: function (method) {
6781      this.childWidgets.each(function () {
6782        var element = $(this),
6783          data = element.data("ui-controlgroup-data");
6784        if (data && data[method]) {
6785          data[method]();
6786        }
6787      });
6788    },
6789
6790    _updateCornerClass: function (element, position) {
6791      var remove =
6792        "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
6793      var add = this._buildSimpleOptions(position, "label").classes.label;
6794
6795      this._removeClass(element, null, remove);
6796      this._addClass(element, null, add);
6797    },
6798
6799    _buildSimpleOptions: function (position, key) {
6800      var direction = this.options.direction === "vertical";
6801      var result = {
6802        classes: {},
6803      };
6804      result.classes[key] = {
6805        middle: "",
6806        first: "ui-corner-" + (direction ? "top" : "left"),
6807        last: "ui-corner-" + (direction ? "bottom" : "right"),
6808        only: "ui-corner-all",
6809      }[position];
6810
6811      return result;
6812    },
6813
6814    _spinnerOptions: function (position) {
6815      var options = this._buildSimpleOptions(position, "ui-spinner");
6816
6817      options.classes["ui-spinner-up"] = "";
6818      options.classes["ui-spinner-down"] = "";
6819
6820      return options;
6821    },
6822
6823    _buttonOptions: function (position) {
6824      return this._buildSimpleOptions(position, "ui-button");
6825    },
6826
6827    _checkboxradioOptions: function (position) {
6828      return this._buildSimpleOptions(position, "ui-checkboxradio-label");
6829    },
6830
6831    _selectmenuOptions: function (position) {
6832      var direction = this.options.direction === "vertical";
6833      return {
6834        width: direction ? "auto" : false,
6835        classes: {
6836          middle: {
6837            "ui-selectmenu-button-open": "",
6838            "ui-selectmenu-button-closed": "",
6839          },
6840          first: {
6841            "ui-selectmenu-button-open":
6842              "ui-corner-" + (direction ? "top" : "tl"),
6843            "ui-selectmenu-button-closed":
6844              "ui-corner-" + (direction ? "top" : "left"),
6845          },
6846          last: {
6847            "ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
6848            "ui-selectmenu-button-closed":
6849              "ui-corner-" + (direction ? "bottom" : "right"),
6850          },
6851          only: {
6852            "ui-selectmenu-button-open": "ui-corner-top",
6853            "ui-selectmenu-button-closed": "ui-corner-all",
6854          },
6855        }[position],
6856      };
6857    },
6858
6859    _resolveClassesValues: function (classes, instance) {
6860      var result = {};
6861      $.each(classes, function (key) {
6862        var current = instance.options.classes[key] || "";
6863        current = String.prototype.trim.call(
6864          current.replace(controlgroupCornerRegex, "")
6865        );
6866        result[key] = (current + " " + classes[key]).replace(/\s+/g, " ");
6867      });
6868      return result;
6869    },
6870
6871    _setOption: function (key, value) {
6872      if (key === "direction") {
6873        this._removeClass("ui-controlgroup-" + this.options.direction);
6874      }
6875
6876      this._super(key, value);
6877      if (key === "disabled") {
6878        this._callChildMethod(value ? "disable" : "enable");
6879        return;
6880      }
6881
6882      this.refresh();
6883    },
6884
6885    refresh: function () {
6886      var children,
6887        that = this;
6888
6889      this._addClass(
6890        "ui-controlgroup ui-controlgroup-" + this.options.direction
6891      );
6892
6893      if (this.options.direction === "horizontal") {
6894        this._addClass(null, "ui-helper-clearfix");
6895      }
6896      this._initWidgets();
6897
6898      children = this.childWidgets;
6899
6900      // We filter here because we need to track all childWidgets not just the visible ones
6901      if (this.options.onlyVisible) {
6902        children = children.filter(":visible");
6903      }
6904
6905      if (children.length) {
6906        // We do this last because we need to make sure all enhancment is done
6907        // before determining first and last
6908        $.each(["first", "last"], function (index, value) {
6909          var instance = children[value]().data("ui-controlgroup-data");
6910
6911          if (instance && that["_" + instance.widgetName + "Options"]) {
6912            var options = that["_" + instance.widgetName + "Options"](
6913              children.length === 1 ? "only" : value
6914            );
6915            options.classes = that._resolveClassesValues(
6916              options.classes,
6917              instance
6918            );
6919            instance.element[instance.widgetName](options);
6920          } else {
6921            that._updateCornerClass(children[value](), value);
6922          }
6923        });
6924
6925        // Finally call the refresh method on each of the child widgets.
6926        this._callChildMethod("refresh");
6927      }
6928    },
6929  });
6930
6931  /*!
6932   * jQuery UI Checkboxradio 1.13.2
6933   * http://jqueryui.com
6934   *
6935   * Copyright jQuery Foundation and other contributors
6936   * Released under the MIT license.
6937   * http://jquery.org/license
6938   */
6939
6940  //>>label: Checkboxradio
6941  //>>group: Widgets
6942  //>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
6943  //>>docs: http://api.jqueryui.com/checkboxradio/
6944  //>>demos: http://jqueryui.com/checkboxradio/
6945  //>>css.structure: ../../themes/base/core.css
6946  //>>css.structure: ../../themes/base/button.css
6947  //>>css.structure: ../../themes/base/checkboxradio.css
6948  //>>css.theme: ../../themes/base/theme.css
6949
6950  $.widget("ui.checkboxradio", [
6951    $.ui.formResetMixin,
6952    {
6953      version: "1.13.2",
6954      options: {
6955        disabled: null,
6956        label: null,
6957        icon: true,
6958        classes: {
6959          "ui-checkboxradio-label": "ui-corner-all",
6960          "ui-checkboxradio-icon": "ui-corner-all",
6961        },
6962      },
6963
6964      _getCreateOptions: function () {
6965        var disabled, labels, labelContents;
6966        var options = this._super() || {};
6967
6968        // We read the type here, because it makes more sense to throw a element type error first,
6969        // rather then the error for lack of a label. Often if its the wrong type, it
6970        // won't have a label (e.g. calling on a div, btn, etc)
6971        this._readType();
6972
6973        labels = this.element.labels();
6974
6975        // If there are multiple labels, use the last one
6976        this.label = $(labels[labels.length - 1]);
6977        if (!this.label.length) {
6978          $.error("No label found for checkboxradio widget");
6979        }
6980
6981        this.originalLabel = "";
6982
6983        // We need to get the label text but this may also need to make sure it does not contain the
6984        // input itself.
6985        // The label contents could be text, html, or a mix. We wrap all elements
6986        // and read the wrapper's `innerHTML` to get a string representation of
6987        // the label, without the input as part of it.
6988        labelContents = this.label.contents().not(this.element[0]);
6989
6990        if (labelContents.length) {
6991          this.originalLabel += labelContents
6992            .clone()
6993            .wrapAll("<div></div>")
6994            .parent()
6995            .html();
6996        }
6997
6998        // Set the label option if we found label text
6999        if (this.originalLabel) {
7000          options.label = this.originalLabel;
7001        }
7002
7003        disabled = this.element[0].disabled;
7004        if (disabled != null) {
7005          options.disabled = disabled;
7006        }
7007        return options;
7008      },
7009
7010      _create: function () {
7011        var checked = this.element[0].checked;
7012
7013        this._bindFormResetHandler();
7014
7015        if (this.options.disabled == null) {
7016          this.options.disabled = this.element[0].disabled;
7017        }
7018
7019        this._setOption("disabled", this.options.disabled);
7020        this._addClass("ui-checkboxradio", "ui-helper-hidden-accessible");
7021        this._addClass(
7022          this.label,
7023          "ui-checkboxradio-label",
7024          "ui-button ui-widget"
7025        );
7026
vendor: 4,055 bytes, lines 7027-7171
7027        if (this.type === "radio") {
7028          this._addClass(this.label, "ui-checkboxradio-radio-label");
7029        }
7030
7031        if (this.options.label && this.options.label !== this.originalLabel) {
7032          this._updateLabel();
7033        } else if (this.originalLabel) {
7034          this.options.label = this.originalLabel;
7035        }
7036
7037        this._enhance();
7038
7039        if (checked) {
7040          this._addClass(
7041            this.label,
7042            "ui-checkboxradio-checked",
7043            "ui-state-active"
7044          );
7045        }
7046
7047        this._on({
7048          change: "_toggleClasses",
7049          focus: function () {
7050            this._addClass(this.label, null, "ui-state-focus ui-visual-focus");
7051          },
7052          blur: function () {
7053            this._removeClass(
7054              this.label,
7055              null,
7056              "ui-state-focus ui-visual-focus"
7057            );
7058          },
7059        });
7060      },
7061
7062      _readType: function () {
7063        var nodeName = this.element[0].nodeName.toLowerCase();
7064        this.type = this.element[0].type;
7065        if (nodeName !== "input" || !/radio|checkbox/.test(this.type)) {
7066          $.error(
7067            "Can't create checkboxradio on element.nodeName=" +
7068              nodeName +
7069              " and element.type=" +
7070              this.type
7071          );
7072        }
7073      },
7074
7075      // Support jQuery Mobile enhanced option
7076      _enhance: function () {
7077        this._updateIcon(this.element[0].checked);
7078      },
7079
7080      widget: function () {
7081        return this.label;
7082      },
7083
7084      _getRadioGroup: function () {
7085        var group;
7086        var name = this.element[0].name;
7087        var nameSelector = "input[name='" + $.escapeSelector(name) + "']";
7088
7089        if (!name) {
7090          return $([]);
7091        }
7092
7093        if (this.form.length) {
7094          group = $(this.form[0].elements).filter(nameSelector);
7095        } else {
7096          // Not inside a form, check all inputs that also are not inside a form
7097          group = $(nameSelector).filter(function () {
7098            return $(this)._form().length === 0;
7099          });
7100        }
7101
7102        return group.not(this.element);
7103      },
7104
7105      _toggleClasses: function () {
7106        var checked = this.element[0].checked;
7107        this._toggleClass(
7108          this.label,
7109          "ui-checkboxradio-checked",
7110          "ui-state-active",
7111          checked
7112        );
7113
7114        if (this.options.icon && this.type === "checkbox") {
7115          this._toggleClass(
7116            this.icon,
7117            null,
7118            "ui-icon-check ui-state-checked",
7119            checked
7120          )._toggleClass(this.icon, null, "ui-icon-blank", !checked);
7121        }
7122
7123        if (this.type === "radio") {
7124          this._getRadioGroup().each(function () {
7125            var instance = $(this).checkboxradio("instance");
7126
7127            if (instance) {
7128              instance._removeClass(
7129                instance.label,
7130                "ui-checkboxradio-checked",
7131                "ui-state-active"
7132              );
7133            }
7134          });
7135        }
7136      },
7137
7138      _destroy: function () {
7139        this._unbindFormResetHandler();
7140
7141        if (this.icon) {
7142          this.icon.remove();
7143          this.iconSpace.remove();
7144        }
7145      },
7146
7147      _setOption: function (key, value) {
7148        // We don't allow the value to be set to nothing
7149        if (key === "label" && !value) {
7150          return;
7151        }
7152
7153        this._super(key, value);
7154
7155        if (key === "disabled") {
7156          this._toggleClass(this.label, null, "ui-state-disabled", value);
7157          this.element[0].disabled = value;
7158
7159          // Don't refresh when setting disabled
7160          return;
7161        }
7162        this.refresh();
7163      },
7164
7165      _updateIcon: function (checked) {
7166        var toAdd = "ui-icon ui-icon-background ";
7167
7168        if (this.options.icon) {
7169          if (!this.icon) {
7170            this.icon = $("<span>");
7171            this.iconSpace = $("<span> </span>");
vendor: 6,948 bytes, lines 7172-7398
7172            this._addClass(this.iconSpace, "ui-checkboxradio-icon-space");
7173          }
7174
7175          if (this.type === "checkbox") {
7176            toAdd += checked
7177              ? "ui-icon-check ui-state-checked"
7178              : "ui-icon-blank";
7179            this._removeClass(
7180              this.icon,
7181              null,
7182              checked ? "ui-icon-blank" : "ui-icon-check"
7183            );
7184          } else {
7185            toAdd += "ui-icon-blank";
7186          }
7187          this._addClass(this.icon, "ui-checkboxradio-icon", toAdd);
7188          if (!checked) {
7189            this._removeClass(
7190              this.icon,
7191              null,
7192              "ui-icon-check ui-state-checked"
7193            );
7194          }
7195          this.icon.prependTo(this.label).after(this.iconSpace);
7196        } else if (this.icon !== undefined) {
7197          this.icon.remove();
7198          this.iconSpace.remove();
7199          delete this.icon;
7200        }
7201      },
7202
7203      _updateLabel: function () {
7204        // Remove the contents of the label ( minus the icon, icon space, and input )
7205        var contents = this.label.contents().not(this.element[0]);
7206        if (this.icon) {
7207          contents = contents.not(this.icon[0]);
7208        }
7209        if (this.iconSpace) {
7210          contents = contents.not(this.iconSpace[0]);
7211        }
7212        contents.remove();
7213
7214        this.label.append(this.options.label);
7215      },
7216
7217      refresh: function () {
7218        var checked = this.element[0].checked,
7219          isDisabled = this.element[0].disabled;
7220
7221        this._updateIcon(checked);
7222        this._toggleClass(
7223          this.label,
7224          "ui-checkboxradio-checked",
7225          "ui-state-active",
7226          checked
7227        );
7228        if (this.options.label !== null) {
7229          this._updateLabel();
7230        }
7231
7232        if (isDisabled !== this.options.disabled) {
7233          this._setOptions({ disabled: isDisabled });
7234        }
7235      },
7236    },
7237  ]);
7238
7239  var widgetsCheckboxradio = $.ui.checkboxradio;
7240
7241  /*!
7242   * jQuery UI Button 1.13.2
7243   * http://jqueryui.com
7244   *
7245   * Copyright jQuery Foundation and other contributors
7246   * Released under the MIT license.
7247   * http://jquery.org/license
7248   */
7249
7250  //>>label: Button
7251  //>>group: Widgets
7252  //>>description: Enhances a form with themeable buttons.
7253  //>>docs: http://api.jqueryui.com/button/
7254  //>>demos: http://jqueryui.com/button/
7255  //>>css.structure: ../../themes/base/core.css
7256  //>>css.structure: ../../themes/base/button.css
7257  //>>css.theme: ../../themes/base/theme.css
7258
7259  $.widget("ui.button", {
7260    version: "1.13.2",
7261    defaultElement: "<button>",
7262    options: {
7263      classes: {
7264        "ui-button": "ui-corner-all",
7265      },
7266      disabled: null,
7267      icon: null,
7268      iconPosition: "beginning",
7269      label: null,
7270      showLabel: true,
7271    },
7272
7273    _getCreateOptions: function () {
7274      var disabled,
7275        // This is to support cases like in jQuery Mobile where the base widget does have
7276        // an implementation of _getCreateOptions
7277        options = this._super() || {};
7278
7279      this.isInput = this.element.is("input");
7280
7281      disabled = this.element[0].disabled;
7282      if (disabled != null) {
7283        options.disabled = disabled;
7284      }
7285
7286      this.originalLabel = this.isInput
7287        ? this.element.val()
7288        : this.element.html();
7289      if (this.originalLabel) {
7290        options.label = this.originalLabel;
7291      }
7292
7293      return options;
7294    },
7295
7296    _create: function () {
7297      if (!this.option.showLabel & !this.options.icon) {
7298        this.options.showLabel = true;
7299      }
7300
7301      // We have to check the option again here even though we did in _getCreateOptions,
7302      // because null may have been passed on init which would override what was set in
7303      // _getCreateOptions
7304      if (this.options.disabled == null) {
7305        this.options.disabled = this.element[0].disabled || false;
7306      }
7307
7308      this.hasTitle = !!this.element.attr("title");
7309
7310      // Check to see if the label needs to be set or if its already correct
7311      if (this.options.label && this.options.label !== this.originalLabel) {
7312        if (this.isInput) {
7313          this.element.val(this.options.label);
7314        } else {
7315          this.element.html(this.options.label);
7316        }
7317      }
7318      this._addClass("ui-button", "ui-widget");
7319      this._setOption("disabled", this.options.disabled);
7320      this._enhance();
7321
7322      if (this.element.is("a")) {
7323        this._on({
7324          keyup: function (event) {
7325            if (event.keyCode === $.ui.keyCode.SPACE) {
7326              event.preventDefault();
7327
7328              // Support: PhantomJS <= 1.9, IE 8 Only
7329              // If a native click is available use it so we actually cause navigation
7330              // otherwise just trigger a click event
7331              if (this.element[0].click) {
7332                this.element[0].click();
7333              } else {
7334                this.element.trigger("click");
7335              }
7336            }
7337          },
7338        });
7339      }
7340    },
7341
7342    _enhance: function () {
7343      if (!this.element.is("button")) {
7344        this.element.attr("role", "button");
7345      }
7346
7347      if (this.options.icon) {
7348        this._updateIcon("icon", this.options.icon);
7349        this._updateTooltip();
7350      }
7351    },
7352
7353    _updateTooltip: function () {
7354      this.title = this.element.attr("title");
7355
7356      if (!this.options.showLabel && !this.title) {
7357        this.element.attr("title", this.options.label);
7358      }
7359    },
7360
7361    _updateIcon: function (option, value) {
7362      var icon = option !== "iconPosition",
7363        position = icon ? this.options.iconPosition : value,
7364        displayBlock = position === "top" || position === "bottom";
7365
7366      // Create icon
7367      if (!this.icon) {
7368        this.icon = $("<span>");
7369
7370        this._addClass(this.icon, "ui-button-icon", "ui-icon");
7371
7372        if (!this.options.showLabel) {
7373          this._addClass("ui-button-icon-only");
7374        }
7375      } else if (icon) {
7376        // If we are updating the icon remove the old icon class
7377        this._removeClass(this.icon, null, this.options.icon);
7378      }
7379
7380      // If we are updating the icon add the new icon class
7381      if (icon) {
7382        this._addClass(this.icon, null, value);
7383      }
7384
7385      this._attachIcon(position);
7386
7387      // If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove
7388      // the iconSpace if there is one.
7389      if (displayBlock) {
7390        this._addClass(this.icon, null, "ui-widget-icon-block");
7391        if (this.iconSpace) {
7392          this.iconSpace.remove();
7393        }
7394      } else {
7395        // Position is beginning or end so remove the ui-widget-icon-block class and add the
7396        // space if it does not exist
7397        if (!this.iconSpace) {
7398          this.iconSpace = $("<span> </span>");
vendor: 4,862 bytes, lines 7399-7564
7399          this._addClass(this.iconSpace, "ui-button-icon-space");
7400        }
7401        this._removeClass(this.icon, null, "ui-wiget-icon-block");
7402        this._attachIconSpace(position);
7403      }
7404    },
7405
7406    _destroy: function () {
7407      this.element.removeAttr("role");
7408
7409      if (this.icon) {
7410        this.icon.remove();
7411      }
7412      if (this.iconSpace) {
7413        this.iconSpace.remove();
7414      }
7415      if (!this.hasTitle) {
7416        this.element.removeAttr("title");
7417      }
7418    },
7419
7420    _attachIconSpace: function (iconPosition) {
7421      this.icon[/^(?:end|bottom)/.test(iconPosition) ? "before" : "after"](
7422        this.iconSpace
7423      );
7424    },
7425
7426    _attachIcon: function (iconPosition) {
7427      this.element[/^(?:end|bottom)/.test(iconPosition) ? "append" : "prepend"](
7428        this.icon
7429      );
7430    },
7431
7432    _setOptions: function (options) {
7433      var newShowLabel =
7434          options.showLabel === undefined
7435            ? this.options.showLabel
7436            : options.showLabel,
7437        newIcon = options.icon === undefined ? this.options.icon : options.icon;
7438
7439      if (!newShowLabel && !newIcon) {
7440        options.showLabel = true;
7441      }
7442      this._super(options);
7443    },
7444
7445    _setOption: function (key, value) {
7446      if (key === "icon") {
7447        if (value) {
7448          this._updateIcon(key, value);
7449        } else if (this.icon) {
7450          this.icon.remove();
7451          if (this.iconSpace) {
7452            this.iconSpace.remove();
7453          }
7454        }
7455      }
7456
7457      if (key === "iconPosition") {
7458        this._updateIcon(key, value);
7459      }
7460
7461      // Make sure we can't end up with a button that has neither text nor icon
7462      if (key === "showLabel") {
7463        this._toggleClass("ui-button-icon-only", null, !value);
7464        this._updateTooltip();
7465      }
7466
7467      if (key === "label") {
7468        if (this.isInput) {
7469          this.element.val(value);
7470        } else {
7471          // If there is an icon, append it, else nothing then append the value
7472          // this avoids removal of the icon when setting label text
7473          this.element.html(value);
7474          if (this.icon) {
7475            this._attachIcon(this.options.iconPosition);
7476            this._attachIconSpace(this.options.iconPosition);
7477          }
7478        }
7479      }
7480
7481      this._super(key, value);
7482
7483      if (key === "disabled") {
7484        this._toggleClass(null, "ui-state-disabled", value);
7485        this.element[0].disabled = value;
7486        if (value) {
7487          this.element.trigger("blur");
7488        }
7489      }
7490    },
7491
7492    refresh: function () {
7493      // Make sure to only check disabled if its an element that supports this otherwise
7494      // check for the disabled class to determine state
7495      var isDisabled = this.element.is("input, button")
7496        ? this.element[0].disabled
7497        : this.element.hasClass("ui-button-disabled");
7498
7499      if (isDisabled !== this.options.disabled) {
7500        this._setOptions({ disabled: isDisabled });
7501      }
7502
7503      this._updateTooltip();
7504    },
7505  });
7506
7507  // DEPRECATED
7508  if ($.uiBackCompat !== false) {
7509    // Text and Icons options
7510    $.widget("ui.button", $.ui.button, {
7511      options: {
7512        text: true,
7513        icons: {
7514          primary: null,
7515          secondary: null,
7516        },
7517      },
7518
7519      _create: function () {
7520        if (this.options.showLabel && !this.options.text) {
7521          this.options.showLabel = this.options.text;
7522        }
7523        if (!this.options.showLabel && this.options.text) {
7524          this.options.text = this.options.showLabel;
7525        }
7526        if (
7527          !this.options.icon &&
7528          (this.options.icons.primary || this.options.icons.secondary)
7529        ) {
7530          if (this.options.icons.primary) {
7531            this.options.icon = this.options.icons.primary;
7532          } else {
7533            this.options.icon = this.options.icons.secondary;
7534            this.options.iconPosition = "end";
7535          }
7536        } else if (this.options.icon) {
7537          this.options.icons.primary = this.options.icon;
7538        }
7539        this._super();
7540      },
7541
7542      _setOption: function (key, value) {
7543        if (key === "text") {
7544          this._super("showLabel", value);
7545          return;
7546        }
7547        if (key === "showLabel") {
7548          this.options.text = value;
7549        }
7550        if (key === "icon") {
7551          this.options.icons.primary = value;
7552        }
7553        if (key === "icons") {
7554          if (value.primary) {
7555            this._super("icon", value.primary);
7556            this._super("iconPosition", "beginning");
7557          } else if (value.secondary) {
7558            this._super("icon", value.secondary);
7559            this._super("iconPosition", "end");
7560          }
7561        }
7562        this._superApply(arguments);
7563      },
7564    });
vendor: 5,587 bytes, lines 7565-7738
7565
7566    $.fn.button = (function (orig) {
7567      return function (options) {
7568        var isMethodCall = typeof options === "string";
7569        var args = Array.prototype.slice.call(arguments, 1);
7570        var returnValue = this;
7571
7572        if (isMethodCall) {
7573          // If this is an empty collection, we need to have the instance method
7574          // return undefined instead of the jQuery instance
7575          if (!this.length && options === "instance") {
7576            returnValue = undefined;
7577          } else {
7578            this.each(function () {
7579              var methodValue;
7580              var type = $(this).attr("type");
7581              var name =
7582                type !== "checkbox" && type !== "radio"
7583                  ? "button"
7584                  : "checkboxradio";
7585              var instance = $.data(this, "ui-" + name);
7586
7587              if (options === "instance") {
7588                returnValue = instance;
7589                return false;
7590              }
7591
7592              if (!instance) {
7593                return $.error(
7594                  "cannot call methods on button" +
7595                    " prior to initialization; " +
7596                    "attempted to call method '" +
7597                    options +
7598                    "'"
7599                );
7600              }
7601
7602              if (
7603                typeof instance[options] !== "function" ||
7604                options.charAt(0) === "_"
7605              ) {
7606                return $.error(
7607                  "no such method '" +
7608                    options +
7609                    "' for button" +
7610                    " widget instance"
7611                );
7612              }
7613
7614              methodValue = instance[options].apply(instance, args);
7615
7616              if (methodValue !== instance && methodValue !== undefined) {
7617                returnValue =
7618                  methodValue && methodValue.jquery
7619                    ? returnValue.pushStack(methodValue.get())
7620                    : methodValue;
7621                return false;
7622              }
7623            });
7624          }
7625        } else {
7626          // Allow multiple hashes to be passed on init
7627          if (args.length) {
7628            options = $.widget.extend.apply(null, [options].concat(args));
7629          }
7630
7631          this.each(function () {
7632            var type = $(this).attr("type");
7633            var name =
7634              type !== "checkbox" && type !== "radio"
7635                ? "button"
7636                : "checkboxradio";
7637            var instance = $.data(this, "ui-" + name);
7638
7639            if (instance) {
7640              instance.option(options || {});
7641              if (instance._init) {
7642                instance._init();
7643              }
7644            } else {
7645              if (name === "button") {
7646                orig.call($(this), options);
7647                return;
7648              }
7649
7650              $(this).checkboxradio($.extend({ icon: false }, options));
7651            }
7652          });
7653        }
7654
7655        return returnValue;
7656      };
7657    })($.fn.button);
7658
7659    $.fn.buttonset = function () {
7660      if (!$.ui.controlgroup) {
7661        $.error("Controlgroup widget missing");
7662      }
7663      if (
7664        arguments[0] === "option" &&
7665        arguments[1] === "items" &&
7666        arguments[2]
7667      ) {
7668        return this.controlgroup.apply(this, [
7669          arguments[0],
7670          "items.button",
7671          arguments[2],
7672        ]);
7673      }
7674      if (arguments[0] === "option" && arguments[1] === "items") {
7675        return this.controlgroup.apply(this, [arguments[0], "items.button"]);
7676      }
7677      if (typeof arguments[0] === "object" && arguments[0].items) {
7678        arguments[0].items = {
7679          button: arguments[0].items,
7680        };
7681      }
7682      return this.controlgroup.apply(this, arguments);
7683    };
7684  }
7685
7686  var widgetsButton = $.ui.button;
7687
7688  /* eslint-disable max-len, camelcase */
7689  /*!
7690   * jQuery UI Datepicker 1.13.2
7691   * http://jqueryui.com
7692   *
7693   * Copyright jQuery Foundation and other contributors
7694   * Released under the MIT license.
7695   * http://jquery.org/license
7696   */
7697
7698  //>>label: Datepicker
7699  //>>group: Widgets
7700  //>>description: Displays a calendar from an input or inline for selecting dates.
7701  //>>docs: http://api.jqueryui.com/datepicker/
7702  //>>demos: http://jqueryui.com/datepicker/
7703  //>>css.structure: ../../themes/base/core.css
7704  //>>css.structure: ../../themes/base/datepicker.css
7705  //>>css.theme: ../../themes/base/theme.css
7706
7707  $.extend($.ui, { datepicker: { version: "1.13.2" } });
7708
7709  var datepicker_instActive;
7710
7711  function datepicker_getZindex(elem) {
7712    var position, value;
7713    while (elem.length && elem[0] !== document) {
7714      // Ignore z-index if position is set to a value where z-index is ignored by the browser
7715      // This makes behavior of this function consistent across browsers
7716      // WebKit always returns auto if the element is positioned
7717      position = elem.css("position");
7718      if (
7719        position === "absolute" ||
7720        position === "relative" ||
7721        position === "fixed"
7722      ) {
7723        // IE returns 0 when zIndex is not specified
7724        // other browsers return a string
7725        // we ignore the case of nested elements with an explicit value of 0
7726        // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
7727        value = parseInt(elem.css("zIndex"), 10);
7728        if (!isNaN(value) && value !== 0) {
7729          return value;
7730        }
7731      }
7732      elem = elem.parent();
7733    }
7734
7735    return 0;
7736  }
7737
7738  /* Date picker manager.
7739   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
7740   Settings for (groups of) date pickers are maintained in an instance object,
7741   allowing multiple different settings on the same page. */
7742
7743  function Datepicker() {
7744    this._curInst = null; // The current instance in use
7745    this._keyEvent = false; // If the last event was a key event
7746    this._disabledInputs = []; // List of date picker inputs that have been disabled
7747    this._datepickerShowing = false; // True if the popup picker is showing , false if not
7748    this._inDialog = false; // True if showing within a "dialog", false if not
7749    this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
7750    this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
7751    this._appendClass = "ui-datepicker-append"; // The name of the append marker class
7752    this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
7753    this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
7754    this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
7755    this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
7756    this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
7757    this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
7758    this.regional = []; // Available regional settings, indexed by language code
7759    this.regional[""] = {
7760      // Default regional settings
7761      closeText: "Done", // Display text for close link
7762      prevText: "Prev", // Display text for previous month link
7763      nextText: "Next", // Display text for next month link
7764      currentText: "Today", // Display text for current month link
7765      monthNames: [
7766        "January",
7767        "February",
7768        "March",
7769        "April",
7770        "May",
7771        "June",
7772        "July",
7773        "August",
7774        "September",
7775        "October",
7776        "November",
7777        "December",
7778      ], // Names of months for drop-down and formatting
7779      monthNamesShort: [
7780        "Jan",
7781        "Feb",
7782        "Mar",
7783        "Apr",
7784        "May",
7785        "Jun",
7786        "Jul",
7787        "Aug",
7788        "Sep",
7789        "Oct",
7790        "Nov",
7791        "Dec",
7792      ], // For formatting
7793      dayNames: [
7794        "Sunday",
7795        "Monday",
7796        "Tuesday",
7797        "Wednesday",
7798        "Thursday",
7799        "Friday",
7800        "Saturday",
7801      ], // For formatting
7802      dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
7803      dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], // Column headings for days starting at Sunday
7804      weekHeader: "Wk", // Column header for week of the year
7805      dateFormat: "mm/dd/yy", // See format options on parseDate
7806      firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
7807      isRTL: false, // True if right-to-left language, false if left-to-right
7808      showMonthAfterYear: false, // True if the year select precedes month, false for month then year
7809      yearSuffix: "", // Additional text to append to the year in the month headers,
7810      selectMonthLabel: "Select month", // Invisible label for month selector
7811      selectYearLabel: "Select year", // Invisible label for year selector
7812    };
7813    this._defaults = {
7814      // Global defaults for all the date picker instances
7815      showOn: "focus", // "focus" for popup on focus,
7816      // "button" for trigger button, or "both" for either
7817      showAnim: "fadeIn", // Name of jQuery animation for popup
7818      showOptions: {}, // Options for enhanced animations
7819      defaultDate: null, // Used when field is blank: actual date,
7820      // +/-number for offset from today, null for today
7821      appendText: "", // Display text following the input box, e.g. showing the format
7822      buttonText: "...", // Text for trigger button
7823      buttonImage: "", // URL for trigger button image
7824      buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
7825      hideIfNoPrevNext: false, // True to hide next/previous month links
7826      // if not applicable, false to just disable them
7827      navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
7828      gotoCurrent: false, // True if today link goes back to current selection instead
vendor: 5,719 bytes, lines 7829-7945
7829      changeMonth: false, // True if month can be selected directly, false if only prev/next
7830      changeYear: false, // True if year can be selected directly, false if only prev/next
7831      yearRange: "c-10:c+10", // Range of years to display in drop-down,
7832      // either relative to today's year (-nn:+nn), relative to currently displayed year
7833      // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
7834      showOtherMonths: false, // True to show dates in other months, false to leave blank
7835      selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
7836      showWeek: false, // True to show week of the year, false to not show it
7837      calculateWeek: this.iso8601Week, // How to calculate the week of the year,
7838      // takes a Date and returns the number of the week for it
7839      shortYearCutoff: "+10", // Short year values < this are in the current century,
7840      // > this are in the previous century,
7841      // string value starting with "+" for current year + value
7842      minDate: null, // The earliest selectable date, or null for no limit
7843      maxDate: null, // The latest selectable date, or null for no limit
7844      duration: "fast", // Duration of display/closure
7845      beforeShowDay: null, // Function that takes a date and returns an array with
7846      // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
7847      // [2] = cell title (optional), e.g. $.datepicker.noWeekends
7848      beforeShow: null, // Function that takes an input field and
7849      // returns a set of custom settings for the date picker
7850      onSelect: null, // Define a callback function when a date is selected
7851      onChangeMonthYear: null, // Define a callback function when the month or year is changed
7852      onClose: null, // Define a callback function when the datepicker is closed
7853      onUpdateDatepicker: null, // Define a callback function when the datepicker is updated
7854      numberOfMonths: 1, // Number of months to show at a time
7855      showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
7856      stepMonths: 1, // Number of months to step back/forward
7857      stepBigMonths: 12, // Number of months to step back/forward for the big links
7858      altField: "", // Selector for an alternate field to store selected dates into
7859      altFormat: "", // The date format to use for the alternate field
7860      constrainInput: true, // The input is constrained by the current date format
7861      showButtonPanel: false, // True to show button panel, false to not show it
7862      autoSize: false, // True to size the input for the date format, false to leave as is
7863      disabled: false, // The initial disabled state
7864    };
7865    $.extend(this._defaults, this.regional[""]);
7866    this.regional.en = $.extend(true, {}, this.regional[""]);
7867    this.regional["en-US"] = $.extend(true, {}, this.regional.en);
7868    this.dpDiv = datepicker_bindHover(
7869      $(
7870        "<div id='" +
7871          this._mainDivId +
7872          "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"
7873      )
7874    );
7875  }
7876
7877  $.extend(Datepicker.prototype, {
7878    /* Class name added to elements to indicate already configured with a date picker. */
7879    markerClassName: "hasDatepicker",
7880
7881    //Keep track of the maximum number of rows displayed (see #7043)
7882    maxRows: 4,
7883
7884    // TODO rename to "widget" when switching to widget factory
7885    _widgetDatepicker: function () {
7886      return this.dpDiv;
7887    },
7888
7889    /* Override the default settings for all instances of the date picker.
7890     * @param  settings  object - the new settings to use as defaults (anonymous object)
7891     * @return the manager object
7892     */
7893    setDefaults: function (settings) {
7894      datepicker_extendRemove(this._defaults, settings || {});
7895      return this;
7896    },
7897
7898    /* Attach the date picker to a jQuery selection.
7899     * @param  target	element - the target input field or division or span
7900     * @param  settings  object - the new settings to use for this date picker instance (anonymous)
7901     */
7902    _attachDatepicker: function (target, settings) {
7903      var nodeName, inline, inst;
7904      nodeName = target.nodeName.toLowerCase();
7905      inline = nodeName === "div" || nodeName === "span";
7906      if (!target.id) {
7907        this.uuid += 1;
7908        target.id = "dp" + this.uuid;
7909      }
7910      inst = this._newInst($(target), inline);
7911      inst.settings = $.extend({}, settings || {});
7912      if (nodeName === "input") {
7913        this._connectDatepicker(target, inst);
7914      } else if (inline) {
7915        this._inlineDatepicker(target, inst);
7916      }
7917    },
7918
7919    /* Create a new instance object. */
7920    _newInst: function (target, inline) {
7921      var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
7922      return {
7923        id: id,
7924        input: target, // associated target
7925        selectedDay: 0,
7926        selectedMonth: 0,
7927        selectedYear: 0, // current selection
7928        drawMonth: 0,
7929        drawYear: 0, // month being drawn
7930        inline: inline, // is datepicker inline or not
7931        dpDiv: !inline
7932          ? this.dpDiv // presentation div
7933          : datepicker_bindHover(
7934              $(
7935                "<div class='" +
7936                  this._inlineClass +
7937                  " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"
7938              )
7939            ),
7940      };
7941    },
7942
7943    /* Attach the date picker to an input field. */
7944    _connectDatepicker: function (target, inst) {
7945      var input = $(target);
vendor: 5,015 bytes, lines 7946-8104
7946      inst.append = $([]);
7947      inst.trigger = $([]);
7948      if (input.hasClass(this.markerClassName)) {
7949        return;
7950      }
7951      this._attachments(input, inst);
7952      input
7953        .addClass(this.markerClassName)
7954        .on("keydown", this._doKeyDown)
7955        .on("keypress", this._doKeyPress)
7956        .on("keyup", this._doKeyUp);
7957      this._autoSize(inst);
7958      $.data(target, "datepicker", inst);
7959
7960      //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
7961      if (inst.settings.disabled) {
7962        this._disableDatepicker(target);
7963      }
7964    },
7965
7966    /* Make attachments based on settings. */
7967    _attachments: function (input, inst) {
7968      var showOn,
7969        buttonText,
7970        buttonImage,
7971        appendText = this._get(inst, "appendText"),
7972        isRTL = this._get(inst, "isRTL");
7973
7974      if (inst.append) {
7975        inst.append.remove();
7976      }
7977      if (appendText) {
7978        inst.append = $("<span>").addClass(this._appendClass).text(appendText);
7979        input[isRTL ? "before" : "after"](inst.append);
7980      }
7981
7982      input.off("focus", this._showDatepicker);
7983
7984      if (inst.trigger) {
7985        inst.trigger.remove();
7986      }
7987
7988      showOn = this._get(inst, "showOn");
7989      if (showOn === "focus" || showOn === "both") {
7990        // pop-up date picker when in the marked field
7991        input.on("focus", this._showDatepicker);
7992      }
7993      if (showOn === "button" || showOn === "both") {
7994        // pop-up date picker when button clicked
7995        buttonText = this._get(inst, "buttonText");
7996        buttonImage = this._get(inst, "buttonImage");
7997
7998        if (this._get(inst, "buttonImageOnly")) {
7999          inst.trigger = $("<img>").addClass(this._triggerClass).attr({
8000            src: buttonImage,
8001            alt: buttonText,
8002            title: buttonText,
8003          });
8004        } else {
8005          inst.trigger = $("<button type='button'>").addClass(
8006            this._triggerClass
8007          );
8008          if (buttonImage) {
8009            inst.trigger.html(
8010              $("<img>").attr({
8011                src: buttonImage,
8012                alt: buttonText,
8013                title: buttonText,
8014              })
8015            );
8016          } else {
8017            inst.trigger.text(buttonText);
8018          }
8019        }
8020
8021        input[isRTL ? "before" : "after"](inst.trigger);
8022        inst.trigger.on("click", function () {
8023          if (
8024            $.datepicker._datepickerShowing &&
8025            $.datepicker._lastInput === input[0]
8026          ) {
8027            $.datepicker._hideDatepicker();
8028          } else if (
8029            $.datepicker._datepickerShowing &&
8030            $.datepicker._lastInput !== input[0]
8031          ) {
8032            $.datepicker._hideDatepicker();
8033            $.datepicker._showDatepicker(input[0]);
8034          } else {
8035            $.datepicker._showDatepicker(input[0]);
8036          }
8037          return false;
8038        });
8039      }
8040    },
8041
8042    /* Apply the maximum length for the date format. */
8043    _autoSize: function (inst) {
8044      if (this._get(inst, "autoSize") && !inst.inline) {
8045        var findMax,
8046          max,
8047          maxI,
8048          i,
8049          date = new Date(2009, 12 - 1, 20), // Ensure double digits
8050          dateFormat = this._get(inst, "dateFormat");
8051
8052        if (dateFormat.match(/[DM]/)) {
8053          findMax = function (names) {
8054            max = 0;
8055            maxI = 0;
8056            for (i = 0; i < names.length; i++) {
8057              if (names[i].length > max) {
8058                max = names[i].length;
8059                maxI = i;
8060              }
8061            }
8062            return maxI;
8063          };
8064          date.setMonth(
8065            findMax(
8066              this._get(
8067                inst,
8068                dateFormat.match(/MM/) ? "monthNames" : "monthNamesShort"
8069              )
8070            )
8071          );
8072          date.setDate(
8073            findMax(
8074              this._get(
8075                inst,
8076                dateFormat.match(/DD/) ? "dayNames" : "dayNamesShort"
8077              )
8078            ) +
8079              20 -
8080              date.getDay()
8081          );
8082        }
8083        inst.input.attr("size", this._formatDate(inst, date).length);
8084      }
8085    },
8086
8087    /* Attach an inline date picker to a div. */
8088    _inlineDatepicker: function (target, inst) {
8089      var divSpan = $(target);
8090      if (divSpan.hasClass(this.markerClassName)) {
8091        return;
8092      }
8093      divSpan.addClass(this.markerClassName).append(inst.dpDiv);
8094      $.data(target, "datepicker", inst);
8095      this._setDate(inst, this._getDefaultDate(inst), true);
8096      this._updateDatepicker(inst);
8097      this._updateAlternate(inst);
8098
8099      //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
8100      if (inst.settings.disabled) {
8101        this._disableDatepicker(target);
8102      }
8103
8104      // Set display:block in place of inst.dpDiv.show() which w
vendor: 17,775 bytes, lines 8104-8627
8104on't work on disconnected elements
8105      // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
8106      inst.dpDiv.css("display", "block");
8107    },
8108
8109    /* Pop-up the date picker in a "dialog" box.
8110     * @param  input element - ignored
8111     * @param  date	string or Date - the initial date to display
8112     * @param  onSelect  function - the function to call when a date is selected
8113     * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
8114     * @param  pos int[2] - coordinates for the dialog's position within the screen or
8115     *					event - with x/y coordinates or
8116     *					leave empty for default (screen centre)
8117     * @return the manager object
8118     */
8119    _dialogDatepicker: function (input, date, onSelect, settings, pos) {
8120      var id,
8121        browserWidth,
8122        browserHeight,
8123        scrollX,
8124        scrollY,
8125        inst = this._dialogInst; // internal instance
8126
8127      if (!inst) {
8128        this.uuid += 1;
8129        id = "dp" + this.uuid;
8130        this._dialogInput = $(
8131          "<input type='text' id='" +
8132            id +
8133            "' style='position: absolute; top: -100px; width: 0px;'/>"
8134        );
8135        this._dialogInput.on("keydown", this._doKeyDown);
8136        $("body").append(this._dialogInput);
8137        inst = this._dialogInst = this._newInst(this._dialogInput, false);
8138        inst.settings = {};
8139        $.data(this._dialogInput[0], "datepicker", inst);
8140      }
8141      datepicker_extendRemove(inst.settings, settings || {});
8142      date =
8143        date && date.constructor === Date ? this._formatDate(inst, date) : date;
8144      this._dialogInput.val(date);
8145
8146      this._pos = pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null;
8147      if (!this._pos) {
8148        browserWidth = document.documentElement.clientWidth;
8149        browserHeight = document.documentElement.clientHeight;
8150        scrollX =
8151          document.documentElement.scrollLeft || document.body.scrollLeft;
8152        scrollY = document.documentElement.scrollTop || document.body.scrollTop;
8153        this._pos =
8154          // should use actual width/height below
8155          [browserWidth / 2 - 100 + scrollX, browserHeight / 2 - 150 + scrollY];
8156      }
8157
8158      // Move input on screen for focus, but hidden behind dialog
8159      this._dialogInput
8160        .css("left", this._pos[0] + 20 + "px")
8161        .css("top", this._pos[1] + "px");
8162      inst.settings.onSelect = onSelect;
8163      this._inDialog = true;
8164      this.dpDiv.addClass(this._dialogClass);
8165      this._showDatepicker(this._dialogInput[0]);
8166      if ($.blockUI) {
8167        $.blockUI(this.dpDiv);
8168      }
8169      $.data(this._dialogInput[0], "datepicker", inst);
8170      return this;
8171    },
8172
8173    /* Detach a datepicker from its control.
8174     * @param  target	element - the target input field or division or span
8175     */
8176    _destroyDatepicker: function (target) {
8177      var nodeName,
8178        $target = $(target),
8179        inst = $.data(target, "datepicker");
8180
8181      if (!$target.hasClass(this.markerClassName)) {
8182        return;
8183      }
8184
8185      nodeName = target.nodeName.toLowerCase();
8186      $.removeData(target, "datepicker");
8187      if (nodeName === "input") {
8188        inst.append.remove();
8189        inst.trigger.remove();
8190        $target
8191          .removeClass(this.markerClassName)
8192          .off("focus", this._showDatepicker)
8193          .off("keydown", this._doKeyDown)
8194          .off("keypress", this._doKeyPress)
8195          .off("keyup", this._doKeyUp);
8196      } else if (nodeName === "div" || nodeName === "span") {
8197        $target.removeClass(this.markerClassName).empty();
8198      }
8199
8200      if (datepicker_instActive === inst) {
8201        datepicker_instActive = null;
8202        this._curInst = null;
8203      }
8204    },
8205
8206    /* Enable the date picker to a jQuery selection.
8207     * @param  target	element - the target input field or division or span
8208     */
8209    _enableDatepicker: function (target) {
8210      var nodeName,
8211        inline,
8212        $target = $(target),
8213        inst = $.data(target, "datepicker");
8214
8215      if (!$target.hasClass(this.markerClassName)) {
8216        return;
8217      }
8218
8219      nodeName = target.nodeName.toLowerCase();
8220      if (nodeName === "input") {
8221        target.disabled = false;
8222        inst.trigger
8223          .filter("button")
8224          .each(function () {
8225            this.disabled = false;
8226          })
8227          .end()
8228          .filter("img")
8229          .css({ opacity: "1.0", cursor: "" });
8230      } else if (nodeName === "div" || nodeName === "span") {
8231        inline = $target.children("." + this._inlineClass);
8232        inline.children().removeClass("ui-state-disabled");
8233        inline
8234          .find("select.ui-datepicker-month, select.ui-datepicker-year")
8235          .prop("disabled", false);
8236      }
8237      this._disabledInputs = $.map(
8238        this._disabledInputs,
8239
8240        // Delete entry
8241        function (value) {
8242          return value === target ? null : value;
8243        }
8244      );
8245    },
8246
8247    /* Disable the date picker to a jQuery selection.
8248     * @param  target	element - the target input field or division or span
8249     */
8250    _disableDatepicker: function (target) {
8251      var nodeName,
8252        inline,
8253        $target = $(target),
8254        inst = $.data(target, "datepicker");
8255
8256      if (!$target.hasClass(this.markerClassName)) {
8257        return;
8258      }
8259
8260      nodeName = target.nodeName.toLowerCase();
8261      if (nodeName === "input") {
8262        target.disabled = true;
8263        inst.trigger
8264          .filter("button")
8265          .each(function () {
8266            this.disabled = true;
8267          })
8268          .end()
8269          .filter("img")
8270          .css({ opacity: "0.5", cursor: "default" });
8271      } else if (nodeName === "div" || nodeName === "span") {
8272        inline = $target.children("." + this._inlineClass);
8273        inline.children().addClass("ui-state-disabled");
8274        inline
8275          .find("select.ui-datepicker-month, select.ui-datepicker-year")
8276          .prop("disabled", true);
8277      }
8278      this._disabledInputs = $.map(
8279        this._disabledInputs,
8280
8281        // Delete entry
8282        function (value) {
8283          return value === target ? null : value;
8284        }
8285      );
8286      this._disabledInputs[this._disabledInputs.length] = target;
8287    },
8288
8289    /* Is the first field in a jQuery collection disabled as a datepicker?
8290     * @param  target	element - the target input field or division or span
8291     * @return boolean - true if disabled, false if enabled
8292     */
8293    _isDisabledDatepicker: function (target) {
8294      if (!target) {
8295        return false;
8296      }
8297      for (var i = 0; i < this._disabledInputs.length; i++) {
8298        if (this._disabledInputs[i] === target) {
8299          return true;
8300        }
8301      }
8302      return false;
8303    },
8304
8305    /* Retrieve the instance data for the target control.
8306     * @param  target  element - the target input field or division or span
8307     * @return  object - the associated instance data
8308     * @throws  error if a jQuery problem getting data
8309     */
8310    _getInst: function (target) {
8311      try {
8312        return $.data(target, "datepicker");
8313      } catch (err) {
8314        throw "Missing instance data for this datepicker";
8315      }
8316    },
8317
8318    /* Update or retrieve the settings for a date picker attached to an input field or division.
8319     * @param  target  element - the target input field or division or span
8320     * @param  name	object - the new settings to update or
8321     *				string - the name of the setting to change or retrieve,
8322     *				when retrieving also "all" for all instance settings or
8323     *				"defaults" for all global defaults
8324     * @param  value   any - the new value for the setting
8325     *				(omit if above is an object or to retrieve a value)
8326     */
8327    _optionDatepicker: function (target, name, value) {
8328      var settings,
8329        date,
8330        minDate,
8331        maxDate,
8332        inst = this._getInst(target);
8333
8334      if (arguments.length === 2 && typeof name === "string") {
8335        return name === "defaults"
8336          ? $.extend({}, $.datepicker._defaults)
8337          : inst
8338          ? name === "all"
8339            ? $.extend({}, inst.settings)
8340            : this._get(inst, name)
8341          : null;
8342      }
8343
8344      settings = name || {};
8345      if (typeof name === "string") {
8346        settings = {};
8347        settings[name] = value;
8348      }
8349
8350      if (inst) {
8351        if (this._curInst === inst) {
8352          this._hideDatepicker();
8353        }
8354
8355        date = this._getDateDatepicker(target, true);
8356        minDate = this._getMinMaxDate(inst, "min");
8357        maxDate = this._getMinMaxDate(inst, "max");
8358        datepicker_extendRemove(inst.settings, settings);
8359
8360        // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
8361        if (
8362          minDate !== null &&
8363          settings.dateFormat !== undefined &&
8364          settings.minDate === undefined
8365        ) {
8366          inst.settings.minDate = this._formatDate(inst, minDate);
8367        }
8368        if (
8369          maxDate !== null &&
8370          settings.dateFormat !== undefined &&
8371          settings.maxDate === undefined
8372        ) {
8373          inst.settings.maxDate = this._formatDate(inst, maxDate);
8374        }
8375        if ("disabled" in settings) {
8376          if (settings.disabled) {
8377            this._disableDatepicker(target);
8378          } else {
8379            this._enableDatepicker(target);
8380          }
8381        }
8382        this._attachments($(target), inst);
8383        this._autoSize(inst);
8384        this._setDate(inst, date);
8385        this._updateAlternate(inst);
8386        this._updateDatepicker(inst);
8387      }
8388    },
8389
8390    // Change method deprecated
8391    _changeDatepicker: function (target, name, value) {
8392      this._optionDatepicker(target, name, value);
8393    },
8394
8395    /* Redraw the date picker attached to an input field or division.
8396     * @param  target  element - the target input field or division or span
8397     */
8398    _refreshDatepicker: function (target) {
8399      var inst = this._getInst(target);
8400      if (inst) {
8401        this._updateDatepicker(inst);
8402      }
8403    },
8404
8405    /* Set the dates for a jQuery selection.
8406     * @param  target element - the target input field or division or span
8407     * @param  date	Date - the new date
8408     */
8409    _setDateDatepicker: function (target, date) {
8410      var inst = this._getInst(target);
8411      if (inst) {
8412        this._setDate(inst, date);
8413        this._updateDatepicker(inst);
8414        this._updateAlternate(inst);
8415      }
8416    },
8417
8418    /* Get the date(s) for the first entry in a jQuery selection.
8419     * @param  target element - the target input field or division or span
8420     * @param  noDefault boolean - true if no default date is to be used
8421     * @return Date - the current date
8422     */
8423    _getDateDatepicker: function (target, noDefault) {
8424      var inst = this._getInst(target);
8425      if (inst && !inst.inline) {
8426        this._setDateFromField(inst, noDefault);
8427      }
8428      return inst ? this._getDate(inst) : null;
8429    },
8430
8431    /* Handle keystrokes. */
8432    _doKeyDown: function (event) {
8433      var onSelect,
8434        dateStr,
8435        sel,
8436        inst = $.datepicker._getInst(event.target),
8437        handled = true,
8438        isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
8439
8440      inst._keyEvent = true;
8441      if ($.datepicker._datepickerShowing) {
8442        switch (event.keyCode) {
8443          case 9:
8444            $.datepicker._hideDatepicker();
8445            handled = false;
8446            break; // hide on tab out
8447          case 13:
8448            sel = $(
8449              "td." +
8450                $.datepicker._dayOverClass +
8451                ":not(." +
8452                $.datepicker._currentClass +
8453                ")",
8454              inst.dpDiv
8455            );
8456            if (sel[0]) {
8457              $.datepicker._selectDay(
8458                event.target,
8459                inst.selectedMonth,
8460                inst.selectedYear,
8461                sel[0]
8462              );
8463            }
8464
8465            onSelect = $.datepicker._get(inst, "onSelect");
8466            if (onSelect) {
8467              dateStr = $.datepicker._formatDate(inst);
8468
8469              // Trigger custom callback
8470              onSelect.apply(inst.input ? inst.input[0] : null, [
8471                dateStr,
8472                inst,
8473              ]);
8474            } else {
8475              $.datepicker._hideDatepicker();
8476            }
8477
8478            return false; // don't submit the form
8479          case 27:
8480            $.datepicker._hideDatepicker();
8481            break; // hide on escape
8482          case 33:
8483            $.datepicker._adjustDate(
8484              event.target,
8485              event.ctrlKey
8486                ? -$.datepicker._get(inst, "stepBigMonths")
8487                : -$.datepicker._get(inst, "stepMonths"),
8488              "M"
8489            );
8490            break; // previous month/year on page up/+ ctrl
8491          case 34:
8492            $.datepicker._adjustDate(
8493              event.target,
8494              event.ctrlKey
8495                ? +$.datepicker._get(inst, "stepBigMonths")
8496                : +$.datepicker._get(inst, "stepMonths"),
8497              "M"
8498            );
8499            break; // next month/year on page down/+ ctrl
8500          case 35:
8501            if (event.ctrlKey || event.metaKey) {
8502              $.datepicker._clearDate(event.target);
8503            }
8504            handled = event.ctrlKey || event.metaKey;
8505            break; // clear on ctrl or command +end
8506          case 36:
8507            if (event.ctrlKey || event.metaKey) {
8508              $.datepicker._gotoToday(event.target);
8509            }
8510            handled = event.ctrlKey || event.metaKey;
8511            break; // current on ctrl or command +home
8512          case 37:
8513            if (event.ctrlKey || event.metaKey) {
8514              $.datepicker._adjustDate(event.target, isRTL ? +1 : -1, "D");
8515            }
8516            handled = event.ctrlKey || event.metaKey;
8517
8518            // -1 day on ctrl or command +left
8519            if (event.originalEvent.altKey) {
8520              $.datepicker._adjustDate(
8521                event.target,
8522                event.ctrlKey
8523                  ? -$.datepicker._get(inst, "stepBigMonths")
8524                  : -$.datepicker._get(inst, "stepMonths"),
8525                "M"
8526              );
8527            }
8528
8529            // next month/year on alt +left on Mac
8530            break;
8531          case 38:
8532            if (event.ctrlKey || event.metaKey) {
8533              $.datepicker._adjustDate(event.target, -7, "D");
8534            }
8535            handled = event.ctrlKey || event.metaKey;
8536            break; // -1 week on ctrl or command +up
8537          case 39:
8538            if (event.ctrlKey || event.metaKey) {
8539              $.datepicker._adjustDate(event.target, isRTL ? -1 : +1, "D");
8540            }
8541            handled = event.ctrlKey || event.metaKey;
8542
8543            // +1 day on ctrl or command +right
8544            if (event.originalEvent.altKey) {
8545              $.datepicker._adjustDate(
8546                event.target,
8547                event.ctrlKey
8548                  ? +$.datepicker._get(inst, "stepBigMonths")
8549                  : +$.datepicker._get(inst, "stepMonths"),
8550                "M"
8551              );
8552            }
8553
8554            // next month/year on alt +right
8555            break;
8556          case 40:
8557            if (event.ctrlKey || event.metaKey) {
8558              $.datepicker._adjustDate(event.target, +7, "D");
8559            }
8560            handled = event.ctrlKey || event.metaKey;
8561            break; // +1 week on ctrl or command +down
8562          default:
8563            handled = false;
8564        }
8565      } else if (event.keyCode === 36 && event.ctrlKey) {
8566        // display the date picker on ctrl+home
8567        $.datepicker._showDatepicker(this);
8568      } else {
8569        handled = false;
8570      }
8571
8572      if (handled) {
8573        event.preventDefault();
8574        event.stopPropagation();
8575      }
8576    },
8577
8578    /* Filter entered characters - based on date format. */
8579    _doKeyPress: function (event) {
8580      var chars,
8581        chr,
8582        inst = $.datepicker._getInst(event.target);
8583
8584      if ($.datepicker._get(inst, "constrainInput")) {
8585        chars = $.datepicker._possibleChars(
8586          $.datepicker._get(inst, "dateFormat")
8587        );
8588        chr = String.fromCharCode(
8589          event.charCode == null ? event.keyCode : event.charCode
8590        );
8591        return (
8592          event.ctrlKey ||
8593          event.metaKey ||
8594          chr < " " ||
8595          !chars ||
8596          chars.indexOf(chr) > -1
8597        );
8598      }
8599    },
8600
8601    /* Synchronise manual entry and field/alternate field. */
8602    _doKeyUp: function (event) {
8603      var date,
8604        inst = $.datepicker._getInst(event.target);
8605
8606      if (inst.input.val() !== inst.lastVal) {
8607        try {
8608          date = $.datepicker.parseDate(
8609            $.datepicker._get(inst, "dateFormat"),
8610            inst.input ? inst.input.val() : null,
8611            $.datepicker._getFormatConfig(inst)
8612          );
8613
8614          if (date) {
8615            // only if valid
8616            $.datepicker._setDateFromField(inst);
8617            $.datepicker._updateAlternate(inst);
8618            $.datepicker._updateDatepicker(inst);
8619          }
8620        } catch (err) {}
8621      }
8622      return true;
8623    },
8624
8625    /* Pop-up the date picker for a given input field.
8626     * If false returned from beforeShow event handler do not show.
8627     * @param  input  element - the input field attached to the date picker or
vendor: 5,652 bytes, lines 8628-8809
8628     *					event - if triggered by focus
8629     */
8630    _showDatepicker: function (input) {
8631      input = input.target || input;
8632      if (input.nodeName.toLowerCase() !== "input") {
8633        // find from button/image trigger
8634        input = $("input", input.parentNode)[0];
8635      }
8636
8637      if (
8638        $.datepicker._isDisabledDatepicker(input) ||
8639        $.datepicker._lastInput === input
8640      ) {
8641        // already here
8642        return;
8643      }
8644
8645      var inst,
8646        beforeShow,
8647        beforeShowSettings,
8648        isFixed,
8649        offset,
8650        showAnim,
8651        duration;
8652
8653      inst = $.datepicker._getInst(input);
8654      if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
8655        $.datepicker._curInst.dpDiv.stop(true, true);
8656        if (inst && $.datepicker._datepickerShowing) {
8657          $.datepicker._hideDatepicker($.datepicker._curInst.input[0]);
8658        }
8659      }
8660
8661      beforeShow = $.datepicker._get(inst, "beforeShow");
8662      beforeShowSettings = beforeShow
8663        ? beforeShow.apply(input, [input, inst])
8664        : {};
8665      if (beforeShowSettings === false) {
8666        return;
8667      }
8668      datepicker_extendRemove(inst.settings, beforeShowSettings);
8669
8670      inst.lastVal = null;
8671      $.datepicker._lastInput = input;
8672      $.datepicker._setDateFromField(inst);
8673
8674      if ($.datepicker._inDialog) {
8675        // hide cursor
8676        input.value = "";
8677      }
8678      if (!$.datepicker._pos) {
8679        // position below input
8680        $.datepicker._pos = $.datepicker._findPos(input);
8681        $.datepicker._pos[1] += input.offsetHeight; // add the height
8682      }
8683
8684      isFixed = false;
8685      $(input)
8686        .parents()
8687        .each(function () {
8688          isFixed |= $(this).css("position") === "fixed";
8689          return !isFixed;
8690        });
8691
8692      offset = { left: $.datepicker._pos[0], top: $.datepicker._pos[1] };
8693      $.datepicker._pos = null;
8694
8695      //to avoid flashes on Firefox
8696      inst.dpDiv.empty();
8697
8698      // determine sizing offscreen
8699      inst.dpDiv.css({
8700        position: "absolute",
8701        display: "block",
8702        top: "-1000px",
8703      });
8704      $.datepicker._updateDatepicker(inst);
8705
8706      // fix width for dynamic number of date pickers
8707      // and adjust position before showing
8708      offset = $.datepicker._checkOffset(inst, offset, isFixed);
8709      inst.dpDiv.css({
8710        position:
8711          $.datepicker._inDialog && $.blockUI
8712            ? "static"
8713            : isFixed
8714            ? "fixed"
8715            : "absolute",
8716        display: "none",
8717        left: offset.left + "px",
8718        top: offset.top + "px",
8719      });
8720
8721      if (!inst.inline) {
8722        showAnim = $.datepicker._get(inst, "showAnim");
8723        duration = $.datepicker._get(inst, "duration");
8724        inst.dpDiv.css("z-index", datepicker_getZindex($(input)) + 1);
8725        $.datepicker._datepickerShowing = true;
8726
8727        if ($.effects && $.effects.effect[showAnim]) {
8728          inst.dpDiv.show(
8729            showAnim,
8730            $.datepicker._get(inst, "showOptions"),
8731            duration
8732          );
8733        } else {
8734          inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
8735        }
8736
8737        if ($.datepicker._shouldFocusInput(inst)) {
8738          inst.input.trigger("focus");
8739        }
8740
8741        $.datepicker._curInst = inst;
8742      }
8743    },
8744
8745    /* Generate the date picker content. */
8746    _updateDatepicker: function (inst) {
8747      this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
8748      datepicker_instActive = inst; // for delegate hover events
8749      inst.dpDiv.empty().append(this._generateHTML(inst));
8750      this._attachHandlers(inst);
8751
8752      var origyearshtml,
8753        numMonths = this._getNumberOfMonths(inst),
8754        cols = numMonths[1],
8755        width = 17,
8756        activeCell = inst.dpDiv.find("." + this._dayOverClass + " a"),
8757        onUpdateDatepicker = $.datepicker._get(inst, "onUpdateDatepicker");
8758
8759      if (activeCell.length > 0) {
8760        datepicker_handleMouseover.apply(activeCell.get(0));
8761      }
8762
8763      inst.dpDiv
8764        .removeClass(
8765          "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4"
8766        )
8767        .width("");
8768      if (cols > 1) {
8769        inst.dpDiv
8770          .addClass("ui-datepicker-multi-" + cols)
8771          .css("width", width * cols + "em");
8772      }
8773      inst.dpDiv[
8774        (numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") + "Class"
8775      ]("ui-datepicker-multi");
8776      inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + "Class"](
8777        "ui-datepicker-rtl"
8778      );
8779
8780      if (
8781        inst === $.datepicker._curInst &&
8782        $.datepicker._datepickerShowing &&
8783        $.datepicker._shouldFocusInput(inst)
8784      ) {
8785        inst.input.trigger("focus");
8786      }
8787
8788      // Deffered render of the years select (to avoid flashes on Firefox)
8789      if (inst.yearshtml) {
8790        origyearshtml = inst.yearshtml;
8791        setTimeout(function () {
8792          //assure that inst.yearshtml didn't change.
8793          if (origyearshtml === inst.yearshtml && inst.yearshtml) {
8794            inst.dpDiv
8795              .find("select.ui-datepicker-year")
8796              .first()
8797              .replaceWith(inst.yearshtml);
8798          }
8799          origyearshtml = inst.yearshtml = null;
8800        }, 0);
8801      }
8802
8803      if (onUpdateDatepicker) {
8804        onUpdateDatepicker.apply(inst.input ? inst.input[0] : null, [inst]);
8805      }
8806    },
8807
8808    // #6694 - don't focus the input if it's already focused
8809    // this breaks the change event in IE
vendor: 30,135 bytes, lines 8810-9737
8810    // Support: IE and jQuery <1.9
8811    _shouldFocusInput: function (inst) {
8812      return (
8813        inst.input &&
8814        inst.input.is(":visible") &&
8815        !inst.input.is(":disabled") &&
8816        !inst.input.is(":focus")
8817      );
8818    },
8819
8820    /* Check positioning to remain on screen. */
8821    _checkOffset: function (inst, offset, isFixed) {
8822      var dpWidth = inst.dpDiv.outerWidth(),
8823        dpHeight = inst.dpDiv.outerHeight(),
8824        inputWidth = inst.input ? inst.input.outerWidth() : 0,
8825        inputHeight = inst.input ? inst.input.outerHeight() : 0,
8826        viewWidth =
8827          document.documentElement.clientWidth +
8828          (isFixed ? 0 : $(document).scrollLeft()),
8829        viewHeight =
8830          document.documentElement.clientHeight +
8831          (isFixed ? 0 : $(document).scrollTop());
8832
8833      offset.left -= this._get(inst, "isRTL") ? dpWidth - inputWidth : 0;
8834      offset.left -=
8835        isFixed && offset.left === inst.input.offset().left
8836          ? $(document).scrollLeft()
8837          : 0;
8838      offset.top -=
8839        isFixed && offset.top === inst.input.offset().top + inputHeight
8840          ? $(document).scrollTop()
8841          : 0;
8842
8843      // Now check if datepicker is showing outside window viewport - move to a better place if so.
8844      offset.left -= Math.min(
8845        offset.left,
8846        offset.left + dpWidth > viewWidth && viewWidth > dpWidth
8847          ? Math.abs(offset.left + dpWidth - viewWidth)
8848          : 0
8849      );
8850      offset.top -= Math.min(
8851        offset.top,
8852        offset.top + dpHeight > viewHeight && viewHeight > dpHeight
8853          ? Math.abs(dpHeight + inputHeight)
8854          : 0
8855      );
8856
8857      return offset;
8858    },
8859
8860    /* Find an object's position on the screen. */
8861    _findPos: function (obj) {
8862      var position,
8863        inst = this._getInst(obj),
8864        isRTL = this._get(inst, "isRTL");
8865
8866      while (
8867        obj &&
8868        (obj.type === "hidden" ||
8869          obj.nodeType !== 1 ||
8870          $.expr.pseudos.hidden(obj))
8871      ) {
8872        obj = obj[isRTL ? "previousSibling" : "nextSibling"];
8873      }
8874
8875      position = $(obj).offset();
8876      return [position.left, position.top];
8877    },
8878
8879    /* Hide the date picker from view.
8880     * @param  input  element - the input field attached to the date picker
8881     */
8882    _hideDatepicker: function (input) {
8883      var showAnim,
8884        duration,
8885        postProcess,
8886        onClose,
8887        inst = this._curInst;
8888
8889      if (!inst || (input && inst !== $.data(input, "datepicker"))) {
8890        return;
8891      }
8892
8893      if (this._datepickerShowing) {
8894        showAnim = this._get(inst, "showAnim");
8895        duration = this._get(inst, "duration");
8896        postProcess = function () {
8897          $.datepicker._tidyDialog(inst);
8898        };
8899
8900        // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
8901        if ($.effects && ($.effects.effect[showAnim] || $.effects[showAnim])) {
8902          inst.dpDiv.hide(
8903            showAnim,
8904            $.datepicker._get(inst, "showOptions"),
8905            duration,
8906            postProcess
8907          );
8908        } else {
8909          inst.dpDiv[
8910            showAnim === "slideDown"
8911              ? "slideUp"
8912              : showAnim === "fadeIn"
8913              ? "fadeOut"
8914              : "hide"
8915          ](showAnim ? duration : null, postProcess);
8916        }
8917
8918        if (!showAnim) {
8919          postProcess();
8920        }
8921        this._datepickerShowing = false;
8922
8923        onClose = this._get(inst, "onClose");
8924        if (onClose) {
8925          onClose.apply(inst.input ? inst.input[0] : null, [
8926            inst.input ? inst.input.val() : "",
8927            inst,
8928          ]);
8929        }
8930
8931        this._lastInput = null;
8932        if (this._inDialog) {
8933          this._dialogInput.css({
8934            position: "absolute",
8935            left: "0",
8936            top: "-100px",
8937          });
8938          if ($.blockUI) {
8939            $.unblockUI();
8940            $("body").append(this.dpDiv);
8941          }
8942        }
8943        this._inDialog = false;
8944      }
8945    },
8946
8947    /* Tidy up after a dialog display. */
8948    _tidyDialog: function (inst) {
8949      inst.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar");
8950    },
8951
8952    /* Close date picker if clicked elsewhere. */
8953    _checkExternalClick: function (event) {
8954      if (!$.datepicker._curInst) {
8955        return;
8956      }
8957
8958      var $target = $(event.target),
8959        inst = $.datepicker._getInst($target[0]);
8960
8961      if (
8962        ($target[0].id !== $.datepicker._mainDivId &&
8963          $target.parents("#" + $.datepicker._mainDivId).length === 0 &&
8964          !$target.hasClass($.datepicker.markerClassName) &&
8965          !$target.closest("." + $.datepicker._triggerClass).length &&
8966          $.datepicker._datepickerShowing &&
8967          !($.datepicker._inDialog && $.blockUI)) ||
8968        ($target.hasClass($.datepicker.markerClassName) &&
8969          $.datepicker._curInst !== inst)
8970      ) {
8971        $.datepicker._hideDatepicker();
8972      }
8973    },
8974
8975    /* Adjust one of the date sub-fields. */
8976    _adjustDate: function (id, offset, period) {
8977      var target = $(id),
8978        inst = this._getInst(target[0]);
8979
8980      if (this._isDisabledDatepicker(target[0])) {
8981        return;
8982      }
8983      this._adjustInstDate(inst, offset, period);
8984      this._updateDatepicker(inst);
8985    },
8986
8987    /* Action for current link. */
8988    _gotoToday: function (id) {
8989      var date,
8990        target = $(id),
8991        inst = this._getInst(target[0]);
8992
8993      if (this._get(inst, "gotoCurrent") && inst.currentDay) {
8994        inst.selectedDay = inst.currentDay;
8995        inst.drawMonth = inst.selectedMonth = inst.currentMonth;
8996        inst.drawYear = inst.selectedYear = inst.currentYear;
8997      } else {
8998        date = new Date();
8999        inst.selectedDay = date.getDate();
9000        inst.drawMonth = inst.selectedMonth = date.getMonth();
9001        inst.drawYear = inst.selectedYear = date.getFullYear();
9002      }
9003      this._notifyChange(inst);
9004      this._adjustDate(target);
9005    },
9006
9007    /* Action for selecting a new month/year. */
9008    _selectMonthYear: function (id, select, period) {
9009      var target = $(id),
9010        inst = this._getInst(target[0]);
9011
9012      inst["selected" + (period === "M" ? "Month" : "Year")] = inst[
9013        "draw" + (period === "M" ? "Month" : "Year")
9014      ] = parseInt(select.options[select.selectedIndex].value, 10);
9015
9016      this._notifyChange(inst);
9017      this._adjustDate(target);
9018    },
9019
9020    /* Action for selecting a day. */
9021    _selectDay: function (id, month, year, td) {
9022      var inst,
9023        target = $(id);
9024
9025      if (
9026        $(td).hasClass(this._unselectableClass) ||
9027        this._isDisabledDatepicker(target[0])
9028      ) {
9029        return;
9030      }
9031
9032      inst = this._getInst(target[0]);
9033      inst.selectedDay = inst.currentDay = parseInt(
9034        $("a", td).attr("data-date")
9035      );
9036      inst.selectedMonth = inst.currentMonth = month;
9037      inst.selectedYear = inst.currentYear = year;
9038      this._selectDate(
9039        id,
9040        this._formatDate(
9041          inst,
9042          inst.currentDay,
9043          inst.currentMonth,
9044          inst.currentYear
9045        )
9046      );
9047    },
9048
9049    /* Erase the input field and hide the date picker. */
9050    _clearDate: function (id) {
9051      var target = $(id);
9052      this._selectDate(target, "");
9053    },
9054
9055    /* Update the input field with the selected date. */
9056    _selectDate: function (id, dateStr) {
9057      var onSelect,
9058        target = $(id),
9059        inst = this._getInst(target[0]);
9060
9061      dateStr = dateStr != null ? dateStr : this._formatDate(inst);
9062      if (inst.input) {
9063        inst.input.val(dateStr);
9064      }
9065      this._updateAlternate(inst);
9066
9067      onSelect = this._get(inst, "onSelect");
9068      if (onSelect) {
9069        onSelect.apply(inst.input ? inst.input[0] : null, [dateStr, inst]); // trigger custom callback
9070      } else if (inst.input) {
9071        inst.input.trigger("change"); // fire the change event
9072      }
9073
9074      if (inst.inline) {
9075        this._updateDatepicker(inst);
9076      } else {
9077        this._hideDatepicker();
9078        this._lastInput = inst.input[0];
9079        if (typeof inst.input[0] !== "object") {
9080          inst.input.trigger("focus"); // restore focus
9081        }
9082        this._lastInput = null;
9083      }
9084    },
9085
9086    /* Update any alternate field to synchronise with the main field. */
9087    _updateAlternate: function (inst) {
9088      var altFormat,
9089        date,
9090        dateStr,
9091        altField = this._get(inst, "altField");
9092
9093      if (altField) {
9094        // update alternate field too
9095        altFormat =
9096          this._get(inst, "altFormat") || this._get(inst, "dateFormat");
9097        date = this._getDate(inst);
9098        dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
9099        $(document).find(altField).val(dateStr);
9100      }
9101    },
9102
9103    /* Set as beforeShowDay function to prevent selection of weekends.
9104     * @param  date  Date - the date to customise
9105     * @return [boolean, string] - is this date selectable?, what is its CSS class?
9106     */
9107    noWeekends: function (date) {
9108      var day = date.getDay();
9109      return [day > 0 && day < 6, ""];
9110    },
9111
9112    /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
9113     * @param  date  Date - the date to get the week for
9114     * @return  number - the number of the week within the year that contains this date
9115     */
9116    iso8601Week: function (date) {
9117      var time,
9118        checkDate = new Date(date.getTime());
9119
9120      // Find Thursday of this week starting on Monday
9121      checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
9122
9123      time = checkDate.getTime();
9124      checkDate.setMonth(0); // Compare with Jan 1
9125      checkDate.setDate(1);
9126      return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
9127    },
9128
9129    /* Parse a string value into a date object.
9130     * See formatDate below for the possible formats.
9131     *
9132     * @param  format string - the expected format of the date
9133     * @param  value string - the date in the above format
9134     * @param  settings Object - attributes include:
9135     *					shortYearCutoff  number - the cutoff year for determining the century (optional)
9136     *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
9137     *					dayNames		string[7] - names of the days from Sunday (optional)
9138     *					monthNamesShort string[12] - abbreviated names of the months (optional)
9139     *					monthNames		string[12] - names of the months (optional)
9140     * @return  Date - the extracted date value or null if value is blank
9141     */
9142    parseDate: function (format, value, settings) {
9143      if (format == null || value == null) {
9144        throw "Invalid arguments";
9145      }
9146
9147      value = typeof value === "object" ? value.toString() : value + "";
9148      if (value === "") {
9149        return null;
9150      }
9151
9152      var iFormat,
9153        dim,
9154        extra,
9155        iValue = 0,
9156        shortYearCutoffTemp =
9157          (settings ? settings.shortYearCutoff : null) ||
9158          this._defaults.shortYearCutoff,
9159        shortYearCutoff =
9160          typeof shortYearCutoffTemp !== "string"
9161            ? shortYearCutoffTemp
9162            : (new Date().getFullYear() % 100) +
9163              parseInt(shortYearCutoffTemp, 10),
9164        dayNamesShort =
9165          (settings ? settings.dayNamesShort : null) ||
9166          this._defaults.dayNamesShort,
9167        dayNames =
9168          (settings ? settings.dayNames : null) || this._defaults.dayNames,
9169        monthNamesShort =
9170          (settings ? settings.monthNamesShort : null) ||
9171          this._defaults.monthNamesShort,
9172        monthNames =
9173          (settings ? settings.monthNames : null) || this._defaults.monthNames,
9174        year = -1,
9175        month = -1,
9176        day = -1,
9177        doy = -1,
9178        literal = false,
9179        date,
9180        // Check whether a format character is doubled
9181        lookAhead = function (match) {
9182          var matches =
9183            iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
9184          if (matches) {
9185            iFormat++;
9186          }
9187          return matches;
9188        },
9189        // Extract a number from the string value
9190        getNumber = function (match) {
9191          var isDoubled = lookAhead(match),
9192            size =
9193              match === "@"
9194                ? 14
9195                : match === "!"
9196                ? 20
9197                : match === "y" && isDoubled
9198                ? 4
9199                : match === "o"
9200                ? 3
9201                : 2,
9202            minSize = match === "y" ? size : 1,
9203            digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
9204            num = value.substring(iValue).match(digits);
9205          if (!num) {
9206            throw "Missing number at position " + iValue;
9207          }
9208          iValue += num[0].length;
9209          return parseInt(num[0], 10);
9210        },
9211        // Extract a name from the string value and convert to an index
9212        getName = function (match, shortNames, longNames) {
9213          var index = -1,
9214            names = $.map(
9215              lookAhead(match) ? longNames : shortNames,
9216              function (v, k) {
9217                return [[k, v]];
9218              }
9219            ).sort(function (a, b) {
9220              return -(a[1].length - b[1].length);
9221            });
9222
9223          $.each(names, function (i, pair) {
9224            var name = pair[1];
9225            if (
9226              value.substr(iValue, name.length).toLowerCase() ===
9227              name.toLowerCase()
9228            ) {
9229              index = pair[0];
9230              iValue += name.length;
9231              return false;
9232            }
9233          });
9234          if (index !== -1) {
9235            return index + 1;
9236          } else {
9237            throw "Unknown name at position " + iValue;
9238          }
9239        },
9240        // Confirm that a literal character matches the string value
9241        checkLiteral = function () {
9242          if (value.charAt(iValue) !== format.charAt(iFormat)) {
9243            throw "Unexpected literal at position " + iValue;
9244          }
9245          iValue++;
9246        };
9247
9248      for (iFormat = 0; iFormat < format.length; iFormat++) {
9249        if (literal) {
9250          if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
9251            literal = false;
9252          } else {
9253            checkLiteral();
9254          }
9255        } else {
9256          switch (format.charAt(iFormat)) {
9257            case "d":
9258              day = getNumber("d");
9259              break;
9260            case "D":
9261              getName("D", dayNamesShort, dayNames);
9262              break;
9263            case "o":
9264              doy = getNumber("o");
9265              break;
9266            case "m":
9267              month = getNumber("m");
9268              break;
9269            case "M":
9270              month = getName("M", monthNamesShort, monthNames);
9271              break;
9272            case "y":
9273              year = getNumber("y");
9274              break;
9275            case "@":
9276              date = new Date(getNumber("@"));
9277              year = date.getFullYear();
9278              month = date.getMonth() + 1;
9279              day = date.getDate();
9280              break;
9281            case "!":
9282              date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
9283              year = date.getFullYear();
9284              month = date.getMonth() + 1;
9285              day = date.getDate();
9286              break;
9287            case "'":
9288              if (lookAhead("'")) {
9289                checkLiteral();
9290              } else {
9291                literal = true;
9292              }
9293              break;
9294            default:
9295              checkLiteral();
9296          }
9297        }
9298      }
9299
9300      if (iValue < value.length) {
9301        extra = value.substr(iValue);
9302        if (!/^\s+/.test(extra)) {
9303          throw "Extra/unparsed characters found in date: " + extra;
9304        }
9305      }
9306
9307      if (year === -1) {
9308        year = new Date().getFullYear();
9309      } else if (year < 100) {
9310        year +=
9311          new Date().getFullYear() -
9312          (new Date().getFullYear() % 100) +
9313          (year <= shortYearCutoff ? 0 : -100);
9314      }
9315
9316      if (doy > -1) {
9317        month = 1;
9318        day = doy;
9319        do {
9320          dim = this._getDaysInMonth(year, month - 1);
9321          if (day <= dim) {
9322            break;
9323          }
9324          month++;
9325          day -= dim;
9326        } while (true);
9327      }
9328
9329      date = this._daylightSavingAdjust(new Date(year, month - 1, day));
9330      if (
9331        date.getFullYear() !== year ||
9332        date.getMonth() + 1 !== month ||
9333        date.getDate() !== day
9334      ) {
9335        throw "Invalid date"; // E.g. 31/02/00
9336      }
9337      return date;
9338    },
9339
9340    /* Standard date formats. */
9341    ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
9342    COOKIE: "D, dd M yy",
9343    ISO_8601: "yy-mm-dd",
9344    RFC_822: "D, d M y",
9345    RFC_850: "DD, dd-M-y",
9346    RFC_1036: "D, d M y",
9347    RFC_1123: "D, d M yy",
9348    RFC_2822: "D, d M yy",
9349    RSS: "D, d M y", // RFC 822
9350    TICKS: "!",
9351    TIMESTAMP: "@",
9352    W3C: "yy-mm-dd", // ISO 8601
9353
9354    _ticksTo1970:
9355      ((1970 - 1) * 365 +
9356        Math.floor(1970 / 4) -
9357        Math.floor(1970 / 100) +
9358        Math.floor(1970 / 400)) *
9359      24 *
9360      60 *
9361      60 *
9362      10000000,
9363
9364    /* Format a date object into a string value.
9365     * The format can be combinations of the following:
9366     * d  - day of month (no leading zero)
9367     * dd - day of month (two digit)
9368     * o  - day of year (no leading zeros)
9369     * oo - day of year (three digit)
9370     * D  - day name short
9371     * DD - day name long
9372     * m  - month of year (no leading zero)
9373     * mm - month of year (two digit)
9374     * M  - month name short
9375     * MM - month name long
9376     * y  - year (two digit)
9377     * yy - year (four digit)
9378     * @ - Unix timestamp (ms since 01/01/1970)
9379     * ! - Windows ticks (100ns since 01/01/0001)
9380     * "..." - literal text
9381     * '' - single quote
9382     *
9383     * @param  format string - the desired format of the date
9384     * @param  date Date - the date value to format
9385     * @param  settings Object - attributes include:
9386     *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
9387     *					dayNames		string[7] - names of the days from Sunday (optional)
9388     *					monthNamesShort string[12] - abbreviated names of the months (optional)
9389     *					monthNames		string[12] - names of the months (optional)
9390     * @return  string - the date in the above format
9391     */
9392    formatDate: function (format, date, settings) {
9393      if (!date) {
9394        return "";
9395      }
9396
9397      var iFormat,
9398        dayNamesShort =
9399          (settings ? settings.dayNamesShort : null) ||
9400          this._defaults.dayNamesShort,
9401        dayNames =
9402          (settings ? settings.dayNames : null) || this._defaults.dayNames,
9403        monthNamesShort =
9404          (settings ? settings.monthNamesShort : null) ||
9405          this._defaults.monthNamesShort,
9406        monthNames =
9407          (settings ? settings.monthNames : null) || this._defaults.monthNames,
9408        // Check whether a format character is doubled
9409        lookAhead = function (match) {
9410          var matches =
9411            iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
9412          if (matches) {
9413            iFormat++;
9414          }
9415          return matches;
9416        },
9417        // Format a number, with leading zero if necessary
9418        formatNumber = function (match, value, len) {
9419          var num = "" + value;
9420          if (lookAhead(match)) {
9421            while (num.length < len) {
9422              num = "0" + num;
9423            }
9424          }
9425          return num;
9426        },
9427        // Format a name, short or long as requested
9428        formatName = function (match, value, shortNames, longNames) {
9429          return lookAhead(match) ? longNames[value] : shortNames[value];
9430        },
9431        output = "",
9432        literal = false;
9433
9434      if (date) {
9435        for (iFormat = 0; iFormat < format.length; iFormat++) {
9436          if (literal) {
9437            if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
9438              literal = false;
9439            } else {
9440              output += format.charAt(iFormat);
9441            }
9442          } else {
9443            switch (format.charAt(iFormat)) {
9444              case "d":
9445                output += formatNumber("d", date.getDate(), 2);
9446                break;
9447              case "D":
9448                output += formatName(
9449                  "D",
9450                  date.getDay(),
9451                  dayNamesShort,
9452                  dayNames
9453                );
9454                break;
9455              case "o":
9456                output += formatNumber(
9457                  "o",
9458                  Math.round(
9459                    (new Date(
9460                      date.getFullYear(),
9461                      date.getMonth(),
9462                      date.getDate()
9463                    ).getTime() -
9464                      new Date(date.getFullYear(), 0, 0).getTime()) /
9465                      86400000
9466                  ),
9467                  3
9468                );
9469                break;
9470              case "m":
9471                output += formatNumber("m", date.getMonth() + 1, 2);
9472                break;
9473              case "M":
9474                output += formatName(
9475                  "M",
9476                  date.getMonth(),
9477                  monthNamesShort,
9478                  monthNames
9479                );
9480                break;
9481              case "y":
9482                output += lookAhead("y")
9483                  ? date.getFullYear()
9484                  : (date.getFullYear() % 100 < 10 ? "0" : "") +
9485                    (date.getFullYear() % 100);
9486                break;
9487              case "@":
9488                output += date.getTime();
9489                break;
9490              case "!":
9491                output += date.getTime() * 10000 + this._ticksTo1970;
9492                break;
9493              case "'":
9494                if (lookAhead("'")) {
9495                  output += "'";
9496                } else {
9497                  literal = true;
9498                }
9499                break;
9500              default:
9501                output += format.charAt(iFormat);
9502            }
9503          }
9504        }
9505      }
9506      return output;
9507    },
9508
9509    /* Extract all possible characters from the date format. */
9510    _possibleChars: function (format) {
9511      var iFormat,
9512        chars = "",
9513        literal = false,
9514        // Check whether a format character is doubled
9515        lookAhead = function (match) {
9516          var matches =
9517            iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
9518          if (matches) {
9519            iFormat++;
9520          }
9521          return matches;
9522        };
9523
9524      for (iFormat = 0; iFormat < format.length; iFormat++) {
9525        if (literal) {
9526          if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
9527            literal = false;
9528          } else {
9529            chars += format.charAt(iFormat);
9530          }
9531        } else {
9532          switch (format.charAt(iFormat)) {
9533            case "d":
9534            case "m":
9535            case "y":
9536            case "@":
9537              chars += "0123456789";
9538              break;
9539            case "D":
9540            case "M":
9541              return null; // Accept anything
9542            case "'":
9543              if (lookAhead("'")) {
9544                chars += "'";
9545              } else {
9546                literal = true;
9547              }
9548              break;
9549            default:
9550              chars += format.charAt(iFormat);
9551          }
9552        }
9553      }
9554      return chars;
9555    },
9556
9557    /* Get a setting value, defaulting if necessary. */
9558    _get: function (inst, name) {
9559      return inst.settings[name] !== undefined
9560        ? inst.settings[name]
9561        : this._defaults[name];
9562    },
9563
9564    /* Parse existing date and initialise date picker. */
9565    _setDateFromField: function (inst, noDefault) {
9566      if (inst.input.val() === inst.lastVal) {
9567        return;
9568      }
9569
9570      var dateFormat = this._get(inst, "dateFormat"),
9571        dates = (inst.lastVal = inst.input ? inst.input.val() : null),
9572        defaultDate = this._getDefaultDate(inst),
9573        date = defaultDate,
9574        settings = this._getFormatConfig(inst);
9575
9576      try {
9577        date = this.parseDate(dateFormat, dates, settings) || defaultDate;
9578      } catch (event) {
9579        dates = noDefault ? "" : dates;
9580      }
9581      inst.selectedDay = date.getDate();
9582      inst.drawMonth = inst.selectedMonth = date.getMonth();
9583      inst.drawYear = inst.selectedYear = date.getFullYear();
9584      inst.currentDay = dates ? date.getDate() : 0;
9585      inst.currentMonth = dates ? date.getMonth() : 0;
9586      inst.currentYear = dates ? date.getFullYear() : 0;
9587      this._adjustInstDate(inst);
9588    },
9589
9590    /* Retrieve the default date shown on opening. */
9591    _getDefaultDate: function (inst) {
9592      return this._restrictMinMax(
9593        inst,
9594        this._determineDate(inst, this._get(inst, "defaultDate"), new Date())
9595      );
9596    },
9597
9598    /* A date may be specified as an exact value or a relative one. */
9599    _determineDate: function (inst, date, defaultDate) {
9600      var offsetNumeric = function (offset) {
9601          var date = new Date();
9602          date.setDate(date.getDate() + offset);
9603          return date;
9604        },
9605        offsetString = function (offset) {
9606          try {
9607            return $.datepicker.parseDate(
9608              $.datepicker._get(inst, "dateFormat"),
9609              offset,
9610              $.datepicker._getFormatConfig(inst)
9611            );
9612          } catch (e) {
9613            // Ignore
9614          }
9615
9616          var date =
9617              (offset.toLowerCase().match(/^c/)
9618                ? $.datepicker._getDate(inst)
9619                : null) || new Date(),
9620            year = date.getFullYear(),
9621            month = date.getMonth(),
9622            day = date.getDate(),
9623            pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
9624            matches = pattern.exec(offset);
9625
9626          while (matches) {
9627            switch (matches[2] || "d") {
9628              case "d":
9629              case "D":
9630                day += parseInt(matches[1], 10);
9631                break;
9632              case "w":
9633              case "W":
9634                day += parseInt(matches[1], 10) * 7;
9635                break;
9636              case "m":
9637              case "M":
9638                month += parseInt(matches[1], 10);
9639                day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
9640                break;
9641              case "y":
9642              case "Y":
9643                year += parseInt(matches[1], 10);
9644                day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
9645                break;
9646            }
9647            matches = pattern.exec(offset);
9648          }
9649          return new Date(year, month, day);
9650        },
9651        newDate =
9652          date == null || date === ""
9653            ? defaultDate
9654            : typeof date === "string"
9655            ? offsetString(date)
9656            : typeof date === "number"
9657            ? isNaN(date)
9658              ? defaultDate
9659              : offsetNumeric(date)
9660            : new Date(date.getTime());
9661
9662      newDate =
9663        newDate && newDate.toString() === "Invalid Date"
9664          ? defaultDate
9665          : newDate;
9666      if (newDate) {
9667        newDate.setHours(0);
9668        newDate.setMinutes(0);
9669        newDate.setSeconds(0);
9670        newDate.setMilliseconds(0);
9671      }
9672      return this._daylightSavingAdjust(newDate);
9673    },
9674
9675    /* Handle switch to/from daylight saving.
9676     * Hours may be non-zero on daylight saving cut-over:
9677     * > 12 when midnight changeover, but then cannot generate
9678     * midnight datetime, so jump to 1AM, otherwise reset.
9679     * @param  date  (Date) the date to check
9680     * @return  (Date) the corrected date
9681     */
9682    _daylightSavingAdjust: function (date) {
9683      if (!date) {
9684        return null;
9685      }
9686      date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
9687      return date;
9688    },
9689
9690    /* Set the date(s) directly. */
9691    _setDate: function (inst, date, noChange) {
9692      var clear = !date,
9693        origMonth = inst.selectedMonth,
9694        origYear = inst.selectedYear,
9695        newDate = this._restrictMinMax(
9696          inst,
9697          this._determineDate(inst, date, new Date())
9698        );
9699
9700      inst.selectedDay = inst.currentDay = newDate.getDate();
9701      inst.drawMonth =
9702        inst.selectedMonth =
9703        inst.currentMonth =
9704          newDate.getMonth();
9705      inst.drawYear =
9706        inst.selectedYear =
9707        inst.currentYear =
9708          newDate.getFullYear();
9709      if (
9710        (origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) &&
9711        !noChange
9712      ) {
9713        this._notifyChange(inst);
9714      }
9715      this._adjustInstDate(inst);
9716      if (inst.input) {
9717        inst.input.val(clear ? "" : this._formatDate(inst));
9718      }
9719    },
9720
9721    /* Retrieve the date(s) directly. */
9722    _getDate: function (inst) {
9723      var startDate =
9724        !inst.currentYear || (inst.input && inst.input.val() === "")
9725          ? null
9726          : this._daylightSavingAdjust(
9727              new Date(inst.currentYear, inst.currentMonth, inst.currentDay)
9728            );
9729      return startDate;
9730    },
9731
9732    /* Attach the onxxx handlers.  These are declared statically so
9733     * they work with static code transformers like Caja.
9734     */
9735    _attachHandlers: function (inst) {
9736      var stepMonths = this._get(inst, "stepMonths"),
9737        id = "#" + inst.id.replace(/\\\\/g, "\\");
vendor: 16,384 bytes, lines 9738-10193
9738      inst.dpDiv.find("[data-handler]").map(function () {
9739        var handler = {
9740          prev: function () {
9741            $.datepicker._adjustDate(id, -stepMonths, "M");
9742          },
9743          next: function () {
9744            $.datepicker._adjustDate(id, +stepMonths, "M");
9745          },
9746          hide: function () {
9747            $.datepicker._hideDatepicker();
9748          },
9749          today: function () {
9750            $.datepicker._gotoToday(id);
9751          },
9752          selectDay: function () {
9753            $.datepicker._selectDay(
9754              id,
9755              +this.getAttribute("data-month"),
9756              +this.getAttribute("data-year"),
9757              this
9758            );
9759            return false;
9760          },
9761          selectMonth: function () {
9762            $.datepicker._selectMonthYear(id, this, "M");
9763            return false;
9764          },
9765          selectYear: function () {
9766            $.datepicker._selectMonthYear(id, this, "Y");
9767            return false;
9768          },
9769        };
9770        $(this).on(
9771          this.getAttribute("data-event"),
9772          handler[this.getAttribute("data-handler")]
9773        );
9774      });
9775    },
9776
9777    /* Generate the HTML for the current state of the date picker. */
9778    _generateHTML: function (inst) {
9779      var maxDraw,
9780        prevText,
9781        prev,
9782        nextText,
9783        next,
9784        currentText,
9785        gotoDate,
9786        controls,
9787        buttonPanel,
9788        firstDay,
9789        showWeek,
9790        dayNames,
9791        dayNamesMin,
9792        monthNames,
9793        monthNamesShort,
9794        beforeShowDay,
9795        showOtherMonths,
9796        selectOtherMonths,
9797        defaultDate,
9798        html,
9799        dow,
9800        row,
9801        group,
9802        col,
9803        selectedDate,
9804        cornerClass,
9805        calender,
9806        thead,
9807        day,
9808        daysInMonth,
9809        leadDays,
9810        curRows,
9811        numRows,
9812        printDate,
9813        dRow,
9814        tbody,
9815        daySettings,
9816        otherMonth,
9817        unselectable,
9818        tempDate = new Date(),
9819        today = this._daylightSavingAdjust(
9820          new Date(
9821            tempDate.getFullYear(),
9822            tempDate.getMonth(),
9823            tempDate.getDate()
9824          )
9825        ), // clear time
9826        isRTL = this._get(inst, "isRTL"),
9827        showButtonPanel = this._get(inst, "showButtonPanel"),
9828        hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
9829        navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
9830        numMonths = this._getNumberOfMonths(inst),
9831        showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
9832        stepMonths = this._get(inst, "stepMonths"),
9833        isMultiMonth = numMonths[0] !== 1 || numMonths[1] !== 1,
9834        currentDate = this._daylightSavingAdjust(
9835          !inst.currentDay
9836            ? new Date(9999, 9, 9)
9837            : new Date(inst.currentYear, inst.currentMonth, inst.currentDay)
9838        ),
9839        minDate = this._getMinMaxDate(inst, "min"),
9840        maxDate = this._getMinMaxDate(inst, "max"),
9841        drawMonth = inst.drawMonth - showCurrentAtPos,
9842        drawYear = inst.drawYear;
9843
9844      if (drawMonth < 0) {
9845        drawMonth += 12;
9846        drawYear--;
9847      }
9848      if (maxDate) {
9849        maxDraw = this._daylightSavingAdjust(
9850          new Date(
9851            maxDate.getFullYear(),
9852            maxDate.getMonth() - numMonths[0] * numMonths[1] + 1,
9853            maxDate.getDate()
9854          )
9855        );
9856        maxDraw = minDate && maxDraw < minDate ? minDate : maxDraw;
9857        while (
9858          this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw
9859        ) {
9860          drawMonth--;
9861          if (drawMonth < 0) {
9862            drawMonth = 11;
9863            drawYear--;
9864          }
9865        }
9866      }
9867      inst.drawMonth = drawMonth;
9868      inst.drawYear = drawYear;
9869
9870      prevText = this._get(inst, "prevText");
9871      prevText = !navigationAsDateFormat
9872        ? prevText
9873        : this.formatDate(
9874            prevText,
9875            this._daylightSavingAdjust(
9876              new Date(drawYear, drawMonth - stepMonths, 1)
9877            ),
9878            this._getFormatConfig(inst)
9879          );
9880
9881      if (this._canAdjustMonth(inst, -1, drawYear, drawMonth)) {
9882        prev = $("<a>")
9883          .attr({
9884            class: "ui-datepicker-prev ui-corner-all",
9885            "data-handler": "prev",
9886            "data-event": "click",
9887            title: prevText,
9888          })
9889          .append(
9890            $("<span>")
9891              .addClass(
9892                "ui-icon ui-icon-circle-triangle-" + (isRTL ? "e" : "w")
9893              )
9894              .text(prevText)
9895          )[0].outerHTML;
9896      } else if (hideIfNoPrevNext) {
9897        prev = "";
9898      } else {
9899        prev = $("<a>")
9900          .attr({
9901            class: "ui-datepicker-prev ui-corner-all ui-state-disabled",
9902            title: prevText,
9903          })
9904          .append(
9905            $("<span>")
9906              .addClass(
9907                "ui-icon ui-icon-circle-triangle-" + (isRTL ? "e" : "w")
9908              )
9909              .text(prevText)
9910          )[0].outerHTML;
9911      }
9912
9913      nextText = this._get(inst, "nextText");
9914      nextText = !navigationAsDateFormat
9915        ? nextText
9916        : this.formatDate(
9917            nextText,
9918            this._daylightSavingAdjust(
9919              new Date(drawYear, drawMonth + stepMonths, 1)
9920            ),
9921            this._getFormatConfig(inst)
9922          );
9923
9924      if (this._canAdjustMonth(inst, +1, drawYear, drawMonth)) {
9925        next = $("<a>")
9926          .attr({
9927            class: "ui-datepicker-next ui-corner-all",
9928            "data-handler": "next",
9929            "data-event": "click",
9930            title: nextText,
9931          })
9932          .append(
9933            $("<span>")
9934              .addClass(
9935                "ui-icon ui-icon-circle-triangle-" + (isRTL ? "w" : "e")
9936              )
9937              .text(nextText)
9938          )[0].outerHTML;
9939      } else if (hideIfNoPrevNext) {
9940        next = "";
9941      } else {
9942        next = $("<a>")
9943          .attr({
9944            class: "ui-datepicker-next ui-corner-all ui-state-disabled",
9945            title: nextText,
9946          })
9947          .append(
9948            $("<span>")
9949              .attr(
9950                "class",
9951                "ui-icon ui-icon-circle-triangle-" + (isRTL ? "w" : "e")
9952              )
9953              .text(nextText)
9954          )[0].outerHTML;
9955      }
9956
9957      currentText = this._get(inst, "currentText");
9958      gotoDate =
9959        this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today;
9960      currentText = !navigationAsDateFormat
9961        ? currentText
9962        : this.formatDate(currentText, gotoDate, this._getFormatConfig(inst));
9963
9964      controls = "";
9965      if (!inst.inline) {
9966        controls = $("<button>")
9967          .attr({
9968            type: "button",
9969            class:
9970              "ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",
9971            "data-handler": "hide",
9972            "data-event": "click",
9973          })
9974          .text(this._get(inst, "closeText"))[0].outerHTML;
9975      }
9976
9977      buttonPanel = "";
9978      if (showButtonPanel) {
9979        buttonPanel = $(
9980          "<div class='ui-datepicker-buttonpane ui-widget-content'>"
9981        )
9982          .append(isRTL ? controls : "")
9983          .append(
9984            this._isInRange(inst, gotoDate)
9985              ? $("<button>")
9986                  .attr({
9987                    type: "button",
9988                    class:
9989                      "ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all",
9990                    "data-handler": "today",
9991                    "data-event": "click",
9992                  })
9993                  .text(currentText)
9994              : ""
9995          )
9996          .append(isRTL ? "" : controls)[0].outerHTML;
9997      }
9998
9999      firstDay = parseInt(this._get(inst, "firstDay"), 10);
10000      firstDay = isNaN(firstDay) ? 0 : firstDay;
10001
10002      showWeek = this._get(inst, "showWeek");
10003      dayNames = this._get(inst, "dayNames");
10004      dayNamesMin = this._get(inst, "dayNamesMin");
10005      monthNames = this._get(inst, "monthNames");
10006      monthNamesShort = this._get(inst, "monthNamesShort");
10007      beforeShowDay = this._get(inst, "beforeShowDay");
10008      showOtherMonths = this._get(inst, "showOtherMonths");
10009      selectOtherMonths = this._get(inst, "selectOtherMonths");
10010      defaultDate = this._getDefaultDate(inst);
10011      html = "";
10012
10013      for (row = 0; row < numMonths[0]; row++) {
10014        group = "";
10015        this.maxRows = 4;
10016        for (col = 0; col < numMonths[1]; col++) {
10017          selectedDate = this._daylightSavingAdjust(
10018            new Date(drawYear, drawMonth, inst.selectedDay)
10019          );
10020          cornerClass = " ui-corner-all";
10021          calender = "";
10022          if (isMultiMonth) {
10023            calender += "<div class='ui-datepicker-group";
10024            if (numMonths[1] > 1) {
10025              switch (col) {
10026                case 0:
10027                  calender += " ui-datepicker-group-first";
10028                  cornerClass = " ui-corner-" + (isRTL ? "right" : "left");
10029                  break;
10030                case numMonths[1] - 1:
10031                  calender += " ui-datepicker-group-last";
10032                  cornerClass = " ui-corner-" + (isRTL ? "left" : "right");
10033                  break;
10034                default:
10035                  calender += " ui-datepicker-group-middle";
10036                  cornerClass = "";
10037                  break;
10038              }
10039            }
10040            calender += "'>";
10041          }
10042          calender +=
10043            "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" +
10044            cornerClass +
10045            "'>" +
10046            (/all|left/.test(cornerClass) && row === 0
10047              ? isRTL
10048                ? next
10049                : prev
10050              : "") +
10051            (/all|right/.test(cornerClass) && row === 0
10052              ? isRTL
10053                ? prev
10054                : next
10055              : "") +
10056            this._generateMonthYearHeader(
10057              inst,
10058              drawMonth,
10059              drawYear,
10060              minDate,
10061              maxDate,
10062              row > 0 || col > 0,
10063              monthNames,
10064              monthNamesShort
10065            ) + // draw month headers
10066            "</div><table class='ui-datepicker-calendar'><thead>" +
10067            "<tr>";
10068          thead = showWeek
10069            ? "<th class='ui-datepicker-week-col'>" +
10070              this._get(inst, "weekHeader") +
10071              "</th>"
10072            : "";
10073          for (dow = 0; dow < 7; dow++) {
10074            // days of the week
10075            day = (dow + firstDay) % 7;
10076            thead +=
10077              "<th scope='col'" +
10078              ((dow + firstDay + 6) % 7 >= 5
10079                ? " class='ui-datepicker-week-end'"
10080                : "") +
10081              ">" +
10082              "<span title='" +
10083              dayNames[day] +
10084              "'>" +
10085              dayNamesMin[day] +
10086              "</span></th>";
10087          }
10088          calender += thead + "</tr></thead><tbody>";
10089          daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
10090          if (
10091            drawYear === inst.selectedYear &&
10092            drawMonth === inst.selectedMonth
10093          ) {
10094            inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
10095          }
10096          leadDays =
10097            (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
10098          curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
10099          numRows = isMultiMonth
10100            ? this.maxRows > curRows
10101              ? this.maxRows
10102              : curRows
10103            : curRows; //If multiple months, use the higher number of rows (see #7043)
10104          this.maxRows = numRows;
10105          printDate = this._daylightSavingAdjust(
10106            new Date(drawYear, drawMonth, 1 - leadDays)
10107          );
10108          for (dRow = 0; dRow < numRows; dRow++) {
10109            // create date picker rows
10110            calender += "<tr>";
10111            tbody = !showWeek
10112              ? ""
10113              : "<td class='ui-datepicker-week-col'>" +
10114                this._get(inst, "calculateWeek")(printDate) +
10115                "</td>";
10116            for (dow = 0; dow < 7; dow++) {
10117              // create date picker days
10118              daySettings = beforeShowDay
10119                ? beforeShowDay.apply(inst.input ? inst.input[0] : null, [
10120                    printDate,
10121                  ])
10122                : [true, ""];
10123              otherMonth = printDate.getMonth() !== drawMonth;
10124              unselectable =
10125                (otherMonth && !selectOtherMonths) ||
10126                !daySettings[0] ||
10127                (minDate && printDate < minDate) ||
10128                (maxDate && printDate > maxDate);
10129              tbody +=
10130                "<td class='" +
10131                ((dow + firstDay + 6) % 7 >= 5
10132                  ? " ui-datepicker-week-end"
10133                  : "") + // highlight weekends
10134                (otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
10135                ((printDate.getTime() === selectedDate.getTime() &&
10136                  drawMonth === inst.selectedMonth &&
10137                  inst._keyEvent) || // user pressed key
10138                (defaultDate.getTime() === printDate.getTime() &&
10139                  defaultDate.getTime() === selectedDate.getTime())
10140                  ? // or defaultDate is current printedDate and defaultDate is selectedDate
10141                    " " + this._dayOverClass
10142                  : "") + // highlight selected day
10143                (unselectable
10144                  ? " " + this._unselectableClass + " ui-state-disabled"
10145                  : "") + // highlight unselectable days
10146                (otherMonth && !showOtherMonths
10147                  ? ""
10148                  : " " +
10149                    daySettings[1] + // highlight custom dates
10150                    (printDate.getTime() === currentDate.getTime()
10151                      ? " " + this._currentClass
10152                      : "") + // highlight selected day
10153                    (printDate.getTime() === today.getTime()
10154                      ? " ui-datepicker-today"
10155                      : "")) +
10156                "'" + // highlight today (if different)
10157                ((!otherMonth || showOtherMonths) && daySettings[2]
10158                  ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'"
10159                  : "") + // cell title
10160                (unselectable
10161                  ? ""
10162                  : " data-handler='selectDay' data-event='click' data-month='" +
10163                    printDate.getMonth() +
10164                    "' data-year='" +
10165                    printDate.getFullYear() +
10166                    "'") +
10167                ">" + // actions
10168                (otherMonth && !showOtherMonths
10169                  ? "&#xa0;" // display for other months
10170                  : unselectable
10171                  ? "<span class='ui-state-default'>" +
10172                    printDate.getDate() +
10173                    "</span>"
10174                  : "<a class='ui-state-default" +
10175                    (printDate.getTime() === today.getTime()
10176                      ? " ui-state-highlight"
10177                      : "") +
10178                    (printDate.getTime() === currentDate.getTime()
10179                      ? " ui-state-active"
10180                      : "") + // highlight selected day
10181                    (otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
10182                    "' href='#' aria-current='" +
10183                    (printDate.getTime() === currentDate.getTime()
10184                      ? "true"
10185                      : "false") + // mark date as selected for screen reader
10186                    "' data-date='" +
10187                    printDate.getDate() + // store date as data
10188                    "'>" +
10189                    printDate.getDate() +
10190                    "</a>") +
10191                "</td>"; // display selectable date
10192              printDate.setDate(printDate.getDate() + 1);
10193              printD
vendor: 13,446 bytes, lines 10193-10595
10193ate = this._daylightSavingAdjust(printDate);
10194            }
10195            calender += tbody + "</tr>";
10196          }
10197          drawMonth++;
10198          if (drawMonth > 11) {
10199            drawMonth = 0;
10200            drawYear++;
10201          }
10202          calender +=
10203            "</tbody></table>" +
10204            (isMultiMonth
10205              ? "</div>" +
10206                (numMonths[0] > 0 && col === numMonths[1] - 1
10207                  ? "<div class='ui-datepicker-row-break'></div>"
10208                  : "")
10209              : "");
10210          group += calender;
10211        }
10212        html += group;
10213      }
10214      html += buttonPanel;
10215      inst._keyEvent = false;
10216      return html;
10217    },
10218
10219    /* Generate the month and year header. */
10220    _generateMonthYearHeader: function (
10221      inst,
10222      drawMonth,
10223      drawYear,
10224      minDate,
10225      maxDate,
10226      secondary,
10227      monthNames,
10228      monthNamesShort
10229    ) {
10230      var inMinYear,
10231        inMaxYear,
10232        month,
10233        years,
10234        thisYear,
10235        determineYear,
10236        year,
10237        endYear,
10238        changeMonth = this._get(inst, "changeMonth"),
10239        changeYear = this._get(inst, "changeYear"),
10240        showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
10241        selectMonthLabel = this._get(inst, "selectMonthLabel"),
10242        selectYearLabel = this._get(inst, "selectYearLabel"),
10243        html = "<div class='ui-datepicker-title'>",
10244        monthHtml = "";
10245
10246      // Month selection
10247      if (secondary || !changeMonth) {
10248        monthHtml +=
10249          "<span class='ui-datepicker-month'>" +
10250          monthNames[drawMonth] +
10251          "</span>";
10252      } else {
10253        inMinYear = minDate && minDate.getFullYear() === drawYear;
10254        inMaxYear = maxDate && maxDate.getFullYear() === drawYear;
10255        monthHtml +=
10256          "<select class='ui-datepicker-month' aria-label='" +
10257          selectMonthLabel +
10258          "' data-handler='selectMonth' data-event='change'>";
10259        for (month = 0; month < 12; month++) {
10260          if (
10261            (!inMinYear || month >= minDate.getMonth()) &&
10262            (!inMaxYear || month <= maxDate.getMonth())
10263          ) {
10264            monthHtml +=
10265              "<option value='" +
10266              month +
10267              "'" +
10268              (month === drawMonth ? " selected='selected'" : "") +
10269              ">" +
10270              monthNamesShort[month] +
10271              "</option>";
10272          }
10273        }
10274        monthHtml += "</select>";
10275      }
10276
10277      if (!showMonthAfterYear) {
10278        html +=
10279          monthHtml +
10280          (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
10281      }
10282
10283      // Year selection
10284      if (!inst.yearshtml) {
10285        inst.yearshtml = "";
10286        if (secondary || !changeYear) {
10287          html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
10288        } else {
10289          // determine range of years to display
10290          years = this._get(inst, "yearRange").split(":");
10291          thisYear = new Date().getFullYear();
10292          determineYear = function (value) {
10293            var year = value.match(/c[+\-].*/)
10294              ? drawYear + parseInt(value.substring(1), 10)
10295              : value.match(/[+\-].*/)
10296              ? thisYear + parseInt(value, 10)
10297              : parseInt(value, 10);
10298            return isNaN(year) ? thisYear : year;
10299          };
10300          year = determineYear(years[0]);
10301          endYear = Math.max(year, determineYear(years[1] || ""));
10302          year = minDate ? Math.max(year, minDate.getFullYear()) : year;
10303          endYear = maxDate
10304            ? Math.min(endYear, maxDate.getFullYear())
10305            : endYear;
10306          inst.yearshtml +=
10307            "<select class='ui-datepicker-year' aria-label='" +
10308            selectYearLabel +
10309            "' data-handler='selectYear' data-event='change'>";
10310          for (; year <= endYear; year++) {
10311            inst.yearshtml +=
10312              "<option value='" +
10313              year +
10314              "'" +
10315              (year === drawYear ? " selected='selected'" : "") +
10316              ">" +
10317              year +
10318              "</option>";
10319          }
10320          inst.yearshtml += "</select>";
10321
10322          html += inst.yearshtml;
10323          inst.yearshtml = null;
10324        }
10325      }
10326
10327      html += this._get(inst, "yearSuffix");
10328      if (showMonthAfterYear) {
10329        html +=
10330          (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") +
10331          monthHtml;
10332      }
10333      html += "</div>"; // Close datepicker_header
10334      return html;
10335    },
10336
10337    /* Adjust one of the date sub-fields. */
10338    _adjustInstDate: function (inst, offset, period) {
10339      var year = inst.selectedYear + (period === "Y" ? offset : 0),
10340        month = inst.selectedMonth + (period === "M" ? offset : 0),
10341        day =
10342          Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +
10343          (period === "D" ? offset : 0),
10344        date = this._restrictMinMax(
10345          inst,
10346          this._daylightSavingAdjust(new Date(year, month, day))
10347        );
10348
10349      inst.selectedDay = date.getDate();
10350      inst.drawMonth = inst.selectedMonth = date.getMonth();
10351      inst.drawYear = inst.selectedYear = date.getFullYear();
10352      if (period === "M" || period === "Y") {
10353        this._notifyChange(inst);
10354      }
10355    },
10356
10357    /* Ensure a date is within any min/max bounds. */
10358    _restrictMinMax: function (inst, date) {
10359      var minDate = this._getMinMaxDate(inst, "min"),
10360        maxDate = this._getMinMaxDate(inst, "max"),
10361        newDate = minDate && date < minDate ? minDate : date;
10362      return maxDate && newDate > maxDate ? maxDate : newDate;
10363    },
10364
10365    /* Notify change of month/year. */
10366    _notifyChange: function (inst) {
10367      var onChange = this._get(inst, "onChangeMonthYear");
10368      if (onChange) {
10369        onChange.apply(inst.input ? inst.input[0] : null, [
10370          inst.selectedYear,
10371          inst.selectedMonth + 1,
10372          inst,
10373        ]);
10374      }
10375    },
10376
10377    /* Determine the number of months to show. */
10378    _getNumberOfMonths: function (inst) {
10379      var numMonths = this._get(inst, "numberOfMonths");
10380      return numMonths == null
10381        ? [1, 1]
10382        : typeof numMonths === "number"
10383        ? [1, numMonths]
10384        : numMonths;
10385    },
10386
10387    /* Determine the current maximum date - ensure no time components are set. */
10388    _getMinMaxDate: function (inst, minMax) {
10389      return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
10390    },
10391
10392    /* Find the number of days in a given month. */
10393    _getDaysInMonth: function (year, month) {
10394      return (
10395        32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate()
10396      );
10397    },
10398
10399    /* Find the day of the week of the first of a month. */
10400    _getFirstDayOfMonth: function (year, month) {
10401      return new Date(year, month, 1).getDay();
10402    },
10403
10404    /* Determines if we should allow a "next/prev" month display change. */
10405    _canAdjustMonth: function (inst, offset, curYear, curMonth) {
10406      var numMonths = this._getNumberOfMonths(inst),
10407        date = this._daylightSavingAdjust(
10408          new Date(
10409            curYear,
10410            curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]),
10411            1
10412          )
10413        );
10414
10415      if (offset < 0) {
10416        date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
10417      }
10418      return this._isInRange(inst, date);
10419    },
10420
10421    /* Is the given date in the accepted range? */
10422    _isInRange: function (inst, date) {
10423      var yearSplit,
10424        currentYear,
10425        minDate = this._getMinMaxDate(inst, "min"),
10426        maxDate = this._getMinMaxDate(inst, "max"),
10427        minYear = null,
10428        maxYear = null,
10429        years = this._get(inst, "yearRange");
10430      if (years) {
10431        yearSplit = years.split(":");
10432        currentYear = new Date().getFullYear();
10433        minYear = parseInt(yearSplit[0], 10);
10434        maxYear = parseInt(yearSplit[1], 10);
10435        if (yearSplit[0].match(/[+\-].*/)) {
10436          minYear += currentYear;
10437        }
10438        if (yearSplit[1].match(/[+\-].*/)) {
10439          maxYear += currentYear;
10440        }
10441      }
10442
10443      return (
10444        (!minDate || date.getTime() >= minDate.getTime()) &&
10445        (!maxDate || date.getTime() <= maxDate.getTime()) &&
10446        (!minYear || date.getFullYear() >= minYear) &&
10447        (!maxYear || date.getFullYear() <= maxYear)
10448      );
10449    },
10450
10451    /* Provide the configuration settings for formatting/parsing. */
10452    _getFormatConfig: function (inst) {
10453      var shortYearCutoff = this._get(inst, "shortYearCutoff");
10454      shortYearCutoff =
10455        typeof shortYearCutoff !== "string"
10456          ? shortYearCutoff
10457          : (new Date().getFullYear() % 100) + parseInt(shortYearCutoff, 10);
10458      return {
10459        shortYearCutoff: shortYearCutoff,
10460        dayNamesShort: this._get(inst, "dayNamesShort"),
10461        dayNames: this._get(inst, "dayNames"),
10462        monthNamesShort: this._get(inst, "monthNamesShort"),
10463        monthNames: this._get(inst, "monthNames"),
10464      };
10465    },
10466
10467    /* Format the given date for display. */
10468    _formatDate: function (inst, day, month, year) {
10469      if (!day) {
10470        inst.currentDay = inst.selectedDay;
10471        inst.currentMonth = inst.selectedMonth;
10472        inst.currentYear = inst.selectedYear;
10473      }
10474      var date = day
10475        ? typeof day === "object"
10476          ? day
10477          : this._daylightSavingAdjust(new Date(year, month, day))
10478        : this._daylightSavingAdjust(
10479            new Date(inst.currentYear, inst.currentMonth, inst.currentDay)
10480          );
10481      return this.formatDate(
10482        this._get(inst, "dateFormat"),
10483        date,
10484        this._getFormatConfig(inst)
10485      );
10486    },
10487  });
10488
10489  /*
10490   * Bind hover events for datepicker elements.
10491   * Done via delegate so the binding only occurs once in the lifetime of the parent div.
10492   * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
10493   */
10494  function datepicker_bindHover(dpDiv) {
10495    var selector =
10496      "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
10497    return dpDiv
10498      .on("mouseout", selector, function () {
10499        $(this).removeClass("ui-state-hover");
10500        if (this.className.indexOf("ui-datepicker-prev") !== -1) {
10501          $(this).removeClass("ui-datepicker-prev-hover");
10502        }
10503        if (this.className.indexOf("ui-datepicker-next") !== -1) {
10504          $(this).removeClass("ui-datepicker-next-hover");
10505        }
10506      })
10507      .on("mouseover", selector, datepicker_handleMouseover);
10508  }
10509
10510  function datepicker_handleMouseover() {
10511    if (
10512      !$.datepicker._isDisabledDatepicker(
10513        datepicker_instActive.inline
10514          ? datepicker_instActive.dpDiv.parent()[0]
10515          : datepicker_instActive.input[0]
10516      )
10517    ) {
10518      $(this)
10519        .parents(".ui-datepicker-calendar")
10520        .find("a")
10521        .removeClass("ui-state-hover");
10522      $(this).addClass("ui-state-hover");
10523      if (this.className.indexOf("ui-datepicker-prev") !== -1) {
10524        $(this).addClass("ui-datepicker-prev-hover");
10525      }
10526      if (this.className.indexOf("ui-datepicker-next") !== -1) {
10527        $(this).addClass("ui-datepicker-next-hover");
10528      }
10529    }
10530  }
10531
10532  /* jQuery extend now ignores nulls! */
10533  function datepicker_extendRemove(target, props) {
10534    $.extend(target, props);
10535    for (var name in props) {
10536      if (props[name] == null) {
10537        target[name] = props[name];
10538      }
10539    }
10540    return target;
10541  }
10542
10543  /* Invoke the datepicker functionality.
10544   @param  options  string - a command, optionally followed by additional parameters or
10545					Object - settings for attaching new datepicker functionality
10546   @return  jQuery object */
10547  $.fn.datepicker = function (options) {
10548    /* Verify an empty collection wasn't passed - Fixes #6976 */
10549    if (!this.length) {
10550      return this;
10551    }
10552
10553    /* Initialise the date picker. */
10554    if (!$.datepicker.initialized) {
10555      $(document).on("mousedown", $.datepicker._checkExternalClick);
10556      $.datepicker.initialized = true;
10557    }
10558
10559    /* Append datepicker main container to body if not exist. */
10560    if ($("#" + $.datepicker._mainDivId).length === 0) {
10561      $("body").append($.datepicker.dpDiv);
10562    }
10563
10564    var otherArgs = Array.prototype.slice.call(arguments, 1);
10565    if (
10566      typeof options === "string" &&
10567      (options === "isDisabled" ||
10568        options === "getDate" ||
10569        options === "widget")
10570    ) {
10571      return $.datepicker["_" + options + "Datepicker"].apply(
10572        $.datepicker,
10573        [this[0]].concat(otherArgs)
10574      );
10575    }
10576    if (
10577      options === "option" &&
10578      arguments.length === 2 &&
10579      typeof arguments[1] === "string"
10580    ) {
10581      return $.datepicker["_" + options + "Datepicker"].apply(
10582        $.datepicker,
10583        [this[0]].concat(otherArgs)
10584      );
10585    }
10586    return this.each(function () {
10587      if (typeof options === "string") {
10588        $.datepicker["_" + options + "Datepicker"].apply(
10589          $.datepicker,
10590          [this].concat(otherArgs)
10591        );
10592      } else {
10593        $.datepicker._attachDatepicker(this, options);
10594      }
10595    });
vendor: 16,352 bytes, lines 10596-11154
10596  };
10597
10598  $.datepicker = new Datepicker(); // singleton instance
10599  $.datepicker.initialized = false;
10600  $.datepicker.uuid = new Date().getTime();
10601  $.datepicker.version = "1.13.2";
10602
10603  var widgetsDatepicker = $.datepicker;
10604
10605  // This file is deprecated
10606  var ie = ($.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()));
10607
10608  /*!
10609   * jQuery UI Mouse 1.13.2
10610   * http://jqueryui.com
10611   *
10612   * Copyright jQuery Foundation and other contributors
10613   * Released under the MIT license.
10614   * http://jquery.org/license
10615   */
10616
10617  //>>label: Mouse
10618  //>>group: Widgets
10619  //>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
10620  //>>docs: http://api.jqueryui.com/mouse/
10621
10622  var mouseHandled = false;
10623  $(document).on("mouseup", function () {
10624    mouseHandled = false;
10625  });
10626
10627  var widgetsMouse = $.widget("ui.mouse", {
10628    version: "1.13.2",
10629    options: {
10630      cancel: "input, textarea, button, select, option",
10631      distance: 1,
10632      delay: 0,
10633    },
10634    _mouseInit: function () {
10635      var that = this;
10636
10637      this.element
10638        .on("mousedown." + this.widgetName, function (event) {
10639          return that._mouseDown(event);
10640        })
10641        .on("click." + this.widgetName, function (event) {
10642          if (
10643            true ===
10644            $.data(event.target, that.widgetName + ".preventClickEvent")
10645          ) {
10646            $.removeData(event.target, that.widgetName + ".preventClickEvent");
10647            event.stopImmediatePropagation();
10648            return false;
10649          }
10650        });
10651
10652      this.started = false;
10653    },
10654
10655    // TODO: make sure destroying one instance of mouse doesn't mess with
10656    // other instances of mouse
10657    _mouseDestroy: function () {
10658      this.element.off("." + this.widgetName);
10659      if (this._mouseMoveDelegate) {
10660        this.document
10661          .off("mousemove." + this.widgetName, this._mouseMoveDelegate)
10662          .off("mouseup." + this.widgetName, this._mouseUpDelegate);
10663      }
10664    },
10665
10666    _mouseDown: function (event) {
10667      // don't let more than one widget handle mouseStart
10668      if (mouseHandled) {
10669        return;
10670      }
10671
10672      this._mouseMoved = false;
10673
10674      // We may have missed mouseup (out of window)
10675      if (this._mouseStarted) {
10676        this._mouseUp(event);
10677      }
10678
10679      this._mouseDownEvent = event;
10680
10681      var that = this,
10682        btnIsLeft = event.which === 1,
10683        // event.target.nodeName works around a bug in IE 8 with
10684        // disabled inputs (#7620)
10685        elIsCancel =
10686          typeof this.options.cancel === "string" && event.target.nodeName
10687            ? $(event.target).closest(this.options.cancel).length
10688            : false;
10689      if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
10690        return true;
10691      }
10692
10693      this.mouseDelayMet = !this.options.delay;
10694      if (!this.mouseDelayMet) {
10695        this._mouseDelayTimer = setTimeout(function () {
10696          that.mouseDelayMet = true;
10697        }, this.options.delay);
10698      }
10699
10700      if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
10701        this._mouseStarted = this._mouseStart(event) !== false;
10702        if (!this._mouseStarted) {
10703          event.preventDefault();
10704          return true;
10705        }
10706      }
10707
10708      // Click event may never have fired (Gecko & Opera)
10709      if (
10710        true === $.data(event.target, this.widgetName + ".preventClickEvent")
10711      ) {
10712        $.removeData(event.target, this.widgetName + ".preventClickEvent");
10713      }
10714
10715      // These delegates are required to keep context
10716      this._mouseMoveDelegate = function (event) {
10717        return that._mouseMove(event);
10718      };
10719      this._mouseUpDelegate = function (event) {
10720        return that._mouseUp(event);
10721      };
10722
10723      this.document
10724        .on("mousemove." + this.widgetName, this._mouseMoveDelegate)
10725        .on("mouseup." + this.widgetName, this._mouseUpDelegate);
10726
10727      event.preventDefault();
10728
10729      mouseHandled = true;
10730      return true;
10731    },
10732
10733    _mouseMove: function (event) {
10734      // Only check for mouseups outside the document if you've moved inside the document
10735      // at least once. This prevents the firing of mouseup in the case of IE<9, which will
10736      // fire a mousemove event if content is placed under the cursor. See #7778
10737      // Support: IE <9
10738      if (this._mouseMoved) {
10739        // IE mouseup check - mouseup happened when mouse was out of window
10740        if (
10741          $.ui.ie &&
10742          (!document.documentMode || document.documentMode < 9) &&
10743          !event.button
10744        ) {
10745          return this._mouseUp(event);
10746
10747          // Iframe mouseup check - mouseup occurred in another document
10748        } else if (!event.which) {
10749          // Support: Safari <=8 - 9
10750          // Safari sets which to 0 if you press any of the following keys
10751          // during a drag (#14461)
10752          if (
10753            event.originalEvent.altKey ||
10754            event.originalEvent.ctrlKey ||
10755            event.originalEvent.metaKey ||
10756            event.originalEvent.shiftKey
10757          ) {
10758            this.ignoreMissingWhich = true;
10759          } else if (!this.ignoreMissingWhich) {
10760            return this._mouseUp(event);
10761          }
10762        }
10763      }
10764
10765      if (event.which || event.button) {
10766        this._mouseMoved = true;
10767      }
10768
10769      if (this._mouseStarted) {
10770        this._mouseDrag(event);
10771        return event.preventDefault();
10772      }
10773
10774      if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
10775        this._mouseStarted =
10776          this._mouseStart(this._mouseDownEvent, event) !== false;
10777        if (this._mouseStarted) {
10778          this._mouseDrag(event);
10779        } else {
10780          this._mouseUp(event);
10781        }
10782      }
10783
10784      return !this._mouseStarted;
10785    },
10786
10787    _mouseUp: function (event) {
10788      this.document
10789        .off("mousemove." + this.widgetName, this._mouseMoveDelegate)
10790        .off("mouseup." + this.widgetName, this._mouseUpDelegate);
10791
10792      if (this._mouseStarted) {
10793        this._mouseStarted = false;
10794
10795        if (event.target === this._mouseDownEvent.target) {
10796          $.data(event.target, this.widgetName + ".preventClickEvent", true);
10797        }
10798
10799        this._mouseStop(event);
10800      }
10801
10802      if (this._mouseDelayTimer) {
10803        clearTimeout(this._mouseDelayTimer);
10804        delete this._mouseDelayTimer;
10805      }
10806
10807      this.ignoreMissingWhich = false;
10808      mouseHandled = false;
10809      event.preventDefault();
10810    },
10811
10812    _mouseDistanceMet: function (event) {
10813      return (
10814        Math.max(
10815          Math.abs(this._mouseDownEvent.pageX - event.pageX),
10816          Math.abs(this._mouseDownEvent.pageY - event.pageY)
10817        ) >= this.options.distance
10818      );
10819    },
10820
10821    _mouseDelayMet: function (/* event */) {
10822      return this.mouseDelayMet;
10823    },
10824
10825    // These are placeholder methods, to be overriden by extending plugin
10826    _mouseStart: function (/* event */) {},
10827    _mouseDrag: function (/* event */) {},
10828    _mouseStop: function (/* event */) {},
10829    _mouseCapture: function (/* event */) {
10830      return true;
10831    },
10832  });
10833
10834  // $.ui.plugin is deprecated. Use $.widget() extensions instead.
10835  var plugin = ($.ui.plugin = {
10836    add: function (module, option, set) {
10837      var i,
10838        proto = $.ui[module].prototype;
10839      for (i in set) {
10840        proto.plugins[i] = proto.plugins[i] || [];
10841        proto.plugins[i].push([option, set[i]]);
10842      }
10843    },
10844    call: function (instance, name, args, allowDisconnected) {
10845      var i,
10846        set = instance.plugins[name];
10847
10848      if (!set) {
10849        return;
10850      }
10851
10852      if (
10853        !allowDisconnected &&
10854        (!instance.element[0].parentNode ||
10855          instance.element[0].parentNode.nodeType === 11)
10856      ) {
10857        return;
10858      }
10859
10860      for (i = 0; i < set.length; i++) {
10861        if (instance.options[set[i][0]]) {
10862          set[i][1].apply(instance.element, args);
10863        }
10864      }
10865    },
10866  });
10867
10868  var safeBlur = ($.ui.safeBlur = function (element) {
10869    // Support: IE9 - 10 only
10870    // If the <body> is blurred, IE will switch windows, see #9420
10871    if (element && element.nodeName.toLowerCase() !== "body") {
10872      $(element).trigger("blur");
10873    }
10874  });
10875
10876  /*!
10877   * jQuery UI Draggable 1.13.2
10878   * http://jqueryui.com
10879   *
10880   * Copyright jQuery Foundation and other contributors
10881   * Released under the MIT license.
10882   * http://jquery.org/license
10883   */
10884
10885  //>>label: Draggable
10886  //>>group: Interactions
10887  //>>description: Enables dragging functionality for any element.
10888  //>>docs: http://api.jqueryui.com/draggable/
10889  //>>demos: http://jqueryui.com/draggable/
10890  //>>css.structure: ../../themes/base/draggable.css
10891
10892  $.widget("ui.draggable", $.ui.mouse, {
10893    version: "1.13.2",
10894    widgetEventPrefix: "drag",
10895    options: {
10896      addClasses: true,
10897      appendTo: "parent",
10898      axis: false,
10899      connectToSortable: false,
10900      containment: false,
10901      cursor: "auto",
10902      cursorAt: false,
10903      grid: false,
10904      handle: false,
10905      helper: "original",
10906      iframeFix: false,
10907      opacity: false,
10908      refreshPositions: false,
10909      revert: false,
10910      revertDuration: 500,
10911      scope: "default",
10912      scroll: true,
10913      scrollSensitivity: 20,
10914      scrollSpeed: 20,
10915      snap: false,
10916      snapMode: "both",
10917      snapTolerance: 20,
10918      stack: false,
10919      zIndex: false,
10920
10921      // Callbacks
10922      drag: null,
10923      start: null,
10924      stop: null,
10925    },
10926    _create: function () {
10927      if (this.options.helper === "original") {
10928        this._setPositionRelative();
10929      }
10930      if (this.options.addClasses) {
10931        this._addClass("ui-draggable");
10932      }
10933      this._setHandleClassName();
10934
10935      this._mouseInit();
10936    },
10937
10938    _setOption: function (key, value) {
10939      this._super(key, value);
10940      if (key === "handle") {
10941        this._removeHandleClassName();
10942        this._setHandleClassName();
10943      }
10944    },
10945
10946    _destroy: function () {
10947      if ((this.helper || this.element).is(".ui-draggable-dragging")) {
10948        this.destroyOnClear = true;
10949        return;
10950      }
10951      this._removeHandleClassName();
10952      this._mouseDestroy();
10953    },
10954
10955    _mouseCapture: function (event) {
10956      var o = this.options;
10957
10958      // Among others, prevent a drag on a resizable-handle
10959      if (
10960        this.helper ||
10961        o.disabled ||
10962        $(event.target).closest(".ui-resizable-handle").length > 0
10963      ) {
10964        return false;
10965      }
10966
10967      //Quit if we're not on a valid handle
10968      this.handle = this._getHandle(event);
10969      if (!this.handle) {
10970        return false;
10971      }
10972
10973      this._blurActiveElement(event);
10974
10975      this._blockFrames(o.iframeFix === true ? "iframe" : o.iframeFix);
10976
10977      return true;
10978    },
10979
10980    _blockFrames: function (selector) {
10981      this.iframeBlocks = this.document.find(selector).map(function () {
10982        var iframe = $(this);
10983
10984        return $("<div>")
10985          .css("position", "absolute")
10986          .appendTo(iframe.parent())
10987          .outerWidth(iframe.outerWidth())
10988          .outerHeight(iframe.outerHeight())
10989          .offset(iframe.offset())[0];
10990      });
10991    },
10992
10993    _unblockFrames: function () {
10994      if (this.iframeBlocks) {
10995        this.iframeBlocks.remove();
10996        delete this.iframeBlocks;
10997      }
10998    },
10999
11000    _blurActiveElement: function (event) {
11001      var activeElement = $.ui.safeActiveElement(this.document[0]),
11002        target = $(event.target);
11003
11004      // Don't blur if the event occurred on an element that is within
11005      // the currently focused element
11006      // See #10527, #12472
11007      if (target.closest(activeElement).length) {
11008        return;
11009      }
11010
11011      // Blur any element that currently has focus, see #4261
11012      $.ui.safeBlur(activeElement);
11013    },
11014
11015    _mouseStart: function (event) {
11016      var o = this.options;
11017
11018      //Create and append the visible helper
11019      this.helper = this._createHelper(event);
11020
11021      this._addClass(this.helper, "ui-draggable-dragging");
11022
11023      //Cache the helper size
11024      this._cacheHelperProportions();
11025
11026      //If ddmanager is used for droppables, set the global draggable
11027      if ($.ui.ddmanager) {
11028        $.ui.ddmanager.current = this;
11029      }
11030
11031      /*
11032       * - Position generation -
11033       * This block generates everything position related - it's the core of draggables.
11034       */
11035
11036      //Cache the margins of the original element
11037      this._cacheMargins();
11038
11039      //Store the helper's css position
11040      this.cssPosition = this.helper.css("position");
11041      this.scrollParent = this.helper.scrollParent(true);
11042      this.offsetParent = this.helper.offsetParent();
11043      this.hasFixedAncestor =
11044        this.helper.parents().filter(function () {
11045          return $(this).css("position") === "fixed";
11046        }).length > 0;
11047
11048      //The element's absolute position on the page minus margins
11049      this.positionAbs = this.element.offset();
11050      this._refreshOffsets(event);
11051
11052      //Generate the original position
11053      this.originalPosition = this.position = this._generatePosition(
11054        event,
11055        false
11056      );
11057      this.originalPageX = event.pageX;
11058      this.originalPageY = event.pageY;
11059
11060      //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
11061      if (o.cursorAt) {
11062        this._adjustOffsetFromHelper(o.cursorAt);
11063      }
11064
11065      //Set a containment if given in the options
11066      this._setContainment();
11067
11068      //Trigger event + callbacks
11069      if (this._trigger("start", event) === false) {
11070        this._clear();
11071        return false;
11072      }
11073
11074      //Recache the helper size
11075      this._cacheHelperProportions();
11076
11077      //Prepare the droppable offsets
11078      if ($.ui.ddmanager && !o.dropBehaviour) {
11079        $.ui.ddmanager.prepareOffsets(this, event);
11080      }
11081
11082      // Execute the drag once - this causes the helper not to be visible before getting its
11083      // correct position
11084      this._mouseDrag(event, true);
11085
11086      // If the ddmanager is used for droppables, inform the manager that dragging has started
11087      // (see #5003)
11088      if ($.ui.ddmanager) {
11089        $.ui.ddmanager.dragStart(this, event);
11090      }
11091
11092      return true;
11093    },
11094
11095    _refreshOffsets: function (event) {
11096      this.offset = {
11097        top: this.positionAbs.top - this.margins.top,
11098        left: this.positionAbs.left - this.margins.left,
11099        scroll: false,
11100        parent: this._getParentOffset(),
11101        relative: this._getRelativeOffset(),
11102      };
11103
11104      this.offset.click = {
11105        left: event.pageX - this.offset.left,
11106        top: event.pageY - this.offset.top,
11107      };
11108    },
11109
11110    _mouseDrag: function (event, noPropagation) {
11111      // reset any necessary cached properties (see #5009)
11112      if (this.hasFixedAncestor) {
11113        this.offset.parent = this._getParentOffset();
11114      }
11115
11116      //Compute the helpers position
11117      this.position = this._generatePosition(event, true);
11118      this.positionAbs = this._convertPositionTo("absolute");
11119
11120      //Call plugins and callbacks and use the resulting position if something is returned
11121      if (!noPropagation) {
11122        var ui = this._uiHash();
11123        if (this._trigger("drag", event, ui) === false) {
11124          this._mouseUp(new $.Event("mouseup", event));
11125          return false;
11126        }
11127        this.position = ui.position;
11128      }
11129
11130      this.helper[0].style.left = this.position.left + "px";
11131      this.helper[0].style.top = this.position.top + "px";
11132
11133      if ($.ui.ddmanager) {
11134        $.ui.ddmanager.drag(this, event);
11135      }
11136
11137      return false;
11138    },
11139
11140    _mouseStop: function (event) {
11141      //If we are using droppables, inform the manager about the drop
11142      var that = this,
11143        dropped = false;
11144      if ($.ui.ddmanager && !this.options.dropBehaviour) {
11145        dropped = $.ui.ddmanager.drop(this, event);
11146      }
11147
11148      //if a drop comes from outside (a sortable)
11149      if (this.dropped) {
11150        dropped = this.dropped;
11151        this.dropped = false;
11152      }
11153
11154      if (
vendor: 9,522 bytes, lines 11155-11459
11155        (this.options.revert === "invalid" && !dropped) ||
11156        (this.options.revert === "valid" && dropped) ||
11157        this.options.revert === true ||
11158        (typeof this.options.revert === "function" &&
11159          this.options.revert.call(this.element, dropped))
11160      ) {
11161        $(this.helper).animate(
11162          this.originalPosition,
11163          parseInt(this.options.revertDuration, 10),
11164          function () {
11165            if (that._trigger("stop", event) !== false) {
11166              that._clear();
11167            }
11168          }
11169        );
11170      } else {
11171        if (this._trigger("stop", event) !== false) {
11172          this._clear();
11173        }
11174      }
11175
11176      return false;
11177    },
11178
11179    _mouseUp: function (event) {
11180      this._unblockFrames();
11181
11182      // If the ddmanager is used for droppables, inform the manager that dragging has stopped
11183      // (see #5003)
11184      if ($.ui.ddmanager) {
11185        $.ui.ddmanager.dragStop(this, event);
11186      }
11187
11188      // Only need to focus if the event occurred on the draggable itself, see #10527
11189      if (this.handleElement.is(event.target)) {
11190        // The interaction is over; whether or not the click resulted in a drag,
11191        // focus the element
11192        this.element.trigger("focus");
11193      }
11194
11195      return $.ui.mouse.prototype._mouseUp.call(this, event);
11196    },
11197
11198    cancel: function () {
11199      if (this.helper.is(".ui-draggable-dragging")) {
11200        this._mouseUp(new $.Event("mouseup", { target: this.element[0] }));
11201      } else {
11202        this._clear();
11203      }
11204
11205      return this;
11206    },
11207
11208    _getHandle: function (event) {
11209      return this.options.handle
11210        ? !!$(event.target).closest(this.element.find(this.options.handle))
11211            .length
11212        : true;
11213    },
11214
11215    _setHandleClassName: function () {
11216      this.handleElement = this.options.handle
11217        ? this.element.find(this.options.handle)
11218        : this.element;
11219      this._addClass(this.handleElement, "ui-draggable-handle");
11220    },
11221
11222    _removeHandleClassName: function () {
11223      this._removeClass(this.handleElement, "ui-draggable-handle");
11224    },
11225
11226    _createHelper: function (event) {
11227      var o = this.options,
11228        helperIsFunction = typeof o.helper === "function",
11229        helper = helperIsFunction
11230          ? $(o.helper.apply(this.element[0], [event]))
11231          : o.helper === "clone"
11232          ? this.element.clone().removeAttr("id")
11233          : this.element;
11234
11235      if (!helper.parents("body").length) {
11236        helper.appendTo(
11237          o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo
11238        );
11239      }
11240
11241      // Http://bugs.jqueryui.com/ticket/9446
11242      // a helper function can return the original element
11243      // which wouldn't have been set to relative in _create
11244      if (helperIsFunction && helper[0] === this.element[0]) {
11245        this._setPositionRelative();
11246      }
11247
11248      if (
11249        helper[0] !== this.element[0] &&
11250        !/(fixed|absolute)/.test(helper.css("position"))
11251      ) {
11252        helper.css("position", "absolute");
11253      }
11254
11255      return helper;
11256    },
11257
11258    _setPositionRelative: function () {
11259      if (!/^(?:r|a|f)/.test(this.element.css("position"))) {
11260        this.element[0].style.position = "relative";
11261      }
11262    },
11263
11264    _adjustOffsetFromHelper: function (obj) {
11265      if (typeof obj === "string") {
11266        obj = obj.split(" ");
11267      }
11268      if (Array.isArray(obj)) {
11269        obj = { left: +obj[0], top: +obj[1] || 0 };
11270      }
11271      if ("left" in obj) {
11272        this.offset.click.left = obj.left + this.margins.left;
11273      }
11274      if ("right" in obj) {
11275        this.offset.click.left =
11276          this.helperProportions.width - obj.right + this.margins.left;
11277      }
11278      if ("top" in obj) {
11279        this.offset.click.top = obj.top + this.margins.top;
11280      }
11281      if ("bottom" in obj) {
11282        this.offset.click.top =
11283          this.helperProportions.height - obj.bottom + this.margins.top;
11284      }
11285    },
11286
11287    _isRootNode: function (element) {
11288      return (
11289        /(html|body)/i.test(element.tagName) || element === this.document[0]
11290      );
11291    },
11292
11293    _getParentOffset: function () {
11294      //Get the offsetParent and cache its position
11295      var po = this.offsetParent.offset(),
11296        document = this.document[0];
11297
11298      // This is a special case where we need to modify a offset calculated on start, since the
11299      // following happened:
11300      // 1. The position of the helper is absolute, so it's position is calculated based on the
11301      // next positioned parent
11302      // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
11303      // the document, which means that the scroll is included in the initial calculation of the
11304      // offset of the parent, and never recalculated upon drag
11305      if (
11306        this.cssPosition === "absolute" &&
11307        this.scrollParent[0] !== document &&
11308        $.contains(this.scrollParent[0], this.offsetParent[0])
11309      ) {
11310        po.left += this.scrollParent.scrollLeft();
11311        po.top += this.scrollParent.scrollTop();
11312      }
11313
11314      if (this._isRootNode(this.offsetParent[0])) {
11315        po = { top: 0, left: 0 };
11316      }
11317
11318      return {
11319        top:
11320          po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
11321        left:
11322          po.left +
11323          (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0),
11324      };
11325    },
11326
11327    _getRelativeOffset: function () {
11328      if (this.cssPosition !== "relative") {
11329        return { top: 0, left: 0 };
11330      }
11331
11332      var p = this.element.position(),
11333        scrollIsRootNode = this._isRootNode(this.scrollParent[0]);
11334
11335      return {
11336        top:
11337          p.top -
11338          (parseInt(this.helper.css("top"), 10) || 0) +
11339          (!scrollIsRootNode ? this.scrollParent.scrollTop() : 0),
11340        left:
11341          p.left -
11342          (parseInt(this.helper.css("left"), 10) || 0) +
11343          (!scrollIsRootNode ? this.scrollParent.scrollLeft() : 0),
11344      };
11345    },
11346
11347    _cacheMargins: function () {
11348      this.margins = {
11349        left: parseInt(this.element.css("marginLeft"), 10) || 0,
11350        top: parseInt(this.element.css("marginTop"), 10) || 0,
11351        right: parseInt(this.element.css("marginRight"), 10) || 0,
11352        bottom: parseInt(this.element.css("marginBottom"), 10) || 0,
11353      };
11354    },
11355
11356    _cacheHelperProportions: function () {
11357      this.helperProportions = {
11358        width: this.helper.outerWidth(),
11359        height: this.helper.outerHeight(),
11360      };
11361    },
11362
11363    _setContainment: function () {
11364      var isUserScrollable,
11365        c,
11366        ce,
11367        o = this.options,
11368        document = this.document[0];
11369
11370      this.relativeContainer = null;
11371
11372      if (!o.containment) {
11373        this.containment = null;
11374        return;
11375      }
11376
11377      if (o.containment === "window") {
11378        this.containment = [
11379          $(window).scrollLeft() -
11380            this.offset.relative.left -
11381            this.offset.parent.left,
11382          $(window).scrollTop() -
11383            this.offset.relative.top -
11384            this.offset.parent.top,
11385          $(window).scrollLeft() +
11386            $(window).width() -
11387            this.helperProportions.width -
11388            this.margins.left,
11389          $(window).scrollTop() +
11390            ($(window).height() || document.body.parentNode.scrollHeight) -
11391            this.helperProportions.height -
11392            this.margins.top,
11393        ];
11394        return;
11395      }
11396
11397      if (o.containment === "document") {
11398        this.containment = [
11399          0,
11400          0,
11401          $(document).width() -
11402            this.helperProportions.width -
11403            this.margins.left,
11404          ($(document).height() || document.body.parentNode.scrollHeight) -
11405            this.helperProportions.height -
11406            this.margins.top,
11407        ];
11408        return;
11409      }
11410
11411      if (o.containment.constructor === Array) {
11412        this.containment = o.containment;
11413        return;
11414      }
11415
11416      if (o.containment === "parent") {
11417        o.containment = this.helper[0].parentNode;
11418      }
11419
11420      c = $(o.containment);
11421      ce = c[0];
11422
11423      if (!ce) {
11424        return;
11425      }
11426
11427      isUserScrollable = /(scroll|auto)/.test(c.css("overflow"));
11428
11429      this.containment = [
11430        (parseInt(c.css("borderLeftWidth"), 10) || 0) +
11431          (parseInt(c.css("paddingLeft"), 10) || 0),
11432        (parseInt(c.css("borderTopWidth"), 10) || 0) +
11433          (parseInt(c.css("paddingTop"), 10) || 0),
11434        (isUserScrollable
11435          ? Math.max(ce.scrollWidth, ce.offsetWidth)
11436          : ce.offsetWidth) -
11437          (parseInt(c.css("borderRightWidth"), 10) || 0) -
11438          (parseInt(c.css("paddingRight"), 10) || 0) -
11439          this.helperProportions.width -
11440          this.margins.left -
11441          this.margins.right,
11442        (isUserScrollable
11443          ? Math.max(ce.scrollHeight, ce.offsetHeight)
11444          : ce.offsetHeight) -
11445          (parseInt(c.css("borderBottomWidth"), 10) || 0) -
11446          (parseInt(c.css("paddingBottom"), 10) || 0) -
11447          this.helperProportions.height -
11448          this.margins.top -
11449          this.margins.bottom,
11450      ];
11451      this.relativeContainer = c;
11452    },
11453
11454    _convertPositionTo: function (d, pos) {
11455      if (!pos) {
11456        pos = this.position;
11457      }
11458
11459      var mod = d === "absolute" ? 1 : -1,
11460        scrollIsRootNode = this._isRootNode(this.scrollParent[0]);
11461
11462      return {
11463        top:
11464          // The absolute mouse position
11465          pos.top +
11466          // Only for relative positioned nodes: Relative offset from element to offset parent
11467          this.offset.relative.top * mod +
11468          // The offsetParent's offset without borders (offset + border)
11469          this.offset.parent.top * mod -
11470          (this.cssPosition === "fixed"
11471            ? -this.offset.scroll.top
11472            : scrollIsRootNode
11473            ? 0
11474            : this.offset.scroll.top) *
11475            mod,
11476        left:
11477          // The absolute mouse position
11478          pos.left +
11479          // Only for relative positioned nodes: Relative offset from element to offset parent
11480          this.offset.relative.left * mod +
11481          // The offsetParent's offset without borders (offset + border)
11482          this.offset.parent.left * mod -
11483          (this.cssPosition === "fixed"
11484            ? -this.offset.scroll.left
11485            : scrollIsRootNode
11486            ? 0
11487            : this.offset.scroll.left) *
11488            mod,
11489      };
11490    },
11491
11492    _generatePosition: function (event, constrainPosition) {
11493      var containment,
11494        co,
11495        top,
11496        left,
11497        o = this.options,
11498        scrollIsRootNode = this._isRootNode(this.scrollParent[0]),
11499        pageX = event.pageX,
11500        pageY = event.pageY;
11501
11502      // Cache the scroll
11503      if (!scrollIsRootNode || !this.offset.scroll) {
11504        this.offset.scroll = {
11505          top: this.scrollParent.scrollTop(),
11506          left: this.scrollParent.scrollLeft(),
11507        };
11508      }
11509
11510      /*
11511       * - Position constraining -
11512       * Constrain the position to a mix of grid, containment.
11513       */
11514
11515      // If we are not dragging yet, we won't check for options
11516      if (constrainPosition) {
11517        if (this.containment) {
11518          if (this.relativeContainer) {
11519            co = this.relativeContainer.offset();
11520            containment = [
11521              this.containment[0] + co.left,
11522              this.containment[1] + co.top,
11523              this.containment[2] + co.left,
11524              this.containment[3] + co.top,
11525            ];
11526          } else {
11527            containment = this.containment;
11528          }
11529
11530          if (event.pageX - this.offset.click.left < containment[0]) {
11531            pageX = containment[0] + this.offset.click.left;
11532          }
11533          if (event.pageY - this.offset.click.top < containment[1]) {
11534            pageY = containment[1] + this.offset.click.top;
11535          }
11536          if (event.pageX - this.offset.click.left > containment[2]) {
11537            pageX = containment[2] + this.offset.click.left;
11538          }
11539          if (event.pageY - this.offset.click.top > containment[3]) {
11540            pageY = containment[3] + this.offset.click.top;
11541          }
11542        }
11543
11544        if (o.grid) {
11545          //Check for grid elements set to 0 to prevent divide by 0 error causing invalid
11546          // argument errors in IE (see ticket #6950)
11547          top = o.grid[1]
11548            ? this.originalPageY +
11549              Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]
11550            : this.originalPageY;
11551          pageY = containment
11552            ? top - this.offset.click.top >= containment[1] ||
11553              top - this.offset.click.top > containment[3]
11554              ? top
11555              : top - this.offset.click.top >= containment[1]
11556              ? top - o.grid[1]
11557              : top + o.grid[1]
11558            : top;
11559
11560          left = o.grid[0]
11561            ? this.originalPageX +
11562              Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]
11563            : this.originalPageX;
11564          pageX = containment
11565            ? left - this.offset.click.left >= containment[0] ||
11566              left - this.offset.click.left > containment[2]
11567              ? left
11568              : left - this.offset.click.left >= containment[0]
11569              ? left - o.grid[0]
11570              : left + o.grid[0]
11571            : left;
11572        }
11573
11574        if (o.axis === "y") {
11575          pageX = this.originalPageX;
11576        }
11577
11578        if (o.axis === "x") {
11579          pageY = this.originalPageY;
11580        }
11581      }
11582
11583      return {
11584        top:
11585          // The absolute mouse position
11586          pageY -
11587          // Click offset (relative to the element)
11588          this.offset.click.top -
11589          // Only for relative positioned nodes: Relative offset from element to offset parent
11590          this.offset.relative.top -
11591          // The offsetParent's offset without borders (offset + border)
11592          this.offset.parent.top +
11593          (this.cssPosition === "fixed"
11594            ? -this.offset.scroll.top
11595            : scrollIsRootNode
11596            ? 0
11597            : this.offset.scroll.top),
11598        left:
11599          // The absolute mouse position
11600          pageX -
11601          // Click offset (relative to the element)
11602          this.offset.click.left -
11603          // Only for relative positioned nodes: Relative offset from element to offset parent
11604          this.offset.relative.left -
11605          // The offsetParent's offset without borders (offset + border)
11606          this.offset.parent.left +
11607          (this.cssPosition === "fixed"
11608            ? -this.offset.scroll.left
11609            : scrollIsRootNode
11610            ? 0
11611            : this.offset.scroll.left),
11612      };
11613    },
11614
11615    _clear: function () {
11616      this._removeClass(this.helper, "ui-draggable-dragging");
11617      if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
11618        this.helper.remove();
11619      }
11620      this.helper = null;
11621      this.cancelHelperRemoval = false;
11622      if (this.destroyOnClear) {
11623        this.destroy();
11624      }
11625    },
11626
11627    // From now on bulk stuff - mainly helpers
11628
11629    _trigger: function (type, event, ui) {
11630      ui = ui || this._uiHash();
11631      $.ui.plugin.call(this, type, [event, ui, this], true);
11632
11633      // Absolute position and offset (see #6884 ) have to be recalculated after plugins
vendor: 18,070 bytes, lines 11634-12173
11634      if (/^(drag|start|stop)/.test(type)) {
11635        this.positionAbs = this._convertPositionTo("absolute");
11636        ui.offset = this.positionAbs;
11637      }
11638      return $.Widget.prototype._trigger.call(this, type, event, ui);
11639    },
11640
11641    plugins: {},
11642
11643    _uiHash: function () {
11644      return {
11645        helper: this.helper,
11646        position: this.position,
11647        originalPosition: this.originalPosition,
11648        offset: this.positionAbs,
11649      };
11650    },
11651  });
11652
11653  $.ui.plugin.add("draggable", "connectToSortable", {
11654    start: function (event, ui, draggable) {
11655      var uiSortable = $.extend({}, ui, {
11656        item: draggable.element,
11657      });
11658
11659      draggable.sortables = [];
11660      $(draggable.options.connectToSortable).each(function () {
11661        var sortable = $(this).sortable("instance");
11662
11663        if (sortable && !sortable.options.disabled) {
11664          draggable.sortables.push(sortable);
11665
11666          // RefreshPositions is called at drag start to refresh the containerCache
11667          // which is used in drag. This ensures it's initialized and synchronized
11668          // with any changes that might have happened on the page since initialization.
11669          sortable.refreshPositions();
11670          sortable._trigger("activate", event, uiSortable);
11671        }
11672      });
11673    },
11674    stop: function (event, ui, draggable) {
11675      var uiSortable = $.extend({}, ui, {
11676        item: draggable.element,
11677      });
11678
11679      draggable.cancelHelperRemoval = false;
11680
11681      $.each(draggable.sortables, function () {
11682        var sortable = this;
11683
11684        if (sortable.isOver) {
11685          sortable.isOver = 0;
11686
11687          // Allow this sortable to handle removing the helper
11688          draggable.cancelHelperRemoval = true;
11689          sortable.cancelHelperRemoval = false;
11690
11691          // Use _storedCSS To restore properties in the sortable,
11692          // as this also handles revert (#9675) since the draggable
11693          // may have modified them in unexpected ways (#8809)
11694          sortable._storedCSS = {
11695            position: sortable.placeholder.css("position"),
11696            top: sortable.placeholder.css("top"),
11697            left: sortable.placeholder.css("left"),
11698          };
11699
11700          sortable._mouseStop(event);
11701
11702          // Once drag has ended, the sortable should return to using
11703          // its original helper, not the shared helper from draggable
11704          sortable.options.helper = sortable.options._helper;
11705        } else {
11706          // Prevent this Sortable from removing the helper.
11707          // However, don't set the draggable to remove the helper
11708          // either as another connected Sortable may yet handle the removal.
11709          sortable.cancelHelperRemoval = true;
11710
11711          sortable._trigger("deactivate", event, uiSortable);
11712        }
11713      });
11714    },
11715    drag: function (event, ui, draggable) {
11716      $.each(draggable.sortables, function () {
11717        var innermostIntersecting = false,
11718          sortable = this;
11719
11720        // Copy over variables that sortable's _intersectsWith uses
11721        sortable.positionAbs = draggable.positionAbs;
11722        sortable.helperProportions = draggable.helperProportions;
11723        sortable.offset.click = draggable.offset.click;
11724
11725        if (sortable._intersectsWith(sortable.containerCache)) {
11726          innermostIntersecting = true;
11727
11728          $.each(draggable.sortables, function () {
11729            // Copy over variables that sortable's _intersectsWith uses
11730            this.positionAbs = draggable.positionAbs;
11731            this.helperProportions = draggable.helperProportions;
11732            this.offset.click = draggable.offset.click;
11733
11734            if (
11735              this !== sortable &&
11736              this._intersectsWith(this.containerCache) &&
11737              $.contains(sortable.element[0], this.element[0])
11738            ) {
11739              innermostIntersecting = false;
11740            }
11741
11742            return innermostIntersecting;
11743          });
11744        }
11745
11746        if (innermostIntersecting) {
11747          // If it intersects, we use a little isOver variable and set it once,
11748          // so that the move-in stuff gets fired only once.
11749          if (!sortable.isOver) {
11750            sortable.isOver = 1;
11751
11752            // Store draggable's parent in case we need to reappend to it later.
11753            draggable._parent = ui.helper.parent();
11754
11755            sortable.currentItem = ui.helper
11756              .appendTo(sortable.element)
11757              .data("ui-sortable-item", true);
11758
11759            // Store helper option to later restore it
11760            sortable.options._helper = sortable.options.helper;
11761
11762            sortable.options.helper = function () {
11763              return ui.helper[0];
11764            };
11765
11766            // Fire the start events of the sortable with our passed browser event,
11767            // and our own helper (so it doesn't create a new one)
11768            event.target = sortable.currentItem[0];
11769            sortable._mouseCapture(event, true);
11770            sortable._mouseStart(event, true, true);
11771
11772            // Because the browser event is way off the new appended portlet,
11773            // modify necessary variables to reflect the changes
11774            sortable.offset.click.top = draggable.offset.click.top;
11775            sortable.offset.click.left = draggable.offset.click.left;
11776            sortable.offset.parent.left -=
11777              draggable.offset.parent.left - sortable.offset.parent.left;
11778            sortable.offset.parent.top -=
11779              draggable.offset.parent.top - sortable.offset.parent.top;
11780
11781            draggable._trigger("toSortable", event);
11782
11783            // Inform draggable that the helper is in a valid drop zone,
11784            // used solely in the revert option to handle "valid/invalid".
11785            draggable.dropped = sortable.element;
11786
11787            // Need to refreshPositions of all sortables in the case that
11788            // adding to one sortable changes the location of the other sortables (#9675)
11789            $.each(draggable.sortables, function () {
11790              this.refreshPositions();
11791            });
11792
11793            // Hack so receive/update callbacks work (mostly)
11794            draggable.currentItem = draggable.element;
11795            sortable.fromOutside = draggable;
11796          }
11797
11798          if (sortable.currentItem) {
11799            sortable._mouseDrag(event);
11800
11801            // Copy the sortable's position because the draggable's can potentially reflect
11802            // a relative position, while sortable is always absolute, which the dragged
11803            // element has now become. (#8809)
11804            ui.position = sortable.position;
11805          }
11806        } else {
11807          // If it doesn't intersect with the sortable, and it intersected before,
11808          // we fake the drag stop of the sortable, but make sure it doesn't remove
11809          // the helper by using cancelHelperRemoval.
11810          if (sortable.isOver) {
11811            sortable.isOver = 0;
11812            sortable.cancelHelperRemoval = true;
11813
11814            // Calling sortable's mouseStop would trigger a revert,
11815            // so revert must be temporarily false until after mouseStop is called.
11816            sortable.options._revert = sortable.options.revert;
11817            sortable.options.revert = false;
11818
11819            sortable._trigger("out", event, sortable._uiHash(sortable));
11820            sortable._mouseStop(event, true);
11821
11822            // Restore sortable behaviors that were modfied
11823            // when the draggable entered the sortable area (#9481)
11824            sortable.options.revert = sortable.options._revert;
11825            sortable.options.helper = sortable.options._helper;
11826
11827            if (sortable.placeholder) {
11828              sortable.placeholder.remove();
11829            }
11830
11831            // Restore and recalculate the draggable's offset considering the sortable
11832            // may have modified them in unexpected ways. (#8809, #10669)
11833            ui.helper.appendTo(draggable._parent);
11834            draggable._refreshOffsets(event);
11835            ui.position = draggable._generatePosition(event, true);
11836
11837            draggable._trigger("fromSortable", event);
11838
11839            // Inform draggable that the helper is no longer in a valid drop zone
11840            draggable.dropped = false;
11841
11842            // Need to refreshPositions of all sortables just in case removing
11843            // from one sortable changes the location of other sortables (#9675)
11844            $.each(draggable.sortables, function () {
11845              this.refreshPositions();
11846            });
11847          }
11848        }
11849      });
11850    },
11851  });
11852
11853  $.ui.plugin.add("draggable", "cursor", {
11854    start: function (event, ui, instance) {
11855      var t = $("body"),
11856        o = instance.options;
11857
11858      if (t.css("cursor")) {
11859        o._cursor = t.css("cursor");
11860      }
11861      t.css("cursor", o.cursor);
11862    },
11863    stop: function (event, ui, instance) {
11864      var o = instance.options;
11865      if (o._cursor) {
11866        $("body").css("cursor", o._cursor);
11867      }
11868    },
11869  });
11870
11871  $.ui.plugin.add("draggable", "opacity", {
11872    start: function (event, ui, instance) {
11873      var t = $(ui.helper),
11874        o = instance.options;
11875      if (t.css("opacity")) {
11876        o._opacity = t.css("opacity");
11877      }
11878      t.css("opacity", o.opacity);
11879    },
11880    stop: function (event, ui, instance) {
11881      var o = instance.options;
11882      if (o._opacity) {
11883        $(ui.helper).css("opacity", o._opacity);
11884      }
11885    },
11886  });
11887
11888  $.ui.plugin.add("draggable", "scroll", {
11889    start: function (event, ui, i) {
11890      if (!i.scrollParentNotHidden) {
11891        i.scrollParentNotHidden = i.helper.scrollParent(false);
11892      }
11893
11894      if (
11895        i.scrollParentNotHidden[0] !== i.document[0] &&
11896        i.scrollParentNotHidden[0].tagName !== "HTML"
11897      ) {
11898        i.overflowOffset = i.scrollParentNotHidden.offset();
11899      }
11900    },
11901    drag: function (event, ui, i) {
11902      var o = i.options,
11903        scrolled = false,
11904        scrollParent = i.scrollParentNotHidden[0],
11905        document = i.document[0];
11906
11907      if (scrollParent !== document && scrollParent.tagName !== "HTML") {
11908        if (!o.axis || o.axis !== "x") {
11909          if (
11910            i.overflowOffset.top + scrollParent.offsetHeight - event.pageY <
11911            o.scrollSensitivity
11912          ) {
11913            scrollParent.scrollTop = scrolled =
11914              scrollParent.scrollTop + o.scrollSpeed;
11915          } else if (event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
11916            scrollParent.scrollTop = scrolled =
11917              scrollParent.scrollTop - o.scrollSpeed;
11918          }
11919        }
11920
11921        if (!o.axis || o.axis !== "y") {
11922          if (
11923            i.overflowOffset.left + scrollParent.offsetWidth - event.pageX <
11924            o.scrollSensitivity
11925          ) {
11926            scrollParent.scrollLeft = scrolled =
11927              scrollParent.scrollLeft + o.scrollSpeed;
11928          } else if (
11929            event.pageX - i.overflowOffset.left <
11930            o.scrollSensitivity
11931          ) {
11932            scrollParent.scrollLeft = scrolled =
11933              scrollParent.scrollLeft - o.scrollSpeed;
11934          }
11935        }
11936      } else {
11937        if (!o.axis || o.axis !== "x") {
11938          if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
11939            scrolled = $(document).scrollTop(
11940              $(document).scrollTop() - o.scrollSpeed
11941            );
11942          } else if (
11943            $(window).height() - (event.pageY - $(document).scrollTop()) <
11944            o.scrollSensitivity
11945          ) {
11946            scrolled = $(document).scrollTop(
11947              $(document).scrollTop() + o.scrollSpeed
11948            );
11949          }
11950        }
11951
11952        if (!o.axis || o.axis !== "y") {
11953          if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
11954            scrolled = $(document).scrollLeft(
11955              $(document).scrollLeft() - o.scrollSpeed
11956            );
11957          } else if (
11958            $(window).width() - (event.pageX - $(document).scrollLeft()) <
11959            o.scrollSensitivity
11960          ) {
11961            scrolled = $(document).scrollLeft(
11962              $(document).scrollLeft() + o.scrollSpeed
11963            );
11964          }
11965        }
11966      }
11967
11968      if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
11969        $.ui.ddmanager.prepareOffsets(i, event);
11970      }
11971    },
11972  });
11973
11974  $.ui.plugin.add("draggable", "snap", {
11975    start: function (event, ui, i) {
11976      var o = i.options;
11977
11978      i.snapElements = [];
11979
11980      $(
11981        o.snap.constructor !== String
11982          ? o.snap.items || ":data(ui-draggable)"
11983          : o.snap
11984      ).each(function () {
11985        var $t = $(this),
11986          $o = $t.offset();
11987        if (this !== i.element[0]) {
11988          i.snapElements.push({
11989            item: this,
11990            width: $t.outerWidth(),
11991            height: $t.outerHeight(),
11992            top: $o.top,
11993            left: $o.left,
11994          });
11995        }
11996      });
11997    },
11998    drag: function (event, ui, inst) {
11999      var ts,
12000        bs,
12001        ls,
12002        rs,
12003        l,
12004        r,
12005        t,
12006        b,
12007        i,
12008        first,
12009        o = inst.options,
12010        d = o.snapTolerance,
12011        x1 = ui.offset.left,
12012        x2 = x1 + inst.helperProportions.width,
12013        y1 = ui.offset.top,
12014        y2 = y1 + inst.helperProportions.height;
12015
12016      for (i = inst.snapElements.length - 1; i >= 0; i--) {
12017        l = inst.snapElements[i].left - inst.margins.left;
12018        r = l + inst.snapElements[i].width;
12019        t = inst.snapElements[i].top - inst.margins.top;
12020        b = t + inst.snapElements[i].height;
12021
12022        if (
12023          x2 < l - d ||
12024          x1 > r + d ||
12025          y2 < t - d ||
12026          y1 > b + d ||
12027          !$.contains(
12028            inst.snapElements[i].item.ownerDocument,
12029            inst.snapElements[i].item
12030          )
12031        ) {
12032          if (inst.snapElements[i].snapping) {
12033            if (inst.options.snap.release) {
12034              inst.options.snap.release.call(
12035                inst.element,
12036                event,
12037                $.extend(inst._uiHash(), {
12038                  snapItem: inst.snapElements[i].item,
12039                })
12040              );
12041            }
12042          }
12043          inst.snapElements[i].snapping = false;
12044          continue;
12045        }
12046
12047        if (o.snapMode !== "inner") {
12048          ts = Math.abs(t - y2) <= d;
12049          bs = Math.abs(b - y1) <= d;
12050          ls = Math.abs(l - x2) <= d;
12051          rs = Math.abs(r - x1) <= d;
12052          if (ts) {
12053            ui.position.top = inst._convertPositionTo("relative", {
12054              top: t - inst.helperProportions.height,
12055              left: 0,
12056            }).top;
12057          }
12058          if (bs) {
12059            ui.position.top = inst._convertPositionTo("relative", {
12060              top: b,
12061              left: 0,
12062            }).top;
12063          }
12064          if (ls) {
12065            ui.position.left = inst._convertPositionTo("relative", {
12066              top: 0,
12067              left: l - inst.helperProportions.width,
12068            }).left;
12069          }
12070          if (rs) {
12071            ui.position.left = inst._convertPositionTo("relative", {
12072              top: 0,
12073              left: r,
12074            }).left;
12075          }
12076        }
12077
12078        first = ts || bs || ls || rs;
12079
12080        if (o.snapMode !== "outer") {
12081          ts = Math.abs(t - y1) <= d;
12082          bs = Math.abs(b - y2) <= d;
12083          ls = Math.abs(l - x1) <= d;
12084          rs = Math.abs(r - x2) <= d;
12085          if (ts) {
12086            ui.position.top = inst._convertPositionTo("relative", {
12087              top: t,
12088              left: 0,
12089            }).top;
12090          }
12091          if (bs) {
12092            ui.position.top = inst._convertPositionTo("relative", {
12093              top: b - inst.helperProportions.height,
12094              left: 0,
12095            }).top;
12096          }
12097          if (ls) {
12098            ui.position.left = inst._convertPositionTo("relative", {
12099              top: 0,
12100              left: l,
12101            }).left;
12102          }
12103          if (rs) {
12104            ui.position.left = inst._convertPositionTo("relative", {
12105              top: 0,
12106              left: r - inst.helperProportions.width,
12107            }).left;
12108          }
12109        }
12110
12111        if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
12112          if (inst.options.snap.snap) {
12113            inst.options.snap.snap.call(
12114              inst.element,
12115              event,
12116              $.extend(inst._uiHash(), {
12117                snapItem: inst.snapElements[i].item,
12118              })
12119            );
12120          }
12121        }
12122        inst.snapElements[i].snapping = ts || bs || ls || rs || first;
12123      }
12124    },
12125  });
12126
12127  $.ui.plugin.add("draggable", "stack", {
12128    start: function (event, ui, instance) {
12129      var min,
12130        o = instance.options,
12131        group = $.makeArray($(o.stack)).sort(function (a, b) {
12132          return (
12133            (parseInt($(a).css("zIndex"), 10) || 0) -
12134            (parseInt($(b).css("zIndex"), 10) || 0)
12135          );
12136        });
12137
12138      if (!group.length) {
12139        return;
12140      }
12141
12142      min = parseInt($(group[0]).css("zIndex"), 10) || 0;
12143      $(group).each(function (i) {
12144        $(this).css("zIndex", min + i);
12145      });
12146      this.css("zIndex", min + group.length);
12147    },
12148  });
12149
12150  $.ui.plugin.add("draggable", "zIndex", {
12151    start: function (event, ui, instance) {
12152      var t = $(ui.helper),
12153        o = instance.options;
12154
12155      if (t.css("zIndex")) {
12156        o._zIndex = t.css("zIndex");
12157      }
12158      t.css("zIndex", o.zIndex);
12159    },
12160    stop: function (event, ui, instance) {
12161      var o = instance.options;
12162
12163      if (o._zIndex) {
12164        $(ui.helper).css("zIndex", o._zIndex);
12165      }
12166    },
12167  });
12168
12169  var widgetsDraggable = $.ui.draggable;
12170
12171  /*!
12172   * jQuery UI Resizable 1.13.2
12173   * http://jqueryui.com
12174   *
12175   * Copyright jQuery Foundation and other contributors
12176   * Released under the MIT license.
12177   * http://jquery.org/license
12178   */
12179
12180  //>>label: Resizable
12181  //>>group: Interactions
12182  //>>description: Enables resize functionality for any element.
12183  //>>docs: http://api.jqueryui.com/resizable/
12184  //>>demos: http://jqueryui.com/resizable/
12185  //>>css.structure: ../../themes/base/core.css
12186  //>>css.structure: ../../themes/base/resizable.css
12187  //>>css.theme: ../../themes/base/theme.css
12188
12189  $.widget("ui.resizable", $.ui.mouse, {
12190    version: "1.13.2",
12191    widgetEventPrefix: "resize",
12192    options: {
12193      alsoResize: false,
12194      animate: false,
12195      animateDuration: "slow",
12196      animateEasing: "swing",
12197      aspectRatio: false,
12198      autoHide: false,
12199      classes: {
12200        "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se",
12201      },
12202      containment: false,
12203      ghost: false,
12204      grid: false,
12205      handles: "e,s,se",
12206      helper: false,
12207      maxHeight: null,
12208      maxWidth: null,
12209      minHeight: 10,
12210      minWidth: 10,
12211
12212      // See #7960
12213      zIndex: 90,
12214
12215      // Callbacks
12216      resize: null,
12217      start: null,
12218      stop: null,
12219    },
12220
12221    _num: function (value) {
12222      return parseFloat(value) || 0;
12223    },
12224
12225    _isNumber: function (value) {
12226      return !isNaN(parseFloat(value));
12227    },
12228
12229    _hasScroll: function (el, a) {
12230      if ($(el).css("overflow") === "hidden") {
12231        return false;
12232      }
12233
12234      var scroll = a && a === "left" ? "scrollLeft" : "scrollTop",
12235        has = false;
12236
12237      if (el[scroll] > 0) {
12238        return true;
12239      }
12240
12241      // TODO: determine which cases actually cause this to happen
12242      // if the element doesn't have the scroll set, see if it's possible to
12243      // set the scroll
12244      try {
12245        el[scroll] = 1;
12246        has = el[scroll] > 0;
12247        el[scroll] = 0;
12248      } catch (e) {
12249        // `el` might be a string, then setting `scroll` will throw
12250        // an error in strict mode; ignore it.
12251      }
12252      return has;
12253    },
12254
12255    _create: function () {
12256      var margins,
12257        o = this.options,
12258        that = this;
12259      this._addClass("ui-resizable");
12260
12261      $.extend(this, {
12262        _aspectRatio: !!o.aspectRatio,
12263        aspectRatio: o.aspectRatio,
12264        originalElement: this.element,
12265        _proportionallyResizeElements: [],
12266        _helper:
12267          o.helper || o.ghost || o.animate
12268            ? o.helper || "ui-resizable-helper"
12269            : null,
12270      });
12271
12272      // Wrap the element if it cannot hold child nodes
12273      if (
12274        this.element[0].nodeName.match(
12275          /^(canvas|textarea|input|select|button|img)$/i
12276        )
12277      ) {
12278        this.element.wrap(
12279          $("<div class='ui-wrapper'></div>").css({
12280            overflow: "hidden",
12281            position: this.element.css("position"),
12282            width: this.element.outerWidth(),
12283            height: this.element.outerHeight(),
12284            top: this.element.css("top"),
12285            left: this.element.css("left"),
12286          })
12287        );
12288
12289        this.element = this.element
12290          .parent()
12291          .data("ui-resizable", this.element.resizable("instance"));
12292
12293        this.elementIsWrapper = true;
12294
12295        margins = {
12296          marginTop: this.originalElement.css("marginTop"),
12297          marginRight: this.originalElement.css("marginRight"),
12298          marginBottom: this.originalElement.css("marginBottom"),
12299          marginLeft: this.originalElement.css("marginLeft"),
12300        };
12301
12302        this.element.css(margins);
12303        this.originalElement.css("margin", 0);
12304
12305        // support: Safari
12306        // Prevent Safari textarea resize
12307        this.originalResizeStyle = this.originalElement.css("resize");
12308        this.originalElement.css("resize", "none");
12309
12310        this._proportionallyResizeElements.push(
12311          this.originalElement.css({
12312            position: "static",
12313            zoom: 1,
12314            display: "block",
12315          })
12316        );
12317
vendor: 16,988 bytes, lines 12318-12931
12318        // Support: IE9
12319        // avoid IE jump (hard set the margin)
12320        this.originalElement.css(margins);
12321
12322        this._proportionallyResize();
12323      }
12324
12325      this._setupHandles();
12326
12327      if (o.autoHide) {
12328        $(this.element)
12329          .on("mouseenter", function () {
12330            if (o.disabled) {
12331              return;
12332            }
12333            that._removeClass("ui-resizable-autohide");
12334            that._handles.show();
12335          })
12336          .on("mouseleave", function () {
12337            if (o.disabled) {
12338              return;
12339            }
12340            if (!that.resizing) {
12341              that._addClass("ui-resizable-autohide");
12342              that._handles.hide();
12343            }
12344          });
12345      }
12346
12347      this._mouseInit();
12348    },
12349
12350    _destroy: function () {
12351      this._mouseDestroy();
12352      this._addedHandles.remove();
12353
12354      var wrapper,
12355        _destroy = function (exp) {
12356          $(exp)
12357            .removeData("resizable")
12358            .removeData("ui-resizable")
12359            .off(".resizable");
12360        };
12361
12362      // TODO: Unwrap at same DOM position
12363      if (this.elementIsWrapper) {
12364        _destroy(this.element);
12365        wrapper = this.element;
12366        this.originalElement
12367          .css({
12368            position: wrapper.css("position"),
12369            width: wrapper.outerWidth(),
12370            height: wrapper.outerHeight(),
12371            top: wrapper.css("top"),
12372            left: wrapper.css("left"),
12373          })
12374          .insertAfter(wrapper);
12375        wrapper.remove();
12376      }
12377
12378      this.originalElement.css("resize", this.originalResizeStyle);
12379      _destroy(this.originalElement);
12380
12381      return this;
12382    },
12383
12384    _setOption: function (key, value) {
12385      this._super(key, value);
12386
12387      switch (key) {
12388        case "handles":
12389          this._removeHandles();
12390          this._setupHandles();
12391          break;
12392        case "aspectRatio":
12393          this._aspectRatio = !!value;
12394          break;
12395        default:
12396          break;
12397      }
12398    },
12399
12400    _setupHandles: function () {
12401      var o = this.options,
12402        handle,
12403        i,
12404        n,
12405        hname,
12406        axis,
12407        that = this;
12408      this.handles =
12409        o.handles ||
12410        (!$(".ui-resizable-handle", this.element).length
12411          ? "e,s,se"
12412          : {
12413              n: ".ui-resizable-n",
12414              e: ".ui-resizable-e",
12415              s: ".ui-resizable-s",
12416              w: ".ui-resizable-w",
12417              se: ".ui-resizable-se",
12418              sw: ".ui-resizable-sw",
12419              ne: ".ui-resizable-ne",
12420              nw: ".ui-resizable-nw",
12421            });
12422
12423      this._handles = $();
12424      this._addedHandles = $();
12425      if (this.handles.constructor === String) {
12426        if (this.handles === "all") {
12427          this.handles = "n,e,s,w,se,sw,ne,nw";
12428        }
12429
12430        n = this.handles.split(",");
12431        this.handles = {};
12432
12433        for (i = 0; i < n.length; i++) {
12434          handle = String.prototype.trim.call(n[i]);
12435          hname = "ui-resizable-" + handle;
12436          axis = $("<div>");
12437          this._addClass(axis, "ui-resizable-handle " + hname);
12438
12439          axis.css({ zIndex: o.zIndex });
12440
12441          this.handles[handle] = ".ui-resizable-" + handle;
12442          if (!this.element.children(this.handles[handle]).length) {
12443            this.element.append(axis);
12444            this._addedHandles = this._addedHandles.add(axis);
12445          }
12446        }
12447      }
12448
12449      this._renderAxis = function (target) {
12450        var i, axis, padPos, padWrapper;
12451
12452        target = target || this.element;
12453
12454        for (i in this.handles) {
12455          if (this.handles[i].constructor === String) {
12456            this.handles[i] = this.element
12457              .children(this.handles[i])
12458              .first()
12459              .show();
12460          } else if (this.handles[i].jquery || this.handles[i].nodeType) {
12461            this.handles[i] = $(this.handles[i]);
12462            this._on(this.handles[i], { mousedown: that._mouseDown });
12463          }
12464
12465          if (
12466            this.elementIsWrapper &&
12467            this.originalElement[0].nodeName.match(
12468              /^(textarea|input|select|button)$/i
12469            )
12470          ) {
12471            axis = $(this.handles[i], this.element);
12472
12473            padWrapper = /sw|ne|nw|se|n|s/.test(i)
12474              ? axis.outerHeight()
12475              : axis.outerWidth();
12476
12477            padPos = [
12478              "padding",
12479              /ne|nw|n/.test(i)
12480                ? "Top"
12481                : /se|sw|s/.test(i)
12482                ? "Bottom"
12483                : /^e$/.test(i)
12484                ? "Right"
12485                : "Left",
12486            ].join("");
12487
12488            target.css(padPos, padWrapper);
12489
12490            this._proportionallyResize();
12491          }
12492
12493          this._handles = this._handles.add(this.handles[i]);
12494        }
12495      };
12496
12497      // TODO: make renderAxis a prototype function
12498      this._renderAxis(this.element);
12499
12500      this._handles = this._handles.add(
12501        this.element.find(".ui-resizable-handle")
12502      );
12503      this._handles.disableSelection();
12504
12505      this._handles.on("mouseover", function () {
12506        if (!that.resizing) {
12507          if (this.className) {
12508            axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
12509          }
12510          that.axis = axis && axis[1] ? axis[1] : "se";
12511        }
12512      });
12513
12514      if (o.autoHide) {
12515        this._handles.hide();
12516        this._addClass("ui-resizable-autohide");
12517      }
12518    },
12519
12520    _removeHandles: function () {
12521      this._addedHandles.remove();
12522    },
12523
12524    _mouseCapture: function (event) {
12525      var i,
12526        handle,
12527        capture = false;
12528
12529      for (i in this.handles) {
12530        handle = $(this.handles[i])[0];
12531        if (handle === event.target || $.contains(handle, event.target)) {
12532          capture = true;
12533        }
12534      }
12535
12536      return !this.options.disabled && capture;
12537    },
12538
12539    _mouseStart: function (event) {
12540      var curleft,
12541        curtop,
12542        cursor,
12543        o = this.options,
12544        el = this.element;
12545
12546      this.resizing = true;
12547
12548      this._renderProxy();
12549
12550      curleft = this._num(this.helper.css("left"));
12551      curtop = this._num(this.helper.css("top"));
12552
12553      if (o.containment) {
12554        curleft += $(o.containment).scrollLeft() || 0;
12555        curtop += $(o.containment).scrollTop() || 0;
12556      }
12557
12558      this.offset = this.helper.offset();
12559      this.position = { left: curleft, top: curtop };
12560
12561      this.size = this._helper
12562        ? {
12563            width: this.helper.width(),
12564            height: this.helper.height(),
12565          }
12566        : {
12567            width: el.width(),
12568            height: el.height(),
12569          };
12570
12571      this.originalSize = this._helper
12572        ? {
12573            width: el.outerWidth(),
12574            height: el.outerHeight(),
12575          }
12576        : {
12577            width: el.width(),
12578            height: el.height(),
12579          };
12580
12581      this.sizeDiff = {
12582        width: el.outerWidth() - el.width(),
12583        height: el.outerHeight() - el.height(),
12584      };
12585
12586      this.originalPosition = { left: curleft, top: curtop };
12587      this.originalMousePosition = { left: event.pageX, top: event.pageY };
12588
12589      this.aspectRatio =
12590        typeof o.aspectRatio === "number"
12591          ? o.aspectRatio
12592          : this.originalSize.width / this.originalSize.height || 1;
12593
12594      cursor = $(".ui-resizable-" + this.axis).css("cursor");
12595      $("body").css(
12596        "cursor",
12597        cursor === "auto" ? this.axis + "-resize" : cursor
12598      );
12599
12600      this._addClass("ui-resizable-resizing");
12601      this._propagate("start", event);
12602      return true;
12603    },
12604
12605    _mouseDrag: function (event) {
12606      var data,
12607        props,
12608        smp = this.originalMousePosition,
12609        a = this.axis,
12610        dx = event.pageX - smp.left || 0,
12611        dy = event.pageY - smp.top || 0,
12612        trigger = this._change[a];
12613
12614      this._updatePrevProperties();
12615
12616      if (!trigger) {
12617        return false;
12618      }
12619
12620      data = trigger.apply(this, [event, dx, dy]);
12621
12622      this._updateVirtualBoundaries(event.shiftKey);
12623      if (this._aspectRatio || event.shiftKey) {
12624        data = this._updateRatio(data, event);
12625      }
12626
12627      data = this._respectSize(data, event);
12628
12629      this._updateCache(data);
12630
12631      this._propagate("resize", event);
12632
12633      props = this._applyChanges();
12634
12635      if (!this._helper && this._proportionallyResizeElements.length) {
12636        this._proportionallyResize();
12637      }
12638
12639      if (!$.isEmptyObject(props)) {
12640        this._updatePrevProperties();
12641        this._trigger("resize", event, this.ui());
12642        this._applyChanges();
12643      }
12644
12645      return false;
12646    },
12647
12648    _mouseStop: function (event) {
12649      this.resizing = false;
12650      var pr,
12651        ista,
12652        soffseth,
12653        soffsetw,
12654        s,
12655        left,
12656        top,
12657        o = this.options,
12658        that = this;
12659
12660      if (this._helper) {
12661        pr = this._proportionallyResizeElements;
12662        ista = pr.length && /textarea/i.test(pr[0].nodeName);
12663        soffseth =
12664          ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
12665        soffsetw = ista ? 0 : that.sizeDiff.width;
12666
12667        s = {
12668          width: that.helper.width() - soffsetw,
12669          height: that.helper.height() - soffseth,
12670        };
12671        left =
12672          parseFloat(that.element.css("left")) +
12673            (that.position.left - that.originalPosition.left) || null;
12674        top =
12675          parseFloat(that.element.css("top")) +
12676            (that.position.top - that.originalPosition.top) || null;
12677
12678        if (!o.animate) {
12679          this.element.css($.extend(s, { top: top, left: left }));
12680        }
12681
12682        that.helper.height(that.size.height);
12683        that.helper.width(that.size.width);
12684
12685        if (this._helper && !o.animate) {
12686          this._proportionallyResize();
12687        }
12688      }
12689
12690      $("body").css("cursor", "auto");
12691
12692      this._removeClass("ui-resizable-resizing");
12693
12694      this._propagate("stop", event);
12695
12696      if (this._helper) {
12697        this.helper.remove();
12698      }
12699
12700      return false;
12701    },
12702
12703    _updatePrevProperties: function () {
12704      this.prevPosition = {
12705        top: this.position.top,
12706        left: this.position.left,
12707      };
12708      this.prevSize = {
12709        width: this.size.width,
12710        height: this.size.height,
12711      };
12712    },
12713
12714    _applyChanges: function () {
12715      var props = {};
12716
12717      if (this.position.top !== this.prevPosition.top) {
12718        props.top = this.position.top + "px";
12719      }
12720      if (this.position.left !== this.prevPosition.left) {
12721        props.left = this.position.left + "px";
12722      }
12723      if (this.size.width !== this.prevSize.width) {
12724        props.width = this.size.width + "px";
12725      }
12726      if (this.size.height !== this.prevSize.height) {
12727        props.height = this.size.height + "px";
12728      }
12729
12730      this.helper.css(props);
12731
12732      return props;
12733    },
12734
12735    _updateVirtualBoundaries: function (forceAspectRatio) {
12736      var pMinWidth,
12737        pMaxWidth,
12738        pMinHeight,
12739        pMaxHeight,
12740        b,
12741        o = this.options;
12742
12743      b = {
12744        minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
12745        maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
12746        minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
12747        maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity,
12748      };
12749
12750      if (this._aspectRatio || forceAspectRatio) {
12751        pMinWidth = b.minHeight * this.aspectRatio;
12752        pMinHeight = b.minWidth / this.aspectRatio;
12753        pMaxWidth = b.maxHeight * this.aspectRatio;
12754        pMaxHeight = b.maxWidth / this.aspectRatio;
12755
12756        if (pMinWidth > b.minWidth) {
12757          b.minWidth = pMinWidth;
12758        }
12759        if (pMinHeight > b.minHeight) {
12760          b.minHeight = pMinHeight;
12761        }
12762        if (pMaxWidth < b.maxWidth) {
12763          b.maxWidth = pMaxWidth;
12764        }
12765        if (pMaxHeight < b.maxHeight) {
12766          b.maxHeight = pMaxHeight;
12767        }
12768      }
12769      this._vBoundaries = b;
12770    },
12771
12772    _updateCache: function (data) {
12773      this.offset = this.helper.offset();
12774      if (this._isNumber(data.left)) {
12775        this.position.left = data.left;
12776      }
12777      if (this._isNumber(data.top)) {
12778        this.position.top = data.top;
12779      }
12780      if (this._isNumber(data.height)) {
12781        this.size.height = data.height;
12782      }
12783      if (this._isNumber(data.width)) {
12784        this.size.width = data.width;
12785      }
12786    },
12787
12788    _updateRatio: function (data) {
12789      var cpos = this.position,
12790        csize = this.size,
12791        a = this.axis;
12792
12793      if (this._isNumber(data.height)) {
12794        data.width = data.height * this.aspectRatio;
12795      } else if (this._isNumber(data.width)) {
12796        data.height = data.width / this.aspectRatio;
12797      }
12798
12799      if (a === "sw") {
12800        data.left = cpos.left + (csize.width - data.width);
12801        data.top = null;
12802      }
12803      if (a === "nw") {
12804        data.top = cpos.top + (csize.height - data.height);
12805        data.left = cpos.left + (csize.width - data.width);
12806      }
12807
12808      return data;
12809    },
12810
12811    _respectSize: function (data) {
12812      var o = this._vBoundaries,
12813        a = this.axis,
12814        ismaxw =
12815          this._isNumber(data.width) && o.maxWidth && o.maxWidth < data.width,
12816        ismaxh =
12817          this._isNumber(data.height) &&
12818          o.maxHeight &&
12819          o.maxHeight < data.height,
12820        isminw =
12821          this._isNumber(data.width) && o.minWidth && o.minWidth > data.width,
12822        isminh =
12823          this._isNumber(data.height) &&
12824          o.minHeight &&
12825          o.minHeight > data.height,
12826        dw = this.originalPosition.left + this.originalSize.width,
12827        dh = this.originalPosition.top + this.originalSize.height,
12828        cw = /sw|nw|w/.test(a),
12829        ch = /nw|ne|n/.test(a);
12830      if (isminw) {
12831        data.width = o.minWidth;
12832      }
12833      if (isminh) {
12834        data.height = o.minHeight;
12835      }
12836      if (ismaxw) {
12837        data.width = o.maxWidth;
12838      }
12839      if (ismaxh) {
12840        data.height = o.maxHeight;
12841      }
12842
12843      if (isminw && cw) {
12844        data.left = dw - o.minWidth;
12845      }
12846      if (ismaxw && cw) {
12847        data.left = dw - o.maxWidth;
12848      }
12849      if (isminh && ch) {
12850        data.top = dh - o.minHeight;
12851      }
12852      if (ismaxh && ch) {
12853        data.top = dh - o.maxHeight;
12854      }
12855
12856      // Fixing jump error on top/left - bug #2330
12857      if (!data.width && !data.height && !data.left && data.top) {
12858        data.top = null;
12859      } else if (!data.width && !data.height && !data.top && data.left) {
12860        data.left = null;
12861      }
12862
12863      return data;
12864    },
12865
12866    _getPaddingPlusBorderDimensions: function (element) {
12867      var i = 0,
12868        widths = [],
12869        borders = [
12870          element.css("borderTopWidth"),
12871          element.css("borderRightWidth"),
12872          element.css("borderBottomWidth"),
12873          element.css("borderLeftWidth"),
12874        ],
12875        paddings = [
12876          element.css("paddingTop"),
12877          element.css("paddingRight"),
12878          element.css("paddingBottom"),
12879          element.css("paddingLeft"),
12880        ];
12881
12882      for (; i < 4; i++) {
12883        widths[i] = parseFloat(borders[i]) || 0;
12884        widths[i] += parseFloat(paddings[i]) || 0;
12885      }
12886
12887      return {
12888        height: widths[0] + widths[2],
12889        width: widths[1] + widths[3],
12890      };
12891    },
12892
12893    _proportionallyResize: function () {
12894      if (!this._proportionallyResizeElements.length) {
12895        return;
12896      }
12897
12898      var prel,
12899        i = 0,
12900        element = this.helper || this.element;
12901
12902      for (; i < this._proportionallyResizeElements.length; i++) {
12903        prel = this._proportionallyResizeElements[i];
12904
12905        // TODO: Seems like a bug to cache this.outerDimensions
12906        // considering that we are in a loop.
12907        if (!this.outerDimensions) {
12908          this.outerDimensions = this._getPaddingPlusBorderDimensions(prel);
12909        }
12910
12911        prel.css({
12912          height: element.height() - this.outerDimensions.height || 0,
12913          width: element.width() - this.outerDimensions.width || 0,
12914        });
12915      }
12916    },
12917
12918    _renderProxy: function () {
12919      var el = this.element,
12920        o = this.options;
12921      this.elementOffset = el.offset();
12922
12923      if (this._helper) {
12924        this.helper =
12925          this.helper || $("<div></div>").css({ overflow: "hidden" });
12926
12927        this._addClass(this.helper, this._helper);
12928        this.helper.css({
12929          width: this.element.outerWidth(),
12930          height: this.element.outerHeight(),
12931          position: "absolute",
12932          left: this.elementOffset.left + "px",
12933          top: this.elementOffset.top + "px",
12934          zIndex: ++o.zIndex, //TODO: Don't modify option
12935        });
12936
12937        this.helper.appendTo("body").disableSelection();
12938      } else {
12939        this.helper = this.element;
12940      }
12941    },
12942
12943    _change: {
12944      e: function (event, dx) {
12945        return { width: this.originalSize.width + dx };
12946      },
12947      w: function (event, dx) {
12948        var cs = this.originalSize,
12949          sp = this.originalPosition;
12950        return { left: sp.left + dx, width: cs.width - dx };
12951      },
12952      n: function (event, dx, dy) {
12953        var cs = this.originalSize,
12954          sp = this.originalPosition;
12955        return { top: sp.top + dy, height: cs.height - dy };
12956      },
12957      s: function (event, dx, dy) {
12958        return { height: this.originalSize.height + dy };
12959      },
12960      se: function (event, dx, dy) {
12961        return $.extend(
12962          this._change.s.apply(this, arguments),
12963          this._change.e.apply(this, [event, dx, dy])
12964        );
12965      },
12966      sw: function (event, dx, dy) {
12967        return $.extend(
12968          this._change.s.apply(this, arguments),
12969          this._change.w.apply(this, [event, dx, dy])
12970        );
12971      },
12972      ne: function (event, dx, dy) {
12973        return $.extend(
12974          this._change.n.apply(this, arguments),
12975          this._change.e.apply(this, [event, dx, dy])
12976        );
12977      },
12978      nw: function (event, dx, dy) {
12979        return $.extend(
12980          this._change.n.apply(this, arguments),
12981          this._change.w.apply(this, [event, dx, dy])
12982        );
12983      },
12984    },
12985
12986    _propagate: function (n, event) {
12987      $.ui.plugin.call(this, n, [event, this.ui()]);
12988      if (n !== "resize") {
12989        this._trigger(n, event, this.ui());
12990      }
12991    },
12992
12993    plugins: {},
12994
12995    ui: function () {
12996      return {
12997        originalElement: this.originalElement,
12998        element: this.element,
12999        helper: this.helper,
13000        position: this.position,
13001        size: this.size,
13002        originalSize: this.originalSize,
13003        originalPosition: this.originalPosition,
13004      };
13005    },
13006  });
13007
13008  /*
13009   * Resizable Extensions
13010   */
13011
13012  $.ui.plugin.add("resizable", "animate", {
13013    stop: function (event) {
13014      var that = $(this).resizable("instance"),
13015        o = that.options,
13016        pr = that._proportionallyResizeElements,
13017        ista = pr.length && /textarea/i.test(pr[0].nodeName),
13018        soffseth =
13019          ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
13020        soffsetw = ista ? 0 : that.sizeDiff.width,
13021        style = {
13022          width: that.size.width - soffsetw,
13023          height: that.size.height - soffseth,
13024        },
13025        left =
13026          parseFloat(that.element.css("left")) +
13027            (that.position.left - that.originalPosition.left) || null,
13028        top =
13029          parseFloat(that.element.css("top")) +
13030            (that.position.top - that.originalPosition.top) || null;
13031
13032      that.element.animate(
13033        $.extend(style, top && left ? { top: top, left: left } : {}),
13034        {
13035          duration: o.animateDuration,
13036          easing: o.animateEasing,
13037          step: function () {
13038            var data = {
13039              width: parseFloat(that.element.css("width")),
13040              height: parseFloat(that.element.css("height")),
13041              top: parseFloat(that.element.css("top")),
13042              left: parseFloat(that.element.css("left")),
13043            };
13044
13045            if (pr && pr.length) {
13046              $(pr[0]).css({ width: data.width, height: data.height });
13047            }
13048
13049            // Propagating resize, and updating values for each animation step
13050            that._updateCache(data);
13051            that._propagate("resize", event);
13052          },
13053        }
13054      );
13055    },
13056  });
13057
13058  $.ui.plugin.add("resizable", "containment", {
13059    start: function () {
13060      var element,
13061        p,
13062        co,
13063        ch,
13064        cw,
13065        width,
13066        height,
13067        that = $(this).resizable("instance"),
13068        o = that.options,
13069        el = that.element,
13070        oc = o.containment,
13071        ce =
13072          oc instanceof $
13073            ? oc.get(0)
13074            : /parent/.test(oc)
13075            ? el.parent().get(0)
13076            : oc;
13077
13078      if (!ce) {
13079        return;
13080      }
13081
13082      that.containerElement = $(ce);
13083
13084      if (/document/.test(oc) || oc === document) {
13085        that.containerOffset = {
13086          left: 0,
13087          top: 0,
13088        };
13089        that.containerPosition = {
13090          left: 0,
13091          top: 0,
13092        };
13093
13094        that.parentData = {
13095          element: $(document),
13096          left: 0,
13097          top: 0,
13098          width: $(document).width(),
13099          height: $(document).height() || document.body.parentNode.scrollHeight,
13100        };
13101      } else {
13102        element = $(ce);
13103        p = [];
13104        $(["Top", "Right", "Left", "Bottom"]).each(function (i, name) {
13105          p[i] = that._num(element.css("padding" + name));
13106        });
13107
13108        that.containerOffset = element.offset();
13109        that.containerPosition = element.position();
13110        that.containerSize = {
13111          height: element.innerHeight() - p[3],
13112          width: element.innerWidth() - p[1],
13113        };
13114
13115        co = that.containerOffset;
13116        ch = that.containerSize.height;
13117        cw = that.containerSize.width;
13118        width = that._hasScroll(ce, "left") ? ce.scrollWidth : cw;
13119        height = that._hasScroll(ce) ? ce.scrollHeight : ch;
13120
13121        that.parentData = {
13122          element: ce,
13123          left: co.left,
13124          top: co.top,
13125          width: width,
13126          height: height,
13127        };
13128      }
13129    },
13130
13131    resize: function (event) {
13132      var woset,
13133        hoset,
13134        isParent,
13135        isOffsetRelative,
13136        that = $(this).resizable("instance"),
13137        o = that.options,
13138        co = that.containerOffset,
13139        cp = that.position,
13140        pRatio = that._aspectRatio || event.shiftKey,
13141        cop = {
13142          top: 0,
13143          left: 0,
13144        },
13145        ce = that.containerElement,
13146        continueResize = true;
13147
13148      if (ce[0] !== document && /static/.test(ce.css("position"))) {
13149        cop = co;
13150      }
13151
13152      if (cp.left < (that._helper ? co.left : 0)) {
13153        that.size.width =
13154          that.size.width +
13155          (that._helper
13156            ? that.position.left - co.left
13157            : that.position.left - cop.left);
13158
13159        if (pRatio) {
13160          that.size.height = that.size.width / that.aspectRatio;
13161          continueResize = false;
13162        }
13163        that.position.left = o.helper ? co.left : 0;
13164      }
13165
13166      if (cp.top < (that._helper ? co.top : 0)) {
13167        that.size.height =
13168          that.size.height +
13169          (that._helper ? that.position.top - co.top : that.position.top);
13170
13171        if (pRatio) {
13172          that.size.width = that.size.height * that.aspectRatio;
13173          continueResize = false;
13174        }
13175        that.position.top = that._helper ? co.top : 0;
13176      }
13177
13178      isParent = that.containerElement.get(0) === that.element.parent().get(0);
13179      isOffsetRelative = /relative|absolute/.test(
13180        that.containerElement.css("position")
13181      );
13182
13183      if (isParent && isOffsetRelative) {
13184        that.offset.left = that.parentData.left + that.position.left;
13185        that.offset.top = that.parentData.top + that.position.top;
13186      } else {
13187        that.offset.left = that.element.offset().left;
13188        that.offset.top = that.element.offset().top;
13189      }
13190
13191      woset = Math.abs(
13192        that.sizeDiff.width +
13193          (that._helper
13194            ? that.offset.left - cop.left
13195            : that.offset.left - co.left)
13196      );
13197
13198      hoset = Math.abs(
13199        that.sizeDiff.height +
13200          (that._helper ? that.offset.top - cop.top : that.offset.top - co.top)
13201      );
13202
13203      if (woset + that.size.width >= that.parentData.width) {
13204        that.size.width = that.parentData.width - woset;
13205        if (pRatio) {
13206          that.size.height = that.size.width / that.aspectRatio;
13207          continueResize = false;
13208        }
13209      }
13210
13211      if (hoset + that.size.height >= that.parentData.height) {
13212        that.size.height = that.parentData.height - hoset;
13213        if (pRatio) {
13214          that.size.width = that.size.height * that.aspectRatio;
13215          continueResize = false;
13216        }
13217      }
13218
13219      if (!continueResize) {
13220        that.position.left = that.prevPosition.left;
13221        that.position.top = that.prevPosition.top;
13222        that.size.width = that.prevSize.width;
13223        that.size.height = that.prevSize.height;
13224      }
13225    },
13226
13227    stop: function () {
13228      var that = $(this).resizable("instance"),
13229        o = that.options,
13230        co = that.containerOffset,
13231        cop = that.containerPosition,
13232        ce = that.containerElement,
13233        helper = $(that.helper),
13234        ho = helper.offset(),
13235        w = helper.outerWidth() - that.sizeDiff.width,
13236        h = helper.outerHeight() - that.sizeDiff.height;
13237
13238      if (that._helper && !o.animate && /relative/.test(ce.css("position"))) {
13239        $(this).css({
13240          left: ho.left - cop.left - co.left,
13241          width: w,
13242          height: h,
13243        });
13244      }
13245
vendor: 3,352 bytes, lines 13246-13365
13246      if (that._helper && !o.animate && /static/.test(ce.css("position"))) {
13247        $(this).css({
13248          left: ho.left - cop.left - co.left,
13249          width: w,
13250          height: h,
13251        });
13252      }
13253    },
13254  });
13255
13256  $.ui.plugin.add("resizable", "alsoResize", {
13257    start: function () {
13258      var that = $(this).resizable("instance"),
13259        o = that.options;
13260
13261      $(o.alsoResize).each(function () {
13262        var el = $(this);
13263        el.data("ui-resizable-alsoresize", {
13264          width: parseFloat(el.width()),
13265          height: parseFloat(el.height()),
13266          left: parseFloat(el.css("left")),
13267          top: parseFloat(el.css("top")),
13268        });
13269      });
13270    },
13271
13272    resize: function (event, ui) {
13273      var that = $(this).resizable("instance"),
13274        o = that.options,
13275        os = that.originalSize,
13276        op = that.originalPosition,
13277        delta = {
13278          height: that.size.height - os.height || 0,
13279          width: that.size.width - os.width || 0,
13280          top: that.position.top - op.top || 0,
13281          left: that.position.left - op.left || 0,
13282        };
13283
13284      $(o.alsoResize).each(function () {
13285        var el = $(this),
13286          start = $(this).data("ui-resizable-alsoresize"),
13287          style = {},
13288          css = el.parents(ui.originalElement[0]).length
13289            ? ["width", "height"]
13290            : ["width", "height", "top", "left"];
13291
13292        $.each(css, function (i, prop) {
13293          var sum = (start[prop] || 0) + (delta[prop] || 0);
13294          if (sum && sum >= 0) {
13295            style[prop] = sum || null;
13296          }
13297        });
13298
13299        el.css(style);
13300      });
13301    },
13302
13303    stop: function () {
13304      $(this).removeData("ui-resizable-alsoresize");
13305    },
13306  });
13307
13308  $.ui.plugin.add("resizable", "ghost", {
13309    start: function () {
13310      var that = $(this).resizable("instance"),
13311        cs = that.size;
13312
13313      that.ghost = that.originalElement.clone();
13314      that.ghost.css({
13315        opacity: 0.25,
13316        display: "block",
13317        position: "relative",
13318        height: cs.height,
13319        width: cs.width,
13320        margin: 0,
13321        left: 0,
13322        top: 0,
13323      });
13324
13325      that._addClass(that.ghost, "ui-resizable-ghost");
13326
13327      // DEPRECATED
13328      // TODO: remove after 1.12
13329      if ($.uiBackCompat !== false && typeof that.options.ghost === "string") {
13330        // Ghost option
13331        that.ghost.addClass(this.options.ghost);
13332      }
13333
13334      that.ghost.appendTo(that.helper);
13335    },
13336
13337    resize: function () {
13338      var that = $(this).resizable("instance");
13339      if (that.ghost) {
13340        that.ghost.css({
13341          position: "relative",
13342          height: that.size.height,
13343          width: that.size.width,
13344        });
13345      }
13346    },
13347
13348    stop: function () {
13349      var that = $(this).resizable("instance");
13350      if (that.ghost && that.helper) {
13351        that.helper.get(0).removeChild(that.ghost.get(0));
13352      }
13353    },
13354  });
13355
13356  $.ui.plugin.add("resizable", "grid", {
13357    resize: function () {
13358      var outerDimensions,
13359        that = $(this).resizable("instance"),
13360        o = that.options,
13361        cs = that.size,
13362        os = that.originalSize,
13363        op = that.originalPosition,
13364        a = that.axis,
13365        grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
vendor: 6,005 bytes, lines 13366-13584
13366        gridX = grid[0] || 1,
13367        gridY = grid[1] || 1,
13368        ox = Math.round((cs.width - os.width) / gridX) * gridX,
13369        oy = Math.round((cs.height - os.height) / gridY) * gridY,
13370        newWidth = os.width + ox,
13371        newHeight = os.height + oy,
13372        isMaxWidth = o.maxWidth && o.maxWidth < newWidth,
13373        isMaxHeight = o.maxHeight && o.maxHeight < newHeight,
13374        isMinWidth = o.minWidth && o.minWidth > newWidth,
13375        isMinHeight = o.minHeight && o.minHeight > newHeight;
13376
13377      o.grid = grid;
13378
13379      if (isMinWidth) {
13380        newWidth += gridX;
13381      }
13382      if (isMinHeight) {
13383        newHeight += gridY;
13384      }
13385      if (isMaxWidth) {
13386        newWidth -= gridX;
13387      }
13388      if (isMaxHeight) {
13389        newHeight -= gridY;
13390      }
13391
13392      if (/^(se|s|e)$/.test(a)) {
13393        that.size.width = newWidth;
13394        that.size.height = newHeight;
13395      } else if (/^(ne)$/.test(a)) {
13396        that.size.width = newWidth;
13397        that.size.height = newHeight;
13398        that.position.top = op.top - oy;
13399      } else if (/^(sw)$/.test(a)) {
13400        that.size.width = newWidth;
13401        that.size.height = newHeight;
13402        that.position.left = op.left - ox;
13403      } else {
13404        if (newHeight - gridY <= 0 || newWidth - gridX <= 0) {
13405          outerDimensions = that._getPaddingPlusBorderDimensions(this);
13406        }
13407
13408        if (newHeight - gridY > 0) {
13409          that.size.height = newHeight;
13410          that.position.top = op.top - oy;
13411        } else {
13412          newHeight = gridY - outerDimensions.height;
13413          that.size.height = newHeight;
13414          that.position.top = op.top + os.height - newHeight;
13415        }
13416        if (newWidth - gridX > 0) {
13417          that.size.width = newWidth;
13418          that.position.left = op.left - ox;
13419        } else {
13420          newWidth = gridX - outerDimensions.width;
13421          that.size.width = newWidth;
13422          that.position.left = op.left + os.width - newWidth;
13423        }
13424      }
13425    },
13426  });
13427
13428  var widgetsResizable = $.ui.resizable;
13429
13430  /*!
13431   * jQuery UI Dialog 1.13.2
13432   * http://jqueryui.com
13433   *
13434   * Copyright jQuery Foundation and other contributors
13435   * Released under the MIT license.
13436   * http://jquery.org/license
13437   */
13438
13439  //>>label: Dialog
13440  //>>group: Widgets
13441  //>>description: Displays customizable dialog windows.
13442  //>>docs: http://api.jqueryui.com/dialog/
13443  //>>demos: http://jqueryui.com/dialog/
13444  //>>css.structure: ../../themes/base/core.css
13445  //>>css.structure: ../../themes/base/dialog.css
13446  //>>css.theme: ../../themes/base/theme.css
13447
13448  $.widget("ui.dialog", {
13449    version: "1.13.2",
13450    options: {
13451      appendTo: "body",
13452      autoOpen: true,
13453      buttons: [],
13454      classes: {
13455        "ui-dialog": "ui-corner-all",
13456        "ui-dialog-titlebar": "ui-corner-all",
13457      },
13458      closeOnEscape: true,
13459      closeText: "Close",
13460      draggable: true,
13461      hide: null,
13462      height: "auto",
13463      maxHeight: null,
13464      maxWidth: null,
13465      minHeight: 150,
13466      minWidth: 150,
13467      modal: false,
13468      position: {
13469        my: "center",
13470        at: "center",
13471        of: window,
13472        collision: "fit",
13473
13474        // Ensure the titlebar is always visible
13475        using: function (pos) {
13476          var topOffset = $(this).css(pos).offset().top;
13477          if (topOffset < 0) {
13478            $(this).css("top", pos.top - topOffset);
13479          }
13480        },
13481      },
13482      resizable: true,
13483      show: null,
13484      title: null,
13485      width: 300,
13486
13487      // Callbacks
13488      beforeClose: null,
13489      close: null,
13490      drag: null,
13491      dragStart: null,
13492      dragStop: null,
13493      focus: null,
13494      open: null,
13495      resize: null,
13496      resizeStart: null,
13497      resizeStop: null,
13498    },
13499
13500    sizeRelatedOptions: {
13501      buttons: true,
13502      height: true,
13503      maxHeight: true,
13504      maxWidth: true,
13505      minHeight: true,
13506      minWidth: true,
13507      width: true,
13508    },
13509
13510    resizableRelatedOptions: {
13511      maxHeight: true,
13512      maxWidth: true,
13513      minHeight: true,
13514      minWidth: true,
13515    },
13516
13517    _create: function () {
13518      this.originalCss = {
13519        display: this.element[0].style.display,
13520        width: this.element[0].style.width,
13521        minHeight: this.element[0].style.minHeight,
13522        maxHeight: this.element[0].style.maxHeight,
13523        height: this.element[0].style.height,
13524      };
13525      this.originalPosition = {
13526        parent: this.element.parent(),
13527        index: this.element.parent().children().index(this.element),
13528      };
13529      this.originalTitle = this.element.attr("title");
13530      if (this.options.title == null && this.originalTitle != null) {
13531        this.options.title = this.originalTitle;
13532      }
13533
13534      // Dialogs can't be disabled
13535      if (this.options.disabled) {
13536        this.options.disabled = false;
13537      }
13538
13539      this._createWrapper();
13540
13541      this.element.show().removeAttr("title").appendTo(this.uiDialog);
13542
13543      this._addClass("ui-dialog-content", "ui-widget-content");
13544
13545      this._createTitlebar();
13546      this._createButtonPane();
13547
13548      if (this.options.draggable && $.fn.draggable) {
13549        this._makeDraggable();
13550      }
13551      if (this.options.resizable && $.fn.resizable) {
13552        this._makeResizable();
13553      }
13554
13555      this._isOpen = false;
13556
13557      this._trackFocus();
13558    },
13559
13560    _init: function () {
13561      if (this.options.autoOpen) {
13562        this.open();
13563      }
13564    },
13565
13566    _appendTo: function () {
13567      var element = this.options.appendTo;
13568      if (element && (element.jquery || element.nodeType)) {
13569        return $(element);
13570      }
13571      return this.document.find(element || "body").eq(0);
13572    },
13573
13574    _destroy: function () {
13575      var next,
13576        originalPosition = this.originalPosition;
13577
13578      this._untrackInstance();
13579      this._destroyOverlay();
13580
13581      this.element
13582        .removeUniqueId()
13583        .css(this.originalCss)
13584
vendor: 38,337 bytes, lines 13585-14871
13585        // Without detaching first, the following becomes really slow
13586        .detach();
13587
13588      this.uiDialog.remove();
13589
13590      if (this.originalTitle) {
13591        this.element.attr("title", this.originalTitle);
13592      }
13593
13594      next = originalPosition.parent.children().eq(originalPosition.index);
13595
13596      // Don't try to place the dialog next to itself (#8613)
13597      if (next.length && next[0] !== this.element[0]) {
13598        next.before(this.element);
13599      } else {
13600        originalPosition.parent.append(this.element);
13601      }
13602    },
13603
13604    widget: function () {
13605      return this.uiDialog;
13606    },
13607
13608    disable: $.noop,
13609    enable: $.noop,
13610
13611    close: function (event) {
13612      var that = this;
13613
13614      if (!this._isOpen || this._trigger("beforeClose", event) === false) {
13615        return;
13616      }
13617
13618      this._isOpen = false;
13619      this._focusedElement = null;
13620      this._destroyOverlay();
13621      this._untrackInstance();
13622
13623      if (!this.opener.filter(":focusable").trigger("focus").length) {
13624        // Hiding a focused element doesn't trigger blur in WebKit
13625        // so in case we have nothing to focus on, explicitly blur the active element
13626        // https://bugs.webkit.org/show_bug.cgi?id=47182
13627        $.ui.safeBlur($.ui.safeActiveElement(this.document[0]));
13628      }
13629
13630      this._hide(this.uiDialog, this.options.hide, function () {
13631        that._trigger("close", event);
13632      });
13633    },
13634
13635    isOpen: function () {
13636      return this._isOpen;
13637    },
13638
13639    moveToTop: function () {
13640      this._moveToTop();
13641    },
13642
13643    _moveToTop: function (event, silent) {
13644      var moved = false,
13645        zIndices = this.uiDialog
13646          .siblings(".ui-front:visible")
13647          .map(function () {
13648            return +$(this).css("z-index");
13649          })
13650          .get(),
13651        zIndexMax = Math.max.apply(null, zIndices);
13652
13653      if (zIndexMax >= +this.uiDialog.css("z-index")) {
13654        this.uiDialog.css("z-index", zIndexMax + 1);
13655        moved = true;
13656      }
13657
13658      if (moved && !silent) {
13659        this._trigger("focus", event);
13660      }
13661      return moved;
13662    },
13663
13664    open: function () {
13665      var that = this;
13666      if (this._isOpen) {
13667        if (this._moveToTop()) {
13668          this._focusTabbable();
13669        }
13670        return;
13671      }
13672
13673      this._isOpen = true;
13674      this.opener = $($.ui.safeActiveElement(this.document[0]));
13675
13676      this._size();
13677      this._position();
13678      this._createOverlay();
13679      this._moveToTop(null, true);
13680
13681      // Ensure the overlay is moved to the top with the dialog, but only when
13682      // opening. The overlay shouldn't move after the dialog is open so that
13683      // modeless dialogs opened after the modal dialog stack properly.
13684      if (this.overlay) {
13685        this.overlay.css("z-index", this.uiDialog.css("z-index") - 1);
13686      }
13687
13688      this._show(this.uiDialog, this.options.show, function () {
13689        that._focusTabbable();
13690        that._trigger("focus");
13691      });
13692
13693      // Track the dialog immediately upon opening in case a focus event
13694      // somehow occurs outside of the dialog before an element inside the
13695      // dialog is focused (#10152)
13696      this._makeFocusTarget();
13697
13698      this._trigger("open");
13699    },
13700
13701    _focusTabbable: function () {
13702      // Set focus to the first match:
13703      // 1. An element that was focused previously
13704      // 2. First element inside the dialog matching [autofocus]
13705      // 3. Tabbable element inside the content element
13706      // 4. Tabbable element inside the buttonpane
13707      // 5. The close button
13708      // 6. The dialog itself
13709      var hasFocus = this._focusedElement;
13710      if (!hasFocus) {
13711        hasFocus = this.element.find("[autofocus]");
13712      }
13713      if (!hasFocus.length) {
13714        hasFocus = this.element.find(":tabbable");
13715      }
13716      if (!hasFocus.length) {
13717        hasFocus = this.uiDialogButtonPane.find(":tabbable");
13718      }
13719      if (!hasFocus.length) {
13720        hasFocus = this.uiDialogTitlebarClose.filter(":tabbable");
13721      }
13722      if (!hasFocus.length) {
13723        hasFocus = this.uiDialog;
13724      }
13725      hasFocus.eq(0).trigger("focus");
13726    },
13727
13728    _restoreTabbableFocus: function () {
13729      var activeElement = $.ui.safeActiveElement(this.document[0]),
13730        isActive =
13731          this.uiDialog[0] === activeElement ||
13732          $.contains(this.uiDialog[0], activeElement);
13733      if (!isActive) {
13734        this._focusTabbable();
13735      }
13736    },
13737
13738    _keepFocus: function (event) {
13739      event.preventDefault();
13740      this._restoreTabbableFocus();
13741
13742      // support: IE
13743      // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
13744      // so we check again later
13745      this._delay(this._restoreTabbableFocus);
13746    },
13747
13748    _createWrapper: function () {
13749      this.uiDialog = $("<div>")
13750        .hide()
13751        .attr({
13752          // Setting tabIndex makes the div focusable
13753          tabIndex: -1,
13754          role: "dialog",
13755        })
13756        .appendTo(this._appendTo());
13757
13758      this._addClass(
13759        this.uiDialog,
13760        "ui-dialog",
13761        "ui-widget ui-widget-content ui-front"
13762      );
13763      this._on(this.uiDialog, {
13764        keydown: function (event) {
13765          if (
13766            this.options.closeOnEscape &&
13767            !event.isDefaultPrevented() &&
13768            event.keyCode &&
13769            event.keyCode === $.ui.keyCode.ESCAPE
13770          ) {
13771            event.preventDefault();
13772            this.close(event);
13773            return;
13774          }
13775
13776          // Prevent tabbing out of dialogs
13777          if (
13778            event.keyCode !== $.ui.keyCode.TAB ||
13779            event.isDefaultPrevented()
13780          ) {
13781            return;
13782          }
13783          var tabbables = this.uiDialog.find(":tabbable"),
13784            first = tabbables.first(),
13785            last = tabbables.last();
13786
13787          if (
13788            (event.target === last[0] || event.target === this.uiDialog[0]) &&
13789            !event.shiftKey
13790          ) {
13791            this._delay(function () {
13792              first.trigger("focus");
13793            });
13794            event.preventDefault();
13795          } else if (
13796            (event.target === first[0] || event.target === this.uiDialog[0]) &&
13797            event.shiftKey
13798          ) {
13799            this._delay(function () {
13800              last.trigger("focus");
13801            });
13802            event.preventDefault();
13803          }
13804        },
13805        mousedown: function (event) {
13806          if (this._moveToTop(event)) {
13807            this._focusTabbable();
13808          }
13809        },
13810      });
13811
13812      // We assume that any existing aria-describedby attribute means
13813      // that the dialog content is marked up properly
13814      // otherwise we brute force the content as the description
13815      if (!this.element.find("[aria-describedby]").length) {
13816        this.uiDialog.attr({
13817          "aria-describedby": this.element.uniqueId().attr("id"),
13818        });
13819      }
13820    },
13821
13822    _createTitlebar: function () {
13823      var uiDialogTitle;
13824
13825      this.uiDialogTitlebar = $("<div>");
13826      this._addClass(
13827        this.uiDialogTitlebar,
13828        "ui-dialog-titlebar",
13829        "ui-widget-header ui-helper-clearfix"
13830      );
13831      this._on(this.uiDialogTitlebar, {
13832        mousedown: function (event) {
13833          // Don't prevent click on close button (#8838)
13834          // Focusing a dialog that is partially scrolled out of view
13835          // causes the browser to scroll it into view, preventing the click event
13836          if (!$(event.target).closest(".ui-dialog-titlebar-close")) {
13837            // Dialog isn't getting focus when dragging (#8063)
13838            this.uiDialog.trigger("focus");
13839          }
13840        },
13841      });
13842
13843      // Support: IE
13844      // Use type="button" to prevent enter keypresses in textboxes from closing the
13845      // dialog in IE (#9312)
13846      this.uiDialogTitlebarClose = $("<button type='button'></button>")
13847        .button({
13848          label: $("<a>").text(this.options.closeText).html(),
13849          icon: "ui-icon-closethick",
13850          showLabel: false,
13851        })
13852        .appendTo(this.uiDialogTitlebar);
13853
13854      this._addClass(this.uiDialogTitlebarClose, "ui-dialog-titlebar-close");
13855      this._on(this.uiDialogTitlebarClose, {
13856        click: function (event) {
13857          event.preventDefault();
13858          this.close(event);
13859        },
13860      });
13861
13862      uiDialogTitle = $("<span>").uniqueId().prependTo(this.uiDialogTitlebar);
13863      this._addClass(uiDialogTitle, "ui-dialog-title");
13864      this._title(uiDialogTitle);
13865
13866      this.uiDialogTitlebar.prependTo(this.uiDialog);
13867
13868      this.uiDialog.attr({
13869        "aria-labelledby": uiDialogTitle.attr("id"),
13870      });
13871    },
13872
13873    _title: function (title) {
13874      if (this.options.title) {
13875        title.text(this.options.title);
13876      } else {
13877        title.html("&#160;");
13878      }
13879    },
13880
13881    _createButtonPane: function () {
13882      this.uiDialogButtonPane = $("<div>");
13883      this._addClass(
13884        this.uiDialogButtonPane,
13885        "ui-dialog-buttonpane",
13886        "ui-widget-content ui-helper-clearfix"
13887      );
13888
13889      this.uiButtonSet = $("<div>").appendTo(this.uiDialogButtonPane);
13890      this._addClass(this.uiButtonSet, "ui-dialog-buttonset");
13891
13892      this._createButtons();
13893    },
13894
13895    _createButtons: function () {
13896      var that = this,
13897        buttons = this.options.buttons;
13898
13899      // If we already have a button pane, remove it
13900      this.uiDialogButtonPane.remove();
13901      this.uiButtonSet.empty();
13902
13903      if (
13904        $.isEmptyObject(buttons) ||
13905        (Array.isArray(buttons) && !buttons.length)
13906      ) {
13907        this._removeClass(this.uiDialog, "ui-dialog-buttons");
13908        return;
13909      }
13910
13911      $.each(buttons, function (name, props) {
13912        var click, buttonOptions;
13913        props =
13914          typeof props === "function" ? { click: props, text: name } : props;
13915
13916        // Default to a non-submitting button
13917        props = $.extend({ type: "button" }, props);
13918
13919        // Change the context for the click callback to be the main element
13920        click = props.click;
13921        buttonOptions = {
13922          icon: props.icon,
13923          iconPosition: props.iconPosition,
13924          showLabel: props.showLabel,
13925
13926          // Deprecated options
13927          icons: props.icons,
13928          text: props.text,
13929        };
13930
13931        delete props.click;
13932        delete props.icon;
13933        delete props.iconPosition;
13934        delete props.showLabel;
13935
13936        // Deprecated options
13937        delete props.icons;
13938        if (typeof props.text === "boolean") {
13939          delete props.text;
13940        }
13941
13942        $("<button></button>", props)
13943          .button(buttonOptions)
13944          .appendTo(that.uiButtonSet)
13945          .on("click", function () {
13946            click.apply(that.element[0], arguments);
13947          });
13948      });
13949      this._addClass(this.uiDialog, "ui-dialog-buttons");
13950      this.uiDialogButtonPane.appendTo(this.uiDialog);
13951    },
13952
13953    _makeDraggable: function () {
13954      var that = this,
13955        options = this.options;
13956
13957      function filteredUi(ui) {
13958        return {
13959          position: ui.position,
13960          offset: ui.offset,
13961        };
13962      }
13963
13964      this.uiDialog.draggable({
13965        cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
13966        handle: ".ui-dialog-titlebar",
13967        containment: "document",
13968        start: function (event, ui) {
13969          that._addClass($(this), "ui-dialog-dragging");
13970          that._blockFrames();
13971          that._trigger("dragStart", event, filteredUi(ui));
13972        },
13973        drag: function (event, ui) {
13974          that._trigger("drag", event, filteredUi(ui));
13975        },
13976        stop: function (event, ui) {
13977          var left = ui.offset.left - that.document.scrollLeft(),
13978            top = ui.offset.top - that.document.scrollTop();
13979
13980          options.position = {
13981            my: "left top",
13982            at:
13983              "left" +
13984              (left >= 0 ? "+" : "") +
13985              left +
13986              " " +
13987              "top" +
13988              (top >= 0 ? "+" : "") +
13989              top,
13990            of: that.window,
13991          };
13992          that._removeClass($(this), "ui-dialog-dragging");
13993          that._unblockFrames();
13994          that._trigger("dragStop", event, filteredUi(ui));
13995        },
13996      });
13997    },
13998
13999    _makeResizable: function () {
14000      var that = this,
14001        options = this.options,
14002        handles = options.resizable,
14003        // .ui-resizable has position: relative defined in the stylesheet
14004        // but dialogs have to use absolute or fixed positioning
14005        position = this.uiDialog.css("position"),
14006        resizeHandles =
14007          typeof handles === "string" ? handles : "n,e,s,w,se,sw,ne,nw";
14008
14009      function filteredUi(ui) {
14010        return {
14011          originalPosition: ui.originalPosition,
14012          originalSize: ui.originalSize,
14013          position: ui.position,
14014          size: ui.size,
14015        };
14016      }
14017
14018      this.uiDialog
14019        .resizable({
14020          cancel: ".ui-dialog-content",
14021          containment: "document",
14022          alsoResize: this.element,
14023          maxWidth: options.maxWidth,
14024          maxHeight: options.maxHeight,
14025          minWidth: options.minWidth,
14026          minHeight: this._minHeight(),
14027          handles: resizeHandles,
14028          start: function (event, ui) {
14029            that._addClass($(this), "ui-dialog-resizing");
14030            that._blockFrames();
14031            that._trigger("resizeStart", event, filteredUi(ui));
14032          },
14033          resize: function (event, ui) {
14034            that._trigger("resize", event, filteredUi(ui));
14035          },
14036          stop: function (event, ui) {
14037            var offset = that.uiDialog.offset(),
14038              left = offset.left - that.document.scrollLeft(),
14039              top = offset.top - that.document.scrollTop();
14040
14041            options.height = that.uiDialog.height();
14042            options.width = that.uiDialog.width();
14043            options.position = {
14044              my: "left top",
14045              at:
14046                "left" +
14047                (left >= 0 ? "+" : "") +
14048                left +
14049                " " +
14050                "top" +
14051                (top >= 0 ? "+" : "") +
14052                top,
14053              of: that.window,
14054            };
14055            that._removeClass($(this), "ui-dialog-resizing");
14056            that._unblockFrames();
14057            that._trigger("resizeStop", event, filteredUi(ui));
14058          },
14059        })
14060        .css("position", position);
14061    },
14062
14063    _trackFocus: function () {
14064      this._on(this.widget(), {
14065        focusin: function (event) {
14066          this._makeFocusTarget();
14067          this._focusedElement = $(event.target);
14068        },
14069      });
14070    },
14071
14072    _makeFocusTarget: function () {
14073      this._untrackInstance();
14074      this._trackingInstances().unshift(this);
14075    },
14076
14077    _untrackInstance: function () {
14078      var instances = this._trackingInstances(),
14079        exists = $.inArray(this, instances);
14080      if (exists !== -1) {
14081        instances.splice(exists, 1);
14082      }
14083    },
14084
14085    _trackingInstances: function () {
14086      var instances = this.document.data("ui-dialog-instances");
14087      if (!instances) {
14088        instances = [];
14089        this.document.data("ui-dialog-instances", instances);
14090      }
14091      return instances;
14092    },
14093
14094    _minHeight: function () {
14095      var options = this.options;
14096
14097      return options.height === "auto"
14098        ? options.minHeight
14099        : Math.min(options.minHeight, options.height);
14100    },
14101
14102    _position: function () {
14103      // Need to show the dialog to get the actual offset in the position plugin
14104      var isVisible = this.uiDialog.is(":visible");
14105      if (!isVisible) {
14106        this.uiDialog.show();
14107      }
14108      this.uiDialog.position(this.options.position);
14109      if (!isVisible) {
14110        this.uiDialog.hide();
14111      }
14112    },
14113
14114    _setOptions: function (options) {
14115      var that = this,
14116        resize = false,
14117        resizableOptions = {};
14118
14119      $.each(options, function (key, value) {
14120        that._setOption(key, value);
14121
14122        if (key in that.sizeRelatedOptions) {
14123          resize = true;
14124        }
14125        if (key in that.resizableRelatedOptions) {
14126          resizableOptions[key] = value;
14127        }
14128      });
14129
14130      if (resize) {
14131        this._size();
14132        this._position();
14133      }
14134      if (this.uiDialog.is(":data(ui-resizable)")) {
14135        this.uiDialog.resizable("option", resizableOptions);
14136      }
14137    },
14138
14139    _setOption: function (key, value) {
14140      var isDraggable,
14141        isResizable,
14142        uiDialog = this.uiDialog;
14143
14144      if (key === "disabled") {
14145        return;
14146      }
14147
14148      this._super(key, value);
14149
14150      if (key === "appendTo") {
14151        this.uiDialog.appendTo(this._appendTo());
14152      }
14153
14154      if (key === "buttons") {
14155        this._createButtons();
14156      }
14157
14158      if (key === "closeText") {
14159        this.uiDialogTitlebarClose.button({
14160          // Ensure that we always pass a string
14161          label: $("<a>")
14162            .text("" + this.options.closeText)
14163            .html(),
14164        });
14165      }
14166
14167      if (key === "draggable") {
14168        isDraggable = uiDialog.is(":data(ui-draggable)");
14169        if (isDraggable && !value) {
14170          uiDialog.draggable("destroy");
14171        }
14172
14173        if (!isDraggable && value) {
14174          this._makeDraggable();
14175        }
14176      }
14177
14178      if (key === "position") {
14179        this._position();
14180      }
14181
14182      if (key === "resizable") {
14183        // currently resizable, becoming non-resizable
14184        isResizable = uiDialog.is(":data(ui-resizable)");
14185        if (isResizable && !value) {
14186          uiDialog.resizable("destroy");
14187        }
14188
14189        // Currently resizable, changing handles
14190        if (isResizable && typeof value === "string") {
14191          uiDialog.resizable("option", "handles", value);
14192        }
14193
14194        // Currently non-resizable, becoming resizable
14195        if (!isResizable && value !== false) {
14196          this._makeResizable();
14197        }
14198      }
14199
14200      if (key === "title") {
14201        this._title(this.uiDialogTitlebar.find(".ui-dialog-title"));
14202      }
14203    },
14204
14205    _size: function () {
14206      // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
14207      // divs will both have width and height set, so we need to reset them
14208      var nonContentHeight,
14209        minContentHeight,
14210        maxContentHeight,
14211        options = this.options;
14212
14213      // Reset content sizing
14214      this.element.show().css({
14215        width: "auto",
14216        minHeight: 0,
14217        maxHeight: "none",
14218        height: 0,
14219      });
14220
14221      if (options.minWidth > options.width) {
14222        options.width = options.minWidth;
14223      }
14224
14225      // Reset wrapper sizing
14226      // determine the height of all the non-content elements
14227      nonContentHeight = this.uiDialog
14228        .css({
14229          height: "auto",
14230          width: options.width,
14231        })
14232        .outerHeight();
14233      minContentHeight = Math.max(0, options.minHeight - nonContentHeight);
14234      maxContentHeight =
14235        typeof options.maxHeight === "number"
14236          ? Math.max(0, options.maxHeight - nonContentHeight)
14237          : "none";
14238
14239      if (options.height === "auto") {
14240        this.element.css({
14241          minHeight: minContentHeight,
14242          maxHeight: maxContentHeight,
14243          height: "auto",
14244        });
14245      } else {
14246        this.element.height(Math.max(0, options.height - nonContentHeight));
14247      }
14248
14249      if (this.uiDialog.is(":data(ui-resizable)")) {
14250        this.uiDialog.resizable("option", "minHeight", this._minHeight());
14251      }
14252    },
14253
14254    _blockFrames: function () {
14255      this.iframeBlocks = this.document.find("iframe").map(function () {
14256        var iframe = $(this);
14257
14258        return $("<div>")
14259          .css({
14260            position: "absolute",
14261            width: iframe.outerWidth(),
14262            height: iframe.outerHeight(),
14263          })
14264          .appendTo(iframe.parent())
14265          .offset(iframe.offset())[0];
14266      });
14267    },
14268
14269    _unblockFrames: function () {
14270      if (this.iframeBlocks) {
14271        this.iframeBlocks.remove();
14272        delete this.iframeBlocks;
14273      }
14274    },
14275
14276    _allowInteraction: function (event) {
14277      if ($(event.target).closest(".ui-dialog").length) {
14278        return true;
14279      }
14280
14281      // TODO: Remove hack when datepicker implements
14282      // the .ui-front logic (#8989)
14283      return !!$(event.target).closest(".ui-datepicker").length;
14284    },
14285
14286    _createOverlay: function () {
14287      if (!this.options.modal) {
14288        return;
14289      }
14290
14291      var jqMinor = $.fn.jquery.substring(0, 4);
14292
14293      // We use a delay in case the overlay is created from an
14294      // event that we're going to be cancelling (#2804)
14295      var isOpening = true;
14296      this._delay(function () {
14297        isOpening = false;
14298      });
14299
14300      if (!this.document.data("ui-dialog-overlays")) {
14301        // Prevent use of anchors and inputs
14302        // This doesn't use `_on()` because it is a shared event handler
14303        // across all open modal dialogs.
14304        this.document.on(
14305          "focusin.ui-dialog",
14306          function (event) {
14307            if (isOpening) {
14308              return;
14309            }
14310
14311            var instance = this._trackingInstances()[0];
14312            if (!instance._allowInteraction(event)) {
14313              event.preventDefault();
14314              instance._focusTabbable();
14315
14316              // Support: jQuery >=3.4 <3.6 only
14317              // Focus re-triggering in jQuery 3.4/3.5 makes the original element
14318              // have its focus event propagated last, breaking the re-targeting.
14319              // Trigger focus in a delay in addition if needed to avoid the issue
14320              // See https://github.com/jquery/jquery/issues/4382
14321              if (jqMinor === "3.4." || jqMinor === "3.5.") {
14322                instance._delay(instance._restoreTabbableFocus);
14323              }
14324            }
14325          }.bind(this)
14326        );
14327      }
14328
14329      this.overlay = $("<div>").appendTo(this._appendTo());
14330
14331      this._addClass(this.overlay, null, "ui-widget-overlay ui-front");
14332      this._on(this.overlay, {
14333        mousedown: "_keepFocus",
14334      });
14335      this.document.data(
14336        "ui-dialog-overlays",
14337        (this.document.data("ui-dialog-overlays") || 0) + 1
14338      );
14339    },
14340
14341    _destroyOverlay: function () {
14342      if (!this.options.modal) {
14343        return;
14344      }
14345
14346      if (this.overlay) {
14347        var overlays = this.document.data("ui-dialog-overlays") - 1;
14348
14349        if (!overlays) {
14350          this.document.off("focusin.ui-dialog");
14351          this.document.removeData("ui-dialog-overlays");
14352        } else {
14353          this.document.data("ui-dialog-overlays", overlays);
14354        }
14355
14356        this.overlay.remove();
14357        this.overlay = null;
14358      }
14359    },
14360  });
14361
14362  // DEPRECATED
14363  // TODO: switch return back to widget declaration at top of file when this is removed
14364  if ($.uiBackCompat !== false) {
14365    // Backcompat for dialogClass option
14366    $.widget("ui.dialog", $.ui.dialog, {
14367      options: {
14368        dialogClass: "",
14369      },
14370      _createWrapper: function () {
14371        this._super();
14372        this.uiDialog.addClass(this.options.dialogClass);
14373      },
14374      _setOption: function (key, value) {
14375        if (key === "dialogClass") {
14376          this.uiDialog.removeClass(this.options.dialogClass).addClass(value);
14377        }
14378        this._superApply(arguments);
14379      },
14380    });
14381  }
14382
14383  var widgetsDialog = $.ui.dialog;
14384
14385  /*!
14386   * jQuery UI Droppable 1.13.2
14387   * http://jqueryui.com
14388   *
14389   * Copyright jQuery Foundation and other contributors
14390   * Released under the MIT license.
14391   * http://jquery.org/license
14392   */
14393
14394  //>>label: Droppable
14395  //>>group: Interactions
14396  //>>description: Enables drop targets for draggable elements.
14397  //>>docs: http://api.jqueryui.com/droppable/
14398  //>>demos: http://jqueryui.com/droppable/
14399
14400  $.widget("ui.droppable", {
14401    version: "1.13.2",
14402    widgetEventPrefix: "drop",
14403    options: {
14404      accept: "*",
14405      addClasses: true,
14406      greedy: false,
14407      scope: "default",
14408      tolerance: "intersect",
14409
14410      // Callbacks
14411      activate: null,
14412      deactivate: null,
14413      drop: null,
14414      out: null,
14415      over: null,
14416    },
14417    _create: function () {
14418      var proportions,
14419        o = this.options,
14420        accept = o.accept;
14421
14422      this.isover = false;
14423      this.isout = true;
14424
14425      this.accept =
14426        typeof accept === "function"
14427          ? accept
14428          : function (d) {
14429              return d.is(accept);
14430            };
14431
14432      this.proportions = function (/* valueToWrite */) {
14433        if (arguments.length) {
14434          // Store the droppable's proportions
14435          proportions = arguments[0];
14436        } else {
14437          // Retrieve or derive the droppable's proportions
14438          return proportions
14439            ? proportions
14440            : (proportions = {
14441                width: this.element[0].offsetWidth,
14442                height: this.element[0].offsetHeight,
14443              });
14444        }
14445      };
14446
14447      this._addToManager(o.scope);
14448
14449      if (o.addClasses) {
14450        this._addClass("ui-droppable");
14451      }
14452    },
14453
14454    _addToManager: function (scope) {
14455      // Add the reference and positions to the manager
14456      $.ui.ddmanager.droppables[scope] = $.ui.ddmanager.droppables[scope] || [];
14457      $.ui.ddmanager.droppables[scope].push(this);
14458    },
14459
14460    _splice: function (drop) {
14461      var i = 0;
14462      for (; i < drop.length; i++) {
14463        if (drop[i] === this) {
14464          drop.splice(i, 1);
14465        }
14466      }
14467    },
14468
14469    _destroy: function () {
14470      var drop = $.ui.ddmanager.droppables[this.options.scope];
14471
14472      this._splice(drop);
14473    },
14474
14475    _setOption: function (key, value) {
14476      if (key === "accept") {
14477        this.accept =
14478          typeof value === "function"
14479            ? value
14480            : function (d) {
14481                return d.is(value);
14482              };
14483      } else if (key === "scope") {
14484        var drop = $.ui.ddmanager.droppables[this.options.scope];
14485
14486        this._splice(drop);
14487        this._addToManager(value);
14488      }
14489
14490      this._super(key, value);
14491    },
14492
14493    _activate: function (event) {
14494      var draggable = $.ui.ddmanager.current;
14495
14496      this._addActiveClass();
14497      if (draggable) {
14498        this._trigger("activate", event, this.ui(draggable));
14499      }
14500    },
14501
14502    _deactivate: function (event) {
14503      var draggable = $.ui.ddmanager.current;
14504
14505      this._removeActiveClass();
14506      if (draggable) {
14507        this._trigger("deactivate", event, this.ui(draggable));
14508      }
14509    },
14510
14511    _over: function (event) {
14512      var draggable = $.ui.ddmanager.current;
14513
14514      // Bail if draggable and droppable are same element
14515      if (
14516        !draggable ||
14517        (draggable.currentItem || draggable.element)[0] === this.element[0]
14518      ) {
14519        return;
14520      }
14521
14522      if (
14523        this.accept.call(
14524          this.element[0],
14525          draggable.currentItem || draggable.element
14526        )
14527      ) {
14528        this._addHoverClass();
14529        this._trigger("over", event, this.ui(draggable));
14530      }
14531    },
14532
14533    _out: function (event) {
14534      var draggable = $.ui.ddmanager.current;
14535
14536      // Bail if draggable and droppable are same element
14537      if (
14538        !draggable ||
14539        (draggable.currentItem || draggable.element)[0] === this.element[0]
14540      ) {
14541        return;
14542      }
14543
14544      if (
14545        this.accept.call(
14546          this.element[0],
14547          draggable.currentItem || draggable.element
14548        )
14549      ) {
14550        this._removeHoverClass();
14551        this._trigger("out", event, this.ui(draggable));
14552      }
14553    },
14554
14555    _drop: function (event, custom) {
14556      var draggable = custom || $.ui.ddmanager.current,
14557        childrenIntersection = false;
14558
14559      // Bail if draggable and droppable are same element
14560      if (
14561        !draggable ||
14562        (draggable.currentItem || draggable.element)[0] === this.element[0]
14563      ) {
14564        return false;
14565      }
14566
14567      this.element
14568        .find(":data(ui-droppable)")
14569        .not(".ui-draggable-dragging")
14570        .each(function () {
14571          var inst = $(this).droppable("instance");
14572          if (
14573            inst.options.greedy &&
14574            !inst.options.disabled &&
14575            inst.options.scope === draggable.options.scope &&
14576            inst.accept.call(
14577              inst.element[0],
14578              draggable.currentItem || draggable.element
14579            ) &&
14580            $.ui.intersect(
14581              draggable,
14582              $.extend(inst, { offset: inst.element.offset() }),
14583              inst.options.tolerance,
14584              event
14585            )
14586          ) {
14587            childrenIntersection = true;
14588            return false;
14589          }
14590        });
14591      if (childrenIntersection) {
14592        return false;
14593      }
14594
14595      if (
14596        this.accept.call(
14597          this.element[0],
14598          draggable.currentItem || draggable.element
14599        )
14600      ) {
14601        this._removeActiveClass();
14602        this._removeHoverClass();
14603
14604        this._trigger("drop", event, this.ui(draggable));
14605        return this.element;
14606      }
14607
14608      return false;
14609    },
14610
14611    ui: function (c) {
14612      return {
14613        draggable: c.currentItem || c.element,
14614        helper: c.helper,
14615        position: c.position,
14616        offset: c.positionAbs,
14617      };
14618    },
14619
14620    // Extension points just to make backcompat sane and avoid duplicating logic
14621    // TODO: Remove in 1.14 along with call to it below
14622    _addHoverClass: function () {
14623      this._addClass("ui-droppable-hover");
14624    },
14625
14626    _removeHoverClass: function () {
14627      this._removeClass("ui-droppable-hover");
14628    },
14629
14630    _addActiveClass: function () {
14631      this._addClass("ui-droppable-active");
14632    },
14633
14634    _removeActiveClass: function () {
14635      this._removeClass("ui-droppable-active");
14636    },
14637  });
14638
14639  $.ui.intersect = (function () {
14640    function isOverAxis(x, reference, size) {
14641      return x >= reference && x < reference + size;
14642    }
14643
14644    return function (draggable, droppable, toleranceMode, event) {
14645      if (!droppable.offset) {
14646        return false;
14647      }
14648
14649      var x1 =
14650          (draggable.positionAbs || draggable.position.absolute).left +
14651          draggable.margins.left,
14652        y1 =
14653          (draggable.positionAbs || draggable.position.absolute).top +
14654          draggable.margins.top,
14655        x2 = x1 + draggable.helperProportions.width,
14656        y2 = y1 + draggable.helperProportions.height,
14657        l = droppable.offset.left,
14658        t = droppable.offset.top,
14659        r = l + droppable.proportions().width,
14660        b = t + droppable.proportions().height;
14661
14662      switch (toleranceMode) {
14663        case "fit":
14664          return l <= x1 && x2 <= r && t <= y1 && y2 <= b;
14665        case "intersect":
14666          return (
14667            l < x1 + draggable.helperProportions.width / 2 && // Right Half
14668            x2 - draggable.helperProportions.width / 2 < r && // Left Half
14669            t < y1 + draggable.helperProportions.height / 2 && // Bottom Half
14670            y2 - draggable.helperProportions.height / 2 < b
14671          ); // Top Half
14672        case "pointer":
14673          return (
14674            isOverAxis(event.pageY, t, droppable.proportions().height) &&
14675            isOverAxis(event.pageX, l, droppable.proportions().width)
14676          );
14677        case "touch":
14678          return (
14679            ((y1 >= t && y1 <= b) || // Top edge touching
14680              (y2 >= t && y2 <= b) || // Bottom edge touching
14681              (y1 < t && y2 > b)) && // Surrounded vertically
14682            ((x1 >= l && x1 <= r) || // Left edge touching
14683              (x2 >= l && x2 <= r) || // Right edge touching
14684              (x1 < l && x2 > r)) // Surrounded horizontally
14685          );
14686        default:
14687          return false;
14688      }
14689    };
14690  })();
14691
14692  /*
14693	This manager tracks offsets of draggables and droppables
14694*/
14695  $.ui.ddmanager = {
14696    current: null,
14697    droppables: { default: [] },
14698    prepareOffsets: function (t, event) {
14699      var i,
14700        j,
14701        m = $.ui.ddmanager.droppables[t.options.scope] || [],
14702        type = event ? event.type : null, // workaround for #2317
14703        list = (t.currentItem || t.element)
14704          .find(":data(ui-droppable)")
14705          .addBack();
14706
14707      droppablesLoop: for (i = 0; i < m.length; i++) {
14708        // No disabled and non-accepted
14709        if (
14710          m[i].options.disabled ||
14711          (t && !m[i].accept.call(m[i].element[0], t.currentItem || t.element))
14712        ) {
14713          continue;
14714        }
14715
14716        // Filter out elements in the current dragged item
14717        for (j = 0; j < list.length; j++) {
14718          if (list[j] === m[i].element[0]) {
14719            m[i].proportions().height = 0;
14720            continue droppablesLoop;
14721          }
14722        }
14723
14724        m[i].visible = m[i].element.css("display") !== "none";
14725        if (!m[i].visible) {
14726          continue;
14727        }
14728
14729        // Activate the droppable if used directly from draggables
14730        if (type === "mousedown") {
14731          m[i]._activate.call(m[i], event);
14732        }
14733
14734        m[i].offset = m[i].element.offset();
14735        m[i].proportions({
14736          width: m[i].element[0].offsetWidth,
14737          height: m[i].element[0].offsetHeight,
14738        });
14739      }
14740    },
14741    drop: function (draggable, event) {
14742      var dropped = false;
14743
14744      // Create a copy of the droppables in case the list changes during the drop (#9116)
14745      $.each(
14746        ($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(),
14747        function () {
14748          if (!this.options) {
14749            return;
14750          }
14751          if (
14752            !this.options.disabled &&
14753            this.visible &&
14754            $.ui.intersect(draggable, this, this.options.tolerance, event)
14755          ) {
14756            dropped = this._drop.call(this, event) || dropped;
14757          }
14758
14759          if (
14760            !this.options.disabled &&
14761            this.visible &&
14762            this.accept.call(
14763              this.element[0],
14764              draggable.currentItem || draggable.element
14765            )
14766          ) {
14767            this.isout = true;
14768            this.isover = false;
14769            this._deactivate.call(this, event);
14770          }
14771        }
14772      );
14773      return dropped;
14774    },
14775    dragStart: function (draggable, event) {
14776      // Listen for scrolling so that if the dragging causes scrolling the position of the
14777      // droppables can be recalculated (see #5003)
14778      draggable.element
14779        .parentsUntil("body")
14780        .on("scroll.droppable", function () {
14781          if (!draggable.options.refreshPositions) {
14782            $.ui.ddmanager.prepareOffsets(draggable, event);
14783          }
14784        });
14785    },
14786    drag: function (draggable, event) {
14787      // If you have a highly dynamic page, you might try this option. It renders positions
14788      // every time you move the mouse.
14789      if (draggable.options.refreshPositions) {
14790        $.ui.ddmanager.prepareOffsets(draggable, event);
14791      }
14792
14793      // Run through all droppables and check their positions based on specific tolerance options
14794      $.each(
14795        $.ui.ddmanager.droppables[draggable.options.scope] || [],
14796        function () {
14797          if (this.options.disabled || this.greedyChild || !this.visible) {
14798            return;
14799          }
14800
14801          var parentInstance,
14802            scope,
14803            parent,
14804            intersects = $.ui.intersect(
14805              draggable,
14806              this,
14807              this.options.tolerance,
14808              event
14809            ),
14810            c =
14811              !intersects && this.isover
14812                ? "isout"
14813                : intersects && !this.isover
14814                ? "isover"
14815                : null;
14816          if (!c) {
14817            return;
14818          }
14819
14820          if (this.options.greedy) {
14821            // find droppable parents with same scope
14822            scope = this.options.scope;
14823            parent = this.element
14824              .parents(":data(ui-droppable)")
14825              .filter(function () {
14826                return $(this).droppable("instance").options.scope === scope;
14827              });
14828
14829            if (parent.length) {
14830              parentInstance = $(parent[0]).droppable("instance");
14831              parentInstance.greedyChild = c === "isover";
14832            }
14833          }
14834
14835          // We just moved into a greedy child
14836          if (parentInstance && c === "isover") {
14837            parentInstance.isover = false;
14838            parentInstance.isout = true;
14839            parentInstance._out.call(parentInstance, event);
14840          }
14841
14842          this[c] = true;
14843          this[c === "isout" ? "isover" : "isout"] = false;
14844          this[c === "isover" ? "_over" : "_out"].call(this, event);
14845
14846          // We just moved out of a greedy child
14847          if (parentInstance && c === "isout") {
14848            parentInstance.isout = false;
14849            parentInstance.isover = true;
14850            parentInstance._over.call(parentInstance, event);
14851          }
14852        }
14853      );
14854    },
14855    dragStop: function (draggable, event) {
14856      draggable.element.parentsUntil("body").off("scroll.droppable");
14857
14858      // Call prepareOffsets one final time since IE does not fire return scroll events when
14859      // overflow was caused by drag (see #5003)
14860      if (!draggable.options.refreshPositions) {
14861        $.ui.ddmanager.prepareOffsets(draggable, event);
14862      }
14863    },
14864  };
14865
14866  // DEPRECATED
14867  // TODO: switch return back to widget declaration at top of file when this is removed
14868  if ($.uiBackCompat !== false) {
14869    // Backcompat for activeClass and hoverClass options
14870    $.widget("ui.droppable", $.ui.droppable, {
14871      options: {
vendor: 19,563 bytes, lines 14872-15529
14872        hoverClass: false,
14873        activeClass: false,
14874      },
14875      _addActiveClass: function () {
14876        this._super();
14877        if (this.options.activeClass) {
14878          this.element.addClass(this.options.activeClass);
14879        }
14880      },
14881      _removeActiveClass: function () {
14882        this._super();
14883        if (this.options.activeClass) {
14884          this.element.removeClass(this.options.activeClass);
14885        }
14886      },
14887      _addHoverClass: function () {
14888        this._super();
14889        if (this.options.hoverClass) {
14890          this.element.addClass(this.options.hoverClass);
14891        }
14892      },
14893      _removeHoverClass: function () {
14894        this._super();
14895        if (this.options.hoverClass) {
14896          this.element.removeClass(this.options.hoverClass);
14897        }
14898      },
14899    });
14900  }
14901
14902  var widgetsDroppable = $.ui.droppable;
14903
14904  /*!
14905   * jQuery UI Progressbar 1.13.2
14906   * http://jqueryui.com
14907   *
14908   * Copyright jQuery Foundation and other contributors
14909   * Released under the MIT license.
14910   * http://jquery.org/license
14911   */
14912
14913  //>>label: Progressbar
14914  //>>group: Widgets
14915  /* eslint-disable max-len */
14916  //>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
14917  /* eslint-enable max-len */
14918  //>>docs: http://api.jqueryui.com/progressbar/
14919  //>>demos: http://jqueryui.com/progressbar/
14920  //>>css.structure: ../../themes/base/core.css
14921  //>>css.structure: ../../themes/base/progressbar.css
14922  //>>css.theme: ../../themes/base/theme.css
14923
14924  var widgetsProgressbar = $.widget("ui.progressbar", {
14925    version: "1.13.2",
14926    options: {
14927      classes: {
14928        "ui-progressbar": "ui-corner-all",
14929        "ui-progressbar-value": "ui-corner-left",
14930        "ui-progressbar-complete": "ui-corner-right",
14931      },
14932      max: 100,
14933      value: 0,
14934
14935      change: null,
14936      complete: null,
14937    },
14938
14939    min: 0,
14940
14941    _create: function () {
14942      // Constrain initial value
14943      this.oldValue = this.options.value = this._constrainedValue();
14944
14945      this.element.attr({
14946        // Only set static values; aria-valuenow and aria-valuemax are
14947        // set inside _refreshValue()
14948        role: "progressbar",
14949        "aria-valuemin": this.min,
14950      });
14951      this._addClass("ui-progressbar", "ui-widget ui-widget-content");
14952
14953      this.valueDiv = $("<div>").appendTo(this.element);
14954      this._addClass(this.valueDiv, "ui-progressbar-value", "ui-widget-header");
14955      this._refreshValue();
14956    },
14957
14958    _destroy: function () {
14959      this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow");
14960
14961      this.valueDiv.remove();
14962    },
14963
14964    value: function (newValue) {
14965      if (newValue === undefined) {
14966        return this.options.value;
14967      }
14968
14969      this.options.value = this._constrainedValue(newValue);
14970      this._refreshValue();
14971    },
14972
14973    _constrainedValue: function (newValue) {
14974      if (newValue === undefined) {
14975        newValue = this.options.value;
14976      }
14977
14978      this.indeterminate = newValue === false;
14979
14980      // Sanitize value
14981      if (typeof newValue !== "number") {
14982        newValue = 0;
14983      }
14984
14985      return this.indeterminate
14986        ? false
14987        : Math.min(this.options.max, Math.max(this.min, newValue));
14988    },
14989
14990    _setOptions: function (options) {
14991      // Ensure "value" option is set after other values (like max)
14992      var value = options.value;
14993      delete options.value;
14994
14995      this._super(options);
14996
14997      this.options.value = this._constrainedValue(value);
14998      this._refreshValue();
14999    },
15000
15001    _setOption: function (key, value) {
15002      if (key === "max") {
15003        // Don't allow a max less than min
15004        value = Math.max(this.min, value);
15005      }
15006      this._super(key, value);
15007    },
15008
15009    _setOptionDisabled: function (value) {
15010      this._super(value);
15011
15012      this.element.attr("aria-disabled", value);
15013      this._toggleClass(null, "ui-state-disabled", !!value);
15014    },
15015
15016    _percentage: function () {
15017      return this.indeterminate
15018        ? 100
15019        : (100 * (this.options.value - this.min)) /
15020            (this.options.max - this.min);
15021    },
15022
15023    _refreshValue: function () {
15024      var value = this.options.value,
15025        percentage = this._percentage();
15026
15027      this.valueDiv
15028        .toggle(this.indeterminate || value > this.min)
15029        .width(percentage.toFixed(0) + "%");
15030
15031      this._toggleClass(
15032        this.valueDiv,
15033        "ui-progressbar-complete",
15034        null,
15035        value === this.options.max
15036      )._toggleClass("ui-progressbar-indeterminate", null, this.indeterminate);
15037
15038      if (this.indeterminate) {
15039        this.element.removeAttr("aria-valuenow");
15040        if (!this.overlayDiv) {
15041          this.overlayDiv = $("<div>").appendTo(this.valueDiv);
15042          this._addClass(this.overlayDiv, "ui-progressbar-overlay");
15043        }
15044      } else {
15045        this.element.attr({
15046          "aria-valuemax": this.options.max,
15047          "aria-valuenow": value,
15048        });
15049        if (this.overlayDiv) {
15050          this.overlayDiv.remove();
15051          this.overlayDiv = null;
15052        }
15053      }
15054
15055      if (this.oldValue !== value) {
15056        this.oldValue = value;
15057        this._trigger("change");
15058      }
15059      if (value === this.options.max) {
15060        this._trigger("complete");
15061      }
15062    },
15063  });
15064
15065  /*!
15066   * jQuery UI Selectable 1.13.2
15067   * http://jqueryui.com
15068   *
15069   * Copyright jQuery Foundation and other contributors
15070   * Released under the MIT license.
15071   * http://jquery.org/license
15072   */
15073
15074  //>>label: Selectable
15075  //>>group: Interactions
15076  //>>description: Allows groups of elements to be selected with the mouse.
15077  //>>docs: http://api.jqueryui.com/selectable/
15078  //>>demos: http://jqueryui.com/selectable/
15079  //>>css.structure: ../../themes/base/selectable.css
15080
15081  var widgetsSelectable = $.widget("ui.selectable", $.ui.mouse, {
15082    version: "1.13.2",
15083    options: {
15084      appendTo: "body",
15085      autoRefresh: true,
15086      distance: 0,
15087      filter: "*",
15088      tolerance: "touch",
15089
15090      // Callbacks
15091      selected: null,
15092      selecting: null,
15093      start: null,
15094      stop: null,
15095      unselected: null,
15096      unselecting: null,
15097    },
15098    _create: function () {
15099      var that = this;
15100
15101      this._addClass("ui-selectable");
15102
15103      this.dragged = false;
15104
15105      // Cache selectee children based on filter
15106      this.refresh = function () {
15107        that.elementPos = $(that.element[0]).offset();
15108        that.selectees = $(that.options.filter, that.element[0]);
15109        that._addClass(that.selectees, "ui-selectee");
15110        that.selectees.each(function () {
15111          var $this = $(this),
15112            selecteeOffset = $this.offset(),
15113            pos = {
15114              left: selecteeOffset.left - that.elementPos.left,
15115              top: selecteeOffset.top - that.elementPos.top,
15116            };
15117          $.data(this, "selectable-item", {
15118            element: this,
15119            $element: $this,
15120            left: pos.left,
15121            top: pos.top,
15122            right: pos.left + $this.outerWidth(),
15123            bottom: pos.top + $this.outerHeight(),
15124            startselected: false,
15125            selected: $this.hasClass("ui-selected"),
15126            selecting: $this.hasClass("ui-selecting"),
15127            unselecting: $this.hasClass("ui-unselecting"),
15128          });
15129        });
15130      };
15131      this.refresh();
15132
15133      this._mouseInit();
15134
15135      this.helper = $("<div>");
15136      this._addClass(this.helper, "ui-selectable-helper");
15137    },
15138
15139    _destroy: function () {
15140      this.selectees.removeData("selectable-item");
15141      this._mouseDestroy();
15142    },
15143
15144    _mouseStart: function (event) {
15145      var that = this,
15146        options = this.options;
15147
15148      this.opos = [event.pageX, event.pageY];
15149      this.elementPos = $(this.element[0]).offset();
15150
15151      if (this.options.disabled) {
15152        return;
15153      }
15154
15155      this.selectees = $(options.filter, this.element[0]);
15156
15157      this._trigger("start", event);
15158
15159      $(options.appendTo).append(this.helper);
15160
15161      // position helper (lasso)
15162      this.helper.css({
15163        left: event.pageX,
15164        top: event.pageY,
15165        width: 0,
15166        height: 0,
15167      });
15168
15169      if (options.autoRefresh) {
15170        this.refresh();
15171      }
15172
15173      this.selectees.filter(".ui-selected").each(function () {
15174        var selectee = $.data(this, "selectable-item");
15175        selectee.startselected = true;
15176        if (!event.metaKey && !event.ctrlKey) {
15177          that._removeClass(selectee.$element, "ui-selected");
15178          selectee.selected = false;
15179          that._addClass(selectee.$element, "ui-unselecting");
15180          selectee.unselecting = true;
15181
15182          // selectable UNSELECTING callback
15183          that._trigger("unselecting", event, {
15184            unselecting: selectee.element,
15185          });
15186        }
15187      });
15188
15189      $(event.target)
15190        .parents()
15191        .addBack()
15192        .each(function () {
15193          var doSelect,
15194            selectee = $.data(this, "selectable-item");
15195          if (selectee) {
15196            doSelect =
15197              (!event.metaKey && !event.ctrlKey) ||
15198              !selectee.$element.hasClass("ui-selected");
15199            that
15200              ._removeClass(
15201                selectee.$element,
15202                doSelect ? "ui-unselecting" : "ui-selected"
15203              )
15204              ._addClass(
15205                selectee.$element,
15206                doSelect ? "ui-selecting" : "ui-unselecting"
15207              );
15208            selectee.unselecting = !doSelect;
15209            selectee.selecting = doSelect;
15210            selectee.selected = doSelect;
15211
15212            // selectable (UN)SELECTING callback
15213            if (doSelect) {
15214              that._trigger("selecting", event, {
15215                selecting: selectee.element,
15216              });
15217            } else {
15218              that._trigger("unselecting", event, {
15219                unselecting: selectee.element,
15220              });
15221            }
15222            return false;
15223          }
15224        });
15225    },
15226
15227    _mouseDrag: function (event) {
15228      this.dragged = true;
15229
15230      if (this.options.disabled) {
15231        return;
15232      }
15233
15234      var tmp,
15235        that = this,
15236        options = this.options,
15237        x1 = this.opos[0],
15238        y1 = this.opos[1],
15239        x2 = event.pageX,
15240        y2 = event.pageY;
15241
15242      if (x1 > x2) {
15243        tmp = x2;
15244        x2 = x1;
15245        x1 = tmp;
15246      }
15247      if (y1 > y2) {
15248        tmp = y2;
15249        y2 = y1;
15250        y1 = tmp;
15251      }
15252      this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
15253
15254      this.selectees.each(function () {
15255        var selectee = $.data(this, "selectable-item"),
15256          hit = false,
15257          offset = {};
15258
15259        //prevent helper from being selected if appendTo: selectable
15260        if (!selectee || selectee.element === that.element[0]) {
15261          return;
15262        }
15263
15264        offset.left = selectee.left + that.elementPos.left;
15265        offset.right = selectee.right + that.elementPos.left;
15266        offset.top = selectee.top + that.elementPos.top;
15267        offset.bottom = selectee.bottom + that.elementPos.top;
15268
15269        if (options.tolerance === "touch") {
15270          hit = !(
15271            offset.left > x2 ||
15272            offset.right < x1 ||
15273            offset.top > y2 ||
15274            offset.bottom < y1
15275          );
15276        } else if (options.tolerance === "fit") {
15277          hit =
15278            offset.left > x1 &&
15279            offset.right < x2 &&
15280            offset.top > y1 &&
15281            offset.bottom < y2;
15282        }
15283
15284        if (hit) {
15285          // SELECT
15286          if (selectee.selected) {
15287            that._removeClass(selectee.$element, "ui-selected");
15288            selectee.selected = false;
15289          }
15290          if (selectee.unselecting) {
15291            that._removeClass(selectee.$element, "ui-unselecting");
15292            selectee.unselecting = false;
15293          }
15294          if (!selectee.selecting) {
15295            that._addClass(selectee.$element, "ui-selecting");
15296            selectee.selecting = true;
15297
15298            // selectable SELECTING callback
15299            that._trigger("selecting", event, {
15300              selecting: selectee.element,
15301            });
15302          }
15303        } else {
15304          // UNSELECT
15305          if (selectee.selecting) {
15306            if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
15307              that._removeClass(selectee.$element, "ui-selecting");
15308              selectee.selecting = false;
15309              that._addClass(selectee.$element, "ui-selected");
15310              selectee.selected = true;
15311            } else {
15312              that._removeClass(selectee.$element, "ui-selecting");
15313              selectee.selecting = false;
15314              if (selectee.startselected) {
15315                that._addClass(selectee.$element, "ui-unselecting");
15316                selectee.unselecting = true;
15317              }
15318
15319              // selectable UNSELECTING callback
15320              that._trigger("unselecting", event, {
15321                unselecting: selectee.element,
15322              });
15323            }
15324          }
15325          if (selectee.selected) {
15326            if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
15327              that._removeClass(selectee.$element, "ui-selected");
15328              selectee.selected = false;
15329
15330              that._addClass(selectee.$element, "ui-unselecting");
15331              selectee.unselecting = true;
15332
15333              // selectable UNSELECTING callback
15334              that._trigger("unselecting", event, {
15335                unselecting: selectee.element,
15336              });
15337            }
15338          }
15339        }
15340      });
15341
15342      return false;
15343    },
15344
15345    _mouseStop: function (event) {
15346      var that = this;
15347
15348      this.dragged = false;
15349
15350      $(".ui-unselecting", this.element[0]).each(function () {
15351        var selectee = $.data(this, "selectable-item");
15352        that._removeClass(selectee.$element, "ui-unselecting");
15353        selectee.unselecting = false;
15354        selectee.startselected = false;
15355        that._trigger("unselected", event, {
15356          unselected: selectee.element,
15357        });
15358      });
15359      $(".ui-selecting", this.element[0]).each(function () {
15360        var selectee = $.data(this, "selectable-item");
15361        that
15362          ._removeClass(selectee.$element, "ui-selecting")
15363          ._addClass(selectee.$element, "ui-selected");
15364        selectee.selecting = false;
15365        selectee.selected = true;
15366        selectee.startselected = true;
15367        that._trigger("selected", event, {
15368          selected: selectee.element,
15369        });
15370      });
15371      this._trigger("stop", event);
15372
15373      this.helper.remove();
15374
15375      return false;
15376    },
15377  });
15378
15379  /*!
15380   * jQuery UI Selectmenu 1.13.2
15381   * http://jqueryui.com
15382   *
15383   * Copyright jQuery Foundation and other contributors
15384   * Released under the MIT license.
15385   * http://jquery.org/license
15386   */
15387
15388  //>>label: Selectmenu
15389  //>>group: Widgets
15390  /* eslint-disable max-len */
15391  //>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
15392  /* eslint-enable max-len */
15393  //>>docs: http://api.jqueryui.com/selectmenu/
15394  //>>demos: http://jqueryui.com/selectmenu/
15395  //>>css.structure: ../../themes/base/core.css
15396  //>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css
15397  //>>css.theme: ../../themes/base/theme.css
15398
15399  var widgetsSelectmenu = $.widget("ui.selectmenu", [
15400    $.ui.formResetMixin,
15401    {
15402      version: "1.13.2",
15403      defaultElement: "<select>",
15404      options: {
15405        appendTo: null,
15406        classes: {
15407          "ui-selectmenu-button-open": "ui-corner-top",
15408          "ui-selectmenu-button-closed": "ui-corner-all",
15409        },
15410        disabled: null,
15411        icons: {
15412          button: "ui-icon-triangle-1-s",
15413        },
15414        position: {
15415          my: "left top",
15416          at: "left bottom",
15417          collision: "none",
15418        },
15419        width: false,
15420
15421        // Callbacks
15422        change: null,
15423        close: null,
15424        focus: null,
15425        open: null,
15426        select: null,
15427      },
15428
15429      _create: function () {
15430        var selectmenuId = this.element.uniqueId().attr("id");
15431        this.ids = {
15432          element: selectmenuId,
15433          button: selectmenuId + "-button",
15434          menu: selectmenuId + "-menu",
15435        };
15436
15437        this._drawButton();
15438        this._drawMenu();
15439        this._bindFormResetHandler();
15440
15441        this._rendered = false;
15442        this.menuItems = $();
15443      },
15444
15445      _drawButton: function () {
15446        var icon,
15447          that = this,
15448          item = this._parseOption(
15449            this.element.find("option:selected"),
15450            this.element[0].selectedIndex
15451          );
15452
15453        // Associate existing label with the new button
15454        this.labels = this.element.labels().attr("for", this.ids.button);
15455        this._on(this.labels, {
15456          click: function (event) {
15457            this.button.trigger("focus");
15458            event.preventDefault();
15459          },
15460        });
15461
15462        // Hide original select element
15463        this.element.hide();
15464
15465        // Create button
15466        this.button = $("<span>", {
15467          tabindex: this.options.disabled ? -1 : 0,
15468          id: this.ids.button,
15469          role: "combobox",
15470          "aria-expanded": "false",
15471          "aria-autocomplete": "list",
15472          "aria-owns": this.ids.menu,
15473          "aria-haspopup": "true",
15474          title: this.element.attr("title"),
15475        }).insertAfter(this.element);
15476
15477        this._addClass(
15478          this.button,
15479          "ui-selectmenu-button ui-selectmenu-button-closed",
15480          "ui-button ui-widget"
15481        );
15482
15483        icon = $("<span>").appendTo(this.button);
15484        this._addClass(
15485          icon,
15486          "ui-selectmenu-icon",
15487          "ui-icon " + this.options.icons.button
15488        );
15489        this.buttonItem = this._renderButtonItem(item).appendTo(this.button);
15490
15491        if (this.options.width !== false) {
15492          this._resizeButton();
15493        }
15494
15495        this._on(this.button, this._buttonEvents);
15496        this.button.one("focusin", function () {
15497          // Delay rendering the menu items until the button receives focus.
15498          // The menu may have already been rendered via a programmatic open.
15499          if (!that._rendered) {
15500            that._refreshMenu();
15501          }
15502        });
15503      },
15504
15505      _drawMenu: function () {
15506        var that = this;
15507
15508        // Create menu
15509        this.menu = $("<ul>", {
15510          "aria-hidden": "true",
15511          "aria-labelledby": this.ids.button,
15512          id: this.ids.menu,
15513        });
15514
15515        // Wrap menu
15516        this.menuWrap = $("<div>").append(this.menu);
15517        this._addClass(this.menuWrap, "ui-selectmenu-menu", "ui-front");
15518        this.menuWrap.appendTo(this._appendTo());
15519
15520        // Initialize menu widget
15521        this.menuInstance = this.menu
15522          .menu({
15523            classes: {
15524              "ui-menu": "ui-corner-bottom",
15525            },
15526            role: "listbox",
15527            select: function (event, ui) {
15528              event.preventDefault();
15529
vendor: 7,082 bytes, lines 15530-15783
15530              // Support: IE8
15531              // If the item was selected via a click, the text selection
15532              // will be destroyed in IE
15533              that._setSelection();
15534
15535              that._select(ui.item.data("ui-selectmenu-item"), event);
15536            },
15537            focus: function (event, ui) {
15538              var item = ui.item.data("ui-selectmenu-item");
15539
15540              // Prevent inital focus from firing and check if its a newly focused item
15541              if (that.focusIndex != null && item.index !== that.focusIndex) {
15542                that._trigger("focus", event, { item: item });
15543                if (!that.isOpen) {
15544                  that._select(item, event);
15545                }
15546              }
15547              that.focusIndex = item.index;
15548
15549              that.button.attr(
15550                "aria-activedescendant",
15551                that.menuItems.eq(item.index).attr("id")
15552              );
15553            },
15554          })
15555          .menu("instance");
15556
15557        // Don't close the menu on mouseleave
15558        this.menuInstance._off(this.menu, "mouseleave");
15559
15560        // Cancel the menu's collapseAll on document click
15561        this.menuInstance._closeOnDocumentClick = function () {
15562          return false;
15563        };
15564
15565        // Selects often contain empty items, but never contain dividers
15566        this.menuInstance._isDivider = function () {
15567          return false;
15568        };
15569      },
15570
15571      refresh: function () {
15572        this._refreshMenu();
15573        this.buttonItem.replaceWith(
15574          (this.buttonItem = this._renderButtonItem(
15575            // Fall back to an empty object in case there are no options
15576            this._getSelectedItem().data("ui-selectmenu-item") || {}
15577          ))
15578        );
15579        if (this.options.width === null) {
15580          this._resizeButton();
15581        }
15582      },
15583
15584      _refreshMenu: function () {
15585        var item,
15586          options = this.element.find("option");
15587
15588        this.menu.empty();
15589
15590        this._parseOptions(options);
15591        this._renderMenu(this.menu, this.items);
15592
15593        this.menuInstance.refresh();
15594        this.menuItems = this.menu
15595          .find("li")
15596          .not(".ui-selectmenu-optgroup")
15597          .find(".ui-menu-item-wrapper");
15598
15599        this._rendered = true;
15600
15601        if (!options.length) {
15602          return;
15603        }
15604
15605        item = this._getSelectedItem();
15606
15607        // Update the menu to have the correct item focused
15608        this.menuInstance.focus(null, item);
15609        this._setAria(item.data("ui-selectmenu-item"));
15610
15611        // Set disabled state
15612        this._setOption("disabled", this.element.prop("disabled"));
15613      },
15614
15615      open: function (event) {
15616        if (this.options.disabled) {
15617          return;
15618        }
15619
15620        // If this is the first time the menu is being opened, render the items
15621        if (!this._rendered) {
15622          this._refreshMenu();
15623        } else {
15624          // Menu clears focus on close, reset focus to selected item
15625          this._removeClass(
15626            this.menu.find(".ui-state-active"),
15627            null,
15628            "ui-state-active"
15629          );
15630          this.menuInstance.focus(null, this._getSelectedItem());
15631        }
15632
15633        // If there are no options, don't open the menu
15634        if (!this.menuItems.length) {
15635          return;
15636        }
15637
15638        this.isOpen = true;
15639        this._toggleAttr();
15640        this._resizeMenu();
15641        this._position();
15642
15643        this._on(this.document, this._documentClick);
15644
15645        this._trigger("open", event);
15646      },
15647
15648      _position: function () {
15649        this.menuWrap.position(
15650          $.extend({ of: this.button }, this.options.position)
15651        );
15652      },
15653
15654      close: function (event) {
15655        if (!this.isOpen) {
15656          return;
15657        }
15658
15659        this.isOpen = false;
15660        this._toggleAttr();
15661
15662        this.range = null;
15663        this._off(this.document);
15664
15665        this._trigger("close", event);
15666      },
15667
15668      widget: function () {
15669        return this.button;
15670      },
15671
15672      menuWidget: function () {
15673        return this.menu;
15674      },
15675
15676      _renderButtonItem: function (item) {
15677        var buttonItem = $("<span>");
15678
15679        this._setText(buttonItem, item.label);
15680        this._addClass(buttonItem, "ui-selectmenu-text");
15681
15682        return buttonItem;
15683      },
15684
15685      _renderMenu: function (ul, items) {
15686        var that = this,
15687          currentOptgroup = "";
15688
15689        $.each(items, function (index, item) {
15690          var li;
15691
15692          if (item.optgroup !== currentOptgroup) {
15693            li = $("<li>", {
15694              text: item.optgroup,
15695            });
15696            that._addClass(
15697              li,
15698              "ui-selectmenu-optgroup",
15699              "ui-menu-divider" +
15700                (item.element.parent("optgroup").prop("disabled")
15701                  ? " ui-state-disabled"
15702                  : "")
15703            );
15704
15705            li.appendTo(ul);
15706
15707            currentOptgroup = item.optgroup;
15708          }
15709
15710          that._renderItemData(ul, item);
15711        });
15712      },
15713
15714      _renderItemData: function (ul, item) {
15715        return this._renderItem(ul, item).data("ui-selectmenu-item", item);
15716      },
15717
15718      _renderItem: function (ul, item) {
15719        var li = $("<li>"),
15720          wrapper = $("<div>", {
15721            title: item.element.attr("title"),
15722          });
15723
15724        if (item.disabled) {
15725          this._addClass(li, null, "ui-state-disabled");
15726        }
15727        this._setText(wrapper, item.label);
15728
15729        return li.append(wrapper).appendTo(ul);
15730      },
15731
15732      _setText: function (element, value) {
15733        if (value) {
15734          element.text(value);
15735        } else {
15736          element.html("&#160;");
15737        }
15738      },
15739
15740      _move: function (direction, event) {
15741        var item,
15742          next,
15743          filter = ".ui-menu-item";
15744
15745        if (this.isOpen) {
15746          item = this.menuItems.eq(this.focusIndex).parent("li");
15747        } else {
15748          item = this.menuItems.eq(this.element[0].selectedIndex).parent("li");
15749          filter += ":not(.ui-state-disabled)";
15750        }
15751
15752        if (direction === "first" || direction === "last") {
15753          next =
15754            item[direction === "first" ? "prevAll" : "nextAll"](filter).eq(-1);
15755        } else {
15756          next = item[direction + "All"](filter).eq(0);
15757        }
15758
15759        if (next.length) {
15760          this.menuInstance.focus(event, next);
15761        }
15762      },
15763
15764      _getSelectedItem: function () {
15765        return this.menuItems.eq(this.element[0].selectedIndex).parent("li");
15766      },
15767
15768      _toggle: function (event) {
15769        this[this.isOpen ? "close" : "open"](event);
15770      },
15771
15772      _setSelection: function () {
15773        var selection;
15774
15775        if (!this.range) {
15776          return;
15777        }
15778
15779        if (window.getSelection) {
15780          selection = window.getSelection();
15781          selection.removeAllRanges();
15782          selection.addRange(this.range);
15783
vendor: 11,770 bytes, lines 15784-16196
15784          // Support: IE8
15785        } else {
15786          this.range.select();
15787        }
15788
15789        // Support: IE
15790        // Setting the text selection kills the button focus in IE, but
15791        // restoring the focus doesn't kill the selection.
15792        this.button.trigger("focus");
15793      },
15794
15795      _documentClick: {
15796        mousedown: function (event) {
15797          if (!this.isOpen) {
15798            return;
15799          }
15800
15801          if (
15802            !$(event.target).closest(
15803              ".ui-selectmenu-menu, #" + $.escapeSelector(this.ids.button)
15804            ).length
15805          ) {
15806            this.close(event);
15807          }
15808        },
15809      },
15810
15811      _buttonEvents: {
15812        // Prevent text selection from being reset when interacting with the selectmenu (#10144)
15813        mousedown: function () {
15814          var selection;
15815
15816          if (window.getSelection) {
15817            selection = window.getSelection();
15818            if (selection.rangeCount) {
15819              this.range = selection.getRangeAt(0);
15820            }
15821
15822            // Support: IE8
15823          } else {
15824            this.range = document.selection.createRange();
15825          }
15826        },
15827
15828        click: function (event) {
15829          this._setSelection();
15830          this._toggle(event);
15831        },
15832
15833        keydown: function (event) {
15834          var preventDefault = true;
15835          switch (event.keyCode) {
15836            case $.ui.keyCode.TAB:
15837            case $.ui.keyCode.ESCAPE:
15838              this.close(event);
15839              preventDefault = false;
15840              break;
15841            case $.ui.keyCode.ENTER:
15842              if (this.isOpen) {
15843                this._selectFocusedItem(event);
15844              }
15845              break;
15846            case $.ui.keyCode.UP:
15847              if (event.altKey) {
15848                this._toggle(event);
15849              } else {
15850                this._move("prev", event);
15851              }
15852              break;
15853            case $.ui.keyCode.DOWN:
15854              if (event.altKey) {
15855                this._toggle(event);
15856              } else {
15857                this._move("next", event);
15858              }
15859              break;
15860            case $.ui.keyCode.SPACE:
15861              if (this.isOpen) {
15862                this._selectFocusedItem(event);
15863              } else {
15864                this._toggle(event);
15865              }
15866              break;
15867            case $.ui.keyCode.LEFT:
15868              this._move("prev", event);
15869              break;
15870            case $.ui.keyCode.RIGHT:
15871              this._move("next", event);
15872              break;
15873            case $.ui.keyCode.HOME:
15874            case $.ui.keyCode.PAGE_UP:
15875              this._move("first", event);
15876              break;
15877            case $.ui.keyCode.END:
15878            case $.ui.keyCode.PAGE_DOWN:
15879              this._move("last", event);
15880              break;
15881            default:
15882              this.menu.trigger(event);
15883              preventDefault = false;
15884          }
15885
15886          if (preventDefault) {
15887            event.preventDefault();
15888          }
15889        },
15890      },
15891
15892      _selectFocusedItem: function (event) {
15893        var item = this.menuItems.eq(this.focusIndex).parent("li");
15894        if (!item.hasClass("ui-state-disabled")) {
15895          this._select(item.data("ui-selectmenu-item"), event);
15896        }
15897      },
15898
15899      _select: function (item, event) {
15900        var oldIndex = this.element[0].selectedIndex;
15901
15902        // Change native select element
15903        this.element[0].selectedIndex = item.index;
15904        this.buttonItem.replaceWith(
15905          (this.buttonItem = this._renderButtonItem(item))
15906        );
15907        this._setAria(item);
15908        this._trigger("select", event, { item: item });
15909
15910        if (item.index !== oldIndex) {
15911          this._trigger("change", event, { item: item });
15912        }
15913
15914        this.close(event);
15915      },
15916
15917      _setAria: function (item) {
15918        var id = this.menuItems.eq(item.index).attr("id");
15919
15920        this.button.attr({
15921          "aria-labelledby": id,
15922          "aria-activedescendant": id,
15923        });
15924        this.menu.attr("aria-activedescendant", id);
15925      },
15926
15927      _setOption: function (key, value) {
15928        if (key === "icons") {
15929          var icon = this.button.find("span.ui-icon");
15930          this._removeClass(icon, null, this.options.icons.button)._addClass(
15931            icon,
15932            null,
15933            value.button
15934          );
15935        }
15936
15937        this._super(key, value);
15938
15939        if (key === "appendTo") {
15940          this.menuWrap.appendTo(this._appendTo());
15941        }
15942
15943        if (key === "width") {
15944          this._resizeButton();
15945        }
15946      },
15947
15948      _setOptionDisabled: function (value) {
15949        this._super(value);
15950
15951        this.menuInstance.option("disabled", value);
15952        this.button.attr("aria-disabled", value);
15953        this._toggleClass(this.button, null, "ui-state-disabled", value);
15954
15955        this.element.prop("disabled", value);
15956        if (value) {
15957          this.button.attr("tabindex", -1);
15958          this.close();
15959        } else {
15960          this.button.attr("tabindex", 0);
15961        }
15962      },
15963
15964      _appendTo: function () {
15965        var element = this.options.appendTo;
15966
15967        if (element) {
15968          element =
15969            element.jquery || element.nodeType
15970              ? $(element)
15971              : this.document.find(element).eq(0);
15972        }
15973
15974        if (!element || !element[0]) {
15975          element = this.element.closest(".ui-front, dialog");
15976        }
15977
15978        if (!element.length) {
15979          element = this.document[0].body;
15980        }
15981
15982        return element;
15983      },
15984
15985      _toggleAttr: function () {
15986        this.button.attr("aria-expanded", this.isOpen);
15987
15988        // We can't use two _toggleClass() calls here, because we need to make sure
15989        // we always remove classes first and add them second, otherwise if both classes have the
15990        // same theme class, it will be removed after we add it.
15991        this._removeClass(
15992          this.button,
15993          "ui-selectmenu-button-" + (this.isOpen ? "closed" : "open")
15994        )
15995          ._addClass(
15996            this.button,
15997            "ui-selectmenu-button-" + (this.isOpen ? "open" : "closed")
15998          )
15999          ._toggleClass(this.menuWrap, "ui-selectmenu-open", null, this.isOpen);
16000
16001        this.menu.attr("aria-hidden", !this.isOpen);
16002      },
16003
16004      _resizeButton: function () {
16005        var width = this.options.width;
16006
16007        // For `width: false`, just remove inline style and stop
16008        if (width === false) {
16009          this.button.css("width", "");
16010          return;
16011        }
16012
16013        // For `width: null`, match the width of the original element
16014        if (width === null) {
16015          width = this.element.show().outerWidth();
16016          this.element.hide();
16017        }
16018
16019        this.button.outerWidth(width);
16020      },
16021
16022      _resizeMenu: function () {
16023        this.menu.outerWidth(
16024          Math.max(
16025            this.button.outerWidth(),
16026
16027            // Support: IE10
16028            // IE10 wraps long text (possibly a rounding bug)
16029            // so we add 1px to avoid the wrapping
16030            this.menu.width("").outerWidth() + 1
16031          )
16032        );
16033      },
16034
16035      _getCreateOptions: function () {
16036        var options = this._super();
16037
16038        options.disabled = this.element.prop("disabled");
16039
16040        return options;
16041      },
16042
16043      _parseOptions: function (options) {
16044        var that = this,
16045          data = [];
16046        options.each(function (index, item) {
16047          if (item.hidden) {
16048            return;
16049          }
16050
16051          data.push(that._parseOption($(item), index));
16052        });
16053        this.items = data;
16054      },
16055
16056      _parseOption: function (option, index) {
16057        var optgroup = option.parent("optgroup");
16058
16059        return {
16060          element: option,
16061          index: index,
16062          value: option.val(),
16063          label: option.text(),
16064          optgroup: optgroup.attr("label") || "",
16065          disabled: optgroup.prop("disabled") || option.prop("disabled"),
16066        };
16067      },
16068
16069      _destroy: function () {
16070        this._unbindFormResetHandler();
16071        this.menuWrap.remove();
16072        this.button.remove();
16073        this.element.show();
16074        this.element.removeUniqueId();
16075        this.labels.attr("for", this.ids.element);
16076      },
16077    },
16078  ]);
16079
16080  /*!
16081   * jQuery UI Slider 1.13.2
16082   * http://jqueryui.com
16083   *
16084   * Copyright jQuery Foundation and other contributors
16085   * Released under the MIT license.
16086   * http://jquery.org/license
16087   */
16088
16089  //>>label: Slider
16090  //>>group: Widgets
16091  //>>description: Displays a flexible slider with ranges and accessibility via keyboard.
16092  //>>docs: http://api.jqueryui.com/slider/
16093  //>>demos: http://jqueryui.com/slider/
16094  //>>css.structure: ../../themes/base/core.css
16095  //>>css.structure: ../../themes/base/slider.css
16096  //>>css.theme: ../../themes/base/theme.css
16097
16098  var widgetsSlider = $.widget("ui.slider", $.ui.mouse, {
16099    version: "1.13.2",
16100    widgetEventPrefix: "slide",
16101
16102    options: {
16103      animate: false,
16104      classes: {
16105        "ui-slider": "ui-corner-all",
16106        "ui-slider-handle": "ui-corner-all",
16107
16108        // Note: ui-widget-header isn't the most fittingly semantic framework class for this
16109        // element, but worked best visually with a variety of themes
16110        "ui-slider-range": "ui-corner-all ui-widget-header",
16111      },
16112      distance: 0,
16113      max: 100,
16114      min: 0,
16115      orientation: "horizontal",
16116      range: false,
16117      step: 1,
16118      value: 0,
16119      values: null,
16120
16121      // Callbacks
16122      change: null,
16123      slide: null,
16124      start: null,
16125      stop: null,
16126    },
16127
16128    // Number of pages in a slider
16129    // (how many times can you page up/down to go through the whole range)
16130    numPages: 5,
16131
16132    _create: function () {
16133      this._keySliding = false;
16134      this._mouseSliding = false;
16135      this._animateOff = true;
16136      this._handleIndex = null;
16137      this._detectOrientation();
16138      this._mouseInit();
16139      this._calculateNewMax();
16140
16141      this._addClass(
16142        "ui-slider ui-slider-" + this.orientation,
16143        "ui-widget ui-widget-content"
16144      );
16145
16146      this._refresh();
16147
16148      this._animateOff = false;
16149    },
16150
16151    _refresh: function () {
16152      this._createRange();
16153      this._createHandles();
16154      this._setupEvents();
16155      this._refreshValue();
16156    },
16157
16158    _createHandles: function () {
16159      var i,
16160        handleCount,
16161        options = this.options,
16162        existingHandles = this.element.find(".ui-slider-handle"),
16163        handle = "<span tabindex='0'></span>",
16164        handles = [];
16165
16166      handleCount = (options.values && options.values.length) || 1;
16167
16168      if (existingHandles.length > handleCount) {
16169        existingHandles.slice(handleCount).remove();
16170        existingHandles = existingHandles.slice(0, handleCount);
16171      }
16172
16173      for (i = existingHandles.length; i < handleCount; i++) {
16174        handles.push(handle);
16175      }
16176
16177      this.handles = existingHandles.add(
16178        $(handles.join("")).appendTo(this.element)
16179      );
16180
16181      this._addClass(this.handles, "ui-slider-handle", "ui-state-default");
16182
16183      this.handle = this.handles.eq(0);
16184
16185      this.handles.each(function (i) {
16186        $(this).data("ui-slider-handle-index", i).attr("tabIndex", 0);
16187      });
16188    },
16189
16190    _createRange: function () {
16191      var options = this.options;
16192
16193      if (options.range) {
16194        if (options.range === true) {
16195          if (!options.values) {
16196            options.values = [this._valueMin(), this._valueMin()];
vendor: 20,160 bytes, lines 16197-16876
16197          } else if (options.values.length && options.values.length !== 2) {
16198            options.values = [options.values[0], options.values[0]];
16199          } else if (Array.isArray(options.values)) {
16200            options.values = options.values.slice(0);
16201          }
16202        }
16203
16204        if (!this.range || !this.range.length) {
16205          this.range = $("<div>").appendTo(this.element);
16206
16207          this._addClass(this.range, "ui-slider-range");
16208        } else {
16209          this._removeClass(
16210            this.range,
16211            "ui-slider-range-min ui-slider-range-max"
16212          );
16213
16214          // Handle range switching from true to min/max
16215          this.range.css({
16216            left: "",
16217            bottom: "",
16218          });
16219        }
16220        if (options.range === "min" || options.range === "max") {
16221          this._addClass(this.range, "ui-slider-range-" + options.range);
16222        }
16223      } else {
16224        if (this.range) {
16225          this.range.remove();
16226        }
16227        this.range = null;
16228      }
16229    },
16230
16231    _setupEvents: function () {
16232      this._off(this.handles);
16233      this._on(this.handles, this._handleEvents);
16234      this._hoverable(this.handles);
16235      this._focusable(this.handles);
16236    },
16237
16238    _destroy: function () {
16239      this.handles.remove();
16240      if (this.range) {
16241        this.range.remove();
16242      }
16243
16244      this._mouseDestroy();
16245    },
16246
16247    _mouseCapture: function (event) {
16248      var position,
16249        normValue,
16250        distance,
16251        closestHandle,
16252        index,
16253        allowed,
16254        offset,
16255        mouseOverHandle,
16256        that = this,
16257        o = this.options;
16258
16259      if (o.disabled) {
16260        return false;
16261      }
16262
16263      this.elementSize = {
16264        width: this.element.outerWidth(),
16265        height: this.element.outerHeight(),
16266      };
16267      this.elementOffset = this.element.offset();
16268
16269      position = { x: event.pageX, y: event.pageY };
16270      normValue = this._normValueFromMouse(position);
16271      distance = this._valueMax() - this._valueMin() + 1;
16272      this.handles.each(function (i) {
16273        var thisDistance = Math.abs(normValue - that.values(i));
16274        if (
16275          distance > thisDistance ||
16276          (distance === thisDistance &&
16277            (i === that._lastChangedValue || that.values(i) === o.min))
16278        ) {
16279          distance = thisDistance;
16280          closestHandle = $(this);
16281          index = i;
16282        }
16283      });
16284
16285      allowed = this._start(event, index);
16286      if (allowed === false) {
16287        return false;
16288      }
16289      this._mouseSliding = true;
16290
16291      this._handleIndex = index;
16292
16293      this._addClass(closestHandle, null, "ui-state-active");
16294      closestHandle.trigger("focus");
16295
16296      offset = closestHandle.offset();
16297      mouseOverHandle = !$(event.target)
16298        .parents()
16299        .addBack()
16300        .is(".ui-slider-handle");
16301      this._clickOffset = mouseOverHandle
16302        ? { left: 0, top: 0 }
16303        : {
16304            left: event.pageX - offset.left - closestHandle.width() / 2,
16305            top:
16306              event.pageY -
16307              offset.top -
16308              closestHandle.height() / 2 -
16309              (parseInt(closestHandle.css("borderTopWidth"), 10) || 0) -
16310              (parseInt(closestHandle.css("borderBottomWidth"), 10) || 0) +
16311              (parseInt(closestHandle.css("marginTop"), 10) || 0),
16312          };
16313
16314      if (!this.handles.hasClass("ui-state-hover")) {
16315        this._slide(event, index, normValue);
16316      }
16317      this._animateOff = true;
16318      return true;
16319    },
16320
16321    _mouseStart: function () {
16322      return true;
16323    },
16324
16325    _mouseDrag: function (event) {
16326      var position = { x: event.pageX, y: event.pageY },
16327        normValue = this._normValueFromMouse(position);
16328
16329      this._slide(event, this._handleIndex, normValue);
16330
16331      return false;
16332    },
16333
16334    _mouseStop: function (event) {
16335      this._removeClass(this.handles, null, "ui-state-active");
16336      this._mouseSliding = false;
16337
16338      this._stop(event, this._handleIndex);
16339      this._change(event, this._handleIndex);
16340
16341      this._handleIndex = null;
16342      this._clickOffset = null;
16343      this._animateOff = false;
16344
16345      return false;
16346    },
16347
16348    _detectOrientation: function () {
16349      this.orientation =
16350        this.options.orientation === "vertical" ? "vertical" : "horizontal";
16351    },
16352
16353    _normValueFromMouse: function (position) {
16354      var pixelTotal, pixelMouse, percentMouse, valueTotal, valueMouse;
16355
16356      if (this.orientation === "horizontal") {
16357        pixelTotal = this.elementSize.width;
16358        pixelMouse =
16359          position.x -
16360          this.elementOffset.left -
16361          (this._clickOffset ? this._clickOffset.left : 0);
16362      } else {
16363        pixelTotal = this.elementSize.height;
16364        pixelMouse =
16365          position.y -
16366          this.elementOffset.top -
16367          (this._clickOffset ? this._clickOffset.top : 0);
16368      }
16369
16370      percentMouse = pixelMouse / pixelTotal;
16371      if (percentMouse > 1) {
16372        percentMouse = 1;
16373      }
16374      if (percentMouse < 0) {
16375        percentMouse = 0;
16376      }
16377      if (this.orientation === "vertical") {
16378        percentMouse = 1 - percentMouse;
16379      }
16380
16381      valueTotal = this._valueMax() - this._valueMin();
16382      valueMouse = this._valueMin() + percentMouse * valueTotal;
16383
16384      return this._trimAlignValue(valueMouse);
16385    },
16386
16387    _uiHash: function (index, value, values) {
16388      var uiHash = {
16389        handle: this.handles[index],
16390        handleIndex: index,
16391        value: value !== undefined ? value : this.value(),
16392      };
16393
16394      if (this._hasMultipleValues()) {
16395        uiHash.value = value !== undefined ? value : this.values(index);
16396        uiHash.values = values || this.values();
16397      }
16398
16399      return uiHash;
16400    },
16401
16402    _hasMultipleValues: function () {
16403      return this.options.values && this.options.values.length;
16404    },
16405
16406    _start: function (event, index) {
16407      return this._trigger("start", event, this._uiHash(index));
16408    },
16409
16410    _slide: function (event, index, newVal) {
16411      var allowed,
16412        otherVal,
16413        currentValue = this.value(),
16414        newValues = this.values();
16415
16416      if (this._hasMultipleValues()) {
16417        otherVal = this.values(index ? 0 : 1);
16418        currentValue = this.values(index);
16419
16420        if (this.options.values.length === 2 && this.options.range === true) {
16421          newVal =
16422            index === 0
16423              ? Math.min(otherVal, newVal)
16424              : Math.max(otherVal, newVal);
16425        }
16426
16427        newValues[index] = newVal;
16428      }
16429
16430      if (newVal === currentValue) {
16431        return;
16432      }
16433
16434      allowed = this._trigger(
16435        "slide",
16436        event,
16437        this._uiHash(index, newVal, newValues)
16438      );
16439
16440      // A slide can be canceled by returning false from the slide callback
16441      if (allowed === false) {
16442        return;
16443      }
16444
16445      if (this._hasMultipleValues()) {
16446        this.values(index, newVal);
16447      } else {
16448        this.value(newVal);
16449      }
16450    },
16451
16452    _stop: function (event, index) {
16453      this._trigger("stop", event, this._uiHash(index));
16454    },
16455
16456    _change: function (event, index) {
16457      if (!this._keySliding && !this._mouseSliding) {
16458        //store the last changed value index for reference when handles overlap
16459        this._lastChangedValue = index;
16460        this._trigger("change", event, this._uiHash(index));
16461      }
16462    },
16463
16464    value: function (newValue) {
16465      if (arguments.length) {
16466        this.options.value = this._trimAlignValue(newValue);
16467        this._refreshValue();
16468        this._change(null, 0);
16469        return;
16470      }
16471
16472      return this._value();
16473    },
16474
16475    values: function (index, newValue) {
16476      var vals, newValues, i;
16477
16478      if (arguments.length > 1) {
16479        this.options.values[index] = this._trimAlignValue(newValue);
16480        this._refreshValue();
16481        this._change(null, index);
16482        return;
16483      }
16484
16485      if (arguments.length) {
16486        if (Array.isArray(arguments[0])) {
16487          vals = this.options.values;
16488          newValues = arguments[0];
16489          for (i = 0; i < vals.length; i += 1) {
16490            vals[i] = this._trimAlignValue(newValues[i]);
16491            this._change(null, i);
16492          }
16493          this._refreshValue();
16494        } else {
16495          if (this._hasMultipleValues()) {
16496            return this._values(index);
16497          } else {
16498            return this.value();
16499          }
16500        }
16501      } else {
16502        return this._values();
16503      }
16504    },
16505
16506    _setOption: function (key, value) {
16507      var i,
16508        valsLength = 0;
16509
16510      if (key === "range" && this.options.range === true) {
16511        if (value === "min") {
16512          this.options.value = this._values(0);
16513          this.options.values = null;
16514        } else if (value === "max") {
16515          this.options.value = this._values(this.options.values.length - 1);
16516          this.options.values = null;
16517        }
16518      }
16519
16520      if (Array.isArray(this.options.values)) {
16521        valsLength = this.options.values.length;
16522      }
16523
16524      this._super(key, value);
16525
16526      switch (key) {
16527        case "orientation":
16528          this._detectOrientation();
16529          this._removeClass(
16530            "ui-slider-horizontal ui-slider-vertical"
16531          )._addClass("ui-slider-" + this.orientation);
16532          this._refreshValue();
16533          if (this.options.range) {
16534            this._refreshRange(value);
16535          }
16536
16537          // Reset positioning from previous orientation
16538          this.handles.css(value === "horizontal" ? "bottom" : "left", "");
16539          break;
16540        case "value":
16541          this._animateOff = true;
16542          this._refreshValue();
16543          this._change(null, 0);
16544          this._animateOff = false;
16545          break;
16546        case "values":
16547          this._animateOff = true;
16548          this._refreshValue();
16549
16550          // Start from the last handle to prevent unreachable handles (#9046)
16551          for (i = valsLength - 1; i >= 0; i--) {
16552            this._change(null, i);
16553          }
16554          this._animateOff = false;
16555          break;
16556        case "step":
16557        case "min":
16558        case "max":
16559          this._animateOff = true;
16560          this._calculateNewMax();
16561          this._refreshValue();
16562          this._animateOff = false;
16563          break;
16564        case "range":
16565          this._animateOff = true;
16566          this._refresh();
16567          this._animateOff = false;
16568          break;
16569      }
16570    },
16571
16572    _setOptionDisabled: function (value) {
16573      this._super(value);
16574
16575      this._toggleClass(null, "ui-state-disabled", !!value);
16576    },
16577
16578    //internal value getter
16579    // _value() returns value trimmed by min and max, aligned by step
16580    _value: function () {
16581      var val = this.options.value;
16582      val = this._trimAlignValue(val);
16583
16584      return val;
16585    },
16586
16587    //internal values getter
16588    // _values() returns array of values trimmed by min and max, aligned by step
16589    // _values( index ) returns single value trimmed by min and max, aligned by step
16590    _values: function (index) {
16591      var val, vals, i;
16592
16593      if (arguments.length) {
16594        val = this.options.values[index];
16595        val = this._trimAlignValue(val);
16596
16597        return val;
16598      } else if (this._hasMultipleValues()) {
16599        // .slice() creates a copy of the array
16600        // this copy gets trimmed by min and max and then returned
16601        vals = this.options.values.slice();
16602        for (i = 0; i < vals.length; i += 1) {
16603          vals[i] = this._trimAlignValue(vals[i]);
16604        }
16605
16606        return vals;
16607      } else {
16608        return [];
16609      }
16610    },
16611
16612    // Returns the step-aligned value that val is closest to, between (inclusive) min and max
16613    _trimAlignValue: function (val) {
16614      if (val <= this._valueMin()) {
16615        return this._valueMin();
16616      }
16617      if (val >= this._valueMax()) {
16618        return this._valueMax();
16619      }
16620      var step = this.options.step > 0 ? this.options.step : 1,
16621        valModStep = (val - this._valueMin()) % step,
16622        alignValue = val - valModStep;
16623
16624      if (Math.abs(valModStep) * 2 >= step) {
16625        alignValue += valModStep > 0 ? step : -step;
16626      }
16627
16628      // Since JavaScript has problems with large floats, round
16629      // the final value to 5 digits after the decimal point (see #4124)
16630      return parseFloat(alignValue.toFixed(5));
16631    },
16632
16633    _calculateNewMax: function () {
16634      var max = this.options.max,
16635        min = this._valueMin(),
16636        step = this.options.step,
16637        aboveMin = Math.round((max - min) / step) * step;
16638      max = aboveMin + min;
16639      if (max > this.options.max) {
16640        //If max is not divisible by step, rounding off may increase its value
16641        max -= step;
16642      }
16643      this.max = parseFloat(max.toFixed(this._precision()));
16644    },
16645
16646    _precision: function () {
16647      var precision = this._precisionOf(this.options.step);
16648      if (this.options.min !== null) {
16649        precision = Math.max(precision, this._precisionOf(this.options.min));
16650      }
16651      return precision;
16652    },
16653
16654    _precisionOf: function (num) {
16655      var str = num.toString(),
16656        decimal = str.indexOf(".");
16657      return decimal === -1 ? 0 : str.length - decimal - 1;
16658    },
16659
16660    _valueMin: function () {
16661      return this.options.min;
16662    },
16663
16664    _valueMax: function () {
16665      return this.max;
16666    },
16667
16668    _refreshRange: function (orientation) {
16669      if (orientation === "vertical") {
16670        this.range.css({ width: "", left: "" });
16671      }
16672      if (orientation === "horizontal") {
16673        this.range.css({ height: "", bottom: "" });
16674      }
16675    },
16676
16677    _refreshValue: function () {
16678      var lastValPercent,
16679        valPercent,
16680        value,
16681        valueMin,
16682        valueMax,
16683        oRange = this.options.range,
16684        o = this.options,
16685        that = this,
16686        animate = !this._animateOff ? o.animate : false,
16687        _set = {};
16688
16689      if (this._hasMultipleValues()) {
16690        this.handles.each(function (i) {
16691          valPercent =
16692            ((that.values(i) - that._valueMin()) /
16693              (that._valueMax() - that._valueMin())) *
16694            100;
16695          _set[that.orientation === "horizontal" ? "left" : "bottom"] =
16696            valPercent + "%";
16697          $(this).stop(1, 1)[animate ? "animate" : "css"](_set, o.animate);
16698          if (that.options.range === true) {
16699            if (that.orientation === "horizontal") {
16700              if (i === 0) {
16701                that.range.stop(1, 1)[animate ? "animate" : "css"](
16702                  {
16703                    left: valPercent + "%",
16704                  },
16705                  o.animate
16706                );
16707              }
16708              if (i === 1) {
16709                that.range[animate ? "animate" : "css"](
16710                  {
16711                    width: valPercent - lastValPercent + "%",
16712                  },
16713                  {
16714                    queue: false,
16715                    duration: o.animate,
16716                  }
16717                );
16718              }
16719            } else {
16720              if (i === 0) {
16721                that.range.stop(1, 1)[animate ? "animate" : "css"](
16722                  {
16723                    bottom: valPercent + "%",
16724                  },
16725                  o.animate
16726                );
16727              }
16728              if (i === 1) {
16729                that.range[animate ? "animate" : "css"](
16730                  {
16731                    height: valPercent - lastValPercent + "%",
16732                  },
16733                  {
16734                    queue: false,
16735                    duration: o.animate,
16736                  }
16737                );
16738              }
16739            }
16740          }
16741          lastValPercent = valPercent;
16742        });
16743      } else {
16744        value = this.value();
16745        valueMin = this._valueMin();
16746        valueMax = this._valueMax();
16747        valPercent =
16748          valueMax !== valueMin
16749            ? ((value - valueMin) / (valueMax - valueMin)) * 100
16750            : 0;
16751        _set[this.orientation === "horizontal" ? "left" : "bottom"] =
16752          valPercent + "%";
16753        this.handle.stop(1, 1)[animate ? "animate" : "css"](_set, o.animate);
16754
16755        if (oRange === "min" && this.orientation === "horizontal") {
16756          this.range.stop(1, 1)[animate ? "animate" : "css"](
16757            {
16758              width: valPercent + "%",
16759            },
16760            o.animate
16761          );
16762        }
16763        if (oRange === "max" && this.orientation === "horizontal") {
16764          this.range.stop(1, 1)[animate ? "animate" : "css"](
16765            {
16766              width: 100 - valPercent + "%",
16767            },
16768            o.animate
16769          );
16770        }
16771        if (oRange === "min" && this.orientation === "vertical") {
16772          this.range.stop(1, 1)[animate ? "animate" : "css"](
16773            {
16774              height: valPercent + "%",
16775            },
16776            o.animate
16777          );
16778        }
16779        if (oRange === "max" && this.orientation === "vertical") {
16780          this.range.stop(1, 1)[animate ? "animate" : "css"](
16781            {
16782              height: 100 - valPercent + "%",
16783            },
16784            o.animate
16785          );
16786        }
16787      }
16788    },
16789
16790    _handleEvents: {
16791      keydown: function (event) {
16792        var allowed,
16793          curVal,
16794          newVal,
16795          step,
16796          index = $(event.target).data("ui-slider-handle-index");
16797
16798        switch (event.keyCode) {
16799          case $.ui.keyCode.HOME:
16800          case $.ui.keyCode.END:
16801          case $.ui.keyCode.PAGE_UP:
16802          case $.ui.keyCode.PAGE_DOWN:
16803          case $.ui.keyCode.UP:
16804          case $.ui.keyCode.RIGHT:
16805          case $.ui.keyCode.DOWN:
16806          case $.ui.keyCode.LEFT:
16807            event.preventDefault();
16808            if (!this._keySliding) {
16809              this._keySliding = true;
16810              this._addClass($(event.target), null, "ui-state-active");
16811              allowed = this._start(event, index);
16812              if (allowed === false) {
16813                return;
16814              }
16815            }
16816            break;
16817        }
16818
16819        step = this.options.step;
16820        if (this._hasMultipleValues()) {
16821          curVal = newVal = this.values(index);
16822        } else {
16823          curVal = newVal = this.value();
16824        }
16825
16826        switch (event.keyCode) {
16827          case $.ui.keyCode.HOME:
16828            newVal = this._valueMin();
16829            break;
16830          case $.ui.keyCode.END:
16831            newVal = this._valueMax();
16832            break;
16833          case $.ui.keyCode.PAGE_UP:
16834            newVal = this._trimAlignValue(
16835              curVal + (this._valueMax() - this._valueMin()) / this.numPages
16836            );
16837            break;
16838          case $.ui.keyCode.PAGE_DOWN:
16839            newVal = this._trimAlignValue(
16840              curVal - (this._valueMax() - this._valueMin()) / this.numPages
16841            );
16842            break;
16843          case $.ui.keyCode.UP:
16844          case $.ui.keyCode.RIGHT:
16845            if (curVal === this._valueMax()) {
16846              return;
16847            }
16848            newVal = this._trimAlignValue(curVal + step);
16849            break;
16850          case $.ui.keyCode.DOWN:
16851          case $.ui.keyCode.LEFT:
16852            if (curVal === this._valueMin()) {
16853              return;
16854            }
16855            newVal = this._trimAlignValue(curVal - step);
16856            break;
16857        }
16858
16859        this._slide(event, index, newVal);
16860      },
16861      keyup: function (event) {
16862        var index = $(event.target).data("ui-slider-handle-index");
16863
16864        if (this._keySliding) {
16865          this._keySliding = false;
16866          this._stop(event, index);
16867          this._change(event, index);
16868          this._removeClass($(event.target), null, "ui-state-active");
16869        }
16870      },
16871    },
16872  });
16873
16874  /*!
16875   * jQuery UI Sortable 1.13.2
16876   * http://jqueryui.com
vendor: 4,272 bytes, lines 16877-17044
16877   *
16878   * Copyright jQuery Foundation and other contributors
16879   * Released under the MIT license.
16880   * http://jquery.org/license
16881   */
16882
16883  //>>label: Sortable
16884  //>>group: Interactions
16885  //>>description: Enables items in a list to be sorted using the mouse.
16886  //>>docs: http://api.jqueryui.com/sortable/
16887  //>>demos: http://jqueryui.com/sortable/
16888  //>>css.structure: ../../themes/base/sortable.css
16889
16890  var widgetsSortable = $.widget("ui.sortable", $.ui.mouse, {
16891    version: "1.13.2",
16892    widgetEventPrefix: "sort",
16893    ready: false,
16894    options: {
16895      appendTo: "parent",
16896      axis: false,
16897      connectWith: false,
16898      containment: false,
16899      cursor: "auto",
16900      cursorAt: false,
16901      dropOnEmpty: true,
16902      forcePlaceholderSize: false,
16903      forceHelperSize: false,
16904      grid: false,
16905      handle: false,
16906      helper: "original",
16907      items: "> *",
16908      opacity: false,
16909      placeholder: false,
16910      revert: false,
16911      scroll: true,
16912      scrollSensitivity: 20,
16913      scrollSpeed: 20,
16914      scope: "default",
16915      tolerance: "intersect",
16916      zIndex: 1000,
16917
16918      // Callbacks
16919      activate: null,
16920      beforeStop: null,
16921      change: null,
16922      deactivate: null,
16923      out: null,
16924      over: null,
16925      receive: null,
16926      remove: null,
16927      sort: null,
16928      start: null,
16929      stop: null,
16930      update: null,
16931    },
16932
16933    _isOverAxis: function (x, reference, size) {
16934      return x >= reference && x < reference + size;
16935    },
16936
16937    _isFloating: function (item) {
16938      return (
16939        /left|right/.test(item.css("float")) ||
16940        /inline|table-cell/.test(item.css("display"))
16941      );
16942    },
16943
16944    _create: function () {
16945      this.containerCache = {};
16946      this._addClass("ui-sortable");
16947
16948      //Get the items
16949      this.refresh();
16950
16951      //Let's determine the parent's offset
16952      this.offset = this.element.offset();
16953
16954      //Initialize mouse events for interaction
16955      this._mouseInit();
16956
16957      this._setHandleClassName();
16958
16959      //We're ready to go
16960      this.ready = true;
16961    },
16962
16963    _setOption: function (key, value) {
16964      this._super(key, value);
16965
16966      if (key === "handle") {
16967        this._setHandleClassName();
16968      }
16969    },
16970
16971    _setHandleClassName: function () {
16972      var that = this;
16973      this._removeClass(
16974        this.element.find(".ui-sortable-handle"),
16975        "ui-sortable-handle"
16976      );
16977      $.each(this.items, function () {
16978        that._addClass(
16979          this.instance.options.handle
16980            ? this.item.find(this.instance.options.handle)
16981            : this.item,
16982          "ui-sortable-handle"
16983        );
16984      });
16985    },
16986
16987    _destroy: function () {
16988      this._mouseDestroy();
16989
16990      for (var i = this.items.length - 1; i >= 0; i--) {
16991        this.items[i].item.removeData(this.widgetName + "-item");
16992      }
16993
16994      return this;
16995    },
16996
16997    _mouseCapture: function (event, overrideHandle) {
16998      var currentItem = null,
16999        validHandle = false,
17000        that = this;
17001
17002      if (this.reverting) {
17003        return false;
17004      }
17005
17006      if (this.options.disabled || this.options.type === "static") {
17007        return false;
17008      }
17009
17010      //We have to refresh the items data once first
17011      this._refreshItems(event);
17012
17013      //Find out if the clicked node (or one of its parents) is a actual item in this.items
17014      $(event.target)
17015        .parents()
17016        .each(function () {
17017          if ($.data(this, that.widgetName + "-item") === that) {
17018            currentItem = $(this);
17019            return false;
17020          }
17021        });
17022      if ($.data(event.target, that.widgetName + "-item") === that) {
17023        currentItem = $(event.target);
17024      }
17025
17026      if (!currentItem) {
17027        return false;
17028      }
17029      if (this.options.handle && !overrideHandle) {
17030        $(this.options.handle, currentItem)
17031          .find("*")
17032          .addBack()
17033          .each(function () {
17034            if (this === event.target) {
17035              validHandle = true;
17036            }
17037          });
17038        if (!validHandle) {
17039          return false;
17040        }
17041      }
17042
17043      this.currentItem = currentItem;
17044      this._removeCurrentsFromItems();
vendor: 9,481 bytes, lines 17045-17343
17045      return true;
17046    },
17047
17048    _mouseStart: function (event, overrideHandle, noActivation) {
17049      var i,
17050        body,
17051        o = this.options;
17052
17053      this.currentContainer = this;
17054
17055      //We only need to call refreshPositions, because the refreshItems call has been moved to
17056      // mouseCapture
17057      this.refreshPositions();
17058
17059      //Prepare the dragged items parent
17060      this.appendTo = $(
17061        o.appendTo !== "parent" ? o.appendTo : this.currentItem.parent()
17062      );
17063
17064      //Create and append the visible helper
17065      this.helper = this._createHelper(event);
17066
17067      //Cache the helper size
17068      this._cacheHelperProportions();
17069
17070      /*
17071       * - Position generation -
17072       * This block generates everything position related - it's the core of draggables.
17073       */
17074
17075      //Cache the margins of the original element
17076      this._cacheMargins();
17077
17078      //The element's absolute position on the page minus margins
17079      this.offset = this.currentItem.offset();
17080      this.offset = {
17081        top: this.offset.top - this.margins.top,
17082        left: this.offset.left - this.margins.left,
17083      };
17084
17085      $.extend(this.offset, {
17086        click: {
17087          //Where the click happened, relative to the element
17088          left: event.pageX - this.offset.left,
17089          top: event.pageY - this.offset.top,
17090        },
17091
17092        // This is a relative to absolute position minus the actual position calculation -
17093        // only used for relative positioned helper
17094        relative: this._getRelativeOffset(),
17095      });
17096
17097      // After we get the helper offset, but before we get the parent offset we can
17098      // change the helper's position to absolute
17099      // TODO: Still need to figure out a way to make relative sorting possible
17100      this.helper.css("position", "absolute");
17101      this.cssPosition = this.helper.css("position");
17102
17103      //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
17104      if (o.cursorAt) {
17105        this._adjustOffsetFromHelper(o.cursorAt);
17106      }
17107
17108      //Cache the former DOM position
17109      this.domPosition = {
17110        prev: this.currentItem.prev()[0],
17111        parent: this.currentItem.parent()[0],
17112      };
17113
17114      // If the helper is not the original, hide the original so it's not playing any role during
17115      // the drag, won't cause anything bad this way
17116      if (this.helper[0] !== this.currentItem[0]) {
17117        this.currentItem.hide();
17118      }
17119
17120      //Create the placeholder
17121      this._createPlaceholder();
17122
17123      //Get the next scrolling parent
17124      this.scrollParent = this.placeholder.scrollParent();
17125
17126      $.extend(this.offset, {
17127        parent: this._getParentOffset(),
17128      });
17129
17130      //Set a containment if given in the options
17131      if (o.containment) {
17132        this._setContainment();
17133      }
17134
17135      if (o.cursor && o.cursor !== "auto") {
17136        // cursor option
17137        body = this.document.find("body");
17138
17139        // Support: IE
17140        this.storedCursor = body.css("cursor");
17141        body.css("cursor", o.cursor);
17142
17143        this.storedStylesheet = $(
17144          "<style>*{ cursor: " + o.cursor + " !important; }</style>"
17145        ).appendTo(body);
17146      }
17147
17148      // We need to make sure to grab the zIndex before setting the
17149      // opacity, because setting the opacity to anything lower than 1
17150      // causes the zIndex to change from "auto" to 0.
17151      if (o.zIndex) {
17152        // zIndex option
17153        if (this.helper.css("zIndex")) {
17154          this._storedZIndex = this.helper.css("zIndex");
17155        }
17156        this.helper.css("zIndex", o.zIndex);
17157      }
17158
17159      if (o.opacity) {
17160        // opacity option
17161        if (this.helper.css("opacity")) {
17162          this._storedOpacity = this.helper.css("opacity");
17163        }
17164        this.helper.css("opacity", o.opacity);
17165      }
17166
17167      //Prepare scrolling
17168      if (
17169        this.scrollParent[0] !== this.document[0] &&
17170        this.scrollParent[0].tagName !== "HTML"
17171      ) {
17172        this.overflowOffset = this.scrollParent.offset();
17173      }
17174
17175      //Call callbacks
17176      this._trigger("start", event, this._uiHash());
17177
17178      //Recache the helper size
17179      if (!this._preserveHelperProportions) {
17180        this._cacheHelperProportions();
17181      }
17182
17183      //Post "activate" events to possible containers
17184      if (!noActivation) {
17185        for (i = this.containers.length - 1; i >= 0; i--) {
17186          this.containers[i]._trigger("activate", event, this._uiHash(this));
17187        }
17188      }
17189
17190      //Prepare possible droppables
17191      if ($.ui.ddmanager) {
17192        $.ui.ddmanager.current = this;
17193      }
17194
17195      if ($.ui.ddmanager && !o.dropBehaviour) {
17196        $.ui.ddmanager.prepareOffsets(this, event);
17197      }
17198
17199      this.dragging = true;
17200
17201      this._addClass(this.helper, "ui-sortable-helper");
17202
17203      //Move the helper, if needed
17204      if (!this.helper.parent().is(this.appendTo)) {
17205        this.helper.detach().appendTo(this.appendTo);
17206
17207        //Update position
17208        this.offset.parent = this._getParentOffset();
17209      }
17210
17211      //Generate the original position
17212      this.position = this.originalPosition = this._generatePosition(event);
17213      this.originalPageX = event.pageX;
17214      this.originalPageY = event.pageY;
17215      this.lastPositionAbs = this.positionAbs =
17216        this._convertPositionTo("absolute");
17217
17218      this._mouseDrag(event);
17219
17220      return true;
17221    },
17222
17223    _scroll: function (event) {
17224      var o = this.options,
17225        scrolled = false;
17226
17227      if (
17228        this.scrollParent[0] !== this.document[0] &&
17229        this.scrollParent[0].tagName !== "HTML"
17230      ) {
17231        if (
17232          this.overflowOffset.top +
17233            this.scrollParent[0].offsetHeight -
17234            event.pageY <
17235          o.scrollSensitivity
17236        ) {
17237          this.scrollParent[0].scrollTop = scrolled =
17238            this.scrollParent[0].scrollTop + o.scrollSpeed;
17239        } else if (
17240          event.pageY - this.overflowOffset.top <
17241          o.scrollSensitivity
17242        ) {
17243          this.scrollParent[0].scrollTop = scrolled =
17244            this.scrollParent[0].scrollTop - o.scrollSpeed;
17245        }
17246
17247        if (
17248          this.overflowOffset.left +
17249            this.scrollParent[0].offsetWidth -
17250            event.pageX <
17251          o.scrollSensitivity
17252        ) {
17253          this.scrollParent[0].scrollLeft = scrolled =
17254            this.scrollParent[0].scrollLeft + o.scrollSpeed;
17255        } else if (
17256          event.pageX - this.overflowOffset.left <
17257          o.scrollSensitivity
17258        ) {
17259          this.scrollParent[0].scrollLeft = scrolled =
17260            this.scrollParent[0].scrollLeft - o.scrollSpeed;
17261        }
17262      } else {
17263        if (event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
17264          scrolled = this.document.scrollTop(
17265            this.document.scrollTop() - o.scrollSpeed
17266          );
17267        } else if (
17268          this.window.height() - (event.pageY - this.document.scrollTop()) <
17269          o.scrollSensitivity
17270        ) {
17271          scrolled = this.document.scrollTop(
17272            this.document.scrollTop() + o.scrollSpeed
17273          );
17274        }
17275
17276        if (event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
17277          scrolled = this.document.scrollLeft(
17278            this.document.scrollLeft() - o.scrollSpeed
17279          );
17280        } else if (
17281          this.window.width() - (event.pageX - this.document.scrollLeft()) <
17282          o.scrollSensitivity
17283        ) {
17284          scrolled = this.document.scrollLeft(
17285            this.document.scrollLeft() + o.scrollSpeed
17286          );
17287        }
17288      }
17289
17290      return scrolled;
17291    },
17292
17293    _mouseDrag: function (event) {
17294      var i,
17295        item,
17296        itemElement,
17297        intersection,
17298        o = this.options;
17299
17300      //Compute the helpers position
17301      this.position = this._generatePosition(event);
17302      this.positionAbs = this._convertPositionTo("absolute");
17303
17304      //Set the helper position
17305      if (!this.options.axis || this.options.axis !== "y") {
17306        this.helper[0].style.left = this.position.left + "px";
17307      }
17308      if (!this.options.axis || this.options.axis !== "x") {
17309        this.helper[0].style.top = this.position.top + "px";
17310      }
17311
17312      //Do scrolling
17313      if (o.scroll) {
17314        if (this._scroll(event) !== false) {
17315          //Update item positions used in position checks
17316          this._refreshItemPositions(true);
17317
17318          if ($.ui.ddmanager && !o.dropBehaviour) {
17319            $.ui.ddmanager.prepareOffsets(this, event);
17320          }
17321        }
17322      }
17323
17324      this.dragDirection = {
17325        vertical: this._getDragVerticalDirection(),
17326        horizontal: this._getDragHorizontalDirection(),
17327      };
17328
17329      //Rearrange
17330      for (i = this.items.length - 1; i >= 0; i--) {
17331        //Cache variables and intersection, continue if no intersection
17332        item = this.items[i];
17333        itemElement = item.item[0];
17334        intersection = this._intersectsWithPointer(item);
17335        if (!intersection) {
17336          continue;
17337        }
17338
17339        // Only put the placeholder inside the current Container, skip all
17340        // items from other containers. This works because when moving
17341        // an item from one container to another the
17342        // currentContainer is switched before the placeholder is moved.
17343        //
vendor: 5,354 bytes, lines 17344-17525
17344        // Without this, moving items in "sub-sortables" can cause
17345        // the placeholder to jitter between the outer and inner container.
17346        if (item.instance !== this.currentContainer) {
17347          continue;
17348        }
17349
17350        // Cannot intersect with itself
17351        // no useless actions that have been done before
17352        // no action if the item moved is the parent of the item checked
17353        if (
17354          itemElement !== this.currentItem[0] &&
17355          this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !==
17356            itemElement &&
17357          !$.contains(this.placeholder[0], itemElement) &&
17358          (this.options.type === "semi-dynamic"
17359            ? !$.contains(this.element[0], itemElement)
17360            : true)
17361        ) {
17362          this.direction = intersection === 1 ? "down" : "up";
17363
17364          if (
17365            this.options.tolerance === "pointer" ||
17366            this._intersectsWithSides(item)
17367          ) {
17368            this._rearrange(event, item);
17369          } else {
17370            break;
17371          }
17372
17373          this._trigger("change", event, this._uiHash());
17374          break;
17375        }
17376      }
17377
17378      //Post events to containers
17379      this._contactContainers(event);
17380
17381      //Interconnect with droppables
17382      if ($.ui.ddmanager) {
17383        $.ui.ddmanager.drag(this, event);
17384      }
17385
17386      //Call callbacks
17387      this._trigger("sort", event, this._uiHash());
17388
17389      this.lastPositionAbs = this.positionAbs;
17390      return false;
17391    },
17392
17393    _mouseStop: function (event, noPropagation) {
17394      if (!event) {
17395        return;
17396      }
17397
17398      //If we are using droppables, inform the manager about the drop
17399      if ($.ui.ddmanager && !this.options.dropBehaviour) {
17400        $.ui.ddmanager.drop(this, event);
17401      }
17402
17403      if (this.options.revert) {
17404        var that = this,
17405          cur = this.placeholder.offset(),
17406          axis = this.options.axis,
17407          animation = {};
17408
17409        if (!axis || axis === "x") {
17410          animation.left =
17411            cur.left -
17412            this.offset.parent.left -
17413            this.margins.left +
17414            (this.offsetParent[0] === this.document[0].body
17415              ? 0
17416              : this.offsetParent[0].scrollLeft);
17417        }
17418        if (!axis || axis === "y") {
17419          animation.top =
17420            cur.top -
17421            this.offset.parent.top -
17422            this.margins.top +
17423            (this.offsetParent[0] === this.document[0].body
17424              ? 0
17425              : this.offsetParent[0].scrollTop);
17426        }
17427        this.reverting = true;
17428        $(this.helper).animate(
17429          animation,
17430          parseInt(this.options.revert, 10) || 500,
17431          function () {
17432            that._clear(event);
17433          }
17434        );
17435      } else {
17436        this._clear(event, noPropagation);
17437      }
17438
17439      return false;
17440    },
17441
17442    cancel: function () {
17443      if (this.dragging) {
17444        this._mouseUp(new $.Event("mouseup", { target: null }));
17445
17446        if (this.options.helper === "original") {
17447          this.currentItem.css(this._storedCSS);
17448          this._removeClass(this.currentItem, "ui-sortable-helper");
17449        } else {
17450          this.currentItem.show();
17451        }
17452
17453        //Post deactivating events to containers
17454        for (var i = this.containers.length - 1; i >= 0; i--) {
17455          this.containers[i]._trigger("deactivate", null, this._uiHash(this));
17456          if (this.containers[i].containerCache.over) {
17457            this.containers[i]._trigger("out", null, this._uiHash(this));
17458            this.containers[i].containerCache.over = 0;
17459          }
17460        }
17461      }
17462
17463      if (this.placeholder) {
17464        //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
17465        // it unbinds ALL events from the original node!
17466        if (this.placeholder[0].parentNode) {
17467          this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
17468        }
17469        if (
17470          this.options.helper !== "original" &&
17471          this.helper &&
17472          this.helper[0].parentNode
17473        ) {
17474          this.helper.remove();
17475        }
17476
17477        $.extend(this, {
17478          helper: null,
17479          dragging: false,
17480          reverting: false,
17481          _noFinalSort: null,
17482        });
17483
17484        if (this.domPosition.prev) {
17485          $(this.domPosition.prev).after(this.currentItem);
17486        } else {
17487          $(this.domPosition.parent).prepend(this.currentItem);
17488        }
17489      }
17490
17491      return this;
17492    },
17493
17494    serialize: function (o) {
17495      var items = this._getItemsAsjQuery(o && o.connected),
17496        str = [];
17497      o = o || {};
17498
17499      $(items).each(function () {
17500        var res = ($(o.item || this).attr(o.attribute || "id") || "").match(
17501          o.expression || /(.+)[\-=_](.+)/
17502        );
17503        if (res) {
17504          str.push(
17505            (o.key || res[1] + "[]") +
17506              "=" +
17507              (o.key && o.expression ? res[1] : res[2])
17508          );
17509        }
17510      });
17511
17512      if (!str.length && o.key) {
17513        str.push(o.key + "=");
17514      }
17515
17516      return str.join("&");
17517    },
17518
17519    toArray: function (o) {
17520      var items = this._getItemsAsjQuery(o && o.connected),
17521        ret = [];
17522
17523      o = o || {};
17524
17525      items.each(function () {
17526        ret.push($(o.item || this).attr(o.attribute || "id") || "");
17527      });
17528      return ret;
17529    },
17530
17531    /* Be careful with the following core functions */
17532    _intersectsWith: function (item) {
17533      var x1 = this.positionAbs.left,
17534        x2 = x1 + this.helperProportions.width,
17535        y1 = this.positionAbs.top,
17536        y2 = y1 + this.helperProportions.height,
17537        l = item.left,
17538        r = l + item.width,
17539        t = item.top,
17540        b = t + item.height,
17541        dyClick = this.offset.click.top,
17542        dxClick = this.offset.click.left,
17543        isOverElementHeight =
17544          this.options.axis === "x" || (y1 + dyClick > t && y1 + dyClick < b),
17545        isOverElementWidth =
17546          this.options.axis === "y" || (x1 + dxClick > l && x1 + dxClick < r),
17547        isOverElement = isOverElementHeight && isOverElementWidth;
17548
17549      if (
17550        this.options.tolerance === "pointer" ||
17551        this.options.forcePointerForContainers ||
17552        (this.options.tolerance !== "pointer" &&
17553          this.helperProportions[this.floating ? "width" : "height"] >
17554            item[this.floating ? "width" : "height"])
17555      ) {
17556        return isOverElement;
17557      } else {
17558        return (
17559          l < x1 + this.helperProportions.width / 2 && // Right Half
17560          x2 - this.helperProportions.width / 2 < r && // Left Half
17561          t < y1 + this.helperProportions.height / 2 && // Bottom Half
17562          y2 - this.helperProportions.height / 2 < b
17563        ); // Top Half
17564      }
17565    },
17566
17567    _intersectsWithPointer: function (item) {
17568      var verticalDirection,
17569        horizontalDirection,
17570        isOverElementHeight =
17571          this.options.axis === "x" ||
17572          this._isOverAxis(
17573            this.positionAbs.top + this.offset.click.top,
17574            item.top,
17575            item.height
17576          ),
17577        isOverElementWidth =
17578          this.options.axis === "y" ||
17579          this._isOverAxis(
17580            this.positionAbs.left + this.offset.click.left,
17581            item.left,
17582            item.width
17583          ),
17584        isOverElement = isOverElementHeight && isOverElementWidth;
17585
17586      if (!isOverElement) {
17587        return false;
17588      }
17589
17590      verticalDirection = this.dragDirection.vertical;
17591      horizontalDirection = this.dragDirection.horizontal;
17592
17593      return this.floating
17594        ? horizontalDirection === "right" || verticalDirection === "down"
17595          ? 2
17596          : 1
17597        : verticalDirection && (verticalDirection === "down" ? 2 : 1);
17598    },
17599
17600    _intersectsWithSides: function (item) {
17601      var isOverBottomHalf = this._isOverAxis(
17602          this.positionAbs.top + this.offset.click.top,
17603          item.top + item.height / 2,
17604          item.height
17605        ),
17606        isOverRightHalf = this._isOverAxis(
17607          this.positionAbs.left + this.offset.click.left,
17608          item.left + item.width / 2,
17609          item.width
17610        ),
17611        verticalDirection = this.dragDirection.vertical,
17612        horizontalDirection = this.dragDirection.horizontal;
17613
17614      if (this.floating && horizontalDirection) {
17615        return (
17616          (horizontalDirection === "right" && isOverRightHalf) ||
17617          (horizontalDirection === "left" && !isOverRightHalf)
17618        );
17619      } else {
17620        return (
17621          verticalDirection &&
17622          ((verticalDirection === "down" && isOverBottomHalf) ||
17623            (verticalDirection === "up" && !isOverBottomHalf))
17624        );
17625      }
17626    },
17627
17628    _getDragVerticalDirection: function () {
17629      var delta = this.positionAbs.top - this.lastPositionAbs.top;
17630      return delta !== 0 && (delta > 0 ? "down" : "up");
17631    },
17632
17633    _getDragHorizontalDirection: function () {
17634      var delta = this.positionAbs.left - this.lastPositionAbs.left;
17635      return delta !== 0 && (delta > 0 ? "right" : "left");
17636    },
17637
17638    refresh: function (event) {
17639      this._refreshItems(event);
17640      this._setHandleClassName();
17641      this.refreshPositions();
17642      return this;
17643    },
17644
17645    _connectWith: function () {
17646      var options = this.options;
17647      return options.connectWith.constructor === String
vendor: 12,823 bytes, lines 17648-18035
17648        ? [options.connectWith]
17649        : options.connectWith;
17650    },
17651
17652    _getItemsAsjQuery: function (connected) {
17653      var i,
17654        j,
17655        cur,
17656        inst,
17657        items = [],
17658        queries = [],
17659        connectWith = this._connectWith();
17660
17661      if (connectWith && connected) {
17662        for (i = connectWith.length - 1; i >= 0; i--) {
17663          cur = $(connectWith[i], this.document[0]);
17664          for (j = cur.length - 1; j >= 0; j--) {
17665            inst = $.data(cur[j], this.widgetFullName);
17666            if (inst && inst !== this && !inst.options.disabled) {
17667              queries.push([
17668                typeof inst.options.items === "function"
17669                  ? inst.options.items.call(inst.element)
17670                  : $(inst.options.items, inst.element)
17671                      .not(".ui-sortable-helper")
17672                      .not(".ui-sortable-placeholder"),
17673                inst,
17674              ]);
17675            }
17676          }
17677        }
17678      }
17679
17680      queries.push([
17681        typeof this.options.items === "function"
17682          ? this.options.items.call(this.element, null, {
17683              options: this.options,
17684              item: this.currentItem,
17685            })
17686          : $(this.options.items, this.element)
17687              .not(".ui-sortable-helper")
17688              .not(".ui-sortable-placeholder"),
17689        this,
17690      ]);
17691
17692      function addItems() {
17693        items.push(this);
17694      }
17695      for (i = queries.length - 1; i >= 0; i--) {
17696        queries[i][0].each(addItems);
17697      }
17698
17699      return $(items);
17700    },
17701
17702    _removeCurrentsFromItems: function () {
17703      var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
17704
17705      this.items = $.grep(this.items, function (item) {
17706        for (var j = 0; j < list.length; j++) {
17707          if (list[j] === item.item[0]) {
17708            return false;
17709          }
17710        }
17711        return true;
17712      });
17713    },
17714
17715    _refreshItems: function (event) {
17716      this.items = [];
17717      this.containers = [this];
17718
17719      var i,
17720        j,
17721        cur,
17722        inst,
17723        targetData,
17724        _queries,
17725        item,
17726        queriesLength,
17727        items = this.items,
17728        queries = [
17729          [
17730            typeof this.options.items === "function"
17731              ? this.options.items.call(this.element[0], event, {
17732                  item: this.currentItem,
17733                })
17734              : $(this.options.items, this.element),
17735            this,
17736          ],
17737        ],
17738        connectWith = this._connectWith();
17739
17740      //Shouldn't be run the first time through due to massive slow-down
17741      if (connectWith && this.ready) {
17742        for (i = connectWith.length - 1; i >= 0; i--) {
17743          cur = $(connectWith[i], this.document[0]);
17744          for (j = cur.length - 1; j >= 0; j--) {
17745            inst = $.data(cur[j], this.widgetFullName);
17746            if (inst && inst !== this && !inst.options.disabled) {
17747              queries.push([
17748                typeof inst.options.items === "function"
17749                  ? inst.options.items.call(inst.element[0], event, {
17750                      item: this.currentItem,
17751                    })
17752                  : $(inst.options.items, inst.element),
17753                inst,
17754              ]);
17755              this.containers.push(inst);
17756            }
17757          }
17758        }
17759      }
17760
17761      for (i = queries.length - 1; i >= 0; i--) {
17762        targetData = queries[i][1];
17763        _queries = queries[i][0];
17764
17765        for (j = 0, queriesLength = _queries.length; j < queriesLength; j++) {
17766          item = $(_queries[j]);
17767
17768          // Data for target checking (mouse manager)
17769          item.data(this.widgetName + "-item", targetData);
17770
17771          items.push({
17772            item: item,
17773            instance: targetData,
17774            width: 0,
17775            height: 0,
17776            left: 0,
17777            top: 0,
17778          });
17779        }
17780      }
17781    },
17782
17783    _refreshItemPositions: function (fast) {
17784      var i, item, t, p;
17785
17786      for (i = this.items.length - 1; i >= 0; i--) {
17787        item = this.items[i];
17788
17789        //We ignore calculating positions of all connected containers when we're not over them
17790        if (
17791          this.currentContainer &&
17792          item.instance !== this.currentContainer &&
17793          item.item[0] !== this.currentItem[0]
17794        ) {
17795          continue;
17796        }
17797
17798        t = this.options.toleranceElement
17799          ? $(this.options.toleranceElement, item.item)
17800          : item.item;
17801
17802        if (!fast) {
17803          item.width = t.outerWidth();
17804          item.height = t.outerHeight();
17805        }
17806
17807        p = t.offset();
17808        item.left = p.left;
17809        item.top = p.top;
17810      }
17811    },
17812
17813    refreshPositions: function (fast) {
17814      // Determine whether items are being displayed horizontally
17815      this.floating = this.items.length
17816        ? this.options.axis === "x" || this._isFloating(this.items[0].item)
17817        : false;
17818
17819      // This has to be redone because due to the item being moved out/into the offsetParent,
17820      // the offsetParent's position will change
17821      if (this.offsetParent && this.helper) {
17822        this.offset.parent = this._getParentOffset();
17823      }
17824
17825      this._refreshItemPositions(fast);
17826
17827      var i, p;
17828
17829      if (this.options.custom && this.options.custom.refreshContainers) {
17830        this.options.custom.refreshContainers.call(this);
17831      } else {
17832        for (i = this.containers.length - 1; i >= 0; i--) {
17833          p = this.containers[i].element.offset();
17834          this.containers[i].containerCache.left = p.left;
17835          this.containers[i].containerCache.top = p.top;
17836          this.containers[i].containerCache.width =
17837            this.containers[i].element.outerWidth();
17838          this.containers[i].containerCache.height =
17839            this.containers[i].element.outerHeight();
17840        }
17841      }
17842
17843      return this;
17844    },
17845
17846    _createPlaceholder: function (that) {
17847      that = that || this;
17848      var className,
17849        nodeName,
17850        o = that.options;
17851
17852      if (!o.placeholder || o.placeholder.constructor === String) {
17853        className = o.placeholder;
17854        nodeName = that.currentItem[0].nodeName.toLowerCase();
17855        o.placeholder = {
17856          element: function () {
17857            var element = $("<" + nodeName + ">", that.document[0]);
17858
17859            that
17860              ._addClass(
17861                element,
17862                "ui-sortable-placeholder",
17863                className || that.currentItem[0].className
17864              )
17865              ._removeClass(element, "ui-sortable-helper");
17866
17867            if (nodeName === "tbody") {
17868              that._createTrPlaceholder(
17869                that.currentItem.find("tr").eq(0),
17870                $("<tr>", that.document[0]).appendTo(element)
17871              );
17872            } else if (nodeName === "tr") {
17873              that._createTrPlaceholder(that.currentItem, element);
17874            } else if (nodeName === "img") {
17875              element.attr("src", that.currentItem.attr("src"));
17876            }
17877
17878            if (!className) {
17879              element.css("visibility", "hidden");
17880            }
17881
17882            return element;
17883          },
17884          update: function (container, p) {
17885            // 1. If a className is set as 'placeholder option, we don't force sizes -
17886            // the class is responsible for that
17887            // 2. The option 'forcePlaceholderSize can be enabled to force it even if a
17888            // class name is specified
17889            if (className && !o.forcePlaceholderSize) {
17890              return;
17891            }
17892
17893            // If the element doesn't have a actual height or width by itself (without
17894            // styles coming from a stylesheet), it receives the inline height and width
17895            // from the dragged item. Or, if it's a tbody or tr, it's going to have a height
17896            // anyway since we're populating them with <td>s above, but they're unlikely to
17897            // be the correct height on their own if the row heights are dynamic, so we'll
17898            // always assign the height of the dragged item given forcePlaceholderSize
17899            // is true.
17900            if (
17901              !p.height() ||
17902              (o.forcePlaceholderSize &&
17903                (nodeName === "tbody" || nodeName === "tr"))
17904            ) {
17905              p.height(
17906                that.currentItem.innerHeight() -
17907                  parseInt(that.currentItem.css("paddingTop") || 0, 10) -
17908                  parseInt(that.currentItem.css("paddingBottom") || 0, 10)
17909              );
17910            }
17911            if (!p.width()) {
17912              p.width(
17913                that.currentItem.innerWidth() -
17914                  parseInt(that.currentItem.css("paddingLeft") || 0, 10) -
17915                  parseInt(that.currentItem.css("paddingRight") || 0, 10)
17916              );
17917            }
17918          },
17919        };
17920      }
17921
17922      //Create the placeholder
17923      that.placeholder = $(
17924        o.placeholder.element.call(that.element, that.currentItem)
17925      );
17926
17927      //Append it after the actual current item
17928      that.currentItem.after(that.placeholder);
17929
17930      //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
17931      o.placeholder.update(that, that.placeholder);
17932    },
17933
17934    _createTrPlaceholder: function (sourceTr, targetTr) {
17935      var that = this;
17936
17937      sourceTr.children().each(function () {
17938        $("<td>&#160;</td>", that.document[0])
17939          .attr("colspan", $(this).attr("colspan") || 1)
17940          .appendTo(targetTr);
17941      });
17942    },
17943
17944    _contactContainers: function (event) {
17945      var i,
17946        j,
17947        dist,
17948        itemWithLeastDistance,
17949        posProperty,
17950        sizeProperty,
17951        cur,
17952        nearBottom,
17953        floating,
17954        axis,
17955        innermostContainer = null,
17956        innermostIndex = null;
17957
17958      // Get innermost container that intersects with item
17959      for (i = this.containers.length - 1; i >= 0; i--) {
17960        // Never consider a container that's located within the item itself
17961        if ($.contains(this.currentItem[0], this.containers[i].element[0])) {
17962          continue;
17963        }
17964
17965        if (this._intersectsWith(this.containers[i].containerCache)) {
17966          // If we've already found a container and it's more "inner" than this, then continue
17967          if (
17968            innermostContainer &&
17969            $.contains(
17970              this.containers[i].element[0],
17971              innermostContainer.element[0]
17972            )
17973          ) {
17974            continue;
17975          }
17976
17977          innermostContainer = this.containers[i];
17978          innermostIndex = i;
17979        } else {
17980          // container doesn't intersect. trigger "out" event if necessary
17981          if (this.containers[i].containerCache.over) {
17982            this.containers[i]._trigger("out", event, this._uiHash(this));
17983            this.containers[i].containerCache.over = 0;
17984          }
17985        }
17986      }
17987
17988      // If no intersecting containers found, return
17989      if (!innermostContainer) {
17990        return;
17991      }
17992
17993      // Move the item into the container if it's not there already
17994      if (this.containers.length === 1) {
17995        if (!this.containers[innermostIndex].containerCache.over) {
17996          this.containers[innermostIndex]._trigger(
17997            "over",
17998            event,
17999            this._uiHash(this)
18000          );
18001          this.containers[innermostIndex].containerCache.over = 1;
18002        }
18003      } else {
18004        // When entering a new container, we will find the item with the least distance and
18005        // append our item near it
18006        dist = 10000;
18007        itemWithLeastDistance = null;
18008        floating =
18009          innermostContainer.floating || this._isFloating(this.currentItem);
18010        posProperty = floating ? "left" : "top";
18011        sizeProperty = floating ? "width" : "height";
18012        axis = floating ? "pageX" : "pageY";
18013
18014        for (j = this.items.length - 1; j >= 0; j--) {
18015          if (
18016            !$.contains(
18017              this.containers[innermostIndex].element[0],
18018              this.items[j].item[0]
18019            )
18020          ) {
18021            continue;
18022          }
18023          if (this.items[j].item[0] === this.currentItem[0]) {
18024            continue;
18025          }
18026
18027          cur = this.items[j].item.offset()[posProperty];
18028          nearBottom = false;
18029          if (event[axis] - cur > this.items[j][sizeProperty] / 2) {
18030            nearBottom = true;
18031          }
18032
18033          if (Math.abs(event[axis] - cur) < dist) {
18034            dist = Math.abs(event[axis] - cur);
18035            itemWithLeastDistance = this.items[j];
vendor: 6,298 bytes, lines 18036-18232
18036            this.direction = nearBottom ? "up" : "down";
18037          }
18038        }
18039
18040        //Check if dropOnEmpty is enabled
18041        if (!itemWithLeastDistance && !this.options.dropOnEmpty) {
18042          return;
18043        }
18044
18045        if (this.currentContainer === this.containers[innermostIndex]) {
18046          if (!this.currentContainer.containerCache.over) {
18047            this.containers[innermostIndex]._trigger(
18048              "over",
18049              event,
18050              this._uiHash()
18051            );
18052            this.currentContainer.containerCache.over = 1;
18053          }
18054          return;
18055        }
18056
18057        if (itemWithLeastDistance) {
18058          this._rearrange(event, itemWithLeastDistance, null, true);
18059        } else {
18060          this._rearrange(
18061            event,
18062            null,
18063            this.containers[innermostIndex].element,
18064            true
18065          );
18066        }
18067        this._trigger("change", event, this._uiHash());
18068        this.containers[innermostIndex]._trigger(
18069          "change",
18070          event,
18071          this._uiHash(this)
18072        );
18073        this.currentContainer = this.containers[innermostIndex];
18074
18075        //Update the placeholder
18076        this.options.placeholder.update(
18077          this.currentContainer,
18078          this.placeholder
18079        );
18080
18081        //Update scrollParent
18082        this.scrollParent = this.placeholder.scrollParent();
18083
18084        //Update overflowOffset
18085        if (
18086          this.scrollParent[0] !== this.document[0] &&
18087          this.scrollParent[0].tagName !== "HTML"
18088        ) {
18089          this.overflowOffset = this.scrollParent.offset();
18090        }
18091
18092        this.containers[innermostIndex]._trigger(
18093          "over",
18094          event,
18095          this._uiHash(this)
18096        );
18097        this.containers[innermostIndex].containerCache.over = 1;
18098      }
18099    },
18100
18101    _createHelper: function (event) {
18102      var o = this.options,
18103        helper =
18104          typeof o.helper === "function"
18105            ? $(o.helper.apply(this.element[0], [event, this.currentItem]))
18106            : o.helper === "clone"
18107            ? this.currentItem.clone()
18108            : this.currentItem;
18109
18110      //Add the helper to the DOM if that didn't happen already
18111      if (!helper.parents("body").length) {
18112        this.appendTo[0].appendChild(helper[0]);
18113      }
18114
18115      if (helper[0] === this.currentItem[0]) {
18116        this._storedCSS = {
18117          width: this.currentItem[0].style.width,
18118          height: this.currentItem[0].style.height,
18119          position: this.currentItem.css("position"),
18120          top: this.currentItem.css("top"),
18121          left: this.currentItem.css("left"),
18122        };
18123      }
18124
18125      if (!helper[0].style.width || o.forceHelperSize) {
18126        helper.width(this.currentItem.width());
18127      }
18128      if (!helper[0].style.height || o.forceHelperSize) {
18129        helper.height(this.currentItem.height());
18130      }
18131
18132      return helper;
18133    },
18134
18135    _adjustOffsetFromHelper: function (obj) {
18136      if (typeof obj === "string") {
18137        obj = obj.split(" ");
18138      }
18139      if (Array.isArray(obj)) {
18140        obj = { left: +obj[0], top: +obj[1] || 0 };
18141      }
18142      if ("left" in obj) {
18143        this.offset.click.left = obj.left + this.margins.left;
18144      }
18145      if ("right" in obj) {
18146        this.offset.click.left =
18147          this.helperProportions.width - obj.right + this.margins.left;
18148      }
18149      if ("top" in obj) {
18150        this.offset.click.top = obj.top + this.margins.top;
18151      }
18152      if ("bottom" in obj) {
18153        this.offset.click.top =
18154          this.helperProportions.height - obj.bottom + this.margins.top;
18155      }
18156    },
18157
18158    _getParentOffset: function () {
18159      //Get the offsetParent and cache its position
18160      this.offsetParent = this.helper.offsetParent();
18161      var po = this.offsetParent.offset();
18162
18163      // This is a special case where we need to modify a offset calculated on start, since the
18164      // following happened:
18165      // 1. The position of the helper is absolute, so it's position is calculated based on the
18166      // next positioned parent
18167      // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
18168      // the document, which means that the scroll is included in the initial calculation of the
18169      // offset of the parent, and never recalculated upon drag
18170      if (
18171        this.cssPosition === "absolute" &&
18172        this.scrollParent[0] !== this.document[0] &&
18173        $.contains(this.scrollParent[0], this.offsetParent[0])
18174      ) {
18175        po.left += this.scrollParent.scrollLeft();
18176        po.top += this.scrollParent.scrollTop();
18177      }
18178
18179      // This needs to be actually done for all browsers, since pageX/pageY includes this
18180      // information with an ugly IE fix
18181      if (
18182        this.offsetParent[0] === this.document[0].body ||
18183        (this.offsetParent[0].tagName &&
18184          this.offsetParent[0].tagName.toLowerCase() === "html" &&
18185          $.ui.ie)
18186      ) {
18187        po = { top: 0, left: 0 };
18188      }
18189
18190      return {
18191        top:
18192          po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
18193        left:
18194          po.left +
18195          (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0),
18196      };
18197    },
18198
18199    _getRelativeOffset: function () {
18200      if (this.cssPosition === "relative") {
18201        var p = this.currentItem.position();
18202        return {
18203          top:
18204            p.top -
18205            (parseInt(this.helper.css("top"), 10) || 0) +
18206            this.scrollParent.scrollTop(),
18207          left:
18208            p.left -
18209            (parseInt(this.helper.css("left"), 10) || 0) +
18210            this.scrollParent.scrollLeft(),
18211        };
18212      } else {
18213        return { top: 0, left: 0 };
18214      }
18215    },
18216
18217    _cacheMargins: function () {
18218      this.margins = {
18219        left: parseInt(this.currentItem.css("marginLeft"), 10) || 0,
18220        top: parseInt(this.currentItem.css("marginTop"), 10) || 0,
18221      };
18222    },
18223
18224    _cacheHelperProportions: function () {
18225      this.helperProportions = {
18226        width: this.helper.outerWidth(),
18227        height: this.helper.outerHeight(),
18228      };
18229    },
18230
18231    _setContainment: function () {
18232      var ce,
vendor: 8,918 bytes, lines 18233-18467
18233        co,
18234        over,
18235        o = this.options;
18236      if (o.containment === "parent") {
18237        o.containment = this.helper[0].parentNode;
18238      }
18239      if (o.containment === "document" || o.containment === "window") {
18240        this.containment = [
18241          0 - this.offset.relative.left - this.offset.parent.left,
18242          0 - this.offset.relative.top - this.offset.parent.top,
18243          o.containment === "document"
18244            ? this.document.width()
18245            : this.window.width() -
18246              this.helperProportions.width -
18247              this.margins.left,
18248          (o.containment === "document"
18249            ? this.document.height() || document.body.parentNode.scrollHeight
18250            : this.window.height() ||
18251              this.document[0].body.parentNode.scrollHeight) -
18252            this.helperProportions.height -
18253            this.margins.top,
18254        ];
18255      }
18256
18257      if (!/^(document|window|parent)$/.test(o.containment)) {
18258        ce = $(o.containment)[0];
18259        co = $(o.containment).offset();
18260        over = $(ce).css("overflow") !== "hidden";
18261
18262        this.containment = [
18263          co.left +
18264            (parseInt($(ce).css("borderLeftWidth"), 10) || 0) +
18265            (parseInt($(ce).css("paddingLeft"), 10) || 0) -
18266            this.margins.left,
18267          co.top +
18268            (parseInt($(ce).css("borderTopWidth"), 10) || 0) +
18269            (parseInt($(ce).css("paddingTop"), 10) || 0) -
18270            this.margins.top,
18271          co.left +
18272            (over ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) -
18273            (parseInt($(ce).css("borderLeftWidth"), 10) || 0) -
18274            (parseInt($(ce).css("paddingRight"), 10) || 0) -
18275            this.helperProportions.width -
18276            this.margins.left,
18277          co.top +
18278            (over
18279              ? Math.max(ce.scrollHeight, ce.offsetHeight)
18280              : ce.offsetHeight) -
18281            (parseInt($(ce).css("borderTopWidth"), 10) || 0) -
18282            (parseInt($(ce).css("paddingBottom"), 10) || 0) -
18283            this.helperProportions.height -
18284            this.margins.top,
18285        ];
18286      }
18287    },
18288
18289    _convertPositionTo: function (d, pos) {
18290      if (!pos) {
18291        pos = this.position;
18292      }
18293      var mod = d === "absolute" ? 1 : -1,
18294        scroll =
18295          this.cssPosition === "absolute" &&
18296          !(
18297            this.scrollParent[0] !== this.document[0] &&
18298            $.contains(this.scrollParent[0], this.offsetParent[0])
18299          )
18300            ? this.offsetParent
18301            : this.scrollParent,
18302        scrollIsRootNode = /(html|body)/i.test(scroll[0].tagName);
18303
18304      return {
18305        top:
18306          // The absolute mouse position
18307          pos.top +
18308          // Only for relative positioned nodes: Relative offset from element to offset parent
18309          this.offset.relative.top * mod +
18310          // The offsetParent's offset without borders (offset + border)
18311          this.offset.parent.top * mod -
18312          (this.cssPosition === "fixed"
18313            ? -this.scrollParent.scrollTop()
18314            : scrollIsRootNode
18315            ? 0
18316            : scroll.scrollTop()) *
18317            mod,
18318        left:
18319          // The absolute mouse position
18320          pos.left +
18321          // Only for relative positioned nodes: Relative offset from element to offset parent
18322          this.offset.relative.left * mod +
18323          // The offsetParent's offset without borders (offset + border)
18324          this.offset.parent.left * mod -
18325          (this.cssPosition === "fixed"
18326            ? -this.scrollParent.scrollLeft()
18327            : scrollIsRootNode
18328            ? 0
18329            : scroll.scrollLeft()) *
18330            mod,
18331      };
18332    },
18333
18334    _generatePosition: function (event) {
18335      var top,
18336        left,
18337        o = this.options,
18338        pageX = event.pageX,
18339        pageY = event.pageY,
18340        scroll =
18341          this.cssPosition === "absolute" &&
18342          !(
18343            this.scrollParent[0] !== this.document[0] &&
18344            $.contains(this.scrollParent[0], this.offsetParent[0])
18345          )
18346            ? this.offsetParent
18347            : this.scrollParent,
18348        scrollIsRootNode = /(html|body)/i.test(scroll[0].tagName);
18349
18350      // This is another very weird special case that only happens for relative elements:
18351      // 1. If the css position is relative
18352      // 2. and the scroll parent is the document or similar to the offset parent
18353      // we have to refresh the relative offset during the scroll so there are no jumps
18354      if (
18355        this.cssPosition === "relative" &&
18356        !(
18357          this.scrollParent[0] !== this.document[0] &&
18358          this.scrollParent[0] !== this.offsetParent[0]
18359        )
18360      ) {
18361        this.offset.relative = this._getRelativeOffset();
18362      }
18363
18364      /*
18365       * - Position constraining -
18366       * Constrain the position to a mix of grid, containment.
18367       */
18368
18369      if (this.originalPosition) {
18370        //If we are not dragging yet, we won't check for options
18371
18372        if (this.containment) {
18373          if (event.pageX - this.offset.click.left < this.containment[0]) {
18374            pageX = this.containment[0] + this.offset.click.left;
18375          }
18376          if (event.pageY - this.offset.click.top < this.containment[1]) {
18377            pageY = this.containment[1] + this.offset.click.top;
18378          }
18379          if (event.pageX - this.offset.click.left > this.containment[2]) {
18380            pageX = this.containment[2] + this.offset.click.left;
18381          }
18382          if (event.pageY - this.offset.click.top > this.containment[3]) {
18383            pageY = this.containment[3] + this.offset.click.top;
18384          }
18385        }
18386
18387        if (o.grid) {
18388          top =
18389            this.originalPageY +
18390            Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
18391          pageY = this.containment
18392            ? top - this.offset.click.top >= this.containment[1] &&
18393              top - this.offset.click.top <= this.containment[3]
18394              ? top
18395              : top - this.offset.click.top >= this.containment[1]
18396              ? top - o.grid[1]
18397              : top + o.grid[1]
18398            : top;
18399
18400          left =
18401            this.originalPageX +
18402            Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
18403          pageX = this.containment
18404            ? left - this.offset.click.left >= this.containment[0] &&
18405              left - this.offset.click.left <= this.containment[2]
18406              ? left
18407              : left - this.offset.click.left >= this.containment[0]
18408              ? left - o.grid[0]
18409              : left + o.grid[0]
18410            : left;
18411        }
18412      }
18413
18414      return {
18415        top:
18416          // The absolute mouse position
18417          pageY -
18418          // Click offset (relative to the element)
18419          this.offset.click.top -
18420          // Only for relative positioned nodes: Relative offset from element to offset parent
18421          this.offset.relative.top -
18422          // The offsetParent's offset without borders (offset + border)
18423          this.offset.parent.top +
18424          (this.cssPosition === "fixed"
18425            ? -this.scrollParent.scrollTop()
18426            : scrollIsRootNode
18427            ? 0
18428            : scroll.scrollTop()),
18429        left:
18430          // The absolute mouse position
18431          pageX -
18432          // Click offset (relative to the element)
18433          this.offset.click.left -
18434          // Only for relative positioned nodes: Relative offset from element to offset parent
18435          this.offset.relative.left -
18436          // The offsetParent's offset without borders (offset + border)
18437          this.offset.parent.left +
18438          (this.cssPosition === "fixed"
18439            ? -this.scrollParent.scrollLeft()
18440            : scrollIsRootNode
18441            ? 0
18442            : scroll.scrollLeft()),
18443      };
18444    },
18445
18446    _rearrange: function (event, i, a, hardRefresh) {
18447      if (a) {
18448        a[0].appendChild(this.placeholder[0]);
18449      } else {
18450        i.item[0].parentNode.insertBefore(
18451          this.placeholder[0],
18452          this.direction === "down" ? i.item[0] : i.item[0].nextSibling
18453        );
18454      }
18455
18456      //Various things done here to improve the performance:
18457      // 1. we create a setTimeout, that calls refreshPositions
18458      // 2. on the instance, we have a counter variable, that get's higher after every append
18459      // 3. on the local scope, we copy the counter variable, and check in the timeout,
18460      // if it's still the same
18461      // 4. this lets only the last addition to the timeout stack through
18462      this.counter = this.counter ? ++this.counter : 1;
18463      var counter = this.counter;
18464
18465      this._delay(function () {
18466        if (counter === this.counter) {
18467          //Precompute after each DOM insertion, NOT on mousemove
vendor: 42,465 bytes, lines 18468-19900
18468          this.refreshPositions(!hardRefresh);
18469        }
18470      });
18471    },
18472
18473    _clear: function (event, noPropagation) {
18474      this.reverting = false;
18475
18476      // We delay all events that have to be triggered to after the point where the placeholder
18477      // has been removed and everything else normalized again
18478      var i,
18479        delayedTriggers = [];
18480
18481      // We first have to update the dom position of the actual currentItem
18482      // Note: don't do it if the current item is already removed (by a user), or it gets
18483      // reappended (see #4088)
18484      if (!this._noFinalSort && this.currentItem.parent().length) {
18485        this.placeholder.before(this.currentItem);
18486      }
18487      this._noFinalSort = null;
18488
18489      if (this.helper[0] === this.currentItem[0]) {
18490        for (i in this._storedCSS) {
18491          if (
18492            this._storedCSS[i] === "auto" ||
18493            this._storedCSS[i] === "static"
18494          ) {
18495            this._storedCSS[i] = "";
18496          }
18497        }
18498        this.currentItem.css(this._storedCSS);
18499        this._removeClass(this.currentItem, "ui-sortable-helper");
18500      } else {
18501        this.currentItem.show();
18502      }
18503
18504      if (this.fromOutside && !noPropagation) {
18505        delayedTriggers.push(function (event) {
18506          this._trigger("receive", event, this._uiHash(this.fromOutside));
18507        });
18508      }
18509      if (
18510        (this.fromOutside ||
18511          this.domPosition.prev !==
18512            this.currentItem.prev().not(".ui-sortable-helper")[0] ||
18513          this.domPosition.parent !== this.currentItem.parent()[0]) &&
18514        !noPropagation
18515      ) {
18516        // Trigger update callback if the DOM position has changed
18517        delayedTriggers.push(function (event) {
18518          this._trigger("update", event, this._uiHash());
18519        });
18520      }
18521
18522      // Check if the items Container has Changed and trigger appropriate
18523      // events.
18524      if (this !== this.currentContainer) {
18525        if (!noPropagation) {
18526          delayedTriggers.push(function (event) {
18527            this._trigger("remove", event, this._uiHash());
18528          });
18529          delayedTriggers.push(
18530            function (c) {
18531              return function (event) {
18532                c._trigger("receive", event, this._uiHash(this));
18533              };
18534            }.call(this, this.currentContainer)
18535          );
18536          delayedTriggers.push(
18537            function (c) {
18538              return function (event) {
18539                c._trigger("update", event, this._uiHash(this));
18540              };
18541            }.call(this, this.currentContainer)
18542          );
18543        }
18544      }
18545
18546      //Post events to containers
18547      function delayEvent(type, instance, container) {
18548        return function (event) {
18549          container._trigger(type, event, instance._uiHash(instance));
18550        };
18551      }
18552      for (i = this.containers.length - 1; i >= 0; i--) {
18553        if (!noPropagation) {
18554          delayedTriggers.push(
18555            delayEvent("deactivate", this, this.containers[i])
18556          );
18557        }
18558        if (this.containers[i].containerCache.over) {
18559          delayedTriggers.push(delayEvent("out", this, this.containers[i]));
18560          this.containers[i].containerCache.over = 0;
18561        }
18562      }
18563
18564      //Do what was originally in plugins
18565      if (this.storedCursor) {
18566        this.document.find("body").css("cursor", this.storedCursor);
18567        this.storedStylesheet.remove();
18568      }
18569      if (this._storedOpacity) {
18570        this.helper.css("opacity", this._storedOpacity);
18571      }
18572      if (this._storedZIndex) {
18573        this.helper.css(
18574          "zIndex",
18575          this._storedZIndex === "auto" ? "" : this._storedZIndex
18576        );
18577      }
18578
18579      this.dragging = false;
18580
18581      if (!noPropagation) {
18582        this._trigger("beforeStop", event, this._uiHash());
18583      }
18584
18585      //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
18586      // it unbinds ALL events from the original node!
18587      this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
18588
18589      if (!this.cancelHelperRemoval) {
18590        if (this.helper[0] !== this.currentItem[0]) {
18591          this.helper.remove();
18592        }
18593        this.helper = null;
18594      }
18595
18596      if (!noPropagation) {
18597        for (i = 0; i < delayedTriggers.length; i++) {
18598          // Trigger all delayed events
18599          delayedTriggers[i].call(this, event);
18600        }
18601        this._trigger("stop", event, this._uiHash());
18602      }
18603
18604      this.fromOutside = false;
18605      return !this.cancelHelperRemoval;
18606    },
18607
18608    _trigger: function () {
18609      if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
18610        this.cancel();
18611      }
18612    },
18613
18614    _uiHash: function (_inst) {
18615      var inst = _inst || this;
18616      return {
18617        helper: inst.helper,
18618        placeholder: inst.placeholder || $([]),
18619        position: inst.position,
18620        originalPosition: inst.originalPosition,
18621        offset: inst.positionAbs,
18622        item: inst.currentItem,
18623        sender: _inst ? _inst.element : null,
18624      };
18625    },
18626  });
18627
18628  /*!
18629   * jQuery UI Spinner 1.13.2
18630   * http://jqueryui.com
18631   *
18632   * Copyright jQuery Foundation and other contributors
18633   * Released under the MIT license.
18634   * http://jquery.org/license
18635   */
18636
18637  //>>label: Spinner
18638  //>>group: Widgets
18639  //>>description: Displays buttons to easily input numbers via the keyboard or mouse.
18640  //>>docs: http://api.jqueryui.com/spinner/
18641  //>>demos: http://jqueryui.com/spinner/
18642  //>>css.structure: ../../themes/base/core.css
18643  //>>css.structure: ../../themes/base/spinner.css
18644  //>>css.theme: ../../themes/base/theme.css
18645
18646  function spinnerModifier(fn) {
18647    return function () {
18648      var previous = this.element.val();
18649      fn.apply(this, arguments);
18650      this._refresh();
18651      if (previous !== this.element.val()) {
18652        this._trigger("change");
18653      }
18654    };
18655  }
18656
18657  $.widget("ui.spinner", {
18658    version: "1.13.2",
18659    defaultElement: "<input>",
18660    widgetEventPrefix: "spin",
18661    options: {
18662      classes: {
18663        "ui-spinner": "ui-corner-all",
18664        "ui-spinner-down": "ui-corner-br",
18665        "ui-spinner-up": "ui-corner-tr",
18666      },
18667      culture: null,
18668      icons: {
18669        down: "ui-icon-triangle-1-s",
18670        up: "ui-icon-triangle-1-n",
18671      },
18672      incremental: true,
18673      max: null,
18674      min: null,
18675      numberFormat: null,
18676      page: 10,
18677      step: 1,
18678
18679      change: null,
18680      spin: null,
18681      start: null,
18682      stop: null,
18683    },
18684
18685    _create: function () {
18686      // handle string values that need to be parsed
18687      this._setOption("max", this.options.max);
18688      this._setOption("min", this.options.min);
18689      this._setOption("step", this.options.step);
18690
18691      // Only format if there is a value, prevents the field from being marked
18692      // as invalid in Firefox, see #9573.
18693      if (this.value() !== "") {
18694        // Format the value, but don't constrain.
18695        this._value(this.element.val(), true);
18696      }
18697
18698      this._draw();
18699      this._on(this._events);
18700      this._refresh();
18701
18702      // Turning off autocomplete prevents the browser from remembering the
18703      // value when navigating through history, so we re-enable autocomplete
18704      // if the page is unloaded before the widget is destroyed. #7790
18705      this._on(this.window, {
18706        beforeunload: function () {
18707          this.element.removeAttr("autocomplete");
18708        },
18709      });
18710    },
18711
18712    _getCreateOptions: function () {
18713      var options = this._super();
18714      var element = this.element;
18715
18716      $.each(["min", "max", "step"], function (i, option) {
18717        var value = element.attr(option);
18718        if (value != null && value.length) {
18719          options[option] = value;
18720        }
18721      });
18722
18723      return options;
18724    },
18725
18726    _events: {
18727      keydown: function (event) {
18728        if (this._start(event) && this._keydown(event)) {
18729          event.preventDefault();
18730        }
18731      },
18732      keyup: "_stop",
18733      focus: function () {
18734        this.previous = this.element.val();
18735      },
18736      blur: function (event) {
18737        if (this.cancelBlur) {
18738          delete this.cancelBlur;
18739          return;
18740        }
18741
18742        this._stop();
18743        this._refresh();
18744        if (this.previous !== this.element.val()) {
18745          this._trigger("change", event);
18746        }
18747      },
18748      mousewheel: function (event, delta) {
18749        var activeElement = $.ui.safeActiveElement(this.document[0]);
18750        var isActive = this.element[0] === activeElement;
18751
18752        if (!isActive || !delta) {
18753          return;
18754        }
18755
18756        if (!this.spinning && !this._start(event)) {
18757          return false;
18758        }
18759
18760        this._spin((delta > 0 ? 1 : -1) * this.options.step, event);
18761        clearTimeout(this.mousewheelTimer);
18762        this.mousewheelTimer = this._delay(function () {
18763          if (this.spinning) {
18764            this._stop(event);
18765          }
18766        }, 100);
18767        event.preventDefault();
18768      },
18769      "mousedown .ui-spinner-button": function (event) {
18770        var previous;
18771
18772        // We never want the buttons to have focus; whenever the user is
18773        // interacting with the spinner, the focus should be on the input.
18774        // If the input is focused then this.previous is properly set from
18775        // when the input first received focus. If the input is not focused
18776        // then we need to set this.previous based on the value before spinning.
18777        previous =
18778          this.element[0] === $.ui.safeActiveElement(this.document[0])
18779            ? this.previous
18780            : this.element.val();
18781        function checkFocus() {
18782          var isActive =
18783            this.element[0] === $.ui.safeActiveElement(this.document[0]);
18784          if (!isActive) {
18785            this.element.trigger("focus");
18786            this.previous = previous;
18787
18788            // support: IE
18789            // IE sets focus asynchronously, so we need to check if focus
18790            // moved off of the input because the user clicked on the button.
18791            this._delay(function () {
18792              this.previous = previous;
18793            });
18794          }
18795        }
18796
18797        // Ensure focus is on (or stays on) the text field
18798        event.preventDefault();
18799        checkFocus.call(this);
18800
18801        // Support: IE
18802        // IE doesn't prevent moving focus even with event.preventDefault()
18803        // so we set a flag to know when we should ignore the blur event
18804        // and check (again) if focus moved off of the input.
18805        this.cancelBlur = true;
18806        this._delay(function () {
18807          delete this.cancelBlur;
18808          checkFocus.call(this);
18809        });
18810
18811        if (this._start(event) === false) {
18812          return;
18813        }
18814
18815        this._repeat(
18816          null,
18817          $(event.currentTarget).hasClass("ui-spinner-up") ? 1 : -1,
18818          event
18819        );
18820      },
18821      "mouseup .ui-spinner-button": "_stop",
18822      "mouseenter .ui-spinner-button": function (event) {
18823        // button will add ui-state-active if mouse was down while mouseleave and kept down
18824        if (!$(event.currentTarget).hasClass("ui-state-active")) {
18825          return;
18826        }
18827
18828        if (this._start(event) === false) {
18829          return false;
18830        }
18831        this._repeat(
18832          null,
18833          $(event.currentTarget).hasClass("ui-spinner-up") ? 1 : -1,
18834          event
18835        );
18836      },
18837
18838      // TODO: do we really want to consider this a stop?
18839      // shouldn't we just stop the repeater and wait until mouseup before
18840      // we trigger the stop event?
18841      "mouseleave .ui-spinner-button": "_stop",
18842    },
18843
18844    // Support mobile enhanced option and make backcompat more sane
18845    _enhance: function () {
18846      this.uiSpinner = this.element
18847        .attr("autocomplete", "off")
18848        .wrap("<span>")
18849        .parent()
18850
18851        // Add buttons
18852        .append("<a></a><a></a>");
18853    },
18854
18855    _draw: function () {
18856      this._enhance();
18857
18858      this._addClass(
18859        this.uiSpinner,
18860        "ui-spinner",
18861        "ui-widget ui-widget-content"
18862      );
18863      this._addClass("ui-spinner-input");
18864
18865      this.element.attr("role", "spinbutton");
18866
18867      // Button bindings
18868      this.buttons = this.uiSpinner
18869        .children("a")
18870        .attr("tabIndex", -1)
18871        .attr("aria-hidden", true)
18872        .button({
18873          classes: {
18874            "ui-button": "",
18875          },
18876        });
18877
18878      // TODO: Right now button does not support classes this is already updated in button PR
18879      this._removeClass(this.buttons, "ui-corner-all");
18880
18881      this._addClass(this.buttons.first(), "ui-spinner-button ui-spinner-up");
18882      this._addClass(this.buttons.last(), "ui-spinner-button ui-spinner-down");
18883      this.buttons.first().button({
18884        icon: this.options.icons.up,
18885        showLabel: false,
18886      });
18887      this.buttons.last().button({
18888        icon: this.options.icons.down,
18889        showLabel: false,
18890      });
18891
18892      // IE 6 doesn't understand height: 50% for the buttons
18893      // unless the wrapper has an explicit height
18894      if (
18895        this.buttons.height() > Math.ceil(this.uiSpinner.height() * 0.5) &&
18896        this.uiSpinner.height() > 0
18897      ) {
18898        this.uiSpinner.height(this.uiSpinner.height());
18899      }
18900    },
18901
18902    _keydown: function (event) {
18903      var options = this.options,
18904        keyCode = $.ui.keyCode;
18905
18906      switch (event.keyCode) {
18907        case keyCode.UP:
18908          this._repeat(null, 1, event);
18909          return true;
18910        case keyCode.DOWN:
18911          this._repeat(null, -1, event);
18912          return true;
18913        case keyCode.PAGE_UP:
18914          this._repeat(null, options.page, event);
18915          return true;
18916        case keyCode.PAGE_DOWN:
18917          this._repeat(null, -options.page, event);
18918          return true;
18919      }
18920
18921      return false;
18922    },
18923
18924    _start: function (event) {
18925      if (!this.spinning && this._trigger("start", event) === false) {
18926        return false;
18927      }
18928
18929      if (!this.counter) {
18930        this.counter = 1;
18931      }
18932      this.spinning = true;
18933      return true;
18934    },
18935
18936    _repeat: function (i, steps, event) {
18937      i = i || 500;
18938
18939      clearTimeout(this.timer);
18940      this.timer = this._delay(function () {
18941        this._repeat(40, steps, event);
18942      }, i);
18943
18944      this._spin(steps * this.options.step, event);
18945    },
18946
18947    _spin: function (step, event) {
18948      var value = this.value() || 0;
18949
18950      if (!this.counter) {
18951        this.counter = 1;
18952      }
18953
18954      value = this._adjustValue(value + step * this._increment(this.counter));
18955
18956      if (
18957        !this.spinning ||
18958        this._trigger("spin", event, { value: value }) !== false
18959      ) {
18960        this._value(value);
18961        this.counter++;
18962      }
18963    },
18964
18965    _increment: function (i) {
18966      var incremental = this.options.incremental;
18967
18968      if (incremental) {
18969        return typeof incremental === "function"
18970          ? incremental(i)
18971          : Math.floor(
18972              (i * i * i) / 50000 - (i * i) / 500 + (17 * i) / 200 + 1
18973            );
18974      }
18975
18976      return 1;
18977    },
18978
18979    _precision: function () {
18980      var precision = this._precisionOf(this.options.step);
18981      if (this.options.min !== null) {
18982        precision = Math.max(precision, this._precisionOf(this.options.min));
18983      }
18984      return precision;
18985    },
18986
18987    _precisionOf: function (num) {
18988      var str = num.toString(),
18989        decimal = str.indexOf(".");
18990      return decimal === -1 ? 0 : str.length - decimal - 1;
18991    },
18992
18993    _adjustValue: function (value) {
18994      var base,
18995        aboveMin,
18996        options = this.options;
18997
18998      // Make sure we're at a valid step
18999      // - find out where we are relative to the base (min or 0)
19000      base = options.min !== null ? options.min : 0;
19001      aboveMin = value - base;
19002
19003      // - round to the nearest step
19004      aboveMin = Math.round(aboveMin / options.step) * options.step;
19005
19006      // - rounding is based on 0, so adjust back to our base
19007      value = base + aboveMin;
19008
19009      // Fix precision from bad JS floating point math
19010      value = parseFloat(value.toFixed(this._precision()));
19011
19012      // Clamp the value
19013      if (options.max !== null && value > options.max) {
19014        return options.max;
19015      }
19016      if (options.min !== null && value < options.min) {
19017        return options.min;
19018      }
19019
19020      return value;
19021    },
19022
19023    _stop: function (event) {
19024      if (!this.spinning) {
19025        return;
19026      }
19027
19028      clearTimeout(this.timer);
19029      clearTimeout(this.mousewheelTimer);
19030      this.counter = 0;
19031      this.spinning = false;
19032      this._trigger("stop", event);
19033    },
19034
19035    _setOption: function (key, value) {
19036      var prevValue, first, last;
19037
19038      if (key === "culture" || key === "numberFormat") {
19039        prevValue = this._parse(this.element.val());
19040        this.options[key] = value;
19041        this.element.val(this._format(prevValue));
19042        return;
19043      }
19044
19045      if (key === "max" || key === "min" || key === "step") {
19046        if (typeof value === "string") {
19047          value = this._parse(value);
19048        }
19049      }
19050      if (key === "icons") {
19051        first = this.buttons.first().find(".ui-icon");
19052        this._removeClass(first, null, this.options.icons.up);
19053        this._addClass(first, null, value.up);
19054        last = this.buttons.last().find(".ui-icon");
19055        this._removeClass(last, null, this.options.icons.down);
19056        this._addClass(last, null, value.down);
19057      }
19058
19059      this._super(key, value);
19060    },
19061
19062    _setOptionDisabled: function (value) {
19063      this._super(value);
19064
19065      this._toggleClass(this.uiSpinner, null, "ui-state-disabled", !!value);
19066      this.element.prop("disabled", !!value);
19067      this.buttons.button(value ? "disable" : "enable");
19068    },
19069
19070    _setOptions: spinnerModifier(function (options) {
19071      this._super(options);
19072    }),
19073
19074    _parse: function (val) {
19075      if (typeof val === "string" && val !== "") {
19076        val =
19077          window.Globalize && this.options.numberFormat
19078            ? Globalize.parseFloat(val, 10, this.options.culture)
19079            : +val;
19080      }
19081      return val === "" || isNaN(val) ? null : val;
19082    },
19083
19084    _format: function (value) {
19085      if (value === "") {
19086        return "";
19087      }
19088      return window.Globalize && this.options.numberFormat
19089        ? Globalize.format(
19090            value,
19091            this.options.numberFormat,
19092            this.options.culture
19093          )
19094        : value;
19095    },
19096
19097    _refresh: function () {
19098      this.element.attr({
19099        "aria-valuemin": this.options.min,
19100        "aria-valuemax": this.options.max,
19101
19102        // TODO: what should we do with values that can't be parsed?
19103        "aria-valuenow": this._parse(this.element.val()),
19104      });
19105    },
19106
19107    isValid: function () {
19108      var value = this.value();
19109
19110      // Null is invalid
19111      if (value === null) {
19112        return false;
19113      }
19114
19115      // If value gets adjusted, it's invalid
19116      return value === this._adjustValue(value);
19117    },
19118
19119    // Update the value without triggering change
19120    _value: function (value, allowAny) {
19121      var parsed;
19122      if (value !== "") {
19123        parsed = this._parse(value);
19124        if (parsed !== null) {
19125          if (!allowAny) {
19126            parsed = this._adjustValue(parsed);
19127          }
19128          value = this._format(parsed);
19129        }
19130      }
19131      this.element.val(value);
19132      this._refresh();
19133    },
19134
19135    _destroy: function () {
19136      this.element
19137        .prop("disabled", false)
19138        .removeAttr(
19139          "autocomplete role aria-valuemin aria-valuemax aria-valuenow"
19140        );
19141
19142      this.uiSpinner.replaceWith(this.element);
19143    },
19144
19145    stepUp: spinnerModifier(function (steps) {
19146      this._stepUp(steps);
19147    }),
19148    _stepUp: function (steps) {
19149      if (this._start()) {
19150        this._spin((steps || 1) * this.options.step);
19151        this._stop();
19152      }
19153    },
19154
19155    stepDown: spinnerModifier(function (steps) {
19156      this._stepDown(steps);
19157    }),
19158    _stepDown: function (steps) {
19159      if (this._start()) {
19160        this._spin((steps || 1) * -this.options.step);
19161        this._stop();
19162      }
19163    },
19164
19165    pageUp: spinnerModifier(function (pages) {
19166      this._stepUp((pages || 1) * this.options.page);
19167    }),
19168
19169    pageDown: spinnerModifier(function (pages) {
19170      this._stepDown((pages || 1) * this.options.page);
19171    }),
19172
19173    value: function (newVal) {
19174      if (!arguments.length) {
19175        return this._parse(this.element.val());
19176      }
19177      spinnerModifier(this._value).call(this, newVal);
19178    },
19179
19180    widget: function () {
19181      return this.uiSpinner;
19182    },
19183  });
19184
19185  // DEPRECATED
19186  // TODO: switch return back to widget declaration at top of file when this is removed
19187  if ($.uiBackCompat !== false) {
19188    // Backcompat for spinner html extension points
19189    $.widget("ui.spinner", $.ui.spinner, {
19190      _enhance: function () {
19191        this.uiSpinner = this.element
19192          .attr("autocomplete", "off")
19193          .wrap(this._uiSpinnerHtml())
19194          .parent()
19195
19196          // Add buttons
19197          .append(this._buttonHtml());
19198      },
19199      _uiSpinnerHtml: function () {
19200        return "<span>";
19201      },
19202
19203      _buttonHtml: function () {
19204        return "<a></a><a></a>";
19205      },
19206    });
19207  }
19208
19209  var widgetsSpinner = $.ui.spinner;
19210
19211  /*!
19212   * jQuery UI Tabs 1.13.2
19213   * http://jqueryui.com
19214   *
19215   * Copyright jQuery Foundation and other contributors
19216   * Released under the MIT license.
19217   * http://jquery.org/license
19218   */
19219
19220  //>>label: Tabs
19221  //>>group: Widgets
19222  //>>description: Transforms a set of container elements into a tab structure.
19223  //>>docs: http://api.jqueryui.com/tabs/
19224  //>>demos: http://jqueryui.com/tabs/
19225  //>>css.structure: ../../themes/base/core.css
19226  //>>css.structure: ../../themes/base/tabs.css
19227  //>>css.theme: ../../themes/base/theme.css
19228
19229  $.widget("ui.tabs", {
19230    version: "1.13.2",
19231    delay: 300,
19232    options: {
19233      active: null,
19234      classes: {
19235        "ui-tabs": "ui-corner-all",
19236        "ui-tabs-nav": "ui-corner-all",
19237        "ui-tabs-panel": "ui-corner-bottom",
19238        "ui-tabs-tab": "ui-corner-top",
19239      },
19240      collapsible: false,
19241      event: "click",
19242      heightStyle: "content",
19243      hide: null,
19244      show: null,
19245
19246      // Callbacks
19247      activate: null,
19248      beforeActivate: null,
19249      beforeLoad: null,
19250      load: null,
19251    },
19252
19253    _isLocal: (function () {
19254      var rhash = /#.*$/;
19255
19256      return function (anchor) {
19257        var anchorUrl, locationUrl;
19258
19259        anchorUrl = anchor.href.replace(rhash, "");
19260        locationUrl = location.href.replace(rhash, "");
19261
19262        // Decoding may throw an error if the URL isn't UTF-8 (#9518)
19263        try {
19264          anchorUrl = decodeURIComponent(anchorUrl);
19265        } catch (error) {}
19266        try {
19267          locationUrl = decodeURIComponent(locationUrl);
19268        } catch (error) {}
19269
19270        return anchor.hash.length > 1 && anchorUrl === locationUrl;
19271      };
19272    })(),
19273
19274    _create: function () {
19275      var that = this,
19276        options = this.options;
19277
19278      this.running = false;
19279
19280      this._addClass("ui-tabs", "ui-widget ui-widget-content");
19281      this._toggleClass("ui-tabs-collapsible", null, options.collapsible);
19282
19283      this._processTabs();
19284      options.active = this._initialActive();
19285
19286      // Take disabling tabs via class attribute from HTML
19287      // into account and update option properly.
19288      if (Array.isArray(options.disabled)) {
19289        options.disabled = $.uniqueSort(
19290          options.disabled.concat(
19291            $.map(this.tabs.filter(".ui-state-disabled"), function (li) {
19292              return that.tabs.index(li);
19293            })
19294          )
19295        ).sort();
19296      }
19297
19298      // Check for length avoids error when initializing empty list
19299      if (this.options.active !== false && this.anchors.length) {
19300        this.active = this._findActive(options.active);
19301      } else {
19302        this.active = $();
19303      }
19304
19305      this._refresh();
19306
19307      if (this.active.length) {
19308        this.load(options.active);
19309      }
19310    },
19311
19312    _initialActive: function () {
19313      var active = this.options.active,
19314        collapsible = this.options.collapsible,
19315        locationHash = location.hash.substring(1);
19316
19317      if (active === null) {
19318        // check the fragment identifier in the URL
19319        if (locationHash) {
19320          this.tabs.each(function (i, tab) {
19321            if ($(tab).attr("aria-controls") === locationHash) {
19322              active = i;
19323              return false;
19324            }
19325          });
19326        }
19327
19328        // Check for a tab marked active via a class
19329        if (active === null) {
19330          active = this.tabs.index(this.tabs.filter(".ui-tabs-active"));
19331        }
19332
19333        // No active tab, set to false
19334        if (active === null || active === -1) {
19335          active = this.tabs.length ? 0 : false;
19336        }
19337      }
19338
19339      // Handle numbers: negative, out of range
19340      if (active !== false) {
19341        active = this.tabs.index(this.tabs.eq(active));
19342        if (active === -1) {
19343          active = collapsible ? false : 0;
19344        }
19345      }
19346
19347      // Don't allow collapsible: false and active: false
19348      if (!collapsible && active === false && this.anchors.length) {
19349        active = 0;
19350      }
19351
19352      return active;
19353    },
19354
19355    _getCreateEventData: function () {
19356      return {
19357        tab: this.active,
19358        panel: !this.active.length ? $() : this._getPanelForTab(this.active),
19359      };
19360    },
19361
19362    _tabKeydown: function (event) {
19363      var focusedTab = $($.ui.safeActiveElement(this.document[0])).closest(
19364          "li"
19365        ),
19366        selectedIndex = this.tabs.index(focusedTab),
19367        goingForward = true;
19368
19369      if (this._handlePageNav(event)) {
19370        return;
19371      }
19372
19373      switch (event.keyCode) {
19374        case $.ui.keyCode.RIGHT:
19375        case $.ui.keyCode.DOWN:
19376          selectedIndex++;
19377          break;
19378        case $.ui.keyCode.UP:
19379        case $.ui.keyCode.LEFT:
19380          goingForward = false;
19381          selectedIndex--;
19382          break;
19383        case $.ui.keyCode.END:
19384          selectedIndex = this.anchors.length - 1;
19385          break;
19386        case $.ui.keyCode.HOME:
19387          selectedIndex = 0;
19388          break;
19389        case $.ui.keyCode.SPACE:
19390          // Activate only, no collapsing
19391          event.preventDefault();
19392          clearTimeout(this.activating);
19393          this._activate(selectedIndex);
19394          return;
19395        case $.ui.keyCode.ENTER:
19396          // Toggle (cancel delayed activation, allow collapsing)
19397          event.preventDefault();
19398          clearTimeout(this.activating);
19399
19400          // Determine if we should collapse or activate
19401          this._activate(
19402            selectedIndex === this.options.active ? false : selectedIndex
19403          );
19404          return;
19405        default:
19406          return;
19407      }
19408
19409      // Focus the appropriate tab, based on which key was pressed
19410      event.preventDefault();
19411      clearTimeout(this.activating);
19412      selectedIndex = this._focusNextTab(selectedIndex, goingForward);
19413
19414      // Navigating with control/command key will prevent automatic activation
19415      if (!event.ctrlKey && !event.metaKey) {
19416        // Update aria-selected immediately so that AT think the tab is already selected.
19417        // Otherwise AT may confuse the user by stating that they need to activate the tab,
19418        // but the tab will already be activated by the time the announcement finishes.
19419        focusedTab.attr("aria-selected", "false");
19420        this.tabs.eq(selectedIndex).attr("aria-selected", "true");
19421
19422        this.activating = this._delay(function () {
19423          this.option("active", selectedIndex);
19424        }, this.delay);
19425      }
19426    },
19427
19428    _panelKeydown: function (event) {
19429      if (this._handlePageNav(event)) {
19430        return;
19431      }
19432
19433      // Ctrl+up moves focus to the current tab
19434      if (event.ctrlKey && event.keyCode === $.ui.keyCode.UP) {
19435        event.preventDefault();
19436        this.active.trigger("focus");
19437      }
19438    },
19439
19440    // Alt+page up/down moves focus to the previous/next tab (and activates)
19441    _handlePageNav: function (event) {
19442      if (event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP) {
19443        this._activate(this._focusNextTab(this.options.active - 1, false));
19444        return true;
19445      }
19446      if (event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN) {
19447        this._activate(this._focusNextTab(this.options.active + 1, true));
19448        return true;
19449      }
19450    },
19451
19452    _findNextTab: function (index, goingForward) {
19453      var lastTabIndex = this.tabs.length - 1;
19454
19455      function constrain() {
19456        if (index > lastTabIndex) {
19457          index = 0;
19458        }
19459        if (index < 0) {
19460          index = lastTabIndex;
19461        }
19462        return index;
19463      }
19464
19465      while ($.inArray(constrain(), this.options.disabled) !== -1) {
19466        index = goingForward ? index + 1 : index - 1;
19467      }
19468
19469      return index;
19470    },
19471
19472    _focusNextTab: function (index, goingForward) {
19473      index = this._findNextTab(index, goingForward);
19474      this.tabs.eq(index).trigger("focus");
19475      return index;
19476    },
19477
19478    _setOption: function (key, value) {
19479      if (key === "active") {
19480        // _activate() will handle invalid values and update this.options
19481        this._activate(value);
19482        return;
19483      }
19484
19485      this._super(key, value);
19486
19487      if (key === "collapsible") {
19488        this._toggleClass("ui-tabs-collapsible", null, value);
19489
19490        // Setting collapsible: false while collapsed; open first panel
19491        if (!value && this.options.active === false) {
19492          this._activate(0);
19493        }
19494      }
19495
19496      if (key === "event") {
19497        this._setupEvents(value);
19498      }
19499
19500      if (key === "heightStyle") {
19501        this._setupHeightStyle(value);
19502      }
19503    },
19504
19505    _sanitizeSelector: function (hash) {
19506      return hash
19507        ? hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&")
19508        : "";
19509    },
19510
19511    refresh: function () {
19512      var options = this.options,
19513        lis = this.tablist.children(":has(a[href])");
19514
19515      // Get disabled tabs from class attribute from HTML
19516      // this will get converted to a boolean if needed in _refresh()
19517      options.disabled = $.map(
19518        lis.filter(".ui-state-disabled"),
19519        function (tab) {
19520          return lis.index(tab);
19521        }
19522      );
19523
19524      this._processTabs();
19525
19526      // Was collapsed or no tabs
19527      if (options.active === false || !this.anchors.length) {
19528        options.active = false;
19529        this.active = $();
19530
19531        // was active, but active tab is gone
19532      } else if (
19533        this.active.length &&
19534        !$.contains(this.tablist[0], this.active[0])
19535      ) {
19536        // all remaining tabs are disabled
19537        if (this.tabs.length === options.disabled.length) {
19538          options.active = false;
19539          this.active = $();
19540
19541          // activate previous tab
19542        } else {
19543          this._activate(
19544            this._findNextTab(Math.max(0, options.active - 1), false)
19545          );
19546        }
19547
19548        // was active, active tab still exists
19549      } else {
19550        // make sure active index is correct
19551        options.active = this.tabs.index(this.active);
19552      }
19553
19554      this._refresh();
19555    },
19556
19557    _refresh: function () {
19558      this._setOptionDisabled(this.options.disabled);
19559      this._setupEvents(this.options.event);
19560      this._setupHeightStyle(this.options.heightStyle);
19561
19562      this.tabs.not(this.active).attr({
19563        "aria-selected": "false",
19564        "aria-expanded": "false",
19565        tabIndex: -1,
19566      });
19567      this.panels.not(this._getPanelForTab(this.active)).hide().attr({
19568        "aria-hidden": "true",
19569      });
19570
19571      // Make sure one tab is in the tab order
19572      if (!this.active.length) {
19573        this.tabs.eq(0).attr("tabIndex", 0);
19574      } else {
19575        this.active.attr({
19576          "aria-selected": "true",
19577          "aria-expanded": "true",
19578          tabIndex: 0,
19579        });
19580        this._addClass(this.active, "ui-tabs-active", "ui-state-active");
19581        this._getPanelForTab(this.active).show().attr({
19582          "aria-hidden": "false",
19583        });
19584      }
19585    },
19586
19587    _processTabs: function () {
19588      var that = this,
19589        prevTabs = this.tabs,
19590        prevAnchors = this.anchors,
19591        prevPanels = this.panels;
19592
19593      this.tablist = this._getList().attr("role", "tablist");
19594      this._addClass(
19595        this.tablist,
19596        "ui-tabs-nav",
19597        "ui-helper-reset ui-helper-clearfix ui-widget-header"
19598      );
19599
19600      // Prevent users from focusing disabled tabs via click
19601      this.tablist
19602        .on("mousedown" + this.eventNamespace, "> li", function (event) {
19603          if ($(this).is(".ui-state-disabled")) {
19604            event.preventDefault();
19605          }
19606        })
19607
19608        // Support: IE <9
19609        // Preventing the default action in mousedown doesn't prevent IE
19610        // from focusing the element, so if the anchor gets focused, blur.
19611        // We don't have to worry about focusing the previously focused
19612        // element since clicking on a non-focusable element should focus
19613        // the body anyway.
19614        .on("focus" + this.eventNamespace, ".ui-tabs-anchor", function () {
19615          if ($(this).closest("li").is(".ui-state-disabled")) {
19616            this.blur();
19617          }
19618        });
19619
19620      this.tabs = this.tablist.find("> li:has(a[href])").attr({
19621        role: "tab",
19622        tabIndex: -1,
19623      });
19624      this._addClass(this.tabs, "ui-tabs-tab", "ui-state-default");
19625
19626      this.anchors = this.tabs
19627        .map(function () {
19628          return $("a", this)[0];
19629        })
19630        .attr({
19631          tabIndex: -1,
19632        });
19633      this._addClass(this.anchors, "ui-tabs-anchor");
19634
19635      this.panels = $();
19636
19637      this.anchors.each(function (i, anchor) {
19638        var selector,
19639          panel,
19640          panelId,
19641          anchorId = $(anchor).uniqueId().attr("id"),
19642          tab = $(anchor).closest("li"),
19643          originalAriaControls = tab.attr("aria-controls");
19644
19645        // Inline tab
19646        if (that._isLocal(anchor)) {
19647          selector = anchor.hash;
19648          panelId = selector.substring(1);
19649          panel = that.element.find(that._sanitizeSelector(selector));
19650
19651          // remote tab
19652        } else {
19653          // If the tab doesn't already have aria-controls,
19654          // generate an id by using a throw-away element
19655          panelId = tab.attr("aria-controls") || $({}).uniqueId()[0].id;
19656          selector = "#" + panelId;
19657          panel = that.element.find(selector);
19658          if (!panel.length) {
19659            panel = that._createPanel(panelId);
19660            panel.insertAfter(that.panels[i - 1] || that.tablist);
19661          }
19662          panel.attr("aria-live", "polite");
19663        }
19664
19665        if (panel.length) {
19666          that.panels = that.panels.add(panel);
19667        }
19668        if (originalAriaControls) {
19669          tab.data("ui-tabs-aria-controls", originalAriaControls);
19670        }
19671        tab.attr({
19672          "aria-controls": panelId,
19673          "aria-labelledby": anchorId,
19674        });
19675        panel.attr("aria-labelledby", anchorId);
19676      });
19677
19678      this.panels.attr("role", "tabpanel");
19679      this._addClass(this.panels, "ui-tabs-panel", "ui-widget-content");
19680
19681      // Avoid memory leaks (#10056)
19682      if (prevTabs) {
19683        this._off(prevTabs.not(this.tabs));
19684        this._off(prevAnchors.not(this.anchors));
19685        this._off(prevPanels.not(this.panels));
19686      }
19687    },
19688
19689    // Allow overriding how to find the list for rare usage scenarios (#7715)
19690    _getList: function () {
19691      return this.tablist || this.element.find("ol, ul").eq(0);
19692    },
19693
19694    _createPanel: function (id) {
19695      return $("<div>").attr("id", id).data("ui-tabs-destroy", true);
19696    },
19697
19698    _setOptionDisabled: function (disabled) {
19699      var currentItem, li, i;
19700
19701      if (Array.isArray(disabled)) {
19702        if (!disabled.length) {
19703          disabled = false;
19704        } else if (disabled.length === this.anchors.length) {
19705          disabled = true;
19706        }
19707      }
19708
19709      // Disable tabs
19710      for (i = 0; (li = this.tabs[i]); i++) {
19711        currentItem = $(li);
19712        if (disabled === true || $.inArray(i, disabled) !== -1) {
19713          currentItem.attr("aria-disabled", "true");
19714          this._addClass(currentItem, null, "ui-state-disabled");
19715        } else {
19716          currentItem.removeAttr("aria-disabled");
19717          this._removeClass(currentItem, null, "ui-state-disabled");
19718        }
19719      }
19720
19721      this.options.disabled = disabled;
19722
19723      this._toggleClass(
19724        this.widget(),
19725        this.widgetFullName + "-disabled",
19726        null,
19727        disabled === true
19728      );
19729    },
19730
19731    _setupEvents: function (event) {
19732      var events = {};
19733      if (event) {
19734        $.each(event.split(" "), function (index, eventName) {
19735          events[eventName] = "_eventHandler";
19736        });
19737      }
19738
19739      this._off(this.anchors.add(this.tabs).add(this.panels));
19740
19741      // Always prevent the default action, even when disabled
19742      this._on(true, this.anchors, {
19743        click: function (event) {
19744          event.preventDefault();
19745        },
19746      });
19747      this._on(this.anchors, events);
19748      this._on(this.tabs, { keydown: "_tabKeydown" });
19749      this._on(this.panels, { keydown: "_panelKeydown" });
19750
19751      this._focusable(this.tabs);
19752      this._hoverable(this.tabs);
19753    },
19754
19755    _setupHeightStyle: function (heightStyle) {
19756      var maxHeight,
19757        parent = this.element.parent();
19758
19759      if (heightStyle === "fill") {
19760        maxHeight = parent.height();
19761        maxHeight -= this.element.outerHeight() - this.element.height();
19762
19763        this.element.siblings(":visible").each(function () {
19764          var elem = $(this),
19765            position = elem.css("position");
19766
19767          if (position === "absolute" || position === "fixed") {
19768            return;
19769          }
19770          maxHeight -= elem.outerHeight(true);
19771        });
19772
19773        this.element
19774          .children()
19775          .not(this.panels)
19776          .each(function () {
19777            maxHeight -= $(this).outerHeight(true);
19778          });
19779
19780        this.panels
19781          .each(function () {
19782            $(this).height(
19783              Math.max(0, maxHeight - $(this).innerHeight() + $(this).height())
19784            );
19785          })
19786          .css("overflow", "auto");
19787      } else if (heightStyle === "auto") {
19788        maxHeight = 0;
19789        this.panels
19790          .each(function () {
19791            maxHeight = Math.max(maxHeight, $(this).height("").height());
19792          })
19793          .height(maxHeight);
19794      }
19795    },
19796
19797    _eventHandler: function (event) {
19798      var options = this.options,
19799        active = this.active,
19800        anchor = $(event.currentTarget),
19801        tab = anchor.closest("li"),
19802        clickedIsActive = tab[0] === active[0],
19803        collapsing = clickedIsActive && options.collapsible,
19804        toShow = collapsing ? $() : this._getPanelForTab(tab),
19805        toHide = !active.length ? $() : this._getPanelForTab(active),
19806        eventData = {
19807          oldTab: active,
19808          oldPanel: toHide,
19809          newTab: collapsing ? $() : tab,
19810          newPanel: toShow,
19811        };
19812
19813      event.preventDefault();
19814
19815      if (
19816        tab.hasClass("ui-state-disabled") ||
19817        // tab is already loading
19818        tab.hasClass("ui-tabs-loading") ||
19819        // can't switch durning an animation
19820        this.running ||
19821        // click on active header, but not collapsible
19822        (clickedIsActive && !options.collapsible) ||
19823        // allow canceling activation
19824        this._trigger("beforeActivate", event, eventData) === false
19825      ) {
19826        return;
19827      }
19828
19829      options.active = collapsing ? false : this.tabs.index(tab);
19830
19831      this.active = clickedIsActive ? $() : tab;
19832      if (this.xhr) {
19833        this.xhr.abort();
19834      }
19835
19836      if (!toHide.length && !toShow.length) {
19837        $.error("jQuery UI Tabs: Mismatching fragment identifier.");
19838      }
19839
19840      if (toShow.length) {
19841        this.load(this.tabs.index(tab), event);
19842      }
19843      this._toggle(event, eventData);
19844    },
19845
19846    // Handles show/hide for selecting tabs
19847    _toggle: function (event, eventData) {
19848      var that = this,
19849        toShow = eventData.newPanel,
19850        toHide = eventData.oldPanel;
19851
19852      this.running = true;
19853
19854      function complete() {
19855        that.running = false;
19856        that._trigger("activate", event, eventData);
19857      }
19858
19859      function show() {
19860        that._addClass(
19861          eventData.newTab.closest("li"),
19862          "ui-tabs-active",
19863          "ui-state-active"
19864        );
19865
19866        if (toShow.length && that.options.show) {
19867          that._show(toShow, that.options.show, complete);
19868        } else {
19869          toShow.show();
19870          complete();
19871        }
19872      }
19873
19874      // Start out by hiding, then showing, then completing
19875      if (toHide.length && this.options.hide) {
19876        this._hide(toHide, this.options.hide, function () {
19877          that._removeClass(
19878            eventData.oldTab.closest("li"),
19879            "ui-tabs-active",
19880            "ui-state-active"
19881          );
19882          show();
19883        });
19884      } else {
19885        this._removeClass(
19886          eventData.oldTab.closest("li"),
19887          "ui-tabs-active",
19888          "ui-state-active"
19889        );
19890        toHide.hide();
19891        show();
19892      }
19893
19894      toHide.attr("aria-hidden", "true");
19895      eventData.oldTab.attr({
19896        "aria-selected": "false",
19897        "aria-expanded": "false",
19898      });
19899
19900      // If we're switching tabs, remove the old tab from the tab order.
vendor: 4,647 bytes, lines 19901-20069
19901      // If we're opening from collapsed state, remove the previous tab from the tab order.
19902      // If we're collapsing, then keep the collapsing tab in the tab order.
19903      if (toShow.length && toHide.length) {
19904        eventData.oldTab.attr("tabIndex", -1);
19905      } else if (toShow.length) {
19906        this.tabs
19907          .filter(function () {
19908            return $(this).attr("tabIndex") === 0;
19909          })
19910          .attr("tabIndex", -1);
19911      }
19912
19913      toShow.attr("aria-hidden", "false");
19914      eventData.newTab.attr({
19915        "aria-selected": "true",
19916        "aria-expanded": "true",
19917        tabIndex: 0,
19918      });
19919    },
19920
19921    _activate: function (index) {
19922      var anchor,
19923        active = this._findActive(index);
19924
19925      // Trying to activate the already active panel
19926      if (active[0] === this.active[0]) {
19927        return;
19928      }
19929
19930      // Trying to collapse, simulate a click on the current active header
19931      if (!active.length) {
19932        active = this.active;
19933      }
19934
19935      anchor = active.find(".ui-tabs-anchor")[0];
19936      this._eventHandler({
19937        target: anchor,
19938        currentTarget: anchor,
19939        preventDefault: $.noop,
19940      });
19941    },
19942
19943    _findActive: function (index) {
19944      return index === false ? $() : this.tabs.eq(index);
19945    },
19946
19947    _getIndex: function (index) {
19948      // meta-function to give users option to provide a href string instead of a numerical index.
19949      if (typeof index === "string") {
19950        index = this.anchors.index(
19951          this.anchors.filter("[href$='" + $.escapeSelector(index) + "']")
19952        );
19953      }
19954
19955      return index;
19956    },
19957
19958    _destroy: function () {
19959      if (this.xhr) {
19960        this.xhr.abort();
19961      }
19962
19963      this.tablist.removeAttr("role").off(this.eventNamespace);
19964
19965      this.anchors.removeAttr("role tabIndex").removeUniqueId();
19966
19967      this.tabs.add(this.panels).each(function () {
19968        if ($.data(this, "ui-tabs-destroy")) {
19969          $(this).remove();
19970        } else {
19971          $(this).removeAttr(
19972            "role tabIndex " +
19973              "aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded"
19974          );
19975        }
19976      });
19977
19978      this.tabs.each(function () {
19979        var li = $(this),
19980          prev = li.data("ui-tabs-aria-controls");
19981        if (prev) {
19982          li.attr("aria-controls", prev).removeData("ui-tabs-aria-controls");
19983        } else {
19984          li.removeAttr("aria-controls");
19985        }
19986      });
19987
19988      this.panels.show();
19989
19990      if (this.options.heightStyle !== "content") {
19991        this.panels.css("height", "");
19992      }
19993    },
19994
19995    enable: function (index) {
19996      var disabled = this.options.disabled;
19997      if (disabled === false) {
19998        return;
19999      }
20000
20001      if (index === undefined) {
20002        disabled = false;
20003      } else {
20004        index = this._getIndex(index);
20005        if (Array.isArray(disabled)) {
20006          disabled = $.map(disabled, function (num) {
20007            return num !== index ? num : null;
20008          });
20009        } else {
20010          disabled = $.map(this.tabs, function (li, num) {
20011            return num !== index ? num : null;
20012          });
20013        }
20014      }
20015      this._setOptionDisabled(disabled);
20016    },
20017
20018    disable: function (index) {
20019      var disabled = this.options.disabled;
20020      if (disabled === true) {
20021        return;
20022      }
20023
20024      if (index === undefined) {
20025        disabled = true;
20026      } else {
20027        index = this._getIndex(index);
20028        if ($.inArray(index, disabled) !== -1) {
20029          return;
20030        }
20031        if (Array.isArray(disabled)) {
20032          disabled = $.merge([index], disabled).sort();
20033        } else {
20034          disabled = [index];
20035        }
20036      }
20037      this._setOptionDisabled(disabled);
20038    },
20039
20040    load: function (index, event) {
20041      index = this._getIndex(index);
20042      var that = this,
20043        tab = this.tabs.eq(index),
20044        anchor = tab.find(".ui-tabs-anchor"),
20045        panel = this._getPanelForTab(tab),
20046        eventData = {
20047          tab: tab,
20048          panel: panel,
20049        },
20050        complete = function (jqXHR, status) {
20051          if (status === "abort") {
20052            that.panels.stop(false, true);
20053          }
20054
20055          that._removeClass(tab, "ui-tabs-loading");
20056          panel.removeAttr("aria-busy");
20057
20058          if (jqXHR === that.xhr) {
20059            delete that.xhr;
20060          }
20061        };
20062
20063      // Not remote
20064      if (this._isLocal(anchor[0])) {
20065        return;
20066      }
20067
20068      this.xhr = $.ajax(this._ajaxSettings(anchor, event, eventData));
20069
vendor: 18,252 bytes, lines 20070-20640
20070      // Support: jQuery <1.8
20071      // jQuery <1.8 returns false if the request is canceled in beforeSend,
20072      // but as of 1.8, $.ajax() always returns a jqXHR object.
20073      if (this.xhr && this.xhr.statusText !== "canceled") {
20074        this._addClass(tab, "ui-tabs-loading");
20075        panel.attr("aria-busy", "true");
20076
20077        this.xhr
20078          .done(function (response, status, jqXHR) {
20079            // support: jQuery <1.8
20080            // http://bugs.jquery.com/ticket/11778
20081            setTimeout(function () {
20082              panel.html(response);
20083              that._trigger("load", event, eventData);
20084
20085              complete(jqXHR, status);
20086            }, 1);
20087          })
20088          .fail(function (jqXHR, status) {
20089            // support: jQuery <1.8
20090            // http://bugs.jquery.com/ticket/11778
20091            setTimeout(function () {
20092              complete(jqXHR, status);
20093            }, 1);
20094          });
20095      }
20096    },
20097
20098    _ajaxSettings: function (anchor, event, eventData) {
20099      var that = this;
20100      return {
20101        // Support: IE <11 only
20102        // Strip any hash that exists to prevent errors with the Ajax request
20103        url: anchor.attr("href").replace(/#.*$/, ""),
20104        beforeSend: function (jqXHR, settings) {
20105          return that._trigger(
20106            "beforeLoad",
20107            event,
20108            $.extend({ jqXHR: jqXHR, ajaxSettings: settings }, eventData)
20109          );
20110        },
20111      };
20112    },
20113
20114    _getPanelForTab: function (tab) {
20115      var id = $(tab).attr("aria-controls");
20116      return this.element.find(this._sanitizeSelector("#" + id));
20117    },
20118  });
20119
20120  // DEPRECATED
20121  // TODO: Switch return back to widget declaration at top of file when this is removed
20122  if ($.uiBackCompat !== false) {
20123    // Backcompat for ui-tab class (now ui-tabs-tab)
20124    $.widget("ui.tabs", $.ui.tabs, {
20125      _processTabs: function () {
20126        this._superApply(arguments);
20127        this._addClass(this.tabs, "ui-tab");
20128      },
20129    });
20130  }
20131
20132  var widgetsTabs = $.ui.tabs;
20133
20134  /*!
20135   * jQuery UI Tooltip 1.13.2
20136   * http://jqueryui.com
20137   *
20138   * Copyright jQuery Foundation and other contributors
20139   * Released under the MIT license.
20140   * http://jquery.org/license
20141   */
20142
20143  //>>label: Tooltip
20144  //>>group: Widgets
20145  //>>description: Shows additional information for any element on hover or focus.
20146  //>>docs: http://api.jqueryui.com/tooltip/
20147  //>>demos: http://jqueryui.com/tooltip/
20148  //>>css.structure: ../../themes/base/core.css
20149  //>>css.structure: ../../themes/base/tooltip.css
20150  //>>css.theme: ../../themes/base/theme.css
20151
20152  $.widget("ui.tooltip", {
20153    version: "1.13.2",
20154    options: {
20155      classes: {
20156        "ui-tooltip": "ui-corner-all ui-widget-shadow",
20157      },
20158      content: function () {
20159        var title = $(this).attr("title");
20160
20161        // Escape title, since we're going from an attribute to raw HTML
20162        return $("<a>").text(title).html();
20163      },
20164      hide: true,
20165
20166      // Disabled elements have inconsistent behavior across browsers (#8661)
20167      items: "[title]:not([disabled])",
20168      position: {
20169        my: "left top+15",
20170        at: "left bottom",
20171        collision: "flipfit flip",
20172      },
20173      show: true,
20174      track: false,
20175
20176      // Callbacks
20177      close: null,
20178      open: null,
20179    },
20180
20181    _addDescribedBy: function (elem, id) {
20182      var describedby = (elem.attr("aria-describedby") || "").split(/\s+/);
20183      describedby.push(id);
20184      elem
20185        .data("ui-tooltip-id", id)
20186        .attr(
20187          "aria-describedby",
20188          String.prototype.trim.call(describedby.join(" "))
20189        );
20190    },
20191
20192    _removeDescribedBy: function (elem) {
20193      var id = elem.data("ui-tooltip-id"),
20194        describedby = (elem.attr("aria-describedby") || "").split(/\s+/),
20195        index = $.inArray(id, describedby);
20196
20197      if (index !== -1) {
20198        describedby.splice(index, 1);
20199      }
20200
20201      elem.removeData("ui-tooltip-id");
20202      describedby = String.prototype.trim.call(describedby.join(" "));
20203      if (describedby) {
20204        elem.attr("aria-describedby", describedby);
20205      } else {
20206        elem.removeAttr("aria-describedby");
20207      }
20208    },
20209
20210    _create: function () {
20211      this._on({
20212        mouseover: "open",
20213        focusin: "open",
20214      });
20215
20216      // IDs of generated tooltips, needed for destroy
20217      this.tooltips = {};
20218
20219      // IDs of parent tooltips where we removed the title attribute
20220      this.parents = {};
20221
20222      // Append the aria-live region so tooltips announce correctly
20223      this.liveRegion = $("<div>")
20224        .attr({
20225          role: "log",
20226          "aria-live": "assertive",
20227          "aria-relevant": "additions",
20228        })
20229        .appendTo(this.document[0].body);
20230      this._addClass(this.liveRegion, null, "ui-helper-hidden-accessible");
20231
20232      this.disabledTitles = $([]);
20233    },
20234
20235    _setOption: function (key, value) {
20236      var that = this;
20237
20238      this._super(key, value);
20239
20240      if (key === "content") {
20241        $.each(this.tooltips, function (id, tooltipData) {
20242          that._updateContent(tooltipData.element);
20243        });
20244      }
20245    },
20246
20247    _setOptionDisabled: function (value) {
20248      this[value ? "_disable" : "_enable"]();
20249    },
20250
20251    _disable: function () {
20252      var that = this;
20253
20254      // Close open tooltips
20255      $.each(this.tooltips, function (id, tooltipData) {
20256        var event = $.Event("blur");
20257        event.target = event.currentTarget = tooltipData.element[0];
20258        that.close(event, true);
20259      });
20260
20261      // Remove title attributes to prevent native tooltips
20262      this.disabledTitles = this.disabledTitles.add(
20263        this.element
20264          .find(this.options.items)
20265          .addBack()
20266          .filter(function () {
20267            var element = $(this);
20268            if (element.is("[title]")) {
20269              return element
20270                .data("ui-tooltip-title", element.attr("title"))
20271                .removeAttr("title");
20272            }
20273          })
20274      );
20275    },
20276
20277    _enable: function () {
20278      // restore title attributes
20279      this.disabledTitles.each(function () {
20280        var element = $(this);
20281        if (element.data("ui-tooltip-title")) {
20282          element.attr("title", element.data("ui-tooltip-title"));
20283        }
20284      });
20285      this.disabledTitles = $([]);
20286    },
20287
20288    open: function (event) {
20289      var that = this,
20290        target = $(event ? event.target : this.element)
20291          // we need closest here due to mouseover bubbling,
20292          // but always pointing at the same event target
20293          .closest(this.options.items);
20294
20295      // No element to show a tooltip for or the tooltip is already open
20296      if (!target.length || target.data("ui-tooltip-id")) {
20297        return;
20298      }
20299
20300      if (target.attr("title")) {
20301        target.data("ui-tooltip-title", target.attr("title"));
20302      }
20303
20304      target.data("ui-tooltip-open", true);
20305
20306      // Kill parent tooltips, custom or native, for hover
20307      if (event && event.type === "mouseover") {
20308        target.parents().each(function () {
20309          var parent = $(this),
20310            blurEvent;
20311          if (parent.data("ui-tooltip-open")) {
20312            blurEvent = $.Event("blur");
20313            blurEvent.target = blurEvent.currentTarget = this;
20314            that.close(blurEvent, true);
20315          }
20316          if (parent.attr("title")) {
20317            parent.uniqueId();
20318            that.parents[this.id] = {
20319              element: this,
20320              title: parent.attr("title"),
20321            };
20322            parent.attr("title", "");
20323          }
20324        });
20325      }
20326
20327      this._registerCloseHandlers(event, target);
20328      this._updateContent(target, event);
20329    },
20330
20331    _updateContent: function (target, event) {
20332      var content,
20333        contentOption = this.options.content,
20334        that = this,
20335        eventType = event ? event.type : null;
20336
20337      if (
20338        typeof contentOption === "string" ||
20339        contentOption.nodeType ||
20340        contentOption.jquery
20341      ) {
20342        return this._open(event, target, contentOption);
20343      }
20344
20345      content = contentOption.call(target[0], function (response) {
20346        // IE may instantly serve a cached response for ajax requests
20347        // delay this call to _open so the other call to _open runs first
20348        that._delay(function () {
20349          // Ignore async response if tooltip was closed already
20350          if (!target.data("ui-tooltip-open")) {
20351            return;
20352          }
20353
20354          // JQuery creates a special event for focusin when it doesn't
20355          // exist natively. To improve performance, the native event
20356          // object is reused and the type is changed. Therefore, we can't
20357          // rely on the type being correct after the event finished
20358          // bubbling, so we set it back to the previous value. (#8740)
20359          if (event) {
20360            event.type = eventType;
20361          }
20362          this._open(event, target, response);
20363        });
20364      });
20365      if (content) {
20366        this._open(event, target, content);
20367      }
20368    },
20369
20370    _open: function (event, target, content) {
20371      var tooltipData,
20372        tooltip,
20373        delayedShow,
20374        a11yContent,
20375        positionOption = $.extend({}, this.options.position);
20376
20377      if (!content) {
20378        return;
20379      }
20380
20381      // Content can be updated multiple times. If the tooltip already
20382      // exists, then just update the content and bail.
20383      tooltipData = this._find(target);
20384      if (tooltipData) {
20385        tooltipData.tooltip.find(".ui-tooltip-content").html(content);
20386        return;
20387      }
20388
20389      // If we have a title, clear it to prevent the native tooltip
20390      // we have to check first to avoid defining a title if none exists
20391      // (we don't want to cause an element to start matching [title])
20392      //
20393      // We use removeAttr only for key events, to allow IE to export the correct
20394      // accessible attributes. For mouse events, set to empty string to avoid
20395      // native tooltip showing up (happens only when removing inside mouseover).
20396      if (target.is("[title]")) {
20397        if (event && event.type === "mouseover") {
20398          target.attr("title", "");
20399        } else {
20400          target.removeAttr("title");
20401        }
20402      }
20403
20404      tooltipData = this._tooltip(target);
20405      tooltip = tooltipData.tooltip;
20406      this._addDescribedBy(target, tooltip.attr("id"));
20407      tooltip.find(".ui-tooltip-content").html(content);
20408
20409      // Support: Voiceover on OS X, JAWS on IE <= 9
20410      // JAWS announces deletions even when aria-relevant="additions"
20411      // Voiceover will sometimes re-read the entire log region's contents from the beginning
20412      this.liveRegion.children().hide();
20413      a11yContent = $("<div>").html(tooltip.find(".ui-tooltip-content").html());
20414      a11yContent.removeAttr("name").find("[name]").removeAttr("name");
20415      a11yContent.removeAttr("id").find("[id]").removeAttr("id");
20416      a11yContent.appendTo(this.liveRegion);
20417
20418      function position(event) {
20419        positionOption.of = event;
20420        if (tooltip.is(":hidden")) {
20421          return;
20422        }
20423        tooltip.position(positionOption);
20424      }
20425      if (this.options.track && event && /^mouse/.test(event.type)) {
20426        this._on(this.document, {
20427          mousemove: position,
20428        });
20429
20430        // trigger once to override element-relative positioning
20431        position(event);
20432      } else {
20433        tooltip.position(
20434          $.extend(
20435            {
20436              of: target,
20437            },
20438            this.options.position
20439          )
20440        );
20441      }
20442
20443      tooltip.hide();
20444
20445      this._show(tooltip, this.options.show);
20446
20447      // Handle tracking tooltips that are shown with a delay (#8644). As soon
20448      // as the tooltip is visible, position the tooltip using the most recent
20449      // event.
20450      // Adds the check to add the timers only when both delay and track options are set (#14682)
20451      if (this.options.track && this.options.show && this.options.show.delay) {
20452        delayedShow = this.delayedShow = setInterval(function () {
20453          if (tooltip.is(":visible")) {
20454            position(positionOption.of);
20455            clearInterval(delayedShow);
20456          }
20457        }, 13);
20458      }
20459
20460      this._trigger("open", event, { tooltip: tooltip });
20461    },
20462
20463    _registerCloseHandlers: function (event, target) {
20464      var events = {
20465        keyup: function (event) {
20466          if (event.keyCode === $.ui.keyCode.ESCAPE) {
20467            var fakeEvent = $.Event(event);
20468            fakeEvent.currentTarget = target[0];
20469            this.close(fakeEvent, true);
20470          }
20471        },
20472      };
20473
20474      // Only bind remove handler for delegated targets. Non-delegated
20475      // tooltips will handle this in destroy.
20476      if (target[0] !== this.element[0]) {
20477        events.remove = function () {
20478          var targetElement = this._find(target);
20479          if (targetElement) {
20480            this._removeTooltip(targetElement.tooltip);
20481          }
20482        };
20483      }
20484
20485      if (!event || event.type === "mouseover") {
20486        events.mouseleave = "close";
20487      }
20488      if (!event || event.type === "focusin") {
20489        events.focusout = "close";
20490      }
20491      this._on(true, target, events);
20492    },
20493
20494    close: function (event) {
20495      var tooltip,
20496        that = this,
20497        target = $(event ? event.currentTarget : this.element),
20498        tooltipData = this._find(target);
20499
20500      // The tooltip may already be closed
20501      if (!tooltipData) {
20502        // We set ui-tooltip-open immediately upon open (in open()), but only set the
20503        // additional data once there's actually content to show (in _open()). So even if the
20504        // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
20505        // the period between open() and _open().
20506        target.removeData("ui-tooltip-open");
20507        return;
20508      }
20509
20510      tooltip = tooltipData.tooltip;
20511
20512      // Disabling closes the tooltip, so we need to track when we're closing
20513      // to avoid an infinite loop in case the tooltip becomes disabled on close
20514      if (tooltipData.closing) {
20515        return;
20516      }
20517
20518      // Clear the interval for delayed tracking tooltips
20519      clearInterval(this.delayedShow);
20520
20521      // Only set title if we had one before (see comment in _open())
20522      // If the title attribute has changed since open(), don't restore
20523      if (target.data("ui-tooltip-title") && !target.attr("title")) {
20524        target.attr("title", target.data("ui-tooltip-title"));
20525      }
20526
20527      this._removeDescribedBy(target);
20528
20529      tooltipData.hiding = true;
20530      tooltip.stop(true);
20531      this._hide(tooltip, this.options.hide, function () {
20532        that._removeTooltip($(this));
20533      });
20534
20535      target.removeData("ui-tooltip-open");
20536      this._off(target, "mouseleave focusout keyup");
20537
20538      // Remove 'remove' binding only on delegated targets
20539      if (target[0] !== this.element[0]) {
20540        this._off(target, "remove");
20541      }
20542      this._off(this.document, "mousemove");
20543
20544      if (event && event.type === "mouseleave") {
20545        $.each(this.parents, function (id, parent) {
20546          $(parent.element).attr("title", parent.title);
20547          delete that.parents[id];
20548        });
20549      }
20550
20551      tooltipData.closing = true;
20552      this._trigger("close", event, { tooltip: tooltip });
20553      if (!tooltipData.hiding) {
20554        tooltipData.closing = false;
20555      }
20556    },
20557
20558    _tooltip: function (element) {
20559      var tooltip = $("<div>").attr("role", "tooltip"),
20560        content = $("<div>").appendTo(tooltip),
20561        id = tooltip.uniqueId().attr("id");
20562
20563      this._addClass(content, "ui-tooltip-content");
20564      this._addClass(tooltip, "ui-tooltip", "ui-widget ui-widget-content");
20565
20566      tooltip.appendTo(this._appendTo(element));
20567
20568      return (this.tooltips[id] = {
20569        element: element,
20570        tooltip: tooltip,
20571      });
20572    },
20573
20574    _find: function (target) {
20575      var id = target.data("ui-tooltip-id");
20576      return id ? this.tooltips[id] : null;
20577    },
20578
20579    _removeTooltip: function (tooltip) {
20580      // Clear the interval for delayed tracking tooltips
20581      clearInterval(this.delayedShow);
20582
20583      tooltip.remove();
20584      delete this.tooltips[tooltip.attr("id")];
20585    },
20586
20587    _appendTo: function (target) {
20588      var element = target.closest(".ui-front, dialog");
20589
20590      if (!element.length) {
20591        element = this.document[0].body;
20592      }
20593
20594      return element;
20595    },
20596
20597    _destroy: function () {
20598      var that = this;
20599
20600      // Close open tooltips
20601      $.each(this.tooltips, function (id, tooltipData) {
20602        // Delegate to close method to handle common cleanup
20603        var event = $.Event("blur"),
20604          element = tooltipData.element;
20605        event.target = event.currentTarget = element[0];
20606        that.close(event, true);
20607
20608        // Remove immediately; destroying an open tooltip doesn't use the
20609        // hide animation
20610        $("#" + id).remove();
20611
20612        // Restore the title
20613        if (element.data("ui-tooltip-title")) {
20614          // If the title attribute has changed since open(), don't restore
20615          if (!element.attr("title")) {
20616            element.attr("title", element.data("ui-tooltip-title"));
20617          }
20618          element.removeData("ui-tooltip-title");
20619        }
20620      });
20621      this.liveRegion.remove();
20622    },
20623  });
20624
20625  // DEPRECATED
20626  // TODO: Switch return back to widget declaration at top of file when this is removed
20627  if ($.uiBackCompat !== false) {
20628    // Backcompat for tooltipClass option
20629    $.widget("ui.tooltip", $.ui.tooltip, {
20630      options: {
20631        tooltipClass: null,
20632      },
20633      _tooltip: function () {
20634        var tooltipData = this._superApply(arguments);
20635        if (this.options.tooltipClass) {
20636          tooltipData.tooltip.addClass(this.options.tooltipClass);
20637        }
20638        return tooltipData;
20639      },
20640    });
20641  }
20642
20643  var widgetsTooltip = $.ui.tooltip;
20644});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.