@brndts/brndts-ads 1.1.5 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -505,22 +505,22 @@ var require_events = __commonJS({
505
505
  var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value2) {
506
506
  return value2 !== value2;
507
507
  };
508
- function EventEmitter6() {
509
- EventEmitter6.init.call(this);
508
+ function EventEmitter7() {
509
+ EventEmitter7.init.call(this);
510
510
  }
511
- module2.exports = EventEmitter6;
511
+ module2.exports = EventEmitter7;
512
512
  module2.exports.once = once;
513
- EventEmitter6.EventEmitter = EventEmitter6;
514
- EventEmitter6.prototype._events = void 0;
515
- EventEmitter6.prototype._eventsCount = 0;
516
- EventEmitter6.prototype._maxListeners = void 0;
513
+ EventEmitter7.EventEmitter = EventEmitter7;
514
+ EventEmitter7.prototype._events = void 0;
515
+ EventEmitter7.prototype._eventsCount = 0;
516
+ EventEmitter7.prototype._maxListeners = void 0;
517
517
  var defaultMaxListeners = 10;
518
518
  function checkListener(listener2) {
519
519
  if (typeof listener2 !== "function") {
520
520
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + (typeof listener2 === "undefined" ? "undefined" : _type_of(listener2)));
521
521
  }
522
522
  }
523
- Object.defineProperty(EventEmitter6, "defaultMaxListeners", {
523
+ Object.defineProperty(EventEmitter7, "defaultMaxListeners", {
524
524
  enumerable: true,
525
525
  get: function get() {
526
526
  return defaultMaxListeners;
@@ -532,14 +532,14 @@ var require_events = __commonJS({
532
532
  defaultMaxListeners = arg;
533
533
  }
534
534
  });
535
- EventEmitter6.init = function() {
535
+ EventEmitter7.init = function() {
536
536
  if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
537
537
  this._events = /* @__PURE__ */ Object.create(null);
538
538
  this._eventsCount = 0;
539
539
  }
540
540
  this._maxListeners = this._maxListeners || void 0;
541
541
  };
542
- EventEmitter6.prototype.setMaxListeners = function setMaxListeners(n) {
542
+ EventEmitter7.prototype.setMaxListeners = function setMaxListeners(n) {
543
543
  if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
544
544
  throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
545
545
  }
@@ -547,13 +547,13 @@ var require_events = __commonJS({
547
547
  return this;
548
548
  };
549
549
  function _getMaxListeners(that) {
550
- if (that._maxListeners === void 0) return EventEmitter6.defaultMaxListeners;
550
+ if (that._maxListeners === void 0) return EventEmitter7.defaultMaxListeners;
551
551
  return that._maxListeners;
552
552
  }
553
- EventEmitter6.prototype.getMaxListeners = function getMaxListeners() {
553
+ EventEmitter7.prototype.getMaxListeners = function getMaxListeners() {
554
554
  return _getMaxListeners(this);
555
555
  };
556
- EventEmitter6.prototype.emit = function emit(type) {
556
+ EventEmitter7.prototype.emit = function emit(type) {
557
557
  var args = [];
558
558
  for(var i = 1; i < arguments.length; i++)args.push(arguments[i]);
559
559
  var doError = type === "error";
@@ -627,11 +627,11 @@ var require_events = __commonJS({
627
627
  }
628
628
  return target;
629
629
  }
630
- EventEmitter6.prototype.addListener = function addListener(type, listener2) {
630
+ EventEmitter7.prototype.addListener = function addListener(type, listener2) {
631
631
  return _addListener(this, type, listener2, false);
632
632
  };
633
- EventEmitter6.prototype.on = EventEmitter6.prototype.addListener;
634
- EventEmitter6.prototype.prependListener = function prependListener(type, listener2) {
633
+ EventEmitter7.prototype.on = EventEmitter7.prototype.addListener;
634
+ EventEmitter7.prototype.prependListener = function prependListener(type, listener2) {
635
635
  return _addListener(this, type, listener2, true);
636
636
  };
637
637
  function onceWrapper() {
@@ -655,17 +655,17 @@ var require_events = __commonJS({
655
655
  state.wrapFn = wrapped;
656
656
  return wrapped;
657
657
  }
658
- EventEmitter6.prototype.once = function once2(type, listener2) {
658
+ EventEmitter7.prototype.once = function once2(type, listener2) {
659
659
  checkListener(listener2);
660
660
  this.on(type, _onceWrap(this, type, listener2));
661
661
  return this;
662
662
  };
663
- EventEmitter6.prototype.prependOnceListener = function prependOnceListener(type, listener2) {
663
+ EventEmitter7.prototype.prependOnceListener = function prependOnceListener(type, listener2) {
664
664
  checkListener(listener2);
665
665
  this.prependListener(type, _onceWrap(this, type, listener2));
666
666
  return this;
667
667
  };
668
- EventEmitter6.prototype.removeListener = function removeListener(type, listener2) {
668
+ EventEmitter7.prototype.removeListener = function removeListener(type, listener2) {
669
669
  var list, events, position, i, originalListener;
670
670
  checkListener(listener2);
671
671
  events = this._events;
@@ -697,8 +697,8 @@ var require_events = __commonJS({
697
697
  }
698
698
  return this;
699
699
  };
700
- EventEmitter6.prototype.off = EventEmitter6.prototype.removeListener;
701
- EventEmitter6.prototype.removeAllListeners = function removeAllListeners(type) {
700
+ EventEmitter7.prototype.off = EventEmitter7.prototype.removeListener;
701
+ EventEmitter7.prototype.removeAllListeners = function removeAllListeners(type) {
702
702
  var listeners, events, i;
703
703
  events = this._events;
704
704
  if (events === void 0) return this;
@@ -747,20 +747,20 @@ var require_events = __commonJS({
747
747
  ];
748
748
  return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
749
749
  }
750
- EventEmitter6.prototype.listeners = function listeners(type) {
750
+ EventEmitter7.prototype.listeners = function listeners(type) {
751
751
  return _listeners(this, type, true);
752
752
  };
753
- EventEmitter6.prototype.rawListeners = function rawListeners(type) {
753
+ EventEmitter7.prototype.rawListeners = function rawListeners(type) {
754
754
  return _listeners(this, type, false);
755
755
  };
756
- EventEmitter6.listenerCount = function(emitter, type) {
756
+ EventEmitter7.listenerCount = function(emitter, type) {
757
757
  if (typeof emitter.listenerCount === "function") {
758
758
  return emitter.listenerCount(type);
759
759
  } else {
760
760
  return listenerCount.call(emitter, type);
761
761
  }
762
762
  };
763
- EventEmitter6.prototype.listenerCount = listenerCount;
763
+ EventEmitter7.prototype.listenerCount = listenerCount;
764
764
  function listenerCount(type) {
765
765
  var events = this._events;
766
766
  if (events !== void 0) {
@@ -773,7 +773,7 @@ var require_events = __commonJS({
773
773
  }
774
774
  return 0;
775
775
  }
776
- EventEmitter6.prototype.eventNames = function eventNames() {
776
+ EventEmitter7.prototype.eventNames = function eventNames() {
777
777
  return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
778
778
  };
779
779
  function arrayClone(arr, n) {
@@ -19009,12 +19009,8 @@ function _getGeneralInfo() {
19009
19009
  var info;
19010
19010
  return _ts_generator(this, function(_state) {
19011
19011
  info = {};
19012
- try {
19013
- info.ua = navigator.userAgent;
19014
- info.domain = window.location.hostname;
19015
- } catch (error) {
19016
- console.log("Error getting info", error);
19017
- }
19012
+ info.ua = navigator.userAgent;
19013
+ info.domain = window.location.hostname;
19018
19014
  return [
19019
19015
  2,
19020
19016
  info
@@ -19194,8 +19190,8 @@ var defaults = {
19194
19190
  enabled: true,
19195
19191
  useLocalCache: false,
19196
19192
  presentation: {
19197
- duration: 2,
19198
- cooldown: 10
19193
+ duration: 3,
19194
+ cooldown: 3
19199
19195
  },
19200
19196
  regions: {
19201
19197
  useCache: true,
@@ -19794,39 +19790,68 @@ var MappedCollection = /*#__PURE__*/ function() {
19794
19790
  ]);
19795
19791
  return MappedCollection;
19796
19792
  }();
19797
- // src/Ads/Regions/Region.ts
19798
- var Plane = /*#__PURE__*/ function() {
19799
- function Plane(descriptor) {
19800
- _class_call_check(this, Plane);
19801
- this.size = _object_spread({
19802
- width: 0,
19803
- height: 0
19804
- }, descriptor || {});
19793
+ // src/Ads/Regions/RegionComponents.ts
19794
+ var import_events = __toESM(require_events());
19795
+ var RegionContours = /*#__PURE__*/ function(_import_events_default) {
19796
+ _inherits(_RegionContours, _import_events_default);
19797
+ function _RegionContours(contours) {
19798
+ _class_call_check(this, _RegionContours);
19799
+ var _this;
19800
+ _this = _call_super(this, _RegionContours);
19801
+ _this.points = _to_consumable_array(contours || []);
19802
+ return _this;
19805
19803
  }
19806
- _create_class(Plane, [
19804
+ _create_class(_RegionContours, [
19805
+ {
19806
+ key: "isEqual",
19807
+ value: function isEqual(points) {
19808
+ return _RegionContours.isEqual(this.points, points);
19809
+ }
19810
+ },
19807
19811
  {
19808
19812
  key: "update",
19809
- value: function update(descriptor) {
19810
- this.size = _object_spread({
19811
- width: 0,
19812
- height: 0
19813
- }, descriptor || {});
19813
+ value: function update(contours) {
19814
+ this.points = _to_consumable_array(contours);
19815
+ this.emit("update");
19816
+ }
19817
+ }
19818
+ ], [
19819
+ {
19820
+ key: "isEqual",
19821
+ value: function isEqual(contoursA, contoursB) {
19822
+ return contoursA.every(function(v, i) {
19823
+ return v.x === contoursB[i].x && v.y === contoursB[i].y;
19824
+ });
19814
19825
  }
19815
19826
  }
19816
19827
  ]);
19817
- return Plane;
19818
- }();
19819
- var RegionBox = /*#__PURE__*/ function() {
19828
+ return _RegionContours;
19829
+ }(import_events.default);
19830
+ var RegionBox = /*#__PURE__*/ function(_import_events_default) {
19831
+ _inherits(_RegionBox, _import_events_default);
19820
19832
  function _RegionBox(coords) {
19821
19833
  _class_call_check(this, _RegionBox);
19822
- this.coords = _object_spread({
19834
+ var _this;
19835
+ _this = _call_super(this, _RegionBox);
19836
+ _this.coords = _object_spread({
19823
19837
  x1: 0,
19824
19838
  x2: 0,
19825
19839
  y1: 0,
19826
19840
  y2: 0
19827
19841
  }, coords || {});
19842
+ return _this;
19828
19843
  }
19829
19844
  _create_class(_RegionBox, [
19845
+ {
19846
+ key: "update",
19847
+ value: function update(coords) {
19848
+ if (_RegionBox.isEqual(this.coords, coords)) {
19849
+ return;
19850
+ }
19851
+ this.coords = _object_spread({}, coords);
19852
+ this.emit("update");
19853
+ }
19854
+ },
19830
19855
  {
19831
19856
  key: "isEqual",
19832
19857
  value: function isEqual(coordsB) {
@@ -19878,29 +19903,118 @@ var RegionBox = /*#__PURE__*/ function() {
19878
19903
  }
19879
19904
  ]);
19880
19905
  return _RegionBox;
19906
+ }(import_events.default);
19907
+ var Plane = /*#__PURE__*/ function(_import_events_default) {
19908
+ _inherits(Plane, _import_events_default);
19909
+ function Plane(descriptor) {
19910
+ _class_call_check(this, Plane);
19911
+ var _this;
19912
+ _this = _call_super(this, Plane);
19913
+ _this.size = _object_spread({
19914
+ width: 0,
19915
+ height: 0
19916
+ }, descriptor || {});
19917
+ return _this;
19918
+ }
19919
+ _create_class(Plane, [
19920
+ {
19921
+ key: "update",
19922
+ value: function update(descriptor) {
19923
+ this.size = _object_spread({
19924
+ width: 0,
19925
+ height: 0
19926
+ }, descriptor || {});
19927
+ this.emit("update");
19928
+ }
19929
+ }
19930
+ ]);
19931
+ return Plane;
19932
+ }(import_events.default);
19933
+ var RegionContent = /*#__PURE__*/ function() {
19934
+ function RegionContent(plane, box) {
19935
+ _class_call_check(this, RegionContent);
19936
+ this.plane = plane;
19937
+ this.box = box;
19938
+ this.container = document.createElement("div");
19939
+ this.container.classList.add("BRNDTS_RB");
19940
+ this.render();
19941
+ }
19942
+ _create_class(RegionContent, [
19943
+ {
19944
+ key: "view",
19945
+ get: function get() {
19946
+ return this.container;
19947
+ }
19948
+ },
19949
+ {
19950
+ key: "hasContent",
19951
+ get: function get() {
19952
+ return this.container.childNodes.length > 0;
19953
+ }
19954
+ },
19955
+ {
19956
+ key: "addContent",
19957
+ value: function addContent(content) {
19958
+ var _this = this;
19959
+ this.container.innerHTML = "";
19960
+ if (Array.isArray(content)) {
19961
+ content.forEach(function(element) {
19962
+ return _this.container.appendChild(element);
19963
+ });
19964
+ } else {
19965
+ this.container.appendChild(content);
19966
+ }
19967
+ this.render();
19968
+ }
19969
+ },
19970
+ {
19971
+ key: "render",
19972
+ value: function render() {
19973
+ this.container.style.width = "".concat(this.box.width(this.plane.size), "px");
19974
+ this.container.style.height = "".concat(this.box.height(this.plane.size), "px");
19975
+ this.container.style.visibility = this.box.area(this.plane.size) > 0 ? "visible" : "hidden";
19976
+ }
19977
+ },
19978
+ {
19979
+ key: "clear",
19980
+ value: function clear() {
19981
+ this.container.style.width = "0px";
19982
+ this.container.style.height = "0px";
19983
+ this.container.style.visibility = "hidden";
19984
+ }
19985
+ },
19986
+ {
19987
+ key: "destroy",
19988
+ value: function destroy() {
19989
+ this.container.innerHTML = "";
19990
+ this.clear();
19991
+ }
19992
+ }
19993
+ ]);
19994
+ return RegionContent;
19881
19995
  }();
19996
+ // src/Ads/Regions/Region.ts
19882
19997
  var Region = /*#__PURE__*/ function() {
19883
19998
  function Region(id, regionDescriptor, planeDescriptor, deps) {
19884
19999
  var _this = this;
19885
20000
  _class_call_check(this, Region);
20001
+ this.onScreen = false;
19886
20002
  this.visible = false;
20003
+ this.plugins = [];
19887
20004
  this.id = id;
19888
20005
  this.regionDescriptor = regionDescriptor;
19889
- this.contours = [];
19890
- this.box = new RegionBox();
20006
+ this.contours = new RegionContours(regionDescriptor.contours);
20007
+ this.box = new RegionBox(regionDescriptor.box);
19891
20008
  this.plane = new Plane(planeDescriptor);
19892
20009
  this.deps = deps;
20010
+ this.plugins = _to_consumable_array(this.plugins).concat(_to_consumable_array(this.deps.plugins || []));
19893
20011
  this.container = document.createElement("div");
19894
20012
  this.container.id = this.id;
19895
20013
  this.container.classList.add("BRNDTS_R");
19896
20014
  this.container.style.position = "absolute";
19897
20015
  this.container.style.pointerEvents = "all";
19898
- this.boxView = document.createElement("div");
19899
- this.boxView.classList.add("BRNDTS_RB");
19900
- this.maskLayer = document.createElement("canvas");
19901
- this.maskLayer.classList.add("BRNDTS_RM");
19902
- this.container.appendChild(this.boxView);
19903
- this.container.appendChild(this.maskLayer);
20016
+ this.content = new RegionContent(this.plane, this.box);
20017
+ this.container.appendChild(this.content.view);
19904
20018
  this.handleClick = this.handleClick.bind(this);
19905
20019
  this.handleMouseEnter = this.handleMouseEnter.bind(this);
19906
20020
  this.handleMouseLeave = this.handleMouseLeave.bind(this);
@@ -19909,18 +20023,18 @@ var Region = /*#__PURE__*/ function() {
19909
20023
  this.container.addEventListener("mouseleave", this.handleMouseLeave);
19910
20024
  if (this.deps.provider) {
19911
20025
  this.deps.provider.onRefreshContents(function(contents) {
19912
- var _this_deps_recorder;
19913
- _this.boxView.innerHTML = "";
19914
- for(var index = 0; index < contents.length; index++){
19915
- _this.boxView.appendChild(contents[index]);
19916
- }
19917
- (_this_deps_recorder = _this.deps.recorder) === null || _this_deps_recorder === void 0 ? void 0 : _this_deps_recorder.presentationStateChanged(_this);
20026
+ _this.content.clear();
20027
+ _this.content.addContent(contents);
19918
20028
  });
20029
+ if (this.boxArea > 0) {
20030
+ this.requestContent();
20031
+ }
20032
+ {
20033
+ this.content.clear();
20034
+ this.content.addContent(this.deps.provider.contents());
20035
+ }
19919
20036
  }
19920
20037
  this.render(regionDescriptor.contours, regionDescriptor.box);
19921
- if (this.boxArea > 0) {
19922
- this.requestContent();
19923
- }
19924
20038
  }
19925
20039
  _create_class(Region, [
19926
20040
  {
@@ -19960,6 +20074,56 @@ var Region = /*#__PURE__*/ function() {
19960
20074
  this.isPresented && ((_this_deps_recorder = this.deps.recorder) === null || _this_deps_recorder === void 0 ? void 0 : _this_deps_recorder.mouseLeave(this));
19961
20075
  }
19962
20076
  },
20077
+ {
20078
+ key: "applyPlugins",
20079
+ value: function applyPlugins(key) {
20080
+ var _this = this;
20081
+ return _async_to_generator(function() {
20082
+ var index, _this_plugins_index_key, _this_plugins_index;
20083
+ return _ts_generator(this, function(_state) {
20084
+ switch(_state.label){
20085
+ case 0:
20086
+ index = 0;
20087
+ _state.label = 1;
20088
+ case 1:
20089
+ if (!(index < _this.plugins.length)) return [
20090
+ 3,
20091
+ 4
20092
+ ];
20093
+ return [
20094
+ 4,
20095
+ (_this_plugins_index_key = (_this_plugins_index = _this.plugins[index])[key]) === null || _this_plugins_index_key === void 0 ? void 0 : _this_plugins_index_key.call(_this_plugins_index, _this)
20096
+ ];
20097
+ case 2:
20098
+ _state.sent();
20099
+ _state.label = 3;
20100
+ case 3:
20101
+ index++;
20102
+ return [
20103
+ 3,
20104
+ 1
20105
+ ];
20106
+ case 4:
20107
+ return [
20108
+ 2
20109
+ ];
20110
+ }
20111
+ });
20112
+ })();
20113
+ }
20114
+ },
20115
+ {
20116
+ key: "shouldPresent",
20117
+ value: function shouldPresent() {
20118
+ return this.box.area(this.plane.size) > 0 && this.content.hasContent && !this.visible;
20119
+ }
20120
+ },
20121
+ {
20122
+ key: "shouldHide",
20123
+ value: function shouldHide() {
20124
+ return (this.box.area(this.plane.size) === 0 || !this.content.hasContent) && this.visible;
20125
+ }
20126
+ },
19963
20127
  {
19964
20128
  key: "updateRegion",
19965
20129
  value: function updateRegion(region) {
@@ -19974,7 +20138,13 @@ var Region = /*#__PURE__*/ function() {
19974
20138
  width: width,
19975
20139
  height: height
19976
20140
  });
19977
- this.render(this.contours, this.box.coords);
20141
+ this.render(this.contours.points, this.box.coords);
20142
+ }
20143
+ },
20144
+ {
20145
+ key: "regionContours",
20146
+ get: function get() {
20147
+ return this.contours;
19978
20148
  }
19979
20149
  },
19980
20150
  {
@@ -20030,7 +20200,7 @@ var Region = /*#__PURE__*/ function() {
20030
20200
  get: function get() {
20031
20201
  var _this = this;
20032
20202
  var area = 0;
20033
- var mappedVertices = this.contours.map(function(v) {
20203
+ var mappedVertices = this.contours.points.map(function(v) {
20034
20204
  return {
20035
20205
  x: v.x * _this.plane.size.width,
20036
20206
  y: v.y * _this.plane.size.height
@@ -20048,26 +20218,26 @@ var Region = /*#__PURE__*/ function() {
20048
20218
  {
20049
20219
  key: "isPresented",
20050
20220
  get: function get() {
20051
- return this.boxWidth * this.boxHeight > 0;
20221
+ return this.box.area(this.plane.size) > 0;
20052
20222
  }
20053
20223
  },
20054
20224
  {
20055
20225
  key: "isVisible",
20056
20226
  get: function get() {
20057
- return this.visible;
20227
+ return this.onScreen;
20058
20228
  }
20059
20229
  },
20060
20230
  {
20061
20231
  key: "hasContent",
20062
20232
  get: function get() {
20063
- return this.boxView.children.length > 0;
20233
+ return this.content.hasContent;
20064
20234
  }
20065
20235
  },
20066
20236
  {
20067
20237
  key: "updateVisibility",
20068
20238
  value: function updateVisibility(value2) {
20069
20239
  var _this_deps_recorder;
20070
- this.visible = value2;
20240
+ this.onScreen = value2;
20071
20241
  (_this_deps_recorder = this.deps.recorder) === null || _this_deps_recorder === void 0 ? void 0 : _this_deps_recorder.displayStateChanged(this);
20072
20242
  }
20073
20243
  },
@@ -20075,61 +20245,81 @@ var Region = /*#__PURE__*/ function() {
20075
20245
  key: "render",
20076
20246
  value: function render(contours, box) {
20077
20247
  var _this = this;
20078
- var _this_deps_recorder;
20079
- this.contours = contours;
20080
- var newBox = new RegionBox(box);
20081
- if (!this.box.isEqual(newBox.coords) && newBox.area(this.plane.size) > 0) {
20082
- this.box = newBox;
20083
- this.requestContent();
20084
- }
20085
- this.box = newBox;
20086
- this.container.style.width = "".concat(this.boxWidth, "px");
20087
- this.container.style.height = "".concat(this.boxHeight, "px");
20088
- this.container.style.left = "".concat(this.boxLeft, "px");
20089
- this.container.style.top = "".concat(this.boxTop, "px");
20090
- this.boxView.style.width = "".concat(Math.floor(this.boxWidth), "px");
20091
- this.boxView.style.height = "".concat(Math.floor(this.boxHeight), "px");
20092
- if (this.maskLayer) {
20093
- this.maskLayer.width = this.boxWidth;
20094
- this.maskLayer.style.width = "".concat(this.boxWidth, "px");
20095
- this.maskLayer.height = this.boxHeight;
20096
- this.maskLayer.style.height = "".concat(this.boxHeight, "px");
20097
- var ctx = this.maskLayer.getContext("2d");
20098
- if (!ctx) {
20099
- return;
20100
- }
20101
- if (this.contours.length === 0) {
20102
- ctx.clearRect(0, 0, this.boxWidth, this.boxHeight);
20103
- ctx.fillStyle = "white";
20104
- ctx.fill();
20105
- ctx.fillStyle = "black";
20106
- ctx.strokeStyle = "black";
20107
- ctx.lineWidth = 2;
20108
- } else {
20109
- ctx.beginPath();
20110
- ctx.moveTo(this.contours[0].x * this.plane.size.width - this.boxLeft, this.contours[0].y * this.plane.size.height - this.boxTop);
20111
- this.contours.forEach(function(point) {
20112
- return ctx.lineTo(point.x * _this.plane.size.width - _this.boxLeft, point.y * _this.plane.size.height - _this.boxTop);
20113
- });
20114
- ctx.closePath();
20115
- ctx.stroke();
20116
- ctx.filter = "blur(1px)";
20117
- ctx.fillStyle = "black";
20118
- ctx.fill();
20119
- }
20120
- var maskUrl = "url(" + this.maskLayer.toDataURL() + ")";
20121
- if (this.boxView) {
20122
- this.boxView.style.maskImage = maskUrl;
20123
- }
20124
- }
20125
- (_this_deps_recorder = this.deps.recorder) === null || _this_deps_recorder === void 0 ? void 0 : _this_deps_recorder.presentationStateChanged(this);
20248
+ return _async_to_generator(function() {
20249
+ var _this_deps_recorder, newBox;
20250
+ return _ts_generator(this, function(_state) {
20251
+ switch(_state.label){
20252
+ case 0:
20253
+ _this.applyPlugins("beforeRender");
20254
+ newBox = new RegionBox(box);
20255
+ if (!_this.box.isEqual(newBox.coords) && newBox.area(_this.plane.size) > 0) {
20256
+ _this.requestContent();
20257
+ }
20258
+ _this.box.update(box);
20259
+ _this.contours.update(contours);
20260
+ if (!_this.shouldPresent()) return [
20261
+ 3,
20262
+ 1
20263
+ ];
20264
+ _this.applyPlugins("beforeShow");
20265
+ _this.container.style.width = "".concat(_this.box.width(_this.plane.size), "px");
20266
+ _this.container.style.height = "".concat(_this.box.height(_this.plane.size), "px");
20267
+ _this.container.style.left = "".concat(_this.boxLeft, "px");
20268
+ _this.container.style.top = "".concat(_this.boxTop, "px");
20269
+ _this.content.render();
20270
+ _this.applyPlugins("afterShow");
20271
+ _this.visible = true;
20272
+ return [
20273
+ 3,
20274
+ 4
20275
+ ];
20276
+ case 1:
20277
+ if (!_this.shouldHide()) return [
20278
+ 3,
20279
+ 3
20280
+ ];
20281
+ return [
20282
+ 4,
20283
+ _this.applyPlugins("beforeHide")
20284
+ ];
20285
+ case 2:
20286
+ _state.sent();
20287
+ _this.container.style.width = "0px";
20288
+ _this.container.style.height = "0px";
20289
+ _this.container.style.left = "0px";
20290
+ _this.container.style.top = "0px";
20291
+ _this.content.render();
20292
+ _this.applyPlugins("afterHide");
20293
+ _this.visible = false;
20294
+ return [
20295
+ 3,
20296
+ 4
20297
+ ];
20298
+ case 3:
20299
+ if (_this.visible) {
20300
+ _this.container.style.width = "".concat(_this.box.width(_this.plane.size), "px");
20301
+ _this.container.style.height = "".concat(_this.box.height(_this.plane.size), "px");
20302
+ _this.container.style.left = "".concat(_this.boxLeft, "px");
20303
+ _this.container.style.top = "".concat(_this.boxTop, "px");
20304
+ _this.content.render();
20305
+ }
20306
+ _state.label = 4;
20307
+ case 4:
20308
+ _this.applyPlugins("afterRender");
20309
+ (_this_deps_recorder = _this.deps.recorder) === null || _this_deps_recorder === void 0 ? void 0 : _this_deps_recorder.presentationStateChanged(_this);
20310
+ return [
20311
+ 2
20312
+ ];
20313
+ }
20314
+ });
20315
+ })();
20126
20316
  }
20127
20317
  },
20128
20318
  {
20129
20319
  key: "clear",
20130
20320
  value: function clear() {
20131
20321
  this.updateRegion({
20132
- id: 0,
20322
+ id: this.regionDescriptor.id,
20133
20323
  box: {
20134
20324
  x1: 0,
20135
20325
  x2: 0,
@@ -20176,6 +20366,207 @@ var AdRegion = /*#__PURE__*/ function(Region) {
20176
20366
  ]);
20177
20367
  return AdRegion;
20178
20368
  }(Region);
20369
+ // src/Ads/Regions/Plugins/Animation/RegionAnimationPlugin.ts
20370
+ var RegionAnimationPlugin = /*#__PURE__*/ function() {
20371
+ function RegionAnimationPlugin() {
20372
+ _class_call_check(this, RegionAnimationPlugin);
20373
+ }
20374
+ _create_class(RegionAnimationPlugin, [
20375
+ {
20376
+ key: "getBoxPosition",
20377
+ value: function getBoxPosition(plane, box) {
20378
+ var planeWidth = plane.size.width;
20379
+ var planeHeight = plane.size.height;
20380
+ var coords = {
20381
+ x1: box.coords.x1 * planeWidth,
20382
+ y1: box.coords.y1 * planeHeight,
20383
+ x2: box.coords.x2 * planeWidth,
20384
+ y2: box.coords.y2 * planeHeight
20385
+ };
20386
+ var centerX = (coords.x1 + coords.x2) / 2;
20387
+ var centerY = (coords.y1 + coords.y2) / 2;
20388
+ var isTop = centerY < planeHeight / 2;
20389
+ var isBottom = centerY >= planeHeight / 2;
20390
+ var isLeft = centerX < planeWidth / 3;
20391
+ var isCenter = centerX >= planeWidth / 3 && centerX < 2 * planeWidth / 3;
20392
+ var isRight = centerX >= 2 * planeWidth / 3;
20393
+ if (isTop && isLeft) return "TOP_LEFT";
20394
+ if (isTop && isCenter) return "TOP_CENTER";
20395
+ if (isTop && isRight) return "TOP_RIGHT";
20396
+ if (isBottom && isRight) return "BOTTOM_RIGHT";
20397
+ }
20398
+ },
20399
+ {
20400
+ key: "getAnimationForEntrance",
20401
+ value: function getAnimationForEntrance(region) {
20402
+ var position = this.getBoxPosition(region.referencePlane, region.boundingBox);
20403
+ if (!position) {
20404
+ return;
20405
+ }
20406
+ return "SLIDE_IN_".concat(position);
20407
+ }
20408
+ },
20409
+ {
20410
+ key: "animateEntrance",
20411
+ value: function animateEntrance(region) {
20412
+ var position = this.getBoxPosition(region.referencePlane, region.boundingBox);
20413
+ if (!position) {
20414
+ return;
20415
+ }
20416
+ region.position = position;
20417
+ region.content.view.classList.remove("SLIDE_OUT_".concat(position));
20418
+ region.content.view.classList.add("SLIDE_IN_".concat(position));
20419
+ }
20420
+ },
20421
+ {
20422
+ key: "animateExit",
20423
+ value: function animateExit(region) {
20424
+ var position = region.position || this.getBoxPosition(region.referencePlane, region.boundingBox);
20425
+ if (!position) {
20426
+ return;
20427
+ }
20428
+ region.position = void 0;
20429
+ region.content.view.classList.remove("SLIDE_IN_".concat(position));
20430
+ region.content.view.classList.add("SLIDE_OUT_".concat(position));
20431
+ }
20432
+ },
20433
+ {
20434
+ key: "beforeRender",
20435
+ value: function beforeRender(region) {
20436
+ region.content.view.classList.add("ANIMATE");
20437
+ return Promise.resolve();
20438
+ }
20439
+ },
20440
+ {
20441
+ key: "afterShow",
20442
+ value: function afterShow(region) {
20443
+ this.animateEntrance(region);
20444
+ return Promise.resolve();
20445
+ }
20446
+ },
20447
+ {
20448
+ key: "beforeHide",
20449
+ value: function beforeHide(region) {
20450
+ this.animateExit(region);
20451
+ return new Promise(function(resolve) {
20452
+ return setTimeout(resolve, 1e3);
20453
+ });
20454
+ }
20455
+ }
20456
+ ]);
20457
+ return RegionAnimationPlugin;
20458
+ }();
20459
+ // src/Ads/Regions/Plugins/Mask/RegionMaskPlugin.ts
20460
+ var RegionMask = /*#__PURE__*/ function() {
20461
+ function RegionMask() {
20462
+ _class_call_check(this, RegionMask);
20463
+ this.width = 0;
20464
+ this.height = 0;
20465
+ this.mask = document.createElement("canvas");
20466
+ this.mask.classList.add("BRNDTS_RM");
20467
+ }
20468
+ _create_class(RegionMask, [
20469
+ {
20470
+ key: "view",
20471
+ get: function get() {
20472
+ return this.mask;
20473
+ }
20474
+ },
20475
+ {
20476
+ key: "maskUrl",
20477
+ get: function get() {
20478
+ return "url(" + this.mask.toDataURL() + ")";
20479
+ }
20480
+ },
20481
+ {
20482
+ key: "render",
20483
+ value: function render(plane, box, contours) {
20484
+ this.width = box.width(plane.size);
20485
+ this.height = box.height(plane.size);
20486
+ this.mask.width = box.width(plane.size);
20487
+ this.mask.style.width = "".concat(box.width(plane.size), "px");
20488
+ this.mask.height = box.height(plane.size);
20489
+ this.mask.style.height = "".concat(box.height(plane.size), "px");
20490
+ if (contours.length === 0) {
20491
+ this.clear();
20492
+ } else {
20493
+ var ctx = this.mask.getContext("2d");
20494
+ if (!ctx) {
20495
+ return;
20496
+ }
20497
+ ctx.beginPath();
20498
+ ctx.moveTo(contours[0].x * plane.size.width - box.coords.x1 * plane.size.width, contours[0].y * plane.size.height - box.coords.y1 * plane.size.height);
20499
+ contours.forEach(function(point) {
20500
+ return ctx.lineTo(point.x * plane.size.width - box.coords.x1 * plane.size.width, point.y * plane.size.height - box.coords.y1 * plane.size.height);
20501
+ });
20502
+ ctx.closePath();
20503
+ ctx.stroke();
20504
+ ctx.filter = "blur(1px)";
20505
+ ctx.fillStyle = "black";
20506
+ ctx.fill();
20507
+ }
20508
+ }
20509
+ },
20510
+ {
20511
+ key: "clear",
20512
+ value: function clear() {
20513
+ var ctx = this.mask.getContext("2d");
20514
+ if (!ctx) {
20515
+ return;
20516
+ }
20517
+ ctx.clearRect(0, 0, this.width, this.height);
20518
+ ctx.fillStyle = "white";
20519
+ ctx.fill();
20520
+ ctx.fillStyle = "black";
20521
+ ctx.strokeStyle = "black";
20522
+ ctx.lineWidth = 2;
20523
+ }
20524
+ }
20525
+ ]);
20526
+ return RegionMask;
20527
+ }();
20528
+ var RegionMaskPlugin = /*#__PURE__*/ function() {
20529
+ function RegionMaskPlugin() {
20530
+ _class_call_check(this, RegionMaskPlugin);
20531
+ this.countours = new RegionContours();
20532
+ this.mask = new RegionMask();
20533
+ }
20534
+ _create_class(RegionMaskPlugin, [
20535
+ {
20536
+ key: "afterRender",
20537
+ value: function afterRender(region) {
20538
+ this.countours.update(region.regionContours.points);
20539
+ this.mask.render(region.referencePlane, region.boundingBox, this.countours.points);
20540
+ region.content.view.style.maskImage = this.mask.maskUrl;
20541
+ return Promise.resolve();
20542
+ }
20543
+ }
20544
+ ]);
20545
+ return RegionMaskPlugin;
20546
+ }();
20547
+ // src/Ads/Regions/Plugins/Border/RegionBorderPlugin.ts
20548
+ var RegionBorderPlugin = /*#__PURE__*/ function() {
20549
+ function RegionBorderPlugin() {
20550
+ _class_call_check(this, RegionBorderPlugin);
20551
+ }
20552
+ _create_class(RegionBorderPlugin, [
20553
+ {
20554
+ key: "beforeShow",
20555
+ value: function beforeShow(region) {
20556
+ region.content.view.classList.toggle("BRNDTS_R_B", true);
20557
+ return Promise.resolve();
20558
+ }
20559
+ },
20560
+ {
20561
+ key: "afterHide",
20562
+ value: function afterHide(region) {
20563
+ region.content.view.classList.toggle("BRNDTS_R_B", false);
20564
+ return Promise.resolve();
20565
+ }
20566
+ }
20567
+ ]);
20568
+ return RegionBorderPlugin;
20569
+ }();
20179
20570
  // src/Ads/Regions/RegionFactory.ts
20180
20571
  var RegionFactory = /*#__PURE__*/ function() {
20181
20572
  function RegionFactory(deps) {
@@ -20184,11 +20575,35 @@ var RegionFactory = /*#__PURE__*/ function() {
20184
20575
  this.deps = deps;
20185
20576
  }
20186
20577
  _create_class(RegionFactory, [
20578
+ {
20579
+ key: "getPluginForStrategy",
20580
+ value: function getPluginForStrategy() {
20581
+ var _this_deps;
20582
+ if (!((_this_deps = this.deps) === null || _this_deps === void 0 ? void 0 : _this_deps.strategy)) {
20583
+ return [
20584
+ new RegionMaskPlugin()
20585
+ ];
20586
+ }
20587
+ if (this.deps.strategy === "blend") {
20588
+ return [
20589
+ new RegionMaskPlugin()
20590
+ ];
20591
+ }
20592
+ if (this.deps.strategy === "banner" || this.deps.strategy === "bannerv2" || this.deps.strategy === "bannerv2_ocr" || this.deps.strategy === "test") {
20593
+ return [
20594
+ new RegionBorderPlugin(),
20595
+ new RegionAnimationPlugin()
20596
+ ];
20597
+ }
20598
+ }
20599
+ },
20187
20600
  {
20188
20601
  key: "get",
20189
20602
  value: function get(regionDescriptor, planeDescriptor) {
20190
20603
  if (regionDescriptor && planeDescriptor) {
20191
- return new AdRegion(regionDescriptor, planeDescriptor, this.deps || {});
20604
+ return new AdRegion(regionDescriptor, planeDescriptor, _object_spread_props(_object_spread({}, this.deps || {}), {
20605
+ plugins: this.getPluginForStrategy()
20606
+ }));
20192
20607
  }
20193
20608
  throw new InternalError("Unable to create region with provided properties!");
20194
20609
  }
@@ -20297,7 +20712,8 @@ var RegionRenderer = /*#__PURE__*/ function() {
20297
20712
  this.regionsContainerView = new RegionsContainerView(width, height);
20298
20713
  this.regionFactory = new RegionFactory({
20299
20714
  recorder: this.options.recorder,
20300
- provider: this.options.provider
20715
+ provider: this.options.provider,
20716
+ strategy: this.options.strategy
20301
20717
  });
20302
20718
  var initialRegion = this.regionFactory.get({
20303
20719
  id: 0,
@@ -20386,10 +20802,8 @@ var RegionRenderer = /*#__PURE__*/ function() {
20386
20802
  {
20387
20803
  key: "clear",
20388
20804
  value: function clear() {
20389
- var _this = this;
20390
20805
  this.regionsData = [];
20391
20806
  this.regionsObjects.forEach(function(region) {
20392
- _this.intersectionObserver.unobserve(region.view);
20393
20807
  region.clear();
20394
20808
  });
20395
20809
  }
@@ -20397,10 +20811,12 @@ var RegionRenderer = /*#__PURE__*/ function() {
20397
20811
  {
20398
20812
  key: "destroy",
20399
20813
  value: function destroy() {
20400
- this.clear();
20401
20814
  while(this.regionsObjects.length){
20402
- var _this_regionsObjects_pop;
20403
- (_this_regionsObjects_pop = this.regionsObjects.pop()) === null || _this_regionsObjects_pop === void 0 ? void 0 : _this_regionsObjects_pop.destroy();
20815
+ var region = this.regionsObjects.pop();
20816
+ if (region) {
20817
+ this.intersectionObserver.unobserve(region.view);
20818
+ region.destroy();
20819
+ }
20404
20820
  }
20405
20821
  this.regionsContainerView.destroy();
20406
20822
  }
@@ -20409,15 +20825,15 @@ var RegionRenderer = /*#__PURE__*/ function() {
20409
20825
  return RegionRenderer;
20410
20826
  }();
20411
20827
  // src/Ads/PresentationStrategy/AbstractPresentation.ts
20412
- var import_events = __toESM(require_events());
20413
- var AbstractPresentation = /*#__PURE__*/ function(_import_events_default) {
20414
- _inherits(AbstractPresentation, _import_events_default);
20828
+ var import_events2 = __toESM(require_events());
20829
+ var AbstractPresentation = /*#__PURE__*/ function(_import_events2_default) {
20830
+ _inherits(AbstractPresentation, _import_events2_default);
20415
20831
  function AbstractPresentation() {
20416
20832
  _class_call_check(this, AbstractPresentation);
20417
20833
  return _call_super(this, AbstractPresentation);
20418
20834
  }
20419
20835
  return AbstractPresentation;
20420
- }(import_events.default);
20836
+ }(import_events2.default);
20421
20837
  // src/Ads/PresentationStrategy/CooldownPresentation.ts
20422
20838
  var CooldownPresentation = /*#__PURE__*/ function(AbstractPresentation) {
20423
20839
  _inherits(CooldownPresentation, AbstractPresentation);
@@ -20710,6 +21126,7 @@ var AdsTerraProvider = /*#__PURE__*/ function(ContentProvider) {
20710
21126
  return AdsTerraProvider;
20711
21127
  }(ContentProvider);
20712
21128
  // src/Ads/Providers/BRNDTSDefault/BRNDTSDefaultProvider.ts
21129
+ var icon = '\n<?xml version="1.0" encoding="UTF-8"?>\n<svg id="Camada_1" data-name="Camada 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 875 245">\n <defs>\n <style>\n .cls-1 {\n fill: #fff;\n }\n </style>\n </defs>\n <g>\n <path class="cls-1" d="M279.16,182.12v-116.12h48.13c12.5,0,21.49,2.76,26.96,8.28,5.47,5.52,8.2,13.08,8.2,22.66,0,4.48-.6,8.41-1.8,11.8-1.2,3.39-2.97,6.2-5.31,8.44-2.34,2.24-5.29,3.78-8.83,4.61,2.71.73,5.26,1.82,7.66,3.28,2.4,1.46,4.48,3.39,6.25,5.78,1.77,2.4,3.15,5.21,4.14,8.44.99,3.23,1.48,6.88,1.48,10.94,0,7.61-1.36,13.75-4.06,18.44-2.71,4.69-6.77,8.1-12.19,10.24-5.42,2.14-12.14,3.2-20.16,3.2h-50.48ZM309.48,111.64h17.5c2.29,0,3.98-.88,5.08-2.66,1.09-1.77,1.64-3.96,1.64-6.56,0-3.54-.7-5.96-2.11-7.27-1.41-1.3-2.94-1.95-4.61-1.95h-17.5v18.44ZM309.48,154.93h19.22c1.88,0,3.44-.42,4.69-1.25,1.25-.83,2.21-2,2.89-3.52.68-1.51,1.02-3.31,1.02-5.39s-.34-3.88-1.02-5.39c-.68-1.51-1.64-2.68-2.89-3.52-1.25-.83-2.81-1.25-4.69-1.25h-19.22v20.32Z"/>\n <path class="cls-1" d="M379.65,182.12v-116.12h49.54c5.1,0,9.79.63,14.07,1.88,4.27,1.25,7.97,3.36,11.1,6.33,3.13,2.97,5.55,6.95,7.27,11.96s2.58,11.31,2.58,18.91c0,4.79-.42,8.96-1.25,12.5-.84,3.54-1.95,6.54-3.36,8.99-1.41,2.45-3.07,4.51-5,6.17-1.93,1.67-3.99,3.13-6.17,4.38l20.16,45.01h-30.79l-16.25-40.01h-11.57v40.01h-30.32ZM409.97,118.05h13.75c1.67,0,3.13-.23,4.38-.7s2.32-1.22,3.2-2.27c.88-1.04,1.54-2.37,1.95-3.98.41-1.61.62-3.57.62-5.86s-.21-4.22-.62-5.78c-.42-1.56-1.07-2.79-1.95-3.67-.89-.88-1.95-1.54-3.2-1.95-1.25-.42-2.71-.62-4.38-.62h-13.75v24.85Z"/>\n <path class="cls-1" d="M479.67,182.12v-116.12h24.07l40.79,64.7v-64.7h30.32v116.12h-24.07l-40.79-64.7v64.7h-30.32Z"/>\n <path class="cls-1" d="M592.03,182.12v-116.12h51.26c8.44,0,15.37,1.48,20.79,4.45,5.42,2.97,9.69,7.11,12.81,12.42,3.13,5.31,5.31,11.49,6.56,18.52,1.25,7.03,1.88,14.61,1.88,22.74,0,13.65-1.54,24.72-4.61,33.21-3.07,8.49-7.71,14.74-13.91,18.75-6.2,4.01-14.04,6.02-23.52,6.02h-51.26ZM622.35,154.93h17.82c3.85,0,6.85-1.04,8.99-3.13,2.13-2.08,3.65-5.39,4.53-9.92.88-4.53,1.33-10.44,1.33-17.74,0-6.88-.34-12.37-1.02-16.49-.68-4.11-1.67-7.21-2.97-9.3-1.3-2.08-2.87-3.46-4.69-4.14-1.82-.68-3.88-1.02-6.17-1.02h-17.82v61.73Z"/>\n <path class="cls-1" d="M721.9,182.12v-88.92h-29.22v-27.19h88.77v27.19h-29.22v88.92h-30.32Z"/>\n <path class="cls-1" d="M828.95,183.06c-3.44,0-6.8-.11-10.08-.31-3.28-.21-6.51-.52-9.69-.94-3.18-.42-6.23-.88-9.14-1.41-2.92-.52-5.73-1.15-8.44-1.88v-24.07c3.54.31,7.37.57,11.49.78,4.11.21,8.28.37,12.5.47,4.22.1,8.15.16,11.8.16,3.44,0,6.3-.26,8.6-.78,2.29-.52,4.01-1.35,5.16-2.5,1.15-1.15,1.72-2.71,1.72-4.69v-1.88c0-2.29-.81-4.01-2.42-5.16-1.62-1.15-3.52-1.72-5.7-1.72h-8.28c-12.09,0-21.25-2.66-27.51-7.97-6.25-5.31-9.38-14.22-9.38-26.72v-5.16c0-11.46,3.44-20.03,10.31-25.71,6.88-5.68,16.77-8.52,29.69-8.52,4.9,0,9.51.23,13.83.7,4.32.47,8.39,1.04,12.19,1.72,3.8.68,7.21,1.38,10.24,2.11v24.07c-4.79-.42-10.18-.75-16.17-1.02-5.99-.26-11.44-.39-16.33-.39-2.92,0-5.52.21-7.81.63-2.29.42-4.06,1.25-5.31,2.5-1.25,1.25-1.88,3.07-1.88,5.47v1.56c0,2.61.83,4.59,2.5,5.94,1.67,1.36,4.22,2.03,7.66,2.03h10.31c7.29,0,13.36,1.38,18.21,4.14,4.84,2.76,8.49,6.51,10.94,11.25,2.45,4.74,3.67,10.13,3.67,16.17v5.16c0,9.9-1.72,17.45-5.16,22.66-3.44,5.21-8.34,8.73-14.69,10.55-6.36,1.82-13.96,2.74-22.82,2.74Z"/>\n </g>\n <path class="cls-1" d="M193.77,2.19H53.62C25.87,2.19,3.39,24.68,3.39,52.42v140.15c0,27.75,22.49,50.23,50.23,50.23h140.15c27.75,0,50.23-22.49,50.23-50.23V52.42c0-27.74-22.49-50.23-50.23-50.23ZM127.13,65.24c0-9.25,7.5-16.74,16.74-16.74h53.45v53.45c0,9.25-7.5,16.74-16.74,16.74h-53.45v-53.45ZM120.23,179.77c0,9.25-7.5,16.74-16.74,16.74h-36.71c-9.25,0-16.74-7.5-16.74-16.74v-114.53c0-9.25,7.5-16.74,16.74-16.74h36.71c9.25,0,16.74,7.5,16.74,16.74v114.53ZM197.33,162.19c-.55,18.26-16.3,33.95-34.45,34.31-17.61.35-33.5-12.89-35.21-30.88-1.15-12.1-.22-24.4-.22-38.93,14.98,0,27.35-.98,39.49.23,18.36,1.83,30.93,17.24,30.38,35.27Z"/>\n</svg>';
20713
21130
  var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
20714
21131
  _inherits(BRNDTSDefaultProvider, ContentProvider);
20715
21132
  function BRNDTSDefaultProvider(context) {
@@ -20725,28 +21142,28 @@ var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
20725
21142
  container.style.height = "100%";
20726
21143
  var box = document.createElement("div");
20727
21144
  box.classList.add("box");
21145
+ var iconBox = document.createElement("div");
21146
+ iconBox.classList.add("icon");
21147
+ iconBox.innerHTML = icon;
21148
+ box.appendChild(iconBox);
20728
21149
  container.appendChild(box);
20729
- container.appendChild(_this.createText("BRNDTS"));
20730
21150
  _this.content.push(container);
20731
21151
  return _this;
20732
21152
  }
20733
21153
  _create_class(BRNDTSDefaultProvider, [
20734
21154
  {
20735
- key: "createText",
20736
- value: function createText(text2) {
20737
- var textElement = document.createElement("div");
20738
- textElement.classList.add("text");
20739
- textElement.textContent = text2;
20740
- return textElement;
21155
+ key: "contents",
21156
+ value: function contents() {
21157
+ return this.content.map(function(v) {
21158
+ return v.cloneNode(true);
21159
+ });
20741
21160
  }
20742
21161
  },
20743
21162
  {
20744
21163
  key: "request",
20745
21164
  value: function request() {
20746
- var _this = this;
20747
21165
  return _async_to_generator(function() {
20748
21166
  return _ts_generator(this, function(_state) {
20749
- _this.notify();
20750
21167
  return [
20751
21168
  2
20752
21169
  ];
@@ -72932,7 +73349,8 @@ var Ads = /*#__PURE__*/ function() {
72932
73349
  this.regionsRenderer = new RegionRenderer(this.context.media.viewWidth, this.context.media.viewHeight, {
72933
73350
  debug: this.context.config.get("debug"),
72934
73351
  recorder: this.context.recorder,
72935
- provider: ContentProviderFactory.getProvider(this.context, this.context.config.get("ads").provider)
73352
+ provider: ContentProviderFactory.getProvider(this.context, this.context.config.get("ads").provider),
73353
+ strategy: this.context.config.get("ads").regions.strategy
72936
73354
  });
72937
73355
  } catch (e2) {
72938
73356
  if (_instanceof(e2, Error)) {
@@ -73003,7 +73421,6 @@ var Ads = /*#__PURE__*/ function() {
73003
73421
  }
73004
73422
  }).on("cooldown", function() {
73005
73423
  var _this_regionsRenderer;
73006
- _this.context.logger.log("cooldown");
73007
73424
  (_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
73008
73425
  });
73009
73426
  (_this_context_media = this.context.media) === null || _this_context_media === void 0 ? void 0 : _this_context_media.on("SEEKED", function() {
@@ -73037,7 +73454,7 @@ var Ads = /*#__PURE__*/ function() {
73037
73454
  // src/Ads/index.ts
73038
73455
  var Ads_default = Ads;
73039
73456
  // src/UI/Interface.ts
73040
- var import_events3 = __toESM(require_events());
73457
+ var import_events4 = __toESM(require_events());
73041
73458
  // src/Common/utils/elements.ts
73042
73459
  function wrap(elements2, wrapper) {
73043
73460
  var targets = elements2.length ? elements2 : [
@@ -73243,15 +73660,15 @@ var elements = {
73243
73660
  };
73244
73661
  var elements_default = elements;
73245
73662
  // src/UI/Controls/ControlEvents.ts
73246
- var import_events2 = __toESM(require_events());
73247
- var ControlsEvents = /*#__PURE__*/ function(_import_events2_default) {
73248
- _inherits(ControlsEvents, _import_events2_default);
73663
+ var import_events3 = __toESM(require_events());
73664
+ var ControlsEvents = /*#__PURE__*/ function(_import_events3_default) {
73665
+ _inherits(ControlsEvents, _import_events3_default);
73249
73666
  function ControlsEvents() {
73250
73667
  _class_call_check(this, ControlsEvents);
73251
73668
  return _call_super(this, ControlsEvents, arguments);
73252
73669
  }
73253
73670
  return ControlsEvents;
73254
- }(import_events2.default);
73671
+ }(import_events3.default);
73255
73672
  // node_modules/@fortawesome/fontawesome-svg-core/index.mjs
73256
73673
  var noop2 = function() {};
73257
73674
  var _WINDOW = {};
@@ -74039,12 +74456,12 @@ function codePointAt(string, index) {
74039
74456
  }
74040
74457
  function normalizeIcons(icons) {
74041
74458
  return Object.keys(icons).reduce(function(acc, iconName) {
74042
- var icon2 = icons[iconName];
74043
- var expanded = !!icon2.icon;
74459
+ var icon3 = icons[iconName];
74460
+ var expanded = !!icon3.icon;
74044
74461
  if (expanded) {
74045
- acc[icon2.iconName] = icon2.icon;
74462
+ acc[icon3.iconName] = icon3.icon;
74046
74463
  } else {
74047
- acc[iconName] = icon2;
74464
+ acc[iconName] = icon3;
74048
74465
  }
74049
74466
  return acc;
74050
74467
  }, {});
@@ -74093,12 +74510,12 @@ var build = function() {
74093
74510
  return o$$1;
74094
74511
  }, {});
74095
74512
  };
74096
- _byUnicode = lookup3(function(acc, icon2, iconName) {
74097
- if (icon2[3]) {
74098
- acc[icon2[3]] = iconName;
74513
+ _byUnicode = lookup3(function(acc, icon3, iconName) {
74514
+ if (icon3[3]) {
74515
+ acc[icon3[3]] = iconName;
74099
74516
  }
74100
- if (icon2[2]) {
74101
- var aliases = icon2[2].filter(function(a$$1) {
74517
+ if (icon3[2]) {
74518
+ var aliases = icon3[2].filter(function(a$$1) {
74102
74519
  return typeof a$$1 === "number";
74103
74520
  });
74104
74521
  aliases.forEach(function(alias) {
@@ -74107,10 +74524,10 @@ var build = function() {
74107
74524
  }
74108
74525
  return acc;
74109
74526
  });
74110
- _byLigature = lookup3(function(acc, icon2, iconName) {
74527
+ _byLigature = lookup3(function(acc, icon3, iconName) {
74111
74528
  acc[iconName] = iconName;
74112
- if (icon2[2]) {
74113
- var aliases = icon2[2].filter(function(a$$1) {
74529
+ if (icon3[2]) {
74530
+ var aliases = icon3[2].filter(function(a$$1) {
74114
74531
  return typeof a$$1 === "string";
74115
74532
  });
74116
74533
  aliases.forEach(function(alias) {
@@ -74119,8 +74536,8 @@ var build = function() {
74119
74536
  }
74120
74537
  return acc;
74121
74538
  });
74122
- _byAlias = lookup3(function(acc, icon2, iconName) {
74123
- var aliases = icon2[2];
74539
+ _byAlias = lookup3(function(acc, icon3, iconName) {
74540
+ var aliases = icon3[2];
74124
74541
  acc[iconName] = iconName;
74125
74542
  aliases.forEach(function(alias) {
74126
74543
  acc[alias] = iconName;
@@ -74315,17 +74732,17 @@ var Library = /*#__PURE__*/ function() {
74315
74732
  0: definition
74316
74733
  } : definition;
74317
74734
  Object.keys(normalized).map(function(key) {
74318
- var _normalized_key = normalized[key], prefix = _normalized_key.prefix, iconName = _normalized_key.iconName, icon2 = _normalized_key.icon;
74319
- var aliases = icon2[2];
74735
+ var _normalized_key = normalized[key], prefix = _normalized_key.prefix, iconName = _normalized_key.iconName, icon3 = _normalized_key.icon;
74736
+ var aliases = icon3[2];
74320
74737
  if (!additions[prefix]) additions[prefix] = {};
74321
74738
  if (aliases.length > 0) {
74322
74739
  aliases.forEach(function(alias) {
74323
74740
  if (typeof alias === "string") {
74324
- additions[prefix][alias] = icon2;
74741
+ additions[prefix][alias] = icon3;
74325
74742
  }
74326
74743
  });
74327
74744
  }
74328
- additions[prefix][iconName] = icon2;
74745
+ additions[prefix][iconName] = icon3;
74329
74746
  });
74330
74747
  return additions;
74331
74748
  }
@@ -74446,26 +74863,26 @@ var dom = {
74446
74863
  }
74447
74864
  };
74448
74865
  var parse = {
74449
- icon: function(icon2) {
74450
- if (icon2 === null) {
74866
+ icon: function(icon3) {
74867
+ if (icon3 === null) {
74451
74868
  return null;
74452
74869
  }
74453
- if ((typeof icon2 === "undefined" ? "undefined" : _type_of(icon2)) === "object" && icon2.prefix && icon2.iconName) {
74870
+ if ((typeof icon3 === "undefined" ? "undefined" : _type_of(icon3)) === "object" && icon3.prefix && icon3.iconName) {
74454
74871
  return {
74455
- prefix: icon2.prefix,
74456
- iconName: byAlias(icon2.prefix, icon2.iconName) || icon2.iconName
74872
+ prefix: icon3.prefix,
74873
+ iconName: byAlias(icon3.prefix, icon3.iconName) || icon3.iconName
74457
74874
  };
74458
74875
  }
74459
- if (Array.isArray(icon2) && icon2.length === 2) {
74460
- var iconName = icon2[1].indexOf("fa-") === 0 ? icon2[1].slice(3) : icon2[1];
74461
- var prefix = getCanonicalPrefix(icon2[0]);
74876
+ if (Array.isArray(icon3) && icon3.length === 2) {
74877
+ var iconName = icon3[1].indexOf("fa-") === 0 ? icon3[1].slice(3) : icon3[1];
74878
+ var prefix = getCanonicalPrefix(icon3[0]);
74462
74879
  return {
74463
74880
  prefix: prefix,
74464
74881
  iconName: byAlias(prefix, iconName) || iconName
74465
74882
  };
74466
74883
  }
74467
- if (typeof icon2 === "string" && (icon2.indexOf("".concat(config.cssPrefix, "-")) > -1 || icon2.match(ICON_SELECTION_SYNTAX_PATTERN))) {
74468
- var canonicalIcon = getCanonicalIcon(icon2.split(" "), {
74884
+ if (typeof icon3 === "string" && (icon3.indexOf("".concat(config.cssPrefix, "-")) > -1 || icon3.match(ICON_SELECTION_SYNTAX_PATTERN))) {
74885
+ var canonicalIcon = getCanonicalIcon(icon3.split(" "), {
74469
74886
  skipLookups: true
74470
74887
  });
74471
74888
  return {
@@ -74473,11 +74890,11 @@ var parse = {
74473
74890
  iconName: byAlias(canonicalIcon.prefix, canonicalIcon.iconName) || canonicalIcon.iconName
74474
74891
  };
74475
74892
  }
74476
- if (typeof icon2 === "string") {
74893
+ if (typeof icon3 === "string") {
74477
74894
  var prefix1 = getDefaultUsablePrefix();
74478
74895
  return {
74479
74896
  prefix: prefix1,
74480
- iconName: byAlias(prefix1, icon2) || icon2
74897
+ iconName: byAlias(prefix1, icon3) || icon3
74481
74898
  };
74482
74899
  }
74483
74900
  }
@@ -74704,10 +75121,10 @@ function makeLayersCounterAbstract(params) {
74704
75121
  return val;
74705
75122
  }
74706
75123
  var styles$1 = namespace.styles;
74707
- function asFoundIcon(icon2) {
74708
- var width = icon2[0];
74709
- var height = icon2[1];
74710
- var _icon2_slice = _sliced_to_array(icon2.slice(4), 1), vectorData = _icon2_slice[0];
75124
+ function asFoundIcon(icon3) {
75125
+ var width = icon3[0];
75126
+ var height = icon3[1];
75127
+ var _icon3_slice = _sliced_to_array(icon3.slice(4), 1), vectorData = _icon3_slice[0];
74711
75128
  var element = null;
74712
75129
  if (Array.isArray(vectorData)) {
74713
75130
  element = {
@@ -74772,8 +75189,8 @@ function findIcon(iconName, prefix) {
74772
75189
  prefix = shim.prefix || prefix;
74773
75190
  }
74774
75191
  if (iconName && prefix && styles$1[prefix] && styles$1[prefix][iconName]) {
74775
- var icon2 = styles$1[prefix][iconName];
74776
- return resolve(asFoundIcon(icon2));
75192
+ var icon3 = styles$1[prefix][iconName];
75193
+ return resolve(asFoundIcon(icon3));
74777
75194
  }
74778
75195
  maybeNotifyMissing(iconName, prefix);
74779
75196
  resolve(_object_spread_props(_object_spread({}, missingIconResolutionMixin), {
@@ -74808,8 +75225,8 @@ function isWatched(node) {
74808
75225
  }
74809
75226
  function hasPrefixAndIcon(node) {
74810
75227
  var prefix = node.getAttribute ? node.getAttribute(DATA_PREFIX) : null;
74811
- var icon2 = node.getAttribute ? node.getAttribute(DATA_ICON) : null;
74812
- return prefix && icon2;
75228
+ var icon3 = node.getAttribute ? node.getAttribute(DATA_ICON) : null;
75229
+ return prefix && icon3;
74813
75230
  }
74814
75231
  function hasBeenReplaced(node) {
74815
75232
  return node && node.classList && node.classList.contains && node.classList.contains(config.replacementClass);
@@ -75191,7 +75608,7 @@ var render = function render(iconDefinition) {
75191
75608
  var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
75192
75609
  var _params_transform = params.transform, transform = _params_transform === void 0 ? meaninglessTransform : _params_transform, _params_symbol = params.symbol, symbol = _params_symbol === void 0 ? false : _params_symbol, _params_mask = params.mask, mask = _params_mask === void 0 ? null : _params_mask, _params_maskId = params.maskId, maskId = _params_maskId === void 0 ? null : _params_maskId, _params_title = params.title, title = _params_title === void 0 ? null : _params_title, _params_titleId = params.titleId, titleId = _params_titleId === void 0 ? null : _params_titleId, _params_classes = params.classes, classes = _params_classes === void 0 ? [] : _params_classes, _params_attributes = params.attributes, attributes = _params_attributes === void 0 ? {} : _params_attributes, tmp = params.styles, styles2 = tmp === void 0 ? {} : tmp;
75193
75610
  if (!iconDefinition) return;
75194
- var prefix = iconDefinition.prefix, iconName = iconDefinition.iconName, icon2 = iconDefinition.icon;
75611
+ var prefix = iconDefinition.prefix, iconName = iconDefinition.iconName, icon3 = iconDefinition.icon;
75195
75612
  return domVariants(_object_spread({
75196
75613
  type: "icon"
75197
75614
  }, iconDefinition), function() {
@@ -75209,7 +75626,7 @@ var render = function render(iconDefinition) {
75209
75626
  }
75210
75627
  return makeInlineSvgAbstract({
75211
75628
  icons: {
75212
- main: asFoundIcon(icon2),
75629
+ main: asFoundIcon(icon3),
75213
75630
  mask: mask ? asFoundIcon(mask.icon) : {
75214
75631
  found: false,
75215
75632
  width: null,
@@ -75972,7 +76389,7 @@ var dom$1 = api.dom;
75972
76389
  var parse$1 = api.parse;
75973
76390
  var findIconDefinition$1 = api.findIconDefinition;
75974
76391
  var toHtml$1 = api.toHtml;
75975
- var icon = api.icon;
76392
+ var icon2 = api.icon;
75976
76393
  var layer = api.layer;
75977
76394
  var text = api.text;
75978
76395
  var counter = api.counter;
@@ -76005,11 +76422,11 @@ var faUpRightAndDownLeftFromCenter = {
76005
76422
  };
76006
76423
  // src/Common/utils/Icons.ts
76007
76424
  library$1.add(faUpRightAndDownLeftFromCenter, faDownLeftAndUpRightToCenter);
76008
- var expand = icon({
76425
+ var expand = icon2({
76009
76426
  prefix: "fas",
76010
76427
  iconName: "up-right-and-down-left-from-center"
76011
76428
  }).html;
76012
- var compress = icon({
76429
+ var compress = icon2({
76013
76430
  prefix: "fas",
76014
76431
  iconName: "down-left-and-up-right-to-center"
76015
76432
  }).html;
@@ -76304,8 +76721,8 @@ var Controls = /*#__PURE__*/ function() {
76304
76721
  return Controls;
76305
76722
  }();
76306
76723
  // src/UI/Interface.ts
76307
- var Interface = /*#__PURE__*/ function(_import_events3_default) {
76308
- _inherits(Interface, _import_events3_default);
76724
+ var Interface = /*#__PURE__*/ function(_import_events4_default) {
76725
+ _inherits(Interface, _import_events4_default);
76309
76726
  function Interface(context) {
76310
76727
  _class_call_check(this, Interface);
76311
76728
  var _this;
@@ -76464,7 +76881,7 @@ var Interface = /*#__PURE__*/ function(_import_events3_default) {
76464
76881
  }
76465
76882
  ]);
76466
76883
  return Interface;
76467
- }(import_events3.default);
76884
+ }(import_events4.default);
76468
76885
  // src/State/Store.ts
76469
76886
  function reducer(state, action) {
76470
76887
  switch(action.type){
@@ -76950,7 +77367,7 @@ var InteractionLog = /*#__PURE__*/ function() {
76950
77367
  return InteractionLog;
76951
77368
  }();
76952
77369
  // src/BRNDTSService.ts
76953
- var import_events4 = __toESM(require_events());
77370
+ var import_events5 = __toESM(require_events());
76954
77371
  // node_modules/engine.io-parser/build/esm/commons.js
76955
77372
  var PACKET_TYPES = /* @__PURE__ */ Object.create(null);
76956
77373
  PACKET_TYPES["open"] = "0";
@@ -80797,8 +81214,8 @@ Object.assign(lookup2, {
80797
81214
  connect: lookup2
80798
81215
  });
80799
81216
  // src/BRNDTSService.ts
80800
- var BRNDTSService = /*#__PURE__*/ function(_import_events4_default) {
80801
- _inherits(BRNDTSService, _import_events4_default);
81217
+ var BRNDTSService = /*#__PURE__*/ function(_import_events5_default) {
81218
+ _inherits(BRNDTSService, _import_events5_default);
80802
81219
  function BRNDTSService(deps, options) {
80803
81220
  _class_call_check(this, BRNDTSService);
80804
81221
  var _this;
@@ -80882,11 +81299,11 @@ var BRNDTSService = /*#__PURE__*/ function(_import_events4_default) {
80882
81299
  }
80883
81300
  ]);
80884
81301
  return BRNDTSService;
80885
- }(import_events4.default);
81302
+ }(import_events5.default);
80886
81303
  // src/Media/GenericMediaElement.ts
80887
- var import_events5 = __toESM(require_events());
80888
- var GenericMediaElement = /*#__PURE__*/ function(_import_events5_default) {
80889
- _inherits(GenericMediaElement, _import_events5_default);
81304
+ var import_events6 = __toESM(require_events());
81305
+ var GenericMediaElement = /*#__PURE__*/ function(_import_events6_default) {
81306
+ _inherits(GenericMediaElement, _import_events6_default);
80890
81307
  function GenericMediaElement(context) {
80891
81308
  _class_call_check(this, GenericMediaElement);
80892
81309
  var _this;
@@ -81050,7 +81467,7 @@ var GenericMediaElement = /*#__PURE__*/ function(_import_events5_default) {
81050
81467
  }
81051
81468
  ]);
81052
81469
  return GenericMediaElement;
81053
- }(import_events5.default);
81470
+ }(import_events6.default);
81054
81471
  // src/Media/YoutubeMediaElements.ts
81055
81472
  var import_loadjs = __toESM(require_loadjs_umd());
81056
81473
  var DEFAULT_SEEK_INTERVAL = 10;