import{N as u}from"./ns-prompt-popup-CwRKP6Ip.js";import{P as c}from"./bootstrap-BsWQM_6D.js";import{j as f}from"./join-array-NDqpMoMN.js";async function d(o,m,p,i="multiselect"){return await new Promise((r,s)=>{nsHttpClient.get(o).subscribe({next:async n=>{try{const t=await new Promise((a,e)=>{c.show(u,{label:m,type:i,options:n.map(l=>({label:l.name,value:l.id})),value:p,resolve:a,reject:e})});if(i==="multiselect"){const a=n.filter(e=>t.includes(e.id)).map(e=>e.name);return r({labels:f(a),values:t})}else{const a=n.filter(e=>+e.id==+t).map(e=>e.name);return r({labels:a,values:[t]})}}catch(t){return s(t)}},error:n=>s(n)})})}export{d as s};
