import{injectPropsWithOption as e}from"../utils/valueUtil.mjs";import{toArray as t}from"../utils/commonUtil.mjs";import{computed as n}from"vue";function r(e,n){return t(e).join(``).toUpperCase().includes(n)}var i=(t,i,a,o,s)=>n(()=>{let n=a.value,c=s?.value,l=o?.value;if(!n||l===!1)return t.value;let{options:u,label:d,value:f}=i.value,p=[],m=typeof l==`function`,h=n.toUpperCase(),g=m?l:(e,t)=>c?r(t[c],h):t[u]?r(t[d===`children`?`label`:d],h):r(t[f],h),_=m?t=>e(t):e=>e;return t.value.forEach(e=>{if(e[u]){if(g(n,_(e)))p.push(e);else{let t=e[u].filter(e=>g(n,_(e)));t.length&&p.push({...e,[u]:t})}return}g(n,_(e))&&p.push(e)}),p});export{i as default};