PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.34
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.34
3.37 3.36 3.35 3.34 3.33 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.40 2.41 2.42 2.43 All 142 releases
photonic / include / js / front-end / out / photonic-lightgallery.js

photonic-lightgallery.js in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 3.34, at include/js/front-end/out/photonic-lightgallery.js

3,788 lines 126.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ "use strict";
3 /******/ var __webpack_modules__ = ({
4
5 /***/ "../../../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
6 /*!******************************************************************************!*\
7 !*** ../../../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
8 \******************************************************************************/
9 /*! unknown exports (runtime-defined) */
10 /*! runtime requirements: module */
11 /*! CommonJS bailout: module.exports is used directly at 39:0-14 */
12 /***/ ((module) => {
13
14
15
16 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
17 try {
18 var info = gen[key](arg);
19 var value = info.value;
20 } catch (error) {
21 reject(error);
22 return;
23 }
24
25 if (info.done) {
26 resolve(value);
27 } else {
28 Promise.resolve(value).then(_next, _throw);
29 }
30 }
31
32 function _asyncToGenerator(fn) {
33 return function () {
34 var self = this,
35 args = arguments;
36 return new Promise(function (resolve, reject) {
37 var gen = fn.apply(self, args);
38
39 function _next(value) {
40 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
41 }
42
43 function _throw(err) {
44 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
45 }
46
47 _next(undefined);
48 });
49 };
50 }
51
52 module.exports = _asyncToGenerator;
53
54 /***/ }),
55
56 /***/ "../../../../../node_modules/@babel/runtime/helpers/defineProperty.js":
57 /*!****************************************************************************!*\
58 !*** ../../../../../node_modules/@babel/runtime/helpers/defineProperty.js ***!
59 \****************************************************************************/
60 /*! unknown exports (runtime-defined) */
61 /*! runtime requirements: module */
62 /*! CommonJS bailout: module.exports is used directly at 18:0-14 */
63 /***/ ((module) => {
64
65
66
67 function _defineProperty(obj, key, value) {
68 if (key in obj) {
69 Object.defineProperty(obj, key, {
70 value: value,
71 enumerable: true,
72 configurable: true,
73 writable: true
74 });
75 } else {
76 obj[key] = value;
77 }
78
79 return obj;
80 }
81
82 module.exports = _defineProperty;
83
84 /***/ }),
85
86 /***/ "../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
87 /*!***********************************************************************************!*\
88 !*** ../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
89 \***********************************************************************************/
90 /*! unknown exports (runtime-defined) */
91 /*! runtime requirements: module */
92 /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
93 /***/ ((module) => {
94
95
96
97 function _interopRequireDefault(obj) {
98 return obj && obj.__esModule ? obj : {
99 "default": obj
100 };
101 }
102
103 module.exports = _interopRequireDefault;
104
105 /***/ }),
106
107 /***/ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js":
108 /*!************************************************************************************!*\
109 !*** ../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js ***!
110 \************************************************************************************/
111 /*! unknown exports (runtime-defined) */
112 /*! runtime requirements: module, __webpack_require__ */
113 /*! CommonJS bailout: module.exports is used directly at 57:0-14 */
114 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
115
116
117
118 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../../../../../node_modules/@babel/runtime/helpers/typeof.js");
119
120 function _getRequireWildcardCache() {
121 if (typeof WeakMap !== "function") return null;
122 var cache = new WeakMap();
123
124 _getRequireWildcardCache = function _getRequireWildcardCache() {
125 return cache;
126 };
127
128 return cache;
129 }
130
131 function _interopRequireWildcard(obj) {
132 if (obj && obj.__esModule) {
133 return obj;
134 }
135
136 if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
137 return {
138 "default": obj
139 };
140 }
141
142 var cache = _getRequireWildcardCache();
143
144 if (cache && cache.has(obj)) {
145 return cache.get(obj);
146 }
147
148 var newObj = {};
149 var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
150
151 for (var key in obj) {
152 if (Object.prototype.hasOwnProperty.call(obj, key)) {
153 var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
154
155 if (desc && (desc.get || desc.set)) {
156 Object.defineProperty(newObj, key, desc);
157 } else {
158 newObj[key] = obj[key];
159 }
160 }
161 }
162
163 newObj["default"] = obj;
164
165 if (cache) {
166 cache.set(obj, newObj);
167 }
168
169 return newObj;
170 }
171
172 module.exports = _interopRequireWildcard;
173
174 /***/ }),
175
176 /***/ "../../../../../node_modules/@babel/runtime/helpers/typeof.js":
177 /*!********************************************************************!*\
178 !*** ../../../../../node_modules/@babel/runtime/helpers/typeof.js ***!
179 \********************************************************************/
180 /*! unknown exports (runtime-defined) */
181 /*! runtime requirements: module */
182 /*! CommonJS bailout: module.exports is used directly at 7:4-18 */
183 /*! CommonJS bailout: module.exports is used directly at 11:4-18 */
184 /*! CommonJS bailout: module.exports is used directly at 19:0-14 */
185 /***/ ((module) => {
186
187
188
189 function _typeof(obj) {
190 "@babel/helpers - typeof";
191
192 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
193 module.exports = _typeof = function _typeof(obj) {
194 return typeof obj;
195 };
196 } else {
197 module.exports = _typeof = function _typeof(obj) {
198 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
199 };
200 }
201
202 return _typeof(obj);
203 }
204
205 module.exports = _typeof;
206
207 /***/ }),
208
209 /***/ "../include/js/front-end/src/Components/Modal.js":
210 /*!*******************************************************!*\
211 !*** ../include/js/front-end/src/Components/Modal.js ***!
212 \*******************************************************/
213 /*! flagged exports */
214 /*! export Modal [provided] [no usage info] [missing usage info prevents renaming] */
215 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
216 /*! other exports [not provided] [no usage info] */
217 /*! runtime requirements: __webpack_exports__ */
218 /***/ ((__unused_webpack_module, exports) => {
219
220
221
222 Object.defineProperty(exports, "__esModule", ({
223 value: true
224 }));
225 exports.Modal = void 0;
226
227 /*
228 * Photonic Modal
229 * Used as the overlay panel
230 * License: MIT
231 */
232 var Modal = function Modal(modal, options) {
233 var body = document.body; //Defaults
234
235 var settings = Object.assign({
236 modalTarget: 'photonicModal',
237 closeCSS: '',
238 closeFromRight: 0,
239 width: '80%',
240 height: '100%',
241 top: '0px',
242 left: '0px',
243 zIndexIn: '9999',
244 zIndexOut: '-9999',
245 color: '#39BEB9',
246 opacityIn: '1',
247 opacityOut: '0',
248 animationDuration: '.6s',
249 overflow: 'auto'
250 }, options);
251 var overlay = document.querySelector('.photonicModalOverlay'),
252 scrollable = document.querySelector('.photonicModalOverlayScrollable');
253
254 if (!overlay) {
255 overlay = document.createElement('div');
256 overlay.className = 'photonicModalOverlay';
257 scrollable = document.createElement('div');
258 scrollable.className = 'photonicModalOverlayScrollable';
259 overlay.appendChild(scrollable);
260 body.appendChild(overlay);
261 }
262
263 var closeIcon = modal.querySelector('.photonicModalClose');
264
265 if (!closeIcon) {
266 closeIcon = document.createElement('a');
267 closeIcon.className = 'photonicModalClose ' + settings.closeCSS;
268 closeIcon.style.right = settings.closeFromRight;
269 closeIcon.innerHTML = '×';
270 closeIcon.setAttribute('href', '#');
271 modal.insertAdjacentElement('afterbegin', closeIcon);
272 }
273
274 closeIcon = modal.querySelector('.photonicModalClose');
275 var id = document.querySelector('#' + settings.modalTarget); // Default Classes
276 // id.addClass('photonicModal');
277 // id.addClass(settings.modalTarget+'-off');
278 //Init styles
279
280 var initStyles = {
281 'width': settings.width,
282 'height': settings.height,
283 'top': settings.top,
284 'left': settings.left,
285 'background-color': settings.color,
286 'overflow-y': settings.overflow,
287 'z-index': settings.zIndexOut,
288 'opacity': settings.opacityOut,
289 '-webkit-animation-duration': settings.animationDuration,
290 '-moz-animation-duration': settings.animationDuration,
291 '-ms-animation-duration': settings.animationDuration,
292 'animation-duration': settings.animationDuration
293 };
294
295 if (id) {
296 id.classList.add('photonicModal');
297 id.classList.add(settings.modalTarget + '-off');
298 var style = '';
299
300 for (var [key, value] of Object.entries(initStyles)) {
301 style += "".concat(key, ": ").concat(value, "; ");
302 }
303
304 id.style.cssText += style; // initStyles.reduce((a, v, i) => a + i + ': ' + v + ';');
305
306 open(id);
307 }
308
309 closeIcon.addEventListener('click', function (event) {
310 event.preventDefault();
311 document.documentElement.style.overflow = 'auto';
312 document.body.style.overflow = 'auto';
313
314 if (id.classList.contains(settings.modalTarget + '-on')) {
315 id.classList.remove(settings.modalTarget + '-on');
316 id.classList.add(settings.modalTarget + '-off');
317 }
318
319 if (id.classList.contains(settings.modalTarget + '-off')) {
320 id.addEventListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', afterClose, {
321 once: true
322 });
323 }
324
325 id.style.overflowY = 'hidden';
326 slideUp(id); // Util.slideUpDown(id.closest('.photonicModalOverlayScrollable'), 'hide');
327
328 overlay.style.overflowY = 'hidden'; // Util.fadeOut(overlay);
329
330 overlay.style.display = 'none';
331 });
332
333 function slideDown(element) {
334 element.style.height = 'auto';
335 element.style.height = "".concat(element.scrollHeight, "px");
336 element.style.height = 'auto';
337 }
338
339 var slideUp = element => {
340 element.style.height = 0;
341 element.style.display = 'none';
342 };
343
344 function open(el) {
345 document.documentElement.style.overflow = 'hidden';
346 document.body.style.overflow = 'hidden';
347
348 if (el.classList.contains(settings.modalTarget + '-off')) {
349 el.classList.remove(settings.modalTarget + '-off');
350 el.classList.add(settings.modalTarget + '-on');
351 }
352
353 if (el.classList.contains(settings.modalTarget + '-on')) {
354 el.style.opacity = settings.opacityIn;
355 el.style.zIndex = settings.zIndexIn;
356 }
357
358 overlay.style.overflowY = settings.overflow;
359 overlay.style.display = 'block'; // Util.fadeIn(overlay);
360
361 scrollable.appendChild(el);
362 el.style.display = 'block';
363 el.style.overflowY = settings.overflow;
364 slideDown(scrollable); // Util.slideUpDown(scrollable, 'show');
365 }
366
367 function afterClose() {
368 id.style.zIndex = settings.zIndexOut;
369 }
370 };
371
372 exports.Modal = Modal;
373
374 /***/ }),
375
376 /***/ "../include/js/front-end/src/Components/Prompter.js":
377 /*!**********************************************************!*\
378 !*** ../include/js/front-end/src/Components/Prompter.js ***!
379 \**********************************************************/
380 /*! flagged exports */
381 /*! export Prompter [provided] [no usage info] [missing usage info prevents renaming] */
382 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
383 /*! other exports [not provided] [no usage info] */
384 /*! runtime requirements: __webpack_exports__ */
385 /***/ ((__unused_webpack_module, exports) => {
386
387
388
389 Object.defineProperty(exports, "__esModule", ({
390 value: true
391 }));
392 exports.Prompter = void 0;
393
394 /**
395 * Photonic Prompter
396 * Used for interactive dialogs, e.g. the Photonic password prompter.
397 *
398 * GPL v3.0
399 */
400
401 /*
402 * var myPrompter = Prompter('htmlID');
403 *
404 * id: The HTML id of the object
405 */
406 class Prompter {
407 constructor(id) {
408 this.events = {
409 onShow: new Event('onShow'),
410 onConfirm: new Event('onConfirm'),
411 onHide: new Event('onHide')
412 };
413 this.modal = document.getElementById(id);
414 this.classClose = '.close';
415 this.classCancel = '.cancel';
416 this.classConfirm = '.confirm';
417 this.btnsOpen = [];
418 }
419 /*
420 * Prompter.show() :
421 *
422 * Shows the modal
423 */
424
425
426 show() {
427 this.modal.dispatchEvent(this.events.onShow);
428 this.modal.style.display = "block";
429 return this;
430 }
431 /* Prompter.hide() :
432 *
433 * Hides the modal
434 */
435
436
437 hide() {
438 this.modal.dispatchEvent(this.events.onHide);
439 this.modal.style.display = "none";
440 return this;
441 }
442 /*
443 * Prompter.removeEvents() :
444 *
445 * Removes the events (by cloning the modal)
446 */
447
448
449 removeEvents() {
450 var clone = this.modal.cloneNode(true);
451 this.modal.parentNode.replaceChild(clone, this.modal);
452 this.modal = clone;
453 return this;
454 }
455 /*
456 * Prompter.on(event, callback):
457 *
458 * Connect an event.
459 *
460 * event:
461 * - 'onShow': Called when the modal is shown (via Prompter.show() or a bound button)
462 * - 'onConfirm': Called when the modal when the user sends the data (via the element with the class '.confirm')
463 * - 'onHide': Called when the modal is hidden (via Prompter.hide() or a bound button)
464 * callback: The function to call on the event
465 *
466 */
467
468
469 on(event, callback) {
470 this.modal.addEventListener(event, callback);
471 return this;
472 }
473 /*
474 * Prompter.attach() :
475 *
476 * Attaches the click events on the elements with classes ".confirm", ".hide", ".cancel" plus the elements to show the modal
477 */
478
479
480 attach() {
481 var i;
482 var items = [];
483 var self = this;
484 items = this.modal.querySelectorAll(self.classClose);
485
486 for (i = items.length - 1; i >= 0; i--) {
487 items[i].addEventListener('click', function () {
488 self.hide();
489 });
490 }
491
492 items = self.modal.querySelectorAll(self.classCancel);
493
494 for (i = items.length - 1; i >= 0; i--) {
495 items[i].addEventListener('click', function () {
496 self.hide();
497 });
498 }
499
500 items = self.modal.querySelectorAll(self.classConfirm);
501
502 for (i = items.length - 1; i >= 0; i--) {
503 items[i].addEventListener('click', function () {
504 self.modal.dispatchEvent(self.events.onConfirm);
505 self.hide();
506 });
507 }
508
509 for (i = self.btnsOpen.length - 1; i >= 0; i--) {
510 self.btnsOpen[i].addEventListener('click', function () {
511 self.show();
512 });
513 }
514
515 return self;
516 }
517 /*
518 * Attach an external element that will open the modal.
519 * Prompter.addOpenBtn(element)
520 *
521 * element: Any HTML element a button, div, span,...
522 */
523
524
525 addOpenBtn(element) {
526 this.btnsOpen.push(element);
527 }
528
529 }
530
531 exports.Prompter = Prompter;
532
533 /***/ }),
534
535 /***/ "../include/js/front-end/src/Components/Tooltip.js":
536 /*!*********************************************************!*\
537 !*** ../include/js/front-end/src/Components/Tooltip.js ***!
538 \*********************************************************/
539 /*! flagged exports */
540 /*! export Tooltip [provided] [no usage info] [missing usage info prevents renaming] */
541 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
542 /*! other exports [not provided] [no usage info] */
543 /*! runtime requirements: __webpack_exports__ */
544 /***/ ((__unused_webpack_module, exports) => {
545
546
547
548 Object.defineProperty(exports, "__esModule", ({
549 value: true
550 }));
551 exports.Tooltip = void 0;
552
553 /*
554 * Photonic Tooltip
555 * License: MIT
556 */
557 var Tooltip = function Tooltip(selector, tooltip_element) {
558 var tooltip, tooltipClass, elemEdges, tooltipElems; // From https://locutus.io/php/strings/strip_tags/, or https://stackoverflow.com/questions/5601903/jquery-almost-equivalent-of-phps-strip-tags/46483672#46483672
559
560 function strip_tags(input, allowed) {
561 allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');
562 var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;
563 var commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
564 return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
565 return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
566 });
567 }
568
569 function create(tooltip, elm) {
570 var tooltipText = elm.getAttribute('data-photonic-tooltip');
571 tooltipText = strip_tags(tooltipText, '<br><strong><em><b><i><p>');
572
573 if (tooltipText !== '') {
574 elm.setAttribute('title', ''); // Blank out the regular title
575 // elemEdges relative to the viewport.
576
577 elemEdges = elm.getBoundingClientRect();
578 var tooltipTextNode = document.createTextNode(tooltipText);
579 tooltip.innerHTML = tooltipText; // ''; // Reset, or upon refresh the node gets repeated
580 // tooltip.appendChild(tooltipTextNode);
581 // Remove no-display + set the correct classname based on the position
582 // of the elm.
583
584 if (elemEdges.left > window.innerWidth - 100) {
585 tooltip.className = 'photonic-tooltip-container tooltip-left';
586 } else if (elemEdges.left + elemEdges.width / 2 < 100) {
587 tooltip.className = 'photonic-tooltip-container tooltip-right';
588 } else {
589 tooltip.className = 'photonic-tooltip-container tooltip-center';
590 }
591 }
592 }
593
594 function position(tooltip, elm) {
595 var tooltipText = elm.getAttribute('data-photonic-tooltip');
596
597 if (tooltipText !== '') {
598 if (elemEdges === undefined) {
599 elemEdges = elm.getBoundingClientRect();
600 } // 10 = arrow height
601
602
603 var elm_top = elemEdges.top + elemEdges.height + window.scrollY;
604 var viewport_edges = window.innerWidth - 100; // Position tooltip on the left side of the elm if the elm touches
605 // the viewports right edge and elm width is < 50px.
606
607 if (elemEdges.left + window.scrollX > viewport_edges && elemEdges.width < 50) {
608 tooltip.style.left = elemEdges.left + window.scrollX - (tooltip.offsetWidth + elemEdges.width) + 'px';
609 tooltip.style.top = elm.offsetTop + 'px'; // Position tooltip on the left side of the elm if the elm touches
610 // the viewports right edge and elm width is > 50px.
611 } else if (elemEdges.left + window.scrollX > viewport_edges && elemEdges.width > 50) {
612 tooltip.style.left = elemEdges.left + window.scrollX - tooltip.offsetWidth - 20 + 'px';
613 tooltip.style.top = elm.offsetTop + 'px';
614 } else if (elemEdges.left + window.scrollX + elemEdges.width / 2 < 100) {
615 // position tooltip on the right side of the elm.
616 tooltip.style.left = elemEdges.left + window.scrollX + elemEdges.width + 20 + 'px';
617 tooltip.style.top = elm.offsetTop + 'px';
618 } else {
619 // Position the toolbox in the center of the elm.
620 var centered = elemEdges.left + window.scrollX + elemEdges.width / 2 - tooltip.offsetWidth / 2;
621 tooltip.style.left = centered + 'px';
622 tooltip.style.top = elm_top + 'px';
623 }
624 }
625 }
626
627 function show(evt) {
628 create(tooltip, evt.currentTarget);
629 position(tooltip, evt.currentTarget);
630 }
631
632 function hide(evt) {
633 tooltip.className = tooltipClass + ' no-display';
634
635 if (tooltip.innerText !== '') {
636 tooltip.removeChild(tooltip.firstChild);
637 tooltip.removeAttribute('style');
638 var element = evt.currentTarget;
639 element.setAttribute('title', element.getAttribute('data-photonic-tooltip'));
640 }
641 }
642
643 function init() {
644 tooltipElems = document.documentElement.querySelectorAll(selector);
645 tooltip = document.documentElement.querySelector(tooltip_element);
646 tooltipClass = tooltip_element.replace(/^\.+/g, '');
647
648 if (tooltip === null || tooltip.length === 0) {
649 tooltip = document.createElement('div');
650 tooltip.className = tooltipClass + ' no-display';
651 document.body.appendChild(tooltip);
652 }
653
654 tooltipElems.forEach(elm => {
655 elm.removeEventListener('mouseenter', show);
656 elm.removeEventListener('mouseleave', hide);
657 elm.addEventListener('mouseenter', show, false);
658 elm.addEventListener('mouseleave', hide, false);
659 });
660 }
661
662 init();
663 };
664
665 exports.Tooltip = Tooltip;
666
667 /***/ }),
668
669 /***/ "../include/js/front-end/src/Core.js":
670 /*!*******************************************!*\
671 !*** ../include/js/front-end/src/Core.js ***!
672 \*******************************************/
673 /*! flagged exports */
674 /*! export Core [provided] [no usage info] [missing usage info prevents renaming] */
675 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
676 /*! other exports [not provided] [no usage info] */
677 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
678 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
679
680
681
682 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
683
684 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
685
686 Object.defineProperty(exports, "__esModule", ({
687 value: true
688 }));
689 exports.Core = void 0;
690
691 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
692
693 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../../../node_modules/@babel/runtime/helpers/defineProperty.js"));
694
695 var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js"));
696
697 var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js");
698
699 var _Prompter = __webpack_require__(/*! ./Components/Prompter */ "../include/js/front-end/src/Components/Prompter.js");
700
701 class Core {}
702
703 exports.Core = Core;
704 (0, _defineProperty2.default)(Core, "lightboxList", []);
705 (0, _defineProperty2.default)(Core, "prompterList", []);
706 (0, _defineProperty2.default)(Core, "lightbox", void 0);
707 (0, _defineProperty2.default)(Core, "deep", location.hash);
708 (0, _defineProperty2.default)(Core, "setLightbox", lb => Core.lightbox = lb);
709 (0, _defineProperty2.default)(Core, "getLightbox", () => Core.lightbox);
710 (0, _defineProperty2.default)(Core, "setDeep", d => Core.deep = d);
711 (0, _defineProperty2.default)(Core, "getDeep", () => Core.deep);
712 (0, _defineProperty2.default)(Core, "addToLightboxList", (idx, lightbox) => Core.lightboxList[idx] = lightbox);
713 (0, _defineProperty2.default)(Core, "getLightboxList", () => Core.lightboxList);
714 (0, _defineProperty2.default)(Core, "showSpinner", () => {
715 var loading = document.getElementsByClassName('photonic-loading');
716
717 if (loading.length > 0) {
718 loading = loading[0];
719 } else {
720 loading = document.createElement('div');
721 loading.className = 'photonic-loading';
722 }
723
724 loading.style.display = 'block';
725 document.body.appendChild(loading);
726 });
727 (0, _defineProperty2.default)(Core, "hideLoading", () => {
728 var loading = document.getElementsByClassName('photonic-loading');
729
730 if (loading.length > 0) {
731 loading = loading[0];
732 loading.style.display = 'none';
733 }
734 });
735 (0, _defineProperty2.default)(Core, "initializePasswordPrompter", selector => {
736 var selectorNoHash = selector.replace(/^#+/g, '');
737 var prompter = new _Prompter.Prompter(selectorNoHash);
738 prompter.attach();
739 Core.prompterList[selector] = prompter;
740 prompter.show();
741 });
742 (0, _defineProperty2.default)(Core, "moveHTML5External", () => {
743 var videos = document.getElementById('photonic-html5-external-videos');
744
745 if (!videos) {
746 videos = document.createElement('div');
747 videos.id = 'photonic-html5-external-videos';
748 videos.style.display = 'none';
749 document.body.appendChild(videos);
750 }
751
752 var current = document.querySelectorAll('.photonic-html5-external');
753
754 if (current) {
755 var cLen = current.length;
756
757 for (var c = 0; c < cLen; c++) {
758 current[c].classList.remove('photonic-html5-external');
759 videos.appendChild(current[c]);
760 }
761 }
762 });
763 (0, _defineProperty2.default)(Core, "blankSlideupTitle", () => {
764 document.querySelectorAll('.title-display-slideup-stick, .photonic-slideshow.title-display-slideup-stick').forEach(item => {
765 Array.from(item.getElementsByTagName('a')).forEach(a => {
766 a.setAttribute('title', '');
767 });
768 });
769 });
770 (0, _defineProperty2.default)(Core, "showSlideupTitle", () => {
771 var titles = document.documentElement.querySelectorAll('.title-display-slideup-stick a .photonic-title');
772 var len = titles.length;
773
774 for (var i = 0; i < len; i++) {
775 titles[i].style.display = 'block';
776 }
777 });
778 (0, _defineProperty2.default)(Core, "waitForImages", /*#__PURE__*/function () {
779 var _ref = (0, _asyncToGenerator2.default)(function* (selector) {
780 var images = Core.getImagesFromSelector(selector);
781 var imageUrlArray = [];
782 var anchorArray = [];
783 var setDimensions = false;
784
785 if (selector instanceof Element && selector.getAttribute('data-photonic-platform') === 'instagram') {
786 setDimensions = true;
787 }
788
789 images.forEach(img => {
790 imageUrlArray.push(img.getAttribute('src'));
791 anchorArray.push(img.parentElement);
792 });
793 var promiseArray = []; // create an array for promises
794
795 var imageArray = []; // array for the images
796
797 var _loop = function _loop(idx, imageUrl) {
798 promiseArray.push(new Promise(resolve => {
799 var img = new Image();
800
801 img.onload = () => {
802 if (setDimensions) {
803 anchorArray[idx].setAttribute('data-pswp-width', img.naturalWidth);
804 anchorArray[idx].setAttribute('data-pswp-height', img.naturalHeight);
805 }
806
807 resolve();
808 };
809
810 img.src = imageUrl;
811 imageArray.push(img);
812 }));
813 };
814
815 for (var [idx, imageUrl] of imageUrlArray.entries()) {
816 _loop(idx, imageUrl);
817 }
818
819 yield Promise.all(promiseArray); // wait for all the images to be loaded
820
821 return imageArray;
822 });
823
824 return function (_x) {
825 return _ref.apply(this, arguments);
826 };
827 }());
828 (0, _defineProperty2.default)(Core, "loadSingleImage", /*#__PURE__*/function () {
829 var _ref2 = (0, _asyncToGenerator2.default)(function* (image) {
830 var promiseArray = [];
831 var retImage = null;
832 promiseArray.push(new Promise(resolve => {
833 var img = new Image();
834
835 img.onload = () => {
836 resolve();
837 };
838
839 if (image.getAttribute('data-src') !== null) {
840 img.src = image.getAttribute('data-src');
841 } else {
842 img.src = image.getAttribute('src'); // Leave the 'src' in just as a backup. E.g. Gallery header images
843 }
844
845 retImage = img;
846 }));
847 yield Promise.all(promiseArray);
848 return retImage;
849 });
850
851 return function (_x2) {
852 return _ref2.apply(this, arguments);
853 };
854 }());
855 (0, _defineProperty2.default)(Core, "watchForImages", selector => {
856 var images = Core.getImagesFromSelector(selector);
857 var intersectionObserver = new IntersectionObserver((items, observer) => {
858 items.forEach(item => {
859 if (item.isIntersecting || item.intersectionRatio > 0) {
860 var image = item.target;
861 image.closest('a').classList.add('photonic-image-loading');
862 Core.loadSingleImage(image).then(() => {
863 if (image.getAttribute('data-src') !== null && image.getAttribute('data-src') !== '') {
864 image.src = image.getAttribute('data-src');
865 image.setAttribute('data-src', '');
866 image.setAttribute('data-loaded', 'true');
867 }
868
869 image.closest('a').classList.remove('photonic-image-loading');
870 Util.fadeIn(image);
871 });
872 observer.unobserve(image);
873 }
874 });
875 });
876 images.forEach(image => {
877 intersectionObserver.observe(image);
878 });
879 });
880 (0, _defineProperty2.default)(Core, "getImagesFromSelector", selector => {
881 var images = [];
882
883 if (typeof selector === 'string') {
884 document.querySelectorAll(selector).forEach(selection => {
885 images = Array.from(selection.getElementsByTagName('img'));
886 });
887 } else if (selector instanceof Element) {
888 images = Array.from(selector.getElementsByTagName('img'));
889 } else if (selector instanceof NodeList) {
890 selector.forEach(selection => {
891 images.push(selection.querySelector('img'));
892 });
893 }
894
895 return images;
896 });
897 (0, _defineProperty2.default)(Core, "standardizeTitleWidths", () => {
898 var self = Core;
899
900 var setWidths = grid => {
901 grid.querySelectorAll('.photonic-thumb').forEach(item => {
902 var img = item.getElementsByTagName('img');
903
904 if (img != null) {
905 img = img[0];
906 var title = item.querySelector('.photonic-title-info');
907
908 if (title) {
909 title.style.width = img.width + 'px';
910 }
911 }
912 });
913 };
914
915 document.querySelectorAll('.photonic-standard-layout.title-display-below, .photonic-standard-layout.title-display-hover-slideup-show, .photonic-standard-layout.title-display-slideup-stick').forEach(grid => {
916 if (grid.classList.contains('sizes-present')) {
917 self.watchForImages(grid);
918 setWidths(grid);
919 } else {
920 self.waitForImages(grid).then(() => {
921 setWidths(grid);
922 });
923 }
924 });
925 });
926 (0, _defineProperty2.default)(Core, "sanitizeTitles", () => {
927 var thumbs = document.querySelectorAll('.photonic-stream a, a.photonic-level-2-thumb');
928 thumbs.forEach(thumb => {
929 if (!thumb.parentNode.classList.contains('photonic-header-title')) {
930 var title = thumb.getAttribute('title'); // Not doing innerHTML, which is susceptible to XSS
931
932 thumb.setAttribute('title', Util.getText(title));
933 var dataTitle = thumb.getAttribute('data-title');
934 thumb.setAttribute('data-title', Util.HTMLSanitizer.SanitizeHTML(dataTitle));
935 }
936 });
937 });
938 (0, _defineProperty2.default)(Core, "initializeTooltips", () => {
939 if (document.querySelector('.title-display-tooltip a, .photonic-slideshow.title-display-tooltip img') != null) {
940 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
941 }
942 });
943 (0, _defineProperty2.default)(Core, "showRegularGrids", () => {
944 document.querySelectorAll('.photonic-standard-layout').forEach(grid => {
945 if (grid.classList.contains('sizes-present')) {
946 Core.watchForImages(grid);
947 } else {
948 Core.waitForImages(grid).then(() => {
949 grid.querySelectorAll('.photonic-level-1, .photonic-level-2').forEach(item => {
950 item.style.display = 'inline-block';
951 });
952 });
953 }
954 });
955 });
956 (0, _defineProperty2.default)(Core, "executeCommon", () => {
957 Core.moveHTML5External();
958 Core.blankSlideupTitle();
959 Core.standardizeTitleWidths();
960 Core.sanitizeTitles();
961 Core.initializeTooltips();
962 Core.showRegularGrids();
963 });
964
965 /***/ }),
966
967 /***/ "../include/js/front-end/src/Layouts/Justified.js":
968 /*!********************************************************!*\
969 !*** ../include/js/front-end/src/Layouts/Justified.js ***!
970 \********************************************************/
971 /*! flagged exports */
972 /*! export JustifiedGrid [provided] [no usage info] [missing usage info prevents renaming] */
973 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
974 /*! other exports [not provided] [no usage info] */
975 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
976 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
977
978
979
980 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
981
982 Object.defineProperty(exports, "__esModule", ({
983 value: true
984 }));
985 exports.JustifiedGrid = void 0;
986
987 var _Core = __webpack_require__(/*! ../Core.js */ "../include/js/front-end/src/Core.js");
988
989 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util.js */ "../include/js/front-end/src/Util.js"));
990
991 /**
992 * Photonic Justified Grid Layout (JS-based)
993 * Photonic can render a justified grid using CSS or JS. The CSS layout is the default. The JS one is used when the sizes of the images are not available upfront.
994 * The CSS layout renders quicker, but the JS layouts are a lot prettier.
995 *
996 * License: GPL v3.0
997 */
998 var linearMin = arr => {
999 var computed, result, x, _i, _len;
1000
1001 for (_i = 0, _len = arr.length; _i < _len; _i++) {
1002 x = arr[_i];
1003 computed = x[0];
1004
1005 if (!result || computed < result.computed) {
1006 result = {
1007 value: x,
1008 computed: computed
1009 };
1010 }
1011 }
1012
1013 return result.value;
1014 };
1015
1016 var linearPartition = (seq, k) => {
1017 var ans, i, j, m, n, solution, table, x, y, _i, _j, _k, _l;
1018
1019 n = seq.length;
1020
1021 if (k <= 0) {
1022 return [];
1023 }
1024
1025 if (k > n) {
1026 return seq.map(x => [x]);
1027 }
1028
1029 table = (() => {
1030 var _i, _results;
1031
1032 _results = [];
1033
1034 for (y = _i = 0; 0 <= n ? _i < n : _i > n; y = 0 <= n ? ++_i : --_i) {
1035 _results.push(function () {
1036 var _j, _results1;
1037
1038 _results1 = [];
1039
1040 for (x = _j = 0; 0 <= k ? _j < k : _j > k; x = 0 <= k ? ++_j : --_j) {
1041 _results1.push(0);
1042 }
1043
1044 return _results1;
1045 }());
1046 }
1047
1048 return _results;
1049 })();
1050
1051 solution = (() => {
1052 var _i, _ref, _results;
1053
1054 _results = [];
1055
1056 for (y = _i = 0, _ref = n - 1; 0 <= _ref ? _i < _ref : _i > _ref; y = 0 <= _ref ? ++_i : --_i) {
1057 _results.push(function () {
1058 var _j, _ref1, _results1;
1059
1060 _results1 = [];
1061
1062 for (x = _j = 0, _ref1 = k - 1; 0 <= _ref1 ? _j < _ref1 : _j > _ref1; x = 0 <= _ref1 ? ++_j : --_j) {
1063 _results1.push(0);
1064 }
1065
1066 return _results1;
1067 }());
1068 }
1069
1070 return _results;
1071 })();
1072
1073 for (i = _i = 0; 0 <= n ? _i < n : _i > n; i = 0 <= n ? ++_i : --_i) {
1074 table[i][0] = seq[i] + (i ? table[i - 1][0] : 0);
1075 }
1076
1077 for (j = _j = 0; 0 <= k ? _j < k : _j > k; j = 0 <= k ? ++_j : --_j) {
1078 table[0][j] = seq[0];
1079 }
1080
1081 for (i = _k = 1; 1 <= n ? _k < n : _k > n; i = 1 <= n ? ++_k : --_k) {
1082 for (j = _l = 1; 1 <= k ? _l < k : _l > k; j = 1 <= k ? ++_l : --_l) {
1083 m = linearMin((() => {
1084 var _m, _results;
1085
1086 _results = [];
1087
1088 for (x = _m = 0; 0 <= i ? _m < i : _m > i; x = 0 <= i ? ++_m : --_m) {
1089 _results.push([Math.max(table[x][j - 1], table[i][0] - table[x][0]), x]);
1090 }
1091
1092 return _results;
1093 })());
1094 table[i][j] = m[0];
1095 solution[i - 1][j - 1] = m[1];
1096 }
1097 }
1098
1099 n = n - 1;
1100 k = k - 2;
1101 ans = [];
1102
1103 while (k >= 0) {
1104 ans = [(() => {
1105 var _m, _ref, _ref1, _results;
1106
1107 _results = [];
1108
1109 for (i = _m = _ref = solution[n - 1][k] + 1, _ref1 = n + 1; _ref <= _ref1 ? _m < _ref1 : _m > _ref1; i = _ref <= _ref1 ? ++_m : --_m) {
1110 _results.push(seq[i]);
1111 }
1112
1113 return _results;
1114 })()].concat(ans);
1115 n = solution[n - 1][k];
1116 k = k - 1;
1117 }
1118
1119 return [(() => {
1120 var _m, _ref, _results;
1121
1122 _results = [];
1123
1124 for (i = _m = 0, _ref = n + 1; 0 <= _ref ? _m < _ref : _m > _ref; i = 0 <= _ref ? ++_m : --_m) {
1125 _results.push(seq[i]);
1126 }
1127
1128 return _results;
1129 })()].concat(ans);
1130 };
1131
1132 function part(seq, k) {
1133 if (k <= 0) {
1134 return [];
1135 }
1136
1137 while (k) {
1138 try {
1139 return linearPartition(seq, k--);
1140 } catch (_error) {//
1141 }
1142 }
1143 }
1144
1145 var JustifiedGrid = (resized, jsLoaded, selector, lightbox) => {
1146 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Justified Grid');
1147 var selection = document.querySelectorAll(selector);
1148
1149 if (selector == null || selection.length === 0) {
1150 selection = document.querySelectorAll('.photonic-random-layout');
1151 }
1152
1153 if (!resized && selection.length > 0) {
1154 _Core.Core.showSpinner();
1155 }
1156
1157 var setupTitles = () => {
1158 _Core.Core.blankSlideupTitle();
1159
1160 _Core.Core.showSlideupTitle();
1161
1162 if (!resized && !jsLoaded) {
1163 _Core.Core.hideLoading();
1164 }
1165 };
1166
1167 selection.forEach(container => {
1168 // If there are some nodes for which the sizes are missing, play safe and run this in JS mode.
1169 // Otherwise render the gallery using CSS, and just display the images once they have downloaded.
1170 if (container.classList.contains('sizes-missing') || !window.CSS || !CSS.supports('color', 'var(--fake-var)')) {
1171 var viewportWidth = Math.floor(container.getBoundingClientRect().width),
1172 windowHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
1173 idealHeight = Math.max(parseInt(windowHeight / 4), Photonic_JS.tile_min_height);
1174 var gap = Photonic_JS.tile_spacing * 2;
1175
1176 _Core.Core.waitForImages(container).then(() => {
1177 var photos = [],
1178 images = Array.from(container.getElementsByTagName('img'));
1179 images.forEach(image => {
1180 if (image.closest('.photonic-panel') !== null) {
1181 return;
1182 }
1183
1184 var div = image.parentNode.parentNode;
1185
1186 if (!(image.naturalHeight === 0 || image.naturalHeight === undefined || image.naturalWidth === undefined)) {
1187 photos.push({
1188 tile: div,
1189 aspect_ratio: image.naturalWidth / image.naturalHeight
1190 });
1191 }
1192 });
1193 var summedWidth = photos.reduce((sum, p) => sum += p.aspect_ratio * idealHeight + gap, 0);
1194 var rows = Math.max(Math.round(summedWidth / viewportWidth), 1),
1195 // At least 1 row should be shown
1196 weights = photos.map(p => Math.round(p.aspect_ratio * 100));
1197 var partition = part(weights, rows);
1198 var index = 0;
1199 var oLen = partition.length;
1200
1201 for (var o = 0; o < oLen; o++) {
1202 var onePart = partition[o];
1203 var summedRatios = void 0;
1204 var rowBuffer = photos.slice(index, index + onePart.length);
1205 index = index + onePart.length;
1206 summedRatios = rowBuffer.reduce((sum, p) => sum += p.aspect_ratio, 0);
1207 var rLen = rowBuffer.length;
1208
1209 for (var r = 0; r < rLen; r++) {
1210 var item = rowBuffer[r],
1211 existing = item.tile;
1212 existing.style.width = parseInt(viewportWidth / summedRatios * item.aspect_ratio) + "px";
1213 existing.style.height = parseInt(viewportWidth / summedRatios) + "px";
1214 }
1215 }
1216
1217 container.querySelectorAll('.photonic-thumb, .photonic-thumb img').forEach(thumb => Util.fadeIn(thumb));
1218 setupTitles();
1219 });
1220 } else {
1221 _Core.Core.watchForImages(container);
1222
1223 setupTitles();
1224 }
1225
1226 if (lightbox && !resized) {
1227 if (Photonic_JS.lightbox_library === 'lightcase') {
1228 lightbox.initialize('.photonic-random-layout');
1229 } else if (['bigpicture', 'featherlight', 'glightbox'].indexOf(Photonic_JS.lightbox_library) > -1) {
1230 lightbox.initialize(container);
1231 } else if (Photonic_JS.lightbox_library === 'fancybox3') {
1232 lightbox.initialize('.photonic-random-layout');
1233 } else if (Photonic_JS.lightbox_library === 'photoswipe') {
1234 lightbox.initialize();
1235 }
1236 }
1237 });
1238 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Justified Grid');
1239 };
1240
1241 exports.JustifiedGrid = JustifiedGrid;
1242
1243 /***/ }),
1244
1245 /***/ "../include/js/front-end/src/Layouts/Layout.js":
1246 /*!*****************************************************!*\
1247 !*** ../include/js/front-end/src/Layouts/Layout.js ***!
1248 \*****************************************************/
1249 /*! flagged exports */
1250 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1251 /*! export initializeLayouts [provided] [no usage info] [missing usage info prevents renaming] */
1252 /*! other exports [not provided] [no usage info] */
1253 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1254 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1255
1256
1257
1258 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
1259
1260 Object.defineProperty(exports, "__esModule", ({
1261 value: true
1262 }));
1263 exports.initializeLayouts = void 0;
1264
1265 var _Justified = __webpack_require__(/*! ./Justified */ "../include/js/front-end/src/Layouts/Justified.js");
1266
1267 var _Mosaic = __webpack_require__(/*! ./Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js");
1268
1269 var _Masonry = __webpack_require__(/*! ./Masonry */ "../include/js/front-end/src/Layouts/Masonry.js");
1270
1271 var _MasonryHorizontal = __webpack_require__(/*! ./MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js");
1272
1273 var Slider = _interopRequireWildcard(__webpack_require__(/*! ./Slider */ "../include/js/front-end/src/Layouts/Slider.js"));
1274
1275 var initializeLayouts = lightbox => {
1276 (0, _Justified.JustifiedGrid)(false, false, null, lightbox);
1277 (0, _Mosaic.Mosaic)(false, false);
1278 (0, _Masonry.Masonry)(false, false);
1279 (0, _MasonryHorizontal.MasonryHorizontal)(false, false);
1280 Slider.initializeSliders();
1281 window.addEventListener('resize', () => {
1282 (0, _Justified.JustifiedGrid)(true, false, '.photonic-random-layout.sizes-missing');
1283 (0, _Mosaic.Mosaic)(true, false);
1284 (0, _Masonry.Masonry)(true, false);
1285 (0, _MasonryHorizontal.MasonryHorizontal)(true, false);
1286 });
1287 };
1288
1289 exports.initializeLayouts = initializeLayouts;
1290
1291 /***/ }),
1292
1293 /***/ "../include/js/front-end/src/Layouts/Masonry.js":
1294 /*!******************************************************!*\
1295 !*** ../include/js/front-end/src/Layouts/Masonry.js ***!
1296 \******************************************************/
1297 /*! flagged exports */
1298 /*! export Masonry [provided] [no usage info] [missing usage info prevents renaming] */
1299 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1300 /*! other exports [not provided] [no usage info] */
1301 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1302 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1303
1304
1305
1306 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
1307
1308 Object.defineProperty(exports, "__esModule", ({
1309 value: true
1310 }));
1311 exports.Masonry = void 0;
1312
1313 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
1314
1315 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js"));
1316
1317 /**
1318 * Photonic Masonry Layout
1319 * The Masonry layout is primarily controlled using CSS columns. The JS component is to facilitate responsive behaviour and breakpoints.
1320 *
1321 * License: GPL v3.0
1322 */
1323 var Masonry = (resized, jsLoaded, selector) => {
1324 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Masonry');
1325 var selection = document.querySelectorAll(selector);
1326
1327 if (selector == null || selection.length === 0) {
1328 selection = document.querySelectorAll('.photonic-masonry-layout');
1329 }
1330
1331 if (!resized && selection.length > 0) {
1332 _Core.Core.showSpinner();
1333 }
1334
1335 var minWidth = isNaN(Photonic_JS.masonry_min_width) || parseInt(Photonic_JS.masonry_min_width) <= 0 ? 200 : Photonic_JS.masonry_min_width;
1336 minWidth = parseInt(minWidth);
1337 selection.forEach(grid => {
1338 var columns = grid.getAttribute('data-photonic-gallery-columns');
1339 columns = isNaN(parseInt(columns)) || parseInt(columns) <= 0 ? 3 : parseInt(columns);
1340
1341 var buildLayout = (grid, fadeIn) => {
1342 var viewportWidth = Math.floor(grid.getBoundingClientRect().width),
1343 idealColumns = viewportWidth / columns > minWidth ? columns : Math.floor(viewportWidth / minWidth);
1344
1345 if (idealColumns !== undefined && idealColumns !== null) {
1346 grid.style.columnCount = idealColumns.toString();
1347 }
1348
1349 if (fadeIn) {
1350 Array.from(grid.getElementsByTagName('img')).forEach(img => {
1351 Util.fadeIn(img);
1352 });
1353 }
1354
1355 _Core.Core.showSlideupTitle();
1356
1357 if (!resized && !jsLoaded) {
1358 _Core.Core.hideLoading();
1359 }
1360 };
1361
1362 if (grid.classList.contains('sizes-present')) {
1363 _Core.Core.watchForImages(grid);
1364
1365 buildLayout(grid, false);
1366 } else {
1367 _Core.Core.waitForImages(grid).then(() => {
1368 buildLayout(grid, true);
1369 });
1370 }
1371 });
1372 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Masonry');
1373 };
1374
1375 exports.Masonry = Masonry;
1376
1377 /***/ }),
1378
1379 /***/ "../include/js/front-end/src/Layouts/MasonryHorizontal.js":
1380 /*!****************************************************************!*\
1381 !*** ../include/js/front-end/src/Layouts/MasonryHorizontal.js ***!
1382 \****************************************************************/
1383 /*! flagged exports */
1384 /*! export MasonryHorizontal [provided] [no usage info] [missing usage info prevents renaming] */
1385 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1386 /*! other exports [not provided] [no usage info] */
1387 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1388 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1389
1390
1391
1392 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
1393
1394 Object.defineProperty(exports, "__esModule", ({
1395 value: true
1396 }));
1397 exports.MasonryHorizontal = void 0;
1398
1399 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
1400
1401 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js"));
1402
1403 /**
1404 * Photonic Masonry Layout
1405 * The Masonry layout is primarily controlled using CSS columns. The JS component is to facilitate responsive behaviour and breakpoints.
1406 *
1407 * License: GPL v3.0
1408 */
1409 var MasonryHorizontal = (resized, jsLoaded, selector) => {
1410 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Horizontal Masonry');
1411 var selection = document.querySelectorAll(selector);
1412
1413 if (selector == null || selection.length === 0) {
1414 selection = document.querySelectorAll('.photonic-masonry-horizontal-layout');
1415 }
1416
1417 if (!resized && selection.length > 0) {
1418 _Core.Core.showSpinner();
1419 }
1420
1421 var minWidth = isNaN(Photonic_JS.masonry_min_width) || parseInt(Photonic_JS.masonry_min_width) <= 0 ? 200 : Photonic_JS.masonry_min_width;
1422 minWidth = parseInt(minWidth);
1423 selection.forEach(grid => {
1424 var columns = grid.getAttribute('data-photonic-gallery-columns');
1425 columns = isNaN(parseInt(columns)) || parseInt(columns) <= 0 ? 3 : parseInt(columns);
1426
1427 var buildLayout = (grid, fadeIn) => {
1428 var figures = grid.querySelectorAll('figure');
1429 var inputFigures = [],
1430 outputFigures = [];
1431 figures.forEach(figure => {
1432 inputFigures[figure.getAttribute('data-photonic-idx')] = figure;
1433 });
1434 var viewportWidth = Math.floor(grid.getBoundingClientRect().width),
1435 idealColumns = viewportWidth / columns > minWidth ? columns : Math.floor(viewportWidth / minWidth);
1436
1437 if (idealColumns !== undefined && idealColumns !== null) {
1438 grid.style.columnCount = idealColumns.toString();
1439 var col = 0;
1440
1441 while (col < idealColumns) {
1442 for (var idx = 0; idx < inputFigures.length; idx += idealColumns) {
1443 var _val = inputFigures[idx + col];
1444
1445 if (_val !== undefined) {
1446 outputFigures.push(_val);
1447 }
1448 }
1449
1450 col++;
1451 }
1452
1453 if (outputFigures.length === inputFigures.length) {
1454 var fragment = document.createDocumentFragment();
1455 outputFigures.forEach(figure => {
1456 grid.appendChild(figure);
1457 });
1458 }
1459 }
1460
1461 if (fadeIn) {
1462 Array.from(grid.getElementsByTagName('img')).forEach(img => {
1463 Util.fadeIn(img);
1464 });
1465 }
1466
1467 _Core.Core.showSlideupTitle();
1468
1469 if (!resized && !jsLoaded) {
1470 _Core.Core.hideLoading();
1471 }
1472 };
1473
1474 if (grid.classList.contains('sizes-present')) {
1475 _Core.Core.watchForImages(grid);
1476
1477 buildLayout(grid, !resized);
1478 } else {
1479 _Core.Core.waitForImages(grid).then(() => {
1480 buildLayout(grid, true);
1481 });
1482 }
1483 });
1484 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Horizontal Masonry');
1485 };
1486
1487 exports.MasonryHorizontal = MasonryHorizontal;
1488
1489 /***/ }),
1490
1491 /***/ "../include/js/front-end/src/Layouts/Mosaic.js":
1492 /*!*****************************************************!*\
1493 !*** ../include/js/front-end/src/Layouts/Mosaic.js ***!
1494 \*****************************************************/
1495 /*! flagged exports */
1496 /*! export Mosaic [provided] [no usage info] [missing usage info prevents renaming] */
1497 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1498 /*! other exports [not provided] [no usage info] */
1499 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1500 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1501
1502
1503
1504 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
1505
1506 Object.defineProperty(exports, "__esModule", ({
1507 value: true
1508 }));
1509 exports.Mosaic = void 0;
1510
1511 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
1512
1513 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js"));
1514
1515 /**
1516 * Photonic Mosaic Layout
1517 * Arranges photos similar to JetPack tiles, but without any of the limitations of JetPack tiles. JS-based, responsive, and images are not affected by resolution issues.
1518 *
1519 * License: GPL V3.0
1520 */
1521 var getDistribution = (setSize, max, min) => {
1522 var distribution = [];
1523 var processed = 0;
1524
1525 while (processed < setSize) {
1526 if (setSize - processed <= max && processed > 0) {
1527 distribution.push(setSize - processed);
1528 processed += setSize - processed;
1529 } else {
1530 var current = Math.max(Math.floor(Math.random() * max + 1), min);
1531 current = Math.min(current, setSize - processed);
1532 distribution.push(current);
1533 processed += current;
1534 }
1535 }
1536
1537 return distribution;
1538 };
1539
1540 var arrayAlternate = (array, remainder) => array.filter((value, index) => index % 2 === remainder);
1541
1542 var setUniformHeightsForRow = array => {
1543 // First, order the array by increasing height
1544 array.sort((a, b) => a.height - b.height);
1545 array[0].new_height = array[0].height;
1546 array[0].new_width = array[0].width;
1547
1548 for (var i = 1; i < array.length; i++) {
1549 array[i].new_height = array[0].height;
1550 array[i].new_width = array[i].new_height * array[i].aspect_ratio;
1551 }
1552
1553 var new_width = array.reduce((sum, p) => sum += p.new_width, 0);
1554 return {
1555 elements: array,
1556 height: array[0].new_height,
1557 width: new_width,
1558 aspect_ratio: new_width / array[0].new_height
1559 };
1560 };
1561
1562 var finalizeTiledLayout = (components, containers) => {
1563 var cLength = components.length;
1564
1565 for (var c = 0; c < cLength; c++) {
1566 var component = components[c];
1567 var rowY = component.y,
1568 otherRowHeight = 0,
1569 container = void 0;
1570 var ceLen = component.elements.length;
1571
1572 for (var e = 0; e < ceLen; e++) {
1573 var element = component.elements[e];
1574
1575 if (element.photo_position !== undefined) {
1576 // Component is a single image
1577 container = containers[element.photo_position];
1578 container.style.width = component.new_width + 'px';
1579 container.style.height = component.new_height + 'px';
1580 container.style.top = component.y + 'px';
1581 container.style.left = component.x + 'px';
1582 } else {
1583 // Component is a clique (element is a row). Widths and Heights of cliques have been calculated. But the rows in cliques need to be recalculated
1584 element.new_width = component.new_width;
1585
1586 if (otherRowHeight === 0) {
1587 element.new_height = element.new_width / element.aspect_ratio;
1588 otherRowHeight = element.new_height;
1589 } else {
1590 element.new_height = component.new_height - otherRowHeight;
1591 }
1592
1593 element.x = component.x;
1594 element.y = rowY;
1595 rowY += element.new_height;
1596 var totalWidth = element.elements.reduce((sum, p) => sum += p.new_width, 0);
1597 var rowX = 0;
1598 var eLength = element.elements.length;
1599
1600 for (var i = 0; i < eLength; i++) {
1601 var image = element.elements[i];
1602 image.new_width = element.new_width * image.new_width / totalWidth;
1603 image.new_height = element.new_height; //image.new_width / image.aspect_ratio;
1604
1605 image.x = rowX;
1606 rowX += image.new_width;
1607 container = containers[image.photo_position];
1608 container.style.width = Math.floor(image.new_width) + 'px';
1609 container.style.height = Math.floor(image.new_height) + 'px';
1610 container.style.top = Math.floor(element.y) + 'px';
1611 container.style.left = Math.floor(element.x + image.x) + 'px';
1612 }
1613 }
1614 }
1615 }
1616 };
1617
1618 var doImageLayout = (grid, needToWait) => {
1619 var viewportWidth = Math.floor(grid.getBoundingClientRect().width),
1620 triggerWidth = isNaN(Photonic_JS.mosaic_trigger_width) || parseInt(Photonic_JS.mosaic_trigger_width) <= 0 ? 200 : parseInt(Photonic_JS.mosaic_trigger_width),
1621 maxInRow = Math.floor(viewportWidth / triggerWidth),
1622 minInRow = viewportWidth >= triggerWidth * 2 ? 2 : 1,
1623 photos = [];
1624 var setSize;
1625 var containers = [],
1626 images = Array.from(grid.getElementsByTagName('img'));
1627 images.forEach((image, position) => {
1628 if (image.closest('.photonic-panel') != null) {
1629 return;
1630 }
1631
1632 var a = image.parentNode;
1633 var div = a.parentNode;
1634 div.setAttribute('data-photonic-photo-index', position);
1635 containers[position] = div;
1636 var height = needToWait ? image.naturalHeight : image.getAttribute('height'),
1637 width = needToWait ? image.naturalWidth : image.getAttribute('width');
1638
1639 if (!(height === 0 || height === undefined || width === undefined)) {
1640 var aspectRatio = width / height;
1641 photos.push({
1642 src: image.src,
1643 width: width,
1644 height: height,
1645 aspect_ratio: aspectRatio,
1646 photo_position: position
1647 });
1648 }
1649 });
1650 setSize = photos.length;
1651 var distribution = getDistribution(setSize, maxInRow, minInRow); // We got our random distribution. Let's divide the photos up according to the distribution.
1652
1653 var groups = [],
1654 startIdx = 0;
1655 distribution.forEach(size => {
1656 groups.push(photos.slice(startIdx, startIdx + size));
1657 startIdx += size;
1658 });
1659 var groupY = 0; // We now have our groups of photos. We need to find the optimal layout for each group.
1660
1661 groups.forEach(group => {
1662 // First, order the group by aspect ratio
1663 group.sort((a, b) => a.aspect_ratio - b.aspect_ratio); // Next, pick a random layout
1664
1665 var groupLayout;
1666
1667 if (group.length === 1) {
1668 groupLayout = [1];
1669 } else if (group.length === 2) {
1670 groupLayout = [1, 1];
1671 } else {
1672 groupLayout = getDistribution(group.length, group.length - 1, 1);
1673 } // Now, LAYOUT, BABY!!!
1674
1675
1676 var cliqueF = 0,
1677 cliqueL = group.length - 1,
1678 cliques = [],
1679 indices = [];
1680
1681 for (var i = 2; i <= maxInRow; i++) {
1682 var index = groupLayout.indexOf(i);
1683
1684 while (-1 < index && cliqueF < cliqueL) {
1685 // Ideal Layout: one landscape, one portrait. But we will take any 2 with contrasting aspect ratios
1686 var clique = [],
1687 j = 0;
1688
1689 while (j < i && cliqueF <= cliqueL) {
1690 clique.push(group[cliqueF++]); // One with a low aspect ratio
1691
1692 j++;
1693
1694 if (j < i && cliqueF <= cliqueL) {
1695 clique.push(group[cliqueL--]); // One with a high aspect ratio
1696
1697 j++;
1698 }
1699 } // Clique is formed. Add it to the list of cliques.
1700
1701
1702 cliques.push(clique);
1703 indices.push(index); // Keep track of the position of the clique in the row
1704
1705 index = groupLayout.indexOf(i, index + 1);
1706 }
1707 } // The ones that are not in any clique (i.e. the ones in the middle) will be given their own columns in the row.
1708
1709
1710 var remainder = group.slice(cliqueF, cliqueL + 1); // Now let's layout the cliques individually. Each clique is its own column.
1711
1712 var rowLayout = [];
1713 cliques.forEach((clique, cliqueIdx) => {
1714 var toss = Math.floor(Math.random() * 2); // 0 --> Groups of smallest and largest, or 1 --> Alternating
1715
1716 var oneRow, otherRow;
1717
1718 if (toss === 0) {
1719 // Group the ones with the lowest aspect ratio together, and the ones with the highest aspect ratio together.
1720 // Lay one group at the top and the other at the bottom
1721 var wide = Math.max(Math.floor(Math.random() * (clique.length / 2 - 1)), 1);
1722 oneRow = clique.slice(0, wide);
1723 otherRow = clique.slice(wide);
1724 } else {
1725 // Group alternates together.
1726 // Lay one group at the top and the other at the bottom
1727 oneRow = arrayAlternate(clique, 0);
1728 otherRow = arrayAlternate(clique, 1);
1729 } // Make heights consistent within rows:
1730
1731
1732 oneRow = setUniformHeightsForRow(oneRow);
1733 otherRow = setUniformHeightsForRow(otherRow); // Now make widths consistent
1734
1735 oneRow.new_width = Math.min(oneRow.width, otherRow.width);
1736 oneRow.new_height = oneRow.new_width / oneRow.aspect_ratio;
1737 otherRow.new_width = oneRow.new_width;
1738 otherRow.new_height = otherRow.new_width / otherRow.aspect_ratio;
1739 rowLayout.push({
1740 elements: [oneRow, otherRow],
1741 height: oneRow.new_height + otherRow.new_height,
1742 width: oneRow.new_width,
1743 aspect_ratio: oneRow.new_width / (oneRow.new_height + otherRow.new_height),
1744 element_position: indices[cliqueIdx]
1745 });
1746 });
1747 rowLayout.sort((a, b) => a.element_position - b.element_position);
1748 var orderedRowLayout = [];
1749
1750 for (var position = 0; position < groupLayout.length; position++) {
1751 var cliqueExists = indices.indexOf(position) > -1;
1752
1753 if (cliqueExists) {
1754 orderedRowLayout.push(rowLayout.shift());
1755 } else {
1756 var rem = remainder.shift();
1757 orderedRowLayout.push({
1758 elements: [rem],
1759 height: rem.height,
1760 width: rem.width,
1761 aspect_ratio: rem.aspect_ratio
1762 });
1763 }
1764 } // Main Row layout is fully constructed and ordered. Now we need to balance heights and widths of all cliques with the "remainder"
1765
1766
1767 var totalAspect = orderedRowLayout.reduce((sum, p) => sum += p.aspect_ratio, 0);
1768 var elementX = 0;
1769 orderedRowLayout.forEach(component => {
1770 component.new_width = component.aspect_ratio / totalAspect * viewportWidth;
1771 component.new_height = component.new_width / component.aspect_ratio;
1772 component.y = groupY;
1773 component.x = elementX;
1774 elementX += component.new_width;
1775 });
1776 groupY += orderedRowLayout[0].new_height;
1777 finalizeTiledLayout(orderedRowLayout, containers);
1778 });
1779 grid.style.height = groupY + 'px';
1780 };
1781
1782 var Mosaic = (resized, jsLoaded, selector) => {
1783 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Mosaic');
1784 var selection = document.querySelectorAll(selector);
1785
1786 if (selector == null || selection.length === 0) {
1787 selection = document.querySelectorAll('.photonic-mosaic-layout');
1788 }
1789
1790 if (!resized && selection.length > 0) {
1791 _Core.Core.showSpinner();
1792 }
1793
1794 selection.forEach(grid => {
1795 if (!grid.hasChildNodes()) {
1796 return;
1797 }
1798
1799 if (grid.classList.contains('sizes-present')) {
1800 _Core.Core.watchForImages(grid);
1801
1802 doImageLayout(grid, false);
1803
1804 _Core.Core.showSlideupTitle();
1805
1806 if (!resized && !jsLoaded) {
1807 _Core.Core.hideLoading();
1808 }
1809 } else {
1810 _Core.Core.waitForImages(grid).then(() => {
1811 if (!grid.classList.contains('sizes-present')) {
1812 doImageLayout(grid, true);
1813 }
1814
1815 Array.from(grid.getElementsByTagName('img')).forEach(image => Util.fadeIn(image));
1816
1817 _Core.Core.showSlideupTitle();
1818
1819 if (!resized && !jsLoaded) {
1820 _Core.Core.hideLoading();
1821 }
1822 });
1823 }
1824 });
1825 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Mosaic');
1826 }; //Mosaic(false);
1827
1828
1829 exports.Mosaic = Mosaic;
1830
1831 /***/ }),
1832
1833 /***/ "../include/js/front-end/src/Layouts/Slider.js":
1834 /*!*****************************************************!*\
1835 !*** ../include/js/front-end/src/Layouts/Slider.js ***!
1836 \*****************************************************/
1837 /*! flagged exports */
1838 /*! export Slider [provided] [no usage info] [missing usage info prevents renaming] */
1839 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1840 /*! export initializeSliders [provided] [no usage info] [missing usage info prevents renaming] */
1841 /*! other exports [not provided] [no usage info] */
1842 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1843 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1844
1845
1846
1847 Object.defineProperty(exports, "__esModule", ({
1848 value: true
1849 }));
1850 exports.initializeSliders = exports.Slider = void 0;
1851
1852 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
1853
1854 var adaptiveHeight = (slideshow, slide, splide) => {
1855 var options = splide.options;
1856 var currentlyActive = splide.index;
1857
1858 if (slide.isWithin(parseInt(currentlyActive), parseInt(options.perPage) - 1)) {
1859 var allSlides = splide.Components.Elements.slides;
1860 var lastVisible = parseInt(currentlyActive) + parseInt(options.perPage);
1861 var visibleSlides = allSlides.slice(currentlyActive, lastVisible);
1862 var maxHeight = 0; // Need requestAnimationFrame, otherwise offsetHeight returns 0 for first photo
1863
1864 requestAnimationFrame(() => {
1865 Array.prototype.forEach.call(visibleSlides, visible => {
1866 var visibleImage = visible.querySelector('img');
1867 var offsetHeight = visibleImage.offsetHeight;
1868
1869 if (visibleImage && offsetHeight > maxHeight) {
1870 maxHeight = offsetHeight;
1871 }
1872 });
1873 slide.slide.style.height = "".concat(maxHeight, "px");
1874 var splideTrack = slideshow.querySelector('.splide__track');
1875 var splideTrackHeight = splideTrack ? splideTrack.offsetHeight : 0;
1876
1877 if (maxHeight !== splideTrackHeight) {
1878 var splideList = slideshow.querySelector('.splide__list');
1879 splideList.style.height = "".concat(maxHeight, "px");
1880 splideTrack.style.height = "".concat(maxHeight, "px");
1881 }
1882 });
1883 }
1884 };
1885
1886 var fixedHeight = (slideshow, splideObj) => {
1887 var maxHeight = 0,
1888 maxAspect = 0,
1889 containerWidth = slideshow.offsetWidth,
1890 children = slideshow.querySelectorAll('.splide__slide img');
1891 Array.prototype.forEach.call(children, img => {
1892 if (img.naturalHeight !== 0) {
1893 var childAspect = img.naturalWidth / img.naturalHeight;
1894
1895 if (childAspect >= maxAspect) {
1896 maxAspect = childAspect;
1897 var heightFactor = img.naturalWidth > containerWidth ? containerWidth / img.naturalWidth : 1;
1898 var cols = parseInt(splideObj.options.perPage, 10);
1899
1900 if (!isNaN(cols) && cols !== 0) {
1901 heightFactor = heightFactor / cols;
1902 }
1903
1904 maxHeight = img.naturalHeight * heightFactor;
1905 }
1906 }
1907 });
1908 Array.prototype.forEach.call(children, img => {
1909 img.style.height = maxHeight + 'px';
1910 });
1911 Array.prototype.forEach.call(slideshow.querySelectorAll('.splide__slide, .splide__list'), slideOrList => {
1912 slideOrList.style.height = maxHeight + 'px';
1913 });
1914 slideshow.style.height = maxHeight + 'px';
1915 };
1916
1917 var Slider = slideshow => {
1918 if (slideshow) {
1919 var content = slideshow.querySelector('.photonic-slideshow-content');
1920
1921 if (content) {
1922 _Core.Core.waitForImages(slideshow).then(() => {
1923 var idStr = '#' + slideshow.getAttribute('id');
1924 var splideThumbs = document.querySelector(idStr + '-thumbs');
1925
1926 if (splideThumbs != null) {
1927 splideThumbs = new Splide(idStr + '-thumbs');
1928 splideThumbs.mount();
1929 }
1930
1931 var splide = new Splide(idStr);
1932 splide.on('mounted resize', function (slide) {
1933 if (slideshow.classList.contains('photonic-slideshow-side-white') || slideshow.classList.contains('photonic-slideshow-start-next')) {
1934 fixedHeight(slideshow, splide);
1935 }
1936 });
1937 splide.on('visible', function (slide) {
1938 if (slideshow.classList.contains('photonic-slideshow-adapt-height')) {
1939 adaptiveHeight(slideshow, slide, splide);
1940 }
1941 });
1942
1943 if (splideThumbs == null) {
1944 splide.mount();
1945 } else {
1946 splide.sync(splideThumbs).mount();
1947 }
1948
1949 slideshow.querySelectorAll('img').forEach(img => {
1950 img.style.display = 'inline';
1951 });
1952 });
1953 }
1954 }
1955 };
1956
1957 exports.Slider = Slider;
1958
1959 var initializeSliders = () => {
1960 var primarySliders = document.querySelectorAll('.photonic-slideshow');
1961
1962 if (typeof Splide != "undefined") {
1963 primarySliders.forEach(slideshow => Slider(slideshow));
1964 } else if (console !== undefined && primarySliders.length > 0) {
1965 console.error('Splide not found! Please ensure that the Splide script is available and loaded before Photonic.');
1966 }
1967 };
1968
1969 exports.initializeSliders = initializeSliders;
1970
1971 /***/ }),
1972
1973 /***/ "../include/js/front-end/src/Lightboxes/LightGallery.js":
1974 /*!**************************************************************!*\
1975 !*** ../include/js/front-end/src/Lightboxes/LightGallery.js ***!
1976 \**************************************************************/
1977 /*! flagged exports */
1978 /*! export PhotonicLightGallery [provided] [no usage info] [missing usage info prevents renaming] */
1979 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1980 /*! other exports [not provided] [no usage info] */
1981 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1982 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1983
1984
1985
1986 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
1987
1988 Object.defineProperty(exports, "__esModule", ({
1989 value: true
1990 }));
1991 exports.PhotonicLightGallery = void 0;
1992
1993 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
1994
1995 var _Lightbox = __webpack_require__(/*! ./Lightbox */ "../include/js/front-end/src/Lightboxes/Lightbox.js");
1996
1997 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js"));
1998
1999 class PhotonicLightGallery extends _Lightbox.Lightbox {
2000 constructor() {
2001 super();
2002 }
2003
2004 soloImages() {
2005 var a = document.querySelectorAll('a[href]');
2006 var solos = Array.from(a).filter(elem => /(\.jpg|\.jpeg|\.bmp|\.gif|\.png)/i.test(elem.getAttribute('href'))).filter(elem => !elem.classList.contains('photonic-lb'));
2007 solos.forEach(solo => {
2008 solo.classList.add("photonic-" + Photonic_JS.lightbox_library);
2009 solo.classList.add(Photonic_JS.lightbox_library);
2010 solo.setAttribute('rel', 'photonic-' + Photonic_JS.lightbox_library);
2011 });
2012 }
2013
2014 changeVideoURL(element, regular, embed) {
2015 element.setAttribute('href', regular);
2016 }
2017
2018 hostedVideo(a) {
2019 var html5 = a.getAttribute('href').match(new RegExp(/(\.mp4|\.webm|\.ogg)/i)),
2020 css = a.classList.contains('photonic-lb');
2021
2022 if (html5 !== null && !css) {
2023 var videoSrc = {
2024 "source": [{
2025 "src": a.getAttribute('href'),
2026 "type": "video/mp4",
2027 "attributes": {
2028 "preload": false,
2029 "playsinline": true,
2030 "controls": true
2031 }
2032 }]
2033 };
2034 a.classList.add(Photonic_JS.lightbox_library + "-html5-video");
2035 a.setAttribute('data-html5-href', a.getAttribute('href'));
2036 a.setAttribute('href', '');
2037 a.setAttribute('data-video', JSON.stringify(videoSrc));
2038 a.setAttribute('data-sub-html', a.getAttribute('title') ? Util.getText(a.getAttribute('title')) : '');
2039 this.videoIndex++;
2040 }
2041 }
2042
2043 initialize(selector, selfSelect) {
2044 this.handleSolos();
2045 var self = this;
2046 var selection;
2047
2048 if (selector instanceof NodeList) {
2049 selection = selector;
2050 } else if (selector instanceof Element) {
2051 selection = [selector];
2052 } else {
2053 selection = document.querySelectorAll(selector);
2054 }
2055
2056 var plugins = Photonic_JS.lg_plugins.split(',');
2057 selection.forEach(function (current) {
2058 var lguid = current.getAttribute('lg-uid');
2059
2060 if (lguid != null && lguid !== '') {
2061 window.lgData[lguid].destroy(true);
2062 }
2063
2064 var thumbs;
2065 thumbs = current.querySelectorAll('a.photonic-lightgallery');
2066 var rel = '';
2067
2068 if (thumbs.length > 0) {
2069 rel = thumbs[0].getAttribute('rel');
2070 }
2071
2072 current.addEventListener('lgAfterSlide', event => {
2073 thumbs = current.querySelectorAll('a.photonic-lightgallery'); // Need to fetch again, since the next line causes issues after "Add More".
2074
2075 var thumb;
2076
2077 if (thumbs.length !== 0) {
2078 thumb = thumbs[event.detail.index];
2079 } else if (current.classList.contains('photonic-lightgallery')) {
2080 thumb = current;
2081 }
2082
2083 var lgId = event.target.getAttribute('data-photonic-lg-uid');
2084
2085 if (thumb != null && lgId != null) {
2086 self.setHash(thumb);
2087 var shareable = {
2088 'url': location.href,
2089 'title': Util.getText(thumb.getAttribute('data-title')),
2090 'image': thumb.getAttribute('href')
2091 };
2092 self.addSocial('#lg-toolbar-' + lgId, shareable);
2093 }
2094 }, false);
2095 current.addEventListener('lgAfterClose', function () {
2096 self.unsetHash();
2097 });
2098 var options = {
2099 selector: selfSelect === undefined || !selfSelect ? 'a[rel="' + rel + '"]' : 'this',
2100 speed: 500,
2101 counter: selfSelect === undefined || !selfSelect,
2102 pause: Photonic_JS.slideshow_interval,
2103 mode: Photonic_JS.lg_transition_effect,
2104 download: Photonic_JS.lg_enable_download,
2105 loop: Photonic_JS.lightbox_loop,
2106 hideBarsDelay: Photonic_JS.lg_hide_bars_delay,
2107 getCaptionFromTitleOrAlt: false,
2108 exThumbImage: 'data-photonic-thumb',
2109 mobileSettings: {
2110 controls: Photonic_JS.lg_mobile_controls,
2111 showCloseIcon: Photonic_JS.lg_mobile_close,
2112 download: Photonic_JS.lg_mobile_download
2113 }
2114 };
2115 var lgPlugins = [lgVideo];
2116
2117 if (plugins.indexOf('thumbnail') > -1) {
2118 lgPlugins.push(lgThumbnail);
2119 options.thumbnail = true;
2120 }
2121
2122 if (plugins.indexOf('zoom') > -1) {
2123 lgPlugins.push(lgZoom);
2124 }
2125
2126 if (plugins.indexOf('fullscreen') > -1) {
2127 lgPlugins.push(lgFullscreen);
2128 }
2129
2130 if (plugins.indexOf('autoplay') > -1) {
2131 lgPlugins.push(lgAutoplay);
2132 options.slideShowInterval = Photonic_JS.lg_transition_speed;
2133 }
2134
2135 options.plugins = lgPlugins;
2136 var lightbox = lightGallery(current, options);
2137
2138 if (!selfSelect === undefined || !selfSelect) {
2139 _Core.Core.addToLightboxList(rel, lightbox);
2140 }
2141
2142 current.setAttribute('data-photonic-lg-uid', lightbox.lgId);
2143 });
2144 }
2145
2146 initializeForNewContainer(containerId) {
2147 this.initialize(containerId);
2148 }
2149
2150 }
2151
2152 exports.PhotonicLightGallery = PhotonicLightGallery;
2153
2154 /***/ }),
2155
2156 /***/ "../include/js/front-end/src/Lightboxes/Lightbox.js":
2157 /*!**********************************************************!*\
2158 !*** ../include/js/front-end/src/Lightboxes/Lightbox.js ***!
2159 \**********************************************************/
2160 /*! flagged exports */
2161 /*! export Lightbox [provided] [no usage info] [missing usage info prevents renaming] */
2162 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2163 /*! other exports [not provided] [no usage info] */
2164 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2165 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2166
2167
2168
2169 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2170
2171 Object.defineProperty(exports, "__esModule", ({
2172 value: true
2173 }));
2174 exports.Lightbox = void 0;
2175
2176 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../../../node_modules/@babel/runtime/helpers/defineProperty.js"));
2177
2178 class Lightbox {
2179 constructor() {
2180 (0, _defineProperty2.default)(this, "deep", void 0);
2181 (0, _defineProperty2.default)(this, "lastDeep", void 0);
2182 this.socialIcons = "<div id='photonic-social'>" + "<a class='photonic-share-fb' href='https://www.facebook.com/sharer/sharer.php?u={photonic_share_link}&amp;title={photonic_share_title}&amp;picture={photonic_share_image}' target='_blank' title='Share on Facebook'><div class='icon-facebook'></div></a>" + "<a class='photonic-share-twitter' href='https://twitter.com/share?url={photonic_share_link}&amp;text={photonic_share_title}' target='_blank' title='Share on Twitter'><div class='icon-twitter'></div></a>" + "<a class='photonic-share-pinterest' data-pin-do='buttonPin' href='https://www.pinterest.com/pin/create/button/?url={photonic_share_link}&media={photonic_share_image}&description={photonic_share_title}' data-pin-custom='true' target='_blank' title='Share on Pinterest'><div class='icon-pinterest'></div></a>" + "</div>";
2183 this.videoIndex = 1;
2184 }
2185
2186 getVideoSize(url, baseline) {
2187 return new Promise(resolve => {
2188 // create the video element
2189 var video = document.createElement('video'); // place a listener on it
2190
2191 video.addEventListener("loadedmetadata", function () {
2192 // retrieve dimensions
2193 var height = this.videoHeight,
2194 width = this.videoWidth;
2195 var videoAspectRatio = this.videoWidth / this.videoHeight,
2196 baseAspectRatio = baseline.width / baseline.height;
2197 var newWidth, newHeight;
2198
2199 if (baseAspectRatio > videoAspectRatio) {
2200 // Window is wider than it needs to be ... constrain by window height
2201 newHeight = baseline.height;
2202 newWidth = width * newHeight / height;
2203 } else {
2204 // Window is narrower than it needs to be ... constrain by window width
2205 newWidth = baseline.width;
2206 newHeight = height * newWidth / width;
2207 } // send back result
2208
2209
2210 resolve({
2211 height: height,
2212 width: width,
2213 newHeight: newHeight,
2214 newWidth: newWidth
2215 });
2216 }, false); // start download meta-data
2217
2218 video.src = url;
2219 });
2220 }
2221
2222 getImageSize(url, baseline) {
2223 return new Promise(function (resolve) {
2224 var image = document.createElement('img'); // place a listener on it
2225
2226 image.addEventListener("load", function () {
2227 // retrieve dimensions
2228 var height = this.height,
2229 width = this.width,
2230 imageAspectRatio = this.width / this.height,
2231 baseAspectRatio = baseline.width / baseline.height;
2232 var newWidth, newHeight;
2233
2234 if (baseAspectRatio > imageAspectRatio) {
2235 // Window is wider than it needs to be ... constrain by window height
2236 newHeight = baseline.height;
2237 newWidth = width * newHeight / height;
2238 } else {
2239 // Window is narrower than it needs to be ... constrain by window width
2240 newWidth = baseline.width;
2241 newHeight = height * newWidth / width;
2242 } // send back result
2243
2244
2245 resolve({
2246 height: height,
2247 width: width,
2248 newHeight: newHeight,
2249 newWidth: newWidth
2250 });
2251 }, false); // start download meta-data
2252
2253 image.src = url;
2254 });
2255 }
2256
2257 addSocial(selector, shareable, position) {
2258 if ((Photonic_JS.social_media === undefined || Photonic_JS.social_media === '') && shareable['buy'] === undefined) {
2259 return;
2260 }
2261
2262 var socialEl = document.getElementById('photonic-social');
2263
2264 if (socialEl !== null) {
2265 socialEl.parentNode.removeChild(socialEl);
2266 }
2267
2268 var addTo;
2269
2270 if (position === undefined || position === null) {
2271 addTo = 'beforeend';
2272 } else {
2273 addTo = position;
2274 }
2275
2276 if (location.hash !== '') {
2277 var social = this.socialIcons.replace(/{photonic_share_link}/g, encodeURIComponent(shareable['url'])).replace(/{photonic_share_title}/g, encodeURIComponent(shareable['title'])).replace(/{photonic_share_image}/g, encodeURIComponent(shareable['image']));
2278 var selectorEl;
2279
2280 if (typeof selector === 'string') {
2281 selectorEl = document.documentElement.querySelector(selector);
2282 } else {
2283 selectorEl = selector;
2284 }
2285
2286 if (selectorEl !== null) {
2287 selectorEl.insertAdjacentHTML(addTo, social);
2288 }
2289
2290 if (Photonic_JS.social_media === undefined || Photonic_JS.social_media === '') {
2291 var socialMediaIcons = document.documentElement.querySelectorAll('.photonic-share-fb, .photonic-share-twitter, .photonic-share-pinterest');
2292 Array.prototype.forEach.call(socialMediaIcons, function (socialIcon) {
2293 socialIcon.parentNode.removeChild(socialIcon);
2294 });
2295 }
2296 }
2297 }
2298
2299 setHash(a) {
2300 if (Photonic_JS.deep_linking === undefined || Photonic_JS.deep_linking === 'none' || a === null || a === undefined) {
2301 return;
2302 }
2303
2304 var hash = typeof a === 'string' ? a : a.getAttribute('data-photonic-deep');
2305
2306 if (hash === undefined) {
2307 return;
2308 }
2309
2310 if (typeof window.history.pushState === 'function' && Photonic_JS.deep_linking === 'yes-history') {
2311 window.history.pushState({}, document.title, '#' + hash);
2312 } else if (typeof window.history.replaceState === 'function' && Photonic_JS.deep_linking === 'no-history') {
2313 window.history.replaceState({}, document.title, '#' + hash);
2314 } else {
2315 document.location.hash = hash;
2316 }
2317 }
2318
2319 unsetHash() {
2320 this.lastDeep = this.lastDeep === undefined || this.deep !== '' ? location.hash : this.lastDeep;
2321
2322 if (window.history && 'replaceState' in window.history) {
2323 history.replaceState({}, document.title, location.href.substr(0, location.href.length - location.hash.length));
2324 } else {
2325 window.location.hash = '';
2326 }
2327 }
2328
2329 changeHash(e) {
2330 if (e.type === 'load') {
2331 var hash = window.location.hash;
2332 hash = hash.substr(1);
2333
2334 if (hash && hash !== '') {
2335 var allMatches = document.querySelectorAll('[data-photonic-deep="' + hash + '"]');
2336
2337 if (allMatches.length > 0) {
2338 var thumbToClick = allMatches[0];
2339 var event = document.createEvent('HTMLEvents');
2340 event.initEvent('click', true, false);
2341 thumbToClick.dispatchEvent(event);
2342 }
2343 }
2344 } else {
2345 var node = this.deep;
2346
2347 if (node != null) {
2348 if (node.length > 1) {
2349 if (window.location.hash && node.indexOf('#access_token=') !== -1) {
2350 this.unsetHash();
2351 } else {
2352 node = node.substr(1);
2353
2354 var _allMatches = document.querySelectorAll('[data-photonic-deep="' + node + '"]');
2355
2356 if (_allMatches.length > 0) {
2357 var _thumbToClick = _allMatches[0];
2358
2359 var _event = document.createEvent('HTMLEvents');
2360
2361 _event.initEvent('click', true, false);
2362
2363 _thumbToClick.dispatchEvent(_event);
2364
2365 this.setHash(node);
2366 }
2367 }
2368 }
2369 }
2370 }
2371 }
2372
2373 catchYouTubeURL(url) {
2374 var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*)(?:(\?t|&t|\?start|&start)=(\d+))?.*/,
2375 match = url.match(regExp);
2376
2377 if (match && match[2].length === 11) {
2378 var obj = {
2379 url: match[2]
2380 };
2381
2382 if (match[4] !== undefined) {
2383 obj.timestamp = match[4];
2384 }
2385
2386 return obj;
2387 }
2388 }
2389
2390 catchVimeoURL(url) {
2391 var regExp = /(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/,
2392 match = url.match(regExp);
2393
2394 if (match) {
2395 return match[1];
2396 }
2397 }
2398
2399 soloImages() {
2400 var a = document.querySelectorAll('a[href]');
2401 var solos = Array.from(a).filter(elem => /(\.jpg|\.jpeg|\.bmp|\.gif|\.png)/i.test(elem.getAttribute('href'))).filter(elem => !elem.classList.contains('photonic-lb'));
2402 solos.forEach(solo => {
2403 solo.classList.add("photonic-" + Photonic_JS.lightbox_library);
2404 solo.classList.add("photonic-" + Photonic_JS.lightbox_library + '-solo');
2405 solo.classList.add(Photonic_JS.lightbox_library);
2406 });
2407 return solos;
2408 }
2409
2410 changeVideoURL(element, regular, embed, poster) {// Implemented in individual lightboxes. Empty for unsupported lightboxes
2411 }
2412
2413 hostedVideo(a) {// Implemented in individual lightboxes. Empty for unsupported lightboxes
2414 }
2415
2416 soloVideos() {
2417 var self = this;
2418
2419 if (Photonic_JS.lightbox_for_videos) {
2420 var a = document.querySelectorAll('a[href]');
2421 a.forEach(function (anchor) {
2422 var regular, embed, poster;
2423 var href = anchor.getAttribute('href'),
2424 youTube = self.catchYouTubeURL(href),
2425 vimeo = self.catchVimeoURL(href);
2426
2427 if (youTube !== undefined) {
2428 var ytSrc = youTube.url,
2429 ytTimeStamp = youTube.timestamp,
2430 regularT = '',
2431 embedT = '';
2432
2433 if (ytTimeStamp !== undefined) {
2434 regularT = '&t=' + ytTimeStamp;
2435 embedT = '?start=' + ytTimeStamp;
2436 }
2437
2438 regular = 'https://youtube.com/watch?v=' + ytSrc + regularT;
2439 embed = 'https://youtube.com/embed/' + ytSrc + embedT;
2440 poster = 'https://img.youtube.com/vi/' + ytSrc + '/hddefault.jpg';
2441 } else if (vimeo !== undefined) {
2442 regular = 'https://vimeo.com/' + vimeo;
2443 embed = 'https://player.vimeo.com/video/' + vimeo;
2444 }
2445
2446 if (regular !== undefined) {
2447 anchor.classList.add(Photonic_JS.lightbox_library + "-video");
2448 self.changeVideoURL(anchor, regular, embed, poster);
2449 self.modifyAdditionalVideoProperties(anchor);
2450 }
2451
2452 self.hostedVideo(anchor);
2453 });
2454 }
2455 }
2456
2457 handleSolos() {
2458 if (Photonic_JS.lightbox_for_all) {
2459 this.soloImages();
2460 }
2461
2462 this.soloVideos();
2463
2464 if (Photonic_JS.deep_linking !== undefined && Photonic_JS.deep_linking !== 'none') {
2465 window.addEventListener('load', this.changeHash);
2466 window.addEventListener('hashchange', this.changeHash);
2467 }
2468 }
2469
2470 initialize() {
2471 this.handleSolos(); // Implemented by child classes
2472 }
2473
2474 initializeForNewContainer(containerId) {// Implemented by individual lightboxes. Empty for cases where not required
2475 }
2476
2477 initializeForExisting() {// Implemented by child classes
2478 }
2479
2480 modifyAdditionalVideoProperties(anchor) {// Implemented by individual lightboxes. Empty for cases where not required
2481 }
2482
2483 }
2484
2485 exports.Lightbox = Lightbox;
2486
2487 /***/ }),
2488
2489 /***/ "../include/js/front-end/src/Listeners.js":
2490 /*!************************************************!*\
2491 !*** ../include/js/front-end/src/Listeners.js ***!
2492 \************************************************/
2493 /*! flagged exports */
2494 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2495 /*! export addAllListeners [provided] [no usage info] [missing usage info prevents renaming] */
2496 /*! export addHelperMoreButtonListener [provided] [no usage info] [missing usage info prevents renaming] */
2497 /*! export addLazyLoadListener [provided] [no usage info] [missing usage info prevents renaming] */
2498 /*! export addLevel2ClickListener [provided] [no usage info] [missing usage info prevents renaming] */
2499 /*! export addLevel3ExpandListener [provided] [no usage info] [missing usage info prevents renaming] */
2500 /*! export addMoreButtonListener [provided] [no usage info] [missing usage info prevents renaming] */
2501 /*! export addPasswordSubmitListener [provided] [no usage info] [missing usage info prevents renaming] */
2502 /*! export addSlideUpEnterListener [provided] [no usage info] [missing usage info prevents renaming] */
2503 /*! export addSlideUpLeaveListener [provided] [no usage info] [missing usage info prevents renaming] */
2504 /*! other exports [not provided] [no usage info] */
2505 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2506 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2507
2508
2509
2510 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
2511
2512 Object.defineProperty(exports, "__esModule", ({
2513 value: true
2514 }));
2515 exports.addAllListeners = exports.addLazyLoadListener = exports.addSlideUpLeaveListener = exports.addSlideUpEnterListener = exports.addHelperMoreButtonListener = exports.addMoreButtonListener = exports.addLevel3ExpandListener = exports.addPasswordSubmitListener = exports.addLevel2ClickListener = void 0;
2516
2517 var _Core = __webpack_require__(/*! ./Core */ "../include/js/front-end/src/Core.js");
2518
2519 var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js"));
2520
2521 var Requests = _interopRequireWildcard(__webpack_require__(/*! ./Requests */ "../include/js/front-end/src/Requests.js"));
2522
2523 var _Justified = __webpack_require__(/*! ./Layouts/Justified */ "../include/js/front-end/src/Layouts/Justified.js");
2524
2525 var _Mosaic = __webpack_require__(/*! ./Layouts/Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js");
2526
2527 var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js");
2528
2529 var _MasonryHorizontal = __webpack_require__(/*! ./Layouts/MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js");
2530
2531 // .photonic-level-2-thumb:not(".gallery-page")
2532 var addLevel2ClickListener = () => {
2533 document.addEventListener('click', e => {
2534 if (!(e.target instanceof Element) || !e.target.closest('.photonic-level-2-thumb') || Photonic_JS.lightbox_library === 'none') {
2535 return;
2536 }
2537
2538 var clicked = e.target.closest('.photonic-level-2-thumb');
2539
2540 if (Util.hasClass(clicked, 'gallery-page')) {
2541 return;
2542 }
2543
2544 e.preventDefault();
2545 var container = clicked.closest('.photonic-level-2-container');
2546 var galleryData = JSON.parse(container.getAttribute('data-photonic'));
2547 var provider = galleryData['platform'],
2548 singular = galleryData['singular'],
2549 query = container.getAttribute('data-photonic-query');
2550 var args = {
2551 "panel_id": clicked.getAttribute('id'),
2552 "popup": galleryData['popup'],
2553 "photo_count": galleryData['photo-count'],
2554 "photo_more": galleryData['photo-more'] || '',
2555 "query": query
2556 };
2557 if (provider === 'google' || provider === 'zenfolio') args.thumb_size = galleryData['thumb-size'];
2558
2559 if (provider === 'flickr' || provider === 'smug' || provider === 'google' || provider === 'zenfolio') {
2560 args.overlay_size = galleryData['overlay-size'];
2561 args.overlay_video_size = galleryData['overlay-video-size'];
2562 }
2563
2564 if (provider === 'google') {
2565 args.overlay_crop = galleryData['overlay-crop'];
2566 }
2567
2568 Requests.displayLevel2(provider, singular, args);
2569 }, false);
2570 }; // .photonic-password-submit
2571
2572
2573 exports.addLevel2ClickListener = addLevel2ClickListener;
2574
2575 var addPasswordSubmitListener = () => {
2576 document.addEventListener('click', e => {
2577 if (!(e.target instanceof Element) || !e.target.closest('.photonic-password-submit')) {
2578 return;
2579 }
2580
2581 e.preventDefault();
2582 var clicked = e.target.closest('.photonic-password-submit');
2583 var modal = clicked.closest('.photonic-password-prompter'),
2584 container = clicked.closest('.photonic-level-2-container');
2585 var galleryData = JSON.parse(container.getAttribute('data-photonic'));
2586 var album_id = modal.getAttribute('id');
2587 var components = album_id.split('-');
2588 var provider = galleryData['platform'],
2589 singular_type = galleryData['singular'],
2590 album_key = components.slice(4).join('-'),
2591 thumb_id = "photonic-".concat(provider, "-").concat(singular_type, "-thumb-").concat(album_key),
2592 thumb = document.getElementById("".concat(thumb_id)),
2593 query = container.getAttribute('data-photonic-query');
2594 var password = modal.querySelector('input[name="photonic-' + provider + '-password"]');
2595 password = password.value;
2596
2597 var prompter = _Core.Core.prompterList["#photonic-".concat(provider, "-").concat(singular_type, "-prompter-").concat(album_key)];
2598
2599 if (prompter !== undefined && prompter !== null) {
2600 prompter.hide();
2601 }
2602
2603 _Core.Core.showSpinner();
2604
2605 var args = {
2606 'panel_id': thumb_id,
2607 "popup": galleryData['popup'],
2608 "photo_count": galleryData['photo-count'],
2609 "photo_more": galleryData['photo-more'] || '',
2610 "query": query
2611 };
2612
2613 if (provider === 'smug') {
2614 args.password = password;
2615 args.overlay_size = galleryData['overlay-size'];
2616 } else if (provider === 'zenfolio') {
2617 args.password = password;
2618 args.realm_id = thumb.getAttribute('data-photonic-realm');
2619 args.thumb_size = galleryData['thumb-size'];
2620 args.overlay_size = galleryData['overlay-size'];
2621 args.overlay_video_size = galleryData['overlay-video-size'];
2622 }
2623
2624 Requests.processRequest(provider, singular_type, album_key, args);
2625 }, false);
2626 }; // a.photonic-level-3-expand
2627
2628
2629 exports.addPasswordSubmitListener = addPasswordSubmitListener;
2630
2631 var addLevel3ExpandListener = () => {
2632 document.addEventListener('click', e => {
2633 if (!(e.target instanceof Element) || !e.target.closest('a.photonic-level-3-expand')) {
2634 return;
2635 }
2636
2637 e.preventDefault();
2638 var current = e.target.closest('a.photonic-level-3-expand'),
2639 header = current.parentNode.parentNode.parentNode,
2640 stream = header.parentNode;
2641
2642 if (current.classList.contains('photonic-level-3-expand-plus')) {
2643 Requests.processL3Request(current, header, {
2644 'view': 'collections',
2645 'node': current.getAttribute('data-photonic-level-3'),
2646 'layout': current.getAttribute('data-photonic-layout'),
2647 'stream': stream.getAttribute('id')
2648 });
2649 } else if (current.classList.contains('photonic-level-3-expand-up')) {
2650 var display = Util.next(header, '.photonic-stream');
2651 Util.slideUpDown(display, 'hide');
2652 current.classList.remove('photonic-level-3-expand-up');
2653 current.classList.add('photonic-level-3-expand-down');
2654 current.setAttribute('title', Photonic_JS.maximize_panel === undefined ? 'Show' : Photonic_JS.maximize_panel);
2655 } else if (current.classList.contains('photonic-level-3-expand-down')) {
2656 var _display = Util.next(header, '.photonic-stream'); // Util.slideDown(display);
2657
2658
2659 Util.slideUpDown(_display, 'show');
2660 current.classList.remove('photonic-level-3-expand-down');
2661 current.classList.add('photonic-level-3-expand-up');
2662 current.setAttribute('title', Photonic_JS.minimize_panel === undefined ? 'Hide' : Photonic_JS.minimize_panel);
2663 }
2664 }, false);
2665 }; // a.photonic-more-button.photonic-more-dynamic
2666
2667
2668 exports.addLevel3ExpandListener = addLevel3ExpandListener;
2669
2670 var addMoreButtonListener = () => {
2671 document.addEventListener('click', e => {
2672 if (!(e.target instanceof Element) || !e.target.closest('a.photonic-more-button.photonic-more-dynamic')) {
2673 return;
2674 }
2675
2676 e.preventDefault();
2677 var clicked = e.target.closest('a.photonic-more-button.photonic-more-dynamic');
2678 var container = clicked.parentNode.querySelector('.photonic-level-1-container, .photonic-level-2-container');
2679 var query = container.getAttribute('data-photonic-query'),
2680 provider = container.getAttribute('data-photonic-platform'),
2681 level = container.classList.contains('photonic-level-1-container') ? 'level-1' : 'level-2',
2682 containerId = container.getAttribute('id'),
2683 existing = container.querySelectorAll('figure');
2684
2685 _Core.Core.showSpinner();
2686
2687 Util.post(Photonic_JS.ajaxurl, {
2688 'action': 'photonic_load_more',
2689 'provider': provider,
2690 'query': query
2691 }, data => {
2692 var ret = Util.getElement(data),
2693 images = ret.querySelectorAll(".photonic-".concat(level)),
2694 more_button = ret.querySelector('.photonic-more-button'),
2695 one_existing = container.querySelector('a.photonic-lb');
2696 var anchors = [];
2697
2698 if (one_existing !== null) {
2699 images.forEach(image => {
2700 var a = image.querySelector('a');
2701
2702 if (a !== null) {
2703 a.setAttribute('rel', one_existing.getAttribute('rel'));
2704
2705 if (a.getAttribute('data-fancybox') != null) {
2706 a.setAttribute('data-fancybox', one_existing.getAttribute('data-fancybox'));
2707 } else if (a.getAttribute('data-rel') != null) {
2708 a.setAttribute('data-rel', one_existing.getAttribute('data-rel'));
2709 } else if (a.getAttribute('data-strip-group') != null) {
2710 a.setAttribute('data-strip-group', one_existing.getAttribute('data-strip-group'));
2711 } else if (a.getAttribute('data-gall') != null) {
2712 a.setAttribute('data-gall', one_existing.getAttribute('data-gall'));
2713 }
2714
2715 anchors.push(a);
2716 }
2717 });
2718 } // Can't do this above, which is only for L1
2719
2720
2721 images.forEach(image => container.appendChild(image));
2722
2723 _Core.Core.moveHTML5External();
2724
2725 if (images.length === 0) {
2726 _Core.Core.hideLoading();
2727
2728 Util.fadeOut(clicked);
2729 clicked.remove();
2730 }
2731
2732 var lightbox = _Core.Core.getLightbox();
2733
2734 if (Photonic_JS.lightbox_library === 'imagelightbox') {
2735 if (one_existing != null) {
2736 lightbox = _Core.Core.getLightboxList()['a[rel="' + one_existing.getAttribute('rel') + '"]'];
2737
2738 if (level === 'level-1') {
2739 lightbox.addToImageLightbox(anchors);
2740 }
2741 }
2742 } else if (Photonic_JS.lightbox_library === 'lightcase') {
2743 if (one_existing != null) {
2744 lightbox.initialize('a[data-rel="' + one_existing.getAttribute('data-rel') + '"]');
2745 }
2746 } else if (Photonic_JS.lightbox_library === 'lightgallery') {
2747 if (one_existing !== null) {
2748 lightbox = _Core.Core.getLightboxList()[one_existing.getAttribute('rel')];
2749 var galleryItems = [...lightbox.galleryItems];
2750 images.forEach(image => {
2751 var a = image.querySelector('a');
2752 var img = a.querySelector('img');
2753 var videoAttr;
2754
2755 if (a.getAttribute('data-photonic-media-type') === 'video') {
2756 videoAttr = JSON.parse(a.getAttribute('data-video'));
2757 }
2758
2759 galleryItems.push({
2760 "alt": img.getAttribute('alt'),
2761 "downloadUrl": a.getAttribute('data-download-url'),
2762 "src": a.getAttribute('data-photonic-media-type') === 'video' ? videoAttr.source[0].src : a.getAttribute('href'),
2763 "subHtml": a.getAttribute('data-sub-html'),
2764 "thumb": img.getAttribute('src')
2765 });
2766 });
2767 lightbox.updateSlides(galleryItems, 0);
2768 lightbox.refresh();
2769 } else {
2770 lightbox.initialize(container);
2771 }
2772 } else if (Photonic_JS.lightbox_library === 'venobox') {
2773 if (one_existing !== null) {
2774 var gallId = one_existing.getAttribute('data-gall');
2775
2776 if (one_existing.closest('.photonic-panel')) {
2777 gallId = one_existing.closest('.photonic-panel').getAttribute('id');
2778 }
2779
2780 lightbox.initialize('#' + gallId, true);
2781 }
2782 } else if (['bigpicture', 'featherlight', 'glightbox', 'spotlight'].includes(Photonic_JS.lightbox_library)) {
2783 lightbox.initialize(container);
2784 } else if (Photonic_JS.lightbox_library === 'baguettebox') {
2785 lightbox.initialize(null, true);
2786 } else if (Photonic_JS.lightbox_library === 'fancybox3') {
2787 if (one_existing != null) {
2788 lightbox.initialize(null, one_existing.getAttribute('data-fancybox'));
2789 }
2790 } else if (Photonic_JS.lightbox_library === 'photoswipe') {
2791 lightbox.initialize();
2792 }
2793
2794 function doImageLayout(images) {
2795 var new_query = ret.querySelector('.photonic-random-layout,.photonic-standard-layout,.photonic-masonry-layout,.photonic-mosaic-layout,.modal-gallery');
2796
2797 if (new_query != null) {
2798 container.setAttribute('data-photonic-query', new_query.getAttribute('data-photonic-query'));
2799 }
2800
2801 if (more_button == null) {
2802 Util.fadeOut(clicked);
2803 clicked.remove();
2804 }
2805
2806 if (Util.hasClass(container, 'photonic-mosaic-layout')) {
2807 (0, _Mosaic.Mosaic)(false, false, '#' + containerId);
2808 } else if (Util.hasClass(container, 'photonic-random-layout')) {
2809 (0, _Justified.JustifiedGrid)(false, false, '#' + containerId, lightbox);
2810 } else if (Util.hasClass(container, 'photonic-masonry-layout')) {
2811 images.forEach(image => {
2812 var img = image.querySelector('img');
2813 Util.fadeIn(img);
2814 img.style.display = 'block';
2815 });
2816
2817 _Core.Core.hideLoading();
2818 } else if (Util.hasClass(container, 'photonic-masonry-horizontal-layout')) {
2819 var existingCount = existing.length;
2820 images.forEach((image, idx) => {
2821 image.setAttribute('data-photonic-idx', existingCount + idx); // const img = image.querySelector('img');
2822 // Util.fadeIn(img);
2823 // img.style.display = 'block';
2824 });
2825 (0, _MasonryHorizontal.MasonryHorizontal)(false, false, '#' + containerId);
2826
2827 _Core.Core.hideLoading();
2828 } else {
2829 container.querySelectorAll('.photonic-' + level).forEach(el => {
2830 el.style.display = 'inline-block';
2831 });
2832
2833 _Core.Core.standardizeTitleWidths();
2834
2835 _Core.Core.hideLoading();
2836 }
2837
2838 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
2839 }
2840
2841 if (container.classList.contains('sizes-present')) {
2842 _Core.Core.watchForImages(images);
2843
2844 doImageLayout(images);
2845 } else {
2846 _Core.Core.waitForImages(images).then(() => {
2847 doImageLayout(images);
2848 });
2849 }
2850 });
2851 });
2852 }; // input[type="button"].photonic-helper-more
2853
2854
2855 exports.addMoreButtonListener = addMoreButtonListener;
2856
2857 var addHelperMoreButtonListener = () => {
2858 document.addEventListener('click', e => {
2859 if (!(e.target instanceof Element) || !e.target.closest('input[type="button"].photonic-helper-more')) {
2860 return;
2861 }
2862
2863 e.preventDefault();
2864
2865 _Core.Core.showSpinner();
2866
2867 var clicked = e.target.closest('input[type="button"].photonic-helper-more');
2868 var table = clicked.closest('table');
2869 var nextToken = clicked.getAttribute('data-photonic-token') === undefined ? null : clicked.getAttribute('data-photonic-token'),
2870 provider = clicked.getAttribute('data-photonic-platform'),
2871 accessType = clicked.getAttribute('data-photonic-access');
2872 var args = {
2873 'action': 'photonic_helper_shortcode_more',
2874 'provider': provider,
2875 'access': accessType
2876 };
2877
2878 if (nextToken) {
2879 args.nextPageToken = nextToken;
2880 }
2881
2882 if (provider === 'google') {
2883 Util.post(Photonic_JS.ajaxurl, args, data => {
2884 var ret = Util.getElement(data);
2885 ret = Array.from(ret.getElementsByTagName('tr'));
2886
2887 if (ret.length > 0) {
2888 var tr = clicked.closest('tr');
2889
2890 if (tr) {
2891 tr.remove();
2892 }
2893
2894 ret.forEach((node, i) => {
2895 if (i !== 0) {
2896 table.appendChild(node);
2897 }
2898 });
2899 }
2900
2901 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
2902
2903 _Core.Core.hideLoading();
2904 });
2905 }
2906 });
2907 };
2908
2909 exports.addHelperMoreButtonListener = addHelperMoreButtonListener;
2910
2911 var addSlideUpEnterListener = () => {
2912 document.addEventListener('mouseover', e => {
2913 var slideup = '.title-display-hover-slideup-show a, .photonic-slideshow.title-display-hover-slideup-show li';
2914
2915 if (e.target instanceof Element && e.target.closest(slideup)) {
2916 var node = e.target.closest(slideup);
2917 var title = node.querySelector('.photonic-title');
2918 Util.slideUpTitle(title, 'show');
2919 node.setAttribute('title', '');
2920 }
2921 }, true);
2922 };
2923
2924 exports.addSlideUpEnterListener = addSlideUpEnterListener;
2925
2926 var addSlideUpLeaveListener = () => {
2927 document.addEventListener('mouseout', e => {
2928 var slideup = '.title-display-hover-slideup-show a, .photonic-slideshow.title-display-hover-slideup-show li';
2929
2930 if (e.target instanceof Element && e.target.closest(slideup)) {
2931 var node = e.target.closest(slideup);
2932 var title = node.querySelector('.photonic-title');
2933 Util.slideUpTitle(title, 'hide');
2934 node.setAttribute('title', Util.getText(node.getAttribute('data-title')));
2935 }
2936 }, true);
2937 };
2938
2939 exports.addSlideUpLeaveListener = addSlideUpLeaveListener;
2940
2941 var addLazyLoadListener = () => {
2942 var buttons = document.documentElement.querySelectorAll('input.photonic-show-gallery-button');
2943 Array.prototype.forEach.call(buttons, button => {
2944 button.addEventListener('click', Requests.lazyLoad);
2945 });
2946 buttons = document.documentElement.querySelectorAll('input.photonic-js-load-button');
2947 Array.prototype.forEach.call(buttons, button => {
2948 button.addEventListener('click', Requests.lazyLoad);
2949 button.click();
2950 });
2951 };
2952
2953 exports.addLazyLoadListener = addLazyLoadListener;
2954
2955 var addAllListeners = () => {
2956 addLevel2ClickListener();
2957 addPasswordSubmitListener();
2958 addLevel3ExpandListener();
2959 addMoreButtonListener();
2960 addHelperMoreButtonListener();
2961 addSlideUpEnterListener();
2962 addSlideUpLeaveListener();
2963 addLazyLoadListener();
2964 };
2965
2966 exports.addAllListeners = addAllListeners;
2967
2968 /***/ }),
2969
2970 /***/ "../include/js/front-end/src/Requests.js":
2971 /*!***********************************************!*\
2972 !*** ../include/js/front-end/src/Requests.js ***!
2973 \***********************************************/
2974 /*! flagged exports */
2975 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2976 /*! export displayLevel2 [provided] [no usage info] [missing usage info prevents renaming] */
2977 /*! export lazyLoad [provided] [no usage info] [missing usage info prevents renaming] */
2978 /*! export processL3Request [provided] [no usage info] [missing usage info prevents renaming] */
2979 /*! export processRequest [provided] [no usage info] [missing usage info prevents renaming] */
2980 /*! other exports [not provided] [no usage info] */
2981 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2982 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2983
2984
2985
2986 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
2987
2988 Object.defineProperty(exports, "__esModule", ({
2989 value: true
2990 }));
2991 exports.lazyLoad = exports.processL3Request = exports.displayLevel2 = exports.processRequest = void 0;
2992
2993 var _Core = __webpack_require__(/*! ./Core */ "../include/js/front-end/src/Core.js");
2994
2995 var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js"));
2996
2997 var _Justified = __webpack_require__(/*! ./Layouts/Justified */ "../include/js/front-end/src/Layouts/Justified.js");
2998
2999 var _Masonry = __webpack_require__(/*! ./Layouts/Masonry */ "../include/js/front-end/src/Layouts/Masonry.js");
3000
3001 var _MasonryHorizontal = __webpack_require__(/*! ./Layouts/MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js");
3002
3003 var _Mosaic = __webpack_require__(/*! ./Layouts/Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js");
3004
3005 var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js");
3006
3007 var _Modal = __webpack_require__(/*! ./Components/Modal */ "../include/js/front-end/src/Components/Modal.js");
3008
3009 var spinners = 0;
3010
3011 var bypassPopup = data => {
3012 _Core.Core.hideLoading();
3013
3014 var panel;
3015
3016 if (data instanceof Element) {
3017 panel = data;
3018 } else {
3019 panel = Util.getElement(data).firstElementChild;
3020 }
3021
3022 Util.hide(panel);
3023 var images = panel.querySelectorAll('img');
3024 images.forEach(image => {
3025 if ((image.getAttribute('src') === null || image.getAttribute('src') === '') && image.getAttribute('data-src') !== null) {
3026 image.setAttribute('src', image.getAttribute('data-src'));
3027 image.removeAttribute('data-src');
3028 }
3029 });
3030 document.body.appendChild(panel);
3031
3032 _Core.Core.moveHTML5External();
3033
3034 var lightbox = _Core.Core.getLightbox();
3035
3036 if (lightbox !== undefined && lightbox !== null) {
3037 lightbox.initializeForNewContainer('#' + panel.getAttribute('id'));
3038 }
3039
3040 var thumbs = panel.querySelectorAll('.photonic-lb');
3041
3042 if (thumbs.length > 0) {
3043 _Core.Core.setDeep('#' + thumbs[0].getAttribute('data-photonic-deep'));
3044
3045 var evt = new MouseEvent('click', {
3046 bubbles: true,
3047 cancelable: true,
3048 view: window
3049 }); // If cancelled, don't dispatch our event
3050
3051 !thumbs[0].dispatchEvent(evt);
3052 }
3053 };
3054
3055 var displayPopup = (data, provider, popup, panelId) => {
3056 var safePanelId = panelId.replace('.', '\\.'); // FOR EXISTING ELEMENTS WHICH NEED SANITIZED PANELID
3057
3058 var div = Util.getElement(data).firstElementChild;
3059 var grid = div.querySelector('.modal-gallery');
3060
3061 var doImageLayout = () => {
3062 var popupPanel = document.querySelector('#photonic-' + provider + '-' + popup + '-' + safePanelId);
3063
3064 if (popupPanel) {
3065 popupPanel.appendChild(div);
3066 Util.show(popupPanel);
3067 }
3068
3069 (0, _Modal.Modal)(div, {
3070 modalTarget: 'photonic-' + provider + '-panel-' + safePanelId,
3071 color: '#000',
3072 width: Photonic_JS.gallery_panel_width + '%',
3073 closeFromRight: (100 - Photonic_JS.gallery_panel_width) / 2 + '%'
3074 });
3075
3076 _Core.Core.moveHTML5External();
3077
3078 var lightbox = _Core.Core.getLightbox();
3079
3080 if (lightbox !== undefined && lightbox !== null) {
3081 lightbox.initializeForNewContainer('#' + div.getAttribute('id'));
3082 }
3083
3084 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3085
3086 _Core.Core.hideLoading();
3087 };
3088
3089 if (grid.classList.contains('sizes-present')) {
3090 _Core.Core.watchForImages(grid);
3091
3092 doImageLayout();
3093 } else {
3094 _Core.Core.waitForImages(grid).then(() => {
3095 doImageLayout();
3096 });
3097 }
3098 };
3099
3100 var redisplayPopupContents = (provider, panelId, panel, args) => {
3101 var panelEl = Util.getElement(panel);
3102
3103 if ('show' === args['popup']) {
3104 _Core.Core.hideLoading();
3105
3106 (0, _Modal.Modal)(panelEl, {
3107 modalTarget: 'photonic-' + provider + '-panel-' + panelId,
3108 color: '#000',
3109 width: Photonic_JS.gallery_panel_width + '%',
3110 closeFromRight: (100 - Photonic_JS.gallery_panel_width) / 2 + '%'
3111 });
3112 } else {
3113 bypassPopup(document.getElementById('photonic-' + provider + '-panel-' + panelId));
3114 }
3115 };
3116
3117 var processRequest = (provider, type, identifier, args) => {
3118 args['action'] = 'photonic_display_level_2_contents';
3119 Util.post(Photonic_JS.ajaxurl, args, function (data) {
3120 if (data.substr(0, Photonic_JS.password_failed.length) === Photonic_JS.password_failed) {
3121 _Core.Core.hideLoading();
3122
3123 var prompter = '#photonic-' + provider + '-' + type + '-prompter-' + identifier;
3124 var prompterDialog = _Core.Core.prompterList[prompter];
3125
3126 if (prompterDialog !== undefined && prompterDialog !== null) {
3127 prompterDialog.show();
3128 }
3129 } else {
3130 if ('show' === args['popup']) {
3131 displayPopup(data, provider, type, identifier);
3132 } else {
3133 if (data !== '') {
3134 bypassPopup(data);
3135 } else {
3136 _Core.Core.hideLoading();
3137 }
3138 }
3139 }
3140 });
3141 };
3142
3143 exports.processRequest = processRequest;
3144
3145 var displayLevel2 = (provider, type, args) => {
3146 var identifier = args['panel_id'].substr(('photonic-' + provider + '-' + type + '-thumb-').length);
3147 var panel = '#photonic-' + provider + '-panel-' + identifier;
3148 var existing = document.getElementById('photonic-' + provider + '-panel-' + identifier);
3149
3150 if (existing == null) {
3151 existing = document.getElementById(args['panel_id']);
3152
3153 if (existing.classList.contains('photonic-' + provider + '-passworded')) {
3154 _Core.Core.initializePasswordPrompter("#photonic-".concat(provider, "-").concat(type, "-prompter-").concat(identifier));
3155 } else {
3156 _Core.Core.showSpinner();
3157
3158 processRequest(provider, type, identifier, args);
3159 }
3160 } else {
3161 _Core.Core.showSpinner();
3162
3163 redisplayPopupContents(provider, identifier, panel, args);
3164 }
3165 };
3166
3167 exports.displayLevel2 = displayLevel2;
3168
3169 var processL3Request = (clicked, header, args) => {
3170 args['action'] = 'photonic_display_level_3_contents';
3171
3172 _Core.Core.showSpinner();
3173
3174 var lightbox = _Core.Core.getLightbox();
3175
3176 Util.post(Photonic_JS.ajaxurl, args, function (data) {
3177 var insert = Util.getElement(data);
3178
3179 if (header) {
3180 var layout = insert.querySelector('.photonic-level-2-container');
3181 var container = header.parentNode;
3182 var returnedStream = insert.firstElementChild;
3183 var collectionId = args.node.substr('flickr-collection-'.length);
3184 returnedStream.setAttribute('id', args.stream + '-' + collectionId);
3185 container.insertBefore(returnedStream, header.nextSibling);
3186
3187 if (layout.classList.contains('photonic-random-layout')) {
3188 (0, _Justified.JustifiedGrid)(false, false, null, lightbox);
3189 } else if (layout.classList.contains('photonic-mosaic-layout')) {
3190 (0, _Mosaic.Mosaic)(false, false);
3191 } else if (layout.classList.contains('photonic-masonry-layout')) {
3192 (0, _Masonry.Masonry)(false, false);
3193 } else if (layout.classList.contains('photonic-masonry-horizontal-layout')) {
3194 (0, _MasonryHorizontal.MasonryHorizontal)(false, false);
3195 } else if (layout.classList.contains('sizes-present')) {
3196 _Core.Core.watchForImages(layout);
3197 }
3198
3199 var level2 = returnedStream.querySelectorAll('.photonic-level-2');
3200 level2.forEach(function (item) {
3201 item.style.display = 'inline-block';
3202 });
3203 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3204 clicked.classList.remove('photonic-level-3-expand-plus');
3205 clicked.classList.add('photonic-level-3-expand-up');
3206 clicked.setAttribute('title', Photonic_JS.minimize_panel === undefined ? 'Hide' : Photonic_JS.minimize_panel);
3207 }
3208
3209 _Core.Core.hideLoading();
3210 });
3211 };
3212
3213 exports.processL3Request = processL3Request;
3214
3215 var lazyLoad = evt => {
3216 spinners++;
3217
3218 _Core.Core.showSpinner();
3219
3220 var clicked = evt.currentTarget;
3221 var shortcode = clicked.getAttribute('data-photonic-shortcode');
3222 var args = {
3223 'action': 'photonic_lazy_load',
3224 'shortcode': shortcode
3225 };
3226
3227 var countdownSpinners = () => {
3228 spinners--;
3229
3230 if (spinners <= 0) {
3231 _Core.Core.hideLoading();
3232 }
3233 };
3234
3235 Util.post(Photonic_JS.ajaxurl, args, data => {
3236 var div = document.createElement('div');
3237 div.innerHTML = data;
3238 div = div.firstElementChild;
3239
3240 if (div) {
3241 var divId = div.getAttribute('id');
3242 var divClass = divId.substring(0, divId.lastIndexOf('-'));
3243 var streams = document.documentElement.querySelectorAll('.' + divClass);
3244 var max = 0;
3245 streams.forEach(stream => {
3246 var streamId = stream.getAttribute('id');
3247 streamId = streamId.substring(streamId.lastIndexOf('-') + 1);
3248 streamId = parseInt(streamId, 10);
3249 max = Math.max(max, streamId);
3250 });
3251 max = max + 1;
3252 var regex = new RegExp(divId, 'gi');
3253 div.innerHTML = data.replace(regex, divClass + '-' + max).replace('photonic-slideshow-' + divId.substring(divId.lastIndexOf('-') + 1), 'photonic-slideshow-' + max);
3254 div = div.firstElementChild; // Level 2 elements get their own ids, which need to be readjusted because the back-end always assigns them a gallery_index of 1
3255
3256 div.querySelectorAll('figure.photonic-level-2').forEach(figure => {
3257 if (figure.getAttribute('id') != null) {
3258 var figId = figure.getAttribute('id');
3259 var modId = figId.substring(0, figId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3260
3261 figure.setAttribute('id', modId);
3262 var anchor = figure.querySelector('a');
3263
3264 if (anchor.getAttribute('id') != null) {
3265 var anchorId = anchor.getAttribute('id');
3266 var modAnchorId = anchorId.substring(0, anchorId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3267
3268 anchor.setAttribute('id', modAnchorId);
3269 }
3270
3271 var prompter = figure.querySelector('.photonic-password-prompter');
3272
3273 if (prompter != null && prompter.getAttribute('id') != null) {
3274 var prompterId = prompter.getAttribute('id');
3275 var modPrompterId = prompterId.substring(0, prompterId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3276
3277 prompter.setAttribute('id', modPrompterId);
3278 }
3279 }
3280 });
3281 clicked.insertAdjacentElement('afterend', div);
3282 var newDivId = divClass + '-' + max;
3283
3284 var lightbox = _Core.Core.getLightbox();
3285
3286 if (lightbox !== undefined && lightbox !== null) {
3287 lightbox.initializeForNewContainer('#' + div.getAttribute('id'));
3288 }
3289
3290 if (document.querySelectorAll('#' + newDivId + ' .photonic-random-layout').length > 0) {
3291 (0, _Justified.JustifiedGrid)(false, true, '#' + newDivId + ' .photonic-random-layout', lightbox);
3292 spinners--;
3293 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-masonry-layout').length > 0) {
3294 (0, _Masonry.Masonry)(false, true, '#' + newDivId + ' .photonic-masonry-layout');
3295 spinners--;
3296 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-masonry-horizontal-layout').length > 0) {
3297 (0, _MasonryHorizontal.MasonryHorizontal)(false, true, '#' + newDivId + ' .photonic-masonry-horizontal-layout');
3298 spinners--;
3299 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-mosaic-layout').length > 0) {
3300 (0, _Mosaic.Mosaic)(false, true, '#' + newDivId + ' .photonic-mosaic-layout');
3301 spinners--;
3302 } // Slider(document.querySelector('#photonic-slideshow-' + max));
3303
3304
3305 if (div.classList.contains('sizes-present') || div.querySelector('.sizes-present') !== null) {
3306 _Core.Core.watchForImages(div);
3307
3308 _Core.Core.standardizeTitleWidths();
3309
3310 countdownSpinners();
3311 } else {
3312 _Core.Core.waitForImages(div).then(() => {
3313 var standard = document.documentElement.querySelectorAll('#' + newDivId + ' .photonic-standard-layout .photonic-level-1, ' + '#' + newDivId + ' .photonic-standard-layout .photonic-level-2');
3314 standard.forEach(image => {
3315 image.style.display = 'inline-block';
3316 });
3317
3318 _Core.Core.standardizeTitleWidths();
3319
3320 countdownSpinners();
3321 });
3322 }
3323
3324 _Core.Core.moveHTML5External();
3325
3326 clicked.parentNode.removeChild(clicked);
3327 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3328
3329 if (spinners <= 0) {
3330 _Core.Core.hideLoading();
3331 }
3332 }
3333 });
3334 };
3335
3336 exports.lazyLoad = lazyLoad;
3337
3338 /***/ }),
3339
3340 /***/ "../include/js/front-end/src/Util.js":
3341 /*!*******************************************!*\
3342 !*** ../include/js/front-end/src/Util.js ***!
3343 \*******************************************/
3344 /*! flagged exports */
3345 /*! export HTMLSanitizer [provided] [no usage info] [missing usage info prevents renaming] */
3346 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
3347 /*! export fadeIn [provided] [no usage info] [missing usage info prevents renaming] */
3348 /*! export fadeOut [provided] [no usage info] [missing usage info prevents renaming] */
3349 /*! export get [provided] [no usage info] [missing usage info prevents renaming] */
3350 /*! export getElement [provided] [no usage info] [missing usage info prevents renaming] */
3351 /*! export getText [provided] [no usage info] [missing usage info prevents renaming] */
3352 /*! export hasClass [provided] [no usage info] [missing usage info prevents renaming] */
3353 /*! export hide [provided] [no usage info] [missing usage info prevents renaming] */
3354 /*! export next [provided] [no usage info] [missing usage info prevents renaming] */
3355 /*! export post [provided] [no usage info] [missing usage info prevents renaming] */
3356 /*! export show [provided] [no usage info] [missing usage info prevents renaming] */
3357 /*! export slideUpDown [provided] [no usage info] [missing usage info prevents renaming] */
3358 /*! export slideUpTitle [provided] [no usage info] [missing usage info prevents renaming] */
3359 /*! other exports [not provided] [no usage info] */
3360 /*! runtime requirements: __webpack_exports__ */
3361 /***/ ((__unused_webpack_module, exports) => {
3362
3363
3364
3365 Object.defineProperty(exports, "__esModule", ({
3366 value: true
3367 }));
3368 exports.HTMLSanitizer = exports.hide = exports.show = exports.fadeOut = exports.fadeIn = exports.slideUpTitle = exports.slideUpDown = exports.getText = exports.getElement = exports.next = exports.get = exports.post = exports.hasClass = void 0;
3369
3370 // Utilities for Photonic
3371 var hasClass = (element, className) => {
3372 if (element.classList) {
3373 return element.classList.contains(className);
3374 } else {
3375 return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);
3376 }
3377 };
3378
3379 exports.hasClass = hasClass;
3380
3381 function ajax(method, url, args, callback) {
3382 var xhr = new XMLHttpRequest();
3383 xhr.open(method, url);
3384
3385 xhr.onreadystatechange = function () {
3386 if (xhr.readyState === 4) {
3387 if (xhr.status === 200) {
3388 var data = xhr.responseText;
3389 callback(data);
3390 }
3391 }
3392 };
3393
3394 var form = new FormData();
3395
3396 for (var [key, value] of Object.entries(args)) {
3397 form.append(key, value);
3398 }
3399
3400 xhr.send(form);
3401 }
3402
3403 var post = (url, args, callback) => {
3404 ajax('POST', url, args, callback);
3405 };
3406
3407 exports.post = post;
3408
3409 var get = (url, args, callback) => {
3410 ajax('GET', url, args, callback);
3411 };
3412
3413 exports.get = get;
3414
3415 var next = (elem, selector) => {
3416 var sibling = elem.nextElementSibling;
3417 if (!selector) return sibling;
3418
3419 while (sibling) {
3420 if (sibling.matches(selector)) return sibling;
3421 sibling = sibling.nextElementSibling;
3422 }
3423 };
3424
3425 exports.next = next;
3426
3427 var getElement = value => {
3428 var parser = new DOMParser();
3429 var doc = parser.parseFromString(value, 'text/html');
3430 return doc.body;
3431 };
3432
3433 exports.getElement = getElement;
3434
3435 var getText = value => {
3436 // Not using innerHTML because of vulnerability to XSS
3437 if (value == null) {
3438 return '';
3439 }
3440
3441 return value.replace(/<[^>]+>/g, '');
3442 };
3443
3444 exports.getText = getText;
3445
3446 var slideUpDown = (element, state) => {
3447 if (element != null && element.classList) {
3448 if (!element.classList.contains('photonic-can-slide')) {
3449 element.classList.add('photonic-can-slide');
3450 }
3451
3452 if ('show' === state) {
3453 element.classList.remove('photonic-can-slide-hide');
3454 element.style.height = "".concat(element.scrollHeight, "px");
3455 } else {
3456 element.classList.add('photonic-can-slide-hide');
3457 element.style.height = 0;
3458 }
3459 }
3460 };
3461
3462 exports.slideUpDown = slideUpDown;
3463
3464 var slideUpTitle = (element, state) => {
3465 if (element && element.classList) {
3466 if ('show' === state) {
3467 var currentPadding = 0;
3468
3469 if (element.offsetHeight) {
3470 currentPadding = parseInt(getComputedStyle(element).paddingTop.slice(0, -2)) * 2;
3471 }
3472
3473 element.style.height = element.scrollHeight + 6 - currentPadding + 'px';
3474 element.classList.add('slideup-show');
3475 } else {
3476 element.style.height = '';
3477 element.classList.remove('slideup-show');
3478 }
3479 }
3480 };
3481
3482 exports.slideUpTitle = slideUpTitle;
3483
3484 var fadeIn = el => {
3485 if (!hasClass(el, 'fade-in')) {
3486 el.style.display = 'block';
3487 el.style.visibility = 'visible';
3488 el.classList.add('fade-in');
3489 }
3490 };
3491
3492 exports.fadeIn = fadeIn;
3493
3494 var fadeOut = (el, duration) => {
3495 var s = el.style,
3496 step = 25 / (duration || 500);
3497 s.opacity = s.opacity || 1;
3498
3499 (function fade() {
3500 s.opacity -= step;
3501
3502 if (s.opacity < 0) {
3503 s.display = "none";
3504 el.classList.remove('fade-in');
3505 } else {
3506 setTimeout(fade, 25);
3507 }
3508 })();
3509 }; // get the default display style of an element
3510
3511
3512 exports.fadeOut = fadeOut;
3513
3514 var defaultDisplay = tag => {
3515 var iframe = document.createElement('iframe');
3516 iframe.setAttribute('frameborder', 0);
3517 iframe.setAttribute('width', 0);
3518 iframe.setAttribute('height', 0);
3519 document.documentElement.appendChild(iframe);
3520 var doc = (iframe.contentWindow || iframe.contentDocument).document; // IE support
3521
3522 doc.write();
3523 doc.close();
3524 var testEl = doc.createElement(tag);
3525 doc.documentElement.appendChild(testEl);
3526 var display = (window.getComputedStyle ? getComputedStyle(testEl, null) : testEl.currentStyle).display;
3527 iframe.parentNode.removeChild(iframe);
3528 return display;
3529 }; // actual show/hide function used by show() and hide() below
3530
3531
3532 var showHide = (el, show) => {
3533 var value = el.getAttribute('data-olddisplay'),
3534 display = el.style.display,
3535 computedDisplay = (window.getComputedStyle ? getComputedStyle(el, null) : el.currentStyle).display;
3536
3537 if (show) {
3538 if (!value && display === 'none') el.style.display = '';
3539 if (el.style.display === '' && computedDisplay === 'none') value = value || defaultDisplay(el.nodeName);
3540 } else {
3541 if (display && display !== 'none' || !(computedDisplay === 'none')) el.setAttribute('data-olddisplay', computedDisplay === 'none' ? display : computedDisplay);
3542 }
3543
3544 if (!show || el.style.display === 'none' || el.style.display === '') el.style.display = show ? value || '' : 'none';
3545 }; // helper functions
3546
3547
3548 var show = el => showHide(el, true);
3549
3550 exports.show = show;
3551
3552 var hide = el => showHide(el); //JavaScript HTML Sanitizer v2.0.3, (c) Alexander Yumashev, Jitbit Software.
3553 //homepage https://github.com/jitbit/HtmlSanitizer
3554 //License: MIT https://github.com/jitbit/HtmlSanitizer/blob/master/LICENSE
3555
3556
3557 exports.hide = hide;
3558 var HTMLSanitizer = new function () {
3559 var _tagWhitelist = {
3560 'A': true,
3561 'ABBR': true,
3562 'B': true,
3563 'BLOCKQUOTE': true,
3564 'BODY': true,
3565 'BR': true,
3566 'CENTER': true,
3567 'CODE': true,
3568 'DD': true,
3569 'DIV': true,
3570 'DL': true,
3571 'DT': true,
3572 'EM': true,
3573 'FONT': true,
3574 'H1': true,
3575 'H2': true,
3576 'H3': true,
3577 'H4': true,
3578 'H5': true,
3579 'H6': true,
3580 'HR': true,
3581 'I': true,
3582 'IMG': true,
3583 'LABEL': true,
3584 'LI': true,
3585 'OL': true,
3586 'P': true,
3587 'PRE': true,
3588 'SMALL': true,
3589 'SOURCE': true,
3590 'SPAN': true,
3591 'STRONG': true,
3592 'SUB': true,
3593 'SUP': true,
3594 'TABLE': true,
3595 'TBODY': true,
3596 'TR': true,
3597 'TD': true,
3598 'TH': true,
3599 'THEAD': true,
3600 'UL': true,
3601 'U': true,
3602 'VIDEO': true
3603 };
3604 var _contentTagWhiteList = {
3605 'FORM': true,
3606 'GOOGLE-SHEETS-HTML-ORIGIN': true
3607 }; //tags that will be converted to DIVs
3608
3609 var _attributeWhitelist = {
3610 'align': true,
3611 'color': true,
3612 'controls': true,
3613 'height': true,
3614 'href': true,
3615 'id': true,
3616 'src': true,
3617 'style': true,
3618 'target': true,
3619 'title': true,
3620 'type': true,
3621 'width': true
3622 };
3623 var _cssWhitelist = {
3624 'background-color': true,
3625 'color': true,
3626 'font-size': true,
3627 'font-weight': true,
3628 'text-align': true,
3629 'text-decoration': true,
3630 'width': true
3631 };
3632 var _schemaWhiteList = ['http:', 'https:', 'data:', 'm-files:', 'file:', 'ftp:', 'mailto:', 'pw:']; //which "protocols" are allowed in "href", "src" etc
3633
3634 var _uriAttributes = {
3635 'href': true,
3636 'action': true
3637 };
3638
3639 var _parser = new DOMParser();
3640
3641 this.SanitizeHTML = (input, extraSelector) => {
3642 if (input == null) return null;
3643 input = input.trim();
3644 if (input === "") return ""; //to save performance
3645 //firefox "bogus node" workaround for wysiwyg's
3646
3647 if (input === "<br>") return "";
3648 if (input.indexOf("<body") === -1) input = "<body>" + input + "</body>"; //add "body" otherwise some tags are skipped, like <style>
3649
3650 var doc = _parser.parseFromString(input, "text/html"); //DOM clobbering check (damn you firefox)
3651
3652
3653 if (doc.body.tagName !== 'BODY') doc.body.remove();
3654 if (typeof doc.createElement !== 'function') doc.createElement.remove();
3655
3656 function makeSanitizedCopy(node) {
3657 var newNode;
3658
3659 if (node.nodeType === Node.TEXT_NODE) {
3660 newNode = node.cloneNode(true);
3661 } else if (node.nodeType === Node.ELEMENT_NODE && (_tagWhitelist[node.tagName] || _contentTagWhiteList[node.tagName] || extraSelector && node.matches(extraSelector))) {
3662 //is tag allowed?
3663 if (_contentTagWhiteList[node.tagName]) newNode = doc.createElement('DIV'); //convert to DIV
3664 else newNode = doc.createElement(node.tagName);
3665
3666 for (var i = 0; i < node.attributes.length; i++) {
3667 var attr = node.attributes[i];
3668
3669 if (_attributeWhitelist[attr.name]) {
3670 if (attr.name === "style") {
3671 for (var s = 0; s < node.style.length; s++) {
3672 var styleName = node.style[s];
3673 if (_cssWhitelist[styleName]) newNode.style.setProperty(styleName, node.style.getPropertyValue(styleName));
3674 }
3675 } else {
3676 if (_uriAttributes[attr.name]) {
3677 //if this is a "uri" attribute, that can have "javascript:" or something
3678 if (attr.value.indexOf(":") > -1 && !startsWithAny(attr.value, _schemaWhiteList)) continue;
3679 }
3680
3681 newNode.setAttribute(attr.name, attr.value);
3682 }
3683 }
3684 }
3685
3686 for (var _i = 0; _i < node.childNodes.length; _i++) {
3687 var subCopy = makeSanitizedCopy(node.childNodes[_i]);
3688 newNode.appendChild(subCopy, false);
3689 } //remove useless empty spans (lots of those when pasting from MS Outlook)
3690
3691
3692 if ((newNode.tagName === "SPAN" || newNode.tagName === "B" || newNode.tagName === "I" || newNode.tagName === "U") && newNode.innerHTML.trim() === "") {
3693 return doc.createDocumentFragment();
3694 }
3695 } else {
3696 newNode = doc.createDocumentFragment();
3697 }
3698
3699 return newNode;
3700 }
3701
3702 var resultElement = makeSanitizedCopy(doc.body);
3703 return resultElement.innerHTML.replace(/div><div/g, "div>\n<div"); //replace is just for cleaner code
3704 };
3705
3706 function startsWithAny(str, substrings) {
3707 for (var i = 0; i < substrings.length; i++) {
3708 if (str.indexOf(substrings[i]) === 0) {
3709 return true;
3710 }
3711 }
3712
3713 return false;
3714 }
3715
3716 this.AllowedTags = _tagWhitelist;
3717 this.AllowedAttributes = _attributeWhitelist;
3718 this.AllowedCssStyles = _cssWhitelist;
3719 this.AllowedSchemas = _schemaWhiteList;
3720 }();
3721 exports.HTMLSanitizer = HTMLSanitizer;
3722
3723 /***/ })
3724
3725 /******/ });
3726 /************************************************************************/
3727 /******/ // The module cache
3728 /******/ var __webpack_module_cache__ = {};
3729 /******/
3730 /******/ // The require function
3731 /******/ function __webpack_require__(moduleId) {
3732 /******/ // Check if module is in cache
3733 /******/ if(__webpack_module_cache__[moduleId]) {
3734 /******/ return __webpack_module_cache__[moduleId].exports;
3735 /******/ }
3736 /******/ // Create a new module (and put it into the cache)
3737 /******/ var module = __webpack_module_cache__[moduleId] = {
3738 /******/ // no module.id needed
3739 /******/ // no module.loaded needed
3740 /******/ exports: {}
3741 /******/ };
3742 /******/
3743 /******/ // Execute the module function
3744 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
3745 /******/
3746 /******/ // Return the exports of the module
3747 /******/ return module.exports;
3748 /******/ }
3749 /******/
3750 /************************************************************************/
3751 (() => {
3752 /*!***********************************************************!*\
3753 !*** ../include/js/front-end/src/Entries/LightGallery.js ***!
3754 \***********************************************************/
3755 /*! unknown exports (runtime-defined) */
3756 /*! runtime requirements: __webpack_require__ */
3757
3758
3759 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
3760
3761 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
3762
3763 var _LightGallery = __webpack_require__(/*! ../Lightboxes/LightGallery */ "../include/js/front-end/src/Lightboxes/LightGallery.js");
3764
3765 var Listeners = _interopRequireWildcard(__webpack_require__(/*! ../Listeners */ "../include/js/front-end/src/Listeners.js"));
3766
3767 var Layout = _interopRequireWildcard(__webpack_require__(/*! ../Layouts/Layout */ "../include/js/front-end/src/Layouts/Layout.js"));
3768
3769 document.addEventListener('DOMContentLoaded', () => {
3770 var lightbox = new _LightGallery.PhotonicLightGallery();
3771
3772 _Core.Core.setLightbox(lightbox); // lightbox.initialize('.photonic-standard-layout,.photonic-random-layout,.photonic-masonry-layout,.photonic-mosaic-layout');
3773
3774
3775 lightbox.initialize('.photonic-level-1-container');
3776 lightbox.initialize('a[rel="photonic-lightgallery"]', true);
3777 lightbox.initialize('a.lightgallery-video', true);
3778 lightbox.initialize('a.lightgallery-html5-video', true);
3779
3780 _Core.Core.executeCommon();
3781
3782 Listeners.addAllListeners();
3783 Layout.initializeLayouts(lightbox);
3784 });
3785 })();
3786
3787 /******/ })()
3788 ;