"use strict";!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.ResizeSensor=t()}("undefined"!=typeof window?window:this,function(){if("undefined"==typeof window)return null;var t="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),b=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||function(e){return t.setTimeout(e,20)},o=t.cancelAnimationFrame||t.mozCancelAnimationFrame||t.webkitCancelAnimationFrame||function(e){t.clearTimeout(e)};function r(e,t){var n=Object.prototype.toString.call(e),i="[object Array]"===n||"[object NodeList]"===n||"[object HTMLCollection]"===n||"[object Object]"===n||"undefined"!=typeof jQuery&&e instanceof jQuery||"undefined"!=typeof Elements&&e instanceof Elements,o=0,r=e.length;if(i)for(;o<r;o++)t(e[o]);else t(e)}function A(e){if(!e.getBoundingClientRect)return{width:e.offsetWidth,height:e.offsetHeight};var t=e.getBoundingClientRect();return{width:Math.round(t.width),height:Math.round(t.height)}}function x(t,n){Object.keys(n).forEach(function(e){t.style[e]=n[e]})}var s=function(t,n){var y=0;function S(){var n,i,o=[];this.add=function(e){o.push(e)},this.call=function(e){for(n=0,i=o.length;n<i;n++)o[n].call(this,e)},this.remove=function(e){var t=[];for(n=0,i=o.length;n<i;n++)o[n]!==e&&t.push(o[n]);o=t},this.length=function(){return o.length}}function i(n,e){if(n)if(n.resizedAttached)n.resizedAttached.add(e);else{n.resizedAttached=new S,n.resizedAttached.add(e),n.resizeSensor=document.createElement("div"),n.resizeSensor.dir="ltr",n.resizeSensor.className="resize-sensor";var t={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},i={position:"absolute",left:"0px",top:"0px",transition:"0s"};x(n.resizeSensor,t);var o=document.createElement("div");o.className="resize-sensor-expand",x(o,t);var r=document.createElement("div");x(r,i),o.appendChild(r);var s=document.createElement("div");s.className="resize-sensor-shrink",x(s,t);var d=document.createElement("div");x(d,i),x(d,{width:"200%",height:"200%"}),s.appendChild(d),n.resizeSensor.appendChild(o),n.resizeSensor.appendChild(s),n.appendChild(n.resizeSensor);var a=window.getComputedStyle(n),c=a?a.getPropertyValue("position"):null;"absolute"!==c&&"relative"!==c&&"fixed"!==c&&"sticky"!==c&&(n.style.position="relative");var f=!1,h=0,l=A(n),u=0,p=0,m=!0;y=0;var v=function(){if(m){if(0===n.offsetWidth&&0===n.offsetHeight)return void(y=y||b(function(){y=0,v()}));m=!1}var e,t;e=n.offsetWidth,t=n.offsetHeight,r.style.width=e+10+"px",r.style.height=t+10+"px",o.scrollLeft=e+10,o.scrollTop=t+10,s.scrollLeft=e+10,s.scrollTop=t+10};n.resizeSensor.resetSensor=v;var z=function(){h=0,f&&(u=l.width,p=l.height,n.resizedAttached&&n.resizedAttached.call(l))},w=function(){l=A(n),(f=l.width!==u||l.height!==p)&&!h&&(h=b(z)),v()},g=function(e,t,n){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n)};g(o,"scroll",w),g(s,"scroll",w),y=b(function(){y=0,v()})}}r(t,function(e){i(e,n)}),this.detach=function(e){y||(o(y),y=0),s.detach(t,e)},this.reset=function(){t.resizeSensor.resetSensor()}};if(s.reset=function(e){r(e,function(e){e.resizeSensor.resetSensor()})},s.detach=function(e,t){r(e,function(e){e&&(e.resizedAttached&&"function"==typeof t&&(e.resizedAttached.remove(t),e.resizedAttached.length())||e.resizeSensor&&(e.contains(e.resizeSensor)&&e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached))})},"undefined"!=typeof MutationObserver){var n=new MutationObserver(function(e){for(var t in e)if(e.hasOwnProperty(t))for(var n=e[t].addedNodes,i=0;i<n.length;i++)n[i].resizeSensor&&s.reset(n[i])});document.addEventListener("DOMContentLoaded",function(e){n.observe(document.body,{childList:!0,subtree:!0})})}return s});