import{dU as f,dV as h,r as l,d9 as y,dW as E,dX as Q}from"./index-60657852.js";function g(n,r,e,s,c){const[t,d]=l.useState(()=>c&&e?e(n).matches:s?s(n).matches:r);return y(()=>{if(!e)return;const o=e(n),a=()=>{d(o.matches)};return a(),o.addEventListener("change",a),()=>{o.removeEventListener("change",a)}},[n,e]),t}const M={...E},p=M.useSyncExternalStore;function v(n,r,e,s,c){const t=l.useCallback(()=>r,[r]),d=l.useMemo(()=>{if(c&&e)return()=>e(n).matches;if(s!==null){const{matches:u}=s(n);return()=>u}return t},[t,n,s,c,e]),[o,a]=l.useMemo(()=>{if(e===null)return[t,()=>()=>{}];const u=e(n);return[()=>u.matches,i=>(u.addEventListener("change",i),()=>{u.removeEventListener("change",i)})]},[t,e,n]);return p(a,o,d)}function S(n={}){const{themeId:r}=n;return function(s,c={}){let t=f();t&&r&&(t=t[r]||t);const d=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:o=!1,matchMedia:a=d?window.matchMedia:null,ssrMatchMedia:m=null,noSsr:u=!1}=h({name:"MuiUseMediaQuery",props:c,theme:t});let i=typeof s=="function"?s(t):s;return i=i.replace(/^@media( ?)/m,""),i.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
`)),(p!==void 0?v:g)(i,o,a,m,u)}}const w=S({themeId:Q}),U=w;export{U as u};
