"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("../StyleContext.js");function d(h,i,f,v){const n=m.useStyleInject(),t=e.shallowRef(""),o=e.shallowRef();e.watchEffect(()=>{t.value=[h,...i.value].join("%")});const s=l=>{n.value.cache.update(l,c=>{const[u=0,a]=c||[];return u-1===0?(v?.(a,!1),null):[u-1,a]})};return e.watch(t,(l,c)=>{c&&s(c),n.value.cache.update(l,u=>{const[a=0,r]=u||[],C=r||f();return[a+1,C]}),o.value=n.value.cache.get(t.value)[1]},{immediate:!0}),e.onBeforeUnmount(()=>{s(t.value)}),o}exports.default=d;
