import{B as e,D as t,K as n}from"./vendor-vue-D9nMs6_1.js";import{i as r}from"./backendApi-CRLUmnjv.js";import{t as i}from"./activeSetStore-6XyTcxfO.js";function a(t,n,r,a){let o=i();return[e(()=>o.usedStyleSet,()=>{a()}),e(()=>o.styleVariantUpdateValues,()=>{let e=o.getVariantStyle(n.value,t);e&&(r.value=e)})]}function o(e,t,n){let a=i();async function o(){try{n.value=await r.get(`/style/variants/${e}/${t.value}`).then(e=>e.data).catch(e=>{throw console.error(`Failed to fetch active style set name:`,e),e})}catch(e){throw console.error(`Failed to fetch active style set name:`,e),e}}return async function(){let r=a.getVariantStatus(e);r&&(r.isActive?(t.value=r.variant,await o()):n.value=void 0)}}var s=class{variantName;style;styleChecker;watchers;constructor(e,t,n,r){this.variantName=e,this.style=t,this.watchers=n,this.styleChecker=r}};function c(e){let t=n(),r=n(``),i=o(e,r,t),c=a(e,r,t,i);return i(),new s(r,t,c,i)}async function l(){await t(),window.__renderReady=!0,document.dispatchEvent(new CustomEvent(`render-ready`))}export{c as n,l as t};