@brndts/brndts-ads 1.14.18 → 1.14.20
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 +135 -131
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +135 -131
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -55196,18 +55196,18 @@ var BrowserClient = /*#__PURE__*/ function(BaseClient) {
|
|
55196
55196
|
function BrowserClient(options) {
|
55197
55197
|
_class_call_check(this, BrowserClient);
|
55198
55198
|
var _this;
|
55199
|
-
var
|
55199
|
+
var opts = _object_spread({
|
55200
55200
|
// We default this to true, as it is the safer scenario
|
55201
55201
|
parentSpanIsAlwaysRootSpan: true
|
55202
55202
|
}, options);
|
55203
55203
|
var sdkSource = WINDOW4.SENTRY_SDK_SOURCE || getSDKSource();
|
55204
|
-
applySdkMetadata(
|
55204
|
+
applySdkMetadata(opts, "browser", [
|
55205
55205
|
"browser"
|
55206
55206
|
], sdkSource);
|
55207
55207
|
_this = _call_super(this, BrowserClient, [
|
55208
|
-
|
55208
|
+
opts
|
55209
55209
|
]);
|
55210
|
-
if (
|
55210
|
+
if (opts.sendClientReports && WINDOW4.document) {
|
55211
55211
|
WINDOW4.document.addEventListener("visibilitychange", function() {
|
55212
55212
|
if (WINDOW4.document.visibilityState === "hidden") {
|
55213
55213
|
_this._flushOutcomes();
|
@@ -55341,7 +55341,7 @@ var initMetric = function(name, value2) {
|
|
55341
55341
|
};
|
55342
55342
|
};
|
55343
55343
|
// node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js
|
55344
|
-
var observe = function(type, callback,
|
55344
|
+
var observe = function(type, callback, opts) {
|
55345
55345
|
try {
|
55346
55346
|
if (PerformanceObserver.supportedEntryTypes.includes(type)) {
|
55347
55347
|
var po2 = new PerformanceObserver(function(list) {
|
@@ -55352,7 +55352,7 @@ var observe = function(type, callback, opts2) {
|
|
55352
55352
|
po2.observe(Object.assign({
|
55353
55353
|
type: type,
|
55354
55354
|
buffered: true
|
55355
|
-
},
|
55355
|
+
}, opts || {}));
|
55356
55356
|
return po2;
|
55357
55357
|
}
|
55358
55358
|
} catch (e2) {}
|
@@ -55426,7 +55426,7 @@ var FCPThresholds = [
|
|
55426
55426
|
3e3
|
55427
55427
|
];
|
55428
55428
|
var onFCP = function(onReport) {
|
55429
|
-
var
|
55429
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55430
55430
|
whenActivated(function() {
|
55431
55431
|
var visibilityWatcher = getVisibilityWatcher();
|
55432
55432
|
var metric = initMetric("FCP");
|
@@ -55445,7 +55445,7 @@ var onFCP = function(onReport) {
|
|
55445
55445
|
};
|
55446
55446
|
var po2 = observe("paint", handleEntries);
|
55447
55447
|
if (po2) {
|
55448
|
-
report = bindReporter(onReport, metric, FCPThresholds,
|
55448
|
+
report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges);
|
55449
55449
|
}
|
55450
55450
|
});
|
55451
55451
|
};
|
@@ -55455,7 +55455,7 @@ var CLSThresholds = [
|
|
55455
55455
|
0.25
|
55456
55456
|
];
|
55457
55457
|
var onCLS = function(onReport) {
|
55458
|
-
var
|
55458
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55459
55459
|
onFCP(runOnce(function() {
|
55460
55460
|
var metric = initMetric("CLS", 0);
|
55461
55461
|
var report;
|
@@ -55485,7 +55485,7 @@ var onCLS = function(onReport) {
|
|
55485
55485
|
};
|
55486
55486
|
var po2 = observe("layout-shift", handleEntries);
|
55487
55487
|
if (po2) {
|
55488
|
-
report = bindReporter(onReport, metric, CLSThresholds,
|
55488
|
+
report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges);
|
55489
55489
|
onHidden(function() {
|
55490
55490
|
handleEntries(po2.takeRecords());
|
55491
55491
|
report(true);
|
@@ -55500,7 +55500,7 @@ var FIDThresholds = [
|
|
55500
55500
|
300
|
55501
55501
|
];
|
55502
55502
|
var onFID = function(onReport) {
|
55503
|
-
var
|
55503
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55504
55504
|
whenActivated(function() {
|
55505
55505
|
var visibilityWatcher = getVisibilityWatcher();
|
55506
55506
|
var metric = initMetric("FID");
|
@@ -55516,7 +55516,7 @@ var onFID = function(onReport) {
|
|
55516
55516
|
entries.forEach(handleEntry);
|
55517
55517
|
};
|
55518
55518
|
var po2 = observe("first-input", handleEntries);
|
55519
|
-
report = bindReporter(onReport, metric, FIDThresholds,
|
55519
|
+
report = bindReporter(onReport, metric, FIDThresholds, opts.reportAllChanges);
|
55520
55520
|
if (po2) {
|
55521
55521
|
onHidden(runOnce(function() {
|
55522
55522
|
handleEntries(po2.takeRecords());
|
@@ -55621,7 +55621,7 @@ var INPThresholds = [
|
|
55621
55621
|
500
|
55622
55622
|
];
|
55623
55623
|
var onINP = function(onReport) {
|
55624
|
-
var
|
55624
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55625
55625
|
if (!("PerformanceEventTiming" in WINDOW5 && "interactionId" in PerformanceEventTiming.prototype)) {
|
55626
55626
|
return;
|
55627
55627
|
}
|
@@ -55647,9 +55647,9 @@ var onINP = function(onReport) {
|
|
55647
55647
|
// and performance. Running this callback for any interaction that spans
|
55648
55648
|
// just one or two frames is likely not worth the insight that could be
|
55649
55649
|
// gained.
|
55650
|
-
durationThreshold:
|
55650
|
+
durationThreshold: opts.durationThreshold != null ? opts.durationThreshold : DEFAULT_DURATION_THRESHOLD
|
55651
55651
|
});
|
55652
|
-
report = bindReporter(onReport, metric, INPThresholds,
|
55652
|
+
report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges);
|
55653
55653
|
if (po2) {
|
55654
55654
|
po2.observe({
|
55655
55655
|
type: "first-input",
|
@@ -55669,13 +55669,13 @@ var LCPThresholds = [
|
|
55669
55669
|
];
|
55670
55670
|
var reportedMetricIDs = {};
|
55671
55671
|
var onLCP = function(onReport) {
|
55672
|
-
var
|
55672
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55673
55673
|
whenActivated(function() {
|
55674
55674
|
var visibilityWatcher = getVisibilityWatcher();
|
55675
55675
|
var metric = initMetric("LCP");
|
55676
55676
|
var report;
|
55677
55677
|
var handleEntries = function(entries) {
|
55678
|
-
if (!
|
55678
|
+
if (!opts.reportAllChanges) {
|
55679
55679
|
entries = entries.slice(-1);
|
55680
55680
|
}
|
55681
55681
|
entries.forEach(function(entry) {
|
@@ -55690,7 +55690,7 @@ var onLCP = function(onReport) {
|
|
55690
55690
|
};
|
55691
55691
|
var po2 = observe("largest-contentful-paint", handleEntries);
|
55692
55692
|
if (po2) {
|
55693
|
-
report = bindReporter(onReport, metric, LCPThresholds,
|
55693
|
+
report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges);
|
55694
55694
|
var stopListening = runOnce(function() {
|
55695
55695
|
if (!reportedMetricIDs[metric.id]) {
|
55696
55696
|
handleEntries(po2.takeRecords());
|
@@ -55735,9 +55735,9 @@ var whenReady = function(callback) {
|
|
55735
55735
|
}
|
55736
55736
|
};
|
55737
55737
|
var onTTFB = function(onReport) {
|
55738
|
-
var
|
55738
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
55739
55739
|
var metric = initMetric("TTFB");
|
55740
|
-
var report = bindReporter(onReport, metric, TTFBThresholds,
|
55740
|
+
var report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges);
|
55741
55741
|
whenReady(function() {
|
55742
55742
|
var navigationEntry = getNavigationEntry();
|
55743
55743
|
if (navigationEntry) {
|
@@ -62849,9 +62849,9 @@ function makeReplayLogger() {
|
|
62849
62849
|
infoTick: function() {
|
62850
62850
|
return void 0;
|
62851
62851
|
},
|
62852
|
-
setConfig: function(
|
62853
|
-
_capture =
|
62854
|
-
_trace =
|
62852
|
+
setConfig: function(opts) {
|
62853
|
+
_capture = opts.captureExceptions;
|
62854
|
+
_trace = opts.traceInternals;
|
62855
62855
|
}
|
62856
62856
|
};
|
62857
62857
|
if (DEBUG_BUILD5) {
|
@@ -69402,9 +69402,9 @@ var RegionMaskPlugin = /*#__PURE__*/ function() {
|
|
69402
69402
|
// src/Ads/Regions/Plugins/Border/RegionBorderPlugin.ts
|
69403
69403
|
var RegionBorderPlugin = /*#__PURE__*/ function() {
|
69404
69404
|
"use strict";
|
69405
|
-
function RegionBorderPlugin(
|
69405
|
+
function RegionBorderPlugin(opts) {
|
69406
69406
|
_class_call_check(this, RegionBorderPlugin);
|
69407
|
-
this.options =
|
69407
|
+
this.options = opts;
|
69408
69408
|
}
|
69409
69409
|
_create_class(RegionBorderPlugin, [
|
69410
69410
|
{
|
@@ -69889,10 +69889,6 @@ var RULES = {
|
|
69889
69889
|
[
|
69890
69890
|
728,
|
69891
69891
|
90
|
69892
|
-
],
|
69893
|
-
[
|
69894
|
-
468,
|
69895
|
-
60
|
69896
69892
|
]
|
69897
69893
|
],
|
69898
69894
|
"desktop": [
|
@@ -69979,6 +69975,10 @@ var RULES = {
|
|
69979
69975
|
[
|
69980
69976
|
200,
|
69981
69977
|
200
|
69978
|
+
],
|
69979
|
+
[
|
69980
|
+
180,
|
69981
|
+
150
|
69982
69982
|
]
|
69983
69983
|
],
|
69984
69984
|
"desktop": [
|
@@ -69993,6 +69993,10 @@ var RULES = {
|
|
69993
69993
|
[
|
69994
69994
|
200,
|
69995
69995
|
200
|
69996
|
+
],
|
69997
|
+
[
|
69998
|
+
180,
|
69999
|
+
150
|
69996
70000
|
]
|
69997
70001
|
],
|
69998
70002
|
"tablet": [
|
@@ -72590,7 +72594,7 @@ var GPT = /*#__PURE__*/ function() {
|
|
72590
72594
|
},
|
72591
72595
|
{
|
72592
72596
|
key: "defineSlot",
|
72593
|
-
value: function defineSlot(slotId, size, containerId,
|
72597
|
+
value: function defineSlot(slotId, size, containerId, opts) {
|
72594
72598
|
window.googletag.cmd.push(function() {
|
72595
72599
|
if (window.googletag.pubads().getSlots().some(function(slot) {
|
72596
72600
|
return slot.getSlotElementId() === containerId;
|
@@ -72599,9 +72603,9 @@ var GPT = /*#__PURE__*/ function() {
|
|
72599
72603
|
}
|
72600
72604
|
var mrec1 = window.googletag.defineSlot(slotId, size, "".concat(containerId)).addService(window.googletag.pubads());
|
72601
72605
|
var mrecmapping;
|
72602
|
-
if (
|
72606
|
+
if (opts === null || opts === void 0 ? void 0 : opts.mapping) {
|
72603
72607
|
mrecmapping = window.googletag.sizeMapping();
|
72604
|
-
var sortedBreakpoints = Object.keys(
|
72608
|
+
var sortedBreakpoints = Object.keys(opts.mapping).sort(function(a, b) {
|
72605
72609
|
return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
|
72606
72610
|
});
|
72607
72611
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
@@ -72611,7 +72615,7 @@ var GPT = /*#__PURE__*/ function() {
|
|
72611
72615
|
mrecmapping = mrecmapping.addSize([
|
72612
72616
|
RegionDefinitions.BREAKPOINTS[bp],
|
72613
72617
|
0
|
72614
|
-
],
|
72618
|
+
], opts.mapping[bp]);
|
72615
72619
|
}
|
72616
72620
|
} catch (err) {
|
72617
72621
|
_didIteratorError = true;
|
@@ -72629,7 +72633,7 @@ var GPT = /*#__PURE__*/ function() {
|
|
72629
72633
|
}
|
72630
72634
|
mrecmapping = mrecmapping.build();
|
72631
72635
|
} else {
|
72632
|
-
window.googletag.sizeMapping().addSize([
|
72636
|
+
mrecmapping = window.googletag.sizeMapping().addSize([
|
72633
72637
|
1024,
|
72634
72638
|
0
|
72635
72639
|
], size).addSize([
|
@@ -72644,9 +72648,9 @@ var GPT = /*#__PURE__*/ function() {
|
|
72644
72648
|
], []).build();
|
72645
72649
|
}
|
72646
72650
|
mrec1 === null || mrec1 === void 0 ? void 0 : mrec1.defineSizeMapping(mrecmapping);
|
72647
|
-
if (
|
72651
|
+
if (opts === null || opts === void 0 ? void 0 : opts.targeting) {
|
72648
72652
|
mrec1.setConfig({
|
72649
|
-
targeting:
|
72653
|
+
targeting: opts === null || opts === void 0 ? void 0 : opts.targeting
|
72650
72654
|
});
|
72651
72655
|
}
|
72652
72656
|
});
|
@@ -72822,7 +72826,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
|
|
72822
72826
|
RegionDefinitions.BREAKPOINTS[bp],
|
72823
72827
|
0
|
72824
72828
|
],
|
72825
|
-
sizes:
|
72829
|
+
sizes: mapping[bp]
|
72826
72830
|
});
|
72827
72831
|
}
|
72828
72832
|
} catch (err) {
|
@@ -80719,7 +80723,7 @@ var CooldownPresentation = /*#__PURE__*/ function(AbstractPresentation) {
|
|
80719
80723
|
},
|
80720
80724
|
{
|
80721
80725
|
key: "startedPresentation",
|
80722
|
-
value: function startedPresentation(
|
80726
|
+
value: function startedPresentation(opts) {
|
80723
80727
|
this.stopRetry();
|
80724
80728
|
this.emit("pace");
|
80725
80729
|
this.presentationTimer.resume();
|
@@ -80955,11 +80959,11 @@ var DynamicDurationPresentation = /*#__PURE__*/ function(AbstractPresentation) {
|
|
80955
80959
|
},
|
80956
80960
|
{
|
80957
80961
|
key: "startedPresentation",
|
80958
|
-
value: function startedPresentation(
|
80962
|
+
value: function startedPresentation(opts) {
|
80959
80963
|
this.stopRetry();
|
80960
80964
|
this.startPacing();
|
80961
|
-
if (
|
80962
|
-
this.presentationTimer.setDuration(
|
80965
|
+
if (opts.expectedDuration && !this.presentationTimer.isPaused) {
|
80966
|
+
this.presentationTimer.setDuration(opts.expectedDuration * 1e3);
|
80963
80967
|
}
|
80964
80968
|
this.presentationTimer.resume();
|
80965
80969
|
}
|
@@ -86776,8 +86780,8 @@ function pick(obj) {
|
|
86776
86780
|
}
|
86777
86781
|
var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout;
|
86778
86782
|
var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
|
86779
|
-
function installTimerFunctions(obj,
|
86780
|
-
if (
|
86783
|
+
function installTimerFunctions(obj, opts) {
|
86784
|
+
if (opts.useNativeTimers) {
|
86781
86785
|
obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
|
86782
86786
|
obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
|
86783
86787
|
} else {
|
@@ -86852,16 +86856,16 @@ var TransportError = /*#__PURE__*/ function(Error1) {
|
|
86852
86856
|
var Transport = /*#__PURE__*/ function(Emitter) {
|
86853
86857
|
"use strict";
|
86854
86858
|
_inherits(Transport, Emitter);
|
86855
|
-
function Transport(
|
86859
|
+
function Transport(opts) {
|
86856
86860
|
_class_call_check(this, Transport);
|
86857
86861
|
var _this;
|
86858
86862
|
_this = _call_super(this, Transport);
|
86859
86863
|
_this.writable = false;
|
86860
|
-
installTimerFunctions(_this,
|
86861
|
-
_this.opts =
|
86862
|
-
_this.query =
|
86863
|
-
_this.socket =
|
86864
|
-
_this.supportsBinary = !
|
86864
|
+
installTimerFunctions(_this, opts);
|
86865
|
+
_this.opts = opts;
|
86866
|
+
_this.query = opts.query;
|
86867
|
+
_this.socket = opts.socket;
|
86868
|
+
_this.supportsBinary = !opts.forceBase64;
|
86865
86869
|
return _this;
|
86866
86870
|
}
|
86867
86871
|
_create_class(Transport, [
|
@@ -87177,11 +87181,11 @@ function empty() {}
|
|
87177
87181
|
var BaseXHR = /*#__PURE__*/ function(Polling) {
|
87178
87182
|
"use strict";
|
87179
87183
|
_inherits(BaseXHR, Polling);
|
87180
|
-
function BaseXHR(
|
87184
|
+
function BaseXHR(opts) {
|
87181
87185
|
_class_call_check(this, BaseXHR);
|
87182
87186
|
var _this;
|
87183
87187
|
_this = _call_super(this, BaseXHR, [
|
87184
|
-
|
87188
|
+
opts
|
87185
87189
|
]);
|
87186
87190
|
if (typeof location !== "undefined") {
|
87187
87191
|
var isSSL = "https:" === location.protocol;
|
@@ -87189,7 +87193,7 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
|
|
87189
87193
|
if (!port) {
|
87190
87194
|
port = isSSL ? "443" : "80";
|
87191
87195
|
}
|
87192
|
-
_this.xd = typeof location !== "undefined" &&
|
87196
|
+
_this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port;
|
87193
87197
|
}
|
87194
87198
|
return _this;
|
87195
87199
|
}
|
@@ -87236,16 +87240,16 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
|
|
87236
87240
|
var Request2 = /*#__PURE__*/ function(Emitter) {
|
87237
87241
|
"use strict";
|
87238
87242
|
_inherits(_Request, Emitter);
|
87239
|
-
function _Request(createRequest, uri,
|
87243
|
+
function _Request(createRequest, uri, opts) {
|
87240
87244
|
_class_call_check(this, _Request);
|
87241
87245
|
var _this;
|
87242
87246
|
_this = _call_super(this, _Request);
|
87243
87247
|
_this.createRequest = createRequest;
|
87244
|
-
installTimerFunctions(_this,
|
87245
|
-
_this._opts =
|
87246
|
-
_this._method =
|
87248
|
+
installTimerFunctions(_this, opts);
|
87249
|
+
_this._opts = opts;
|
87250
|
+
_this._method = opts.method || "GET";
|
87247
87251
|
_this._uri = uri;
|
87248
|
-
_this._data = void 0 !==
|
87252
|
+
_this._data = void 0 !== opts.data ? opts.data : null;
|
87249
87253
|
_this._create();
|
87250
87254
|
return _this;
|
87251
87255
|
}
|
@@ -87259,9 +87263,9 @@ var Request2 = /*#__PURE__*/ function(Emitter) {
|
|
87259
87263
|
value: function _create() {
|
87260
87264
|
var _this = this;
|
87261
87265
|
var _a;
|
87262
|
-
var
|
87263
|
-
|
87264
|
-
var xhr = this._xhr = this.createRequest(
|
87266
|
+
var opts = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
|
87267
|
+
opts.xdomain = !!this._opts.xd;
|
87268
|
+
var xhr = this._xhr = this.createRequest(opts);
|
87265
87269
|
try {
|
87266
87270
|
xhr.open(this._method, this._uri, true);
|
87267
87271
|
try {
|
@@ -87404,13 +87408,13 @@ var hasXHR2 = function() {
|
|
87404
87408
|
var XHR = /*#__PURE__*/ function(BaseXHR) {
|
87405
87409
|
"use strict";
|
87406
87410
|
_inherits(XHR, BaseXHR);
|
87407
|
-
function XHR(
|
87411
|
+
function XHR(opts) {
|
87408
87412
|
_class_call_check(this, XHR);
|
87409
87413
|
var _this;
|
87410
87414
|
_this = _call_super(this, XHR, [
|
87411
|
-
|
87415
|
+
opts
|
87412
87416
|
]);
|
87413
|
-
var forceBase64 =
|
87417
|
+
var forceBase64 = opts && opts.forceBase64;
|
87414
87418
|
_this.supportsBinary = hasXHR2 && !forceBase64;
|
87415
87419
|
return _this;
|
87416
87420
|
}
|
@@ -87418,18 +87422,18 @@ var XHR = /*#__PURE__*/ function(BaseXHR) {
|
|
87418
87422
|
{
|
87419
87423
|
key: "request",
|
87420
87424
|
value: function request() {
|
87421
|
-
var
|
87422
|
-
Object.assign(
|
87425
|
+
var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
87426
|
+
Object.assign(opts, {
|
87423
87427
|
xd: this.xd
|
87424
87428
|
}, this.opts);
|
87425
|
-
return new Request2(newRequest, this.uri(),
|
87429
|
+
return new Request2(newRequest, this.uri(), opts);
|
87426
87430
|
}
|
87427
87431
|
}
|
87428
87432
|
]);
|
87429
87433
|
return XHR;
|
87430
87434
|
}(BaseXHR);
|
87431
|
-
function newRequest(
|
87432
|
-
var xdomain =
|
87435
|
+
function newRequest(opts) {
|
87436
|
+
var xdomain = opts.xdomain;
|
87433
87437
|
try {
|
87434
87438
|
if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
|
87435
87439
|
return new XMLHttpRequest();
|
@@ -87464,12 +87468,12 @@ var BaseWS = /*#__PURE__*/ function(Transport) {
|
|
87464
87468
|
value: function doOpen() {
|
87465
87469
|
var uri = this.uri();
|
87466
87470
|
var protocols = this.opts.protocols;
|
87467
|
-
var
|
87471
|
+
var opts = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
|
87468
87472
|
if (this.opts.extraHeaders) {
|
87469
|
-
|
87473
|
+
opts.headers = this.opts.extraHeaders;
|
87470
87474
|
}
|
87471
87475
|
try {
|
87472
|
-
this.ws = this.createSocket(uri, protocols,
|
87476
|
+
this.ws = this.createSocket(uri, protocols, opts);
|
87473
87477
|
} catch (err) {
|
87474
87478
|
return this.emitReserved("error", err);
|
87475
87479
|
}
|
@@ -87570,8 +87574,8 @@ var WS = /*#__PURE__*/ function(BaseWS) {
|
|
87570
87574
|
_create_class(WS, [
|
87571
87575
|
{
|
87572
87576
|
key: "createSocket",
|
87573
|
-
value: function createSocket(uri, protocols,
|
87574
|
-
return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols,
|
87577
|
+
value: function createSocket(uri, protocols, opts) {
|
87578
|
+
return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols, opts);
|
87575
87579
|
}
|
87576
87580
|
},
|
87577
87581
|
{
|
@@ -87751,7 +87755,7 @@ if (withEventListeners) {
|
|
87751
87755
|
var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
87752
87756
|
"use strict";
|
87753
87757
|
_inherits(_SocketWithoutUpgrade, Emitter);
|
87754
|
-
function _SocketWithoutUpgrade(uri,
|
87758
|
+
function _SocketWithoutUpgrade(uri, opts) {
|
87755
87759
|
_class_call_check(this, _SocketWithoutUpgrade);
|
87756
87760
|
var _this;
|
87757
87761
|
_this = _call_super(this, _SocketWithoutUpgrade);
|
@@ -87763,28 +87767,28 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87763
87767
|
_this._maxPayload = -1;
|
87764
87768
|
_this._pingTimeoutTime = Infinity;
|
87765
87769
|
if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
|
87766
|
-
|
87770
|
+
opts = uri;
|
87767
87771
|
uri = null;
|
87768
87772
|
}
|
87769
87773
|
if (uri) {
|
87770
87774
|
var parsedUri = parse2(uri);
|
87771
|
-
|
87772
|
-
|
87773
|
-
|
87774
|
-
if (parsedUri.query)
|
87775
|
-
} else if (
|
87776
|
-
|
87777
|
-
}
|
87778
|
-
installTimerFunctions(_this,
|
87779
|
-
_this.secure = null !=
|
87780
|
-
if (
|
87781
|
-
|
87782
|
-
}
|
87783
|
-
_this.hostname =
|
87784
|
-
_this.port =
|
87775
|
+
opts.hostname = parsedUri.host;
|
87776
|
+
opts.secure = parsedUri.protocol === "https" || parsedUri.protocol === "wss";
|
87777
|
+
opts.port = parsedUri.port;
|
87778
|
+
if (parsedUri.query) opts.query = parsedUri.query;
|
87779
|
+
} else if (opts.host) {
|
87780
|
+
opts.hostname = parse2(opts.host).host;
|
87781
|
+
}
|
87782
|
+
installTimerFunctions(_this, opts);
|
87783
|
+
_this.secure = null != opts.secure ? opts.secure : typeof location !== "undefined" && "https:" === location.protocol;
|
87784
|
+
if (opts.hostname && !opts.port) {
|
87785
|
+
opts.port = _this.secure ? "443" : "80";
|
87786
|
+
}
|
87787
|
+
_this.hostname = opts.hostname || (typeof location !== "undefined" ? location.hostname : "localhost");
|
87788
|
+
_this.port = opts.port || (typeof location !== "undefined" && location.port ? location.port : _this.secure ? "443" : "80");
|
87785
87789
|
_this.transports = [];
|
87786
87790
|
_this._transportsByName = {};
|
87787
|
-
|
87791
|
+
opts.transports.forEach(function(t2) {
|
87788
87792
|
var transportName = t2.prototype.name;
|
87789
87793
|
_this.transports.push(transportName);
|
87790
87794
|
_this._transportsByName[transportName] = t2;
|
@@ -87803,7 +87807,7 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87803
87807
|
},
|
87804
87808
|
transportOptions: {},
|
87805
87809
|
closeOnBeforeunload: false
|
87806
|
-
},
|
87810
|
+
}, opts);
|
87807
87811
|
_this.opts.path = _this.opts.path.replace(/\/$/, "") + (_this.opts.addTrailingSlash ? "/" : "");
|
87808
87812
|
if (typeof _this.opts.query === "string") {
|
87809
87813
|
_this.opts.query = decode2(_this.opts.query);
|
@@ -87847,14 +87851,14 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87847
87851
|
query.EIO = protocol;
|
87848
87852
|
query.transport = name;
|
87849
87853
|
if (this.id) query.sid = this.id;
|
87850
|
-
var
|
87854
|
+
var opts = Object.assign({}, this.opts, {
|
87851
87855
|
query: query,
|
87852
87856
|
socket: this,
|
87853
87857
|
hostname: this.hostname,
|
87854
87858
|
secure: this.secure,
|
87855
87859
|
port: this.port
|
87856
87860
|
}, this.opts.transportOptions[name]);
|
87857
|
-
return new this._transportsByName[name](
|
87861
|
+
return new this._transportsByName[name](opts);
|
87858
87862
|
}
|
87859
87863
|
},
|
87860
87864
|
{
|
@@ -88358,9 +88362,9 @@ var Socket = /*#__PURE__*/ function(SocketWithUpgrade) {
|
|
88358
88362
|
"use strict";
|
88359
88363
|
_inherits(Socket, SocketWithUpgrade);
|
88360
88364
|
function Socket(uri) {
|
88361
|
-
var
|
88365
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
88362
88366
|
_class_call_check(this, Socket);
|
88363
|
-
var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri :
|
88367
|
+
var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri : opts;
|
88364
88368
|
if (!o2.transports || o2.transports && typeof o2.transports[0] === "string") {
|
88365
88369
|
o2.transports = (o2.transports || [
|
88366
88370
|
"polling",
|
@@ -88838,7 +88842,7 @@ var RESERVED_EVENTS2 = Object.freeze({
|
|
88838
88842
|
var Socket2 = /*#__PURE__*/ function(Emitter) {
|
88839
88843
|
"use strict";
|
88840
88844
|
_inherits(Socket2, Emitter);
|
88841
|
-
function Socket2(io, nsp,
|
88845
|
+
function Socket2(io, nsp, opts) {
|
88842
88846
|
_class_call_check(this, Socket2);
|
88843
88847
|
var _this;
|
88844
88848
|
_this = _call_super(this, Socket2);
|
@@ -88853,10 +88857,10 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
|
|
88853
88857
|
_this.flags = {};
|
88854
88858
|
_this.io = io;
|
88855
88859
|
_this.nsp = nsp;
|
88856
|
-
if (
|
88857
|
-
_this.auth =
|
88860
|
+
if (opts && opts.auth) {
|
88861
|
+
_this.auth = opts.auth;
|
88858
88862
|
}
|
88859
|
-
_this._opts = Object.assign({},
|
88863
|
+
_this._opts = Object.assign({}, opts);
|
88860
88864
|
if (_this.io._autoConnect) _this.open();
|
88861
88865
|
return _this;
|
88862
88866
|
}
|
@@ -89754,12 +89758,12 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
|
|
89754
89758
|
return Socket2;
|
89755
89759
|
}(Emitter);
|
89756
89760
|
// node_modules/socket.io-client/build/esm/contrib/backo2.js
|
89757
|
-
function Backoff(
|
89758
|
-
|
89759
|
-
this.ms =
|
89760
|
-
this.max =
|
89761
|
-
this.factor =
|
89762
|
-
this.jitter =
|
89761
|
+
function Backoff(opts) {
|
89762
|
+
opts = opts || {};
|
89763
|
+
this.ms = opts.min || 100;
|
89764
|
+
this.max = opts.max || 1e4;
|
89765
|
+
this.factor = opts.factor || 2;
|
89766
|
+
this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
|
89763
89767
|
this.attempts = 0;
|
89764
89768
|
}
|
89765
89769
|
Backoff.prototype.duration = function() {
|
@@ -89787,7 +89791,7 @@ Backoff.prototype.setJitter = function(jitter) {
|
|
89787
89791
|
var Manager = /*#__PURE__*/ function(Emitter) {
|
89788
89792
|
"use strict";
|
89789
89793
|
_inherits(Manager, Emitter);
|
89790
|
-
function Manager(uri,
|
89794
|
+
function Manager(uri, opts) {
|
89791
89795
|
_class_call_check(this, Manager);
|
89792
89796
|
var _this;
|
89793
89797
|
var _a;
|
@@ -89795,30 +89799,30 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
89795
89799
|
_this.nsps = {};
|
89796
89800
|
_this.subs = [];
|
89797
89801
|
if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
|
89798
|
-
|
89802
|
+
opts = uri;
|
89799
89803
|
uri = void 0;
|
89800
89804
|
}
|
89801
|
-
|
89802
|
-
|
89803
|
-
_this.opts =
|
89804
|
-
installTimerFunctions(_this,
|
89805
|
-
_this.reconnection(
|
89806
|
-
_this.reconnectionAttempts(
|
89807
|
-
_this.reconnectionDelay(
|
89808
|
-
_this.reconnectionDelayMax(
|
89809
|
-
_this.randomizationFactor((_a =
|
89805
|
+
opts = opts || {};
|
89806
|
+
opts.path = opts.path || "/socket.io";
|
89807
|
+
_this.opts = opts;
|
89808
|
+
installTimerFunctions(_this, opts);
|
89809
|
+
_this.reconnection(opts.reconnection !== false);
|
89810
|
+
_this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
|
89811
|
+
_this.reconnectionDelay(opts.reconnectionDelay || 1e3);
|
89812
|
+
_this.reconnectionDelayMax(opts.reconnectionDelayMax || 5e3);
|
89813
|
+
_this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);
|
89810
89814
|
_this.backoff = new Backoff({
|
89811
89815
|
min: _this.reconnectionDelay(),
|
89812
89816
|
max: _this.reconnectionDelayMax(),
|
89813
89817
|
jitter: _this.randomizationFactor()
|
89814
89818
|
});
|
89815
|
-
_this.timeout(null ==
|
89819
|
+
_this.timeout(null == opts.timeout ? 2e4 : opts.timeout);
|
89816
89820
|
_this._readyState = "closed";
|
89817
89821
|
_this.uri = uri;
|
89818
|
-
var _parser =
|
89822
|
+
var _parser = opts.parser || esm_exports2;
|
89819
89823
|
_this.encoder = new _parser.Encoder();
|
89820
89824
|
_this.decoder = new _parser.Decoder();
|
89821
|
-
_this._autoConnect =
|
89825
|
+
_this._autoConnect = opts.autoConnect !== false;
|
89822
89826
|
if (_this._autoConnect) _this.open();
|
89823
89827
|
return _this;
|
89824
89828
|
}
|
@@ -90023,10 +90027,10 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
90023
90027
|
* @return {Socket}
|
90024
90028
|
* @public
|
90025
90029
|
*/ key: "socket",
|
90026
|
-
value: function socket(nsp,
|
90030
|
+
value: function socket(nsp, opts) {
|
90027
90031
|
var socket = this.nsps[nsp];
|
90028
90032
|
if (!socket) {
|
90029
|
-
socket = new Socket2(this, nsp,
|
90033
|
+
socket = new Socket2(this, nsp, opts);
|
90030
90034
|
this.nsps[nsp] = socket;
|
90031
90035
|
} else if (this._autoConnect && !socket.active) {
|
90032
90036
|
socket.connect();
|
@@ -90199,31 +90203,31 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
90199
90203
|
}(Emitter);
|
90200
90204
|
// node_modules/socket.io-client/build/esm/index.js
|
90201
90205
|
var cache = {};
|
90202
|
-
function lookup2(uri,
|
90206
|
+
function lookup2(uri, opts) {
|
90203
90207
|
if ((typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object") {
|
90204
|
-
|
90208
|
+
opts = uri;
|
90205
90209
|
uri = void 0;
|
90206
90210
|
}
|
90207
|
-
|
90208
|
-
var parsed = url(uri,
|
90211
|
+
opts = opts || {};
|
90212
|
+
var parsed = url(uri, opts.path || "/socket.io");
|
90209
90213
|
var source = parsed.source;
|
90210
90214
|
var id = parsed.id;
|
90211
90215
|
var path = parsed.path;
|
90212
90216
|
var sameNamespace = cache[id] && path in cache[id]["nsps"];
|
90213
|
-
var newConnection =
|
90217
|
+
var newConnection = opts.forceNew || opts["force new connection"] || false === opts.multiplex || sameNamespace;
|
90214
90218
|
var io;
|
90215
90219
|
if (newConnection) {
|
90216
|
-
io = new Manager(source,
|
90220
|
+
io = new Manager(source, opts);
|
90217
90221
|
} else {
|
90218
90222
|
if (!cache[id]) {
|
90219
|
-
cache[id] = new Manager(source,
|
90223
|
+
cache[id] = new Manager(source, opts);
|
90220
90224
|
}
|
90221
90225
|
io = cache[id];
|
90222
90226
|
}
|
90223
|
-
if (parsed.query && !
|
90224
|
-
|
90227
|
+
if (parsed.query && !opts.query) {
|
90228
|
+
opts.query = parsed.queryKey;
|
90225
90229
|
}
|
90226
|
-
return io.socket(parsed.path,
|
90230
|
+
return io.socket(parsed.path, opts);
|
90227
90231
|
}
|
90228
90232
|
Object.assign(lookup2, {
|
90229
90233
|
Manager: Manager,
|