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,IAAI,CAAC,CAAC;AACrB,CAAC,CAAC,C","sources":["webpack://harbinger-custom/./src/util/dom-ready.js","webpack://harbinger-custom/webpack/bootstrap","webpack://harbinger-custom/webpack/runtime/define property getters","webpack://harbinger-custom/webpack/runtime/hasOwnProperty shorthand","webpack://harbinger-custom/webpack/runtime/make namespace object","webpack://harbinger-custom/./src/card-helper/card-helper.js"],"sourcesContent":["// Handles firing DOMReady events on scripts loaded asynchronously\n\nconst DOMReady = (callback) => {\n document.readyState === 'interactive' || document.readyState === 'complete'\n ? callback()\n : document.addEventListener('DOMContentLoaded', callback);\n};\n\nexport default DOMReady;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import DOMReady from \"../util/dom-ready\";\n\nconst CardHelper = {\n init() {\n this.card = null;\n this.link = null;\n this.mousedowntime = 0;\n \n const body = document.querySelector('body');\n \n body.addEventListener('click', this.handleCardClick.bind(this));\n \n // Works better with drag scrolling if available\n // body.addEventListener('mousedown', this.handleCardMouseDown.bind(this));\n // body.addEventListener('mouseup', this.handleCardMouseUp.bind(this));\n },\n \n handleCardClick(evt) {\n const target = evt.target;\n this.card = target.closest('[class*=\"card-helper\"]');\n \n if (!this.card) {\n return;\n }\n \n // Exclude direct clicks on links or buttons\n if (target.closest('a') || target.closest('input') || target.closest('button')) {\n return;\n }\n this.link = this.card.querySelector('a');\n if (!this.link) {\n return;\n }\n \n this.link.click();\n \n },\n \n handleCardMouseDown(evt) {\n const target = evt.target;\n this.card = target.closest('[class*=\"card\"]');\n // Not a card? Bail out.\n if (!this.card) {\n return;\n }\n // Exclude direct clicks on links or buttons\n if (target.closest('a') || target.closest('input') || target.closest('button')) {\n return;\n }\n this.link = this.card.querySelector('a');\n if (!this.link) {\n return;\n }\n this.mousedowntime = new Date().getTime();\n },\n \n handleCardMouseUp() {\n if (!this.link) {\n return;\n }\n const mouseuptime = new Date().getTime();\n if (mouseuptime - this.mousedowntime < 200) {\n this.link.click();\n }\n },\n };\n \n// export default CardHelper;\n \n\nDOMReady(() => {\n // TODO: This needs to be true on storybook, but false on live. Need to move to an environment variable\n if (!event.isTrusted) {\n return\n }\n CardHelper.init();\n});\n"],"names":["DOMReady","callback","document","readyState","addEventListener","CardHelper","init","card","link","mousedowntime","body","querySelector","handleCardClick","bind","evt","target","closest","click","handleCardMouseDown","Date","getTime","handleCardMouseUp","mouseuptime","event","isTrusted"],"sourceRoot":""}