| 1 |
- import{c4 as vl,bN as ml,c5 as mt,c6 as ht,b2 as ee,c7 as hl,c8 as bl,az as gl,c9 as yl,aq as Se,_ as le,f as A,O as ge,N as te,a$ as Sl,r as S,y as v,be as bt,a9 as De,c2 as it,o as g,m as D,w as V,$ as pe,a as M,a2 as m,k as I,a4 as Q,a0 as Me,bm as gt,aB as yt,c as $,b as W,H as Ne,ar as Re,bb as ce,bw as rt,W as Y,aU as _,X,S as We,j as we,C as ke,a8 as wl,R as B,a1 as $e,n as z,M as ae,as as Ae,bs as Cl,aR as St,bC as ut,a3 as U,B as Pe,ca as wt,a5 as Fe,aD as Ct,ae as Ot,t as x,aZ as Ol,a6 as oe,ac as El,cb as Il,cc as Tl,aQ as Rl,bh as $l,b1 as G,cd as Ml,aS as kl,aF as Vl,ba as zl,ce as Be,af as J,aa as Ll,a7 as Et,aK as Bl,aI as It,aN as Dl,ab as dt,aV as Nl,aW as Pl,q as Wl,Z as se,b4 as Al,I as ct,aX as be,aY as Fl,cf as Hl,at as Tt}from"./entry.ae0eac90.js";import{u as Kl,b as Ul,E as Gl,C as ql}from"./index.37a58183.js";import{b as Rt,h as Xl,i as ye}from"./isEqual.8f1b966f.js";import{t as Yl,d as Ql}from"./debounce.439230eb.js";import{k as Zl}from"./_getTag.e4404448.js";var ft=1/0,jl=17976931348623157e292;function Jl(e){if(!e)return e===0?e:0;if(e=Yl(e),e===ft||e===-ft){var l=e<0?-1:1;return l*jl}return e===e?e:0}function _l(e){var l=Jl(e),s=l%1;return l===l?s?l-s:l:0}function xl(e,l,s,u){for(var i=e.length,p=s+(u?1:-1);u?p--:++p<i;)if(l(e[p],p,e))return p;return-1}var en=1,tn=2;function ln(e,l,s,u){var i=s.length,p=i,t=!u;if(e==null)return!p;for(e=Object(e);i--;){var f=s[i];if(t&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++i<p;){f=s[i];var a=f[0],b=e[a],h=f[1];if(t&&f[2]){if(b===void 0&&!(a in e))return!1}else{var c=new vl;if(u)var E=u(b,h,a,e,l,c);if(!(E===void 0?Rt(h,b,en|tn,u,c):E))return!1}}return!0}function $t(e){return e===e&&!ml(e)}function nn(e){for(var l=Zl(e),s=l.length;s--;){var u=l[s],i=e[u];l[s]=[u,i,$t(i)]}return l}function Mt(e,l){return function(s){return s==null?!1:s[e]===l&&(l!==void 0||e in Object(s))}}function sn(e){var l=nn(e);return l.length==1&&l[0][2]?Mt(l[0][0],l[0][1]):function(s){return s===e||ln(s,e,l)}}var on=1,an=2;function rn(e,l){return mt(e)&&$t(l)?Mt(ht(e),l):function(s){var u=ee(s,e);return u===void 0&&u===l?Xl(s,e):Rt(l,u,on|an)}}function un(e){return function(l){return l==null?void 0:l[e]}}function dn(e){return function(l){return hl(l,e)}}function cn(e){return mt(e)?un(ht(e)):dn(e)}function fn(e){return typeof e=="function"?e:e==null?bl:typeof e=="object"?gl(e)?rn(e[0],e[1]):sn(e):cn(e)}var pn=Math.max,vn=Math.min;function mn(e,l,s){var u=e==null?0:e.length;if(!u)return-1;var i=u-1;return s!==void 0&&(i=_l(s),i=s<0?pn(u+i,0):vn(i,u-1)),xl(e,fn(l),i,!0)}const hn=(e="")=>e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),is=e=>yl(e),fe=4,bn={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},gn=({move:e,size:l,bar:s})=>({[s.size]:l,transform:`translate${s.axis}(${e}%)`}),kt=Symbol("scrollbarContextKey"),yn=Se({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),Sn="Thumb",wn=A({__name:"thumb",props:yn,setup(e){const l=e,s=ge(kt),u=te("scrollbar");s||Sl(Sn,"can not inject scrollbar context");const i=S(),p=S(),t=S({}),f=S(!1);let a=!1,b=!1,h=yt?document.onselectstart:null;const c=v(()=>bn[l.vertical?"vertical":"horizontal"]),E=v(()=>gn({size:l.size,move:l.move,bar:c.value})),y=v(()=>i.value[c.value.offset]**2/s.wrapElement[c.value.scrollSize]/l.ratio/p.value[c.value.offset]),w=O=>{var r;if(O.stopPropagation(),O.ctrlKey||[1,2].includes(O.button))return;(r=window.getSelection())==null||r.removeAllRanges(),k(O);const T=O.currentTarget;T&&(t.value[c.value.axis]=T[c.value.offset]-(O[c.value.client]-T.getBoundingClientRect()[c.value.direction]))},d=O=>{if(!p.value||!i.value||!s.wrapElement)return;const r=Math.abs(O.target.getBoundingClientRect()[c.value.direction]-O[c.value.client]),T=p.value[c.value.offset]/2,H=(r-T)*100*y.value/i.value[c.value.offset];s.wrapElement[c.value.scroll]=H*s.wrapElement[c.value.scrollSize]/100},k=O=>{O.stopImmediatePropagation(),a=!0,document.addEventListener("mousemove",F),document.addEventListener("mouseup",N),h=document.onselectstart,document.onselectstart=()=>!1},F=O=>{if(!i.value||!p.value||a===!1)return;const r=t.value[c.value.axis];if(!r)return;const T=(i.value.getBoundingClientRect()[c.value.direction]-O[c.value.client])*-1,H=p.value[c.value.offset]-r,P=(T-H)*100*y.value/i.value[c.value.offset];s.wrapElement[c.value.scroll]=P*s.wrapElement[c.value.scrollSize]/100},N=()=>{a=!1,t.value[c.value.axis]=0,document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",N),re(),b&&(f.value=!1)},Z=()=>{b=!1,f.value=!!l.size},ie=()=>{b=!0,f.value=a};bt(()=>{re(),document.removeEventListener("mouseup",N)});const re=()=>{document.onselectstart!==h&&(document.onselectstart=h)};return De(it(s,"scrollbarElement"),"mousemove",Z),De(it(s,"scrollbarElement"),"mouseleave",ie),(O,r)=>(g(),D(gt,{name:I(u).b("fade"),persisted:""},{default:V(()=>[pe(M("div",{ref_key:"instance",ref:i,class:m([I(u).e("bar"),I(u).is(I(c).key)]),onMousedown:d},[M("div",{ref_key:"thumb",ref:p,class:m(I(u).e("thumb")),style:Q(I(E)),onMousedown:w},null,38)],34),[[Me,O.always||f.value]])]),_:1},8,["name"]))}});var pt=le(wn,[["__file","thumb.vue"]]);const Cn=Se({always:{type:Boolean,default:!0},width:String,height:String,ratioX:{type:Number,default:1},ratioY:{type:Number,default:1}}),On=A({__name:"bar",props:Cn,setup(e,{expose:l}){const s=e,u=S(0),i=S(0);return l({handleScroll:t=>{if(t){const f=t.offsetHeight-fe,a=t.offsetWidth-fe;i.value=t.scrollTop*100/f*s.ratioY,u.value=t.scrollLeft*100/a*s.ratioX}}}),(t,f)=>(g(),$(Ne,null,[W(pt,{move:u.value,ratio:t.ratioX,size:t.width,always:t.always},null,8,["move","ratio","size","always"]),W(pt,{move:i.value,ratio:t.ratioY,size:t.height,vertical:"",always:t.always},null,8,["move","ratio","size","always"])],64))}});var En=le(On,[["__file","bar.vue"]]);const In=Se({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Re([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},id:String,role:String,ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical"]}}),Tn={scroll:({scrollTop:e,scrollLeft:l})=>[e,l].every(ce)},Rn="ElScrollbar",$n=A({name:Rn}),Mn=A({...$n,props:In,emits:Tn,setup(e,{expose:l,emit:s}){const u=e,i=te("scrollbar");let p,t;const f=S(),a=S(),b=S(),h=S("0"),c=S("0"),E=S(),y=S(1),w=S(1),d=v(()=>{const r={};return u.height&&(r.height=rt(u.height)),u.maxHeight&&(r.maxHeight=rt(u.maxHeight)),[u.wrapStyle,r]}),k=v(()=>[u.wrapClass,i.e("wrap"),{[i.em("wrap","hidden-default")]:!u.native}]),F=v(()=>[i.e("view"),u.viewClass]),N=()=>{var r;a.value&&((r=E.value)==null||r.handleScroll(a.value),s("scroll",{scrollTop:a.value.scrollTop,scrollLeft:a.value.scrollLeft}))};function Z(r,T){ae(r)?a.value.scrollTo(r):ce(r)&&ce(T)&&a.value.scrollTo(r,T)}const ie=r=>{ce(r)&&(a.value.scrollTop=r)},re=r=>{ce(r)&&(a.value.scrollLeft=r)},O=()=>{if(!a.value)return;const r=a.value.offsetHeight-fe,T=a.value.offsetWidth-fe,H=r**2/a.value.scrollHeight,P=T**2/a.value.scrollWidth,ue=Math.max(H,u.minSize),q=Math.max(P,u.minSize);y.value=H/(r-H)/(ue/(r-ue)),w.value=P/(T-P)/(q/(T-q)),c.value=ue+fe<r?`${ue}px`:"",h.value=q+fe<T?`${q}px`:""};return Y(()=>u.noresize,r=>{r?(p==null||p(),t==null||t()):({stop:p}=_(b,O),t=De("resize",O))},{immediate:!0}),Y(()=>[u.maxHeight,u.height],()=>{u.native||X(()=>{var r;O(),a.value&&((r=E.value)==null||r.handleScroll(a.value))})}),We(kt,we({scrollbarElement:f,wrapElement:a})),ke(()=>{u.native||X(()=>{O()})}),wl(()=>O()),l({wrapRef:a,update:O,scrollTo:Z,setScrollTop:ie,setScrollLeft:re,handleScroll:N}),(r,T)=>(g(),$("div",{ref_key:"scrollbarRef",ref:f,class:m(I(i).b())},[M("div",{ref_key:"wrapRef",ref:a,class:m(I(k)),style:Q(I(d)),onScroll:N},[(g(),D($e(r.tag),{id:r.id,ref_key:"resizeRef",ref:b,class:m(I(F)),style:Q(r.viewStyle),role:r.role,"aria-label":r.ariaLabel,"aria-orientation":r.ariaOrientation},{default:V(()=>[B(r.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],38),r.native?z("v-if",!0):(g(),D(En,{key:0,ref_key:"barRef",ref:E,height:c.value,width:h.value,always:r.always,"ratio-x":w.value,"ratio-y":y.value},null,8,["height","width","always","ratio-x","ratio-y"]))],2))}});var kn=le(Mn,[["__file","scrollbar.vue"]]);const Vn=Ae(kn),Vt=Se({type:{type:String,values:["success","info","warning","danger",""],default:""},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:{type:String,default:""},size:{type:String,values:Cl,default:""},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),zn={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},Ln=A({name:"ElTag"}),Bn=A({...Ln,props:Vt,emits:zn,setup(e,{emit:l}){const s=e,u=St(),i=te("tag"),p=v(()=>{const{type:a,hit:b,effect:h,closable:c,round:E}=s;return[i.b(),i.is("closable",c),i.m(a),i.m(u.value),i.m(h),i.is("hit",b),i.is("round",E)]}),t=a=>{l("close",a)},f=a=>{l("click",a)};return(a,b)=>a.disableTransitions?(g(),$("span",{key:0,class:m(I(p)),style:Q({backgroundColor:a.color}),onClick:f},[M("span",{class:m(I(i).e("content"))},[B(a.$slots,"default")],2),a.closable?(g(),D(I(Pe),{key:0,class:m(I(i).e("close")),onClick:U(t,["stop"])},{default:V(()=>[W(I(ut))]),_:1},8,["class","onClick"])):z("v-if",!0)],6)):(g(),D(gt,{key:1,name:`${I(i).namespace.value}-zoom-in-center`,appear:""},{default:V(()=>[M("span",{class:m(I(p)),style:Q({backgroundColor:a.color}),onClick:f},[M("span",{class:m(I(i).e("content"))},[B(a.$slots,"default")],2),a.closable?(g(),D(I(Pe),{key:0,class:m(I(i).e("close")),onClick:U(t,["stop"])},{default:V(()=>[W(I(ut))]),_:1},8,["class","onClick"])):z("v-if",!0)],6)]),_:3},8,["name"]))}});var Dn=le(Bn,[["__file","tag.vue"]]);const Nn=Ae(Dn),zt=Symbol("ElSelectGroup"),Ve=Symbol("ElSelect");function Pn(e,l){const s=ge(Ve),u=ge(zt,{disabled:!1}),i=v(()=>s.props.multiple?h(s.props.modelValue,e.value):ye(e.value,s.props.modelValue)),p=v(()=>{if(s.props.multiple){const y=s.props.modelValue||[];return!i.value&&y.length>=s.props.multipleLimit&&s.props.multipleLimit>0}else return!1}),t=v(()=>e.label||(ae(e.value)?"":e.value)),f=v(()=>e.value||e.label||""),a=v(()=>e.disabled||l.groupDisabled||p.value),b=Fe(),h=(y=[],w)=>{if(ae(e.value)){const d=s.props.valueKey;return y&&y.some(k=>wt(ee(k,d))===ee(w,d))}else return y&&y.includes(w)},c=()=>{!e.disabled&&!u.disabled&&(s.states.hoveringIndex=s.optionsArray.indexOf(b.proxy))},E=y=>{const w=new RegExp(hn(y),"i");l.visible=w.test(t.value)||e.created};return Y(()=>t.value,()=>{!e.created&&!s.props.remote&&s.setSelected()}),Y(()=>e.value,(y,w)=>{const{remote:d,valueKey:k}=s.props;if(ye(y,w)||(s.onOptionDestroy(w,b.proxy),s.onOptionCreate(b.proxy)),!e.created&&!d){if(k&&ae(y)&&ae(w)&&y[k]===w[k])return;s.setSelected()}}),Y(()=>u.disabled,()=>{l.groupDisabled=u.disabled},{immediate:!0}),{select:s,currentLabel:t,currentValue:f,itemSelected:i,isDisabled:a,hoverItem:c,updateOption:E}}const Wn=A({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(e){const l=te("select"),s=Ct(),u=v(()=>[l.be("dropdown","item"),l.is("disabled",I(f)),l.is("selected",I(t)),l.is("hovering",I(E))]),i=we({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:p,itemSelected:t,isDisabled:f,select:a,hoverItem:b,updateOption:h}=Pn(e,i),{visible:c,hover:E}=Ot(i),y=Fe().proxy;a.onOptionCreate(y),bt(()=>{const d=y.value,{selected:k}=a.states,N=(a.props.multiple?k:[k]).some(Z=>Z.value===y.value);X(()=>{a.states.cachedOptions.get(d)===y&&!N&&a.states.cachedOptions.delete(d)}),a.onOptionDestroy(d,y)});function w(){e.disabled!==!0&&i.groupDisabled!==!0&&a.handleOptionSelect(y)}return{ns:l,id:s,containerKls:u,currentLabel:p,itemSelected:t,isDisabled:f,select:a,hoverItem:b,updateOption:h,visible:c,hover:E,selectOptionClick:w,states:i}}}),An=["id","aria-disabled","aria-selected"];function Fn(e,l,s,u,i,p){return pe((g(),$("li",{id:e.id,class:m(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMouseenter:l[0]||(l[0]=(...t)=>e.hoverItem&&e.hoverItem(...t)),onClick:l[1]||(l[1]=U((...t)=>e.selectOptionClick&&e.selectOptionClick(...t),["stop"]))},[B(e.$slots,"default",{},()=>[M("span",null,x(e.currentLabel),1)])],42,An)),[[Me,e.visible]])}var He=le(Wn,[["render",Fn],["__file","option.vue"]]);const Hn=A({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=ge(Ve),l=te("select"),s=v(()=>e.props.popperClass),u=v(()=>e.props.multiple),i=v(()=>e.props.fitInputWidth),p=S("");function t(){var f;p.value=`${(f=e.selectRef)==null?void 0:f.offsetWidth}px`}return ke(()=>{t(),_(e.selectRef,t)}),{ns:l,minWidth:p,popperClass:s,isMultiple:u,isFitInputWidth:i}}});function Kn(e,l,s,u,i,p){return g(),$("div",{class:m([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:Q({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(g(),$("div",{key:0,class:m(e.ns.be("dropdown","header"))},[B(e.$slots,"header")],2)):z("v-if",!0),B(e.$slots,"default"),e.$slots.footer?(g(),$("div",{key:1,class:m(e.ns.be("dropdown","footer"))},[B(e.$slots,"footer")],2)):z("v-if",!0)],6)}var Un=le(Hn,[["render",Kn],["__file","select-dropdown.vue"]]);function Gn(e){const l=S(!1);return{handleCompositionStart:()=>{l.value=!0},handleCompositionUpdate:p=>{const t=p.target.value,f=t[t.length-1]||"";l.value=!Ol(f)},handleCompositionEnd:p=>{l.value&&(l.value=!1,oe(e)&&e(p))}}}const qn=11,Xn=(e,l)=>{const{t:s}=El(),u=Ct(),i=te("select"),p=te("input"),t=we({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:e.multiple?[]:{},selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1});Il({from:"suffixTransition",replacement:"override style scheme",version:"2.3.0",scope:"props",ref:"https://element-plus.org/en-US/component/select.html#select-attributes"},v(()=>e.suffixTransition===!1));const f=S(null),a=S(null),b=S(null),h=S(null),c=S(null),E=S(null),y=S(null),w=S(null),d=S(null),k=S(null),F=S(null),N=S(null),{wrapperRef:Z,isFocused:ie,handleFocus:re,handleBlur:O}=Tl(c,{afterFocus(){e.automaticDropdown&&!r.value&&(r.value=!0,t.menuVisibleOnFocus=!0)},beforeBlur(n){var o,C;return((o=b.value)==null?void 0:o.isFocusInsideContent(n))||((C=h.value)==null?void 0:C.isFocusInsideContent(n))},afterBlur(){r.value=!1,t.menuVisibleOnFocus=!1}}),r=S(!1),T=S(),{form:H,formItem:P}=Rl(),{inputId:ue}=$l(e,{formItemContext:P}),q=v(()=>e.disabled||(H==null?void 0:H.disabled)),ze=v(()=>e.multiple?G(e.modelValue)&&e.modelValue.length>0:e.modelValue!==void 0&&e.modelValue!==null&&e.modelValue!==""),Bt=v(()=>e.clearable&&!q.value&&t.inputHovering&&ze.value),Ke=v(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),Dt=v(()=>i.is("reverse",Ke.value&&r.value&&e.suffixTransition)),Ue=v(()=>(P==null?void 0:P.validateState)||""),Nt=v(()=>Ml[Ue.value]),Pt=v(()=>e.remote?300:0),Ge=v(()=>e.loading?e.loadingText||s("el.select.loading"):e.remote&&!t.inputValue&&t.options.size===0?!1:e.filterable&&t.inputValue&&t.options.size>0&&ve.value===0?e.noMatchText||s("el.select.noMatch"):t.options.size===0?e.noDataText||s("el.select.noData"):null),ve=v(()=>L.value.filter(n=>n.visible).length),L=v(()=>{const n=Array.from(t.options.values()),o=[];return t.optionValues.forEach(C=>{const R=n.findIndex(j=>j.value===C);R>-1&&o.push(n[R])}),o.length>=n.length?o:n}),Wt=v(()=>Array.from(t.cachedOptions.values())),At=v(()=>{const n=L.value.filter(o=>!o.created).some(o=>o.currentLabel===t.inputValue);return e.filterable&&e.allowCreate&&t.inputValue!==""&&!n}),qe=()=>{e.filterable&&oe(e.filterMethod)||e.filterable&&e.remote&&oe(e.remoteMethod)||L.value.forEach(n=>{n.updateOption(t.inputValue)})},Xe=St(),Ft=v(()=>["small"].includes(Xe.value)?"small":"default"),Ht=v({get(){return r.value&&Ge.value!==!1},set(n){r.value=n}}),Kt=v(()=>G(e.modelValue)?e.modelValue.length===0&&!t.inputValue:e.filterable?!t.inputValue:!0),Ut=v(()=>{var n;const o=(n=e.placeholder)!=null?n:s("el.select.placeholder");return e.multiple||!ze.value?o:t.selectedLabel});Y(()=>e.modelValue,(n,o)=>{e.multiple&&e.filterable&&!e.reserveKeyword&&(t.inputValue="",Ce("")),Oe(),!ye(n,o)&&e.validateEvent&&(P==null||P.validate("change").catch(C=>kl()))},{flush:"post",deep:!0}),Y(()=>r.value,n=>{n?Ce(t.inputValue):(t.inputValue="",t.previousQuery=null,t.isBeforeHide=!0),l("visible-change",n)}),Y(()=>t.options.entries(),()=>{var n;if(!yt)return;const o=((n=f.value)==null?void 0:n.querySelectorAll("input"))||[];(!e.filterable&&!e.defaultFirstOption&&!Vl(e.modelValue)||!Array.from(o).includes(document.activeElement))&&Oe(),e.defaultFirstOption&&(e.filterable||e.remote)&&ve.value&&Ye()},{flush:"post"}),Y(()=>t.hoveringIndex,n=>{ce(n)&&n>-1?T.value=L.value[n]||{}:T.value={},L.value.forEach(o=>{o.hover=T.value===o})}),zl(()=>{t.isBeforeHide||qe()});const Ce=n=>{t.previousQuery!==n&&(t.previousQuery=n,e.filterable&&oe(e.filterMethod)?e.filterMethod(n):e.filterable&&e.remote&&oe(e.remoteMethod)&&e.remoteMethod(n),e.defaultFirstOption&&(e.filterable||e.remote)&&ve.value?X(Ye):X(Gt))},Ye=()=>{const n=L.value.filter(R=>R.visible&&!R.disabled&&!R.states.groupDisabled),o=n.find(R=>R.created),C=n[0];t.hoveringIndex=lt(L.value,o||C)},Oe=()=>{if(e.multiple)t.selectedLabel="";else{const o=Qe(e.modelValue);t.selectedLabel=o.currentLabel,t.selected=o;return}const n=[];G(e.modelValue)&&e.modelValue.forEach(o=>{n.push(Qe(o))}),t.selected=n},Qe=n=>{let o;const C=Be(n).toLowerCase()==="object",R=Be(n).toLowerCase()==="null",j=Be(n).toLowerCase()==="undefined";for(let ne=t.cachedOptions.size-1;ne>=0;ne--){const K=Wt.value[ne];if(C?ee(K.value,e.valueKey)===ee(n,e.valueKey):K.value===n){o={value:n,currentLabel:K.currentLabel,isDisabled:K.isDisabled};break}}if(o)return o;const de=C?n.label:!R&&!j?n:"";return{value:n,currentLabel:de}},Gt=()=>{e.multiple?t.selected.length>0?t.hoveringIndex=Math.min(...t.selected.map(n=>L.value.findIndex(o=>he(o)===he(n)))):t.hoveringIndex=-1:t.hoveringIndex=L.value.findIndex(n=>he(n)===he(t.selected))},qt=()=>{t.selectionWidth=a.value.getBoundingClientRect().width},Ze=()=>{t.calculatorWidth=E.value.getBoundingClientRect().width},Xt=()=>{t.collapseItemWidth=F.value.getBoundingClientRect().width},Le=()=>{var n,o;(o=(n=b.value)==null?void 0:n.updatePopper)==null||o.call(n)},je=()=>{var n,o;(o=(n=h.value)==null?void 0:n.updatePopper)==null||o.call(n)},Je=()=>{t.inputValue.length>0&&!r.value&&(r.value=!0),Ce(t.inputValue)},_e=n=>{if(t.inputValue=n.target.value,e.remote)xe();else return Je()},xe=Ql(()=>{Je()},Pt.value),me=n=>{ye(e.modelValue,n)||l(It,n)},Yt=n=>mn(n,o=>!t.disabledOptions.has(o)),Qt=n=>{if(e.multiple&&n.code!==Ll.delete&&n.target.value.length<=0){const o=e.modelValue.slice(),C=Yt(o);if(C<0)return;o.splice(C,1),l(J,o),me(o)}},Zt=(n,o)=>{const C=t.selected.indexOf(o);if(C>-1&&!q.value){const R=e.modelValue.slice();R.splice(C,1),l(J,R),me(R),l("remove-tag",o.value)}n.stopPropagation(),Ie()},et=n=>{n.stopPropagation();const o=e.multiple?[]:"";if(!Et(o))for(const C of t.selected)C.isDisabled&&o.push(C.value);l(J,o),me(o),t.hoveringIndex=-1,r.value=!1,l("clear"),Ie()},tt=n=>{if(e.multiple){const o=(e.modelValue||[]).slice(),C=lt(o,n.value);C>-1?o.splice(C,1):(e.multipleLimit<=0||o.length<e.multipleLimit)&&o.push(n.value),l(J,o),me(o),n.created&&Ce(""),e.filterable&&!e.reserveKeyword&&(t.inputValue="")}else l(J,n.value),me(n.value),r.value=!1;Ie(),!r.value&&X(()=>{Ee(n)})},lt=(n=[],o)=>{if(!ae(o))return n.indexOf(o);const C=e.valueKey;let R=-1;return n.some((j,de)=>wt(ee(j,C))===ee(o,C)?(R=de,!0):!1),R},Ee=n=>{var o,C,R,j,de;const Te=G(n)?n[0]:n;let ne=null;if(Te!=null&&Te.value){const K=L.value.filter(at=>at.value===Te.value);K.length>0&&(ne=K[0].$el)}if(b.value&&ne){const K=(j=(R=(C=(o=b.value)==null?void 0:o.popperRef)==null?void 0:C.contentRef)==null?void 0:R.querySelector)==null?void 0:j.call(R,`.${i.be("dropdown","wrap")}`);K&&Bl(K,ne)}(de=N.value)==null||de.handleScroll()},jt=n=>{t.options.set(n.value,n),t.cachedOptions.set(n.value,n),n.disabled&&t.disabledOptions.set(n.value,n)},Jt=(n,o)=>{t.options.get(n)===o&&t.options.delete(n)},{handleCompositionStart:_t,handleCompositionUpdate:xt,handleCompositionEnd:el}=Gn(n=>_e(n)),tl=v(()=>{var n,o;return(o=(n=b.value)==null?void 0:n.popperRef)==null?void 0:o.contentRef}),ll=()=>{X(()=>Ee(t.selected))},Ie=()=>{var n;(n=c.value)==null||n.focus()},nl=()=>{nt()},sl=n=>{et(n)},nt=n=>{if(r.value=!1,ie.value){const o=new FocusEvent("focus",n);X(()=>O(o))}},ol=()=>{t.inputValue.length>0?t.inputValue="":r.value=!1},st=()=>{q.value||e.filterable&&e.remote&&oe(e.remoteMethod)||(t.menuVisibleOnFocus?t.menuVisibleOnFocus=!1:r.value=!r.value)},al=()=>{r.value?L.value[t.hoveringIndex]&&tt(L.value[t.hoveringIndex]):st()},he=n=>ae(n.value)?ee(n.value,e.valueKey):n.value,il=v(()=>L.value.filter(n=>n.visible).every(n=>n.disabled)),rl=v(()=>e.multiple?e.collapseTags?t.selected.slice(0,e.maxCollapseTags):t.selected:[]),ul=v(()=>e.multiple?e.collapseTags?t.selected.slice(e.maxCollapseTags):[]:[]),ot=n=>{if(!r.value){r.value=!0;return}if(!(t.options.size===0||ve.value===0)&&!il.value){n==="next"?(t.hoveringIndex++,t.hoveringIndex===t.options.size&&(t.hoveringIndex=0)):n==="prev"&&(t.hoveringIndex--,t.hoveringIndex<0&&(t.hoveringIndex=t.options.size-1));const o=L.value[t.hoveringIndex];(o.disabled===!0||o.states.groupDisabled===!0||!o.visible)&&ot(n),X(()=>Ee(T.value))}},dl=()=>{if(!a.value)return 0;const n=window.getComputedStyle(a.value);return Number.parseFloat(n.gap||"6px")},cl=v(()=>{const n=dl();return{maxWidth:`${F.value&&e.maxCollapseTags===1?t.selectionWidth-t.collapseItemWidth-n:t.selectionWidth}px`}}),fl=v(()=>({maxWidth:`${t.selectionWidth}px`})),pl=v(()=>({width:`${Math.max(t.calculatorWidth,qn)}px`}));return e.multiple&&!G(e.modelValue)&&l(J,[]),!e.multiple&&G(e.modelValue)&&l(J,""),_(a,qt),_(E,Ze),_(d,Le),_(Z,Le),_(k,je),_(F,Xt),ke(()=>{Oe()}),{inputId:ue,contentId:u,nsSelect:i,nsInput:p,states:t,isFocused:ie,expanded:r,optionsArray:L,hoverOption:T,selectSize:Xe,filteredOptionsCount:ve,resetCalculatorWidth:Ze,updateTooltip:Le,updateTagTooltip:je,debouncedOnInputChange:xe,onInput:_e,deletePrevTag:Qt,deleteTag:Zt,deleteSelected:et,handleOptionSelect:tt,scrollToOption:Ee,hasModelValue:ze,shouldShowPlaceholder:Kt,currentPlaceholder:Ut,showClose:Bt,iconComponent:Ke,iconReverse:Dt,validateState:Ue,validateIcon:Nt,showNewOption:At,updateOptions:qe,collapseTagSize:Ft,setSelected:Oe,selectDisabled:q,emptyText:Ge,handleCompositionStart:_t,handleCompositionUpdate:xt,handleCompositionEnd:el,onOptionCreate:jt,onOptionDestroy:Jt,handleMenuEnter:ll,handleFocus:re,focus:Ie,blur:nl,handleBlur:O,handleClearClick:sl,handleClickOutside:nt,handleEsc:ol,toggleMenu:st,selectOption:al,getValueKey:he,navigateOptions:ot,dropdownMenuVisible:Ht,showTagList:rl,collapseTagList:ul,tagStyle:cl,collapseTagStyle:fl,inputStyle:pl,popperRef:tl,inputRef:c,tooltipRef:b,tagTooltipRef:h,calculatorRef:E,prefixRef:y,suffixRef:w,selectRef:f,wrapperRef:Z,selectionRef:a,scrollbarRef:N,menuRef:d,tagMenuRef:k,collapseItemRef:F}};var Yn=A({name:"ElOptions",setup(e,{slots:l}){const s=ge(Ve);let u=[];return()=>{var i,p;const t=(i=l.default)==null?void 0:i.call(l),f=[];function a(b){G(b)&&b.forEach(h=>{var c,E,y,w;const d=(c=(h==null?void 0:h.type)||{})==null?void 0:c.name;d==="ElOptionGroup"?a(!Et(h.children)&&!G(h.children)&&oe((E=h.children)==null?void 0:E.default)?(y=h.children)==null?void 0:y.default():h.children):d==="ElOption"?f.push((w=h.props)==null?void 0:w.value):G(h.children)&&a(h.children)})}return t.length&&a((p=t[0])==null?void 0:p.children),ye(f,u)||(u=f,s&&(s.states.optionValues=f)),t}}});const Qn=Se({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Dl,effect:{type:Re(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Re(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:Kl.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:dt,default:Nl},fitInputWidth:Boolean,suffixIcon:{type:dt,default:Pl},tagType:{...Vt.type,default:"info"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,suffixTransition:{type:Boolean,default:!0},placement:{type:Re(String),values:Ul,default:"bottom-start"},ariaLabel:{type:String,default:void 0}}),vt="ElSelect",Zn=A({name:vt,componentName:vt,components:{ElInput:Wl,ElSelectMenu:Un,ElOption:He,ElOptions:Yn,ElTag:Nn,ElScrollbar:Vn,ElTooltip:Gl,ElIcon:Pe},directives:{ClickOutside:ql},props:Qn,emits:[J,It,"remove-tag","clear","visible-change","focus","blur"],setup(e,{emit:l}){const s=Xn(e,l);return We(Ve,we({props:e,states:s.states,optionsArray:s.optionsArray,handleOptionSelect:s.handleOptionSelect,onOptionCreate:s.onOptionCreate,onOptionDestroy:s.onOptionDestroy,selectRef:s.selectRef,setSelected:s.setSelected})),{...s}}}),jn=["id","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label"],Jn=["textContent"];function _n(e,l,s,u,i,p){const t=se("el-tag"),f=se("el-tooltip"),a=se("el-icon"),b=se("el-option"),h=se("el-options"),c=se("el-scrollbar"),E=se("el-select-menu"),y=Al("click-outside");return pe((g(),$("div",{ref:"selectRef",class:m([e.nsSelect.b(),e.nsSelect.m(e.selectSize)]),onMouseenter:l[14]||(l[14]=w=>e.states.inputHovering=!0),onMouseleave:l[15]||(l[15]=w=>e.states.inputHovering=!1),onClick:l[16]||(l[16]=U((...w)=>e.toggleMenu&&e.toggleMenu(...w),["stop"]))},[W(f,{ref:"tooltipRef",visible:e.dropdownMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,onBeforeShow:e.handleMenuEnter,onHide:l[13]||(l[13]=w=>e.states.isBeforeHide=!1)},{default:V(()=>{var w;return[M("div",{ref:"wrapperRef",class:m([e.nsSelect.e("wrapper"),e.nsSelect.is("focused",e.isFocused),e.nsSelect.is("hovering",e.states.inputHovering),e.nsSelect.is("filterable",e.filterable),e.nsSelect.is("disabled",e.selectDisabled)])},[e.$slots.prefix?(g(),$("div",{key:0,ref:"prefixRef",class:m(e.nsSelect.e("prefix"))},[B(e.$slots,"prefix")],2)):z("v-if",!0),M("div",{ref:"selectionRef",class:m([e.nsSelect.e("selection"),e.nsSelect.is("near",e.multiple&&!e.$slots.prefix&&!!e.states.selected.length)])},[e.multiple?B(e.$slots,"tag",{key:0},()=>[(g(!0),$(Ne,null,ct(e.showTagList,d=>(g(),$("div",{key:e.getValueKey(d),class:m(e.nsSelect.e("selected-item"))},[W(t,{closable:!e.selectDisabled&&!d.isDisabled,size:e.collapseTagSize,type:e.tagType,"disable-transitions":"",style:Q(e.tagStyle),onClose:k=>e.deleteTag(k,d)},{default:V(()=>[M("span",{class:m(e.nsSelect.e("tags-text"))},x(d.currentLabel),3)]),_:2},1032,["closable","size","type","style","onClose"])],2))),128)),e.collapseTags&&e.states.selected.length>e.maxCollapseTags?(g(),D(f,{key:0,ref:"tagTooltipRef",disabled:e.dropdownMenuVisible||!e.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:V(()=>[M("div",{ref:"collapseItemRef",class:m(e.nsSelect.e("selected-item"))},[W(t,{closable:!1,size:e.collapseTagSize,type:e.tagType,"disable-transitions":"",style:Q(e.collapseTagStyle)},{default:V(()=>[M("span",{class:m(e.nsSelect.e("tags-text"))}," + "+x(e.states.selected.length-e.maxCollapseTags),3)]),_:1},8,["size","type","style"])],2)]),content:V(()=>[M("div",{ref:"tagMenuRef",class:m(e.nsSelect.e("selection"))},[(g(!0),$(Ne,null,ct(e.collapseTagList,d=>(g(),$("div",{key:e.getValueKey(d),class:m(e.nsSelect.e("selected-item"))},[W(t,{class:"in-tooltip",closable:!e.selectDisabled&&!d.isDisabled,size:e.collapseTagSize,type:e.tagType,"disable-transitions":"",onClose:k=>e.deleteTag(k,d)},{default:V(()=>[M("span",{class:m(e.nsSelect.e("tags-text"))},x(d.currentLabel),3)]),_:2},1032,["closable","size","type","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect","teleported"])):z("v-if",!0)]):z("v-if",!0),e.selectDisabled?z("v-if",!0):(g(),$("div",{key:1,class:m([e.nsSelect.e("selected-item"),e.nsSelect.e("input-wrapper"),e.nsSelect.is("hidden",!e.filterable)])},[pe(M("input",{id:e.inputId,ref:"inputRef","onUpdate:modelValue":l[0]||(l[0]=d=>e.states.inputValue=d),type:"text",class:m([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:Q(e.inputStyle),role:"combobox",readonly:!e.filterable,spellcheck:"false","aria-activedescendant":((w=e.hoverOption)==null?void 0:w.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropdownMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:l[1]||(l[1]=(...d)=>e.handleFocus&&e.handleFocus(...d)),onBlur:l[2]||(l[2]=(...d)=>e.handleBlur&&e.handleBlur(...d)),onKeydown:[l[3]||(l[3]=be(U(d=>e.navigateOptions("next"),["stop","prevent"]),["down"])),l[4]||(l[4]=be(U(d=>e.navigateOptions("prev"),["stop","prevent"]),["up"])),l[5]||(l[5]=be(U((...d)=>e.handleEsc&&e.handleEsc(...d),["stop","prevent"]),["esc"])),l[6]||(l[6]=be(U((...d)=>e.selectOption&&e.selectOption(...d),["stop","prevent"]),["enter"])),l[7]||(l[7]=be(U((...d)=>e.deletePrevTag&&e.deletePrevTag(...d),["stop","prevent"]),["delete"]))],onCompositionstart:l[8]||(l[8]=(...d)=>e.handleCompositionStart&&e.handleCompositionStart(...d)),onCompositionupdate:l[9]||(l[9]=(...d)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...d)),onCompositionend:l[10]||(l[10]=(...d)=>e.handleCompositionEnd&&e.handleCompositionEnd(...d)),onInput:l[11]||(l[11]=(...d)=>e.onInput&&e.onInput(...d)),onClick:l[12]||(l[12]=U((...d)=>e.toggleMenu&&e.toggleMenu(...d),["stop"]))},null,46,jn),[[Fl,e.states.inputValue]]),e.filterable?(g(),$("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:m(e.nsSelect.e("input-calculator")),textContent:x(e.states.inputValue)},null,10,Jn)):z("v-if",!0)],2)),e.shouldShowPlaceholder?(g(),$("div",{key:2,class:m([e.nsSelect.e("selected-item"),e.nsSelect.e("placeholder"),e.nsSelect.is("transparent",!e.hasModelValue||e.expanded&&!e.states.inputValue)])},[M("span",null,x(e.currentPlaceholder),1)],2)):z("v-if",!0)],2),M("div",{ref:"suffixRef",class:m(e.nsSelect.e("suffix"))},[e.iconComponent&&!e.showClose?(g(),D(a,{key:0,class:m([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:V(()=>[(g(),D($e(e.iconComponent)))]),_:1},8,["class"])):z("v-if",!0),e.showClose&&e.clearIcon?(g(),D(a,{key:1,class:m([e.nsSelect.e("caret"),e.nsSelect.e("icon")]),onClick:e.handleClearClick},{default:V(()=>[(g(),D($e(e.clearIcon)))]),_:1},8,["class","onClick"])):z("v-if",!0),e.validateState&&e.validateIcon?(g(),D(a,{key:2,class:m([e.nsInput.e("icon"),e.nsInput.e("validateIcon")])},{default:V(()=>[(g(),D($e(e.validateIcon)))]),_:1},8,["class"])):z("v-if",!0)],2)],2)]}),content:V(()=>[W(E,{ref:"menuRef"},{default:V(()=>[e.$slots.header?(g(),$("div",{key:0,class:m(e.nsSelect.be("dropdown","header"))},[B(e.$slots,"header")],2)):z("v-if",!0),pe(W(c,{id:e.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:m([e.nsSelect.is("empty",e.filteredOptionsCount===0)]),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical"},{default:V(()=>[e.showNewOption?(g(),D(b,{key:0,value:e.states.inputValue,created:!0},null,8,["value"])):z("v-if",!0),W(h,null,{default:V(()=>[B(e.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[Me,e.states.options.size>0&&!e.loading]]),e.$slots.loading&&e.loading?(g(),$("div",{key:1,class:m(e.nsSelect.be("dropdown","loading"))},[B(e.$slots,"loading")],2)):e.loading||e.filteredOptionsCount===0?(g(),$("div",{key:2,class:m(e.nsSelect.be("dropdown","empty"))},[B(e.$slots,"empty",{},()=>[M("span",null,x(e.emptyText),1)])],2)):z("v-if",!0),e.$slots.footer?(g(),$("div",{key:3,class:m(e.nsSelect.be("dropdown","footer"))},[B(e.$slots,"footer")],2)):z("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","effect","transition","persistent","onBeforeShow"])],34)),[[y,e.handleClickOutside,e.popperRef]])}var xn=le(Zn,[["render",_n],["__file","select.vue"]]);const es=A({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const l=te("select"),s=S(null),u=Fe(),i=S([]);We(zt,we({...Ot(e)}));const p=v(()=>i.value.some(a=>a.visible===!0)),t=a=>{const b=[];return G(a.children)&&a.children.forEach(h=>{var c;h.type&&h.type.name==="ElOption"&&h.component&&h.component.proxy?b.push(h.component.proxy):(c=h.children)!=null&&c.length&&b.push(...t(h))}),b},f=()=>{i.value=t(u.subTree)};return ke(()=>{f()}),Hl(s,f,{attributes:!0,subtree:!0,childList:!0}),{groupRef:s,visible:p,ns:l}}});function ts(e,l,s,u,i,p){return pe((g(),$("ul",{ref:"groupRef",class:m(e.ns.be("group","wrap"))},[M("li",{class:m(e.ns.be("group","title"))},x(e.label),3),M("li",null,[M("ul",{class:m(e.ns.b("group"))},[B(e.$slots,"default")],2)])],2)),[[Me,e.visible]])}var Lt=le(es,[["render",ts],["__file","option-group.vue"]]);const rs=Ae(xn,{Option:He,OptionGroup:Lt}),us=Tt(He);Tt(Lt);export{us as E,rs as a,Nn as b,fn as c,Vn as d,hn as e,is as f,Ve as s,Vt as t};
|