Boxzilla - Version 3.2.20

Version Description

Download this release

Release Info

Developer DvanKooten
Plugin Icon 128x128 Boxzilla
Version 3.2.20
Comparing to
See all releases

Code changes from version 3.2.19 to 3.2.20

CHANGELOG.md CHANGED
@@ -1,6 +1,17 @@
1
  Changelog
2
  ==========
3
 
 
 
 
 
 
 
 
 
 
 
 
4
  #### 3.2.19 - Dec 30, 2019
5
 
6
  **Fixes**
1
  Changelog
2
  ==========
3
 
4
+ #### 3.2.20 - Jan 20, 2020
5
+
6
+ **Fixes**
7
+
8
+ - An issue with the "pageviews" trigger on Safari Mobile where session storage is inaccessible in the beforeunload event.
9
+
10
+ **Improvements**
11
+
12
+ - Prepare for upcoming [Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/) plugin update which changes the name of the JS object when a form is submitted without AJAX.
13
+
14
+
15
  #### 3.2.19 - Dec 30, 2019
16
 
17
  **Fixes**
assets/js/script.js CHANGED
@@ -108,25 +108,17 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
108
  }
109
 
110
  function maybeOpenMailChimpForWordPressBox() {
111
- if (_typeof(window.mc4wp_forms_config) !== "object" || !window.mc4wp_forms_config.submitted_form) {
112
  return;
113
  }
114
 
115
- var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;
116
- var boxes = Boxzilla.boxes;
117
-
118
- for (var boxId in boxes) {
119
- if (!boxes.hasOwnProperty(boxId)) {
120
- continue;
121
- }
122
-
123
- var box = boxes[boxId];
124
-
125
  if (box.element.querySelector(selector)) {
126
  box.show();
127
- return;
128
  }
129
- }
130
  } // print message when test mode is enabled
131
 
132
 
@@ -702,149 +694,41 @@ module.exports = Box;
702
  },{"./animator.js":2,"./events.js":5}],4:[function(require,module,exports){
703
  'use strict';
704
 
705
- var Timer = require('./timer.js');
706
-
707
  var Boxzilla = require('./events.js');
708
 
709
  var Box = require('./box.js');
710
 
711
- var boxes = [];
712
- var scrollElement = window;
713
- var siteTimer;
714
- var pageTimer;
715
- var pageViews;
716
- var initialised = false;
717
 
718
  var styles = require('./styles.js');
719
 
720
  var ExitIntent = require('./triggers/exit-intent.js');
721
 
722
- function throttle(fn, threshhold, scope) {
723
- threshhold || (threshhold = 250);
724
- var last, deferTimer;
725
- return function () {
726
- var context = scope || this;
727
- var now = +new Date(),
728
- args = arguments;
729
 
730
- if (last && now < last + threshhold) {
731
- // hold on to it
732
- clearTimeout(deferTimer);
733
- deferTimer = setTimeout(function () {
734
- last = now;
735
- fn.apply(context, args);
736
- }, threshhold);
737
- } else {
738
- last = now;
739
- fn.apply(context, args);
740
- }
741
- };
742
- } // "keyup" listener
743
 
 
 
744
 
745
  function onKeyUp(e) {
746
  if (e.keyCode === 27) {
747
  Boxzilla.dismiss();
748
  }
749
- } // check "pageviews" criteria for each box
750
-
751
-
752
- function checkPageViewsCriteria() {
753
- // don't bother if another box is currently open
754
- if (isAnyBoxVisible()) {
755
- return;
756
- }
757
-
758
- boxes.forEach(function (box) {
759
- if (!box.mayAutoShow()) {
760
- return;
761
- }
762
-
763
- if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {
764
- box.trigger();
765
- }
766
- });
767
- } // check time trigger criteria for each box
768
-
769
-
770
- function checkTimeCriteria() {
771
- // don't bother if another box is currently open
772
- if (isAnyBoxVisible()) {
773
- return;
774
- }
775
-
776
- boxes.forEach(function (box) {
777
- if (!box.mayAutoShow()) {
778
- return;
779
- } // check "time on site" trigger
780
-
781
-
782
- if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {
783
- box.trigger();
784
- } // check "time on page" trigger
785
-
786
-
787
- if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {
788
- box.trigger();
789
- }
790
- });
791
- } // check triggerHeight criteria for all boxes
792
-
793
-
794
- function checkHeightCriteria() {
795
- var scrollY = scrollElement.hasOwnProperty('pageYOffset') ? scrollElement.pageYOffset : scrollElement.scrollTop;
796
- scrollY = scrollY + window.innerHeight * 0.9;
797
- boxes.forEach(function (box) {
798
- if (!box.mayAutoShow() || box.triggerHeight <= 0) {
799
- return;
800
- }
801
-
802
- if (scrollY > box.triggerHeight) {
803
- // don't bother if another box is currently open
804
- if (isAnyBoxVisible()) {
805
- return;
806
- } // trigger box
807
-
808
-
809
- box.trigger();
810
- } // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box
811
-
812
-
813
- if (box.mayRehide() && scrollY < box.triggerHeight - 5) {
814
- box.hide();
815
- }
816
- });
817
  } // recalculate heights and variables based on height
818
 
819
 
820
  function recalculateHeights() {
821
  boxes.forEach(function (box) {
822
- box.onResize();
823
  });
824
  }
825
 
826
- function showBoxesWithExitIntentTrigger() {
827
- // do nothing if already triggered OR another box is visible.
828
- if (isAnyBoxVisible()) {
829
- return;
830
- }
831
-
832
- boxes.forEach(function (box) {
833
- if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {
834
- box.trigger();
835
- }
836
- });
837
- }
838
-
839
- function isAnyBoxVisible() {
840
- return boxes.filter(function (b) {
841
- return b.visible;
842
- }).length > 0;
843
- }
844
-
845
- function onElementClick(e) {
846
  // find <a> element in up to 3 parent elements
847
- var el = e.target || e.srcElement;
848
  var depth = 3;
849
 
850
  for (var i = 0; i <= depth; i++) {
@@ -855,75 +739,39 @@ function onElementClick(e) {
855
  el = el.parentElement;
856
  }
857
 
858
- if (!el || el.tagName !== 'A' || !el.getAttribute('href')) {
859
  return;
860
  }
861
 
862
- var href = el.getAttribute('href').toLowerCase();
863
  var match = href.match(/[#&]boxzilla-(\d+)/);
864
 
865
  if (match && match.length > 1) {
866
  var boxId = match[1];
867
  Boxzilla.toggle(boxId);
868
  }
869
- }
870
 
871
- var timers = {
872
- start: function start() {
873
- try {
874
- var sessionTime = sessionStorage.getItem('boxzilla_timer');
875
- if (sessionTime) siteTimer.time = sessionTime;
876
- } catch (e) {}
877
-
878
- siteTimer.start();
879
- pageTimer.start();
880
- },
881
- stop: function stop() {
882
- sessionStorage.setItem('boxzilla_timer', siteTimer.time);
883
- siteTimer.stop();
884
- pageTimer.stop();
885
- }
886
- }; // initialise & add event listeners
887
 
888
  Boxzilla.init = function () {
889
  if (initialised) {
890
  return;
891
- }
892
 
893
- document.body.addEventListener('click', onElementClick, true);
894
-
895
- try {
896
- pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;
897
- } catch (e) {
898
- pageViews = 0;
899
- }
900
-
901
- siteTimer = new Timer(0);
902
- pageTimer = new Timer(0); // insert styles into DOM
903
 
904
  var styleElement = document.createElement('style');
905
  styleElement.setAttribute("type", "text/css");
906
  styleElement.innerHTML = styles;
907
- document.head.appendChild(styleElement); // init exit intent trigger
908
-
909
- new ExitIntent(showBoxesWithExitIntentTrigger); // start timers
910
 
911
- timers.start();
912
- scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true);
913
- scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true);
914
- window.addEventListener('resize', throttle(recalculateHeights));
 
 
915
  window.addEventListener('load', recalculateHeights);
916
- window.setInterval(checkTimeCriteria, 1000);
917
- window.setTimeout(checkPageViewsCriteria, 1000);
918
- document.addEventListener('keyup', onKeyUp); // stop timers when leaving page or switching to other tab
919
-
920
- document.addEventListener("visibilitychange", function () {
921
- document.hidden ? timers.stop() : timers.start();
922
- });
923
- window.addEventListener('beforeunload', function () {
924
- timers.stop();
925
- sessionStorage.setItem('boxzilla_pageviews', ++pageViews);
926
- });
927
  Boxzilla.trigger('ready');
928
  initialised = true; // ensure this function doesn't run again
929
  };
@@ -953,10 +801,8 @@ Boxzilla.create = function (id, opts) {
953
 
954
  Boxzilla.get = function (id) {
955
  for (var i = 0; i < boxes.length; i++) {
956
- var box = boxes[i];
957
-
958
- if (box.id == id) {
959
- return box;
960
  }
961
  }
962
 
@@ -970,7 +816,7 @@ Boxzilla.dismiss = function (id, animate) {
970
  Boxzilla.get(id).dismiss(animate);
971
  } else {
972
  boxes.forEach(function (box) {
973
- box.dismiss(animate);
974
  });
975
  }
976
  };
@@ -980,7 +826,7 @@ Boxzilla.hide = function (id, animate) {
980
  Boxzilla.get(id).hide(animate);
981
  } else {
982
  boxes.forEach(function (box) {
983
- box.hide(animate);
984
  });
985
  }
986
  };
@@ -990,7 +836,7 @@ Boxzilla.show = function (id, animate) {
990
  Boxzilla.get(id).show(animate);
991
  } else {
992
  boxes.forEach(function (box) {
993
- box.show(animate);
994
  });
995
  }
996
  };
@@ -1000,7 +846,7 @@ Boxzilla.toggle = function (id, animate) {
1000
  Boxzilla.get(id).toggle(animate);
1001
  } else {
1002
  boxes.forEach(function (box) {
1003
- box.toggle(animate);
1004
  });
1005
  }
1006
  }; // expose each individual box.
@@ -1014,21 +860,21 @@ if (typeof module !== 'undefined' && module.exports) {
1014
  module.exports = Boxzilla;
1015
  }
1016
 
1017
- },{"./box.js":3,"./events.js":5,"./styles.js":6,"./timer.js":7,"./triggers/exit-intent.js":8}],5:[function(require,module,exports){
1018
  'use strict';
1019
 
1020
  var EventEmitter = require('wolfy87-eventemitter');
1021
 
1022
  module.exports = Object.create(EventEmitter.prototype);
1023
 
1024
- },{"wolfy87-eventemitter":9}],6:[function(require,module,exports){
1025
  "use strict";
1026
 
1027
  var styles = "#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}";
1028
  module.exports = styles;
1029
 
1030
  },{}],7:[function(require,module,exports){
1031
- 'use strict';
1032
 
1033
  var Timer = function Timer(start) {
1034
  this.time = start;
@@ -1055,19 +901,24 @@ Timer.prototype.stop = function () {
1055
  module.exports = Timer;
1056
 
1057
  },{}],8:[function(require,module,exports){
1058
- 'use strict';
1059
 
1060
- module.exports = function (callback) {
1061
  var timeout = null;
1062
  var touchStart = {};
1063
 
1064
- function triggerCallback() {
1065
  document.documentElement.removeEventListener('mouseleave', onMouseLeave);
1066
  document.documentElement.removeEventListener('mouseenter', onMouseEnter);
1067
  document.documentElement.removeEventListener('click', clearTimeout);
1068
  window.removeEventListener('touchstart', onTouchStart);
1069
- window.removeEventListener('touchend', onTouchEnd);
1070
- callback();
 
 
 
 
 
1071
  }
1072
 
1073
  function clearTimeout() {
@@ -1096,7 +947,7 @@ module.exports = function (callback) {
1096
  // add small exception space in the top-right corner
1097
 
1098
  if (evt.clientY <= getAddressBarY() && evt.clientX < 0.80 * window.innerWidth) {
1099
- timeout = window.setTimeout(triggerCallback, 400);
1100
  }
1101
  }
1102
 
@@ -1129,7 +980,7 @@ module.exports = function (callback) {
1129
  return;
1130
  }
1131
 
1132
- timeout = window.setTimeout(triggerCallback, 800);
1133
  }
1134
 
1135
  window.addEventListener('touchstart', onTouchStart);
@@ -1140,6 +991,137 @@ module.exports = function (callback) {
1140
  };
1141
 
1142
  },{}],9:[function(require,module,exports){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1143
  /*!
1144
  * EventEmitter v5.2.8 - git.io/ee
1145
  * Unlicense - http://unlicense.org/
108
  }
109
 
110
  function maybeOpenMailChimpForWordPressBox() {
111
+ if ((_typeof(window.mc4wp_forms_config) !== "object" || !window.mc4wp_forms_config.submitted_form) && _typeof(window.mc4wp_submitted_form) !== "object") {
112
  return;
113
  }
114
 
115
+ var submitted_form = window.mc4wp_submitted_form || window.mc4wp_forms_config.submitted_form;
116
+ var selector = '#' + submitted_form.element_id;
117
+ Boxzilla.boxes.forEach(function (box) {
 
 
 
 
 
 
 
118
  if (box.element.querySelector(selector)) {
119
  box.show();
 
120
  }
121
+ });
122
  } // print message when test mode is enabled
123
 
124
 
694
  },{"./animator.js":2,"./events.js":5}],4:[function(require,module,exports){
695
  'use strict';
696
 
 
 
697
  var Boxzilla = require('./events.js');
698
 
699
  var Box = require('./box.js');
700
 
701
+ var util = require('./util.js');
 
 
 
 
 
702
 
703
  var styles = require('./styles.js');
704
 
705
  var ExitIntent = require('./triggers/exit-intent.js');
706
 
707
+ var Scroll = require('./triggers/scroll.js');
 
 
 
 
 
 
708
 
709
+ var Pageviews = require('./triggers/pageviews.js');
710
+
711
+ var Time = require('./triggers/time.js');
 
 
 
 
 
 
 
 
 
 
712
 
713
+ var initialised = false;
714
+ var boxes = []; // "keyup" listener
715
 
716
  function onKeyUp(e) {
717
  if (e.keyCode === 27) {
718
  Boxzilla.dismiss();
719
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  } // recalculate heights and variables based on height
721
 
722
 
723
  function recalculateHeights() {
724
  boxes.forEach(function (box) {
725
+ return box.onResize();
726
  });
727
  }
728
 
729
+ function onElementClick(evt) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
730
  // find <a> element in up to 3 parent elements
731
+ var el = evt.target || evt.srcElement;
732
  var depth = 3;
733
 
734
  for (var i = 0; i <= depth; i++) {
739
  el = el.parentElement;
740
  }
741
 
742
+ if (!el || el.tagName !== 'A' || !el.href) {
743
  return;
744
  }
745
 
746
+ var href = el.href.toLowerCase();
747
  var match = href.match(/[#&]boxzilla-(\d+)/);
748
 
749
  if (match && match.length > 1) {
750
  var boxId = match[1];
751
  Boxzilla.toggle(boxId);
752
  }
753
+ } // initialise & add event listeners
754
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
755
 
756
  Boxzilla.init = function () {
757
  if (initialised) {
758
  return;
759
+ } // insert styles into DOM
760
 
 
 
 
 
 
 
 
 
 
 
761
 
762
  var styleElement = document.createElement('style');
763
  styleElement.setAttribute("type", "text/css");
764
  styleElement.innerHTML = styles;
765
+ document.head.appendChild(styleElement); // init exit intent triggershow
 
 
766
 
767
+ new ExitIntent(boxes);
768
+ new Pageviews(boxes);
769
+ new Scroll(boxes);
770
+ new Time(boxes);
771
+ document.body.addEventListener('click', onElementClick, true);
772
+ window.addEventListener('resize', util.throttle(recalculateHeights));
773
  window.addEventListener('load', recalculateHeights);
774
+ document.addEventListener('keyup', onKeyUp);
 
 
 
 
 
 
 
 
 
 
775
  Boxzilla.trigger('ready');
776
  initialised = true; // ensure this function doesn't run again
777
  };
801
 
802
  Boxzilla.get = function (id) {
803
  for (var i = 0; i < boxes.length; i++) {
804
+ if (boxes[i].id == id) {
805
+ return boxes[i];
 
 
806
  }
807
  }
808
 
816
  Boxzilla.get(id).dismiss(animate);
817
  } else {
818
  boxes.forEach(function (box) {
819
+ return box.dismiss(animate);
820
  });
821
  }
822
  };
826
  Boxzilla.get(id).hide(animate);
827
  } else {
828
  boxes.forEach(function (box) {
829
+ return box.hide(animate);
830
  });
831
  }
832
  };
836
  Boxzilla.get(id).show(animate);
837
  } else {
838
  boxes.forEach(function (box) {
839
+ return box.show(animate);
840
  });
841
  }
842
  };
846
  Boxzilla.get(id).toggle(animate);
847
  } else {
848
  boxes.forEach(function (box) {
849
+ return box.toggle(animate);
850
  });
851
  }
852
  }; // expose each individual box.
860
  module.exports = Boxzilla;
861
  }
862
 
863
+ },{"./box.js":3,"./events.js":5,"./styles.js":6,"./triggers/exit-intent.js":8,"./triggers/pageviews.js":9,"./triggers/scroll.js":10,"./triggers/time.js":11,"./util.js":12}],5:[function(require,module,exports){
864
  'use strict';
865
 
866
  var EventEmitter = require('wolfy87-eventemitter');
867
 
868
  module.exports = Object.create(EventEmitter.prototype);
869
 
870
+ },{"wolfy87-eventemitter":13}],6:[function(require,module,exports){
871
  "use strict";
872
 
873
  var styles = "#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}";
874
  module.exports = styles;
875
 
876
  },{}],7:[function(require,module,exports){
877
+ "use strict";
878
 
879
  var Timer = function Timer(start) {
880
  this.time = start;
901
  module.exports = Timer;
902
 
903
  },{}],8:[function(require,module,exports){
904
+ "use strict";
905
 
906
+ module.exports = function (boxes) {
907
  var timeout = null;
908
  var touchStart = {};
909
 
910
+ function trigger() {
911
  document.documentElement.removeEventListener('mouseleave', onMouseLeave);
912
  document.documentElement.removeEventListener('mouseenter', onMouseEnter);
913
  document.documentElement.removeEventListener('click', clearTimeout);
914
  window.removeEventListener('touchstart', onTouchStart);
915
+ window.removeEventListener('touchend', onTouchEnd); // show boxes with exit intent trigger
916
+
917
+ boxes.forEach(function (box) {
918
+ if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {
919
+ box.trigger();
920
+ }
921
+ });
922
  }
923
 
924
  function clearTimeout() {
947
  // add small exception space in the top-right corner
948
 
949
  if (evt.clientY <= getAddressBarY() && evt.clientX < 0.80 * window.innerWidth) {
950
+ timeout = window.setTimeout(trigger, 400);
951
  }
952
  }
953
 
980
  return;
981
  }
982
 
983
+ timeout = window.setTimeout(trigger, 800);
984
  }
985
 
986
  window.addEventListener('touchstart', onTouchStart);
991
  };
992
 
993
  },{}],9:[function(require,module,exports){
994
+ "use strict";
995
+
996
+ module.exports = function (boxes) {
997
+ var pageviews;
998
+
999
+ try {
1000
+ pageviews = sessionStorage.getItem('boxzilla_pageviews') || 0;
1001
+ sessionStorage.setItem('boxzilla_pageviews', ++pageviews);
1002
+ } catch (e) {
1003
+ pageviews = 0;
1004
+ }
1005
+
1006
+ window.setTimeout(function () {
1007
+ boxes.forEach(function (box) {
1008
+ if (box.config.trigger.method === 'pageviews' && pageviews >= box.config.trigger.value && box.mayAutoShow()) {
1009
+ box.trigger();
1010
+ }
1011
+ });
1012
+ }, 1000);
1013
+ };
1014
+
1015
+ },{}],10:[function(require,module,exports){
1016
+ "use strict";
1017
+
1018
+ var throttle = require('../util.js').throttle;
1019
+
1020
+ module.exports = function (boxes) {
1021
+ // check triggerHeight criteria for all boxes
1022
+ function checkHeightCriteria() {
1023
+ var scrollY = window.hasOwnProperty('pageYOffset') ? window.pageYOffset : window.scrollTop;
1024
+ scrollY = scrollY + window.innerHeight * 0.9;
1025
+ boxes.forEach(function (box) {
1026
+ if (!box.mayAutoShow() || box.triggerHeight <= 0) {
1027
+ return;
1028
+ }
1029
+
1030
+ if (scrollY > box.triggerHeight) {
1031
+ box.trigger();
1032
+ } // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box
1033
+
1034
+
1035
+ if (box.mayRehide() && scrollY < box.triggerHeight - 5) {
1036
+ box.hide();
1037
+ }
1038
+ });
1039
+ }
1040
+
1041
+ window.addEventListener('touchstart', throttle(checkHeightCriteria), true);
1042
+ window.addEventListener('scroll', throttle(checkHeightCriteria), true);
1043
+ };
1044
+
1045
+ },{"../util.js":12}],11:[function(require,module,exports){
1046
+ "use strict";
1047
+
1048
+ var Timer = require('../timer.js');
1049
+
1050
+ module.exports = function (boxes) {
1051
+ var siteTimer = new Timer(0);
1052
+ var pageTimer = new Timer(0);
1053
+ var timers = {
1054
+ start: function start() {
1055
+ try {
1056
+ var sessionTime = parseInt(sessionStorage.getItem('boxzilla_timer'));
1057
+
1058
+ if (sessionTime) {
1059
+ siteTimer.time = sessionTime;
1060
+ }
1061
+ } catch (e) {}
1062
+
1063
+ siteTimer.start();
1064
+ pageTimer.start();
1065
+ },
1066
+ stop: function stop() {
1067
+ sessionStorage.setItem('boxzilla_timer', siteTimer.time);
1068
+ siteTimer.stop();
1069
+ pageTimer.stop();
1070
+ }
1071
+ }; // start timers
1072
+
1073
+ timers.start(); // stop timers when leaving page or switching to other tab
1074
+
1075
+ document.addEventListener("visibilitychange", function () {
1076
+ document.hidden ? timers.stop() : timers.start();
1077
+ });
1078
+ window.addEventListener('beforeunload', function () {
1079
+ timers.stop();
1080
+ });
1081
+ window.setInterval(function () {
1082
+ boxes.forEach(function (box) {
1083
+ if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value && box.mayAutoShow()) {
1084
+ box.trigger();
1085
+ }
1086
+
1087
+ if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value && box.mayAutoShow()) {
1088
+ box.trigger();
1089
+ }
1090
+ });
1091
+ }, 1000);
1092
+ };
1093
+
1094
+ },{"../timer.js":7}],12:[function(require,module,exports){
1095
+ "use strict";
1096
+
1097
+ function throttle(fn, threshold, scope) {
1098
+ threshold || (threshold = 600);
1099
+ var last;
1100
+ var deferTimer;
1101
+ return function () {
1102
+ var context = scope || this;
1103
+ var now = +new Date(),
1104
+ args = arguments;
1105
+
1106
+ if (last && now < last + threshold) {
1107
+ // hold on to it
1108
+ clearTimeout(deferTimer);
1109
+ deferTimer = setTimeout(function () {
1110
+ last = now;
1111
+ fn.apply(context, args);
1112
+ }, threshold);
1113
+ } else {
1114
+ last = now;
1115
+ fn.apply(context, args);
1116
+ }
1117
+ };
1118
+ }
1119
+
1120
+ module.exports = {
1121
+ throttle: throttle
1122
+ };
1123
+
1124
+ },{}],13:[function(require,module,exports){
1125
  /*!
1126
  * EventEmitter v5.2.8 - git.io/ee
1127
  * Unlicense - http://unlicense.org/
assets/js/script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var l=void 0;!function r(s,l,c){function a(e,t){if(!l[e]){if(!s[e]){var i=!1;if(!t&&i)return i(e,!0);if(d)return d(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var o=l[e]={exports:{}};s[e][0].call(o.exports,function(t){return a(s[e][1][t]||t)},o,o.exports,r,s,l,c)}return l[e].exports}for(var d=!1,t=0;t<c.length;t++)a(c[t]);return a}({1:[function(t,e,i){"use strict";function d(t){return(d="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(){var s=t("boxzilla"),l=window.boxzilla_options;function c(t){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.match(/[#&](boxzilla-\d+)/);if(!e||"object"!==d(e)||e.length<2)return!1;var i=e[1];return i===t.element.id||!!t.element.querySelector("#"+i)}window.Boxzilla=s;var a=-1<document.body.className.indexOf("logged-in");a&&l.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),s.init(),window.addEventListener("load",function(){if(!l.inited){for(var t in l.boxes){var e=l.boxes[t];e.testMode=a&&l.testMode;var i=document.getElementById("boxzilla-box-"+e.id+"-content");if(i){e.content=i;var n=s.create(e.id,e);n.element.className=n.element.className+" boxzilla-"+e.post.slug,o=n.element,(r=e.css).background_color&&(o.style.background=r.background_color),r.color&&(o.style.color=r.color),r.border_color&&(o.style.borderColor=r.border_color),r.border_width&&(o.style.borderWidth=parseInt(r.border_width)+"px"),r.border_style&&(o.style.borderStyle=r.border_style),r.width&&(o.style.maxWidth=parseInt(r.width)+"px");try{n.element.firstChild.firstChild.className+=" first-child",n.element.firstChild.lastChild.className+=" last-child"}catch(t){}n.fits()&&c(n)&&n.show()}}var o,r;l.inited=!0,s.trigger("done"),function(){if("object"!==d(window.mc4wp_forms_config)||!window.mc4wp_forms_config.submitted_form)return;var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=s.boxes;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n.element.querySelector(t))return n.show()}}()}})}()},{boxzilla:4}],2:[function(t,e,i){"use strict";var o=320;function a(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i])}function d(a,d,h){var u=+new Date,t=window.getComputedStyle(a),f={},g={};for(var e in d)if(d.hasOwnProperty(e)){d[e]=parseFloat(d[e]);var i=d[e],n=parseFloat(t[e]);n!=i?(g[e]=(i-n)/o,f[e]=n):delete d[e]}!function t(){var e,i,n,o,r=+new Date-u,s=!0;for(var l in d)if(d.hasOwnProperty(l)){e=g[l],i=d[l],n=e*r,o=f[l]+n,0<e&&i<=o||e<0&&o<=i?o=i:s=!1,f[l]=o;var c="opacity"!==l?"px":"";a.style[l]=o+c}u=+new Date,s?h&&h():window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,32)}()}e.exports={toggle:function(t,e,i){function n(){t.removeAttribute("data-animated"),t.setAttribute("style",l.getAttribute("style")),t.style.display=s?"none":"",i&&i()}var o,r,s="none"!==t.style.display||0<t.offsetLeft,l=t.cloneNode(!0);if(t.setAttribute("data-animated","true"),s||(t.style.display=""),"slide"===e){if(o=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),r={},!s){if(r=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],window.getComputedStyle(t)),!isFinite(r.height)){var c=t.getBoundingClientRect();r.height=c.height}a(t,o)}t.style.overflowY="hidden",d(t,s?o:r,n)}else o={opacity:0},r={opacity:1},s||a(t,o),d(t,s?o:r,n)},animate:d,animated:function(t){return!!t.getAttribute("data-animated")}}},{}],3:[function(t,e,i){"use strict";var n={animation:"fade",rehide:!1,content:"",cookie:null,icon:"&times",screenWidthCondition:null,position:"center",testMode:!1,trigger:!1,closable:!0},r=t("./events.js"),o=t("./animator.js");function s(t,e){this.id=t,this.config=function(t,e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);for(var o in e)e.hasOwnProperty(o)&&(i[o]=e[o]);return i}(n,e),this.overlay=document.createElement("div"),this.overlay.style.display="none",this.overlay.id="boxzilla-overlay-"+this.id,this.overlay.classList.add("boxzilla-overlay"),document.body.appendChild(this.overlay),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()}s.prototype.events=function(){var o=this;this.closeIcon&&this.closeIcon.addEventListener("click",function(t){t.preventDefault(),o.dismiss()}),this.element.addEventListener("click",function(t){"A"===t.target.tagName&&r.trigger("box.interactions.link",[o,t.target])},!1),this.element.addEventListener("submit",function(t){o.setCookie(),r.trigger("box.interactions.form",[o,t.target])},!1),this.overlay.addEventListener("click",function(t){var e=t.offsetX,i=t.offsetY,n=o.element.getBoundingClientRect();(e<n.left-40||e>n.right+40||i<n.top-40||i>n.bottom+40)&&o.dismiss()})},s.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e,i=document.createElement("div");if(i.setAttribute("id","boxzilla-"+this.id),i.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,i.style.display="none",t.appendChild(i),"string"==typeof this.config.content?(e=document.createElement("div")).innerHTML=this.config.content:(e=this.config.content).style.display="",e.className="boxzilla-content",i.appendChild(e),this.config.closable&&this.config.icon){var n=document.createElement("span");n.className="boxzilla-close-icon",n.innerHTML=this.config.icon,i.appendChild(n),this.closeIcon=n}document.body.appendChild(t),this.contentElement=e,this.element=i},s.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="",this.element.style.maxHeight="";var e=window.innerHeight,i=this.element.clientHeight;if(e<i&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(e-i)/2;n=0<=n?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=t},s.prototype.toggle=function(t,e){return e=void 0===e||e,(t=void 0===t?!this.visible:t)!==this.visible&&(!o.animated(this.element)&&(!(!t&&!this.config.closable)&&(this.visible=t,this.setCustomBoxStyling(),r.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),e?o.toggle(this.overlay,"fade"):this.overlay.style.display=t?"":"none"),e?o.toggle(this.element,this.config.animation,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)):this.element.style.display=t?"":"none",!0)))},s.prototype.show=function(t){return this.toggle(!0,t)},s.prototype.hide=function(t){return this.toggle(!1,t)},s.prototype.calculateTriggerHeight=function(){var t=0;if(this.config.trigger)if("element"===this.config.trigger.method){var e=document.body.querySelector(this.config.trigger.value);if(e)t=e.getBoundingClientRect().top}else"percentage"===this.config.trigger.method&&(t=this.config.trigger.value/100*function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}());return t},s.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},s.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},s.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},s.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},s.prototype.isCookieSet=function(){return!(this.config.testMode||!this.config.trigger)&&(!(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)&&"true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))},s.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},s.prototype.trigger=function(){this.show()&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},s.prototype.dismiss=function(t){return!!this.visible&&(this.hide(t),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,r.trigger("box.dismiss",[this]),!0)},e.exports=s},{"./animator.js":2,"./events.js":5}],4:[function(t,e,i){"use strict";var n,o,r,s=t("./timer.js"),l=t("./events.js"),c=t("./box.js"),a=[],d=window,h=!1,u=t("./styles.js"),f=t("./triggers/exit-intent.js");function g(n,o,r){var s,l;return o=o||250,function(){var t=r||this,e=+new Date,i=arguments;s&&e<s+o?(clearTimeout(l),l=setTimeout(function(){s=e,n.apply(t,i)},o)):(s=e,n.apply(t,i))}}function m(t){27===t.keyCode&&l.dismiss()}function p(){x()||a.forEach(function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&r>=t.config.trigger.value&&t.trigger()})}function v(){x()||a.forEach(function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&n.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&o.time>=t.config.trigger.value&&t.trigger())})}function y(){var e=d.hasOwnProperty("pageYOffset")?d.pageYOffset:d.scrollTop;e+=.9*window.innerHeight,a.forEach(function(t){if(t.mayAutoShow()&&!(t.triggerHeight<=0)){if(e>t.triggerHeight){if(x())return;t.trigger()}t.mayRehide()&&e<t.triggerHeight-5&&t.hide()}})}function b(){a.forEach(function(t){t.onResize()})}function w(){x()||a.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()})}function x(){return 0<a.filter(function(t){return t.visible}).length}function E(t){for(var e=t.target||t.srcElement,i=0;i<=3&&(e&&"A"!==e.tagName);i++)e=e.parentElement;if(e&&"A"===e.tagName&&e.getAttribute("href")){var n=e.getAttribute("href").toLowerCase().match(/[#&]boxzilla-(\d+)/);if(n&&1<n.length){var o=n[1];l.toggle(o)}}}var L=function(){try{var t=sessionStorage.getItem("boxzilla_timer");t&&(n.time=t)}catch(t){}n.start(),o.start()},z=function(){sessionStorage.setItem("boxzilla_timer",n.time),n.stop(),o.stop()};l.init=function(){if(!h){document.body.addEventListener("click",E,!0);try{r=sessionStorage.getItem("boxzilla_pageviews")||0}catch(t){r=0}n=new s(0),o=new s(0);var t=document.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=u,document.head.appendChild(t),new f(w),L(),d.addEventListener("touchstart",g(y),!0),d.addEventListener("scroll",g(y),!0),window.addEventListener("resize",g(b)),window.addEventListener("load",b),window.setInterval(v,1e3),window.setTimeout(p,1e3),document.addEventListener("keyup",m),document.addEventListener("visibilitychange",function(){document.hidden?z():L()}),window.addEventListener("beforeunload",function(){z(),sessionStorage.setItem("boxzilla_pageviews",++r)}),l.trigger("ready"),h=!0}},l.create=function(t,e){void 0!==e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new c(t,e);return a.push(i),i},l.get=function(t){for(var e=0;e<a.length;e++){var i=a[e];if(i.id==t)return i}throw new Error("No box exists with ID "+t)},l.dismiss=function(t,e){t?l.get(t).dismiss(e):a.forEach(function(t){t.dismiss(e)})},l.hide=function(t,e){t?l.get(t).hide(e):a.forEach(function(t){t.hide(e)})},l.show=function(t,e){t?l.get(t).show(e):a.forEach(function(t){t.show(e)})},l.toggle=function(t,e){t?l.get(t).toggle(e):a.forEach(function(t){t.toggle(e)})},l.boxes=a,window.Boxzilla=l,void 0!==e&&e.exports&&(e.exports=l)},{"./box.js":3,"./events.js":5,"./styles.js":6,"./timer.js":7,"./triggers/exit-intent.js":8}],5:[function(t,e,i){"use strict";var n=t("wolfy87-eventemitter");e.exports=Object.create(n.prototype)},{"wolfy87-eventemitter":9}],6:[function(t,e,i){"use strict";e.exports="#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"},{}],7:[function(t,e,i){"use strict";function n(t){this.time=t,this.interval=0}n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}],8:[function(t,e,i){"use strict";e.exports=function(t){var e=null,i={};function n(){document.documentElement.removeEventListener("mouseleave",s),document.documentElement.removeEventListener("mouseenter",r),document.documentElement.removeEventListener("click",o),window.removeEventListener("touchstart",l),window.removeEventListener("touchend",c),t()}function o(){null!==e&&(window.clearTimeout(e),e=null)}function r(t){o()}function s(t){o(),t.clientY<=(document.documentMode||/Edge\//.test(navigator.userAgent)?5:0)&&t.clientX<.8*window.innerWidth&&(e=window.setTimeout(n,400))}function l(t){o(),i={timestamp:performance.now(),scrollY:window.scrollY,windowHeight:window.innerHeight}}function c(t){o(),window.innerHeight>i.windowHeight||window.scrollY+20>=i.scrollY||300<performance.now()-i.timestamp||-1<["A","INPUT","BUTTON"].indexOf(t.target.tagName)||(e=window.setTimeout(n,800))}window.addEventListener("touchstart",l),window.addEventListener("touchend",c),document.documentElement.addEventListener("mouseenter",r),document.documentElement.addEventListener("mouseleave",s),document.documentElement.addEventListener("click",o)}},{}],9:[function(t,s,e){!function(t){"use strict";function e(){}var i=e.prototype,n=t.EventEmitter;function r(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}i.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp)for(i in e={},n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i]);else e=n[t]||(n[t]=[]);return e},i.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},i.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},i.addListener=function(t,e){if(!function t(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&t(e.listener)}(e))throw new TypeError("listener must be a function");var i,n=this.getListenersAsObject(t),o="object"==typeof e;for(i in n)n.hasOwnProperty(i)&&-1===r(n[i],e)&&n[i].push(o?e:{listener:e,once:!1});return this},i.on=o("addListener"),i.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},i.once=o("addOnceListener"),i.defineEvent=function(t){return this.getListeners(t),this},i.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},i.removeListener=function(t,e){var i,n,o=this.getListenersAsObject(t);for(n in o)o.hasOwnProperty(n)&&-1!==(i=r(o[n],e))&&o[n].splice(i,1);return this},i.off=o("removeListener"),i.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},i.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},i.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},i.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"==i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},i.removeAllListeners=o("removeEvent"),i.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].slice(0),o=0;o<i.length;o++)!0===(n=i[o]).once&&this.removeListener(t,n.listener),n.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},i.trigger=o("emitEvent"),i.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},i.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return t.EventEmitter=n,e},"function"==typeof l&&l.amd?l(function(){return e}):"object"==typeof s&&s.exports?s.exports=e:t.EventEmitter=e}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=script.min.js.map
1
+ !function(){var l=void 0;!function r(s,l,c){function a(e,t){if(!l[e]){if(!s[e]){var i=!1;if(!t&&i)return i(e,!0);if(d)return d(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var o=l[e]={exports:{}};s[e][0].call(o.exports,function(t){return a(s[e][1][t]||t)},o,o.exports,r,s,l,c)}return l[e].exports}for(var d=!1,t=0;t<c.length;t++)a(c[t]);return a}({1:[function(t,e,i){"use strict";function d(t){return(d="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(){var s=t("boxzilla"),l=window.boxzilla_options;function c(t){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.match(/[#&](boxzilla-\d+)/);if(!e||"object"!==d(e)||e.length<2)return!1;var i=e[1];return i===t.element.id||!!t.element.querySelector("#"+i)}window.Boxzilla=s;var a=-1<document.body.className.indexOf("logged-in");a&&l.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),s.init(),window.addEventListener("load",function(){if(!l.inited){for(var t in l.boxes){var e=l.boxes[t];e.testMode=a&&l.testMode;var i=document.getElementById("boxzilla-box-"+e.id+"-content");if(i){e.content=i;var n=s.create(e.id,e);n.element.className=n.element.className+" boxzilla-"+e.post.slug,o=n.element,(r=e.css).background_color&&(o.style.background=r.background_color),r.color&&(o.style.color=r.color),r.border_color&&(o.style.borderColor=r.border_color),r.border_width&&(o.style.borderWidth=parseInt(r.border_width)+"px"),r.border_style&&(o.style.borderStyle=r.border_style),r.width&&(o.style.maxWidth=parseInt(r.width)+"px");try{n.element.firstChild.firstChild.className+=" first-child",n.element.firstChild.lastChild.className+=" last-child"}catch(t){}n.fits()&&c(n)&&n.show()}}var o,r;l.inited=!0,s.trigger("done"),function(){if(("object"!==d(window.mc4wp_forms_config)||!window.mc4wp_forms_config.submitted_form)&&"object"!==d(window.mc4wp_submitted_form))return;var e="#"+(window.mc4wp_submitted_form||window.mc4wp_forms_config.submitted_form).element_id;s.boxes.forEach(function(t){t.element.querySelector(e)&&t.show()})}()}})}()},{boxzilla:4}],2:[function(t,e,i){"use strict";var o=320;function a(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i])}function d(a,d,u){var h=+new Date,t=window.getComputedStyle(a),f={},g={};for(var e in d)if(d.hasOwnProperty(e)){d[e]=parseFloat(d[e]);var i=d[e],n=parseFloat(t[e]);n!=i?(g[e]=(i-n)/o,f[e]=n):delete d[e]}!function t(){var e,i,n,o,r=+new Date-h,s=!0;for(var l in d)if(d.hasOwnProperty(l)){e=g[l],i=d[l],n=e*r,o=f[l]+n,0<e&&i<=o||e<0&&o<=i?o=i:s=!1,f[l]=o;var c="opacity"!==l?"px":"";a.style[l]=o+c}h=+new Date,s?u&&u():window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,32)}()}e.exports={toggle:function(t,e,i){function n(){t.removeAttribute("data-animated"),t.setAttribute("style",l.getAttribute("style")),t.style.display=s?"none":"",i&&i()}var o,r,s="none"!==t.style.display||0<t.offsetLeft,l=t.cloneNode(!0);if(t.setAttribute("data-animated","true"),s||(t.style.display=""),"slide"===e){if(o=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),r={},!s){if(r=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],window.getComputedStyle(t)),!isFinite(r.height)){var c=t.getBoundingClientRect();r.height=c.height}a(t,o)}t.style.overflowY="hidden",d(t,s?o:r,n)}else o={opacity:0},r={opacity:1},s||a(t,o),d(t,s?o:r,n)},animate:d,animated:function(t){return!!t.getAttribute("data-animated")}}},{}],3:[function(t,e,i){"use strict";var n={animation:"fade",rehide:!1,content:"",cookie:null,icon:"&times",screenWidthCondition:null,position:"center",testMode:!1,trigger:!1,closable:!0},r=t("./events.js"),o=t("./animator.js");function s(t,e){this.id=t,this.config=function(t,e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);for(var o in e)e.hasOwnProperty(o)&&(i[o]=e[o]);return i}(n,e),this.overlay=document.createElement("div"),this.overlay.style.display="none",this.overlay.id="boxzilla-overlay-"+this.id,this.overlay.classList.add("boxzilla-overlay"),document.body.appendChild(this.overlay),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()}s.prototype.events=function(){var o=this;this.closeIcon&&this.closeIcon.addEventListener("click",function(t){t.preventDefault(),o.dismiss()}),this.element.addEventListener("click",function(t){"A"===t.target.tagName&&r.trigger("box.interactions.link",[o,t.target])},!1),this.element.addEventListener("submit",function(t){o.setCookie(),r.trigger("box.interactions.form",[o,t.target])},!1),this.overlay.addEventListener("click",function(t){var e=t.offsetX,i=t.offsetY,n=o.element.getBoundingClientRect();(e<n.left-40||e>n.right+40||i<n.top-40||i>n.bottom+40)&&o.dismiss()})},s.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e,i=document.createElement("div");if(i.setAttribute("id","boxzilla-"+this.id),i.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,i.style.display="none",t.appendChild(i),"string"==typeof this.config.content?(e=document.createElement("div")).innerHTML=this.config.content:(e=this.config.content).style.display="",e.className="boxzilla-content",i.appendChild(e),this.config.closable&&this.config.icon){var n=document.createElement("span");n.className="boxzilla-close-icon",n.innerHTML=this.config.icon,i.appendChild(n),this.closeIcon=n}document.body.appendChild(t),this.contentElement=e,this.element=i},s.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="",this.element.style.maxHeight="";var e=window.innerHeight,i=this.element.clientHeight;if(e<i&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(e-i)/2;n=0<=n?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=t},s.prototype.toggle=function(t,e){return e=void 0===e||e,(t=void 0===t?!this.visible:t)!==this.visible&&(!o.animated(this.element)&&(!(!t&&!this.config.closable)&&(this.visible=t,this.setCustomBoxStyling(),r.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),e?o.toggle(this.overlay,"fade"):this.overlay.style.display=t?"":"none"),e?o.toggle(this.element,this.config.animation,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)):this.element.style.display=t?"":"none",!0)))},s.prototype.show=function(t){return this.toggle(!0,t)},s.prototype.hide=function(t){return this.toggle(!1,t)},s.prototype.calculateTriggerHeight=function(){var t=0;if(this.config.trigger)if("element"===this.config.trigger.method){var e=document.body.querySelector(this.config.trigger.value);if(e)t=e.getBoundingClientRect().top}else"percentage"===this.config.trigger.method&&(t=this.config.trigger.value/100*function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}());return t},s.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},s.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},s.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},s.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},s.prototype.isCookieSet=function(){return!(this.config.testMode||!this.config.trigger)&&(!(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)&&"true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))},s.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},s.prototype.trigger=function(){this.show()&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},s.prototype.dismiss=function(t){return!!this.visible&&(this.hide(t),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,r.trigger("box.dismiss",[this]),!0)},e.exports=s},{"./animator.js":2,"./events.js":5}],4:[function(t,e,i){"use strict";var r=t("./events.js"),n=t("./box.js"),o=t("./util.js"),s=t("./styles.js"),l=t("./triggers/exit-intent.js"),c=t("./triggers/scroll.js"),a=t("./triggers/pageviews.js"),d=t("./triggers/time.js"),u=!1,h=[];function f(t){27===t.keyCode&&r.dismiss()}function g(){h.forEach(function(t){return t.onResize()})}function m(t){for(var e=t.target||t.srcElement,i=0;i<=3&&(e&&"A"!==e.tagName);i++)e=e.parentElement;if(e&&"A"===e.tagName&&e.href){var n=e.href.toLowerCase().match(/[#&]boxzilla-(\d+)/);if(n&&1<n.length){var o=n[1];r.toggle(o)}}}r.init=function(){if(!u){var t=document.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=s,document.head.appendChild(t),new l(h),new a(h),new c(h),new d(h),document.body.addEventListener("click",m,!0),window.addEventListener("resize",o.throttle(g)),window.addEventListener("load",g),document.addEventListener("keyup",f),r.trigger("ready"),u=!0}},r.create=function(t,e){void 0!==e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new n(t,e);return h.push(i),i},r.get=function(t){for(var e=0;e<h.length;e++)if(h[e].id==t)return h[e];throw new Error("No box exists with ID "+t)},r.dismiss=function(t,e){t?r.get(t).dismiss(e):h.forEach(function(t){return t.dismiss(e)})},r.hide=function(t,e){t?r.get(t).hide(e):h.forEach(function(t){return t.hide(e)})},r.show=function(t,e){t?r.get(t).show(e):h.forEach(function(t){return t.show(e)})},r.toggle=function(t,e){t?r.get(t).toggle(e):h.forEach(function(t){return t.toggle(e)})},r.boxes=h,window.Boxzilla=r,void 0!==e&&e.exports&&(e.exports=r)},{"./box.js":3,"./events.js":5,"./styles.js":6,"./triggers/exit-intent.js":8,"./triggers/pageviews.js":9,"./triggers/scroll.js":10,"./triggers/time.js":11,"./util.js":12}],5:[function(t,e,i){"use strict";var n=t("wolfy87-eventemitter");e.exports=Object.create(n.prototype)},{"wolfy87-eventemitter":13}],6:[function(t,e,i){"use strict";e.exports="#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"},{}],7:[function(t,e,i){"use strict";function n(t){this.time=t,this.interval=0}n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}],8:[function(t,e,i){"use strict";e.exports=function(t){var e=null,i={};function n(){document.documentElement.removeEventListener("mouseleave",s),document.documentElement.removeEventListener("mouseenter",r),document.documentElement.removeEventListener("click",o),window.removeEventListener("touchstart",l),window.removeEventListener("touchend",c),t.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()})}function o(){null!==e&&(window.clearTimeout(e),e=null)}function r(t){o()}function s(t){o(),t.clientY<=(document.documentMode||/Edge\//.test(navigator.userAgent)?5:0)&&t.clientX<.8*window.innerWidth&&(e=window.setTimeout(n,400))}function l(t){o(),i={timestamp:performance.now(),scrollY:window.scrollY,windowHeight:window.innerHeight}}function c(t){o(),window.innerHeight>i.windowHeight||window.scrollY+20>=i.scrollY||300<performance.now()-i.timestamp||-1<["A","INPUT","BUTTON"].indexOf(t.target.tagName)||(e=window.setTimeout(n,800))}window.addEventListener("touchstart",l),window.addEventListener("touchend",c),document.documentElement.addEventListener("mouseenter",r),document.documentElement.addEventListener("mouseleave",s),document.documentElement.addEventListener("click",o)}},{}],9:[function(t,e,i){"use strict";e.exports=function(t){var e;try{e=sessionStorage.getItem("boxzilla_pageviews")||0,sessionStorage.setItem("boxzilla_pageviews",++e)}catch(t){e=0}window.setTimeout(function(){t.forEach(function(t){"pageviews"===t.config.trigger.method&&e>=t.config.trigger.value&&t.mayAutoShow()&&t.trigger()})},1e3)}},{}],10:[function(t,e,i){"use strict";var n=t("../util.js").throttle;e.exports=function(t){function e(){var e=window.hasOwnProperty("pageYOffset")?window.pageYOffset:window.scrollTop;e+=.9*window.innerHeight,t.forEach(function(t){!t.mayAutoShow()||t.triggerHeight<=0||(e>t.triggerHeight&&t.trigger(),t.mayRehide()&&e<t.triggerHeight-5&&t.hide())})}window.addEventListener("touchstart",n(e),!0),window.addEventListener("scroll",n(e),!0)}},{"../util.js":12}],11:[function(t,e,i){"use strict";var r=t("../timer.js");e.exports=function(t){var e=new r(0),i=new r(0),n=function(){try{var t=parseInt(sessionStorage.getItem("boxzilla_timer"));t&&(e.time=t)}catch(t){}e.start(),i.start()},o=function(){sessionStorage.setItem("boxzilla_timer",e.time),e.stop(),i.stop()};n(),document.addEventListener("visibilitychange",function(){document.hidden?o():n()}),window.addEventListener("beforeunload",function(){o()}),window.setInterval(function(){t.forEach(function(t){"time_on_site"===t.config.trigger.method&&e.time>=t.config.trigger.value&&t.mayAutoShow()&&t.trigger(),"time_on_page"===t.config.trigger.method&&i.time>=t.config.trigger.value&&t.mayAutoShow()&&t.trigger()})},1e3)}},{"../timer.js":7}],12:[function(t,e,i){"use strict";e.exports={throttle:function(n,o,r){var s,l;return o=o||600,function(){var t=r||this,e=+new Date,i=arguments;s&&e<s+o?(clearTimeout(l),l=setTimeout(function(){s=e,n.apply(t,i)},o)):(s=e,n.apply(t,i))}}}},{}],13:[function(t,s,e){!function(t){"use strict";function e(){}var i=e.prototype,n=t.EventEmitter;function r(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}i.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp)for(i in e={},n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i]);else e=n[t]||(n[t]=[]);return e},i.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},i.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},i.addListener=function(t,e){if(!function t(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&t(e.listener)}(e))throw new TypeError("listener must be a function");var i,n=this.getListenersAsObject(t),o="object"==typeof e;for(i in n)n.hasOwnProperty(i)&&-1===r(n[i],e)&&n[i].push(o?e:{listener:e,once:!1});return this},i.on=o("addListener"),i.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},i.once=o("addOnceListener"),i.defineEvent=function(t){return this.getListeners(t),this},i.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},i.removeListener=function(t,e){var i,n,o=this.getListenersAsObject(t);for(n in o)o.hasOwnProperty(n)&&-1!==(i=r(o[n],e))&&o[n].splice(i,1);return this},i.off=o("removeListener"),i.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},i.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},i.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},i.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"==i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},i.removeAllListeners=o("removeEvent"),i.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].slice(0),o=0;o<i.length;o++)!0===(n=i[o]).once&&this.removeListener(t,n.listener),n.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},i.trigger=o("emitEvent"),i.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},i.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return t.EventEmitter=n,e},"function"==typeof l&&l.amd?l(function(){return e}):"object"==typeof s&&s.exports?s.exports=e:t.EventEmitter=e}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=script.min.js.map
assets/js/script.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","_typeof","obj","Symbol","iterator","constructor","prototype","Boxzilla","options","window","boxzilla_options","locationHashRefersBox","box","location","hash","match","elementId","element","id","querySelector","isLoggedIn","document","body","className","indexOf","testMode","console","log","init","addEventListener","inited","key","boxes","boxOpts","boxContentElement","getElementById","content","create","post","slug","styles","css","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","firstChild","lastChild","fits","show","trigger","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","maybeOpenMailChimpForWordPressBox","boxzilla","2","duration","property","animate","targetStyles","fn","last","Date","initialStyles","getComputedStyle","currentStyles","propSteps","parseFloat","to","current","tick","step","increment","newValue","timeSinceLastTick","done","_property","suffix","requestAnimationFrame","setTimeout","toggle","animation","callbackFn","cleanup","removeAttribute","setAttribute","clone","getAttribute","display","nowVisible","hiddenStyles","visibleStyles","offsetLeft","cloneNode","properties","value","newObject","initObjectProperties","object","copyObjectProperties","isFinite","height","clientRect","getBoundingClientRect","overflowY","opacity","animated","3","defaults","rehide","cookie","icon","screenWidthCondition","position","closable","events","Animator","Box","config","this","obj1","obj2","obj3","attrname","_attrname","merge","overlay","createElement","classList","add","appendChild","visible","dismissed","triggered","triggerHeight","calculateTriggerHeight","cookieSet","isCookieSet","contentElement","closeIcon","dom","evt","preventDefault","dismiss","target","tagName","setCookie","x","offsetX","y","offsetY","rect","left","right","top","bottom","wrapper","innerHTML","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","clientHeight","newTopMargin","marginTop","bind","hide","method","triggerElement","html","documentElement","Math","max","scrollHeight","offsetHeight","getDocumentHeight","condition","innerWidth","onResize","mayAutoShow","mayRehide","replace","RegExp","hours","expiryDate","setHours","getHours","toUTCString","./animator.js","./events.js","4","siteTimer","pageTimer","pageViews","Timer","scrollElement","initialised","ExitIntent","throttle","threshhold","scope","deferTimer","context","now","args","arguments","clearTimeout","apply","onKeyUp","keyCode","checkPageViewsCriteria","isAnyBoxVisible","forEach","checkTimeCriteria","time","checkHeightCriteria","scrollY","pageYOffset","scrollTop","recalculateHeights","showBoxesWithExitIntentTrigger","filter","b","onElementClick","el","srcElement","parentElement","toLowerCase","timers","sessionTime","sessionStorage","getItem","start","setItem","stop","styleElement","head","setInterval","hidden","opts","minimumScreenWidth","push","get","./box.js","./styles.js","./timer.js","./triggers/exit-intent.js","5","EventEmitter","Object","wolfy87-eventemitter","6","7","interval","clearInterval","8","callback","timeout","touchStart","triggerCallback","removeEventListener","onMouseLeave","onMouseEnter","onTouchStart","onTouchEnd","clientY","documentMode","test","navigator","userAgent","clientX","timestamp","performance","9","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","getListeners","response","_getEvents","flattenListeners","flatListeners","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","on","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,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YjM,KAAKiM,QAAU,KAQ3C9D,EAAauE,WAAa,WAEtB,OADAnV,EAAQ4Q,aAAe2B,EAChB3B,GAIW,mBAAX3R,GAAyBA,EAAOmW,IACvCnW,EAAO,WACH,OAAO2R,IAGY,iBAAXvQ,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAU4Q,EAGjB5Q,EAAQ4Q,aAAeA,EA5d9B,CA8dmB,oBAAX9P,OAAyBA,OAAS2H,MAAQ,KAEjD,KAAK,GAAG,CAAC,IA7lDX","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nfunction _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\n(function () {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n\n var options = window.boxzilla_options; // expose Boxzilla object to window\n\n window.Boxzilla = Boxzilla; // helper function for setting CSS styles\n\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n function createBoxesFromConfig() {\n // failsafe against including script twice.\n if (options.inited) {\n return;\n } // create boxes from options\n\n\n for (var key in options.boxes) {\n // get opts\n var boxOpts = options.boxes[key];\n boxOpts.testMode = isLoggedIn && options.testMode; // find box content element, bail if not found\n\n var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');\n\n if (!boxContentElement) {\n continue;\n } // use element as content option\n\n\n boxOpts.content = boxContentElement; // create box\n\n var box = Boxzilla.create(boxOpts.id, boxOpts); // add box slug to box element as classname\n\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug; // add custom css to box\n\n css(box.element, boxOpts.css);\n\n try {\n box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n } catch (e) {} // maybe show box right away\n\n\n if (box.fits() && locationHashRefersBox(box)) {\n box.show();\n }\n } // set flag to prevent initialising twice\n\n\n options.inited = true; // trigger \"done\" event.\n\n Boxzilla.trigger('done'); // maybe open box with MC4WP form in it\n\n maybeOpenMailChimpForWordPressBox();\n }\n\n function locationHashRefersBox(box) {\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n } // parse \"boxzilla-{id}\" from location hash\n\n\n var match = window.location.hash.match(/[#&](boxzilla-\\d+)/);\n\n if (!match || _typeof(match) !== \"object\" || match.length < 2) {\n return false;\n }\n\n var elementId = match[1];\n\n if (elementId === box.element.id) {\n return true;\n } else if (box.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n }\n\n function maybeOpenMailChimpForWordPressBox() {\n if (_typeof(window.mc4wp_forms_config) !== \"object\" || !window.mc4wp_forms_config.submitted_form) {\n return;\n }\n\n var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;\n var boxes = Boxzilla.boxes;\n\n for (var boxId in boxes) {\n if (!boxes.hasOwnProperty(boxId)) {\n continue;\n }\n\n var box = boxes[boxId];\n\n if (box.element.querySelector(selector)) {\n box.show();\n return;\n }\n }\n } // print message when test mode is enabled\n\n\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n } // init boxzilla\n\n\n Boxzilla.init(); // on window.load, create DOM elements for boxes\n\n window.addEventListener('load', createBoxesFromConfig);\n})();\n\n},{\"boxzilla\":4}],2:[function(require,module,exports){\n'use strict';\n\nvar duration = 320;\n\nfunction css(element, styles) {\n for (var property in styles) {\n if (!styles.hasOwnProperty(property)) {\n continue;\n }\n\n element.style[property] = styles[property];\n }\n}\n\nfunction initObjectProperties(properties, value) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n\n return newObject;\n}\n\nfunction copyObjectProperties(properties, object) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n\n return newObject;\n}\n/**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\n\n\nfunction animated(element) {\n return !!element.getAttribute('data-animated');\n}\n/**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n * @param callbackFn\n */\n\n\nfunction toggle(element, animation, callbackFn) {\n var nowVisible = element.style.display !== 'none' || element.offsetLeft > 0; // create clone for reference\n\n var clone = element.cloneNode(true);\n\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n\n if (callbackFn) {\n callbackFn();\n }\n }; // store attribute so everyone knows we're animating this element\n\n\n element.setAttribute('data-animated', \"true\"); // toggle element visiblity right away if we're making something visible\n\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles;\n var visibleStyles; // animate properties\n\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles); // in some browsers, getComputedStyle returns \"auto\" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.\n\n if (!isFinite(visibleStyles.height)) {\n var clientRect = element.getBoundingClientRect();\n visibleStyles.height = clientRect.height;\n }\n\n css(element, hiddenStyles);\n } // don't show a scrollbar during animation\n\n\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = {\n opacity: 0\n };\n visibleStyles = {\n opacity: 1\n };\n\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n}\n\nfunction animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n if (!targetStyles.hasOwnProperty(property)) {\n continue;\n } // make sure we have an object filled with floats\n\n\n targetStyles[property] = parseFloat(targetStyles[property]); // calculate step size & current value\n\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]); // is there something to do?\n\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n var step, to, increment, newValue;\n\n for (var _property in targetStyles) {\n if (!targetStyles.hasOwnProperty(_property)) {\n continue;\n }\n\n step = propSteps[_property];\n to = targetStyles[_property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[_property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n } // store new value\n\n\n currentStyles[_property] = newValue;\n var suffix = _property !== \"opacity\" ? \"px\" : \"\";\n element.style[_property] = newValue + suffix;\n }\n\n last = +new Date(); // keep going until we're done for all props\n\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n}\n\nmodule.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n};\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'screenWidthCondition': null,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n};\n\nvar events = require('./events.js');\n\nvar Animator = require('./animator.js');\n/**\n* Merge 2 objects, values of the latter overwriting the former.\n*\n* @param obj1\n* @param obj2\n* @returns {*}\n*/\n\n\nfunction merge(obj1, obj2) {\n var obj3 = {}; // add obj1 to obj3\n\n for (var attrname in obj1) {\n if (obj1.hasOwnProperty(attrname)) {\n obj3[attrname] = obj1[attrname];\n }\n } // add obj2 to obj3\n\n\n for (var _attrname in obj2) {\n if (obj2.hasOwnProperty(_attrname)) {\n obj3[_attrname] = obj2[_attrname];\n }\n }\n\n return obj3;\n}\n/**\n* Get the real height of entire document.\n* @returns {number}\n*/\n\n\nfunction getDocumentHeight() {\n var body = document.body;\n var html = document.documentElement;\n return Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n} // Box Object\n\n\nfunction Box(id, config) {\n this.id = id; // store config values\n\n this.config = merge(defaults, config); // add overlay element to dom and store ref to overlay\n\n this.overlay = document.createElement('div');\n this.overlay.style.display = 'none';\n this.overlay.id = 'boxzilla-overlay-' + this.id;\n this.overlay.classList.add('boxzilla-overlay');\n document.body.appendChild(this.overlay); // state\n\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = this.calculateTriggerHeight();\n this.cookieSet = this.isCookieSet();\n this.element = null;\n this.contentElement = null;\n this.closeIcon = null; // create dom elements for this box\n\n this.dom(); // further initialise the box\n\n this.events();\n}\n\n; // initialise the box\n\nBox.prototype.events = function () {\n var box = this; // attach event to \"close\" icon inside box\n\n if (this.closeIcon) {\n this.closeIcon.addEventListener('click', function (evt) {\n evt.preventDefault();\n box.dismiss();\n });\n }\n\n this.element.addEventListener('click', function (evt) {\n if (evt.target.tagName === 'A') {\n events.trigger('box.interactions.link', [box, evt.target]);\n }\n }, false);\n this.element.addEventListener('submit', function (evt) {\n box.setCookie();\n events.trigger('box.interactions.form', [box, evt.target]);\n }, false);\n this.overlay.addEventListener('click', function (e) {\n var x = e.offsetX;\n var y = e.offsetY; // calculate if click was less than 40px outside box to avoid closing it by accident\n\n var rect = box.element.getBoundingClientRect();\n var margin = 40; // if click was not anywhere near box, dismiss it.\n\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n}; // generate dom elements for this box\n\n\nBox.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n var content;\n\n if (typeof this.config.content === \"string\") {\n content = document.createElement('div');\n content.innerHTML = this.config.content;\n } else {\n content = this.config.content; // make sure element is visible\n\n content.style.display = '';\n }\n\n content.className = 'boxzilla-content';\n box.appendChild(content);\n\n if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = \"boxzilla-close-icon\";\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.contentElement = content;\n this.element = box;\n}; // set (calculate) custom box styling depending on box options\n\n\nBox.prototype.setCustomBoxStyling = function () {\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = '';\n this.element.style.maxHeight = ''; // get new dimensions\n\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight; // add scrollbar to box and limit height\n\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n } // set new top margin for boxes which are centered\n\n\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n}; // toggle visibility of the box\n\n\nBox.prototype.toggle = function (show, animate) {\n show = typeof show === \"undefined\" ? !this.visible : show;\n animate = typeof animate === \"undefined\" ? true : animate; // is box already at desired visibility?\n\n if (show === this.visible) {\n return false;\n } // is box being animated?\n\n\n if (Animator.animated(this.element)) {\n return false;\n } // if box should be hidden but is not closable, bail.\n\n\n if (!show && !this.config.closable) {\n return false;\n } // set new visibility status\n\n\n this.visible = show; // calculate new styling rules\n\n this.setCustomBoxStyling(); // trigger event\n\n events.trigger('box.' + (show ? 'show' : 'hide'), [this]); // show or hide box using selected animation\n\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n\n if (animate) {\n Animator.toggle(this.overlay, \"fade\");\n } else {\n this.overlay.style.display = show ? '' : 'none';\n }\n }\n\n if (animate) {\n Animator.toggle(this.element, this.config.animation, function () {\n if (this.visible) {\n return;\n }\n\n this.contentElement.innerHTML = this.contentElement.innerHTML;\n }.bind(this));\n } else {\n this.element.style.display = show ? '' : 'none';\n }\n\n return true;\n}; // show the box\n\n\nBox.prototype.show = function (animate) {\n return this.toggle(true, animate);\n}; // hide the box\n\n\nBox.prototype.hide = function (animate) {\n return this.toggle(false, animate);\n}; // calculate trigger height\n\n\nBox.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger) {\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n }\n\n return triggerHeight;\n};\n\nBox.prototype.fits = function () {\n if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {\n return true;\n }\n\n switch (this.config.screenWidthCondition.condition) {\n case \"larger\":\n return window.innerWidth > this.config.screenWidthCondition.value;\n\n case \"smaller\":\n return window.innerWidth < this.config.screenWidthCondition.value;\n } // meh.. condition should be \"smaller\" or \"larger\", just return true.\n\n\n return true;\n};\n\nBox.prototype.onResize = function () {\n this.triggerHeight = this.calculateTriggerHeight();\n this.setCustomBoxStyling();\n}; // is this box enabled?\n\n\nBox.prototype.mayAutoShow = function () {\n if (this.dismissed) {\n return false;\n } // check if box fits on given minimum screen width\n\n\n if (!this.fits()) {\n return false;\n } // if trigger empty or error in calculating triggerHeight, return false\n\n\n if (!this.config.trigger) {\n return false;\n } // rely on cookie value (show if not set, don't show if set)\n\n\n return !this.cookieSet;\n};\n\nBox.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function () {\n // always show on test mode or when no auto-trigger is configured\n if (this.config.testMode || !this.config.trigger) {\n return false;\n } // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n\n\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n}; // set cookie that disables automatically showing the box\n\n\nBox.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n};\n\nBox.prototype.trigger = function () {\n var shown = this.show();\n\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n};\n/**\n* Dismisses the box and optionally sets a cookie.\n* @param animate\n* @returns {boolean}\n*/\n\n\nBox.prototype.dismiss = function (animate) {\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n } // hide box element\n\n\n this.hide(animate); // set cookie\n\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n events.trigger('box.dismiss', [this]);\n return true;\n};\n\nmodule.exports = Box;\n\n},{\"./animator.js\":2,\"./events.js\":5}],4:[function(require,module,exports){\n'use strict';\n\nvar Timer = require('./timer.js');\n\nvar Boxzilla = require('./events.js');\n\nvar Box = require('./box.js');\n\nvar boxes = [];\nvar scrollElement = window;\nvar siteTimer;\nvar pageTimer;\nvar pageViews;\nvar initialised = false;\n\nvar styles = require('./styles.js');\n\nvar ExitIntent = require('./triggers/exit-intent.js');\n\nfunction throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n var now = +new Date(),\n args = arguments;\n\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n} // \"keyup\" listener\n\n\nfunction onKeyUp(e) {\n if (e.keyCode === 27) {\n Boxzilla.dismiss();\n }\n} // check \"pageviews\" criteria for each box\n\n\nfunction checkPageViewsCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {\n box.trigger();\n }\n });\n} // check time trigger criteria for each box\n\n\nfunction checkTimeCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n } // check \"time on site\" trigger\n\n\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n } // check \"time on page\" trigger\n\n\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n} // check triggerHeight criteria for all boxes\n\n\nfunction checkHeightCriteria() {\n var scrollY = scrollElement.hasOwnProperty('pageYOffset') ? scrollElement.pageYOffset : scrollElement.scrollTop;\n scrollY = scrollY + window.innerHeight * 0.9;\n boxes.forEach(function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n } // trigger box\n\n\n box.trigger();\n } // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box\n\n\n if (box.mayRehide() && scrollY < box.triggerHeight - 5) {\n box.hide();\n }\n });\n} // recalculate heights and variables based on height\n\n\nfunction recalculateHeights() {\n boxes.forEach(function (box) {\n box.onResize();\n });\n}\n\nfunction showBoxesWithExitIntentTrigger() {\n // do nothing if already triggered OR another box is visible.\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n}\n\nfunction isAnyBoxVisible() {\n return boxes.filter(function (b) {\n return b.visible;\n }).length > 0;\n}\n\nfunction onElementClick(e) {\n // find <a> element in up to 3 parent elements\n var el = e.target || e.srcElement;\n var depth = 3;\n\n for (var i = 0; i <= depth; i++) {\n if (!el || el.tagName === 'A') {\n break;\n }\n\n el = el.parentElement;\n }\n\n if (!el || el.tagName !== 'A' || !el.getAttribute('href')) {\n return;\n }\n\n var href = el.getAttribute('href').toLowerCase();\n var match = href.match(/[#&]boxzilla-(\\d+)/);\n\n if (match && match.length > 1) {\n var boxId = match[1];\n Boxzilla.toggle(boxId);\n }\n}\n\nvar timers = {\n start: function start() {\n try {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if (sessionTime) siteTimer.time = sessionTime;\n } catch (e) {}\n\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n}; // initialise & add event listeners\n\nBoxzilla.init = function () {\n if (initialised) {\n return;\n }\n\n document.body.addEventListener('click', onElementClick, true);\n\n try {\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n } catch (e) {\n pageViews = 0;\n }\n\n siteTimer = new Timer(0);\n pageTimer = new Timer(0); // insert styles into DOM\n\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement); // init exit intent trigger\n\n new ExitIntent(showBoxesWithExitIntentTrigger); // start timers\n\n timers.start();\n scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true);\n scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true);\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000);\n document.addEventListener('keyup', onKeyUp); // stop timers when leaving page or switching to other tab\n\n document.addEventListener(\"visibilitychange\", function () {\n document.hidden ? timers.stop() : timers.start();\n });\n window.addEventListener('beforeunload', function () {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n Boxzilla.trigger('ready');\n initialised = true; // ensure this function doesn't run again\n};\n/**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\n\n\nBoxzilla.create = function (id, opts) {\n // preserve backwards compat for minimumScreenWidth option\n if (typeof opts.minimumScreenWidth !== \"undefined\") {\n opts.screenWidthCondition = {\n condition: \"larger\",\n value: opts.minimumScreenWidth\n };\n }\n\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n};\n\nBoxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n\n if (box.id == id) {\n return box;\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n}; // dismiss a single box (or all by omitting id param)\n\n\nBoxzilla.dismiss = function (id, animate) {\n // if no id given, dismiss all current open boxes\n if (id) {\n Boxzilla.get(id).dismiss(animate);\n } else {\n boxes.forEach(function (box) {\n box.dismiss(animate);\n });\n }\n};\n\nBoxzilla.hide = function (id, animate) {\n if (id) {\n Boxzilla.get(id).hide(animate);\n } else {\n boxes.forEach(function (box) {\n box.hide(animate);\n });\n }\n};\n\nBoxzilla.show = function (id, animate) {\n if (id) {\n Boxzilla.get(id).show(animate);\n } else {\n boxes.forEach(function (box) {\n box.show(animate);\n });\n }\n};\n\nBoxzilla.toggle = function (id, animate) {\n if (id) {\n Boxzilla.get(id).toggle(animate);\n } else {\n boxes.forEach(function (box) {\n box.toggle(animate);\n });\n }\n}; // expose each individual box.\n\n\nBoxzilla.boxes = boxes; // expose boxzilla object\n\nwindow.Boxzilla = Boxzilla;\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n}\n\n},{\"./box.js\":3,\"./events.js\":5,\"./styles.js\":6,\"./timer.js\":7,\"./triggers/exit-intent.js\":8}],5:[function(require,module,exports){\n'use strict';\n\nvar EventEmitter = require('wolfy87-eventemitter');\n\nmodule.exports = Object.create(EventEmitter.prototype);\n\n},{\"wolfy87-eventemitter\":9}],6:[function(require,module,exports){\n\"use strict\";\n\nvar styles = \"#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\nmodule.exports = styles;\n\n},{}],7:[function(require,module,exports){\n'use strict';\n\nvar Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function () {\n this.time++;\n};\n\nTimer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n};\n\nmodule.exports = Timer;\n\n},{}],8:[function(require,module,exports){\n'use strict';\n\nmodule.exports = function (callback) {\n var timeout = null;\n var touchStart = {};\n\n function triggerCallback() {\n document.documentElement.removeEventListener('mouseleave', onMouseLeave);\n document.documentElement.removeEventListener('mouseenter', onMouseEnter);\n document.documentElement.removeEventListener('click', clearTimeout);\n window.removeEventListener('touchstart', onTouchStart);\n window.removeEventListener('touchend', onTouchEnd);\n callback();\n }\n\n function clearTimeout() {\n if (timeout === null) {\n return;\n }\n\n window.clearTimeout(timeout);\n timeout = null;\n }\n\n function onMouseEnter(evt) {\n clearTimeout();\n }\n\n function getAddressBarY() {\n if (document.documentMode || /Edge\\//.test(navigator.userAgent)) {\n return 5;\n }\n\n return 0;\n }\n\n function onMouseLeave(evt) {\n clearTimeout(); // did mouse leave at top of window?\n // add small exception space in the top-right corner\n\n if (evt.clientY <= getAddressBarY() && evt.clientX < 0.80 * window.innerWidth) {\n timeout = window.setTimeout(triggerCallback, 400);\n }\n }\n\n function onTouchStart(evt) {\n clearTimeout();\n touchStart = {\n timestamp: performance.now(),\n scrollY: window.scrollY,\n windowHeight: window.innerHeight\n };\n }\n\n function onTouchEnd(evt) {\n clearTimeout(); // did address bar appear?\n\n if (window.innerHeight > touchStart.windowHeight) {\n return;\n } // allow a tiny tiny margin for error, to not fire on clicks\n\n\n if (window.scrollY + 20 >= touchStart.scrollY) {\n return;\n }\n\n if (performance.now() - touchStart.timestamp > 300) {\n return;\n }\n\n if (['A', 'INPUT', 'BUTTON'].indexOf(evt.target.tagName) > -1) {\n return;\n }\n\n timeout = window.setTimeout(triggerCallback, 800);\n }\n\n window.addEventListener('touchstart', onTouchStart);\n window.addEventListener('touchend', onTouchEnd);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('click', clearTimeout);\n};\n\n},{}],9:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.8 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n; })();"]}
1
+ {"version":3,"sources":["script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","_typeof","obj","Symbol","iterator","constructor","prototype","Boxzilla","options","window","boxzilla_options","locationHashRefersBox","box","location","hash","match","elementId","element","id","querySelector","isLoggedIn","document","body","className","indexOf","testMode","console","log","init","addEventListener","inited","key","boxes","boxOpts","boxContentElement","getElementById","content","create","post","slug","styles","css","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","firstChild","lastChild","fits","show","trigger","mc4wp_forms_config","submitted_form","mc4wp_submitted_form","selector","element_id","forEach","maybeOpenMailChimpForWordPressBox","boxzilla","2","duration","property","hasOwnProperty","animate","targetStyles","fn","last","Date","initialStyles","getComputedStyle","currentStyles","propSteps","parseFloat","to","current","tick","step","increment","newValue","timeSinceLastTick","done","_property","suffix","requestAnimationFrame","setTimeout","toggle","animation","callbackFn","cleanup","removeAttribute","setAttribute","clone","getAttribute","display","nowVisible","hiddenStyles","visibleStyles","offsetLeft","cloneNode","properties","value","newObject","initObjectProperties","object","copyObjectProperties","isFinite","height","clientRect","getBoundingClientRect","overflowY","opacity","animated","3","defaults","rehide","cookie","icon","screenWidthCondition","position","closable","events","Animator","Box","config","this","obj1","obj2","obj3","attrname","_attrname","merge","overlay","createElement","classList","add","appendChild","visible","dismissed","triggered","triggerHeight","calculateTriggerHeight","cookieSet","isCookieSet","contentElement","closeIcon","dom","evt","preventDefault","dismiss","target","tagName","setCookie","x","offsetX","y","offsetY","rect","left","right","top","bottom","wrapper","innerHTML","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","clientHeight","newTopMargin","marginTop","bind","hide","method","triggerElement","html","documentElement","Math","max","scrollHeight","offsetHeight","getDocumentHeight","condition","innerWidth","onResize","mayAutoShow","mayRehide","replace","RegExp","hours","expiryDate","setHours","getHours","toUTCString","./animator.js","./events.js","4","util","ExitIntent","Scroll","Pageviews","Time","initialised","onKeyUp","keyCode","recalculateHeights","onElementClick","el","srcElement","parentElement","href","toLowerCase","boxId","styleElement","head","throttle","opts","minimumScreenWidth","push","get","./box.js","./styles.js","./triggers/exit-intent.js","./triggers/pageviews.js","./triggers/scroll.js","./triggers/time.js","./util.js","5","EventEmitter","Object","wolfy87-eventemitter","6","7","Timer","start","time","interval","setInterval","stop","clearInterval","8","timeout","touchStart","removeEventListener","onMouseLeave","onMouseEnter","clearTimeout","onTouchStart","onTouchEnd","clientY","documentMode","test","navigator","userAgent","clientX","timestamp","performance","now","scrollY","9","pageviews","sessionStorage","getItem","setItem","10","checkHeightCriteria","pageYOffset","scrollTop","../util.js","11","siteTimer","pageTimer","timers","sessionTime","hidden","../timer.js","12","threshold","scope","deferTimer","context","args","arguments","apply","13","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","getListeners","response","_getEvents","flattenListeners","flatListeners","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","on","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,IAAIZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGQ,QAAQ,IAAI,IAAIL,GAAE,EAAoCH,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACY,EAAE,CAAC,SAASC,EAAQC,EAAOL,GACzlB,aAEA,SAASM,EAAQC,GAAwT,OAAtOD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,IAExV,WAGE,IAAIK,EAAWR,EAAQ,YAEnBS,EAAUC,OAAOC,iBA4ErB,SAASC,EAAsBC,GAC7B,IAAKH,OAAOI,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ports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nfunction _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\n(function () {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n\n var options = window.boxzilla_options; // expose Boxzilla object to window\n\n window.Boxzilla = Boxzilla; // helper function for setting CSS styles\n\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n function createBoxesFromConfig() {\n // failsafe against including script twice.\n if (options.inited) {\n return;\n } // create boxes from options\n\n\n for (var key in options.boxes) {\n // get opts\n var boxOpts = options.boxes[key];\n boxOpts.testMode = isLoggedIn && options.testMode; // find box content element, bail if not found\n\n var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');\n\n if (!boxContentElement) {\n continue;\n } // use element as content option\n\n\n boxOpts.content = boxContentElement; // create box\n\n var box = Boxzilla.create(boxOpts.id, boxOpts); // add box slug to box element as classname\n\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug; // add custom css to box\n\n css(box.element, boxOpts.css);\n\n try {\n box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n } catch (e) {} // maybe show box right away\n\n\n if (box.fits() && locationHashRefersBox(box)) {\n box.show();\n }\n } // set flag to prevent initialising twice\n\n\n options.inited = true; // trigger \"done\" event.\n\n Boxzilla.trigger('done'); // maybe open box with MC4WP form in it\n\n maybeOpenMailChimpForWordPressBox();\n }\n\n function locationHashRefersBox(box) {\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n } // parse \"boxzilla-{id}\" from location hash\n\n\n var match = window.location.hash.match(/[#&](boxzilla-\\d+)/);\n\n if (!match || _typeof(match) !== \"object\" || match.length < 2) {\n return false;\n }\n\n var elementId = match[1];\n\n if (elementId === box.element.id) {\n return true;\n } else if (box.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n }\n\n function maybeOpenMailChimpForWordPressBox() {\n if ((_typeof(window.mc4wp_forms_config) !== \"object\" || !window.mc4wp_forms_config.submitted_form) && _typeof(window.mc4wp_submitted_form) !== \"object\") {\n return;\n }\n\n var submitted_form = window.mc4wp_submitted_form || window.mc4wp_forms_config.submitted_form;\n var selector = '#' + submitted_form.element_id;\n Boxzilla.boxes.forEach(function (box) {\n if (box.element.querySelector(selector)) {\n box.show();\n }\n });\n } // print message when test mode is enabled\n\n\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n } // init boxzilla\n\n\n Boxzilla.init(); // on window.load, create DOM elements for boxes\n\n window.addEventListener('load', createBoxesFromConfig);\n})();\n\n},{\"boxzilla\":4}],2:[function(require,module,exports){\n'use strict';\n\nvar duration = 320;\n\nfunction css(element, styles) {\n for (var property in styles) {\n if (!styles.hasOwnProperty(property)) {\n continue;\n }\n\n element.style[property] = styles[property];\n }\n}\n\nfunction initObjectProperties(properties, value) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n\n return newObject;\n}\n\nfunction copyObjectProperties(properties, object) {\n var newObject = {};\n\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n\n return newObject;\n}\n/**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\n\n\nfunction animated(element) {\n return !!element.getAttribute('data-animated');\n}\n/**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n * @param callbackFn\n */\n\n\nfunction toggle(element, animation, callbackFn) {\n var nowVisible = element.style.display !== 'none' || element.offsetLeft > 0; // create clone for reference\n\n var clone = element.cloneNode(true);\n\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n\n if (callbackFn) {\n callbackFn();\n }\n }; // store attribute so everyone knows we're animating this element\n\n\n element.setAttribute('data-animated', \"true\"); // toggle element visiblity right away if we're making something visible\n\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles;\n var visibleStyles; // animate properties\n\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles); // in some browsers, getComputedStyle returns \"auto\" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.\n\n if (!isFinite(visibleStyles.height)) {\n var clientRect = element.getBoundingClientRect();\n visibleStyles.height = clientRect.height;\n }\n\n css(element, hiddenStyles);\n } // don't show a scrollbar during animation\n\n\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = {\n opacity: 0\n };\n visibleStyles = {\n opacity: 1\n };\n\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n}\n\nfunction animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n if (!targetStyles.hasOwnProperty(property)) {\n continue;\n } // make sure we have an object filled with floats\n\n\n targetStyles[property] = parseFloat(targetStyles[property]); // calculate step size & current value\n\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]); // is there something to do?\n\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n var step, to, increment, newValue;\n\n for (var _property in targetStyles) {\n if (!targetStyles.hasOwnProperty(_property)) {\n continue;\n }\n\n step = propSteps[_property];\n to = targetStyles[_property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[_property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n } // store new value\n\n\n currentStyles[_property] = newValue;\n var suffix = _property !== \"opacity\" ? \"px\" : \"\";\n element.style[_property] = newValue + suffix;\n }\n\n last = +new Date(); // keep going until we're done for all props\n\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n}\n\nmodule.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n};\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'screenWidthCondition': null,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n};\n\nvar events = require('./events.js');\n\nvar Animator = require('./animator.js');\n/**\n* Merge 2 objects, values of the latter overwriting the former.\n*\n* @param obj1\n* @param obj2\n* @returns {*}\n*/\n\n\nfunction merge(obj1, obj2) {\n var obj3 = {}; // add obj1 to obj3\n\n for (var attrname in obj1) {\n if (obj1.hasOwnProperty(attrname)) {\n obj3[attrname] = obj1[attrname];\n }\n } // add obj2 to obj3\n\n\n for (var _attrname in obj2) {\n if (obj2.hasOwnProperty(_attrname)) {\n obj3[_attrname] = obj2[_attrname];\n }\n }\n\n return obj3;\n}\n/**\n* Get the real height of entire document.\n* @returns {number}\n*/\n\n\nfunction getDocumentHeight() {\n var body = document.body;\n var html = document.documentElement;\n return Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n} // Box Object\n\n\nfunction Box(id, config) {\n this.id = id; // store config values\n\n this.config = merge(defaults, config); // add overlay element to dom and store ref to overlay\n\n this.overlay = document.createElement('div');\n this.overlay.style.display = 'none';\n this.overlay.id = 'boxzilla-overlay-' + this.id;\n this.overlay.classList.add('boxzilla-overlay');\n document.body.appendChild(this.overlay); // state\n\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = this.calculateTriggerHeight();\n this.cookieSet = this.isCookieSet();\n this.element = null;\n this.contentElement = null;\n this.closeIcon = null; // create dom elements for this box\n\n this.dom(); // further initialise the box\n\n this.events();\n}\n\n; // initialise the box\n\nBox.prototype.events = function () {\n var box = this; // attach event to \"close\" icon inside box\n\n if (this.closeIcon) {\n this.closeIcon.addEventListener('click', function (evt) {\n evt.preventDefault();\n box.dismiss();\n });\n }\n\n this.element.addEventListener('click', function (evt) {\n if (evt.target.tagName === 'A') {\n events.trigger('box.interactions.link', [box, evt.target]);\n }\n }, false);\n this.element.addEventListener('submit', function (evt) {\n box.setCookie();\n events.trigger('box.interactions.form', [box, evt.target]);\n }, false);\n this.overlay.addEventListener('click', function (e) {\n var x = e.offsetX;\n var y = e.offsetY; // calculate if click was less than 40px outside box to avoid closing it by accident\n\n var rect = box.element.getBoundingClientRect();\n var margin = 40; // if click was not anywhere near box, dismiss it.\n\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n}; // generate dom elements for this box\n\n\nBox.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n var content;\n\n if (typeof this.config.content === \"string\") {\n content = document.createElement('div');\n content.innerHTML = this.config.content;\n } else {\n content = this.config.content; // make sure element is visible\n\n content.style.display = '';\n }\n\n content.className = 'boxzilla-content';\n box.appendChild(content);\n\n if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = \"boxzilla-close-icon\";\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.contentElement = content;\n this.element = box;\n}; // set (calculate) custom box styling depending on box options\n\n\nBox.prototype.setCustomBoxStyling = function () {\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = '';\n this.element.style.maxHeight = ''; // get new dimensions\n\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight; // add scrollbar to box and limit height\n\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n } // set new top margin for boxes which are centered\n\n\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n}; // toggle visibility of the box\n\n\nBox.prototype.toggle = function (show, animate) {\n show = typeof show === \"undefined\" ? !this.visible : show;\n animate = typeof animate === \"undefined\" ? true : animate; // is box already at desired visibility?\n\n if (show === this.visible) {\n return false;\n } // is box being animated?\n\n\n if (Animator.animated(this.element)) {\n return false;\n } // if box should be hidden but is not closable, bail.\n\n\n if (!show && !this.config.closable) {\n return false;\n } // set new visibility status\n\n\n this.visible = show; // calculate new styling rules\n\n this.setCustomBoxStyling(); // trigger event\n\n events.trigger('box.' + (show ? 'show' : 'hide'), [this]); // show or hide box using selected animation\n\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n\n if (animate) {\n Animator.toggle(this.overlay, \"fade\");\n } else {\n this.overlay.style.display = show ? '' : 'none';\n }\n }\n\n if (animate) {\n Animator.toggle(this.element, this.config.animation, function () {\n if (this.visible) {\n return;\n }\n\n this.contentElement.innerHTML = this.contentElement.innerHTML;\n }.bind(this));\n } else {\n this.element.style.display = show ? '' : 'none';\n }\n\n return true;\n}; // show the box\n\n\nBox.prototype.show = function (animate) {\n return this.toggle(true, animate);\n}; // hide the box\n\n\nBox.prototype.hide = function (animate) {\n return this.toggle(false, animate);\n}; // calculate trigger height\n\n\nBox.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger) {\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n }\n\n return triggerHeight;\n};\n\nBox.prototype.fits = function () {\n if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {\n return true;\n }\n\n switch (this.config.screenWidthCondition.condition) {\n case \"larger\":\n return window.innerWidth > this.config.screenWidthCondition.value;\n\n case \"smaller\":\n return window.innerWidth < this.config.screenWidthCondition.value;\n } // meh.. condition should be \"smaller\" or \"larger\", just return true.\n\n\n return true;\n};\n\nBox.prototype.onResize = function () {\n this.triggerHeight = this.calculateTriggerHeight();\n this.setCustomBoxStyling();\n}; // is this box enabled?\n\n\nBox.prototype.mayAutoShow = function () {\n if (this.dismissed) {\n return false;\n } // check if box fits on given minimum screen width\n\n\n if (!this.fits()) {\n return false;\n } // if trigger empty or error in calculating triggerHeight, return false\n\n\n if (!this.config.trigger) {\n return false;\n } // rely on cookie value (show if not set, don't show if set)\n\n\n return !this.cookieSet;\n};\n\nBox.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function () {\n // always show on test mode or when no auto-trigger is configured\n if (this.config.testMode || !this.config.trigger) {\n return false;\n } // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n\n\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n}; // set cookie that disables automatically showing the box\n\n\nBox.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n};\n\nBox.prototype.trigger = function () {\n var shown = this.show();\n\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n};\n/**\n* Dismisses the box and optionally sets a cookie.\n* @param animate\n* @returns {boolean}\n*/\n\n\nBox.prototype.dismiss = function (animate) {\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n } // hide box element\n\n\n this.hide(animate); // set cookie\n\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n events.trigger('box.dismiss', [this]);\n return true;\n};\n\nmodule.exports = Box;\n\n},{\"./animator.js\":2,\"./events.js\":5}],4:[function(require,module,exports){\n'use strict';\n\nvar Boxzilla = require('./events.js');\n\nvar Box = require('./box.js');\n\nvar util = require('./util.js');\n\nvar styles = require('./styles.js');\n\nvar ExitIntent = require('./triggers/exit-intent.js');\n\nvar Scroll = require('./triggers/scroll.js');\n\nvar Pageviews = require('./triggers/pageviews.js');\n\nvar Time = require('./triggers/time.js');\n\nvar initialised = false;\nvar boxes = []; // \"keyup\" listener\n\nfunction onKeyUp(e) {\n if (e.keyCode === 27) {\n Boxzilla.dismiss();\n }\n} // recalculate heights and variables based on height\n\n\nfunction recalculateHeights() {\n boxes.forEach(function (box) {\n return box.onResize();\n });\n}\n\nfunction onElementClick(evt) {\n // find <a> element in up to 3 parent elements\n var el = evt.target || evt.srcElement;\n var depth = 3;\n\n for (var i = 0; i <= depth; i++) {\n if (!el || el.tagName === 'A') {\n break;\n }\n\n el = el.parentElement;\n }\n\n if (!el || el.tagName !== 'A' || !el.href) {\n return;\n }\n\n var href = el.href.toLowerCase();\n var match = href.match(/[#&]boxzilla-(\\d+)/);\n\n if (match && match.length > 1) {\n var boxId = match[1];\n Boxzilla.toggle(boxId);\n }\n} // initialise & add event listeners\n\n\nBoxzilla.init = function () {\n if (initialised) {\n return;\n } // insert styles into DOM\n\n\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement); // init exit intent triggershow\n\n new ExitIntent(boxes);\n new Pageviews(boxes);\n new Scroll(boxes);\n new Time(boxes);\n document.body.addEventListener('click', onElementClick, true);\n window.addEventListener('resize', util.throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n document.addEventListener('keyup', onKeyUp);\n Boxzilla.trigger('ready');\n initialised = true; // ensure this function doesn't run again\n};\n/**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\n\n\nBoxzilla.create = function (id, opts) {\n // preserve backwards compat for minimumScreenWidth option\n if (typeof opts.minimumScreenWidth !== \"undefined\") {\n opts.screenWidthCondition = {\n condition: \"larger\",\n value: opts.minimumScreenWidth\n };\n }\n\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n};\n\nBoxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n if (boxes[i].id == id) {\n return boxes[i];\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n}; // dismiss a single box (or all by omitting id param)\n\n\nBoxzilla.dismiss = function (id, animate) {\n // if no id given, dismiss all current open boxes\n if (id) {\n Boxzilla.get(id).dismiss(animate);\n } else {\n boxes.forEach(function (box) {\n return box.dismiss(animate);\n });\n }\n};\n\nBoxzilla.hide = function (id, animate) {\n if (id) {\n Boxzilla.get(id).hide(animate);\n } else {\n boxes.forEach(function (box) {\n return box.hide(animate);\n });\n }\n};\n\nBoxzilla.show = function (id, animate) {\n if (id) {\n Boxzilla.get(id).show(animate);\n } else {\n boxes.forEach(function (box) {\n return box.show(animate);\n });\n }\n};\n\nBoxzilla.toggle = function (id, animate) {\n if (id) {\n Boxzilla.get(id).toggle(animate);\n } else {\n boxes.forEach(function (box) {\n return box.toggle(animate);\n });\n }\n}; // expose each individual box.\n\n\nBoxzilla.boxes = boxes; // expose boxzilla object\n\nwindow.Boxzilla = Boxzilla;\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n}\n\n},{\"./box.js\":3,\"./events.js\":5,\"./styles.js\":6,\"./triggers/exit-intent.js\":8,\"./triggers/pageviews.js\":9,\"./triggers/scroll.js\":10,\"./triggers/time.js\":11,\"./util.js\":12}],5:[function(require,module,exports){\n'use strict';\n\nvar EventEmitter = require('wolfy87-eventemitter');\n\nmodule.exports = Object.create(EventEmitter.prototype);\n\n},{\"wolfy87-eventemitter\":13}],6:[function(require,module,exports){\n\"use strict\";\n\nvar styles = \"#boxzilla-overlay,.boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\nmodule.exports = styles;\n\n},{}],7:[function(require,module,exports){\n\"use strict\";\n\nvar Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function () {\n this.time++;\n};\n\nTimer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n};\n\nmodule.exports = Timer;\n\n},{}],8:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = function (boxes) {\n var timeout = null;\n var touchStart = {};\n\n function trigger() {\n document.documentElement.removeEventListener('mouseleave', onMouseLeave);\n document.documentElement.removeEventListener('mouseenter', onMouseEnter);\n document.documentElement.removeEventListener('click', clearTimeout);\n window.removeEventListener('touchstart', onTouchStart);\n window.removeEventListener('touchend', onTouchEnd); // show boxes with exit intent trigger\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n }\n\n function clearTimeout() {\n if (timeout === null) {\n return;\n }\n\n window.clearTimeout(timeout);\n timeout = null;\n }\n\n function onMouseEnter(evt) {\n clearTimeout();\n }\n\n function getAddressBarY() {\n if (document.documentMode || /Edge\\//.test(navigator.userAgent)) {\n return 5;\n }\n\n return 0;\n }\n\n function onMouseLeave(evt) {\n clearTimeout(); // did mouse leave at top of window?\n // add small exception space in the top-right corner\n\n if (evt.clientY <= getAddressBarY() && evt.clientX < 0.80 * window.innerWidth) {\n timeout = window.setTimeout(trigger, 400);\n }\n }\n\n function onTouchStart(evt) {\n clearTimeout();\n touchStart = {\n timestamp: performance.now(),\n scrollY: window.scrollY,\n windowHeight: window.innerHeight\n };\n }\n\n function onTouchEnd(evt) {\n clearTimeout(); // did address bar appear?\n\n if (window.innerHeight > touchStart.windowHeight) {\n return;\n } // allow a tiny tiny margin for error, to not fire on clicks\n\n\n if (window.scrollY + 20 >= touchStart.scrollY) {\n return;\n }\n\n if (performance.now() - touchStart.timestamp > 300) {\n return;\n }\n\n if (['A', 'INPUT', 'BUTTON'].indexOf(evt.target.tagName) > -1) {\n return;\n }\n\n timeout = window.setTimeout(trigger, 800);\n }\n\n window.addEventListener('touchstart', onTouchStart);\n window.addEventListener('touchend', onTouchEnd);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('click', clearTimeout);\n};\n\n},{}],9:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = function (boxes) {\n var pageviews;\n\n try {\n pageviews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n sessionStorage.setItem('boxzilla_pageviews', ++pageviews);\n } catch (e) {\n pageviews = 0;\n }\n\n window.setTimeout(function () {\n boxes.forEach(function (box) {\n if (box.config.trigger.method === 'pageviews' && pageviews >= box.config.trigger.value && box.mayAutoShow()) {\n box.trigger();\n }\n });\n }, 1000);\n};\n\n},{}],10:[function(require,module,exports){\n\"use strict\";\n\nvar throttle = require('../util.js').throttle;\n\nmodule.exports = function (boxes) {\n // check triggerHeight criteria for all boxes\n function checkHeightCriteria() {\n var scrollY = window.hasOwnProperty('pageYOffset') ? window.pageYOffset : window.scrollTop;\n scrollY = scrollY + window.innerHeight * 0.9;\n boxes.forEach(function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n box.trigger();\n } // if box may auto-hide and scrollY is less than triggerHeight (with small margin of error), hide box\n\n\n if (box.mayRehide() && scrollY < box.triggerHeight - 5) {\n box.hide();\n }\n });\n }\n\n window.addEventListener('touchstart', throttle(checkHeightCriteria), true);\n window.addEventListener('scroll', throttle(checkHeightCriteria), true);\n};\n\n},{\"../util.js\":12}],11:[function(require,module,exports){\n\"use strict\";\n\nvar Timer = require('../timer.js');\n\nmodule.exports = function (boxes) {\n var siteTimer = new Timer(0);\n var pageTimer = new Timer(0);\n var timers = {\n start: function start() {\n try {\n var sessionTime = parseInt(sessionStorage.getItem('boxzilla_timer'));\n\n if (sessionTime) {\n siteTimer.time = sessionTime;\n }\n } catch (e) {}\n\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n }; // start timers\n\n timers.start(); // stop timers when leaving page or switching to other tab\n\n document.addEventListener(\"visibilitychange\", function () {\n document.hidden ? timers.stop() : timers.start();\n });\n window.addEventListener('beforeunload', function () {\n timers.stop();\n });\n window.setInterval(function () {\n boxes.forEach(function (box) {\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value && box.mayAutoShow()) {\n box.trigger();\n }\n\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value && box.mayAutoShow()) {\n box.trigger();\n }\n });\n }, 1000);\n};\n\n},{\"../timer.js\":7}],12:[function(require,module,exports){\n\"use strict\";\n\nfunction throttle(fn, threshold, scope) {\n threshold || (threshold = 600);\n var last;\n var deferTimer;\n return function () {\n var context = scope || this;\n var now = +new Date(),\n args = arguments;\n\n if (last && now < last + threshold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n}\n\nmodule.exports = {\n throttle: throttle\n};\n\n},{}],13:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.8 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n; })();"]}
boxzilla.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
- Version: 3.2.19
5
  Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
  Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
  Author: ibericode
@@ -41,7 +41,7 @@ if ( ! defined( 'ABSPATH' ) ) {
41
  function _load_boxzilla() {
42
 
43
  define( 'BOXZILLA_FILE', __FILE__ );
44
- define( 'BOXZILLA_VERSION', '3.2.19' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
+ Version: 3.2.20
5
  Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
  Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
  Author: ibericode
41
  function _load_boxzilla() {
42
 
43
  define( 'BOXZILLA_FILE', __FILE__ );
44
+ define( 'BOXZILLA_VERSION', '3.2.20' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
languages/boxzilla.pot CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2019 boxzilla
2
  # This file is distributed under the same license as the boxzilla package.
3
  msgid ""
4
  msgstr ""
1
+ # Copyright (C) 2020 boxzilla
2
  # This file is distributed under the same license as the boxzilla package.
3
  msgid ""
4
  msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=bo
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.6
6
  Tested up to: 5.3
7
- Stable tag: 3.2.19
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
@@ -15,24 +15,25 @@ Flexible pop-ups or slide-ins, showing up at just the right time.
15
 
16
  ### Boxzilla for WordPress
17
 
18
- Boxzilla is a plugin that allows you to add powerful call-to-actions via pop-up or slide-in boxes to your WordPress site. Boxes can slide or fade in at any point and can contain whatever content you like.
19
 
20
  #### Some of Boxzilla's features
21
 
22
- - Boxes can contain _any_ content you like.
23
- - You can set-up various box triggers:
24
- - Scroll percentage
25
- - Reaching a certain page element
26
- - X amount of time on the page
27
- - Exit Intent (premium)
28
- - Time on Site (premium)
29
  - Manually by clicking a link or button
 
 
30
  - Customizable box position on the screen.
31
- - Various visibility animations.
32
- - Advanced page targeting.
33
- - Full control over how long (and whether) boxes should stay hidden.
34
- - Customizable box appearance using a simple & intuitive interface.
35
- - Mobile optimized.
36
 
37
  [Read more about Boxzilla](https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=boxzilla&utm_campaign=description).
38
 
@@ -130,6 +131,17 @@ Have a look at the [frequently asked questions](https://wordpress.org/plugins/bo
130
  == Changelog ==
131
 
132
 
 
 
 
 
 
 
 
 
 
 
 
133
  #### 3.2.19 - Dec 30, 2019
134
 
135
  **Fixes**
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.6
6
  Tested up to: 5.3
7
+ Stable tag: 3.2.20
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
15
 
16
  ### Boxzilla for WordPress
17
 
18
+ Boxzilla is a plugin allowing you to add pop-up or slide-in boxes to your WordPress site. Boxes can slide or fade in at any point and can contain whatever content you like.
19
 
20
  #### Some of Boxzilla's features
21
 
22
+ - Boxes can contain any content you like.
23
+ - You can show boxes at various events:
24
+ - After scrolling down past a certain percentage of the page height.
25
+ - After scrolling down to a specific page element.
26
+ - After X seconds on the page.
27
+ - After X pageviews on the site.
 
28
  - Manually by clicking a link or button
29
+ - When the user intents to exit your website (Premium)
30
+ - After X seconds on the site (any page). (Premium)
31
  - Customizable box position on the screen.
32
+ - Animations for showing or hiding boxes.
33
+ - Page targeting, to only show pop-ups on certain posts or pages.
34
+ - Full control over how long boxes should stay hidden once they are dismissed.
35
+ - Customizable box appearance using a simple visual interface.
36
+ - Only 6 kB of JavaScript is added to your website.
37
 
38
  [Read more about Boxzilla](https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=boxzilla&utm_campaign=description).
39
 
131
  == Changelog ==
132
 
133
 
134
+ #### 3.2.20 - Jan 20, 2020
135
+
136
+ **Fixes**
137
+
138
+ - An issue with the "pageviews" trigger on Safari Mobile where session storage is inaccessible in the beforeunload event.
139
+
140
+ **Improvements**
141
+
142
+ - Prepare for upcoming [Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/) plugin update which changes the name of the JS object when a form is submitted without AJAX.
143
+
144
+
145
  #### 3.2.19 - Dec 30, 2019
146
 
147
  **Fixes**