"use strict";const o=require("react/jsx-runtime"),c=require("../../providers/Stream.cjs.js"),l=require("../../providers/CustomComponentProvider.cjs.js"),p=require("@langchain/langgraph-sdk/react-ui"),u=require("react"),i=require("../../utils/logger.cjs.js");function C({message:t,thread:m}){const{values:n}=c.useStreamContext(),{components:r}=l.useCustomComponents(),s=u.useMemo(()=>n.ui?.filter(e=>e?.metadata?.id===t.id||e?.metadata?.message_id===t.id||e?.id===t.id),[n.ui,t.id]);return i.logger.debug("CustomComponentRender - customComponents:",t),i.logger.debug("CustomComponentRender - available components:",n),s?.length?o.jsx(o.Fragment,{children:s?.filter(e=>!!r?.[e.name]).map((e,d)=>{const a=e.props||{};return o.jsx(p.LoadExternalComponent,{stream:m,message:e,components:r,meta:{...a,ui:e}},e._key||`${t.id}-${e.id||d}`)})}):null}const g=u.memo(C);module.exports=g;
//# sourceMappingURL=CustomComponentRender.cjs.js.map
