@mjhls/mjh-framework 1.0.104 → 1.0.107

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.es.js CHANGED
@@ -8,7 +8,7 @@ import Card from 'react-bootstrap/Card';
8
8
  import Link from 'next/link';
9
9
  import { withRouter, useRouter } from 'next/router';
10
10
  import Media from 'react-bootstrap/Media';
11
- import { Media as Media$1, Card as Card$1, Container as Container$1, Dropdown, Figure, Carousel, Table, Button as Button$1, ProgressBar } from 'react-bootstrap';
11
+ import { Media as Media$1, Container as Container$1, Dropdown, Figure, Carousel, Table, Button as Button$1, ProgressBar, Card as Card$1 } from 'react-bootstrap';
12
12
  import ListGroup from 'react-bootstrap/ListGroup';
13
13
  import Head from 'next/head';
14
14
  import Accordion from 'react-bootstrap/Accordion';
@@ -22,6 +22,7 @@ import Navbar from 'react-bootstrap/Navbar';
22
22
  import NavDropdown from 'react-bootstrap/NavDropdown';
23
23
  import Carousel$1 from 'react-bootstrap/Carousel';
24
24
  import Breadcrumb from 'react-bootstrap/Breadcrumb';
25
+ import cookie from 'js-cookie';
25
26
 
26
27
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
27
28
 
@@ -9894,6 +9895,48 @@ var GridContent = function (_React$Component) {
9894
9895
  }
9895
9896
  }
9896
9897
  }
9898
+ }, _this.renderAuthor = function (authorDetail, index$$1, length) {
9899
+ var _id = authorDetail._id,
9900
+ displayName = authorDetail.displayName,
9901
+ url = authorDetail.url;
9902
+
9903
+ if (displayName && url && url.current) {
9904
+ return React__default.createElement(
9905
+ 'div',
9906
+ { key: _id },
9907
+ index$$1 === 0 && React__default.createElement(
9908
+ 'span',
9909
+ { className: 'pr-1' },
9910
+ 'By'
9911
+ ),
9912
+ React__default.createElement(
9913
+ Link,
9914
+ { href: '/authors/[url]', as: '/authors/' + url.current },
9915
+ React__default.createElement(
9916
+ 'a',
9917
+ { className: 'text-muted' },
9918
+ displayName,
9919
+ length !== index$$1 + 1 && React__default.createElement('br', null)
9920
+ )
9921
+ )
9922
+ );
9923
+ } else if (displayName) {
9924
+ return React__default.createElement(
9925
+ 'div',
9926
+ { key: _id },
9927
+ index$$1 === 0 && React__default.createElement(
9928
+ 'span',
9929
+ { className: 'pr-1' },
9930
+ 'By'
9931
+ ),
9932
+ React__default.createElement(
9933
+ 'span',
9934
+ { className: 'text-muted' },
9935
+ displayName,
9936
+ length !== index$$1 + 1 && React__default.createElement('br', null)
9937
+ )
9938
+ );
9939
+ }
9897
9940
  }, _this.renderManualPagination = function () {
9898
9941
  var currentPage = _this.state.currentPage;
9899
9942
 
@@ -9932,44 +9975,55 @@ var GridContent = function (_React$Component) {
9932
9975
  Col,
9933
9976
  { key: index$$1, md: 12, lg: lgVar, style: { display: 'flex', flex: '1 0 auto' } },
9934
9977
  React__default.createElement(
9935
- Link,
9936
- { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
9978
+ Card,
9979
+ { className: 'queue-card', style: { borderTop: '1px solid #EEE' } },
9937
9980
  React__default.createElement(
9938
- 'a',
9939
- null,
9981
+ Row,
9982
+ { style: { flexDirection: 'row' } },
9940
9983
  React__default.createElement(
9941
- Card,
9942
- { className: 'queue-card', style: { borderTop: '1px solid #EEE' } },
9984
+ Col,
9985
+ { md: 12, lg: 4 },
9943
9986
  React__default.createElement(
9944
- Row,
9945
- { style: { flexDirection: 'row' } },
9987
+ Link,
9988
+ { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
9946
9989
  React__default.createElement(
9947
- Col,
9948
- { md: 12, lg: 4 },
9990
+ 'a',
9991
+ null,
9949
9992
  React__default.createElement(Card.Img, { variant: 'top', src: thumbnailURL })
9950
- ),
9993
+ )
9994
+ )
9995
+ ),
9996
+ React__default.createElement(
9997
+ Col,
9998
+ null,
9999
+ React__default.createElement(
10000
+ Card.Body,
10001
+ { style: { padding: '20px' } },
9951
10002
  React__default.createElement(
9952
- Col,
9953
- null,
10003
+ Link,
10004
+ { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
9954
10005
  React__default.createElement(
9955
- Card.Body,
9956
- { style: { padding: '20px' } },
10006
+ 'a',
10007
+ null,
9957
10008
  React__default.createElement(
9958
10009
  Card.Title,
9959
10010
  null,
9960
10011
  row.title
9961
- ),
9962
- _this2.props.showPublished && row.published && React__default.createElement(
9963
- Card.Subtitle,
9964
- { style: { marginTop: 0 } },
9965
- moment(row.published).format('MMMM DD, YYYY')
9966
- ),
9967
- React__default.createElement(
9968
- Card.Text,
9969
- null,
9970
- row.summary
9971
10012
  )
9972
10013
  )
10014
+ ),
10015
+ _this2.props.showPublished && row.published && React__default.createElement(
10016
+ Card.Subtitle,
10017
+ { style: { marginTop: 0 } },
10018
+ moment(row.published).format('MMMM DD, YYYY')
10019
+ ),
10020
+ _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
10021
+ return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
10022
+ }),
10023
+ React__default.createElement(
10024
+ Card.Text,
10025
+ null,
10026
+ row.summary
9973
10027
  )
9974
10028
  )
9975
10029
  )
@@ -10020,18 +10074,21 @@ var GridContent = function (_React$Component) {
10020
10074
  Card.Title,
10021
10075
  null,
10022
10076
  row.title
10023
- ),
10024
- _this2.props.showPublished && row.published && React__default.createElement(
10025
- Card.Subtitle,
10026
- { style: { marginTop: 0 } },
10027
- moment(row.published).format('MMMM DD, YYYY')
10028
- ),
10029
- React__default.createElement(
10030
- Card.Text,
10031
- { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
10032
- row.summary
10033
10077
  )
10034
10078
  )
10079
+ ),
10080
+ _this2.props.showPublished && row.published && React__default.createElement(
10081
+ Card.Subtitle,
10082
+ { style: { marginTop: 0 } },
10083
+ moment(row.published).format('MMMM DD, YYYY')
10084
+ ),
10085
+ _this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
10086
+ return _this2.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
10087
+ }),
10088
+ React__default.createElement(
10089
+ Card.Text,
10090
+ { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
10091
+ row.summary
10035
10092
  )
10036
10093
  )
10037
10094
  )
@@ -11006,29 +11063,51 @@ var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pagevi
11006
11063
  }
11007
11064
  };
11008
11065
 
11009
- var renderAuthor = function renderAuthor(authorName, authorURL, index$$1, length) {
11010
- if (authorName && authorURL) {
11066
+ var renderAuthor = function renderAuthor(authorDetail, index$$1, length) {
11067
+ var _id = authorDetail._id,
11068
+ displayName = authorDetail.displayName,
11069
+ url = authorDetail.url;
11070
+
11071
+ if (displayName && url && url.current) {
11011
11072
  return React__default.createElement(
11012
- Link,
11013
- { href: '/authors/' + authorURL.current, key: index$$1 },
11073
+ 'div',
11074
+ { key: _id },
11075
+ index$$1 === 0 && React__default.createElement(
11076
+ 'span',
11077
+ { className: 'pr-1' },
11078
+ 'By'
11079
+ ),
11014
11080
  React__default.createElement(
11015
- 'a',
11016
- null,
11017
- authorName,
11018
- length !== index$$1 + 1 && ' | '
11081
+ Link,
11082
+ { href: '/authors/[url]', as: '/authors/' + url.current },
11083
+ React__default.createElement(
11084
+ 'a',
11085
+ { className: 'text-muted' },
11086
+ displayName,
11087
+ length !== index$$1 + 1 && React__default.createElement('br', null)
11088
+ )
11019
11089
  )
11020
11090
  );
11021
- } else if (authorName) {
11091
+ } else if (displayName) {
11022
11092
  return React__default.createElement(
11023
- 'span',
11024
- { key: index$$1 },
11025
- authorName,
11026
- length !== index$$1 + 1 && ' | '
11093
+ 'div',
11094
+ { key: _id },
11095
+ index$$1 === 0 && React__default.createElement(
11096
+ 'span',
11097
+ { className: 'pr-1' },
11098
+ 'By'
11099
+ ),
11100
+ React__default.createElement(
11101
+ 'span',
11102
+ { className: 'text-muted' },
11103
+ displayName,
11104
+ length !== index$$1 + 1 && React__default.createElement('br', null)
11105
+ )
11027
11106
  );
11028
11107
  }
11029
11108
  };
11030
11109
 
11031
- var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage) {
11110
+ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor) {
11032
11111
  return React__default.createElement(
11033
11112
  'div',
11034
11113
  null,
@@ -11082,12 +11161,8 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
11082
11161
  { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
11083
11162
  moment(article.published).format('MMMM DD, YYYY')
11084
11163
  ),
11085
- article.authorDetails && article.authorDetails.length > 0 && article.authorDetails.map(function (authorDetail, index$$1) {
11086
- return React__default.createElement(
11087
- 'div',
11088
- { className: 'card-text d-inline', key: index$$1 },
11089
- renderAuthor(authorDetail.displayName, authorDetail.url, index$$1, article.authorDetails.length)
11090
- );
11164
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index$$1) {
11165
+ return renderAuthor(authorDetail, index$$1, article.authorMapping.length);
11091
11166
  }),
11092
11167
  article.summary && React__default.createElement(
11093
11168
  'p',
@@ -11139,7 +11214,8 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
11139
11214
  mapping = props.mapping,
11140
11215
  seoPaginate = props.seoPaginate,
11141
11216
  pageview = props.pageview,
11142
- defaultImage = props.defaultImage;
11217
+ defaultImage = props.defaultImage,
11218
+ showAuthor = props.showAuthor;
11143
11219
  var initialCurrentPage = props.currentPage,
11144
11220
  showPublished = props.showPublished;
11145
11221
 
@@ -11156,9 +11232,8 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
11156
11232
  setScrolling = _useState4[1];
11157
11233
 
11158
11234
  var _useState5 = useState(params ? params.to : 0),
11159
- _useState6 = slicedToArray(_useState5, 2),
11160
- per = _useState6[0],
11161
- setPer = _useState6[1];
11235
+ _useState6 = slicedToArray(_useState5, 1),
11236
+ per = _useState6[0];
11162
11237
 
11163
11238
  var _useState7 = useState(initialCurrentPage || 1),
11164
11239
  _useState8 = slicedToArray(_useState7, 2),
@@ -11198,7 +11273,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
11198
11273
  React__default.createElement(
11199
11274
  Container$1,
11200
11275
  null,
11201
- cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage)
11276
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor)
11202
11277
  )
11203
11278
  ),
11204
11279
  React__default.createElement(
@@ -11212,7 +11287,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
11212
11287
  React__default.createElement(
11213
11288
  Container$1,
11214
11289
  null,
11215
- cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage)
11290
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor)
11216
11291
  ),
11217
11292
  React__default.createElement(
11218
11293
  'div',
@@ -11244,6 +11319,233 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
11244
11319
  );
11245
11320
  };
11246
11321
 
11322
+ var VideoSeriesListing = function (_React$Component) {
11323
+ inherits(VideoSeriesListing, _React$Component);
11324
+
11325
+ function VideoSeriesListing() {
11326
+ var _ref;
11327
+
11328
+ var _temp, _this, _ret;
11329
+
11330
+ classCallCheck(this, VideoSeriesListing);
11331
+
11332
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
11333
+ args[_key] = arguments[_key];
11334
+ }
11335
+
11336
+ return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = VideoSeriesListing.__proto__ || Object.getPrototypeOf(VideoSeriesListing)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.dataArr = [_this.data], _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
11337
+ data: _this.dataArr,
11338
+ per: _this.params ? _this.params.to : 2,
11339
+ page: _this.props.currentPage || 1,
11340
+ from: _this.params ? _this.params.from : 0,
11341
+ to: _this.params ? _this.params.to : 2,
11342
+ total_pages: null,
11343
+ scrolling: true,
11344
+ query: _this.query,
11345
+ currentPage: _this.props.currentPage || 1
11346
+ }, _this.loadMore = debounce_1(function () {
11347
+ _this.setState(function (state) {
11348
+ var page = state.page,
11349
+ from = state.from,
11350
+ per = state.per,
11351
+ to = state.to;
11352
+
11353
+ return {
11354
+ page: page + 1,
11355
+ from: from + per,
11356
+ to: to + per
11357
+ };
11358
+ }, _this.loadData);
11359
+ }, 0), _this.loadData = function () {
11360
+ var _this$state = _this.state,
11361
+ from = _this$state.from,
11362
+ to = _this$state.to,
11363
+ data = _this$state.data,
11364
+ query = _this$state.query,
11365
+ page = _this$state.page;
11366
+ var client = _this.props.client;
11367
+
11368
+ _this.changePageNumber(page);
11369
+ var params = _extends({}, _this.params, { from: from, to: to
11370
+ // const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
11371
+ // const query = '*[_type == "article" && defined(title) && defined(thumbnail)][$from...$to] { title, summary, thumbnail { asset-> }, url }'
11372
+ });client.fetch(query, params).then(function (dataArr) {
11373
+ if (_this.pointer && _this.pointerArray) {
11374
+ var pointer = _this.pointer;
11375
+ dataArr = dataArr[_this.pointerArray][pointer];
11376
+ }
11377
+ dataArr = dataArr.map(function (item) {
11378
+ return _extends({}, item, {
11379
+ pageNumber: page
11380
+ });
11381
+ });
11382
+
11383
+ _this.setState(function () {
11384
+ if (dataArr.length > 0) {
11385
+ var newDataArr = _this.state.data;
11386
+ newDataArr.push(dataArr);
11387
+ return {
11388
+ data: newDataArr,
11389
+ scrolling: true
11390
+ };
11391
+ } else {
11392
+ return {
11393
+ scrolling: false
11394
+ };
11395
+ }
11396
+ });
11397
+ });
11398
+ }, _this.changePageNumber = function (pageNumber) {
11399
+ var _this$props = _this.props,
11400
+ seoPaginate = _this$props.seoPaginate,
11401
+ pageview = _this$props.pageview,
11402
+ router = _this$props.router;
11403
+ var currentPage = _this.state.currentPage;
11404
+
11405
+ if (seoPaginate) {
11406
+ var path = router.asPath;
11407
+ var qrIndex = path.indexOf('?');
11408
+ var pathname = router.pathname;
11409
+ var queryString = '';
11410
+
11411
+ if (qrIndex > 0) {
11412
+ path = path.substring(1, qrIndex);
11413
+
11414
+ var partialQS = router.asPath.substring(qrIndex + 1);
11415
+ var partialQSArr = partialQS.split('&');
11416
+
11417
+ // exclude page=xxx from query string
11418
+ partialQSArr.map(function (item) {
11419
+ var itemArr = item.split('=');
11420
+ var key = itemArr[0];
11421
+ var val = itemArr[1];
11422
+
11423
+ if (key !== 'page') {
11424
+ queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
11425
+ }
11426
+ });
11427
+ }
11428
+
11429
+ if (queryString.length > 0) {
11430
+ path += '?' + queryString;
11431
+ }
11432
+
11433
+ pageNumber = parseInt(pageNumber);
11434
+
11435
+ if (currentPage !== pageNumber) {
11436
+ lib_3.refresh();
11437
+ if (pageview) {
11438
+ _this.setState({
11439
+ currentPage: pageNumber
11440
+ }, function () {
11441
+ if (path[0] !== '/') {
11442
+ path = '/' + path;
11443
+ }
11444
+
11445
+ var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
11446
+
11447
+ pageview(newPath);
11448
+
11449
+ router.push(pathname, newPath, {
11450
+ shallow: true
11451
+ });
11452
+ });
11453
+ }
11454
+ }
11455
+ }
11456
+ }, _this.renderManualPagination = function () {
11457
+ var currentPage = _this.state.currentPage;
11458
+
11459
+ return React__default.createElement(
11460
+ 'div',
11461
+ { className: 'd-flex justify-content-between' },
11462
+ currentPage && currentPage > 1 && React__default.createElement(
11463
+ 'a',
11464
+ { href: '?page=' + (currentPage - 1) },
11465
+ '<< Previous'
11466
+ ),
11467
+ React__default.createElement(
11468
+ 'a',
11469
+ { href: '?page=' + (currentPage + 1) },
11470
+ 'Next >>'
11471
+ )
11472
+ );
11473
+ }, _this.renderSeries = function (seriesData) {
11474
+ var itemCounter = 0;
11475
+
11476
+ return React__default.createElement(
11477
+ 'div',
11478
+ null,
11479
+ seriesData && seriesData.map(function (docSeries, index$$1) {
11480
+ docSeries.body[0].videos.map(function (singleVideo, indexInner) {
11481
+ singleVideo.link = '/view/' + docSeries.url.current + '?seriesVid=' + (indexInner + 1);
11482
+ });
11483
+ return React__default.createElement(
11484
+ 'div',
11485
+ { key: index$$1, counter: itemCounter++ },
11486
+ React__default.createElement(
11487
+ 'h4',
11488
+ { className: 'video-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', borderBottom: '2px solid var(--gold)' } },
11489
+ React__default.createElement(
11490
+ Link,
11491
+ { href: '/' + _this.props.page + '/' + docSeries.url.current },
11492
+ React__default.createElement(
11493
+ 'a',
11494
+ null,
11495
+ docSeries.title,
11496
+ React__default.createElement(
11497
+ 'span',
11498
+ { style: { fontSize: '.9rem', color: 'grey', marginLeft: '1rem' } },
11499
+ 'View Topic'
11500
+ )
11501
+ )
11502
+ )
11503
+ ),
11504
+ React__default.createElement(YoutubeGroup, { key: index$$1, dataset: docSeries.body[0].videos })
11505
+ );
11506
+ })
11507
+ );
11508
+ }, _temp), possibleConstructorReturn(_this, _ret);
11509
+ }
11510
+
11511
+ createClass(VideoSeriesListing, [{
11512
+ key: 'render',
11513
+ value: function render() {
11514
+ var _this2 = this;
11515
+
11516
+ return React__default.createElement(
11517
+ InfiniteScroll,
11518
+ { dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.9 },
11519
+ React__default.createElement(
11520
+ Container,
11521
+ null,
11522
+ this.state.data && this.state.data.map(function (series, index$$1) {
11523
+ var page = series[0].pageNumber !== 1 ? series[0].pageNumber : index$$1 + 1;
11524
+
11525
+ return React__default.createElement(
11526
+ VisibilitySensor,
11527
+ {
11528
+ partialVisibility: true,
11529
+ offset: { bottom: 400, top: 200 },
11530
+ key: index$$1,
11531
+ onChange: function onChange(isVisible) {
11532
+ isVisible && _this2.changePageNumber(page);
11533
+ } },
11534
+ React__default.createElement(
11535
+ 'div',
11536
+ null,
11537
+ _this2.renderSeries(series)
11538
+ )
11539
+ );
11540
+ })
11541
+ )
11542
+ );
11543
+ }
11544
+ }]);
11545
+ return VideoSeriesListing;
11546
+ }(React__default.Component);
11547
+ var VideoSeriesListing$1 = withRouter(VideoSeriesListing);
11548
+
11247
11549
  var Column1 = function Column1(props) {
11248
11550
  var title = props.title;
11249
11551
 
@@ -11591,6 +11893,10 @@ function IconBase(props) {
11591
11893
  }
11592
11894
 
11593
11895
  // THIS FILE IS AUTO GENERATED
11896
+ var IoIosHome = function (props) {
11897
+ return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M258.5 104.1c-1.5-1.2-3.5-1.2-5 0l-156 124.8c-.9.8-1.5 1.9-1.5 3.1v230c0 1.1.9 2 2 2h108c1.1 0 2-.9 2-2V322c0-1.1.9-2 2-2h92c1.1 0 2 .9 2 2v140c0 1.1.9 2 2 2h108c1.1 0 2-.9 2-2V232c0-1.2-.6-2.4-1.5-3.1l-156-124.8z"}},{"tag":"path","attr":{"d":"M458.7 204.2l-189-151.4C265.9 49.7 261 48 256 48s-9.9 1.7-13.7 4.8L160 119.7V77.5c0-1.1-.9-2-2-2H98c-1.1 0-2 .9-2 2v92.2l-42.7 35.1c-3.1 2.5-5.1 6.2-5.3 10.2-.2 4 1.3 7.9 4.1 10.7 2.6 2.6 6.1 4.1 9.9 4.1 3.2 0 6.3-1.1 8.8-3.1l183.9-148c.5-.4.9-.4 1.3-.4s.8.1 1.3.4l183.9 147.4c2.5 2 5.6 3.1 8.8 3.1 3.7 0 7.2-1.4 9.9-4.1 2.9-2.8 4.4-6.7 4.2-10.7-.3-4-2.2-7.7-5.4-10.2z"}}]})(props);
11898
+ };
11899
+ IoIosHome.displayName = "IoIosHome";
11594
11900
  var IoMdArrowDropdown = function (props) {
11595
11901
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M128 192l128 128 128-128z"}}]})(props);
11596
11902
  };
@@ -11882,6 +12188,31 @@ var NavMagazine = function NavMagazine(props) {
11882
12188
  subNav = props.subNav,
11883
12189
  website = props.website;
11884
12190
 
12191
+ var navRef = useRef(null);
12192
+
12193
+ var _useState = useState(false),
12194
+ _useState2 = slicedToArray(_useState, 2),
12195
+ isSticky = _useState2[0],
12196
+ setIsSticky = _useState2[1];
12197
+
12198
+ useEffect(function () {
12199
+ document.addEventListener('scroll', trackScrolling);
12200
+ return function () {
12201
+ document.removeEventListener('scroll', trackScrolling);
12202
+ };
12203
+ // eslint-disable-next-line react-hooks/exhaustive-deps
12204
+ }, []);
12205
+
12206
+ var trackScrolling = function trackScrolling() {
12207
+ var offsetTop = navRef.current.getBoundingClientRect().top;
12208
+
12209
+ if (offsetTop === 0) {
12210
+ setIsSticky(true);
12211
+ } else {
12212
+ setIsSticky(false);
12213
+ }
12214
+ };
12215
+
11885
12216
  return React__default.createElement(
11886
12217
  React__default.Fragment,
11887
12218
  null,
@@ -11914,7 +12245,7 @@ var NavMagazine = function NavMagazine(props) {
11914
12245
  ),
11915
12246
  React__default.createElement(
11916
12247
  Navbar,
11917
- { className: 'bottom-nav', variant: 'dark', expand: 'lg', bg: 'primary', sticky: 'top' },
12248
+ { className: 'bottom-nav', variant: 'dark', expand: 'lg', bg: 'primary', sticky: 'top', ref: navRef },
11918
12249
  React__default.createElement(
11919
12250
  Container,
11920
12251
  { className: 'mobile-nav' },
@@ -11922,6 +12253,15 @@ var NavMagazine = function NavMagazine(props) {
11922
12253
  React__default.createElement(
11923
12254
  Navbar.Collapse,
11924
12255
  { id: 'basic-navbar-nav' },
12256
+ isSticky && React__default.createElement(
12257
+ Link,
12258
+ { href: '/' },
12259
+ React__default.createElement(
12260
+ 'a',
12261
+ null,
12262
+ React__default.createElement(IoIosHome, { size: 20, className: 'sticky-home', color: '#fff' })
12263
+ )
12264
+ ),
11925
12265
  React__default.createElement(
11926
12266
  Nav,
11927
12267
  { className: 'mr-auto' },
@@ -12004,6 +12344,48 @@ var NavMagazine = function NavMagazine(props) {
12004
12344
  })
12005
12345
  )
12006
12346
  ),
12347
+ React__default.createElement(
12348
+ Navbar.Collapse,
12349
+ { id: 'basic-navbar-nav' },
12350
+ React__default.createElement(
12351
+ Nav,
12352
+ { className: 'mr-auto' },
12353
+ dataObject && dataObject.map(function (row, index) {
12354
+ if (row.subQuery && row.subQuery.length > 0) {
12355
+ return row.name ? React__default.createElement(
12356
+ NavDropdown,
12357
+ { key: index, title: row.name, id: 'basic-nav-dropdown' },
12358
+ row.subQuery && row.subQuery.map(function (ddRow, subIndex) {
12359
+ if (ddRow.type === 'divider') {
12360
+ return React__default.createElement(NavDropdown.Divider, { key: subIndex });
12361
+ } else {
12362
+ return ddRow.url && ddRow.name ? React__default.createElement(
12363
+ Link,
12364
+ { key: subIndex, href: ddRow.url },
12365
+ React__default.createElement(
12366
+ 'a',
12367
+ { target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
12368
+ ddRow.name
12369
+ )
12370
+ ) : null;
12371
+ }
12372
+ })
12373
+ ) : null;
12374
+ } else {
12375
+ return row.url && row.name ? React__default.createElement(
12376
+ Link,
12377
+ { key: index, href: row.url },
12378
+ React__default.createElement(
12379
+ 'a',
12380
+ { target: row.blank ? '_blank' : '_self', className: 'nav-link' },
12381
+ row.name
12382
+ )
12383
+ ) : null;
12384
+ }
12385
+ })
12386
+ ),
12387
+ React__default.createElement(Search, { device: 'mobile' })
12388
+ ),
12007
12389
  website && React__default.createElement(
12008
12390
  Navbar.Collapse,
12009
12391
  { id: 'basic-navbar-sub' },
@@ -12018,7 +12400,7 @@ var NavMagazine = function NavMagazine(props) {
12018
12400
  React__default.createElement(
12019
12401
  'style',
12020
12402
  { jsx: true },
12021
- '\n @media screen and (max-width: 991px) {\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n .navbar-expand-lg .show#basic-navbar-sub {\n display: block;\n }\n .navbar .mobile-nav .navbar-collapse.show {\n padding-bottom: 20px;\n border-bottom: 0.5px solid white;\n margin-bottom: 15px;\n }\n .navbar .mobile-nav .navbar-collapse .form-inline {\n margin: 5px 0px;\n }\n .navbar .mobile-nav .navbar-collapse:last-child {\n border-bottom: none;\n margin-bottom: 0px;\n padding-bottom: 0px;\n }\n .navbar .mobile-nav .navbar-collapse .nav-footer ul {\n list-style-type: none;\n padding: inherit;\n margin-bottom: 0rem;\n }\n .navbar .mobile-nav .navbar-collapse .nav-footer .nav-link {\n text-transform: capitalize !important;\n font-weight: 300;\n }\n .navbar .mobile-nav .dropdown-item:focus {\n background-color: #696969;\n }\n .navbar .mobile-nav .dropdown-menu .dropdown-item {\n color: white;\n }\n .navbar .mobile-nav .dropdown-menu {\n background: inherit;\n border: none;\n }\n }\n @media screen and (min-width: 992px) {\n #basic-navbar-sub {\n display: none !important;\n }\n .navbar .mobile-nav .dropdown-menu .dropdown-item {\n color: #696969;\n }\n .navbar .mobile-nav .dropdown-menu {\n background: white;\n border: 1 px solid #708090;\n }\n }\n '
12403
+ '\n .sticky-home {\n position: relative;\n top: -3px;\n left: -6px;\n cursor: pointer;\n }\n @media screen and (max-width: 991px) {\n .sticky-home {\n display: none;\n }\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n .navbar-expand-lg .show#basic-navbar-sub {\n display: block;\n }\n .navbar .mobile-nav .navbar-collapse.show {\n padding-bottom: 20px;\n border-bottom: 0.5px solid white;\n margin-bottom: 15px;\n }\n .navbar .mobile-nav .navbar-collapse .form-inline {\n display: none;\n }\n .navbar .mobile-nav .navbar-collapse {\n margin-top: 15px;\n }\n .navbar .mobile-nav .navbar-collapse:last-child {\n border-bottom: none;\n margin-bottom: 0px;\n padding-bottom: 0px;\n margin-top: 0px;\n }\n .navbar .mobile-nav .navbar-collapse .nav-footer ul {\n list-style-type: none;\n padding: inherit;\n margin-bottom: 0rem;\n }\n .navbar .mobile-nav .navbar-collapse .nav-footer .nav-link {\n text-transform: capitalize !important;\n font-weight: 300;\n }\n .navbar .mobile-nav .dropdown-item:focus {\n background-color: #696969;\n }\n .navbar .mobile-nav .dropdown-menu .dropdown-item {\n color: white;\n }\n .navbar .mobile-nav .dropdown-menu {\n background: inherit;\n border: none;\n }\n .navbar .mobile-nav .dropdown-menu.show {\n max-height: 100px;\n }\n }\n @media screen and (min-width: 992px) {\n #basic-navbar-sub {\n display: none !important;\n }\n .navbar .mobile-nav .dropdown-menu .dropdown-item {\n color: #696969;\n }\n .navbar .mobile-nav .dropdown-menu {\n background: white;\n border: 1 px solid #708090;\n }\n }\n .mobile-nav .navbar-toggler {\n width: 100%;\n }\n .mobile-nav .navbar-toggler-icon {\n margin-top: 4px;\n float: left;\n }\n .mobile-nav .form-inline {\n float: right;\n }\n .mobile-nav .form-inline .mobile-search {\n width: 69%;\n }\n '
12022
12404
  )
12023
12405
  );
12024
12406
  };
@@ -13408,26 +13790,38 @@ var AD300x250x600 = function AD300x250x600(_ref) {
13408
13790
  });
13409
13791
  };
13410
13792
 
13793
+ var urlFor$1 = function urlFor(source, client) {
13794
+ var builder = imageUrlBuilder(client);
13795
+ return builder.image(source);
13796
+ };
13797
+
13411
13798
  var FigureComponent = function FigureComponent(_ref) {
13412
13799
  var node$$1 = _ref.node,
13413
13800
  client = _ref.client;
13801
+
13802
+ var imgElement = useRef(null);
13803
+
13804
+ var _useState = useState(null),
13805
+ _useState2 = slicedToArray(_useState, 2),
13806
+ captionWidth = _useState2[0],
13807
+ setcaptionWidth = _useState2[1];
13808
+
13809
+ var _useState3 = useState(''),
13810
+ _useState4 = slicedToArray(_useState3, 2),
13811
+ imgFloat = _useState4[0],
13812
+ setimgFloat = _useState4[1];
13813
+
13414
13814
  var caption = node$$1.caption,
13415
- asset = node$$1.asset,
13416
13815
  alt = node$$1.alt,
13417
13816
  blank = node$$1.blank,
13418
13817
  link = node$$1.link,
13419
- _node$widthP = node$$1.widthP,
13420
- widthP = _node$widthP === undefined ? '100' : _node$widthP,
13818
+ widthP = node$$1.widthP,
13421
13819
  _node$alignment = node$$1.alignment,
13422
13820
  alignment = _node$alignment === undefined ? 'center' : _node$alignment;
13423
13821
 
13424
- var builder = imageUrlBuilder(client);
13425
13822
 
13426
- var urlFor = function urlFor(source) {
13427
- return builder.image(source);
13428
- };
13429
- var imgWidth = widthP + '%';
13430
- var imgFloat = alignment.toLowerCase() === 'center' ? 'none' : alignment.toLowerCase();
13823
+ var imgWidth = widthP ? widthP + '%' : 'auto';
13824
+
13431
13825
  var figureMargin = void 0;
13432
13826
  if (imgFloat === 'none') {
13433
13827
  figureMargin = '0 auto 1rem';
@@ -13438,32 +13832,47 @@ var FigureComponent = function FigureComponent(_ref) {
13438
13832
  if (imgFloat === 'right') {
13439
13833
  figureMargin = '0 10% 1rem 1rem';
13440
13834
  }
13835
+
13836
+ var loadImg = function loadImg() {
13837
+ setcaptionWidth(imgElement.current.naturalWidth);
13838
+ };
13839
+
13840
+ useEffect(function () {
13841
+ var screenWidth = window.innerWidth;
13842
+ if (screenWidth > 1000) {
13843
+ var align = alignment.toLowerCase() === 'center' ? 'none' : alignment.toLowerCase();
13844
+ setimgFloat(align);
13845
+ loadImg();
13846
+ }
13847
+ // eslint-disable-next-line react-hooks/exhaustive-deps
13848
+ }, []);
13849
+
13441
13850
  return React__default.createElement(
13442
13851
  Figure,
13443
- { className: 'd-block text-center mb-3', style: { width: imgWidth, float: imgFloat, margin: figureMargin } },
13852
+ { className: 'd-block text-center mb-3', style: { width: imgWidth, clear: 'both', float: imgFloat, margin: figureMargin } },
13444
13853
  link ? React__default.createElement(
13445
13854
  'a',
13446
13855
  { href: link, target: blank ? '_blank' : '_self' },
13447
- React__default.createElement(Figure.Image, { src: urlFor(node$$1).url(), alt: alt && alt }),
13856
+ React__default.createElement(Figure.Image, { ref: imgElement, onLoad: loadImg, src: urlFor$1(node$$1, client).url(), alt: alt && alt }),
13448
13857
  caption && React__default.createElement(
13449
13858
  Figure.Caption,
13450
- null,
13859
+ { style: { width: captionWidth } },
13451
13860
  caption
13452
13861
  )
13453
13862
  ) : React__default.createElement(
13454
13863
  React__default.Fragment,
13455
13864
  null,
13456
- React__default.createElement(Figure.Image, { src: urlFor(node$$1).url(), alt: alt && alt }),
13865
+ React__default.createElement(Figure.Image, { ref: imgElement, onLoad: loadImg, src: urlFor$1(node$$1, client).url(), alt: alt && alt }),
13457
13866
  caption && React__default.createElement(
13458
13867
  Figure.Caption,
13459
- null,
13868
+ { style: { width: captionWidth } },
13460
13869
  caption
13461
13870
  )
13462
13871
  )
13463
13872
  );
13464
13873
  };
13465
13874
 
13466
- var urlFor$1 = function urlFor(source, builder) {
13875
+ var urlFor$2 = function urlFor(source, builder) {
13467
13876
  return builder.image(source);
13468
13877
  };
13469
13878
 
@@ -13499,7 +13908,7 @@ var Slideshow = function Slideshow(_ref) {
13499
13908
  return React__default.createElement(
13500
13909
  Carousel.Item,
13501
13910
  { key: slide._key },
13502
- React__default.createElement('img', { src: slide.asset && urlFor$1(slide.asset, builder).url(), alt: slide.alt && slide.alt, style: { width: '100%' } }),
13911
+ React__default.createElement('img', { src: slide.asset && urlFor$2(slide.asset, builder).url(), alt: slide.alt && slide.alt, style: { width: '100%' } }),
13503
13912
  slide.caption && React__default.createElement(
13504
13913
  'p',
13505
13914
  { className: 'p-2' },
@@ -19389,7 +19798,9 @@ var Video = function Video(_ref) {
19389
19798
  var source = node.source,
19390
19799
  videoID = node.videoID;
19391
19800
 
19392
- if (source === 'brightcove' && accountIDs.brightcove) return React__default.createElement(ReactPlayerLoader, { accountId: accountIDs.brightcove, videoId: videoID, attrs: { className: 'brightcove' } });
19801
+ if (source === 'brightcove' && accountIDs.brightcove) {
19802
+ return React__default.createElement(ReactPlayerLoader, { accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove' } });
19803
+ }
19393
19804
  // TODO - add players for other video types
19394
19805
  return null;
19395
19806
  };
@@ -19610,7 +20021,7 @@ var Poll = function Poll(_ref) {
19610
20021
  response = node.response;
19611
20022
 
19612
20023
 
19613
- var choicesTotolCount = choices && choices.reduce(function (acc, choice) {
20024
+ var choicesTotalCount = choices && choices.reduce(function (acc, choice) {
19614
20025
  acc = acc + parseInt(choice.choiceCount);
19615
20026
  return acc;
19616
20027
  }, 0);
@@ -19651,7 +20062,7 @@ var Poll = function Poll(_ref) {
19651
20062
  'div',
19652
20063
  { className: 'progress-container' },
19653
20064
  showAnswer && choices && choices.length > 0 && choices.map(function (choice) {
19654
- var percentage = Math.floor(choice.choiceCount * 100 / choicesTotolCount);
20065
+ var percentage = choicesTotalCount && choicesTotalCount > 0 ? Math.floor(choice.choiceCount * 100 / choicesTotalCount) : 0;
19655
20066
  return React__default.createElement(
19656
20067
  'div',
19657
20068
  { key: choice._key, className: 'mb-3' },
@@ -19660,16 +20071,24 @@ var Poll = function Poll(_ref) {
19660
20071
  null,
19661
20072
  choice.choiceText
19662
20073
  ),
19663
- React__default.createElement(ProgressBar, { now: percentage, label: percentage + '%' }),
20074
+ React__default.createElement(ProgressBar, { now: percentage }),
19664
20075
  React__default.createElement(
19665
20076
  'span',
19666
20077
  { className: 'float-right' },
20078
+ percentage,
20079
+ '% (',
19667
20080
  choice.choiceCount,
19668
- ' Votes'
20081
+ ' Votes)'
19669
20082
  )
19670
20083
  );
19671
20084
  })
19672
20085
  ),
20086
+ showAnswer && React__default.createElement(
20087
+ 'h4',
20088
+ { className: 'text-center small p-3' },
20089
+ 'Total Votes: ',
20090
+ choicesTotalCount
20091
+ ),
19673
20092
  showAnswer && response && React__default.createElement(BlockContent, { blocks: response }),
19674
20093
  React__default.createElement(
19675
20094
  'style',
@@ -19791,7 +20210,7 @@ var Feature = function Feature(props) {
19791
20210
  null,
19792
20211
  React__default.createElement(
19793
20212
  Carousel$1,
19794
- null,
20213
+ { touch: true },
19795
20214
  dataset.map(function (feature, index) {
19796
20215
  var feature_title = feature.feature_title,
19797
20216
  feature_body = feature.feature_body,
@@ -19875,7 +20294,56 @@ var Breadcrumbs = function Breadcrumbs() {
19875
20294
  );
19876
20295
  };
19877
20296
 
19878
- var urlFor$2 = function urlFor(source, client) {
20297
+ var SetCookie = function SetCookie(key, value) {
20298
+ cookie.set(key, value, { expires: 1, sameSite: 'none', secure: true });
20299
+ };
20300
+
20301
+ var BreadcrumbsExtended = function BreadcrumbsExtended(_ref) {
20302
+ var childLinks = _ref.childLinks,
20303
+ parentTaxonomy = _ref.parentTaxonomy;
20304
+
20305
+ if (childLinks && childLinks.length > 0) {
20306
+ return React__default.createElement(
20307
+ Breadcrumb,
20308
+ null,
20309
+ childLinks.map(function (item, index) {
20310
+ return React__default.createElement(
20311
+ Breadcrumb.Item,
20312
+ { href: '/' + item.url, key: index },
20313
+ item.name
20314
+ );
20315
+ }),
20316
+ React__default.createElement(
20317
+ 'style',
20318
+ { jsx: true },
20319
+ '\n .breadcrumb {\n background: transparent;\n border: none;\n padding-left: 0.25rem;\n }\n\n .breadcrumb-item + .breadcrumb-item::before {\n content: \'|\';\n }\n\n .breadcrumb .breadcrumb-item a {\n color: var(--primary);\n font-size: 12px;\n }\n '
20320
+ )
20321
+ );
20322
+ } else if (parentTaxonomy.identifier && parentTaxonomy.name) {
20323
+ return React__default.createElement(
20324
+ Breadcrumb,
20325
+ null,
20326
+ React__default.createElement(
20327
+ Breadcrumb.Item,
20328
+ { href: '/' },
20329
+ 'home'
20330
+ ),
20331
+ React__default.createElement(
20332
+ Breadcrumb.Item,
20333
+ { href: '/' + parentTaxonomy.identifier },
20334
+ parentTaxonomy.name
20335
+ ),
20336
+ React__default.createElement(
20337
+ 'style',
20338
+ { jsx: true },
20339
+ '\n ol.breadcrumb {\n background: transparent;\n padding-left: 0.25rem;\n }\n '
20340
+ )
20341
+ );
20342
+ }
20343
+ return null;
20344
+ };
20345
+
20346
+ var urlFor$3 = function urlFor(source, client) {
19879
20347
  var builder = imageUrlBuilder(client);
19880
20348
  return builder.image(source);
19881
20349
  };
@@ -19902,7 +20370,7 @@ var Hero = function Hero(_ref) {
19902
20370
  { className: 'h4' },
19903
20371
  title
19904
20372
  ),
19905
- thumbnail && React__default.createElement(Card$1.Img, { src: urlFor$2(thumbnail, client).url() }),
20373
+ thumbnail && React__default.createElement(Card$1.Img, { src: urlFor$3(thumbnail, client).url() }),
19906
20374
  summary && React__default.createElement(
19907
20375
  Card$1.Footer,
19908
20376
  { className: 'h6' },
@@ -19913,5 +20381,5 @@ var Hero = function Hero(_ref) {
19913
20381
  );
19914
20382
  };
19915
20383
 
19916
- export { ContentCard as DeckContent, GridContent$1 as GridContent, Queue as DeckQueue, ThumbnailCard, TaxonomyCard, GroupDeck, YoutubeGroup, QueueDeckExpanded, Column1, Column2, Column3, Header, LeftNav, AccordionPanel, SocialShare, PageFilter, NavMagazine, NavNative, NavNormal, NavDvm, TemplateNormal, AD300x250, AD300x250x600, AD728x90, getSerializers$1 as getSerializers, Search, Feature, Breadcrumbs, Hero };
20384
+ export { ContentCard as DeckContent, GridContent$1 as GridContent, Queue as DeckQueue, ThumbnailCard, TaxonomyCard, GroupDeck, YoutubeGroup, QueueDeckExpanded, VideoSeriesListing$1 as VideoSeriesListing, Column1, Column2, Column3, Header, LeftNav, AccordionPanel, SocialShare, PageFilter, NavMagazine, NavNative, NavNormal, NavDvm, TemplateNormal, AD300x250, AD300x250x600, AD728x90, getSerializers$1 as getSerializers, Search, Feature, Breadcrumbs, SetCookie, BreadcrumbsExtended, Hero };
19917
20385
  //# sourceMappingURL=index.es.js.map