{"version":3,"file":"index-BoqFf1zM.js","sources":["../../../node_modules/.pnpm/vuetify@2.7.2_vue@2.7.16/node_modules/vuetify/lib/mixins/overlayable/index.js"],"sourcesContent":["// Components\nimport VOverlay from '../../components/VOverlay'; // Utilities\n\nimport { keyCodes, addOnceEventListener, addPassiveEventListener, getZIndex, composedPath } from '../../util/helpers'; // Types\n\nimport Vue from 'vue';\n/* @vue/component */\n\nexport default Vue.extend().extend({\n name: 'overlayable',\n props: {\n hideOverlay: Boolean,\n overlayColor: String,\n overlayOpacity: [Number, String]\n },\n\n data() {\n return {\n animationFrame: 0,\n overlay: null\n };\n },\n\n watch: {\n hideOverlay(value) {\n if (!this.isActive) return;\n if (value) this.removeOverlay();else this.genOverlay();\n }\n\n },\n\n beforeDestroy() {\n this.removeOverlay();\n },\n\n methods: {\n createOverlay() {\n const overlay = new VOverlay({\n propsData: {\n absolute: this.absolute,\n value: false,\n color: this.overlayColor,\n opacity: this.overlayOpacity\n }\n });\n overlay.$mount();\n const parent = this.absolute ? this.$el.parentNode : document.querySelector('[data-app]');\n parent && parent.insertBefore(overlay.$el, parent.firstChild);\n this.overlay = overlay;\n },\n\n genOverlay() {\n this.hideScroll();\n if (this.hideOverlay) return;\n if (!this.overlay) this.createOverlay();\n this.animationFrame = requestAnimationFrame(() => {\n if (!this.overlay) return;\n\n if (this.activeZIndex !== undefined) {\n this.overlay.zIndex = String(this.activeZIndex - 1);\n } else if (this.$el) {\n this.overlay.zIndex = getZIndex(this.$el);\n }\n\n this.overlay.value = true;\n });\n return true;\n },\n\n /** removeOverlay(false) will not restore the scollbar afterwards */\n removeOverlay(showScroll = true) {\n if (this.overlay) {\n addOnceEventListener(this.overlay.$el, 'transitionend', () => {\n if (!this.overlay || !this.overlay.$el || !this.overlay.$el.parentNode || this.overlay.value || this.isActive) return;\n this.overlay.$el.parentNode.removeChild(this.overlay.$el);\n this.overlay.$destroy();\n this.overlay = null;\n }); // Cancel animation frame in case\n // overlay is removed before it\n // has finished its animation\n\n cancelAnimationFrame(this.animationFrame);\n this.overlay.value = false;\n }\n\n showScroll && this.showScroll();\n },\n\n scrollListener(e) {\n if ('key' in e) {\n if (['INPUT', 'TEXTAREA', 'SELECT'].includes(e.target.tagName) || // https://github.com/vuetifyjs/vuetify/issues/4715\n e.target.isContentEditable) return;\n const up = [keyCodes.up, keyCodes.pageup];\n const down = [keyCodes.down, keyCodes.pagedown];\n\n if (up.includes(e.keyCode)) {\n e.deltaY = -1;\n } else if (down.includes(e.keyCode)) {\n e.deltaY = 1;\n } else {\n return;\n }\n }\n\n if (e.target === this.overlay || e.type !== 'keydown' && e.target === document.body || this.checkPath(e)) e.preventDefault();\n },\n\n hasScrollbar(el) {\n if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;\n const style = window.getComputedStyle(el);\n return (['auto', 'scroll'].includes(style.overflowY) || el.tagName === 'SELECT') && el.scrollHeight > el.clientHeight || ['auto', 'scroll'].includes(style.overflowX) && el.scrollWidth > el.clientWidth;\n },\n\n shouldScroll(el, e) {\n if (el.hasAttribute('data-app')) return false;\n const dir = e.shiftKey || e.deltaX ? 'x' : 'y';\n const delta = dir === 'y' ? e.deltaY : e.deltaX || e.deltaY;\n let alreadyAtStart;\n let alreadyAtEnd;\n\n if (dir === 'y') {\n alreadyAtStart = el.scrollTop === 0;\n alreadyAtEnd = el.scrollTop + el.clientHeight === el.scrollHeight;\n } else {\n alreadyAtStart = el.scrollLeft === 0;\n alreadyAtEnd = el.scrollLeft + el.clientWidth === el.scrollWidth;\n }\n\n const scrollingUp = delta < 0;\n const scrollingDown = delta > 0;\n if (!alreadyAtStart && scrollingUp) return true;\n if (!alreadyAtEnd && scrollingDown) return true;\n\n if ((alreadyAtStart || alreadyAtEnd) && el.parentNode) {\n return this.shouldScroll(el.parentNode, e);\n }\n\n return false;\n },\n\n isInside(el, parent) {\n if (el === parent) {\n return true;\n } else if (el === null || el === document.body) {\n return false;\n } else {\n return this.isInside(el.parentNode, parent);\n }\n },\n\n checkPath(e) {\n const path = composedPath(e);\n\n if (e.type === 'keydown' && path[0] === document.body) {\n const dialog = this.$refs.dialog; // getSelection returns null in firefox in some edge cases, can be ignored\n\n const selected = window.getSelection().anchorNode;\n\n if (dialog && this.hasScrollbar(dialog) && this.isInside(selected, dialog)) {\n return !this.shouldScroll(dialog, e);\n }\n\n return true;\n }\n\n for (let index = 0; index < path.length; index++) {\n const el = path[index];\n if (el === document) return true;\n if (el === document.documentElement) return true;\n if (el === this.$refs.content) return true;\n if (this.hasScrollbar(el)) return !this.shouldScroll(el, e);\n }\n\n return true;\n },\n\n hideScroll() {\n if (this.$vuetify.breakpoint.smAndDown) {\n document.documentElement.classList.add('overflow-y-hidden');\n } else {\n addPassiveEventListener(window, 'wheel', this.scrollListener, {\n passive: false\n });\n window.addEventListener('keydown', this.scrollListener);\n }\n },\n\n showScroll() {\n document.documentElement.classList.remove('overflow-y-hidden');\n window.removeEventListener('wheel', this.scrollListener);\n window.removeEventListener('keydown', this.scrollListener);\n }\n\n }\n});\n//# sourceMappingURL=index.js.map"],"names":["Overlayable","Vue","value","overlay","VOverlay","parent","getZIndex","showScroll","addOnceEventListener","up","keyCodes","down","el","style","e","dir","delta","alreadyAtStart","alreadyAtEnd","scrollingUp","scrollingDown","path","composedPath","dialog","selected","index","addPassiveEventListener"],"mappings":"siBAQA,MAAAA,EAAeC,EAAI,OAAQ,EAAC,OAAO,CACjC,KAAM,cACN,MAAO,CACL,YAAa,QACb,aAAc,OACd,eAAgB,CAAC,OAAQ,MAAM,CAChC,EAED,MAAO,CACL,MAAO,CACL,eAAgB,EAChB,QAAS,IACV,CACF,EAED,MAAO,CACL,YAAYC,EAAO,CACZ,KAAK,WACNA,EAAO,KAAK,cAAe,EAAM,KAAK,WAAY,EAC5D,CAEG,EAED,eAAgB,CACd,KAAK,cAAe,CACrB,EAED,QAAS,CACP,eAAgB,CACd,MAAMC,EAAU,IAAIC,EAAS,CAC3B,UAAW,CACT,SAAU,KAAK,SACf,MAAO,GACP,MAAO,KA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