var __awaiter=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(n,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r["throw"](e))}catch(e){a(e)}}function u(e){e.done?n(e.value):new i(function(t){t(e.value)}).then(o,l)}u((r=r.apply(e,t||[])).next())})};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(e){return function(t){return u([e,t])}}function u(o){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-4f5dbe8b.system.js"],function(e){"use strict";var t,i,r,n;return{setters:[function(e){t=e.r;i=e.c;r=e.h;n=e.H}],execute:function(){var a=e("materials_time_field",function(){function e(e){t(this,e);this.timepicker=true;this.timepickerStep=15;this.timepickerFormat="24h";this.input=i(this,"input",7)}e.prototype.isValid=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){switch(e.label){case 0:return[4,this.materialsTextFieldEl.isValid()];case 1:return[2,e.sent()]}})})};e.prototype.forceValidation=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){this.materialsTextFieldEl.forceValidation();return[2]})})};e.prototype.componentWillLoad=function(){if(this.outlined&&this.fullwidth){console.warn("[materials-date-field] You should not use fullwidth and outlined together")}};e.prototype.updateValue=function(){if(this.materialsTextFieldEl){this.materialsTextFieldEl.value=this.value}};e.prototype.renderTimePicker=function(){var e=this;if(!this.timepicker)return;return r("materials-menu",{maxHeight:200,noPadding:true,ref:function(t){return e.materialsMenuTimepickerEl=t}},r("materials-timepicker",{timeSelected:this.value,clock24:this.timepickerFormat==="24h",step:this.timepickerStep,onTimeSelectedChange:function(t){e.value=t.detail;e.input.emit();if(e.materialsMenuTimepickerEl)e.materialsMenuTimepickerEl.close()},onClick:function(e){return e.stopPropagation()}}))};e.prototype.openPicker=function(e){return __awaiter(this,void 0,void 0,function(){var t,i,r;return __generator(this,function(n){switch(n.label){case 0:if(this.disabled){return[2]}if(!this.timepicker)return[3,2];e.stopPropagation();e.preventDefault();if(!this.materialsMenuTimepickerEl)return[3,2];return[4,this.materialsMenuTimepickerEl.open()];case 1:n.sent();t=this.materialsMenuTimepickerEl.querySelector("materials-timepicker");i=this.materialsMenuTimepickerEl.shadowRoot.querySelector(".mdc-menu");r=t.shadowRoot.querySelector("materials-list-item[selected]");if(t&&i&&r)i.scrollTop=r.offsetTop-60;n.label=2;case 2:return[2]}})})};e.prototype.render=function(){var e=this;return r(n,{class:{"materials-time-field--dense":this.dense}},r("materials-text-field",{class:"timepicker-with-value",type:"time",value:this.value,label:this.label,fullwidth:this.fullwidth,dense:this.dense,outlined:this.outlined,focused:this.focused,disabled:this.disabled,leadingIcon:this.leadingIcon,required:this.required,width:this.width,helperText:this.helperText,persistent:this.persistent,hideNativeClear:true,customValidation:this.customValidation,ref:function(t){return e.materialsTextFieldEl=t},onInput:function(t){t.stopPropagation();e.input.emit(t.detail)},onClick:function(t){return e.openPicker(t)}}),this.renderTimePicker())};Object.defineProperty(e,"watchers",{get:function(){return{value:["updateValue"]}},enumerable:true,configurable:true});Object.defineProperty(e,"style",{get:function(){return":host{display:-ms-flexbox;display:flex}.date-picker{padding:16px}"},enumerable:true,configurable:true});return e}())}}});