"use strict";var Win=function(i,t,n){this.windowWidth=null,this.windowHeight=null,this.windowDimensionScale=this.__windowDimensionScale=1,this.windowWidthOld=null,this.windowHeightOld=null,this.windowRatio=null,this.windowPixelCountRGBA=null,this.windowResizeCallbacks=Util.isInitialized(n)?n.constructor===Array?n:[n]:[],Util.isInitialized(i)&&Util.isInitialized(t)&&this.setWindowSize(i,t)};Win.prototype.addResizingCallback=function(i){this.windowResizeCallbacks.push(i)},Win.prototype.updateObjectAfterResize=function(i){var t=this;this.addResizingCallback(function(){i(t.windowWidth,t.windowHeight)})},Win.prototype.setWindowSize=function(i){if(0===arguments.length)var t=this.windowWidth,n=this.windowHeight;else if(1===arguments.length){var o=arguments[0];if(o.constructor===Array)var t=o[0],n=o[1];else var t=o[0],n=t}else var t=arguments[0],n=arguments[1];t*=this.windowDimensionScale,n*=this.windowDimensionScale,this.windowWidthOld=null!==this.windowWidth?this.windowWidth:t,this.windowHeightOld=null!==this.windowHeight?this.windowHeight:n,this.windowWidth=t,this.windowHeight=n,this.windowPixelCountRGBA=t*n*4,this.windowRatio=Win.computeWindowRatio(t,n);for(var w=0;w<this.windowResizeCallbacks.length;w++)this.windowResizeCallbacks[w]()},Win.prototype.restoreOldWindowSize=function(){this.setWindowSize(this.windowWidthOld,this.windowHeightOld)},Win.computeRatioToAnotherWindow=function(i,t,n){Util.isInitialized(i)&&Util.isInitialized(t)&&(n.x=i.windowWidth/t.windowWidth,n.y=i.windowHeight/t.windowHeight)},Win.computeWindowRatio=function(i,t){return i/t};