function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = ["./index-dyx4v2bZ.js","./index-BKNuk68o.css"]
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
import{d as b,an as M,ao as g,Q as y,i as S,a as B,ap as x,q as k,c as s,o as u,f as C,R as t,b as c,aw as L,_ as h}from"./index-dyx4v2bZ.js";import{u as j}from"./useListResources-DdhCMljT.js";const q={class:"BuilderModelSelect--text"},A=b({__name:"BuilderModelSelect",props:M({enableMultiSelection:{type:Boolean,required:!1}},{modelValue:{type:[String,Array],required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(d,{expose:m}){const p=g({loader:()=>y(()=>import("./index-dyx4v2bZ.js").then(e=>e.bC),__vite__mapDeps([0,1]),import.meta.url)}),v=S(B.core),l=x(d,"modelValue"),{load:f,data:o,isLoading:i}=j(v,"models");k(f);const _=s(()=>o.value.map(e=>({label:e.name,value:e.id})).sort((e,a)=>e.label.localeCompare(a.label))),r=s({get(){return l.value===void 0?"":typeof l.value=="string"?l.value:l.value.join(",")},set(e){l.value=e.split(",")}}),V=s(()=>{if(l.value!==void 0)return typeof l.value=="string"?o.value.find(e=>e.id===l.value):o.value.filter(e=>l.value.includes(e.id))});return m({selectedData:V}),(e,a)=>(u(),C("div",q,[t(o).length>0||t(i)?(u(),c(t(p),{key:0,modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=n=>l.value=n),options:_.value,"hide-icons":"","enable-search":"",loading:t(i),"enable-multi-selection":d.enableMultiSelection},null,8,["modelValue","options","loading","enable-multi-selection"])):(u(),c(L,{key:1,modelValue:r.value,"onUpdate:modelValue":a[1]||(a[1]=n=>r.value=n)},null,8,["modelValue"]))]))}}),R=h(A,[["__scopeId","data-v-e9b7f7a0"]]);export{R as default};
