/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import{r as M,f as s,e as w,h as i,d as t,g as L}from"./p-C8IsBmNU.js";import{c as o}from"./p-DiVJyqlX.js";import{x as n,y as N}from"./p-COG0_eom.js";import{c as D,b as e}from"./p-COLHV2ym.js";const y=class{constructor(s){M(this,s),this.type="password",this.togglePasswordVisibility=()=>{const{inputElRef:M}=this;M&&(M.type="text"===M.type?"password":"text")}}onTypeChange(M){"text"===M||"password"===M||s(`[ion-input-password-toggle] - Only inputs of type "text" or "password" are supported. Input of type "${M}" is not compatible.`,this.el)}connectedCallback(){const{el:M}=this,w=this.inputElRef=M.closest("ion-input");w?this.type=w.type:s("[ion-input-password-toggle] - No ancestor ion-input found. This component must be slotted inside of an ion-input.",M)}disconnectedCallback(){this.inputElRef=null}get inputPasswordHideIcon(){if(null!=this.hideIcon)return this.hideIcon;const M=D(this),s={ios:n,ionic:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTYgMjU2IiBmaWxsPSJjdXJyZW50Q29sb3IiPjxwYXRoIGQ9Ik01My45MiwzNC42MkE4LDgsMCwxLDAsNDIuMDgsNDUuMzhMNjEuMzIsNjYuNTVDMjUsODguODQsOS4zOCwxMjMuMiw4LjY5LDEyNC43NmE4LDgsMCwwLDAsMCw2LjVjLjM1Ljc5LDguODIsMTkuNTcsMjcuNjUsMzguNEM2MS40MywxOTQuNzQsOTMuMTIsMjA4LDEyOCwyMDhhMTI3LjExLDEyNy4xMSwwLDAsMCw1Mi4wNy0xMC44M2wyMiwyNC4yMWE4LDgsMCwxLDAsMTEuODQtMTAuNzZabTQ3LjMzLDc1Ljg0LDQxLjY3LDQ1Ljg1YTMyLDMyLDAsMCwxLTQxLjY3LTQ1Ljg1Wk0xMjgsMTkyYy0zMC43OCwwLTU3LjY3LTExLjE5LTc5LjkzLTMzLjI1QTEzMy4xNiwxMzMuMTYsMCwwLDEsMjUsMTI4YzQuNjktOC43OSwxOS42Ni0zMy4zOSw0Ny4zNS00OS4zOGwxOCwxOS43NWE0OCw0OCwwLDAsMCw2My42Niw3MGwxNC43MywxNi4yQTExMiwxMTIsMCwwLDEsMTI4LDE5MlptNi05NS40M2E4LDgsMCwwLDEsMy0xNS43Miw0OC4xNiw0OC4xNiwwLDAsMSwzOC43Nyw0Mi42NCw4LDgsMCwwLDEtNy4yMiw4LjcxLDYuMzksNi4zOSwwLDAsMS0uNzUsMCw4LDgsMCwwLDEtOC03LjI2QTMyLjA5LDMyLjA5LDAsMCwwLDEzNCw5Ni41N1ptMTEzLjI4LDM0LjY5Yy0uNDIuOTQtMTAuNTUsMjMuMzctMzMuMzYsNDMuOGE4LDgsMCwxLDEtMTAuNjctMTEuOTJBMTMyLjc3LDEzMi43NywwLDAsMCwyMzEuMDUsMTI4YTEzMy4xNSwxMzMuMTUsMCwwLDAtMjMuMTItMzAuNzdDMTg1LjY3LDc1LjE5LDE1OC43OCw2NCwxMjgsNjRhMTE4LjM3LDExOC4zNywwLDAsMC0xOS4zNiwxLjU3QTgsOCwwLDEsMSwxMDYsNDkuNzksMTM0LDEzNCwwLDAsMSwxMjgsNDhjMzQuODgsMCw2Ni41NywxMy4yNiw5MS42NiwzOC4zNSwxOC44MywxOC44MywyNy4zLDM3LjYyLDI3LjY1LDM4LjQxQTgsOCwwLDAsMSwyNDcuMzEsMTMxLjI2WiIvPjwvc3ZnPg==",md:n};return w.get("inputPasswordHideIcon",s[M]||s.md)}get inputPasswordShowIcon(){if(null!=this.showIcon)return this.showIcon;const M=D(this),s={ios:N,ionic:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTYgMjU2IiBmaWxsPSJjdXJyZW50Q29sb3IiPjxwYXRoIGQ9Ik0yNDcuMzEsMTI0Ljc2Yy0uMzUtLjc5LTguODItMTkuNTgtMjcuNjUtMzguNDFDMTk0LjU3LDYxLjI2LDE2Mi44OCw0OCwxMjgsNDhTNjEuNDMsNjEuMjYsMzYuMzQsODYuMzVDMTcuNTEsMTA1LjE4LDksMTI0LDguNjksMTI0Ljc2YTgsOCwwLDAsMCwwLDYuNWMuMzUuNzksOC44MiwxOS41NywyNy42NSwzOC40QzYxLjQzLDE5NC43NCw5My4xMiwyMDgsMTI4LDIwOHM2Ni41Ny0xMy4yNiw5MS42Ni0zOC4zNGMxOC44My0xOC44MywyNy4zLTM3LjYxLDI3LjY1LTM4LjRBOCw4LDAsMCwwLDI0Ny4zMSwxMjQuNzZaTTEyOCwxOTJjLTMwLjc4LDAtNTcuNjctMTEuMTktNzkuOTMtMzMuMjVBMTMzLjQ3LDEzMy40NywwLDAsMSwyNSwxMjgsMTMzLjMzLDEzMy4zMywwLDAsMSw0OC4wNyw5Ny4yNUM3MC4zMyw3NS4xOSw5Ny4yMiw2NCwxMjgsNjRzNTcuNjcsMTEuMTksNzkuOTMsMzMuMjVBMTMzLjQ2LDEzMy40NiwwLDAsMSwyMzEuMDUsMTI4QzIyMy44NCwxNDEuNDYsMTkyLjQzLDE5MiwxMjgsMTkyWm0wLTExMmE0OCw0OCwwLDEsMCw0OCw0OEE0OC4wNSw0OC4wNSwwLDAsMCwxMjgsODBabTAsODBhMzIsMzIsMCwxLDEsMzItMzJBMzIsMzIsMCwwLDEsMTI4LDE2MFoiLz48L3N2Zz4=",md:N};return w.get("inputPasswordShowIcon",s[M]||s.md)}render(){const{color:M,inputPasswordHideIcon:s,inputPasswordShowIcon:w,type:L}=this,n=e(this),N="text"===L;return i(t,{key:"e265bb6460041189fea1812d391121a9e8dde669",class:o(M,{[n]:!0})},i("ion-button",{key:"b7ca2e12e3b1b9a161acc002abb8f1b8efeea46e",mode:n,color:M,fill:"clear",shape:"round","aria-checked":N?"true":"false","aria-label":N?"Hide password":"Show password",role:"switch",type:"button",onPointerDown:M=>{M.preventDefault()},onClick:this.togglePasswordVisibility},i("ion-icon",{key:"4d5ba21325812d9c820ae26688d17ae821ffd25c",slot:"icon-only","aria-hidden":"true",icon:N?s:w})))}get el(){return L(this)}static get watchers(){return{type:["onTypeChange"]}}};y.style={ionic:":host ion-button{--color:var(--token-primitives-neutral-800, #626262);--margin-end:calc(-1 * var(--padding-end));--padding-end:inherit;--icon-size:var(--token-font-size-400, 16px);-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end);margin-top:0;margin-bottom:0;width:var(--size);height:var(--size)}:host ion-button ion-icon{font-size:var(--icon-size)}",ios:"",md:""};export{y as ion_input_password_toggle}