/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/@wellesley/redux-subscribe-action@1.0.1/index.mjs
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
const r=[],b=[],n=[],o=[],f=(e,t)=>{if("function"!=typeof e)throw new Error("Expected the listener to be a function.");return t.push(e),()=>{const n=t.indexOf(e);t.splice(n,1)}},B=e=>f(e,r),E=e=>f(e,b),A=(e,t)=>{if(!e.action)throw new Error("Expected the action to be a string.");if("function"!=typeof e.listener)throw new Error("Expected the listener to be a function.");return t.push(e),()=>{const n=t.indexOf(e);t.splice(n,1)}},y=(e,t)=>A({action:e,listener:t},n),L=(e,t)=>A({action:e,listener:t},o),h=()=>{r.length=0},d=()=>{n.length=0},p=()=>{b.length=0},g=()=>{o.length=0},j=()=>{h(),d(),p(),g()},l=(e,t)=>{const n=e.filter((({action:e})=>e!==t));e.length=0,e.concat(n)},x=e=>{l(n,e)},w=e=>{l(o,e)},O=e=>{x(e),w(e)},i=(e,t)=>{for(let n=t.length-1;n>=0;n--){const s=t[n];"object"==typeof e&&s(e)}},u=(e,t)=>{for(let n=t.length-1;n>=0;n--){const s=t[n];"object"==typeof e&&s.action===e.type&&s.listener(e)}},S=()=>e=>t=>{i(t,r),u(t,n);const s=e(t);return i(t,b),u(t,o),s};export{L as subscribeActionAfter,y as subscribeActionBefore,S as subscribeActionMiddleware,E as subscribeAfter,B as subscribeBefore,w as unsubscribeActionAfter,O as unsubscribeActionAll,x as unsubscribeActionBefore,g as unsubscribeActionsAfter,d as unsubscribeActionsBefore,p as unsubscribeAfter,j as unsubscribeAll,h as unsubscribeBefore};