1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2026-03-21 09:13:10 +00:00
Classworks/assets/VSelect-B5ZKU6ZJ.js

2 lines
22 KiB
JavaScript

import{f as it,j as ct,e as ft,V as Be,g as dt}from"./VTextField-BmfQXFFg.js";import{g as fe,ar as pe,aH as vt,b7 as mt,bm as je,bO as ht,ch as Ke,$ as gt,ci as yt,ae as q,b as de,an as _e,c as x,aW as Ge,E as _,au as We,cj as pt,ck as Xe,a3 as H,av as ce,a2 as W,az as U,p as X,aA as Ye,bn as bt,cl as Ze,cm as Se,bT as kt,cn as wt,bo as Vt,aC as St,bz as Pt,bg as Ct,co as It,be as At,n as Qe,d as ie,e as Je,bp as xt,bj as Tt,m as Rt,bk as Ft,cp as Et,bl as Dt,bq as Mt,f as qe,h as Fe,bI as Lt,cd as et,i as C,F as ue,X as Ot,b3 as xe,ba as tt,bc as Pe,bb as Bt,c8 as lt,aw as nt,aS as at,bZ as Kt,by as _t,Z as Ht,ca as $t,aJ as ye,bY as Te,ah as re,as as Re,aq as zt,aR as Ut,aY as Ce,t as He,P as Nt,Q as $e,cq as jt,K as Gt,aU as Wt,L as Xt,aV as Yt,v as Zt,aX as ze,aZ as Ue,bi as Qt,a_ as Jt,cr as qt}from"./index-CHEqx3ZK.js";import{V as el}from"./VCheckboxBtn-L9oezRC0.js";import{V as Ne}from"./VChip-B02B673U.js";const tl=X({id:String,submenu:Boolean,...Ye(bt({captureFocus:!0,closeDelay:250,closeOnContentClick:!0,locationStrategy:"connected",location:void 0,openDelay:300,scrim:!1,scrollStrategy:"reposition",transition:{component:Ze}}),["absolute"])},"VMenu"),ll=fe()({name:"VMenu",props:tl(),emits:{"update:modelValue":e=>!0},setup(e,n){let{slots:t}=n;const u=pe(e,"modelValue"),{scopeId:r}=vt(),{isRtl:c}=mt(),f=je(),a=ce(()=>e.id||`v-menu-${f}`),o=W(),i=ht(Ke,null),y=U(new Set);kt(Ke,{register(){y.value.add(f)},unregister(){y.value.delete(f)},closeParents(l){setTimeout(()=>{var d;!y.value.size&&!e.persistent&&(l==null||(d=o.value)!=null&&d.contentEl&&!wt(l,o.value.contentEl))&&(u.value=!1,i==null||i.closeParents())},40)}}),gt(()=>i==null?void 0:i.unregister()),yt(()=>u.value=!1),q(u,l=>{l?i==null||i.register():i==null||i.unregister()},{immediate:!0});function b(l){i==null||i.closeParents(l)}function k(l){var d,h,P,E,I;if(!e.disabled)if(l.key==="Tab"||l.key==="Enter"&&!e.closeOnContentClick){if(l.key==="Enter"&&(l.target instanceof HTMLTextAreaElement||l.target instanceof HTMLInputElement&&l.target.closest("form")))return;l.key==="Enter"&&l.preventDefault(),!pt(Xe((d=o.value)==null?void 0:d.contentEl,!1),l.shiftKey?"prev":"next",j=>j.tabIndex>=0)&&!e.retainFocus&&(u.value=!1,(P=(h=o.value)==null?void 0:h.activatorEl)==null||P.focus())}else e.submenu&&l.key===(c.value?"ArrowRight":"ArrowLeft")&&(u.value=!1,(I=(E=o.value)==null?void 0:E.activatorEl)==null||I.focus())}function g(l){var h;if(e.disabled)return;const d=(h=o.value)==null?void 0:h.contentEl;d&&u.value?l.key==="ArrowDown"?(l.preventDefault(),l.stopImmediatePropagation(),Se(d,"next")):l.key==="ArrowUp"?(l.preventDefault(),l.stopImmediatePropagation(),Se(d,"prev")):e.submenu&&(l.key===(c.value?"ArrowRight":"ArrowLeft")?u.value=!1:l.key===(c.value?"ArrowLeft":"ArrowRight")&&(l.preventDefault(),Se(d,"first"))):(e.submenu?l.key===(c.value?"ArrowLeft":"ArrowRight"):["ArrowDown","ArrowUp"].includes(l.key))&&(u.value=!0,l.preventDefault(),setTimeout(()=>setTimeout(()=>g(l))))}const v=H(()=>_({"aria-haspopup":"menu","aria-expanded":String(u.value),"aria-controls":a.value,"aria-owns":a.value,onKeydown:g},e.activatorProps));return de(()=>{const l=_e.filterProps(e);return x(_e,_({ref:o,id:a.value,class:["v-menu",e.class],style:e.style},l,{modelValue:u.value,"onUpdate:modelValue":d=>u.value=d,absolute:!0,activatorProps:v.value,location:e.location??(e.submenu?"end":"bottom"),"onClick:outside":b,onKeydown:k},r),{activator:t.activator,default:function(){for(var d=arguments.length,h=new Array(d),P=0;P<d;P++)h[P]=arguments[P];return x(Ge,{root:"VMenu"},{default:()=>{var E;return[(E=t.default)==null?void 0:E.call(t,...h)]}})}})}),We({id:a,ΨopenChildren:y},o)}}),nl=X({color:String,...Lt(),...Fe(),...qe(),...Mt(),...Dt(),...Et(),...Ft(),...Rt(),...Tt()},"VSheet"),al=fe()({name:"VSheet",props:nl(),setup(e,n){let{slots:t}=n;const{themeClasses:u}=Vt(e),{backgroundColorClasses:r,backgroundColorStyles:c}=St(()=>e.color),{borderClasses:f}=Pt(e),{dimensionStyles:a}=Je(e),{elevationClasses:o}=xt(e),{locationStyles:i}=Ct(e),{positionClasses:y}=It(e),{roundedClasses:b}=At(e);return de(()=>x(e.tag,{class:ie(["v-sheet",u.value,r.value,f.value,o.value,y.value,b.value,e.class]),style:Qe([c.value,a.value,i.value,e.style])},t)),{}}}),ol=X({renderless:Boolean,...Fe()},"VVirtualScrollItem"),sl=fe()({name:"VVirtualScrollItem",inheritAttrs:!1,props:ol(),emits:{"update:height":e=>!0},setup(e,n){let{attrs:t,emit:u,slots:r}=n;const{resizeRef:c,contentRect:f}=et(void 0,"border");q(()=>{var a;return(a=f.value)==null?void 0:a.height},a=>{a!=null&&u("update:height",a)}),de(()=>{var a,o;return e.renderless?C(ue,null,[(a=r.default)==null?void 0:a.call(r,{itemRef:c})]):C("div",_({ref:c,class:["v-virtual-scroll__item",e.class],style:e.style},t),[(o=r.default)==null?void 0:o.call(r)])})}}),ul=-1,rl=1,Ie=100,il=X({itemHeight:{type:[Number,String],default:null},itemKey:{type:[String,Array,Function],default:null},height:[Number,String]},"virtual");function cl(e,n){const t=Ot(),u=U(0);xe(()=>{u.value=parseFloat(e.itemHeight||0)});const r=U(0),c=U(Math.ceil((parseInt(e.height)||t.height.value)/(u.value||16))||1),f=U(0),a=U(0),o=W(),i=W();let y=0;const{resizeRef:b,contentRect:k}=et();xe(()=>{b.value=o.value});const g=H(()=>{var m;return o.value===document.documentElement?t.height.value:((m=k.value)==null?void 0:m.height)||parseInt(e.height)||0}),v=H(()=>!!(o.value&&i.value&&g.value&&u.value));let l=Array.from({length:n.value.length}),d=Array.from({length:n.value.length});const h=U(0);let P=-1;function E(m){return l[m]||u.value}const I=Bt(()=>{const m=performance.now();d[0]=0;const S=n.value.length;for(let F=1;F<=S;F++)d[F]=(d[F-1]||0)+E(F-1);h.value=Math.max(h.value,performance.now()-m)},h),Y=q(v,m=>{m&&(Y(),y=i.value.offsetTop,I.immediate(),G(),~P&&nt(()=>{at&&window.requestAnimationFrame(()=>{N(P),P=-1})}))});tt(()=>{I.clear()});function j(m,S){const F=l[m],M=u.value;u.value=M?Math.min(u.value,S):S,(F!==S||M!==u.value)&&(l[m]=S,I())}function R(m){m=Pe(m,0,n.value.length);const S=Math.floor(m),F=m%1,M=S+1,Q=d[S]||0,B=d[M]||Q;return Q+(B-Q)*F}function Z(m){return fl(d,m)}let ee=0,D=0,te=0;q(g,(m,S)=>{G(),m<S&&requestAnimationFrame(()=>{D=0,G()})});let le=-1;function T(){if(!o.value||!i.value)return;const m=o.value.scrollTop,S=performance.now();S-te>500?(D=Math.sign(m-ee),y=i.value.offsetTop):D=m-ee,ee=m,te=S,window.clearTimeout(le),le=window.setTimeout(ve,500),G()}function ve(){!o.value||!i.value||(D=0,te=0,window.clearTimeout(le),G())}let me=-1;function G(){cancelAnimationFrame(me),me=requestAnimationFrame(be)}function be(){if(!o.value||!g.value||!u.value)return;const m=ee-y,S=Math.sign(D),F=Math.max(0,m-Ie),M=Pe(Z(F),0,n.value.length),Q=m+g.value+Ie,B=Pe(Z(Q)+1,M+1,n.value.length);if((S!==ul||M<r.value)&&(S!==rl||B>c.value)){const we=R(r.value)-R(M),Ve=R(B)-R(c.value);Math.max(we,Ve)>Ie?(r.value=M,c.value=B):(M<=0&&(r.value=M),B>=n.value.length&&(c.value=B))}f.value=R(r.value),a.value=R(n.value.length)-R(c.value)}function N(m){const S=R(m);!o.value||m&&!S?P=m:o.value.scrollTop=S}const ke=H(()=>n.value.slice(r.value,c.value).map((m,S)=>{const F=S+r.value;return{raw:m,index:F,key:lt(m,e.itemKey,F)}}));return q(n,()=>{l=Array.from({length:n.value.length}),d=Array.from({length:n.value.length}),I.immediate(),G()},{deep:1}),{calculateVisibleItems:G,containerRef:o,markerRef:i,computedItems:ke,paddingTop:f,paddingBottom:a,scrollToIndex:N,handleScroll:T,handleScrollend:ve,handleItemResize:j}}function fl(e,n){let t=e.length-1,u=0,r=0,c=null,f=-1;if(e[t]<n)return t;for(;u<=t;)if(r=u+t>>1,c=e[r],c>n)t=r-1;else if(c<n)f=r,u=r+1;else return c===n?r:u;return f}const dl=X({items:{type:Array,default:()=>[]},renderless:Boolean,...il(),...Fe(),...qe()},"VVirtualScroll"),vl=fe()({name:"VVirtualScroll",props:dl(),setup(e,n){let{slots:t}=n;const u=Kt("VVirtualScroll"),{dimensionStyles:r}=Je(e),{calculateVisibleItems:c,containerRef:f,markerRef:a,handleScroll:o,handleScrollend:i,handleItemResize:y,scrollToIndex:b,paddingTop:k,paddingBottom:g,computedItems:v}=cl(e,ce(()=>e.items));return _t(()=>e.renderless,()=>{function l(){var P,E;const h=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)?"addEventListener":"removeEventListener";f.value===document.documentElement?(document[h]("scroll",o,{passive:!0}),document[h]("scrollend",i)):((P=f.value)==null||P[h]("scroll",o,{passive:!0}),(E=f.value)==null||E[h]("scrollend",i))}Ht(()=>{f.value=$t(u.vnode.el,!0),l(!0)}),tt(l)}),de(()=>{const l=v.value.map(d=>x(sl,{key:d.key,renderless:e.renderless,"onUpdate:height":h=>y(d.index,h)},{default:h=>{var P;return(P=t.default)==null?void 0:P.call(t,{item:d.raw,index:d.index,...h})}}));return e.renderless?C(ue,null,[C("div",{ref:a,class:"v-virtual-scroll__spacer",style:{paddingTop:ye(k.value)}},null),l,C("div",{class:"v-virtual-scroll__spacer",style:{paddingBottom:ye(g.value)}},null)]):C("div",{ref:f,class:ie(["v-virtual-scroll",e.class]),onScrollPassive:o,onScrollend:i,style:Qe([r.value,e.style])},[C("div",{ref:a,class:"v-virtual-scroll__container",style:{paddingTop:ye(k.value),paddingBottom:ye(g.value)}},[l])])}),{calculateVisibleItems:c,scrollToIndex:b}}});function ml(e,n){const t=U(!1);let u;function r(a){cancelAnimationFrame(u),t.value=!0,u=requestAnimationFrame(()=>{u=requestAnimationFrame(()=>{t.value=!1})})}async function c(){await new Promise(a=>requestAnimationFrame(a)),await new Promise(a=>requestAnimationFrame(a)),await new Promise(a=>requestAnimationFrame(a)),await new Promise(a=>{if(t.value){const o=q(t,()=>{o(),a()})}else a()})}async function f(a){var y,b;if(a.key==="Tab"&&((y=n.value)==null||y.focus()),!["PageDown","PageUp","Home","End"].includes(a.key))return;const o=(b=e.value)==null?void 0:b.$el;if(!o)return;(a.key==="Home"||a.key==="End")&&o.scrollTo({top:a.key==="Home"?0:o.scrollHeight,behavior:"smooth"}),await c();const i=o.querySelectorAll(":scope > :not(.v-virtual-scroll__spacer)");if(a.key==="PageDown"||a.key==="Home"){const k=o.getBoundingClientRect().top;for(const g of i)if(g.getBoundingClientRect().top>=k){g.focus();break}}else{const k=o.getBoundingClientRect().bottom;for(const g of[...i].reverse())if(g.getBoundingClientRect().bottom<=k){g.focus();break}}}return{onScrollPassive:r,onKeydown:f}}function hl(e){let{groups:n,onLeave:t}=e;function u(a){var o;return a.type==="list"?(o=a.contentRef.value)==null?void 0:o.$el:a.contentRef.value}function r(a){const o=u(a);return o?Xe(o):[]}function c(a){var g;const o=a.target,i=a.shiftKey?"backward":"forward",y=n.map(r),b=n.map(v=>{var l;return v.type==="list"?(l=v.contentRef.value)==null?void 0:l.$el:v.contentRef.value}).findIndex(v=>v==null?void 0:v.contains(o)),k=f(y,b,i,o);if(k===null){const v=n[b],l=y[b];(v.type==="list"||(i==="forward"?l.at(-1)===a.target:l.at(0)===a.target))&&t()}else{a.preventDefault(),a.stopImmediatePropagation();const v=n[k];if(v.type==="list"&&Te(v.displayItemsCount)>0)(g=v.contentRef.value)==null||g.focus(0);else{const l=i==="forward";y[k].at(l?0:-1).focus()}}}function f(a,o,i,y){const b=n[o],k=a[o];if(b.type!=="list"&&!(i==="forward"?k.at(-1)===y:k.at(0)===y))return null;const g=i==="forward"?1:-1;for(let v=o+g;v>=0&&v<n.length;v+=g){const l=n[v];if(a[v].length>0||l.type==="list"&&Te(l.displayItemsCount)>0)return v}return null}return{onTabKeydown:c}}const gl=(e,n,t)=>{if(e==null||n==null)return-1;if(!n.length)return 0;e=e.toString().toLocaleLowerCase(),n=n.toString().toLocaleLowerCase();const u=[];let r=e.indexOf(n);for(;~r;)u.push([r,r+n.length]),r=e.indexOf(n,r+n.length);return u.length?u:-1};function Ae(e,n){if(!(e==null||typeof e=="boolean"||e===-1))return typeof e=="number"?[[e,e+n.length]]:Array.isArray(e[0])?e:[e]}const yl=X({customFilter:Function,customKeyFilter:Object,filterKeys:[Array,String],filterMode:{type:String,default:"intersection"},noFilter:Boolean},"filter");function pl(e,n,t){var o,i;const u=[],r=(t==null?void 0:t.default)??gl,c=t!=null&&t.filterKeys?Re(t.filterKeys):!1,f=Object.keys((t==null?void 0:t.customKeyFilter)??{}).length;if(!(e!=null&&e.length))return u;let a=[];e:for(let y=0;y<e.length;y++){const[b,k=b]=Re(e[y]),g={},v={};let l=-1;if((n||f>0)&&!(t!=null&&t.noFilter)){let d=!1;if(typeof b=="object"){if(b.type==="divider"||b.type==="subheader"){(((o=a.at(-1))==null?void 0:o.type)!=="divider"||b.type!=="subheader")&&(a=[]),a.push({index:y,matches:{},type:b.type});continue}const E=c||Object.keys(k);d=E.length===f;for(const I of E){const Y=lt(k,I),j=(i=t==null?void 0:t.customKeyFilter)==null?void 0:i[I];if(l=j?j(Y,n,b):r(Y,n,b),l!==-1&&l!==!1)j?g[I]=Ae(l,n):v[I]=Ae(l,n);else if((t==null?void 0:t.filterMode)==="every")continue e}}else l=r(b,n,b),l!==-1&&l!==!1&&(v.title=Ae(l,n));const h=Object.keys(v).length,P=Object.keys(g).length;if(!h&&!P||(t==null?void 0:t.filterMode)==="union"&&P!==f&&!h||(t==null?void 0:t.filterMode)==="intersection"&&(P!==f||!h&&f>0&&!d))continue}a.length&&(u.push(...a),a=[]),u.push({index:y,matches:{...v,...g}})}return u}function bl(e,n,t,u){const r=U([]),c=U(new Map),f=H(()=>u!=null&&u.transform?re(n).map(o=>[o,u.transform(o)]):re(n));xe(()=>{const o=typeof t=="function"?t():re(t),i=typeof o!="string"&&typeof o!="number"?"":String(o),y=pl(f.value,i,{customKeyFilter:{...e.customKeyFilter,...re(u==null?void 0:u.customKeyFilter)},default:e.customFilter,filterKeys:e.filterKeys,filterMode:e.filterMode,noFilter:e.noFilter}),b=re(n),k=[],g=new Map;y.forEach(v=>{let{index:l,matches:d}=v;const h=b[l];k.push(h),g.set(h.value,d)}),r.value=k,c.value=g});function a(o){return c.value.get(o.value)}return{filteredItems:r,filteredMatches:c,getMatches:a}}function kl(e,n,t){return t==null||!t.length?n:t.map((u,r)=>{const c=r===0?0:t[r-1][1],f=[C("span",{class:ie(`${e}__unmask`)},[n.slice(c,u[0])]),C("span",{class:ie(`${e}__mask`)},[n.slice(u[0],u[1])])];return r===t.length-1&&f.push(C("span",{class:ie(`${e}__unmask`)},[n.slice(u[1])])),C(ue,null,[f])})}const wl=X({closeText:{type:String,default:"$vuetify.close"},openText:{type:String,default:"$vuetify.open"}},"autocomplete");function Vl(e,n){const t=je(),u=H(()=>`menu-${t}`),r=ce(()=>Te(n)),c=ce(()=>u.value);return{menuId:u,ariaExpanded:r,ariaControls:c}}const Sl=X({chips:Boolean,closableChips:Boolean,eager:Boolean,hideNoData:Boolean,hideSelected:Boolean,listProps:{type:Object},menu:Boolean,menuIcon:{type:Jt,default:"$dropdown"},menuProps:{type:Object},multiple:Boolean,noDataText:{type:String,default:"$vuetify.noDataText"},openOnClear:Boolean,itemColor:String,noAutoScroll:Boolean,...wl(),...qt({itemChildren:!1})},"Select"),Pl=X({search:String,...yl({filterKeys:["title"]}),...Sl(),...Ye(dt({modelValue:null,role:"combobox"}),["validationValue","dirty"]),...Qt({transition:{component:Ze}})},"VSelect"),Tl=fe()({name:"VSelect",props:Pl(),emits:{"update:focused":e=>!0,"update:modelValue":e=>!0,"update:menu":e=>!0,"update:search":e=>!0},setup(e,n){let{slots:t}=n;const{t:u}=zt(),r=W(),c=W(),f=W(),a=W(),o=W(),{items:i,transformIn:y,transformOut:b}=Ut(e),k=pe(e,"search",""),{filteredItems:g,getMatches:v}=bl(e,i,()=>k.value),l=pe(e,"modelValue",[],s=>y(s===null?[null]:Re(s)),s=>{const w=b(s);return e.multiple?w:w[0]??null}),d=H(()=>typeof e.counterValue=="function"?e.counterValue(l.value):typeof e.counterValue=="number"?e.counterValue:l.value.length),h=it(e),P=ct(e),E=H(()=>l.value.map(s=>s.value)),I=U(!1),Y=ce(()=>e.closableChips&&!h.isReadonly.value&&!h.isDisabled.value),{InputIcon:j}=ft(e);let R="",Z=0,ee;const D=H(()=>{const s=k.value?g.value:i.value;return e.hideSelected?s.filter(w=>!l.value.some(A=>(e.valueComparator||Ce)(A,w))):s}),te=H(()=>e.hideNoData&&!D.value.length||h.isReadonly.value||h.isDisabled.value),le=pe(e,"menu"),T=H({get:()=>le.value,set:s=>{var w;le.value&&!s&&((w=c.value)!=null&&w.ΨopenChildren.size)||s&&te.value||(le.value=s)}}),{menuId:ve,ariaExpanded:me,ariaControls:G}=Vl(e,T),be=H(()=>{var s;return{...e.menuProps,activatorProps:{...((s=e.menuProps)==null?void 0:s.activatorProps)||{},"aria-haspopup":"listbox"}}}),N=W(),ke=ml(N,r),{onTabKeydown:m}=hl({groups:[{type:"element",contentRef:f},{type:"list",contentRef:N,displayItemsCount:()=>D.value.length},{type:"element",contentRef:a}],onLeave:()=>{var s;T.value=!1,(s=r.value)==null||s.focus()}});function S(s){e.openOnClear&&(T.value=!0)}function F(){te.value||(T.value=!T.value)}function M(s){var w;s.key==="Tab"&&m(s),(w=N.value)!=null&&w.$el.contains(s.target)&&ze(s)&&Q(s)}function Q(s){var K,z,se;if(!s.key||h.isReadonly.value)return;if(["Enter"," ","ArrowDown","ArrowUp","Home","End"].includes(s.key)&&s.preventDefault(),["Enter","ArrowDown"," "].includes(s.key)&&(T.value=!0),["Escape","Tab"].includes(s.key)&&(T.value=!1),e.clearable&&s.key==="Backspace"){s.preventDefault(),l.value=[],S();return}s.key==="Home"?(K=N.value)==null||K.focus("first"):s.key==="End"&&((z=N.value)==null||z.focus("last"));const w=1e3;if(!ze(s))return;const A=performance.now();A-ee>w&&(R="",Z=0),R+=s.key.toLowerCase(),ee=A;const ne=D.value;function J(){let p=ae();return p||R.at(-1)===R.at(-2)&&(R=R.slice(0,-1),Z++,p=ae(),p)||(Z=0,p=ae(),p)?p:(R=s.key.toLowerCase(),ae())}function ae(){for(let p=Z;p<ne.length;p++){const L=ne[p];if(L.title.toLowerCase().startsWith(R))return[L,p]}}const $=J();if(!$)return;const[oe,V]=$;Z=V,(se=N.value)==null||se.focus(V),e.multiple||(l.value=[oe])}function B(s){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!s.props.disabled)if(e.multiple){const A=l.value.findIndex(J=>(e.valueComparator||Ce)(J.value,s.value)),ne=w??!~A;if(~A){const J=ne?[...l.value,s]:[...l.value];J.splice(A,1),l.value=J}else ne&&(l.value=[...l.value,s])}else{const A=w!==!1;l.value=A?[s]:[],nt(()=>{T.value=!1})}}function we(s){var A;const w=s.target;(A=r.value)!=null&&A.$el.contains(w)||(T.value=!1)}function Ve(){var s;e.eager&&((s=o.value)==null||s.calculateVisibleItems())}function Ee(){var s;k.value="",I.value&&((s=r.value)==null||s.focus())}function ot(s){I.value=!0}function st(s){if(s==null)l.value=[];else if(Ue(r.value,":autofill")||Ue(r.value,":-webkit-autofill")){const w=i.value.find(A=>A.title===s);w&&B(w)}else r.value&&(r.value.value="")}return q(T,()=>{if(!e.hideSelected&&T.value&&l.value.length){const s=D.value.findIndex(w=>l.value.some(A=>(e.valueComparator||Ce)(A.value,w.value)));at&&!e.noAutoScroll&&window.requestAnimationFrame(()=>{var w;s>=0&&((w=o.value)==null||w.scrollToIndex(s))})}}),q(i,(s,w)=>{T.value||I.value&&e.hideNoData&&!w.length&&s.length&&(T.value=!0)}),de(()=>{const s=!!(e.chips||t.chip),w=!!(!e.hideNoData||D.value.length||t["prepend-item"]||t["append-item"]||t["no-data"]),A=l.value.length>0,ne=Be.filterProps(e),J=A||!I.value&&e.label&&!e.persistentPlaceholder?void 0:e.placeholder,ae={search:k,filteredItems:g.value};return x(Be,_({ref:r},ne,{modelValue:l.value.map($=>$.props.title).join(", "),name:void 0,"onUpdate:modelValue":st,focused:I.value,"onUpdate:focused":$=>I.value=$,validationValue:l.externalValue,counterValue:d.value,dirty:A,class:["v-select",{"v-select--active-menu":T.value,"v-select--chips":!!e.chips,[`v-select--${e.multiple?"multiple":"single"}`]:!0,"v-select--selected":l.value.length,"v-select--selection-slot":!!t.selection},e.class],style:e.style,inputmode:"none",placeholder:J,"onClick:clear":S,"onMousedown:control":F,onBlur:we,onKeydown:Q,"aria-expanded":me.value,"aria-controls":G.value}),{...t,default:$=>{let{id:oe}=$;return C(ue,null,[C("select",{hidden:!0,multiple:e.multiple,name:P.fieldName.value},[i.value.map(V=>C("option",{key:V.value,value:V.value,selected:E.value.includes(V.value)},null))]),x(ll,_({id:ve.value,ref:c,modelValue:T.value,"onUpdate:modelValue":V=>T.value=V,activator:"parent",contentClass:"v-select__content",disabled:te.value,eager:e.eager,maxHeight:310,openOnClick:!1,closeOnContentClick:!1,transition:e.transition,onAfterEnter:Ve,onAfterLeave:Ee},be.value),{default:()=>[x(al,{onFocusin:ot,onKeydown:M},{default:()=>[t["menu-header"]&&C("header",{ref:f},[t["menu-header"](ae)]),w&&x(Nt,_({key:"select-list",ref:N,selected:E.value,selectStrategy:e.multiple?"independent":"single-independent",tabindex:"-1",selectable:!!D.value.length,"aria-live":"polite","aria-labelledby":`${oe.value}-label`,"aria-multiselectable":e.multiple,color:e.itemColor??e.color},ke,e.listProps),{default:()=>{var V,K,z;return[(V=t["prepend-item"])==null?void 0:V.call(t),!D.value.length&&!e.hideNoData&&(((K=t["no-data"])==null?void 0:K.call(t))??x($e,{key:"no-data",title:u(e.noDataText)},null)),x(vl,{ref:o,renderless:!0,items:D.value,itemKey:"value"},{default:se=>{var Me,Le,Oe;let{item:p,index:L,itemRef:O}=se;const he=jt(p.props),De=_(p.props,{ref:O,key:p.value,onClick:()=>B(p,null),"aria-posinset":L+1,"aria-setsize":D.value.length});return p.type==="divider"?((Me=t.divider)==null?void 0:Me.call(t,{props:p.raw,index:L}))??x(Gt,_(p.props,{key:`divider-${L}`}),null):p.type==="subheader"?((Le=t.subheader)==null?void 0:Le.call(t,{props:p.raw,index:L}))??x(Wt,_(p.props,{key:`subheader-${L}`}),null):((Oe=t.item)==null?void 0:Oe.call(t,{item:p,index:L,props:De}))??x($e,_(De,{role:"option"}),{prepend:ge=>{let{isSelected:ut}=ge;return C(ue,null,[e.multiple&&!e.hideSelected?x(el,{key:p.value,modelValue:ut,ripple:!1,tabindex:"-1","aria-hidden":!0,onClick:rt=>rt.preventDefault()},null):void 0,he.prependAvatar&&x(Xt,{image:he.prependAvatar},null),he.prependIcon&&x(He,{icon:he.prependIcon},null)])},title:()=>{var ge;return k.value?kl("v-select",p.title,(ge=v(p))==null?void 0:ge.title):p.title}})}}),(z=t["append-item"])==null?void 0:z.call(t)]}}),t["menu-footer"]&&C("footer",{ref:a},[t["menu-footer"](ae)])]})]}),l.value.map((V,K)=>{function z(O){O.stopPropagation(),O.preventDefault(),B(V,!1)}const se=_(Ne.filterProps(V.props),{"onClick:close":z,onKeydown(O){O.key!=="Enter"&&O.key!==" "||(O.preventDefault(),O.stopPropagation(),z(O))},onMousedown(O){O.preventDefault(),O.stopPropagation()},modelValue:!0,"onUpdate:modelValue":void 0}),p=s?!!t.chip:!!t.selection,L=p?Yt(s?t.chip({item:V,index:K,props:se}):t.selection({item:V,index:K})):void 0;if(!(p&&!L))return C("div",{key:V.value,class:"v-select__selection"},[s?t.chip?x(Ge,{key:"chip-defaults",defaults:{VChip:{closable:Y.value,size:"small",text:V.title}}},{default:()=>[L]}):x(Ne,_({key:"chip",closable:Y.value,size:"small",text:V.title,disabled:V.props.disabled},se),null):L??C("span",{class:"v-select__selection-text"},[V.title,e.multiple&&K<l.value.length-1&&C("span",{class:"v-select__selection-comma"},[Zt(",")])])])})])},"append-inner":function(){var K,z;for(var $=arguments.length,oe=new Array($),V=0;V<$;V++)oe[V]=arguments[V];return C(ue,null,[(K=t["append-inner"])==null?void 0:K.call(t,...oe),e.menuIcon?x(He,{class:"v-select__menu-icon",color:(z=r.value)==null?void 0:z.fieldIconColor,icon:e.menuIcon,"aria-hidden":!0},null):void 0,e.appendInnerIcon&&x(j,{key:"append-icon",name:"appendInner",color:oe[0].iconColor.value},null)])}})}),We({isFocused:I,menu:T,search:k,filteredItems:g,select:B},r)}});export{ll as V,Vl as a,al as b,vl as c,ml as d,yl as e,hl as f,nl as g,kl as h,Tl as i,Sl as m,bl as u};