import{r as t,c as e,h as a,H as i}from"./p-21516f8c.js";const o=':host{display:inline-block}.container{border-radius:2px;display:flex;border:1px solid #686a6f}.toggle{padding:var(--lu-toggle-padding-top, 0.563em) var(--lu-toggle-padding-end, 2em) var(--lu-toggle-padding-bottom, 0.563em) var(--lu-toggle-padding-start, 3em);position:relative;border-style:none;background-color:#ffffff;font-family:var(--lu-toggle-font-family, "Roboto", sans-serif);font-size:var(--lu-toggle-font-size, 16px)}button{margin:0}.left-toggle{display:flex;align-items:center;justify-content:end;border-right:1px solid #686a6f}.right-toggle{display:flex;align-items:center;justify-content:end;border-left:none}:host([data-start-active]) .left-toggle{padding-left:var(--lu-toggle-active-padding-start, 3em);padding-right:var(--lu-toggle-padding-end, 2em);box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.2)}:host([data-start-active]) .right-toggle{background-color:#c6c7c9;cursor:pointer}:host([data-end-active]) .right-toggle{padding-left:var(--lu-toggle-active-padding-start, 3em);padding-right:var(--lu-toggle-padding-end, 2em);box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.2)}:host([data-end-active]) .left-toggle{background-color:#c6c7c9;cursor:pointer}.toggle lu-icon{left:0.5em;position:absolute;font-size:var(--lu-toggle-check-icon-font-size, 23px)}';const l=class{constructor(a){t(this,a);this.luToggleChanged=e(this,"luToggleChanged",7);this.startSelected=true}startSelectedHandler(t,e){if(t!==e){if(t){this.toggler("start")}else{this.toggler("end")}}}valueWatcher(t,e){this.luToggleChanged.emit({value:t,oldValue:e})}componentWillLoad(){this.value=this.startSelected?this.startValue:this.endValue}toggler(t){if(t==="start"){if(!this.startSelected){this.value=this.startValue;this.startSelected=true}}if(t==="end"){if(this.startSelected){this.value=this.endValue;this.startSelected=false}}}hostData(){return{"data-start-active":this.startSelected,"data-end-active":!this.startSelected}}__stencil_render(){return a("div",{class:"container"},a("button",{type:"button",class:"toggle left-toggle",onClick:()=>this.toggler("start")},this.startSelected?a("lu-icon",{name:"md-checkmark"}):null,this.startText),a("button",{type:"button",class:"toggle right-toggle",onClick:()=>this.toggler("end")},!this.startSelected?a("lu-icon",{name:"md-checkmark"}):null,this.endText))}static get watchers(){return{startSelected:["startSelectedHandler"],value:["valueWatcher"]}}render(){return a(i,this.hostData(),this.__stencil_render())}};l.style=o;export{l as lu_toggle};
//# sourceMappingURL=p-7b0352ff.entry.js.map