@brndts/brndts-ads 1.14.4 → 1.14.6

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
@@ -468,13 +468,13 @@ var __toCommonJS = function(mod) {
468
468
  var require_events = __commonJS({
469
469
  "node_modules/events/events.js": function(exports, module2) {
470
470
  "use strict";
471
- var R = (typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" ? Reflect : null;
472
- var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
471
+ var R2 = (typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" ? Reflect : null;
472
+ var ReflectApply = R2 && typeof R2.apply === "function" ? R2.apply : function ReflectApply2(target, receiver, args) {
473
473
  return Function.prototype.apply.call(target, receiver, args);
474
474
  };
475
475
  var ReflectOwnKeys;
476
- if (R && typeof R.ownKeys === "function") {
477
- ReflectOwnKeys = R.ownKeys;
476
+ if (R2 && typeof R2.ownKeys === "function") {
477
+ ReflectOwnKeys = R2.ownKeys;
478
478
  } else if (Object.getOwnPropertySymbols) {
479
479
  ReflectOwnKeys = function ReflectOwnKeys2(target) {
480
480
  return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
@@ -68506,7 +68506,7 @@ var RegionContent = /*#__PURE__*/ function() {
68506
68506
  {
68507
68507
  key: "renderSandboxedContent",
68508
68508
  value: function renderSandboxedContent() {
68509
- var _iframe_contentWindow, _this_content_extra_sz, _this_content_extra, _this_content, _this_content_extra_sz1, _this_content_extra1, _this_content1;
68509
+ var _this_content_extra_sz, _this_content_extra, _this_content, _this_content_extra_sz1, _this_content_extra1, _this_content1, _this_content_extra_sz2, _this_content_extra2, _this_content2, _this_content_extra_sz3, _this_content_extra3, _this_content3, _iframe_contentWindow;
68510
68510
  var iframe = document.createElement("iframe");
68511
68511
  iframe.name = "prebid_ads_iframe_".concat(this.id);
68512
68512
  iframe.title = "3rd party ad content";
@@ -68523,15 +68523,19 @@ var RegionContent = /*#__PURE__*/ function() {
68523
68523
  iframe.style.border = "0";
68524
68524
  iframe.style.margin = "0";
68525
68525
  iframe.style.overflow = "hidden";
68526
- iframe.style.width = "100%";
68527
- iframe.style.height = "100%";
68526
+ iframe.style.width = "".concat(((_this_content = this.content) === null || _this_content === void 0 ? void 0 : (_this_content_extra = _this_content.extra) === null || _this_content_extra === void 0 ? void 0 : (_this_content_extra_sz = _this_content_extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w) ? this.content.extra.sz.w + "px" : "100%", ";");
68527
+ iframe.style.height = "".concat(((_this_content1 = this.content) === null || _this_content1 === void 0 ? void 0 : (_this_content_extra1 = _this_content1.extra) === null || _this_content_extra1 === void 0 ? void 0 : (_this_content_extra_sz1 = _this_content_extra1.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h) ? this.content.extra.sz.h + "px" : "100%", ";");
68528
+ iframe.width = "".concat(((_this_content2 = this.content) === null || _this_content2 === void 0 ? void 0 : (_this_content_extra2 = _this_content2.extra) === null || _this_content_extra2 === void 0 ? void 0 : (_this_content_extra_sz2 = _this_content_extra2.sz) === null || _this_content_extra_sz2 === void 0 ? void 0 : _this_content_extra_sz2.w) ? this.content.extra.sz.w : "100%", ";");
68529
+ iframe.height = "".concat(((_this_content3 = this.content) === null || _this_content3 === void 0 ? void 0 : (_this_content_extra3 = _this_content3.extra) === null || _this_content_extra3 === void 0 ? void 0 : (_this_content_extra_sz3 = _this_content_extra3.sz) === null || _this_content_extra_sz3 === void 0 ? void 0 : _this_content_extra_sz3.h) ? this.content.extra.sz.h : "100%", ";");
68530
+ var scale = this.getScaleValue();
68531
+ iframe.style.transform = "scale(".concat(scale.x, ", ").concat(scale.y, ")");
68532
+ iframe.style.transformOrigin = "top left";
68528
68533
  this.container.appendChild(iframe);
68529
68534
  var iframeDoc = (_iframe_contentWindow = iframe.contentWindow) === null || _iframe_contentWindow === void 0 ? void 0 : _iframe_contentWindow.document;
68530
68535
  if (!iframeDoc) return;
68531
68536
  var stringContent = this.content.asStr;
68532
- var scale = this.getScaleValue();
68533
68537
  iframeDoc.open();
68534
- iframeDoc.write('\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n\n html, body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: hidden;\n }\n .ad-container {\n width: '.concat(((_this_content = this.content) === null || _this_content === void 0 ? void 0 : (_this_content_extra = _this_content.extra) === null || _this_content_extra === void 0 ? void 0 : (_this_content_extra_sz = _this_content_extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w) ? this.content.extra.sz.w + "px" : "100%", ";\n height: ").concat(((_this_content1 = this.content) === null || _this_content1 === void 0 ? void 0 : (_this_content_extra1 = _this_content1.extra) === null || _this_content_extra1 === void 0 ? void 0 : (_this_content_extra_sz1 = _this_content_extra1.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h) ? this.content.extra.sz.h + "px" : "100%", ";\n transform: scale(").concat(scale.x, ", ").concat(scale.y, ');\n transform-origin: top left;\n }\n .ad-container > * {\n padding: 0 !important;\n }\n </style>\n </head>\n <body>\n <div class="ad-container">').concat(stringContent, "</div>\n </body>\n </html>\n "));
68538
+ iframeDoc.write('\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n\n html, body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: hidden;\n }\n .ad-container > * {\n padding: 0 !important;\n }\n </style>\n </head>\n <body>\n <div class="ad-container">'.concat(stringContent, "</div>\n </body>\n </html>\n "));
68535
68539
  iframeDoc.close();
68536
68540
  }
68537
68541
  },
@@ -71569,29 +71573,125 @@ var PrebidConfigBuilder = /*#__PURE__*/ function() {
71569
71573
  {
71570
71574
  key: "addConsent",
71571
71575
  value: function addConsent(consent) {
71572
- if (// @ts-expect-error
71573
- window.__tcfapi !== void 0 && // @ts-expect-error
71574
- typeof window.__tcfapi === "function") {
71575
- this.config.consentManagement = {
71576
+ var hasTcfCmp = typeof window.__tcfapi === "function";
71577
+ var hasGppCmp = typeof window.__gpp === "function";
71578
+ var cm = {};
71579
+ if (hasTcfCmp) {
71580
+ cm.gdpr = {
71576
71581
  cmpApi: "iab",
71577
71582
  timeout: 8e3,
71578
- allowAuctionWithoutConsent: true,
71579
- defaultGdprScope: true
71583
+ defaultGdprScope: true,
71584
+ rules: [
71585
+ {
71586
+ purpose: "basicAds",
71587
+ enforcePurpose: true,
71588
+ enforceVendor: true,
71589
+ softVendorExceptions: [
71590
+ "valuad",
71591
+ "improvedigital"
71592
+ ]
71593
+ },
71594
+ {
71595
+ purpose: "storage",
71596
+ enforcePurpose: true,
71597
+ enforceVendor: true,
71598
+ softVendorExceptions: [
71599
+ "valuad",
71600
+ "improvedigital"
71601
+ ]
71602
+ },
71603
+ // add P4 so UFPD can flow when CMP gives consent
71604
+ {
71605
+ purpose: "personalizedAds",
71606
+ enforcePurpose: true,
71607
+ enforceVendor: true
71608
+ },
71609
+ {
71610
+ purpose: "measurement",
71611
+ enforcePurpose: true,
71612
+ enforceVendor: true
71613
+ }
71614
+ ]
71580
71615
  };
71581
71616
  } else {
71582
- this.config.consentManagement = {
71617
+ var _gdpr_purpose_consents, _gdpr_purpose, _gdpr_purpose_consents1, _gdpr_purpose1, _gdpr_purpose_consents2, _gdpr_purpose2, _gdpr_purpose_consents3, _gdpr_purpose3;
71618
+ var gdpr = typeof consent.gdpr === "function" ? consent.gdpr() : void 0;
71619
+ var _gdpr_gdprApplies, _gdpr_purpose_consents_1, _gdpr_purpose_consents_2, _gdpr_purpose_consents_4, _gdpr_purpose_consents_7;
71620
+ cm.gdpr = {
71583
71621
  cmpApi: "static",
71584
71622
  timeout: 8e3,
71585
- allowAuctionWithoutConsent: true,
71586
71623
  defaultGdprScope: true,
71587
71624
  consentData: {
71588
71625
  getTCData: {
71589
- tcString: consent.gdpr().tcString || "",
71590
- gdprApplies: consent.gdpr().gdprApplies || false
71626
+ tcString: (gdpr === null || gdpr === void 0 ? void 0 : gdpr.tcString) || "",
71627
+ gdprApplies: (_gdpr_gdprApplies = gdpr === null || gdpr === void 0 ? void 0 : gdpr.gdprApplies) !== null && _gdpr_gdprApplies !== void 0 ? _gdpr_gdprApplies : true,
71628
+ // Grant P1, P2, P4, P7 so modules won't be denied in static mode
71629
+ purpose: {
71630
+ consents: {
71631
+ "1": (_gdpr_purpose_consents_1 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose = gdpr.purpose) === null || _gdpr_purpose === void 0 ? void 0 : (_gdpr_purpose_consents = _gdpr_purpose.consents) === null || _gdpr_purpose_consents === void 0 ? void 0 : _gdpr_purpose_consents["1"]) !== null && _gdpr_purpose_consents_1 !== void 0 ? _gdpr_purpose_consents_1 : true,
71632
+ // storage (accessDevice)
71633
+ "2": (_gdpr_purpose_consents_2 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose1 = gdpr.purpose) === null || _gdpr_purpose1 === void 0 ? void 0 : (_gdpr_purpose_consents1 = _gdpr_purpose1.consents) === null || _gdpr_purpose_consents1 === void 0 ? void 0 : _gdpr_purpose_consents1["2"]) !== null && _gdpr_purpose_consents_2 !== void 0 ? _gdpr_purpose_consents_2 : true,
71634
+ // basic ads (fetchBids)
71635
+ "4": (_gdpr_purpose_consents_4 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose2 = gdpr.purpose) === null || _gdpr_purpose2 === void 0 ? void 0 : (_gdpr_purpose_consents2 = _gdpr_purpose2.consents) === null || _gdpr_purpose_consents2 === void 0 ? void 0 : _gdpr_purpose_consents2["4"]) !== null && _gdpr_purpose_consents_4 !== void 0 ? _gdpr_purpose_consents_4 : true,
71636
+ // personalized ads (transmitUfpd)
71637
+ "7": (_gdpr_purpose_consents_7 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose3 = gdpr.purpose) === null || _gdpr_purpose3 === void 0 ? void 0 : (_gdpr_purpose_consents3 = _gdpr_purpose3.consents) === null || _gdpr_purpose_consents3 === void 0 ? void 0 : _gdpr_purpose_consents3["7"]) !== null && _gdpr_purpose_consents_7 !== void 0 ? _gdpr_purpose_consents_7 : true
71638
+ }
71639
+ }
71640
+ }
71641
+ },
71642
+ rules: [
71643
+ // In static mode: enforce purpose, skip vendor checks
71644
+ {
71645
+ purpose: "basicAds",
71646
+ enforcePurpose: true,
71647
+ enforceVendor: false
71648
+ },
71649
+ {
71650
+ purpose: "storage",
71651
+ enforcePurpose: true,
71652
+ enforceVendor: false
71653
+ },
71654
+ {
71655
+ purpose: "personalizedAds",
71656
+ enforcePurpose: true,
71657
+ enforceVendor: false
71658
+ },
71659
+ // <-- allows transmitUfpd
71660
+ {
71661
+ purpose: "measurement",
71662
+ enforcePurpose: true,
71663
+ enforceVendor: false
71591
71664
  }
71665
+ ]
71666
+ };
71667
+ this.config.allowActivities = _object_spread_props(_object_spread({}, this.config.allowActivities), {
71668
+ accessDevice: {
71669
+ rules: [
71670
+ {
71671
+ allow: true
71672
+ }
71673
+ ]
71674
+ }
71675
+ });
71676
+ }
71677
+ if (hasGppCmp) {
71678
+ cm.gpp = {
71679
+ cmpApi: "iab",
71680
+ timeout: 8e3
71681
+ };
71682
+ } else {
71683
+ var gpp = typeof consent.gpp === "function" ? consent.gpp() : void 0;
71684
+ cm.gpp = {
71685
+ cmpApi: "static",
71686
+ timeout: 8e3,
71687
+ consentData: {
71688
+ gppString: (gpp === null || gpp === void 0 ? void 0 : gpp.gppString) || "",
71689
+ applicableSections: /* gpp?.applicableSections ?? gpp?.sectionList ?? */ [],
71690
+ sectionList: /* gpp?.sectionList ?? gpp?.applicableSections ?? */ []
71592
71691
  }
71593
71692
  };
71594
71693
  }
71694
+ this.config.consentManagement = cm;
71595
71695
  return this;
71596
71696
  }
71597
71697
  },
@@ -73856,25 +73956,15 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
73856
73956
  }
73857
73957
  },
73858
73958
  {
73859
- key: "assurePlaybackState",
73860
- value: function assurePlaybackState(play) {
73861
- if (this.media && this.media.hasPlayed) {
73862
- var _this_instance;
73863
- var newVideoIndex = (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.getPlaylistIndex();
73864
- if (newVideoIndex !== this.currentVideoIndex) {
73865
- this.currentVideoIndex = newVideoIndex;
73866
- if (this._source && this._source.type === "playlist") {
73867
- var _this__source;
73868
- this._source.videoId = this.videoId;
73869
- this.emit("UPDATED_SOURCE", (_this__source = this._source) === null || _this__source === void 0 ? void 0 : _this__source.videoId);
73870
- }
73871
- }
73959
+ key: "checkForVideoIdChanges",
73960
+ value: function checkForVideoIdChanges() {
73961
+ if (!this._source || this._source.type !== "playlist") {
73962
+ return;
73872
73963
  }
73873
- if (this.media && play && !this.media.hasPlayed) {
73874
- this.media.hasPlayed = true;
73875
- if (this._source) {
73876
- this._source.videoId = this.videoId;
73877
- }
73964
+ var currentVideoId = this.videoId;
73965
+ if (currentVideoId && currentVideoId.trim() !== "" && currentVideoId !== this._source.videoId) {
73966
+ this._source.videoId = currentVideoId;
73967
+ this.emit("UPDATED_SOURCE", this._source.videoId);
73878
73968
  }
73879
73969
  }
73880
73970
  },
@@ -73903,15 +73993,16 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
73903
73993
  key: "handleYTPlayerReady",
73904
73994
  value: function handleYTPlayerReady(event) {
73905
73995
  var _this = this;
73906
- var _this_instance;
73907
73996
  if (this.instance) {
73908
73997
  this.context.logger.warn("Instance already found!");
73909
73998
  return;
73910
73999
  }
73911
74000
  this.instance = event.target;
73912
- this.currentVideoIndex = (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.getPlaylistIndex();
73913
74001
  this.ready = true;
73914
74002
  this.observeResize();
74003
+ if (this._source && this._source.type === "playlist") {
74004
+ this._source.videoId = this.videoId;
74005
+ }
73915
74006
  this.context.store.dispatch({
73916
74007
  type: "READY"
73917
74008
  });
@@ -73924,6 +74015,7 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
73924
74015
  if (newState !== _this.state) {
73925
74016
  _this.handlePlayerStateChange(newState);
73926
74017
  }
74018
+ _this.checkForVideoIdChanges();
73927
74019
  }, 10);
73928
74020
  }
73929
74021
  },
@@ -73945,19 +74037,16 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
73945
74037
  case -1:
73946
74038
  break;
73947
74039
  case 0:
73948
- this.assurePlaybackState(false);
73949
74040
  this.context.store.dispatch({
73950
74041
  type: "PAUSE"
73951
74042
  });
73952
74043
  break;
73953
74044
  case 1:
73954
- this.assurePlaybackState(true);
73955
74045
  this.context.store.dispatch({
73956
74046
  type: "PLAY"
73957
74047
  });
73958
74048
  break;
73959
74049
  case 2:
73960
- this.assurePlaybackState(false);
73961
74050
  this.context.store.dispatch({
73962
74051
  type: "PAUSE"
73963
74052
  });
@@ -74214,7 +74303,6 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74214
74303
  key: "play",
74215
74304
  value: function play() {
74216
74305
  var _this_instance;
74217
- this.assurePlaybackState(true);
74218
74306
  (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.playVideo();
74219
74307
  return Promise.resolve();
74220
74308
  }
@@ -74223,7 +74311,6 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74223
74311
  key: "pause",
74224
74312
  value: function pause() {
74225
74313
  var _this_instance;
74226
- this.assurePlaybackState(false);
74227
74314
  (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.pauseVideo();
74228
74315
  return Promise.resolve();
74229
74316
  }
@@ -76830,6 +76917,22 @@ var VideoRegionsDataCollection = /*#__PURE__*/ function() {
76830
76917
  }
76831
76918
  return this.missingInfo[keys[keys.length - 1]];
76832
76919
  }
76920
+ },
76921
+ {
76922
+ key: "getLoadedPercentage",
76923
+ value: function getLoadedPercentage() {
76924
+ if (this.isComplete) {
76925
+ return 100;
76926
+ }
76927
+ if (this.timestampList.length === 0) {
76928
+ return 0;
76929
+ }
76930
+ ;
76931
+ var firstMissingTimestamp = Object.keys(this.missingInfo).sort(function(a, b) {
76932
+ return parseFloat(a) - parseFloat(b);
76933
+ })[0];
76934
+ return parseFloat(firstMissingTimestamp) / this.totalLengthSeconds * 100;
76935
+ }
76833
76936
  }
76834
76937
  ]);
76835
76938
  return VideoRegionsDataCollection;
@@ -76860,6 +76963,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
76860
76963
  value: function handlePredictionResult(data) {
76861
76964
  var _this_cache;
76862
76965
  this.regionsData.append(data);
76966
+ this.emit("UPDATE");
76863
76967
  (_this_cache = this.cache) === null || _this_cache === void 0 ? void 0 : _this_cache.update(data);
76864
76968
  }
76865
76969
  },
@@ -76868,6 +76972,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
76868
76972
  value: function handlePredictionCompleted() {
76869
76973
  var _this_logger;
76870
76974
  (_this_logger = this.logger) === null || _this_logger === void 0 ? void 0 : _this_logger.log("Prediction completed!");
76975
+ this.emit("UPDATE");
76871
76976
  }
76872
76977
  },
76873
76978
  {
@@ -76935,6 +77040,12 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
76935
77040
  return this.regionsData.get(timestamp);
76936
77041
  }
76937
77042
  },
77043
+ {
77044
+ key: "progress",
77045
+ value: function progress() {
77046
+ return this.regionsData.getLoadedPercentage();
77047
+ }
77048
+ },
76938
77049
  {
76939
77050
  key: "dumps",
76940
77051
  value: function dumps(from, to) {
@@ -76960,6 +77071,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
76960
77071
  this.service.send("stop");
76961
77072
  this.service.destroy();
76962
77073
  this.regionsData.load(data);
77074
+ this.emit("UPDATE");
76963
77075
  return;
76964
77076
  }
76965
77077
  if (typeof window === "undefined") {
@@ -76989,6 +77101,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
76989
77101
  _this.service.send("stop");
76990
77102
  _this.service.destroy();
76991
77103
  _this.regionsData.load(parsed);
77104
+ _this.emit("UPDATE");
76992
77105
  } catch (err) {
76993
77106
  var _this_logger;
76994
77107
  (_this_logger = _this.logger) === null || _this_logger === void 0 ? void 0 : _this_logger.error("Failed to load data:", err);
@@ -80970,6 +81083,59 @@ var ProgressBar = /*#__PURE__*/ function() {
80970
81083
  ]);
80971
81084
  return ProgressBar;
80972
81085
  }();
81086
+ // src/Ads/VideoAds/UI/Controls/Components/ProgressIndicator.ts
81087
+ var NS = "http://www.w3.org/2000/svg";
81088
+ var BOX_S = 16;
81089
+ var R = 6;
81090
+ var CIRC = 2 * Math.PI * R;
81091
+ var ProgressBanner = /*#__PURE__*/ function() {
81092
+ function ProgressBanner() {
81093
+ _class_call_check(this, ProgressBanner);
81094
+ this.view = document.createElement("div");
81095
+ this.view.classList.add("progress-banner");
81096
+ var circleWrap = document.createElement("div");
81097
+ circleWrap.classList.add("progress-circle");
81098
+ circleWrap.style.width = "".concat(BOX_S, "px");
81099
+ circleWrap.style.height = "".concat(BOX_S, "px");
81100
+ var svg = document.createElementNS(NS, "svg");
81101
+ svg.setAttribute("viewBox", "0 0 ".concat(BOX_S, " ").concat(BOX_S));
81102
+ var bg = document.createElementNS(NS, "circle");
81103
+ bg.setAttribute("cx", "".concat(BOX_S / 2));
81104
+ bg.setAttribute("cy", "".concat(BOX_S / 2));
81105
+ bg.setAttribute("r", R.toString());
81106
+ bg.classList.add("bg");
81107
+ svg.appendChild(bg);
81108
+ this.fg = document.createElementNS(NS, "circle");
81109
+ this.fg.setAttribute("cx", "".concat(BOX_S / 2));
81110
+ this.fg.setAttribute("cy", "".concat(BOX_S / 2));
81111
+ this.fg.setAttribute("r", R.toString());
81112
+ this.fg.classList.add("fg");
81113
+ this.fg.setAttribute("stroke-dasharray", "".concat(CIRC));
81114
+ this.fg.setAttribute("stroke-dashoffset", "".concat(CIRC));
81115
+ svg.setAttribute("tabindex", "0");
81116
+ svg.appendChild(this.fg);
81117
+ circleWrap.appendChild(svg);
81118
+ this.view.appendChild(circleWrap);
81119
+ this.view.setAttribute("aria-label", "Video processing is 0% complete.");
81120
+ this.label = document.createElement("span");
81121
+ this.label.classList.add("progress-label");
81122
+ this.view.appendChild(this.label);
81123
+ this.setValue(0);
81124
+ }
81125
+ _create_class(ProgressBanner, [
81126
+ {
81127
+ /** Update the banner (0 – 100) */ key: "setValue",
81128
+ value: function setValue(value2) {
81129
+ var offset = CIRC - value2 / 100 * CIRC;
81130
+ this.fg.setAttribute("stroke-dashoffset", "".concat(offset));
81131
+ var text2 = "Video processing is ".concat(Math.ceil(value2), "% complete.");
81132
+ this.label.textContent = text2;
81133
+ this.view.setAttribute("aria-label", text2);
81134
+ }
81135
+ }
81136
+ ]);
81137
+ return ProgressBanner;
81138
+ }();
80973
81139
  // src/Ads/VideoAds/UI/Controls/Components/BottomBar/ControlBottomBar.ts
80974
81140
  var ControlBottomBar = /*#__PURE__*/ function() {
80975
81141
  function ControlBottomBar(context, events) {
@@ -81106,6 +81272,46 @@ var DailymotionBottomBar = /*#__PURE__*/ function() {
81106
81272
  ]);
81107
81273
  return DailymotionBottomBar;
81108
81274
  }();
81275
+ var NativeBottomBar = /*#__PURE__*/ function() {
81276
+ function NativeBottomBar(context, events) {
81277
+ var _this = this;
81278
+ _class_call_check(this, NativeBottomBar);
81279
+ this.buttons = {};
81280
+ this.context = context;
81281
+ this.events = events;
81282
+ this.controlsContainer = document.createElement("div");
81283
+ this.controlsContainer.id = "BRNDTS_CTLBB";
81284
+ this.controlsContainer.dataset.type = "N_CTLBB";
81285
+ var topElement = document.createElement("div");
81286
+ topElement.classList.add("BRNDTS_CTLBB_TOP");
81287
+ this.controlsContainer.appendChild(topElement);
81288
+ var ind = new ProgressBanner();
81289
+ this.context.store.subscribe(this.handleStateChange.bind(this));
81290
+ this.context.data.on("UPDATE", function() {
81291
+ ind.setValue(_this.context.data.progress());
81292
+ });
81293
+ topElement.appendChild(ind.view);
81294
+ }
81295
+ _create_class(NativeBottomBar, [
81296
+ {
81297
+ key: "handleStateChange",
81298
+ value: function handleStateChange(state) {}
81299
+ },
81300
+ {
81301
+ key: "view",
81302
+ get: function get() {
81303
+ return this.controlsContainer;
81304
+ }
81305
+ },
81306
+ {
81307
+ key: "destroy",
81308
+ value: function destroy() {
81309
+ this.view.remove();
81310
+ }
81311
+ }
81312
+ ]);
81313
+ return NativeBottomBar;
81314
+ }();
81109
81315
  // src/Ads/VideoAds/UI/Controls/Controls.ts
81110
81316
  var Controls = /*#__PURE__*/ function() {
81111
81317
  function Controls(context) {
@@ -81147,7 +81353,12 @@ var Controls = /*#__PURE__*/ function() {
81147
81353
  this.container.appendChild(this.controlBottomBar.view);
81148
81354
  }
81149
81355
  if (this.context.media.is("NATIVE")) {
81356
+ var _this_context_config_get_elements, _this_context_config_get1;
81150
81357
  this.setTopBar();
81358
+ if ((_this_context_config_get1 = this.context.config.get("controls")) === null || _this_context_config_get1 === void 0 ? void 0 : (_this_context_config_get_elements = _this_context_config_get1.elements) === null || _this_context_config_get_elements === void 0 ? void 0 : _this_context_config_get_elements.progress_ind) {
81359
+ this.controlBottomBar = new NativeBottomBar(this.context, this.events);
81360
+ this.container.appendChild(this.controlBottomBar.view);
81361
+ }
81151
81362
  }
81152
81363
  }
81153
81364
  }
@@ -83779,6 +83990,12 @@ var VideoRegionsDataManagerDecorator = /*#__PURE__*/ function() {
83779
83990
  return this.component.on(event, handler);
83780
83991
  }
83781
83992
  },
83993
+ {
83994
+ key: "off",
83995
+ value: function off(event, handler) {
83996
+ return this.component.off(event, handler);
83997
+ }
83998
+ },
83782
83999
  {
83783
84000
  key: "fetch",
83784
84001
  value: function fetch1() {
@@ -83797,6 +84014,12 @@ var VideoRegionsDataManagerDecorator = /*#__PURE__*/ function() {
83797
84014
  return this.component.check(timestamp);
83798
84015
  }
83799
84016
  },
84017
+ {
84018
+ key: "progress",
84019
+ value: function progress() {
84020
+ return this.component.progress();
84021
+ }
84022
+ },
83800
84023
  {
83801
84024
  key: "get",
83802
84025
  value: function get(timestamp) {
@@ -83817,8 +84040,8 @@ var VideoRegionsDataManagerDecorator = /*#__PURE__*/ function() {
83817
84040
  },
83818
84041
  {
83819
84042
  key: "loads",
83820
- value: function loads() {
83821
- return this.component.loads();
84043
+ value: function loads(data) {
84044
+ return this.component.loads(data);
83822
84045
  }
83823
84046
  }
83824
84047
  ]);
@@ -84053,7 +84276,7 @@ var VideoRegionsDecoratorFactory = /*#__PURE__*/ function() {
84053
84276
  minDuration: params.minimum_display_time.value
84054
84277
  });
84055
84278
  }
84056
- if ((_params_ad_placements_and_sizes = params.ad_placements_and_sizes) === null || _params_ad_placements_and_sizes === void 0 ? void 0 : _params_ad_placements_and_sizes.value) {
84279
+ if (((_params_ad_placements_and_sizes = params.ad_placements_and_sizes) === null || _params_ad_placements_and_sizes === void 0 ? void 0 : _params_ad_placements_and_sizes.value) !== void 0) {
84057
84280
  target = new VideoRegionsTypeFilterDecorator(target, params.ad_placements_and_sizes);
84058
84281
  }
84059
84282
  return target;
@@ -84132,7 +84355,7 @@ var VideoAd = /*#__PURE__*/ function() {
84132
84355
  {
84133
84356
  key: "handleInfo",
84134
84357
  value: function handleInfo(data) {
84135
- var _this_presentation;
84358
+ var _this_presentation, _this_presentation1;
84136
84359
  if (!data.video) {
84137
84360
  ErrorHandler.handle(new InternalError("Setup failed: no video identifier"));
84138
84361
  return;
@@ -84167,6 +84390,7 @@ var VideoAd = /*#__PURE__*/ function() {
84167
84390
  ts: 0
84168
84391
  });
84169
84392
  (_this_presentation = this.presentation) === null || _this_presentation === void 0 ? void 0 : _this_presentation.setup();
84393
+ (_this_presentation1 = this.presentation) === null || _this_presentation1 === void 0 ? void 0 : _this_presentation1.start();
84170
84394
  }
84171
84395
  },
84172
84396
  {