@liquidcommercedev/rmn-sdk 1.5.0-beta.47 → 1.5.0-beta.49
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.cjs +844 -334
- package/dist/index.esm.js +844 -334
- package/dist/types/enums.d.ts +3 -0
- package/dist/types/modules/spot-template/rb-template.interface.d.ts +36 -0
- package/dist/types/modules/spot-template/reservebar/carousel-horizontal-short-info-card.template.d.ts +9 -0
- package/dist/types/modules/spot-template/reservebar/carousel-vertical-small-image-info-card.template.d.ts +9 -0
- package/dist/types/modules/spot-template/reservebar/index.d.ts +2 -0
- package/dist/types/rmn-client.d.ts +6 -6
- package/dist/types/types.d.ts +1 -1
- package/package.json +22 -32
- package/umd/liquidcommerce-rmn-sdk.min.js +1 -1
package/dist/index.cjs
CHANGED
@@ -18,6 +18,8 @@ exports.RMN_SPOT_TYPE = void 0;
|
|
18
18
|
RMN_SPOT_TYPE["RB_VIDEO_PLAYER"] = "rbVideoPlayer";
|
19
19
|
RMN_SPOT_TYPE["RB_IN_TEXT"] = "rbInText";
|
20
20
|
RMN_SPOT_TYPE["RB_CAROUSEL_HORIZONTAL_INFO_CARD"] = "rbCarouselHorizontalInfoCard";
|
21
|
+
RMN_SPOT_TYPE["RB_CAROUSEL_VERTICAL_SMALL_IMAGE_INFO_CARD"] = "rbCarouselVerticalSmallImageInfoCard";
|
22
|
+
RMN_SPOT_TYPE["RB_CAROUSEL_HORIZONTAL_SHORT_INFO_CARD"] = "rbCarouselHorizontalShortInfoCard";
|
21
23
|
// IAB Standard Spot Types
|
22
24
|
RMN_SPOT_TYPE["BILLBOARD"] = "billboard";
|
23
25
|
RMN_SPOT_TYPE["LARGE_RECTANGLE"] = "largeRectangle";
|
@@ -92,6 +94,7 @@ exports.ENUM_TEXT_BLOCK_POSITION = void 0;
|
|
92
94
|
ENUM_TEXT_BLOCK_POSITION["TOP"] = "top";
|
93
95
|
ENUM_TEXT_BLOCK_POSITION["BOTTOM"] = "bottom";
|
94
96
|
ENUM_TEXT_BLOCK_POSITION["MIDDLE"] = "middle";
|
97
|
+
ENUM_TEXT_BLOCK_POSITION["CENTER"] = "center";
|
95
98
|
ENUM_TEXT_BLOCK_POSITION["TOP_LEFT"] = "top-left";
|
96
99
|
ENUM_TEXT_BLOCK_POSITION["TOP_RIGHT"] = "top-right";
|
97
100
|
ENUM_TEXT_BLOCK_POSITION["BOTTOM_LEFT"] = "bottom-left";
|
@@ -282,6 +285,7 @@ function bind(fn, thisArg) {
|
|
282
285
|
|
283
286
|
const {toString: toString$1} = Object.prototype;
|
284
287
|
const {getPrototypeOf} = Object;
|
288
|
+
const {iterator, toStringTag} = Symbol;
|
285
289
|
|
286
290
|
const kindOf = (cache => thing => {
|
287
291
|
const str = toString$1.call(thing);
|
@@ -322,7 +326,7 @@ const isUndefined = typeOfTest('undefined');
|
|
322
326
|
*/
|
323
327
|
function isBuffer$1(val) {
|
324
328
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
325
|
-
&& isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
329
|
+
&& isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
326
330
|
}
|
327
331
|
|
328
332
|
/**
|
@@ -367,7 +371,7 @@ const isString = typeOfTest('string');
|
|
367
371
|
* @param {*} val The value to test
|
368
372
|
* @returns {boolean} True if value is a Function, otherwise false
|
369
373
|
*/
|
370
|
-
const isFunction = typeOfTest('function');
|
374
|
+
const isFunction$1 = typeOfTest('function');
|
371
375
|
|
372
376
|
/**
|
373
377
|
* Determine if a value is a Number
|
@@ -408,7 +412,28 @@ const isPlainObject = (val) => {
|
|
408
412
|
}
|
409
413
|
|
410
414
|
const prototype = getPrototypeOf(val);
|
411
|
-
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(
|
415
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
416
|
+
};
|
417
|
+
|
418
|
+
/**
|
419
|
+
* Determine if a value is an empty object (safely handles Buffers)
|
420
|
+
*
|
421
|
+
* @param {*} val The value to test
|
422
|
+
*
|
423
|
+
* @returns {boolean} True if value is an empty object, otherwise false
|
424
|
+
*/
|
425
|
+
const isEmptyObject = (val) => {
|
426
|
+
// Early return for non-objects or Buffers to prevent RangeError
|
427
|
+
if (!isObject$1(val) || isBuffer$1(val)) {
|
428
|
+
return false;
|
429
|
+
}
|
430
|
+
|
431
|
+
try {
|
432
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
433
|
+
} catch (e) {
|
434
|
+
// Fallback for any other objects that might cause RangeError with Object.keys()
|
435
|
+
return false;
|
436
|
+
}
|
412
437
|
};
|
413
438
|
|
414
439
|
/**
|
@@ -454,7 +479,7 @@ const isFileList = kindOfTest('FileList');
|
|
454
479
|
*
|
455
480
|
* @returns {boolean} True if value is a Stream, otherwise false
|
456
481
|
*/
|
457
|
-
const isStream = (val) => isObject$1(val) && isFunction(val.pipe);
|
482
|
+
const isStream = (val) => isObject$1(val) && isFunction$1(val.pipe);
|
458
483
|
|
459
484
|
/**
|
460
485
|
* Determine if a value is a FormData
|
@@ -467,10 +492,10 @@ const isFormData = (thing) => {
|
|
467
492
|
let kind;
|
468
493
|
return thing && (
|
469
494
|
(typeof FormData === 'function' && thing instanceof FormData) || (
|
470
|
-
isFunction(thing.append) && (
|
495
|
+
isFunction$1(thing.append) && (
|
471
496
|
(kind = kindOf(thing)) === 'formdata' ||
|
472
497
|
// detect form-data instance
|
473
|
-
(kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
|
498
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
474
499
|
)
|
475
500
|
)
|
476
501
|
)
|
@@ -533,6 +558,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
533
558
|
fn.call(null, obj[i], i, obj);
|
534
559
|
}
|
535
560
|
} else {
|
561
|
+
// Buffer check
|
562
|
+
if (isBuffer$1(obj)) {
|
563
|
+
return;
|
564
|
+
}
|
565
|
+
|
536
566
|
// Iterate over object keys
|
537
567
|
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
538
568
|
const len = keys.length;
|
@@ -546,6 +576,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
546
576
|
}
|
547
577
|
|
548
578
|
function findKey(obj, key) {
|
579
|
+
if (isBuffer$1(obj)){
|
580
|
+
return null;
|
581
|
+
}
|
582
|
+
|
549
583
|
key = key.toLowerCase();
|
550
584
|
const keys = Object.keys(obj);
|
551
585
|
let i = keys.length;
|
@@ -586,7 +620,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
586
620
|
* @returns {Object} Result of all merge properties
|
587
621
|
*/
|
588
622
|
function merge(/* obj1, obj2, obj3, ... */) {
|
589
|
-
const {caseless} = isContextDefined(this) && this || {};
|
623
|
+
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
590
624
|
const result = {};
|
591
625
|
const assignValue = (val, key) => {
|
592
626
|
const targetKey = caseless && findKey(result, key) || key;
|
@@ -596,7 +630,7 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
596
630
|
result[targetKey] = merge({}, val);
|
597
631
|
} else if (isArray$1(val)) {
|
598
632
|
result[targetKey] = val.slice();
|
599
|
-
} else {
|
633
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
600
634
|
result[targetKey] = val;
|
601
635
|
}
|
602
636
|
};
|
@@ -619,7 +653,7 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
619
653
|
*/
|
620
654
|
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
621
655
|
forEach(b, (val, key) => {
|
622
|
-
if (thisArg && isFunction(val)) {
|
656
|
+
if (thisArg && isFunction$1(val)) {
|
623
657
|
a[key] = bind(val, thisArg);
|
624
658
|
} else {
|
625
659
|
a[key] = val;
|
@@ -759,13 +793,13 @@ const isTypedArray = (TypedArray => {
|
|
759
793
|
* @returns {void}
|
760
794
|
*/
|
761
795
|
const forEachEntry = (obj, fn) => {
|
762
|
-
const generator = obj && obj[
|
796
|
+
const generator = obj && obj[iterator];
|
763
797
|
|
764
|
-
const
|
798
|
+
const _iterator = generator.call(obj);
|
765
799
|
|
766
800
|
let result;
|
767
801
|
|
768
|
-
while ((result =
|
802
|
+
while ((result = _iterator.next()) && !result.done) {
|
769
803
|
const pair = result.value;
|
770
804
|
fn.call(obj, pair[0], pair[1]);
|
771
805
|
}
|
@@ -835,13 +869,13 @@ const reduceDescriptors = (obj, reducer) => {
|
|
835
869
|
const freezeMethods = (obj) => {
|
836
870
|
reduceDescriptors(obj, (descriptor, name) => {
|
837
871
|
// skip restricted props in strict mode
|
838
|
-
if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
872
|
+
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
839
873
|
return false;
|
840
874
|
}
|
841
875
|
|
842
876
|
const value = obj[name];
|
843
877
|
|
844
|
-
if (!isFunction(value)) return;
|
878
|
+
if (!isFunction$1(value)) return;
|
845
879
|
|
846
880
|
descriptor.enumerable = false;
|
847
881
|
|
@@ -878,6 +912,8 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
878
912
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
879
913
|
};
|
880
914
|
|
915
|
+
|
916
|
+
|
881
917
|
/**
|
882
918
|
* If the thing is a FormData object, return true, otherwise return false.
|
883
919
|
*
|
@@ -886,7 +922,7 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
886
922
|
* @returns {boolean}
|
887
923
|
*/
|
888
924
|
function isSpecCompliantForm(thing) {
|
889
|
-
return !!(thing && isFunction(thing.append) && thing[
|
925
|
+
return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
890
926
|
}
|
891
927
|
|
892
928
|
const toJSONObject = (obj) => {
|
@@ -899,6 +935,11 @@ const toJSONObject = (obj) => {
|
|
899
935
|
return;
|
900
936
|
}
|
901
937
|
|
938
|
+
//Buffer check
|
939
|
+
if (isBuffer$1(source)) {
|
940
|
+
return source;
|
941
|
+
}
|
942
|
+
|
902
943
|
if(!('toJSON' in source)) {
|
903
944
|
stack[i] = source;
|
904
945
|
const target = isArray$1(source) ? [] : {};
|
@@ -923,7 +964,7 @@ const toJSONObject = (obj) => {
|
|
923
964
|
const isAsyncFn = kindOfTest('AsyncFunction');
|
924
965
|
|
925
966
|
const isThenable = (thing) =>
|
926
|
-
thing && (isObject$1(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
967
|
+
thing && (isObject$1(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
927
968
|
|
928
969
|
// original code
|
929
970
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
@@ -947,7 +988,7 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
947
988
|
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
948
989
|
})(
|
949
990
|
typeof setImmediate === 'function',
|
950
|
-
isFunction(_global.postMessage)
|
991
|
+
isFunction$1(_global.postMessage)
|
951
992
|
);
|
952
993
|
|
953
994
|
const asap = typeof queueMicrotask !== 'undefined' ?
|
@@ -955,6 +996,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
|
|
955
996
|
|
956
997
|
// *********************
|
957
998
|
|
999
|
+
|
1000
|
+
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
1001
|
+
|
1002
|
+
|
958
1003
|
var utils$1 = {
|
959
1004
|
isArray: isArray$1,
|
960
1005
|
isArrayBuffer,
|
@@ -966,6 +1011,7 @@ var utils$1 = {
|
|
966
1011
|
isBoolean,
|
967
1012
|
isObject: isObject$1,
|
968
1013
|
isPlainObject,
|
1014
|
+
isEmptyObject,
|
969
1015
|
isReadableStream,
|
970
1016
|
isRequest,
|
971
1017
|
isResponse,
|
@@ -975,7 +1021,7 @@ var utils$1 = {
|
|
975
1021
|
isFile,
|
976
1022
|
isBlob,
|
977
1023
|
isRegExp,
|
978
|
-
isFunction,
|
1024
|
+
isFunction: isFunction$1,
|
979
1025
|
isStream,
|
980
1026
|
isURLSearchParams,
|
981
1027
|
isTypedArray,
|
@@ -1010,7 +1056,8 @@ var utils$1 = {
|
|
1010
1056
|
isAsyncFn,
|
1011
1057
|
isThenable,
|
1012
1058
|
setImmediate: _setImmediate,
|
1013
|
-
asap
|
1059
|
+
asap,
|
1060
|
+
isIterable
|
1014
1061
|
};
|
1015
1062
|
|
1016
1063
|
var lookup = [];
|
@@ -3077,11 +3124,18 @@ AxiosError$1.from = (error, code, config, request, response, customProps) => {
|
|
3077
3124
|
return prop !== 'isAxiosError';
|
3078
3125
|
});
|
3079
3126
|
|
3080
|
-
|
3127
|
+
const msg = error && error.message ? error.message : 'Error';
|
3128
|
+
|
3129
|
+
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
3130
|
+
const errCode = code == null && error ? error.code : code;
|
3131
|
+
AxiosError$1.call(axiosError, msg, errCode, config, request, response);
|
3081
3132
|
|
3082
|
-
|
3133
|
+
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
|
3134
|
+
if (error && axiosError.cause == null) {
|
3135
|
+
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
|
3136
|
+
}
|
3083
3137
|
|
3084
|
-
axiosError.name = error.name;
|
3138
|
+
axiosError.name = (error && error.name) || 'Error';
|
3085
3139
|
|
3086
3140
|
customProps && Object.assign(axiosError, customProps);
|
3087
3141
|
|
@@ -3206,6 +3260,10 @@ function toFormData$1(obj, formData, options) {
|
|
3206
3260
|
return value.toISOString();
|
3207
3261
|
}
|
3208
3262
|
|
3263
|
+
if (utils$1.isBoolean(value)) {
|
3264
|
+
return value.toString();
|
3265
|
+
}
|
3266
|
+
|
3209
3267
|
if (!useBlob && utils$1.isBlob(value)) {
|
3210
3268
|
throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
|
3211
3269
|
}
|
@@ -3368,9 +3426,7 @@ function encode$1(val) {
|
|
3368
3426
|
replace(/%3A/gi, ':').
|
3369
3427
|
replace(/%24/g, '$').
|
3370
3428
|
replace(/%2C/gi, ',').
|
3371
|
-
replace(/%20/g, '+')
|
3372
|
-
replace(/%5B/gi, '[').
|
3373
|
-
replace(/%5D/gi, ']');
|
3429
|
+
replace(/%20/g, '+');
|
3374
3430
|
}
|
3375
3431
|
|
3376
3432
|
/**
|
@@ -3567,7 +3623,7 @@ var platform = {
|
|
3567
3623
|
};
|
3568
3624
|
|
3569
3625
|
function toURLEncodedForm(data, options) {
|
3570
|
-
return toFormData$1(data, new platform.classes.URLSearchParams(),
|
3626
|
+
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
3571
3627
|
visitor: function(value, key, path, helpers) {
|
3572
3628
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
3573
3629
|
this.append(key, value.toString('base64'));
|
@@ -3575,8 +3631,9 @@ function toURLEncodedForm(data, options) {
|
|
3575
3631
|
}
|
3576
3632
|
|
3577
3633
|
return helpers.defaultVisitor.apply(this, arguments);
|
3578
|
-
}
|
3579
|
-
|
3634
|
+
},
|
3635
|
+
...options
|
3636
|
+
});
|
3580
3637
|
}
|
3581
3638
|
|
3582
3639
|
/**
|
@@ -3772,7 +3829,7 @@ const defaults = {
|
|
3772
3829
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
3773
3830
|
|
3774
3831
|
try {
|
3775
|
-
return JSON.parse(data);
|
3832
|
+
return JSON.parse(data, this.parseReviver);
|
3776
3833
|
} catch (e) {
|
3777
3834
|
if (strictJSONParsing) {
|
3778
3835
|
if (e.name === 'SyntaxError') {
|
@@ -3968,10 +4025,18 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
3968
4025
|
setHeaders(header, valueOrRewrite);
|
3969
4026
|
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
3970
4027
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
3971
|
-
} else if (utils$1.
|
3972
|
-
|
3973
|
-
|
4028
|
+
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
4029
|
+
let obj = {}, dest, key;
|
4030
|
+
for (const entry of header) {
|
4031
|
+
if (!utils$1.isArray(entry)) {
|
4032
|
+
throw TypeError('Object iterator must return a key-value pair');
|
4033
|
+
}
|
4034
|
+
|
4035
|
+
obj[key = entry[0]] = (dest = obj[key]) ?
|
4036
|
+
(utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
|
3974
4037
|
}
|
4038
|
+
|
4039
|
+
setHeaders(obj, valueOrRewrite);
|
3975
4040
|
} else {
|
3976
4041
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
3977
4042
|
}
|
@@ -4113,6 +4178,10 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
4113
4178
|
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
4114
4179
|
}
|
4115
4180
|
|
4181
|
+
getSetCookie() {
|
4182
|
+
return this.get("set-cookie") || [];
|
4183
|
+
}
|
4184
|
+
|
4116
4185
|
get [Symbol.toStringTag]() {
|
4117
4186
|
return 'AxiosHeaders';
|
4118
4187
|
}
|
@@ -4313,7 +4382,7 @@ function throttle(fn, freq) {
|
|
4313
4382
|
clearTimeout(timer);
|
4314
4383
|
timer = null;
|
4315
4384
|
}
|
4316
|
-
fn
|
4385
|
+
fn(...args);
|
4317
4386
|
};
|
4318
4387
|
|
4319
4388
|
const throttled = (...args) => {
|
@@ -4470,7 +4539,7 @@ function combineURLs(baseURL, relativeURL) {
|
|
4470
4539
|
*/
|
4471
4540
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
4472
4541
|
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
4473
|
-
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
|
4542
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
4474
4543
|
return combineURLs(baseURL, requestedURL);
|
4475
4544
|
}
|
4476
4545
|
return requestedURL;
|
@@ -4569,7 +4638,7 @@ function mergeConfig$1(config1, config2) {
|
|
4569
4638
|
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
4570
4639
|
};
|
4571
4640
|
|
4572
|
-
utils$1.forEach(Object.keys(
|
4641
|
+
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
4573
4642
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
4574
4643
|
const configValue = merge(config1[prop], config2[prop], prop);
|
4575
4644
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
@@ -4581,7 +4650,7 @@ function mergeConfig$1(config1, config2) {
|
|
4581
4650
|
var resolveConfig = (config) => {
|
4582
4651
|
const newConfig = mergeConfig$1({}, config);
|
4583
4652
|
|
4584
|
-
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
4653
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
4585
4654
|
|
4586
4655
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
4587
4656
|
|
@@ -4594,17 +4663,21 @@ var resolveConfig = (config) => {
|
|
4594
4663
|
);
|
4595
4664
|
}
|
4596
4665
|
|
4597
|
-
let contentType;
|
4598
|
-
|
4599
4666
|
if (utils$1.isFormData(data)) {
|
4600
4667
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
4601
|
-
headers.setContentType(undefined); //
|
4602
|
-
} else if ((
|
4603
|
-
//
|
4604
|
-
const
|
4605
|
-
headers
|
4668
|
+
headers.setContentType(undefined); // browser handles it
|
4669
|
+
} else if (utils$1.isFunction(data.getHeaders)) {
|
4670
|
+
// Node.js FormData (like form-data package)
|
4671
|
+
const formHeaders = data.getHeaders();
|
4672
|
+
// Only set safe headers to avoid overwriting security headers
|
4673
|
+
const allowedHeaders = ['content-type', 'content-length'];
|
4674
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
4675
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
4676
|
+
headers.set(key, val);
|
4677
|
+
}
|
4678
|
+
});
|
4606
4679
|
}
|
4607
|
-
}
|
4680
|
+
}
|
4608
4681
|
|
4609
4682
|
// Add xsrf header
|
4610
4683
|
// This is only done if running in a standard browser environment.
|
@@ -4721,15 +4794,18 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
4721
4794
|
};
|
4722
4795
|
|
4723
4796
|
// Handle low level network errors
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4727
|
-
|
4728
|
-
|
4729
|
-
|
4730
|
-
|
4797
|
+
request.onerror = function handleError(event) {
|
4798
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
4799
|
+
// (message may be empty; when present, surface it)
|
4800
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
4801
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
4802
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
4803
|
+
// attach the underlying event for consumers who want details
|
4804
|
+
err.event = event || null;
|
4805
|
+
reject(err);
|
4806
|
+
request = null;
|
4731
4807
|
};
|
4732
|
-
|
4808
|
+
|
4733
4809
|
// Handle timeout
|
4734
4810
|
request.ontimeout = function handleTimeout() {
|
4735
4811
|
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
@@ -4943,14 +5019,18 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
4943
5019
|
})
|
4944
5020
|
};
|
4945
5021
|
|
4946
|
-
const
|
4947
|
-
|
5022
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
5023
|
+
|
5024
|
+
const {isFunction} = utils$1;
|
5025
|
+
|
5026
|
+
const globalFetchAPI = (({Request, Response}) => ({
|
5027
|
+
Request, Response
|
5028
|
+
}))(utils$1.global);
|
5029
|
+
|
5030
|
+
const {
|
5031
|
+
ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1
|
5032
|
+
} = utils$1.global;
|
4948
5033
|
|
4949
|
-
// used only inside the fetch adapter
|
4950
|
-
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
4951
|
-
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
4952
|
-
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
4953
|
-
);
|
4954
5034
|
|
4955
5035
|
const test = (fn, ...args) => {
|
4956
5036
|
try {
|
@@ -4960,211 +5040,268 @@ const test = (fn, ...args) => {
|
|
4960
5040
|
}
|
4961
5041
|
};
|
4962
5042
|
|
4963
|
-
const
|
4964
|
-
|
5043
|
+
const factory = (env) => {
|
5044
|
+
env = utils$1.merge.call({
|
5045
|
+
skipUndefined: true
|
5046
|
+
}, globalFetchAPI, env);
|
4965
5047
|
|
4966
|
-
const
|
4967
|
-
|
4968
|
-
|
4969
|
-
|
4970
|
-
duplexAccessed = true;
|
4971
|
-
return 'half';
|
4972
|
-
},
|
4973
|
-
}).headers.has('Content-Type');
|
5048
|
+
const {fetch: envFetch, Request, Response} = env;
|
5049
|
+
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
5050
|
+
const isRequestSupported = isFunction(Request);
|
5051
|
+
const isResponseSupported = isFunction(Response);
|
4974
5052
|
|
4975
|
-
|
4976
|
-
|
5053
|
+
if (!isFetchSupported) {
|
5054
|
+
return false;
|
5055
|
+
}
|
4977
5056
|
|
4978
|
-
const
|
5057
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
4979
5058
|
|
4980
|
-
const
|
4981
|
-
|
5059
|
+
const encodeText = isFetchSupported && (typeof TextEncoder$1 === 'function' ?
|
5060
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) :
|
5061
|
+
async (str) => new Uint8Array(await new Request(str).arrayBuffer())
|
5062
|
+
);
|
4982
5063
|
|
5064
|
+
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
5065
|
+
let duplexAccessed = false;
|
4983
5066
|
|
4984
|
-
const
|
4985
|
-
|
4986
|
-
|
5067
|
+
const hasContentType = new Request(platform.origin, {
|
5068
|
+
body: new ReadableStream$1(),
|
5069
|
+
method: 'POST',
|
5070
|
+
get duplex() {
|
5071
|
+
duplexAccessed = true;
|
5072
|
+
return 'half';
|
5073
|
+
},
|
5074
|
+
}).headers.has('Content-Type');
|
4987
5075
|
|
4988
|
-
|
4989
|
-
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
4990
|
-
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
|
4991
|
-
(_, config) => {
|
4992
|
-
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
4993
|
-
});
|
5076
|
+
return duplexAccessed && !hasContentType;
|
4994
5077
|
});
|
4995
|
-
})(new Response));
|
4996
5078
|
|
4997
|
-
const
|
4998
|
-
|
4999
|
-
return 0;
|
5000
|
-
}
|
5079
|
+
const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
|
5080
|
+
test(() => utils$1.isReadableStream(new Response('').body));
|
5001
5081
|
|
5002
|
-
|
5003
|
-
|
5004
|
-
}
|
5082
|
+
const resolvers = {
|
5083
|
+
stream: supportsResponseStream && ((res) => res.body)
|
5084
|
+
};
|
5005
5085
|
|
5006
|
-
|
5007
|
-
|
5008
|
-
|
5009
|
-
|
5086
|
+
isFetchSupported && ((() => {
|
5087
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
5088
|
+
!resolvers[type] && (resolvers[type] = (res, config) => {
|
5089
|
+
let method = res && res[type];
|
5090
|
+
|
5091
|
+
if (method) {
|
5092
|
+
return method.call(res);
|
5093
|
+
}
|
5094
|
+
|
5095
|
+
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
5096
|
+
});
|
5010
5097
|
});
|
5011
|
-
|
5012
|
-
}
|
5098
|
+
})());
|
5013
5099
|
|
5014
|
-
|
5015
|
-
|
5016
|
-
|
5100
|
+
const getBodyLength = async (body) => {
|
5101
|
+
if (body == null) {
|
5102
|
+
return 0;
|
5103
|
+
}
|
5017
5104
|
|
5018
|
-
|
5019
|
-
|
5020
|
-
|
5105
|
+
if (utils$1.isBlob(body)) {
|
5106
|
+
return body.size;
|
5107
|
+
}
|
5021
5108
|
|
5022
|
-
|
5023
|
-
|
5024
|
-
|
5025
|
-
|
5109
|
+
if (utils$1.isSpecCompliantForm(body)) {
|
5110
|
+
const _request = new Request(platform.origin, {
|
5111
|
+
method: 'POST',
|
5112
|
+
body,
|
5113
|
+
});
|
5114
|
+
return (await _request.arrayBuffer()).byteLength;
|
5115
|
+
}
|
5026
5116
|
|
5027
|
-
|
5028
|
-
|
5117
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
5118
|
+
return body.byteLength;
|
5119
|
+
}
|
5029
5120
|
|
5030
|
-
|
5031
|
-
|
5121
|
+
if (utils$1.isURLSearchParams(body)) {
|
5122
|
+
body = body + '';
|
5123
|
+
}
|
5124
|
+
|
5125
|
+
if (utils$1.isString(body)) {
|
5126
|
+
return (await encodeText(body)).byteLength;
|
5127
|
+
}
|
5128
|
+
};
|
5129
|
+
|
5130
|
+
const resolveBodyLength = async (headers, body) => {
|
5131
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
5132
|
+
|
5133
|
+
return length == null ? getBodyLength(body) : length;
|
5134
|
+
};
|
5135
|
+
|
5136
|
+
return async (config) => {
|
5137
|
+
let {
|
5138
|
+
url,
|
5139
|
+
method,
|
5140
|
+
data,
|
5141
|
+
signal,
|
5142
|
+
cancelToken,
|
5143
|
+
timeout,
|
5144
|
+
onDownloadProgress,
|
5145
|
+
onUploadProgress,
|
5146
|
+
responseType,
|
5147
|
+
headers,
|
5148
|
+
withCredentials = 'same-origin',
|
5149
|
+
fetchOptions
|
5150
|
+
} = resolveConfig(config);
|
5151
|
+
|
5152
|
+
let _fetch = envFetch || fetch;
|
5153
|
+
|
5154
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
5032
5155
|
|
5033
|
-
|
5034
|
-
|
5035
|
-
|
5036
|
-
|
5037
|
-
|
5038
|
-
signal,
|
5039
|
-
cancelToken,
|
5040
|
-
timeout,
|
5041
|
-
onDownloadProgress,
|
5042
|
-
onUploadProgress,
|
5043
|
-
responseType,
|
5044
|
-
headers,
|
5045
|
-
withCredentials = 'same-origin',
|
5046
|
-
fetchOptions
|
5047
|
-
} = resolveConfig(config);
|
5048
|
-
|
5049
|
-
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
5050
|
-
|
5051
|
-
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
5052
|
-
|
5053
|
-
let request;
|
5054
|
-
|
5055
|
-
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
5156
|
+
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
5157
|
+
|
5158
|
+
let request = null;
|
5159
|
+
|
5160
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
5056
5161
|
composedSignal.unsubscribe();
|
5057
|
-
|
5162
|
+
});
|
5058
5163
|
|
5059
|
-
|
5164
|
+
let requestContentLength;
|
5060
5165
|
|
5061
|
-
|
5062
|
-
|
5063
|
-
|
5064
|
-
|
5065
|
-
|
5066
|
-
|
5067
|
-
|
5068
|
-
|
5069
|
-
|
5070
|
-
|
5166
|
+
try {
|
5167
|
+
if (
|
5168
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
5169
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
5170
|
+
) {
|
5171
|
+
let _request = new Request(url, {
|
5172
|
+
method: 'POST',
|
5173
|
+
body: data,
|
5174
|
+
duplex: "half"
|
5175
|
+
});
|
5071
5176
|
|
5072
|
-
|
5177
|
+
let contentTypeHeader;
|
5073
5178
|
|
5074
|
-
|
5075
|
-
|
5076
|
-
|
5179
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
5180
|
+
headers.setContentType(contentTypeHeader);
|
5181
|
+
}
|
5077
5182
|
|
5078
|
-
|
5079
|
-
|
5080
|
-
|
5081
|
-
|
5082
|
-
|
5183
|
+
if (_request.body) {
|
5184
|
+
const [onProgress, flush] = progressEventDecorator(
|
5185
|
+
requestContentLength,
|
5186
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
5187
|
+
);
|
5083
5188
|
|
5084
|
-
|
5189
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
5190
|
+
}
|
5085
5191
|
}
|
5086
|
-
}
|
5087
5192
|
|
5088
|
-
|
5089
|
-
|
5090
|
-
|
5193
|
+
if (!utils$1.isString(withCredentials)) {
|
5194
|
+
withCredentials = withCredentials ? 'include' : 'omit';
|
5195
|
+
}
|
5091
5196
|
|
5092
|
-
|
5093
|
-
|
5094
|
-
|
5095
|
-
request = new Request(url, {
|
5096
|
-
...fetchOptions,
|
5097
|
-
signal: composedSignal,
|
5098
|
-
method: method.toUpperCase(),
|
5099
|
-
headers: headers.normalize().toJSON(),
|
5100
|
-
body: data,
|
5101
|
-
duplex: "half",
|
5102
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
5103
|
-
});
|
5197
|
+
// Cloudflare Workers throws when credentials are defined
|
5198
|
+
// see https://github.com/cloudflare/workerd/issues/902
|
5199
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
5104
5200
|
|
5105
|
-
|
5201
|
+
const resolvedOptions = {
|
5202
|
+
...fetchOptions,
|
5203
|
+
signal: composedSignal,
|
5204
|
+
method: method.toUpperCase(),
|
5205
|
+
headers: headers.normalize().toJSON(),
|
5206
|
+
body: data,
|
5207
|
+
duplex: "half",
|
5208
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
5209
|
+
};
|
5106
5210
|
|
5107
|
-
|
5211
|
+
request = isRequestSupported && new Request(url, resolvedOptions);
|
5108
5212
|
|
5109
|
-
|
5110
|
-
const options = {};
|
5213
|
+
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
5111
5214
|
|
5112
|
-
|
5113
|
-
options[prop] = response[prop];
|
5114
|
-
});
|
5215
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
5115
5216
|
|
5116
|
-
|
5217
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
5218
|
+
const options = {};
|
5117
5219
|
|
5118
|
-
|
5119
|
-
|
5120
|
-
|
5121
|
-
) || [];
|
5220
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
5221
|
+
options[prop] = response[prop];
|
5222
|
+
});
|
5122
5223
|
|
5123
|
-
|
5124
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
5125
|
-
flush && flush();
|
5126
|
-
unsubscribe && unsubscribe();
|
5127
|
-
}),
|
5128
|
-
options
|
5129
|
-
);
|
5130
|
-
}
|
5224
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
5131
5225
|
|
5132
|
-
|
5226
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
5227
|
+
responseContentLength,
|
5228
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
5229
|
+
) || [];
|
5133
5230
|
|
5134
|
-
|
5231
|
+
response = new Response(
|
5232
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
5233
|
+
flush && flush();
|
5234
|
+
unsubscribe && unsubscribe();
|
5235
|
+
}),
|
5236
|
+
options
|
5237
|
+
);
|
5238
|
+
}
|
5135
5239
|
|
5136
|
-
|
5240
|
+
responseType = responseType || 'text';
|
5137
5241
|
|
5138
|
-
|
5139
|
-
settle(resolve, reject, {
|
5140
|
-
data: responseData,
|
5141
|
-
headers: AxiosHeaders$1.from(response.headers),
|
5142
|
-
status: response.status,
|
5143
|
-
statusText: response.statusText,
|
5144
|
-
config,
|
5145
|
-
request
|
5146
|
-
});
|
5147
|
-
})
|
5148
|
-
} catch (err) {
|
5149
|
-
unsubscribe && unsubscribe();
|
5242
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
5150
5243
|
|
5151
|
-
|
5152
|
-
|
5153
|
-
|
5154
|
-
{
|
5155
|
-
|
5156
|
-
|
5157
|
-
|
5244
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
5245
|
+
|
5246
|
+
return await new Promise((resolve, reject) => {
|
5247
|
+
settle(resolve, reject, {
|
5248
|
+
data: responseData,
|
5249
|
+
headers: AxiosHeaders$1.from(response.headers),
|
5250
|
+
status: response.status,
|
5251
|
+
statusText: response.statusText,
|
5252
|
+
config,
|
5253
|
+
request
|
5254
|
+
});
|
5255
|
+
})
|
5256
|
+
} catch (err) {
|
5257
|
+
unsubscribe && unsubscribe();
|
5258
|
+
|
5259
|
+
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
5260
|
+
throw Object.assign(
|
5261
|
+
new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
|
5262
|
+
{
|
5263
|
+
cause: err.cause || err
|
5264
|
+
}
|
5265
|
+
)
|
5266
|
+
}
|
5267
|
+
|
5268
|
+
throw AxiosError$1.from(err, err && err.code, config, request);
|
5158
5269
|
}
|
5270
|
+
}
|
5271
|
+
};
|
5159
5272
|
|
5160
|
-
|
5273
|
+
const seedCache = new Map();
|
5274
|
+
|
5275
|
+
const getFetch = (config) => {
|
5276
|
+
let env = config ? config.env : {};
|
5277
|
+
const {fetch, Request, Response} = env;
|
5278
|
+
const seeds = [
|
5279
|
+
Request, Response, fetch
|
5280
|
+
];
|
5281
|
+
|
5282
|
+
let len = seeds.length, i = len,
|
5283
|
+
seed, target, map = seedCache;
|
5284
|
+
|
5285
|
+
while (i--) {
|
5286
|
+
seed = seeds[i];
|
5287
|
+
target = map.get(seed);
|
5288
|
+
|
5289
|
+
target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
|
5290
|
+
|
5291
|
+
map = target;
|
5161
5292
|
}
|
5162
|
-
|
5293
|
+
|
5294
|
+
return target;
|
5295
|
+
};
|
5296
|
+
|
5297
|
+
getFetch();
|
5163
5298
|
|
5164
5299
|
const knownAdapters = {
|
5165
5300
|
http: httpAdapter,
|
5166
5301
|
xhr: xhrAdapter,
|
5167
|
-
fetch:
|
5302
|
+
fetch: {
|
5303
|
+
get: getFetch,
|
5304
|
+
}
|
5168
5305
|
};
|
5169
5306
|
|
5170
5307
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
@@ -5183,7 +5320,7 @@ const renderReason = (reason) => `- ${reason}`;
|
|
5183
5320
|
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
5184
5321
|
|
5185
5322
|
var adapters = {
|
5186
|
-
getAdapter: (adapters) => {
|
5323
|
+
getAdapter: (adapters, config) => {
|
5187
5324
|
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
5188
5325
|
|
5189
5326
|
const {length} = adapters;
|
@@ -5206,7 +5343,7 @@ var adapters = {
|
|
5206
5343
|
}
|
5207
5344
|
}
|
5208
5345
|
|
5209
|
-
if (adapter) {
|
5346
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
5210
5347
|
break;
|
5211
5348
|
}
|
5212
5349
|
|
@@ -5274,7 +5411,7 @@ function dispatchRequest(config) {
|
|
5274
5411
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
5275
5412
|
}
|
5276
5413
|
|
5277
|
-
const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
|
5414
|
+
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
5278
5415
|
|
5279
5416
|
return adapter(config).then(function onAdapterResolution(response) {
|
5280
5417
|
throwIfCancellationRequested(config);
|
@@ -5308,7 +5445,7 @@ function dispatchRequest(config) {
|
|
5308
5445
|
});
|
5309
5446
|
}
|
5310
5447
|
|
5311
|
-
const VERSION$1 = "1.
|
5448
|
+
const VERSION$1 = "1.12.2";
|
5312
5449
|
|
5313
5450
|
const validators$1 = {};
|
5314
5451
|
|
@@ -5416,7 +5553,7 @@ const validators = validator.validators;
|
|
5416
5553
|
*/
|
5417
5554
|
let Axios$1 = class Axios {
|
5418
5555
|
constructor(instanceConfig) {
|
5419
|
-
this.defaults = instanceConfig;
|
5556
|
+
this.defaults = instanceConfig || {};
|
5420
5557
|
this.interceptors = {
|
5421
5558
|
request: new InterceptorManager(),
|
5422
5559
|
response: new InterceptorManager()
|
@@ -5547,8 +5684,8 @@ let Axios$1 = class Axios {
|
|
5547
5684
|
|
5548
5685
|
if (!synchronousRequestInterceptors) {
|
5549
5686
|
const chain = [dispatchRequest.bind(this), undefined];
|
5550
|
-
chain.unshift
|
5551
|
-
chain.push
|
5687
|
+
chain.unshift(...requestInterceptorChain);
|
5688
|
+
chain.push(...responseInterceptorChain);
|
5552
5689
|
len = chain.length;
|
5553
5690
|
|
5554
5691
|
promise = Promise.resolve(config);
|
@@ -5564,8 +5701,6 @@ let Axios$1 = class Axios {
|
|
5564
5701
|
|
5565
5702
|
let newConfig = config;
|
5566
5703
|
|
5567
|
-
i = 0;
|
5568
|
-
|
5569
5704
|
while (i < len) {
|
5570
5705
|
const onFulfilled = requestInterceptorChain[i++];
|
5571
5706
|
const onRejected = requestInterceptorChain[i++];
|
@@ -7144,7 +7279,7 @@ const LETTERLIKE_SYMBOLS_MAP = {
|
|
7144
7279
|
'℠': '',
|
7145
7280
|
'℡': '',
|
7146
7281
|
'™': '',
|
7147
|
-
|
7282
|
+
℮: '',
|
7148
7283
|
ℯ: '',
|
7149
7284
|
ℰ: '',
|
7150
7285
|
ℱ: '',
|
@@ -7155,7 +7290,7 @@ const LETTERLIKE_SYMBOLS_MAP = {
|
|
7155
7290
|
ℶ: '',
|
7156
7291
|
ℷ: '',
|
7157
7292
|
ℸ: '',
|
7158
|
-
|
7293
|
+
℘: '',
|
7159
7294
|
};
|
7160
7295
|
const CURRENCY_SYMBOLS_MAP = {
|
7161
7296
|
'₠': '',
|
@@ -7398,7 +7533,7 @@ class NormalizeStringHelper {
|
|
7398
7533
|
*/
|
7399
7534
|
removeLeadingZerosIfNumber(text) {
|
7400
7535
|
// If the string is not a number, return it as is
|
7401
|
-
if (isNaN(Number(text))) {
|
7536
|
+
if (Number.isNaN(Number(text))) {
|
7402
7537
|
return text;
|
7403
7538
|
}
|
7404
7539
|
// If the string consists of only zeros, return "0"
|
@@ -7519,7 +7654,7 @@ class ObjectHelper {
|
|
7519
7654
|
if (this.isArray(value)) {
|
7520
7655
|
return this.mergeArrayValues(targetValue, value);
|
7521
7656
|
}
|
7522
|
-
|
7657
|
+
if (typeof value === 'object') {
|
7523
7658
|
return this.mergeObjectValues(targetValue, value);
|
7524
7659
|
}
|
7525
7660
|
return (_a = value !== null && value !== void 0 ? value : targetValue) !== null && _a !== void 0 ? _a : undefined;
|
@@ -7877,7 +8012,11 @@ function getAugmentedNamespace(n) {
|
|
7877
8012
|
var f = n.default;
|
7878
8013
|
if (typeof f == "function") {
|
7879
8014
|
var a = function a () {
|
7880
|
-
|
8015
|
+
var isInstance = false;
|
8016
|
+
try {
|
8017
|
+
isInstance = this instanceof a;
|
8018
|
+
} catch {}
|
8019
|
+
if (isInstance) {
|
7881
8020
|
return Reflect.construct(f, arguments, this.constructor);
|
7882
8021
|
}
|
7883
8022
|
return f.apply(this, arguments);
|
@@ -16630,8 +16769,7 @@ class ApiError {
|
|
16630
16769
|
var _a, _b, _c, _d, _e, _f, _g;
|
16631
16770
|
const e = error;
|
16632
16771
|
this.cause = (_d = (_b = (_a = e === null || e === void 0 ? void 0 : e.response) === null || _a === void 0 ? void 0 : _a.data.statusCode) !== null && _b !== void 0 ? _b : (_c = e === null || e === void 0 ? void 0 : e.response) === null || _c === void 0 ? void 0 : _c.status) !== null && _d !== void 0 ? _d : 0;
|
16633
|
-
this.errorMessage =
|
16634
|
-
(_g = (_f = (_e = e === null || e === void 0 ? void 0 : e.response) === null || _e === void 0 ? void 0 : _e.data.message) !== null && _f !== void 0 ? _f : e === null || e === void 0 ? void 0 : e.message) !== null && _g !== void 0 ? _g : `There's been an error related to the API request to LiquidCommerce RMN Services.`;
|
16772
|
+
this.errorMessage = (_g = (_f = (_e = e === null || e === void 0 ? void 0 : e.response) === null || _e === void 0 ? void 0 : _e.data.message) !== null && _f !== void 0 ? _f : e === null || e === void 0 ? void 0 : e.message) !== null && _g !== void 0 ? _g : `There's been an error related to the API request to LiquidCommerce RMN Services.`;
|
16635
16773
|
}
|
16636
16774
|
}
|
16637
16775
|
|
@@ -16720,10 +16858,7 @@ class EncryptedApi {
|
|
16720
16858
|
async joseEncrypt(data, key, exp) {
|
16721
16859
|
// Encode and sign data
|
16722
16860
|
const currentDate = new Date();
|
16723
|
-
const token = new SignJWT(data)
|
16724
|
-
.setProtectedHeader({ alg: 'HS256' })
|
16725
|
-
.setIssuedAt(currentDate.getTime())
|
16726
|
-
.setExpirationTime(exp);
|
16861
|
+
const token = new SignJWT(data).setProtectedHeader({ alg: 'HS256' }).setIssuedAt(currentDate.getTime()).setExpirationTime(exp);
|
16727
16862
|
const signedToken = await token.sign(Buffer.from(key));
|
16728
16863
|
// Encrypt and format payload
|
16729
16864
|
return cryptoJsExports.AES.encrypt(signedToken, key).toString();
|
@@ -16761,6 +16896,7 @@ class BaseApi extends BaseApiAbstract {
|
|
16761
16896
|
});
|
16762
16897
|
}
|
16763
16898
|
getPartnerSite() {
|
16899
|
+
// biome-ignore lint/complexity/useOptionalChain: Type guard required before property access
|
16764
16900
|
if (typeof window !== 'undefined' && window.location) {
|
16765
16901
|
return window.location.origin;
|
16766
16902
|
}
|
@@ -16803,6 +16939,7 @@ class BaseApi extends BaseApiAbstract {
|
|
16803
16939
|
async post(path, data, configOverrides) {
|
16804
16940
|
let requestData = data;
|
16805
16941
|
if (![exports.RMN_ENV.LOCAL, exports.RMN_ENV.DEVELOPMENT].includes(this.authInfo.env)) {
|
16942
|
+
// biome-ignore lint/complexity/useDateNow: Timestamp needed for authentication headers
|
16806
16943
|
const timestamp = new Date().getTime();
|
16807
16944
|
configOverrides = {
|
16808
16945
|
...configOverrides,
|
@@ -16871,20 +17008,17 @@ class BaseApi extends BaseApiAbstract {
|
|
16871
17008
|
let responseData = (response === null || response === void 0 ? void 0 : response.data) ? response.data : null;
|
16872
17009
|
let isEncrypted = false;
|
16873
17010
|
let timestamp = 0;
|
16874
|
-
if (
|
17011
|
+
if (
|
17012
|
+
// biome-ignore lint/complexity/useOptionalChain: Explicit null checks preferred for readability
|
17013
|
+
(response === null || response === void 0 ? void 0 : response.headers) &&
|
16875
17014
|
((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a.has) &&
|
16876
17015
|
((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b.has(REQUEST_CLOUD_PROTECTED_KEY)) &&
|
16877
17016
|
((_c = response === null || response === void 0 ? void 0 : response.headers) === null || _c === void 0 ? void 0 : _c.has(REQUEST_CLOUD_PROTECTED_TIMESTAMP)) &&
|
16878
17017
|
((_d = response === null || response === void 0 ? void 0 : response.headers) === null || _d === void 0 ? void 0 : _d.get)) {
|
16879
17018
|
isEncrypted = ((_e = response === null || response === void 0 ? void 0 : response.headers) === null || _e === void 0 ? void 0 : _e.get(REQUEST_CLOUD_PROTECTED_KEY)) === 'true';
|
16880
|
-
timestamp = ((_f = response === null || response === void 0 ? void 0 : response.headers) === null || _f === void 0 ? void 0 : _f.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP))
|
16881
|
-
|
16882
|
-
|
16883
|
-
}
|
16884
|
-
if (responseData &&
|
16885
|
-
isEncrypted &&
|
16886
|
-
this.objectHelper.includes(responseData, 't') &&
|
16887
|
-
timestamp > 0) {
|
17019
|
+
timestamp = ((_f = response === null || response === void 0 ? void 0 : response.headers) === null || _f === void 0 ? void 0 : _f.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP)) ? Number((_g = response === null || response === void 0 ? void 0 : response.headers) === null || _g === void 0 ? void 0 : _g.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP)) : 0;
|
17020
|
+
}
|
17021
|
+
if (responseData && isEncrypted && this.objectHelper.includes(responseData, 't') && timestamp > 0) {
|
16888
17022
|
const { t: encryptedPayload } = responseData;
|
16889
17023
|
const decryptedData = await this.encryptedApi.handleDecryption(encryptedPayload, timestamp);
|
16890
17024
|
if (decryptedData === null || decryptedData === void 0 ? void 0 : decryptedData.payload) {
|
@@ -16973,6 +17107,8 @@ const SPOT_DIMENSIONS = {
|
|
16973
17107
|
[exports.RMN_SPOT_TYPE.RB_VIDEO_PLAYER]: { width: 1280, height: 720 },
|
16974
17108
|
[exports.RMN_SPOT_TYPE.RB_IN_TEXT]: { width: 1, height: 1 },
|
16975
17109
|
[exports.RMN_SPOT_TYPE.RB_CAROUSEL_HORIZONTAL_INFO_CARD]: { width: 592, height: 386 },
|
17110
|
+
[exports.RMN_SPOT_TYPE.RB_CAROUSEL_VERTICAL_SMALL_IMAGE_INFO_CARD]: { width: 285, height: 386 },
|
17111
|
+
[exports.RMN_SPOT_TYPE.RB_CAROUSEL_HORIZONTAL_SHORT_INFO_CARD]: { width: 285, height: 416 },
|
16976
17112
|
[exports.RMN_SPOT_TYPE.SMALL_RECTANGLE]: { width: 180, height: 150 },
|
16977
17113
|
[exports.RMN_SPOT_TYPE.MEDIUM_RECTANGLE]: { width: 300, height: 250 },
|
16978
17114
|
[exports.RMN_SPOT_TYPE.LARGE_RECTANGLE]: { width: 336, height: 280 },
|
@@ -17041,9 +17177,7 @@ class BaseSpotComponent extends BaseElement {
|
|
17041
17177
|
if (!this.initialized || !this.dataInitialized || !isBrowser) {
|
17042
17178
|
return;
|
17043
17179
|
}
|
17044
|
-
this._container = this._config.useShadowDom
|
17045
|
-
? this.shadowRoot || this.attachShadow({ mode: 'open' })
|
17046
|
-
: this;
|
17180
|
+
this._container = this._config.useShadowDom ? this.shadowRoot || this.attachShadow({ mode: 'open' }) : this;
|
17047
17181
|
this._container.innerHTML = '';
|
17048
17182
|
const style = document.createElement('style');
|
17049
17183
|
style.textContent = this.baseStyles() + this.styles();
|
@@ -17242,10 +17376,7 @@ class LocalStorageService {
|
|
17242
17376
|
const decryptedData = this.decryptData(localStorageData);
|
17243
17377
|
const parsedData = JSON.parse(decryptedData);
|
17244
17378
|
if (Array.isArray(parsedData)) {
|
17245
|
-
const data = Object.fromEntries(parsedData.map((spot) => [
|
17246
|
-
spot[ENUM_SPOT_ARRAY_INDEX.SPOT_ID],
|
17247
|
-
this.spotArrayToObject(spot),
|
17248
|
-
]));
|
17379
|
+
const data = Object.fromEntries(parsedData.map((spot) => [spot[ENUM_SPOT_ARRAY_INDEX.SPOT_ID], this.spotArrayToObject(spot)]));
|
17249
17380
|
this.spots = this.objectToMap(data);
|
17250
17381
|
}
|
17251
17382
|
else {
|
@@ -17261,7 +17392,7 @@ class LocalStorageService {
|
|
17261
17392
|
updateLocalStorage() {
|
17262
17393
|
var _a;
|
17263
17394
|
if (!this.spots)
|
17264
|
-
return
|
17395
|
+
return;
|
17265
17396
|
const spotsObj = this.mapToObject(this.spots);
|
17266
17397
|
const data = Object.values(spotsObj).map((spot) => this.spotObjectToArray(spot));
|
17267
17398
|
try {
|
@@ -17699,9 +17830,9 @@ function convertHexToRgba(hex, opacity = 1) {
|
|
17699
17830
|
// Remove # if present
|
17700
17831
|
const cleanHex = hex.replace('#', '');
|
17701
17832
|
// Convert hex to RGB
|
17702
|
-
const r = parseInt(cleanHex.substring(0, 2), 16);
|
17703
|
-
const g = parseInt(cleanHex.substring(2, 4), 16);
|
17704
|
-
const b = parseInt(cleanHex.substring(4, 6), 16);
|
17833
|
+
const r = Number.parseInt(cleanHex.substring(0, 2), 16);
|
17834
|
+
const g = Number.parseInt(cleanHex.substring(2, 4), 16);
|
17835
|
+
const b = Number.parseInt(cleanHex.substring(4, 6), 16);
|
17705
17836
|
// Return rgba string
|
17706
17837
|
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
17707
17838
|
}
|
@@ -17729,10 +17860,7 @@ function generateGradientColor(overlay, fallback = '') {
|
|
17729
17860
|
}
|
17730
17861
|
function importFonts(...fonts) {
|
17731
17862
|
const fontsToImport = fonts.length === 0 ? ['sourceSans', 'cormorant'] : fonts;
|
17732
|
-
return [
|
17733
|
-
FONTS.preconnect,
|
17734
|
-
...fontsToImport.map((font) => FONTS[font]),
|
17735
|
-
].join('');
|
17863
|
+
return [FONTS.preconnect, ...fontsToImport.map((font) => FONTS[font])].join('');
|
17736
17864
|
}
|
17737
17865
|
function renderElement(tag, className, content) {
|
17738
17866
|
return (content === null || content === void 0 ? void 0 : content.trim()) ? `<${tag} class="${className}">${content}</${tag}>` : '';
|
@@ -17779,7 +17907,7 @@ class BillboardV1SE extends BaseSpotComponent {
|
|
17779
17907
|
elements.forEach((element) => {
|
17780
17908
|
if (element instanceof HTMLElement) {
|
17781
17909
|
if (!this.originalFontSizes.has(element)) {
|
17782
|
-
const originalSize = parseFloat(window.getComputedStyle(element).fontSize);
|
17910
|
+
const originalSize = Number.parseFloat(window.getComputedStyle(element).fontSize);
|
17783
17911
|
this.originalFontSizes.set(element, originalSize);
|
17784
17912
|
}
|
17785
17913
|
const originalSize = this.originalFontSizes.get(element);
|
@@ -17990,7 +18118,7 @@ class RbCarouselHorizontalInfoCardSE extends BaseSpotComponent {
|
|
17990
18118
|
`;
|
17991
18119
|
}
|
17992
18120
|
styles() {
|
17993
|
-
const { headerColor = '#212121', textColor = '#616161', backgroundColor = '#
|
18121
|
+
const { headerColor = '#212121', textColor = '#616161', backgroundColor = '#f7f5f3', ctaTextColor = '#b5914a', primaryImage, mobilePrimaryImage = primaryImage, } = this._data;
|
17994
18122
|
const prefix = this._config.prefix;
|
17995
18123
|
return `
|
17996
18124
|
.${prefix} {
|
@@ -18042,8 +18170,7 @@ class RbCarouselHorizontalInfoCardSE extends BaseSpotComponent {
|
|
18042
18170
|
margin: 0;
|
18043
18171
|
color:${headerColor};
|
18044
18172
|
font-family: "Cormorant", system-ui;
|
18045
|
-
font-
|
18046
|
-
font-size: 8px;
|
18173
|
+
font-size: ${this._isMobileDevice ? '8px' : '9px'};
|
18047
18174
|
line-height: normal;
|
18048
18175
|
letter-spacing: 0.8px;
|
18049
18176
|
}
|
@@ -18053,7 +18180,7 @@ class RbCarouselHorizontalInfoCardSE extends BaseSpotComponent {
|
|
18053
18180
|
color: ${headerColor};
|
18054
18181
|
font-family: "Cormorant", system-ui;
|
18055
18182
|
font-weight: bold;
|
18056
|
-
font-size: 16px;
|
18183
|
+
font-size: ${this._isMobileDevice ? '16px' : '18px'};
|
18057
18184
|
line-height: 24px;
|
18058
18185
|
position: relative;
|
18059
18186
|
padding-bottom: 10px;
|
@@ -18080,10 +18207,9 @@ class RbCarouselHorizontalInfoCardSE extends BaseSpotComponent {
|
|
18080
18207
|
|
18081
18208
|
.${prefix}__cta-button {
|
18082
18209
|
color: ${ctaTextColor};
|
18083
|
-
font-size: 10px;
|
18210
|
+
font-size: ${this._isMobileDevice ? '10px' : '12px'};
|
18084
18211
|
font-weight: 700;
|
18085
18212
|
font-family: "Source Sans 3", system-ui;
|
18086
|
-
letter-spacing: 1.4px;
|
18087
18213
|
border: none;
|
18088
18214
|
cursor: pointer;
|
18089
18215
|
padding: 10px 0;
|
@@ -18159,19 +18285,12 @@ class RbCarouselHorizontalInfoCardSE extends BaseSpotComponent {
|
|
18159
18285
|
font-size: 14px;
|
18160
18286
|
}
|
18161
18287
|
|
18162
|
-
.${prefix}__cta-button {
|
18163
|
-
font-size: 13px;
|
18164
|
-
}
|
18165
18288
|
}
|
18166
18289
|
|
18167
18290
|
@container (min-width: 1280px) {
|
18168
18291
|
.${prefix}__header {
|
18169
18292
|
font-size: 24px;
|
18170
18293
|
}
|
18171
|
-
|
18172
|
-
.${prefix}__cta-button {
|
18173
|
-
font-size: 14px;
|
18174
|
-
}
|
18175
18294
|
}
|
18176
18295
|
`;
|
18177
18296
|
}
|
@@ -18181,7 +18300,409 @@ class RbCarouselHorizontalInfoCardSE extends BaseSpotComponent {
|
|
18181
18300
|
enableMobileTexts = true, } = this._data;
|
18182
18301
|
const content = this._isMobileDevice && enableMobileTexts
|
18183
18302
|
? {
|
18184
|
-
|
18303
|
+
preHeader: mobilePreHeader,
|
18304
|
+
header: mobileHeader,
|
18305
|
+
description: mobileDescription,
|
18306
|
+
ctaText: mobileCtaText,
|
18307
|
+
}
|
18308
|
+
: { preHeader, header, description, ctaText };
|
18309
|
+
return Object.values(content).some(Boolean);
|
18310
|
+
}
|
18311
|
+
}
|
18312
|
+
|
18313
|
+
class RbCarouselHorizontalShortInfoCardSE extends BaseSpotComponent {
|
18314
|
+
constructor() {
|
18315
|
+
super();
|
18316
|
+
this.reRenderOnDeviceChange = true;
|
18317
|
+
}
|
18318
|
+
template() {
|
18319
|
+
const prefix = this._config.prefix;
|
18320
|
+
const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.BOTTOM,
|
18321
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
18322
|
+
enableMobileTexts = true, } = this._data;
|
18323
|
+
const content = this._isMobileDevice && enableMobileTexts
|
18324
|
+
? {
|
18325
|
+
preHeader: mobilePreHeader,
|
18326
|
+
header: mobileHeader,
|
18327
|
+
description: mobileDescription,
|
18328
|
+
ctaText: mobileCtaText,
|
18329
|
+
}
|
18330
|
+
: { preHeader, header, description, ctaText };
|
18331
|
+
const elements = this.hasContent
|
18332
|
+
? [
|
18333
|
+
renderElement('p', `${prefix}__preHeader`, content.preHeader),
|
18334
|
+
renderElement('h2', `${prefix}__header`, content.header),
|
18335
|
+
renderElement('p', `${prefix}__description`, content.description),
|
18336
|
+
renderElement('span', `${prefix}__cta-button`, content.ctaText),
|
18337
|
+
]
|
18338
|
+
: [];
|
18339
|
+
return `
|
18340
|
+
${importFonts()}
|
18341
|
+
<div class="${prefix}">
|
18342
|
+
<div class="${prefix}__content ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${textBlockPosition}">
|
18343
|
+
<div class="${prefix}__image"></div>
|
18344
|
+
<div class="${prefix}__text">
|
18345
|
+
<div class="${prefix}__text-container">
|
18346
|
+
${elements.join('')}
|
18347
|
+
</div>
|
18348
|
+
</div>
|
18349
|
+
</div>
|
18350
|
+
</div>
|
18351
|
+
`;
|
18352
|
+
}
|
18353
|
+
styles() {
|
18354
|
+
const { headerColor = '#212121', textColor = '#616161', backgroundColor = '#f7f5f3', ctaTextColor = '#b5914a', primaryImage, mobilePrimaryImage = primaryImage, } = this._data;
|
18355
|
+
const prefix = this._config.prefix;
|
18356
|
+
return `
|
18357
|
+
.${prefix} {
|
18358
|
+
width: 100%;
|
18359
|
+
height: 100%;
|
18360
|
+
position: relative;
|
18361
|
+
border-radius: 5px;
|
18362
|
+
}
|
18363
|
+
|
18364
|
+
.${prefix}__content {
|
18365
|
+
width: 100%;
|
18366
|
+
height: 100%;
|
18367
|
+
display: flex;
|
18368
|
+
flex-direction: column;
|
18369
|
+
overflow: hidden;
|
18370
|
+
border-radius: 5px;
|
18371
|
+
}
|
18372
|
+
|
18373
|
+
.${prefix}__image {
|
18374
|
+
width: 100%;
|
18375
|
+
height: 62.5%;
|
18376
|
+
background-image: url("${this._isMobileDevice ? mobilePrimaryImage : primaryImage}");
|
18377
|
+
background-position: center;
|
18378
|
+
background-repeat: no-repeat;
|
18379
|
+
background-size: cover;
|
18380
|
+
min-width: 100px;
|
18381
|
+
overflow: hidden;
|
18382
|
+
}
|
18383
|
+
|
18384
|
+
.${prefix}__text {
|
18385
|
+
background-color: ${backgroundColor};
|
18386
|
+
display: flex;
|
18387
|
+
flex-direction: column;
|
18388
|
+
justify-content: center;
|
18389
|
+
width: 100%;
|
18390
|
+
height: 37.5%;
|
18391
|
+
padding: 15px;
|
18392
|
+
box-sizing: border-box;
|
18393
|
+
}
|
18394
|
+
|
18395
|
+
.${prefix}__text-container {
|
18396
|
+
display: flex;
|
18397
|
+
flex-direction: column;
|
18398
|
+
gap: 5px;
|
18399
|
+
}
|
18400
|
+
|
18401
|
+
.${prefix}__preHeader {
|
18402
|
+
margin: 0;
|
18403
|
+
color:${headerColor};
|
18404
|
+
font-family: "Cormorant", system-ui;
|
18405
|
+
font-size: ${this._isMobileDevice ? '8px' : '9px'};
|
18406
|
+
line-height: normal;
|
18407
|
+
letter-spacing: 0.8px;
|
18408
|
+
}
|
18409
|
+
|
18410
|
+
.${prefix}__header {
|
18411
|
+
margin: 0;
|
18412
|
+
color: ${headerColor};
|
18413
|
+
font-family: "Cormorant", system-ui;
|
18414
|
+
font-weight: bold;
|
18415
|
+
font-size: ${this._isMobileDevice ? '16px' : '18px'};
|
18416
|
+
line-height: 24px;
|
18417
|
+
position: relative;
|
18418
|
+
padding-bottom: 10px;
|
18419
|
+
margin-bottom: 5px;
|
18420
|
+
}
|
18421
|
+
|
18422
|
+
.${prefix}__header::after {
|
18423
|
+
content: '';
|
18424
|
+
position: absolute;
|
18425
|
+
bottom: 0;
|
18426
|
+
left: 0;
|
18427
|
+
width: 76px;
|
18428
|
+
height: 1px;
|
18429
|
+
background-color: ${ctaTextColor};
|
18430
|
+
}
|
18431
|
+
|
18432
|
+
.${prefix}__description {
|
18433
|
+
color: ${textColor};
|
18434
|
+
margin: 0;
|
18435
|
+
font-size: 10px;
|
18436
|
+
font-family: "Source Sans 3", system-ui;
|
18437
|
+
font-weight: 400;
|
18438
|
+
}
|
18439
|
+
|
18440
|
+
.${prefix}__cta-button {
|
18441
|
+
color: ${ctaTextColor};
|
18442
|
+
font-size: ${this._isMobileDevice ? '10px' : '12px'};
|
18443
|
+
font-weight: 700;
|
18444
|
+
font-family: "Source Sans 3", system-ui;
|
18445
|
+
border: none;
|
18446
|
+
cursor: pointer;
|
18447
|
+
transition: opacity 0.3s ease;
|
18448
|
+
display: inline-block;
|
18449
|
+
align-self: flex-end;
|
18450
|
+
text-decoration: none;
|
18451
|
+
margin-top: auto;
|
18452
|
+
}
|
18453
|
+
|
18454
|
+
.${prefix}__content:hover .${prefix}__cta-button {
|
18455
|
+
opacity: 0.8;
|
18456
|
+
}
|
18457
|
+
|
18458
|
+
@container (min-width: 768px) {
|
18459
|
+
.${prefix}__preHeader {
|
18460
|
+
font-size: 9px;
|
18461
|
+
}
|
18462
|
+
|
18463
|
+
.${prefix}__cta-button {
|
18464
|
+
font-size: 12px;
|
18465
|
+
}
|
18466
|
+
}
|
18467
|
+
|
18468
|
+
@container (min-width: 1024px) {
|
18469
|
+
.${prefix}__text {
|
18470
|
+
padding: 20px;
|
18471
|
+
}
|
18472
|
+
|
18473
|
+
.${prefix}__text-container {
|
18474
|
+
padding-right: 20px;
|
18475
|
+
}
|
18476
|
+
|
18477
|
+
.${prefix}__preHeader {
|
18478
|
+
font-size: 10px;
|
18479
|
+
}
|
18480
|
+
|
18481
|
+
.${prefix}__header {
|
18482
|
+
font-size: 18px;
|
18483
|
+
}
|
18484
|
+
|
18485
|
+
.${prefix}__description {
|
18486
|
+
font-size: 14px;
|
18487
|
+
}
|
18488
|
+
}
|
18489
|
+
|
18490
|
+
@container (min-width: 1280px) {
|
18491
|
+
.${prefix}__header {
|
18492
|
+
font-size: 24px;
|
18493
|
+
}
|
18494
|
+
}
|
18495
|
+
`;
|
18496
|
+
}
|
18497
|
+
get hasContent() {
|
18498
|
+
const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
|
18499
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
18500
|
+
enableMobileTexts = true, } = this._data;
|
18501
|
+
const content = this._isMobileDevice && enableMobileTexts
|
18502
|
+
? {
|
18503
|
+
preHeader: mobilePreHeader,
|
18504
|
+
header: mobileHeader,
|
18505
|
+
description: mobileDescription,
|
18506
|
+
ctaText: mobileCtaText,
|
18507
|
+
}
|
18508
|
+
: { preHeader, header, description, ctaText };
|
18509
|
+
return Object.values(content).some(Boolean);
|
18510
|
+
}
|
18511
|
+
}
|
18512
|
+
|
18513
|
+
class RbCarouselVerticalSmallImageInfoCardSE extends BaseSpotComponent {
|
18514
|
+
constructor() {
|
18515
|
+
super();
|
18516
|
+
this.reRenderOnDeviceChange = true;
|
18517
|
+
}
|
18518
|
+
template() {
|
18519
|
+
const prefix = this._config.prefix;
|
18520
|
+
const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.BOTTOM,
|
18521
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
18522
|
+
enableMobileTexts = true, } = this._data;
|
18523
|
+
const content = this._isMobileDevice && enableMobileTexts
|
18524
|
+
? {
|
18525
|
+
preHeader: mobilePreHeader,
|
18526
|
+
header: mobileHeader,
|
18527
|
+
description: mobileDescription,
|
18528
|
+
ctaText: mobileCtaText,
|
18529
|
+
}
|
18530
|
+
: { preHeader, header, description, ctaText };
|
18531
|
+
const elements = this.hasContent
|
18532
|
+
? [
|
18533
|
+
renderElement('p', `${prefix}__preHeader`, content.preHeader),
|
18534
|
+
renderElement('h2', `${prefix}__header`, content.header),
|
18535
|
+
renderElement('p', `${prefix}__description`, content.description),
|
18536
|
+
renderElement('span', `${prefix}__cta-button`, content.ctaText),
|
18537
|
+
]
|
18538
|
+
: [];
|
18539
|
+
return `
|
18540
|
+
${importFonts()}
|
18541
|
+
<div class="${prefix}">
|
18542
|
+
<div class="${prefix}__content ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${textBlockPosition}">
|
18543
|
+
<div class="${prefix}__image"></div>
|
18544
|
+
<div class="${prefix}__text">
|
18545
|
+
<div class="${prefix}__text-container">
|
18546
|
+
${elements.join('')}
|
18547
|
+
</div>
|
18548
|
+
</div>
|
18549
|
+
</div>
|
18550
|
+
</div>
|
18551
|
+
`;
|
18552
|
+
}
|
18553
|
+
styles() {
|
18554
|
+
const { headerColor = '#212121', textColor = '#616161', backgroundColor = '#f7f5f3', ctaTextColor = '#b5914a', primaryImage, mobilePrimaryImage = primaryImage, } = this._data;
|
18555
|
+
const prefix = this._config.prefix;
|
18556
|
+
return `
|
18557
|
+
.${prefix} {
|
18558
|
+
width: 100%;
|
18559
|
+
height: 100%;
|
18560
|
+
position: relative;
|
18561
|
+
border-radius: 5px;
|
18562
|
+
}
|
18563
|
+
|
18564
|
+
.${prefix}__content {
|
18565
|
+
width: 100%;
|
18566
|
+
height: 100%;
|
18567
|
+
display: flex;
|
18568
|
+
flex-direction: column;
|
18569
|
+
overflow: hidden;
|
18570
|
+
border-radius: 5px;
|
18571
|
+
}
|
18572
|
+
|
18573
|
+
.${prefix}__image {
|
18574
|
+
width: 100%;
|
18575
|
+
height: 50%;
|
18576
|
+
background-image: url("${this._isMobileDevice ? mobilePrimaryImage : primaryImage}");
|
18577
|
+
background-position: center;
|
18578
|
+
background-repeat: no-repeat;
|
18579
|
+
background-size: cover;
|
18580
|
+
min-width: 100px;
|
18581
|
+
overflow: hidden;
|
18582
|
+
}
|
18583
|
+
|
18584
|
+
.${prefix}__text {
|
18585
|
+
background-color: ${backgroundColor};
|
18586
|
+
display: flex;
|
18587
|
+
flex-direction: column;
|
18588
|
+
justify-content: center;
|
18589
|
+
width: 100%;
|
18590
|
+
height: 50%;
|
18591
|
+
padding: 16px;
|
18592
|
+
box-sizing: border-box;
|
18593
|
+
}
|
18594
|
+
|
18595
|
+
.${prefix}__text-container {
|
18596
|
+
display: flex;
|
18597
|
+
flex-direction: column;
|
18598
|
+
gap: 5px;
|
18599
|
+
height: 100%;
|
18600
|
+
justify-content: space-between;
|
18601
|
+
}
|
18602
|
+
|
18603
|
+
.${prefix}__preHeader {
|
18604
|
+
margin: 0;
|
18605
|
+
color:${headerColor};
|
18606
|
+
font-family: "Cormorant", system-ui;
|
18607
|
+
font-size: ${this._isMobileDevice ? '8px' : '9px'};
|
18608
|
+
line-height: normal;
|
18609
|
+
letter-spacing: 0.8px;
|
18610
|
+
}
|
18611
|
+
|
18612
|
+
.${prefix}__header {
|
18613
|
+
margin: 0;
|
18614
|
+
color: ${headerColor};
|
18615
|
+
font-family: "Cormorant", system-ui;
|
18616
|
+
font-weight: bold;
|
18617
|
+
font-size: ${this._isMobileDevice ? '16px' : '18px'};
|
18618
|
+
line-height: 24px;
|
18619
|
+
position: relative;
|
18620
|
+
padding-bottom: 10px;
|
18621
|
+
margin-bottom: 5px;
|
18622
|
+
}
|
18623
|
+
|
18624
|
+
.${prefix}__header::after {
|
18625
|
+
content: '';
|
18626
|
+
position: absolute;
|
18627
|
+
bottom: 0;
|
18628
|
+
left: 0;
|
18629
|
+
width: 76px;
|
18630
|
+
height: 1px;
|
18631
|
+
background-color: ${ctaTextColor};
|
18632
|
+
}
|
18633
|
+
|
18634
|
+
.${prefix}__description {
|
18635
|
+
color: ${textColor};
|
18636
|
+
margin: 0;
|
18637
|
+
font-size: 10px;
|
18638
|
+
font-family: "Source Sans 3", system-ui;
|
18639
|
+
font-weight: 400;
|
18640
|
+
}
|
18641
|
+
|
18642
|
+
.${prefix}__cta-button {
|
18643
|
+
color: ${ctaTextColor};
|
18644
|
+
font-size: ${this._isMobileDevice ? '10px' : '12px'};
|
18645
|
+
font-weight: 700;
|
18646
|
+
font-family: "Source Sans 3", system-ui;
|
18647
|
+
border: none;
|
18648
|
+
cursor: pointer;
|
18649
|
+
transition: opacity 0.3s ease;
|
18650
|
+
display: inline-block;
|
18651
|
+
align-self: flex-end;
|
18652
|
+
text-decoration: none;
|
18653
|
+
margin-top: auto;
|
18654
|
+
}
|
18655
|
+
|
18656
|
+
.${prefix}__content:hover .${prefix}__cta-button {
|
18657
|
+
opacity: 0.8;
|
18658
|
+
}
|
18659
|
+
|
18660
|
+
@container (min-width: 768px) {
|
18661
|
+
.${prefix}__preHeader {
|
18662
|
+
font-size: 9px;
|
18663
|
+
}
|
18664
|
+
|
18665
|
+
.${prefix}__cta-button {
|
18666
|
+
font-size: 12px;
|
18667
|
+
}
|
18668
|
+
}
|
18669
|
+
|
18670
|
+
@container (min-width: 1024px) {
|
18671
|
+
.${prefix}__text {
|
18672
|
+
padding: 20px;
|
18673
|
+
}
|
18674
|
+
|
18675
|
+
.${prefix}__text-container {
|
18676
|
+
padding-right: 20px;
|
18677
|
+
}
|
18678
|
+
|
18679
|
+
.${prefix}__preHeader {
|
18680
|
+
font-size: 10px;
|
18681
|
+
}
|
18682
|
+
|
18683
|
+
.${prefix}__header {
|
18684
|
+
font-size: 18px;
|
18685
|
+
}
|
18686
|
+
|
18687
|
+
.${prefix}__description {
|
18688
|
+
font-size: 14px;
|
18689
|
+
}
|
18690
|
+
}
|
18691
|
+
|
18692
|
+
@container (min-width: 1280px) {
|
18693
|
+
.${prefix}__header {
|
18694
|
+
font-size: 24px;
|
18695
|
+
}
|
18696
|
+
}
|
18697
|
+
`;
|
18698
|
+
}
|
18699
|
+
get hasContent() {
|
18700
|
+
const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
|
18701
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
18702
|
+
enableMobileTexts = true, } = this._data;
|
18703
|
+
const content = this._isMobileDevice && enableMobileTexts
|
18704
|
+
? {
|
18705
|
+
preHeader: mobilePreHeader,
|
18185
18706
|
header: mobileHeader,
|
18186
18707
|
description: mobileDescription,
|
18187
18708
|
ctaText: mobileCtaText,
|
@@ -18281,20 +18802,26 @@ class RbHomepageHeroFullImageSE extends BaseSpotComponent {
|
|
18281
18802
|
`;
|
18282
18803
|
}
|
18283
18804
|
styles() {
|
18284
|
-
const { textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.BOTTOM_LEFT, mobileTextBlockPosition = textBlockPosition, } = this._data;
|
18805
|
+
const { textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.BOTTOM_LEFT, mobileTextBlockPosition = textBlockPosition, showContentGradient = true, } = this._data;
|
18285
18806
|
const desktopGradientDirection = this.getGradientDirection(textBlockPosition);
|
18286
18807
|
const mobileGradientDirection = this.getGradientDirection(mobileTextBlockPosition);
|
18287
18808
|
const linearGradient = generateGradientColor(this._config.overlay, 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 40%');
|
18288
18809
|
const { textColor = '#ffffff', ctaTextColor = textColor, ctaBorderColor = ctaTextColor, primaryImage, mobilePrimaryImage = primaryImage, } = this._data;
|
18289
18810
|
const prefix = this._config.prefix;
|
18811
|
+
// Determine mobile background image based on hasContent and enableGradient
|
18812
|
+
const mobileBackgroundImage = this.hasContent && showContentGradient
|
18813
|
+
? `background-image: linear-gradient(${mobileGradientDirection}, ${linearGradient}), url("${mobilePrimaryImage}");`
|
18814
|
+
: `background-image: url("${mobilePrimaryImage}");`;
|
18815
|
+
// Determine desktop background image based on hasContent and enableGradient
|
18816
|
+
const desktopBackgroundImage = this.hasContent && showContentGradient
|
18817
|
+
? `background-image: linear-gradient(${desktopGradientDirection}, ${linearGradient}), url("${primaryImage}");`
|
18818
|
+
: `background-image: url("${primaryImage}");`;
|
18290
18819
|
return `
|
18291
18820
|
.${prefix} {
|
18292
18821
|
display: flex;
|
18293
18822
|
width: 100%;
|
18294
18823
|
height: 100%;
|
18295
|
-
${
|
18296
|
-
? `background-image: linear-gradient(${mobileGradientDirection}, ${linearGradient}), url("${mobilePrimaryImage}");`
|
18297
|
-
: `background-image: url("${mobilePrimaryImage}");`}
|
18824
|
+
${mobileBackgroundImage}
|
18298
18825
|
background-size: cover;
|
18299
18826
|
background-repeat: no-repeat;
|
18300
18827
|
background-position: center;
|
@@ -18413,9 +18940,7 @@ class RbHomepageHeroFullImageSE extends BaseSpotComponent {
|
|
18413
18940
|
|
18414
18941
|
@container (min-width: 640px) {
|
18415
18942
|
.${prefix} {
|
18416
|
-
${
|
18417
|
-
? `background-image: linear-gradient(${desktopGradientDirection}, ${linearGradient}), url("${primaryImage}");`
|
18418
|
-
: `background-image: url("${primaryImage}");`}
|
18943
|
+
${desktopBackgroundImage}
|
18419
18944
|
}
|
18420
18945
|
|
18421
18946
|
.${prefix}__text > * {
|
@@ -19002,13 +19527,13 @@ class RbInTextSE extends BaseSpotComponent {
|
|
19002
19527
|
`;
|
19003
19528
|
}
|
19004
19529
|
styles() {
|
19005
|
-
const { textColor = '#212121', backgroundColor = 'transparent' } = this._data;
|
19530
|
+
const { textColor = '#212121', backgroundColor = 'transparent', textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.LEFT } = this._data;
|
19006
19531
|
const prefix = this._config.prefix;
|
19007
19532
|
return `
|
19008
19533
|
.${prefix} {
|
19009
19534
|
display: block;
|
19010
19535
|
cursor: pointer;
|
19011
|
-
|
19536
|
+
width: 100%;
|
19012
19537
|
padding: 0;
|
19013
19538
|
background-color: ${backgroundColor};
|
19014
19539
|
}
|
@@ -19019,6 +19544,7 @@ class RbInTextSE extends BaseSpotComponent {
|
|
19019
19544
|
color: ${textColor};
|
19020
19545
|
font-family: "Source Sans 3", system-ui;
|
19021
19546
|
margin: 0;
|
19547
|
+
text-align: ${textBlockPosition};
|
19022
19548
|
}
|
19023
19549
|
.${prefix}__header:hover {
|
19024
19550
|
color: #b5914a;
|
@@ -19472,7 +19998,7 @@ class RbLongToutTallSE extends BaseSpotComponent {
|
|
19472
19998
|
`;
|
19473
19999
|
}
|
19474
20000
|
styles() {
|
19475
|
-
const { textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.MIDDLE_LEFT, mobileTextBlockPosition = textBlockPosition
|
20001
|
+
const { textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.MIDDLE_LEFT, mobileTextBlockPosition = textBlockPosition } = this._data;
|
19476
20002
|
const desktopGradientDirection = this.getGradientDirection(textBlockPosition);
|
19477
20003
|
const mobileGradientDirection = this.getGradientDirection(mobileTextBlockPosition);
|
19478
20004
|
const linearGradient = generateGradientColor(this._config.overlay, 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 40%');
|
@@ -19934,7 +20460,7 @@ class RbSmallDiscoverToutSE extends BaseSpotComponent {
|
|
19934
20460
|
`;
|
19935
20461
|
}
|
19936
20462
|
styles() {
|
19937
|
-
const { textColor = '#000000', backgroundColor = 'transparent', primaryImage, mobilePrimaryImage = primaryImage
|
20463
|
+
const { textColor = '#000000', backgroundColor = 'transparent', primaryImage, mobilePrimaryImage = primaryImage } = this._data;
|
19938
20464
|
const prefix = this._config.prefix;
|
19939
20465
|
return `
|
19940
20466
|
.${prefix} {
|
@@ -20104,10 +20630,7 @@ class RbVideoPlayerSE extends BaseSpotComponent {
|
|
20104
20630
|
description: mobileDescription,
|
20105
20631
|
}
|
20106
20632
|
: { header, description };
|
20107
|
-
const elements = [
|
20108
|
-
renderElement('h2', `${prefix}__header`, content.header),
|
20109
|
-
renderElement('p', `${prefix}__description`, content.description),
|
20110
|
-
];
|
20633
|
+
const elements = [renderElement('h2', `${prefix}__header`, content.header), renderElement('p', `${prefix}__description`, content.description)];
|
20111
20634
|
return `
|
20112
20635
|
<div class="${prefix}__text ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${mobileTextBlockPosition}">
|
20113
20636
|
${elements.join('')}
|
@@ -20246,9 +20769,7 @@ class RbVideoPlayerSE extends BaseSpotComponent {
|
|
20246
20769
|
|
20247
20770
|
@container (max-width: 639px) {
|
20248
20771
|
.${prefix}::before {
|
20249
|
-
${this.hasContent
|
20250
|
-
? `background: linear-gradient(${mobileGradientDirection}, ${linearGradient});`
|
20251
|
-
: ``}
|
20772
|
+
${this.hasContent ? `background: linear-gradient(${mobileGradientDirection}, ${linearGradient});` : ''}
|
20252
20773
|
}
|
20253
20774
|
|
20254
20775
|
.${prefix}__text-block-mobile--${exports.ENUM_TEXT_BLOCK_POSITION.TOP_LEFT} {
|
@@ -20304,9 +20825,7 @@ class RbVideoPlayerSE extends BaseSpotComponent {
|
|
20304
20825
|
|
20305
20826
|
@container (min-width: 640px) {
|
20306
20827
|
.${prefix}::before {
|
20307
|
-
${this.hasContent
|
20308
|
-
? `background: linear-gradient(${desktopGradientDirection}, ${linearGradient});`
|
20309
|
-
: ``}
|
20828
|
+
${this.hasContent ? `background: linear-gradient(${desktopGradientDirection}, ${linearGradient});` : ''}
|
20310
20829
|
}
|
20311
20830
|
|
20312
20831
|
.${prefix}__text > * {
|
@@ -20514,6 +21033,12 @@ class SpotTemplateService {
|
|
20514
21033
|
[exports.RMN_SPOT_TYPE.RB_CAROUSEL_HORIZONTAL_INFO_CARD]: {
|
20515
21034
|
rbCarouselHorizontalInfoCard: RbCarouselHorizontalInfoCardSE,
|
20516
21035
|
},
|
21036
|
+
[exports.RMN_SPOT_TYPE.RB_CAROUSEL_VERTICAL_SMALL_IMAGE_INFO_CARD]: {
|
21037
|
+
rbCarouselVerticalSmallImageInfoCard: RbCarouselVerticalSmallImageInfoCardSE,
|
21038
|
+
},
|
21039
|
+
[exports.RMN_SPOT_TYPE.RB_CAROUSEL_HORIZONTAL_SHORT_INFO_CARD]: {
|
21040
|
+
rbCarouselHorizontalShortInfoCard: RbCarouselHorizontalShortInfoCardSE,
|
21041
|
+
},
|
20517
21042
|
};
|
20518
21043
|
}
|
20519
21044
|
initializeIabTemplates() {
|
@@ -20920,18 +21445,14 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
20920
21445
|
this.cloneToOriginalMap.set(newSpot, original);
|
20921
21446
|
// Add event delegation
|
20922
21447
|
let isDragging = false;
|
20923
|
-
slideElement.addEventListener('mousedown', () =>
|
20924
|
-
|
21448
|
+
slideElement.addEventListener('mousedown', () => {
|
21449
|
+
isDragging = false;
|
21450
|
+
});
|
21451
|
+
slideElement.addEventListener('mousemove', () => {
|
21452
|
+
isDragging = true;
|
21453
|
+
});
|
20925
21454
|
// Delegate all events to the original element
|
20926
|
-
const eventTypes = [
|
20927
|
-
'click',
|
20928
|
-
'mouseenter',
|
20929
|
-
'mouseleave',
|
20930
|
-
'mouseover',
|
20931
|
-
'mouseout',
|
20932
|
-
'focus',
|
20933
|
-
'blur',
|
20934
|
-
];
|
21455
|
+
const eventTypes = ['click', 'mouseenter', 'mouseleave', 'mouseover', 'mouseout', 'focus', 'blur'];
|
20935
21456
|
eventTypes.forEach((eventType) => {
|
20936
21457
|
newSpot.addEventListener(eventType, (e) => {
|
20937
21458
|
if (eventType === 'click' && isDragging) {
|
@@ -21218,8 +21739,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
21218
21739
|
updateDragPosition() {
|
21219
21740
|
if (!this.elements.slidesContainer || this.state.isTransitioning)
|
21220
21741
|
return;
|
21221
|
-
const translateX = -this.state.virtualIndex * 100 -
|
21222
|
-
(this.state.dragDistance / this.state.containerWidth) * 100;
|
21742
|
+
const translateX = -this.state.virtualIndex * 100 - (this.state.dragDistance / this.state.containerWidth) * 100;
|
21223
21743
|
this.elements.slidesContainer.style.transform = `translateX(${translateX}%)`;
|
21224
21744
|
this.elements.slidesContainer.style.transition = 'none';
|
21225
21745
|
}
|
@@ -21227,6 +21747,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
21227
21747
|
* Navigates to a specific slide
|
21228
21748
|
* Used primarily by dot navigation
|
21229
21749
|
*/
|
21750
|
+
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: Used for dot navigation
|
21230
21751
|
goToSlide(index) {
|
21231
21752
|
if (this.state.isTransitioning)
|
21232
21753
|
return;
|
@@ -21412,9 +21933,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
21412
21933
|
* Ensures only valid positions are used
|
21413
21934
|
*/
|
21414
21935
|
validateButtonsPosition() {
|
21415
|
-
if (this.state.useButtons &&
|
21416
|
-
!this.state.buttons.together &&
|
21417
|
-
this.state.buttons.position !== 'middle-sides') {
|
21936
|
+
if (this.state.useButtons && !this.state.buttons.together && this.state.buttons.position !== 'middle-sides') {
|
21418
21937
|
console.warn('LiquidCommerce Rmn Sdk: When buttons are not together, only "middle-sides" is allowed. Defaulting to "middle-sides".');
|
21419
21938
|
this.state.buttons.position = 'middle-sides';
|
21420
21939
|
}
|
@@ -21811,7 +22330,7 @@ class MonitorService {
|
|
21811
22330
|
}
|
21812
22331
|
}
|
21813
22332
|
}
|
21814
|
-
async fireAndPublishSpotEvent({ spotEvent, eventUrl, placementId, spotId, spotType
|
22333
|
+
async fireAndPublishSpotEvent({ spotEvent, eventUrl, placementId, spotId, spotType }) {
|
21815
22334
|
await fireEvent({
|
21816
22335
|
spotType,
|
21817
22336
|
event: spotEvent,
|
@@ -21830,8 +22349,7 @@ class MonitorService {
|
|
21830
22349
|
return AnalyticsTool.Other;
|
21831
22350
|
}
|
21832
22351
|
// Check for GTM
|
21833
|
-
if (typeof window.google_tag_manager !== 'undefined' ||
|
21834
|
-
typeof window.dataLayer !== 'undefined') {
|
22352
|
+
if (typeof window.google_tag_manager !== 'undefined' || typeof window.dataLayer !== 'undefined') {
|
21835
22353
|
return AnalyticsTool.GoogleTagManager;
|
21836
22354
|
}
|
21837
22355
|
// Check for GA (both Universal Analytics and GA4)
|
@@ -22014,14 +22532,10 @@ class SpotManagerService {
|
|
22014
22532
|
}
|
22015
22533
|
deepMerge(current, updates) {
|
22016
22534
|
return {
|
22017
|
-
identifier: updates.identifier
|
22018
|
-
? { ...current.identifier, ...updates.identifier }
|
22019
|
-
: current.identifier,
|
22535
|
+
identifier: updates.identifier ? { ...current.identifier, ...updates.identifier } : current.identifier,
|
22020
22536
|
dom: updates.dom ? { ...current.dom, ...updates.dom } : current.dom,
|
22021
22537
|
state: updates.state ? { ...current.state, ...updates.state } : current.state,
|
22022
|
-
displayConfig: updates.displayConfig
|
22023
|
-
? { ...current.displayConfig, ...updates.displayConfig }
|
22024
|
-
: current.displayConfig,
|
22538
|
+
displayConfig: updates.displayConfig ? { ...current.displayConfig, ...updates.displayConfig } : current.displayConfig,
|
22025
22539
|
};
|
22026
22540
|
}
|
22027
22541
|
}
|
@@ -22222,9 +22736,7 @@ class BrowserRmnClient {
|
|
22222
22736
|
if (!placement || !injectData) {
|
22223
22737
|
this.spotManagerService.updateSpotLifecycleState(placementId, {
|
22224
22738
|
state: {
|
22225
|
-
error: !placement
|
22226
|
-
? `Placement element not found for id "${placementId}".`
|
22227
|
-
: `Placement not found for id "${placementId}".`,
|
22739
|
+
error: !placement ? `Placement element not found for id "${placementId}".` : `Placement not found for id "${placementId}".`,
|
22228
22740
|
mounted: false,
|
22229
22741
|
loading: false,
|
22230
22742
|
},
|
@@ -22246,7 +22758,7 @@ class BrowserRmnClient {
|
|
22246
22758
|
if (!skeletonElement) {
|
22247
22759
|
this.spotManagerService.updateSpotLifecycleState(injectData.placementId, {
|
22248
22760
|
state: {
|
22249
|
-
error:
|
22761
|
+
error: 'Failed to create skeleton loader element.',
|
22250
22762
|
loading: true,
|
22251
22763
|
},
|
22252
22764
|
});
|
@@ -22459,7 +22971,7 @@ class BrowserRmnClient {
|
|
22459
22971
|
if (!carouselElement) {
|
22460
22972
|
this.spotManagerService.updateSpotLifecycleState(placementId, {
|
22461
22973
|
state: {
|
22462
|
-
error:
|
22974
|
+
error: 'Failed to inject spot carousel element. Could not create spot carousel element.',
|
22463
22975
|
mounted: false,
|
22464
22976
|
loading: false,
|
22465
22977
|
},
|
@@ -22534,23 +23046,21 @@ class ServerRmnClient {
|
|
22534
23046
|
/**
|
22535
23047
|
* Publishes the spot data for a given placement ID to the RMN.
|
22536
23048
|
*
|
22537
|
-
* @param {string}
|
22538
|
-
* @param {ISpot}
|
23049
|
+
* @param {string} _placementId - The unique identifier for the placement.
|
23050
|
+
* @param {ISpot} _spot - The spot data.
|
22539
23051
|
* @return {void} - Does not return any value.
|
22540
23052
|
*/
|
22541
|
-
|
22542
|
-
publishSpotToRmn(placementId, spot) {
|
23053
|
+
publishSpotToRmn(_placementId, _spot) {
|
22543
23054
|
console.warn('RmnSdk: Publishing spot elements is not supported in server-side environment.');
|
22544
23055
|
}
|
22545
23056
|
/**
|
22546
23057
|
* Injects the spot elements into their provided placement.
|
22547
23058
|
*
|
22548
|
-
* @param {IInjectSpotElementParams}
|
23059
|
+
* @param {IInjectSpotElementParams} _params - Parameters for injecting spot elements.
|
22549
23060
|
*
|
22550
23061
|
* @return {Promise<void>} - A promise that resolves when the spot elements are injected.
|
22551
23062
|
*/
|
22552
|
-
|
22553
|
-
async injectSpotElement(params) {
|
23063
|
+
async injectSpotElement(_params) {
|
22554
23064
|
console.warn('RmnSdk: Injecting spot elements is not supported in server-side environment.');
|
22555
23065
|
}
|
22556
23066
|
}
|