/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import{e as writeTask}from"./index-6f1cee27.js";import{h as hapticSelectionEnd,a as hapticSelectionStart,b as hapticSelectionChanged}from"./haptic-9a9aa7ec.js";import{createGesture}from"./index-41bf41f2.js";var createButtonActiveGesture=function(e,t){var n;var r;var i=function(e,r,i){if(typeof document==="undefined"){return}var o=document.elementFromPoint(e,r);if(!o||!t(o)){c();return}if(o!==n){c();a(o,i)}};var a=function(e,t){n=e;if(!r){r=n}var i=n;writeTask((function(){return i.classList.add("ion-activated")}));t()};var c=function(e){if(e===void 0){e=false}if(!n){return}var t=n;writeTask((function(){return t.classList.remove("ion-activated")}));if(e&&r!==n){n.click()}n=undefined};return createGesture({el:e,gestureName:"buttonActiveDrag",threshold:0,onStart:function(e){return i(e.currentX,e.currentY,hapticSelectionStart)},onMove:function(e){return i(e.currentX,e.currentY,hapticSelectionChanged)},onEnd:function(){c(true);hapticSelectionEnd();r=undefined}})};export{createButtonActiveGesture as c};