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9C,aAAO,IAAI,CAAC,GAAL,CACL,QAAQ,CAAC,eAAT,CAA0B,YADrB,EAEL,MAAM,CAAC,WAAP,IAAsB,CAFjB,CAAP;AAID;;;;EA9J6B,gB;;;AAChB,UAAA,CAAA,QAAA,GAAW,YAAX","sourcesContent":["// Extensions\nimport { Service } from '../service'\n\n// Types\nimport { VuetifyBreakpointOptions } from 'vuetify/types/services/breakpoint'\n\nexport class Breakpoint extends Service {\n public static property = 'breakpoint'\n\n // Public\n public xs = false\n\n public sm = false\n\n public md = false\n\n public lg = false\n\n public xl = false\n\n public xsOnly = false\n\n public smOnly = false\n\n public smAndDown = false\n\n public smAndUp = false\n\n public mdOnly = false\n\n public mdAndDown = false\n\n public mdAndUp = false\n\n public lgOnly = false\n\n public lgAndDown = false\n\n public lgAndUp = false\n\n public xlOnly = false\n\n public name = ''\n\n public height = 0\n\n public width = 0\n\n public thresholds = {\n xs: 600,\n sm: 960,\n md: 1280,\n lg: 1920,\n }\n\n public scrollbarWidth = 16\n\n private resizeTimeout = 0\n\n constructor (options: Partial<VuetifyBreakpointOptions> = {}) {\n super()\n this.thresholds = {\n ...this.thresholds,\n ...options.thresholds,\n }\n this.scrollbarWidth = (\n options.scrollBarWidth ||\n this.scrollbarWidth\n )\n this.init()\n }\n\n public init () {\n /* istanbul ignore if */\n if (typeof window === 'undefined') return\n\n window.addEventListener(\n 'resize',\n this.onResize.bind(this),\n { passive: true }\n )\n\n this.update()\n }\n\n private onResize () {\n clearTimeout(this.resizeTimeout)\n\n // Added debounce to match what\n // v-resize used to do but was\n // removed due to a memory leak\n // https://github.com/vuetifyjs/vuetify/pull/2997\n this.resizeTimeout = window.setTimeout(this.update.bind(this), 200)\n }\n\n /* eslint-disable-next-line max-statements */\n private update () {\n const height = this.getClientHeight()\n const width = this.getClientWidth()\n\n const xs = width < this.thresholds.xs\n const sm = width < this.thresholds.sm && !xs\n const md = width < (this.thresholds.md - this.scrollbarWidth) && !(sm || xs)\n const lg = width < (this.thresholds.lg - this.scrollbarWidth) && !(md || sm || xs)\n const xl = width >= (this.thresholds.lg - this.scrollbarWidth)\n\n this.height = height\n this.width = width\n\n this.xs = xs\n this.sm = sm\n this.md = md\n this.lg = lg\n this.xl = xl\n\n this.xsOnly = xs\n this.smOnly = sm\n this.smAndDown = (xs || sm) && !(md || lg || xl)\n this.smAndUp = !xs && (sm || md || lg || xl)\n this.mdOnly = md\n this.mdAndDown = (xs || sm || md) && !(lg || xl)\n this.mdAndUp = !(xs || sm) && (md || lg || xl)\n this.lgOnly = lg\n this.lgAndDown = (xs || sm || md || lg) && !xl\n this.lgAndUp = !(xs || sm || md) && (lg || xl)\n this.xlOnly = xl\n\n switch (true) {\n case (xs):\n this.name = 'xs'\n break\n case (sm):\n this.name = 'sm'\n break\n case (md):\n this.name = 'md'\n break\n case (lg):\n this.name = 'lg'\n break\n default:\n this.name = 'xl'\n break\n }\n }\n\n // Cross-browser support as described in:\n // https://stackoverflow.com/questions/1248081\n private getClientWidth () {\n /* istanbul ignore if */\n if (typeof document === 'undefined') return 0 // SSR\n return Math.max(\n document.documentElement!.clientWidth,\n window.innerWidth || 0\n )\n }\n\n private getClientHeight () {\n /* istanbul ignore if */\n if (typeof document === 'undefined') return 0 // SSR\n return Math.max(\n document.documentElement!.clientHeight,\n window.innerHeight || 0\n )\n }\n}\n"],"sourceRoot":"","file":"index.js"} |