@liquidcommercedev/rmn-sdk 1.5.0-beta.33 → 1.5.0-beta.34

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 CHANGED
@@ -17147,7 +17147,7 @@ class DummyHTMLElement {
17147
17147
  }
17148
17148
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
17149
17149
  attachShadow(_options) {
17150
- throw new Error('attachShadow is not supported in non-browser environment');
17150
+ throw new Error('Liquid Commerce Rmn Sdk: attachShadow is not supported in non-browser environment');
17151
17151
  }
17152
17152
  appendChild(node) {
17153
17153
  return node;
@@ -17182,6 +17182,12 @@ class BaseSpotComponent extends BaseElement {
17182
17182
  writable: true,
17183
17183
  value: void 0
17184
17184
  });
17185
+ Object.defineProperty(this, "_container", {
17186
+ enumerable: true,
17187
+ configurable: true,
17188
+ writable: true,
17189
+ value: void 0
17190
+ });
17185
17191
  }
17186
17192
  initializeData(data, config) {
17187
17193
  if (this.dataInitialized) {
@@ -17198,19 +17204,19 @@ class BaseSpotComponent extends BaseElement {
17198
17204
  if (!this.initialized || !this.dataInitialized || !isBrowser) {
17199
17205
  return;
17200
17206
  }
17201
- const container = this._config.useShadowDom
17207
+ this._container = this._config.useShadowDom
17202
17208
  ? this.shadowRoot || this.attachShadow({ mode: 'open' })
17203
17209
  : this;
17204
- container.innerHTML = '';
17210
+ this._container.innerHTML = '';
17205
17211
  const style = document.createElement('style');
17206
17212
  style.textContent = this.baseStyles() + this.styles();
17207
- container.appendChild(style);
17213
+ this._container.appendChild(style);
17208
17214
  const content = this.template();
17209
17215
  if (typeof content === 'string') {
17210
- container.innerHTML += content;
17216
+ this._container.innerHTML += content;
17211
17217
  }
17212
17218
  else {
17213
- container.appendChild(content);
17219
+ this._container.appendChild(content);
17214
17220
  }
17215
17221
  }
17216
17222
  baseStyles() {
@@ -17538,7 +17544,7 @@ Object.defineProperty(LocalStorageService, "encryptData", {
17538
17544
 
17539
17545
  class ProximityObserver {
17540
17546
  constructor(elementIds, callback, options = {}) {
17541
- var _a, _b, _c, _d;
17547
+ var _a, _b;
17542
17548
  Object.defineProperty(this, "intersectionObserver", {
17543
17549
  enumerable: true,
17544
17550
  configurable: true,
@@ -17557,13 +17563,7 @@ class ProximityObserver {
17557
17563
  writable: true,
17558
17564
  value: void 0
17559
17565
  });
17560
- Object.defineProperty(this, "observedElements", {
17561
- enumerable: true,
17562
- configurable: true,
17563
- writable: true,
17564
- value: void 0
17565
- });
17566
- Object.defineProperty(this, "processedGroups", {
17566
+ Object.defineProperty(this, "processedIds", {
17567
17567
  enumerable: true,
17568
17568
  configurable: true,
17569
17569
  writable: true,
@@ -17575,13 +17575,7 @@ class ProximityObserver {
17575
17575
  writable: true,
17576
17576
  value: void 0
17577
17577
  });
17578
- Object.defineProperty(this, "verticalThreshold", {
17579
- enumerable: true,
17580
- configurable: true,
17581
- writable: true,
17582
- value: void 0
17583
- });
17584
- Object.defineProperty(this, "horizontalThreshold", {
17578
+ Object.defineProperty(this, "proximityThreshold", {
17585
17579
  enumerable: true,
17586
17580
  configurable: true,
17587
17581
  writable: true,
@@ -17597,125 +17591,130 @@ class ProximityObserver {
17597
17591
  enumerable: true,
17598
17592
  configurable: true,
17599
17593
  writable: true,
17600
- value: void 0
17594
+ value: 20
17601
17595
  });
17602
17596
  this.targetIds = new Set(elementIds);
17603
- this.observedElements = new Map();
17604
- this.processedGroups = new Set();
17597
+ this.processedIds = new Set();
17605
17598
  this.callback = callback;
17606
- this.verticalThreshold = (_a = options.verticalThreshold) !== null && _a !== void 0 ? _a : 200;
17607
- this.horizontalThreshold = (_b = options.horizontalThreshold) !== null && _b !== void 0 ? _b : 400;
17608
- this.intersectionMargin = (_c = options.intersectionMargin) !== null && _c !== void 0 ? _c : '1000px';
17609
- this.maxGroupSize = (_d = options.maxGroupSize) !== null && _d !== void 0 ? _d : 4;
17610
- this.initializeIntersectionObserver();
17611
- this.initializeMutationObserver();
17612
- this.startObservingExistingElements();
17613
- }
17614
- initializeIntersectionObserver() {
17599
+ this.proximityThreshold = (_a = options.proximityThreshold) !== null && _a !== void 0 ? _a : 500;
17600
+ this.intersectionMargin = (_b = options.intersectionMargin) !== null && _b !== void 0 ? _b : '2000px';
17601
+ this.initializeObservers();
17602
+ this.observeExistingElements();
17603
+ }
17604
+ initializeObservers() {
17605
+ // Initialize intersection observer to detect when elements are near viewport
17615
17606
  this.intersectionObserver = new IntersectionObserver(this.handleIntersection.bind(this), {
17616
17607
  rootMargin: this.intersectionMargin,
17617
- threshold: 0,
17618
17608
  });
17619
- }
17620
- initializeMutationObserver() {
17621
- this.mutationObserver = new MutationObserver(this.handleMutation.bind(this));
17609
+ // Initialize mutation observer to detect new elements
17610
+ this.mutationObserver = new MutationObserver((mutations) => {
17611
+ mutations.forEach((mutation) => {
17612
+ if (mutation.type === 'childList') {
17613
+ mutation.addedNodes.forEach((node) => {
17614
+ if (node instanceof HTMLElement) {
17615
+ this.checkElement(node);
17616
+ node.querySelectorAll('*').forEach((el) => {
17617
+ if (el instanceof HTMLElement) {
17618
+ this.checkElement(el);
17619
+ }
17620
+ });
17621
+ }
17622
+ });
17623
+ }
17624
+ });
17625
+ });
17626
+ // Start observing DOM changes
17622
17627
  this.mutationObserver.observe(document.body, {
17623
17628
  childList: true,
17624
17629
  subtree: true,
17625
17630
  });
17626
17631
  }
17627
- isElementInViewportRange(element) {
17628
- const rect = element.getBoundingClientRect();
17629
- const viewportWidth = window.innerWidth;
17630
- const extendedBounds = 200; // Additional buffer space
17631
- // Check if element is within viewport bounds plus buffer
17632
- return rect.right >= -extendedBounds && rect.left <= viewportWidth + extendedBounds;
17633
- }
17634
- findNearbyElements(element) {
17635
- const elementRect = element.getBoundingClientRect();
17636
- const nearbyElements = [];
17637
- const elementCenterX = elementRect.left + elementRect.width / 2;
17638
- const elementCenterY = elementRect.top + elementRect.height / 2;
17639
- // First, collect potential nearby elements
17640
- this.observedElements.forEach((el) => {
17641
- if (el.id === element.id || this.isElementProcessed(el.id))
17642
- return;
17643
- // Skip elements that are far outside viewport range
17644
- if (!this.isElementInViewportRange(el))
17645
- return;
17646
- const targetRect = el.getBoundingClientRect();
17647
- const targetCenterX = targetRect.left + targetRect.width / 2;
17648
- const targetCenterY = targetRect.top + targetRect.height / 2;
17649
- const horizontalDistance = Math.abs(elementCenterX - targetCenterX);
17650
- const verticalDistance = Math.abs(elementCenterY - targetCenterY);
17651
- if (horizontalDistance <= this.horizontalThreshold &&
17652
- verticalDistance <= this.verticalThreshold) {
17653
- // Calculate total distance for sorting
17654
- const totalDistance = Math.sqrt(Math.pow(horizontalDistance, 2) + Math.pow(verticalDistance, 2));
17655
- nearbyElements.push({ element: el, distance: totalDistance });
17632
+ checkElement(element) {
17633
+ if (element.id && this.targetIds.has(element.id) && !this.processedIds.has(element.id)) {
17634
+ this.intersectionObserver.observe(element);
17635
+ }
17636
+ }
17637
+ findNearbyTargetIds(element) {
17638
+ // Cache element rectangle to avoid multiple calculations
17639
+ const elementCenter = this.getElementCenter(element);
17640
+ const nearbyTargets = [];
17641
+ // Use for...of instead of forEach for better performance and ability to break early
17642
+ for (const targetId of this.targetIds) {
17643
+ // Early exit conditions
17644
+ if (this.processedIds.has(targetId))
17645
+ continue;
17646
+ if (targetId === element.id)
17647
+ continue;
17648
+ const targetElement = document.getElementById(targetId);
17649
+ if (!targetElement)
17650
+ continue;
17651
+ // Calculate distance between element centers
17652
+ const targetCenter = this.getElementCenter(targetElement);
17653
+ const distance = this.calculateDistance(elementCenter, targetCenter);
17654
+ if (distance <= this.proximityThreshold) {
17655
+ nearbyTargets.push({ id: targetId, distance });
17656
+ // Early exit if we've reached maxResults
17657
+ if (nearbyTargets.length >= this.maxGroupSize)
17658
+ break;
17656
17659
  }
17657
- });
17658
- // Sort by distance and limit to maxGroupSize - 1
17659
- return nearbyElements
17660
- .sort((a, b) => a.distance - b.distance)
17661
- .slice(0, this.maxGroupSize - 1)
17662
- .map((item) => item.element);
17660
+ }
17661
+ // Sort by distance and return only the IDs
17662
+ return nearbyTargets.sort((a, b) => a.distance - b.distance).map((target) => target.id);
17663
17663
  }
17664
17664
  handleIntersection(entries) {
17665
17665
  entries.forEach((entry) => {
17666
17666
  if (!entry.isIntersecting)
17667
17667
  return;
17668
17668
  const element = entry.target;
17669
- if (this.isElementProcessed(element.id))
17670
- return;
17671
- // Only process if element is in viewport range
17672
- if (!this.isElementInViewportRange(element))
17669
+ if (!element.id || this.processedIds.has(element.id))
17673
17670
  return;
17674
- const nearbyElements = this.findNearbyElements(element);
17675
- const groupIds = [element.id, ...nearbyElements.map((el) => el.id)];
17676
- const groupKey = groupIds.sort().join(',');
17677
- if (!this.processedGroups.has(groupKey)) {
17678
- this.processedGroups.add(groupKey);
17679
- this.callback(groupIds);
17671
+ // Find nearby target elements
17672
+ const allGroupIds = [element.id, ...this.findNearbyTargetIds(element)];
17673
+ // Take only up to maxGroupSize elements
17674
+ const groupIdsToProcess = allGroupIds.slice(0, this.maxGroupSize);
17675
+ // Mark all found IDs as processed
17676
+ groupIdsToProcess.forEach((id) => {
17677
+ this.processedIds.add(id);
17678
+ const el = document.getElementById(id);
17679
+ if (el)
17680
+ this.intersectionObserver.unobserve(el);
17681
+ });
17682
+ // Trigger callback with the group
17683
+ this.callback(groupIdsToProcess);
17684
+ // Cleanup if all elements have been processed
17685
+ if (this.targetIds.size === this.processedIds.size) {
17686
+ this.cleanup();
17680
17687
  }
17681
17688
  });
17682
17689
  }
17683
- isElementProcessed(elementId) {
17684
- return Array.from(this.processedGroups).some((group) => group.split(',').includes(elementId));
17685
- }
17686
- handleMutation(mutations) {
17687
- mutations.forEach((mutation) => {
17688
- if (mutation.type === 'childList') {
17689
- mutation.addedNodes.forEach((node) => {
17690
- if (node.nodeType === Node.ELEMENT_NODE) {
17691
- this.checkAndObserveElement(node);
17692
- node
17693
- .querySelectorAll('*')
17694
- .forEach((el) => this.checkAndObserveElement(el));
17695
- }
17696
- });
17697
- }
17698
- });
17690
+ /**
17691
+ * Calculates the center point of an HTML element.
17692
+ */
17693
+ getElementCenter(element) {
17694
+ const rect = element.getBoundingClientRect();
17695
+ return {
17696
+ x: rect.left + rect.width / 2,
17697
+ y: rect.top + rect.height / 2,
17698
+ };
17699
17699
  }
17700
- checkAndObserveElement(element) {
17701
- if (element.id && this.targetIds.has(element.id) && !this.observedElements.has(element.id)) {
17702
- this.observedElements.set(element.id, element);
17703
- this.intersectionObserver.observe(element);
17704
- }
17700
+ /**
17701
+ * Calculates the Euclidean distance between two points.
17702
+ */
17703
+ calculateDistance(point1, point2) {
17704
+ return Math.hypot(point1.x - point2.x, point1.y - point2.y);
17705
17705
  }
17706
- startObservingExistingElements() {
17706
+ observeExistingElements() {
17707
17707
  this.targetIds.forEach((id) => {
17708
17708
  const element = document.getElementById(id);
17709
17709
  if (element) {
17710
- this.checkAndObserveElement(element);
17710
+ this.checkElement(element);
17711
17711
  }
17712
17712
  });
17713
17713
  }
17714
17714
  cleanup() {
17715
17715
  this.intersectionObserver.disconnect();
17716
17716
  this.mutationObserver.disconnect();
17717
- this.observedElements.clear();
17718
- this.processedGroups.clear();
17717
+ this.processedIds.clear();
17719
17718
  this.targetIds.clear();
17720
17719
  }
17721
17720
  }
@@ -19455,144 +19454,38 @@ class RbVideoPlayerSE extends BaseSpotComponent {
19455
19454
  writable: true,
19456
19455
  value: () => `.${this._config.prefix}__video-element`
19457
19456
  });
19458
- Object.defineProperty(this, "timelineSelector", {
19459
- enumerable: true,
19460
- configurable: true,
19461
- writable: true,
19462
- value: () => `.${this._config.prefix}__timeline`
19463
- });
19464
- Object.defineProperty(this, "playButtonSelector", {
19465
- enumerable: true,
19466
- configurable: true,
19467
- writable: true,
19468
- value: () => `.${this._config.prefix}__play-button`
19469
- });
19470
19457
  Object.defineProperty(this, "muteButtonSelector", {
19471
19458
  enumerable: true,
19472
19459
  configurable: true,
19473
19460
  writable: true,
19474
19461
  value: () => `.${this._config.prefix}__mute-button`
19475
19462
  });
19476
- Object.defineProperty(this, "volumeSliderSelector", {
19477
- enumerable: true,
19478
- configurable: true,
19479
- writable: true,
19480
- value: () => `.${this._config.prefix}__volume-slider`
19481
- });
19482
19463
  Object.defineProperty(this, "video", {
19483
19464
  enumerable: true,
19484
19465
  configurable: true,
19485
19466
  writable: true,
19486
19467
  value: null
19487
19468
  });
19488
- Object.defineProperty(this, "timeline", {
19489
- enumerable: true,
19490
- configurable: true,
19491
- writable: true,
19492
- value: null
19493
- });
19494
19469
  this.bindEventHandlers();
19495
19470
  }
19496
- get container() {
19497
- return this._config.useShadowDom && this.shadowRoot ? this.shadowRoot : this;
19498
- }
19499
19471
  // Initialization Methods
19500
19472
  bindEventHandlers() {
19501
- this.handlePlayPause = this.handlePlayPause.bind(this);
19502
- this.handleTimelineClick = this.handleTimelineClick.bind(this);
19503
- this.handleVolumeChange = this.handleVolumeChange.bind(this);
19504
- this.updateProgress = this.updateProgress.bind(this);
19505
- this.hideOverlay = this.hideOverlay.bind(this);
19506
19473
  this.handleMuteToggle = this.handleMuteToggle.bind(this);
19507
19474
  }
19508
19475
  // UI Update Methods
19509
- updatePlayIcon(isPaused) {
19510
- const playIcon = this.container.querySelector(`.${this._config.prefix}__play-icon`);
19511
- if (!playIcon)
19512
- return;
19513
- playIcon.innerHTML = isPaused ? this.getPlayIcon() : this.getPauseIcon();
19514
- }
19515
19476
  updateMuteIcon(isMuted) {
19516
- const muteIcon = this.container.querySelector(`.${this._config.prefix}__mute-icon`);
19477
+ const muteIcon = this._container.querySelector(`.${this._config.prefix}__mute-icon`);
19517
19478
  if (!muteIcon)
19518
19479
  return;
19519
19480
  muteIcon.innerHTML = isMuted ? this.getMuteIcon() : this.getUnmuteIcon();
19520
19481
  }
19521
- updateProgress() {
19522
- if (!this.video)
19523
- return;
19524
- const progress = this.container.querySelector(`.${this._config.prefix}__progress`);
19525
- const currentTime = this.container.querySelector(`.${this._config.prefix}__current-time`);
19526
- const duration = this.container.querySelector(`.${this._config.prefix}__duration`);
19527
- if (progress instanceof HTMLElement && this.video.duration) {
19528
- const percentage = (this.video.currentTime / this.video.duration) * 100;
19529
- progress.style.width = `${percentage}%`;
19530
- }
19531
- if (currentTime instanceof HTMLElement) {
19532
- currentTime.textContent = this.formatTime(this.video.currentTime);
19533
- }
19534
- if (duration instanceof HTMLElement && this.video.duration) {
19535
- duration.textContent = this.formatTime(this.video.duration);
19536
- }
19537
- }
19538
19482
  // Event Handlers
19539
- handlePlayPause(event) {
19540
- event.preventDefault();
19541
- if (!this.video)
19542
- return;
19543
- if (this.video.paused) {
19544
- this.video
19545
- .play()
19546
- .then(() => {
19547
- this.updatePlayIcon(false);
19548
- this.hideOverlay();
19549
- })
19550
- .catch(console.error);
19551
- }
19552
- else {
19553
- this.video.pause();
19554
- this.updatePlayIcon(true);
19555
- }
19556
- }
19557
- handleTimelineClick(event) {
19558
- event.preventDefault();
19559
- if (!this.video || !this.timeline)
19560
- return;
19561
- const rect = this.timeline.getBoundingClientRect();
19562
- const position = (event.clientX - rect.left) / rect.width;
19563
- this.video.currentTime = position * this.video.duration;
19564
- }
19565
- handleVolumeChange(event) {
19566
- if (!this.video)
19567
- return;
19568
- const input = event.target;
19569
- this.video.volume = parseFloat(input.value);
19570
- }
19571
19483
  handleMuteToggle(event) {
19572
19484
  event.preventDefault();
19573
19485
  if (!this.video)
19574
19486
  return;
19575
19487
  this.video.muted = !this.video.muted;
19576
19488
  this.updateMuteIcon(this.video.muted);
19577
- const volumeSlider = this.container.querySelector(this.volumeSliderSelector());
19578
- if (volumeSlider) {
19579
- volumeSlider.value = this.video.muted ? '0' : this.video.volume.toString();
19580
- }
19581
- }
19582
- // Utility Methods
19583
- formatTime(seconds) {
19584
- const minutes = Math.floor(seconds / 60);
19585
- const remainingSeconds = Math.floor(seconds % 60);
19586
- return `${minutes}:${remainingSeconds.toString().padStart(2, '0')}`;
19587
- }
19588
- hideOverlay() {
19589
- const overlay = this.container.querySelector(`.${this._config.prefix}__overlay`);
19590
- if (!(overlay instanceof HTMLElement))
19591
- return;
19592
- overlay.style.opacity = '0';
19593
- setTimeout(() => {
19594
- overlay.style.display = 'none';
19595
- }, 300);
19596
19489
  }
19597
19490
  // Icon Templates
19598
19491
  getMuteIcon() {
@@ -19612,95 +19505,32 @@ class RbVideoPlayerSE extends BaseSpotComponent {
19612
19505
  </svg>
19613
19506
  `;
19614
19507
  }
19615
- getPlayIcon() {
19616
- return `
19617
- <svg height="20px" viewBox="0 0 512 512" width="20px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
19618
- <path fill="#fff" d="M405.2,232.9L126.8,67.2c-3.4-2-6.9-3.2-10.9-3.2c-10.9,0-19.8,9-19.8,20H96v344h0.1c0,11,8.9,20,19.8,20 c4.1,0,7.5-1.4,11.2-3.4l278.1-165.5c6.6-5.5,10.8-13.8,10.8-23.1C416,246.7,411.8,238.5,405.2,232.9z"/>
19619
- </svg>
19620
- `;
19621
- }
19622
- getPauseIcon() {
19623
- return `
19624
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
19625
- <path fill="#fff" d="M11 22h-4v-20h4v20zm6-20h-4v20h4v-20z"/>
19626
- </svg>
19627
- `;
19628
- }
19629
19508
  // Lifecycle Methods
19630
19509
  connected() {
19631
19510
  this.initializeElements();
19632
- this.setupAutoplay();
19633
19511
  this.attachEventListeners();
19634
19512
  }
19635
19513
  disconnected() {
19636
19514
  this.removeEventListeners();
19637
19515
  }
19638
19516
  initializeElements() {
19639
- this.video = this.container.querySelector(this.videoSelector());
19640
- this.timeline = this.container.querySelector(this.timelineSelector());
19641
- }
19642
- setupAutoplay() {
19643
- if (this._data.video.autoplay && this.video) {
19644
- setTimeout(() => {
19645
- this.hideOverlay();
19646
- }, 1000);
19647
- }
19517
+ this.video = this._container.querySelector(this.videoSelector());
19648
19518
  }
19649
19519
  attachEventListeners() {
19650
- var _a;
19651
19520
  if (!this.video)
19652
19521
  return;
19653
- this.video.addEventListener('timeupdate', this.updateProgress);
19654
- this.video.addEventListener('loadedmetadata', this.updateProgress);
19655
- this.video.addEventListener('play', this.hideOverlay);
19656
- this.video.addEventListener('volumechange', () => {
19657
- if (this.video) {
19658
- this.updateMuteIcon(this.video.muted || this.video.volume === 0);
19659
- }
19660
- });
19661
- const playButton = this.container.querySelector(this.playButtonSelector());
19662
- const muteButton = this.container.querySelector(this.muteButtonSelector());
19663
- const volumeSlider = this.container.querySelector(this.volumeSliderSelector());
19664
- playButton === null || playButton === void 0 ? void 0 : playButton.addEventListener('click', this.handlePlayPause);
19522
+ const muteButton = this._container.querySelector(this.muteButtonSelector());
19665
19523
  muteButton === null || muteButton === void 0 ? void 0 : muteButton.addEventListener('click', this.handleMuteToggle);
19666
- (_a = this.timeline) === null || _a === void 0 ? void 0 : _a.addEventListener('click', this.handleTimelineClick);
19667
- volumeSlider === null || volumeSlider === void 0 ? void 0 : volumeSlider.addEventListener('input', this.handleVolumeChange);
19668
19524
  }
19669
19525
  removeEventListeners() {
19670
- var _a;
19671
19526
  if (!this.video)
19672
19527
  return;
19673
- this.video.removeEventListener('timeupdate', this.updateProgress);
19674
- this.video.removeEventListener('loadedmetadata', this.updateProgress);
19675
- this.video.removeEventListener('play', this.hideOverlay);
19676
- this.video.removeEventListener('volumechange', () => null);
19677
- const playButton = this.container.querySelector(this.playButtonSelector());
19678
- const muteButton = this.container.querySelector(this.muteButtonSelector());
19679
- const volumeSlider = this.container.querySelector(this.volumeSliderSelector());
19680
- playButton === null || playButton === void 0 ? void 0 : playButton.removeEventListener('click', this.handlePlayPause);
19528
+ const muteButton = this._container.querySelector(this.muteButtonSelector());
19681
19529
  muteButton === null || muteButton === void 0 ? void 0 : muteButton.removeEventListener('click', this.handleMuteToggle);
19682
- (_a = this.timeline) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', this.handleTimelineClick);
19683
- volumeSlider === null || volumeSlider === void 0 ? void 0 : volumeSlider.removeEventListener('input', this.handleVolumeChange);
19684
19530
  }
19685
19531
  template() {
19686
19532
  const prefix = this._config.prefix;
19687
- const { url, posterTitle, posterDescription,
19688
- // eslint-disable-next-line @typescript-eslint/naming-convention
19689
- autoplay,
19690
- // eslint-disable-next-line @typescript-eslint/naming-convention
19691
- mute,
19692
- // eslint-disable-next-line @typescript-eslint/naming-convention
19693
- loop,
19694
- // eslint-disable-next-line @typescript-eslint/naming-convention
19695
- showControls,
19696
- // eslint-disable-next-line @typescript-eslint/naming-convention
19697
- showPlay,
19698
- // eslint-disable-next-line @typescript-eslint/naming-convention
19699
- showTimeline,
19700
- // eslint-disable-next-line @typescript-eslint/naming-convention
19701
- showVolume,
19702
- // eslint-disable-next-line @typescript-eslint/naming-convention
19703
- showTime, } = this._data.video;
19533
+ const { url, posterTitle, posterDescription } = this._data.video;
19704
19534
  if (!url) {
19705
19535
  return '<p>Please provide a video source</p>';
19706
19536
  }
@@ -19721,72 +19551,31 @@ class RbVideoPlayerSE extends BaseSpotComponent {
19721
19551
  <video
19722
19552
  class="${prefix}__video-element"
19723
19553
  src="${url}"
19724
- ${autoplay ? 'autoplay' : ''}
19725
- ${mute ? 'muted' : ''}
19726
- ${loop ? 'loop' : ''}
19554
+ autoplay
19555
+ muted
19556
+ loop
19727
19557
  preload="metadata"
19728
19558
  >
19729
19559
  Your browser doesn't support HTML5 video playback.
19730
19560
  </video>
19731
19561
  </div>
19732
- `;
19733
- const renderPlayButton = () => !showPlay
19734
- ? ''
19735
- : `
19736
- <button type="button" class="${prefix}__play-button">
19737
- <span class="${prefix}__play-icon">
19738
- ${autoplay ? this.getPauseIcon() : this.getPlayIcon()}
19739
- </span>
19740
- </button>
19741
19562
  `;
19742
19563
  const renderMuteButton = () => `
19743
19564
  <button type="button" class="${prefix}__mute-button">
19744
19565
  <span class="${prefix}__mute-icon">
19745
- ${mute ? this.getMuteIcon() : this.getUnmuteIcon()}
19566
+ ${this.getMuteIcon()}
19746
19567
  </span>
19747
19568
  </button>
19748
19569
  `;
19749
- const renderVolumeControl = () => !showVolume
19750
- ? ''
19751
- : `
19752
- <div class="${prefix}__volume-control">
19753
- <input
19754
- type="range"
19755
- min="0"
19756
- max="1"
19757
- step="0.1"
19758
- value="${mute ? '0' : '1'}"
19759
- class="${prefix}__volume-slider"
19760
- />
19761
- </div>
19762
- `;
19763
- const renderTimeline = () => !showTimeline
19764
- ? ''
19765
- : `
19766
- <div class="${prefix}__timeline">
19767
- <div class="${prefix}__progress"></div>
19768
- </div>
19769
- `;
19770
- const renderTime = () => !showTime
19771
- ? ''
19772
- : `
19773
- <div class="${prefix}__time">
19774
- <span class="${prefix}__current-time">0:00</span> /
19775
- <span class="${prefix}__duration">0:00</span>
19776
- </div>
19777
- `;
19778
- const renderControls = () => !showControls
19779
- ? ''
19780
- : `
19570
+ const renderControls = () => `
19781
19571
  <div class="${prefix}__controls">
19782
- ${renderPlayButton()}
19783
19572
  ${renderMuteButton()}
19784
- ${renderVolumeControl()}
19785
- ${renderTimeline()}
19786
- ${renderTime()}
19787
19573
  </div>
19788
19574
  `;
19789
19575
  return `
19576
+ ${GFONT_PRECONNECT}
19577
+ ${GFONT_SOURCE_SANS_3}
19578
+ ${GFONT_CORMORANT}
19790
19579
  <div class="${prefix}">
19791
19580
  ${renderOverlay()}
19792
19581
  ${renderVideo()}
@@ -19801,7 +19590,6 @@ class RbVideoPlayerSE extends BaseSpotComponent {
19801
19590
  width: 100%;
19802
19591
  height: 100%;
19803
19592
  background: #000;
19804
- border-radius: 8px;
19805
19593
  overflow: hidden;
19806
19594
  position: relative;
19807
19595
  }
@@ -19812,33 +19600,39 @@ class RbVideoPlayerSE extends BaseSpotComponent {
19812
19600
  left: 0;
19813
19601
  right: 0;
19814
19602
  z-index: 2;
19815
- background-image: url('${this._data.video.poster}');
19816
- background-color: rgba(0, 0, 0, 0.5);
19817
- transition: opacity 0.3s ease;
19818
19603
  width: 100%;
19819
19604
  height: 100%;
19820
19605
  display: flex;
19821
19606
  flex-direction: column;
19822
19607
  justify-content: flex-end;
19608
+ background-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 40%);
19823
19609
  }
19824
19610
 
19825
19611
  .${prefix}__overlay-text {
19826
19612
  padding: 3rem;
19827
19613
  display: flex;
19828
19614
  flex-direction: column;
19829
- gap: 15px;
19615
+ gap: 8px;
19830
19616
  }
19831
19617
 
19832
19618
  .${prefix}__title {
19833
19619
  color: #fff;
19620
+ font-size: 26px;
19834
19621
  margin: 0;
19835
- font-size: 1.5rem;
19622
+ font-family: "Cormorant", system-ui;
19623
+ font-style: normal;
19624
+ font-weight: 300;
19625
+ line-height: normal;
19836
19626
  }
19837
19627
 
19838
19628
  .${prefix}__description {
19839
19629
  color: #ccc;
19840
19630
  margin: 0;
19841
- font-size: 1rem;
19631
+ font-size: 13px;
19632
+ font-family: "Source Sans 3", system-ui;
19633
+ font-style: normal;
19634
+ font-weight: 400;
19635
+ line-height: 20px;
19842
19636
  }
19843
19637
 
19844
19638
  .${prefix}__video-container {
@@ -19856,75 +19650,23 @@ class RbVideoPlayerSE extends BaseSpotComponent {
19856
19650
 
19857
19651
  .${prefix}__controls {
19858
19652
  position: absolute;
19859
- bottom: 0;
19860
- left: 0;
19861
- right: 0;
19862
- background: rgba(0, 0, 0, 0.7);
19653
+ bottom: 5px;
19654
+ right: 5px;
19655
+ background: rgba(0, 0, 0, 0.5);
19863
19656
  padding: 8px;
19864
19657
  display: flex;
19865
19658
  align-items: center;
19866
- gap: 8px;
19867
19659
  opacity: 0;
19868
19660
  transition: opacity 0.3s;
19869
19661
  z-index: 3;
19662
+ width: fit-content;
19663
+ border-radius: 50%;
19870
19664
  }
19871
19665
 
19872
19666
  .${prefix}:hover .${prefix}__controls {
19873
19667
  opacity: 1;
19874
19668
  }
19875
19669
 
19876
- .${prefix}__play-button {
19877
- background: none;
19878
- border: none;
19879
- color: white;
19880
- cursor: pointer;
19881
- width: 32px;
19882
- height: 32px;
19883
- padding: 0;
19884
- display: flex;
19885
- align-items: center;
19886
- justify-content: center;
19887
- }
19888
-
19889
- .${prefix}__play-icon svg {
19890
- width: 20px;
19891
- height: 20px;
19892
- }
19893
-
19894
- .${prefix}__play-button:hover {
19895
- opacity: 0.8;
19896
- }
19897
-
19898
- .${prefix}__timeline {
19899
- flex-grow: 1;
19900
- height: 4px;
19901
- background: rgba(255, 255, 255, 0.3);
19902
- cursor: pointer;
19903
- position: relative;
19904
- }
19905
-
19906
- .${prefix}__progress {
19907
- height: 100%;
19908
- background: #fff;
19909
- width: 0%;
19910
- }
19911
-
19912
- .${prefix}__time {
19913
- color: white;
19914
- font-size: 14px;
19915
- min-width: 100px;
19916
- text-align: center;
19917
- }
19918
-
19919
- .${prefix}__volume-control {
19920
- width: 100px;
19921
- }
19922
-
19923
- .${prefix}__volume-slider {
19924
- width: 100%;
19925
- cursor: pointer;
19926
- }
19927
-
19928
19670
  .${prefix}__mute-button {
19929
19671
  background: none;
19930
19672
  border: none;
@@ -21819,21 +21561,19 @@ class BrowserRmnClient {
21819
21561
  }
21820
21562
  // Validate inject data
21821
21563
  params.inject = validateInjectData(params.inject);
21822
- new ProximityObserver(params.inject.map((item) => item.placementId), (intersectingPlacementIds) => __awaiter(this, void 0, void 0, function* () {
21564
+ const placementIds = params.inject.map((item) => item.placementId);
21565
+ new ProximityObserver(placementIds, (intersectingPlacementIds) => __awaiter(this, void 0, void 0, function* () {
21823
21566
  /**
21824
21567
  * Called when elements are within range
21825
21568
  *
21826
21569
  * intersectingPlacementIds includes:
21827
- * 1. The element that came within 1000px
21828
- * 2. Any unprocessed elements within 200px of that element
21570
+ * 1. The element that came within 2000px
21571
+ * 2. Any unprocessed elements within 500px of that element
21829
21572
  */
21830
21573
  yield this.processPlacements(params, intersectingPlacementIds);
21831
- // console.info('intersectingPlacementIds', intersectingPlacementIds);
21832
21574
  }), {
21833
- intersectionMargin: '1000px',
21834
- verticalThreshold: 200,
21835
- horizontalThreshold: 400,
21836
- maxGroupSize: 5,
21575
+ proximityThreshold: 500,
21576
+ intersectionMargin: '2000px',
21837
21577
  });
21838
21578
  });
21839
21579
  }