@wistia/wistia-player-react 0.0.46 → 0.0.48

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.
@@ -567,12 +567,7 @@ function _assertClassBrand(e, t, n) {
567
567
  }
568
568
  function _get_pageUrl(_this) {
569
569
  var _this$getAttribute3;
570
- return (_this$getAttribute3 = _this.getAttribute("page-url")) !== null && _this$getAttribute3 !== void 0 ? _this$getAttribute3 : (0, _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_28__.H)();
571
- }
572
- function _camelCaseToKebabCase(camelCaseString) {
573
- return camelCaseString.replace(/[A-Z]+(?![a-z])|[A-Z]/g, function(letter, idx) {
574
- return (idx !== void 0 ? "-" : "") + letter.toLowerCase();
575
- });
570
+ return (_this$getAttribute3 = _this.getAttribute("page-url")) !== null && _this$getAttribute3 !== void 0 ? _this$getAttribute3 : (0, _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_29__.H)();
576
571
  }
577
572
  function _generateUniqueId(mediaId) {
578
573
  var index = 1;
@@ -585,11 +580,11 @@ function _generateUniqueId(mediaId) {
585
580
  return candidate;
586
581
  }
587
582
  function _getSyncedEmbedOption(key) {
588
- var _ref17, _ref18;
589
- if (this.api && key in this.api._attrs) {
590
- return this.api._attrs[key];
583
+ var _this$api58, _ref17, _ref18;
584
+ if ((_this$api58 = this.api) !== null && _this$api58 !== void 0 && _this$api58._impl && key in this.api._impl._attrs) {
585
+ return this.api._impl._attrs[key];
591
586
  }
592
- return (_ref17 = (_ref18 = this.embedOptions[key]) !== null && _ref18 !== void 0 ? _ref18 : _assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, _assertClassBrand(_WistiaPlayer_brand, this, _camelCaseToKebabCase).call(this, key))) !== null && _ref17 !== void 0 ? _ref17 : defaultEmbedOptions[key];
587
+ return (_ref17 = (_ref18 = this.embedOptions[key]) !== null && _ref18 !== void 0 ? _ref18 : _assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, (0, _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_28__.$)(key))) !== null && _ref17 !== void 0 ? _ref17 : defaultEmbedOptions[key];
593
588
  }
594
589
  function _getValueFromAttribute(name) {
595
590
  if (!this.hasAttribute(name)) {
@@ -611,13 +606,14 @@ function _initPlayerEmbed(_ref19) {
611
606
  _classPrivateFieldGet(_playerData, this).updateEmbedOptionOverrides({
612
607
  videoFoam: true
613
608
  });
614
- if (mediaData && !(0, _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_29__.V)(mediaData)) {
609
+ if (mediaData && !(0, _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_30__.V)(mediaData)) {
615
610
  _classPrivateFieldSet(_playerType, this, (0, _utilities_judy_js__WEBPACK_IMPORTED_MODULE_12__.$F)(_classPrivateFieldGet(_judyContext, this), _classPrivateFieldGet(_playerData, this).mediaData, _classPrivateFieldGet(_playerData, this).embedOptions));
616
611
  _assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this);
617
612
  _assertClassBrand(_WistiaPlayer_brand, this, _maybeInjectJsonLd).call(this);
618
613
  }
619
- if ("attachInternals" in HTMLElement.prototype) {
620
- _classPrivateFieldGet(_internals, this).states.delete("--initializing");
614
+ if ("attachInternals" in HTMLElement.prototype && "states" in ElementInternals.prototype) {
615
+ var _classPrivateFieldGet9;
616
+ (_classPrivateFieldGet9 = _classPrivateFieldGet(_internals, this)) === null || _classPrivateFieldGet9 === void 0 ? void 0 : _classPrivateFieldGet9.states.delete("--initializing");
621
617
  }
622
618
  void _assertClassBrand(_WistiaPlayer_brand, this, _initPublicApi).call(this, this.mediaId, {
623
619
  container,
@@ -629,7 +625,8 @@ function _initPublicApi(_x17, _x18) {
629
625
  }
630
626
  function _initPublicApi2() {
631
627
  _initPublicApi2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee21(mediaId, options) {
632
- var _this$api58, _this14 = this, _this$api59;
628
+ var _this14 = this, _this$api60;
629
+ var embeddedCallback;
633
630
  return _regeneratorRuntime().wrap(function _callee21$(_context21) {
634
631
  while (1) switch (_context21.prev = _context21.next) {
635
632
  case 0:
@@ -643,20 +640,25 @@ function _initPublicApi2() {
643
640
  (0, _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_14__.WO)("player/failure/init-failed");
644
641
  throw new Error("Wistia.PublicApi is not defined");
645
642
  case 5:
646
- _classPrivateFieldSet(_api, this, new _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s.PublicApi(mediaId, options));
647
- (_this$api58 = this.api) === null || _this$api58 === void 0 ? void 0 : _this$api58.embedded(function() {
648
- var _classPrivateFieldGet12, _classPrivateFieldGet13;
643
+ embeddedCallback = function embeddedCallback2() {
644
+ var _classPrivateFieldGet13, _classPrivateFieldGet14;
649
645
  void _assertClassBrand(_WistiaPlayer_brand, _this14, _maybeInitializeMux).call(_this14);
650
646
  _classPrivateFieldSet(_preloadAspectRatio, _this14, void 0);
651
647
  _assertClassBrand(_WistiaPlayer_brand, _this14, _renderEmbedTemplate).call(_this14);
652
- (_classPrivateFieldGet12 = _classPrivateFieldGet(_preloadThumbnailRoot, _this14)) === null || _classPrivateFieldGet12 === void 0 ? void 0 : _classPrivateFieldGet12.remove();
653
- (_classPrivateFieldGet13 = _classPrivateFieldGet(_resizeObserver, _this14)) === null || _classPrivateFieldGet13 === void 0 ? void 0 : _classPrivateFieldGet13.disconnect();
648
+ (_classPrivateFieldGet13 = _classPrivateFieldGet(_preloadThumbnailRoot, _this14)) === null || _classPrivateFieldGet13 === void 0 ? void 0 : _classPrivateFieldGet13.remove();
649
+ (_classPrivateFieldGet14 = _classPrivateFieldGet(_resizeObserver, _this14)) === null || _classPrivateFieldGet14 === void 0 ? void 0 : _classPrivateFieldGet14.disconnect();
654
650
  _classPrivateFieldSet(_resizeObserver, _this14, null);
655
651
  if (_classPrivateFieldGet(_playPending, _this14)) {
656
652
  void _this14.play();
657
653
  }
654
+ };
655
+ this.addEventListener("embedded", embeddedCallback);
656
+ _classPrivateFieldGet(_removeEventListeners, this).push(function() {
657
+ _this14.removeEventListener("embedded", embeddedCallback);
658
658
  });
659
- (_this$api59 = this.api) === null || _this$api59 === void 0 ? void 0 : _this$api59.ready(function() {
659
+ _classPrivateFieldSet(_api, this, new _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s.PublicApi(mediaId, options));
660
+ (_this$api60 = this.api) === null || _this$api60 === void 0 ? void 0 : _this$api60.ready(function() {
661
+ var _this14$api;
660
662
  _this14.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_27__.c5, {
661
663
  detail: {
662
664
  mediaId
@@ -668,15 +670,15 @@ function _initPublicApi2() {
668
670
  api: _this14.api
669
671
  }
670
672
  }));
671
- if (_this14.api) {
672
- Object.entries(_this14.api._attrs).forEach(function(_ref25) {
673
+ if ((_this14$api = _this14.api) !== null && _this14$api !== void 0 && _this14$api._impl) {
674
+ Object.entries(_this14.api._impl._attrs).forEach(function(_ref25) {
673
675
  var _ref26 = _slicedToArray(_ref25, 2), key = _ref26[0], value = _ref26[1];
674
676
  _classPrivateFieldGet(_playerData, _this14).updateEmbedOptionOverrides(_defineProperty({}, key, value));
675
677
  });
676
678
  }
677
679
  _assertClassBrand(_WistiaPlayer_brand, _this14, _renderPreloadThumbnail).call(_this14);
678
680
  });
679
- case 8:
681
+ case 10:
680
682
  case "end":
681
683
  return _context21.stop();
682
684
  }
@@ -687,11 +689,6 @@ function _initPublicApi2() {
687
689
  function _isPopoverWithThumbnail() {
688
690
  return this.wistiaPopover && (this.popoverContent === void 0 || this.popoverContent === "" || this.popoverContent === "thumbnail");
689
691
  }
690
- function _kebabCaseToCamelCase(kebabCaseString) {
691
- return kebabCaseString.replace(/-./g, function(word) {
692
- return word[1].toUpperCase();
693
- });
694
- }
695
692
  function _maybeInitializeMux() {
696
693
  return _maybeInitializeMux2.apply(this, arguments);
697
694
  }
@@ -708,8 +705,8 @@ function _maybeInitializeMux2() {
708
705
  }
709
706
  return _context22.abrupt("return");
710
707
  case 2:
711
- shouldRandomEnableMux = (0, _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_30__.k)(_utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_31__._);
712
- shouldEnableMuxForPlayer = (0, _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_31__.J)(this.api, shouldRandomEnableMux) && (0, _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_15__.D5)();
708
+ shouldRandomEnableMux = (0, _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_31__.k)(_utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_32__._);
709
+ shouldEnableMuxForPlayer = (0, _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_32__.J)(this.api, shouldRandomEnableMux) && (0, _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_15__.D5)();
713
710
  embedType = this.useWebComponent ? "translated-web-component" : "web-component";
714
711
  if (!shouldEnableMuxForPlayer) {
715
712
  _context22.next = 11;
@@ -768,7 +765,7 @@ function _renderEmbedTemplate() {
768
765
  if (parseFloat(_classPrivateFieldGet(_paddingTop, this)) !== 0 && _classPrivateFieldGet(_paddingTop, this) !== "") {
769
766
  swatchHeight = "".concat(parseFloat(_classPrivateFieldGet(_paddingTop, this)), "px");
770
767
  }
771
- var playerBorderRadius = (0, _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_32__.JA)({
768
+ var playerBorderRadius = (0, _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_33__.JA)({
772
769
  playerBorderRadius: this.playerBorderRadius,
773
770
  roundedPlayer: this.roundedPlayer
774
771
  });
@@ -818,8 +815,8 @@ function _renderPreloadThumbnail() {
818
815
  if (!_classPrivateFieldGet(_preloadThumbnailRoot, this)) {
819
816
  return;
820
817
  }
821
- var _classPrivateFieldGet9 = _classPrivateFieldGet(_playerData, this).mediaData, assets = _classPrivateFieldGet9.assets, mediaType = _classPrivateFieldGet9.mediaType;
822
- var _classPrivateFieldGet10 = _classPrivateFieldGet(_playerData, this).embedOptions, autoPlay = _classPrivateFieldGet10.autoPlay, plugin = _classPrivateFieldGet10.plugin;
818
+ var _classPrivateFieldGet10 = _classPrivateFieldGet(_playerData, this).mediaData, assets = _classPrivateFieldGet10.assets, mediaType = _classPrivateFieldGet10.mediaType;
819
+ var _classPrivateFieldGet11 = _classPrivateFieldGet(_playerData, this).embedOptions, autoPlay = _classPrivateFieldGet11.autoPlay, plugin = _classPrivateFieldGet11.plugin;
823
820
  var thumbnailAssets = (0, _utilities_assets_js__WEBPACK_IMPORTED_MODULE_5__.Q0)(assets, {});
824
821
  var willAutoplay = this.autoplay || autoPlay;
825
822
  var hasVideoThumbnail = (plugin === null || plugin === void 0 ? void 0 : plugin.videoThumbnail) !== void 0;
@@ -841,12 +838,12 @@ function _runMethodsFromAttributes() {
841
838
  var _this10 = this;
842
839
  if (_assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, "current-time") !== null) {
843
840
  var _setInitialCurrentTime = function setInitialCurrentTime() {
844
- var _ref21, _this10$api, _this10$api2;
841
+ var _ref21, _this10$api, _this10$api2, _this10$api2$_impl;
845
842
  var newTime = Number(_assertClassBrand(_WistiaPlayer_brand, _this10, _getValueFromAttribute).call(_this10, "current-time"));
846
843
  var isClosedPopover = (_ref21 = ((_this10$api = _this10.api) === null || _this10$api === void 0 ? void 0 : _this10$api.popover) && !_this10.api.popover.isVisible()) !== null && _ref21 !== void 0 ? _ref21 : false;
847
844
  var isMobile = (0, _utilities_detect_js__WEBPACK_IMPORTED_MODULE_6__.GS)();
848
845
  var shouldDelayUntilPlay = _this10.state !== "playing" && (isMobile || isClosedPopover);
849
- void ((_this10$api2 = _this10.api) === null || _this10$api2 === void 0 ? void 0 : _this10$api2.time(newTime, {
846
+ void ((_this10$api2 = _this10.api) === null || _this10$api2 === void 0 ? void 0 : (_this10$api2$_impl = _this10$api2._impl) === null || _this10$api2$_impl === void 0 ? void 0 : _this10$api2$_impl.time(newTime, {
850
847
  lazy: shouldDelayUntilPlay
851
848
  }));
852
849
  _assertClassBrand(_WistiaPlayer_brand, _this10, _setSyncedEmbedOption).call(_this10, "currentTime", newTime);
@@ -872,15 +869,16 @@ function _saveInitialAttributesFromDomOptions() {
872
869
  var _this11 = this;
873
870
  var domOptions = Object.fromEntries(Object.entries(this.attributes).map(function(_ref22) {
874
871
  var _ref23 = _slicedToArray(_ref22, 2), value = _ref23[1];
875
- return [_assertClassBrand(_WistiaPlayer_brand, _this11, _kebabCaseToCamelCase).call(_this11, value.name), _assertClassBrand(_WistiaPlayer_brand, _this11, _getValueFromAttribute).call(_this11, value.name)];
872
+ return [(0, _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_28__.b)(value.name), _assertClassBrand(_WistiaPlayer_brand, _this11, _getValueFromAttribute).call(_this11, value.name)];
876
873
  }));
877
874
  _classPrivateFieldGet(_playerData, this).setDomEmbedOptionSource(domOptions);
878
875
  (0, _utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_8__.gY)("__".concat(this.uniqueId, "_dom_options__"), _classPrivateFieldGet(_playerData, this).embedOptions);
879
876
  }
880
877
  function _setSyncedEmbedOption(key, value) {
878
+ var _this$api59;
881
879
  _classPrivateFieldGet(_logger, this).info("set ".concat(key), value.toString());
882
- if (this.api) {
883
- this.api._attrs[key] = value;
880
+ if ((_this$api59 = this.api) !== null && _this$api59 !== void 0 && _this$api59._impl) {
881
+ this.api._impl._attrs[key] = value;
884
882
  }
885
883
  _classPrivateFieldGet(_playerData, this).updateEmbedOptionOverrides(_defineProperty({}, key, value));
886
884
  _assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this);
@@ -923,7 +921,7 @@ function _updateMediaData(mediaData) {
923
921
  _classPrivateFieldSet(_playerType, this, (0, _utilities_judy_js__WEBPACK_IMPORTED_MODULE_12__.$F)(_classPrivateFieldGet(_judyContext, this), _classPrivateFieldGet(_playerData, this).mediaData, _classPrivateFieldGet(_playerData, this).embedOptions));
924
922
  _assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this);
925
923
  }
926
- var __webpack_modules__, __webpack_module_cache__, __webpack_exports__2, preact__WEBPACK_IMPORTED_MODULE_0__, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_26__, _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__, _components_PreloadThumbnail_tsx__WEBPACK_IMPORTED_MODULE_2__, _hooks_usePlayerData_tsx__WEBPACK_IMPORTED_MODULE_3__, _utilities_constants_ts__WEBPACK_IMPORTED_MODULE_25__, _utilities_PlayerDataHandler_ts__WEBPACK_IMPORTED_MODULE_4__, _appHostname_js__WEBPACK_IMPORTED_MODULE_24__, _utilities_assets_js__WEBPACK_IMPORTED_MODULE_5__, _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_30__, _utilities_detect_js__WEBPACK_IMPORTED_MODULE_6__, _utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_7__, _utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_8__, _utilities_elem_js__WEBPACK_IMPORTED_MODULE_9__, _utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_27__, _utilities_extractEmailFromParams_ts__WEBPACK_IMPORTED_MODULE_10__, _utilities_hosts_js__WEBPACK_IMPORTED_MODULE_11__, _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_28__, _utilities_judy_js__WEBPACK_IMPORTED_MODULE_12__, _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_32__, _utilities_runScript_js__WEBPACK_IMPORTED_MODULE_13__, _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_31__, _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_14__, _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_15__, _utilities_url_js__WEBPACK_IMPORTED_MODULE_16__, _utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_17__, _utilities_wistiaOptions_ts__WEBPACK_IMPORTED_MODULE_18__, _utilities_wistiaQueue_ts__WEBPACK_IMPORTED_MODULE_19__, _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_20__, _utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_21__, _utilities_getInitialMediaData_ts__WEBPACK_IMPORTED_MODULE_22__, _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_29__, _utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_23__, _WistiaPlayer, requiredAttributes, optionalPublicAttributes, optionalPrivateAttributes, defaultEmbedOptions, getSwatchUrl, _api, _fullscreenState, _internals, _jsonLdId, _judyContext, _logger, _oldEngine, _playerData, _playerType, _removeEventListeners, _hasElementConnectedToDOM, _paddingTop, _playPending, _preactRoot, _preloadAspectRatio, _preloadThumbnailRoot, _publicApiScript, _resizeObserver, _WistiaPlayer_brand, WistiaPlayer, getSwatchMetaData2, wistiaSwatchElement, __webpack_exports__WistiaPlayer, __webpack_exports__wistiaSwatchElement;
924
+ var __webpack_modules__, __webpack_module_cache__, __webpack_exports__2, preact__WEBPACK_IMPORTED_MODULE_0__, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_26__, _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__, _components_PreloadThumbnail_tsx__WEBPACK_IMPORTED_MODULE_2__, _hooks_usePlayerData_tsx__WEBPACK_IMPORTED_MODULE_3__, _utilities_constants_ts__WEBPACK_IMPORTED_MODULE_25__, _utilities_PlayerDataHandler_ts__WEBPACK_IMPORTED_MODULE_4__, _appHostname_js__WEBPACK_IMPORTED_MODULE_24__, _utilities_assets_js__WEBPACK_IMPORTED_MODULE_5__, _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_31__, _utilities_detect_js__WEBPACK_IMPORTED_MODULE_6__, _utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_7__, _utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_8__, _utilities_elem_js__WEBPACK_IMPORTED_MODULE_9__, _utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_27__, _utilities_extractEmailFromParams_ts__WEBPACK_IMPORTED_MODULE_10__, _utilities_hosts_js__WEBPACK_IMPORTED_MODULE_11__, _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_29__, _utilities_judy_js__WEBPACK_IMPORTED_MODULE_12__, _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_33__, _utilities_runScript_js__WEBPACK_IMPORTED_MODULE_13__, _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_32__, _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_14__, _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_15__, _utilities_url_js__WEBPACK_IMPORTED_MODULE_16__, _utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_17__, _utilities_wistiaOptions_ts__WEBPACK_IMPORTED_MODULE_18__, _utilities_wistiaQueue_ts__WEBPACK_IMPORTED_MODULE_19__, _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_20__, _utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_21__, _utilities_getInitialMediaData_ts__WEBPACK_IMPORTED_MODULE_22__, _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_30__, _utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_23__, _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_28__, _WistiaPlayer, requiredAttributes, optionalPublicAttributes, optionalPrivateAttributes, defaultEmbedOptions, getSwatchUrl, _api, _fullscreenState, _internals, _jsonLdId, _judyContext, _logger, _oldEngine, _playerData, _playerType, _removeEventListeners, _hasElementConnectedToDOM, _paddingTop, _playPending, _preactRoot, _preloadAspectRatio, _preloadThumbnailRoot, _publicApiScript, _resizeObserver, _WistiaPlayer_brand, WistiaPlayer, getSwatchMetaData2, wistiaSwatchElement, __webpack_exports__WistiaPlayer, __webpack_exports__wistiaSwatchElement;
927
925
  var init_wistia_player = __esm({
928
926
  "../wistia-player/dist/wistia-player.js"() {
929
927
  __webpack_modules__ = {
@@ -966,8 +964,8 @@ var init_wistia_player = __esm({
966
964
  exports.u4 = isRecord;
967
965
  const isEmptyRecord = (x) => (0, exports.u4)(x) && Object.keys(x).length === 0;
968
966
  __webpack_unused_export__ = isEmptyRecord;
969
- const isNonEmptyRecord = (x) => (0, exports.u4)(x) && Object.keys(x).length > 0;
970
- exports.uu = isNonEmptyRecord;
967
+ const isNonEmptyRecord2 = (x) => (0, exports.u4)(x) && Object.keys(x).length > 0;
968
+ exports.uu = isNonEmptyRecord2;
971
969
  const isArray2 = (x) => (0, exports.n9)(x) && typeof x === "object" && x instanceof Array;
972
970
  exports.cy = isArray2;
973
971
  const isNotArray = (x) => !(0, exports.cy)(x);
@@ -1011,10 +1009,10 @@ var init_wistia_player = __esm({
1011
1009
  var _svgs_OldBigPlayButtonSVG_tsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(1549);
1012
1010
  var _svgs_BigPlayButtonSVG_tsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__3(7880);
1013
1011
  var _shared_translations_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__3(4730);
1014
- var _utilities_color_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__3(5417);
1015
- var _utilities_core_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__3(1627);
1016
- var _utilities_detect_js__WEBPACK_IMPORTED_MODULE_6__2 = __webpack_require__3(7231);
1017
- var _utilities_duration_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__3(1341);
1012
+ var _utilities_color_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__3(5417);
1013
+ var _utilities_core_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__3(1627);
1014
+ var _utilities_detect_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__3(7231);
1015
+ var _utilities_duration_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__3(1341);
1018
1016
  var _utilities_interFontFamily_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__3(8213);
1019
1017
  function _slicedToArray2(r, e) {
1020
1018
  return _arrayWithHoles2(r) || _iterableToArrayLimit2(r, e) || _unsupportedIterableToArray2(r, e) || _nonIterableRest2();
@@ -1058,7 +1056,7 @@ var init_wistia_player = __esm({
1058
1056
  function _arrayWithHoles2(r) {
1059
1057
  if (Array.isArray(r)) return r;
1060
1058
  }
1061
- var detect = (0, _utilities_detect_js__WEBPACK_IMPORTED_MODULE_6__2.o1)();
1059
+ var detect = (0, _utilities_detect_js__WEBPACK_IMPORTED_MODULE_7__.o1)();
1062
1060
  var BASE_BUTTON_WIDTH = 125;
1063
1061
  var BASE_BUTTON_HEIGHT = 80;
1064
1062
  var BASE_FONT_SIZE = 18;
@@ -1073,7 +1071,7 @@ var init_wistia_player = __esm({
1073
1071
  var translate = function translate2(key) {
1074
1072
  return (0, _shared_translations_js__WEBPACK_IMPORTED_MODULE_4__.sC)(playerLanguage.code, "PLAY_BUTTON_".concat(key));
1075
1073
  };
1076
- var unescapedVideoName = (0, _utilities_core_js__WEBPACK_IMPORTED_MODULE_5__.Uh)(videoName);
1074
+ var unescapedVideoName = (0, _utilities_core_js__WEBPACK_IMPORTED_MODULE_6__.Uh)(videoName);
1077
1075
  var ariaLabel = "".concat(translate("TITLE_WHEN_NOT_PLAYING"), ": ").concat(unescapedVideoName);
1078
1076
  var wrapperStyle = {
1079
1077
  borderRadius: "".concat(borderRadius, "px"),
@@ -1094,7 +1092,7 @@ var init_wistia_player = __esm({
1094
1092
  width: "".concat(scaledWidth, "px")
1095
1093
  };
1096
1094
  var shouldMixBlendMode = !detect.edge && !noMixBlendMode;
1097
- var blendColor = new _utilities_color_js__WEBPACK_IMPORTED_MODULE_8__.Q(color !== null && color !== void 0 ? color : "#000").alpha(1);
1095
+ var blendColor = new _utilities_color_js__WEBPACK_IMPORTED_MODULE_5__.Q(color !== null && color !== void 0 ? color : "#000").alpha(1);
1098
1096
  var blendStyle = {
1099
1097
  background: blendColor.toRgba(),
1100
1098
  display: shouldMixBlendMode ? "block" : "none",
@@ -1105,7 +1103,7 @@ var init_wistia_player = __esm({
1105
1103
  top: 0,
1106
1104
  width: "".concat(scaledWidth, "px")
1107
1105
  };
1108
- var overlayColor = new _utilities_color_js__WEBPACK_IMPORTED_MODULE_8__.Q(color !== null && color !== void 0 ? color : "#000");
1106
+ var overlayColor = new _utilities_color_js__WEBPACK_IMPORTED_MODULE_5__.Q(color !== null && color !== void 0 ? color : "#000");
1109
1107
  var overlayAlphaValue = shouldMixBlendMode ? ALPHA_MIX_BLEND_MODE : ALPHA_NO_MIX_BLEND_MODE;
1110
1108
  overlayColor.alpha(overlayAlphaValue);
1111
1109
  if (isFocused) {
@@ -1168,7 +1166,7 @@ var init_wistia_player = __esm({
1168
1166
  })), shouldDisplayDuration ? (0, preact__WEBPACK_IMPORTED_MODULE_0__2.h)("div", {
1169
1167
  class: "w-bpb-time",
1170
1168
  style: timeStyle
1171
- }, (0, _utilities_duration_ts__WEBPACK_IMPORTED_MODULE_7__.G5)(duration)) : null);
1169
+ }, (0, _utilities_duration_ts__WEBPACK_IMPORTED_MODULE_8__.G5)(duration)) : null);
1172
1170
  };
1173
1171
  }
1174
1172
  ),
@@ -2707,6 +2705,35 @@ var init_wistia_player = __esm({
2707
2705
  }
2708
2706
  ),
2709
2707
  /***/
2708
+ 4989: (
2709
+ /***/
2710
+ (__unused_webpack_module, __webpack_exports__3, __webpack_require__3) => {
2711
+ __webpack_require__3.d(__webpack_exports__3, {
2712
+ /* harmony export */
2713
+ $: () => (
2714
+ /* binding */
2715
+ camelCaseToKebabCase2
2716
+ ),
2717
+ /* harmony export */
2718
+ b: () => (
2719
+ /* binding */
2720
+ kebabCaseToCamelCase
2721
+ )
2722
+ /* harmony export */
2723
+ });
2724
+ var camelCaseToKebabCase2 = function camelCaseToKebabCase3(camelCaseString) {
2725
+ return camelCaseString.replace(/[A-Z]+(?![a-z])|[A-Z]/g, function(letter, idx) {
2726
+ return (idx !== void 0 ? "-" : "") + letter.toLowerCase();
2727
+ });
2728
+ };
2729
+ var kebabCaseToCamelCase = function kebabCaseToCamelCase2(kebabCaseString) {
2730
+ return kebabCaseString.replace(/-./g, function(word) {
2731
+ return word[1].toUpperCase();
2732
+ });
2733
+ };
2734
+ }
2735
+ ),
2736
+ /***/
2710
2737
  7323: (
2711
2738
  /***/
2712
2739
  (__unused_webpack_module, __webpack_exports__3, __webpack_require__3) => {
@@ -2731,6 +2758,147 @@ var init_wistia_player = __esm({
2731
2758
  }
2732
2759
  ),
2733
2760
  /***/
2761
+ 998: (
2762
+ /***/
2763
+ (__unused_webpack_module, __webpack_exports__3, __webpack_require__3) => {
2764
+ __webpack_require__3.d(__webpack_exports__3, {
2765
+ /* harmony export */
2766
+ K6: () => (
2767
+ /* binding */
2768
+ rgbToHsl
2769
+ ),
2770
+ /* harmony export */
2771
+ bJ: () => (
2772
+ /* binding */
2773
+ getContrast
2774
+ ),
2775
+ /* harmony export */
2776
+ s1: () => (
2777
+ /* binding */
2778
+ colorContrastRatiosByShape
2779
+ )
2780
+ /* harmony export */
2781
+ });
2782
+ var _wistia_type_guards__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(4586);
2783
+ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(5417);
2784
+ var _sentryUtils_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(2621);
2785
+ var colorContrastRatiosByShape = {
2786
+ nonText: 3,
2787
+ // 3:1 - https://www.w3.org/TR/WCAG21/#non-text-contrast
2788
+ largeText: 3,
2789
+ // 3:1 - https://www.w3.org/TR/WCAG21/#contrast-minimum
2790
+ paragraphText: 4.5,
2791
+ // 4.5:1 - https://www.w3.org/TR/WCAG21/#contrast-minimum
2792
+ smallText: 5.5
2793
+ // We're making this up, but it should be more than the paragraph text
2794
+ };
2795
+ var rgbToHsl = function rgbToHsl2(color) {
2796
+ var colorArray = color;
2797
+ if (color instanceof _color_js__WEBPACK_IMPORTED_MODULE_0__.Q) {
2798
+ if ((0, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_2__.gD)(color.r) || (0, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_2__.gD)(color.g) || (0, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_2__.gD)(color.b)) {
2799
+ throw new Error("Color does not contain required RGB values");
2800
+ }
2801
+ colorArray = [color.r, color.g, color.b];
2802
+ } else if (typeof color === "string") {
2803
+ var colorInstance = new _color_js__WEBPACK_IMPORTED_MODULE_0__.Q(color);
2804
+ if ((0, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_2__.gD)(colorInstance.r) || (0, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_2__.gD)(colorInstance.g) || (0, _wistia_type_guards__WEBPACK_IMPORTED_MODULE_2__.gD)(colorInstance.b)) {
2805
+ throw new Error("Color does not contain required RGB values");
2806
+ }
2807
+ colorArray = [colorInstance.r, colorInstance.g, colorInstance.b];
2808
+ }
2809
+ var red = colorArray[0] / 255;
2810
+ var green = colorArray[1] / 255;
2811
+ var blue = colorArray[2] / 255;
2812
+ var max = Math.max(red, green, blue);
2813
+ var min = Math.min(red, green, blue);
2814
+ var hue = 0;
2815
+ var saturation = 0;
2816
+ var lightness = (max + min) / 2;
2817
+ if (max === min) {
2818
+ hue = 0;
2819
+ saturation = 0;
2820
+ }
2821
+ var delta = max - min;
2822
+ if (delta === 0) {
2823
+ return {
2824
+ hue,
2825
+ saturation,
2826
+ lightness: red * 100
2827
+ };
2828
+ }
2829
+ if (lightness > 0.5) {
2830
+ saturation = delta / (2 - max - min);
2831
+ } else {
2832
+ saturation = delta / (max + min);
2833
+ }
2834
+ if (max === red) {
2835
+ hue = (green - blue) / delta + (green < blue ? 6 : 0);
2836
+ } else if (max === green) {
2837
+ hue = (blue - red) / delta + 2;
2838
+ } else {
2839
+ hue = (red - green) / delta + 4;
2840
+ }
2841
+ hue /= 6;
2842
+ return {
2843
+ hue: hue * 360,
2844
+ saturation: saturation * 100,
2845
+ lightness: lightness * 100
2846
+ };
2847
+ };
2848
+ var getContrast = function getContrast2(foreground, background) {
2849
+ var foregroundColor = new _color_js__WEBPACK_IMPORTED_MODULE_0__.Q(foreground);
2850
+ var backgroundColor = new _color_js__WEBPACK_IMPORTED_MODULE_0__.Q(background);
2851
+ var l1 = foregroundColor.getRelativeLuminance();
2852
+ var l2 = backgroundColor.getRelativeLuminance();
2853
+ return l1 > l2 ? (l1 + 0.05) / (l2 + 0.05) : (l2 + 0.05) / (l1 + 0.05);
2854
+ };
2855
+ var adjustColorForProperContrast = function adjustColorForProperContrast2(foreground, background) {
2856
+ var shape = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "paragraphText";
2857
+ var foregroundColor = new Color(foreground);
2858
+ var backgroundColor = new Color(background);
2859
+ if (isNil(foregroundColor.r) || isNil(foregroundColor.g) || isNil(foregroundColor.b)) {
2860
+ throw new Error("Color does not contain required RGB values");
2861
+ }
2862
+ var initialContrastRatio = getContrast(foregroundColor.toHexWithHash(), backgroundColor.toHexWithHash());
2863
+ if (foregroundColor.hasAccessibleContrast(backgroundColor, shape)) {
2864
+ return foregroundColor.toHexWithHash();
2865
+ }
2866
+ var _rgbToHsl = rgbToHsl([foregroundColor.r, foregroundColor.g, foregroundColor.b]), foregroundColorLightness = _rgbToHsl.lightness;
2867
+ var shouldForegroundColorBeLighter = foregroundColorLightness < 0.1 || foregroundColor.getContrastRatio(backgroundColor) > initialContrastRatio;
2868
+ if (foregroundColorLightness > 0.8 && initialContrastRatio === 1) {
2869
+ shouldForegroundColorBeLighter = false;
2870
+ }
2871
+ var adjustedForegroundColor = new Color(foregroundColor);
2872
+ var i2 = 0;
2873
+ while (!adjustedForegroundColor.hasAccessibleContrast(backgroundColor, shape)) {
2874
+ i2 += 1;
2875
+ if (i2 > 1e3) {
2876
+ reportError("other", new Error("Exceeded ".concat(i2, " attempts to find contrasting color")), {
2877
+ key: "adjust-color-for-proper-contrast",
2878
+ foregroundColor: foregroundColor.toHexWithHash(),
2879
+ backgroundColor: backgroundColor.toHexWithHash()
2880
+ });
2881
+ return "#".concat(adjustedForegroundColor.toHex());
2882
+ }
2883
+ var adjustedForegroundColorLuminance = adjustedForegroundColor.getRelativeLuminance();
2884
+ if (i2 > 1 && (adjustedForegroundColorLuminance === 1 || adjustedForegroundColorLuminance === 0)) {
2885
+ if (colorContrastRatiosByShape[shape] > 3) {
2886
+ return getContrast("#fff", backgroundColor.toHexWithHash()) > getContrast("#000", backgroundColor.toHexWithHash()) ? "#fff" : "#000";
2887
+ }
2888
+ shouldForegroundColorBeLighter = !shouldForegroundColorBeLighter;
2889
+ adjustedForegroundColor = foregroundColor;
2890
+ }
2891
+ if (shouldForegroundColorBeLighter) {
2892
+ adjustedForegroundColor.lighten(1);
2893
+ } else {
2894
+ adjustedForegroundColor.darken(1);
2895
+ }
2896
+ }
2897
+ return adjustedForegroundColor.toHexWithHash();
2898
+ };
2899
+ }
2900
+ ),
2901
+ /***/
2734
2902
  1341: (
2735
2903
  /***/
2736
2904
  (__unused_webpack_module, __webpack_exports__3, __webpack_require__3) => {
@@ -4143,6 +4311,78 @@ var init_wistia_player = __esm({
4143
4311
  }
4144
4312
  ),
4145
4313
  /***/
4314
+ 2621: (
4315
+ /***/
4316
+ (__unused_webpack_module, __webpack_exports__3, __webpack_require__3) => {
4317
+ var utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(4755);
4318
+ var PLAYER_SAMPLE_RATE = 1e-4;
4319
+ var NON_PLAYER_EMBED_SAMPLE_RATE = 0.25;
4320
+ var IS_DEV_OR_TEST_ENV = (
4321
+ /* unused pure expression or super */
4322
+ null
4323
+ );
4324
+ var configureSentry = function configureSentry2() {
4325
+ if (window.Sentry && typeof window.Sentry.init === "function") {
4326
+ window.Sentry.init({
4327
+ allowUrls: [/^https:\/\/fast.wistia.(?:com|net|io|st)\/.*$/],
4328
+ // Only allow exceptions that are captured from scripts that are served by Wistia
4329
+ dsn: "https://a3591ba5e949a37083cc6f5a4191e903@o4505518331658240.ingest.us.sentry.io/4505794284290048",
4330
+ initialScope: {
4331
+ tags: {
4332
+ pillar: "publish"
4333
+ }
4334
+ },
4335
+ defaultIntegrations: false
4336
+ // We want different sample rates for errors from the player versus errors from forms, channels, and transcripts.
4337
+ // So we don't configure sampleRate here and instead have custom sampling logic in the reportError function.
4338
+ });
4339
+ }
4340
+ };
4341
+ var initializeSentry = function initializeSentry2() {
4342
+ if (!window.Sentry) {
4343
+ var sentryLoader = document.createElement("script");
4344
+ sentryLoader.onload = function() {
4345
+ return configureSentry();
4346
+ };
4347
+ sentryLoader.src = "https://js.sentry-cdn.com/a3591ba5e949a37083cc6f5a4191e903.min.js";
4348
+ sentryLoader.crossOrigin = "anonymous";
4349
+ document.head.appendChild(sentryLoader);
4350
+ }
4351
+ };
4352
+ var reportError2 = function reportError3(product, error, details) {
4353
+ try {
4354
+ var _window$Sentry;
4355
+ if (typeof ((_window$Sentry = window.Sentry) === null || _window$Sentry === void 0 ? void 0 : _window$Sentry.withScope) === "function") {
4356
+ var sampleRate = product === "player" ? PLAYER_SAMPLE_RATE : NON_PLAYER_EMBED_SAMPLE_RATE;
4357
+ var shouldSendToSentry = IS_DEV_OR_TEST_ENV;
4358
+ var cryptoObj = isNil(window.crypto) ? window.msCrypto : window.crypto;
4359
+ if (cryptoObj !== void 0) {
4360
+ var cryptoRandom = cryptoObj.getRandomValues(new Uint32Array(1));
4361
+ shouldSendToSentry = cryptoRandom[0] / (4294967295 + 1) < sampleRate;
4362
+ } else {
4363
+ var mathRandom = Math.random();
4364
+ shouldSendToSentry = mathRandom < sampleRate;
4365
+ }
4366
+ if (!shouldSendToSentry) {
4367
+ console.error(error);
4368
+ } else if (isVisitorTrackingEnabled()) {
4369
+ window.Sentry.withScope(function(scope) {
4370
+ var _window$Sentry2;
4371
+ scope.setTag("product", product);
4372
+ if (isNonEmptyRecord(details)) {
4373
+ scope.setTags(details);
4374
+ }
4375
+ (_window$Sentry2 = window.Sentry) === null || _window$Sentry2 === void 0 ? void 0 : _window$Sentry2.captureException(error);
4376
+ });
4377
+ }
4378
+ }
4379
+ } catch (err) {
4380
+ console.error(err);
4381
+ }
4382
+ };
4383
+ }
4384
+ ),
4385
+ /***/
4146
4386
  7211: (
4147
4387
  /***/
4148
4388
  (__unused_webpack_module, __webpack_exports__3, __webpack_require__3) => {
@@ -7269,10 +7509,11 @@ var init_wistia_player = __esm({
7269
7509
  /* harmony export */
7270
7510
  Q: () => (
7271
7511
  /* binding */
7272
- Color
7512
+ Color2
7273
7513
  )
7274
7514
  /* harmony export */
7275
7515
  });
7516
+ var _color_utils_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(998);
7276
7517
  function _classCallCheck2(a, n) {
7277
7518
  if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
7278
7519
  }
@@ -7327,10 +7568,10 @@ var init_wistia_player = __esm({
7327
7568
  }
7328
7569
  return a;
7329
7570
  };
7330
- var Color = /* @__PURE__ */ function() {
7331
- function Color2(input) {
7332
- _classCallCheck2(this, Color2);
7333
- if (input instanceof Color2) {
7571
+ var Color2 = /* @__PURE__ */ function() {
7572
+ function Color3(input) {
7573
+ _classCallCheck2(this, Color3);
7574
+ if (input instanceof Color3) {
7334
7575
  this.r = input.r;
7335
7576
  this.g = input.g;
7336
7577
  this.b = input.b;
@@ -7342,11 +7583,17 @@ var init_wistia_player = __esm({
7342
7583
  this.a = 1;
7343
7584
  }
7344
7585
  }
7345
- return _createClass2(Color2, [{
7586
+ return _createClass2(Color3, [{
7346
7587
  key: "parse",
7347
7588
  value: function parse2(input) {
7348
- input = String(input);
7349
- if (rHex.test(input)) {
7589
+ if (Array.isArray(input)) {
7590
+ var _input$;
7591
+ this.r = input[0];
7592
+ this.g = input[1];
7593
+ this.b = input[2];
7594
+ this.a = (_input$ = input[3]) !== null && _input$ !== void 0 ? _input$ : 1;
7595
+ } else if (rHex.test(input)) {
7596
+ input = String(input);
7350
7597
  var stripped = input.replace(/^#/, "");
7351
7598
  if (stripped.length === 3 || stripped.length === 4) {
7352
7599
  stripped = stripped.replace(hexBit, "$1$1");
@@ -7360,6 +7607,7 @@ var init_wistia_player = __esm({
7360
7607
  this.a = 1;
7361
7608
  }
7362
7609
  } else if (rRgb.test(input)) {
7610
+ input = String(input);
7363
7611
  var parts = input.match(rRgb);
7364
7612
  this.r = parseFloat(p2v(parts[1]));
7365
7613
  this.g = parseFloat(p2v(parts[2]));
@@ -7375,46 +7623,16 @@ var init_wistia_player = __esm({
7375
7623
  }, {
7376
7624
  key: "clone",
7377
7625
  value: function clone2() {
7378
- return new Color2(this);
7626
+ return new Color3(this);
7379
7627
  }
7380
7628
  // Compute internal HSL values based on internal RGB values.
7381
7629
  }, {
7382
7630
  key: "_hslFromRgb",
7383
7631
  value: function _hslFromRgb() {
7384
- var r = this.r / 255;
7385
- var g = this.g / 255;
7386
- var b = this.b / 255;
7387
- var max = Math.max(r, g, b);
7388
- var min = Math.min(r, g, b);
7389
- var l = (max + min) / 2;
7390
- if (max === min) {
7391
- this._h = this._s = 0;
7392
- }
7393
- var d = max - min;
7394
- var s;
7395
- if (d === 0) {
7396
- this._h = 0;
7397
- this._s = 0;
7398
- this._l = r * 100;
7399
- return this;
7400
- }
7401
- if (l > 0.5) {
7402
- s = d / (2 - max - min);
7403
- } else {
7404
- s = d / (max + min);
7405
- }
7406
- var h;
7407
- if (max === r) {
7408
- h = (g - b) / d + (g < b ? 6 : 0);
7409
- } else if (max === g) {
7410
- h = (b - r) / d + 2;
7411
- } else {
7412
- h = (r - g) / d + 4;
7413
- }
7414
- h /= 6;
7415
- this._h = h * 360;
7416
- this._s = s * 100;
7417
- this._l = l * 100;
7632
+ var _rgbToHsl = (0, _color_utils_ts__WEBPACK_IMPORTED_MODULE_0__.K6)([this.r, this.g, this.b]), hue = _rgbToHsl.hue, saturation = _rgbToHsl.saturation, lightness = _rgbToHsl.lightness;
7633
+ this._h = hue;
7634
+ this._s = saturation;
7635
+ this._l = lightness;
7418
7636
  return this;
7419
7637
  }
7420
7638
  // Compute internal RGB values based on internal HSL values.
@@ -7435,7 +7653,11 @@ var init_wistia_player = __esm({
7435
7653
  // the strength of the blend.
7436
7654
  }, {
7437
7655
  key: "blendChannel",
7438
- value: function blendChannel(channel, value, alpha) {
7656
+ value: function blendChannel(channel, value, alpha, shouldUseLrgb) {
7657
+ if (shouldUseLrgb) {
7658
+ this[channel] = Math.sqrt(Math.pow(this[channel], 2) * (1 - alpha) + Math.pow(value, 2) * alpha);
7659
+ return this;
7660
+ }
7439
7661
  this[channel] = alpha * value + (1 - alpha) * this[channel];
7440
7662
  return this;
7441
7663
  }
@@ -7443,13 +7665,32 @@ var init_wistia_player = __esm({
7443
7665
  // channel individually.
7444
7666
  }, {
7445
7667
  key: "blend",
7446
- value: function blend(color, alpha) {
7447
- color = new Color2(color);
7448
- this.blendChannel("r", color.r, alpha);
7449
- this.blendChannel("g", color.g, alpha);
7450
- this.blendChannel("b", color.b, alpha);
7668
+ value: function blend(color, alpha, shouldUseLrgb) {
7669
+ color = new Color3(color);
7670
+ this.blendChannel("r", color.r, alpha, shouldUseLrgb);
7671
+ this.blendChannel("g", color.g, alpha, shouldUseLrgb);
7672
+ this.blendChannel("b", color.b, alpha, shouldUseLrgb);
7451
7673
  return this;
7452
7674
  }
7675
+ // background color can be a string or a Color
7676
+ }, {
7677
+ key: "getContrastRatio",
7678
+ value: function getContrastRatio(backgroundColor) {
7679
+ return (0, _color_utils_ts__WEBPACK_IMPORTED_MODULE_0__.bJ)(this.toHexWithHash(), new Color3(backgroundColor).toHexWithHash());
7680
+ }
7681
+ // background color can be a string or a Color
7682
+ // shape will be a key of colorContrastRatiosByShape
7683
+ }, {
7684
+ key: "hasAccessibleContrast",
7685
+ value: function hasAccessibleContrast(backgroundColor, shape) {
7686
+ return this.getContrastRatio(backgroundColor) >= _color_utils_ts__WEBPACK_IMPORTED_MODULE_0__.s1[shape];
7687
+ }
7688
+ }, {
7689
+ key: "hue",
7690
+ value: function hue() {
7691
+ this._hslFromRgb();
7692
+ return this._h;
7693
+ }
7453
7694
  // Increase a channel by a fixed value, but within the [0,255] range.
7454
7695
  }, {
7455
7696
  key: "lightenChannel",
@@ -7495,7 +7736,6 @@ var init_wistia_player = __esm({
7495
7736
  }, {
7496
7737
  key: "lightness",
7497
7738
  value: function lightness(l) {
7498
- this._hslFromRgb();
7499
7739
  if (l != null) {
7500
7740
  this._l = Math.max(0, Math.min(100, l));
7501
7741
  this._rgbFromHsl();
@@ -7518,6 +7758,21 @@ var init_wistia_player = __esm({
7518
7758
  }
7519
7759
  return this._s;
7520
7760
  }
7761
+ }, {
7762
+ key: "setHue",
7763
+ value: function setHue(hueValue) {
7764
+ this._hslFromRgb();
7765
+ if (hueValue != null) {
7766
+ this._h = Math.max(0, Math.min(360, hueValue));
7767
+ this._rgbFromHsl();
7768
+ return this;
7769
+ }
7770
+ }
7771
+ }, {
7772
+ key: "shade",
7773
+ value: function shade(percentage, shouldUseLrgb) {
7774
+ return this.blend("#000000", percentage, shouldUseLrgb);
7775
+ }
7521
7776
  // Gray level accounts for the strength of each individual channel.
7522
7777
  // This is more visually accurate than just averaging all the channels.
7523
7778
  }, {
@@ -7525,6 +7780,11 @@ var init_wistia_player = __esm({
7525
7780
  value: function grayLevel() {
7526
7781
  return (0.299 * this.r + 0.587 * this.g + 0.114 * this.b) / 255;
7527
7782
  }
7783
+ }, {
7784
+ key: "tint",
7785
+ value: function tint(percentage, shouldUseLrgb) {
7786
+ return this.blend("#ffffff", percentage, shouldUseLrgb);
7787
+ }
7528
7788
  // The white level is basically paleness, and is determined by the
7529
7789
  // minimum of all the RGB channels.
7530
7790
  }, {
@@ -7532,9 +7792,35 @@ var init_wistia_player = __esm({
7532
7792
  value: function whiteLevel() {
7533
7793
  return Math.min(Math.min(this.r, this.g), this.b);
7534
7794
  }
7795
+ }, {
7796
+ key: "getRelativeLuminance",
7797
+ value: function getRelativeLuminance() {
7798
+ var adjustChannel = function adjustChannel2(givenVal) {
7799
+ var val = givenVal * 3921569e-9;
7800
+ if (val <= 0.03928) {
7801
+ return val / 12.92;
7802
+ }
7803
+ return Math.pow((val + 0.055) / 1.055, 2.4);
7804
+ };
7805
+ var rAdjusted = adjustChannel(this.r);
7806
+ var gAdjusted = adjustChannel(this.g);
7807
+ var bAdjusted = adjustChannel(this.b);
7808
+ return 0.2126 * rAdjusted + 0.7152 * gAdjusted + 0.0722 * bAdjusted;
7809
+ }
7810
+ }, {
7811
+ key: "isDark",
7812
+ value: function isDark(shouldUseRL) {
7813
+ if (shouldUseRL) {
7814
+ return this.getRelativeLuminance() < 0.15;
7815
+ }
7816
+ return this.grayLevel() <= 0.4;
7817
+ }
7535
7818
  }, {
7536
7819
  key: "isLight",
7537
- value: function isLight() {
7820
+ value: function isLight(shouldUseRL) {
7821
+ if (shouldUseRL) {
7822
+ return this.getRelativeLuminance() >= 0.8;
7823
+ }
7538
7824
  return this.grayLevel() > 0.4;
7539
7825
  }
7540
7826
  }, {
@@ -7617,6 +7903,11 @@ var init_wistia_player = __esm({
7617
7903
  }
7618
7904
  return "".concat(a).concat(this.toHex());
7619
7905
  }
7906
+ }, {
7907
+ key: "toHexWithHash",
7908
+ value: function toHexWithHash() {
7909
+ return "#".concat(this.toHex());
7910
+ }
7620
7911
  }, {
7621
7912
  key: "toRgb",
7622
7913
  value: function toRgb() {
@@ -9329,7 +9620,7 @@ var init_wistia_player = __esm({
9329
9620
  var PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
9330
9621
  var PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
9331
9622
  var SSL_EMBED_HOST = "embed-ssl.wistia.com";
9332
- var TAGGED_VERSION = "0.0.46";
9623
+ var TAGGED_VERSION = "0.0.48";
9333
9624
  var DEFAULT_PROTOCOL = function() {
9334
9625
  if (typeof window !== "undefined" && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location) {
9335
9626
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location.protocol;
@@ -11908,7 +12199,7 @@ var init_wistia_player = __esm({
11908
12199
  /* harmony export */
11909
12200
  D5: () => (
11910
12201
  /* binding */
11911
- isVisitorTrackingEnabled
12202
+ isVisitorTrackingEnabled2
11912
12203
  )
11913
12204
  /* harmony export */
11914
12205
  });
@@ -11965,7 +12256,7 @@ var init_wistia_player = __esm({
11965
12256
  }
11966
12257
  var consent = function consent2(val) {
11967
12258
  if (val == null) {
11968
- return isVisitorTrackingEnabled();
12259
+ return isVisitorTrackingEnabled2();
11969
12260
  }
11970
12261
  return setVisitorTrackingEnabled(val);
11971
12262
  };
@@ -12006,7 +12297,7 @@ var init_wistia_player = __esm({
12006
12297
  }
12007
12298
  }
12008
12299
  };
12009
- var isVisitorTrackingEnabled = function isVisitorTrackingEnabled2() {
12300
+ var isVisitorTrackingEnabled2 = function isVisitorTrackingEnabled3() {
12010
12301
  if (typeof _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_3__.s._visitorTracking === "boolean") {
12011
12302
  return _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_3__.s._visitorTracking;
12012
12303
  }
@@ -12905,7 +13196,7 @@ var init_wistia_player = __esm({
12905
13196
  _utilities_PlayerDataHandler_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2(6462);
12906
13197
  _appHostname_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__2(787);
12907
13198
  _utilities_assets_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2(7209);
12908
- _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__2(7323);
13199
+ _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__2(7323);
12909
13200
  _utilities_detect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2(7231);
12910
13201
  _utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2(7157);
12911
13202
  _utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2(3280);
@@ -12913,11 +13204,11 @@ var init_wistia_player = __esm({
12913
13204
  _utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__2(2760);
12914
13205
  _utilities_extractEmailFromParams_ts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__2(3832);
12915
13206
  _utilities_hosts_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__2(5857);
12916
- _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__2(5393);
13207
+ _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__2(5393);
12917
13208
  _utilities_judy_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__2(438);
12918
- _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__2(3123);
13209
+ _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__2(3123);
12919
13210
  _utilities_runScript_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__2(1248);
12920
- _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__2(7211);
13211
+ _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__2(7211);
12921
13212
  _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__2(1161);
12922
13213
  _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__2(4755);
12923
13214
  _utilities_url_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__2(2671);
@@ -12927,8 +13218,9 @@ var init_wistia_player = __esm({
12927
13218
  _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__2(6637);
12928
13219
  _utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__2(2147);
12929
13220
  _utilities_getInitialMediaData_ts__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__2(5833);
12930
- _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__2(959);
13221
+ _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__2(959);
12931
13222
  _utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__2(3411);
13223
+ _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__2(4989);
12932
13224
  requiredAttributes = ["media-id"];
12933
13225
  optionalPublicAttributes = ["aspect", "audio-description-control", "autoplay", "big-play-button", "controls-visible-on-load", "copy-link-and-thumbnail", "current-time", "do-not-track", "email", "end-video-behavior", "fullscreen-control", "muted", "playback-rate-control", "play-bar-control", "player-color", "playlist-channel-id", "playlist-links", "playlist-loop", "play-pause-control", "play-pause-notifier", "popover-animate-thumbnail", "popover-animation", "popover-border-color", "popover-border-radius", "popover-border-width", "popover-box-shadow", "popover-caption", "popover-caption-container", "popover-content", "popover-disable-autoplay", "popover-overlay-color", "popover-overlay-opacity", "popover-prevent-scroll", "popover-show-on-load", "poster", "preload", "quality-control", "quality-max", "quality-min", "resumable", "rounded-player", "seo", "settings-control", "silent-autoplay", "transparent-letterbox", "video-quality", "volume", "volume-control", "wistia-popover"];
12934
13226
  optionalPrivateAttributes = ["big-play-button-border-radius", "control-bar-border-radius", "embed-host", "hls", "page-url", "player-border-radius", "player-force", "stats-url", "swatch", "unique-id", "use-web-component"];
@@ -13036,7 +13328,7 @@ var init_wistia_player = __esm({
13036
13328
  _classPrivateFieldInitSpec(_this2, _preloadThumbnailRoot, null);
13037
13329
  _classPrivateFieldInitSpec(_this2, _publicApiScript, (0, _utilities_runScript_js__WEBPACK_IMPORTED_MODULE_13__.j)("".concat((0, _utilities_url_js__WEBPACK_IMPORTED_MODULE_16__.ff)(), "//").concat((0, _appHostname_js__WEBPACK_IMPORTED_MODULE_24__.N)("fast"), "/assets/external/publicApi.js")));
13038
13330
  _classPrivateFieldInitSpec(_this2, _resizeObserver, null);
13039
- if ("attachInternals" in HTMLElement.prototype) {
13331
+ if ("attachInternals" in HTMLElement.prototype && "states" in ElementInternals.prototype) {
13040
13332
  _classPrivateFieldSet(_internals, _this2, _this2.attachInternals());
13041
13333
  _classPrivateFieldGet(_internals, _this2).states.add("--initializing");
13042
13334
  }
@@ -13205,7 +13497,7 @@ var init_wistia_player = __esm({
13205
13497
  }
13206
13498
  /**
13207
13499
  * Getter. Returns all defined controls.
13208
- * @returns {PlayerControls} returns object of defined controls. Please note this may return an
13500
+ * @returns {ControlInstances} returns object of defined controls. Please note this may return an
13209
13501
  * empty object if not controls have yet been defined.
13210
13502
  */
13211
13503
  }, {
@@ -14660,7 +14952,7 @@ var init_wistia_player = __esm({
14660
14952
  default:
14661
14953
  break;
14662
14954
  }
14663
- this[_assertClassBrand(_WistiaPlayer_brand, this, _kebabCaseToCamelCase).call(this, name)] = finalValue;
14955
+ this[(0, _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_28__.b)(name)] = finalValue;
14664
14956
  }
14665
14957
  }, {
14666
14958
  key: "connectedCallback",
@@ -14732,9 +15024,8 @@ var init_wistia_player = __esm({
14732
15024
  // Private methods
14733
15025
  // --------------------------------------------------
14734
15026
  /**
14735
- * Takes a string in camelCase and converts it to kebab-case
14736
- * This is a pretty generic helper function, so it could be moved to a utility file if needed
14737
- * @param {string} camelCaseString - String in camelCase
15027
+ * Generates a unique id for the embed
15028
+ * @param {number | string} mediaId - The media id
14738
15029
  * @returns {string}
14739
15030
  */
14740
15031
  }], [{