import{r as s,h as t,a as e}from"./p-D0dWnGvB.js";const i=class{constructor(t){s(this,t),this.currentStep=1,this.title="",this.description="",this.activeStep=0,this.nextStep=!0,this.showStepName=!0,this.showStepDescription=!0,this.internalActiveStep=1,this.isActive=!1,this.labelState="upcoming",this.labelStyle="circle",this.handleFocus=()=>{this.stepContentRef.classList.add("focus")},this.handleFocusOut=()=>{this.stepContentRef.classList.remove("focus")},this.handleEscape=s=>{if("Escape"===s.key){this.handleFocusOut();const s=this.el.querySelector("input");s&&s.blur()}}}componentWillLoad(){this.updateState(),window.addEventListener("keydown",this.handleEscape)}disconnectedCallback(){window.removeEventListener("keydown",this.handleEscape)}stepChangeHandler(s){this.internalActiveStep=s.detail,console.log("stepChangeHandler",s.detail),this.isActive=s.detail>this.currentStep,this.labelState=s.detail>this.currentStep?"completed":s.detail<this.currentStep?"upcoming":"current"}updateState(){this.isActive=this.internalActiveStep>this.currentStep,this.labelState=this.internalActiveStep>this.currentStep?"completed":this.internalActiveStep<this.currentStep?"upcoming":"current"}labelChildren(s){return"completed"===this.labelState?t("i",{class:"hgi-stroke hgi-tick-02",style:{fontSize:"16px"}}):s.toString()}render(){return t("div",{key:"1dbf3a46fd2a16be1fed73c03024f3e6a4aab05f",class:"progress-indicator__step",onMouseDown:this.handleFocus,onMouseUp:this.handleFocusOut},t("div",{key:"fd7b1d9d72dc84e78a9b5a86febf9a3fe1477b14",class:"progress-indicator__step-content dga-flex-column",ref:s=>this.stepContentRef=s},t("div",{key:"20398cc4dbfe44280b10f13e5741a55c74aa2ae0",class:"step-label","data-state":this.labelState},t("span",{key:"afc36029e3aedc6b657b4c71e43bc902c49660a8",class:`step-label--${this.labelStyle}`},"circle"===this.labelStyle&&this.labelChildren(this.currentStep))),t("div",{key:"e9ac3adb6f843e081e51c788163b3e4dc1a83490",class:"step-text dga-flex-column"},this.showStepName&&t("span",{key:"a14606aa329d9c664577e92525c6a5969b43a5bd",class:this.isActive?"text-md-medium":"text-md-regular"},this.title),this.showStepDescription&&t("p",{key:"aa46e054ae72ffda1c48a776195a41d2c0209c67",class:"text-sm-regular"},this.description))),this.nextStep&&t("span",{key:"a24a8f4ff6b89bae49d9f3429a9a7bdbdb95c14f",class:"progress-indicator__step-connector "+(this.isActive?"progress-indicator__step-connector--active":"")}))}get el(){return e(this)}};export{i as dga_progress_indicator_step_v3}