1import{$t as Je,At as B,C as W,Ct as be,E as M,Et as kt,Ft as Tt,H as Qe,Ht as j,K as Vt,L as xe,M as Lt,N as it,Nt as ye,Q as v,S as f,T as h,U as $,Y as Bt,Yt as Be,_ as Me,_n as me,_t as Y,a as Rt,cn as Fe,ct as At,dt as $t,fn as g,h as pe,mn as he,nn as Ze,ot as X,pt as oe,rt as ae,w as C,zt as a}from"./vue.runtime.esm-bundler-BXOQDxND.js";import{D as Ot,Et as Gt,J as Ht,Kt as Dt,Ut as lt,W as Kt,_t as Ut,a as Wt,at as _e,cn as jt,en as et,et as Yt,o as ke,on as Te,qt as L,st as Xt,t as q,v as rt}from"./icon-9jHkglq3.js";import{f as qt,l as Ve,t as Jt}from"./use-aria-CKdrUsn3.js";import{d as Le,f as ge,l as ut,o as tt,s as Qt,u as at}from"./_plugin-vue_export-helper-B4b1J8Q5.js";import{i as Zt,n as _t,r as ea,t as ta}from"./use-form-item-Cb37NJsM.js";xe();var aa=["class","style"],oa=/^on[A-Z]/,na=(e={})=>{const{excludeListeners:u=!1,excludeKeys:m}=e,t=f(()=>(m?.value||[]).concat(aa)),s=it();return s?f(()=>jt(Object.entries(s.proxy?.$attrs).filter(([d])=>!t.value.includes(d)&&!(u&&oa.test(d))))):(lt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),f(()=>({})))};function sa(e){let u;function m(){if(e.value==null)return;const{selectionStart:s,selectionEnd:d,value:p}=e.value;s==null||d==null||(u={selectionStart:s,selectionEnd:d,value:p,beforeTxt:p.slice(0,Math.max(0,s)),afterTxt:p.slice(Math.max(0,d))})}function t(){if(e.value==null||u==null)return;const{value:s}=e.value,{beforeTxt:d,afterTxt:p,selectionStart:l}=u;if(d==null||p==null||l==null)return;let b=s.length;if(s.endsWith(p))b=s.length-p.length;else if(s.startsWith(d))b=d.length;else{const N=d[l-1],c=s.indexOf(N,l-1);c!==-1&&(b=c+1)}e.value.setSelectionRange(b,b)}return[m,t]}Be();xe(),be();function ia(e,{disabled:u,beforeFocus:m,afterFocus:t,beforeBlur:s,afterBlur:d}={}){const{emit:p}=it(),l=ye(),b=B(!1),N=y=>{const k=Je(m)?m(y):!1;a(u)||b.value||k||(b.value=!0,p("focus",y),t?.())},c=y=>{const k=Je(s)?s(y):!1;a(u)||y.relatedTarget&&l.value?.contains(y.relatedTarget)||k||(b.value=!1,p("blur",y),d?.())},R=y=>{a(u)||Ut(y.target)||l.value?.contains(document.activeElement)&&l.value!==document.activeElement||e.value?.focus()};return oe([l,()=>a(u)],([y,k])=>{y&&(k?y.removeAttribute("tabindex"):y.setAttribute("tabindex","-1"))}),Ve(l,"focus",N,!0),Ve(l,"blur",c,!0),Ve(l,"click",R,!0),{isFocused:b,wrapperRef:l,handleFocus:N,handleBlur:c}}xe(),be();function la({afterComposition:e,emit:u}
1){const m=B(!1),t=l=>{u?.("compositionstart",l),m.value=!0},s=l=>{u?.("compositionupdate",l),m.value=!0},d=l=>{u?.("compositionend",l),m.value&&(m.value=!1,$(()=>e(l)))};return{isComposing:m,handleComposition:l=>{l.type==="compositionend"?d(l):s(l)},handleCompositionStart:t,handleCompositionUpdate:s,handleCompositionEnd:d}}var ra=e=>e;Be();be();var ua=Dt({id:{type:String,default:void 0},size:Yt,disabled:{type:Boolean,default:void 0},modelValue:{type:L([String,Number,Object]),default:""},modelModifiers:{type:L(Object),default:()=>({})},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:L(String),default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:L([Boolean,Object]),default:!1},autocomplete:{type:L(String),default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:ke,default:rt},showPassword:Boolean,showWordLimit:Boolean,wordLimitPosition:{type:String,values:["inside","outside"],default:"inside"},suffixIcon:{type:ke},prefixIcon:{type:ke},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:L([Object,Array,String,Boolean]),default:()=>ra({})},countGraphemes:{type:L(Function)},autofocus:Boolean,rows:{type:Number,default:2},...Jt(["ariaLabel"]),inputmode:{type:L(String),default:void 0},name:String}),ca={[ge]:e=>Fe(e),input:e=>Fe(e),change:(e,u)=>Fe(e)&&(u instanceof Event||u===void 0),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:e=>e===void 0||e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},Na={disabled:void 0,modelValue:"",modelModifiers:()=>({}),type:"text",autocomplete:"off",clearIcon:kt(rt),wordLimitPosition:"inside",tabindex:0,validateEvent:!0,inputStyle:()=>({}),rows:2},I=void 0,da={height:"0",visibility:"hidden",overflow:ut()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},fa=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],ot=e=>{const u=Number.parseFloat(e);return Number.isNaN(u)?e:u};function va(e){const u=window.getComputedStyle(e),m=u.getPropertyValue("box-sizing"),t=Number.parseFloat(u.getPropertyValue("padding-bottom"))+Number.parseFloat(u.getPropertyValue("padding-top")),s=Number.parseFloat(u.getPropertyValue("border-bottom-width"))+Number.parseFloat(u.getPropertyValue("border-top-width"));return{contextStyle:fa.map(d=>[d,u.getPropertyValue(d)]),paddingSize:t,borderSize:s,boxSizing:m}}function nt(e,u=1,m){if(!I){I=document.createElement("textarea");let c=document.body;!ut()&&e.parentNode&&(c=e.parentNode),c.appendChild(I)}const{paddingSize:t,borderSize:s,boxSizing:d,contextStyle:p}=va(e);p.forEach(([c,R])=>I?.style.setProperty(c,R)),Object.entries(da).forEach(([c,R])=>I?.style.setProperty(c,R,"important")),I.value=e.value||e.placeholder||"";let l=I.scrollHeight;const b={};d==="border-box"?l=l+s:d==="content-box"&&(l=l-t),I.value="";const N=I.scrollHeight-t;if(et(u)){let c=N*u;d==="border-box"&&(c=c+t+s),l=Math.max(c,l),b.minHeight=`${c}px`}if(et(m)){let c=N*m;d==="border-box"&&(c=c+t+s),l=Math.min(c,l)}return b.height=`${l}px`,I.parentNode?.removeChild(I),I=void 0,b}Be();xe(),be(),Rt();var ma=["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode"],pa=["aria-label"],ha=["id","name","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","inputmode"],ya=["aria-label"],st="ElInput",ga=Lt({name:st,inheritAttrs:!1,__name:"input",props:ua,emits:ca,setup(e,{expose:u,emit:m}){const t=e,s=m,d=At(),p=$t(),l=f(()=>[t.type==="textarea"?J.b():r.b(),r.m(ct.value),r.is("disabled",A.value),r.is("exceed",pt.value),{[r.b("group")]:p.prepend||p.append,[r.m("prefix")]:p.prefix||t.prefixIcon,[r.m("suffix")]:p.suffix||t.suffixIcon||t.clearable||t.showPassword,[r.bm("suffix","password-clear")]:le.value&&Ie.value,[r.b("hidden")]:t.type==="hidden"},d.class]),b=f(()=>[r.e("wrapper"),r.is("focus",Se.value)]),N=na(),c=f(()=>t.maxlength?.toString()),{form:R,formItem:y}=ta(),{inputId:k}=_t(t,{formItemContext:y}),ct=Zt(),A=ea(),r=_e("input"),J=_e("textarea"),{t:dt}=Xt(),ne=ye(),P=ye(),we=B(!1),O=B(!1),Re=B(),Ae=B(),se=ye(t.inputStyle),Q=B("");let G;const ie=B(),x=f(()=>ne.value||P.value),{wrapperRef:ft,isFocused:Se,handleFocus:$e,handleBlur:Oe}=ia(x,{disabled:A,afterFocus(){t.showPassword&&(G=x.value?.value)},beforeBlur(o){if(t.showPassword){const n=x.value;if(o.relatedTarget&&n?.parentElement?.contains(o.relatedTarget))return;const i=n?.value;!Te(i)&&!Te(G)&&i!==G&&n?.dispatchEvent(new Event("change",{bubbles:!0})),G=void 0}},afterBlur(){t.validateEvent&&y?.validate?.("blur").catch(j)}}),Ge=f(()=>R?.statusIcon??!1),Z=f(()=>y?.validateState||""),He=f(()=>Z.value&&Wt[Z.value]),vt=f(()=>O.value?Kt:Ot),mt=f(()=>[d.style]),De=f(()=>[t.inputStyle,se.value,{resize:t.resize},ie.value?{height:ie.value}:void 0]),F=f(()=>Te(t.modelValue)?"":String(t.modelValue)),Ce=f(()=>t.clearable&&!A.value&&!t.readonly),le=f(()=>Ce.value&&!!F.value&&(Se.value||we.value)),Ie=f(()=>t.showPassword&&!A.value&&!!F.value),H=f(()=>t.showWordLimit&&!!c.value&&(t.type==="text"||t.type==="textarea")&&!A.value&&!t.readonly&&!t.showPassword),re=f(()=>t.countGraphemes&&t.showWordLimit?t.countGraphemes(F.value):F.value.length),Ke=f(()=>dt("el.input.characters",{count:re.value,max:c.value??""})),pt=f(()=>!!H.value&&re.value>Number(c.value)),ht=f(()=>!!p.suffix||!!t.suffixIcon||t.clearable||t.showPassword||H.value||!!Z.value&&Ge.value),yt=f(()=>!!Object.keys(t.modelModifiers).length),[gt,bt]=sa(ne);let D;qt(P,o=>{if(xt(),!H.value&&!Ce.value||t.resize!=="both"&&t.resize!=="horizontal")return;const{width:n}=o[0].target.getBoundingClientRect(),i=()=>{D=void 0,Re.value={right:`calc(100% - ${n-10}px)`},Ae.value={right:`calc(100% - ${n-11}px)`}};D&&tt(D),D=Qt(i)});const _=()=>{const{type:o,autosize:n}=t;if(!(!Gt||o!=="textarea"||!P.value))if(n){const i=Ze(n)?n.minRows:void 0,z=Ze(n)?n.maxRows:void 0,S=nt(P.value,i,z);se.value={overflowY:"hidden",...S},$(()=>{P.value.offsetHeight,se.value=S})}else se.value={minHeight:nt(P.value).minHeight}},xt=(o=>{let n=!1;return()=>{if(n||!t.autosize){t.resize!=="none"&&setTimeout(()=>{ie.value=P.value?.style.height});return}P.value?.offsetParent!==null&&(setTimeout(o),n=!0)}})(_),K=()=>{const o=x.value,n=t.formatter?t.formatter(F.value):F.value;!o||o.value===n||t.type==="file"||(o.value=n)},Ue=o=>{const{trim:n,number:i}=t.modelModifiers;return n&&(o=o.trim()),i&&(o=`${ot(o)}`),t.formatter&&t.parser&&(o=t.parser(o)),o},Ee=async o=>{if(je.value)return;const{lazy:n}=t.modelModifiers;let{value:i}=o.target,z=!1;if(n){s(Le,i);return}if(i=Ue(i),t.countGraphemes&&c.value!=null){const S=Number(c.value),fe=t.countGraphemes(i),U=t.countGraphemes(Q.value);if(fe>S&&fe>U)if(U>S)i=Q.value,z=!0;else{const T=Q.value,E=i;let w=0;for(;w<T.length&&w<E.length&&T[w]===E[w];)w++;let V=T.length,ee=E.length;for(;V>w&&ee>w&&T[V-1]===E[ee-1];)V--,ee--;const Pt=E.slice(0,w),zt=T.slice(w,V),Xe=E.slice(w,ee),Mt=E.slice(ee),Ft=U-t.countGraphemes(zt),Pe=Math.max(0,S-Ft);let te="";if(Pe>0)if(typeof Intl<"u"&&"Segmenter"in Intl){const ze=new Intl.Segmenter(void 0,{granularity:"grapheme"});for(const{segment:ve}of ze.segment(Xe)){const qe=te+ve;if(t.countGraphemes(qe)>Pe)break;te=qe}}else for(const ze of Array.from(Xe)){const ve=te+ze;if(t.countGraphemes(ve)>Pe)break;te=ve}i=Pt+te+Mt,z=!0}}if(String(i)===F.value){if(t.formatter||z){const S=o.target,fe=S.value,U=S.selectionStart,T=S.selectionEnd;if(K(),z&&x.value&&U!=null&&T!=null){const E=x.value.value,w=fe.slice(Math.max(0,T));let V=Math.min(U,E.length);w&&E.endsWith(w)&&(V=E.length-w.length),x.value.setSelectionRange(V,V)}}return}Q.value=i,gt(),s(ge,i),s(Le,i),await $(),(t.formatter&&t.parser||!yt.value)&&K(),bt()},We=async o=>{let{value:n}=o.target;t.showPassword&&(G=n),n=Ue(n),t.modelModifiers.lazy&&s(ge,n),s(at,n,o),await $(),K()},{isComposing:je,handleCompositionStart:ue,handleCompositionUpdate:ce,handleCompositionEnd:de}=la({emit:s,afterComposition:Ee}),wt=()=>{O.value=!O.value},St=()=>x.value?.focus(),Ct=()=>x.value?.blur(),It=o=>{we.value=!1,s("mouseleave",o)},Et=o=>{we.value=!0,s("mouseenter",o)},Ye=o=>{s("keydown",o)},Nt=()=>{x.value?.select()},Ne=o=>{s(ge,""),G="",s(at,""),s("clear",o),s(Le,"")};return oe(()=>t.modelValue,()=>{$(()=>{_(),t.autosize&&(ie.value=void 0)}),t.validateEvent&&y?.validate?.("change").catch(j)}),oe(()=>F.value,o=>{Q.value=o},{immediate:!0}),oe(F,o=>{if(!x.value)return;const{trim:n,number:i}=t.modelModifiers,z=x.value.value,S=(i||t.type==="number")&&!/^0\d/.test(z)?`${ot(z)}`:z;S!==o&&(document.activeElement===x.value&&x.value.type!=="range"&&n&&S.trim()===o||K())}),oe(()=>t.type,async()=>{await $(),K(),_()}),Bt(()=>{!t.formatter&&t.parser&<(st,"If you set the parser, you also need to set the formatter."),K(),$(_)}),Vt(()=>{D&&tt(D)}),u({input:ne,textarea:P,ref:x,textareaStyle:De,autosize:Tt(t,"autosize"),isComposing:je,passwordVisible:O,focus:St,blur:Ct,select:Nt,clear:Ne,resizeTextarea:_}),(o,n)=>(v(),M("div",{class:g([l.value,{[a(r).bm("group","append")]:o.$slots.append,[a(r).bm("group","prepe
1nd")]:o.$slots.prepend}]),style:he(mt.value),onMouseenter:Et,onMouseleave:It},[h(" input "),e.type!=="textarea"?(v(),M(Me,{key:0},[h(" prepend slot "),o.$slots.prepend?(v(),M("div",{key:0,class:g(a(r).be("group","prepend"))},[ae(o.$slots,"prepend")],2)):h("v-if",!0),W("div",{ref_key:"wrapperRef",ref:ft,class:g(b.value)},[h(" prefix slot "),o.$slots.prefix||e.prefixIcon?(v(),M("span",{key:0,class:g(a(r).e("prefix"))},[W("span",{class:g(a(r).e("prefix-inner"))},[ae(o.$slots,"prefix"),e.prefixIcon?(v(),C(a(q),{key:0,class:g(a(r).e("icon"))},{default:Y(()=>[(v(),C(X(e.prefixIcon)))]),_:1},8,["class"])):h("v-if",!0)],2)],2)):h("v-if",!0),W("input",Qe({id:a(k),ref_key:"input",ref:ne,class:a(r).e("inner")},a(N),{name:e.name,minlength:e.countGraphemes?void 0:e.minlength,maxlength:e.countGraphemes?void 0:c.value,type:e.showPassword?O.value?"text":"password":e.type,disabled:a(A),readonly:e.readonly,autocomplete:e.autocomplete,tabindex:e.tabindex,"aria-label":e.ariaLabel,placeholder:e.placeholder,style:e.inputStyle,form:e.form,autofocus:e.autofocus,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:n[0]||(n[0]=(...i)=>a(ue)&&a(ue)(...i)),onCompositionupdate:n[1]||(n[1]=(...i)=>a(ce)&&a(ce)(...i)),onCompositionend:n[2]||(n[2]=(...i)=>a(de)&&a(de)(...i)),onInput:Ee,onChange:We,onKeydown:Ye}),null,16,ma),h(" suffix slot "),ht.value?(v(),M("span",{key:1,class:g(a(r).e("suffix"))},[W("span",{class:g(a(r).e("suffix-inner"))},[Ce.value?(v(),C(a(q),{key:0,class:g([a(r).e("icon"),a(r).e("clear")]),style:he({visibility:le.value?"visible":"hidden"}),onMousedown:pe(a(j),["prevent"]),onClick:Ne},{default:Y(()=>[(v(),C(X(e.clearIcon)))]),_:1},8,["class","style","onMousedown"])):h("v-if",!0),!le.value||!Ie.value||!H.value?(v(),M(Me,{key:1},[ae(o.$slots,"suffix"),e.suffixIcon?(v(),C(a(q),{key:0,class:g(a(r).e("icon"))},{default:Y(()=>[(v(),C(X(e.suffixIcon)))]),_:1},8,["class"])):h("v-if",!0)],64)):h("v-if",!0),Ie.value?(v(),C(a(q),{key:2,class:g([a(r).e("icon"),a(r).e("password")]),onClick:wt,onMousedown:pe(a(j),["prevent"]),onMouseup:pe(a(j),["prevent"])},{default:Y(()=>[ae(o.$slots,"password-icon",{visible:O.value},()=>[(v(),C(X(vt.value)))])]),_:3},8,["class","onMousedown","onMouseup"])):h("v-if",!0),H.value?(v(),M("span",{key:3,class:g([a(r).e("count"),a(r).is("outside",e.wordLimitPosition==="outside")]),"aria-label":Ke.value,role:"status"},[W("span",{class:g(a(r).e("count-inner"))},me(re.value)+" / "+me(c.value),3)],10,pa)):h("v-if",!0),Z.value&&He.value&&Ge.value?(v(),C(a(q),{key:4,class:g([a(r).e("icon"),a(r).e("validateIcon"),a(r).is("loading",Z.value==="validating")])},{default:Y(()=>[(v(),C(X(He.value)))]),_:1},8,["class"])):h("v-if",!0)],2)],2)):h("v-if",!0)],2),h(" append slot "),o.$slots.append?(v(),M("div",{key:1,class:g(a(r).be("group","append"))},[ae(o.$slots,"append")],2)):h("v-if",!0)],64)):(v(),M(Me,{key:1},[h(" textarea "),W("textarea",Qe({id:a(k),ref_key:"textarea",ref:P,class:[a(J).e("inner"),a(r).is("focus",a(Se)),a(J).is("clearable",e.clearable)]},a(N),{name:e.name,minlength:e.countGraphemes?void 0:e.minlength,maxlength:e.countGraphemes?void 0:c.value,tabindex:e.tabindex,disabled:a(A),readonly:e.readonly,autocomplete:e.autocomplete,style:De.value,"aria-label":e.ariaLabel,placeholder:e.placeholder,form:e.form,autofocus:e.autofocus,rows:e.rows,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:n[3]||(n[3]=(...i)=>a(ue)&&a(ue)(...i)),onCompositionupdate:n[4]||(n[4]=(...i)=>a(ce)&&a(ce)(...i)),onCompositionend:n[5]||(n[5]=(...i)=>a(de)&&a(de)(...i)),onInput:Ee,onFocus:n[6]||(n[6]=(...i)=>a($e)&&a($e)(...i)),onBlur:n[7]||(n[7]=(...i)=>a(Oe)&&a(Oe)(...i)),onChange:We,onKeydown:Ye}),null,16,ha),le.value?(v(),C(a(q),{key:0,class:g([a(J).e("icon"),a(J).e("clear")]),style:he(Ae.value),onMousedown:pe(a(j),["prevent"]),onClick:Ne},{default:Y(()=>[(v(),C(X(e.clearIcon)))]),_:1},8,["class","style","onMousedown"])):h("v-if",!0),H.value?(v(),M("span",{key:1,style:he(Re.value),class:g([a(r).e("count"),a(r).is("outside",e.wordLimitPosition==="outside")]),"aria-label":Ke.value,role:"status"},me(re.value)+" / "+me(c.value),15,ya)):h("v-if",!0)],64))],38))}}),ba=ga,Pa=Ht(ba);export{ia as a,la as i,ua as n,na as o,ra as r,Pa as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.