const DEFAULT_DURATION_MS=0xfa;function prefersReducedMotion(){try{return window['matchMedia']&&window['matchMedia']('(prefers-reduced-motion:\x20reduce)')['matches'];}catch{return![];}}function safeCancelAnimations(_0x34cdaa){if(!_0x34cdaa||typeof _0x34cdaa['getAnimations']!=='function')return;try{_0x34cdaa['getAnimations']()['forEach'](_0x2679e7=>_0x2679e7['cancel']());}catch{}}function animateRestoreFlip({contentEl:_0x340b4e,fromRect:_0x18674f,toRect:_0x2c0aa1,durationMs:_0x552f5c}){if(!_0x340b4e)return;if(!_0x18674f||!_0x2c0aa1)return;if(prefersReducedMotion())return;const _0x213e51=_0x2c0aa1['width']||0x0,_0x3ef1c2=_0x2c0aa1['height']||0x0,_0x39642d=_0x18674f['width']||0x0,_0x3e5e4b=_0x18674f['height']||0x0;if(_0x213e51<=0x0||_0x3ef1c2<=0x0||_0x39642d<=0x0||_0x3e5e4b<=0x0)return;const _0x2dfee3=_0x18674f['left']-_0x2c0aa1['left'],_0x398388=_0x18674f['top']-_0x2c0aa1['top'],_0x3157fa=_0x39642d/_0x213e51,_0x479939=_0x3e5e4b/_0x3ef1c2;if(!Number['isFinite'](_0x2dfee3)||!Number['isFinite'](_0x398388)||!Number['isFinite'](_0x3157fa)||!Number['isFinite'](_0x479939))return;safeCancelAnimations(_0x340b4e);const _0x312f39=_0x340b4e['style']['transition'],_0x48362e=_0x340b4e['style']['transformOrigin'],_0x31d793=_0x340b4e['style']['willChange'];_0x340b4e['style']['transition']='none',_0x340b4e['style']['transformOrigin']='top\x20left',_0x340b4e['style']['willChange']='transform';const _0x492d98='translate('+_0x2dfee3+'px,\x20'+_0x398388+'px)\x20scale('+_0x3157fa+',\x20'+_0x479939+')',_0x2ecb14=_0x340b4e['animate']([{'transform':_0x492d98},{'transform':'none'}],{'duration':_0x552f5c,'easing':'ease','fill':'both'}),_0x2e92b8=()=>{_0x340b4e['style']['transition']=_0x312f39,_0x340b4e['style']['transformOrigin']=_0x48362e,_0x340b4e['style']['willChange']=_0x31d793;};_0x2ecb14['addEventListener']('finish',_0x2e92b8,{'once':!![]}),_0x2ecb14['addEventListener']('cancel',_0x2e92b8,{'once':!![]});}export function toggleModalMaximize(_0x1fbbee,_0x28eba8={}){if(!_0x1fbbee)return;const {storageKey:_0x2c7287,updateIcon:_0x172b8a,onAfterToggle:_0x2f7087,durationMs:durationMs=DEFAULT_DURATION_MS}=_0x28eba8,_0x313e71=_0x1fbbee['querySelector']('.modal-content'),_0x555105=_0x1fbbee['classList']['contains']('maximized'),_0x151488=!_0x555105;if(!_0x313e71){_0x1fbbee['classList']['toggle']('maximized'),_0x172b8a?.(_0x151488),_0x2f7087?.(_0x151488);if(_0x2c7287)try{localStorage['setItem'](_0x2c7287,String(_0x151488));}catch{}return;}if(_0x555105&&!prefersReducedMotion()){const _0x531dd3=_0x313e71['getBoundingClientRect']();_0x1fbbee['classList']['remove']('maximized');const _0x31ad5f=_0x313e71['getBoundingClientRect']();animateRestoreFlip({'contentEl':_0x313e71,'fromRect':_0x531dd3,'toRect':_0x31ad5f,'durationMs':durationMs});}else _0x1fbbee['classList']['toggle']('maximized');_0x172b8a?.(_0x151488),_0x2f7087?.(_0x151488);if(_0x2c7287)try{localStorage['setItem'](_0x2c7287,String(_0x151488));}catch{}}