(({every:e,indexOf:t,slice:s}=Array.prototype,n=globalThis.document,o=n&&CSS.supports("contain: layout inline-size"),i=":not(*)",c=/\(\s*(min|max)-(height|width):\s*([^\s]+)\s*\)/,l=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)(.*)$/,r=new Set,a=new WeakMap,d=[],f=[],h=(e=>e.length?`:where(${e.join(",")})`:i),u=(e=>{let s,n="";for(;s=e.parentElement;){n=` > :nth-child(${t.call(s.children,e)+1})${n}`,e=s}return":root"+n}),m=(e=>/inline/i.test(getComputedStyle(e).display)),g=((e,s)=>t.call(e.cssRules||[],s)),p=(e=>s.call(e.cssRules||[])),w=((e,t,s)=>e.cssRules[e.insertRule(t,s)]),$=(()=>{for(const[e,t,s]of d){const n=new Set;for(const t of r)if(s(t,a.get(t)))for(const s of t.querySelectorAll(e))n.add(s);const o=[];for(const e of n){const t=u(e);o.push(t)}const c=o.length?`:is(${e}):where(${o.join(",")})`:i;t.selectorText!==c&&(t.selectorText=c)}}),y=((t,s,n,o,c)=>{const l=g(n,s),getFallbackCssText=e=>`${i}{transform:scale3d(1,1,1);${o?`inline-size:${e?0:100}%;`:""}${c?`block-size:${e?0:100};`:""}}`,d=`@media all{${getFallbackCssText(!0)}${getFallbackCssText(!1)}}`,p=w(n,d,l),[$,y]=p.cssRules;let x=[];const onMutation=()=>{const n=[],i=[],l=t.querySelectorAll(s.selectorText);if(!(l.length===x.length&&e.call(l,((e,t)=>e===x[t])))){r.clear(),S.disconnect();for(const e of l){r.add(e),a.set(e,[o,c]);const t=u(e);m(e)?i.push(t):n.push(t),S.observe(e)}const e=h(i);$.selectorText!==e&&($.selectorText=e);const t=h(n);y.selectorText!==t&&(y.selectorText=t),x=l}};onMutation(),f.push(onMutation),z.observe(t,{attributes:!0,childList:!0,subtree:!0})}),x=((e,t)=>{const getCssStyleRuleContainValues=e=>e.style?e.style.getPropertyValue("--css-contain").trim().toLowerCase().split(/\s+/):[],walkCssParent=t=>{for(const s of p(t)){walkCssParent(s);const n=getCssStyleRuleContainValues(s),o=n.includes("layout"),i=n.includes("size"),c=o&&(i||n.includes("inline-size")),l=o&&(i||n.includes("block-size"));(c||l)&&y(e,s,t,c,l)}};walkCssParent(t)}),b=((e,t)=>{const walkCssParent=t=>{for(const s of p(t)){const n=s.media?s.media.mediaText:"";if(0===n.indexOf("@container")||0===n.indexOf("--css-container")){const n=s.media[0].match(c);if(n){const[,o,c,r]=n,[,a,f]=r.match(l),doesFulfillQuery=(t,s,n)=>{if(!(n!==("block-size"===c||"height"===c))&&!(s!==("inline-size"===c||"width"===c)))return!1;const i=t.getBoundingClientRect()[c],l=Number(a)*("em"===f?parseInt(window.getComputedStyle(t).fontSize):"rem"===f?parseInt(window.getComputedStyle(e.documentElement).fontSize):"vh"===f?window.innerHeight/100:"vw"===f?window.innerWidth/100:1);return"min"===o?i>=l:i<=l},h=g(t,s),u=w(t,"@media all{}",h);let m=0;for(const e of p(s)){const t=e.selectorText;if(t){const s=e.cssText.slice(t.length),n=w(u,`${i}${s}`,m++);d.push([t,n,doesFulfillQuery])}}}}walkCssParent(s)}};walkCssParent(t),$()}),S,z)=>(e=n)=>{if(n&&!o){let t=0;const{styleSheets:s}=e,onMutation=()=>{for(const e of f)e()},onFrame=()=>{const n=s.length;if(n!==t){for(;t