import{d as ne,ah as a,am as ar,ap as ve,aj as ir,m as w,q as be,az as lr,p as _,cb as sr,ar as m,aW as d,aq as A,aM as $,au as Y,aA as cr,ai as Be,cc as dr,cd as ur,av as Ce,aZ as hr,aY as fr,aS as ze,s as vr,aK as pr,aL as Se,aJ as gr,ce as br,aN as pe,cf as xr,aB as mr,cg as oe,aQ as ge,bh as wr,F as yr,ch as Cr,a$ as Fe,aw as Ae,b0 as y,aG as $e,ax as Re}from"./index-d63aee15.js";import{u as zr,N as _e,a as Sr}from"./Suffix-2e1b8ac3.js";const Fr=ne({name:"Eye",render(){return a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},a("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),a("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),Ar=ne({name:"EyeOff",render(){return a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},a("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),a("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),a("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),a("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),a("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),$r={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},Rr=r=>{const{textColor2:p,textColor3:t,textColorDisabled:S,primaryColor:C,primaryColorHover:g,inputColor:u,inputColorDisabled:s,borderColor:c,warningColor:i,warningColorHover:l,errorColor:h,errorColorHover:b,borderRadius:E,lineHeight:z,fontSizeTiny:te,fontSizeSmall:V,fontSizeMedium:ae,fontSizeLarge:F,heightTiny:P,heightSmall:O,heightMedium:B,heightLarge:ie,actionColor:T,clearColor:I,clearColorHover:R,clearColorPressed:k,placeholderColor:L,placeholderColorDisabled:N,iconColor:le,iconColorDisabled:se,iconColorHover:K,iconColorPressed:ce}=r;return Object.assign(Object.assign({},$r),{countTextColorDisabled:S,countTextColor:t,heightTiny:P,heightSmall:O,heightMedium:B,heightLarge:ie,fontSizeTiny:te,fontSizeSmall:V,fontSizeMedium:ae,fontSizeLarge:F,lineHeight:z,lineHeightTextarea:z,borderRadius:E,iconSize:"16px",groupLabelColor:T,groupLabelTextColor:p,textColor:p,textColorDisabled:S,textDecorationColor:p,caretColor:C,placeholderColor:L,placeholderColorDisabled:N,color:u,colorDisabled:s,colorFocus:u,groupLabelBorder:`1px solid ${c}`,border:`1px solid ${c}`,borderHover:`1px solid ${g}`,borderDisabled:`1px solid ${c}`,borderFocus:`1px solid ${g}`,boxShadowFocus:`0 0 0 2px ${ve(C,{alpha:.2})}`,loadingColor:C,loadingColorWarning:i,borderWarning:`1px solid ${i}`,borderHoverWarning:`1px solid ${l}`,colorFocusWarning:u,borderFocusWarning:`1px solid ${l}`,boxShadowFocusWarning:`0 0 0 2px ${ve(i,{alpha:.2})}`,caretColorWarning:i,loadingColorError:h,borderError:`1px solid ${h}`,borderHoverError:`1px solid ${b}`,colorFocusError:u,borderFocusError:`1px solid ${b}`,boxShadowFocusError:`0 0 0 2px ${ve(h,{alpha:.2})}`,caretColorError:h,clearColor:I,clearColorHover:R,clearColorPressed:k,iconColor:le,iconColorDisabled:se,iconColorHover:K,iconColorPressed:ce,suffixTextColor:p})},_r={name:"Input",common:ar,self:Rr},Er=_r,Te=ir("n-input");function Br(r){let p=0;for(const t of r)p++;return p}function re(r){return r===""||r==null}function Tr(r){const p=w(null);function t(){const{value:g}=r;if(!(g!=null&&g.focus)){C();return}const{selectionStart:u,selectionEnd:s,value:c}=g;if(u==null||s==null){C();return}p.value={start:u,end:s,beforeText:c.slice(0,u),afterText:c.slice(s)}}function S(){var g;const{value:u}=p,{value:s}=r;if(!u||!s)return;const{value:c}=s,{start:i,beforeText:l,afterText:h}=u;let b=c.length;if(c.endsWith(h))b=c.length-h.length;else if(c.startsWith(l))b=l.length;else{const E=l[i-1],z=c.indexOf(E,i-1);z!==-1&&(b=z+1)}(g=s.setSelectionRange)===null||g===void 0||g.call(s,b,b)}function C(){p.value=null}return be(r,C),{recordCursor:t,restoreCursor:S}}const Ee=ne({name:"InputWordCount",setup(r,{slots:p}){const{mergedValueRef:t,maxlengthRef:S,mergedClsPrefixRef:C,countGraphemesRef:g}=lr(Te),u=_(()=>{const{value:s}=t;return s===null||Array.isArray(s)?0:(g.value||Br)(s)});return()=>{const{value:s}=S,{value:c}=t;return a("span",{class:`${C.value}-input-word-count`},sr(p.default,{value:c===null||Array.isArray(c)?"":c},()=>[s===void 0?u.value:`${u.value} / ${s}`]))}}}),Pr=m("input",` max-width: 100%; cursor: text; line-height: 1.5; z-index: auto; outline: none; box-sizing: border-box; position: relative; display: inline-flex; border-radius: var(--n-border-radius); background-color: var(--n-color); transition: background-color .3s var(--n-bezier); font-size: var(--n-font-size); --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2); `,[d("input, textarea",` overflow: hidden; flex-grow: 1; position: relative; `),d("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder",` box-sizing: border-box; font-size: inherit; line-height: 1.5; font-family: inherit; border: none; outline: none; background-color: #0000; text-align: inherit; transition: -webkit-text-fill-color .3s var(--n-bezier), caret-color .3s var(--n-bezier), color .3s var(--n-bezier), text-decoration-color .3s var(--n-bezier); `),d("input-el, textarea-el",` -webkit-appearance: none; scrollbar-width: none; width: 100%; min-width: 0; text-decoration-color: var(--n-text-decoration-color); color: var(--n-text-color); caret-color: var(--n-caret-color); background-color: transparent; `,[A("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` width: 0; height: 0; display: none; `),A("&::placeholder",` color: #0000; -webkit-text-fill-color: transparent !important; `),A("&:-webkit-autofill ~",[d("placeholder","display: none;")])]),$("round",[Y("textarea","border-radius: calc(var(--n-height) / 2);")]),d("placeholder",` pointer-events: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden; color: var(--n-placeholder-color); `,[A("span",` width: 100%; display: inline-block; `)]),$("textarea",[d("placeholder","overflow: visible;")]),Y("autosize","width: 100%;"),$("autosize",[d("textarea-el, input-el",` position: absolute; top: 0; left: 0; height: 100%; `)]),m("input-wrapper",` overflow: hidden; display: inline-flex; flex-grow: 1; position: relative; padding-left: var(--n-padding-left); padding-right: var(--n-padding-right); `),d("input-mirror",` padding: 0; height: var(--n-height); line-height: var(--n-height); overflow: hidden; visibility: hidden; position: static; white-space: pre; pointer-events: none; `),d("input-el",` padding: 0; height: var(--n-height); line-height: var(--n-height); `,[A("+",[d("placeholder",` display: flex; align-items: center; `)])]),Y("textarea",[d("placeholder","white-space: nowrap;")]),d("eye",` display: flex; align-items: center; justify-content: center; transition: color .3s var(--n-bezier); `),$("textarea","width: 100%;",[m("input-word-count",` position: absolute; right: var(--n-padding-right); bottom: var(--n-padding-vertical); `),$("resizable",[m("input-wrapper",` resize: vertical; min-height: var(--n-height); `)]),d("textarea-el, textarea-mirror, placeholder",` height: 100%; padding-left: 0; padding-right: 0; padding-top: var(--n-padding-vertical); padding-bottom: var(--n-padding-vertical); word-break: break-word; display: inline-block; vertical-align: bottom; box-sizing: border-box; line-height: var(--n-line-height-textarea); margin: 0; resize: none; white-space: pre-wrap; scroll-padding-block-end: var(--n-padding-vertical); `),d("textarea-mirror",` width: 100%; pointer-events: none; overflow: hidden; visibility: hidden; position: static; white-space: pre-wrap; overflow-wrap: break-word; `)]),$("pair",[d("input-el, placeholder","text-align: center;"),d("separator",` display: flex; align-items: center; transition: color .3s var(--n-bezier); color: var(--n-text-color); white-space: nowrap; `,[m("icon",` color: var(--n-icon-color); `),m("base-icon",` color: var(--n-icon-color); `)])]),$("disabled",` cursor: not-allowed; background-color: var(--n-color-disabled); `,[d("border","border: var(--n-border-disabled);"),d("input-el, textarea-el",` cursor: not-allowed; color: var(--n-text-color-disabled); text-decoration-color: var(--n-text-color-disabled); `),d("placeholder","color: var(--n-placeholder-color-disabled);"),d("separator","color: var(--n-text-color-disabled);",[m("icon",` color: var(--n-icon-color-disabled); `),m("base-icon",` color: var(--n-icon-color-disabled); `)]),m("input-word-count",` color: var(--n-count-text-color-disabled); `),d("suffix, prefix","color: var(--n-text-color-disabled);",[m("icon",` color: var(--n-icon-color-disabled); `),m("internal-icon",` color: var(--n-icon-color-disabled); `)])]),Y("disabled",[d("eye",` color: var(--n-icon-color); cursor: pointer; `,[A("&:hover",` color: var(--n-icon-color-hover); `),A("&:active",` color: var(--n-icon-color-pressed); `)]),A("&:hover",[d("state-border","border: var(--n-border-hover);")]),$("focus","background-color: var(--n-color-focus);",[d("state-border",` border: var(--n-border-focus); box-shadow: var(--n-box-shadow-focus); `)])]),d("border, state-border",` box-sizing: border-box; position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; border-radius: inherit; border: var(--n-border); transition: box-shadow .3s var(--n-bezier), border-color .3s var(--n-bezier); `),d("state-border",` border-color: #0000; z-index: 1; `),d("prefix","margin-right: 4px;"),d("suffix",` margin-left: 4px; `),d("suffix, prefix",` transition: color .3s var(--n-bezier); flex-wrap: nowrap; flex-shrink: 0; line-height: var(--n-height); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; color: var(--n-suffix-text-color); `,[m("base-loading",` font-size: var(--n-icon-size); margin: 0 2px; color: var(--n-loading-color); `),m("base-clear",` font-size: var(--n-icon-size); `,[d("placeholder",[m("base-icon",` transition: color .3s var(--n-bezier); color: var(--n-icon-color); font-size: var(--n-icon-size); `)])]),A(">",[m("icon",` transition: color .3s var(--n-bezier); color: var(--n-icon-color); font-size: var(--n-icon-size); `)]),m("base-icon",` font-size: var(--n-icon-size); `)]),m("input-word-count",` pointer-events: none; line-height: 1.5; font-size: .85em; color: var(--n-count-text-color); transition: color .3s var(--n-bezier); margin-left: 4px; font-variant: tabular-nums; `),["warning","error"].map(r=>$(`${r}-status`,[Y("disabled",[m("base-loading",` color: var(--n-loading-color-${r}) `),d("input-el, textarea-el",` caret-color: var(--n-caret-color-${r}); `),d("state-border",` border: var(--n-border-${r}); `),A("&:hover",[d("state-border",` border: var(--n-border-hover-${r}); `)]),A("&:focus",` background-color: var(--n-color-focus-${r}); `,[d("state-border",` box-shadow: var(--n-box-shadow-focus-${r}); border: var(--n-border-focus-${r}); `)]),$("focus",` background-color: var(--n-color-focus-${r}); `,[d("state-border",` box-shadow: var(--n-box-shadow-focus-${r}); border: var(--n-border-focus-${r}); `)])])]))]),Ir=m("input",[$("disabled",[d("input-el, textarea-el",` -webkit-text-fill-color: var(--n-text-color-disabled); `)])]),kr=Object.assign(Object.assign({},Be.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),Dr=ne({name:"Input",props:kr,setup(r){const{mergedClsPrefixRef:p,mergedBorderedRef:t,inlineThemeDisabled:S,mergedRtlRef:C}=cr(r),g=Be("Input","-input",Pr,Er,r,p);dr&&ur("-input-safari",Ir,p);const u=w(null),s=w(null),c=w(null),i=w(null),l=w(null),h=w(null),b=w(null),E=Tr(b),z=w(null),{localeRef:te}=zr("Input"),V=w(r.defaultValue),ae=Ce(r,"value"),F=hr(ae,V),P=fr(r),{mergedSizeRef:O,mergedDisabledRef:B,mergedStatusRef:ie}=P,T=w(!1),I=w(!1),R=w(!1),k=w(!1);let L=null;const N=_(()=>{const{placeholder:e,pair:o}=r;return o?Array.isArray(e)?e:e===void 0?["",""]:[e,e]:e===void 0?[te.value.placeholder]:[e]}),le=_(()=>{const{value:e}=R,{value:o}=F,{value:n}=N;return!e&&(re(o)||Array.isArray(o)&&re(o[0]))&&n[0]}),se=_(()=>{const{value:e}=R,{value:o}=F,{value:n}=N;return!e&&n[1]&&(re(o)||Array.isArray(o)&&re(o[1]))}),K=ze(()=>r.internalForceFocus||T.value),ce=ze(()=>{if(B.value||r.readonly||!r.clearable||!K.value&&!I.value)return!1;const{value:e}=F,{value:o}=K;return r.pair?!!(Array.isArray(e)&&(e[0]||e[1]))&&(I.value||o):!!e&&(I.value||o)}),de=_(()=>{const{showPasswordOn:e}=r;if(e)return e;if(r.showPasswordToggle)return"click"}),j=w(!1),Pe=_(()=>{const{textDecoration:e}=r;return e?Array.isArray(e)?e.map(o=>({textDecoration:o})):[{textDecoration:e}]:["",""]}),xe=w(void 0),Ie=()=>{var e,o;if(r.type==="textarea"){const{autosize:n}=r;if(n&&(xe.value=(o=(e=z.value)===null||e===void 0?void 0:e.$el)===null||o===void 0?void 0:o.offsetWidth),!s.value||typeof n=="boolean")return;const{paddingTop:v,paddingBottom:x,lineHeight:f}=window.getComputedStyle(s.value),M=Number(v.slice(0,-2)),W=Number(x.slice(0,-2)),D=Number(f.slice(0,-2)),{value:U}=c;if(!U)return;if(n.minRows){const G=Math.max(n.minRows,1),fe=`${M+W+D*G}px`;U.style.minHeight=fe}if(n.maxRows){const G=`${M+W+D*n.maxRows}px`;U.style.maxHeight=G}}},ke=_(()=>{const{maxlength:e}=r;return e===void 0?void 0:Number(e)});vr(()=>{const{value:e}=F;Array.isArray(e)||he(e)});const Me=pr().proxy;function X(e){const{onUpdateValue:o,"onUpdate:value":n,onInput:v}=r,{nTriggerFormInput:x}=P;o&&y(o,e),n&&y(n,e),v&&y(v,e),V.value=e,x()}function q(e){const{onChange:o}=r,{nTriggerFormChange:n}=P;o&&y(o,e),V.value=e,n()}function We(e){const{onBlur:o}=r,{nTriggerFormBlur:n}=P;o&&y(o,e),n()}function De(e){const{onFocus:o}=r,{nTriggerFormFocus:n}=P;o&&y(o,e),n()}function Ve(e){const{onClear:o}=r;o&&y(o,e)}function He(e){const{onInputBlur:o}=r;o&&y(o,e)}function Oe(e){const{onInputFocus:o}=r;o&&y(o,e)}function Le(){const{onDeactivate:e}=r;e&&y(e)}function Ne(){const{onActivate:e}=r;e&&y(e)}function Ke(e){const{onClick:o}=r;o&&y(o,e)}function je(e){const{onWrapperFocus:o}=r;o&&y(o,e)}function Ue(e){const{onWrapperBlur:o}=r;o&&y(o,e)}function Ge(){R.value=!0}function Ye(e){R.value=!1,e.target===h.value?J(e,1):J(e,0)}function J(e,o=0,n="input"){const v=e.target.value;if(he(v),e instanceof InputEvent&&!e.isComposing&&(R.value=!1),r.type==="textarea"){const{value:f}=z;f&&f.syncUnifiedContainer()}if(L=v,R.value)return;E.recordCursor();const x=Xe(v);if(x)if(!r.pair)n==="input"?X(v):q(v);else{let{value:f}=F;Array.isArray(f)?f=[f[0],f[1]]:f=["",""],f[o]=v,n==="input"?X(f):q(f)}Me.$forceUpdate(),x||Fe(E.restoreCursor)}function Xe(e){const{countGraphemes:o,maxlength:n,minlength:v}=r;if(o){let f;if(n!==void 0&&(f===void 0&&(f=o(e)),f>Number(n))||v!==void 0&&(f===void 0&&(f=o(e)),f<Number(n)))return!1}const{allowInput:x}=r;return typeof x=="function"?x(e):!0}function qe(e){He(e),e.relatedTarget===u.value&&Le(),e.relatedTarget!==null&&(e.relatedTarget===l.value||e.relatedTarget===h.value||e.relatedTarget===s.value)||(k.value=!1),Q(e,"blur"),b.value=null}function Je(e,o){Oe(e),T.value=!0,k.value=!0,Ne(),Q(e,"focus"),o===0?b.value=l.value:o===1?b.value=h.value:o===2&&(b.value=s.value)}function Qe(e){r.passivelyActivated&&(Ue(e),Q(e,"blur"))}function Ze(e){r.passivelyActivated&&(T.value=!0,je(e),Q(e,"focus"))}function Q(e,o){e.relatedTarget!==null&&(e.relatedTarget===l.value||e.relatedTarget===h.value||e.relatedTarget===s.value||e.relatedTarget===u.value)||(o==="focus"?(De(e),T.value=!0):o==="blur"&&(We(e),T.value=!1))}function eo(e,o){J(e,o,"change")}function oo(e){Ke(e)}function ro(e){Ve(e),r.pair?(X(["",""]),q(["",""])):(X(""),q(""))}function no(e){const{onMousedown:o}=r;o&&o(e);const{tagName:n}=e.target;if(n!=="INPUT"&&n!=="TEXTAREA"){if(r.resizable){const{value:v}=u;if(v){const{left:x,top:f,width:M,height:W}=v.getBoundingClientRect(),D=14;if(x+M-D<e.clientX&&e.clientX<x+M&&f+W-D<e.clientY&&e.clientY<f+W)return}}e.preventDefault(),T.value||me()}}function to(){var e;I.value=!0,r.type==="textarea"&&((e=z.value)===null||e===void 0||e.handleMouseEnterWrapper())}function ao(){var e;I.value=!1,r.type==="textarea"&&((e=z.value)===null||e===void 0||e.handleMouseLeaveWrapper())}function io(){B.value||de.value==="click"&&(j.value=!j.value)}function lo(e){if(B.value)return;e.preventDefault();const o=v=>{v.preventDefault(),Re("mouseup",document,o)};if(Ae("mouseup",document,o),de.value!=="mousedown")return;j.value=!0;const n=()=>{j.value=!1,Re("mouseup",document,n)};Ae("mouseup",document,n)}function so(e){r.onKeyup&&y(r.onKeyup,e)}function co(e){switch(r.onKeydown&&y(r.onKeydown,e),e.key){case"Escape":ue();break;case"Enter":uo(e);break}}function uo(e){var o,n;if(r.passivelyActivated){const{value:v}=k;if(v){r.internalDeactivateOnEnter&&ue();return}e.preventDefault(),r.type==="textarea"?(o=s.value)===null||o===void 0||o.focus():(n=l.value)===null||n===void 0||n.focus()}}function ue(){r.passivelyActivated&&(k.value=!1,Fe(()=>{var e;(e=u.value)===null||e===void 0||e.focus()}))}function me(){var e,o,n;B.value||(r.passivelyActivated?(e=u.value)===null||e===void 0||e.focus():((o=s.value)===null||o===void 0||o.focus(),(n=l.value)===null||n===void 0||n.focus()))}function ho(){var e;!((e=u.value)===null||e===void 0)&&e.contains(document.activeElement)&&document.activeElement.blur()}function fo(){var e,o;(e=s.value)===null||e===void 0||e.select(),(o=l.value)===null||o===void 0||o.select()}function vo(){B.value||(s.value?s.value.focus():l.value&&l.value.focus())}function po(){const{value:e}=u;e!=null&&e.contains(document.activeElement)&&e!==document.activeElement&&ue()}function go(e){if(r.type==="textarea"){const{value:o}=s;o==null||o.scrollTo(e)}else{const{value:o}=l;o==null||o.scrollTo(e)}}function he(e){const{type:o,pair:n,autosize:v}=r;if(!n&&v)if(o==="textarea"){const{value:x}=c;x&&(x.textContent=(e??"")+`\r `)}else{const{value:x}=i;x&&(e?x.textContent=e:x.innerHTML=" ")}}function bo(){Ie()}const we=w({top:"0"});function xo(e){var o;const{scrollTop:n}=e.target;we.value.top=`${-n}px`,(o=z.value)===null||o===void 0||o.syncUnifiedContainer()}let Z=null;Se(()=>{const{autosize:e,type:o}=r;e&&o==="textarea"?Z=be(F,n=>{!Array.isArray(n)&&n!==L&&he(n)}):Z==null||Z()});let ee=null;Se(()=>{r.type==="textarea"?ee=be(F,e=>{var o;!Array.isArray(e)&&e!==L&&((o=z.value)===null||o===void 0||o.syncUnifiedContainer())}):ee==null||ee()}),gr(Te,{mergedValueRef:F,maxlengthRef:ke,mergedClsPrefixRef:p,countGraphemesRef:Ce(r,"countGraphemes")});const mo={wrapperElRef:u,inputElRef:l,textareaElRef:s,isCompositing:R,focus:me,blur:ho,select:fo,deactivate:po,activate:vo,scrollTo:go},wo=br("Input",C,p),ye=_(()=>{const{value:e}=O,{common:{cubicBezierEaseInOut:o},self:{color:n,borderRadius:v,textColor:x,caretColor:f,caretColorError:M,caretColorWarning:W,textDecorationColor:D,border:U,borderDisabled:G,borderHover:fe,borderFocus:yo,placeholderColor:Co,placeholderColorDisabled:zo,lineHeightTextarea:So,colorDisabled:Fo,colorFocus:Ao,textColorDisabled:$o,boxShadowFocus:Ro,iconSize:_o,colorFocusWarning:Eo,boxShadowFocusWarning:Bo,borderWarning:To,borderFocusWarning:Po,borderHoverWarning:Io,colorFocusError:ko,boxShadowFocusError:Mo,borderError:Wo,borderFocusError:Do,borderHoverError:Vo,clearSize:Ho,clearColor:Oo,clearColorHover:Lo,clearColorPressed:No,iconColor:Ko,iconColorDisabled:jo,suffixTextColor:Uo,countTextColor:Go,countTextColorDisabled:Yo,iconColorHover:Xo,iconColorPressed:qo,loadingColor:Jo,loadingColorError:Qo,loadingColorWarning:Zo,[pe("padding",e)]:er,[pe("fontSize",e)]:or,[pe("height",e)]:rr}}=g.value,{left:nr,right:tr}=xr(er);return{"--n-bezier":o,"--n-count-text-color":Go,"--n-count-text-color-disabled":Yo,"--n-color":n,"--n-font-size":or,"--n-border-radius":v,"--n-height":rr,"--n-padding-left":nr,"--n-padding-right":tr,"--n-text-color":x,"--n-caret-color":f,"--n-text-decoration-color":D,"--n-border":U,"--n-border-disabled":G,"--n-border-hover":fe,"--n-border-focus":yo,"--n-placeholder-color":Co,"--n-placeholder-color-disabled":zo,"--n-icon-size":_o,"--n-line-height-textarea":So,"--n-color-disabled":Fo,"--n-color-focus":Ao,"--n-text-color-disabled":$o,"--n-box-shadow-focus":Ro,"--n-loading-color":Jo,"--n-caret-color-warning":W,"--n-color-focus-warning":Eo,"--n-box-shadow-focus-warning":Bo,"--n-border-warning":To,"--n-border-focus-warning":Po,"--n-border-hover-warning":Io,"--n-loading-color-warning":Zo,"--n-caret-color-error":M,"--n-color-focus-error":ko,"--n-box-shadow-focus-error":Mo,"--n-border-error":Wo,"--n-border-focus-error":Do,"--n-border-hover-error":Vo,"--n-loading-color-error":Qo,"--n-clear-color":Oo,"--n-clear-size":Ho,"--n-clear-color-hover":Lo,"--n-clear-color-pressed":No,"--n-icon-color":Ko,"--n-icon-color-hover":Xo,"--n-icon-color-pressed":qo,"--n-icon-color-disabled":jo,"--n-suffix-text-color":Uo}}),H=S?mr("input",_(()=>{const{value:e}=O;return e[0]}),ye,r):void 0;return Object.assign(Object.assign({},mo),{wrapperElRef:u,inputElRef:l,inputMirrorElRef:i,inputEl2Ref:h,textareaElRef:s,textareaMirrorElRef:c,textareaScrollbarInstRef:z,rtlEnabled:wo,uncontrolledValue:V,mergedValue:F,passwordVisible:j,mergedPlaceholder:N,showPlaceholder1:le,showPlaceholder2:se,mergedFocus:K,isComposing:R,activated:k,showClearButton:ce,mergedSize:O,mergedDisabled:B,textDecorationStyle:Pe,mergedClsPrefix:p,mergedBordered:t,mergedShowPasswordOn:de,placeholderStyle:we,mergedStatus:ie,textAreaScrollContainerWidth:xe,handleTextAreaScroll:xo,handleCompositionStart:Ge,handleCompositionEnd:Ye,handleInput:J,handleInputBlur:qe,handleInputFocus:Je,handleWrapperBlur:Qe,handleWrapperFocus:Ze,handleMouseEnter:to,handleMouseLeave:ao,handleMouseDown:no,handleChange:eo,handleClick:oo,handleClear:ro,handlePasswordToggleClick:io,handlePasswordToggleMousedown:lo,handleWrapperKeydown:co,handleWrapperKeyup:so,handleTextAreaMirrorResize:bo,getTextareaScrollContainer:()=>s.value,mergedTheme:g,cssVars:S?void 0:ye,themeClass:H==null?void 0:H.themeClass,onRender:H==null?void 0:H.onRender})},render(){var r,p;const{mergedClsPrefix:t,mergedStatus:S,themeClass:C,type:g,countGraphemes:u,onRender:s}=this,c=this.$slots;return s==null||s(),a("div",{ref:"wrapperElRef",class:[`${t}-input`,C,S&&`${t}-input--${S}-status`,{[`${t}-input--rtl`]:this.rtlEnabled,[`${t}-input--disabled`]:this.mergedDisabled,[`${t}-input--textarea`]:g==="textarea",[`${t}-input--resizable`]:this.resizable&&!this.autosize,[`${t}-input--autosize`]:this.autosize,[`${t}-input--round`]:this.round&&g!=="textarea",[`${t}-input--pair`]:this.pair,[`${t}-input--focus`]:this.mergedFocus,[`${t}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},a("div",{class:`${t}-input-wrapper`},oe(c.prefix,i=>i&&a("div",{class:`${t}-input__prefix`},i)),g==="textarea"?a(wr,{ref:"textareaScrollbarInstRef",class:`${t}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var i,l;const{textAreaScrollContainerWidth:h}=this,b={width:this.autosize&&h&&`${h}px`};return a(yr,null,a("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${t}-input__textarea-el`,(i=this.inputProps)===null||i===void 0?void 0:i.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:u?void 0:this.maxlength,minlength:u?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(l=this.inputProps)===null||l===void 0?void 0:l.style,b],onBlur:this.handleInputBlur,onFocus:E=>{this.handleInputFocus(E,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?a("div",{class:`${t}-input__placeholder`,style:[this.placeholderStyle,b],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?a(Cr,{onResize:this.handleTextAreaMirrorResize},{default:()=>a("div",{ref:"textareaMirrorElRef",class:`${t}-input__textarea-mirror`,key:"mirror"})}):null)}}):a("div",{class:`${t}-input__input`},a("input",Object.assign({type:g==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":g},this.inputProps,{ref:"inputElRef",class:[`${t}-input__input-el`,(r=this.inputProps)===null||r===void 0?void 0:r.class],style:[this.textDecorationStyle[0],(p=this.inputProps)===null||p===void 0?void 0:p.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:u?void 0:this.maxlength,minlength:u?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:i=>{this.handleInputFocus(i,0)},onInput:i=>{this.handleInput(i,0)},onChange:i=>{this.handleChange(i,0)}})),this.showPlaceholder1?a("div",{class:`${t}-input__placeholder`},a("span",null,this.mergedPlaceholder[0])):null,this.autosize?a("div",{class:`${t}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"},"Â "):null),!this.pair&&oe(c.suffix,i=>i||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?a("div",{class:`${t}-input__suffix`},[oe(c["clear-icon-placeholder"],l=>(this.clearable||l)&&a(_e,{clsPrefix:t,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>l,icon:()=>{var h,b;return(b=(h=this.$slots)["clear-icon"])===null||b===void 0?void 0:b.call(h)}})),this.internalLoadingBeforeSuffix?null:i,this.loading!==void 0?a(Sr,{clsPrefix:t,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?i:null,this.showCount&&this.type!=="textarea"?a(Ee,null,{default:l=>{var h;return(h=c.count)===null||h===void 0?void 0:h.call(c,l)}}):null,this.mergedShowPasswordOn&&this.type==="password"?a("div",{class:`${t}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?ge(c["password-visible-icon"],()=>[a($e,{clsPrefix:t},{default:()=>a(Fr,null)})]):ge(c["password-invisible-icon"],()=>[a($e,{clsPrefix:t},{default:()=>a(Ar,null)})])):null]):null)),this.pair?a("span",{class:`${t}-input__separator`},ge(c.separator,()=>[this.separator])):null,this.pair?a("div",{class:`${t}-input-wrapper`},a("div",{class:`${t}-input__input`},a("input",{ref:"inputEl2Ref",type:this.type,class:`${t}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:u?void 0:this.maxlength,minlength:u?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:i=>{this.handleInputFocus(i,1)},onInput:i=>{this.handleInput(i,1)},onChange:i=>{this.handleChange(i,1)}}),this.showPlaceholder2?a("div",{class:`${t}-input__placeholder`},a("span",null,this.mergedPlaceholder[1])):null),oe(c.suffix,i=>(this.clearable||i)&&a("div",{class:`${t}-input__suffix`},[this.clearable&&a(_e,{clsPrefix:t,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var l;return(l=c["clear-icon"])===null||l===void 0?void 0:l.call(c)},placeholder:()=>{var l;return(l=c["clear-icon-placeholder"])===null||l===void 0?void 0:l.call(c)}}),i]))):null,this.mergedBordered?a("div",{class:`${t}-input__border`}):null,this.mergedBordered?a("div",{class:`${t}-input__state-border`}):null,this.showCount&&g==="textarea"?a(Ee,null,{default:i=>{var l;const{renderCount:h}=this;return h?h(i):(l=c.count)===null||l===void 0?void 0:l.call(c,i)}}):null)}});export{Fr as E,Dr as N,Er as i};