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js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/stimulus-use-tinygesture@2.0.0/dist/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*\nStimulusUseTinyGesture 2.0.0\n*/\n(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tinygesture')) :\n    typeof define === 'function' && define.amd ? define(['exports', 'tinygesture'], factory) :\n    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.StimulusUseTinyGesture = {}, global.TinyGesture));\n})(this, (function (exports, TinyGesture) { 'use strict';\n\n    function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\n    var TinyGesture__default = /*#__PURE__*/_interopDefaultLegacy(TinyGesture);\n\n    class UseTinyGesture {\n        constructor(controller, options) {\n            let element = options.element;\n            if (element === undefined) {\n                element = controller.element;\n            }\n            const tinyGestureOptions = options.tinygesture;\n            const gesture = new TinyGesture__default[\"default\"](element, tinyGestureOptions);\n            Object.entries(options.handlers).forEach(([eventName, handlers]) => {\n                for (let i = 0; i < handlers.length; i++) {\n                    const handler = handlers[i].bind(controller);\n                    gesture.on(eventName, (event) => {\n                        handler(event, gesture);\n                    });\n                }\n            });\n            this.gesture = gesture;\n        }\n        destroy() {\n            if (this.gesture !== undefined) {\n                this.gesture.destroy();\n                this.gesture = undefined;\n            }\n        }\n    }\n    function useTinyGesture(controller, options) {\n        const gesture = new UseTinyGesture(controller, options);\n        const controllerDisconnect = controller.disconnect.bind(controller);\n        Object.assign(controller, {\n            disconnect() {\n                controllerDisconnect();\n                gesture.destroy();\n            }\n        });\n        return gesture;\n    }\n\n    exports.UseTinyGesture = UseTinyGesture;\n    exports.useTinyGesture = useTinyGesture;\n\n    Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n"]}