! function($, window, document) {
    "use strict";
    function Wickedpicker(e, t) {
        this.element = $(e), this.options = $.extend({}, defaults, t), this.element.addClass("hasWickedpicker"), this.element.attr("onkeypress", "return false;"), this.element.attr("aria-showingpicker", "false"), this.createPicker(), this.timepicker = $(".wickedpicker"), this.up = $("." + this.options.upArrow.split(/\s+/)
            .join(".")), this.down = $("." + this.options.downArrow.split(/\s+/)
            .join(".")), this.separator = $(".wickedpicker__controls__control--separator"), this.hoursElem = $(".wickedpicker__controls__control--hours"), this.minutesElem = $(".wickedpicker__controls__control--minutes"), this.secondsElem = $(".wickedpicker__controls__control--seconds"), this.meridiemElem = $(".wickedpicker__controls__control--meridiem"), this.close = $("." + this.options.close.split(/\s+/)
            .join("."));
        var i = this.timeArrayFromString(this.options.now);
        this.options.now = new Date(today.getFullYear(), today.getMonth(), today.getDate(), i[0], i[1], i[2]), this.selectedHour = this.parseHours(this.options.now.getHours()), this.selectedMin = this.parseSecMin(this.options.now.getMinutes()), this.selectedSec = this.parseSecMin(this.options.now.getSeconds()), this.selectedMeridiem = this.parseMeridiem(this.options.now.getHours()), this.setHoverState(), this.attach(e), this.setText(e)
    }
    "function" != typeof String.prototype.endsWith && (String.prototype.endsWith = function(e) {
        return e.length > 0 && this.substring(this.length - e.length, this.length) === e
    });
    var isMobile = function() {
            return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
        },
        today = new Date,
        pluginName = "wickedpicker",
        defaults = {
            now: today.getHours() + ":" + today.getMinutes(),
            twentyFour: !1,
            upArrow: "wickedpicker__controls__control-up",
            downArrow: "wickedpicker__controls__control-down",
            close: "wickedpicker__close",
            hoverState: "hover-state",
            title: "Timepicker",
            showSeconds: !1,
            timeSeparator: " : ",
            secondsInterval: 1,
            minutesInterval: 1,
            beforeShow: null,
            afterShow: null,
            show: null,
            clearable: !1,
            closeOnClickOutside: !0,
            onClickOutside: function() {}
        };
    $.extend(Wickedpicker.prototype, {
        showPicker: function(e) {
            "function" == typeof this.options.beforeShow && this.options.beforeShow(e, this.timepicker);
            var t = $(e)
                .offset();
            if($(e)
                .attr({
                    "aria-showingpicker": "true",
                    tabindex: -1
                }), this.setText(e), this.showHideMeridiemControl(), this.getText(e) !== this.getTime()) {
                var i = this.getText(e),
                    s = /\s[ap]m$/i,
                    o = s.test(i) ? i.substr(-2, 2) : null,
                    n = i.replace(s, "")
                    .split(this.options.timeSeparator),
                    r = {};
                r.hours = n[0], r.minutes = n[1], r.meridiem = o, this.options.showSeconds && (r.seconds = n[2]), this.setTime(r)
            }
            this.timepicker.css({
                    "z-index": this.element.css("z-index") + 1,
                    position: "absolute",
                    left: t.left,
                    top: t.top + $(e)[0].offsetHeight
                })
                .show(), "function" == typeof this.options.show && this.options.show(e, this.timepicker), this.handleTimeAdjustments(e)
        },
        hideTimepicker: function(e) {
            this.timepicker.hide(), "function" == typeof this.options.afterShow && this.options.afterShow(e, this.timepicker), {
                    start: function() {
                        var e = $.Deferred();
                        return $('[aria-showingpicker="true"]')
                            .attr("aria-showingpicker", "false"), e.promise()
                    }
                }.start()
                .then(function(e) {
                    setTimeout(function() {
                        $('[aria-showingpicker="false"]')
                            .attr("tabindex", e)
                    }, 400)
                }(0))
        },
        createPicker: function() {
            if(0 === $(".wickedpicker")
                .length) {
                var e = '
' + this.options.title + '
- 00
- :
- 00';
                this.options.showSeconds && (e += '
- :
- 00 '), e += '
- AM