Your IP : 216.73.216.93


Current Path : /home/users/unlimited/www/admin.medimeet.codeskitter.site/assets/
Upload File :
Current File : /home/users/unlimited/www/admin.medimeet.codeskitter.site/assets/MultiTaginput-E1FVrP37.js

import{r as h,a0 as b,j as r}from"./index-C50MwByD.js";import{B as j}from"./button-Dq0pEB9k.js";import{P as g,a as m,C as y,b as C,c as S,d as v,e as w,f as N,g as k,h as $}from"./popover-BIUulaFx.js";function M({data:a,setState:x,name:l,defaultId:n,defaultName:f}){const[u,s]=h.useState(!1),[d,o]=h.useState(""),{colorMode:c}=b();return h.useEffect(()=>{if(n){const e=a==null?void 0:a.find(t=>t.id===n);e&&o(e.title)}else if(f){const e=a.find(t=>t.title===f);e&&o(e.title)}},[n,f,a]),r.jsxs(g,{open:u,onOpenChange:s,children:[r.jsx(m,{asChild:!0,children:r.jsxs(j,{variant:"outline",role:"combobox","aria-expanded":u,className:`w-[100%] h-8 justify-between bg-transparent hover:bg-transparent hover:text-inherit rounded-[6px] capitalize ${c==="dark"?"border-[#ffffff3d]":"border-[#E2e8f0]"}`,children:[d||`Select ${l}`,r.jsx(y,{className:"ml-2 h-4 w-4 shrink-0 "})]})}),r.jsx(C,{className:`w-[200px] p-0 max-h-[240px]  overflow-y-scroll hideScrollbar z-[1500] ${c==="dark"?"bg-[#2D3748]":"bg-[#ffffff]"}`,children:r.jsxs(S,{className:`${c==="dark"?"bg-[#2D3748]":"bg-[#ffffff]"}  `,children:[r.jsx(v,{placeholder:`Search ${l}`,colorMode:c,className:c==="dark"?"text-[#fff]":"text-[#000]"}),r.jsxs(w,{children:["No ",l," found."]}),r.jsx(N,{children:a==null?void 0:a.map(e=>r.jsxs(k,{value:e.title.toString(),onSelect:t=>{o(t),s(!1),x(e.id)},className:"dark:text-white capitalize",children:[r.jsx($,{className:`mr-2 h-4 w-4 ${d===e.title.toString()?"opacity-100":"opacity-0"}`}),e.title]},e.id))})]})})]})}function O({data:a,setState:x,name:l,defaultSelected:n}){const[f,u]=h.useState(!1),[s,d]=h.useState([]),{colorMode:o}=b();h.useEffect(()=>{if(Array.isArray(n)&&n.length>0){const e=(a==null?void 0:a.filter(t=>{for(const i of n||[])if(t.title===i)return!0;return!1}))||[];d(e),x(e.map(t=>t.title))}},[]);const c=e=>{const t=s.some(p=>p.id===e.id);let i;t?i=s.filter(p=>p.id!==e.id):i=[...s,e],d(i),x(i.map(p=>p.title))};return r.jsxs(g,{open:f,onOpenChange:u,children:[r.jsx(m,{asChild:!0,children:r.jsx(j,{variant:"outline",role:"combobox","aria-expanded":f,className:`w-[100%] h-8 justify-start bg-transparent hover:bg-transparent hover:text-inherit rounded-[6px] ${o==="dark"?"border-[#ffffff3d]":"border-[#E2e8f0]"}`,children:s.length>0?s.map(e=>r.jsxs("span",{children:[e.title,", "]},e.id)):`Select ${l}`})}),r.jsx(C,{className:`w-[200px] p-0 max-h-[240px]  overflow-y-scroll hideScrollbar ${o==="dark"?"bg-[#2D3748]":"bg-[#ffffff]"}`,children:r.jsxs(S,{className:`${o==="dark"?"bg-[#2D3748]":"bg-[#ffffff]"}  `,children:[r.jsx(v,{placeholder:`Search ${l}`,colorMode:o,className:o==="dark"?"text-[#fff]":"text-[#000]"}),r.jsxs(w,{children:["No ",l," found."]}),r.jsx(N,{children:a==null?void 0:a.map(e=>r.jsxs(k,{value:e.title.toString(),onSelect:()=>c(e),className:"dark:text-white",children:[r.jsx($,{className:`mr-2 h-4 w-4 ${s.some(t=>t.id===e.id)?"opacity-100":"opacity-0"}`}),e.title]},e.id))})]})})]})}export{M as C,O as M};