From da1f361919cf2c9e0e5e0c6d1514a0973a31be57 Mon Sep 17 00:00:00 2001 From: Andrew Kos Date: Thu, 6 Apr 2017 13:16:09 -0500 Subject: [PATCH] build for tag: 16.0.2 --- dist/bulbs-article-body.js | 2 + dist/bulbs-article-body.js.map | 1 + dist/bulbs-carousel.css | 2 + dist/bulbs-carousel.css.map | 1 + dist/bulbs-carousel.js | 2 + dist/bulbs-carousel.js.map | 1 + dist/bulbs-cinemagraph.css | 2 + dist/bulbs-cinemagraph.css.map | 1 + dist/bulbs-cinemagraph.js | 4 ++ dist/bulbs-cinemagraph.js.map | 1 + dist/bulbs-clickventure.bulbs-cms.js | 2 + dist/bulbs-clickventure.bulbs-cms.js.map | 1 + dist/bulbs-clickventure.css | 2 + dist/bulbs-clickventure.css.map | 1 + dist/bulbs-clickventure.js | 8 ++++ dist/bulbs-clickventure.js.map | 1 + dist/bulbs-content.css | 2 + dist/bulbs-content.css.map | 1 + dist/bulbs-content.js | 2 + dist/bulbs-content.js.map | 1 + dist/bulbs-datamap.css | 2 + dist/bulbs-datamap.css.map | 1 + dist/bulbs-datamap.js | 12 +++++ dist/bulbs-datamap.js.map | 1 + dist/bulbs-dfp.js | 2 + dist/bulbs-dfp.js.map | 1 + dist/bulbs-ellipsize.js | 2 + dist/bulbs-ellipsize.js.map | 1 + dist/bulbs-flyover-menu.css | 2 + dist/bulbs-flyover-menu.css.map | 1 + dist/bulbs-flyover-menu.js | 2 + dist/bulbs-flyover-menu.js.map | 1 + dist/bulbs-header.css | 2 + dist/bulbs-header.css.map | 1 + dist/bulbs-header.js | 2 + dist/bulbs-header.js.map | 1 + dist/bulbs-lightbox.css | 2 + dist/bulbs-lightbox.css.map | 1 + dist/bulbs-lightbox.js | 2 + dist/bulbs-lightbox.js.map | 1 + dist/bulbs-liveblog.js | 34 ++++++++++++++ dist/bulbs-liveblog.js.map | 1 + dist/bulbs-load-more.js | 2 + dist/bulbs-load-more.js.map | 1 + dist/bulbs-page.css | 2 + dist/bulbs-page.css.map | 1 + dist/bulbs-page.js | 2 + dist/bulbs-page.js.map | 1 + dist/bulbs-pinned-element.css | 2 + dist/bulbs-pinned-element.css.map | 1 + dist/bulbs-pinned-element.js | 2 + dist/bulbs-pinned-element.js.map | 1 + dist/bulbs-poll.bulbs-cms.js | 2 + dist/bulbs-poll.bulbs-cms.js.map | 1 + dist/bulbs-poll.css | 2 + dist/bulbs-poll.css.map | 1 + dist/bulbs-poll.js | 2 + dist/bulbs-poll.js.map | 1 + dist/bulbs-pollzone-charter.js | 6 +++ dist/bulbs-pollzone-charter.js.map | 1 + dist/bulbs-pollzone-map.css | 2 + dist/bulbs-pollzone-map.css.map | 1 + dist/bulbs-pollzone-map.js | 13 ++++++ dist/bulbs-pollzone-map.js.map | 1 + dist/bulbs-quiz.bulbs-cms.js | 2 + dist/bulbs-quiz.bulbs-cms.js.map | 1 + dist/bulbs-quiz.css | 2 + dist/bulbs-quiz.css.map | 1 + dist/bulbs-quiz.js | 4 ++ dist/bulbs-quiz.js.map | 1 + dist/bulbs-reading-list.js | 2 + dist/bulbs-reading-list.js.map | 1 + dist/bulbs-slick-slideshow.css | 2 + dist/bulbs-slick-slideshow.css.map | 1 + dist/bulbs-slick-slideshow.js | 28 ++++++++++++ dist/bulbs-slick-slideshow.js.map | 1 + dist/bulbs-slideshow.bulbs-cms.js | 2 + dist/bulbs-slideshow.bulbs-cms.js.map | 1 + dist/bulbs-slideshow.css | 2 + dist/bulbs-slideshow.css.map | 1 + dist/bulbs-slideshow.js | 2 + dist/bulbs-slideshow.js.map | 1 + dist/bulbs-splitpic.bulbs-cms.js | 2 + dist/bulbs-splitpic.bulbs-cms.js.map | 1 + dist/bulbs-splitpic.css | 2 + dist/bulbs-splitpic.css.map | 1 + dist/bulbs-splitpic.js | 2 + dist/bulbs-splitpic.js.map | 1 + dist/bulbs-truncate-element.css | 2 + dist/bulbs-truncate-element.css.map | 1 + dist/bulbs-truncate-element.js | 2 + dist/bulbs-truncate-element.js.map | 1 + dist/bulbs-video-play-button.css | 2 + dist/bulbs-video-play-button.css.map | 1 + dist/bulbs-video-play-button.js | 2 + dist/bulbs-video-play-button.js.map | 1 + dist/bulbs-video.bulbs-cms.js | 2 + dist/bulbs-video.bulbs-cms.js.map | 1 + dist/bulbs-video.css | 2 + dist/bulbs-video.css.map | 1 + dist/bulbs-video.js | 12 +++++ dist/bulbs-video.js.map | 1 + dist/campaign-brand-messaging.js | 2 + dist/campaign-brand-messaging.js.map | 1 + dist/campaign-display.css | 2 + dist/campaign-display.css.map | 1 + dist/campaign-display.js | 2 + dist/campaign-display.js.map | 1 + dist/campaign-product-shot.js | 2 + dist/campaign-product-shot.js.map | 1 + dist/clickhole-medal-tracker.css | 2 + dist/clickhole-medal-tracker.css.map | 1 + dist/clickhole-medal-tracker.js | 5 +++ dist/clickhole-medal-tracker.js.map | 1 + dist/lazy-iframe.js | 2 + dist/lazy-iframe.js.map | 1 + dist/lazy-template.css | 2 + dist/lazy-template.css.map | 1 + dist/lazy-template.js | 2 + dist/lazy-template.js.map | 1 + dist/notification-container.css | 2 + dist/notification-container.css.map | 1 + dist/notification-container.js | 2 + dist/notification-container.js.map | 1 + dist/progress-bar.css | 2 + dist/progress-bar.css.map | 1 + dist/progress-bar.js | 2 + dist/progress-bar.js.map | 1 + dist/share-tools.css | 2 + dist/share-tools.css.map | 1 + dist/share-tools.js | 2 + dist/share-tools.js.map | 1 + dist/vendor.bundle.js | 56 ++++++++++++++++++++++++ dist/vendor.bundle.js.map | 1 + 134 files changed, 361 insertions(+) create mode 100644 dist/bulbs-article-body.js create mode 100644 dist/bulbs-article-body.js.map create mode 100644 dist/bulbs-carousel.css create mode 100644 dist/bulbs-carousel.css.map create mode 100644 dist/bulbs-carousel.js create mode 100644 dist/bulbs-carousel.js.map create mode 100644 dist/bulbs-cinemagraph.css create mode 100644 dist/bulbs-cinemagraph.css.map create mode 100644 dist/bulbs-cinemagraph.js create mode 100644 dist/bulbs-cinemagraph.js.map create mode 100644 dist/bulbs-clickventure.bulbs-cms.js create mode 100644 dist/bulbs-clickventure.bulbs-cms.js.map create mode 100644 dist/bulbs-clickventure.css create mode 100644 dist/bulbs-clickventure.css.map create mode 100644 dist/bulbs-clickventure.js create mode 100644 dist/bulbs-clickventure.js.map create mode 100644 dist/bulbs-content.css create mode 100644 dist/bulbs-content.css.map create mode 100644 dist/bulbs-content.js create mode 100644 dist/bulbs-content.js.map create mode 100644 dist/bulbs-datamap.css create mode 100644 dist/bulbs-datamap.css.map create mode 100644 dist/bulbs-datamap.js create mode 100644 dist/bulbs-datamap.js.map create mode 100644 dist/bulbs-dfp.js create mode 100644 dist/bulbs-dfp.js.map create mode 100644 dist/bulbs-ellipsize.js create mode 100644 dist/bulbs-ellipsize.js.map create mode 100644 dist/bulbs-flyover-menu.css create mode 100644 dist/bulbs-flyover-menu.css.map create mode 100644 dist/bulbs-flyover-menu.js create mode 100644 dist/bulbs-flyover-menu.js.map create mode 100644 dist/bulbs-header.css create mode 100644 dist/bulbs-header.css.map create mode 100644 dist/bulbs-header.js create mode 100644 dist/bulbs-header.js.map create mode 100644 dist/bulbs-lightbox.css create mode 100644 dist/bulbs-lightbox.css.map create mode 100644 dist/bulbs-lightbox.js create mode 100644 dist/bulbs-lightbox.js.map create mode 100644 dist/bulbs-liveblog.js create mode 100644 dist/bulbs-liveblog.js.map create mode 100644 dist/bulbs-load-more.js create mode 100644 dist/bulbs-load-more.js.map create mode 100644 dist/bulbs-page.css create mode 100644 dist/bulbs-page.css.map create mode 100644 dist/bulbs-page.js create mode 100644 dist/bulbs-page.js.map create mode 100644 dist/bulbs-pinned-element.css create mode 100644 dist/bulbs-pinned-element.css.map create mode 100644 dist/bulbs-pinned-element.js create mode 100644 dist/bulbs-pinned-element.js.map create mode 100644 dist/bulbs-poll.bulbs-cms.js create mode 100644 dist/bulbs-poll.bulbs-cms.js.map create mode 100644 dist/bulbs-poll.css create mode 100644 dist/bulbs-poll.css.map create mode 100644 dist/bulbs-poll.js create mode 100644 dist/bulbs-poll.js.map create mode 100644 dist/bulbs-pollzone-charter.js create mode 100644 dist/bulbs-pollzone-charter.js.map create mode 100644 dist/bulbs-pollzone-map.css create mode 100644 dist/bulbs-pollzone-map.css.map create mode 100644 dist/bulbs-pollzone-map.js create mode 100644 dist/bulbs-pollzone-map.js.map create mode 100644 dist/bulbs-quiz.bulbs-cms.js create mode 100644 dist/bulbs-quiz.bulbs-cms.js.map create mode 100644 dist/bulbs-quiz.css create mode 100644 dist/bulbs-quiz.css.map create mode 100644 dist/bulbs-quiz.js create mode 100644 dist/bulbs-quiz.js.map create mode 100644 dist/bulbs-reading-list.js create mode 100644 dist/bulbs-reading-list.js.map create mode 100644 dist/bulbs-slick-slideshow.css create mode 100644 dist/bulbs-slick-slideshow.css.map create mode 100644 dist/bulbs-slick-slideshow.js create mode 100644 dist/bulbs-slick-slideshow.js.map create mode 100644 dist/bulbs-slideshow.bulbs-cms.js create mode 100644 dist/bulbs-slideshow.bulbs-cms.js.map create mode 100644 dist/bulbs-slideshow.css create mode 100644 dist/bulbs-slideshow.css.map create mode 100644 dist/bulbs-slideshow.js create mode 100644 dist/bulbs-slideshow.js.map create mode 100644 dist/bulbs-splitpic.bulbs-cms.js create mode 100644 dist/bulbs-splitpic.bulbs-cms.js.map create mode 100644 dist/bulbs-splitpic.css create mode 100644 dist/bulbs-splitpic.css.map create mode 100644 dist/bulbs-splitpic.js create mode 100644 dist/bulbs-splitpic.js.map create mode 100644 dist/bulbs-truncate-element.css create mode 100644 dist/bulbs-truncate-element.css.map create mode 100644 dist/bulbs-truncate-element.js create mode 100644 dist/bulbs-truncate-element.js.map create mode 100644 dist/bulbs-video-play-button.css create mode 100644 dist/bulbs-video-play-button.css.map create mode 100644 dist/bulbs-video-play-button.js create mode 100644 dist/bulbs-video-play-button.js.map create mode 100644 dist/bulbs-video.bulbs-cms.js create mode 100644 dist/bulbs-video.bulbs-cms.js.map create mode 100644 dist/bulbs-video.css create mode 100644 dist/bulbs-video.css.map create mode 100644 dist/bulbs-video.js create mode 100644 dist/bulbs-video.js.map create mode 100644 dist/campaign-brand-messaging.js create mode 100644 dist/campaign-brand-messaging.js.map create mode 100644 dist/campaign-display.css create mode 100644 dist/campaign-display.css.map create mode 100644 dist/campaign-display.js create mode 100644 dist/campaign-display.js.map create mode 100644 dist/campaign-product-shot.js create mode 100644 dist/campaign-product-shot.js.map create mode 100644 dist/clickhole-medal-tracker.css create mode 100644 dist/clickhole-medal-tracker.css.map create mode 100644 dist/clickhole-medal-tracker.js create mode 100644 dist/clickhole-medal-tracker.js.map create mode 100644 dist/lazy-iframe.js create mode 100644 dist/lazy-iframe.js.map create mode 100644 dist/lazy-template.css create mode 100644 dist/lazy-template.css.map create mode 100644 dist/lazy-template.js create mode 100644 dist/lazy-template.js.map create mode 100644 dist/notification-container.css create mode 100644 dist/notification-container.css.map create mode 100644 dist/notification-container.js create mode 100644 dist/notification-container.js.map create mode 100644 dist/progress-bar.css create mode 100644 dist/progress-bar.css.map create mode 100644 dist/progress-bar.js create mode 100644 dist/progress-bar.js.map create mode 100644 dist/share-tools.css create mode 100644 dist/share-tools.css.map create mode 100644 dist/share-tools.js create mode 100644 dist/share-tools.js.map create mode 100644 dist/vendor.bundle.js create mode 100644 dist/vendor.bundle.js.map diff --git a/dist/bulbs-article-body.js b/dist/bulbs-article-body.js new file mode 100644 index 00000000..708310eb --- /dev/null +++ b/dist/bulbs-article-body.js @@ -0,0 +1,2 @@ +webpackJsonp([0],[function(e,t,n){"use strict";function i(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i :last-child"),t='';e.text()||(e=e.prev()),e.is("ul")?e.children("li:last-child").append(t):e.is("div")?e.find("> :last-child").is("p")?e.find("> :last-child").append(t):e.append(t):e.is("p")&&(e.children("br").length?e.children("br:last-child").before(t):e.append(t))}},t.prototype.resizeIframes=function(){window.iFrameResize&&[].forEach.call(this.querySelectorAll("iframe.onionstudios-playlist"),function(e){window.iFrameResize({checkOrigin:!1},e)})},t.prototype.attachedCallback=function(){this.addDingbat(),this.resizeIframes()},t}(s.BulbsHTMLElement);c.extends="div",(0,s.registerElement)("bulbs-article-body",c)}]); +//# sourceMappingURL=bulbs-article-body.js.map \ No newline at end of file diff --git a/dist/bulbs-article-body.js.map b/dist/bulbs-article-body.js.map new file mode 100644 index 00000000..c33b2e9e --- /dev/null +++ b/dist/bulbs-article-body.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///bulbs-article-body.js","webpack:///./elements/bulbs-article-body/bulbs-article-body.js"],"names":["webpackJsonp","module","exports","__webpack_require__","_defaults","obj","defaults","keys","Object","getOwnPropertyNames","i","length","key","value","getOwnPropertyDescriptor","configurable","undefined","defineProperty","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","call","ReferenceError","_inherits","subClass","superClass","prototype","create","constructor","enumerable","writable","setPrototypeOf","_register","BulbsArticleBody","_BulbsHTMLElement","this","apply","arguments","addDingbat","querySelector","$lastElement","$","find","dingbat","text","prev","is","children","append","before","resizeIframes","window","iFrameResize","forEach","querySelectorAll","iframe","checkOrigin","attachedCallback","BulbsHTMLElement","extends","registerElement"],"mappings":"AAAAA,cAAc,IAER,SAASC,EAAQC,EAASC,GAE/B,YAIA,SAASC,GAAUC,EAAKC,GAA6D,IAAK,GAAlDC,GAAOC,OAAOC,oBAAoBH,GAAoBI,EAAI,EAAGA,EAAIH,EAAKI,OAAQD,IAAK,CAAE,GAAIE,GAAML,EAAKG,GAAQG,EAAQL,OAAOM,yBAAyBR,EAAUM,EAAUC,IAASA,EAAME,cAA6BC,SAAbX,EAAIO,IAAsBJ,OAAOS,eAAeZ,EAAKO,EAAKC,GAAY,MAAOR,GAE5T,QAASa,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCAEhH,QAASC,GAA2BC,EAAMC,GAAQ,IAAKD,EAAQ,KAAM,IAAIE,gBAAe,4DAAgE,QAAOD,GAAyB,gBAATA,IAAqC,kBAATA,GAA8BD,EAAPC,EAElO,QAASE,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Content":["webpackJsonp([0],[\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _register = __webpack_require__(1);\n\t\n\tfunction _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _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; }\n\t\n\tfunction _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) : _defaults(subClass, superClass); }\n\t\n\tvar BulbsArticleBody = function (_BulbsHTMLElement) {\n\t _inherits(BulbsArticleBody, _BulbsHTMLElement);\n\t\n\t function BulbsArticleBody() {\n\t _classCallCheck(this, BulbsArticleBody);\n\t\n\t return _possibleConstructorReturn(this, _BulbsHTMLElement.apply(this, arguments));\n\t }\n\t\n\t BulbsArticleBody.prototype.addDingbat = function addDingbat() {\n\t if (this.querySelector('.site-dingbat')) {\n\t return;\n\t }\n\t\n\t var $lastElement = $(this).find('> :last-child');\n\t var dingbat = '';\n\t\n\t if (!$lastElement.text()) {\n\t $lastElement = $lastElement.prev();\n\t }\n\t\n\t if ($lastElement.is('ul')) {\n\t // appends to this > ul > li:last-child\n\t $lastElement.children('li:last-child').append(dingbat);\n\t } else if ($lastElement.is('div')) {\n\t if ($lastElement.find('> :last-child').is('p')) {\n\t // appends to this > div > p:last-child\n\t $lastElement.find('> :last-child').append(dingbat);\n\t } else {\n\t // appends to this > div:last-child\n\t $lastElement.append(dingbat);\n\t }\n\t } else if ($lastElement.is('p')) {\n\t // Handle extraneous br tags\n\t if ($lastElement.children('br').length) {\n\t // targets this > p:last-child > before br:last-child\n\t $lastElement.children('br:last-child').before(dingbat);\n\t } else {\n\t // targets this > p:last-child\n\t $lastElement.append(dingbat);\n\t }\n\t }\n\t };\n\t\n\t BulbsArticleBody.prototype.resizeIframes = function resizeIframes() {\n\t if (window.iFrameResize) {\n\t [].forEach.call(this.querySelectorAll('iframe.onionstudios-playlist'), function (iframe) {\n\t window.iFrameResize({ checkOrigin: false }, iframe);\n\t });\n\t }\n\t };\n\t\n\t BulbsArticleBody.prototype.attachedCallback = function attachedCallback() {\n\t this.addDingbat();\n\t this.resizeIframes();\n\t };\n\t\n\t return BulbsArticleBody;\n\t}(_register.BulbsHTMLElement);\n\t\n\tBulbsArticleBody.extends = 'div';\n\t\n\t(0, _register.registerElement)('bulbs-article-body', BulbsArticleBody);\n\n/***/ }\n]);\n\n\n// WEBPACK FOOTER //\n// bulbs-article-body.js","import {\n BulbsHTMLElement,\n registerElement,\n} from 'bulbs-elements/register';\n\nclass BulbsArticleBody extends BulbsHTMLElement {\n\n addDingbat () {\n if (this.querySelector('.site-dingbat')) {\n return;\n }\n\n let $lastElement = $(this).find('> :last-child');\n let dingbat = '';\n\n if (!$lastElement.text()) {\n $lastElement = $lastElement.prev();\n }\n\n if ($lastElement.is('ul')) {\n // appends to this > ul > li:last-child\n $lastElement.children('li:last-child').append(dingbat);\n }\n else if ($lastElement.is('div')) {\n if ($lastElement.find('> :last-child').is('p')) {\n // appends to this > div > p:last-child\n $lastElement.find('> :last-child').append(dingbat);\n }\n else {\n // appends to this > div:last-child\n $lastElement.append(dingbat);\n }\n }\n else if ($lastElement.is('p')) {\n // Handle extraneous br tags\n if($lastElement.children('br').length) {\n // targets this > p:last-child > before br:last-child\n $lastElement.children('br:last-child').before(dingbat);\n }\n else {\n // targets this > p:last-child\n $lastElement.append(dingbat);\n }\n }\n }\n\n resizeIframes () {\n if (window.iFrameResize) {\n [].forEach.call(this.querySelectorAll('iframe.onionstudios-playlist'), (iframe) => {\n window.iFrameResize({ checkOrigin: false }, iframe);\n });\n }\n }\n\n attachedCallback () {\n this.addDingbat();\n this.resizeIframes();\n }\n}\n\nBulbsArticleBody.extends = 'div';\n\nregisterElement('bulbs-article-body', BulbsArticleBody);\n\n\n\n// WEBPACK FOOTER //\n// ./elements/bulbs-article-body/bulbs-article-body.js"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/bulbs-carousel.css b/dist/bulbs-carousel.css new file mode 100644 index 00000000..339c7b25 --- /dev/null +++ b/dist/bulbs-carousel.css @@ -0,0 +1,2 @@ +bulbs-carousel-next,bulbs-carousel-previous{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#000;color:#fff;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:1.5em;height:2em;-ms-flex-pack:distribute;justify-content:space-around;width:2em}bulbs-carousel-next:hover,bulbs-carousel-previous:hover{opacity:.8}bulbs-carousel-next[disabled],bulbs-carousel-previous[disabled]{opacity:.5;cursor:disabled}bulbs-carousel{display:block}bulbs-carousel-item{display:block;-webkit-transition:all .5s;transition:all .5s}bulbs-carousel-slider{display:block;overflow:hidden} +/*# sourceMappingURL=bulbs-carousel.css.map*/ \ No newline at end of file diff --git a/dist/bulbs-carousel.css.map b/dist/bulbs-carousel.css.map new file mode 100644 index 00000000..114cf6db --- /dev/null +++ b/dist/bulbs-carousel.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"bulbs-carousel.css","sourceRoot":""} \ No newline at end of file diff --git a/dist/bulbs-carousel.js b/dist/bulbs-carousel.js new file mode 100644 index 00000000..bdebd019 --- /dev/null +++ b/dist/bulbs-carousel.js @@ -0,0 +1,2 @@ +webpackJsonp([1],{0:function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function s(t,e){for(var r=Object.getOwnPropertyNames(e),n=0;n MUST contain a element."),this.handleClick=this.handleClick.bind(this),this.addEventListener("click",this.handleClick);var t=this.querySelector("bulbs-carousel-track");t?this.track=t:(this.track=document.createElement("bulbs-carousel-track"),(0,p.moveChildren)(this.slider,this.track),this.slider.appendChild(this.track)),this.previousButtons=this.getElementsByTagName("bulbs-carousel-previous"),this.nextButtons=this.getElementsByTagName("bulbs-carousel-next"),this.state=new f.default({carousel:this,carouselItems:this.track.children,currentIndex:0})},e.prototype.attachedCallback=function(){this.state.pageToCarouselItem(this.state.getActiveCarouselItem()),this.applyState()},e.prototype.stateChanged=function(t){var e={state:this.state,desc:t},r=new CustomEvent("bulbs-carousel:stateChange",{detail:e});this.dispatchEvent(r)},e.prototype.handleClick=function(t){t.target.closest("bulbs-carousel-previous")&&(this.state.slideToPrevious(),this.applyState(),this.stateChanged("previous")),t.target.closest("bulbs-carousel-next")&&(this.state.slideToNext(),this.applyState(),this.stateChanged("next"))},e.prototype.applyState=function(){function t(t,e,r){Array.prototype.forEach.call(t,function(t){r?t.setAttribute(e,""):t.removeAttribute(e)})}var e=this.state.getCurrentPage(),r=this.state.isOnfirstPage(),n=this.state.isOnLastPage(),s=-100*e,o=this.state.getItemMargin(),i=o*e;p.supportsCalcInTransform?this.track.style.transform="translateX(calc("+s+"% - "+i+"px))":this.track.style.transform="translateX("+s+"%) translateX(-"+i+"px)",t(this.previousButtons,"disabled",r),t(this.nextButtons,"disabled",n)},e}(l.BulbsHTMLElement);e.default=d,(0,l.registerElement)("bulbs-carousel",d),(0,l.registerElement)("bulbs-carousel-slider",function(t){function e(){return o(this,e),i(this,t.apply(this,arguments))}return a(e,t),e}(l.BulbsHTMLElement)),(0,l.registerElement)("bulbs-carousel-track",function(t){function e(){return o(this,e),i(this,t.apply(this,arguments))}return a(e,t),e}(l.BulbsHTMLElement))},207:function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r for width calculations"),this.props=e}return t.prototype.getActiveCarouselItem=function(){return Array.prototype.find.call(this.props.carouselItems,function(t){return t.getAttribute("href")===window.location.pathname})},t.prototype.getGridRatio=function(){return this.firstItem?this.getItemWidth()/this.props.carousel.offsetWidth||0:0},t.prototype.getItemMargin=function(){if(this.firstItem){var t=getComputedStyle(this.firstItem);return(parseInt(t.marginLeft,10)||0)+(parseInt(t.marginRight,10)||0)}return 0},t.prototype.getItemWidth=function(){return this.firstItem?this.getItemMargin()+this.firstItem.offsetWidth:0},t.prototype.getChildrenPerPage=function(){return this.firstItem?Math.round(1/this.getGridRatio()):0},t.prototype.getCurrentPage=function(){if(this.firstItem){var t=this.getChildrenPerPage(),e=Math.floor(this.props.currentIndex/t);return this.props.currentIndex===this.props.carouselItems.length&&this.props.currentIndex%t===0?e-1:e}return 0},t.prototype.updateCurrentIndex=function(t){var e=this.getChildrenPerPage(),r=Math.ceil(this.props.carouselItems.length/e)-1;this.props.currentIndex=Math.max(0,this.props.currentIndex+parseInt(t,10)),this.props.currentIndex>=this.props.carouselItems.length&&(this.props.currentIndex-=e),this.getCurrentPage()>r&&(this.props.currentIndex=r*e),this.props.currentIndex<0&&(this.props.currentIndex=0)},t.prototype.pageToCarouselItem=function(t){var e=Array.prototype.indexOf.call(this.props.carouselItems,t);e>-1&&(this.props.currentIndex=e)},t.prototype.slideToNext=function(){this.updateCurrentIndex(this.getChildrenPerPage())},t.prototype.slideToPrevious=function(){this.updateCurrentIndex(-this.getChildrenPerPage())},t.prototype.isOnfirstPage=function(){return 0===this.props.currentIndex},t.prototype.isOnLastPage=function(){return this.props.currentIndex+this.getChildrenPerPage()>=this.props.carouselItems.length},o(t,[{key:"firstItem",get:function(){return this.props.carouselItems[0]}}]),t}();e.default=c},208:function(t,e){},212:function(t,e,r){"use strict";function n(t,e){for(var r=Object.getOwnPropertyNames(e),n=0;n'},e}(a.BulbsHTMLElement),c=e.PreviousButton=function(t){function e(){return s(this,e),o(this,t.apply(this,arguments))}return i(e,t),e.prototype.createdCallback=function(){this.innerHTML=''},e}(a.BulbsHTMLElement);(0,a.registerElement)("bulbs-carousel-next",u),(0,a.registerElement)("bulbs-carousel-previous",c)}}); +//# sourceMappingURL=bulbs-carousel.js.map \ No newline at end of file diff --git a/dist/bulbs-carousel.js.map b/dist/bulbs-carousel.js.map new file mode 100644 index 00000000..28f126ee --- /dev/null +++ b/dist/bulbs-carousel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///bulbs-carousel.js","webpack:///./elements/bulbs-carousel/bulbs-carousel.js","webpack:///./elements/bulbs-carousel/bulbs-carousel-state.js","webpack:///./elements/bulbs-carousel/item.js","webpack:///./elements/bulbs-carousel/buttons.js"],"names":["webpackJsonp","0","module","exports","__webpack_require__","_interopRequireDefault","obj","__esModule","default","_defaults","defaults","keys","Object","getOwnPropertyNames","i","length","key","value","getOwnPropertyDescriptor","configurable","undefined","defineProperty","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","call","ReferenceError","_inherits","subClass","superClass","prototype","create","constructor","enumerable","writable","setPrototypeOf","_invariant","_invariant2","_register","_util","_bulbsCarouselState","_bulbsCarouselState2","BulbsCarousel","_BulbsHTMLElement","this","apply","arguments","createdCallback","slider","querySelector","handleClick","bind","addEventListener","track","document","createElement","moveChildren","appendChild","previousButtons","getElementsByTagName","nextButtons","state","carousel","carouselItems","children","currentIndex","attachedCallback","pageToCarouselItem","getActiveCarouselItem","applyState","stateChanged","desc","detail","event","CustomEvent","dispatchEvent","target","closest","slideToPrevious","slideToNext","toggleAttribute","collection","attribute","toggle","Array","forEach","item","setAttribute","removeAttribute","currentPage","getCurrentPage","onFirstPage","isOnfirstPage","onLastPage","isOnLastPage","translate","itemMargin","getItemMargin","marginCorrection","supportsCalcInTransform","style","transform","BulbsHTMLElement","registerElement","_BulbsHTMLElement2","BulbsCarouselSlider","_BulbsHTMLElement3","BulbsCarouselTrack","207","_createClass","defineProperties","props","descriptor","protoProps","staticProps","HTMLCollection","body","BulbsCarouselState","tagName","find","getAttribute","window","location","pathname","getGridRatio","firstItem","getItemWidth","offsetWidth","getComputedStyle","parseInt","marginLeft","marginRight","getChildrenPerPage","Math","round","perPage","page","floor","updateCurrentIndex","magnitude","maxPage","ceil","max","index","indexOf","get","208","212","CarouselItem","anchor","copyAttribute","213","PreviousButton","NextButton","innerHTML"],"mappings":"AAAAA,cAAc,IAERC,EACA,SAASC,EAAQC,EAASC,GAE/B,YAwBA,SAASC,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,QAASF,GAEvF,QAASG,GAAUH,EAAKI,GAA6D,IAAK,GAAlDC,GAAOC,OAAOC,oBAAoBH,GAAoBI,EAAI,EAAGA,EAAIH,EAAKI,OAAQD,IAAK,CAAE,GAAIE,GAAML,EAAKG,GAAQG,EAAQL,OAAOM,yBAAyBR,EAAUM,EAAUC,IAASA,EAAME,cAA6BC,SAAbd,EAAIU,IAAsBJ,OAAOS,eAAef,EAAKU,EAAKC,GAAY,MAAOX,GAE5T,QAASgB,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCAEhH,QAASC,GAA2BC,EAAMC,GAAQ,IAAKD,EAAQ,KAAM,IAAIE,gBAAe,4DAAgE,QAAOD,GAAyB,gBAATA,IAAqC,kBAATA,GAA8BD,EAAPC,EAElO,QAASE,GAAUC,EAAUC,GAAc,GAA0B,kBAAfA,IAA4C,OAAfA,EAAuB,KAAM,IAAIP,WAAU,iEAAoEO,GAAeD,GAASE,UAAYrB,OAAOsB,OAAOF,GAAcA,EAAWC,WAAaE,aAAelB,MAAOc,EAAUK,YAAY,EAAOC,UAAU,EAAMlB,cAAc,KAAea,IAAYpB,OAAO0B,eAAiB1B,OAAO0B,eAAeP,EAAUC,GAAcvB,EAAUsB,EAAUC,IA9BhepB,OAAOS,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D,EAAe1H,UI1YhBiB,gBJ0Y4C,WIzY1CH,KAAK8G,UAAY,oCJ6YXF,GACPlH,EAAUgE,mBI1Yb,EAAAhE,EAAAiE,iBAAgB,sBAAuBkD,IACvC,EAAAnH,EAAAiE,iBAAgB,0BAA2BiD","file":"bulbs-carousel.js","sourcesContent":["webpackJsonp([1],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _invariant = __webpack_require__(36);\n\t\n\tvar _invariant2 = _interopRequireDefault(_invariant);\n\t\n\tvar _register = __webpack_require__(1);\n\t\n\tvar _util = __webpack_require__(185);\n\t\n\tvar _bulbsCarouselState = __webpack_require__(207);\n\t\n\tvar _bulbsCarouselState2 = _interopRequireDefault(_bulbsCarouselState);\n\t\n\t__webpack_require__(208);\n\t\n\t__webpack_require__(212);\n\t\n\t__webpack_require__(213);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _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; }\n\t\n\tfunction _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) : _defaults(subClass, superClass); }\n\t\n\tvar BulbsCarousel = function (_BulbsHTMLElement) {\n\t _inherits(BulbsCarousel, _BulbsHTMLElement);\n\t\n\t function BulbsCarousel() {\n\t _classCallCheck(this, BulbsCarousel);\n\t\n\t return _possibleConstructorReturn(this, _BulbsHTMLElement.apply(this, arguments));\n\t }\n\t\n\t BulbsCarousel.prototype.createdCallback = function createdCallback() {\n\t (0, _invariant2.default)(this.slider = this.querySelector('bulbs-carousel-slider'), ' MUST contain a element.');\n\t\n\t this.handleClick = this.handleClick.bind(this);\n\t this.addEventListener('click', this.handleClick);\n\t\n\t // bugfix: if this element is recreated from markup, such as by resetting\n\t // its innerHTML, the track will already exist.\n\t var track = this.querySelector('bulbs-carousel-track');\n\t if (track) {\n\t this.track = track;\n\t } else {\n\t this.track = document.createElement('bulbs-carousel-track');\n\t (0, _util.moveChildren)(this.slider, this.track);\n\t this.slider.appendChild(this.track);\n\t }\n\t\n\t this.previousButtons = this.getElementsByTagName('bulbs-carousel-previous');\n\t this.nextButtons = this.getElementsByTagName('bulbs-carousel-next');\n\t\n\t this.state = new _bulbsCarouselState2.default({\n\t carousel: this,\n\t carouselItems: this.track.children,\n\t currentIndex: 0\n\t });\n\t };\n\t\n\t BulbsCarousel.prototype.attachedCallback = function attachedCallback() {\n\t this.state.pageToCarouselItem(this.state.getActiveCarouselItem());\n\t this.applyState();\n\t };\n\t\n\t BulbsCarousel.prototype.stateChanged = function stateChanged(desc) {\n\t var detail = {\n\t state: this.state,\n\t desc: desc\n\t };\n\t var event = new CustomEvent('bulbs-carousel:stateChange', { detail: detail });\n\t this.dispatchEvent(event);\n\t };\n\t\n\t BulbsCarousel.prototype.handleClick = function handleClick(event) {\n\t if (event.target.closest('bulbs-carousel-previous')) {\n\t this.state.slideToPrevious();\n\t this.applyState();\n\t this.stateChanged('previous');\n\t }\n\t\n\t if (event.target.closest('bulbs-carousel-next')) {\n\t this.state.slideToNext();\n\t this.applyState();\n\t this.stateChanged('next');\n\t }\n\t };\n\t\n\t BulbsCarousel.prototype.applyState = function applyState() {\n\t var currentPage = this.state.getCurrentPage();\n\t var onFirstPage = this.state.isOnfirstPage();\n\t var onLastPage = this.state.isOnLastPage();\n\t var translate = -100 * currentPage;\n\t var itemMargin = this.state.getItemMargin();\n\t var marginCorrection = itemMargin * currentPage;\n\t\n\t // some IE browsers do not support css calc() in the transform property.\n\t // For those browsers one uses multiple translateX() declarations.\n\t // Be sad.\n\t if (_util.supportsCalcInTransform) {\n\t this.track.style.transform = 'translateX(calc(' + translate + '% - ' + marginCorrection + 'px))';\n\t } else {\n\t this.track.style.transform = 'translateX(' + translate + '%) translateX(-' + marginCorrection + 'px)';\n\t }\n\t\n\t function toggleAttribute(collection, attribute, toggle) {\n\t Array.prototype.forEach.call(collection, function (item) {\n\t toggle ? item.setAttribute(attribute, '') : item.removeAttribute(attribute);\n\t });\n\t }\n\t\n\t toggleAttribute(this.previousButtons, 'disabled', onFirstPage);\n\t toggleAttribute(this.nextButtons, 'disabled', onLastPage);\n\t };\n\t\n\t return BulbsCarousel;\n\t}(_register.BulbsHTMLElement);\n\t\n\texports.default = BulbsCarousel;\n\t\n\t\n\t(0, _register.registerElement)('bulbs-carousel', BulbsCarousel);\n\t(0, _register.registerElement)('bulbs-carousel-slider', function (_BulbsHTMLElement2) {\n\t _inherits(BulbsCarouselSlider, _BulbsHTMLElement2);\n\t\n\t function BulbsCarouselSlider() {\n\t _classCallCheck(this, BulbsCarouselSlider);\n\t\n\t return _possibleConstructorReturn(this, _BulbsHTMLElement2.apply(this, arguments));\n\t }\n\t\n\t return BulbsCarouselSlider;\n\t}(_register.BulbsHTMLElement));\n\t(0, _register.registerElement)('bulbs-carousel-track', function (_BulbsHTMLElement3) {\n\t _inherits(BulbsCarouselTrack, _BulbsHTMLElement3);\n\t\n\t function BulbsCarouselTrack() {\n\t _classCallCheck(this, BulbsCarouselTrack);\n\t\n\t return _possibleConstructorReturn(this, _BulbsHTMLElement3.apply(this, arguments));\n\t }\n\t\n\t return BulbsCarouselTrack;\n\t}(_register.BulbsHTMLElement));\n\n/***/ },\n\n/***/ 207:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _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; }; }();\n\t\n\tvar _invariant = __webpack_require__(36);\n\t\n\tvar _invariant2 = _interopRequireDefault(_invariant);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar HTMLCollection = document.body.children.constructor;\n\t\n\tvar BulbsCarouselState = function () {\n\t function BulbsCarouselState(props) {\n\t _classCallCheck(this, BulbsCarouselState);\n\t\n\t (0, _invariant2.default)(typeof props.currentIndex !== 'undefined', 'BulbsCarouselState requires a currentIndex property');\n\t\n\t (0, _invariant2.default)(props.carouselItems && props.carouselItems.constructor === HTMLCollection, 'BulbsCarouselState requires a carouselItems property (must be a NodeList)');\n\t\n\t (0, _invariant2.default)(props.carousel && props.carousel.tagName === 'BULBS-CAROUSEL', 'BulbsCarouselState requires access to a for width calculations');\n\t\n\t this.props = props;\n\t }\n\t\n\t BulbsCarouselState.prototype.getActiveCarouselItem = function getActiveCarouselItem() {\n\t return Array.prototype.find.call(this.props.carouselItems, function (item) {\n\t return item.getAttribute('href') === window.location.pathname;\n\t });\n\t };\n\t\n\t BulbsCarouselState.prototype.getGridRatio = function getGridRatio() {\n\t if (this.firstItem) {\n\t return this.getItemWidth() / this.props.carousel.offsetWidth || 0;\n\t }\n\t return 0;\n\t };\n\t\n\t BulbsCarouselState.prototype.getItemMargin = function getItemMargin() {\n\t if (this.firstItem) {\n\t var style = getComputedStyle(this.firstItem);\n\t return (parseInt(style.marginLeft, 10) || 0) + (parseInt(style.marginRight, 10) || 0);\n\t }\n\t return 0;\n\t };\n\t\n\t BulbsCarouselState.prototype.getItemWidth = function getItemWidth() {\n\t if (this.firstItem) {\n\t return this.getItemMargin() + this.firstItem.offsetWidth;\n\t }\n\t return 0;\n\t };\n\t\n\t BulbsCarouselState.prototype.getChildrenPerPage = function getChildrenPerPage() {\n\t if (this.firstItem) {\n\t return Math.round(1 / this.getGridRatio());\n\t }\n\t return 0;\n\t };\n\t\n\t BulbsCarouselState.prototype.getCurrentPage = function getCurrentPage() {\n\t if (this.firstItem) {\n\t var perPage = this.getChildrenPerPage();\n\t var page = Math.floor(this.props.currentIndex / perPage);\n\t if (this.props.currentIndex === this.props.carouselItems.length && this.props.currentIndex % perPage === 0) {\n\t return page - 1;\n\t }\n\t return page;\n\t }\n\t return 0;\n\t };\n\t\n\t BulbsCarouselState.prototype.updateCurrentIndex = function updateCurrentIndex(magnitude) {\n\t var perPage = this.getChildrenPerPage();\n\t var maxPage = Math.ceil(this.props.carouselItems.length / perPage) - 1;\n\t\n\t this.props.currentIndex = Math.max(0, this.props.currentIndex + parseInt(magnitude, 10));\n\t if (this.props.currentIndex >= this.props.carouselItems.length) {\n\t this.props.currentIndex -= perPage;\n\t }\n\t if (this.getCurrentPage() > maxPage) {\n\t this.props.currentIndex = maxPage * perPage;\n\t }\n\t if (this.props.currentIndex < 0) {\n\t this.props.currentIndex = 0;\n\t }\n\t };\n\t\n\t BulbsCarouselState.prototype.pageToCarouselItem = function pageToCarouselItem(item) {\n\t var index = Array.prototype.indexOf.call(this.props.carouselItems, item);\n\t\n\t if (index > -1) {\n\t this.props.currentIndex = index;\n\t }\n\t };\n\t\n\t BulbsCarouselState.prototype.slideToNext = function slideToNext() {\n\t this.updateCurrentIndex(this.getChildrenPerPage());\n\t };\n\t\n\t BulbsCarouselState.prototype.slideToPrevious = function slideToPrevious() {\n\t this.updateCurrentIndex(-this.getChildrenPerPage());\n\t };\n\t\n\t BulbsCarouselState.prototype.isOnfirstPage = function isOnfirstPage() {\n\t return this.props.currentIndex === 0;\n\t };\n\t\n\t BulbsCarouselState.prototype.isOnLastPage = function isOnLastPage() {\n\t return this.props.currentIndex + this.getChildrenPerPage() >= this.props.carouselItems.length;\n\t };\n\t\n\t _createClass(BulbsCarouselState, [{\n\t key: 'firstItem',\n\t get: function get() {\n\t return this.props.carouselItems[0];\n\t }\n\t }]);\n\t\n\t return BulbsCarouselState;\n\t}();\n\t\n\texports.default = BulbsCarouselState;\n\n/***/ },\n\n/***/ 208:\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ },\n\n/***/ 212:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _register = __webpack_require__(1);\n\t\n\tvar _util = __webpack_require__(185);\n\t\n\tfunction _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _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; }\n\t\n\tfunction _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) : _defaults(subClass, superClass); }\n\t\n\tvar CarouselItem = function (_BulbsHTMLElement) {\n\t _inherits(CarouselItem, _BulbsHTMLElement);\n\t\n\t function CarouselItem() {\n\t _classCallCheck(this, CarouselItem);\n\t\n\t return _possibleConstructorReturn(this, _BulbsHTMLElement.apply(this, arguments));\n\t }\n\t\n\t CarouselItem.prototype.createdCallback = function createdCallback() {\n\t if (this.getAttribute('href')) {\n\t var anchor = document.createElement('a');\n\t\n\t (0, _util.copyAttribute)('data-track-action', this, anchor);\n\t (0, _util.copyAttribute)('data-track-category', this, anchor);\n\t (0, _util.copyAttribute)('href', this, anchor);\n\t\n\t (0, _util.moveChildren)(this, anchor);\n\t\n\t this.appendChild(anchor);\n\t }\n\t };\n\t\n\t return CarouselItem;\n\t}(_register.BulbsHTMLElement);\n\t\n\texports.default = CarouselItem;\n\t\n\t\n\t(0, _register.registerElement)('bulbs-carousel-item', CarouselItem);\n\n/***/ },\n\n/***/ 213:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.PreviousButton = exports.NextButton = undefined;\n\t\n\tvar _register = __webpack_require__(1);\n\t\n\tfunction _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _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; }\n\t\n\tfunction _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) : _defaults(subClass, superClass); }\n\t\n\tvar NextButton = exports.NextButton = function (_BulbsHTMLElement) {\n\t _inherits(NextButton, _BulbsHTMLElement);\n\t\n\t function NextButton() {\n\t _classCallCheck(this, NextButton);\n\t\n\t return _possibleConstructorReturn(this, _BulbsHTMLElement.apply(this, arguments));\n\t }\n\t\n\t NextButton.prototype.createdCallback = function createdCallback() {\n\t this.innerHTML = '';\n\t };\n\t\n\t return NextButton;\n\t}(_register.BulbsHTMLElement);\n\t\n\tvar PreviousButton = exports.PreviousButton = function (_BulbsHTMLElement2) {\n\t _inherits(PreviousButton, _BulbsHTMLElement2);\n\t\n\t function PreviousButton() {\n\t _classCallCheck(this, PreviousButton);\n\t\n\t return _possibleConstructorReturn(this, _BulbsHTMLElement2.apply(this, arguments));\n\t }\n\t\n\t PreviousButton.prototype.createdCallback = function createdCallback() {\n\t this.innerHTML = '';\n\t };\n\t\n\t return PreviousButton;\n\t}(_register.BulbsHTMLElement);\n\t\n\t(0, _register.registerElement)('bulbs-carousel-next', NextButton);\n\t(0, _register.registerElement)('bulbs-carousel-previous', PreviousButton);\n\n/***/ }\n\n});\n\n\n// WEBPACK FOOTER //\n// bulbs-carousel.js","import invariant from 'invariant';\nimport { BulbsHTMLElement, registerElement } from 'bulbs-elements/register';\nimport { moveChildren, supportsCalcInTransform } from 'bulbs-elements/util';\nimport BulbsCarouselState from './bulbs-carousel-state';\n\nimport './bulbs-carousel.scss';\n\nexport default class BulbsCarousel extends BulbsHTMLElement {\n createdCallback () {\n invariant(\n this.slider = this.querySelector('bulbs-carousel-slider'),\n ' MUST contain a element.'\n );\n\n this.handleClick = this.handleClick.bind(this);\n this.addEventListener('click', this.handleClick);\n\n // bugfix: if this element is recreated from markup, such as by resetting\n // its innerHTML, the track will already exist.\n let track = this.querySelector('bulbs-carousel-track');\n if (track) {\n this.track = track;\n }\n else {\n this.track = document.createElement('bulbs-carousel-track');\n moveChildren(this.slider, this.track);\n this.slider.appendChild(this.track);\n }\n\n this.previousButtons = this.getElementsByTagName('bulbs-carousel-previous');\n this.nextButtons = this.getElementsByTagName('bulbs-carousel-next');\n\n this.state = new BulbsCarouselState({\n carousel: this,\n carouselItems: this.track.children,\n currentIndex: 0,\n });\n }\n\n attachedCallback () {\n this.state.pageToCarouselItem(this.state.getActiveCarouselItem());\n this.applyState();\n }\n\n stateChanged (desc) {\n let detail = {\n state: this.state,\n desc,\n };\n let event = new CustomEvent('bulbs-carousel:stateChange', { detail });\n this.dispatchEvent(event);\n }\n\n handleClick (event) {\n if (event.target.closest('bulbs-carousel-previous')) {\n this.state.slideToPrevious();\n this.applyState();\n this.stateChanged('previous');\n }\n\n if (event.target.closest('bulbs-carousel-next')) {\n this.state.slideToNext();\n this.applyState();\n this.stateChanged('next');\n }\n }\n\n applyState () {\n let currentPage = this.state.getCurrentPage();\n let onFirstPage = this.state.isOnfirstPage();\n let onLastPage = this.state.isOnLastPage();\n let translate = -100 * currentPage;\n let itemMargin = this.state.getItemMargin();\n let marginCorrection = itemMargin * currentPage;\n\n // some IE browsers do not support css calc() in the transform property.\n // For those browsers one uses multiple translateX() declarations.\n // Be sad.\n if (supportsCalcInTransform) {\n this.track.style.transform = `translateX(calc(${translate}% - ${marginCorrection}px))`;\n }\n else {\n this.track.style.transform = `translateX(${translate}%) translateX(-${marginCorrection}px)`;\n }\n\n function toggleAttribute (collection, attribute, toggle) {\n Array.prototype.forEach.call(collection, (item) => {\n toggle ? item.setAttribute(attribute, '') : item.removeAttribute(attribute);\n });\n }\n\n toggleAttribute(this.previousButtons, 'disabled', onFirstPage);\n toggleAttribute(this.nextButtons, 'disabled', onLastPage);\n }\n}\n\nimport './item';\nimport './buttons';\n\nregisterElement('bulbs-carousel', BulbsCarousel);\nregisterElement('bulbs-carousel-slider', class BulbsCarouselSlider extends BulbsHTMLElement {});\nregisterElement('bulbs-carousel-track', class BulbsCarouselTrack extends BulbsHTMLElement {});\n\n\n\n// WEBPACK FOOTER //\n// ./elements/bulbs-carousel/bulbs-carousel.js","import invariant from 'invariant';\n\nconst HTMLCollection = document.body.children.constructor;\n\nexport default class BulbsCarouselState {\n constructor (props) {\n invariant(\n typeof props.currentIndex !== 'undefined',\n 'BulbsCarouselState requires a currentIndex property'\n );\n\n invariant(\n props.carouselItems && props.carouselItems.constructor === HTMLCollection,\n 'BulbsCarouselState requires a carouselItems property (must be a NodeList)'\n );\n\n invariant(\n props.carousel && props.carousel.tagName === 'BULBS-CAROUSEL',\n 'BulbsCarouselState requires access to a for width calculations'\n );\n\n this.props = props;\n }\n\n get firstItem () {\n return this.props.carouselItems[0];\n }\n\n getActiveCarouselItem () {\n return Array.prototype.find.call(this.props.carouselItems, (item) => {\n return item.getAttribute('href') === window.location.pathname;\n });\n }\n\n getGridRatio () {\n if (this.firstItem) {\n return (this.getItemWidth() / this.props.carousel.offsetWidth) || 0;\n }\n return 0;\n }\n\n getItemMargin () {\n if (this.firstItem) {\n let style = getComputedStyle(this.firstItem);\n return (parseInt(style.marginLeft, 10) || 0) + (parseInt(style.marginRight, 10) || 0);\n }\n return 0;\n }\n\n getItemWidth () {\n if (this.firstItem) {\n return this.getItemMargin() + this.firstItem.offsetWidth;\n }\n return 0;\n }\n\n getChildrenPerPage () {\n if (this.firstItem) {\n return Math.round(1 / this.getGridRatio());\n }\n return 0;\n }\n\n getCurrentPage () {\n if (this.firstItem) {\n let perPage = this.getChildrenPerPage();\n let page = Math.floor(this.props.currentIndex / perPage);\n if (this.props.currentIndex === this.props.carouselItems.length && this.props.currentIndex % perPage === 0) {\n return page - 1;\n }\n return page;\n }\n return 0;\n }\n\n updateCurrentIndex (magnitude) {\n let perPage = this.getChildrenPerPage();\n let maxPage = Math.ceil(this.props.carouselItems.length / perPage) - 1;\n\n this.props.currentIndex = Math.max(0, this.props.currentIndex + parseInt(magnitude, 10));\n if (this.props.currentIndex >= this.props.carouselItems.length) {\n this.props.currentIndex -= perPage;\n }\n if(this.getCurrentPage() > maxPage) {\n this.props.currentIndex = maxPage * perPage;\n }\n if (this.props.currentIndex < 0) {\n this.props.currentIndex = 0;\n }\n }\n\n pageToCarouselItem (item) {\n let index = Array.prototype.indexOf.call(this.props.carouselItems, item);\n\n if (index > -1) {\n this.props.currentIndex = index;\n }\n }\n\n slideToNext () {\n this.updateCurrentIndex(this.getChildrenPerPage());\n }\n\n slideToPrevious () {\n this.updateCurrentIndex(-this.getChildrenPerPage());\n }\n\n isOnfirstPage () {\n return this.props.currentIndex === 0;\n }\n\n isOnLastPage () {\n return this.props.currentIndex + this.getChildrenPerPage() >= this.props.carouselItems.length;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./elements/bulbs-carousel/bulbs-carousel-state.js","import { BulbsHTMLElement, registerElement } from 'bulbs-elements/register';\nimport { moveChildren, copyAttribute } from 'bulbs-elements/util';\n\nexport default class CarouselItem extends BulbsHTMLElement {\n createdCallback () {\n if (this.getAttribute('href')) {\n let anchor = document.createElement('a');\n\n copyAttribute('data-track-action', this, anchor);\n copyAttribute('data-track-category', this, anchor);\n copyAttribute('href', this, anchor);\n\n moveChildren(this, anchor);\n\n this.appendChild(anchor);\n }\n }\n}\n\nregisterElement('bulbs-carousel-item', CarouselItem);\n\n\n\n// WEBPACK FOOTER //\n// ./elements/bulbs-carousel/item.js","import { BulbsHTMLElement, registerElement } from 'bulbs-elements/register';\n\nexport class NextButton extends BulbsHTMLElement {\n createdCallback () {\n this.innerHTML = '';\n }\n}\n\nexport class PreviousButton extends BulbsHTMLElement {\n createdCallback () {\n this.innerHTML = '';\n }\n}\n\nregisterElement('bulbs-carousel-next', NextButton);\nregisterElement('bulbs-carousel-previous', PreviousButton);\n\n\n\n// WEBPACK FOOTER //\n// ./elements/bulbs-carousel/buttons.js"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/bulbs-cinemagraph.css b/dist/bulbs-cinemagraph.css new file mode 100644 index 00000000..ce85ec3b --- /dev/null +++ b/dist/bulbs-cinemagraph.css @@ -0,0 +1,2 @@ +video[is=bulbs-cinemagraph]::-webkit-media-controls-play-button,video[is=bulbs-cinemagraph]::-webkit-media-controls-start-playback-button{opacity:0;pointer-events:none;width:5px} +/*# sourceMappingURL=bulbs-cinemagraph.css.map*/ \ No newline at end of file diff --git a/dist/bulbs-cinemagraph.css.map b/dist/bulbs-cinemagraph.css.map new file mode 100644 index 00000000..a2754683 --- /dev/null +++ b/dist/bulbs-cinemagraph.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"bulbs-cinemagraph.css","sourceRoot":""} \ No newline at end of file diff --git a/dist/bulbs-cinemagraph.js b/dist/bulbs-cinemagraph.js new file mode 100644 index 00000000..7d6fae2a --- /dev/null +++ b/dist/bulbs-cinemagraph.js @@ -0,0 +1,4 @@ +webpackJsonp([2],{0:function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n=e.video.duration}function p(e){var t=this;t.video.readyState>=t.video.HAVE_FUTURE_DATA?(t.hasAudio||(t.driver.currentTime=t.video.currentTime+e*t.video.playbackRate/1e3,t.video.loop&&s(t)&&(t.driver.currentTime=0)),c(t.video,t.driver.currentTime)):t.video.networkState!==t.video.NETWORK_IDLE||t.video.buffered.length||t.video.load(),t.video.ended&&(delete t.video[O],t.video.pause(!0))}function l(){var e=this,t=e[E];return e.webkitDisplayingFullscreen?void e[T]():("data:"!==t.driver.src&&t.driver.src!==e.src&&(c(e,0,!0),t.driver.src=e.src),void(e.paused&&(t.paused=!1,e.buffered.length||e.load(),t.driver.play(),t.updater.start(),t.hasAudio||(u(e,"play"),t.video.readyState>=t.video.HAVE_ENOUGH_DATA&&u(e,"playing")))))}function v(e){var t=this,r=t[E];r.driver.pause(),r.updater.stop(),t.webkitDisplayingFullscreen&&t[A](),r.paused&&!e||(r.paused=!0,r.hasAudio||u(t,"pause"),t.ended&&(t[O]=!0,u(t,"ended")))}function f(e,t){var r=e[E]={};r.paused=!0,r.hasAudio=t,r.video=e,r.updater=g.frameIntervalometer(p.bind(r)),t?r.driver=d(e):(e.addEventListener("canplay",function(){e.paused||u(e,"playing")}),r.driver={src:e.src||e.currentSrc||"data:",muted:!0,paused:!0,pause:function(){r.driver.paused=!0},play:function(){r.driver.paused=!1,s(r)&&c(e,0)},get ended(){return s(r)}}),e.addEventListener("emptied",function(){var t=!r.driver.src||"data:"===r.driver.src;r.driver.src&&r.driver.src!==e.src&&(c(e,0,!0),r.driver.src=e.src,t?r.driver.play():r.updater.stop())},!1),e.addEventListener("webkitbeginfullscreen",function(){e.paused?t&&!r.driver.buffered.length&&r.driver.load():(e.pause(),e[T]())}),t&&(e.addEventListener("webkitendfullscreen",function(){r.driver.currentTime=e.currentTime}),e.addEventListener("seeking",function(){k.indexOf(100*e.currentTime|0)<0&&(r.driver.currentTime=e.currentTime)}))}function h(e){var t=e[E];e[T]=e.play,e[A]=e.pause,e.play=l,e.pause=v,o(e,"paused",t.driver),o(e,"muted",t.driver,!0),o(e,"playbackRate",t.driver,!0),o(e,"ended",t.driver),o(e,"loop",t.driver,!0),i(e,"seeking"),i(e,"seeked"),i(e,"timeupdate",O,!1),i(e,"ended",O,!1)}function m(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=!0),r&&!w||e[E]||(f(e,t),h(e),e.classList.add("IIV"),!t&&e.autoplay&&e.play(),/iPhone|iPod|iPad/.test(navigator.platform)||console.warn("iphone-inline-video is not guaranteed to work in emulated environments"))}var y,b=n(r(215)),g=r(216),w="object-fit"in document.head.style&&/iPhone|iPod/i.test(navigator.userAgent)&&!matchMedia("(-webkit-video-playable-inline)").matches,E=b(),O=b(),T=b("nativeplay"),A=b("nativepause"),k=[],P=0;m.isWhitelisted=w,e.exports=m},215:function(e,t){"use strict";var r="undefined"==typeof Symbol?function(e){return"@"+(e||"@")+Math.random()}:Symbol;e.exports=r},216:function(e,t){/*! npm.im/intervalometer */ +"use strict";function r(e,t,r,n){function i(r){o=t(i,n),e(r-(a||r)),a=r}var o,a;return{start:function(){o||i(0)},stop:function(){r(o),o=null,a=0}}}function n(e){return r(e,requestAnimationFrame,cancelAnimationFrame)}function i(e,t){return r(e,setTimeout,clearTimeout,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.intervalometer=r,t.frameIntervalometer=n,t.timerIntervalometer=i},217:function(e,t){}}); +//# sourceMappingURL=bulbs-cinemagraph.js.map \ No newline at end of file diff --git a/dist/bulbs-cinemagraph.js.map b/dist/bulbs-cinemagraph.js.map new file mode 100644 index 00000000..0bc3f599 --- /dev/null +++ b/dist/bulbs-cinemagraph.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///bulbs-cinemagraph.js","webpack:///./elements/bulbs-cinemagraph/bulbs-cinemagraph.js","webpack:///./~/iphone-inline-video/dist/iphone-inline-video.common-js.js","webpack:///./~/poor-mans-symbol/dist/poor-mans-symbol.common-js.js","webpack:///./~/intervalometer/dist/intervalometer.common-js.js"],"names":["webpackJsonp","0","module","exports","__webpack_require__","_interopRequireWildcard","obj","__esModule","newObj","key","Object","prototype","hasOwnProperty","call","default","_defaults","defaults","keys","getOwnPropertyNames","i","length","value","getOwnPropertyDescriptor","configurable","undefined","defineProperty","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","enumerable","writable","setPrototypeOf","BulbsHTMLVideoElement","_register","_util","_iphoneInlineVideo","iphoneInlineVideo","HTMLVideoElement","BulbsCinemagraph","_BulbsHTMLVideoElemen","this","apply","arguments","createdCallback","get","parseFloat","getAttribute","attachedCallback","_this2","hasAttribute","console","warn","setAttribute","addEventListener","play","pause","InViewMonitor","add","detachedCallback","remove","extends","registerElement","214","_interopDefault","ex","preventEvent","element","eventName","toggleProperty","preventWithProperty","handler","e","Boolean","stopImmediatePropagation","proxyProperty","object","propertyName","sourceObject","copyFirst","set","proxyEvent","dispatchEvent","Event","dispatchEventAsync","type","Promise","resolve","then","getAudioFromVideo","video","audio","Audio","crossOrigin","src","currentSrc","setTime","time","rememberOnly","lastTimeupdateEvent","Date","now","ಠevent","currentTime","lastRequests","requestIndex","isPlayerEnded","player","driver","duration","update","timeDiff","readyState","HAVE_FUTURE_DATA","hasAudio","playbackRate","loop","networkState","NETWORK_IDLE","buffered","load","ended","ಠ","webkitDisplayingFullscreen","ಠplay","paused","updater","start","HAVE_ENOUGH_DATA","forceEvents","stop","ಠpause","addPlayer","intervalometer","frameIntervalometer","bind","muted","wasEmpty","indexOf","overloadAPI","enableInlineVideo","onlyWhitelisted","isWhitelisted","classList","autoplay","test","navigator","platform","Symbol","document","head","style","userAgent","matchMedia","matches","215","index","description","Math","random","216","cb","request","cancel","requestParameter","requestId","previousLoopTime","requestAnimationFrame","cancelAnimationFrame","timerIntervalometer","delay","setTimeout","clearTimeout","217"],"mappings":"AAAAA,cAAc,IAERC,EACA,SAASC,EAAQC,EAASC,GAE/B,YAYA,SAASC,GAAwBC,GAAO,GAAIA,GAAOA,EAAIC,WAAc,MAAOD,EAAc,IAAIE,KAAa,IAAW,MAAPF,EAAe,IAAK,GAAIG,KAAOH,GAAWI,OAAOC,UAAUC,eAAeC,KAAKP,EAAKG,KAAMD,EAAOC,GAAOH,EAAIG,GAAgC,OAAtBD,GAAOM,QAAUR,EAAYE,EAElQ,QAASO,GAAUT,EAAKU,GAA6D,IAAK,GAAlDC,GAAOP,OAAOQ,oBAAoBF,GAAoBG,EAAI,EAAGA,EAAIF,EAAKG,OAAQD,IAAK,CAAE,GAAIV,GAAMQ,EAAKE,GAAQE,EAAQX,OAAOY,yBAAyBN,EAAUP,EAAUY,IAASA,EAAME,cAA6BC,SAAblB,EAAIG,IAAsBC,OAAOe,eAAenB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AAAf,GAEAgE,EAAAH,EAAA9C,EAAAgD,GAGAH,EAAA5D,GAAAiE,GAAAjE,IAEAiE,EAAAjE,EATA,GAAAgE,GACAC,CAUA,QACAvC,MAAA,WACAsC,GACAjD,EAAA,IAGAc,KAAA,WACAiC,EAAAE,GACAA,EAAA,KACAC,EAAA,IAKA,QAAAhC,GAAA2B,GACA,MAAA5B,GAAA4B,EAAAM,sBAAAC,sBAGA,QAAAC,GAAAR,EAAAS,GACA,MAAArC,GAAA4B,EAAAU,WAAAC,aAAAF,GAjCAxK,OAAAe,eAAAtB,EAAA,cAA8CkB,OAAA,IAoC9ClB,EAAA0I,iBACA1I,EAAA2I,sBACA3I,EAAA8K,uBJwbMI,IACA,SAASnL,EAAQC","file":"bulbs-cinemagraph.js","sourcesContent":["webpackJsonp([2],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _register = __webpack_require__(1);\n\t\n\tvar _util = __webpack_require__(185);\n\t\n\tvar _iphoneInlineVideo = __webpack_require__(214);\n\t\n\tvar iphoneInlineVideo = _interopRequireWildcard(_iphoneInlineVideo);\n\t\n\t__webpack_require__(217);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _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; }\n\t\n\tfunction _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) : _defaults(subClass, superClass); }\n\t\n\t// We have to do this little dance to properly subclass elements in Safari\n\tfunction BulbsHTMLVideoElement() {}\n\tBulbsHTMLVideoElement.prototype = HTMLVideoElement.prototype;\n\t\n\tvar BulbsCinemagraph = function (_BulbsHTMLVideoElemen) {\n\t _inherits(BulbsCinemagraph, _BulbsHTMLVideoElemen);\n\t\n\t function BulbsCinemagraph() {\n\t _classCallCheck(this, BulbsCinemagraph);\n\t\n\t return _possibleConstructorReturn(this, _BulbsHTMLVideoElemen.apply(this, arguments));\n\t }\n\t\n\t BulbsCinemagraph.prototype.createdCallback = function createdCallback() {\n\t\n\t // makeVideoPlayableInline is dumb and goes just a little bit too far in the\n\t // video, this results in a quick flash of a black frame in the loop. If we\n\t // override the duration we can get the loop to loop properly.\n\t // For now, this must be determined by hand.\n\t Object.defineProperty(this, 'duration', {\n\t get: function get() {\n\t return parseFloat(this.getAttribute('cinemagraph-duration')) || 0;\n\t }\n\t });\n\t };\n\t\n\t BulbsCinemagraph.prototype.attachedCallback = function attachedCallback() {\n\t var _this2 = this;\n\t\n\t if (!this.hasAttribute('cinemagraph-duration')) {\n\t console.warn('is=\"bulbs-cinemagraph\" elements should have a [cinemagraph-duration] attribute set');\n\t }\n\t\n\t this.setAttribute('loop', true);\n\t this.setAttribute('webkit-playsinline', true);\n\t\n\t this.addEventListener('enterviewport', function () {\n\t return _this2.play();\n\t });\n\t this.addEventListener('exitviewport', function () {\n\t return _this2.pause();\n\t });\n\t iphoneInlineVideo.default(this, /* hasAudio */false);\n\t _util.InViewMonitor.add(this);\n\t };\n\t\n\t BulbsCinemagraph.prototype.detachedCallback = function detachedCallback() {\n\t _util.InViewMonitor.remove(this);\n\t };\n\t\n\t return BulbsCinemagraph;\n\t}(BulbsHTMLVideoElement);\n\t\n\tBulbsCinemagraph.extends = 'video';\n\t\n\t(0, _register.registerElement)('bulbs-cinemagraph', BulbsCinemagraph);\n\n/***/ },\n\n/***/ 214:\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*! npm.im/iphone-inline-video */\n\t'use strict';\n\t\n\tfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\t\n\tvar Symbol = _interopDefault(__webpack_require__(215));\n\tvar intervalometer = __webpack_require__(216);\n\t\n\tfunction preventEvent(element, eventName, toggleProperty, preventWithProperty) {\n\t\tfunction handler(e) {\n\t\t\tif (Boolean(element[toggleProperty]) === Boolean(preventWithProperty)) {\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t// console.log(eventName, 'prevented on', element);\n\t\t\t}\n\t\t\tdelete element[toggleProperty];\n\t\t}\n\t\telement.addEventListener(eventName, handler, false);\n\t\n\t\t// Return handler to allow to disable the prevention. Usage:\n\t\t// const preventionHandler = preventEvent(el, 'click');\n\t\t// el.removeEventHandler('click', preventionHandler);\n\t\treturn handler;\n\t}\n\t\n\tfunction proxyProperty(object, propertyName, sourceObject, copyFirst) {\n\t\tfunction get() {\n\t\t\treturn sourceObject[propertyName];\n\t\t}\n\t\tfunction set(value) {\n\t\t\tsourceObject[propertyName] = value;\n\t\t}\n\t\n\t\tif (copyFirst) {\n\t\t\tset(object[propertyName]);\n\t\t}\n\t\n\t\tObject.defineProperty(object, propertyName, {get: get, set: set});\n\t}\n\t\n\tfunction proxyEvent(object, eventName, sourceObject) {\n\t\tsourceObject.addEventListener(eventName, function () { return object.dispatchEvent(new Event(eventName)); });\n\t}\n\t\n\tfunction dispatchEventAsync(element, type) {\n\t\tPromise.resolve().then(function () {\n\t\t\telement.dispatchEvent(new Event(type));\n\t\t});\n\t}\n\t\n\t// iOS 10 adds support for native inline playback + silent autoplay\n\tvar isWhitelisted = 'object-fit' in document.head.style && /iPhone|iPod/i.test(navigator.userAgent) && !matchMedia('(-webkit-video-playable-inline)').matches;\n\t\n\tvar ಠ = Symbol();\n\tvar ಠevent = Symbol();\n\tvar ಠplay = Symbol('nativeplay');\n\tvar ಠpause = Symbol('nativepause');\n\t\n\t/**\n\t * UTILS\n\t */\n\t\n\tfunction getAudioFromVideo(video) {\n\t\tvar audio = new Audio();\n\t\tproxyEvent(video, 'play', audio);\n\t\tproxyEvent(video, 'playing', audio);\n\t\tproxyEvent(video, 'pause', audio);\n\t\taudio.crossOrigin = video.crossOrigin;\n\t\n\t\t// 'data:' causes audio.networkState > 0\n\t\t// which then allows to keep