import{q as d,r as c}from"./chunk-3DUK4Z3F.js";import{b as p}from"./chunk-HAAHFJJA.js";import{b as l}from"./chunk-NQENCJMJ.js";import{e as n,i as u,m as o,n as f,q as g}from"./chunk-QECZUVWI.js";import"./chunk-S5EYVFES.js";var m="",I="",k=(()=>{let i=class{constructor(t){u(this,t),this.type="password",this.togglePasswordVisibility=()=>{let{inputElRef:s}=this;s&&(s.type=s.type==="text"?"password":"text")}}onTypeChange(t){if(t!=="text"&&t!=="password"){n(`[ion-input-password-toggle] - Only inputs of type "text" or "password" are supported. Input of type "${t}" is not compatible.`,this.el);return}}connectedCallback(){let{el:t}=this,s=this.inputElRef=t.closest("ion-input");if(!s){n("[ion-input-password-toggle] - No ancestor ion-input found. This component must be slotted inside of an ion-input.",t);return}this.type=s.type}disconnectedCallback(){this.inputElRef=null}render(){var t,s;let{color:r,type:h}=this,a=l(this),y=(t=this.showIcon)!==null&&t!==void 0?t:d,w=(s=this.hideIcon)!==null&&s!==void 0?s:c,e=h==="text";return o(f,{key:"91bc55664d496fe457518bd112865dd7811d0c17",class:p(r,{[a]:!0})},o("ion-button",{key:"6344d6838f5cdcba54c6bf4b592f036092044de0",mode:a,color:r,fill:"clear",shape:"round","aria-label":e?"Hide password":"Show password","aria-pressed":e?"true":"false",type:"button",onPointerDown:b=>{b.preventDefault()},onClick:this.togglePasswordVisibility},o("ion-icon",{key:"a2bd9197c2635bf8cb155ff25ce022e7d7dc6d00",slot:"icon-only","aria-hidden":"true",icon:e?w:y})))}get el(){return g(this)}static get watchers(){return{type:["onTypeChange"]}}};return i.style={ios:m,md:I},i})();export{k as ion_input_password_toggle};
