/* ComputedStyleObserver | (C) Keith Clark | MIT | https://github.com/keithclark/ComputedStyleObserver */
(function(){"use strict";const a=1,b=0;let c=b,d=new Map;const e=(b,e)=>{let f=d.get(b);return(f||(f={styles:{},observers:[]},d.set(b,f)),!f.observers.includes(e))&&(f.observers.push(e),c!==a&&(c=a,j()),!0)},f=(a,e)=>{let f=d.get(a);if(!f)return!1;let g=f.observers.indexOf(e);return-1!==g&&(f.observers.splice(g,1),0===f.observers.length&&d.delete(a),0===d.size&&(c=b),!0)},g=a=>{d.forEach((b,c)=>{b.observers.includes(a)&&f(c,a)})},h=()=>{d.forEach((a,b)=>{i(b,a)})},i=(a,b)=>{let c=getComputedStyle(a),d={};b.observers.forEach(e=>{let f=[];e.properties.forEach(e=>{let g=c[e],h=b.styles[e];g!==h&&h&&f.push(new ComputedStyleObserverEntry(a,e,g,h)),d[e]=g}),f.length&&e.callback(f)}),b.styles=d},j=()=>{c===a&&(requestAnimationFrame(j),h())};let k=new WeakMap;window.ComputedStyleObserver=class{constructor(a,b=null){Array.isArray(b)&&(b=[...b]),k.set(this,{callback:a,properties:b})}disconnect(){g(k.get(this))}observe(a){return e(a,k.get(this))}unobserve(a){return f(a,k.get(this))}},window.ComputedStyleObserverEntry=class{constructor(a,b,c,d){this.target=a,this.property=b,this.value=c,this.previousValue=d}}})();