UNPKG

710 BJavaScriptView Raw
1import{h as e}from"./p-c69e1c21.js";const t=(()=>{let t=new Map,c={historyType:"browser",location:{pathname:"",query:{},key:""},titleSuffix:"",root:"/",routeViewsUpdated:()=>{}};const r=(e,t)=>{Array.isArray(e)?[...e].forEach(e=>{t[e]=c[e]}):t[e]=Object.assign({},c)},o=(e,c)=>(t.has(e)||(t.set(e,c),r(c,e)),()=>{t.has(e)&&t.delete(e)});return{Provider:({state:e},o)=>(c=e,t.forEach(r),o),Consumer:(t,c)=>((t,c)=>e("context-consumer",{subscribe:t,renderer:c}))(o,c[0]),injectProps:(e,c)=>{const r=e.prototype,n=r.connectedCallback,s=r.disconnectedCallback;r.connectedCallback=function(){if(o(this,c),n)return n.call(this)},r.disconnectedCallback=function(){t.delete(this),s&&s.call(this)}}}})();export{t as A};
\No newline at end of file