@brndts/brndts-ads 1.14.16 → 1.14.18

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
@@ -55202,18 +55202,18 @@ var BrowserClient = /*#__PURE__*/ function(BaseClient) {
55202
55202
  function BrowserClient(options) {
55203
55203
  _class_call_check(this, BrowserClient);
55204
55204
  var _this;
55205
- var opts = _object_spread({
55205
+ var opts2 = _object_spread({
55206
55206
  // We default this to true, as it is the safer scenario
55207
55207
  parentSpanIsAlwaysRootSpan: true
55208
55208
  }, options);
55209
55209
  var sdkSource = WINDOW4.SENTRY_SDK_SOURCE || getSDKSource();
55210
- applySdkMetadata(opts, "browser", [
55210
+ applySdkMetadata(opts2, "browser", [
55211
55211
  "browser"
55212
55212
  ], sdkSource);
55213
55213
  _this = _call_super(this, BrowserClient, [
55214
- opts
55214
+ opts2
55215
55215
  ]);
55216
- if (opts.sendClientReports && WINDOW4.document) {
55216
+ if (opts2.sendClientReports && WINDOW4.document) {
55217
55217
  WINDOW4.document.addEventListener("visibilitychange", function() {
55218
55218
  if (WINDOW4.document.visibilityState === "hidden") {
55219
55219
  _this._flushOutcomes();
@@ -55347,7 +55347,7 @@ var initMetric = function(name, value2) {
55347
55347
  };
55348
55348
  };
55349
55349
  // node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js
55350
- var observe = function(type, callback, opts) {
55350
+ var observe = function(type, callback, opts2) {
55351
55351
  try {
55352
55352
  if (PerformanceObserver.supportedEntryTypes.includes(type)) {
55353
55353
  var po2 = new PerformanceObserver(function(list) {
@@ -55358,7 +55358,7 @@ var observe = function(type, callback, opts) {
55358
55358
  po2.observe(Object.assign({
55359
55359
  type: type,
55360
55360
  buffered: true
55361
- }, opts || {}));
55361
+ }, opts2 || {}));
55362
55362
  return po2;
55363
55363
  }
55364
55364
  } catch (e2) {}
@@ -55432,7 +55432,7 @@ var FCPThresholds = [
55432
55432
  3e3
55433
55433
  ];
55434
55434
  var onFCP = function(onReport) {
55435
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55435
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55436
55436
  whenActivated(function() {
55437
55437
  var visibilityWatcher = getVisibilityWatcher();
55438
55438
  var metric = initMetric("FCP");
@@ -55451,7 +55451,7 @@ var onFCP = function(onReport) {
55451
55451
  };
55452
55452
  var po2 = observe("paint", handleEntries);
55453
55453
  if (po2) {
55454
- report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges);
55454
+ report = bindReporter(onReport, metric, FCPThresholds, opts2.reportAllChanges);
55455
55455
  }
55456
55456
  });
55457
55457
  };
@@ -55461,7 +55461,7 @@ var CLSThresholds = [
55461
55461
  0.25
55462
55462
  ];
55463
55463
  var onCLS = function(onReport) {
55464
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55464
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55465
55465
  onFCP(runOnce(function() {
55466
55466
  var metric = initMetric("CLS", 0);
55467
55467
  var report;
@@ -55491,7 +55491,7 @@ var onCLS = function(onReport) {
55491
55491
  };
55492
55492
  var po2 = observe("layout-shift", handleEntries);
55493
55493
  if (po2) {
55494
- report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges);
55494
+ report = bindReporter(onReport, metric, CLSThresholds, opts2.reportAllChanges);
55495
55495
  onHidden(function() {
55496
55496
  handleEntries(po2.takeRecords());
55497
55497
  report(true);
@@ -55506,7 +55506,7 @@ var FIDThresholds = [
55506
55506
  300
55507
55507
  ];
55508
55508
  var onFID = function(onReport) {
55509
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55509
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55510
55510
  whenActivated(function() {
55511
55511
  var visibilityWatcher = getVisibilityWatcher();
55512
55512
  var metric = initMetric("FID");
@@ -55522,7 +55522,7 @@ var onFID = function(onReport) {
55522
55522
  entries.forEach(handleEntry);
55523
55523
  };
55524
55524
  var po2 = observe("first-input", handleEntries);
55525
- report = bindReporter(onReport, metric, FIDThresholds, opts.reportAllChanges);
55525
+ report = bindReporter(onReport, metric, FIDThresholds, opts2.reportAllChanges);
55526
55526
  if (po2) {
55527
55527
  onHidden(runOnce(function() {
55528
55528
  handleEntries(po2.takeRecords());
@@ -55627,7 +55627,7 @@ var INPThresholds = [
55627
55627
  500
55628
55628
  ];
55629
55629
  var onINP = function(onReport) {
55630
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55630
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55631
55631
  if (!("PerformanceEventTiming" in WINDOW5 && "interactionId" in PerformanceEventTiming.prototype)) {
55632
55632
  return;
55633
55633
  }
@@ -55653,9 +55653,9 @@ var onINP = function(onReport) {
55653
55653
  // and performance. Running this callback for any interaction that spans
55654
55654
  // just one or two frames is likely not worth the insight that could be
55655
55655
  // gained.
55656
- durationThreshold: opts.durationThreshold != null ? opts.durationThreshold : DEFAULT_DURATION_THRESHOLD
55656
+ durationThreshold: opts2.durationThreshold != null ? opts2.durationThreshold : DEFAULT_DURATION_THRESHOLD
55657
55657
  });
55658
- report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges);
55658
+ report = bindReporter(onReport, metric, INPThresholds, opts2.reportAllChanges);
55659
55659
  if (po2) {
55660
55660
  po2.observe({
55661
55661
  type: "first-input",
@@ -55675,13 +55675,13 @@ var LCPThresholds = [
55675
55675
  ];
55676
55676
  var reportedMetricIDs = {};
55677
55677
  var onLCP = function(onReport) {
55678
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55678
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55679
55679
  whenActivated(function() {
55680
55680
  var visibilityWatcher = getVisibilityWatcher();
55681
55681
  var metric = initMetric("LCP");
55682
55682
  var report;
55683
55683
  var handleEntries = function(entries) {
55684
- if (!opts.reportAllChanges) {
55684
+ if (!opts2.reportAllChanges) {
55685
55685
  entries = entries.slice(-1);
55686
55686
  }
55687
55687
  entries.forEach(function(entry) {
@@ -55696,7 +55696,7 @@ var onLCP = function(onReport) {
55696
55696
  };
55697
55697
  var po2 = observe("largest-contentful-paint", handleEntries);
55698
55698
  if (po2) {
55699
- report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges);
55699
+ report = bindReporter(onReport, metric, LCPThresholds, opts2.reportAllChanges);
55700
55700
  var stopListening = runOnce(function() {
55701
55701
  if (!reportedMetricIDs[metric.id]) {
55702
55702
  handleEntries(po2.takeRecords());
@@ -55741,9 +55741,9 @@ var whenReady = function(callback) {
55741
55741
  }
55742
55742
  };
55743
55743
  var onTTFB = function(onReport) {
55744
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55744
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55745
55745
  var metric = initMetric("TTFB");
55746
- var report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges);
55746
+ var report = bindReporter(onReport, metric, TTFBThresholds, opts2.reportAllChanges);
55747
55747
  whenReady(function() {
55748
55748
  var navigationEntry = getNavigationEntry();
55749
55749
  if (navigationEntry) {
@@ -62842,9 +62842,9 @@ function makeReplayLogger() {
62842
62842
  infoTick: function() {
62843
62843
  return void 0;
62844
62844
  },
62845
- setConfig: function(opts) {
62846
- _capture = opts.captureExceptions;
62847
- _trace = opts.traceInternals;
62845
+ setConfig: function(opts2) {
62846
+ _capture = opts2.captureExceptions;
62847
+ _trace = opts2.traceInternals;
62848
62848
  }
62849
62849
  };
62850
62850
  if (DEBUG_BUILD5) {
@@ -69360,9 +69360,9 @@ var RegionMaskPlugin = /*#__PURE__*/ function() {
69360
69360
  }();
69361
69361
  // src/Ads/Regions/Plugins/Border/RegionBorderPlugin.ts
69362
69362
  var RegionBorderPlugin = /*#__PURE__*/ function() {
69363
- function RegionBorderPlugin(opts) {
69363
+ function RegionBorderPlugin(opts2) {
69364
69364
  _class_call_check(this, RegionBorderPlugin);
69365
- this.options = opts;
69365
+ this.options = opts2;
69366
69366
  }
69367
69367
  _create_class(RegionBorderPlugin, [
69368
69368
  {
@@ -69797,6 +69797,254 @@ var TYPE_AND_DIMENSIONS = {
69797
69797
  ]
69798
69798
  ]
69799
69799
  };
69800
+ var BREAKPOINTS = {
69801
+ "large-desktop": 1280,
69802
+ "desktop": 1024,
69803
+ "tablet": 768,
69804
+ "mobile": 0
69805
+ };
69806
+ var RULES = {
69807
+ "billboard": {
69808
+ "large-desktop": [
69809
+ [
69810
+ 970,
69811
+ 250
69812
+ ],
69813
+ [
69814
+ 970,
69815
+ 90
69816
+ ]
69817
+ ],
69818
+ // allow billboard + super lb
69819
+ "desktop": [
69820
+ [
69821
+ 970,
69822
+ 250
69823
+ ],
69824
+ [
69825
+ 970,
69826
+ 90
69827
+ ]
69828
+ ],
69829
+ // drop 970x250, still wide
69830
+ "tablet": [
69831
+ [
69832
+ 728,
69833
+ 90
69834
+ ],
69835
+ [
69836
+ 468,
69837
+ 60
69838
+ ]
69839
+ ]
69840
+ },
69841
+ "leaderboard": {
69842
+ "large-desktop": [
69843
+ [
69844
+ 728,
69845
+ 90
69846
+ ],
69847
+ [
69848
+ 468,
69849
+ 60
69850
+ ]
69851
+ ],
69852
+ "desktop": [
69853
+ [
69854
+ 728,
69855
+ 90
69856
+ ],
69857
+ [
69858
+ 468,
69859
+ 60
69860
+ ]
69861
+ ],
69862
+ "tablet": [
69863
+ [
69864
+ 728,
69865
+ 90
69866
+ ],
69867
+ [
69868
+ 468,
69869
+ 60
69870
+ ]
69871
+ ],
69872
+ "mobile": [
69873
+ [
69874
+ 728,
69875
+ 90
69876
+ ],
69877
+ [
69878
+ 468,
69879
+ 60
69880
+ ],
69881
+ [
69882
+ 320,
69883
+ 50
69884
+ ],
69885
+ [
69886
+ 300,
69887
+ 50
69888
+ ]
69889
+ ]
69890
+ },
69891
+ "large-rectangle": {
69892
+ "large-desktop": [
69893
+ [
69894
+ 300,
69895
+ 600
69896
+ ],
69897
+ [
69898
+ 160,
69899
+ 600
69900
+ ]
69901
+ ],
69902
+ "desktop": [
69903
+ [
69904
+ 300,
69905
+ 600
69906
+ ],
69907
+ [
69908
+ 160,
69909
+ 600
69910
+ ]
69911
+ ],
69912
+ "tablet": [
69913
+ [
69914
+ 160,
69915
+ 600
69916
+ ],
69917
+ [
69918
+ 120,
69919
+ 600
69920
+ ]
69921
+ ]
69922
+ },
69923
+ "medium-rectangle": {
69924
+ "large-desktop": [
69925
+ [
69926
+ 300,
69927
+ 250
69928
+ ],
69929
+ [
69930
+ 250,
69931
+ 250
69932
+ ],
69933
+ [
69934
+ 200,
69935
+ 200
69936
+ ]
69937
+ ],
69938
+ "desktop": [
69939
+ [
69940
+ 300,
69941
+ 250
69942
+ ],
69943
+ [
69944
+ 250,
69945
+ 250
69946
+ ],
69947
+ [
69948
+ 200,
69949
+ 200
69950
+ ]
69951
+ ],
69952
+ "tablet": [
69953
+ [
69954
+ 300,
69955
+ 250
69956
+ ],
69957
+ [
69958
+ 250,
69959
+ 250
69960
+ ],
69961
+ [
69962
+ 200,
69963
+ 200
69964
+ ],
69965
+ [
69966
+ 180,
69967
+ 150
69968
+ ]
69969
+ ],
69970
+ "mobile": [
69971
+ [
69972
+ 300,
69973
+ 250
69974
+ ],
69975
+ [
69976
+ 250,
69977
+ 250
69978
+ ],
69979
+ [
69980
+ 180,
69981
+ 150
69982
+ ],
69983
+ [
69984
+ 150,
69985
+ 150
69986
+ ]
69987
+ ]
69988
+ },
69989
+ "smartphone-banner": {
69990
+ "large-desktop": [
69991
+ [
69992
+ 320,
69993
+ 50
69994
+ ],
69995
+ [
69996
+ 300,
69997
+ 50
69998
+ ],
69999
+ [
70000
+ 320,
70001
+ 100
70002
+ ]
70003
+ ],
70004
+ "desktop": [
70005
+ [
70006
+ 320,
70007
+ 50
70008
+ ],
70009
+ [
70010
+ 300,
70011
+ 50
70012
+ ],
70013
+ [
70014
+ 320,
70015
+ 100
70016
+ ]
70017
+ ],
70018
+ "tablet": [
70019
+ [
70020
+ 320,
70021
+ 50
70022
+ ],
70023
+ [
70024
+ 300,
70025
+ 50
70026
+ ],
70027
+ [
70028
+ 320,
70029
+ 100
70030
+ ]
70031
+ ],
70032
+ "mobile": [
70033
+ [
70034
+ 320,
70035
+ 50
70036
+ ],
70037
+ [
70038
+ 300,
70039
+ 50
70040
+ ],
70041
+ [
70042
+ 320,
70043
+ 100
70044
+ ]
70045
+ ]
70046
+ }
70047
+ };
69800
70048
  var REGIONS = [
69801
70049
  {
69802
70050
  id: 1,
@@ -70131,6 +70379,30 @@ var RegionDefinitions = /*#__PURE__*/ function() {
70131
70379
  return REGIONS;
70132
70380
  }
70133
70381
  },
70382
+ {
70383
+ key: "BREAKPOINTS",
70384
+ get: function get() {
70385
+ return BREAKPOINTS;
70386
+ }
70387
+ },
70388
+ {
70389
+ key: "RULES",
70390
+ get: function get() {
70391
+ return RULES;
70392
+ }
70393
+ },
70394
+ {
70395
+ key: "mapping",
70396
+ value: function mapping(type) {
70397
+ return RULES[type];
70398
+ }
70399
+ },
70400
+ {
70401
+ key: "getBreakpointsSize",
70402
+ value: function getBreakpointsSize(breakpointLabel) {
70403
+ return BREAKPOINTS[breakpointLabel];
70404
+ }
70405
+ },
70134
70406
  {
70135
70407
  key: "approxRegionByRatio",
70136
70408
  value: function approxRegionByRatio(w2, h) {
@@ -71610,6 +71882,13 @@ var PrebidConfigBuilder = /*#__PURE__*/ function() {
71610
71882
  return this;
71611
71883
  }
71612
71884
  },
71885
+ {
71886
+ key: "setSizeConfiguration",
71887
+ value: function setSizeConfiguration(config2) {
71888
+ this.config.sizeConfig = config2;
71889
+ return this;
71890
+ }
71891
+ },
71613
71892
  {
71614
71893
  key: "addConsent",
71615
71894
  value: function addConsent(consent) {
@@ -72127,6 +72406,49 @@ var Prebid = /*#__PURE__*/ function() {
72127
72406
  }();
72128
72407
  // src/Ads/Providers/Prebidjs/PrebidGAMProvider.ts
72129
72408
  var FALLBACK_GAM_NETWORK_ID = "23256716895";
72409
+ function toMediaQuery(minWidth) {
72410
+ return "(min-width: ".concat(minWidth, "px)");
72411
+ }
72412
+ function buildPrebidSizeConfig(rules) {
72413
+ var byBp = {
72414
+ "large-desktop": /* @__PURE__ */ new Set(),
72415
+ "desktop": /* @__PURE__ */ new Set(),
72416
+ "tablet": /* @__PURE__ */ new Set(),
72417
+ "mobile": /* @__PURE__ */ new Set()
72418
+ };
72419
+ Object.values(rules).forEach(function(perType) {
72420
+ Object.keys(perType).forEach(function(bp) {
72421
+ var _perType_bp;
72422
+ (_perType_bp = perType[bp]) === null || _perType_bp === void 0 ? void 0 : _perType_bp.forEach(function(param) {
72423
+ var _param = _sliced_to_array(param, 2), w2 = _param[0], h = _param[1];
72424
+ return byBp[bp].add("".concat(w2, "x").concat(h));
72425
+ });
72426
+ });
72427
+ });
72428
+ var toSizes = function(set) {
72429
+ return Array.from(set).map(function(s2) {
72430
+ return s2.split("x").map(Number);
72431
+ });
72432
+ };
72433
+ var ordered = [
72434
+ "large-desktop",
72435
+ "desktop",
72436
+ "tablet",
72437
+ "mobile"
72438
+ ];
72439
+ return ordered.filter(function(bp) {
72440
+ return byBp[bp].size > 0;
72441
+ }).map(function(bp) {
72442
+ return {
72443
+ // @ts-expect-error
72444
+ mediaQuery: toMediaQuery(RegionDefinitions.BREAKPOINTS[bp]),
72445
+ sizesSupported: toSizes(byBp[bp]),
72446
+ labels: [
72447
+ bp
72448
+ ]
72449
+ };
72450
+ });
72451
+ }
72130
72452
  var PrebidGAMEvents = /*#__PURE__*/ function() {
72131
72453
  function PrebidGAMEvents() {
72132
72454
  _class_call_check(this, PrebidGAMEvents);
@@ -72179,38 +72501,6 @@ var GPT = /*#__PURE__*/ function() {
72179
72501
  });
72180
72502
  }
72181
72503
  },
72182
- {
72183
- key: "defineSlot",
72184
- value: function defineSlot(slotId, size, containerId, targeting) {
72185
- window.googletag.cmd.push(function() {
72186
- if (window.googletag.pubads().getSlots().some(function(slot) {
72187
- return slot.getSlotElementId() === containerId;
72188
- })) {
72189
- return;
72190
- }
72191
- var mrec1 = window.googletag.defineSlot(slotId, size, "".concat(containerId)).addService(window.googletag.pubads());
72192
- var mrecmapping = window.googletag.sizeMapping().addSize([
72193
- 1024,
72194
- 0
72195
- ], size).addSize([
72196
- 728,
72197
- 0
72198
- ], size).addSize([
72199
- 320,
72200
- 0
72201
- ], size).addSize([
72202
- 0,
72203
- 0
72204
- ], []).build();
72205
- mrec1 === null || mrec1 === void 0 ? void 0 : mrec1.defineSizeMapping(mrecmapping);
72206
- if (targeting) {
72207
- mrec1.setConfig({
72208
- targeting: targeting
72209
- });
72210
- }
72211
- });
72212
- }
72213
- },
72214
72504
  {
72215
72505
  key: "start",
72216
72506
  value: function start() {
@@ -72228,6 +72518,70 @@ var GPT = /*#__PURE__*/ function() {
72228
72518
  });
72229
72519
  }
72230
72520
  },
72521
+ {
72522
+ key: "defineSlot",
72523
+ value: function defineSlot(slotId, size, containerId, opts2) {
72524
+ window.googletag.cmd.push(function() {
72525
+ if (window.googletag.pubads().getSlots().some(function(slot) {
72526
+ return slot.getSlotElementId() === containerId;
72527
+ })) {
72528
+ return;
72529
+ }
72530
+ var mrec1 = window.googletag.defineSlot(slotId, size, "".concat(containerId)).addService(window.googletag.pubads());
72531
+ var mrecmapping;
72532
+ if (opts2 === null || opts2 === void 0 ? void 0 : opts2.mapping) {
72533
+ mrecmapping = window.googletag.sizeMapping();
72534
+ var sortedBreakpoints = Object.keys(opts2.mapping).sort(function(a, b) {
72535
+ return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
72536
+ });
72537
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
72538
+ try {
72539
+ for(var _iterator = sortedBreakpoints[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
72540
+ var bp = _step.value;
72541
+ mrecmapping = mrecmapping.addSize([
72542
+ RegionDefinitions.BREAKPOINTS[bp],
72543
+ 0
72544
+ ], opts2.mapping[bp]);
72545
+ }
72546
+ } catch (err) {
72547
+ _didIteratorError = true;
72548
+ _iteratorError = err;
72549
+ } finally{
72550
+ try {
72551
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
72552
+ _iterator.return();
72553
+ }
72554
+ } finally{
72555
+ if (_didIteratorError) {
72556
+ throw _iteratorError;
72557
+ }
72558
+ }
72559
+ }
72560
+ mrecmapping = mrecmapping.build();
72561
+ } else {
72562
+ window.googletag.sizeMapping().addSize([
72563
+ 1024,
72564
+ 0
72565
+ ], size).addSize([
72566
+ 728,
72567
+ 0
72568
+ ], size).addSize([
72569
+ 320,
72570
+ 0
72571
+ ], size).addSize([
72572
+ 0,
72573
+ 0
72574
+ ], []).build();
72575
+ }
72576
+ mrec1 === null || mrec1 === void 0 ? void 0 : mrec1.defineSizeMapping(mrecmapping);
72577
+ if (opts2 === null || opts2 === void 0 ? void 0 : opts2.targeting) {
72578
+ mrec1.setConfig({
72579
+ targeting: opts2 === null || opts2 === void 0 ? void 0 : opts2.targeting
72580
+ });
72581
+ }
72582
+ });
72583
+ }
72584
+ },
72231
72585
  {
72232
72586
  key: "queue",
72233
72587
  value: function queue(callback) {
@@ -72288,7 +72642,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
72288
72642
  params: {}
72289
72643
  }
72290
72644
  ]
72291
- }).addConsent(context.consent);
72645
+ }).setSizeConfiguration(buildPrebidSizeConfig(RegionDefinitions.RULES)).addConsent(context.consent);
72292
72646
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.setConfig(configBuilder.build());
72293
72647
  (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.enableAnalytics({
72294
72648
  provider: "smartyads"
@@ -72335,31 +72689,6 @@ var PrebidGAM = /*#__PURE__*/ function() {
72335
72689
  return gamNetworkId;
72336
72690
  }
72337
72691
  },
72338
- {
72339
- key: "defineSlots",
72340
- value: function defineSlots(options) {
72341
- var _window_pbjs_que, _window_pbjs;
72342
- var gamNetwork = _PrebidGAM.getProperGAMNetworkId(options);
72343
- options.units.forEach(function(unit) {
72344
- var _unit_mediaTypes_banner;
72345
- var sizes = ((_unit_mediaTypes_banner = unit.mediaTypes.banner) === null || _unit_mediaTypes_banner === void 0 ? void 0 : _unit_mediaTypes_banner.sizes) || [];
72346
- GPT.defineSlot("/".concat(gamNetwork, "/banner"), sizes, unit.code);
72347
- });
72348
- (_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() {
72349
- var _window_pbjs;
72350
- if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
72351
- window.pbjs.addAdUnits(options.units.filter(function(unit) {
72352
- var _window_pbjs;
72353
- return !((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
72354
- return "".concat(unit.code) === "".concat(defUnit.code);
72355
- }));
72356
- }));
72357
- } else {
72358
- console.error("addAdUnits is not a function.");
72359
- }
72360
- });
72361
- }
72362
- },
72363
72692
  {
72364
72693
  key: "defineSlot",
72365
72694
  value: function defineSlot(options, slotId, containerId, adType) {
@@ -72370,12 +72699,14 @@ var PrebidGAM = /*#__PURE__*/ function() {
72370
72699
  return unit.code === "".concat(slotId);
72371
72700
  });
72372
72701
  var sizes = [];
72702
+ var mapping = void 0;
72373
72703
  if (!unitDefinition) {
72374
72704
  console.error("No unit definition found for slotId: ".concat(slotId));
72375
72705
  return;
72376
72706
  }
72377
72707
  if (adType) {
72378
72708
  sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
72709
+ mapping = RegionDefinitions.mapping(adType);
72379
72710
  } else {
72380
72711
  var _unitDefinition_mediaTypes_banner;
72381
72712
  sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
@@ -72387,9 +72718,10 @@ var PrebidGAM = /*#__PURE__*/ function() {
72387
72718
  brndts_zid: unitDefinition.zoneId
72388
72719
  };
72389
72720
  }
72390
- GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), [
72391
- sizes[0] || []
72392
- ], "".concat(containerId), targeting);
72721
+ GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId), {
72722
+ targeting: targeting,
72723
+ mapping: mapping
72724
+ });
72393
72725
  if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
72394
72726
  return "".concat(containerId) === "".concat(defUnit.code);
72395
72727
  }))) {
@@ -72397,15 +72729,51 @@ var PrebidGAM = /*#__PURE__*/ function() {
72397
72729
  (_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() {
72398
72730
  var _window_pbjs;
72399
72731
  if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
72732
+ var adUnit = _object_spread_props(_object_spread({}, unitDefinition), {
72733
+ mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
72734
+ banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
72735
+ sizes: sizes
72736
+ })
72737
+ }),
72738
+ code: "".concat(containerId)
72739
+ });
72740
+ if (mapping) {
72741
+ var mappedSizes = [];
72742
+ var sortedBreakpoints = Object.keys(mapping).sort(function(a, b) {
72743
+ return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
72744
+ });
72745
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
72746
+ try {
72747
+ for(var _iterator = sortedBreakpoints[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
72748
+ var bp = _step.value;
72749
+ mappedSizes.push({
72750
+ minViewPort: [
72751
+ RegionDefinitions.BREAKPOINTS[bp],
72752
+ 0
72753
+ ],
72754
+ sizes: opts.mapping[bp]
72755
+ });
72756
+ }
72757
+ } catch (err) {
72758
+ _didIteratorError = true;
72759
+ _iteratorError = err;
72760
+ } finally{
72761
+ try {
72762
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
72763
+ _iterator.return();
72764
+ }
72765
+ } finally{
72766
+ if (_didIteratorError) {
72767
+ throw _iteratorError;
72768
+ }
72769
+ }
72770
+ }
72771
+ adUnit.mediaTypes.banner.sizeConfig = mappedSizes;
72772
+ } else {
72773
+ adUnit.mediaTypes.banner.sizes = sizes;
72774
+ }
72400
72775
  window.pbjs.addAdUnits([
72401
- _object_spread_props(_object_spread({}, unitDefinition), {
72402
- mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
72403
- banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
72404
- sizes: sizes
72405
- })
72406
- }),
72407
- code: "".concat(containerId)
72408
- })
72776
+ adUnit
72409
72777
  ]);
72410
72778
  } else {
72411
72779
  console.error("addAdUnits is not a function.");
@@ -72445,7 +72813,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
72445
72813
  var container = document.createElement("div");
72446
72814
  container.id = containerId;
72447
72815
  var script = document.createElement("script");
72448
- script.innerHTML = '\n window.googletag.cmd.push(function() {\n googletag.pubads().refresh(googletag.pubads().getSlots().filter(slot => slot.getSlotElementId() === "'.concat(containerId, '"), { changeCorrelator: true });\n });');
72816
+ script.innerHTML = '\n window.googletag.cmd.push(function() {\n googletag.pubads().refresh(googletag.pubads().getSlots().filter(slot => slot.getSlotElementId() === "'.concat(containerId, '"), { changeCorrelator: false });\n });');
72449
72817
  container.appendChild(script);
72450
72818
  callback(container);
72451
72819
  });
@@ -78824,6 +79192,7 @@ var MediaElementSizeController = /*#__PURE__*/ function(_import_events6_default)
78824
79192
  var BasicPresentationMode = /*#__PURE__*/ function() {
78825
79193
  function BasicPresentationMode(context) {
78826
79194
  _class_call_check(this, BasicPresentationMode);
79195
+ this.presenting = false;
78827
79196
  this.updatedContainerSize = functions_default.debounce(this.updatedContainerSize.bind(this), 100);
78828
79197
  this.context = context;
78829
79198
  this.mediaElementSizeController = new MediaElementSizeController(context);
@@ -78877,9 +79246,11 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
78877
79246
  x: 0,
78878
79247
  y: 10
78879
79248
  });
79249
+ this.presenting = true;
78880
79250
  return {};
78881
79251
  } else {
78882
79252
  var _this_context_interface_backdrop1, _this_context_interface1;
79253
+ this.presenting = false;
78883
79254
  (_this_context_interface1 = this.context.interface) === null || _this_context_interface1 === void 0 ? void 0 : (_this_context_interface_backdrop1 = _this_context_interface1.backdrop) === null || _this_context_interface_backdrop1 === void 0 ? void 0 : _this_context_interface_backdrop1.hide();
78884
79255
  }
78885
79256
  return;
@@ -78896,6 +79267,7 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
78896
79267
  value: function cooldown() {
78897
79268
  var _this = this;
78898
79269
  var _this_regionsRenderer;
79270
+ this.presenting = false;
78899
79271
  (_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
78900
79272
  this.packer.reset();
78901
79273
  requestAnimationFrame(function() {
@@ -78927,6 +79299,20 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
78927
79299
  {
78928
79300
  key: "updateSize",
78929
79301
  value: function updateSize() {
79302
+ if (this.context.media) {
79303
+ var _this_context_interface;
79304
+ var adjustedSize;
79305
+ if (this.presenting) {
79306
+ adjustedSize = adjustSizeWithAspectRatio(this.context.media.viewWidth, this.context.media.viewHeight, this.context.media.aspectRatio);
79307
+ } else {
79308
+ var _this_context_elements_container, _this_context_elements_container1;
79309
+ adjustedSize = {
79310
+ width: ((_this_context_elements_container = this.context.elements.container) === null || _this_context_elements_container === void 0 ? void 0 : _this_context_elements_container.getBoundingClientRect().width) || 0,
79311
+ height: ((_this_context_elements_container1 = this.context.elements.container) === null || _this_context_elements_container1 === void 0 ? void 0 : _this_context_elements_container1.getBoundingClientRect().height) || 0
79312
+ };
79313
+ }
79314
+ (_this_context_interface = this.context.interface) === null || _this_context_interface === void 0 ? void 0 : _this_context_interface.updateSize(adjustedSize.width, adjustedSize.height, this.context.media.aspectRatio);
79315
+ }
78930
79316
  return void 0;
78931
79317
  }
78932
79318
  },
@@ -78954,11 +79340,13 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
78954
79340
  this.packer.repack();
78955
79341
  if (this.packer.packed.length > 0) {
78956
79342
  var _this_context_interface_backdrop, _this_context_interface, _this_regionsRenderer1, _this_regionsRenderer2;
79343
+ this.presenting = true;
78957
79344
  (_this_context_interface = this.context.interface) === null || _this_context_interface === void 0 ? void 0 : (_this_context_interface_backdrop = _this_context_interface.backdrop) === null || _this_context_interface_backdrop === void 0 ? void 0 : _this_context_interface_backdrop.show();
78958
79345
  (_this_regionsRenderer1 = this.regionsRenderer) === null || _this_regionsRenderer1 === void 0 ? void 0 : _this_regionsRenderer1.addAreas(this.packer.areas);
78959
79346
  (_this_regionsRenderer2 = this.regionsRenderer) === null || _this_regionsRenderer2 === void 0 ? void 0 : _this_regionsRenderer2.render(this.packer.packed);
78960
79347
  } else {
78961
79348
  var _this_regionsRenderer3, _this_mediaElementSizeController5, _this_context_interface_backdrop1, _this_context_interface1;
79349
+ this.presenting = false;
78962
79350
  (_this_regionsRenderer3 = this.regionsRenderer) === null || _this_regionsRenderer3 === void 0 ? void 0 : _this_regionsRenderer3.clear();
78963
79351
  (_this_mediaElementSizeController5 = this.mediaElementSizeController) === null || _this_mediaElementSizeController5 === void 0 ? void 0 : _this_mediaElementSizeController5.restore();
78964
79352
  (_this_context_interface1 = this.context.interface) === null || _this_context_interface1 === void 0 ? void 0 : (_this_context_interface_backdrop1 = _this_context_interface1.backdrop) === null || _this_context_interface_backdrop1 === void 0 ? void 0 : _this_context_interface_backdrop1.hide();
@@ -80210,7 +80598,7 @@ var CooldownPresentation = /*#__PURE__*/ function(AbstractPresentation) {
80210
80598
  },
80211
80599
  {
80212
80600
  key: "startedPresentation",
80213
- value: function startedPresentation(opts) {
80601
+ value: function startedPresentation(opts2) {
80214
80602
  this.stopRetry();
80215
80603
  this.emit("pace");
80216
80604
  this.presentationTimer.resume();
@@ -80444,11 +80832,11 @@ var DynamicDurationPresentation = /*#__PURE__*/ function(AbstractPresentation) {
80444
80832
  },
80445
80833
  {
80446
80834
  key: "startedPresentation",
80447
- value: function startedPresentation(opts) {
80835
+ value: function startedPresentation(opts2) {
80448
80836
  this.stopRetry();
80449
80837
  this.startPacing();
80450
- if (opts.expectedDuration && !this.presentationTimer.isPaused) {
80451
- this.presentationTimer.setDuration(opts.expectedDuration * 1e3);
80838
+ if (opts2.expectedDuration && !this.presentationTimer.isPaused) {
80839
+ this.presentationTimer.setDuration(opts2.expectedDuration * 1e3);
80452
80840
  }
80453
80841
  this.presentationTimer.resume();
80454
80842
  }
@@ -84641,22 +85029,6 @@ var Interface = /*#__PURE__*/ function(_import_events9_default) {
84641
85029
  return Interface;
84642
85030
  }(import_events9.default);
84643
85031
  // src/Ads/VideoAds/VideoAd.ts
84644
- function adjustSizeWithAspectRatio2(maxWidth, maxHeight, aspectRatio) {
84645
- var width = maxWidth;
84646
- var height = maxHeight;
84647
- if (aspectRatio > 0) {
84648
- width = Math.min(maxWidth, maxHeight * aspectRatio);
84649
- height = width / aspectRatio;
84650
- if (height > maxHeight) {
84651
- height = maxHeight;
84652
- width = height * aspectRatio;
84653
- }
84654
- }
84655
- return {
84656
- width: width,
84657
- height: height
84658
- };
84659
- }
84660
85032
  var PresentationManager = /*#__PURE__*/ function() {
84661
85033
  function PresentationManager(context) {
84662
85034
  _class_call_check(this, PresentationManager);
@@ -84810,11 +85182,6 @@ var PresentationManager = /*#__PURE__*/ function() {
84810
85182
  this.modes.forEach(function(mode) {
84811
85183
  mode.updateSize();
84812
85184
  });
84813
- if (this.context.media) {
84814
- var _this_context_interface;
84815
- var adjustedSize = adjustSizeWithAspectRatio2(this.context.media.viewWidth, this.context.media.viewHeight, this.context.media.aspectRatio);
84816
- (_this_context_interface = this.context.interface) === null || _this_context_interface === void 0 ? void 0 : _this_context_interface.updateSize(adjustedSize.width, adjustedSize.height, this.context.media.aspectRatio);
84817
- }
84818
85185
  }
84819
85186
  },
84820
85187
  {
@@ -86259,8 +86626,8 @@ function pick(obj) {
86259
86626
  }
86260
86627
  var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout;
86261
86628
  var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
86262
- function installTimerFunctions(obj, opts) {
86263
- if (opts.useNativeTimers) {
86629
+ function installTimerFunctions(obj, opts2) {
86630
+ if (opts2.useNativeTimers) {
86264
86631
  obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
86265
86632
  obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
86266
86633
  } else {
@@ -86333,16 +86700,16 @@ var TransportError = /*#__PURE__*/ function(Error1) {
86333
86700
  }(_wrap_native_super(Error));
86334
86701
  var Transport = /*#__PURE__*/ function(Emitter) {
86335
86702
  _inherits(Transport, Emitter);
86336
- function Transport(opts) {
86703
+ function Transport(opts2) {
86337
86704
  _class_call_check(this, Transport);
86338
86705
  var _this;
86339
86706
  _this = _call_super(this, Transport);
86340
86707
  _this.writable = false;
86341
- installTimerFunctions(_this, opts);
86342
- _this.opts = opts;
86343
- _this.query = opts.query;
86344
- _this.socket = opts.socket;
86345
- _this.supportsBinary = !opts.forceBase64;
86708
+ installTimerFunctions(_this, opts2);
86709
+ _this.opts = opts2;
86710
+ _this.query = opts2.query;
86711
+ _this.socket = opts2.socket;
86712
+ _this.supportsBinary = !opts2.forceBase64;
86346
86713
  return _this;
86347
86714
  }
86348
86715
  _create_class(Transport, [
@@ -86656,11 +87023,11 @@ var hasCORS = value;
86656
87023
  function empty() {}
86657
87024
  var BaseXHR = /*#__PURE__*/ function(Polling) {
86658
87025
  _inherits(BaseXHR, Polling);
86659
- function BaseXHR(opts) {
87026
+ function BaseXHR(opts2) {
86660
87027
  _class_call_check(this, BaseXHR);
86661
87028
  var _this;
86662
87029
  _this = _call_super(this, BaseXHR, [
86663
- opts
87030
+ opts2
86664
87031
  ]);
86665
87032
  if (typeof location !== "undefined") {
86666
87033
  var isSSL = "https:" === location.protocol;
@@ -86668,7 +87035,7 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
86668
87035
  if (!port) {
86669
87036
  port = isSSL ? "443" : "80";
86670
87037
  }
86671
- _this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port;
87038
+ _this.xd = typeof location !== "undefined" && opts2.hostname !== location.hostname || port !== opts2.port;
86672
87039
  }
86673
87040
  return _this;
86674
87041
  }
@@ -86714,16 +87081,16 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
86714
87081
  }(Polling);
86715
87082
  var Request2 = /*#__PURE__*/ function(Emitter) {
86716
87083
  _inherits(_Request, Emitter);
86717
- function _Request(createRequest, uri, opts) {
87084
+ function _Request(createRequest, uri, opts2) {
86718
87085
  _class_call_check(this, _Request);
86719
87086
  var _this;
86720
87087
  _this = _call_super(this, _Request);
86721
87088
  _this.createRequest = createRequest;
86722
- installTimerFunctions(_this, opts);
86723
- _this._opts = opts;
86724
- _this._method = opts.method || "GET";
87089
+ installTimerFunctions(_this, opts2);
87090
+ _this._opts = opts2;
87091
+ _this._method = opts2.method || "GET";
86725
87092
  _this._uri = uri;
86726
- _this._data = void 0 !== opts.data ? opts.data : null;
87093
+ _this._data = void 0 !== opts2.data ? opts2.data : null;
86727
87094
  _this._create();
86728
87095
  return _this;
86729
87096
  }
@@ -86737,9 +87104,9 @@ var Request2 = /*#__PURE__*/ function(Emitter) {
86737
87104
  value: function _create() {
86738
87105
  var _this = this;
86739
87106
  var _a;
86740
- var opts = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
86741
- opts.xdomain = !!this._opts.xd;
86742
- var xhr = this._xhr = this.createRequest(opts);
87107
+ var opts2 = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
87108
+ opts2.xdomain = !!this._opts.xd;
87109
+ var xhr = this._xhr = this.createRequest(opts2);
86743
87110
  try {
86744
87111
  xhr.open(this._method, this._uri, true);
86745
87112
  try {
@@ -86881,13 +87248,13 @@ var hasXHR2 = function() {
86881
87248
  }();
86882
87249
  var XHR = /*#__PURE__*/ function(BaseXHR) {
86883
87250
  _inherits(XHR, BaseXHR);
86884
- function XHR(opts) {
87251
+ function XHR(opts2) {
86885
87252
  _class_call_check(this, XHR);
86886
87253
  var _this;
86887
87254
  _this = _call_super(this, XHR, [
86888
- opts
87255
+ opts2
86889
87256
  ]);
86890
- var forceBase64 = opts && opts.forceBase64;
87257
+ var forceBase64 = opts2 && opts2.forceBase64;
86891
87258
  _this.supportsBinary = hasXHR2 && !forceBase64;
86892
87259
  return _this;
86893
87260
  }
@@ -86895,18 +87262,18 @@ var XHR = /*#__PURE__*/ function(BaseXHR) {
86895
87262
  {
86896
87263
  key: "request",
86897
87264
  value: function request() {
86898
- var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
86899
- Object.assign(opts, {
87265
+ var opts2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
87266
+ Object.assign(opts2, {
86900
87267
  xd: this.xd
86901
87268
  }, this.opts);
86902
- return new Request2(newRequest, this.uri(), opts);
87269
+ return new Request2(newRequest, this.uri(), opts2);
86903
87270
  }
86904
87271
  }
86905
87272
  ]);
86906
87273
  return XHR;
86907
87274
  }(BaseXHR);
86908
- function newRequest(opts) {
86909
- var xdomain = opts.xdomain;
87275
+ function newRequest(opts2) {
87276
+ var xdomain = opts2.xdomain;
86910
87277
  try {
86911
87278
  if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
86912
87279
  return new XMLHttpRequest();
@@ -86940,12 +87307,12 @@ var BaseWS = /*#__PURE__*/ function(Transport) {
86940
87307
  value: function doOpen() {
86941
87308
  var uri = this.uri();
86942
87309
  var protocols = this.opts.protocols;
86943
- var opts = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
87310
+ var opts2 = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
86944
87311
  if (this.opts.extraHeaders) {
86945
- opts.headers = this.opts.extraHeaders;
87312
+ opts2.headers = this.opts.extraHeaders;
86946
87313
  }
86947
87314
  try {
86948
- this.ws = this.createSocket(uri, protocols, opts);
87315
+ this.ws = this.createSocket(uri, protocols, opts2);
86949
87316
  } catch (err) {
86950
87317
  return this.emitReserved("error", err);
86951
87318
  }
@@ -87045,8 +87412,8 @@ var WS = /*#__PURE__*/ function(BaseWS) {
87045
87412
  _create_class(WS, [
87046
87413
  {
87047
87414
  key: "createSocket",
87048
- value: function createSocket(uri, protocols, opts) {
87049
- return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols, opts);
87415
+ value: function createSocket(uri, protocols, opts2) {
87416
+ return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols, opts2);
87050
87417
  }
87051
87418
  },
87052
87419
  {
@@ -87224,7 +87591,7 @@ if (withEventListeners) {
87224
87591
  }
87225
87592
  var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
87226
87593
  _inherits(_SocketWithoutUpgrade, Emitter);
87227
- function _SocketWithoutUpgrade(uri, opts) {
87594
+ function _SocketWithoutUpgrade(uri, opts2) {
87228
87595
  _class_call_check(this, _SocketWithoutUpgrade);
87229
87596
  var _this;
87230
87597
  _this = _call_super(this, _SocketWithoutUpgrade);
@@ -87236,28 +87603,28 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
87236
87603
  _this._maxPayload = -1;
87237
87604
  _this._pingTimeoutTime = Infinity;
87238
87605
  if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
87239
- opts = uri;
87606
+ opts2 = uri;
87240
87607
  uri = null;
87241
87608
  }
87242
87609
  if (uri) {
87243
87610
  var parsedUri = parse2(uri);
87244
- opts.hostname = parsedUri.host;
87245
- opts.secure = parsedUri.protocol === "https" || parsedUri.protocol === "wss";
87246
- opts.port = parsedUri.port;
87247
- if (parsedUri.query) opts.query = parsedUri.query;
87248
- } else if (opts.host) {
87249
- opts.hostname = parse2(opts.host).host;
87250
- }
87251
- installTimerFunctions(_this, opts);
87252
- _this.secure = null != opts.secure ? opts.secure : typeof location !== "undefined" && "https:" === location.protocol;
87253
- if (opts.hostname && !opts.port) {
87254
- opts.port = _this.secure ? "443" : "80";
87255
- }
87256
- _this.hostname = opts.hostname || (typeof location !== "undefined" ? location.hostname : "localhost");
87257
- _this.port = opts.port || (typeof location !== "undefined" && location.port ? location.port : _this.secure ? "443" : "80");
87611
+ opts2.hostname = parsedUri.host;
87612
+ opts2.secure = parsedUri.protocol === "https" || parsedUri.protocol === "wss";
87613
+ opts2.port = parsedUri.port;
87614
+ if (parsedUri.query) opts2.query = parsedUri.query;
87615
+ } else if (opts2.host) {
87616
+ opts2.hostname = parse2(opts2.host).host;
87617
+ }
87618
+ installTimerFunctions(_this, opts2);
87619
+ _this.secure = null != opts2.secure ? opts2.secure : typeof location !== "undefined" && "https:" === location.protocol;
87620
+ if (opts2.hostname && !opts2.port) {
87621
+ opts2.port = _this.secure ? "443" : "80";
87622
+ }
87623
+ _this.hostname = opts2.hostname || (typeof location !== "undefined" ? location.hostname : "localhost");
87624
+ _this.port = opts2.port || (typeof location !== "undefined" && location.port ? location.port : _this.secure ? "443" : "80");
87258
87625
  _this.transports = [];
87259
87626
  _this._transportsByName = {};
87260
- opts.transports.forEach(function(t2) {
87627
+ opts2.transports.forEach(function(t2) {
87261
87628
  var transportName = t2.prototype.name;
87262
87629
  _this.transports.push(transportName);
87263
87630
  _this._transportsByName[transportName] = t2;
@@ -87276,7 +87643,7 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
87276
87643
  },
87277
87644
  transportOptions: {},
87278
87645
  closeOnBeforeunload: false
87279
- }, opts);
87646
+ }, opts2);
87280
87647
  _this.opts.path = _this.opts.path.replace(/\/$/, "") + (_this.opts.addTrailingSlash ? "/" : "");
87281
87648
  if (typeof _this.opts.query === "string") {
87282
87649
  _this.opts.query = decode2(_this.opts.query);
@@ -87320,14 +87687,14 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
87320
87687
  query.EIO = protocol;
87321
87688
  query.transport = name;
87322
87689
  if (this.id) query.sid = this.id;
87323
- var opts = Object.assign({}, this.opts, {
87690
+ var opts2 = Object.assign({}, this.opts, {
87324
87691
  query: query,
87325
87692
  socket: this,
87326
87693
  hostname: this.hostname,
87327
87694
  secure: this.secure,
87328
87695
  port: this.port
87329
87696
  }, this.opts.transportOptions[name]);
87330
- return new this._transportsByName[name](opts);
87697
+ return new this._transportsByName[name](opts2);
87331
87698
  }
87332
87699
  },
87333
87700
  {
@@ -87829,9 +88196,9 @@ var SocketWithUpgrade = /*#__PURE__*/ function(SocketWithoutUpgrade1) {
87829
88196
  var Socket = /*#__PURE__*/ function(SocketWithUpgrade) {
87830
88197
  _inherits(Socket, SocketWithUpgrade);
87831
88198
  function Socket(uri) {
87832
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
88199
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
87833
88200
  _class_call_check(this, Socket);
87834
- var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri : opts;
88201
+ var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri : opts2;
87835
88202
  if (!o2.transports || o2.transports && typeof o2.transports[0] === "string") {
87836
88203
  o2.transports = (o2.transports || [
87837
88204
  "polling",
@@ -88305,7 +88672,7 @@ var RESERVED_EVENTS2 = Object.freeze({
88305
88672
  });
88306
88673
  var Socket2 = /*#__PURE__*/ function(Emitter) {
88307
88674
  _inherits(Socket2, Emitter);
88308
- function Socket2(io, nsp, opts) {
88675
+ function Socket2(io, nsp, opts2) {
88309
88676
  _class_call_check(this, Socket2);
88310
88677
  var _this;
88311
88678
  _this = _call_super(this, Socket2);
@@ -88320,10 +88687,10 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
88320
88687
  _this.flags = {};
88321
88688
  _this.io = io;
88322
88689
  _this.nsp = nsp;
88323
- if (opts && opts.auth) {
88324
- _this.auth = opts.auth;
88690
+ if (opts2 && opts2.auth) {
88691
+ _this.auth = opts2.auth;
88325
88692
  }
88326
- _this._opts = Object.assign({}, opts);
88693
+ _this._opts = Object.assign({}, opts2);
88327
88694
  if (_this.io._autoConnect) _this.open();
88328
88695
  return _this;
88329
88696
  }
@@ -89221,12 +89588,12 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
89221
89588
  return Socket2;
89222
89589
  }(Emitter);
89223
89590
  // node_modules/socket.io-client/build/esm/contrib/backo2.js
89224
- function Backoff(opts) {
89225
- opts = opts || {};
89226
- this.ms = opts.min || 100;
89227
- this.max = opts.max || 1e4;
89228
- this.factor = opts.factor || 2;
89229
- this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
89591
+ function Backoff(opts2) {
89592
+ opts2 = opts2 || {};
89593
+ this.ms = opts2.min || 100;
89594
+ this.max = opts2.max || 1e4;
89595
+ this.factor = opts2.factor || 2;
89596
+ this.jitter = opts2.jitter > 0 && opts2.jitter <= 1 ? opts2.jitter : 0;
89230
89597
  this.attempts = 0;
89231
89598
  }
89232
89599
  Backoff.prototype.duration = function() {
@@ -89253,7 +89620,7 @@ Backoff.prototype.setJitter = function(jitter) {
89253
89620
  // node_modules/socket.io-client/build/esm/manager.js
89254
89621
  var Manager = /*#__PURE__*/ function(Emitter) {
89255
89622
  _inherits(Manager, Emitter);
89256
- function Manager(uri, opts) {
89623
+ function Manager(uri, opts2) {
89257
89624
  _class_call_check(this, Manager);
89258
89625
  var _this;
89259
89626
  var _a;
@@ -89261,30 +89628,30 @@ var Manager = /*#__PURE__*/ function(Emitter) {
89261
89628
  _this.nsps = {};
89262
89629
  _this.subs = [];
89263
89630
  if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
89264
- opts = uri;
89631
+ opts2 = uri;
89265
89632
  uri = void 0;
89266
89633
  }
89267
- opts = opts || {};
89268
- opts.path = opts.path || "/socket.io";
89269
- _this.opts = opts;
89270
- installTimerFunctions(_this, opts);
89271
- _this.reconnection(opts.reconnection !== false);
89272
- _this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
89273
- _this.reconnectionDelay(opts.reconnectionDelay || 1e3);
89274
- _this.reconnectionDelayMax(opts.reconnectionDelayMax || 5e3);
89275
- _this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);
89634
+ opts2 = opts2 || {};
89635
+ opts2.path = opts2.path || "/socket.io";
89636
+ _this.opts = opts2;
89637
+ installTimerFunctions(_this, opts2);
89638
+ _this.reconnection(opts2.reconnection !== false);
89639
+ _this.reconnectionAttempts(opts2.reconnectionAttempts || Infinity);
89640
+ _this.reconnectionDelay(opts2.reconnectionDelay || 1e3);
89641
+ _this.reconnectionDelayMax(opts2.reconnectionDelayMax || 5e3);
89642
+ _this.randomizationFactor((_a = opts2.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);
89276
89643
  _this.backoff = new Backoff({
89277
89644
  min: _this.reconnectionDelay(),
89278
89645
  max: _this.reconnectionDelayMax(),
89279
89646
  jitter: _this.randomizationFactor()
89280
89647
  });
89281
- _this.timeout(null == opts.timeout ? 2e4 : opts.timeout);
89648
+ _this.timeout(null == opts2.timeout ? 2e4 : opts2.timeout);
89282
89649
  _this._readyState = "closed";
89283
89650
  _this.uri = uri;
89284
- var _parser = opts.parser || esm_exports2;
89651
+ var _parser = opts2.parser || esm_exports2;
89285
89652
  _this.encoder = new _parser.Encoder();
89286
89653
  _this.decoder = new _parser.Decoder();
89287
- _this._autoConnect = opts.autoConnect !== false;
89654
+ _this._autoConnect = opts2.autoConnect !== false;
89288
89655
  if (_this._autoConnect) _this.open();
89289
89656
  return _this;
89290
89657
  }
@@ -89489,10 +89856,10 @@ var Manager = /*#__PURE__*/ function(Emitter) {
89489
89856
  * @return {Socket}
89490
89857
  * @public
89491
89858
  */ key: "socket",
89492
- value: function socket(nsp, opts) {
89859
+ value: function socket(nsp, opts2) {
89493
89860
  var socket = this.nsps[nsp];
89494
89861
  if (!socket) {
89495
- socket = new Socket2(this, nsp, opts);
89862
+ socket = new Socket2(this, nsp, opts2);
89496
89863
  this.nsps[nsp] = socket;
89497
89864
  } else if (this._autoConnect && !socket.active) {
89498
89865
  socket.connect();
@@ -89665,31 +90032,31 @@ var Manager = /*#__PURE__*/ function(Emitter) {
89665
90032
  }(Emitter);
89666
90033
  // node_modules/socket.io-client/build/esm/index.js
89667
90034
  var cache = {};
89668
- function lookup2(uri, opts) {
90035
+ function lookup2(uri, opts2) {
89669
90036
  if ((typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object") {
89670
- opts = uri;
90037
+ opts2 = uri;
89671
90038
  uri = void 0;
89672
90039
  }
89673
- opts = opts || {};
89674
- var parsed = url(uri, opts.path || "/socket.io");
90040
+ opts2 = opts2 || {};
90041
+ var parsed = url(uri, opts2.path || "/socket.io");
89675
90042
  var source = parsed.source;
89676
90043
  var id = parsed.id;
89677
90044
  var path = parsed.path;
89678
90045
  var sameNamespace = cache[id] && path in cache[id]["nsps"];
89679
- var newConnection = opts.forceNew || opts["force new connection"] || false === opts.multiplex || sameNamespace;
90046
+ var newConnection = opts2.forceNew || opts2["force new connection"] || false === opts2.multiplex || sameNamespace;
89680
90047
  var io;
89681
90048
  if (newConnection) {
89682
- io = new Manager(source, opts);
90049
+ io = new Manager(source, opts2);
89683
90050
  } else {
89684
90051
  if (!cache[id]) {
89685
- cache[id] = new Manager(source, opts);
90052
+ cache[id] = new Manager(source, opts2);
89686
90053
  }
89687
90054
  io = cache[id];
89688
90055
  }
89689
- if (parsed.query && !opts.query) {
89690
- opts.query = parsed.queryKey;
90056
+ if (parsed.query && !opts2.query) {
90057
+ opts2.query = parsed.queryKey;
89691
90058
  }
89692
- return io.socket(parsed.path, opts);
90059
+ return io.socket(parsed.path, opts2);
89693
90060
  }
89694
90061
  Object.assign(lookup2, {
89695
90062
  Manager: Manager,