import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","value","defaultValue","onChange","id","name","inputRef","maxLength","disabled","size","view","form","status","onBlur","onFocus","autoFocus","placeholder","leftSide","rightSide","autoComplete","clearButton","readOnly","type","tabIndex","ariaLabel","iconSize","onClick","onKeyDown","onKeyDownCapture","onKeyUp","onKeyUpCapture","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onClear","onWheel","iconClear","iconShowPassword","iconHidePassword"];import React,{forwardRef}from"react";import{FieldClearButton,FieldControlLayout,FieldInput,FieldToggleVisiblePasswordButton,renderSide}from"../../FieldComponents";import{useFlag}from"../../../hooks/useFlag";import{useForkRef}from"../../../hooks/useForkRef";import{useTextField}from"../useTextField";export var TextFieldTypePassword=forwardRef(function(a,b){var c=a.className,d=a.value,e=a.defaultValue,f=a.onChange,g=a.id,h=a.name,i=a.inputRef,j=a.maxLength,k=a.disabled,l=a.size,m=void 0===l?"m":l,n=a.view,o=void 0===n?"default":n,p=a.form,q=a.status,r=a.onBlur,s=a.onFocus,t=a.autoFocus,u=a.placeholder,v=a.leftSide,w=a.rightSide,x=a.autoComplete,y=a.clearButton,z=a.readOnly,A=a.type,B=a.tabIndex,C=a.ariaLabel,D=a.iconSize,E=a.onClick,F=a.onKeyDown,G=a.onKeyDownCapture,H=a.onKeyUp,I=a.onKeyUpCapture,J=a.onCopy,K=a.onCopyCapture,L=a.onCut,M=a.onCutCapture,N=a.onPaste,O=a.onPasteCapture,P=a.onClear,Q=a.onWheel,R=a.iconClear,S=a.iconShowPassword,T=a.iconHidePassword,U=_objectWithoutProperties(a,_excluded),V=useTextField({onClick:E,onChange:f,onBlur:r,onFocus:s,disabled:k,onClear:P}),W=V.handleBlur,X=V.handleChange,Y=V.handleClear,Z=V.handleFocus,$=V.focused,_=V.withValue,aa=V.ref,ba=V.inputRef,ca=V.handleClick,da=useFlag(),ea=_slicedToArray(da,2),fa=ea[0],ga=ea[1];return React.createElement(FieldControlLayout,Object.assign({},U,{className:c,form:p,status:q,size:m,leftSide:renderSide(v,m,D),rightSide:[y&&!k&&_&&React.createElement(FieldClearButton,{size:m,onClick:Y,icon:R}),_&&React.createElement(FieldToggleVisiblePasswordButton,{size:m,onClick:ga.toggle,active:fa,startIcon:S,endIcon:T})],focused:$,view:o,ref:useForkRef([b,aa]),disabled:k,onClick:ca}),React.createElement(FieldInput,{type:fa?"text":"password",placeholder:u,autoFocus:t,autoComplete:x,onBlur:W,onChange:X,onFocus:Z,defaultValue:e||void 0,value:null===d?"":d,ref:useForkRef([i,ba]),readOnly:z,tabIndex:B,"aria-label":C,onKeyDown:F,onKeyDownCapture:G,onKeyUp:H,onKeyUpCapture:I,maxLength:j,disabled:k,id:g,name:h,onCopy:J,onCopyCapture:K,onCut:L,onCutCapture:M,onPaste:N,onPasteCapture:O,onWheel:Q}))});
//# sourceMappingURL=TextFieldTypePassword.js.map