1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-icons-ai-D84WBkAM.js","assets/react-icons-lib-DGihIP_I.js","assets/react-vendor-DxUv0b-E.js","assets/react-icons-fa-DS0WGntn.js","assets/react-icons-fi-KLKPHWnU.js","assets/react-icons-io5-CtSYLPmH.js","assets/react-icons-md-D_DNSN8M.js"])))=>i.map(i=>d[i]); 2import{_ as i}from"./index-D3IHbOo4.js";import{a as n,j as e}from"./react-vendor-DxUv0b-E.js";import{X as w,j as N,l as I}from"./lucide-DWuOA0uJ.js";import"./toast-CYWZkW3Q.js";import"./http-DhXgJQ-f.js";import"./crypto-54sHe70Q.js";import"./tanstack-DdulLlji.js";import"./framer-motion-CQVjGQci.js";import"./vendor-CY5ep9EN.js";const x={Ai:"Ant Design Icons",Fa:"Font Awesome Icons",Fi:"Feather Icons",Io:"Ionicons",Md:"Material Icons"},A={Ai:async()=>await i(()=>import("./react-icons-ai-D84WBkAM.js"),__vite__mapDeps([0,1,2])),Fa:async()=>await i(()=>import("./react-icons-fa-DS0WGntn.js"),__vite__mapDeps([3,1,2])),Fi:async()=>await i(()=>import("./react-icons-fi-KLKPHWnU.js"),__vite__mapDeps([4,1,2])),Io:async()=>await i(()=>import("./react-icons-io5-CtSYLPmH.js"),__vite__mapDeps([5,1,2])),Md:async()=>await i(()=>import("./react-icons-md-D_DNSN8M.js"),__vite__mapDeps([6,1,2]))},g=Object.keys(x),E=(r,o)=>Object.keys(o).filter(s=>s.startsWith(r)&&typeof o[s]=="function").map(s=>({pack:r,name:s,Icon:o[s]}));function T({open:r,onClose:o,onUse:s,currentValue:d}){const[m,j]=n.useState(""),[a,v]=n.useState("Fi"),[p,h]=n.useState([]),[_,u]=n.useState(!1);n.useEffect(()=>{if(!r)return;let t=!0;return u(!0),(async()=>{const l=a==="all"?g:[a],y=await Promise.all(l.map(async b=>E(b,await A[b]())));t&&(h(y.flat()),u(!1))})().catch(()=>{t&&(h([]),u(!1))}),()=>{t=!1}},[r,a]);const f=n.useMemo(()=>{const t=m.trim().toLowerCase();return p.filter(c=>!t||c.name.toLowerCase().includes(t)).slice(0,300)},[p,m]);return r?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"flex max-h-[88vh] w-full max-w-5xl flex-col overflow-hidden rounded-2xl bg-card shadow-2xl",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-border p-5",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Choose React Icon"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Search and select an internal icon. The component name will be saved."})]}),e.jsx("button",{type:"button",className:"btn btn-sm btn-ghost btn-icon",onClick:o,children:e.jsx(w,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid gap-3 border-b border-border bg-muted/40 p-4 md:grid-cols-[1fr_220px]",children:[e.jsxs("div",{className:"relative",children:[e.jsx(N,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{value:m,onChange:t=>j(t.target.value),placeholder:"Search icons, e.g. service, user, home",className:"input input-sm w-full pl-9",autoFocus:!0})]}),e.jsxs("select",{value:a,onChange:t=>v(t.target.value),className:"select select-sm w-full",children:[g.map(t=>e.jsx("option",{value:t,children:x[t]},t)),e.jsx("option",{value:"all",children:"All Icon Packs"})]})]}),e.jsx("div",{className:"overflow-y-auto p-4",children:_?e.jsxs("div",{className:"flex items-center justify-center gap-2 rounded-xl border border-dashed border-border p-8 text-center text-sm text-muted-foreground",children:[e.jsx(I,{className:"h-4 w-4 animate-spin"}),"Loading icons..."]}):f.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:"No icons found"}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Try another keyword."})]}):e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6",children:f.map(({name:t,Icon:c})=>{const l=d===t;return e.jsxs("button",{type:"button",className:["flex flex-col items-center gap-2 rounded-xl border p-3 text-center text-xs transition",l?"border-primary bg-primary/10 text-primary":"border-border bg-card hover:border-primary/50 hover:bg-muted"].join(" "),onClick:()=>{s(t),o()},children:[e.jsx(c,{className:"h-6 w-6"}),e.jsx("span",{className:"w-full truncate",children:t})]},t)})})}),e.jsxs("div",{className:"flex items-center justify-between border-t border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground",children:[e.jsxs("span",{children:["Showing up to 300 icons",a==="all"?"":` from ${x[a]}`,"."]}),d&&e.jsxs("span",{children:["Selected: ",d]})]})]})}):null}export{T as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.