From c184b6b226f82fe9a6ea76305846f54c02ffd8e4 Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Mon, 8 Apr 2019 08:42:44 +0200 Subject: [PATCH] Add new version with id support --- README.md | 5 +++-- build/index.css | 2 +- build/index.css.map | 2 +- build/index.js | 4 ++-- build/index.js.map | 2 +- docs/index.js | 2 +- docs/index.js.map | 2 +- package.json | 2 +- src/docs/App.js | 7 +++++++ src/lib/App.js | 9 +++++---- 10 files changed, 23 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f42c08be..25abdceb 100644 --- a/README.md +++ b/README.md @@ -49,13 +49,14 @@ These are all the options you can use in the constructor: ```js new HelloBar({ + id: "", // A unique ID for this hello bar content (required for targeting) text: "", // Text you want the banner to display hideClose: false, // Set to `true` to hide close button position: "top", // Set to "bottom" to have the bar in the bottom instead of top fixed: false, // Set to `true` to set the position as fixed (on scroll) move: null, // Element(s) to force add margin-top to, in case you have any absolutely positioned elements - duration: 500, // Animation duration in miliseconds - delay: 1, // Delay in miliseconds + duration: 500, // Animation duration in ms + delay: 1, // Delay in ms align: "center", // Text alignment in CSS ("left", "right", or "center") background: "#eee", // Background color textColor: null, // Black or white text is automagically determined; you can specify a color if you like diff --git a/build/index.css b/build/index.css index 340b2957..170c1e36 100644 --- a/build/index.css +++ b/build/index.css @@ -1,6 +1,6 @@ /*! * - * hello-bar v1.2.0 + * hello-bar v1.3.0 * https://github.com/AnandChowdhary/hello-bar * * Copyright (c) Anand Chowdhary (https://github.com/AnandChowdhary) diff --git a/build/index.css.map b/build/index.css.map index ac979128..eeb4624b 100644 --- a/build/index.css.map +++ b/build/index.css.map @@ -1 +1 @@ -{"version":3,"sources":["index.css","App.css"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG,ACVH,WACI,sBAAuB,AACvB,cAAe,AACf,kBAAmB,AACnB,OAAQ,AACR,QAAS,AACT,MAAO,AACP,WAAY,AACZ,aAAc,AACd,oCAA6B,AAA7B,4BAA6B,AAC7B,SAAW,C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1C,wCAA0C,CAAE,AACjD,GAAK,+CAAwC,AAAxC,sCAAwC,CAAE,AAC/C,GAAK,iDAA0C,AAA1C,wCAA0C,CAAE,AACjD,IAAM,+CAAwC,AAAxC,sCAAwC,CAAE,AAChD,IAAM,iDAA0C,AAA1C,wCAA0C,CAAE,AAClD,IAAM,+CAAwC,AAAxC,sCAAwC,CAAE,AAChD,IAAM,iDAA0C,AAA1C,wCAA0C,CAAE,AAClD,IAAM,4CAAqC,AAArC,mCAAqC,CAAE,AAC7C,IAAM,6CAAsC,AAAtC,oCAAsC,CAAE,CACjD,AAXD,4BACI,GAAK,+CAAwC,AAAxC,sCAAwC,CAAE,AAC/C,GAAK,iDAA0C,AAA1C,wCAA0C,CAAE,AACjD,GAAK,+CAAwC,AAAxC,sCAAwC,CAAE,AAC/C,GAAK,iDAA0C,AAA1C,wCAA0C,CAAE,AACjD,IAAM,+CAAwC,AAAxC,sCAAwC,CAAE,AAChD,IAAM,iDAA0C,AAA1C,wCAA0C,CAAE,AAClD,IAAM,+CAAwC,AAAxC,sCAAwC,CAAE,AAChD,IAAM,iDAA0C,AAA1C,wCAA0C,CAAE,AAClD,IAAM,4CAAqC,AAArC,mCAAqC,CAAE,AAC7C,IAAM,6CAAsC,AAAtC,oCAAsC,CAAE,CDkCjD","file":"index.css","sourcesContent":["/*!\n * \n * hello-bar v1.2.0\n * https://github.com/AnandChowdhary/hello-bar\n * \n * Copyright (c) Anand Chowdhary (https://github.com/AnandChowdhary)\n * \n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n * \n */\n.hello-bar {\n box-sizing: border-box;\n font-size: 90%;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n width: 100%;\n z-index: 1000;\n -webkit-transform: translateY(-100%);\n transform: translateY(-100%);\n opacity: 0;\n}\n\n.hello-bar.hello-bar.hello-bar--is-bottom {\n top: auto;\n -webkit-transform: translateY(100%);\n transform: translateY(100%);\n bottom: 0;\n}\n\n.hello-bar.hello-bar.hello-bar--is-visible {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n opacity: 1;\n}\n\n.hello-bar .hello-bar-container {\n overflow-y: hidden;\n margin-right: 1.5rem;\n overflow-x: auto;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 2rem;\n}\n\n.hello-bar p.hello-bar-text {\n margin: 0 auto;\n text-align: inherit;\n max-width: 100%;\n line-height: 1;\n white-space: nowrap;\n}\n\n.hello-bar p.hello-bar-text .cta {\n text-decoration: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background: none;\n display: inline-block;\n vertical-align: middle;\n width: auto;\n border: none;\n padding: 0.3rem 1rem;\n border: 0.3rem solid;\n border-radius: 10rem;\n font: inherit;\n font-weight: bold;\n text-transform: uppercase;\n line-height: 1;\n margin-left: 0.5rem;\n}\n\n.hello-bar a {\n color: inherit;\n font-weight: bold;\n}\n.hello-bar .hello-bar-text--after {\n position: absolute;\n right: 1rem;\n z-index: 1;\n top: 0;\n bottom: 0;\n width: 3rem;\n}\n\n.hello-bar.hello-bar--is-fixed {\n position: fixed;\n}\n\n.hello-bar button.hello-bar-button {\n position: absolute;\n right: 0;\n top: 50%;\n z-index: 2;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%);\n line-height: 1;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background: none;\n border: none;\n padding: 0 0.75rem;\n margin: 0;\n width: auto;\n color: inherit;\n}\n.hello-bar button.hello-bar-button svg {\n height: 1rem;\n}\n\n.hello-bar.hello-bar--size-large {\n font-size: 120%;\n}\n.hello-bar.hello-bar--size-large .hello-bar-container {\n height: 4rem;\n}\n.hello-bar.hello-bar--size-large p.hello-bar-text .cta {\n padding: 0.75rem 1.25rem;\n border: 0.5rem solid;\n margin-left: 0.5rem;\n}\n.hello-bar.hello-bar--size-large p.hello-bar-text .cta.wiggle {\n -webkit-animation: hello-bar-wiggle 5s infinite;\n animation: hello-bar-wiggle 5s infinite;\n}\n\n.hello-bar.hello-bar--size-large button.hello-bar-button svg {\n height: 1.33rem;\n}\n\n.hello-bar.hello-bar--is-multiline .hello-bar-container {\n height: auto;\n padding: 0.5rem 0;\n}\n.hello-bar.hello-bar--is-multiline p.hello-bar-text {\n white-space: normal;\n line-height: inherit;\n}\n\n@-webkit-keyframes hello-bar-wiggle {\n 2% { -webkit-transform: translateX(3px) rotate(2deg); transform: translateX(3px) rotate(2deg); }\n 4% { -webkit-transform: translateX(-3px) rotate(-2deg); transform: translateX(-3px) rotate(-2deg); }\n 6% { -webkit-transform: translateX(3px) rotate(2deg); transform: translateX(3px) rotate(2deg); }\n 8% { -webkit-transform: translateX(-3px) rotate(-2deg); transform: translateX(-3px) rotate(-2deg); }\n 10% { -webkit-transform: translateX(2px) rotate(1deg); transform: translateX(2px) rotate(1deg); }\n 12% { -webkit-transform: translateX(-2px) rotate(-1deg); transform: translateX(-2px) rotate(-1deg); }\n 14% { -webkit-transform: translateX(2px) rotate(1deg); transform: translateX(2px) rotate(1deg); }\n 16% { -webkit-transform: translateX(-2px) rotate(-1deg); transform: translateX(-2px) rotate(-1deg); }\n 18% { -webkit-transform: translateX(1px) rotate(0); transform: translateX(1px) rotate(0); }\n 20% { -webkit-transform: translateX(-1px) rotate(0); transform: translateX(-1px) rotate(0); }\n}\n\n@keyframes hello-bar-wiggle {\n 2% { -webkit-transform: translateX(3px) rotate(2deg); transform: translateX(3px) rotate(2deg); }\n 4% { -webkit-transform: translateX(-3px) rotate(-2deg); transform: translateX(-3px) rotate(-2deg); }\n 6% { -webkit-transform: translateX(3px) rotate(2deg); transform: translateX(3px) rotate(2deg); }\n 8% { -webkit-transform: translateX(-3px) rotate(-2deg); transform: translateX(-3px) rotate(-2deg); }\n 10% { -webkit-transform: translateX(2px) rotate(1deg); transform: translateX(2px) rotate(1deg); }\n 12% { -webkit-transform: translateX(-2px) rotate(-1deg); transform: translateX(-2px) rotate(-1deg); }\n 14% { -webkit-transform: translateX(2px) rotate(1deg); transform: translateX(2px) rotate(1deg); }\n 16% { -webkit-transform: translateX(-2px) rotate(-1deg); transform: translateX(-2px) rotate(-1deg); }\n 18% { -webkit-transform: translateX(1px) rotate(0); transform: translateX(1px) rotate(0); }\n 20% { -webkit-transform: translateX(-1px) rotate(0); transform: translateX(-1px) rotate(0); }\n}\n",".hello-bar {\n box-sizing: border-box;\n font-size: 90%;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n width: 100%;\n z-index: 1000;\n transform: translateY(-100%);\n opacity: 0;\n}\n\n.hello-bar.hello-bar.hello-bar--is-bottom {\n top: auto;\n transform: translateY(100%);\n bottom: 0;\n}\n\n.hello-bar.hello-bar.hello-bar--is-visible {\n transform: translateY(0);\n opacity: 1;\n}\n\n.hello-bar .hello-bar-container {\n overflow-y: hidden;\n margin-right: 1.5rem;\n overflow-x: auto;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 2rem;\n}\n\n.hello-bar p.hello-bar-text {\n margin: 0 auto;\n text-align: inherit;\n max-width: 100%;\n line-height: 1;\n white-space: nowrap;\n}\n\n.hello-bar p.hello-bar-text .cta {\n text-decoration: none;\n appearance: none;\n background: none;\n display: inline-block;\n vertical-align: middle;\n width: auto;\n border: none;\n padding: 0.3rem 1rem;\n border: 0.3rem solid;\n border-radius: 10rem;\n font: inherit;\n font-weight: bold;\n text-transform: uppercase;\n line-height: 1;\n margin-left: 0.5rem;\n}\n\n.hello-bar a {\n color: inherit;\n font-weight: bold;\n}\n.hello-bar .hello-bar-text--after {\n position: absolute;\n right: 1rem;\n z-index: 1;\n top: 0;\n bottom: 0;\n width: 3rem;\n}\n\n.hello-bar.hello-bar--is-fixed {\n position: fixed;\n}\n\n.hello-bar button.hello-bar-button {\n position: absolute;\n right: 0;\n top: 50%;\n z-index: 2;\n transform: translateY(-50%);\n line-height: 1;\n appearance: none;\n background: none;\n border: none;\n padding: 0 0.75rem;\n margin: 0;\n width: auto;\n color: inherit;\n}\n.hello-bar button.hello-bar-button svg {\n height: 1rem;\n}\n\n.hello-bar.hello-bar--size-large {\n font-size: 120%;\n}\n.hello-bar.hello-bar--size-large .hello-bar-container {\n height: 4rem;\n}\n.hello-bar.hello-bar--size-large p.hello-bar-text .cta {\n padding: 0.75rem 1.25rem;\n border: 0.5rem solid;\n margin-left: 0.5rem;\n}\n.hello-bar.hello-bar--size-large p.hello-bar-text .cta.wiggle {\n animation: hello-bar-wiggle 5s infinite;\n}\n\n.hello-bar.hello-bar--size-large button.hello-bar-button svg {\n height: 1.33rem;\n}\n\n.hello-bar.hello-bar--is-multiline .hello-bar-container {\n height: auto;\n padding: 0.5rem 0;\n}\n.hello-bar.hello-bar--is-multiline p.hello-bar-text {\n white-space: normal;\n line-height: inherit;\n}\n\n@keyframes hello-bar-wiggle {\n 2% { transform: translateX(3px) rotate(2deg); }\n 4% { transform: translateX(-3px) rotate(-2deg); }\n 6% { transform: translateX(3px) rotate(2deg); }\n 8% { transform: translateX(-3px) rotate(-2deg); }\n 10% { transform: translateX(2px) rotate(1deg); }\n 12% { transform: translateX(-2px) rotate(-1deg); }\n 14% { transform: translateX(2px) rotate(1deg); }\n 16% { transform: translateX(-2px) rotate(-1deg); }\n 18% { transform: translateX(1px) rotate(0); }\n 20% { transform: translateX(-1px) rotate(0); }\n}"]} \ No newline at end of file +{"version":3,"sources":["index.css","App.css"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG,ACVH,WACI,sBAAuB,AACvB,cAAe,AACf,kBAAmB,AACnB,OAAQ,AACR,QAAS,AACT,MAAO,AACP,WAAY,AACZ,aAAc,AACd,oCAA6B,AAA7B,4BAA6B,AAC7B,SAAW,CACd,AAED,0CACI,SAAU,AACV,mCAA4B,AAA5B,2BAA4B,AAC5B,QAAU,CACb,AAED,2CACI,gCAAyB,AAAzB,wBAAyB,AACzB,SAAW,CACd,AAED,gCACI,kBAAmB,AACnB,oBAAqB,AACrB,gBAAiB,AACjB,aAAc,AACd,sBAAuB,AACvB,uBAAwB,AACxB,WAAa,CAChB,AAED,4BACI,cAAe,AACf,mBAA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AA1C,wCAA0C,CAAE,AAClD,IAAM,4CAAqC,AAArC,mCAAqC,CAAE,AAC7C,IAAM,6CAAsC,AAAtC,oCAAsC,CAAE,CACjD,AAXD,4BACI,GAAK,+CAAwC,AAAxC,sCAAwC,CAAE,AAC/C,GAAK,iDAA0C,AAA1C,wCAA0C,CAAE,AACjD,GAAK,+CAAwC,AAAxC,sCAAwC,CAAE,AAC/C,GAAK,iDAA0C,AAA1C,wCAA0C,CAAE,AACjD,IAAM,+CAAwC,AAAxC,sCAAwC,CAAE,AAChD,IAAM,iDAA0C,AAA1C,wCAA0C,CAAE,AAClD,IAAM,+CAAwC,AAAxC,sCAAwC,CAAE,AAChD,IAAM,iDAA0C,AAA1C,wCAA0C,CAAE,AAClD,IAAM,4CAAqC,AAArC,mCAAqC,CAAE,AAC7C,IAAM,6CAAsC,AAAtC,oCAAsC,CAAE,CDkCjD","file":"index.css","sourcesContent":["/*!\n * \n * hello-bar v1.3.0\n * https://github.com/AnandChowdhary/hello-bar\n * \n * Copyright (c) Anand Chowdhary (https://github.com/AnandChowdhary)\n * \n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n * \n */\n.hello-bar {\n box-sizing: border-box;\n font-size: 90%;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n width: 100%;\n z-index: 1000;\n -webkit-transform: translateY(-100%);\n transform: translateY(-100%);\n opacity: 0;\n}\n\n.hello-bar.hello-bar.hello-bar--is-bottom {\n top: auto;\n -webkit-transform: translateY(100%);\n transform: translateY(100%);\n bottom: 0;\n}\n\n.hello-bar.hello-bar.hello-bar--is-visible {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n opacity: 1;\n}\n\n.hello-bar .hello-bar-container {\n overflow-y: hidden;\n margin-right: 1.5rem;\n overflow-x: auto;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 2rem;\n}\n\n.hello-bar p.hello-bar-text {\n margin: 0 auto;\n text-align: inherit;\n max-width: 100%;\n line-height: 1;\n white-space: nowrap;\n}\n\n.hello-bar p.hello-bar-text .cta {\n text-decoration: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background: none;\n display: inline-block;\n vertical-align: middle;\n width: auto;\n border: none;\n padding: 0.3rem 1rem;\n border: 0.3rem solid;\n border-radius: 10rem;\n font: inherit;\n font-weight: bold;\n text-transform: uppercase;\n line-height: 1;\n margin-left: 0.5rem;\n}\n\n.hello-bar a {\n color: inherit;\n font-weight: bold;\n}\n.hello-bar .hello-bar-text--after {\n position: absolute;\n right: 1rem;\n z-index: 1;\n top: 0;\n bottom: 0;\n width: 3rem;\n}\n\n.hello-bar.hello-bar--is-fixed {\n position: fixed;\n}\n\n.hello-bar button.hello-bar-button {\n position: absolute;\n right: 0;\n top: 50%;\n z-index: 2;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%);\n line-height: 1;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background: none;\n border: none;\n padding: 0 0.75rem;\n margin: 0;\n width: auto;\n color: inherit;\n}\n.hello-bar button.hello-bar-button svg {\n height: 1rem;\n}\n\n.hello-bar.hello-bar--size-large {\n font-size: 120%;\n}\n.hello-bar.hello-bar--size-large .hello-bar-container {\n height: 4rem;\n}\n.hello-bar.hello-bar--size-large p.hello-bar-text .cta {\n padding: 0.75rem 1.25rem;\n border: 0.5rem solid;\n margin-left: 0.5rem;\n}\n.hello-bar.hello-bar--size-large p.hello-bar-text .cta.wiggle {\n -webkit-animation: hello-bar-wiggle 5s infinite;\n animation: hello-bar-wiggle 5s infinite;\n}\n\n.hello-bar.hello-bar--size-large button.hello-bar-button svg {\n height: 1.33rem;\n}\n\n.hello-bar.hello-bar--is-multiline .hello-bar-container {\n height: auto;\n padding: 0.5rem 0;\n}\n.hello-bar.hello-bar--is-multiline p.hello-bar-text {\n white-space: normal;\n line-height: inherit;\n}\n\n@-webkit-keyframes hello-bar-wiggle {\n 2% { -webkit-transform: translateX(3px) rotate(2deg); transform: translateX(3px) rotate(2deg); }\n 4% { -webkit-transform: translateX(-3px) rotate(-2deg); transform: translateX(-3px) rotate(-2deg); }\n 6% { -webkit-transform: translateX(3px) rotate(2deg); transform: translateX(3px) rotate(2deg); }\n 8% { -webkit-transform: translateX(-3px) rotate(-2deg); transform: translateX(-3px) rotate(-2deg); }\n 10% { -webkit-transform: translateX(2px) rotate(1deg); transform: translateX(2px) rotate(1deg); }\n 12% { -webkit-transform: translateX(-2px) rotate(-1deg); transform: translateX(-2px) rotate(-1deg); }\n 14% { -webkit-transform: translateX(2px) rotate(1deg); transform: translateX(2px) rotate(1deg); }\n 16% { -webkit-transform: translateX(-2px) rotate(-1deg); transform: translateX(-2px) rotate(-1deg); }\n 18% { -webkit-transform: translateX(1px) rotate(0); transform: translateX(1px) rotate(0); }\n 20% { -webkit-transform: translateX(-1px) rotate(0); transform: translateX(-1px) rotate(0); }\n}\n\n@keyframes hello-bar-wiggle {\n 2% { -webkit-transform: translateX(3px) rotate(2deg); transform: translateX(3px) rotate(2deg); }\n 4% { -webkit-transform: translateX(-3px) rotate(-2deg); transform: translateX(-3px) rotate(-2deg); }\n 6% { -webkit-transform: translateX(3px) rotate(2deg); transform: translateX(3px) rotate(2deg); }\n 8% { -webkit-transform: translateX(-3px) rotate(-2deg); transform: translateX(-3px) rotate(-2deg); }\n 10% { -webkit-transform: translateX(2px) rotate(1deg); transform: translateX(2px) rotate(1deg); }\n 12% { -webkit-transform: translateX(-2px) rotate(-1deg); transform: translateX(-2px) rotate(-1deg); }\n 14% { -webkit-transform: translateX(2px) rotate(1deg); transform: translateX(2px) rotate(1deg); }\n 16% { -webkit-transform: translateX(-2px) rotate(-1deg); transform: translateX(-2px) rotate(-1deg); }\n 18% { -webkit-transform: translateX(1px) rotate(0); transform: translateX(1px) rotate(0); }\n 20% { -webkit-transform: translateX(-1px) rotate(0); transform: translateX(-1px) rotate(0); }\n}\n",".hello-bar {\n box-sizing: border-box;\n font-size: 90%;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n width: 100%;\n z-index: 1000;\n transform: translateY(-100%);\n opacity: 0;\n}\n\n.hello-bar.hello-bar.hello-bar--is-bottom {\n top: auto;\n transform: translateY(100%);\n bottom: 0;\n}\n\n.hello-bar.hello-bar.hello-bar--is-visible {\n transform: translateY(0);\n opacity: 1;\n}\n\n.hello-bar .hello-bar-container {\n overflow-y: hidden;\n margin-right: 1.5rem;\n overflow-x: auto;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 2rem;\n}\n\n.hello-bar p.hello-bar-text {\n margin: 0 auto;\n text-align: inherit;\n max-width: 100%;\n line-height: 1;\n white-space: nowrap;\n}\n\n.hello-bar p.hello-bar-text .cta {\n text-decoration: none;\n appearance: none;\n background: none;\n display: inline-block;\n vertical-align: middle;\n width: auto;\n border: none;\n padding: 0.3rem 1rem;\n border: 0.3rem solid;\n border-radius: 10rem;\n font: inherit;\n font-weight: bold;\n text-transform: uppercase;\n line-height: 1;\n margin-left: 0.5rem;\n}\n\n.hello-bar a {\n color: inherit;\n font-weight: bold;\n}\n.hello-bar .hello-bar-text--after {\n position: absolute;\n right: 1rem;\n z-index: 1;\n top: 0;\n bottom: 0;\n width: 3rem;\n}\n\n.hello-bar.hello-bar--is-fixed {\n position: fixed;\n}\n\n.hello-bar button.hello-bar-button {\n position: absolute;\n right: 0;\n top: 50%;\n z-index: 2;\n transform: translateY(-50%);\n line-height: 1;\n appearance: none;\n background: none;\n border: none;\n padding: 0 0.75rem;\n margin: 0;\n width: auto;\n color: inherit;\n}\n.hello-bar button.hello-bar-button svg {\n height: 1rem;\n}\n\n.hello-bar.hello-bar--size-large {\n font-size: 120%;\n}\n.hello-bar.hello-bar--size-large .hello-bar-container {\n height: 4rem;\n}\n.hello-bar.hello-bar--size-large p.hello-bar-text .cta {\n padding: 0.75rem 1.25rem;\n border: 0.5rem solid;\n margin-left: 0.5rem;\n}\n.hello-bar.hello-bar--size-large p.hello-bar-text .cta.wiggle {\n animation: hello-bar-wiggle 5s infinite;\n}\n\n.hello-bar.hello-bar--size-large button.hello-bar-button svg {\n height: 1.33rem;\n}\n\n.hello-bar.hello-bar--is-multiline .hello-bar-container {\n height: auto;\n padding: 0.5rem 0;\n}\n.hello-bar.hello-bar--is-multiline p.hello-bar-text {\n white-space: normal;\n line-height: inherit;\n}\n\n@keyframes hello-bar-wiggle {\n 2% { transform: translateX(3px) rotate(2deg); }\n 4% { transform: translateX(-3px) rotate(-2deg); }\n 6% { transform: translateX(3px) rotate(2deg); }\n 8% { transform: translateX(-3px) rotate(-2deg); }\n 10% { transform: translateX(2px) rotate(1deg); }\n 12% { transform: translateX(-2px) rotate(-1deg); }\n 14% { transform: translateX(2px) rotate(1deg); }\n 16% { transform: translateX(-2px) rotate(-1deg); }\n 18% { transform: translateX(1px) rotate(0); }\n 20% { transform: translateX(-1px) rotate(0); }\n}"]} \ No newline at end of file diff --git a/build/index.js b/build/index.js index 85954154..d1dac54d 100644 --- a/build/index.js +++ b/build/index.js @@ -1,6 +1,6 @@ /*! * - * hello-bar v1.2.0 + * hello-bar v1.3.0 * https://github.com/AnandChowdhary/hello-bar * * Copyright (c) Anand Chowdhary (https://github.com/AnandChowdhary) @@ -9,5 +9,5 @@ * LICENSE file in the root directory of this source tree. * */ -!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define("HelloBar",[],e):"object"===typeof exports?exports.HelloBar=e():t.HelloBar=e()}(window,function(){return function(t){var e={};function __webpack_require__(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}return __webpack_require__.m=t,__webpack_require__.c=e,__webpack_require__.d=function(t,e,n){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},__webpack_require__.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(t,e){if(1&e&&(t=__webpack_require__(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)__webpack_require__.d(n,i,function(e){return t[e]}.bind(null,i));return n},__webpack_require__.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=2)}([function(t,e){t.exports=function(t,e,i){var r=/#/.test(t),o=void 0!==e&&void 0!==i,s=Array.isArray(t),a="#ffffff",c=0;if(r)c=n(t.substr(1,2)),e=n(t.substr(3,2)),i=n(t.substr(5,2));else if(o)c=parseInt(t),e=parseInt(e),i=parseInt(i);else{if(!s)return a;c=parseInt(t[0]),e=parseInt(t[1]),i=parseInt(t[2])}return Math.sqrt(c*c*.241+e*e*.691+i*i*.068)>130&&(a="#000000"),a};var n=function(t){var e=t.replace(/[^a-f0-9]/gi,"");return parseInt(e,16)}},function(t,e){function debounce(t,e,n){var i,r,o,s,a;function later(){var c=Date.now()-s;c=0?i=setTimeout(later,e-c):(i=null,n||(a=t.apply(o,r),o=r=null))}null==e&&(e=100);var c=function(){o=this,r=arguments,s=Date.now();var c=n&&!i;return i||(i=setTimeout(later,e)),c&&(a=t.apply(o,r),o=r=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=t.apply(o,r),o=r=null,clearTimeout(i),i=null)},c}debounce.debounce=debounce,t.exports=debounce},function(t,e,n){t.exports=n(4)},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(3);var i=n(0),r=n.n(i),o=n(1),s=n.n(o),a=["BE","BG","CZ","DK","DE","EE","IE","EL","ES","FR","HR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","UK"];function _typeof(t){return(_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperties(t,e){for(var n=0;n

'.concat(this.text,'

'),this.settings.hideClose||(this.bar.innerHTML+='')),this.bar.classList.add("hello-bar"),this.settings.fixed&&this.bar.classList.add("hello-bar--is-fixed"),this.settings.multiline&&this.bar.classList.add("hello-bar--is-multiline"),"bottom"===this.settings.position?(this.bar.classList.add("hello-bar--is-bottom"),this.marginProp="marginBottom"):this.marginProp="marginTop",this.events={},window.addEventListener("resize",s()(function(){document.querySelector("#".concat(e.id))&&(e.$emit("window-resize"),e.unMove(),e.settings.disableBodyMove||e.moveElements(document.body),e.moveElements(e.settings.move),e.colorizeBar())},200)),this.confirmShow().then(function(){e.$emit("before-created"),e.insertBar(),e.functionBar(),e.calculateHeight(),e.colorizeBar(),e.settings.disableBodyMove||e.moveElements(document.body),e.moveElements(e.settings.move),e.showBar(),e.$emit("after-created")}).catch(function(){e.$emit("not-created")})}var t,e,n;return t=App,(e=[{key:"on",value:function(t,e){this.events[t]=e}},{key:"$emit",value:function(t,e){this.events[t]&&"function"===typeof this.events[t]&&this.events[t](e)}},{key:"confirmShow",value:function(){var t=this;return new Promise(function(e,n){var i=function(){if(t.settings.targeting.once&&sessionStorage.getItem("hello-bar--session-showed"))return n();if(t.settings.targeting.onceUser&&localStorage.getItem("hello-bar--user-showed"))return n();if(Object.keys(t.settings.targeting.time).length){var i={year:"getFullYear",month:"getMonth",day:"getDate",dayOfWeek:"getDay",hour:"getHours",minute:"getMinutes",second:"getSeconds"},r=["getMonth","getDay"];["year","month","day","hour","minute","second"].forEach(function(e){var o=new Date;if(t.settings.targeting.time.after[e]){var s=o[i[e]]();if(r.includes(e)&&(s+=1),s<=t.settings.targeting.time.after[e])return n()}if(t.settings.targeting.time.before[e]){var a=o[i[e]]();if(r.includes(e)&&(a+=1),a>=t.settings.targeting.time.after[e])return n()}})}return t.settings.targeting.params&&Object.keys(t.settings.targeting.params).forEach(function(e){var i=function(t){var e=window.location.href;t=t.replace(/[[\]]/g,"\\$&");var n=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);if(n&&n[2])return decodeURIComponent(n[2].replace(/\+/g," "))}(e);if(i&&i!==t.settings.targeting.params[e])return n()}),t.settings.targeting.pathname&&window.location.pathname!==t.settings.targeting.pathname?n():t.settings.targeting.href&&window.location.href!==t.settings.targeting.href?n():void e()};if(t.settings.hide)return n();Object.keys(t.settings.targeting.location).length?t.getIpInfo().then(function(e){if(t.settings.targeting.location.eu&&!a.includes(e.country))return n();["country","city","ip","postal","region"].forEach(function(i){if(t.settings.targeting.location[i]&&t.settings.targeting.location[i].constructor===Array&&!t.settings.targeting.location[i].includes(e[i]))return n()}),i()}):i()})}},{key:"showBar",value:function(){var t=this;document.querySelector("#".concat(this.id))&&(this.bar.style.transition=(this.settings.duration||500)+"ms",setTimeout(function(){t.bar.classList.add("hello-bar--is-visible")},this.settings.delay||1),this.$emit("show-bar",this.bar))}},{key:"unMove",value:function(){for(var t=document.querySelectorAll(".hello-bar--has-moved"),e=0;e *");t?document.body.insertBefore(this.bar,t):document.body.appendChild(this.bar),this.$emit("created",this.bar)}},{key:"moveElements",value:function(t){if(t)if("string"===typeof t)for(var e=document.querySelectorAll(t),n=0;n(new Date).getTime())return t(o.cache_value)}catch(s){}fetch(i,r).then(function(t){return t.json()}).then(function(e){localStorage.setItem(n,JSON.stringify({created_at:(new Date).getTime(),expires_at:(new Date).getTime()+6048e5,cache_value:e})),t(e)}).catch(function(t){return e(t)})})).then(function(n){t.$emit("fetch-ip-info",n),e(n)}).catch(function(e){t.$emit("error-ip-info",e),n(e)})})}}])&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),App}();e.default=c}])}); +!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define("HelloBar",[],e):"object"===typeof exports?exports.HelloBar=e():t.HelloBar=e()}(window,function(){return function(t){var e={};function __webpack_require__(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}return __webpack_require__.m=t,__webpack_require__.c=e,__webpack_require__.d=function(t,e,i){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},__webpack_require__.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(t,e){if(1&e&&(t=__webpack_require__(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(__webpack_require__.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)__webpack_require__.d(i,n,function(e){return t[e]}.bind(null,n));return i},__webpack_require__.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=2)}([function(t,e){t.exports=function(t,e,n){var r=/#/.test(t),o=void 0!==e&&void 0!==n,s=Array.isArray(t),a="#ffffff",c=0;if(r)c=i(t.substr(1,2)),e=i(t.substr(3,2)),n=i(t.substr(5,2));else if(o)c=parseInt(t),e=parseInt(e),n=parseInt(n);else{if(!s)return a;c=parseInt(t[0]),e=parseInt(t[1]),n=parseInt(t[2])}return Math.sqrt(c*c*.241+e*e*.691+n*n*.068)>130&&(a="#000000"),a};var i=function(t){var e=t.replace(/[^a-f0-9]/gi,"");return parseInt(e,16)}},function(t,e){function debounce(t,e,i){var n,r,o,s,a;function later(){var c=Date.now()-s;c=0?n=setTimeout(later,e-c):(n=null,i||(a=t.apply(o,r),o=r=null))}null==e&&(e=100);var c=function(){o=this,r=arguments,s=Date.now();var c=i&&!n;return n||(n=setTimeout(later,e)),c&&(a=t.apply(o,r),o=r=null),a};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(a=t.apply(o,r),o=r=null,clearTimeout(n),n=null)},c}debounce.debounce=debounce,t.exports=debounce},function(t,e,i){t.exports=i(4)},function(t,e,i){},function(t,e,i){"use strict";i.r(e);i(3);var n=i(0),r=i.n(n),o=i(1),s=i.n(o),a=["BE","BG","CZ","DK","DE","EE","IE","EL","ES","FR","HR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","UK"];function _typeof(t){return(_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperties(t,e){for(var i=0;i

'.concat(this.text,'

'),this.settings.hideClose||(this.bar.innerHTML+='')),this.bar.classList.add("hello-bar"),this.settings.fixed&&this.bar.classList.add("hello-bar--is-fixed"),this.settings.multiline&&this.bar.classList.add("hello-bar--is-multiline"),"bottom"===this.settings.position?(this.bar.classList.add("hello-bar--is-bottom"),this.marginProp="marginBottom"):this.marginProp="marginTop",this.events={},window.addEventListener("resize",s()(function(){document.querySelector("#".concat(e.id))&&(e.$emit("window-resize"),e.unMove(),e.settings.disableBodyMove||e.moveElements(document.body),e.moveElements(e.settings.move),e.colorizeBar())},200)),this.confirmShow().then(function(){e.$emit("before-created"),e.insertBar(),e.functionBar(),e.calculateHeight(),e.colorizeBar(),e.settings.disableBodyMove||e.moveElements(document.body),e.moveElements(e.settings.move),e.showBar(),e.$emit("after-created")}).catch(function(){e.$emit("not-created")})}var t,e,i;return t=App,(e=[{key:"on",value:function(t,e){this.events[t]=e}},{key:"$emit",value:function(t,e){this.events[t]&&"function"===typeof this.events[t]&&this.events[t](e)}},{key:"confirmShow",value:function(){var t=this;return new Promise(function(e,i){var n=function(){if(t.settings.targeting.once&&sessionStorage.getItem("hello-bar-".concat(t.id,"--session-showed")))return i();if(t.settings.targeting.onceUser&&localStorage.getItem("hello-bar-".concat(t.id,"--user-showed")))return i();if(Object.keys(t.settings.targeting.time).length){var n={year:"getFullYear",month:"getMonth",day:"getDate",dayOfWeek:"getDay",hour:"getHours",minute:"getMinutes",second:"getSeconds"},r=["getMonth","getDay"];["year","month","day","hour","minute","second"].forEach(function(e){var o=new Date;if(t.settings.targeting.time.after[e]){var s=o[n[e]]();if(r.includes(e)&&(s+=1),s<=t.settings.targeting.time.after[e])return i()}if(t.settings.targeting.time.before[e]){var a=o[n[e]]();if(r.includes(e)&&(a+=1),a>=t.settings.targeting.time.after[e])return i()}})}return t.settings.targeting.params&&Object.keys(t.settings.targeting.params).forEach(function(e){var n=function(t){var e=window.location.href;t=t.replace(/[[\]]/g,"\\$&");var i=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);if(i&&i[2])return decodeURIComponent(i[2].replace(/\+/g," "))}(e);if(n&&n!==t.settings.targeting.params[e])return i()}),t.settings.targeting.pathname&&window.location.pathname!==t.settings.targeting.pathname?i():t.settings.targeting.href&&window.location.href!==t.settings.targeting.href?i():void e()};if(t.settings.hide)return i();Object.keys(t.settings.targeting.location).length?t.getIpInfo().then(function(e){if(t.settings.targeting.location.eu&&!a.includes(e.country))return i();["country","city","ip","postal","region"].forEach(function(n){if(t.settings.targeting.location[n]&&t.settings.targeting.location[n].constructor===Array&&!t.settings.targeting.location[n].includes(e[n]))return i()}),n()}):n()})}},{key:"showBar",value:function(){var t=this;document.querySelector("#".concat(this.id))&&(this.bar.style.transition=(this.settings.duration||500)+"ms",setTimeout(function(){t.bar.classList.add("hello-bar--is-visible")},this.settings.delay||1),this.$emit("show-bar",this.bar))}},{key:"unMove",value:function(){for(var t=document.querySelectorAll(".hello-bar--has-moved"),e=0;e *");t?document.body.insertBefore(this.bar,t):document.body.appendChild(this.bar),this.$emit("created",this.bar)}},{key:"moveElements",value:function(t){if(t)if("string"===typeof t)for(var e=document.querySelectorAll(t),i=0;i(new Date).getTime())return t(o.cache_value)}catch(s){}fetch(n,r).then(function(t){return t.json()}).then(function(e){localStorage.setItem(i,JSON.stringify({created_at:(new Date).getTime(),expires_at:(new Date).getTime()+6048e5,cache_value:e})),t(e)}).catch(function(t){return e(t)})})).then(function(i){t.$emit("fetch-ip-info",i),e(i)}).catch(function(e){t.$emit("error-ip-info",e),i(e)})})}}])&&_defineProperties(t.prototype,e),i&&_defineProperties(t,i),App}();e.default=c}])}); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/index.js.map b/build/index.js.map index f061fbcf..fc95dcf2 100644 --- a/build/index.js.map +++ b/build/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../webpack/universalModuleDefinition","../../webpack/bootstrap","../../node_modules/font-color-contrast/font-color-contrast.js","../../node_modules/debounce/index.js","euCountries.js","App.js","getParameterByName.js","cachedFetch.js","index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","hexColorOrRedOrArray","green","blue","isHex","test","isRGB","undefined","isArray","Array","fontColor","red","hexToDec","substr","parseInt","Math","sqrt","hexString","decString","replace","debounce","func","wait","immediate","timeout","args","context","timestamp","result","later","last","Date","now","setTimeout","apply","debounced","this","arguments","callNow","clear","clearTimeout","flush","euCountries","App","settings","_this","_classCallCheck","forEach","category","targeting","location","params","time","before","after","id","random","toString","bar","document","createElement","setAttribute","_typeof","text","floor","length","innerHTML","concat","hideClose","i18n","hideText","classList","add","fixed","multiline","position","marginProp","events","addEventListener","querySelector","$emit","unMove","disableBodyMove","moveElements","body","move","colorizeBar","confirmShow","then","insertBar","functionBar","calculateHeight","showBar","catch","eventName","callback","_this2","Promise","resolve","reject","finishConfirmation","once","sessionStorage","getItem","onceUser","localStorage","keys","timeMatches","year","month","day","dayOfWeek","hour","minute","second","addValue","dateType","timeNow","currentValue","includes","param","paramValue","url","href","results","RegExp","exec","decodeURIComponent","getParameterByName","pathname","hide","getIpInfo","geolocation","eu","country","targetOptions","constructor","_this3","style","transition","duration","delay","movedElements","querySelectorAll","currentMargin","height","remove","_this4","setItem","parentNode","removeChild","_this5","hideBar","eventMatches","mouseenter","mouseleave","click","mouseup","mousedown","cta","event","backgroundColor","background","textColor","fontColorContrast","color","textAlign","align","size","getBoundingClientRect","offsetHeight","firstChild","insertBefore","appendChild","elements","allElements","contains","currentStyle","getComputedStyle","_this6","options","ipEndpoint","cacheKey","JSON","stringify","cacheObject","parse","expires_at","getTime","cache_value","e","fetch","response","json","created_at","error"],"mappings":";;;;;;;;;;;CAAA,SAAAA,EAAAC,GACA,kBAAAC,SAAA,kBAAAC,OACAA,OAAAD,QAAAD,IACA,oBAAAG,eAAAC,IACAD,OAAA,cAAAH,GACA,kBAAAC,QACAA,QAAA,SAAAD,IAEAD,EAAA,SAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,oBAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAT,QAAA,IAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,qBAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,oBAAAM,EAAAF,EAGAJ,oBAAAO,EAAAR,EAGAC,oBAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,oBAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,oBAAAgB,EAAA,SAAAtB,GACA,qBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,EAAA,cAAiDyB,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ACpB,IAAMmF,EAAQ,mBAAAnH,OAAsBuD,GAAtBvD,OACZiH,EAAU,IAAMG,KAAKC,UAAUJ,GAAW,IAE5C,GAAI3E,aAAaF,QAAQ+E,GACvB,IACE,IAAMG,EAAcF,KAAKG,MAAMjF,aAAaF,QAAQ+E,IACpD,GAAIG,EAAYE,YAAa,IAAI5J,MAAO6J,UACtC,OAAO1F,EAAQuF,EAAYI,aAC7B,MAAOC,IAEXC,MAAMrE,EAAK0D,GACR5F,KAAK,SAAAwG,GAAQ,OAAIA,EAASC,SAC1BzG,KAAK,SAAAyG,GACJxF,aAAa2C,QACXkC,EACAC,KAAKC,UAAU,CACbU,YAAY,IAAInK,MAAO6J,UACvBD,YAAY,IAAI5J,MAAO6J,UAAY,OACnCC,YAAaI,KAGjB/F,EAAQ+F,KAETpG,MAAM,SAAAsG,GAAK,OAAIhG,EAAOgG,QFySpB3G,KAAK,SAAAyG,GACJd,EAAKnG,MAAM,gBAAiBiH,GAC5B/F,EAAQ+F,KAETpG,MAAM,SAAAsG,GACLhB,EAAKnG,MAAM,gBAAiBmH,GAC5BhG,EAAOgG,8EG5UFxJ","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"HelloBar\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"HelloBar\"] = factory();\n\telse\n\t\troot[\"HelloBar\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","var fontColorContrast = function fontColorContrast(hexColorOrRedOrArray, green, blue) {\n // Check if the color is hexadecimal (with hash)\n var hash = /#/;\n var isHex = hash.test(hexColorOrRedOrArray);\n var isRGB = green !== undefined && blue !== undefined ? true : false;\n var isArray = Array.isArray(hexColorOrRedOrArray); //Default is a bright color\n\n var fontColor = '#ffffff';\n var red = 0;\n\n if (isHex) {\n red = hexToDec(hexColorOrRedOrArray.substr(1, 2));\n green = hexToDec(hexColorOrRedOrArray.substr(3, 2));\n blue = hexToDec(hexColorOrRedOrArray.substr(5, 2));\n } else if (isRGB) {\n red = parseInt(hexColorOrRedOrArray);\n green = parseInt(green);\n blue = parseInt(blue);\n } else if (isArray) {\n red = parseInt(hexColorOrRedOrArray[0]);\n green = parseInt(hexColorOrRedOrArray[1]);\n blue = parseInt(hexColorOrRedOrArray[2]);\n } else {\n // Not a color, respond with white color\n return fontColor;\n }\n\n var contrast = Math.sqrt(red * red * .241 + green * green * .691 + blue * blue * .068);\n\n if (contrast > 130) {\n fontColor = '#000000';\n }\n\n return fontColor;\n};\n\nmodule.exports = fontColorContrast;\n\nvar hexToDec = function hexToDec(hexString) {\n var decString = hexString.replace(/[^a-f0-9]/gi, '');\n return parseInt(decString, 16);\n};","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate) {\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n }\n\n ;\n\n var debounced = function debounced() {\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function () {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n debounced.flush = function () {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n}\n\n; // Adds compatibility for ES modules\n\ndebounce.debounce = debounce;\nmodule.exports = debounce;","export default [\n \"BE\",\n \"BG\",\n \"CZ\",\n \"DK\",\n \"DE\",\n \"EE\",\n \"IE\",\n \"EL\",\n \"ES\",\n \"FR\",\n \"HR\",\n \"IT\",\n \"CY\",\n \"LV\",\n \"LT\",\n \"LU\",\n \"HU\",\n \"MT\",\n \"NL\",\n \"AT\",\n \"PL\",\n \"PT\",\n \"RO\",\n \"SI\",\n \"SK\",\n \"FI\",\n \"SE\",\n \"UK\"\n];\n","import \"./css/App.css\";\nimport fontColorContrast from \"font-color-contrast\";\nimport debounce from \"debounce\";\nimport cachedFetch from \"./cachedFetch\";\nimport euCountries from \"./euCountries\";\nimport getParameterByName from \"./getParameterByName\";\n\nclass App {\n constructor(settings) {\n settings = settings || {};\n this.settings = settings;\n [\"i18n\", \"targeting\"].forEach(category => {\n this.settings[category] = this.settings[category] || {};\n });\n this.settings.targeting.location = this.settings.targeting.location || {};\n this.settings.targeting.params = this.settings.targeting.params || {};\n this.settings.targeting.time = this.settings.targeting.time || {};\n this.settings.targeting.time.before = this.settings.targeting.time.before || {};\n this.settings.targeting.time.after = this.settings.targeting.time.after || {};\n this.id =\n \"helloBar_\" +\n Math.random()\n .toString(36)\n .substr(2);\n this.bar = document.createElement(\"div\");\n this.bar.setAttribute(\"id\", this.id);\n if (typeof this.settings.text === \"object\") {\n this.text = this.settings.text[\n Math.floor(Math.random() * this.settings.text.length)\n ];\n } else {\n this.text = this.settings.text;\n }\n this.bar.innerHTML = `

${\n this.text\n }

`;\n if (!this.settings.hideClose) {\n this.bar.innerHTML += ``;\n }\n this.bar.classList.add(\"hello-bar\");\n if (this.settings.fixed) {\n this.bar.classList.add(\"hello-bar--is-fixed\");\n }\n if (this.settings.multiline) {\n this.bar.classList.add(\"hello-bar--is-multiline\");\n }\n if (this.settings.position === \"bottom\") {\n this.bar.classList.add(\"hello-bar--is-bottom\");\n this.marginProp = \"marginBottom\";\n } else {\n this.marginProp = \"marginTop\";\n }\n this.events = {};\n window.addEventListener(\"resize\", debounce(() => {\n if (!document.querySelector(`#${this.id}`)) return;\n this.$emit(\"window-resize\");\n this.unMove();\n if (!this.settings.disableBodyMove) this.moveElements(document.body);\n this.moveElements(this.settings.move);\n this.colorizeBar();\n }, 200));\n this.confirmShow()\n .then(() => {\n this.$emit(\"before-created\");\n this.insertBar();\n this.functionBar();\n this.calculateHeight();\n this.colorizeBar();\n if (!this.settings.disableBodyMove) this.moveElements(document.body);\n this.moveElements(this.settings.move);\n this.showBar();\n this.$emit(\"after-created\");\n })\n .catch(() => {\n this.$emit(\"not-created\");\n });\n }\n\n on(eventName, callback) {\n this.events[eventName] = callback;\n }\n\n $emit(eventName, context) {\n if (this.events[eventName] && typeof this.events[eventName] === \"function\")\n this.events[eventName](context);\n }\n\n confirmShow() {\n return new Promise((resolve, reject) => {\n const finishConfirmation = () => {\n if (this.settings.targeting.once) {\n if (sessionStorage.getItem(\"hello-bar--session-showed\"))\n return reject();\n }\n if (this.settings.targeting.onceUser) {\n if (localStorage.getItem(\"hello-bar--user-showed\")) return reject();\n }\n if (Object.keys(this.settings.targeting.time).length) {\n const timeMatches = {\n year: \"getFullYear\",\n month: \"getMonth\",\n day: \"getDate\",\n dayOfWeek: \"getDay\",\n hour: \"getHours\",\n minute: \"getMinutes\",\n second: \"getSeconds\",\n };\n const addValue = [\"getMonth\", \"getDay\"];\n [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"].forEach(dateType => {\n const timeNow = new Date();\n if (this.settings.targeting.time.after[dateType]) {\n let currentValue = timeNow[timeMatches[dateType]]();\n if (addValue.includes(dateType)) currentValue += 1;\n if (currentValue <= this.settings.targeting.time.after[dateType]) return reject();\n }\n if (this.settings.targeting.time.before[dateType]) {\n let currentValue = timeNow[timeMatches[dateType]]();\n if (addValue.includes(dateType)) currentValue += 1;\n if (currentValue >= this.settings.targeting.time.after[dateType]) return reject();\n }\n });\n }\n if (this.settings.targeting.params) {\n Object.keys(this.settings.targeting.params).forEach(param => {\n const paramValue = getParameterByName(param);\n if (\n paramValue &&\n paramValue !== this.settings.targeting.params[param]\n )\n return reject();\n });\n }\n if (this.settings.targeting.pathname) {\n if (window.location.pathname !== this.settings.targeting.pathname) return reject();\n }\n if (this.settings.targeting.href) {\n if (window.location.href !== this.settings.targeting.href) return reject();\n }\n resolve();\n };\n if (this.settings.hide) return reject();\n if (Object.keys(this.settings.targeting.location).length) {\n this.getIpInfo().then(geolocation => {\n if (this.settings.targeting.location.eu) {\n if (!euCountries.includes(geolocation.country)) return reject();\n }\n [\"country\", \"city\", \"ip\", \"postal\", \"region\"].forEach(\n targetOptions => {\n if (\n this.settings.targeting.location[targetOptions] &&\n this.settings.targeting.location[targetOptions].constructor ===\n Array\n ) {\n if (\n !this.settings.targeting.location[targetOptions].includes(\n geolocation[targetOptions]\n )\n )\n return reject();\n }\n }\n );\n finishConfirmation();\n });\n } else {\n finishConfirmation();\n }\n });\n }\n\n showBar() {\n if (!document.querySelector(`#${this.id}`)) return;\n this.bar.style.transition = (this.settings.duration || 500) + \"ms\";\n setTimeout(() => {\n this.bar.classList.add(\"hello-bar--is-visible\");\n }, this.settings.delay || 1);\n this.$emit(\"show-bar\", this.bar);\n }\n\n unMove() {\n const movedElements = document.querySelectorAll(\".hello-bar--has-moved\");\n for (let i = 0; i < movedElements.length; i++) {\n const currentMargin = parseInt(movedElements[i].style[this.marginProp]);\n movedElements[i].style[this.marginProp] = `${currentMargin -\n this.height}px`;\n movedElements[i].classList.remove(\"hello-bar--has-moved\");\n }\n }\n\n hideBar() {\n if (!document.querySelector(`#${this.id}`)) return;\n this.bar.classList.remove(\"hello-bar--is-visible\");\n sessionStorage.setItem(\"hello-bar--session-showed\", true);\n localStorage.setItem(\"hello-bar--user-showed\", true);\n this.unMove();\n setTimeout(() => {\n this.bar.parentNode.removeChild(this.bar);\n }, (this.settings.duration || 500) + 1);\n this.$emit(\"hide-bar\", this.bar);\n }\n\n functionBar() {\n if (document.querySelector(\".hello-bar button.hello-bar-button\")) {\n document\n .querySelector(\".hello-bar button.hello-bar-button\")\n .addEventListener(\"click\", () => {\n this.$emit(\"close-bar\", this.bar);\n this.hideBar();\n });\n }\n const eventMatches = {\n mouseenter: \"mouse-enter\",\n mouseleave: \"mouse-leave\",\n click: \"mouse-click\",\n mouseup: \"mouse-up\",\n mousedown: \"mouse-down\"\n };\n const cta = document.querySelector(\".hello-bar .cta\");\n Object.keys(eventMatches).forEach(event => {\n this.bar.addEventListener(event, () =>\n this.$emit(eventMatches[event], this.bar)\n );\n if (cta) {\n cta.addEventListener(event, () =>\n this.$emit(`cta-${eventMatches[event]}`, cta)\n );\n }\n });\n }\n\n colorizeBar() {\n if (!document.querySelector(`#${this.id}`)) return;\n const backgroundColor = this.settings.background || \"#eeeeee\";\n const textColor =\n this.settings.textColor || fontColorContrast(backgroundColor);\n this.bar.style.backgroundColor = backgroundColor;\n if (document.querySelector(\".hello-bar .hello-bar-text--after\"))\n document.querySelector(\n \".hello-bar .hello-bar-text--after\"\n ).style.background = `linear-gradient(to right, rgba(0, 0, 0, 0), ${backgroundColor})`;\n this.bar.style.color = textColor;\n this.bar.style.textAlign = this.settings.align || \"center\";\n if (document.querySelector(\".hello-bar p.hello-bar-text .cta\")) {\n document.querySelector(\".hello-bar p.hello-bar-text .cta\").style.color =\n this.settings.background || \"#eeeeee\";\n document.querySelector(\n \".hello-bar p.hello-bar-text .cta\"\n ).style.background = textColor;\n this.$emit(\"color-bar\", {\n backgroundColor,\n textColor\n });\n }\n }\n\n calculateHeight() {\n if (!document.querySelector(`#${this.id}`)) return;\n if (this.settings.size)\n this.bar.classList.add(`hello-bar--size-${this.settings.size}`);\n if (\n typeof this.bar.getBoundingClientRect === \"function\" &&\n this.bar.getBoundingClientRect().height\n ) {\n this.height = this.bar.getBoundingClientRect().height;\n } else {\n this.height = this.bar.offsetHeight;\n }\n this.height = parseInt(this.height);\n this.$emit(\"calculate-height\", this.height);\n }\n\n insertBar() {\n const firstChild = document.querySelector(\"body > *\");\n if (firstChild) {\n document.body.insertBefore(this.bar, firstChild);\n } else {\n document.body.appendChild(this.bar);\n }\n this.$emit(\"created\", this.bar);\n }\n\n moveElements(elements) {\n if (!elements) return;\n // e.g., \"h1.hero-title\"\n if (typeof elements === \"string\") {\n const allElements = document.querySelectorAll(elements);\n for (let i = 0; i < allElements.length; i++) {\n this.moveElements(allElements[i]);\n }\n // e.g., [\"h1.hero-title\", document.querySelector(\"a#moveMe\")]\n } else if (elements.constructor === Array && elements.length) {\n for (let i = 0; i < elements.length; i++) {\n this.moveElements(elements[i]);\n }\n // e.g., document.querySelector(\"a#moveMe\")\n } else if (typeof elements === \"object\") {\n if (\n typeof elements.classList === \"object\" &&\n typeof elements.classList.add === \"function\" &&\n !elements.classList.contains(\"hello-bar--has-moved\")\n ) {\n const style =\n elements.currentStyle || window.getComputedStyle(elements);\n if (typeof style === \"object\" && style[this.marginProp]) {\n elements.style[this.marginProp] = `${parseInt(\n style[this.marginProp]\n ) + this.height}px`;\n } else {\n elements.style[this.marginProp] = `${this.height}px`;\n }\n this.$emit(\"move-element\", elements);\n elements.classList.add(\"hello-bar--has-moved\");\n }\n }\n }\n\n getIpInfo() {\n this.$emit(\"start-ip-info\");\n return new Promise((resolve, reject) => {\n cachedFetch(this.settings.ipEndpoint || \"https://ipinfo.io/json\")\n .then(json => {\n this.$emit(\"fetch-ip-info\", json);\n resolve(json);\n })\n .catch(error => {\n this.$emit(\"error-ip-info\", error);\n reject(error);\n });\n });\n }\n}\n\nexport default App;\n","export default name => {\n const url = window.location.href;\n name = name.replace(/[[\\]]/g, \"\\\\$&\");\n const regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n results = regex.exec(url);\n if (!results) return;\n if (!results[2]) return;\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n};\n","/**\n * Fetch with local storage cache to prevent multple requests with the same expected response\n * @param {string} url - Endpoint for fetch request\n * @param {object} options - Fetch configuration object\n */\nexport default (url, options) =>\n new Promise((resolve, reject) => {\n const cacheKey = `hello_bar_cache_${url}${\n options ? \"_\" + JSON.stringify(options) : \"\"\n }`;\n if (localStorage.getItem(cacheKey)) {\n try {\n const cacheObject = JSON.parse(localStorage.getItem(cacheKey));\n if (cacheObject.expires_at > new Date().getTime())\n return resolve(cacheObject.cache_value);\n } catch (e) {}\n }\n fetch(url, options)\n .then(response => response.json())\n .then(json => {\n localStorage.setItem(\n cacheKey,\n JSON.stringify({\n created_at: new Date().getTime(),\n expires_at: new Date().getTime() + 7 * 24 * 60 * 60 * 1000, // One-week cache\n cache_value: json\n })\n );\n resolve(json);\n })\n .catch(error => reject(error));\n });\n","import App from \"./App\";\nexport default App;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["../../webpack/universalModuleDefinition","../../webpack/bootstrap","../../node_modules/font-color-contrast/font-color-contrast.js","../../node_modules/debounce/index.js","euCountries.js","App.js","getParameterByName.js","cachedFetch.js","index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","hexColorOrRedOrArray","green","blue","isHex","test","isRGB","undefined","isArray","Array","fontColor","red","hexToDec","substr","parseInt","Math","sqrt","hexString","decString","replace","debounce","func","wait","immediate","timeout","args","context","timestamp","result","later","last","Date","now","setTimeout","apply","debounced","this","arguments","callNow","clear","clearTimeout","flush","euCountries","App","settings","_this","_classCallCheck","forEach","category","targeting","location","params","time","before","after","id","random","toString","bar","document","createElement","setAttribute","_typeof","text","floor","length","innerHTML","concat","hideClose","i18n","hideText","classList","add","fixed","multiline","position","marginProp","events","addEventListener","querySelector","$emit","unMove","disableBodyMove","moveElements","body","move","colorizeBar","confirmShow","then","insertBar","functionBar","calculateHeight","showBar","catch","eventName","callback","_this2","Promise","resolve","reject","finishConfirmation","once","sessionStorage","getItem","onceUser","localStorage","keys","timeMatches","year","month","day","dayOfWeek","hour","minute","second","addValue","dateType","timeNow","currentValue","includes","param","paramValue","url","href","results","RegExp","exec","decodeURIComponent","getParameterByName","pathname","hide","getIpInfo","geolocation","eu","country","targetOptions","constructor","_this3","style","transition","duration","delay","movedElements","querySelectorAll","currentMargin","height","remove","_this4","setItem","parentNode","removeChild","_this5","hideBar","eventMatches","mouseenter","mouseleave","click","mouseup","mousedown","cta","event","backgroundColor","background","textColor","fontColorContrast","color","textAlign","align","size","getBoundingClientRect","offsetHeight","firstChild","insertBefore","appendChild","elements","allElements","contains","currentStyle","getComputedStyle","_this6","options","ipEndpoint","cacheKey","JSON","stringify","cacheObject","parse","expires_at","getTime","cache_value","e","fetch","response","json","created_at","error"],"mappings":";;;;;;;;;;;CAAA,SAAAA,EAAAC,GACA,kBAAAC,SAAA,kBAAAC,OACAA,OAAAD,QAAAD,IACA,oBAAAG,eAAAC,IACAD,OAAA,cAAAH,GACA,kBAAAC,QACAA,QAAA,SAAAD,IAEAD,EAAA,SAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,oBAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD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EAAKnG,MAAM,gBAAiBiH,GAC5B/F,EAAQ+F,KAETpG,MAAM,SAAAsG,GACLhB,EAAKnG,MAAM,gBAAiBmH,GAC5BhG,EAAOgG,8EG7UFxJ","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"HelloBar\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"HelloBar\"] = factory();\n\telse\n\t\troot[\"HelloBar\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","var fontColorContrast = function fontColorContrast(hexColorOrRedOrArray, green, blue) {\n // Check if the color is hexadecimal (with hash)\n var hash = /#/;\n var isHex = hash.test(hexColorOrRedOrArray);\n var isRGB = green !== undefined && blue !== undefined ? true : false;\n var isArray = Array.isArray(hexColorOrRedOrArray); //Default is a bright color\n\n var fontColor = '#ffffff';\n var red = 0;\n\n if (isHex) {\n red = hexToDec(hexColorOrRedOrArray.substr(1, 2));\n green = hexToDec(hexColorOrRedOrArray.substr(3, 2));\n blue = hexToDec(hexColorOrRedOrArray.substr(5, 2));\n } else if (isRGB) {\n red = parseInt(hexColorOrRedOrArray);\n green = parseInt(green);\n blue = parseInt(blue);\n } else if (isArray) {\n red = parseInt(hexColorOrRedOrArray[0]);\n green = parseInt(hexColorOrRedOrArray[1]);\n blue = parseInt(hexColorOrRedOrArray[2]);\n } else {\n // Not a color, respond with white color\n return fontColor;\n }\n\n var contrast = Math.sqrt(red * red * .241 + green * green * .691 + blue * blue * .068);\n\n if (contrast > 130) {\n fontColor = '#000000';\n }\n\n return fontColor;\n};\n\nmodule.exports = fontColorContrast;\n\nvar hexToDec = function hexToDec(hexString) {\n var decString = hexString.replace(/[^a-f0-9]/gi, '');\n return parseInt(decString, 16);\n};","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate) {\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n }\n\n ;\n\n var debounced = function debounced() {\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function () {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n debounced.flush = function () {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n}\n\n; // Adds compatibility for ES modules\n\ndebounce.debounce = debounce;\nmodule.exports = debounce;","export default [\n \"BE\",\n \"BG\",\n \"CZ\",\n \"DK\",\n \"DE\",\n \"EE\",\n \"IE\",\n \"EL\",\n \"ES\",\n \"FR\",\n \"HR\",\n \"IT\",\n \"CY\",\n \"LV\",\n \"LT\",\n \"LU\",\n \"HU\",\n \"MT\",\n \"NL\",\n \"AT\",\n \"PL\",\n \"PT\",\n \"RO\",\n \"SI\",\n \"SK\",\n \"FI\",\n \"SE\",\n \"UK\"\n];\n","import \"./css/App.css\";\nimport fontColorContrast from \"font-color-contrast\";\nimport debounce from \"debounce\";\nimport cachedFetch from \"./cachedFetch\";\nimport euCountries from \"./euCountries\";\nimport getParameterByName from \"./getParameterByName\";\n\nclass App {\n constructor(settings) {\n settings = settings || {};\n this.settings = settings;\n [\"i18n\", \"targeting\"].forEach(category => {\n this.settings[category] = this.settings[category] || {};\n });\n this.settings.targeting.location = this.settings.targeting.location || {};\n this.settings.targeting.params = this.settings.targeting.params || {};\n this.settings.targeting.time = this.settings.targeting.time || {};\n this.settings.targeting.time.before = this.settings.targeting.time.before || {};\n this.settings.targeting.time.after = this.settings.targeting.time.after || {};\n this.id =\n \"helloBar_\" +\n Math.random()\n .toString(36)\n .substr(2);\n if (this.settings.id) this.id = this.settings.id;\n this.bar = document.createElement(\"div\");\n this.bar.setAttribute(\"id\", this.id);\n if (typeof this.settings.text === \"object\") {\n this.text = this.settings.text[\n Math.floor(Math.random() * this.settings.text.length)\n ];\n } else {\n this.text = this.settings.text;\n }\n this.bar.innerHTML = `

${\n this.text\n }

`;\n if (!this.settings.hideClose) {\n this.bar.innerHTML += ``;\n }\n this.bar.classList.add(\"hello-bar\");\n if (this.settings.fixed) {\n this.bar.classList.add(\"hello-bar--is-fixed\");\n }\n if (this.settings.multiline) {\n this.bar.classList.add(\"hello-bar--is-multiline\");\n }\n if (this.settings.position === \"bottom\") {\n this.bar.classList.add(\"hello-bar--is-bottom\");\n this.marginProp = \"marginBottom\";\n } else {\n this.marginProp = \"marginTop\";\n }\n this.events = {};\n window.addEventListener(\"resize\", debounce(() => {\n if (!document.querySelector(`#${this.id}`)) return;\n this.$emit(\"window-resize\");\n this.unMove();\n if (!this.settings.disableBodyMove) this.moveElements(document.body);\n this.moveElements(this.settings.move);\n this.colorizeBar();\n }, 200));\n this.confirmShow()\n .then(() => {\n this.$emit(\"before-created\");\n this.insertBar();\n this.functionBar();\n this.calculateHeight();\n this.colorizeBar();\n if (!this.settings.disableBodyMove) this.moveElements(document.body);\n this.moveElements(this.settings.move);\n this.showBar();\n this.$emit(\"after-created\");\n })\n .catch(() => {\n this.$emit(\"not-created\");\n });\n }\n\n on(eventName, callback) {\n this.events[eventName] = callback;\n }\n\n $emit(eventName, context) {\n if (this.events[eventName] && typeof this.events[eventName] === \"function\")\n this.events[eventName](context);\n }\n\n confirmShow() {\n return new Promise((resolve, reject) => {\n const finishConfirmation = () => {\n if (this.settings.targeting.once) {\n if (sessionStorage.getItem(`hello-bar-${this.id}--session-showed`))\n return reject();\n }\n if (this.settings.targeting.onceUser) {\n if (localStorage.getItem(`hello-bar-${this.id}--user-showed`)) return reject();\n }\n if (Object.keys(this.settings.targeting.time).length) {\n const timeMatches = {\n year: \"getFullYear\",\n month: \"getMonth\",\n day: \"getDate\",\n dayOfWeek: \"getDay\",\n hour: \"getHours\",\n minute: \"getMinutes\",\n second: \"getSeconds\",\n };\n const addValue = [\"getMonth\", \"getDay\"];\n [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"].forEach(dateType => {\n const timeNow = new Date();\n if (this.settings.targeting.time.after[dateType]) {\n let currentValue = timeNow[timeMatches[dateType]]();\n if (addValue.includes(dateType)) currentValue += 1;\n if (currentValue <= this.settings.targeting.time.after[dateType]) return reject();\n }\n if (this.settings.targeting.time.before[dateType]) {\n let currentValue = timeNow[timeMatches[dateType]]();\n if (addValue.includes(dateType)) currentValue += 1;\n if (currentValue >= this.settings.targeting.time.after[dateType]) return reject();\n }\n });\n }\n if (this.settings.targeting.params) {\n Object.keys(this.settings.targeting.params).forEach(param => {\n const paramValue = getParameterByName(param);\n if (\n paramValue &&\n paramValue !== this.settings.targeting.params[param]\n )\n return reject();\n });\n }\n if (this.settings.targeting.pathname) {\n if (window.location.pathname !== this.settings.targeting.pathname) return reject();\n }\n if (this.settings.targeting.href) {\n if (window.location.href !== this.settings.targeting.href) return reject();\n }\n resolve();\n };\n if (this.settings.hide) return reject();\n if (Object.keys(this.settings.targeting.location).length) {\n this.getIpInfo().then(geolocation => {\n if (this.settings.targeting.location.eu) {\n if (!euCountries.includes(geolocation.country)) return reject();\n }\n [\"country\", \"city\", \"ip\", \"postal\", \"region\"].forEach(\n targetOptions => {\n if (\n this.settings.targeting.location[targetOptions] &&\n this.settings.targeting.location[targetOptions].constructor ===\n Array\n ) {\n if (\n !this.settings.targeting.location[targetOptions].includes(\n geolocation[targetOptions]\n )\n )\n return reject();\n }\n }\n );\n finishConfirmation();\n });\n } else {\n finishConfirmation();\n }\n });\n }\n\n showBar() {\n if (!document.querySelector(`#${this.id}`)) return;\n this.bar.style.transition = (this.settings.duration || 500) + \"ms\";\n setTimeout(() => {\n this.bar.classList.add(\"hello-bar--is-visible\");\n }, this.settings.delay || 1);\n this.$emit(\"show-bar\", this.bar);\n }\n\n unMove() {\n const movedElements = document.querySelectorAll(\".hello-bar--has-moved\");\n for (let i = 0; i < movedElements.length; i++) {\n const currentMargin = parseInt(movedElements[i].style[this.marginProp]);\n movedElements[i].style[this.marginProp] = `${currentMargin -\n this.height}px`;\n movedElements[i].classList.remove(\"hello-bar--has-moved\");\n }\n }\n\n hideBar() {\n if (!document.querySelector(`#${this.id}`)) return;\n this.bar.classList.remove(\"hello-bar--is-visible\");\n sessionStorage.setItem(`hello-bar-${this.id}--session-showed`, true);\n localStorage.setItem(`hello-bar-${this.id}--user-showed`, true);\n this.unMove();\n setTimeout(() => {\n this.bar.parentNode.removeChild(this.bar);\n }, (this.settings.duration || 500) + 1);\n this.$emit(\"hide-bar\", this.bar);\n }\n\n functionBar() {\n if (document.querySelector(\".hello-bar button.hello-bar-button\")) {\n document\n .querySelector(\".hello-bar button.hello-bar-button\")\n .addEventListener(\"click\", () => {\n this.$emit(\"close-bar\", this.bar);\n this.hideBar();\n });\n }\n const eventMatches = {\n mouseenter: \"mouse-enter\",\n mouseleave: \"mouse-leave\",\n click: \"mouse-click\",\n mouseup: \"mouse-up\",\n mousedown: \"mouse-down\"\n };\n const cta = document.querySelector(\".hello-bar .cta\");\n Object.keys(eventMatches).forEach(event => {\n this.bar.addEventListener(event, () =>\n this.$emit(eventMatches[event], this.bar)\n );\n if (cta) {\n cta.addEventListener(event, () =>\n this.$emit(`cta-${eventMatches[event]}`, cta)\n );\n }\n });\n }\n\n colorizeBar() {\n if (!document.querySelector(`#${this.id}`)) return;\n const backgroundColor = this.settings.background || \"#eeeeee\";\n const textColor =\n this.settings.textColor || fontColorContrast(backgroundColor);\n this.bar.style.backgroundColor = backgroundColor;\n if (document.querySelector(\".hello-bar .hello-bar-text--after\"))\n document.querySelector(\n \".hello-bar .hello-bar-text--after\"\n ).style.background = `linear-gradient(to right, rgba(0, 0, 0, 0), ${backgroundColor})`;\n this.bar.style.color = textColor;\n this.bar.style.textAlign = this.settings.align || \"center\";\n if (document.querySelector(\".hello-bar p.hello-bar-text .cta\")) {\n document.querySelector(\".hello-bar p.hello-bar-text .cta\").style.color =\n this.settings.background || \"#eeeeee\";\n document.querySelector(\n \".hello-bar p.hello-bar-text .cta\"\n ).style.background = textColor;\n this.$emit(\"color-bar\", {\n backgroundColor,\n textColor\n });\n }\n }\n\n calculateHeight() {\n if (!document.querySelector(`#${this.id}`)) return;\n if (this.settings.size)\n this.bar.classList.add(`hello-bar--size-${this.settings.size}`);\n if (\n typeof this.bar.getBoundingClientRect === \"function\" &&\n this.bar.getBoundingClientRect().height\n ) {\n this.height = this.bar.getBoundingClientRect().height;\n } else {\n this.height = this.bar.offsetHeight;\n }\n this.height = parseInt(this.height);\n this.$emit(\"calculate-height\", this.height);\n }\n\n insertBar() {\n const firstChild = document.querySelector(\"body > *\");\n if (firstChild) {\n document.body.insertBefore(this.bar, firstChild);\n } else {\n document.body.appendChild(this.bar);\n }\n this.$emit(\"created\", this.bar);\n }\n\n moveElements(elements) {\n if (!elements) return;\n // e.g., \"h1.hero-title\"\n if (typeof elements === \"string\") {\n const allElements = document.querySelectorAll(elements);\n for (let i = 0; i < allElements.length; i++) {\n this.moveElements(allElements[i]);\n }\n // e.g., [\"h1.hero-title\", document.querySelector(\"a#moveMe\")]\n } else if (elements.constructor === Array && elements.length) {\n for (let i = 0; i < elements.length; i++) {\n this.moveElements(elements[i]);\n }\n // e.g., document.querySelector(\"a#moveMe\")\n } else if (typeof elements === \"object\") {\n if (\n typeof elements.classList === \"object\" &&\n typeof elements.classList.add === \"function\" &&\n !elements.classList.contains(\"hello-bar--has-moved\")\n ) {\n const style =\n elements.currentStyle || window.getComputedStyle(elements);\n if (typeof style === \"object\" && style[this.marginProp]) {\n elements.style[this.marginProp] = `${parseInt(\n style[this.marginProp]\n ) + this.height}px`;\n } else {\n elements.style[this.marginProp] = `${this.height}px`;\n }\n this.$emit(\"move-element\", elements);\n elements.classList.add(\"hello-bar--has-moved\");\n }\n }\n }\n\n getIpInfo() {\n this.$emit(\"start-ip-info\");\n return new Promise((resolve, reject) => {\n cachedFetch(this.settings.ipEndpoint || \"https://ipinfo.io/json\")\n .then(json => {\n this.$emit(\"fetch-ip-info\", json);\n resolve(json);\n })\n .catch(error => {\n this.$emit(\"error-ip-info\", error);\n reject(error);\n });\n });\n }\n}\n\nexport default App;\n","export default name => {\n const url = window.location.href;\n name = name.replace(/[[\\]]/g, \"\\\\$&\");\n const regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n results = regex.exec(url);\n if (!results) return;\n if (!results[2]) return;\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n};\n","/**\n * Fetch with local storage cache to prevent multple requests with the same expected response\n * @param {string} url - Endpoint for fetch request\n * @param {object} options - Fetch configuration object\n */\nexport default (url, options) =>\n new Promise((resolve, reject) => {\n const cacheKey = `hello_bar_cache_${url}${\n options ? \"_\" + JSON.stringify(options) : \"\"\n }`;\n if (localStorage.getItem(cacheKey)) {\n try {\n const cacheObject = JSON.parse(localStorage.getItem(cacheKey));\n if (cacheObject.expires_at > new Date().getTime())\n return resolve(cacheObject.cache_value);\n } catch (e) {}\n }\n fetch(url, options)\n .then(response => response.json())\n .then(json => {\n localStorage.setItem(\n cacheKey,\n JSON.stringify({\n created_at: new Date().getTime(),\n expires_at: new Date().getTime() + 7 * 24 * 60 * 60 * 1000, // One-week cache\n cache_value: json\n })\n );\n resolve(json);\n })\n .catch(error => reject(error));\n });\n","import App from \"./App\";\nexport default App;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/index.js b/docs/index.js index 738d3f10..af907dd4 100644 --- a/docs/index.js +++ b/docs/index.js @@ -1,2 +1,2 @@ -!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e){t.exports=function(t,e,i){var o=/#/.test(t),r=void 0!==e&&void 0!==i,s=Array.isArray(t),a="#ffffff",c=0;if(o)c=n(t.substr(1,2)),e=n(t.substr(3,2)),i=n(t.substr(5,2));else if(r)c=parseInt(t),e=parseInt(e),i=parseInt(i);else{if(!s)return a;c=parseInt(t[0]),e=parseInt(t[1]),i=parseInt(t[2])}return Math.sqrt(c*c*.241+e*e*.691+i*i*.068)>130&&(a="#000000"),a};var n=function(t){var e=t.replace(/[^a-f0-9]/gi,"");return parseInt(e,16)}},function(t,e){function n(t,e,n){var i,o,r,s,a;function c(){var u=Date.now()-s;u=0?i=setTimeout(c,e-u):(i=null,n||(a=t.apply(r,o),r=o=null))}null==e&&(e=100);var u=function(){r=this,o=arguments,s=Date.now();var u=n&&!i;return i||(i=setTimeout(c,e)),u&&(a=t.apply(r,o),r=o=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=t.apply(r,o),r=o=null,clearTimeout(i),i=null)},u}n.debounce=n,t.exports=n},function(t,e,n){t.exports=n(5)},function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(3),n(4);var i=n(0),o=n.n(i),r=n(1),s=n.n(r),a=["BE","BG","CZ","DK","DE","EE","IE","EL","ES","FR","HR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","UK"];function c(t){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){for(var n=0;n

'.concat(this.text,'

'),this.settings.hideClose||(this.bar.innerHTML+='')),this.bar.classList.add("hello-bar"),this.settings.fixed&&this.bar.classList.add("hello-bar--is-fixed"),this.settings.multiline&&this.bar.classList.add("hello-bar--is-multiline"),"bottom"===this.settings.position?(this.bar.classList.add("hello-bar--is-bottom"),this.marginProp="marginBottom"):this.marginProp="marginTop",this.events={},window.addEventListener("resize",s()(function(){document.querySelector("#".concat(n.id))&&(n.$emit("window-resize"),n.unMove(),n.settings.disableBodyMove||n.moveElements(document.body),n.moveElements(n.settings.move),n.colorizeBar())},200)),this.confirmShow().then(function(){n.$emit("before-created"),n.insertBar(),n.functionBar(),n.calculateHeight(),n.colorizeBar(),n.settings.disableBodyMove||n.moveElements(document.body),n.moveElements(n.settings.move),n.showBar(),n.$emit("after-created")}).catch(function(){n.$emit("not-created")})}var e,n,i;return e=t,(n=[{key:"on",value:function(t,e){this.events[t]=e}},{key:"$emit",value:function(t,e){this.events[t]&&"function"===typeof this.events[t]&&this.events[t](e)}},{key:"confirmShow",value:function(){var t=this;return new Promise(function(e,n){var i=function(){if(t.settings.targeting.once&&sessionStorage.getItem("hello-bar--session-showed"))return n();if(t.settings.targeting.onceUser&&localStorage.getItem("hello-bar--user-showed"))return n();if(Object.keys(t.settings.targeting.time).length){var i={year:"getFullYear",month:"getMonth",day:"getDate",dayOfWeek:"getDay",hour:"getHours",minute:"getMinutes",second:"getSeconds"},o=["getMonth","getDay"];["year","month","day","hour","minute","second"].forEach(function(e){var r=new Date;if(t.settings.targeting.time.after[e]){var s=r[i[e]]();if(o.includes(e)&&(s+=1),s<=t.settings.targeting.time.after[e])return n()}if(t.settings.targeting.time.before[e]){var a=r[i[e]]();if(o.includes(e)&&(a+=1),a>=t.settings.targeting.time.after[e])return n()}})}return t.settings.targeting.params&&Object.keys(t.settings.targeting.params).forEach(function(e){var i=function(t){var e=window.location.href;t=t.replace(/[[\]]/g,"\\$&");var n=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);if(n&&n[2])return decodeURIComponent(n[2].replace(/\+/g," "))}(e);if(i&&i!==t.settings.targeting.params[e])return n()}),t.settings.targeting.pathname&&window.location.pathname!==t.settings.targeting.pathname?n():t.settings.targeting.href&&window.location.href!==t.settings.targeting.href?n():void e()};if(t.settings.hide)return n();Object.keys(t.settings.targeting.location).length?t.getIpInfo().then(function(e){if(t.settings.targeting.location.eu&&!a.includes(e.country))return n();["country","city","ip","postal","region"].forEach(function(i){if(t.settings.targeting.location[i]&&t.settings.targeting.location[i].constructor===Array&&!t.settings.targeting.location[i].includes(e[i]))return n()}),i()}):i()})}},{key:"showBar",value:function(){var t=this;document.querySelector("#".concat(this.id))&&(this.bar.style.transition=(this.settings.duration||500)+"ms",setTimeout(function(){t.bar.classList.add("hello-bar--is-visible")},this.settings.delay||1),this.$emit("show-bar",this.bar))}},{key:"unMove",value:function(){for(var t=document.querySelectorAll(".hello-bar--has-moved"),e=0;e *");t?document.body.insertBefore(this.bar,t):document.body.appendChild(this.bar),this.$emit("created",this.bar)}},{key:"moveElements",value:function(t){if(t)if("string"===typeof t)for(var e=document.querySelectorAll(t),n=0;n(new Date).getTime())return t(r.cache_value)}catch(s){}fetch(i,o).then(function(t){return t.json()}).then(function(e){localStorage.setItem(n,JSON.stringify({created_at:(new Date).getTime(),expires_at:(new Date).getTime()+6048e5,cache_value:e})),t(e)}).catch(function(t){return e(t)})})).then(function(n){t.$emit("fetch-ip-info",n),e(n)}).catch(function(e){t.$emit("error-ip-info",e),n(e)})})}}])&&u(e.prototype,n),i&&u(e,i),t}();function h(t,e){for(var n=0;n130&&(a="#000000"),a};var n=function(t){var e=t.replace(/[^a-f0-9]/gi,"");return parseInt(e,16)}},function(t,e){function n(t,e,n){var i,o,s,r,a;function c(){var u=Date.now()-r;u=0?i=setTimeout(c,e-u):(i=null,n||(a=t.apply(s,o),s=o=null))}null==e&&(e=100);var u=function(){s=this,o=arguments,r=Date.now();var u=n&&!i;return i||(i=setTimeout(c,e)),u&&(a=t.apply(s,o),s=o=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=t.apply(s,o),s=o=null,clearTimeout(i),i=null)},u}n.debounce=n,t.exports=n},function(t,e,n){t.exports=n(5)},function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(3),n(4);var i=n(0),o=n.n(i),s=n(1),r=n.n(s),a=["BE","BG","CZ","DK","DE","EE","IE","EL","ES","FR","HR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","UK"];function c(t){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){for(var n=0;n

'.concat(this.text,'

'),this.settings.hideClose||(this.bar.innerHTML+='')),this.bar.classList.add("hello-bar"),this.settings.fixed&&this.bar.classList.add("hello-bar--is-fixed"),this.settings.multiline&&this.bar.classList.add("hello-bar--is-multiline"),"bottom"===this.settings.position?(this.bar.classList.add("hello-bar--is-bottom"),this.marginProp="marginBottom"):this.marginProp="marginTop",this.events={},window.addEventListener("resize",r()(function(){document.querySelector("#".concat(n.id))&&(n.$emit("window-resize"),n.unMove(),n.settings.disableBodyMove||n.moveElements(document.body),n.moveElements(n.settings.move),n.colorizeBar())},200)),this.confirmShow().then(function(){n.$emit("before-created"),n.insertBar(),n.functionBar(),n.calculateHeight(),n.colorizeBar(),n.settings.disableBodyMove||n.moveElements(document.body),n.moveElements(n.settings.move),n.showBar(),n.$emit("after-created")}).catch(function(){n.$emit("not-created")})}var e,n,i;return e=t,(n=[{key:"on",value:function(t,e){this.events[t]=e}},{key:"$emit",value:function(t,e){this.events[t]&&"function"===typeof this.events[t]&&this.events[t](e)}},{key:"confirmShow",value:function(){var t=this;return new Promise(function(e,n){var i=function(){if(t.settings.targeting.once&&sessionStorage.getItem("hello-bar-".concat(t.id,"--session-showed")))return n();if(t.settings.targeting.onceUser&&localStorage.getItem("hello-bar-".concat(t.id,"--user-showed")))return n();if(Object.keys(t.settings.targeting.time).length){var i={year:"getFullYear",month:"getMonth",day:"getDate",dayOfWeek:"getDay",hour:"getHours",minute:"getMinutes",second:"getSeconds"},o=["getMonth","getDay"];["year","month","day","hour","minute","second"].forEach(function(e){var s=new Date;if(t.settings.targeting.time.after[e]){var r=s[i[e]]();if(o.includes(e)&&(r+=1),r<=t.settings.targeting.time.after[e])return n()}if(t.settings.targeting.time.before[e]){var a=s[i[e]]();if(o.includes(e)&&(a+=1),a>=t.settings.targeting.time.after[e])return n()}})}return t.settings.targeting.params&&Object.keys(t.settings.targeting.params).forEach(function(e){var i=function(t){var e=window.location.href;t=t.replace(/[[\]]/g,"\\$&");var n=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);if(n&&n[2])return decodeURIComponent(n[2].replace(/\+/g," "))}(e);if(i&&i!==t.settings.targeting.params[e])return n()}),t.settings.targeting.pathname&&window.location.pathname!==t.settings.targeting.pathname?n():t.settings.targeting.href&&window.location.href!==t.settings.targeting.href?n():void e()};if(t.settings.hide)return n();Object.keys(t.settings.targeting.location).length?t.getIpInfo().then(function(e){if(t.settings.targeting.location.eu&&!a.includes(e.country))return n();["country","city","ip","postal","region"].forEach(function(i){if(t.settings.targeting.location[i]&&t.settings.targeting.location[i].constructor===Array&&!t.settings.targeting.location[i].includes(e[i]))return n()}),i()}):i()})}},{key:"showBar",value:function(){var t=this;document.querySelector("#".concat(this.id))&&(this.bar.style.transition=(this.settings.duration||500)+"ms",setTimeout(function(){t.bar.classList.add("hello-bar--is-visible")},this.settings.delay||1),this.$emit("show-bar",this.bar))}},{key:"unMove",value:function(){for(var t=document.querySelectorAll(".hello-bar--has-moved"),e=0;e *");t?document.body.insertBefore(this.bar,t):document.body.appendChild(this.bar),this.$emit("created",this.bar)}},{key:"moveElements",value:function(t){if(t)if("string"===typeof t)for(var e=document.querySelectorAll(t),n=0;n(new Date).getTime())return t(s.cache_value)}catch(r){}fetch(i,o).then(function(t){return t.json()}).then(function(e){localStorage.setItem(n,JSON.stringify({created_at:(new Date).getTime(),expires_at:(new Date).getTime()+6048e5,cache_value:e})),t(e)}).catch(function(t){return e(t)})})).then(function(n){t.$emit("fetch-ip-info",n),e(n)}).catch(function(e){t.$emit("error-ip-info",e),n(e)})})}}])&&u(e.prototype,n),i&&u(e,i),t}();function h(t,e){for(var n=0;n 130) {\n fontColor = '#000000';\n }\n\n return fontColor;\n};\n\nmodule.exports = fontColorContrast;\n\nvar hexToDec = function hexToDec(hexString) {\n var decString = hexString.replace(/[^a-f0-9]/gi, '');\n return parseInt(decString, 16);\n};","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate) {\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n }\n\n ;\n\n var debounced = function debounced() {\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function () {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n debounced.flush = function () {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n}\n\n; // Adds compatibility for ES modules\n\ndebounce.debounce = debounce;\nmodule.exports = debounce;","export default [\"BE\", \"BG\", \"CZ\", \"DK\", \"DE\", \"EE\", \"IE\", \"EL\", \"ES\", \"FR\", \"HR\", \"IT\", \"CY\", \"LV\", \"LT\", \"LU\", \"HU\", \"MT\", \"NL\", \"AT\", \"PL\", \"PT\", \"RO\", \"SI\", \"SK\", \"FI\", \"SE\", \"UK\"];","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport \"./css/App.css\";\nimport fontColorContrast from \"font-color-contrast\";\nimport debounce from \"debounce\";\nimport cachedFetch from \"./cachedFetch\";\nimport euCountries from \"./euCountries\";\nimport getParameterByName from \"./getParameterByName\";\n\nvar App =\n/*#__PURE__*/\nfunction () {\n function App(settings) {\n var _this = this;\n\n _classCallCheck(this, App);\n\n settings = settings || {};\n this.settings = settings;\n [\"i18n\", \"targeting\"].forEach(function (category) {\n _this.settings[category] = _this.settings[category] || {};\n });\n this.settings.targeting.location = this.settings.targeting.location || {};\n this.settings.targeting.params = this.settings.targeting.params || {};\n this.settings.targeting.time = this.settings.targeting.time || {};\n this.settings.targeting.time.before = this.settings.targeting.time.before || {};\n this.settings.targeting.time.after = this.settings.targeting.time.after || {};\n this.id = \"helloBar_\" + Math.random().toString(36).substr(2);\n this.bar = document.createElement(\"div\");\n this.bar.setAttribute(\"id\", this.id);\n\n if (_typeof(this.settings.text) === \"object\") {\n this.text = this.settings.text[Math.floor(Math.random() * this.settings.text.length)];\n } else {\n this.text = this.settings.text;\n }\n\n this.bar.innerHTML = \"

\".concat(this.text, \"

\");\n\n if (!this.settings.hideClose) {\n this.bar.innerHTML += \"\");\n }\n\n this.bar.classList.add(\"hello-bar\");\n\n if (this.settings.fixed) {\n this.bar.classList.add(\"hello-bar--is-fixed\");\n }\n\n if (this.settings.multiline) {\n this.bar.classList.add(\"hello-bar--is-multiline\");\n }\n\n if (this.settings.position === \"bottom\") {\n this.bar.classList.add(\"hello-bar--is-bottom\");\n this.marginProp = \"marginBottom\";\n } else {\n this.marginProp = \"marginTop\";\n }\n\n this.events = {};\n window.addEventListener(\"resize\", debounce(function () {\n if (!document.querySelector(\"#\".concat(_this.id))) return;\n\n _this.$emit(\"window-resize\");\n\n _this.unMove();\n\n if (!_this.settings.disableBodyMove) _this.moveElements(document.body);\n\n _this.moveElements(_this.settings.move);\n\n _this.colorizeBar();\n }, 200));\n this.confirmShow().then(function () {\n _this.$emit(\"before-created\");\n\n _this.insertBar();\n\n _this.functionBar();\n\n _this.calculateHeight();\n\n _this.colorizeBar();\n\n if (!_this.settings.disableBodyMove) _this.moveElements(document.body);\n\n _this.moveElements(_this.settings.move);\n\n _this.showBar();\n\n _this.$emit(\"after-created\");\n }).catch(function () {\n _this.$emit(\"not-created\");\n });\n }\n\n _createClass(App, [{\n key: \"on\",\n value: function on(eventName, callback) {\n this.events[eventName] = callback;\n }\n }, {\n key: \"$emit\",\n value: function $emit(eventName, context) {\n if (this.events[eventName] && typeof this.events[eventName] === \"function\") this.events[eventName](context);\n }\n }, {\n key: \"confirmShow\",\n value: function confirmShow() {\n var _this2 = this;\n\n return new Promise(function (resolve, reject) {\n var finishConfirmation = function finishConfirmation() {\n if (_this2.settings.targeting.once) {\n if (sessionStorage.getItem(\"hello-bar--session-showed\")) return reject();\n }\n\n if (_this2.settings.targeting.onceUser) {\n if (localStorage.getItem(\"hello-bar--user-showed\")) return reject();\n }\n\n if (Object.keys(_this2.settings.targeting.time).length) {\n var timeMatches = {\n year: \"getFullYear\",\n month: \"getMonth\",\n day: \"getDate\",\n dayOfWeek: \"getDay\",\n hour: \"getHours\",\n minute: \"getMinutes\",\n second: \"getSeconds\"\n };\n var addValue = [\"getMonth\", \"getDay\"];\n [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"].forEach(function (dateType) {\n var timeNow = new Date();\n\n if (_this2.settings.targeting.time.after[dateType]) {\n var currentValue = timeNow[timeMatches[dateType]]();\n if (addValue.includes(dateType)) currentValue += 1;\n if (currentValue <= _this2.settings.targeting.time.after[dateType]) return reject();\n }\n\n if (_this2.settings.targeting.time.before[dateType]) {\n var _currentValue = timeNow[timeMatches[dateType]]();\n\n if (addValue.includes(dateType)) _currentValue += 1;\n if (_currentValue >= _this2.settings.targeting.time.after[dateType]) return reject();\n }\n });\n }\n\n if (_this2.settings.targeting.params) {\n Object.keys(_this2.settings.targeting.params).forEach(function (param) {\n var paramValue = getParameterByName(param);\n if (paramValue && paramValue !== _this2.settings.targeting.params[param]) return reject();\n });\n }\n\n if (_this2.settings.targeting.pathname) {\n if (window.location.pathname !== _this2.settings.targeting.pathname) return reject();\n }\n\n if (_this2.settings.targeting.href) {\n if (window.location.href !== _this2.settings.targeting.href) return reject();\n }\n\n resolve();\n };\n\n if (_this2.settings.hide) return reject();\n\n if (Object.keys(_this2.settings.targeting.location).length) {\n _this2.getIpInfo().then(function (geolocation) {\n if (_this2.settings.targeting.location.eu) {\n if (!euCountries.includes(geolocation.country)) return reject();\n }\n\n [\"country\", \"city\", \"ip\", \"postal\", \"region\"].forEach(function (targetOptions) {\n if (_this2.settings.targeting.location[targetOptions] && _this2.settings.targeting.location[targetOptions].constructor === Array) {\n if (!_this2.settings.targeting.location[targetOptions].includes(geolocation[targetOptions])) return reject();\n }\n });\n finishConfirmation();\n });\n } else {\n finishConfirmation();\n }\n });\n }\n }, {\n key: \"showBar\",\n value: function showBar() {\n var _this3 = this;\n\n if (!document.querySelector(\"#\".concat(this.id))) return;\n this.bar.style.transition = (this.settings.duration || 500) + \"ms\";\n setTimeout(function () {\n _this3.bar.classList.add(\"hello-bar--is-visible\");\n }, this.settings.delay || 1);\n this.$emit(\"show-bar\", this.bar);\n }\n }, {\n key: \"unMove\",\n value: function unMove() {\n var movedElements = document.querySelectorAll(\".hello-bar--has-moved\");\n\n for (var i = 0; i < movedElements.length; i++) {\n var currentMargin = parseInt(movedElements[i].style[this.marginProp]);\n movedElements[i].style[this.marginProp] = \"\".concat(currentMargin - this.height, \"px\");\n movedElements[i].classList.remove(\"hello-bar--has-moved\");\n }\n }\n }, {\n key: \"hideBar\",\n value: function hideBar() {\n var _this4 = this;\n\n if (!document.querySelector(\"#\".concat(this.id))) return;\n this.bar.classList.remove(\"hello-bar--is-visible\");\n sessionStorage.setItem(\"hello-bar--session-showed\", true);\n localStorage.setItem(\"hello-bar--user-showed\", true);\n this.unMove();\n setTimeout(function () {\n _this4.bar.parentNode.removeChild(_this4.bar);\n }, (this.settings.duration || 500) + 1);\n this.$emit(\"hide-bar\", this.bar);\n }\n }, {\n key: \"functionBar\",\n value: function functionBar() {\n var _this5 = this;\n\n if (document.querySelector(\".hello-bar button.hello-bar-button\")) {\n document.querySelector(\".hello-bar button.hello-bar-button\").addEventListener(\"click\", function () {\n _this5.$emit(\"close-bar\", _this5.bar);\n\n _this5.hideBar();\n });\n }\n\n var eventMatches = {\n mouseenter: \"mouse-enter\",\n mouseleave: \"mouse-leave\",\n click: \"mouse-click\",\n mouseup: \"mouse-up\",\n mousedown: \"mouse-down\"\n };\n var cta = document.querySelector(\".hello-bar .cta\");\n Object.keys(eventMatches).forEach(function (event) {\n _this5.bar.addEventListener(event, function () {\n return _this5.$emit(eventMatches[event], _this5.bar);\n });\n\n if (cta) {\n cta.addEventListener(event, function () {\n return _this5.$emit(\"cta-\".concat(eventMatches[event]), cta);\n });\n }\n });\n }\n }, {\n key: \"colorizeBar\",\n value: function colorizeBar() {\n if (!document.querySelector(\"#\".concat(this.id))) return;\n var backgroundColor = this.settings.background || \"#eeeeee\";\n var textColor = this.settings.textColor || fontColorContrast(backgroundColor);\n this.bar.style.backgroundColor = backgroundColor;\n if (document.querySelector(\".hello-bar .hello-bar-text--after\")) document.querySelector(\".hello-bar .hello-bar-text--after\").style.background = \"linear-gradient(to right, rgba(0, 0, 0, 0), \".concat(backgroundColor, \")\");\n this.bar.style.color = textColor;\n this.bar.style.textAlign = this.settings.align || \"center\";\n\n if (document.querySelector(\".hello-bar p.hello-bar-text .cta\")) {\n document.querySelector(\".hello-bar p.hello-bar-text .cta\").style.color = this.settings.background || \"#eeeeee\";\n document.querySelector(\".hello-bar p.hello-bar-text .cta\").style.background = textColor;\n this.$emit(\"color-bar\", {\n backgroundColor: backgroundColor,\n textColor: textColor\n });\n }\n }\n }, {\n key: \"calculateHeight\",\n value: function calculateHeight() {\n if (!document.querySelector(\"#\".concat(this.id))) return;\n if (this.settings.size) this.bar.classList.add(\"hello-bar--size-\".concat(this.settings.size));\n\n if (typeof this.bar.getBoundingClientRect === \"function\" && this.bar.getBoundingClientRect().height) {\n this.height = this.bar.getBoundingClientRect().height;\n } else {\n this.height = this.bar.offsetHeight;\n }\n\n this.height = parseInt(this.height);\n this.$emit(\"calculate-height\", this.height);\n }\n }, {\n key: \"insertBar\",\n value: function insertBar() {\n var firstChild = document.querySelector(\"body > *\");\n\n if (firstChild) {\n document.body.insertBefore(this.bar, firstChild);\n } else {\n document.body.appendChild(this.bar);\n }\n\n this.$emit(\"created\", this.bar);\n }\n }, {\n key: \"moveElements\",\n value: function moveElements(elements) {\n if (!elements) return; // e.g., \"h1.hero-title\"\n\n if (typeof elements === \"string\") {\n var allElements = document.querySelectorAll(elements);\n\n for (var i = 0; i < allElements.length; i++) {\n this.moveElements(allElements[i]);\n } // e.g., [\"h1.hero-title\", document.querySelector(\"a#moveMe\")]\n\n } else if (elements.constructor === Array && elements.length) {\n for (var _i = 0; _i < elements.length; _i++) {\n this.moveElements(elements[_i]);\n } // e.g., document.querySelector(\"a#moveMe\")\n\n } else if (_typeof(elements) === \"object\") {\n if (_typeof(elements.classList) === \"object\" && typeof elements.classList.add === \"function\" && !elements.classList.contains(\"hello-bar--has-moved\")) {\n var style = elements.currentStyle || window.getComputedStyle(elements);\n\n if (_typeof(style) === \"object\" && style[this.marginProp]) {\n elements.style[this.marginProp] = \"\".concat(parseInt(style[this.marginProp]) + this.height, \"px\");\n } else {\n elements.style[this.marginProp] = \"\".concat(this.height, \"px\");\n }\n\n this.$emit(\"move-element\", elements);\n elements.classList.add(\"hello-bar--has-moved\");\n }\n }\n }\n }, {\n key: \"getIpInfo\",\n value: function getIpInfo() {\n var _this6 = this;\n\n this.$emit(\"start-ip-info\");\n return new Promise(function (resolve, reject) {\n cachedFetch(_this6.settings.ipEndpoint || \"https://ipinfo.io/json\").then(function (json) {\n _this6.$emit(\"fetch-ip-info\", json);\n\n resolve(json);\n }).catch(function (error) {\n _this6.$emit(\"error-ip-info\", error);\n\n reject(error);\n });\n });\n }\n }]);\n\n return App;\n}();\n\nexport default App;","import App from \"./App\";\nexport default App;","export default (function (name) {\n var url = window.location.href;\n name = name.replace(/[[\\]]/g, \"\\\\$&\");\n var regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n results = regex.exec(url);\n if (!results) return;\n if (!results[2]) return;\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n});","/**\n * Fetch with local storage cache to prevent multple requests with the same expected response\n * @param {string} url - Endpoint for fetch request\n * @param {object} options - Fetch configuration object\n */\nexport default (function (url, options) {\n return new Promise(function (resolve, reject) {\n var cacheKey = \"hello_bar_cache_\".concat(url).concat(options ? \"_\" + JSON.stringify(options) : \"\");\n\n if (localStorage.getItem(cacheKey)) {\n try {\n var cacheObject = JSON.parse(localStorage.getItem(cacheKey));\n if (cacheObject.expires_at > new Date().getTime()) return resolve(cacheObject.cache_value);\n } catch (e) {}\n }\n\n fetch(url, options).then(function (response) {\n return response.json();\n }).then(function (json) {\n localStorage.setItem(cacheKey, JSON.stringify({\n created_at: new Date().getTime(),\n expires_at: new Date().getTime() + 7 * 24 * 60 * 60 * 1000,\n // One-week cache\n cache_value: json\n }));\n resolve(json);\n }).catch(function (error) {\n return reject(error);\n });\n });\n});","import \"./css/App.css\";\nimport Lib from \"../lib\";\n\nconst checkOutText =\n \"Check out this repository on GitHub now! ★  Star now\";\nconst euText =\n \"🍪 This website uses cookies to make your experience better. Cookie policy\";\nconst randomText = [\"You are seeing message A!\", \"You are seeing message B!\"];\nconst eveningText = \"You are visiting this website after 8 pm! Quite the night rider. ;)\"\nconst multiLineText = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris non lorem quam. Nunc at risus auctor felis semper semper. Proin nec consectetur dolor, eu congue tellus. Nulla ac libero viverra, aliquam mi eget, auctor diam. Vestibulum eget leo consequat, tempus eros ac, bibendum ligula.\";\n\nclass App {\n constructor() {\n this.libInstance = new Lib({\n text: checkOutText,\n background: \"#5352ed\",\n size: \"large\",\n delay: 500\n });\n this.addEvents();\n console.log(\"Demo loaded!\", this.libInstance);\n const radioInputs = document.querySelectorAll(\"input[type='radio']\");\n for (let i = 0; i < radioInputs.length; i++) {\n radioInputs[i].addEventListener(\"change\", () => {\n this.libInstance.hideBar();\n switch (radioInputs[i].value) {\n case \"cookie-law-1\":\n setTimeout(() => {\n this.libInstance = new Lib({\n text: euText,\n position: \"bottom\",\n fixed: true\n });\n this.addEvents();\n }, 600);\n break;\n case \"cookie-law-2\":\n setTimeout(() => {\n this.libInstance = new Lib({\n text: euText,\n targeting: {\n location: {\n eu: true\n }\n }\n });\n this.addEvents();\n }, 600);\n break;\n case \"multiline\":\n setTimeout(() => {\n this.libInstance = new Lib({\n text: multiLineText,\n multiline: true\n });\n this.addEvents();\n }, 600);\n break;\n case \"evening\":\n setTimeout(() => {\n this.libInstance = new Lib({\n text: eveningText,\n background: \"#000\",\n targeting: {\n time: {\n after: {\n hour: 20\n }\n }\n }\n });\n this.addEvents();\n }, 600);\n break;\n case \"random\":\n setTimeout(() => {\n this.libInstance = new Lib({\n text: randomText,\n background: \"#e24331\",\n size: \"large\"\n });\n this.addEvents();\n }, 600);\n break;\n default:\n setTimeout(() => {\n this.libInstance = new Lib({\n text: checkOutText,\n background: \"#5352ed\",\n size: \"large\"\n });\n this.addEvents();\n }, 600);\n break;\n }\n });\n }\n }\n addEvents() {\n [\n \"before-created\",\n \"after-created\",\n \"not-created\",\n \"mouse-enter\",\n \"mouse-leave\",\n \"mouse-down\",\n \"mouse-up\",\n \"mouse-click\",\n \"cta-mouse-enter\",\n \"cta-mouse-leave\",\n \"cta-mouse-down\",\n \"cta-mouse-up\",\n \"cta-mouse-click\",\n \"show-bar\",\n \"hide-bar\",\n \"close-bar\",\n \"color-bar\",\n \"calculate-height\",\n \"created\",\n \"move-element\",\n \"start-ip-info\",\n \"fetch-ip-info\",\n \"error-ip-info\"\n ].forEach(event => {\n this.libInstance.on(event, e => {\n console.log(\"Emitted \" + event, e);\n });\n });\n }\n}\n\nexport default App;\n","import App from \"./App\";\n\nnew App();\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["../../webpack/bootstrap","../../node_modules/font-color-contrast/font-color-contrast.js","../../node_modules/debounce/index.js","../lib/euCountries.js","../lib/App.js","../lib/index.js","../lib/getParameterByName.js","../lib/cachedFetch.js","App.js","index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","hexColorOrRedOrArray","green","blue","isHex","test","isRGB","undefined","isArray","Array","fontColor","red","hexToDec","substr","parseInt","Math","sqrt","hexString","decString","replace","debounce","func","wait","immediate","timeout","args","context","timestamp","result","later","last","Date","now","setTimeout","apply","debounced","this","arguments","callNow","clear","clearTimeout","flush","euCountries","_typeof","obj","iterator","constructor","_defineProperties","target","props","length","descriptor","configurable","writable","lib","App","settings","_this","instance","Constructor","TypeError","_classCallCheck","forEach","category","targeting","location","params","time","before","after","id","random","toString","bar","document","createElement","setAttribute","text","floor","innerHTML","concat","hideClose","i18n","hideText","classList","add","fixed","multiline","position","marginProp","events","window","addEventListener","debounce_default","querySelector","$emit","unMove","disableBodyMove","moveElements","body","move","colorizeBar","confirmShow","then","insertBar","functionBar","calculateHeight","showBar","catch","protoProps","staticProps","eventName","callback","_this2","Promise","resolve","reject","finishConfirmation","once","sessionStorage","getItem","onceUser","localStorage","keys","timeMatches","year","month","day","dayOfWeek","hour","minute","second","addValue","dateType","timeNow","currentValue","includes","_currentValue","param","paramValue","url","href","results","RegExp","exec","decodeURIComponent","getParameterByName","pathname","hide","getIpInfo","geolocation","eu","country","targetOptions","_this3","style","transition","duration","delay","movedElements","querySelectorAll","currentMargin","height","remove","_this4","setItem","parentNode","removeChild","_this5","hideBar","eventMatches","mouseenter","mouseleave","click","mouseup","mousedown","cta","event","backgroundColor","background","textColor","font_color_contrast_default","color","textAlign","align","size","getBoundingClientRect","offsetHeight","firstChild","insertBefore","appendChild","elements","allElements","_i","contains","currentStyle","getComputedStyle","_this6","options","ipEndpoint","cacheKey","JSON","stringify","cacheObject","parse","expires_at","getTime","cache_value","e","fetch","response","json","created_at","error","checkOutText","euText","randomText","eveningText","multiLineText","App_classCallCheck","libInstance","Lib","addEvents","console","log","radioInputs","_loop","on"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,qBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAE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4I,EACNtC,WAAY,OACZnH,UAAW,CACTG,KAAM,CACJE,MAAO,CACL4D,KAAM,QAKdxE,EAAKqK,aACJ,KACH,MACF,IAAK,SACH7L,WAAW,WACTwB,EAAKmK,YAAc,IAAIC,EAAI,CACzBvJ,GAAI,WACJO,KAAM2I,EACNrC,WAAY,UACZM,KAAM,UAERhI,EAAKqK,aACJ,KACH,MACF,QACE7L,WAAW,WACTwB,EAAKmK,YAAc,IAAIC,EAAI,CACzBvJ,GAAI,SACJO,KAAMyI,EACNnC,WAAY,UACZM,KAAM,UAERhI,EAAKqK,aACJ,SA5EF7P,EAAI,EAAGA,EAAIgQ,EAAY/K,OAAQjF,IAAKiQ,EAApCjQ,8DAkFC,IAAAgJ,EAAA7E,KACV,CACE,iBACA,gBACA,cACA,cACA,cACA,aACA,WACA,cACA,kBACA,kBACA,iBACA,eACA,kBACA,WACA,WACA,YACA,YACA,mBACA,UACA,eACA,gBACA,gBACA,iBACA0B,QAAQ,SAAAmH,GACRhE,EAAK2G,YAAYO,GAAGlD,EAAO,SAAA+B,GACzBe,QAAQC,IAAI,WAAa/C,EAAO+B","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","var fontColorContrast = function fontColorContrast(hexColorOrRedOrArray, green, blue) {\n // Check if the color is hexadecimal (with hash)\n var hash = /#/;\n var isHex = hash.test(hexColorOrRedOrArray);\n var isRGB = green !== undefined && blue !== undefined ? true : false;\n var isArray = Array.isArray(hexColorOrRedOrArray); //Default is a bright color\n\n var fontColor = '#ffffff';\n var red = 0;\n\n if (isHex) {\n red = hexToDec(hexColorOrRedOrArray.substr(1, 2));\n green = hexToDec(hexColorOrRedOrArray.substr(3, 2));\n blue = hexToDec(hexColorOrRedOrArray.substr(5, 2));\n } else if (isRGB) {\n red = parseInt(hexColorOrRedOrArray);\n green = parseInt(green);\n blue = parseInt(blue);\n } else if (isArray) {\n red = parseInt(hexColorOrRedOrArray[0]);\n green = parseInt(hexColorOrRedOrArray[1]);\n blue = parseInt(hexColorOrRedOrArray[2]);\n } else {\n // Not a color, respond with white color\n return fontColor;\n }\n\n var contrast = Math.sqrt(red * red * .241 + green * green * .691 + blue * blue * .068);\n\n if (contrast > 130) {\n fontColor = '#000000';\n }\n\n return fontColor;\n};\n\nmodule.exports = fontColorContrast;\n\nvar hexToDec = function hexToDec(hexString) {\n var decString = hexString.replace(/[^a-f0-9]/gi, '');\n return parseInt(decString, 16);\n};","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate) {\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n }\n\n ;\n\n var debounced = function debounced() {\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function () {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n debounced.flush = function () {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n}\n\n; // Adds compatibility for ES modules\n\ndebounce.debounce = debounce;\nmodule.exports = debounce;","export default [\"BE\", \"BG\", \"CZ\", \"DK\", \"DE\", \"EE\", \"IE\", \"EL\", \"ES\", \"FR\", \"HR\", \"IT\", \"CY\", \"LV\", \"LT\", \"LU\", \"HU\", \"MT\", \"NL\", \"AT\", \"PL\", \"PT\", \"RO\", \"SI\", \"SK\", \"FI\", \"SE\", \"UK\"];","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport \"./css/App.css\";\nimport fontColorContrast from \"font-color-contrast\";\nimport debounce from \"debounce\";\nimport cachedFetch from \"./cachedFetch\";\nimport euCountries from \"./euCountries\";\nimport getParameterByName from \"./getParameterByName\";\n\nvar App =\n/*#__PURE__*/\nfunction () {\n function App(settings) {\n var _this = this;\n\n _classCallCheck(this, App);\n\n settings = settings || {};\n this.settings = settings;\n [\"i18n\", \"targeting\"].forEach(function (category) {\n _this.settings[category] = _this.settings[category] || {};\n });\n this.settings.targeting.location = this.settings.targeting.location || {};\n this.settings.targeting.params = this.settings.targeting.params || {};\n this.settings.targeting.time = this.settings.targeting.time || {};\n this.settings.targeting.time.before = this.settings.targeting.time.before || {};\n this.settings.targeting.time.after = this.settings.targeting.time.after || {};\n this.id = \"helloBar_\" + Math.random().toString(36).substr(2);\n if (this.settings.id) this.id = this.settings.id;\n this.bar = document.createElement(\"div\");\n this.bar.setAttribute(\"id\", this.id);\n\n if (_typeof(this.settings.text) === \"object\") {\n this.text = this.settings.text[Math.floor(Math.random() * this.settings.text.length)];\n } else {\n this.text = this.settings.text;\n }\n\n this.bar.innerHTML = \"

\".concat(this.text, \"

\");\n\n if (!this.settings.hideClose) {\n this.bar.innerHTML += \"\");\n }\n\n this.bar.classList.add(\"hello-bar\");\n\n if (this.settings.fixed) {\n this.bar.classList.add(\"hello-bar--is-fixed\");\n }\n\n if (this.settings.multiline) {\n this.bar.classList.add(\"hello-bar--is-multiline\");\n }\n\n if (this.settings.position === \"bottom\") {\n this.bar.classList.add(\"hello-bar--is-bottom\");\n this.marginProp = \"marginBottom\";\n } else {\n this.marginProp = \"marginTop\";\n }\n\n this.events = {};\n window.addEventListener(\"resize\", debounce(function () {\n if (!document.querySelector(\"#\".concat(_this.id))) return;\n\n _this.$emit(\"window-resize\");\n\n _this.unMove();\n\n if (!_this.settings.disableBodyMove) _this.moveElements(document.body);\n\n _this.moveElements(_this.settings.move);\n\n _this.colorizeBar();\n }, 200));\n this.confirmShow().then(function () {\n _this.$emit(\"before-created\");\n\n _this.insertBar();\n\n _this.functionBar();\n\n _this.calculateHeight();\n\n _this.colorizeBar();\n\n if (!_this.settings.disableBodyMove) _this.moveElements(document.body);\n\n _this.moveElements(_this.settings.move);\n\n _this.showBar();\n\n _this.$emit(\"after-created\");\n }).catch(function () {\n _this.$emit(\"not-created\");\n });\n }\n\n _createClass(App, [{\n key: \"on\",\n value: function on(eventName, callback) {\n this.events[eventName] = callback;\n }\n }, {\n key: \"$emit\",\n value: function $emit(eventName, context) {\n if (this.events[eventName] && typeof this.events[eventName] === \"function\") this.events[eventName](context);\n }\n }, {\n key: \"confirmShow\",\n value: function confirmShow() {\n var _this2 = this;\n\n return new Promise(function (resolve, reject) {\n var finishConfirmation = function finishConfirmation() {\n if (_this2.settings.targeting.once) {\n if (sessionStorage.getItem(\"hello-bar-\".concat(_this2.id, \"--session-showed\"))) return reject();\n }\n\n if (_this2.settings.targeting.onceUser) {\n if (localStorage.getItem(\"hello-bar-\".concat(_this2.id, \"--user-showed\"))) return reject();\n }\n\n if (Object.keys(_this2.settings.targeting.time).length) {\n var timeMatches = {\n year: \"getFullYear\",\n month: \"getMonth\",\n day: \"getDate\",\n dayOfWeek: \"getDay\",\n hour: \"getHours\",\n minute: \"getMinutes\",\n second: \"getSeconds\"\n };\n var addValue = [\"getMonth\", \"getDay\"];\n [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"].forEach(function (dateType) {\n var timeNow = new Date();\n\n if (_this2.settings.targeting.time.after[dateType]) {\n var currentValue = timeNow[timeMatches[dateType]]();\n if (addValue.includes(dateType)) currentValue += 1;\n if (currentValue <= _this2.settings.targeting.time.after[dateType]) return reject();\n }\n\n if (_this2.settings.targeting.time.before[dateType]) {\n var _currentValue = timeNow[timeMatches[dateType]]();\n\n if (addValue.includes(dateType)) _currentValue += 1;\n if (_currentValue >= _this2.settings.targeting.time.after[dateType]) return reject();\n }\n });\n }\n\n if (_this2.settings.targeting.params) {\n Object.keys(_this2.settings.targeting.params).forEach(function (param) {\n var paramValue = getParameterByName(param);\n if (paramValue && paramValue !== _this2.settings.targeting.params[param]) return reject();\n });\n }\n\n if (_this2.settings.targeting.pathname) {\n if (window.location.pathname !== _this2.settings.targeting.pathname) return reject();\n }\n\n if (_this2.settings.targeting.href) {\n if (window.location.href !== _this2.settings.targeting.href) return reject();\n }\n\n resolve();\n };\n\n if (_this2.settings.hide) return reject();\n\n if (Object.keys(_this2.settings.targeting.location).length) {\n _this2.getIpInfo().then(function (geolocation) {\n if (_this2.settings.targeting.location.eu) {\n if (!euCountries.includes(geolocation.country)) return reject();\n }\n\n [\"country\", \"city\", \"ip\", \"postal\", \"region\"].forEach(function (targetOptions) {\n if (_this2.settings.targeting.location[targetOptions] && _this2.settings.targeting.location[targetOptions].constructor === Array) {\n if (!_this2.settings.targeting.location[targetOptions].includes(geolocation[targetOptions])) return reject();\n }\n });\n finishConfirmation();\n });\n } else {\n finishConfirmation();\n }\n });\n }\n }, {\n key: \"showBar\",\n value: function showBar() {\n var _this3 = this;\n\n if (!document.querySelector(\"#\".concat(this.id))) return;\n this.bar.style.transition = (this.settings.duration || 500) + \"ms\";\n setTimeout(function () {\n _this3.bar.classList.add(\"hello-bar--is-visible\");\n }, this.settings.delay || 1);\n this.$emit(\"show-bar\", this.bar);\n }\n }, {\n key: \"unMove\",\n value: function unMove() {\n var movedElements = document.querySelectorAll(\".hello-bar--has-moved\");\n\n for (var i = 0; i < movedElements.length; i++) {\n var currentMargin = parseInt(movedElements[i].style[this.marginProp]);\n movedElements[i].style[this.marginProp] = \"\".concat(currentMargin - this.height, \"px\");\n movedElements[i].classList.remove(\"hello-bar--has-moved\");\n }\n }\n }, {\n key: \"hideBar\",\n value: function hideBar() {\n var _this4 = this;\n\n if (!document.querySelector(\"#\".concat(this.id))) return;\n this.bar.classList.remove(\"hello-bar--is-visible\");\n sessionStorage.setItem(\"hello-bar-\".concat(this.id, \"--session-showed\"), true);\n localStorage.setItem(\"hello-bar-\".concat(this.id, \"--user-showed\"), true);\n this.unMove();\n setTimeout(function () {\n _this4.bar.parentNode.removeChild(_this4.bar);\n }, (this.settings.duration || 500) + 1);\n this.$emit(\"hide-bar\", this.bar);\n }\n }, {\n key: \"functionBar\",\n value: function functionBar() {\n var _this5 = this;\n\n if (document.querySelector(\".hello-bar button.hello-bar-button\")) {\n document.querySelector(\".hello-bar button.hello-bar-button\").addEventListener(\"click\", function () {\n _this5.$emit(\"close-bar\", _this5.bar);\n\n _this5.hideBar();\n });\n }\n\n var eventMatches = {\n mouseenter: \"mouse-enter\",\n mouseleave: \"mouse-leave\",\n click: \"mouse-click\",\n mouseup: \"mouse-up\",\n mousedown: \"mouse-down\"\n };\n var cta = document.querySelector(\".hello-bar .cta\");\n Object.keys(eventMatches).forEach(function (event) {\n _this5.bar.addEventListener(event, function () {\n return _this5.$emit(eventMatches[event], _this5.bar);\n });\n\n if (cta) {\n cta.addEventListener(event, function () {\n return _this5.$emit(\"cta-\".concat(eventMatches[event]), cta);\n });\n }\n });\n }\n }, {\n key: \"colorizeBar\",\n value: function colorizeBar() {\n if (!document.querySelector(\"#\".concat(this.id))) return;\n var backgroundColor = this.settings.background || \"#eeeeee\";\n var textColor = this.settings.textColor || fontColorContrast(backgroundColor);\n this.bar.style.backgroundColor = backgroundColor;\n if (document.querySelector(\".hello-bar .hello-bar-text--after\")) document.querySelector(\".hello-bar .hello-bar-text--after\").style.background = \"linear-gradient(to right, rgba(0, 0, 0, 0), \".concat(backgroundColor, \")\");\n this.bar.style.color = textColor;\n this.bar.style.textAlign = this.settings.align || \"center\";\n\n if (document.querySelector(\".hello-bar p.hello-bar-text .cta\")) {\n document.querySelector(\".hello-bar p.hello-bar-text .cta\").style.color = this.settings.background || \"#eeeeee\";\n document.querySelector(\".hello-bar p.hello-bar-text .cta\").style.background = textColor;\n this.$emit(\"color-bar\", {\n backgroundColor: backgroundColor,\n textColor: textColor\n });\n }\n }\n }, {\n key: \"calculateHeight\",\n value: function calculateHeight() {\n if (!document.querySelector(\"#\".concat(this.id))) return;\n if (this.settings.size) this.bar.classList.add(\"hello-bar--size-\".concat(this.settings.size));\n\n if (typeof this.bar.getBoundingClientRect === \"function\" && this.bar.getBoundingClientRect().height) {\n this.height = this.bar.getBoundingClientRect().height;\n } else {\n this.height = this.bar.offsetHeight;\n }\n\n this.height = parseInt(this.height);\n this.$emit(\"calculate-height\", this.height);\n }\n }, {\n key: \"insertBar\",\n value: function insertBar() {\n var firstChild = document.querySelector(\"body > *\");\n\n if (firstChild) {\n document.body.insertBefore(this.bar, firstChild);\n } else {\n document.body.appendChild(this.bar);\n }\n\n this.$emit(\"created\", this.bar);\n }\n }, {\n key: \"moveElements\",\n value: function moveElements(elements) {\n if (!elements) return; // e.g., \"h1.hero-title\"\n\n if (typeof elements === \"string\") {\n var allElements = document.querySelectorAll(elements);\n\n for (var i = 0; i < allElements.length; i++) {\n this.moveElements(allElements[i]);\n } // e.g., [\"h1.hero-title\", document.querySelector(\"a#moveMe\")]\n\n } else if (elements.constructor === Array && elements.length) {\n for (var _i = 0; _i < elements.length; _i++) {\n this.moveElements(elements[_i]);\n } // e.g., document.querySelector(\"a#moveMe\")\n\n } else if (_typeof(elements) === \"object\") {\n if (_typeof(elements.classList) === \"object\" && typeof elements.classList.add === \"function\" && !elements.classList.contains(\"hello-bar--has-moved\")) {\n var style = elements.currentStyle || window.getComputedStyle(elements);\n\n if (_typeof(style) === \"object\" && style[this.marginProp]) {\n elements.style[this.marginProp] = \"\".concat(parseInt(style[this.marginProp]) + this.height, \"px\");\n } else {\n elements.style[this.marginProp] = \"\".concat(this.height, \"px\");\n }\n\n this.$emit(\"move-element\", elements);\n elements.classList.add(\"hello-bar--has-moved\");\n }\n }\n }\n }, {\n key: \"getIpInfo\",\n value: function getIpInfo() {\n var _this6 = this;\n\n this.$emit(\"start-ip-info\");\n return new Promise(function (resolve, reject) {\n cachedFetch(_this6.settings.ipEndpoint || \"https://ipinfo.io/json\").then(function (json) {\n _this6.$emit(\"fetch-ip-info\", json);\n\n resolve(json);\n }).catch(function (error) {\n _this6.$emit(\"error-ip-info\", error);\n\n reject(error);\n });\n });\n }\n }]);\n\n return App;\n}();\n\nexport default App;","import App from \"./App\";\nexport default App;","export default (function (name) {\n var url = window.location.href;\n name = name.replace(/[[\\]]/g, \"\\\\$&\");\n var regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n results = regex.exec(url);\n if (!results) return;\n if (!results[2]) return;\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n});","/**\n * Fetch with local storage cache to prevent multple requests with the same expected response\n * @param {string} url - Endpoint for fetch request\n * @param {object} options - Fetch configuration object\n */\nexport default (function (url, options) {\n return new Promise(function (resolve, reject) {\n var cacheKey = \"hello_bar_cache_\".concat(url).concat(options ? \"_\" + JSON.stringify(options) : \"\");\n\n if (localStorage.getItem(cacheKey)) {\n try {\n var cacheObject = JSON.parse(localStorage.getItem(cacheKey));\n if (cacheObject.expires_at > new Date().getTime()) return resolve(cacheObject.cache_value);\n } catch (e) {}\n }\n\n fetch(url, options).then(function (response) {\n return response.json();\n }).then(function (json) {\n localStorage.setItem(cacheKey, JSON.stringify({\n created_at: new Date().getTime(),\n expires_at: new Date().getTime() + 7 * 24 * 60 * 60 * 1000,\n // One-week cache\n cache_value: json\n }));\n resolve(json);\n }).catch(function (error) {\n return reject(error);\n });\n });\n});","import \"./css/App.css\";\nimport Lib from \"../lib\";\n\nconst checkOutText =\n \"Check out this repository on GitHub now! ★  Star now\";\nconst euText =\n \"🍪 This website uses cookies to make your experience better. Cookie policy\";\nconst randomText = [\"You are seeing message A!\", \"You are seeing message B!\"];\nconst eveningText = \"You are visiting this website after 8 pm! Quite the night rider. ;)\"\nconst multiLineText = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris non lorem quam. Nunc at risus auctor felis semper semper. Proin nec consectetur dolor, eu congue tellus. Nulla ac libero viverra, aliquam mi eget, auctor diam. Vestibulum eget leo consequat, tempus eros ac, bibendum ligula.\";\n\nclass App {\n constructor() {\n this.libInstance = new Lib({\n id: \"github\",\n text: checkOutText,\n background: \"#5352ed\",\n size: \"large\",\n delay: 500\n });\n this.addEvents();\n console.log(\"Demo loaded!\", this.libInstance);\n const radioInputs = document.querySelectorAll(\"input[type='radio']\");\n for (let i = 0; i < radioInputs.length; i++) {\n radioInputs[i].addEventListener(\"change\", () => {\n this.libInstance.hideBar();\n switch (radioInputs[i].value) {\n case \"cookie-law-1\":\n setTimeout(() => {\n this.libInstance = new Lib({\n id: \"eu\",\n text: euText,\n position: \"bottom\",\n fixed: true\n });\n this.addEvents();\n }, 600);\n break;\n case \"cookie-law-2\":\n setTimeout(() => {\n this.libInstance = new Lib({\n id: \"eu-2\",\n text: euText,\n targeting: {\n location: {\n eu: true\n }\n }\n });\n this.addEvents();\n }, 600);\n break;\n case \"multiline\":\n setTimeout(() => {\n this.libInstance = new Lib({\n id: \"multiline\",\n text: multiLineText,\n multiline: true\n });\n this.addEvents();\n }, 600);\n break;\n case \"evening\":\n setTimeout(() => {\n this.libInstance = new Lib({\n id: \"evening\",\n text: eveningText,\n background: \"#000\",\n targeting: {\n time: {\n after: {\n hour: 20\n }\n }\n }\n });\n this.addEvents();\n }, 600);\n break;\n case \"random\":\n setTimeout(() => {\n this.libInstance = new Lib({\n id: \"a-b-test\",\n text: randomText,\n background: \"#e24331\",\n size: \"large\"\n });\n this.addEvents();\n }, 600);\n break;\n default:\n setTimeout(() => {\n this.libInstance = new Lib({\n id: \"github\",\n text: checkOutText,\n background: \"#5352ed\",\n size: \"large\"\n });\n this.addEvents();\n }, 600);\n break;\n }\n });\n }\n }\n addEvents() {\n [\n \"before-created\",\n \"after-created\",\n \"not-created\",\n \"mouse-enter\",\n \"mouse-leave\",\n \"mouse-down\",\n \"mouse-up\",\n \"mouse-click\",\n \"cta-mouse-enter\",\n \"cta-mouse-leave\",\n \"cta-mouse-down\",\n \"cta-mouse-up\",\n \"cta-mouse-click\",\n \"show-bar\",\n \"hide-bar\",\n \"close-bar\",\n \"color-bar\",\n \"calculate-height\",\n \"created\",\n \"move-element\",\n \"start-ip-info\",\n \"fetch-ip-info\",\n \"error-ip-info\"\n ].forEach(event => {\n this.libInstance.on(event, e => {\n console.log(\"Emitted \" + event, e);\n });\n });\n }\n}\n\nexport default App;\n","import App from \"./App\";\n\nnew App();\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 98fbd01d..65cedaaa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hello-bar", - "version": "1.2.0", + "version": "1.3.0", "main": "build/index.js", "scripts": { "start": "node scripts/start.js", diff --git a/src/docs/App.js b/src/docs/App.js index 3d6f893e..cf07864f 100644 --- a/src/docs/App.js +++ b/src/docs/App.js @@ -12,6 +12,7 @@ const multiLineText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. class App { constructor() { this.libInstance = new Lib({ + id: "github", text: checkOutText, background: "#5352ed", size: "large", @@ -27,6 +28,7 @@ class App { case "cookie-law-1": setTimeout(() => { this.libInstance = new Lib({ + id: "eu", text: euText, position: "bottom", fixed: true @@ -37,6 +39,7 @@ class App { case "cookie-law-2": setTimeout(() => { this.libInstance = new Lib({ + id: "eu-2", text: euText, targeting: { location: { @@ -50,6 +53,7 @@ class App { case "multiline": setTimeout(() => { this.libInstance = new Lib({ + id: "multiline", text: multiLineText, multiline: true }); @@ -59,6 +63,7 @@ class App { case "evening": setTimeout(() => { this.libInstance = new Lib({ + id: "evening", text: eveningText, background: "#000", targeting: { @@ -75,6 +80,7 @@ class App { case "random": setTimeout(() => { this.libInstance = new Lib({ + id: "a-b-test", text: randomText, background: "#e24331", size: "large" @@ -85,6 +91,7 @@ class App { default: setTimeout(() => { this.libInstance = new Lib({ + id: "github", text: checkOutText, background: "#5352ed", size: "large" diff --git a/src/lib/App.js b/src/lib/App.js index 382efc05..9cc9c4ee 100644 --- a/src/lib/App.js +++ b/src/lib/App.js @@ -22,6 +22,7 @@ class App { Math.random() .toString(36) .substr(2); + if (this.settings.id) this.id = this.settings.id; this.bar = document.createElement("div"); this.bar.setAttribute("id", this.id); if (typeof this.settings.text === "object") { @@ -96,11 +97,11 @@ class App { return new Promise((resolve, reject) => { const finishConfirmation = () => { if (this.settings.targeting.once) { - if (sessionStorage.getItem("hello-bar--session-showed")) + if (sessionStorage.getItem(`hello-bar-${this.id}--session-showed`)) return reject(); } if (this.settings.targeting.onceUser) { - if (localStorage.getItem("hello-bar--user-showed")) return reject(); + if (localStorage.getItem(`hello-bar-${this.id}--user-showed`)) return reject(); } if (Object.keys(this.settings.targeting.time).length) { const timeMatches = { @@ -197,8 +198,8 @@ class App { hideBar() { if (!document.querySelector(`#${this.id}`)) return; this.bar.classList.remove("hello-bar--is-visible"); - sessionStorage.setItem("hello-bar--session-showed", true); - localStorage.setItem("hello-bar--user-showed", true); + sessionStorage.setItem(`hello-bar-${this.id}--session-showed`, true); + localStorage.setItem(`hello-bar-${this.id}--user-showed`, true); this.unMove(); setTimeout(() => { this.bar.parentNode.removeChild(this.bar);