import{r as s,c as t,h as a,H as i}from"./p-7d0be017.js";const o=class{constructor(a){s(this,a),this.gascoChangeValue=t(this,"gascoChangeValue",7),this.gascoBlur=t(this,"gascoBlur",7),this.gascoFocus=t(this,"gascoFocus",7),this.fireFocusEvents=!0,this.hasFocus=!1,this.showCalendar=!1,this.inputValue="",this.onFocus=s=>{this.hasFocus=!0,this.showCalendar||(this.showCalendar=!0),this.fireFocusEvents&&this.gascoFocus.emit(s)},this.onBlur=s=>{this.hasFocus=!1,this.showCalendar&&(this.showCalendar=!1),this.fireFocusEvents&&this.gascoBlur.emit(s)}}handleDatetimeReady(s){const{month:t,day:a,year:i}=s.detail,o=`${a}/${t}/${i}`;this.inputValue=o,this.gascoChangeValue.emit({value:o})}render(){const{onFocus:s,onBlur:t,showCalendar:o,inputValue:e}=this;return a(i,{onBlur:t,onFocus:s,class:{"gasco-color":!0,"gasco-calendar":!0,"gasco-color-primary":!0,"has-focus":this.hasFocus}},a("div",{class:"native-calendar",part:"native"},a("gasco-input",{class:"input-datetime",value:e,readonly:!0},a("ion-icon",{name:"calendar-number-outline",slot:"end"})),o&&a("gasco-datetime",{size:"cover"})))}};o.style=":host(.gasco-calendar){position:relative;max-width:350px;width:100%}.native-calendar{max-width:inherit;width:100%}:host(.gasco-calendar) gasco-datetime{position:absolute;left:0;right:0;top:55px;box-shadow:0px 4px 4px var(--gasco-color-medium, #999999);border-radius:0 0 15px 15px;max-width:340px;margin-inline:5px;z-index:9999}";export{o as gasco_calendar}