@mjhls/mjh-framework 1.0.192 → 1.0.194

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -769,6 +769,8 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
769
769
 
770
770
  return new Promise(function (resolve) {
771
771
  _this3.getGoogletag().then(function (googletag) {
772
+ _this3.configureInitialOptions(googletag);
773
+
772
774
  slotsToInitialize.forEach(function (currentSlotId) {
773
775
  registeredSlots[currentSlotId].loading = false;
774
776
  googletag.cmd.push(function () {
@@ -832,14 +834,25 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
832
834
  });
833
835
  });
834
836
  },
835
- configureOptions: function configureOptions(googletag) {
837
+ // configure those gpt parameters that need to be set before pubsads service
838
+ // initialization.
839
+ configureInitialOptions: function configureInitialOptions(googletag) {
836
840
  var _this4 = this;
837
841
 
842
+ googletag.cmd.push(function () {
843
+ if (_this4.disableInitialLoadIsEnabled()) {
844
+ googletag.pubads().disableInitialLoad();
845
+ }
846
+ });
847
+ },
848
+ configureOptions: function configureOptions(googletag) {
849
+ var _this5 = this;
850
+
838
851
  googletag.cmd.push(function () {
839
852
  var pubadsService = googletag.pubads();
840
- pubadsService.setRequestNonPersonalizedAds(_this4.personalizedAdsEnabled() ? 0 : 1);
853
+ pubadsService.setRequestNonPersonalizedAds(_this5.personalizedAdsEnabled() ? 0 : 1);
841
854
 
842
- var targetingArguments = _this4.getTargetingArguments(); // set global targetting arguments
855
+ var targetingArguments = _this5.getTargetingArguments(); // set global targetting arguments
843
856
 
844
857
 
845
858
  Object.keys(targetingArguments).forEach(function (varName) {
@@ -848,16 +861,16 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
848
861
  }
849
862
  }); // set global adSense attributes
850
863
 
851
- var adSenseAttributes = _this4.getAdSenseAttributes();
864
+ var adSenseAttributes = _this5.getAdSenseAttributes();
852
865
 
853
866
  Object.keys(adSenseAttributes).forEach(function (key) {
854
867
  pubadsService.set(key, adSenseAttributes[key]);
855
868
  });
856
869
 
857
- if (_this4.lazyLoadIsEnabled()) {
870
+ if (_this5.lazyLoadIsEnabled()) {
858
871
  var args = [];
859
872
 
860
- var config = _this4.getLazyLoadConfig();
873
+ var config = _this5.getLazyLoadConfig();
861
874
 
862
875
  if (config !== null) {
863
876
  args.push(config);
@@ -866,16 +879,12 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
866
879
  pubadsService.enableLazyLoad.call(args);
867
880
  }
868
881
 
869
- if (_this4.singleRequestIsEnabled()) {
882
+ if (_this5.singleRequestIsEnabled()) {
870
883
  pubadsService.enableSingleRequest();
871
884
  }
872
885
 
873
- if (_this4.disableInitialLoadIsEnabled()) {
874
- pubadsService.disableInitialLoad();
875
- }
876
-
877
- if (_this4.collapseEmptyDivs === true || _this4.collapseEmptyDivs === false) {
878
- pubadsService.collapseEmptyDivs(_this4.collapseEmptyDivs);
886
+ if (_this5.collapseEmptyDivs === true || _this5.collapseEmptyDivs === false) {
887
+ pubadsService.collapseEmptyDivs(_this5.collapseEmptyDivs);
879
888
  }
880
889
  });
881
890
  },
@@ -917,10 +926,10 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
917
926
  }
918
927
  },
919
928
  gptRefreshAds: function gptRefreshAds(slots) {
920
- var _this5 = this;
929
+ var _this6 = this;
921
930
 
922
931
  return this.getGoogletag().then(function (googletag) {
923
- _this5.configureOptions(googletag);
932
+ _this6.configureOptions(googletag);
924
933
 
925
934
  googletag.cmd.push(function () {
926
935
  var pubadsService = googletag.pubads();
@@ -931,14 +940,14 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
931
940
  });
932
941
  },
933
942
  reload: function reload() {
934
- var _this6 = this;
943
+ var _this7 = this;
935
944
 
936
945
  return this.destroyGPTSlots.apply(this, arguments).then(function () {
937
- return _this6.load();
946
+ return _this7.load();
938
947
  });
939
948
  },
940
949
  destroyGPTSlots: function destroyGPTSlots() {
941
- var _this7 = this;
950
+ var _this8 = this;
942
951
 
943
952
  for (var _len4 = arguments.length, slotsToDestroy = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
944
953
  slotsToDestroy[_key4] = arguments[_key4];
@@ -958,7 +967,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
958
967
  slots.push(slot);
959
968
  }
960
969
 
961
- _this7.getGoogletag().then(function (googletag) {
970
+ _this8.getGoogletag().then(function (googletag) {
962
971
  googletag.cmd.push(function () {
963
972
  if (managerAlreadyInitialized === true) {
964
973
  if (slotsToDestroy.length > 0) {
@@ -981,7 +990,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
981
990
  });
982
991
  },
983
992
  registerSlot: function registerSlot(_ref) {
984
- var _this8 = this;
993
+ var _this9 = this;
985
994
 
986
995
  var slotId = _ref.slotId,
987
996
  dfpNetworkId = _ref.dfpNetworkId,
@@ -1020,7 +1029,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
1020
1029
  gptSlot = slot.gptSlot;
1021
1030
 
1022
1031
  if (loading === false && !gptSlot) {
1023
- _this8.load(slotId);
1032
+ _this9.load(slotId);
1024
1033
  }
1025
1034
  }
1026
1035
  });
@@ -7948,6 +7957,7 @@ exports.SPEC_NAME_TO_URL_NAME_MAPPINGS = [
7948
7957
  ['quality', 'q'],
7949
7958
  ['fit', 'fit'],
7950
7959
  ['crop', 'crop'],
7960
+ ['saturation', 'sat'],
7951
7961
  ['auto', 'auto'],
7952
7962
  ['dpr', 'dpr']
7953
7963
  ];
@@ -7984,9 +7994,9 @@ function urlForImage(options) {
7984
7994
  // If irrelevant, or if we are requested to: don't perform crop/fit based on
7985
7995
  // the crop/hotspot.
7986
7996
  if (!(spec.rect || spec.focalPoint || spec.ignoreImageParams || spec.crop)) {
7987
- spec = __assign({}, spec, fit({ crop: crop, hotspot: hotspot }, spec));
7997
+ spec = __assign(__assign({}, spec), fit({ crop: crop, hotspot: hotspot }, spec));
7988
7998
  }
7989
- return specToImageUrl(__assign({}, spec, { asset: asset }));
7999
+ return specToImageUrl(__assign(__assign({}, spec), { asset: asset }));
7990
8000
  }
7991
8001
  exports.default = urlForImage;
7992
8002
  // eslint-disable-next-line complexity
@@ -8008,7 +8018,7 @@ function specToImageUrl(spec) {
8008
8018
  }
8009
8019
  if (spec.focalPoint) {
8010
8020
  params.push("fp-x=" + spec.focalPoint.x);
8011
- params.push("fp-x=" + spec.focalPoint.y);
8021
+ params.push("fp-y=" + spec.focalPoint.y);
8012
8022
  }
8013
8023
  var flip = [spec.flipHorizontal && 'h', spec.flipVertical && 'v'].filter(Boolean).join('');
8014
8024
  if (flip) {
@@ -8142,7 +8152,8 @@ function urlBuilder(options) {
8142
8152
  var client = options;
8143
8153
  if (isSanityClient(client)) {
8144
8154
  // Inherit config from client
8145
- var _a = client.clientConfig, apiHost = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
8155
+ var _a = client.clientConfig, apiUrl = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
8156
+ var apiHost = apiUrl || 'https://api.sanity.io';
8146
8157
  return new ImageUrlBuilder(null, {
8147
8158
  baseUrl: apiHost.replace(/^https:\/\/api\./, 'https://cdn.'),
8148
8159
  projectId: projectId,
@@ -8156,7 +8167,7 @@ exports.default = urlBuilder;
8156
8167
  var ImageUrlBuilder = /** @class */ (function () {
8157
8168
  function ImageUrlBuilder(parent, options) {
8158
8169
  this.options = parent
8159
- ? __assign({}, (parent.options || {}), (options || {})) : __assign({}, (options || {})); // Copy options
8170
+ ? __assign(__assign({}, (parent.options || {})), (options || {})) : __assign({}, (options || {})); // Copy options
8160
8171
  }
8161
8172
  ImageUrlBuilder.prototype.withOptions = function (options) {
8162
8173
  var baseUrl = options.baseUrl || '';
@@ -8273,6 +8284,10 @@ var ImageUrlBuilder = /** @class */ (function () {
8273
8284
  }
8274
8285
  return this.withOptions({ crop: value });
8275
8286
  };
8287
+ // Saturation
8288
+ ImageUrlBuilder.prototype.saturation = function (saturation) {
8289
+ return this.withOptions({ saturation: saturation });
8290
+ };
8276
8291
  ImageUrlBuilder.prototype.auto = function (value) {
8277
8292
  if (validAutoModes.indexOf(value) === -1) {
8278
8293
  throw new Error("Invalid auto mode \"" + value + "\"");
@@ -8289,10 +8304,12 @@ var ImageUrlBuilder = /** @class */ (function () {
8289
8304
  };
8290
8305
  return ImageUrlBuilder;
8291
8306
  }());
8307
+ exports.ImageUrlBuilder = ImageUrlBuilder;
8292
8308
 
8293
8309
  });
8294
8310
 
8295
8311
  unwrapExports(builder);
8312
+ var builder_1 = builder.ImageUrlBuilder;
8296
8313
 
8297
8314
  var node = createCommonjsModule(function (module) {
8298
8315
  var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
@@ -17242,22 +17259,27 @@ var FigureComponent = function FigureComponent(_ref) {
17242
17259
  null,
17243
17260
  React__default.createElement(
17244
17261
  reactBootstrap.Figure,
17245
- {
17246
- className: 'd-block',
17247
- style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imgFloat, margin: figureMargin },
17248
- onClick: function onClick() {
17249
- setOpenImgSrc(urlFor$1(node$$1, client).url());
17250
- setOpenImg(true);
17251
- } },
17262
+ { className: 'd-block', style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imgFloat, margin: figureMargin } },
17252
17263
  link$$1 ? React__default.createElement(
17253
17264
  'a',
17254
- { target: blank ? '_blank' : '_self' },
17265
+ { target: blank ? '_blank' : '_self', href: link$$1 },
17255
17266
  React__default.createElement(reactBootstrap.Figure.Image, { style: { width: '100%' }, className: 'figure-image', ref: imgElement, onLoad: loadImg, src: urlFor$1(node$$1, client).url(), alt: alt && alt }),
17256
17267
  caption && React__default.createElement('div', { dangerouslySetInnerHTML: { __html: '<span class=\'figure-caption\'>' + caption + '</span>' } })
17257
17268
  ) : React__default.createElement(
17258
17269
  React__default.Fragment,
17259
17270
  null,
17260
- React__default.createElement(reactBootstrap.Figure.Image, { style: { width: '100%' }, className: 'figure-image', ref: imgElement, onLoad: loadImg, src: urlFor$1(node$$1, client).url(), alt: alt && alt }),
17271
+ React__default.createElement(reactBootstrap.Figure.Image, {
17272
+ style: { width: '100%' },
17273
+ className: 'figure-image',
17274
+ ref: imgElement,
17275
+ onLoad: loadImg,
17276
+ src: urlFor$1(node$$1, client).url(),
17277
+ alt: alt && alt,
17278
+ onClick: function onClick() {
17279
+ setOpenImgSrc(urlFor$1(node$$1, client).url());
17280
+ setOpenImg(true);
17281
+ }
17282
+ }),
17261
17283
  caption && React__default.createElement('div', { dangerouslySetInnerHTML: { __html: '<span class=\'figure-caption\'>' + caption + '</span>' } })
17262
17284
  )
17263
17285
  ),
@@ -17344,21 +17366,18 @@ var Slideshow = function Slideshow(_ref) {
17344
17366
  );
17345
17367
  };
17346
17368
 
17347
- var isArray$1 = Array.isArray;
17348
- var keyList = Object.keys;
17349
- var hasProp = Object.prototype.hasOwnProperty;
17369
+ // do not edit .js files directly - edit src/index.jst
17370
+
17371
+
17350
17372
 
17351
17373
  var fastDeepEqual = function equal(a, b) {
17352
17374
  if (a === b) return true;
17353
17375
 
17354
17376
  if (a && b && typeof a == 'object' && typeof b == 'object') {
17355
- var arrA = isArray$1(a)
17356
- , arrB = isArray$1(b)
17357
- , i
17358
- , length
17359
- , key;
17377
+ if (a.constructor !== b.constructor) return false;
17360
17378
 
17361
- if (arrA && arrB) {
17379
+ var length, i, keys;
17380
+ if (Array.isArray(a)) {
17362
17381
  length = a.length;
17363
17382
  if (length != b.length) return false;
17364
17383
  for (i = length; i-- !== 0;)
@@ -17366,35 +17385,29 @@ var fastDeepEqual = function equal(a, b) {
17366
17385
  return true;
17367
17386
  }
17368
17387
 
17369
- if (arrA != arrB) return false;
17370
17388
 
17371
- var dateA = a instanceof Date
17372
- , dateB = b instanceof Date;
17373
- if (dateA != dateB) return false;
17374
- if (dateA && dateB) return a.getTime() == b.getTime();
17375
17389
 
17376
- var regexpA = a instanceof RegExp
17377
- , regexpB = b instanceof RegExp;
17378
- if (regexpA != regexpB) return false;
17379
- if (regexpA && regexpB) return a.toString() == b.toString();
17390
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
17391
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
17392
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
17380
17393
 
17381
- var keys = keyList(a);
17394
+ keys = Object.keys(a);
17382
17395
  length = keys.length;
17383
-
17384
- if (length !== keyList(b).length)
17385
- return false;
17396
+ if (length !== Object.keys(b).length) return false;
17386
17397
 
17387
17398
  for (i = length; i-- !== 0;)
17388
- if (!hasProp.call(b, keys[i])) return false;
17399
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
17389
17400
 
17390
17401
  for (i = length; i-- !== 0;) {
17391
- key = keys[i];
17402
+ var key = keys[i];
17403
+
17392
17404
  if (!equal(a[key], b[key])) return false;
17393
17405
  }
17394
17406
 
17395
17407
  return true;
17396
17408
  }
17397
17409
 
17410
+ // true if both NaN, false otherwise
17398
17411
  return a!==a && b!==b;
17399
17412
  };
17400
17413
 
@@ -18639,7 +18652,7 @@ function formatValue(ctx, value, recurseTimes) {
18639
18652
  var base = '', array = false, braces = ['{', '}'];
18640
18653
 
18641
18654
  // Make Array say that they are Array
18642
- if (isArray$2(value)) {
18655
+ if (isArray$1(value)) {
18643
18656
  array = true;
18644
18657
  braces = ['[', ']'];
18645
18658
  }
@@ -18818,7 +18831,7 @@ function reduceToSingleString(output, base, braces) {
18818
18831
 
18819
18832
  // NOTE: These type checking functions intentionally don't use `instanceof`
18820
18833
  // because it is fragile and can be easily faked with `Object.create()`.
18821
- function isArray$2(ar) {
18834
+ function isArray$1(ar) {
18822
18835
  return Array.isArray(ar);
18823
18836
  }
18824
18837
 
@@ -18945,7 +18958,7 @@ var util = {
18945
18958
  isNullOrUndefined: isNullOrUndefined,
18946
18959
  isNull: isNull,
18947
18960
  isBoolean: isBoolean,
18948
- isArray: isArray$2,
18961
+ isArray: isArray$1,
18949
18962
  inspect: inspect,
18950
18963
  deprecate: deprecate,
18951
18964
  format: format,
@@ -19612,201 +19625,237 @@ module.exports = exports['default'];
19612
19625
 
19613
19626
  var youTubePlayer = unwrapExports(dist);
19614
19627
 
19615
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
19616
-
19617
- var _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
19628
+ function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
19618
19629
 
19619
19630
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19620
19631
 
19621
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
19632
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
19633
+
19634
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
19635
+
19636
+ function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
19637
+
19638
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
19639
+
19640
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19622
19641
 
19623
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
19642
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
19643
+
19644
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
19624
19645
 
19625
- /**
19626
- * Check whether a `props` change should result in the video being updated.
19627
- *
19628
- * @param {Object} prevProps
19629
- * @param {Object} props
19646
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
19647
+
19648
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
19649
+
19650
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
19651
+
19652
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19653
+
19654
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19655
+ /**
19656
+ * Check whether a `props` change should result in the video being updated.
19657
+ *
19658
+ * @param {Object} prevProps
19659
+ * @param {Object} props
19630
19660
  */
19661
+
19631
19662
  function shouldUpdateVideo(prevProps, props) {
19632
19663
  // A changing video should always trigger an update
19633
19664
  if (prevProps.videoId !== props.videoId) {
19634
19665
  return true;
19635
- }
19636
-
19637
- // Otherwise, a change in the start/end time playerVars also requires a player
19666
+ } // Otherwise, a change in the start/end time playerVars also requires a player
19638
19667
  // update.
19668
+
19669
+
19639
19670
  var prevVars = prevProps.opts.playerVars || {};
19640
19671
  var vars = props.opts.playerVars || {};
19641
-
19642
19672
  return prevVars.start !== vars.start || prevVars.end !== vars.end;
19643
19673
  }
19644
-
19645
- /**
19646
- * Neutralise API options that only require a video update, leaving only options
19647
- * that require a player reset. The results can then be compared to see if a
19648
- * player reset is necessary.
19649
- *
19650
- * @param {Object} opts
19674
+ /**
19675
+ * Neutralize API options that only require a video update, leaving only options
19676
+ * that require a player reset. The results can then be compared to see if a
19677
+ * player reset is necessary.
19678
+ *
19679
+ * @param {Object} opts
19651
19680
  */
19681
+
19682
+
19652
19683
  function filterResetOptions(opts) {
19653
- return _extends$1({}, opts, {
19654
- playerVars: _extends$1({}, opts.playerVars, {
19684
+ return _objectSpread({}, opts, {
19685
+ playerVars: _objectSpread({}, opts.playerVars, {
19655
19686
  autoplay: 0,
19656
19687
  start: 0,
19657
19688
  end: 0
19658
19689
  })
19659
19690
  });
19660
19691
  }
19661
-
19662
- /**
19663
- * Check whether a `props` change should result in the player being reset.
19664
- * The player is reset when the `props.opts` change, except if the only change
19665
- * is in the `start` and `end` playerVars, because a video update can deal with
19666
- * those.
19667
- *
19668
- * @param {Object} prevProps
19669
- * @param {Object} props
19692
+ /**
19693
+ * Check whether a `props` change should result in the player being reset.
19694
+ * The player is reset when the `props.opts` change, except if the only change
19695
+ * is in the `start` and `end` playerVars, because a video update can deal with
19696
+ * those.
19697
+ *
19698
+ * @param {Object} prevProps
19699
+ * @param {Object} props
19670
19700
  */
19701
+
19702
+
19671
19703
  function shouldResetPlayer(prevProps, props) {
19672
19704
  return !fastDeepEqual(filterResetOptions(prevProps.opts), filterResetOptions(props.opts));
19673
19705
  }
19674
-
19675
- /**
19676
- * Check whether a props change should result in an id or className update.
19677
- *
19678
- * @param {Object} prevProps
19679
- * @param {Object} props
19706
+ /**
19707
+ * Check whether a props change should result in an id or className update.
19708
+ *
19709
+ * @param {Object} prevProps
19710
+ * @param {Object} props
19680
19711
  */
19712
+
19713
+
19681
19714
  function shouldUpdatePlayer(prevProps, props) {
19682
19715
  return prevProps.id !== props.id || prevProps.className !== props.className;
19683
19716
  }
19684
19717
 
19685
- var YouTube = function (_React$Component) {
19718
+ var YouTube = /*#__PURE__*/function (_React$Component) {
19686
19719
  _inherits(YouTube, _React$Component);
19687
19720
 
19721
+ var _super = _createSuper(YouTube);
19722
+
19723
+ /**
19724
+ * Expose PlayerState constants for convenience. These constants can also be
19725
+ * accessed through the global YT object after the YouTube IFrame API is instantiated.
19726
+ * https://developers.google.com/youtube/iframe_api_reference#onStateChange
19727
+ */
19688
19728
  function YouTube(props) {
19729
+ var _this;
19730
+
19689
19731
  _classCallCheck(this, YouTube);
19690
19732
 
19691
- var _this = _possibleConstructorReturn(this, (YouTube.__proto__ || Object.getPrototypeOf(YouTube)).call(this, props));
19733
+ _this = _super.call(this, props);
19692
19734
 
19693
- _this.onPlayerReady = function (event) {
19735
+ _defineProperty(_assertThisInitialized(_this), "onPlayerReady", function (event) {
19694
19736
  return _this.props.onReady(event);
19695
- };
19737
+ });
19696
19738
 
19697
- _this.onPlayerError = function (event) {
19739
+ _defineProperty(_assertThisInitialized(_this), "onPlayerError", function (event) {
19698
19740
  return _this.props.onError(event);
19699
- };
19741
+ });
19700
19742
 
19701
- _this.onPlayerStateChange = function (event) {
19743
+ _defineProperty(_assertThisInitialized(_this), "onPlayerStateChange", function (event) {
19702
19744
  _this.props.onStateChange(event);
19703
- switch (event.data) {
19704
19745
 
19746
+ switch (event.data) {
19705
19747
  case YouTube.PlayerState.ENDED:
19706
19748
  _this.props.onEnd(event);
19749
+
19707
19750
  break;
19708
19751
 
19709
19752
  case YouTube.PlayerState.PLAYING:
19710
19753
  _this.props.onPlay(event);
19754
+
19711
19755
  break;
19712
19756
 
19713
19757
  case YouTube.PlayerState.PAUSED:
19714
19758
  _this.props.onPause(event);
19759
+
19715
19760
  break;
19716
19761
 
19717
19762
  default:
19718
19763
  }
19719
- };
19764
+ });
19720
19765
 
19721
- _this.onPlayerPlaybackRateChange = function (event) {
19766
+ _defineProperty(_assertThisInitialized(_this), "onPlayerPlaybackRateChange", function (event) {
19722
19767
  return _this.props.onPlaybackRateChange(event);
19723
- };
19768
+ });
19724
19769
 
19725
- _this.onPlayerPlaybackQualityChange = function (event) {
19770
+ _defineProperty(_assertThisInitialized(_this), "onPlayerPlaybackQualityChange", function (event) {
19726
19771
  return _this.props.onPlaybackQualityChange(event);
19727
- };
19772
+ });
19728
19773
 
19729
- _this.createPlayer = function () {
19774
+ _defineProperty(_assertThisInitialized(_this), "createPlayer", function () {
19730
19775
  // do not attempt to create a player server-side, it won't work
19731
- if (typeof document === 'undefined') return;
19732
- // create player
19733
- var playerOpts = _extends$1({}, _this.props.opts, {
19776
+ if (typeof document === 'undefined') return; // create player
19777
+
19778
+ var playerOpts = _objectSpread({}, _this.props.opts, {
19734
19779
  // preload the `videoId` video if one is already given
19735
19780
  videoId: _this.props.videoId
19736
19781
  });
19737
- _this.internalPlayer = youTubePlayer(_this.container, playerOpts);
19738
- // attach event handlers
19782
+
19783
+ _this.internalPlayer = youTubePlayer(_this.container, playerOpts); // attach event handlers
19784
+
19739
19785
  _this.internalPlayer.on('ready', _this.onPlayerReady);
19786
+
19740
19787
  _this.internalPlayer.on('error', _this.onPlayerError);
19788
+
19741
19789
  _this.internalPlayer.on('stateChange', _this.onPlayerStateChange);
19790
+
19742
19791
  _this.internalPlayer.on('playbackRateChange', _this.onPlayerPlaybackRateChange);
19792
+
19743
19793
  _this.internalPlayer.on('playbackQualityChange', _this.onPlayerPlaybackQualityChange);
19744
- };
19794
+ });
19745
19795
 
19746
- _this.resetPlayer = function () {
19796
+ _defineProperty(_assertThisInitialized(_this), "resetPlayer", function () {
19747
19797
  return _this.internalPlayer.destroy().then(_this.createPlayer);
19748
- };
19798
+ });
19749
19799
 
19750
- _this.updatePlayer = function () {
19800
+ _defineProperty(_assertThisInitialized(_this), "updatePlayer", function () {
19751
19801
  _this.internalPlayer.getIframe().then(function (iframe) {
19752
19802
  if (_this.props.id) iframe.setAttribute('id', _this.props.id);else iframe.removeAttribute('id');
19753
19803
  if (_this.props.className) iframe.setAttribute('class', _this.props.className);else iframe.removeAttribute('class');
19754
19804
  });
19755
- };
19805
+ });
19756
19806
 
19757
- _this.updateVideo = function () {
19807
+ _defineProperty(_assertThisInitialized(_this), "updateVideo", function () {
19758
19808
  if (typeof _this.props.videoId === 'undefined' || _this.props.videoId === null) {
19759
19809
  _this.internalPlayer.stopVideo();
19810
+
19760
19811
  return;
19761
- }
19812
+ } // set queueing options
19813
+
19762
19814
 
19763
- // set queueing options
19764
19815
  var autoplay = false;
19765
19816
  var opts = {
19766
19817
  videoId: _this.props.videoId
19767
19818
  };
19819
+
19768
19820
  if ('playerVars' in _this.props.opts) {
19769
19821
  autoplay = _this.props.opts.playerVars.autoplay === 1;
19822
+
19770
19823
  if ('start' in _this.props.opts.playerVars) {
19771
19824
  opts.startSeconds = _this.props.opts.playerVars.start;
19772
19825
  }
19826
+
19773
19827
  if ('end' in _this.props.opts.playerVars) {
19774
19828
  opts.endSeconds = _this.props.opts.playerVars.end;
19775
19829
  }
19776
- }
19830
+ } // if autoplay is enabled loadVideoById
19831
+
19777
19832
 
19778
- // if autoplay is enabled loadVideoById
19779
19833
  if (autoplay) {
19780
19834
  _this.internalPlayer.loadVideoById(opts);
19835
+
19781
19836
  return;
19782
- }
19783
- // default behaviour just cues the video
19837
+ } // default behaviour just cues the video
19838
+
19839
+
19784
19840
  _this.internalPlayer.cueVideoById(opts);
19785
- };
19841
+ });
19786
19842
 
19787
- _this.refContainer = function (container) {
19843
+ _defineProperty(_assertThisInitialized(_this), "refContainer", function (container) {
19788
19844
  _this.container = container;
19789
- };
19845
+ });
19790
19846
 
19791
19847
  _this.container = null;
19792
19848
  _this.internalPlayer = null;
19793
19849
  return _this;
19794
19850
  }
19795
19851
 
19796
- /**
19797
- * Expose PlayerState constants for convenience. These constants can also be
19798
- * accessed through the global YT object after the YouTube IFrame API is instantiated.
19799
- * https://developers.google.com/youtube/iframe_api_reference#onStateChange
19800
- */
19801
-
19802
-
19803
19852
  _createClass(YouTube, [{
19804
- key: 'componentDidMount',
19853
+ key: "componentDidMount",
19805
19854
  value: function componentDidMount() {
19806
19855
  this.createPlayer();
19807
19856
  }
19808
19857
  }, {
19809
- key: 'componentDidUpdate',
19858
+ key: "componentDidUpdate",
19810
19859
  value: function componentDidUpdate(prevProps) {
19811
19860
  if (shouldUpdatePlayer(prevProps, this.props)) {
19812
19861
  this.updatePlayer();
@@ -19821,112 +19870,58 @@ var YouTube = function (_React$Component) {
19821
19870
  }
19822
19871
  }
19823
19872
  }, {
19824
- key: 'componentWillUnmount',
19873
+ key: "componentWillUnmount",
19825
19874
  value: function componentWillUnmount() {
19826
- /**
19827
- * Note: The `youtube-player` package that is used promisifies all Youtube
19828
- * Player API calls, which introduces a delay of a tick before it actually
19829
- * gets destroyed. Since React attempts to remove the element instantly
19830
- * this method isn't quick enough to reset the container element.
19875
+ /**
19876
+ * Note: The `youtube-player` package that is used promisifies all YouTube
19877
+ * Player API calls, which introduces a delay of a tick before it actually
19878
+ * gets destroyed. Since React attempts to remove the element instantly
19879
+ * this method isn't quick enough to reset the container element.
19831
19880
  */
19832
19881
  this.internalPlayer.destroy();
19833
19882
  }
19834
-
19835
- /**
19836
- * https://developers.google.com/youtube/iframe_api_reference#onReady
19837
- *
19838
- * @param {Object} event
19839
- * @param {Object} target - player object
19840
- */
19841
-
19842
-
19843
- /**
19844
- * https://developers.google.com/youtube/iframe_api_reference#onError
19845
- *
19846
- * @param {Object} event
19847
- * @param {Integer} data - error type
19848
- * @param {Object} target - player object
19849
- */
19850
-
19851
-
19852
- /**
19853
- * https://developers.google.com/youtube/iframe_api_reference#onStateChange
19854
- *
19855
- * @param {Object} event
19856
- * @param {Integer} data - status change type
19857
- * @param {Object} target - actual YT player
19858
- */
19859
-
19860
-
19861
- /**
19862
- * https://developers.google.com/youtube/iframe_api_reference#onPlaybackRateChange
19863
- *
19864
- * @param {Object} event
19865
- * @param {Float} data - playback rate
19866
- * @param {Object} target - actual YT player
19867
- */
19868
-
19869
-
19870
- /**
19871
- * https://developers.google.com/youtube/iframe_api_reference#onPlaybackQualityChange
19872
- *
19873
- * @param {Object} event
19874
- * @param {String} data - playback quality
19875
- * @param {Object} target - actual YT player
19876
- */
19877
-
19878
-
19879
- /**
19880
- * Initialize the Youtube Player API on the container and attach event handlers
19881
- */
19882
-
19883
-
19884
- /**
19885
- * Shorthand for destroying and then re-creating the Youtube Player
19886
- */
19887
-
19888
-
19889
- /**
19890
- * Method to update the id and class of the Youtube Player iframe.
19891
- * React should update this automatically but since the Youtube Player API
19892
- * replaced the DIV that is mounted by React we need to do this manually.
19893
- */
19894
-
19895
-
19896
- /**
19897
- * Call Youtube Player API methods to update the currently playing video.
19898
- * Depeding on the `opts.playerVars.autoplay` this function uses one of two
19899
- * Youtube Player API methods to update the video.
19883
+ /**
19884
+ * https://developers.google.com/youtube/iframe_api_reference#onReady
19885
+ *
19886
+ * @param {Object} event
19887
+ * @param {Object} target - player object
19900
19888
  */
19901
19889
 
19902
19890
  }, {
19903
- key: 'render',
19891
+ key: "render",
19904
19892
  value: function render() {
19905
- return React__default.createElement(
19906
- 'div',
19907
- { className: this.props.containerClassName },
19908
- React__default.createElement('div', { id: this.props.id, className: this.props.className, ref: this.refContainer })
19909
- );
19893
+ return /*#__PURE__*/React__default.createElement("div", {
19894
+ className: this.props.containerClassName
19895
+ }, /*#__PURE__*/React__default.createElement("div", {
19896
+ id: this.props.id,
19897
+ className: this.props.className,
19898
+ ref: this.refContainer
19899
+ }));
19910
19900
  }
19911
19901
  }]);
19912
19902
 
19913
19903
  return YouTube;
19914
19904
  }(React__default.Component);
19915
19905
 
19906
+ _defineProperty(YouTube, "PlayerState", {
19907
+ UNSTARTED: -1,
19908
+ ENDED: 0,
19909
+ PLAYING: 1,
19910
+ PAUSED: 2,
19911
+ BUFFERING: 3,
19912
+ CUED: 5
19913
+ });
19914
+
19916
19915
  YouTube.propTypes = {
19917
19916
  videoId: PropTypes.string,
19918
-
19919
19917
  // custom ID for player element
19920
19918
  id: PropTypes.string,
19921
-
19922
19919
  // custom class name for player element
19923
19920
  className: PropTypes.string,
19924
19921
  // custom class name for player container element
19925
19922
  containerClassName: PropTypes.string,
19926
-
19927
19923
  // https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player
19928
19924
  opts: PropTypes.objectOf(PropTypes.any),
19929
-
19930
19925
  // event subscriptions
19931
19926
  onReady: PropTypes.func,
19932
19927
  onError: PropTypes.func,
@@ -19938,6 +19933,7 @@ YouTube.propTypes = {
19938
19933
  onPlaybackQualityChange: PropTypes.func
19939
19934
  };
19940
19935
  YouTube.defaultProps = {
19936
+ videoId: null,
19941
19937
  id: null,
19942
19938
  className: null,
19943
19939
  opts: {},
@@ -19951,14 +19947,6 @@ YouTube.defaultProps = {
19951
19947
  onPlaybackRateChange: function onPlaybackRateChange() {},
19952
19948
  onPlaybackQualityChange: function onPlaybackQualityChange() {}
19953
19949
  };
19954
- YouTube.PlayerState = {
19955
- UNSTARTED: -1,
19956
- ENDED: 0,
19957
- PLAYING: 1,
19958
- PAUSED: 2,
19959
- BUFFERING: 3,
19960
- CUED: 5
19961
- };
19962
19950
 
19963
19951
  var YouTubePlayer$1 = function YouTubePlayer(_ref) {
19964
19952
  var url = _ref.url;
@@ -20620,7 +20608,7 @@ function checksum(str) {
20620
20608
  return hash;
20621
20609
  }
20622
20610
 
20623
- function _typeof$1(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
20611
+ function _typeof$2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$2(obj); }
20624
20612
 
20625
20613
 
20626
20614
 
@@ -20631,7 +20619,7 @@ var isDefined = function isDefined(val) {
20631
20619
 
20632
20620
  var mergeSerializers = function mergeSerializers(defaultSerializers, userSerializers) {
20633
20621
  return Object.keys(defaultSerializers).reduce(function (acc, key) {
20634
- var type = _typeof$1(defaultSerializers[key]);
20622
+ var type = _typeof$2(defaultSerializers[key]);
20635
20623
 
20636
20624
  if (type === 'function') {
20637
20625
  acc[key] = isDefined(userSerializers[key]) ? userSerializers[key] : defaultSerializers[key];
@@ -21804,8 +21792,8 @@ var window_1 = win;
21804
21792
 
21805
21793
  /*! @name @brightcove/react-player-loader @version 1.4.0 @license Apache-2.0 */
21806
21794
 
21807
- function _extends$2() {
21808
- _extends$2 = Object.assign || function (target) {
21795
+ function _extends$1() {
21796
+ _extends$1 = Object.assign || function (target) {
21809
21797
  for (var i = 1; i < arguments.length; i++) {
21810
21798
  var source = arguments[i];
21811
21799
 
@@ -21819,7 +21807,7 @@ function _extends$2() {
21819
21807
  return target;
21820
21808
  };
21821
21809
 
21822
- return _extends$2.apply(this, arguments);
21810
+ return _extends$1.apply(this, arguments);
21823
21811
  }
21824
21812
 
21825
21813
  function _inheritsLoose(subClass, superClass) {
@@ -21828,7 +21816,7 @@ function _inheritsLoose(subClass, superClass) {
21828
21816
  subClass.__proto__ = superClass;
21829
21817
  }
21830
21818
 
21831
- function _assertThisInitialized(self) {
21819
+ function _assertThisInitialized$1(self) {
21832
21820
  if (self === void 0) {
21833
21821
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
21834
21822
  }
@@ -21861,7 +21849,7 @@ var version$1 = "1.7.1";
21861
21849
  /*! @name @brightcove/player-url @version 1.2.0 @license Apache-2.0 */
21862
21850
  var version$1$1 = "1.2.0";
21863
21851
 
21864
- var _typeof$2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
21852
+ var _typeof$3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
21865
21853
  return typeof obj;
21866
21854
  } : function (obj) {
21867
21855
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
@@ -21996,7 +21984,7 @@ var brightcovePlayerUrl = function brightcovePlayerUrl(_ref) {
21996
21984
 
21997
21985
  var qs = '';
21998
21986
 
21999
- if (iframe && queryParams && (typeof queryParams === 'undefined' ? 'undefined' : _typeof$2(queryParams)) === 'object') {
21987
+ if (iframe && queryParams && (typeof queryParams === 'undefined' ? 'undefined' : _typeof$3(queryParams)) === 'object') {
22000
21988
  qs = getQueryString$1(queryParams);
22001
21989
  }
22002
21990
 
@@ -23057,7 +23045,7 @@ function (_React$Component) {
23057
23045
  _this.refNode = ref;
23058
23046
  };
23059
23047
 
23060
- _this.loadPlayer = _this.loadPlayer.bind(_assertThisInitialized(_this));
23048
+ _this.loadPlayer = _this.loadPlayer.bind(_assertThisInitialized$1(_this));
23061
23049
  return _this;
23062
23050
  }
23063
23051
  /**
@@ -23078,7 +23066,7 @@ function (_React$Component) {
23078
23066
  var userSuccess = this.props.onSuccess;
23079
23067
  var userFailure = this.props.onFailure;
23080
23068
 
23081
- var options = _extends$2({}, this.props, {
23069
+ var options = _extends$1({}, this.props, {
23082
23070
  refNode: this.refNode,
23083
23071
  refNodeInsert: 'append',
23084
23072
  onSuccess: function onSuccess(_ref) {
@@ -23387,7 +23375,7 @@ function (_React$Component) {
23387
23375
  ;
23388
23376
 
23389
23377
  _proto.render = function render() {
23390
- var props = _extends$2({
23378
+ var props = _extends$1({
23391
23379
  className: 'brightcove-react-player-loader'
23392
23380
  }, this.props.attrs, {
23393
23381
  ref: this.setRefNode
@@ -28485,7 +28473,7 @@ var Slideshow$1 = function Slideshow(_ref) {
28485
28473
  { className: 'p-2' },
28486
28474
  slide.slideshowImage.caption && React__default.createElement(
28487
28475
  'h3',
28488
- null,
28476
+ { style: { padding: '0px' } },
28489
28477
  slide.slideshowImage.caption
28490
28478
  ),
28491
28479
  slide.description && React__default.createElement(BlockContent, { blocks: slide.description, serializers: getSerializers$1(serializerArguments) })
@@ -28844,7 +28832,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
28844
28832
  React__default.createElement(
28845
28833
  Breadcrumb.Item,
28846
28834
  { active: true },
28847
- currentPath
28835
+ currentPath.indexOf('?page') !== -1 ? currentPath.slice(NaN, currentPath.indexOf('?page')) : currentPath
28848
28836
  ),
28849
28837
  React__default.createElement(
28850
28838
  'style',