"use strict";const o=require("./Tools_delayFun-DYTkzlXE.cjs"),t=require("./Tools_animateEasing-C6TmrmvZ.cjs"),r=require("./Tools_localStorage-Cbecy4gj.cjs"),l=require("./Tools_cookie-CCTgXZb7.cjs"),a=require("./Tools_number-Bh6hGO5U.cjs"),s=require("./base-iCmnU-fv.cjs"),n=require("./Element_Event_drag-L_ZT9whD.cjs");require("js-cookie");require("decimal.js");const _={DelayFun:o.DelayFun,AnimateEasing:t.AnimateEasing,LocalStorage:r.LocalStorage,Cookie:l.Cookie,Number:a.CommNumber};class u{options;_isWinResize;_isRunDelay;_runDelayFun;_bindWinResize;_objResizeObserver;constructor(e){this._isWinResize=s.CommonBase.isUndefined(e.element),this._isRunDelay=!!(!s.CommonBase.isBoolean(e.isDelay)||e.isDelay),this.options=e,this._init()}_init(){this._isRunDelay&&(this._runDelayFun=new o.DelayFun(this.options.callback,this.options.delayTime)),this._isWinResize?(this._bindWinResize=this._onWinResize.bind(this),n.CommonElement.onListener(window,"resize",this._bindWinResize)):this._initResizeObserver()}_onWinResize(){this._isRunDelay?this._runDelayFun.run():this.options.callback&&this.options.callback()}_initResizeObserver(){window&&"ResizeObserver"in window&&(this._objResizeObserver=new ResizeObserver(e=>{const i=e[0];this._isRunDelay?this._runDelayFun.run(()=>{this.options.callback(i)}):this.options.callback(i)}),this._objResizeObserver.observe(this.options.element))}destroy(){this._isWinResize?n.CommonElement.offListener(window,"resize",this._bindWinResize):this._objResizeObserver&&(this._objResizeObserver.disconnect(),this._objResizeObserver=null)}}exports.CommonTools=_;exports.Resize=u;
//# sourceMappingURL=Element_Event_resize-DA_sUt40.cjs.map
