{"version":3,"file":"3100.4f9b2f68d6b5538b.js","mappings":"6KAOA,MAAMA,EAAyBA,CAACC,EAAIC,EAAiBC,EAAgBC,EAAeC,KAChF,MAAMC,EAAML,EAAGM,cAAcC,YAC7B,IAAIC,KAAMC,KAAMT,GAMhB,MAQMU,EAAaC,GACRH,GAAOG,EAAOC,OAASD,EAAOC,OAqCzC,SAAOC,iBAAc,CACjBb,KACAc,YAAa,eAKbC,gBAAiB,IACjBC,UAAW,GACXC,SAzCcN,IAMdH,KAAMC,KAAMT,GApBEW,KAEd,MAAQO,UAAWP,EACnB,OAAIH,EACOU,GAAUb,EAAIc,WAAaH,GAE/BE,GAAUF,IAeVI,CAAST,IAAWV,KAmC3BoB,QAASnB,EACToB,OAlCYX,IAGZ,MAAMY,EADQb,EAAUC,GACEN,EAAIc,WAC9BhB,EAAcoB,EAAS,EA+BvBC,MA7BWb,IAEX,MAAMc,EAAQf,EAAUC,GAClBe,EAAQrB,EAAIc,WACZI,EAAYE,EAAQC,EACpBC,EAvBYhB,IACXH,GAAOG,EAAOiB,UAAYjB,EAAOiB,UAsBvBC,CAAalB,GAExBmB,EAAiBH,GAAY,IAAMA,EAAW,IAAOF,EADjDC,EAAQ,GAGZK,GADUD,EAAiB,EAAIP,EAAYA,GACfG,EAClC,IAAIM,EAAU,EACd,GAAID,EAAkB,EAAG,CACrB,MAAME,EAAMF,EAAkBG,KAAKC,IAAIR,GACvCK,EAAUE,KAAKE,IAAIH,EAAK,IAC5B,CACA7B,EAAa0B,EAAgBP,GAAa,EAAI,OAAOc,KAAM,EAAGd,EAAW,OAASS,EAAO,GAe5F","names":["createSwipeBackGesture","el","canStartHandler","onStartHandler","onMoveHandler","onEndHandler","win","ownerDocument","defaultView","rtl","isRTL","getDeltaX","detail","deltaX","createGesture","gestureName","gesturePriority","threshold","canStart","startX","innerWidth","isAtEdge","onStart","onMove","stepValue","onEnd","delta","width","velocity","velocityX","getVelocityX","shouldComplete","missingDistance","realDur","dur","Math","abs","min","clamp"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./node_modules/@ionic/core/components/swipe-back.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { k as clamp } from './helpers.js';\nimport { i as isRTL } from './dir.js';\nimport { createGesture } from './index3.js';\n\nconst createSwipeBackGesture = (el, canStartHandler, onStartHandler, onMoveHandler, onEndHandler) => {\n    const win = el.ownerDocument.defaultView;\n    let rtl = isRTL(el);\n    /**\n     * Determine if a gesture is near the edge\n     * of the screen. If true, then the swipe\n     * to go back gesture should proceed.\n     */\n    const isAtEdge = (detail) => {\n        const threshold = 50;\n        const { startX } = detail;\n        if (rtl) {\n            return startX >= win.innerWidth - threshold;\n        }\n        return startX <= threshold;\n    };\n    const getDeltaX = (detail) => {\n        return rtl ? -detail.deltaX : detail.deltaX;\n    };\n    const getVelocityX = (detail) => {\n        return rtl ? -detail.velocityX : detail.velocityX;\n    };\n    const canStart = (detail) => {\n        /**\n         * The user's locale can change mid-session,\n         * so we need to check text direction at\n         * the beginning of every gesture.\n         */\n        rtl = isRTL(el);\n        return isAtEdge(detail) && canStartHandler();\n    };\n    const onMove = (detail) => {\n        // set the transition animation's progress\n        const delta = getDeltaX(detail);\n        const stepValue = delta / win.innerWidth;\n        onMoveHandler(stepValue);\n    };\n    const onEnd = (detail) => {\n        // the swipe back gesture has ended\n        const delta = getDeltaX(detail);\n        const width = win.innerWidth;\n        const stepValue = delta / width;\n        const velocity = getVelocityX(detail);\n        const z = width / 2.0;\n        const shouldComplete = velocity >= 0 && (velocity > 0.2 || delta > 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        onEndHandler(shouldComplete, stepValue <= 0 ? 0.01 : clamp(0, stepValue, 0.9999), realDur);\n    };\n    return createGesture({\n        el,\n        gestureName: 'goback-swipe',\n        /**\n         * Swipe to go back should have priority over other horizontal swipe\n         * gestures. These gestures have a priority of 100 which is why 101 was chosen here.\n         */\n        gesturePriority: 101,\n        threshold: 10,\n        canStart,\n        onStart: onStartHandler,\n        onMove,\n        onEnd,\n    });\n};\n\nexport { createSwipeBackGesture };\n"],"x_google_ignoreList":[0]}