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,KAHO;;AAIR,IAAA,MAAM,GAAA;AACJ,UAAI,KAAK,IAAL,KAAc,IAAlB,EAAwB;AACtB;AACA,eAAO,IAAP;AACD,OAHD,MAGO,IAAI,KAAK,KAAL,KAAe,IAAnB,EAAyB;AAC9B;AACA,eAAO,KAAP;AACD,OAHM,MAGA;AACL;AACA,eAAO,KAAK,KAAL,CAAW,MAAlB;AACD;AACF,KAfO;;AAgBR,IAAA,YAAY,GAAA;AACV,aAAO;AACL,uBAAe,KAAK,MADf;AAEL,wBAAgB,CAAC,KAAK;AAFjB,OAAP;AAID,KArBO;;AAsBR;AACA,IAAA,UAAU,GAAA;AACR,UAAI,KAAK,IAAL,KAAc,IAAlB,EAAwB;AACtB;AACA,eAAO,IAAP;AACD,OAHD,MAGO,IAAI,KAAK,KAAL,KAAe,IAAnB,EAAyB;AAC9B;AACA,eAAO,KAAP;AACD,OAHM,MAGA;AACL;AACA,eAAO,KAAK,SAAZ;AACD;AACF,KAlCO;;AAmCR,IAAA,gBAAgB,GAAA;AACd,aAAO;AACL,uBAAe,KAAK,UADf;AAEL,wBAAgB,CAAC,KAAK;AAFjB,OAAP;AAID;;AAxCO,GApCqC;AA+E/C,EAAA,KAAK,EAAE;AACL,IAAA,MAAM,EAAE;AACN,MAAA,OAAO,CAAE,MAAF,EAAU,MAAV,EAAgB;AACrB,YAAI,MAAM,KAAK,MAAf,EAAuB;AACrB,eAAK,gBAAL,CAAsB,MAAtB,GAA+B,KAAK,MAApC;AACD;AACF,OALK;;AAMN,MAAA,SAAS,EAAE;AANL;AADH;AA/EwC,CAA/B,CAAlB;AA2FA,eAAe,SAAf","sourcesContent":["import Vue from 'vue'\nimport { PropValidator, RenderContext } from 'vue/types/options'\n\n/* eslint-disable-next-line no-use-before-define */\ninterface Themeable extends Vue {\n theme: {\n isDark: boolean\n }\n}\n\nexport function functionalThemeClasses (context: RenderContext): object {\n const vm = {\n ...context.props,\n ...context.injections,\n }\n const isDark = Themeable.options.computed.isDark.call(vm)\n return Themeable.options.computed.themeClasses.call({ isDark })\n}\n\n/* @vue/component */\nconst Themeable = Vue.extend<Themeable>().extend({\n name: 'themeable',\n\n provide (): object {\n return {\n theme: this.themeableProvide,\n }\n },\n\n inject: {\n theme: {\n default: {\n isDark: false,\n },\n },\n },\n\n props: {\n dark: {\n type: Boolean,\n default: null,\n } as PropValidator<boolean | null>,\n light: {\n type: Boolean,\n default: null,\n } as PropValidator<boolean | null>,\n },\n\n data () {\n return {\n themeableProvide: {\n isDark: false,\n },\n }\n },\n\n computed: {\n appIsDark (): boolean {\n return this.$vuetify.theme.dark || false\n },\n isDark (): boolean {\n if (this.dark === true) {\n // explicitly dark\n return true\n } else if (this.light === true) {\n // explicitly light\n return false\n } else {\n // inherit from parent, or default false if there is none\n return this.theme.isDark\n }\n },\n themeClasses (): object {\n return {\n 'theme--dark': this.isDark,\n 'theme--light': !this.isDark,\n }\n },\n /** Used by menus and dialogs, inherits from v-app instead of the parent */\n rootIsDark (): boolean {\n if (this.dark === true) {\n // explicitly dark\n return true\n } else if (this.light === true) {\n // explicitly light\n return false\n } else {\n // inherit from v-app\n return this.appIsDark\n }\n },\n rootThemeClasses (): Dictionary<boolean> {\n return {\n 'th
|