class l{constructor(){this.callbacks=[],this.activeBreakpoints=[],this.scheduled=!1,this.queries=[{name:"desktop",query:window&&window.matchMedia("(min-width: 1440px)")},{name:"laptop-gt",query:window&&window.matchMedia("(min-width: 1024px)")},{name:"tablet-lt",query:window&&window.matchMedia(`(max-width: ${1024-.02}px)`)},{name:"laptop",query:window&&window.matchMedia(`(min-width: 768px) and (max-width: ${1440-.02}px)`)},{name:"tablet",query:window&&window.matchMedia(`(min-width: 768px) and (max-width: ${1024-.02}px)`)},{name:"mobile",query:window&&window.matchMedia("(max-width: 768px)")}];for(const t of this.queries)t.query.matches&&this.updateBreakpointStatus(t),t.query.addEventListener("change",()=>{this.handleChange(t)});this.scheduleUpdate()}subscribe(t){this.callbacks.push(t)}updateBreakpointStatus(t){t.query.matches?this.activeBreakpoints.push(t.name):this.activeBreakpoints=this.activeBreakpoints.filter(d=>d!==t.name)}handleChange(t){this.updateBreakpointStatus(t),this.scheduleUpdate()}scheduleUpdate(){this.scheduled||window.requestAnimationFrame(()=>{for(const t of this.callbacks)t();this.scheduled=!1}),this.scheduled=!0}is(t){return this.activeBreakpoints.includes(t)}}const c=s=>{class t extends s{connectedCallback(){t.mediaQueryController||(t.mediaQueryController=new l),super.connectedCallback(),t.mediaQueryController.subscribe(this.callback.bind(this))}callback(){this.requestUpdate()}responsiveValue(i){if(i===void 0)return;if(typeof i!="string"||!i.includes(";"))return i;const r=i.split(";").filter(e=>e.trim()!=="");let a="";for(let e of r){e=e.trim();const n=e.includes(":")?e.split(":")[0]:"default";n==="default"&&(a=e),t.mediaQueryController.is(n)&&(a=e.split(":")[1].trim())}return a}}return t};export{c as R};