{"version":3,"sources":["../assets/scripts/cookies.js"],"names":["$","window","jQuery","CookieBox","selector","this","init","prototype","key","$el","length","binds","showBox","accept","e","preventDefault","currentTarget","closest","hide","document","cookie","bind","indexOf","show"],"mappings":"AAAA,GAAAA,GAAAC,OAAAC,QACA,SAAAF,GAOA,QAAAG,GAAAC,GACAC,KAAAC,KAAAF,GAGAD,EAAAI,WAOAC,IAAA,WAOAF,KAAA,SAAAF,GACAC,KAAAI,IAAAT,EAAAI,GAEAC,KAAAI,IAAAC,SAIAL,KAAAM,QACAN,KAAAO,YAQAC,OAAA,SAAAC,GACAA,EAAAC,iBACAf,EAAAc,EAAAE,eAAAC,QAAA,kBAAAC,OACAC,SAAAC,OAAAf,KAAAG,IAAA,sDAMAG,MAAA,WACAN,KAAAI,IAAAY,KAAA,QAAA,gBAAAhB,KAAAQ,OAAAQ,KAAAhB,QAMAO,QAAA,WACA,IAAA,IAAAO,SAAAC,OAAAE,QAAAjB,KAAAG,IAAA,KACA,MAAAH,MAAAI,IAAAS,MAGAb,MAAAI,IAAAc,SAKA,GAAApB,GAAA,gBACAF,OAAAC","file":"cookies.js","sourcesContent":["var $ = window.jQuery;\n(function($) {\n\n /**\n * Cookie box constructor.\n *\n * @param {string} selector\n */\n function CookieBox(selector) {\n this.init(selector);\n }\n\n CookieBox.prototype = {\n\n /**\n * The cookie key.\n *\n * @type {string}\n */\n key: 'transarb',\n\n /**\n * Initialize the module.\n *\n * @param {string} selector\n */\n init: function(selector) {\n this.$el = $(selector);\n\n if (!this.$el.length) {\n return;\n }\n\n this.binds();\n this.showBox();\n },\n\n /**\n * Accept cookie information.\n *\n * @param {object} e\n */\n accept: function(e) {\n e.preventDefault();\n $(e.currentTarget).closest('.alert-message').hide();\n document.cookie = this.key + '=ok; path=/; expires=Fri, 31 Dec 9999 23:59:59 GMT';\n },\n\n /**\n * Bind elements with events.\n */\n binds: function() {\n this.$el.bind('click', '.btn.btn-blue', this.accept.bind(this));\n },\n\n /**\n * Show box if no cookie is set.\n */\n showBox: function() {\n if (document.cookie.indexOf(this.key + '=') !== -1) {\n return this.$el.hide();\n }\n\n this.$el.show();\n }\n\n };\n\n new CookieBox('.cookie-box');\n})(window.jQuery);\n"],"sourceRoot":"assets/scripts/"}