@brndts/brndts-ads 1.14.19 → 1.14.21

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
@@ -68090,9 +68090,89 @@ var BASIC_SUPPORT = {
68090
68090
  audio: "canPlayType" in document.createElement("audio"),
68091
68091
  video: "canPlayType" in document.createElement("video")
68092
68092
  };
68093
+ function detectAdblock() {
68094
+ var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_timeoutMs = _ref.timeoutMs, timeoutMs = _ref_timeoutMs === void 0 ? 1500 : _ref_timeoutMs;
68095
+ return new Promise(function(resolve) {
68096
+ var maybeResolve = function maybeResolve() {
68097
+ requestAnimationFrame(function() {
68098
+ checkCSS();
68099
+ var signals = (cssHit ? 1 : 0) + (netHit ? 1 : 0) + (scriptHit ? 1 : 0);
68100
+ if (signals >= 2 || scriptLoaded && (cssHit || netHit)) {
68101
+ done(true);
68102
+ }
68103
+ });
68104
+ };
68105
+ var cleanup = function cleanup() {
68106
+ clearTimeout(t2);
68107
+ try {
68108
+ bait.remove();
68109
+ } catch (e) {}
68110
+ try {
68111
+ s2.remove();
68112
+ } catch (e) {}
68113
+ img.src = "";
68114
+ };
68115
+ var resolved = false;
68116
+ var done = function(v) {
68117
+ if (!resolved) {
68118
+ resolved = true;
68119
+ cleanup();
68120
+ resolve(v);
68121
+ }
68122
+ };
68123
+ var bait = document.createElement("div");
68124
+ bait.className = "ads ad ad-banner ad-unit adzone adsbox pub_300x250";
68125
+ bait.style.cssText = "position:absolute;left:-9999px;width:300px;height:250px;pointer-events:none;";
68126
+ document.addEventListener("DOMContentLoaded", function() {
68127
+ return document.body.appendChild(bait);
68128
+ });
68129
+ var cssHit = false;
68130
+ var checkCSS = function() {
68131
+ if (!bait.isConnected) {
68132
+ cssHit = true;
68133
+ return;
68134
+ }
68135
+ var cs = getComputedStyle(bait);
68136
+ var hidden = cs.display === "none" || cs.visibility === "hidden" || parseInt(cs.height || "0", 10) === 0 || bait.offsetParent === null;
68137
+ if (hidden) cssHit = true;
68138
+ };
68139
+ var img = new Image();
68140
+ var netHit = false;
68141
+ img.onload = function() {};
68142
+ img.onerror = function() {
68143
+ netHit = true;
68144
+ maybeResolve();
68145
+ };
68146
+ img.src = "/ads/px.gif?cb=".concat(Date.now());
68147
+ var s2 = document.createElement("script");
68148
+ var scriptHit = false;
68149
+ var scriptLoaded = false;
68150
+ window.__ab_allow = void 0;
68151
+ s2.async = true;
68152
+ s2.src = "/ads/allow.js?cb=".concat(Date.now());
68153
+ s2.onload = function() {
68154
+ scriptLoaded = true;
68155
+ if (window.__ab_allow !== true) {
68156
+ scriptHit = true;
68157
+ }
68158
+ maybeResolve();
68159
+ };
68160
+ s2.onerror = function() {
68161
+ scriptHit = true;
68162
+ maybeResolve();
68163
+ };
68164
+ document.head.appendChild(s2);
68165
+ var t2 = setTimeout(function() {
68166
+ checkCSS();
68167
+ var blocked = cssHit || netHit || scriptHit;
68168
+ done(blocked);
68169
+ }, timeoutMs);
68170
+ });
68171
+ }
68093
68172
  var Support = /*#__PURE__*/ function() {
68094
68173
  function _Support(type, provider) {
68095
68174
  _class_call_check(this, _Support);
68175
+ this.supportAds = null;
68096
68176
  this.api = type && BASIC_SUPPORT[type] || provider !== "html5";
68097
68177
  this.ui = this.api && _Support.rangeInput;
68098
68178
  }
@@ -68141,6 +68221,35 @@ var Support = /*#__PURE__*/ function() {
68141
68221
  ui: ui
68142
68222
  };
68143
68223
  }
68224
+ },
68225
+ {
68226
+ key: "ads",
68227
+ value: function ads() {
68228
+ return _async_to_generator(function() {
68229
+ var _;
68230
+ return _ts_generator(this, function(_state) {
68231
+ switch(_state.label){
68232
+ case 0:
68233
+ if (this.supportAds !== null) {
68234
+ this.supportAds;
68235
+ }
68236
+ _ = this;
68237
+ return [
68238
+ 4,
68239
+ detectAdblock().then(function(blocked) {
68240
+ return !blocked;
68241
+ })
68242
+ ];
68243
+ case 1:
68244
+ _.supportAds = _state.sent();
68245
+ return [
68246
+ 2,
68247
+ !!this.supportAds
68248
+ ];
68249
+ }
68250
+ });
68251
+ }).call(this);
68252
+ }
68144
68253
  }
68145
68254
  ], [
68146
68255
  {
@@ -69929,6 +70038,10 @@ var RULES = {
69929
70038
  [
69930
70039
  200,
69931
70040
  200
70041
+ ],
70042
+ [
70043
+ 180,
70044
+ 150
69932
70045
  ]
69933
70046
  ],
69934
70047
  "desktop": [
@@ -69943,6 +70056,10 @@ var RULES = {
69943
70056
  [
69944
70057
  200,
69945
70058
  200
70059
+ ],
70060
+ [
70061
+ 180,
70062
+ 150
69946
70063
  ]
69947
70064
  ],
69948
70065
  "tablet": [
@@ -71167,6 +71284,19 @@ var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
71167
71284
  });
71168
71285
  }).call(this);
71169
71286
  }
71287
+ },
71288
+ {
71289
+ key: "requestInstream",
71290
+ value: function requestInstream() {
71291
+ return _async_to_generator(function() {
71292
+ return _ts_generator(this, function(_state) {
71293
+ return [
71294
+ 2,
71295
+ Promise.resolve({})
71296
+ ];
71297
+ });
71298
+ })();
71299
+ }
71170
71300
  }
71171
71301
  ]);
71172
71302
  return BRNDTSDefaultProvider;
@@ -71445,6 +71575,22 @@ var SmartyadsProvider = /*#__PURE__*/ function(ContentProvider) {
71445
71575
  });
71446
71576
  }).call(this);
71447
71577
  }
71578
+ },
71579
+ {
71580
+ key: "requestInstream",
71581
+ value: function requestInstream() {
71582
+ return _async_to_generator(function() {
71583
+ var params;
71584
+ var _arguments = arguments;
71585
+ return _ts_generator(this, function(_state) {
71586
+ params = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
71587
+ return [
71588
+ 2,
71589
+ Promise.resolve({})
71590
+ ];
71591
+ });
71592
+ }).apply(this, arguments);
71593
+ }
71448
71594
  }
71449
71595
  ]);
71450
71596
  return SmartyadsProvider;
@@ -71553,6 +71699,22 @@ var SmartyadsTagProvider = /*#__PURE__*/ function(ContentProvider) {
71553
71699
  });
71554
71700
  }).call(this);
71555
71701
  }
71702
+ },
71703
+ {
71704
+ key: "requestInstream",
71705
+ value: function requestInstream() {
71706
+ return _async_to_generator(function() {
71707
+ var params;
71708
+ var _arguments = arguments;
71709
+ return _ts_generator(this, function(_state) {
71710
+ params = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
71711
+ return [
71712
+ 2,
71713
+ Promise.resolve({})
71714
+ ];
71715
+ });
71716
+ }).apply(this, arguments);
71717
+ }
71556
71718
  }
71557
71719
  ]);
71558
71720
  return SmartyadsTagProvider;
@@ -71600,6 +71762,19 @@ var StaticImageProvider = /*#__PURE__*/ function(ContentProvider) {
71600
71762
  });
71601
71763
  })();
71602
71764
  }
71765
+ },
71766
+ {
71767
+ key: "requestInstream",
71768
+ value: function requestInstream() {
71769
+ return _async_to_generator(function() {
71770
+ return _ts_generator(this, function(_state) {
71771
+ return [
71772
+ 2,
71773
+ Promise.resolve({})
71774
+ ];
71775
+ });
71776
+ })();
71777
+ }
71603
71778
  }
71604
71779
  ]);
71605
71780
  return StaticImageProvider;
@@ -71813,6 +71988,19 @@ var AffiliateProvider = /*#__PURE__*/ function(ContentProvider) {
71813
71988
  });
71814
71989
  }).call(this);
71815
71990
  }
71991
+ },
71992
+ {
71993
+ key: "requestInstream",
71994
+ value: function requestInstream() {
71995
+ return _async_to_generator(function() {
71996
+ return _ts_generator(this, function(_state) {
71997
+ return [
71998
+ 2,
71999
+ Promise.resolve({})
72000
+ ];
72001
+ });
72002
+ })();
72003
+ }
71816
72004
  }
71817
72005
  ]);
71818
72006
  return AffiliateProvider;
@@ -71825,7 +72013,23 @@ var PrebidConfigBuilder = /*#__PURE__*/ function() {
71825
72013
  debug: false,
71826
72014
  priceGranularity: "high",
71827
72015
  enableSendAllBids: true,
71828
- enableTIDs: true
72016
+ enableTIDs: true,
72017
+ cache: {
72018
+ url: "https://afatv.com/cache",
72019
+ // still required by API; won't be used when useLocal is true
72020
+ useLocal: true
72021
+ },
72022
+ mediaTypePriceGranularity: {
72023
+ video: {
72024
+ buckets: [
72025
+ {
72026
+ min: 0,
72027
+ max: 100,
72028
+ increment: 0.1
72029
+ }
72030
+ ]
72031
+ }
72032
+ }
71829
72033
  };
71830
72034
  }
71831
72035
  _create_class(PrebidConfigBuilder, [
@@ -72370,6 +72574,22 @@ var PrebidjsProvider = /*#__PURE__*/ function(ContentProvider) {
72370
72574
  });
72371
72575
  }).call(this);
72372
72576
  }
72577
+ },
72578
+ {
72579
+ key: "requestInstream",
72580
+ value: function requestInstream() {
72581
+ return _async_to_generator(function() {
72582
+ var params;
72583
+ var _arguments = arguments;
72584
+ return _ts_generator(this, function(_state) {
72585
+ params = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
72586
+ return [
72587
+ 2,
72588
+ Promise.resolve({})
72589
+ ];
72590
+ });
72591
+ }).apply(this, arguments);
72592
+ }
72373
72593
  }
72374
72594
  ]);
72375
72595
  return PrebidjsProvider;
@@ -72555,7 +72775,7 @@ var GPT = /*#__PURE__*/ function() {
72555
72775
  }
72556
72776
  mrecmapping = mrecmapping.build();
72557
72777
  } else {
72558
- window.googletag.sizeMapping().addSize([
72778
+ mrecmapping = window.googletag.sizeMapping().addSize([
72559
72779
  1024,
72560
72780
  0
72561
72781
  ], size).addSize([
@@ -72686,96 +72906,169 @@ var PrebidGAM = /*#__PURE__*/ function() {
72686
72906
  }
72687
72907
  },
72688
72908
  {
72689
- key: "defineSlot",
72690
- value: function defineSlot(options, slotId, containerId, adType) {
72909
+ key: "defineBannerAdUnit",
72910
+ value: function defineBannerAdUnit(unitDefinition, containerId, options, adType) {
72691
72911
  var adName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "banner";
72692
- var _window_pbjs;
72693
- var gamNetworkId = _PrebidGAM.getProperGAMNetworkId(options);
72694
- var unitDefinition = options.units.find(function(unit) {
72695
- return unit.code === "".concat(slotId);
72696
- });
72697
- var sizes = [];
72698
- var mapping = void 0;
72699
- if (!unitDefinition) {
72700
- console.error("No unit definition found for slotId: ".concat(slotId));
72701
- return;
72702
- }
72703
- if (adType) {
72704
- sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
72705
- mapping = RegionDefinitions.mapping(adType);
72706
- } else {
72707
- var _unitDefinition_mediaTypes_banner;
72708
- sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
72709
- }
72710
- var targeting = void 0;
72711
- if (unitDefinition.zoneId && options.reviveId) {
72712
- targeting = {
72713
- brndts_rid: options.reviveId,
72714
- brndts_zid: unitDefinition.zoneId
72715
- };
72716
- }
72717
- GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId), {
72718
- targeting: targeting,
72719
- mapping: mapping
72720
- });
72721
- if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
72722
- return "".concat(containerId) === "".concat(defUnit.code);
72723
- }))) {
72724
- var _window_pbjs_que, _window_pbjs1;
72725
- (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
72726
- var _window_pbjs;
72727
- if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
72728
- var adUnit = _object_spread_props(_object_spread({}, unitDefinition), {
72729
- mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
72730
- banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
72731
- sizes: sizes
72732
- })
72733
- }),
72734
- code: "".concat(containerId)
72735
- });
72736
- if (mapping) {
72737
- var mappedSizes = [];
72738
- var sortedBreakpoints = Object.keys(mapping).sort(function(a, b) {
72739
- return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
72740
- });
72741
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
72742
- try {
72743
- for(var _iterator = sortedBreakpoints[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
72744
- var bp = _step.value;
72745
- mappedSizes.push({
72746
- minViewPort: [
72747
- RegionDefinitions.BREAKPOINTS[bp],
72748
- 0
72749
- ],
72750
- sizes: mapping[bp]
72751
- });
72752
- }
72753
- } catch (err) {
72754
- _didIteratorError = true;
72755
- _iteratorError = err;
72756
- } finally{
72912
+ return new Promise(function(resolve) {
72913
+ var _window_pbjs;
72914
+ var sizes = [];
72915
+ var mapping = void 0;
72916
+ if (adType) {
72917
+ sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
72918
+ mapping = RegionDefinitions.mapping(adType);
72919
+ } else {
72920
+ var _unitDefinition_mediaTypes_banner;
72921
+ sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
72922
+ }
72923
+ var targeting = void 0;
72924
+ if (unitDefinition.zoneId && options.reviveId) {
72925
+ targeting = {
72926
+ brndts_rid: options.reviveId,
72927
+ brndts_zid: unitDefinition.zoneId
72928
+ };
72929
+ }
72930
+ var gamNetworkId = _PrebidGAM.getProperGAMNetworkId(options);
72931
+ GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId), {
72932
+ targeting: targeting,
72933
+ mapping: mapping
72934
+ });
72935
+ var existingSlot = (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.find(function(defUnit) {
72936
+ return "".concat(containerId) === "".concat(defUnit.code);
72937
+ });
72938
+ if (!existingSlot) {
72939
+ var _window_pbjs_que, _window_pbjs1;
72940
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
72941
+ var _window_pbjs;
72942
+ if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
72943
+ var adUnit = {
72944
+ code: "".concat(containerId),
72945
+ mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
72946
+ banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
72947
+ sizes: sizes
72948
+ })
72949
+ }),
72950
+ bids: unitDefinition.bids,
72951
+ schain: unitDefinition.schain
72952
+ };
72953
+ if (mapping) {
72954
+ var mappedSizes = [];
72955
+ var sortedBreakpoints = Object.keys(mapping).sort(function(a, b) {
72956
+ return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
72957
+ });
72958
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
72757
72959
  try {
72758
- if (!_iteratorNormalCompletion && _iterator.return != null) {
72759
- _iterator.return();
72960
+ for(var _iterator = sortedBreakpoints[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
72961
+ var bp = _step.value;
72962
+ mappedSizes.push({
72963
+ minViewPort: [
72964
+ RegionDefinitions.BREAKPOINTS[bp],
72965
+ 0
72966
+ ],
72967
+ sizes: mapping[bp]
72968
+ });
72760
72969
  }
72970
+ } catch (err) {
72971
+ _didIteratorError = true;
72972
+ _iteratorError = err;
72761
72973
  } finally{
72762
- if (_didIteratorError) {
72763
- throw _iteratorError;
72974
+ try {
72975
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
72976
+ _iterator.return();
72977
+ }
72978
+ } finally{
72979
+ if (_didIteratorError) {
72980
+ throw _iteratorError;
72981
+ }
72764
72982
  }
72765
72983
  }
72984
+ adUnit.mediaTypes.banner.sizeConfig = mappedSizes;
72985
+ } else {
72986
+ adUnit.mediaTypes.banner.sizes = sizes;
72766
72987
  }
72767
- adUnit.mediaTypes.banner.sizeConfig = mappedSizes;
72988
+ window.pbjs.addAdUnits([
72989
+ adUnit
72990
+ ]);
72991
+ resolve(adUnit);
72768
72992
  } else {
72769
- adUnit.mediaTypes.banner.sizes = sizes;
72993
+ console.error("addAdUnits is not a function.");
72994
+ resolve(void 0);
72770
72995
  }
72771
- window.pbjs.addAdUnits([
72772
- adUnit
72773
- ]);
72774
- } else {
72775
- console.error("addAdUnits is not a function.");
72996
+ });
72997
+ } else {
72998
+ resolve(existingSlot);
72999
+ }
73000
+ });
73001
+ }
73002
+ },
73003
+ {
73004
+ key: "defineVideoAdUnit",
73005
+ value: function defineVideoAdUnit(unitDefinition, containerId) {
73006
+ return new Promise(function(resolve) {
73007
+ var _window_pbjs;
73008
+ var existingSlot = (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.find(function(defUnit) {
73009
+ return "".concat(containerId) === "".concat(defUnit.code);
73010
+ });
73011
+ if (!existingSlot) {
73012
+ var _window_pbjs_que, _window_pbjs1;
73013
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73014
+ var _window_pbjs;
73015
+ if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73016
+ var adUnit = {
73017
+ code: "".concat(containerId),
73018
+ mediaTypes: _object_spread({}, unitDefinition.mediaTypes),
73019
+ bids: unitDefinition.bids,
73020
+ schain: unitDefinition.schain
73021
+ };
73022
+ window.pbjs.addAdUnits([
73023
+ adUnit
73024
+ ]);
73025
+ resolve(adUnit);
73026
+ } else {
73027
+ console.error("addAdUnits is not a function.");
73028
+ resolve(void 0);
73029
+ }
73030
+ });
73031
+ } else {
73032
+ resolve(existingSlot);
73033
+ }
73034
+ });
73035
+ }
73036
+ },
73037
+ {
73038
+ key: "defineSlot",
73039
+ value: function defineSlot(options, slotId, containerId, adType) {
73040
+ var adName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "banner";
73041
+ return _async_to_generator(function() {
73042
+ var unitDefinition;
73043
+ return _ts_generator(this, function(_state) {
73044
+ unitDefinition = options.units.find(function(unit) {
73045
+ return unit.code === "".concat(slotId);
73046
+ });
73047
+ if (!unitDefinition) {
73048
+ console.error("No unit definition found for slotId: ".concat(slotId));
73049
+ return [
73050
+ 2,
73051
+ unitDefinition
73052
+ ];
72776
73053
  }
73054
+ if (unitDefinition.mediaTypes.video) {
73055
+ return [
73056
+ 2,
73057
+ _PrebidGAM.defineVideoAdUnit(unitDefinition, containerId)
73058
+ ];
73059
+ } else if (unitDefinition.mediaTypes.banner) {
73060
+ return [
73061
+ 2,
73062
+ _PrebidGAM.defineBannerAdUnit(unitDefinition, containerId, options, adType, adName)
73063
+ ];
73064
+ }
73065
+ console.warn("No supported mediaTypes found for unit: ".concat(slotId));
73066
+ return [
73067
+ 2,
73068
+ void 0
73069
+ ];
72777
73070
  });
72778
- }
73071
+ })();
72779
73072
  }
72780
73073
  },
72781
73074
  {
@@ -72817,6 +73110,40 @@ var PrebidGAM = /*#__PURE__*/ function() {
72817
73110
  });
72818
73111
  });
72819
73112
  }
73113
+ },
73114
+ {
73115
+ key: "requestInstream",
73116
+ value: function requestInstream(options, slotId, containerId, callback) {
73117
+ var _window_pbjs;
73118
+ var PREBID_TIMEOUT = 1e3;
73119
+ (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.que.push(function() {
73120
+ var _window_pbjs;
73121
+ (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.requestBids({
73122
+ adUnitCodes: [
73123
+ "".concat(containerId)
73124
+ ],
73125
+ timeout: PREBID_TIMEOUT,
73126
+ bidsBackHandler: function bidsBackHandler() {
73127
+ var _window_pbjs, _window_pbjs_adServers, _window_pbjs1;
73128
+ var existingSlot = (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.find(function(defUnit) {
73129
+ return "".concat(containerId) === "".concat(defUnit.code);
73130
+ });
73131
+ if (!existingSlot) {
73132
+ console.warn("No ad unit found for containerId: ".concat(containerId));
73133
+ return;
73134
+ }
73135
+ var gamNetworkId = _PrebidGAM.getProperGAMNetworkId(options);
73136
+ var vastTagUrl = (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_adServers = _window_pbjs1.adServers) === null || _window_pbjs_adServers === void 0 ? void 0 : _window_pbjs_adServers.dfp.buildVideoUrl({
73137
+ adUnit: existingSlot,
73138
+ params: {
73139
+ iu: "/".concat(gamNetworkId, "/").concat(existingSlot.gamAdUnit)
73140
+ }
73141
+ });
73142
+ callback(vastTagUrl);
73143
+ }
73144
+ });
73145
+ });
73146
+ }
72820
73147
  }
72821
73148
  ]);
72822
73149
  return _PrebidGAM;
@@ -72945,6 +73272,72 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider) {
72945
73272
  });
72946
73273
  }).call(this);
72947
73274
  }
73275
+ },
73276
+ {
73277
+ key: "requestInstream",
73278
+ value: function requestInstream(params) {
73279
+ return _async_to_generator(function() {
73280
+ var _this;
73281
+ return _ts_generator(this, function(_state) {
73282
+ _this = this;
73283
+ return [
73284
+ 2,
73285
+ new Promise(function(resolve) {
73286
+ return _async_to_generator(function() {
73287
+ var adSlotId, adSlot, result;
73288
+ return _ts_generator(this, function(_state) {
73289
+ switch(_state.label){
73290
+ case 0:
73291
+ adSlotId = params.adSlot;
73292
+ if (!adSlotId && params.roles && params.roles.length > 0) {
73293
+ adSlot = this.options.units.find(function(unit) {
73294
+ var _params_roles;
73295
+ return unit._brndts_role !== void 0 && ((_params_roles = params.roles) === null || _params_roles === void 0 ? void 0 : _params_roles.includes(unit._brndts_role));
73296
+ });
73297
+ adSlotId = adSlot === null || adSlot === void 0 ? void 0 : adSlot.code;
73298
+ }
73299
+ if (!adSlotId) {
73300
+ console.warn("No adSlot or roles provided for instream ad request.");
73301
+ resolve({});
73302
+ return [
73303
+ 2
73304
+ ];
73305
+ }
73306
+ return [
73307
+ 4,
73308
+ prebidGamReady2.promise
73309
+ ];
73310
+ case 1:
73311
+ _state.sent();
73312
+ return [
73313
+ 4,
73314
+ PrebidGAM.defineSlot(this.options, adSlotId, adSlotId)
73315
+ ];
73316
+ case 2:
73317
+ result = _state.sent();
73318
+ if (!result) {
73319
+ console.warn("No ad unit found for instream adSlot: ".concat(adSlotId));
73320
+ resolve({});
73321
+ return [
73322
+ 2
73323
+ ];
73324
+ }
73325
+ PrebidGAM.requestInstream(this.options, adSlotId, adSlotId, function(content) {
73326
+ resolve({
73327
+ vastTagUrl: content
73328
+ });
73329
+ });
73330
+ return [
73331
+ 2
73332
+ ];
73333
+ }
73334
+ });
73335
+ }).call(_this);
73336
+ })
73337
+ ];
73338
+ });
73339
+ }).call(this);
73340
+ }
72948
73341
  }
72949
73342
  ]);
72950
73343
  return PrebidGAMProvider;
@@ -73040,16 +73433,29 @@ var ReviveProvider = /*#__PURE__*/ function(ContentProvider) {
73040
73433
  });
73041
73434
  }).call(this);
73042
73435
  }
73436
+ },
73437
+ {
73438
+ key: "requestInstream",
73439
+ value: function requestInstream() {
73440
+ return _async_to_generator(function() {
73441
+ return _ts_generator(this, function(_state) {
73442
+ return [
73443
+ 2,
73444
+ Promise.resolve({})
73445
+ ];
73446
+ });
73447
+ })();
73448
+ }
73043
73449
  }
73044
73450
  ]);
73045
73451
  return ReviveProvider;
73046
73452
  }(ContentProvider);
73047
73453
  // src/Ads/Providers/Prebidjs/PrebidReviveProvider.ts
73048
73454
  var PrebidRevive = /*#__PURE__*/ function() {
73049
- function PrebidRevive() {
73050
- _class_call_check(this, PrebidRevive);
73455
+ function _PrebidRevive() {
73456
+ _class_call_check(this, _PrebidRevive);
73051
73457
  }
73052
- _create_class(PrebidRevive, null, [
73458
+ _create_class(_PrebidRevive, null, [
73053
73459
  {
73054
73460
  key: "load",
73055
73461
  value: function load() {
@@ -73115,20 +73521,137 @@ var PrebidRevive = /*#__PURE__*/ function() {
73115
73521
  }
73116
73522
  },
73117
73523
  {
73118
- key: "defineSlots",
73119
- value: function defineSlots(options) {
73120
- var _window_pbjs_que, _window_pbjs;
73121
- (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73524
+ key: "defineSlots",
73525
+ value: function defineSlots(options) {
73526
+ var _window_pbjs_que, _window_pbjs;
73527
+ (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73528
+ var _window_pbjs;
73529
+ if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73530
+ window.pbjs.addAdUnits(options.units.filter(function(unit) {
73531
+ var _window_pbjs;
73532
+ return !((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
73533
+ return "".concat(unit.code) === "".concat(defUnit.code);
73534
+ }));
73535
+ }));
73536
+ } else {
73537
+ console.error("addAdUnits is not a function.");
73538
+ }
73539
+ });
73540
+ }
73541
+ },
73542
+ {
73543
+ key: "defineBannerAdUnit",
73544
+ value: function defineBannerAdUnit(unitDefinition, containerId, options, adType) {
73545
+ var adName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "banner";
73546
+ return new Promise(function(resolve) {
73547
+ var _window_pbjs;
73548
+ var sizes = [];
73549
+ var mapping = void 0;
73550
+ if (adType) {
73551
+ sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
73552
+ mapping = RegionDefinitions.mapping(adType);
73553
+ } else {
73554
+ var _unitDefinition_mediaTypes_banner;
73555
+ sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
73556
+ }
73557
+ var existingSlot = (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.find(function(defUnit) {
73558
+ return "".concat(containerId) === "".concat(defUnit.code);
73559
+ });
73560
+ if (!existingSlot) {
73561
+ var _window_pbjs_que, _window_pbjs1;
73562
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73563
+ var _window_pbjs;
73564
+ if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73565
+ var adUnit = {
73566
+ code: "".concat(containerId),
73567
+ mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
73568
+ banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
73569
+ sizes: sizes
73570
+ })
73571
+ }),
73572
+ bids: unitDefinition.bids,
73573
+ schain: unitDefinition.schain
73574
+ };
73575
+ if (mapping) {
73576
+ var mappedSizes = [];
73577
+ var sortedBreakpoints = Object.keys(mapping).sort(function(a, b) {
73578
+ return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
73579
+ });
73580
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
73581
+ try {
73582
+ for(var _iterator = sortedBreakpoints[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
73583
+ var bp = _step.value;
73584
+ mappedSizes.push({
73585
+ minViewPort: [
73586
+ RegionDefinitions.BREAKPOINTS[bp],
73587
+ 0
73588
+ ],
73589
+ sizes: mapping[bp]
73590
+ });
73591
+ }
73592
+ } catch (err) {
73593
+ _didIteratorError = true;
73594
+ _iteratorError = err;
73595
+ } finally{
73596
+ try {
73597
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
73598
+ _iterator.return();
73599
+ }
73600
+ } finally{
73601
+ if (_didIteratorError) {
73602
+ throw _iteratorError;
73603
+ }
73604
+ }
73605
+ }
73606
+ adUnit.mediaTypes.banner.sizeConfig = mappedSizes;
73607
+ } else {
73608
+ adUnit.mediaTypes.banner.sizes = sizes;
73609
+ }
73610
+ window.pbjs.addAdUnits([
73611
+ adUnit
73612
+ ]);
73613
+ resolve(adUnit);
73614
+ } else {
73615
+ console.error("addAdUnits is not a function.");
73616
+ resolve(void 0);
73617
+ }
73618
+ });
73619
+ } else {
73620
+ resolve(existingSlot);
73621
+ }
73622
+ });
73623
+ }
73624
+ },
73625
+ {
73626
+ key: "defineVideoAdUnit",
73627
+ value: function defineVideoAdUnit(unitDefinition, containerId) {
73628
+ return new Promise(function(resolve) {
73122
73629
  var _window_pbjs;
73123
- if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73124
- window.pbjs.addAdUnits(options.units.filter(function(unit) {
73630
+ var existingSlot = (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.find(function(defUnit) {
73631
+ return "".concat(containerId) === "".concat(defUnit.code);
73632
+ });
73633
+ if (!existingSlot) {
73634
+ var _window_pbjs_que, _window_pbjs1;
73635
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73125
73636
  var _window_pbjs;
73126
- return !((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
73127
- return "".concat(unit.code) === "".concat(defUnit.code);
73128
- }));
73129
- }));
73637
+ if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73638
+ var adUnit = {
73639
+ code: "".concat(containerId),
73640
+ mediaTypes: _object_spread({}, unitDefinition.mediaTypes),
73641
+ bids: unitDefinition.bids,
73642
+ schain: unitDefinition.schain
73643
+ };
73644
+ window.pbjs.addAdUnits([
73645
+ adUnit
73646
+ ]);
73647
+ resolve(adUnit);
73648
+ } else {
73649
+ console.error("addAdUnits is not a function.");
73650
+ resolve(void 0);
73651
+ }
73652
+ });
73130
73653
  } else {
73131
- console.error("addAdUnits is not a function.");
73654
+ resolve(existingSlot);
73132
73655
  }
73133
73656
  });
73134
73657
  }
@@ -73137,48 +73660,86 @@ var PrebidRevive = /*#__PURE__*/ function() {
73137
73660
  key: "defineSlot",
73138
73661
  value: function defineSlot(options, slotId, containerId, adType) {
73139
73662
  var adName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "banner";
73140
- var _window_pbjs;
73141
- var unitDefinition = options.units.find(function(unit) {
73142
- return unit.code === "".concat(slotId);
73143
- });
73144
- var sizes = [];
73145
- if (!unitDefinition) {
73146
- console.error("No unit definition found for slotId: ".concat(slotId));
73147
- return;
73148
- }
73149
- if (adType) {
73150
- sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
73151
- } else {
73152
- var _unitDefinition_mediaTypes_banner;
73153
- sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
73154
- }
73155
- if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
73156
- return "".concat(containerId) === "".concat(defUnit.code);
73157
- }))) {
73158
- var _window_pbjs_que, _window_pbjs1;
73159
- (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
73160
- var _window_pbjs;
73161
- if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
73162
- window.pbjs.addAdUnits([
73163
- _object_spread_props(_object_spread({}, unitDefinition), {
73164
- mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
73165
- banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
73166
- sizes: sizes
73167
- })
73168
- }),
73169
- code: "".concat(containerId)
73170
- })
73171
- ]);
73172
- } else {
73173
- console.error("addAdUnits is not a function.");
73663
+ return _async_to_generator(function() {
73664
+ var unitDefinition;
73665
+ return _ts_generator(this, function(_state) {
73666
+ unitDefinition = options.units.find(function(unit) {
73667
+ return unit.code === "".concat(slotId);
73668
+ });
73669
+ if (!unitDefinition) {
73670
+ console.error("No unit definition found for slotId: ".concat(slotId));
73671
+ return [
73672
+ 2,
73673
+ unitDefinition
73674
+ ];
73675
+ }
73676
+ if (unitDefinition.mediaTypes.video) {
73677
+ return [
73678
+ 2,
73679
+ _PrebidRevive.defineVideoAdUnit(unitDefinition, containerId)
73680
+ ];
73681
+ } else if (unitDefinition.mediaTypes.banner) {
73682
+ return [
73683
+ 2,
73684
+ _PrebidRevive.defineBannerAdUnit(unitDefinition, containerId, options, adType, adName)
73685
+ ];
73174
73686
  }
73687
+ console.warn("No supported mediaTypes found for unit: ".concat(slotId));
73688
+ return [
73689
+ 2,
73690
+ void 0
73691
+ ];
73175
73692
  });
73176
- }
73693
+ })();
73177
73694
  }
73178
73695
  },
73179
73696
  {
73180
73697
  key: "onSlotRenderEnded",
73181
- value: function onSlotRenderEnded(slotId, cb) {}
73698
+ value: // static defineSlot(
73699
+ // options: PrebidjsProviderOptions,
73700
+ // slotId: string,
73701
+ // containerId: string,
73702
+ // adType: Ads.AdSizeType,
73703
+ // adName: string = "banner",
73704
+ // ) {
73705
+ // // let gamNetworkId: string = PrebidGAM.getProperGAMNetworkId(options);
73706
+ // const unitDefinition = options.units.find((unit) => unit.code === `${slotId}`);
73707
+ // let sizes: [number, number][] = [];
73708
+ // if (!unitDefinition) {
73709
+ // console.error(`No unit definition found for slotId: ${slotId}`);
73710
+ // return;
73711
+ // }
73712
+ // if (adType) {
73713
+ // sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
73714
+ // } else {
73715
+ // sizes = unitDefinition.mediaTypes.banner?.sizes || [];
73716
+ // }
73717
+ // // GPT.defineSlot(`/${gamNetworkId}/${adName}`, [sizes[0] || []], `${containerId}`);
73718
+ // if (
73719
+ // !window.pbjs?.adUnits.some((defUnit) => `${containerId}` === `${defUnit.code}`)
73720
+ // ) {
73721
+ // window.pbjs?.que?.push(() => {
73722
+ // if (window.pbjs?.addAdUnits) {
73723
+ // window.pbjs.addAdUnits([
73724
+ // {
73725
+ // ...unitDefinition,
73726
+ // mediaTypes: {
73727
+ // ...(unitDefinition.mediaTypes || {}),
73728
+ // banner: {
73729
+ // ...(unitDefinition.mediaTypes.banner || {}),
73730
+ // sizes: sizes,
73731
+ // },
73732
+ // },
73733
+ // code: `${containerId}`,
73734
+ // },
73735
+ // ]);
73736
+ // } else {
73737
+ // console.error("addAdUnits is not a function.");
73738
+ // }
73739
+ // });
73740
+ // }
73741
+ // }
73742
+ function onSlotRenderEnded(slotId, cb) {}
73182
73743
  },
73183
73744
  {
73184
73745
  key: "start",
@@ -73229,9 +73790,65 @@ var PrebidRevive = /*#__PURE__*/ function() {
73229
73790
  });
73230
73791
  });
73231
73792
  }
73793
+ },
73794
+ {
73795
+ key: "requestInstream",
73796
+ value: function requestInstream(options, slotId, containerId, callback) {
73797
+ var _window_pbjs;
73798
+ var PREBID_TIMEOUT = 1e3;
73799
+ (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.que.push(function() {
73800
+ var _window_pbjs;
73801
+ (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.requestBids({
73802
+ adUnitCodes: [
73803
+ "".concat(containerId)
73804
+ ],
73805
+ timeout: PREBID_TIMEOUT,
73806
+ bidsBackHandler: function bidsBackHandler(bids) {
73807
+ var winners = Object.values(bids).reduce(function(acc, unit) {
73808
+ if (unit.bids) {
73809
+ var _acc;
73810
+ (_acc = acc).push.apply(_acc, _to_consumable_array(unit.bids));
73811
+ }
73812
+ return acc;
73813
+ }, []).sort(function(a, b) {
73814
+ return b.cpm - a.cpm;
73815
+ });
73816
+ if (winners.length > 0) {
73817
+ var winner = winners[0];
73818
+ var content = {
73819
+ asStr: winner.ad,
73820
+ content: [],
73821
+ extra: {
73822
+ region: winner.adUnitCode,
73823
+ sz: {
73824
+ w: winner.width,
73825
+ h: winner.height
73826
+ },
73827
+ cpm: winner.cpm
73828
+ }
73829
+ };
73830
+ if (winner.vastUrl) {
73831
+ callback(winner.vastUrl);
73832
+ return;
73833
+ }
73834
+ ;
73835
+ if (winner.vastXml) {
73836
+ callback(winner.vastXml);
73837
+ return;
73838
+ }
73839
+ ;
73840
+ }
73841
+ if (winners.length === 0) {
73842
+ callback(null);
73843
+ }
73844
+ callback(null);
73845
+ }
73846
+ });
73847
+ });
73848
+ }
73232
73849
  }
73233
73850
  ]);
73234
- return PrebidRevive;
73851
+ return _PrebidRevive;
73235
73852
  }();
73236
73853
  var prebidReviveConfig = false;
73237
73854
  var prebidReviveReady = new Awaitable(false);
@@ -73291,7 +73908,7 @@ var PrebidReviveProvider = /*#__PURE__*/ function(ContentProvider) {
73291
73908
  key: "request",
73292
73909
  value: function request(params) {
73293
73910
  return _async_to_generator(function() {
73294
- var _this, adType, adName, regionId, regionInfo;
73911
+ var _this, adType, adName, regionId, regionInfo, result;
73295
73912
  return _ts_generator(this, function(_state) {
73296
73913
  switch(_state.label){
73297
73914
  case 0:
@@ -73327,7 +73944,19 @@ var PrebidReviveProvider = /*#__PURE__*/ function(ContentProvider) {
73327
73944
  ];
73328
73945
  case 2:
73329
73946
  _state.sent();
73330
- PrebidRevive.defineSlot(this.options, regionId, this.workingSlotId, adType, adName);
73947
+ return [
73948
+ 4,
73949
+ PrebidRevive.defineSlot(this.options, regionId, this.workingSlotId, adType, adName)
73950
+ ];
73951
+ case 3:
73952
+ result = _state.sent();
73953
+ if (!result) {
73954
+ this.context.logger.warn("No ad unit found for regionId: ".concat(regionId));
73955
+ this.notify();
73956
+ return [
73957
+ 2
73958
+ ];
73959
+ }
73331
73960
  PrebidRevive.request(regionId, this.workingSlotId, function(content) {
73332
73961
  return _async_to_generator(function() {
73333
73962
  var content2;
@@ -73392,6 +74021,76 @@ var PrebidReviveProvider = /*#__PURE__*/ function(ContentProvider) {
73392
74021
  });
73393
74022
  }).call(this);
73394
74023
  }
74024
+ },
74025
+ {
74026
+ key: "requestInstream",
74027
+ value: function requestInstream(params) {
74028
+ return _async_to_generator(function() {
74029
+ var _this;
74030
+ return _ts_generator(this, function(_state) {
74031
+ _this = this;
74032
+ return [
74033
+ 2,
74034
+ new Promise(function(resolve) {
74035
+ return _async_to_generator(function() {
74036
+ var adSlotId, adSlot, result;
74037
+ return _ts_generator(this, function(_state) {
74038
+ switch(_state.label){
74039
+ case 0:
74040
+ adSlotId = params.adSlot;
74041
+ if (!adSlotId && params.roles && params.roles.length > 0) {
74042
+ adSlot = this.options.units.find(function(unit) {
74043
+ var _params_roles;
74044
+ return unit._brndts_role !== void 0 && ((_params_roles = params.roles) === null || _params_roles === void 0 ? void 0 : _params_roles.includes(unit._brndts_role));
74045
+ });
74046
+ adSlotId = adSlot === null || adSlot === void 0 ? void 0 : adSlot.code;
74047
+ }
74048
+ if (!adSlotId) {
74049
+ console.warn("No adSlot or roles provided for instream ad request.");
74050
+ resolve({});
74051
+ return [
74052
+ 2
74053
+ ];
74054
+ }
74055
+ return [
74056
+ 4,
74057
+ prebidReviveReady.promise
74058
+ ];
74059
+ case 1:
74060
+ _state.sent();
74061
+ return [
74062
+ 4,
74063
+ PrebidRevive.defineSlot(this.options, adSlotId, adSlotId)
74064
+ ];
74065
+ case 2:
74066
+ result = _state.sent();
74067
+ if (!result) {
74068
+ console.warn("No ad unit found for instream adSlot: ".concat(adSlotId));
74069
+ resolve({});
74070
+ return [
74071
+ 2
74072
+ ];
74073
+ }
74074
+ PrebidRevive.requestInstream(this.options, adSlotId, adSlotId, function(content) {
74075
+ if (content === null) {
74076
+ resolve({});
74077
+ return;
74078
+ }
74079
+ resolve({
74080
+ vastTagUrl: content
74081
+ });
74082
+ });
74083
+ return [
74084
+ 2
74085
+ ];
74086
+ }
74087
+ });
74088
+ }).call(_this);
74089
+ })
74090
+ ];
74091
+ });
74092
+ }).call(this);
74093
+ }
73395
74094
  }
73396
74095
  ]);
73397
74096
  return PrebidReviveProvider;
@@ -73444,6 +74143,22 @@ var GPTProvider = /*#__PURE__*/ function(ContentProvider) {
73444
74143
  });
73445
74144
  }).call(this);
73446
74145
  }
74146
+ },
74147
+ {
74148
+ key: "requestInstream",
74149
+ value: function requestInstream() {
74150
+ return _async_to_generator(function() {
74151
+ var params;
74152
+ var _arguments = arguments;
74153
+ return _ts_generator(this, function(_state) {
74154
+ params = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
74155
+ return [
74156
+ 2,
74157
+ Promise.resolve({})
74158
+ ];
74159
+ });
74160
+ }).apply(this, arguments);
74161
+ }
73447
74162
  }
73448
74163
  ]);
73449
74164
  return GPTProvider;
@@ -73517,6 +74232,22 @@ var DebugProvider = /*#__PURE__*/ function(ContentProvider) {
73517
74232
  });
73518
74233
  }).call(this);
73519
74234
  }
74235
+ },
74236
+ {
74237
+ key: "requestInstream",
74238
+ value: function requestInstream() {
74239
+ return _async_to_generator(function() {
74240
+ var params;
74241
+ var _arguments = arguments;
74242
+ return _ts_generator(this, function(_state) {
74243
+ params = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
74244
+ return [
74245
+ 2,
74246
+ Promise.resolve({})
74247
+ ];
74248
+ });
74249
+ }).apply(this, arguments);
74250
+ }
73520
74251
  }
73521
74252
  ]);
73522
74253
  return DebugProvider;
@@ -79540,9 +80271,7 @@ var AuxElementsRenderer = /*#__PURE__*/ function() {
79540
80271
  }, {
79541
80272
  width: this.regionsContainerView.width,
79542
80273
  height: this.regionsContainerView.height
79543
- }, {}, {
79544
- provider: ContentProviderFactory.getProvider(this.context, this.context.config.get("ads").provider)
79545
- });
80274
+ }, {}, {});
79546
80275
  this.auxElementsData.push({
79547
80276
  box: {
79548
80277
  x1: 0,
@@ -84204,6 +84933,7 @@ var ControlTopBar = /*#__PURE__*/ function() {
84204
84933
  });
84205
84934
  this.context.store.subscribe(this.handleStateChange.bind(this));
84206
84935
  if ((_this_context_config_get = this.context.config.get("controls")) === null || _this_context_config_get === void 0 ? void 0 : (_this_context_config_get_elements = _this_context_config_get.elements) === null || _this_context_config_get_elements === void 0 ? void 0 : _this_context_config_get_elements.progress_ind) {
84936
+ var _this_context_data, _this_context_media;
84207
84937
  var ind = new ProgressBanner({
84208
84938
  indicators: [
84209
84939
  {
@@ -84216,10 +84946,10 @@ var ControlTopBar = /*#__PURE__*/ function() {
84216
84946
  }
84217
84947
  ]
84218
84948
  });
84219
- this.context.data.on("UPDATE", function() {
84949
+ (_this_context_data = this.context.data) === null || _this_context_data === void 0 ? void 0 : _this_context_data.on("UPDATE", function() {
84220
84950
  ind.setValue("BRNDTS_LOADING", _this.context.data.progress());
84221
84951
  });
84222
- this.context.media.on("TIME_UPDATE", function(param) {
84952
+ (_this_context_media = this.context.media) === null || _this_context_media === void 0 ? void 0 : _this_context_media.on("TIME_UPDATE", function(param) {
84223
84953
  var time = param.time, duration = param.duration;
84224
84954
  ind.setValue("PLAYER_TIME", time / duration * 100);
84225
84955
  });
@@ -85662,6 +86392,64 @@ var VideoAds = /*#__PURE__*/ function() {
85662
86392
  return entry.inst;
85663
86393
  }
85664
86394
  },
86395
+ {
86396
+ key: "getDetachedInstreamAds",
86397
+ value: function getDetachedInstreamAds() {
86398
+ return _async_to_generator(function() {
86399
+ var provider, instreamInfo, e2;
86400
+ return _ts_generator(this, function(_state) {
86401
+ switch(_state.label){
86402
+ case 0:
86403
+ provider = ContentProviderFactory.getProvider(this.context, this.context.config.get("ads").provider);
86404
+ _state.label = 1;
86405
+ case 1:
86406
+ _state.trys.push([
86407
+ 1,
86408
+ 3,
86409
+ ,
86410
+ 4
86411
+ ]);
86412
+ return [
86413
+ 4,
86414
+ provider.requestInstream({
86415
+ roles: [
86416
+ "pre-roll"
86417
+ ]
86418
+ })
86419
+ ];
86420
+ case 2:
86421
+ instreamInfo = _state.sent();
86422
+ if (!instreamInfo.vastTagUrl) {
86423
+ return [
86424
+ 2,
86425
+ []
86426
+ ];
86427
+ }
86428
+ return [
86429
+ 2,
86430
+ [
86431
+ {
86432
+ timeOffset: "00:00:00",
86433
+ vast: instreamInfo.vastTagUrl
86434
+ }
86435
+ ]
86436
+ ];
86437
+ case 3:
86438
+ e2 = _state.sent();
86439
+ ErrorHandler.handle(e2);
86440
+ return [
86441
+ 2,
86442
+ []
86443
+ ];
86444
+ case 4:
86445
+ return [
86446
+ 2
86447
+ ];
86448
+ }
86449
+ });
86450
+ }).call(this);
86451
+ }
86452
+ },
85665
86453
  {
85666
86454
  key: "destroy",
85667
86455
  value: function destroy() {
@@ -85715,6 +86503,12 @@ var Ads = /*#__PURE__*/ function() {
85715
86503
  });
85716
86504
  }
85717
86505
  },
86506
+ {
86507
+ key: "getDetachedInstreamAds",
86508
+ value: function getDetachedInstreamAds() {
86509
+ return this.videoAds.getDetachedInstreamAds();
86510
+ }
86511
+ },
85718
86512
  {
85719
86513
  key: "updateSize",
85720
86514
  value: function updateSize() {
@@ -90296,10 +91090,17 @@ var BrndtsAds = /*#__PURE__*/ function() {
90296
91090
  {
90297
91091
  key: "handleConnected",
90298
91092
  value: function handleConnected() {
90299
- this.ready.resolve(true);
90300
- this.context.logger.log("connected to service");
90301
- this.context.ads = new Ads_default(this.context);
90302
- this.context.ads.start();
91093
+ return _async_to_generator(function() {
91094
+ return _ts_generator(this, function(_state) {
91095
+ this.context.logger.log("connected to service");
91096
+ this.context.ads = new Ads_default(this.context);
91097
+ this.context.ads.start();
91098
+ this.ready.resolve(true);
91099
+ return [
91100
+ 2
91101
+ ];
91102
+ });
91103
+ }).call(this);
90303
91104
  }
90304
91105
  },
90305
91106
  {
@@ -90347,6 +91148,16 @@ var BrndtsAds = /*#__PURE__*/ function() {
90347
91148
  this.context.config.set("controls", controlsConfig);
90348
91149
  }
90349
91150
  },
91151
+ {
91152
+ key: "getDetachedInstreamAds",
91153
+ value: function getDetachedInstreamAds() {
91154
+ if (!this.ready.value || this.context.ads === void 0) {
91155
+ console.warn("Ads not ready yet!");
91156
+ return Promise.resolve([]);
91157
+ }
91158
+ return this.context.ads.getDetachedInstreamAds();
91159
+ }
91160
+ },
90350
91161
  {
90351
91162
  key: "rewind",
90352
91163
  value: function rewind(value2) {
@@ -90378,7 +91189,9 @@ var BrndtsAds = /*#__PURE__*/ function() {
90378
91189
  }
90379
91190
  ]);
90380
91191
  return BrndtsAds;
90381
- }(); /*! Bundled license information:
91192
+ }(); //! TEST
91193
+ //!
91194
+ /*! Bundled license information:
90382
91195
 
90383
91196
  @fortawesome/fontawesome-svg-core/index.mjs:
90384
91197
  @fortawesome/free-solid-svg-icons/index.mjs: