{"version":3,"sources":["webpack:///../../../src/components/VSnackbar/VSnackbar.ts","webpack:///../../../src/directives/intersect/index.ts"],"names":["name","props","app","centered","contentClass","type","default","multiLine","text","timeout","Number","transition","Boolean","validator","v","vertical","data","activeTimeout","computed","classes","this","bottom","hasBackground","isDark","styles","$vuetify","top","paddingBottom","paddingLeft","paddingRight","paddingTop","bar","watch","isActive","mounted","setTimeout","created","$attrs","hasOwnProperty","methods","genActions","$createElement","staticClass","attrs","class","genContent","role","genWrapper","setColor","directives","value","genTransition","window","render","h","style","inserted","modifiers","binding","handler","options","observer","IntersectionObserver","entries","el","isIntersecting","entry","unbind","init","observe","Intersect"],"mappings":"kQAoBe,sBAAO,EAAD,mBAInB,eAAoB,CAAC,WAAD,wBAAD,SAJN,OAYN,CACPA,KADO,aAGPC,MAAO,CACLC,IADK,QAELC,SAFK,QAGLC,aAAc,CACZC,KADY,OAEZC,QAAS,IAEXC,UAPK,QAQLC,KARK,QASLC,QAAS,CACPJ,KAAM,CAACK,OADA,QAEPJ,QAAS,KAEXK,WAAY,CACVN,KAAM,CAACO,QADG,QAEVN,QAFU,qBAGVO,UAAW,SAAAC,GAAC,MAAiB,kBAANA,IAAwB,IAANA,IAE3CC,SAAUH,SAGZI,KAAM,iBAAO,CACXC,eAAgB,IAGlBC,SAAU,CACRC,QADQ,WAEN,MAAO,CACL,oBAAqBC,KADhB,SAEL,kBAAmBA,KAFd,SAGL,kBAAmBA,KAAKC,SAAWD,KAH9B,IAIL,oBAAqBA,KAJhB,SAKL,0BAA2BA,KALtB,cAML,gBAAiBA,KANZ,KAOL,sBAAuBA,KAAKb,YAAca,KAPrC,SAQL,iBAAkBA,KARb,MASL,gBAAiBA,KATZ,KAUL,eAAgBA,KAVX,IAWL,oBAAqBA,KAAKL,WAK9BO,cAlBQ,WAmBN,OACGF,KAAD,OACCA,KAFH,UAOFG,OA1BQ,WA2BN,OAAOH,KAAKE,eACPF,KADE,MAEH,oCAFJ,OAIFI,OA/BQ,WAkCN,GA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,EAAUC,OAAOU,KAAvB,SAGGA,KAAD,WAEA,gBAHF,KAQAA,KAAA,cAAqBgC,OAAA,YAAkB,WACrC,gBADF,MAMJC,OA5KO,SA4KD,GACJ,OAAOC,EAAE,MAAO,CACdZ,YADc,UAEdE,MAAOxB,KAFO,QAGdmC,MAAOnC,KAAKI,QACX,EACmB,IAApBJ,KAAKT,WACDS,KADJ,gBAEIA,KAPN,mB,8DC7LJ,SAASoC,EAAT,KACE,IAAMC,EAAYC,EAAA,WAAlB,GACMR,EAAQQ,EAAd,MAFgE,EAGnC,+BAEzB,CAAEC,QAAF,EAAkBC,QAAS,IAFzB,EAH0D,EAG1D,QAAWA,EAH+C,EAG/CA,QAGXC,EAAW,IAAIC,sBAAqB,WAGtC,IAFFC,EAEE,uDAHsC,KAGtC,uCAEF,GAAKC,EAAL,UAIA,GACEL,KACGF,EAAD,OACAO,EAAA,SAHJ,MAKE,CACA,IAAMC,EAAiBrD,QAAQmD,EAAA,MAAa,SAAAG,GAAK,OAAIA,EAArD,mBAEAP,EAAQI,EAASF,EAAjB,GAKEG,EAAA,eAAoBP,EAAxB,KAAwCU,EAAxC,GAEMH,EAAA,eAAD,KAxBP,GA2BAA,EAAA,SAAc,CAAEI,MAAF,EAAeP,YAE7BA,EAAAQ,QAAA,GAGF,SAASF,EAAT,GAEOH,EAAL,WAEAA,EAAA,4BAAAA,UACOA,EAAP,UAGK,IAAMM,EAAY,CACvBd,WACAW,UAGF,U","file":"js/chunk-612fd592.6153891f.js","sourcesContent":["// Styles\nimport './VSnackbar.sass'\n\n// Components\nimport VSheet from '../VSheet/VSheet'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport Themeable from '../../mixins/themeable'\nimport Toggleable from '../../mixins/toggleable'\nimport { factory as PositionableFactory } from '../../mixins/positionable'\n\n// Utilities\nimport mixins from '../../util/mixins'\nimport { convertToUnit, getSlot } from '../../util/helpers'\nimport { deprecate, removed } from '../../util/console'\n\n// Types\nimport { PropType, VNode } from 'vue'\n\nexport default mixins(\n VSheet,\n Colorable,\n Toggleable,\n PositionableFactory([\n 'absolute',\n 'bottom',\n 'left',\n 'right',\n 'top',\n ])\n/* @vue/component */\n).extend({\n name: 'v-snackbar',\n\n props: {\n app: Boolean,\n centered: Boolean,\n contentClass: {\n type: String,\n default: '',\n },\n multiLine: Boolean,\n text: Boolean,\n timeout: {\n type: [Number, String],\n default: 5000,\n },\n transition: {\n type: [Boolean, String] as PropType,\n default: 'v-snack-transition',\n validator: v => typeof v === 'string' || v === false,\n },\n vertical: Boolean,\n },\n\n data: () => ({\n activeTimeout: -1,\n }),\n\n computed: {\n classes (): object {\n return {\n 'v-snack--absolute': this.absolute,\n 'v-snack--active': this.isActive,\n 'v-snack--bottom': this.bottom || !this.top,\n 'v-snack--centered': this.centered,\n 'v-snack--has-background': this.hasBackground,\n 'v-snack--left': this.left,\n 'v-snack--multi-line': this.multiLine && !this.vertical,\n 'v-snack--right': this.right,\n 'v-snack--text': this.text,\n 'v-snack--top': this.top,\n 'v-snack--vertical': this.vertical,\n }\n },\n // Text and outlined styles both\n // use transparent backgrounds\n hasBackground (): boolean {\n return (\n !this.text &&\n !this.outlined\n )\n },\n // Snackbar is dark by default\n // override themeable logic.\n isDark (): boolean {\n return this.hasBackground\n ? !this.light\n : Themeable.options.computed.isDark.call(this)\n },\n styles (): object {\n // Styles are not needed when\n // using the absolute prop.\n if (this.absolute) return {}\n\n const {\n bar,\n bottom,\n footer,\n insetFooter,\n left,\n right,\n top,\n } = this.$vuetify.application\n\n // Should always move for y-axis\n // applicationable components.\n return {\n paddingBottom: convertToUnit(bottom + footer + insetFooter),\n paddingLeft: !this.app ? undefined : convertToUnit(left),\n paddingRight: !this.app ? undefined : convertToUnit(right),\n paddingTop: convertToUnit(bar + top),\n }\n },\n },\n\n watch: {\n isActive: 'setTimeout',\n timeout: 'setTimeout',\n },\n\n mounted () {\n if (this.isActive) this.setTimeout()\n },\n\n created () {\n /* istanbul ignore next */\n if (this.$attrs.hasOwnProperty('auto-height')) {\n removed('auto-height', this)\n }\n\n /* istanbul ignore next */\n // eslint-disable-next-line eqeqeq\n if (this.timeout == 0) {\n deprecate('timeout=\"0\"', '-1', this)\n }\n },\n\n methods: {\n genActions () {\n return this.$createElement('div', {\n staticClass: 'v-snack__action ',\n }, [\n getSlot(this, 'action', {\n attrs: { class: 'v-snack__btn' },\n }),\n ])\n },\n genContent () {\n return this.$createElement('div', {\n staticClass: 'v-snack__content',\n class: {\n [this.contentClass]: true,\n },\n attrs: {\n role: 'status',\n 'aria-live': 'polite',\n },\n }, [getSlot(this)])\n },\n genWrapper () {\n const setColor = this.hasBackground\n ? this.setBackgroundColor\n : this.setTextColor\n\n const data = setColor(this.color, {\n staticClass: 'v-snack__wrapper',\n class: VSheet.options.computed.classes.call(this),\n directives: [{\n name: 'show',\n value: this.isActive,\n }],\n })\n\n return this.$createElement('div', data, [\n this.genContent(),\n this.genActions(),\n ])\n },\n genTransition () {\n return this.$createElement('transition', {\n props: { name: this.transition },\n }, [this.genWrapper()])\n },\n setTimeout () {\n window.clearTimeout(this.activeTimeout)\n\n const timeout = Number(this.timeout)\n\n if (\n !this.isActive ||\n // TODO: remove 0 in v3\n [0, -1].includes(timeout)\n ) {\n return\n }\n\n this.activeTimeout = window.setTimeout(() => {\n this.isActive = false\n }, timeout)\n },\n },\n\n render (h): VNode {\n return h('div', {\n staticClass: 'v-snack',\n class: this.classes,\n style: this.styles,\n }, [\n this.transition !== false\n ? this.genTransition()\n : this.genWrapper(),\n ])\n },\n})\n","import { VNodeDirective } from 'vue/types/vnode'\n\ntype ObserveHandler = (\n entries: IntersectionObserverEntry[],\n observer: IntersectionObserver,\n isIntersecting: boolean,\n) => void\n\ninterface ObserveVNodeDirective extends Omit {\n value?: ObserveHandler | { handler: ObserveHandler, options?: IntersectionObserverInit }\n modifiers?: {\n once?: boolean\n quiet?: boolean\n }\n}\n\nfunction inserted (el: HTMLElement, binding: ObserveVNodeDirective) {\n const modifiers = binding.modifiers || {}\n const value = binding.value\n const { handler, options } = typeof value === 'object'\n ? value\n : { handler: value, options: {} }\n const observer = new IntersectionObserver((\n entries: IntersectionObserverEntry[] = [],\n observer: IntersectionObserver\n ) => {\n /* istanbul ignore if */\n if (!el._observe) return // Just in case, should never fire\n\n // If is not quiet or has already been\n // initted, invoke the user callback\n if (\n handler && (\n !modifiers.quiet ||\n el._observe.init\n )\n ) {\n const isIntersecting = Boolean(entries.find(entry => entry.isIntersecting))\n\n handler(entries, observer, isIntersecting)\n }\n\n // If has already been initted and\n // has the once modifier, unbind\n if (el._observe.init && modifiers.once) unbind(el)\n // Otherwise, mark the observer as initted\n else (el._observe.init = true)\n }, options)\n\n el._observe = { init: false, observer }\n\n observer.observe(el)\n}\n\nfunction unbind (el: HTMLElement) {\n /* istanbul ignore if */\n if (!el._observe) return\n\n el._observe.observer.unobserve(el)\n delete el._observe\n}\n\nexport const Intersect = {\n inserted,\n unbind,\n}\n\nexport default Intersect\n"],"sourceRoot":""}