import{b as i}from"./chunk-LYT2GSGQ.mjs";import f,{memo as u}from"react";import{createChainOfResponsibility as c}from"react-chain-of-responsibility";import{array as w,function_ as m,safeParse as M}from"valibot";var P=w(m()),a=Symbol(),R=r=>M(P,r).success,T=Object.freeze([]);function I(r){let s=n=>{let e=t=>t===r&&n;return e[a]=a,e},p=i(`Middleware passed for extraction of "${r}" must be an array of function`),l=n=>{if(n){if(R(n))return Object.freeze(n.map(e=>{let t=e(r);return typeof t!="function"&&t!==!1?(console.warn(`botframework-webchat: ${r}.middleware must return enhancer function or false`),!1):t}).filter(e=>!!e).map(e=>()=>e));p()}return T},{Provider:y,Proxy:d}=c(),o=u(function({children:e,middleware:t}){return f.createElement(y,{init:r,middleware:t},e)});return o.displayName=`${r}Provider`,d.displayName=`${r}Proxy`,{createMiddleware:s,extractMiddleware:l,Provider:o,Proxy:d,"~types":void 0}}var O=I;export{a,O as b};
//# sourceMappingURL=chunk-F4ENGDCK.mjs.map