{"version":3,"sources":["./node_modules/@ionic/core/dist/esm/swipe-back-7f7c9a3b.js"],"names":["createSwipeBackGesture","el","canStartHandler","onStartHandler","onMoveHandler","onEndHandler","win","ownerDocument","defaultView","gestureName","gesturePriority","threshold","canStart","detail","startX","onStart","onMove","deltaX","innerWidth","onEnd","width","stepValue","velocity","velocityX","shouldComplete","missingDistance","realDur","dur","Math","abs","min"],"mappings":"2FAAA,oGAIA,MAAMA,EAAyB,CAACC,EAAIC,EAAiBC,EAAgBC,EAAeC,KAClF,MAAMC,EAAML,EAAGM,cAAcC,YAgC7B,OAAO,wBAAc,CACnBP,KACAQ,YAAa,eACbC,gBAAiB,GACjBC,UAAW,GACXC,SApCgBC,GACTA,EAAOC,QAAU,IAAMZ,IAoC9Ba,QAASZ,EACTa,OAnCcH,IAIdT,EAFcS,EAAOI,OACKX,EAAIY,aAiC9BC,MA9BaN,IAEb,MACMO,EAAQd,EAAIY,WACZG,EAFQR,EAAOI,OAEKG,EACpBE,EAAWT,EAAOU,UAElBC,EAAiBF,GAAY,IAAMA,EAAW,IAAOT,EAAOI,OADxDG,EAAQ,GAGZK,GADUD,EAAiB,EAAIH,EAAYA,GACfD,EAClC,IAAIM,EAAU,EACd,GAAID,EAAkB,EAAG,CACvB,MAAME,EAAMF,EAAkBG,KAAKC,IAAIP,GACvCI,EAAUE,KAAKE,IAAIH,EAAK,KAO1BtB,EAAamB,EAAiBH,GAAa,EAAK,IAAO,YAAM,EAAGA,EAAW,OAASK","file":"3.449b96a7ccd2e45363f0.js","sourcesContent":["import { j as clamp } from './helpers-cf6e85ee.js';\nimport './gesture-controller-31cb6bb9.js';\nimport { createGesture } from './index-f49d994d.js';\n\nconst createSwipeBackGesture = (el, canStartHandler, onStartHandler, onMoveHandler, onEndHandler) => {\n const win = el.ownerDocument.defaultView;\n const canStart = (detail) => {\n return detail.startX <= 50 && canStartHandler();\n };\n const onMove = (detail) => {\n // set the transition animation's progress\n const delta = detail.deltaX;\n const stepValue = delta / win.innerWidth;\n onMoveHandler(stepValue);\n };\n const onEnd = (detail) => {\n // the swipe back gesture has ended\n const delta = detail.deltaX;\n const width = win.innerWidth;\n const stepValue = delta / width;\n const velocity = detail.velocityX;\n const z = width / 2.0;\n const shouldComplete = velocity >= 0 && (velocity > 0.2 || detail.deltaX > z);\n const missing = shouldComplete ? 1 - stepValue : stepValue;\n const missingDistance = missing * width;\n let realDur = 0;\n if (missingDistance > 5) {\n const dur = missingDistance / Math.abs(velocity);\n realDur = Math.min(dur, 540);\n }\n /**\n * TODO: stepValue can sometimes return negative values\n * or values greater than 1 which should not be possible.\n * Need to investigate more to find where the issue is.\n */\n onEndHandler(shouldComplete, (stepValue <= 0) ? 0.01 : clamp(0, stepValue, 0.9999), realDur);\n };\n return createGesture({\n el,\n gestureName: 'goback-swipe',\n gesturePriority: 40,\n threshold: 10,\n canStart,\n onStart: onStartHandler,\n onMove,\n onEnd\n });\n};\n\nexport { createSwipeBackGesture };\n"],"sourceRoot":"webpack:///"}