{"version":3,"sources":["../../node_modules/@d3r/js-tools/legacy/viewport.js","viewport.js"],"names":["Viewport","breakpoints","this","mediaQuery","breakpoint","type","size","matchMedia","window","matches","customMediaQuery","customMatchMedia","customMatches","resize","callback","windowResizing","addEventListener","clearTimeout","setTimeout","app","viewport","D3RSite","D3R"],"mappings":"AAAA,SAAAA,SAAAC,GAEAC,KAAAD,YAAAA,EAGAC,KAAAC,WAAA,SAAAC,GACA,MACA,IACAF,KAAAD,YAAAG,GAAAC,KACA,KACAH,KAAAD,YAAAG,GAAAE,KACA,KAEA,EAGAJ,KAAAK,WAAA,SAAAH,GACA,OAAAI,OAAAD,WAAAL,KAAAC,WAAAC,GACA,EAGAF,KAAAO,QAAA,SAAAL,GACA,OAAAI,OAAAD,WAAAL,KAAAC,WAAAC,IAAAK,OACA,EAGAP,KAAAQ,iBAAA,SAAAN,GACA,OAAAA,CACA,EAGAF,KAAAS,iBAAA,SAAAP,GACA,OAAAI,OAAAD,WAAAL,KAAAQ,iBAAAN,GACA,EAGAF,KAAAU,cAAA,SAAAR,GACA,OAAAI,OAAAD,WAAAL,KAAAQ,iBAAAN,IAAAK,OACA,EAGAP,KAAAW,OAAA,SAAAC,GACA,IAAAC,EAEAP,OAAAQ,iBAAA,SAAA,WACAC,aAAAF,GACAA,EAAAG,WAAA,WACA,mBAAAJ,GACAA,GAEA,EAAA,IACA,EACA,CACA,ECpDA,SAAAK,EAAAC,GACAD,EAAAC,SAAAA,CACA,CAFA,CAEAZ,OAAAa,QAAAb,OAAAa,SAAA,CAAA,EAAA,IAAArB,SAAAsB,IAAArB","file":"../../javascript/viewport.js","sourcesContent":["function Viewport(breakpoints) {\n    // Get the breakpoint config\n    this.breakpoints = breakpoints;\n\n    // Constuct the breakpoint for the media query\n    this.mediaQuery = function (breakpoint) {\n        return (\n            '(' +\n            this.breakpoints[breakpoint].type +\n            ': ' +\n            this.breakpoints[breakpoint].size +\n            'px)'\n        );\n    };\n\n    // Check if the media query matches\n    this.matchMedia = function (breakpoint) {\n        return window.matchMedia(this.mediaQuery(breakpoint));\n    };\n\n    // Check if the media query matches\n    this.matches = function (breakpoint) {\n        return window.matchMedia(this.mediaQuery(breakpoint)).matches;\n    };\n\n    // Construct the custom media query\n    this.customMediaQuery = function (breakpoint) {\n        return breakpoint;\n    };\n\n    // Check if the custom media query matches\n    this.customMatchMedia = function (breakpoint) {\n        return window.matchMedia(this.customMediaQuery(breakpoint));\n    };\n\n    // Check if the custom media query matches\n    this.customMatches = function (breakpoint) {\n        return window.matchMedia(this.customMediaQuery(breakpoint)).matches;\n    };\n\n    // Watch for viewport resize\n    this.resize = function (callback) {\n        var windowResizing;\n\n        window.addEventListener('resize', function () {\n            clearTimeout(windowResizing);\n            windowResizing = setTimeout(function () {\n                if (typeof callback == 'function') {\n                    callback();\n                }\n            }, 100);\n        });\n    };\n}\n","function Viewport(breakpoints) {\n    // Get the breakpoint config\n    this.breakpoints = breakpoints;\n\n    // Constuct the breakpoint for the media query\n    this.mediaQuery = function (breakpoint) {\n        return (\n            '(' +\n            this.breakpoints[breakpoint].type +\n            ': ' +\n            this.breakpoints[breakpoint].size +\n            'px)'\n        );\n    };\n\n    // Check if the media query matches\n    this.matchMedia = function (breakpoint) {\n        return window.matchMedia(this.mediaQuery(breakpoint));\n    };\n\n    // Check if the media query matches\n    this.matches = function (breakpoint) {\n        return window.matchMedia(this.mediaQuery(breakpoint)).matches;\n    };\n\n    // Construct the custom media query\n    this.customMediaQuery = function (breakpoint) {\n        return breakpoint;\n    };\n\n    // Check if the custom media query matches\n    this.customMatchMedia = function (breakpoint) {\n        return window.matchMedia(this.customMediaQuery(breakpoint));\n    };\n\n    // Check if the custom media query matches\n    this.customMatches = function (breakpoint) {\n        return window.matchMedia(this.customMediaQuery(breakpoint)).matches;\n    };\n\n    // Watch for viewport resize\n    this.resize = function (callback) {\n        var windowResizing;\n\n        window.addEventListener('resize', function () {\n            clearTimeout(windowResizing);\n            windowResizing = setTimeout(function () {\n                if (typeof callback == 'function') {\n                    callback();\n                }\n            }, 100);\n        });\n    };\n}\n\n;(function (app, viewport) {\n    app.viewport = viewport;\n})(window.D3RSite = window.D3RSite || {}, new Viewport(D3R.breakpoints));\n"]}