"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("vue"),o=require("../theme/internal.js"),h=["xxxl","xxl","xl","lg","md","sm","xs"],x=s=>({xs:`(max-width: ${s.screenXSMax}px)`,sm:`(min-width: ${s.screenSM}px)`,md:`(min-width: ${s.screenMD}px)`,lg:`(min-width: ${s.screenLG}px)`,xl:`(min-width: ${s.screenXL}px)`,xxl:`(min-width: ${s.screenXXL}px)`,xxxl:`{min-width: ${s.screenXXXL}px}`});function m(){const[,s]=o.useToken();return u.computed(()=>{const n=x(s.value),r=new Map;let a=-1,c={};return{matchHandlers:{},dispatch(e){return c=e,r.forEach(t=>t(c)),r.size>=1},subscribe(e){return r.size||this.register(),a+=1,r.set(a,e),e(c),a},unsubscribe(e){r.delete(e),r.size||this.unregister()},unregister(){Object.keys(n).forEach(e=>{const t=n[e],i=this.matchHandlers[t];i?.mql.removeListener(i?.listener)}),r.clear()},register(){Object.keys(n).forEach(e=>{const t=n[e],i=({matches:l})=>{this.dispatch({...c,[e]:l})},d=window.matchMedia(t);d.addListener(i),this.matchHandlers[t]={mql:d,listener:i},i(d)})},responsiveMap:n}})}exports.default=m;exports.responsiveArray=h;
