const MOBILE_QUERY='(hover:\x20none),\x20(pointer:\x20coarse)',LONG_PRESS_DURATION=0x1c2,MOVEMENT_SLOP_SQ=0x64,CLICK_SUPPRESS_MS=0x320;function isMobileContext(){if(typeof window==='undefined'||typeof window['matchMedia']!=='function')return![];return window['matchMedia'](MOBILE_QUERY)['matches'];}export function enableMobileLongPressSelect({container:_0x76714d,tileSelector:tileSelector='.task-tile',onLongPress:_0x4f79ca,shouldHandle:_0x33ae72}={}){if(typeof document==='undefined')return()=>{};if(typeof _0x4f79ca!=='function')return()=>{};const _0x3fff2f=typeof _0x76714d==='string'?document['querySelector'](_0x76714d):_0x76714d;if(!_0x3fff2f)return()=>{};let _0xdce5b=null,_0x946fae=0x0;function _0x1fa1fe(){if(!_0xdce5b)return;_0xdce5b['timer']&&(clearTimeout(_0xdce5b['timer']),_0xdce5b['timer']=null),_0xdce5b['tile']&&_0xdce5b['tile']['classList']['remove']('mobile-long-press-active'),_0xdce5b=null;}function _0x195e30(_0x34cc1d){const _0x5d55f5=_0x5a0831=>{_0x5a0831['preventDefault'](),_0x5a0831['stopPropagation'](),_0x34cc1d['removeEventListener']('click',_0x5d55f5,!![]);};_0x34cc1d['addEventListener']('click',_0x5d55f5,!![]),window['setTimeout'](()=>{_0x34cc1d['removeEventListener']('click',_0x5d55f5,!![]);},CLICK_SUPPRESS_MS);}function _0x9d549e(_0x20cae6){if(!isMobileContext())return;if(!_0x20cae6['isPrimary'])return;if(_0x20cae6['button']!==undefined&&_0x20cae6['button']!==0x0)return;if(_0x20cae6['pointerType']&&_0x20cae6['pointerType']==='mouse')return;const _0x410079=_0x20cae6['target'];if(!(_0x410079 instanceof Element))return;if(_0x410079['closest']('button,\x20input,\x20select,\x20textarea,\x20label,\x20a[href]:not(.task-tile),\x20[data-no-long-press]'))return;const _0x54a6b8=_0x410079['closest'](tileSelector);if(!_0x54a6b8||!_0x3fff2f['contains'](_0x54a6b8))return;if(typeof _0x33ae72==='function'&&!_0x33ae72(_0x54a6b8,_0x20cae6))return;_0x1fa1fe(),_0xdce5b={'tile':_0x54a6b8,'pointerId':_0x20cae6['pointerId'],'startX':_0x20cae6['clientX'],'startY':_0x20cae6['clientY'],'timer':null},_0x54a6b8['classList']['add']('mobile-long-press-active'),_0xdce5b['timer']=window['setTimeout'](()=>{const _0x49f881=_0xdce5b;if(!_0x49f881)return;_0xdce5b=null,_0x49f881['tile']['classList']['remove']('mobile-long-press-active');if(typeof navigator!=='undefined'&&typeof navigator['vibrate']==='function')try{navigator['vibrate'](0xe);}catch(_0x45842b){}_0x946fae=Date['now']()+CLICK_SUPPRESS_MS,_0x195e30(_0x49f881['tile']);try{_0x4f79ca(_0x49f881['tile'],_0x20cae6);}catch(_0xce309d){console['error']('[mobile-long-press-select]\x20handler\x20failed',_0xce309d);}},LONG_PRESS_DURATION);}function _0x53f036(_0x5f3364){if(!_0xdce5b||_0x5f3364['pointerId']!==_0xdce5b['pointerId'])return;const _0xf6fd59=_0x5f3364['clientX']-_0xdce5b['startX'],_0x55cb02=_0x5f3364['clientY']-_0xdce5b['startY'];_0xf6fd59*_0xf6fd59+_0x55cb02*_0x55cb02>MOVEMENT_SLOP_SQ&&_0x1fa1fe();}function _0x43ecc3(_0x397c04){if(!_0xdce5b)return;if(_0x397c04['pointerId']!==_0xdce5b['pointerId'])return;_0x1fa1fe();}function _0x594665(){if(_0xdce5b)_0x1fa1fe();}function _0x53c3f4(_0x44e5c0){if(!isMobileContext())return;if(!_0xdce5b&&Date['now']()>_0x946fae)return;_0x44e5c0['preventDefault']();}return _0x3fff2f['addEventListener']('pointerdown',_0x9d549e,{'passive':!![]}),_0x3fff2f['addEventListener']('pointermove',_0x53f036,{'passive':!![]}),_0x3fff2f['addEventListener']('pointerup',_0x43ecc3,{'passive':!![]}),_0x3fff2f['addEventListener']('pointercancel',_0x43ecc3,{'passive':!![]}),_0x3fff2f['addEventListener']('pointerleave',_0x43ecc3,{'passive':!![]}),_0x3fff2f['addEventListener']('contextmenu',_0x53c3f4),window['addEventListener']('scroll',_0x594665,{'passive':!![],'capture':!![]}),()=>{_0x1fa1fe(),_0x3fff2f['removeEventListener']('pointerdown',_0x9d549e),_0x3fff2f['removeEventListener']('pointermove',_0x53f036),_0x3fff2f['removeEventListener']('pointerup',_0x43ecc3),_0x3fff2f['removeEventListener']('pointercancel',_0x43ecc3),_0x3fff2f['removeEventListener']('pointerleave',_0x43ecc3),_0x3fff2f['removeEventListener']('contextmenu',_0x53c3f4),window['removeEventListener']('scroll',_0x594665,{'capture':!![]});};}