@brndts/brndts-ads 1.14.12 → 1.14.14

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
@@ -72232,15 +72232,7 @@ var GPT = /*#__PURE__*/ function() {
72232
72232
  ]);
72233
72233
  return GPT;
72234
72234
  }();
72235
- var tcf_ready = false;
72236
- function handleTCFApiEvent(data, success) {
72237
- if (!success) return;
72238
- var ready = (data === null || data === void 0 ? void 0 : data.eventStatus) === "tcloaded" || (data === null || data === void 0 ? void 0 : data.eventStatus) === "useractioncomplete";
72239
- var hasTC = !!(data === null || data === void 0 ? void 0 : data.tcString);
72240
- if (ready && hasTC) {
72241
- tcf_ready = true;
72242
- }
72243
- }
72235
+ var displayedSlots = /* @__PURE__ */ new Set();
72244
72236
  var PrebidGAM = /*#__PURE__*/ function() {
72245
72237
  function _PrebidGAM() {
72246
72238
  _class_call_check(this, _PrebidGAM);
@@ -72274,13 +72266,6 @@ var PrebidGAM = /*#__PURE__*/ function() {
72274
72266
  key: "configure",
72275
72267
  value: function configure(context, options) {
72276
72268
  var _window_pbjs_que, _window_pbjs;
72277
- if (typeof window.__tcfapi === "function") {
72278
- var _window___tcfapi, _window, _window___tcfapi1, _window1;
72279
- (_window___tcfapi = (_window = window).__tcfapi) === null || _window___tcfapi === void 0 ? void 0 : _window___tcfapi.call(_window, "getTCData", 2, handleTCFApiEvent);
72280
- (_window___tcfapi1 = (_window1 = window).__tcfapi) === null || _window___tcfapi1 === void 0 ? void 0 : _window___tcfapi1.call(_window1, "addEventListener", 2, handleTCFApiEvent);
72281
- } else {
72282
- tcf_ready = true;
72283
- }
72284
72269
  (_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() {
72285
72270
  var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1, _window_pbjs2;
72286
72271
  var configBuilder = new PrebidConfigBuilder();
@@ -72433,16 +72418,6 @@ var PrebidGAM = /*#__PURE__*/ function() {
72433
72418
  value: function request(slotId, containerId, callback) {
72434
72419
  var _window_pbjs;
72435
72420
  var PREBID_TIMEOUT = 1e3;
72436
- if (!tcf_ready) {
72437
- console.warn("TCF not ready, waiting for consent data.");
72438
- var container = document.createElement("div");
72439
- container.id = containerId;
72440
- var script = document.createElement("script");
72441
- script.innerHTML = '\n window.googletag.cmd.push(function() {\n googletag.pubads().refresh(googletag.pubads().getSlots().filter(slot => slot.getSlotElementId() === "'.concat(containerId, '"));\n });');
72442
- container.appendChild(script);
72443
- callback(container);
72444
- return;
72445
- }
72446
72421
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.que.push(function() {
72447
72422
  var _window_pbjs;
72448
72423
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.requestBids({
@@ -72455,6 +72430,12 @@ var PrebidGAM = /*#__PURE__*/ function() {
72455
72430
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.setTargetingForGPTAsync([
72456
72431
  "".concat(containerId)
72457
72432
  ]);
72433
+ window.googletag.cmd.push(function() {
72434
+ if (!displayedSlots.has(containerId)) {
72435
+ window.googletag.display(containerId);
72436
+ displayedSlots.add(containerId);
72437
+ }
72438
+ });
72458
72439
  window.googletag.cmd.push(function() {
72459
72440
  var container = document.createElement("div");
72460
72441
  container.id = containerId;
@@ -72659,6 +72640,7 @@ var ReviveProvider = /*#__PURE__*/ function(ContentProvider) {
72659
72640
  iframe.scrolling = "no";
72660
72641
  iframe.width = "".concat(regionInfo.w);
72661
72642
  iframe.height = "".concat(regionInfo.h);
72643
+ iframe.style.maxWidth = "inherit";
72662
72644
  iframe.allow = "autoplay";
72663
72645
  iframe.style.display = "block";
72664
72646
  link = document.createElement("a");