OwlCyberSecurity - MANAGER
Edit File: kendo.timepicker.min.js
/*! * Copyright 2021 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ !function(t,define){define("kendo.timepicker.min",["kendo.popup.min","kendo.dateinput.min"],t)}(function(){return function(t,e){function i(){var t=new it,e=new it(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),i=new it(t.getFullYear(),t.getMonth(),t.getDate(),12,0,0);return-1*(e.getTimezoneOffset()-i.getTimezoneOffset())}function n(t){return 60*t.getHours()*N+t.getMinutes()*N+1e3*t.getSeconds()+t.getMilliseconds()}function a(t){var e=new Date(2100,0,1);return e.setMinutes(-t),e}function s(t,e,i){var a,s=n(e),o=n(i);return!t||s==o||(a=n(t),s>a&&(a+=K),o<s&&(o+=K),a>=s&&a<=o)}function o(t){var e=t.parseFormats;t.format=T(t.format||w.getCulture(t.culture).calendars.standard.patterns.t),e=$(e)?e:[e],e.splice(0,0,t.format),t.parseFormats=e}function l(t){t.preventDefault()}function r(t,e){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function u(t,e){var i,n=e.calendar;return"string"==typeof t&&(i=n.patterns[t]?n.patterns[t]:t),i||(i=n.patterns.d),i}function c(t,e){var i=t[t.length-1];i&&"LITERAL"===i.type?i.pattern+=e:t.push({type:at,pattern:e})}function d(t){return"h"===t||"K"===t}function h(t){var e;return t<=3?e="abbreviated":4===t?e="wide":5===t?e="narrow":6===t&&(e="short"),e}function p(t,e,i){return i=i||0,t.indexOf(e,i)===i}function m(t,e){var i=!1;return t.indexOf(e)!==-1&&(i=!0),i}function f(t){for(var e,i,n,a,s,o,l,r=w.culture(),m=u(t,r),f=[],g=nt.lastIndex=0,_=nt.exec(m);_;)l=_[0],g<_.index&&c(f,m.substring(g,_.index)),p(l,'"')||p(l,"'")?c(f,l):(e=l[0],i=ct[e],n={type:i,pattern:l},"hour"===i&&(n.hour12=d(l)),a=dt[i],a&&(s="number"==typeof a.minLength?a.minLength:a.minLength[e],o=l.length,o>=s&&(n.names={type:a.type,nameType:h(o),standAlone:a.standAlone===e})),f.push(n)),g=nt.lastIndex,_=nt.exec(m);return g<m.length&&c(f,m.substring(g)),f}function g(t,e){for(var i=t+"";i.length<(e||2);)i="0"+i;return i}function _(t,e){return Math.max(Math.floor(t/e),0)}var v,k,w=window.kendo,b=w.keys,y=w.parseDate,x=w._activeElement,T=w._extractFormat,M=w.support,H=M.browser,D=w.ui,S=D.Widget,C="open",V="close",L="change",R=".kendoTimePicker",q="click"+R,I="k-state-default",F="disabled",A="readonly",O="li",E="<span></span>",P="k-state-focused",W="k-state-hover",Y="mouseenter"+R+" mouseleave"+R,B="mousedown"+R,N=6e4,K=864e5,z="k-state-selected",G="k-state-disabled",j="aria-selected",Q="aria-expanded",U="aria-hidden",X="aria-disabled",Z="aria-activedescendant",J="id",$=t.isArray,tt=t.extend,et=t.proxy,it=Date,nt=/d{1,2}|E{1,6}|e{1,6}|c{3,6}|c{1}|M{1,5}|L{1,5}|y{1,4}|H{1,2}|h{1,2}|k{1,2}|K{1,2}|m{1,2}|a{1,5}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|x{1,5}|X{1,5}|G{1,5}|q{1,5}|Q{1,5}|"[^"]*"|'[^']*'/g,at="literal",st="month",ot="hour",lt="zone",rt="weekday",ut="quarter",ct={G:"era",y:"year",q:ut,Q:ut,M:st,L:st,d:"day",E:rt,c:rt,e:rt,h:ot,H:ot,k:ot,K:ot,m:"minute",s:"second",a:"dayperiod",x:lt,X:lt,z:lt,Z:lt},dt={month:{type:"months",minLength:3,standAlone:"L"},quarter:{type:"quarters",minLength:3,standAlone:"q"},weekday:{type:"days",minLength:{E:0,c:3,e:3},standAlone:"c"},dayperiod:{type:"dayPeriods",minLength:0},era:{type:"eras",minLength:0}},ht=new it,pt='<div tabindex="0" class="k-timeselector"><div class="k-time-header"><span class="k-title"></span><button class="k-button k-flat k-time-now" title="Select now" aria-label="Select now">#=messages.now#</button></div><div class="k-time-list-container"><span class="k-time-highlight"></span></div></div>',mt='<div class="k-time-footer k-action-buttons"><button class="k-button k-time-cancel" title="Cancel changes" aria-label="Cancel changes">#=messages.cancel#</button><button class="k-time-accept k-button k-primary" title="Set time" aria-label="Set time">#=messages.set#</button></div>',ft='<span class="k-time-highlight"></span>';ht=new Date(ht.getFullYear(),ht.getMonth(),ht.getDate(),0,0,0),v=function(t){var e=this,i=t.id;e.options=t,e._dates=[],e._createList(t.timeView&&"scroll"===t.timeView.list),i&&(e._timeViewID=i+"_timeview",e._optionID=i+"_option_selected",e.ul.attr(J,e._timeViewID)),e._heightHandler=et(e._height,e),e._popup()},v.prototype={_createList:function(t){t?this._createScrollList():this._createClassicRenderingList()},_createScrollList:function(){this.list=t(w.template(pt)(this.options)).on(B,l),this.options.omitPopup||this.list.append(w.template(mt)(this.options)),this.ul=this.list.find(".k-time-list-container"),this.list.on("click"+R,".k-time-header button.k-time-now",et(this._nowClickHandler,this)),this.list.on("click"+R,".k-time-footer button.k-time-cancel",et(this._cancelClickHandler,this)),this.list.on("click"+R,".k-time-footer button.k-time-accept",et(this._setClickHandler,this)),this.list.on("mouseover"+R,".k-time-list-wrapper",et(this._mouseOverHandler,this)),this.list.on("keydown"+R,et(this._scrollerKeyDownHandler,this))},_scrollerKeyDownHandler:function(e){var i=this,n=e.keyCode,a=t(e.currentTarget).find(".k-time-list-wrapper.k-state-focused"),s=i.list.find(".k-time-list-wrapper"),o=s.length,l=s.index(a),r=w.support.isRtl(i.wrapper),u=a.find(".k-item:visible:eq(0)").outerHeight(),c=a.find(".k-time-container.k-content.k-scrollable");a.length&&(n==b.RIGHT&&!r||n==b.LEFT&&r?l+1<o&&i._focusList(s.eq(l+1)):n==b.LEFT&&!r||n==b.RIGHT&&r?l-1>=0&&i._focusList(s.eq(l-1)):n==b.UP?(c.scrollTop(c.scrollTop()-u),e.preventDefault()):n==b.DOWN?(c.scrollTop(c.scrollTop()+u),e.preventDefault()):n===b.ENTER?i._setClickHandler():n===b.ESC&&i._cancelClickHandler())},_mouseOverHandler:function(e){this._focusList(t(e.currentTarget))},_focusList:function(t){this.list.find(".k-time-list-wrapper").removeClass(P),t.addClass(P),this.list.focus(),this._scrollTop=t.find(".k-scrollable").scrollTop()},_createClassicRenderingList:function(){var e=this;e.ul=t('<ul tabindex="-1" role="listbox" aria-hidden="true" unselectable="on" class="k-list k-reset"/>').css({overflow:M.kineticScrollNeeded?"":"auto"}).on(q,O,et(e._click,e)).on("mouseenter"+R,O,function(){t(this).addClass(W)}).on("mouseleave"+R,O,function(){t(this).removeClass(W)}),e.list=t("<div class='k-list-container k-list-scroller' unselectable='on'/>").append(e.ul).on(B,l),e.template=w.template('<li tabindex="-1" role="option" class="k-item" unselectable="on">#=data#</li>',{useWithBlock:!1})},current:function(i){var n=this,a=n.options.active;return i===e?n._current:(n._current&&(n._current.removeClass(z),n._current&&n._current.length&&(n._current[0].removeAttribute(J),n._current[0].removeAttribute(j))),i&&(i=t(i).addClass(z).attr(J,n._optionID).attr(j,!0),n.scroll(i[0])),n._current=i,a&&a(i),e)},_updateTitle:function(){this.list.find(".k-time-header > .k-title").html(w.toString(this._value,this.options.format,this.options.culture))},applyValue:function(t){var e,i,n,a,s,o,l,r,u,c;t&&(e=m(this.options.format.toLowerCase(),"t"),i=t.getHours(),n=t.getMinutes(),a=t.getSeconds(),o=this.ul.find('[data-index="1"]'),l=this.ul.find('[data-index="2"]'),r=this.ul.find('[data-index="3"]'),u=this.ul.find('[data-index="4"]'),e&&(i>=12?(s="PM",i>12&&(i-=12)):s="AM"),o.length&&(c=o.find('.k-item[data-value="'+g(i)+'"]'),o.scrollTop(o.find(".k-item:visible").index(c)*c.outerHeight())),l.length&&(c=l.find('.k-item[data-value="'+g(n)+'"]'),l.scrollTop(l.find(".k-item:visible").index(c)*c.outerHeight())),r.length&&(c=r.find('.k-item[data-value="'+g(a)+'"]'),r.scrollTop(r.find(".k-item:visible").index(c)*c.outerHeight())),u.length&&(c=u.find('.k-item[data-value="'+g(s)+'"]'),u.scrollTop(u.find(".k-item:visible").index(c)*c.outerHeight())))},close:function(){this.popup.close()},destroy:function(){var t=this;t.ul.off(R),t.list.off(R),this.popup&&t.popup.destroy()},open:function(){var t,e=this;(!e.ul[0].firstChild||e.ul.find("li").length<1)&&e.bind(),t=e.popup._hovered,e.popup._hovered=!0,e.popup.open(),setTimeout(function(){e.popup._hovered=t},1),e._current&&e.scroll(e._current[0])},dataBind:function(t){for(var e,i=this,n=i.options,a=n.format,o=w.toString,l=i.template,r=t.length,u=0,c="";u<r;u++)e=t[u],s(e,n.min,n.max)&&(c+=l(o(e,a,n.culture)));i._html(c)},refresh:function(){var t,e,s=this,o=s.options,l=o.format,u=i(),c=u<0,d=w.parseDate(s._value),h=d?r(d,o.min):r(new Date,o.min),p=o.min,m=o.max,g=n(p),_=n(m),v=n(a(o.interval)),k=o.interval*N,b=w.toString,y=s.template,x=o.useValueToRender?h:new Date((+o.min)),T=new it(x),M="";e=c?(K+u*N)/k:K/k,g==_&&v!==_||(g>_&&(_+=K),e=(_-g)/k+1),o.timeView&&"scroll"===o.timeView.list?M=s._createListContent(f(l)):s.getDatesInRange(t,_,T,m,k,x).forEach(function(t){M+=y(b(t,l,o.culture))}),s._html(M)},_updateListBottomOffset:function(t){var e=t.find(".k-item:visible:eq(0)").outerHeight(),i=t.outerHeight(),n=i-e;t.find(".k-scrollable-placeholder").css({height:t.find("ul").height()+n})},_updateHoursRange:function(){var e,i,n,a=this,s=this.ul.find('[data-index="1"]'),o=this._minHours,l=this._maxHours,r=m(this.options.format.toLowerCase(),"t");s.length&&(n=_(s.scrollTop(),s.find(".k-item:visible:eq(0)").outerHeight()),this._selectedHour=+s.find(".k-item:visible").eq(n).attr("data-value"),r&&this._selectedDesignator?("AM"===this._selectedDesignator?(o<12&&(i=!0),l<12&&(e=!0)):"PM"===this._selectedDesignator&&(o>12&&(i=!0,o-=12),l>12&&(e=!0,l-=12)),s.find(".k-item").each(function(n,s){s=t(s);var r=+s.attr("data-value");a._validateMin&&i&&r<o||a._validateMax&&e&&r>l?s.hide():s.show()})):s.find(".k-item").each(function(e,i){i=t(i);var n=+i.attr("data-value");a._validateMin&&n<o||a._validateMax&&n>l?i.hide():i.show()}),this._updateListBottomOffset(s))},_updateMinutesRange:function(){var e,i=this,n=this.ul.find('[data-index="2"]'),a=this._minHours,s=this._maxHours,o=this._minMinutes,l=this._maxMinutes,r=this._selectedHour;n.length&&(e=_(n.scrollTop(),n.find(".k-item:visible:eq(0)").outerHeight()),this._selectedMinutes=+n.find(".k-item:visible").eq(e).attr("data-value"),n.find(".k-item").each(function(e,n){n=t(n);var u=+n.attr("data-value");i._validateMin&&u<o&&a&&r===a||i._validateMax&&u>l&&s&&r===s?n.hide():n.show()}),this._updateListBottomOffset(n))},_updateSecondsRange:function(){var e=this,i=this.ul.find('[data-index="3"]'),n=this._minSeconds,a=this._minSeconds,s=this._minMinutes,o=this._maxMinutes,l=this._selectedMinutes;i.length&&(i.find(".k-item").each(function(i,r){r=t(r);var u=+r.attr("data-value");e._validateMin&&u<n&&s&&l===s||e._validateMax&&u>a&&o&&l===o?r.hide():r.show()}),this._updateListBottomOffset(i))},_updateDesignatorRange:function(){var t,e=this._minHours,i=this._maxHours,n=this.ul.find('[data-index="4"]');n.length&&(t=_(n.scrollTop(),n.find(".k-item:visible:eq(0)").outerHeight()),this._selectedDesignator=n.find(".k-item:visible").eq(t).attr("data-value"),this._validateMin&&e>=12?n.find('.k-item[data-value="AM"]').hide():n.find('.k-item[data-value="AM"]').show(),this._validateMax&&i<12?n.find('.k-item[data-value="PM"]').hide():n.find('.k-item[data-value="PM"]').show())},_updateRanges:function(){var t,e;if(this.options.specifiedRange){if(this._currentlySelected||(this._currentlySelected=new Date),t=this.options.max,e=this.options.min,this._selectedDesignator=this._selectedHour=this._selectedMinutes=this._selectedSeconds=null,this.options.validateDate){if(this._validateMax=t.getFullYear()===this._currentlySelected.getFullYear()&&t.getMonth()===this._currentlySelected.getMonth()&&t.getDate()===this._currentlySelected.getDate(),this._validateMin=e.getFullYear()===this._currentlySelected.getFullYear()&&e.getMonth()===this._currentlySelected.getMonth()&&e.getDate()===this._currentlySelected.getDate(),!this._validateMax&&!this._validateMin)return}else this._validateMax=!0,this._validateMin=!0;this._minMinutes=e.getMinutes(),this._maxMinutes=t.getMinutes(),this._minHours=e.getHours(),this._maxHours=t.getHours(),this._minSeconds=e.getSeconds(),this._maxSeconds=t.getSeconds(),this._updateDesignatorRange(),this._updateHoursRange(),this._updateMinutesRange(),this._updateSecondsRange()}},addTranslate:function(){var t,e,i,n,a,s,o,l=this.ul.find(".k-time-container.k-content.k-scrollable"),r=l.length;for(o=0;o<r;o++)t=l.eq(o),e=t.find(".k-item:visible:eq(0)").outerHeight(),i=t.outerHeight(),n=(i-e)/2,a="translateY("+n+"px)",s=i-e,t.find("ul").css({transform:a,"-ms-transform":a}),t.find(".k-scrollable-placeholder").css({height:t.find("ul").height()+s}),t.off(R).on("click"+R,".k-item",et(this._itemClickHandler,this)).on("scroll"+R,et(this._listScrollHandler,this))},_nowClickHandler:function(){var t=new Date;this.value(t),this.options.change(w.toString(t,this.options.format,this.options.culture))},_cancelClickHandler:function(){this.value(this._value),this.popup.close()},_setClickHandler:function(){this._value=new Date(this._currentlySelected),this._updateCurrentlySelected(),this.options.change(w.toString(this._value,this.options.format,this.options.culture),!0),this.popup.close()},_listScrollHandler:function(e){var i=this,n=Math.floor(t(e.currentTarget).find(".k-item:visible:eq(0)").outerHeight());i._scrollingTimeout&&clearTimeout(i._scrollingTimeout),i._scrollingTimeout=setTimeout(function(){e.currentTarget.scrollTop%n!==0&&(e.currentTarget.scrollTop=e.currentTarget.scrollTop>i._scrollTop?Math.ceil(e.currentTarget.scrollTop/n)*n:Math.floor(e.currentTarget.scrollTop/n)*n),i._scrollTop=e.currentTarget.scrollTop,i._updateRanges(),i._updateCurrentlySelected()},100)},_updateCurrentlySelected:function(){var t,i,n,a,s,o=m(this.options.format.toLowerCase(),"t"),l=this.ul.find('[data-index="1"]'),r=this.ul.find('[data-index="2"]'),u=this.ul.find('[data-index="3"]'),c=this.ul.find('[data-index="4"]');this._currentlySelected||(this._currentlySelected=this._value?new Date(this._value):new Date),l.length&&(n=_(l.scrollTop(),Math.floor(l.find(".k-item:visible:eq(0)").outerHeight())),t=+l.find(".k-item:visible").eq(n).attr("data-value")),r.length&&(n=_(r.scrollTop(),Math.floor(r.find(".k-item:visible:eq(0)").outerHeight())),i=+r.find(".k-item:visible").eq(n).attr("data-value")),u.length&&(n=_(u.scrollTop(),Math.floor(u.find(".k-item:visible:eq(0)").outerHeight())),a=+u.find(".k-item:visible").eq(n).attr("data-value")),c.length&&(n=_(c.scrollTop(),Math.floor(c.find(".k-item:visible:eq(0)").outerHeight())),s=c.find(".k-item:visible").eq(n).attr("data-value")),o&&("PM"==s&&(t+=12,24==t&&(t=12)),"AM"===s&&12===t&&(t=0)),t!==e&&this._currentlySelected.setHours(t),i!==e&&this._currentlySelected.setMinutes(i),a!==e&&this._currentlySelected.setSeconds(a)},_itemClickHandler:function(e){var i=t(e.originalEvent.currentTarget),n=i.find(".k-item:visible").index(t(e.currentTarget)),a=i.find(".k-item:visible:eq(0)").outerHeight();i.scrollTop(n*a)},getDatesInRange:function(t,e,i,a,s,o){for(var l=[];;){if(e&&(n(o)>=e||i.getDate()!=o.getDate())){t=n(o),i<o&&(t+=K),t>e&&(o=new it((+a))),n(o)>0&&l.push(new Date(o));break}if(i.getDate()!=o.getDate())break;l.push(new Date(o)),o.setTime(o.getTime()+s)}return l},_createListContent:function(t){var e,i,n,a=t.length,s="";for(n=0;n<a;n++)e=t[n],"literal"===e.type?s+=this._literalTemplate(e):(i=this._getValues(e,!0),s+=this._itemTemplate(i.values,e,this.options.messages[e.type],i.index));return s},_itemTemplate:function(t,e,i,n){var a,s="",o=t.length;for(s+='<div class="k-time-list-wrapper" role="presentation"><span class="k-title">'+(i||e.type)+'</span><div class="k-time-list"><div class="k-time-container k-content k-scrollable" role="presentation" data-index="'+n+'"><ul class="k-reset">',a=0;a<o;a++)s+='<li class="k-item" data-value="'+t[a]+'"><span>'+t[a]+"</span></li>";return s+='</ul><div class="k-scrollable-placeholder"></div></div></div></div>'},_getValues:function(t,e){var i,n,a=[],s=0;for("hour"===t.type?(s=1,i=1,n=t.hour12?12:24):"minute"===t.type?(i=2,n=59):"second"===t.type&&(i=3,n=59);s<=n;s++)a.push(e?g(s):s);return{values:a,index:i}},_literalTemplate:function(t){var e='<div class="k-time-separator">'+(" tt"===t.pattern?":":t.pattern)+"</div>";return" tt"===t.pattern&&(e+=this._itemTemplate(["AM","PM"],t,"AM/PM",4)),e},bind:function(){var t=this,e=t.options.dates;e&&e[0]?t.dataBind(e):t.refresh()},_html:function(t){var e=this;e.options.timeView&&"scroll"===e.options.timeView.list?(t=ft+t,e.ul.html(t)):(e.ul[0].innerHTML=t,e.popup.unbind(C,e._heightHandler),e.popup.one(C,e._heightHandler),e.current(null),e.select(e._value))},scroll:function(t){if(t){var e=this.list[0],i=t.offsetTop,n=t.offsetHeight,a=e.scrollTop,s=e.clientHeight,o=i+n;a>i?a=i:o>a+s&&(a=o-s),e.scrollTop=a}},select:function(e){var i,n=this,a=n.options,s=n._current;e instanceof Date&&(e=w.toString(e,a.format,a.culture)),"string"==typeof e&&(s&&s.text()===e?e=s:(e=t.grep(n.ul[0].childNodes,function(t){return(t.textContent||t.innerText)==e}),e=e[0]?e:null)),i=n._distinctSelection(e),n.current(i)},_distinctSelection:function(e){var i,a,s=this;return e&&e.length>1&&(i=n(s._value),a=t.inArray(i,s._dates),e=s.ul.children()[a]),e},setOptions:function(t){var e=this.options;t.min=y(t.min),t.max=y(t.max),this.options=tt(e,t,{active:e.active,change:e.change,close:e.close,open:e.open}),this.bind()},toggle:function(){var t=this;t.popup.visible()?t.close():t.open()},value:function(t){var e=this;e._value=t,e.ul[0].firstChild&&(e.options.timeView&&"scroll"===e.options.timeView.list?e.applyValue(t):e.select(t))},_click:function(e){var i=this,n=t(e.currentTarget),a=n.text(),s=i.options.dates;s&&s.length>0&&(a=s[n.index()]),e.isDefaultPrevented()||(i.select(n),i.options.change(a,!0),i.close())},_height:function(){var t=this,e=t.list,i=e.parent(".k-animation-container"),n=t.options.height;t.ul[0].children.length&&e.add(i).show().height(t.ul[0].scrollHeight>n?n:"auto").hide()},_parse:function(t){var e=this,i=e.options,a=n(i.min)!=n(ht)?i.min:null,s=n(i.max)!=n(ht)?i.max:null,o=e._value||a||s||ht;return t instanceof it?t:(t=y(t,i.parseFormats,i.culture),t&&(t=new it(o.getFullYear(),o.getMonth(),o.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())),t)},_adjustListWidth:function(){var t,e,i=this.list,n=i[0].style.width,a=this.options.anchor,s=w._outerWidth;!i.data("width")&&n||(t=window.getComputedStyle?window.getComputedStyle(a[0],null):0,e=t?parseFloat(t.width):s(a),t&&(H.mozilla||H.msie)&&(e+=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)+parseFloat(t.borderLeftWidth)+parseFloat(t.borderRightWidth)),n=e-(s(i)-i.width()),i.css({fontFamily:a.css("font-family"),width:n}).data("width",n))},_popup:function(){var t=this,e=t.list,i=t.options,n=i.anchor;this.options.omitPopup?e.appendTo(i.timeDiv):t.popup=new D.Popup(e,tt(i.popup,{anchor:n,open:i.open,close:i.close,animation:i.animation,isRtl:M.isRtl(i.anchor),activate:function(){t.options.timeView&&"scroll"===t.options.timeView.list&&(t.addTranslate(),t.applyValue(t._value),t._updateRanges(),t._focusList(t.list.find(".k-time-list-wrapper:eq(0)")))}}))},move:function(t){var i=this,n=t.keyCode,a=i.ul[0],s=i._current,o=n===b.DOWN;if(n===b.UP||o){if(t.altKey)return i.toggle(o),e;s=o?s?s[0].nextSibling:a.firstChild:s?s[0].previousSibling:a.lastChild,s&&i.select(s),i.options.change(i._current.text()),t.preventDefault()}else n!==b.ENTER&&n!==b.TAB&&n!==b.ESC||(t.preventDefault(),s&&i.options.change(s.text(),!0),i.close())}},v.getMilliseconds=n,w.TimeView=v,k=S.extend({init:function(e,i){var a,s,l,r,u,c,d=this;i=i||{},i.componentType=i.componentType||"classic",S.fn.init.call(d,e,i),e=d.element,i=d.options,i.min=y(e.attr("min"))||y(i.min),i.max=y(e.attr("max"))||y(i.max),+i.max==+ht&&+i.min==+ht||(this._specifiedRange=!0),o(i),d._initialOptions=tt({},i),d._wrapper(),d.options.timeView&&"scroll"===d.options.timeView.list&&(d.options.height=null),d.timeView=s=new v(tt({},i,{id:e.attr(J),anchor:d.wrapper,format:i.format,change:function(t,i){i?d._change(t):e.val(t)},open:function(t){d.options.timeView&&"scroll"!==d.options.timeView.list?d.timeView._adjustListWidth():d.timeView._updateTitle(),d.trigger(C)?t.preventDefault():(e.attr(Q,!0),a.attr(U,!1))},close:function(t){d.trigger(V)?t.preventDefault():(e.attr(Q,!1),a.attr(U,!0))},active:function(t){e&&e.length&&e[0].removeAttribute(Z),t&&e.attr(Z,s._optionID)},specifiedRange:d._specifiedRange})),a=s.ul,d._icon(),d._reset();try{e[0].setAttribute("type","text")}catch(h){e[0].type="text"}e.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":s._timeViewID,autocomplete:"off"}),l=e.is("[disabled]")||t(d.element).parents("fieldset").is(":disabled"),l?d.enable(!1):d.readonly(e.is("[readonly]")),i.dateInput&&(r=i.min,u=i.max,c=new it,n(r)==n(u)&&(r=new it(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0),u=new it(c.getFullYear(),c.getMonth(),c.getDate(),24,0,0)),d._dateInput=new D.DateInput(e,{culture:i.culture,format:i.format,min:r,max:u,value:i.value,interval:i.interval})),d._old=d._update(i.value||d.element.val()),d._oldText=e.val(),w.notify(d)},options:{name:"TimePicker",min:ht,max:ht,format:"",dates:[],parseFormats:[],value:null,interval:30,height:200,animation:{},dateInput:!1,messages:{set:"Set",cancel:"Cancel",hour:"hour",minute:"minute",second:"second",millisecond:"millisecond",now:"Now"}},events:[C,V,L],componentTypes:{classic:{timeView:{list:"list"}},modern:{timeView:{list:"scroll"}}},setOptions:function(t){var e=this,i=e._value;S.fn.setOptions.call(e,t),t=e.options,o(t),e.timeView.setOptions(t),i&&e.element.val(w.toString(i,t.format,t.culture))},dataBind:function(t){$(t)&&this.timeView.dataBind(t)},_editable:function(t){var e=this,i=t.disable,n=t.readonly,a=e._arrow.off(R),s=e.element.off(R),o=e._inputWrapper.off(R);e._dateInput&&e._dateInput._unbindInput(),n||i?(o.addClass(i?G:I).removeClass(i?I:G),s.attr(F,i).attr(A,n).attr(X,i)):(o.addClass(I).removeClass(G).on(Y,e._toggleHover),s&&s.length&&(s[0].removeAttribute(F),s[0].removeAttribute(A)),s.attr(X,!1).on("keydown"+R,et(e._keydown,e)).on("focusout"+R,et(e._blur,e)).on("focus"+R,function(){e._inputWrapper.addClass(P)}),e._dateInput&&e._dateInput._bindInput(),a.on(q,et(e._click,e)).on(B,l))},readonly:function(t){this._editable({readonly:t===e||t,disable:!1})},enable:function(t){this._editable({readonly:!1,disable:!(t=t===e||t)})},destroy:function(){var t=this;S.fn.destroy.call(t),t.timeView.destroy(),t.element.off(R),t._arrow.off(R),t._inputWrapper.off(R),t._form&&t._form.off("reset",t._resetHandler)},close:function(){this.timeView.close()},open:function(){this.timeView.open()},min:function(t){return this._option("min",t)},max:function(t){return this._option("max",t)},value:function(t){var i=this;return t===e?i._value:(i._old=i._update(t),null===i._old&&i.element.val(""),i._oldText=i.element.val(),e)},_blur:function(){var t=this,e=t.element.val();t.options.timeView&&"scroll"===t.options.timeView.list||t.close(),e!==t._oldText&&t._change(e),t._inputWrapper.removeClass(P)},_click:function(){var t=this,e=t.element;t.timeView.toggle(),M.touch||e[0]===x()||e.trigger("focus")},_change:function(t){var e,i,n,a=this,s=a.element.val();t=a._update(t),e=!w.calendar.isEqualDate(a._old,t),i=e&&!a._typing,n=s!==a.element.val(),(i||n)&&a.element.trigger(L),e&&(a._old=t,a._oldText=a.element.val(),a.trigger(L)),a._typing=!1},_icon:function(){var e,i=this,n=i.element;e=n.next("span.k-select"),e[0]||(e=t('<span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-clock"></span></span>').insertAfter(n)),i._arrow=e.attr({role:"button","aria-controls":i.timeView._timeViewID})},_keydown:function(t){var e=this,i=t.keyCode,n=e.timeView,a=e.element.val();n.popup.visible()||t.altKey?(n.move(t),e._dateInput&&t.stopImmediatePropagation&&t.stopImmediatePropagation()):i===b.ENTER&&a!==e._oldText?e._change(a):e._typing=!0},_option:function(t,i){var n=this,a=n.options;return i===e?a[t]:(i=n.timeView._parse(i),i&&(i=new it((+i)),a[t]=i,n.timeView.options[t]=i,n.timeView.bind()),e)},_toggleHover:function(e){t(e.currentTarget).toggleClass(W,"mouseenter"===e.type)},_update:function(t){var e=this,i=e.options,n=e.timeView,a=n._parse(t);return s(a,i.min,i.max)||(a=null),e._value=a,e._currentlySelected=a,e._dateInput&&a?e._dateInput.value(a||t):e.element.val(w.toString(a||t,i.format,i.culture)),n.value(a),a},_wrapper:function(){var e,i=this,n=i.element;e=n.parents(".k-timepicker"),e[0]||(e=n.wrap(E).parent().addClass("k-picker-wrap k-state-default"),e=e.wrap(E).parent()),e[0].style.cssText=n[0].style.cssText,i.wrapper=e.addClass("k-widget k-timepicker").addClass(n[0].className),n.css({width:"100%",height:n[0].style.height}),i._inputWrapper=t(e[0].firstChild)},_reset:function(){var e=this,i=e.element,n=i.attr("form"),a=n?t("#"+n):i.closest("form");a[0]&&(e._resetHandler=function(){e.value(i[0].defaultValue),e.max(e._initialOptions.max),e.min(e._initialOptions.min)},e._form=a.on("reset",e._resetHandler))}}),D.plugin(k)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,i){(i||e)()});