var __spreadArray=this&&this.__spreadArray||function(r,e,a){if(a||arguments.length===2)for(var t=0,n=e.length,c;t<n;t++){if(c||!(t in e)){if(!c)c=Array.prototype.slice.call(e,0,t);c[t]=e[t]}}return r.concat(c||Array.prototype.slice.call(e))};var createProviderConsumer=function(r,e){var a=new Map;var t=r;var n=function(r,e){if(Array.isArray(r)){__spreadArray([],r,true).forEach((function(r){e[r]=t[r]}))}else{e[r]=Object.assign({},t)}};var c=function(r,e){if(!a.has(r)){a.set(r,e);n(e,r)}return function(){if(a.has(r)){a.delete(r)}}};var i=function(r,e){var c=r.state;t=c;a.forEach(n);return e};var o=function(r,a){return e(c,a[0])};var s=function(r,e){var t=r.prototype;var n=t.connectedCallback;var i=t.disconnectedCallback;t.connectedCallback=function(){c(this,e);if(n){return n.call(this)}};t.disconnectedCallback=function(){a.delete(this);if(i){i.call(this)}}};return{Provider:i,Consumer:o,injectProps:s}};export{createProviderConsumer as c};