@brndts/brndts-ads 1.14.8 → 1.14.9

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
@@ -72199,6 +72199,15 @@ var GPT = /*#__PURE__*/ function() {
72199
72199
  ]);
72200
72200
  return GPT;
72201
72201
  }();
72202
+ var tcf_ready = false;
72203
+ function handleTCFApiEvent(data, success) {
72204
+ if (!success) return;
72205
+ var ready = (data === null || data === void 0 ? void 0 : data.eventStatus) === "tcloaded" || (data === null || data === void 0 ? void 0 : data.eventStatus) === "useractioncomplete";
72206
+ var hasTC = !!(data === null || data === void 0 ? void 0 : data.tcString);
72207
+ if (ready && hasTC) {
72208
+ tcf_ready = true;
72209
+ }
72210
+ }
72202
72211
  var PrebidGAM = /*#__PURE__*/ function() {
72203
72212
  function _PrebidGAM() {
72204
72213
  _class_call_check(this, _PrebidGAM);
@@ -72232,6 +72241,13 @@ var PrebidGAM = /*#__PURE__*/ function() {
72232
72241
  key: "configure",
72233
72242
  value: function configure(context, options) {
72234
72243
  var _window_pbjs_que, _window_pbjs;
72244
+ if (window.__tcfApi) {
72245
+ var _window___tcfapi, _window, _window___tcfapi1, _window1;
72246
+ (_window___tcfapi = (_window = window).__tcfapi) === null || _window___tcfapi === void 0 ? void 0 : _window___tcfapi.call(_window, "getTCData", 2, handleTCFApiEvent);
72247
+ (_window___tcfapi1 = (_window1 = window).__tcfapi) === null || _window___tcfapi1 === void 0 ? void 0 : _window___tcfapi1.call(_window1, "addEventListener", 2, handleTCFApiEvent);
72248
+ } else {
72249
+ tcf_ready = true;
72250
+ }
72235
72251
  (_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() {
72236
72252
  var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1, _window_pbjs2;
72237
72253
  var configBuilder = new PrebidConfigBuilder();