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-featherlight.js

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

3,781 lines 126.7 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/Featherlight.js":
1974 /*!**************************************************************!*\
1975 !*** ../include/js/front-end/src/Lightboxes/Featherlight.js ***!
1976 \**************************************************************/
1977 /*! flagged exports */
1978 /*! export PhotonicFeatherlight [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.PhotonicFeatherlight = void 0;
1992
1993 var _Lightbox = __webpack_require__(/*! ./Lightbox */ "../include/js/front-end/src/Lightboxes/Lightbox.js");
1994
1995 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js"));
1996
1997 class PhotonicFeatherlight extends _Lightbox.Lightbox {
1998 constructor($) {
1999 super();
2000 this.$ = $;
2001 }
2002
2003 resizeContainer(elem) {
2004 var $ = this.$;
2005 var target = elem,
2006 video = $(target.attr('data-featherlight')),
2007 videoURL = $(video.children()[0]).attr('src');
2008
2009 if (videoURL === undefined) {//videoURL = target.attr('data-html5-href');
2010 }
2011
2012 this.getVideoSize(videoURL, {
2013 width: window.innerWidth * 0.85 - 50,
2014 height: window.innerHeight * 0.85 - 50
2015 }).then(function (dimensions) {
2016 $('.featherlight-content').find('video').attr('width', dimensions.newWidth).attr('height', dimensions.newHeight);
2017 target.attr('data-featherlight', $('<div/>').append(video).html());
2018 });
2019 }
2020
2021 resizeImageContainer(elem) {
2022 var $ = this.$;
2023 var imageURL = $(elem).attr('href');
2024 this.getImageSize(imageURL, {
2025 width: window.innerWidth * 0.85 - 50,
2026 height: window.innerHeight * 0.85 - 50
2027 }).then(function (dimensions) {
2028 $('.featherlight-content').find('img').css({
2029 width: dimensions.newWidth + 'px',
2030 height: dimensions.newHeight + 'px'
2031 });
2032 });
2033 }
2034
2035 soloImages() {
2036 var $ = this.$;
2037 $('a[href]').filter(function () {
2038 return /(\.jpg|\.jpeg|\.bmp|\.gif|\.png)/i.test($(this).attr('href'));
2039 }).filter(function () {
2040 var res = new RegExp('photonic-lb').test($(this).attr('class'));
2041 return !res;
2042 }).addClass("photonic-featherlight-solo");
2043 }
2044
2045 changeVideoURL(element, regular, embed) {
2046 var $ = this.$;
2047 $(element).attr('href', embed);
2048 $(element).attr("data-featherlight", 'iframe').addClass('featherlight-video');
2049 }
2050
2051 hostedVideo(a) {
2052 var $ = this.$;
2053 var html5 = $(a).attr('href').match(new RegExp(/(\.mp4|\.webm|\.ogg)/i));
2054 var css = $(a).attr('class');
2055 css = css !== undefined && css.includes('photonic-lb');
2056
2057 if (html5 !== null && !css) {
2058 $(a).addClass(Photonic_JS.lightbox_library + "-html5-video");
2059 $(a).attr('data-featherlight', '<video controls preload="none"><source src="' + $(a).attr('href') + '" type="video/mp4">Your browser does not support HTML5 video.</video>');
2060 this.videoIndex++;
2061 }
2062 }
2063
2064 initializeGallery(selector, self) {
2065 var $ = this.$;
2066 $(selector).featherlightGallery({
2067 gallery: {
2068 fadeIn: 300,
2069 fadeOut: 300
2070 },
2071 openSpeed: 300,
2072 closeSpeed: 300,
2073 afterContent: function afterContent() {
2074 this.$legend = this.$legend || $('<div class="legend"/>').insertAfter(this.$content.parent());
2075 this.$legend.html(this.$currentTarget.data('title'));
2076 this.$instance.find('.featherlight-previous img').remove();
2077 this.$instance.find('.featherlight-next img').remove();
2078
2079 if (this.$currentTarget !== null && this.$currentTarget.length > 0) {
2080 self.setHash(this.$currentTarget[0]);
2081 }
2082
2083 var shareable = {
2084 'url': location.href,
2085 'title': Util.getText(this.$currentTarget.data('title')),
2086 'image': this.$content.attr('src')
2087 };
2088 self.addSocial('.photonic-featherlight', shareable);
2089 $(window).resize();
2090 },
2091 afterClose: function afterClose() {
2092 self.unsetHash();
2093 },
2094 onResize: function onResize() {
2095 //if ($(this.$currentTarget).attr('data-featherlight-type') == 'video' || $(this.$currentTarget).attr('data-html5-href') != undefined) {
2096 if ($(this.$currentTarget).attr('data-featherlight-type') === 'video') {
2097 self.resizeContainer($(this.$currentTarget));
2098 } else {
2099 self.resizeImageContainer($(this.$currentTarget));
2100 }
2101 },
2102 variant: 'photonic-featherlight'
2103 });
2104 }
2105
2106 initialize(selector, group) {
2107 var $ = this.$;
2108 this.handleSolos();
2109 var self = this;
2110 $(selector).each(function () {
2111 var current = $(this),
2112 thumbs = current.find('a.photonic-featherlight');
2113 var rel = '';
2114
2115 if (thumbs.length > 0) {
2116 rel = $(thumbs[0]).attr('rel');
2117 }
2118
2119 self.initializeGallery('a[rel="' + rel + '"]', self);
2120 });
2121 $('a.photonic-featherlight-solo').featherlight({
2122 afterContent: function afterContent() {
2123 this.$legend = this.$legend || $('<div class="legend"/>').insertAfter(this.$content.parent());
2124 this.$legend.html(this.$currentTarget.data('title') || this.$currentTarget.attr('title') || this.$currentTarget.find('img').attr('title') || this.$currentTarget.find('img').attr('alt'));
2125 },
2126 type: 'image',
2127 variant: 'photonic-featherlight'
2128 });
2129 $('a.featherlight-video').featherlight({
2130 iframeWidth: 640,
2131 iframeHeight: 480,
2132 iframeFrameborder: 0,
2133 variant: 'photonic-featherlight'
2134 });
2135 $('a.featherlight-html5-video').featherlight({
2136 onResize: function onResize() {
2137 self.resizeContainer($(this.$currentTarget));
2138 },
2139 variant: 'photonic-featherlight'
2140 });
2141 }
2142
2143 initializeForNewContainer(containerId) {
2144 this.initialize(containerId);
2145 }
2146
2147 }
2148
2149 exports.PhotonicFeatherlight = PhotonicFeatherlight;
2150
2151 /***/ }),
2152
2153 /***/ "../include/js/front-end/src/Lightboxes/Lightbox.js":
2154 /*!**********************************************************!*\
2155 !*** ../include/js/front-end/src/Lightboxes/Lightbox.js ***!
2156 \**********************************************************/
2157 /*! flagged exports */
2158 /*! export Lightbox [provided] [no usage info] [missing usage info prevents renaming] */
2159 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2160 /*! other exports [not provided] [no usage info] */
2161 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2162 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2163
2164
2165
2166 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2167
2168 Object.defineProperty(exports, "__esModule", ({
2169 value: true
2170 }));
2171 exports.Lightbox = void 0;
2172
2173 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../../../node_modules/@babel/runtime/helpers/defineProperty.js"));
2174
2175 class Lightbox {
2176 constructor() {
2177 (0, _defineProperty2.default)(this, "deep", void 0);
2178 (0, _defineProperty2.default)(this, "lastDeep", void 0);
2179 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>";
2180 this.videoIndex = 1;
2181 }
2182
2183 getVideoSize(url, baseline) {
2184 return new Promise(resolve => {
2185 // create the video element
2186 var video = document.createElement('video'); // place a listener on it
2187
2188 video.addEventListener("loadedmetadata", function () {
2189 // retrieve dimensions
2190 var height = this.videoHeight,
2191 width = this.videoWidth;
2192 var videoAspectRatio = this.videoWidth / this.videoHeight,
2193 baseAspectRatio = baseline.width / baseline.height;
2194 var newWidth, newHeight;
2195
2196 if (baseAspectRatio > videoAspectRatio) {
2197 // Window is wider than it needs to be ... constrain by window height
2198 newHeight = baseline.height;
2199 newWidth = width * newHeight / height;
2200 } else {
2201 // Window is narrower than it needs to be ... constrain by window width
2202 newWidth = baseline.width;
2203 newHeight = height * newWidth / width;
2204 } // send back result
2205
2206
2207 resolve({
2208 height: height,
2209 width: width,
2210 newHeight: newHeight,
2211 newWidth: newWidth
2212 });
2213 }, false); // start download meta-data
2214
2215 video.src = url;
2216 });
2217 }
2218
2219 getImageSize(url, baseline) {
2220 return new Promise(function (resolve) {
2221 var image = document.createElement('img'); // place a listener on it
2222
2223 image.addEventListener("load", function () {
2224 // retrieve dimensions
2225 var height = this.height,
2226 width = this.width,
2227 imageAspectRatio = this.width / this.height,
2228 baseAspectRatio = baseline.width / baseline.height;
2229 var newWidth, newHeight;
2230
2231 if (baseAspectRatio > imageAspectRatio) {
2232 // Window is wider than it needs to be ... constrain by window height
2233 newHeight = baseline.height;
2234 newWidth = width * newHeight / height;
2235 } else {
2236 // Window is narrower than it needs to be ... constrain by window width
2237 newWidth = baseline.width;
2238 newHeight = height * newWidth / width;
2239 } // send back result
2240
2241
2242 resolve({
2243 height: height,
2244 width: width,
2245 newHeight: newHeight,
2246 newWidth: newWidth
2247 });
2248 }, false); // start download meta-data
2249
2250 image.src = url;
2251 });
2252 }
2253
2254 addSocial(selector, shareable, position) {
2255 if ((Photonic_JS.social_media === undefined || Photonic_JS.social_media === '') && shareable['buy'] === undefined) {
2256 return;
2257 }
2258
2259 var socialEl = document.getElementById('photonic-social');
2260
2261 if (socialEl !== null) {
2262 socialEl.parentNode.removeChild(socialEl);
2263 }
2264
2265 var addTo;
2266
2267 if (position === undefined || position === null) {
2268 addTo = 'beforeend';
2269 } else {
2270 addTo = position;
2271 }
2272
2273 if (location.hash !== '') {
2274 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']));
2275 var selectorEl;
2276
2277 if (typeof selector === 'string') {
2278 selectorEl = document.documentElement.querySelector(selector);
2279 } else {
2280 selectorEl = selector;
2281 }
2282
2283 if (selectorEl !== null) {
2284 selectorEl.insertAdjacentHTML(addTo, social);
2285 }
2286
2287 if (Photonic_JS.social_media === undefined || Photonic_JS.social_media === '') {
2288 var socialMediaIcons = document.documentElement.querySelectorAll('.photonic-share-fb, .photonic-share-twitter, .photonic-share-pinterest');
2289 Array.prototype.forEach.call(socialMediaIcons, function (socialIcon) {
2290 socialIcon.parentNode.removeChild(socialIcon);
2291 });
2292 }
2293 }
2294 }
2295
2296 setHash(a) {
2297 if (Photonic_JS.deep_linking === undefined || Photonic_JS.deep_linking === 'none' || a === null || a === undefined) {
2298 return;
2299 }
2300
2301 var hash = typeof a === 'string' ? a : a.getAttribute('data-photonic-deep');
2302
2303 if (hash === undefined) {
2304 return;
2305 }
2306
2307 if (typeof window.history.pushState === 'function' && Photonic_JS.deep_linking === 'yes-history') {
2308 window.history.pushState({}, document.title, '#' + hash);
2309 } else if (typeof window.history.replaceState === 'function' && Photonic_JS.deep_linking === 'no-history') {
2310 window.history.replaceState({}, document.title, '#' + hash);
2311 } else {
2312 document.location.hash = hash;
2313 }
2314 }
2315
2316 unsetHash() {
2317 this.lastDeep = this.lastDeep === undefined || this.deep !== '' ? location.hash : this.lastDeep;
2318
2319 if (window.history && 'replaceState' in window.history) {
2320 history.replaceState({}, document.title, location.href.substr(0, location.href.length - location.hash.length));
2321 } else {
2322 window.location.hash = '';
2323 }
2324 }
2325
2326 changeHash(e) {
2327 if (e.type === 'load') {
2328 var hash = window.location.hash;
2329 hash = hash.substr(1);
2330
2331 if (hash && hash !== '') {
2332 var allMatches = document.querySelectorAll('[data-photonic-deep="' + hash + '"]');
2333
2334 if (allMatches.length > 0) {
2335 var thumbToClick = allMatches[0];
2336 var event = document.createEvent('HTMLEvents');
2337 event.initEvent('click', true, false);
2338 thumbToClick.dispatchEvent(event);
2339 }
2340 }
2341 } else {
2342 var node = this.deep;
2343
2344 if (node != null) {
2345 if (node.length > 1) {
2346 if (window.location.hash && node.indexOf('#access_token=') !== -1) {
2347 this.unsetHash();
2348 } else {
2349 node = node.substr(1);
2350
2351 var _allMatches = document.querySelectorAll('[data-photonic-deep="' + node + '"]');
2352
2353 if (_allMatches.length > 0) {
2354 var _thumbToClick = _allMatches[0];
2355
2356 var _event = document.createEvent('HTMLEvents');
2357
2358 _event.initEvent('click', true, false);
2359
2360 _thumbToClick.dispatchEvent(_event);
2361
2362 this.setHash(node);
2363 }
2364 }
2365 }
2366 }
2367 }
2368 }
2369
2370 catchYouTubeURL(url) {
2371 var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*)(?:(\?t|&t|\?start|&start)=(\d+))?.*/,
2372 match = url.match(regExp);
2373
2374 if (match && match[2].length === 11) {
2375 var obj = {
2376 url: match[2]
2377 };
2378
2379 if (match[4] !== undefined) {
2380 obj.timestamp = match[4];
2381 }
2382
2383 return obj;
2384 }
2385 }
2386
2387 catchVimeoURL(url) {
2388 var regExp = /(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/,
2389 match = url.match(regExp);
2390
2391 if (match) {
2392 return match[1];
2393 }
2394 }
2395
2396 soloImages() {
2397 var a = document.querySelectorAll('a[href]');
2398 var solos = Array.from(a).filter(elem => /(\.jpg|\.jpeg|\.bmp|\.gif|\.png)/i.test(elem.getAttribute('href'))).filter(elem => !elem.classList.contains('photonic-lb'));
2399 solos.forEach(solo => {
2400 solo.classList.add("photonic-" + Photonic_JS.lightbox_library);
2401 solo.classList.add("photonic-" + Photonic_JS.lightbox_library + '-solo');
2402 solo.classList.add(Photonic_JS.lightbox_library);
2403 });
2404 return solos;
2405 }
2406
2407 changeVideoURL(element, regular, embed, poster) {// Implemented in individual lightboxes. Empty for unsupported lightboxes
2408 }
2409
2410 hostedVideo(a) {// Implemented in individual lightboxes. Empty for unsupported lightboxes
2411 }
2412
2413 soloVideos() {
2414 var self = this;
2415
2416 if (Photonic_JS.lightbox_for_videos) {
2417 var a = document.querySelectorAll('a[href]');
2418 a.forEach(function (anchor) {
2419 var regular, embed, poster;
2420 var href = anchor.getAttribute('href'),
2421 youTube = self.catchYouTubeURL(href),
2422 vimeo = self.catchVimeoURL(href);
2423
2424 if (youTube !== undefined) {
2425 var ytSrc = youTube.url,
2426 ytTimeStamp = youTube.timestamp,
2427 regularT = '',
2428 embedT = '';
2429
2430 if (ytTimeStamp !== undefined) {
2431 regularT = '&t=' + ytTimeStamp;
2432 embedT = '?start=' + ytTimeStamp;
2433 }
2434
2435 regular = 'https://youtube.com/watch?v=' + ytSrc + regularT;
2436 embed = 'https://youtube.com/embed/' + ytSrc + embedT;
2437 poster = 'https://img.youtube.com/vi/' + ytSrc + '/hddefault.jpg';
2438 } else if (vimeo !== undefined) {
2439 regular = 'https://vimeo.com/' + vimeo;
2440 embed = 'https://player.vimeo.com/video/' + vimeo;
2441 }
2442
2443 if (regular !== undefined) {
2444 anchor.classList.add(Photonic_JS.lightbox_library + "-video");
2445 self.changeVideoURL(anchor, regular, embed, poster);
2446 self.modifyAdditionalVideoProperties(anchor);
2447 }
2448
2449 self.hostedVideo(anchor);
2450 });
2451 }
2452 }
2453
2454 handleSolos() {
2455 if (Photonic_JS.lightbox_for_all) {
2456 this.soloImages();
2457 }
2458
2459 this.soloVideos();
2460
2461 if (Photonic_JS.deep_linking !== undefined && Photonic_JS.deep_linking !== 'none') {
2462 window.addEventListener('load', this.changeHash);
2463 window.addEventListener('hashchange', this.changeHash);
2464 }
2465 }
2466
2467 initialize() {
2468 this.handleSolos(); // Implemented by child classes
2469 }
2470
2471 initializeForNewContainer(containerId) {// Implemented by individual lightboxes. Empty for cases where not required
2472 }
2473
2474 initializeForExisting() {// Implemented by child classes
2475 }
2476
2477 modifyAdditionalVideoProperties(anchor) {// Implemented by individual lightboxes. Empty for cases where not required
2478 }
2479
2480 }
2481
2482 exports.Lightbox = Lightbox;
2483
2484 /***/ }),
2485
2486 /***/ "../include/js/front-end/src/Listeners.js":
2487 /*!************************************************!*\
2488 !*** ../include/js/front-end/src/Listeners.js ***!
2489 \************************************************/
2490 /*! flagged exports */
2491 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2492 /*! export addAllListeners [provided] [no usage info] [missing usage info prevents renaming] */
2493 /*! export addHelperMoreButtonListener [provided] [no usage info] [missing usage info prevents renaming] */
2494 /*! export addLazyLoadListener [provided] [no usage info] [missing usage info prevents renaming] */
2495 /*! export addLevel2ClickListener [provided] [no usage info] [missing usage info prevents renaming] */
2496 /*! export addLevel3ExpandListener [provided] [no usage info] [missing usage info prevents renaming] */
2497 /*! export addMoreButtonListener [provided] [no usage info] [missing usage info prevents renaming] */
2498 /*! export addPasswordSubmitListener [provided] [no usage info] [missing usage info prevents renaming] */
2499 /*! export addSlideUpEnterListener [provided] [no usage info] [missing usage info prevents renaming] */
2500 /*! export addSlideUpLeaveListener [provided] [no usage info] [missing usage info prevents renaming] */
2501 /*! other exports [not provided] [no usage info] */
2502 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2503 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2504
2505
2506
2507 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
2508
2509 Object.defineProperty(exports, "__esModule", ({
2510 value: true
2511 }));
2512 exports.addAllListeners = exports.addLazyLoadListener = exports.addSlideUpLeaveListener = exports.addSlideUpEnterListener = exports.addHelperMoreButtonListener = exports.addMoreButtonListener = exports.addLevel3ExpandListener = exports.addPasswordSubmitListener = exports.addLevel2ClickListener = void 0;
2513
2514 var _Core = __webpack_require__(/*! ./Core */ "../include/js/front-end/src/Core.js");
2515
2516 var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js"));
2517
2518 var Requests = _interopRequireWildcard(__webpack_require__(/*! ./Requests */ "../include/js/front-end/src/Requests.js"));
2519
2520 var _Justified = __webpack_require__(/*! ./Layouts/Justified */ "../include/js/front-end/src/Layouts/Justified.js");
2521
2522 var _Mosaic = __webpack_require__(/*! ./Layouts/Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js");
2523
2524 var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js");
2525
2526 var _MasonryHorizontal = __webpack_require__(/*! ./Layouts/MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js");
2527
2528 // .photonic-level-2-thumb:not(".gallery-page")
2529 var addLevel2ClickListener = () => {
2530 document.addEventListener('click', e => {
2531 if (!(e.target instanceof Element) || !e.target.closest('.photonic-level-2-thumb') || Photonic_JS.lightbox_library === 'none') {
2532 return;
2533 }
2534
2535 var clicked = e.target.closest('.photonic-level-2-thumb');
2536
2537 if (Util.hasClass(clicked, 'gallery-page')) {
2538 return;
2539 }
2540
2541 e.preventDefault();
2542 var container = clicked.closest('.photonic-level-2-container');
2543 var galleryData = JSON.parse(container.getAttribute('data-photonic'));
2544 var provider = galleryData['platform'],
2545 singular = galleryData['singular'],
2546 query = container.getAttribute('data-photonic-query');
2547 var args = {
2548 "panel_id": clicked.getAttribute('id'),
2549 "popup": galleryData['popup'],
2550 "photo_count": galleryData['photo-count'],
2551 "photo_more": galleryData['photo-more'] || '',
2552 "query": query
2553 };
2554 if (provider === 'google' || provider === 'zenfolio') args.thumb_size = galleryData['thumb-size'];
2555
2556 if (provider === 'flickr' || provider === 'smug' || provider === 'google' || provider === 'zenfolio') {
2557 args.overlay_size = galleryData['overlay-size'];
2558 args.overlay_video_size = galleryData['overlay-video-size'];
2559 }
2560
2561 if (provider === 'google') {
2562 args.overlay_crop = galleryData['overlay-crop'];
2563 }
2564
2565 Requests.displayLevel2(provider, singular, args);
2566 }, false);
2567 }; // .photonic-password-submit
2568
2569
2570 exports.addLevel2ClickListener = addLevel2ClickListener;
2571
2572 var addPasswordSubmitListener = () => {
2573 document.addEventListener('click', e => {
2574 if (!(e.target instanceof Element) || !e.target.closest('.photonic-password-submit')) {
2575 return;
2576 }
2577
2578 e.preventDefault();
2579 var clicked = e.target.closest('.photonic-password-submit');
2580 var modal = clicked.closest('.photonic-password-prompter'),
2581 container = clicked.closest('.photonic-level-2-container');
2582 var galleryData = JSON.parse(container.getAttribute('data-photonic'));
2583 var album_id = modal.getAttribute('id');
2584 var components = album_id.split('-');
2585 var provider = galleryData['platform'],
2586 singular_type = galleryData['singular'],
2587 album_key = components.slice(4).join('-'),
2588 thumb_id = "photonic-".concat(provider, "-").concat(singular_type, "-thumb-").concat(album_key),
2589 thumb = document.getElementById("".concat(thumb_id)),
2590 query = container.getAttribute('data-photonic-query');
2591 var password = modal.querySelector('input[name="photonic-' + provider + '-password"]');
2592 password = password.value;
2593
2594 var prompter = _Core.Core.prompterList["#photonic-".concat(provider, "-").concat(singular_type, "-prompter-").concat(album_key)];
2595
2596 if (prompter !== undefined && prompter !== null) {
2597 prompter.hide();
2598 }
2599
2600 _Core.Core.showSpinner();
2601
2602 var args = {
2603 'panel_id': thumb_id,
2604 "popup": galleryData['popup'],
2605 "photo_count": galleryData['photo-count'],
2606 "photo_more": galleryData['photo-more'] || '',
2607 "query": query
2608 };
2609
2610 if (provider === 'smug') {
2611 args.password = password;
2612 args.overlay_size = galleryData['overlay-size'];
2613 } else if (provider === 'zenfolio') {
2614 args.password = password;
2615 args.realm_id = thumb.getAttribute('data-photonic-realm');
2616 args.thumb_size = galleryData['thumb-size'];
2617 args.overlay_size = galleryData['overlay-size'];
2618 args.overlay_video_size = galleryData['overlay-video-size'];
2619 }
2620
2621 Requests.processRequest(provider, singular_type, album_key, args);
2622 }, false);
2623 }; // a.photonic-level-3-expand
2624
2625
2626 exports.addPasswordSubmitListener = addPasswordSubmitListener;
2627
2628 var addLevel3ExpandListener = () => {
2629 document.addEventListener('click', e => {
2630 if (!(e.target instanceof Element) || !e.target.closest('a.photonic-level-3-expand')) {
2631 return;
2632 }
2633
2634 e.preventDefault();
2635 var current = e.target.closest('a.photonic-level-3-expand'),
2636 header = current.parentNode.parentNode.parentNode,
2637 stream = header.parentNode;
2638
2639 if (current.classList.contains('photonic-level-3-expand-plus')) {
2640 Requests.processL3Request(current, header, {
2641 'view': 'collections',
2642 'node': current.getAttribute('data-photonic-level-3'),
2643 'layout': current.getAttribute('data-photonic-layout'),
2644 'stream': stream.getAttribute('id')
2645 });
2646 } else if (current.classList.contains('photonic-level-3-expand-up')) {
2647 var display = Util.next(header, '.photonic-stream');
2648 Util.slideUpDown(display, 'hide');
2649 current.classList.remove('photonic-level-3-expand-up');
2650 current.classList.add('photonic-level-3-expand-down');
2651 current.setAttribute('title', Photonic_JS.maximize_panel === undefined ? 'Show' : Photonic_JS.maximize_panel);
2652 } else if (current.classList.contains('photonic-level-3-expand-down')) {
2653 var _display = Util.next(header, '.photonic-stream'); // Util.slideDown(display);
2654
2655
2656 Util.slideUpDown(_display, 'show');
2657 current.classList.remove('photonic-level-3-expand-down');
2658 current.classList.add('photonic-level-3-expand-up');
2659 current.setAttribute('title', Photonic_JS.minimize_panel === undefined ? 'Hide' : Photonic_JS.minimize_panel);
2660 }
2661 }, false);
2662 }; // a.photonic-more-button.photonic-more-dynamic
2663
2664
2665 exports.addLevel3ExpandListener = addLevel3ExpandListener;
2666
2667 var addMoreButtonListener = () => {
2668 document.addEventListener('click', e => {
2669 if (!(e.target instanceof Element) || !e.target.closest('a.photonic-more-button.photonic-more-dynamic')) {
2670 return;
2671 }
2672
2673 e.preventDefault();
2674 var clicked = e.target.closest('a.photonic-more-button.photonic-more-dynamic');
2675 var container = clicked.parentNode.querySelector('.photonic-level-1-container, .photonic-level-2-container');
2676 var query = container.getAttribute('data-photonic-query'),
2677 provider = container.getAttribute('data-photonic-platform'),
2678 level = container.classList.contains('photonic-level-1-container') ? 'level-1' : 'level-2',
2679 containerId = container.getAttribute('id'),
2680 existing = container.querySelectorAll('figure');
2681
2682 _Core.Core.showSpinner();
2683
2684 Util.post(Photonic_JS.ajaxurl, {
2685 'action': 'photonic_load_more',
2686 'provider': provider,
2687 'query': query
2688 }, data => {
2689 var ret = Util.getElement(data),
2690 images = ret.querySelectorAll(".photonic-".concat(level)),
2691 more_button = ret.querySelector('.photonic-more-button'),
2692 one_existing = container.querySelector('a.photonic-lb');
2693 var anchors = [];
2694
2695 if (one_existing !== null) {
2696 images.forEach(image => {
2697 var a = image.querySelector('a');
2698
2699 if (a !== null) {
2700 a.setAttribute('rel', one_existing.getAttribute('rel'));
2701
2702 if (a.getAttribute('data-fancybox') != null) {
2703 a.setAttribute('data-fancybox', one_existing.getAttribute('data-fancybox'));
2704 } else if (a.getAttribute('data-rel') != null) {
2705 a.setAttribute('data-rel', one_existing.getAttribute('data-rel'));
2706 } else if (a.getAttribute('data-strip-group') != null) {
2707 a.setAttribute('data-strip-group', one_existing.getAttribute('data-strip-group'));
2708 } else if (a.getAttribute('data-gall') != null) {
2709 a.setAttribute('data-gall', one_existing.getAttribute('data-gall'));
2710 }
2711
2712 anchors.push(a);
2713 }
2714 });
2715 } // Can't do this above, which is only for L1
2716
2717
2718 images.forEach(image => container.appendChild(image));
2719
2720 _Core.Core.moveHTML5External();
2721
2722 if (images.length === 0) {
2723 _Core.Core.hideLoading();
2724
2725 Util.fadeOut(clicked);
2726 clicked.remove();
2727 }
2728
2729 var lightbox = _Core.Core.getLightbox();
2730
2731 if (Photonic_JS.lightbox_library === 'imagelightbox') {
2732 if (one_existing != null) {
2733 lightbox = _Core.Core.getLightboxList()['a[rel="' + one_existing.getAttribute('rel') + '"]'];
2734
2735 if (level === 'level-1') {
2736 lightbox.addToImageLightbox(anchors);
2737 }
2738 }
2739 } else if (Photonic_JS.lightbox_library === 'lightcase') {
2740 if (one_existing != null) {
2741 lightbox.initialize('a[data-rel="' + one_existing.getAttribute('data-rel') + '"]');
2742 }
2743 } else if (Photonic_JS.lightbox_library === 'lightgallery') {
2744 if (one_existing !== null) {
2745 lightbox = _Core.Core.getLightboxList()[one_existing.getAttribute('rel')];
2746 var galleryItems = [...lightbox.galleryItems];
2747 images.forEach(image => {
2748 var a = image.querySelector('a');
2749 var img = a.querySelector('img');
2750 var videoAttr;
2751
2752 if (a.getAttribute('data-photonic-media-type') === 'video') {
2753 videoAttr = JSON.parse(a.getAttribute('data-video'));
2754 }
2755
2756 galleryItems.push({
2757 "alt": img.getAttribute('alt'),
2758 "downloadUrl": a.getAttribute('data-download-url'),
2759 "src": a.getAttribute('data-photonic-media-type') === 'video' ? videoAttr.source[0].src : a.getAttribute('href'),
2760 "subHtml": a.getAttribute('data-sub-html'),
2761 "thumb": img.getAttribute('src')
2762 });
2763 });
2764 lightbox.updateSlides(galleryItems, 0);
2765 lightbox.refresh();
2766 } else {
2767 lightbox.initialize(container);
2768 }
2769 } else if (Photonic_JS.lightbox_library === 'venobox') {
2770 if (one_existing !== null) {
2771 var gallId = one_existing.getAttribute('data-gall');
2772
2773 if (one_existing.closest('.photonic-panel')) {
2774 gallId = one_existing.closest('.photonic-panel').getAttribute('id');
2775 }
2776
2777 lightbox.initialize('#' + gallId, true);
2778 }
2779 } else if (['bigpicture', 'featherlight', 'glightbox', 'spotlight'].includes(Photonic_JS.lightbox_library)) {
2780 lightbox.initialize(container);
2781 } else if (Photonic_JS.lightbox_library === 'baguettebox') {
2782 lightbox.initialize(null, true);
2783 } else if (Photonic_JS.lightbox_library === 'fancybox3') {
2784 if (one_existing != null) {
2785 lightbox.initialize(null, one_existing.getAttribute('data-fancybox'));
2786 }
2787 } else if (Photonic_JS.lightbox_library === 'photoswipe') {
2788 lightbox.initialize();
2789 }
2790
2791 function doImageLayout(images) {
2792 var new_query = ret.querySelector('.photonic-random-layout,.photonic-standard-layout,.photonic-masonry-layout,.photonic-mosaic-layout,.modal-gallery');
2793
2794 if (new_query != null) {
2795 container.setAttribute('data-photonic-query', new_query.getAttribute('data-photonic-query'));
2796 }
2797
2798 if (more_button == null) {
2799 Util.fadeOut(clicked);
2800 clicked.remove();
2801 }
2802
2803 if (Util.hasClass(container, 'photonic-mosaic-layout')) {
2804 (0, _Mosaic.Mosaic)(false, false, '#' + containerId);
2805 } else if (Util.hasClass(container, 'photonic-random-layout')) {
2806 (0, _Justified.JustifiedGrid)(false, false, '#' + containerId, lightbox);
2807 } else if (Util.hasClass(container, 'photonic-masonry-layout')) {
2808 images.forEach(image => {
2809 var img = image.querySelector('img');
2810 Util.fadeIn(img);
2811 img.style.display = 'block';
2812 });
2813
2814 _Core.Core.hideLoading();
2815 } else if (Util.hasClass(container, 'photonic-masonry-horizontal-layout')) {
2816 var existingCount = existing.length;
2817 images.forEach((image, idx) => {
2818 image.setAttribute('data-photonic-idx', existingCount + idx); // const img = image.querySelector('img');
2819 // Util.fadeIn(img);
2820 // img.style.display = 'block';
2821 });
2822 (0, _MasonryHorizontal.MasonryHorizontal)(false, false, '#' + containerId);
2823
2824 _Core.Core.hideLoading();
2825 } else {
2826 container.querySelectorAll('.photonic-' + level).forEach(el => {
2827 el.style.display = 'inline-block';
2828 });
2829
2830 _Core.Core.standardizeTitleWidths();
2831
2832 _Core.Core.hideLoading();
2833 }
2834
2835 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
2836 }
2837
2838 if (container.classList.contains('sizes-present')) {
2839 _Core.Core.watchForImages(images);
2840
2841 doImageLayout(images);
2842 } else {
2843 _Core.Core.waitForImages(images).then(() => {
2844 doImageLayout(images);
2845 });
2846 }
2847 });
2848 });
2849 }; // input[type="button"].photonic-helper-more
2850
2851
2852 exports.addMoreButtonListener = addMoreButtonListener;
2853
2854 var addHelperMoreButtonListener = () => {
2855 document.addEventListener('click', e => {
2856 if (!(e.target instanceof Element) || !e.target.closest('input[type="button"].photonic-helper-more')) {
2857 return;
2858 }
2859
2860 e.preventDefault();
2861
2862 _Core.Core.showSpinner();
2863
2864 var clicked = e.target.closest('input[type="button"].photonic-helper-more');
2865 var table = clicked.closest('table');
2866 var nextToken = clicked.getAttribute('data-photonic-token') === undefined ? null : clicked.getAttribute('data-photonic-token'),
2867 provider = clicked.getAttribute('data-photonic-platform'),
2868 accessType = clicked.getAttribute('data-photonic-access');
2869 var args = {
2870 'action': 'photonic_helper_shortcode_more',
2871 'provider': provider,
2872 'access': accessType
2873 };
2874
2875 if (nextToken) {
2876 args.nextPageToken = nextToken;
2877 }
2878
2879 if (provider === 'google') {
2880 Util.post(Photonic_JS.ajaxurl, args, data => {
2881 var ret = Util.getElement(data);
2882 ret = Array.from(ret.getElementsByTagName('tr'));
2883
2884 if (ret.length > 0) {
2885 var tr = clicked.closest('tr');
2886
2887 if (tr) {
2888 tr.remove();
2889 }
2890
2891 ret.forEach((node, i) => {
2892 if (i !== 0) {
2893 table.appendChild(node);
2894 }
2895 });
2896 }
2897
2898 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
2899
2900 _Core.Core.hideLoading();
2901 });
2902 }
2903 });
2904 };
2905
2906 exports.addHelperMoreButtonListener = addHelperMoreButtonListener;
2907
2908 var addSlideUpEnterListener = () => {
2909 document.addEventListener('mouseover', e => {
2910 var slideup = '.title-display-hover-slideup-show a, .photonic-slideshow.title-display-hover-slideup-show li';
2911
2912 if (e.target instanceof Element && e.target.closest(slideup)) {
2913 var node = e.target.closest(slideup);
2914 var title = node.querySelector('.photonic-title');
2915 Util.slideUpTitle(title, 'show');
2916 node.setAttribute('title', '');
2917 }
2918 }, true);
2919 };
2920
2921 exports.addSlideUpEnterListener = addSlideUpEnterListener;
2922
2923 var addSlideUpLeaveListener = () => {
2924 document.addEventListener('mouseout', e => {
2925 var slideup = '.title-display-hover-slideup-show a, .photonic-slideshow.title-display-hover-slideup-show li';
2926
2927 if (e.target instanceof Element && e.target.closest(slideup)) {
2928 var node = e.target.closest(slideup);
2929 var title = node.querySelector('.photonic-title');
2930 Util.slideUpTitle(title, 'hide');
2931 node.setAttribute('title', Util.getText(node.getAttribute('data-title')));
2932 }
2933 }, true);
2934 };
2935
2936 exports.addSlideUpLeaveListener = addSlideUpLeaveListener;
2937
2938 var addLazyLoadListener = () => {
2939 var buttons = document.documentElement.querySelectorAll('input.photonic-show-gallery-button');
2940 Array.prototype.forEach.call(buttons, button => {
2941 button.addEventListener('click', Requests.lazyLoad);
2942 });
2943 buttons = document.documentElement.querySelectorAll('input.photonic-js-load-button');
2944 Array.prototype.forEach.call(buttons, button => {
2945 button.addEventListener('click', Requests.lazyLoad);
2946 button.click();
2947 });
2948 };
2949
2950 exports.addLazyLoadListener = addLazyLoadListener;
2951
2952 var addAllListeners = () => {
2953 addLevel2ClickListener();
2954 addPasswordSubmitListener();
2955 addLevel3ExpandListener();
2956 addMoreButtonListener();
2957 addHelperMoreButtonListener();
2958 addSlideUpEnterListener();
2959 addSlideUpLeaveListener();
2960 addLazyLoadListener();
2961 };
2962
2963 exports.addAllListeners = addAllListeners;
2964
2965 /***/ }),
2966
2967 /***/ "../include/js/front-end/src/Requests.js":
2968 /*!***********************************************!*\
2969 !*** ../include/js/front-end/src/Requests.js ***!
2970 \***********************************************/
2971 /*! flagged exports */
2972 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2973 /*! export displayLevel2 [provided] [no usage info] [missing usage info prevents renaming] */
2974 /*! export lazyLoad [provided] [no usage info] [missing usage info prevents renaming] */
2975 /*! export processL3Request [provided] [no usage info] [missing usage info prevents renaming] */
2976 /*! export processRequest [provided] [no usage info] [missing usage info prevents renaming] */
2977 /*! other exports [not provided] [no usage info] */
2978 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2979 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2980
2981
2982
2983 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
2984
2985 Object.defineProperty(exports, "__esModule", ({
2986 value: true
2987 }));
2988 exports.lazyLoad = exports.processL3Request = exports.displayLevel2 = exports.processRequest = void 0;
2989
2990 var _Core = __webpack_require__(/*! ./Core */ "../include/js/front-end/src/Core.js");
2991
2992 var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js"));
2993
2994 var _Justified = __webpack_require__(/*! ./Layouts/Justified */ "../include/js/front-end/src/Layouts/Justified.js");
2995
2996 var _Masonry = __webpack_require__(/*! ./Layouts/Masonry */ "../include/js/front-end/src/Layouts/Masonry.js");
2997
2998 var _MasonryHorizontal = __webpack_require__(/*! ./Layouts/MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js");
2999
3000 var _Mosaic = __webpack_require__(/*! ./Layouts/Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js");
3001
3002 var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js");
3003
3004 var _Modal = __webpack_require__(/*! ./Components/Modal */ "../include/js/front-end/src/Components/Modal.js");
3005
3006 var spinners = 0;
3007
3008 var bypassPopup = data => {
3009 _Core.Core.hideLoading();
3010
3011 var panel;
3012
3013 if (data instanceof Element) {
3014 panel = data;
3015 } else {
3016 panel = Util.getElement(data).firstElementChild;
3017 }
3018
3019 Util.hide(panel);
3020 var images = panel.querySelectorAll('img');
3021 images.forEach(image => {
3022 if ((image.getAttribute('src') === null || image.getAttribute('src') === '') && image.getAttribute('data-src') !== null) {
3023 image.setAttribute('src', image.getAttribute('data-src'));
3024 image.removeAttribute('data-src');
3025 }
3026 });
3027 document.body.appendChild(panel);
3028
3029 _Core.Core.moveHTML5External();
3030
3031 var lightbox = _Core.Core.getLightbox();
3032
3033 if (lightbox !== undefined && lightbox !== null) {
3034 lightbox.initializeForNewContainer('#' + panel.getAttribute('id'));
3035 }
3036
3037 var thumbs = panel.querySelectorAll('.photonic-lb');
3038
3039 if (thumbs.length > 0) {
3040 _Core.Core.setDeep('#' + thumbs[0].getAttribute('data-photonic-deep'));
3041
3042 var evt = new MouseEvent('click', {
3043 bubbles: true,
3044 cancelable: true,
3045 view: window
3046 }); // If cancelled, don't dispatch our event
3047
3048 !thumbs[0].dispatchEvent(evt);
3049 }
3050 };
3051
3052 var displayPopup = (data, provider, popup, panelId) => {
3053 var safePanelId = panelId.replace('.', '\\.'); // FOR EXISTING ELEMENTS WHICH NEED SANITIZED PANELID
3054
3055 var div = Util.getElement(data).firstElementChild;
3056 var grid = div.querySelector('.modal-gallery');
3057
3058 var doImageLayout = () => {
3059 var popupPanel = document.querySelector('#photonic-' + provider + '-' + popup + '-' + safePanelId);
3060
3061 if (popupPanel) {
3062 popupPanel.appendChild(div);
3063 Util.show(popupPanel);
3064 }
3065
3066 (0, _Modal.Modal)(div, {
3067 modalTarget: 'photonic-' + provider + '-panel-' + safePanelId,
3068 color: '#000',
3069 width: Photonic_JS.gallery_panel_width + '%',
3070 closeFromRight: (100 - Photonic_JS.gallery_panel_width) / 2 + '%'
3071 });
3072
3073 _Core.Core.moveHTML5External();
3074
3075 var lightbox = _Core.Core.getLightbox();
3076
3077 if (lightbox !== undefined && lightbox !== null) {
3078 lightbox.initializeForNewContainer('#' + div.getAttribute('id'));
3079 }
3080
3081 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3082
3083 _Core.Core.hideLoading();
3084 };
3085
3086 if (grid.classList.contains('sizes-present')) {
3087 _Core.Core.watchForImages(grid);
3088
3089 doImageLayout();
3090 } else {
3091 _Core.Core.waitForImages(grid).then(() => {
3092 doImageLayout();
3093 });
3094 }
3095 };
3096
3097 var redisplayPopupContents = (provider, panelId, panel, args) => {
3098 var panelEl = Util.getElement(panel);
3099
3100 if ('show' === args['popup']) {
3101 _Core.Core.hideLoading();
3102
3103 (0, _Modal.Modal)(panelEl, {
3104 modalTarget: 'photonic-' + provider + '-panel-' + panelId,
3105 color: '#000',
3106 width: Photonic_JS.gallery_panel_width + '%',
3107 closeFromRight: (100 - Photonic_JS.gallery_panel_width) / 2 + '%'
3108 });
3109 } else {
3110 bypassPopup(document.getElementById('photonic-' + provider + '-panel-' + panelId));
3111 }
3112 };
3113
3114 var processRequest = (provider, type, identifier, args) => {
3115 args['action'] = 'photonic_display_level_2_contents';
3116 Util.post(Photonic_JS.ajaxurl, args, function (data) {
3117 if (data.substr(0, Photonic_JS.password_failed.length) === Photonic_JS.password_failed) {
3118 _Core.Core.hideLoading();
3119
3120 var prompter = '#photonic-' + provider + '-' + type + '-prompter-' + identifier;
3121 var prompterDialog = _Core.Core.prompterList[prompter];
3122
3123 if (prompterDialog !== undefined && prompterDialog !== null) {
3124 prompterDialog.show();
3125 }
3126 } else {
3127 if ('show' === args['popup']) {
3128 displayPopup(data, provider, type, identifier);
3129 } else {
3130 if (data !== '') {
3131 bypassPopup(data);
3132 } else {
3133 _Core.Core.hideLoading();
3134 }
3135 }
3136 }
3137 });
3138 };
3139
3140 exports.processRequest = processRequest;
3141
3142 var displayLevel2 = (provider, type, args) => {
3143 var identifier = args['panel_id'].substr(('photonic-' + provider + '-' + type + '-thumb-').length);
3144 var panel = '#photonic-' + provider + '-panel-' + identifier;
3145 var existing = document.getElementById('photonic-' + provider + '-panel-' + identifier);
3146
3147 if (existing == null) {
3148 existing = document.getElementById(args['panel_id']);
3149
3150 if (existing.classList.contains('photonic-' + provider + '-passworded')) {
3151 _Core.Core.initializePasswordPrompter("#photonic-".concat(provider, "-").concat(type, "-prompter-").concat(identifier));
3152 } else {
3153 _Core.Core.showSpinner();
3154
3155 processRequest(provider, type, identifier, args);
3156 }
3157 } else {
3158 _Core.Core.showSpinner();
3159
3160 redisplayPopupContents(provider, identifier, panel, args);
3161 }
3162 };
3163
3164 exports.displayLevel2 = displayLevel2;
3165
3166 var processL3Request = (clicked, header, args) => {
3167 args['action'] = 'photonic_display_level_3_contents';
3168
3169 _Core.Core.showSpinner();
3170
3171 var lightbox = _Core.Core.getLightbox();
3172
3173 Util.post(Photonic_JS.ajaxurl, args, function (data) {
3174 var insert = Util.getElement(data);
3175
3176 if (header) {
3177 var layout = insert.querySelector('.photonic-level-2-container');
3178 var container = header.parentNode;
3179 var returnedStream = insert.firstElementChild;
3180 var collectionId = args.node.substr('flickr-collection-'.length);
3181 returnedStream.setAttribute('id', args.stream + '-' + collectionId);
3182 container.insertBefore(returnedStream, header.nextSibling);
3183
3184 if (layout.classList.contains('photonic-random-layout')) {
3185 (0, _Justified.JustifiedGrid)(false, false, null, lightbox);
3186 } else if (layout.classList.contains('photonic-mosaic-layout')) {
3187 (0, _Mosaic.Mosaic)(false, false);
3188 } else if (layout.classList.contains('photonic-masonry-layout')) {
3189 (0, _Masonry.Masonry)(false, false);
3190 } else if (layout.classList.contains('photonic-masonry-horizontal-layout')) {
3191 (0, _MasonryHorizontal.MasonryHorizontal)(false, false);
3192 } else if (layout.classList.contains('sizes-present')) {
3193 _Core.Core.watchForImages(layout);
3194 }
3195
3196 var level2 = returnedStream.querySelectorAll('.photonic-level-2');
3197 level2.forEach(function (item) {
3198 item.style.display = 'inline-block';
3199 });
3200 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3201 clicked.classList.remove('photonic-level-3-expand-plus');
3202 clicked.classList.add('photonic-level-3-expand-up');
3203 clicked.setAttribute('title', Photonic_JS.minimize_panel === undefined ? 'Hide' : Photonic_JS.minimize_panel);
3204 }
3205
3206 _Core.Core.hideLoading();
3207 });
3208 };
3209
3210 exports.processL3Request = processL3Request;
3211
3212 var lazyLoad = evt => {
3213 spinners++;
3214
3215 _Core.Core.showSpinner();
3216
3217 var clicked = evt.currentTarget;
3218 var shortcode = clicked.getAttribute('data-photonic-shortcode');
3219 var args = {
3220 'action': 'photonic_lazy_load',
3221 'shortcode': shortcode
3222 };
3223
3224 var countdownSpinners = () => {
3225 spinners--;
3226
3227 if (spinners <= 0) {
3228 _Core.Core.hideLoading();
3229 }
3230 };
3231
3232 Util.post(Photonic_JS.ajaxurl, args, data => {
3233 var div = document.createElement('div');
3234 div.innerHTML = data;
3235 div = div.firstElementChild;
3236
3237 if (div) {
3238 var divId = div.getAttribute('id');
3239 var divClass = divId.substring(0, divId.lastIndexOf('-'));
3240 var streams = document.documentElement.querySelectorAll('.' + divClass);
3241 var max = 0;
3242 streams.forEach(stream => {
3243 var streamId = stream.getAttribute('id');
3244 streamId = streamId.substring(streamId.lastIndexOf('-') + 1);
3245 streamId = parseInt(streamId, 10);
3246 max = Math.max(max, streamId);
3247 });
3248 max = max + 1;
3249 var regex = new RegExp(divId, 'gi');
3250 div.innerHTML = data.replace(regex, divClass + '-' + max).replace('photonic-slideshow-' + divId.substring(divId.lastIndexOf('-') + 1), 'photonic-slideshow-' + max);
3251 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
3252
3253 div.querySelectorAll('figure.photonic-level-2').forEach(figure => {
3254 if (figure.getAttribute('id') != null) {
3255 var figId = figure.getAttribute('id');
3256 var modId = figId.substring(0, figId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3257
3258 figure.setAttribute('id', modId);
3259 var anchor = figure.querySelector('a');
3260
3261 if (anchor.getAttribute('id') != null) {
3262 var anchorId = anchor.getAttribute('id');
3263 var modAnchorId = anchorId.substring(0, anchorId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3264
3265 anchor.setAttribute('id', modAnchorId);
3266 }
3267
3268 var prompter = figure.querySelector('.photonic-password-prompter');
3269
3270 if (prompter != null && prompter.getAttribute('id') != null) {
3271 var prompterId = prompter.getAttribute('id');
3272 var modPrompterId = prompterId.substring(0, prompterId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3273
3274 prompter.setAttribute('id', modPrompterId);
3275 }
3276 }
3277 });
3278 clicked.insertAdjacentElement('afterend', div);
3279 var newDivId = divClass + '-' + max;
3280
3281 var lightbox = _Core.Core.getLightbox();
3282
3283 if (lightbox !== undefined && lightbox !== null) {
3284 lightbox.initializeForNewContainer('#' + div.getAttribute('id'));
3285 }
3286
3287 if (document.querySelectorAll('#' + newDivId + ' .photonic-random-layout').length > 0) {
3288 (0, _Justified.JustifiedGrid)(false, true, '#' + newDivId + ' .photonic-random-layout', lightbox);
3289 spinners--;
3290 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-masonry-layout').length > 0) {
3291 (0, _Masonry.Masonry)(false, true, '#' + newDivId + ' .photonic-masonry-layout');
3292 spinners--;
3293 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-masonry-horizontal-layout').length > 0) {
3294 (0, _MasonryHorizontal.MasonryHorizontal)(false, true, '#' + newDivId + ' .photonic-masonry-horizontal-layout');
3295 spinners--;
3296 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-mosaic-layout').length > 0) {
3297 (0, _Mosaic.Mosaic)(false, true, '#' + newDivId + ' .photonic-mosaic-layout');
3298 spinners--;
3299 } // Slider(document.querySelector('#photonic-slideshow-' + max));
3300
3301
3302 if (div.classList.contains('sizes-present') || div.querySelector('.sizes-present') !== null) {
3303 _Core.Core.watchForImages(div);
3304
3305 _Core.Core.standardizeTitleWidths();
3306
3307 countdownSpinners();
3308 } else {
3309 _Core.Core.waitForImages(div).then(() => {
3310 var standard = document.documentElement.querySelectorAll('#' + newDivId + ' .photonic-standard-layout .photonic-level-1, ' + '#' + newDivId + ' .photonic-standard-layout .photonic-level-2');
3311 standard.forEach(image => {
3312 image.style.display = 'inline-block';
3313 });
3314
3315 _Core.Core.standardizeTitleWidths();
3316
3317 countdownSpinners();
3318 });
3319 }
3320
3321 _Core.Core.moveHTML5External();
3322
3323 clicked.parentNode.removeChild(clicked);
3324 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3325
3326 if (spinners <= 0) {
3327 _Core.Core.hideLoading();
3328 }
3329 }
3330 });
3331 };
3332
3333 exports.lazyLoad = lazyLoad;
3334
3335 /***/ }),
3336
3337 /***/ "../include/js/front-end/src/Util.js":
3338 /*!*******************************************!*\
3339 !*** ../include/js/front-end/src/Util.js ***!
3340 \*******************************************/
3341 /*! flagged exports */
3342 /*! export HTMLSanitizer [provided] [no usage info] [missing usage info prevents renaming] */
3343 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
3344 /*! export fadeIn [provided] [no usage info] [missing usage info prevents renaming] */
3345 /*! export fadeOut [provided] [no usage info] [missing usage info prevents renaming] */
3346 /*! export get [provided] [no usage info] [missing usage info prevents renaming] */
3347 /*! export getElement [provided] [no usage info] [missing usage info prevents renaming] */
3348 /*! export getText [provided] [no usage info] [missing usage info prevents renaming] */
3349 /*! export hasClass [provided] [no usage info] [missing usage info prevents renaming] */
3350 /*! export hide [provided] [no usage info] [missing usage info prevents renaming] */
3351 /*! export next [provided] [no usage info] [missing usage info prevents renaming] */
3352 /*! export post [provided] [no usage info] [missing usage info prevents renaming] */
3353 /*! export show [provided] [no usage info] [missing usage info prevents renaming] */
3354 /*! export slideUpDown [provided] [no usage info] [missing usage info prevents renaming] */
3355 /*! export slideUpTitle [provided] [no usage info] [missing usage info prevents renaming] */
3356 /*! other exports [not provided] [no usage info] */
3357 /*! runtime requirements: __webpack_exports__ */
3358 /***/ ((__unused_webpack_module, exports) => {
3359
3360
3361
3362 Object.defineProperty(exports, "__esModule", ({
3363 value: true
3364 }));
3365 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;
3366
3367 // Utilities for Photonic
3368 var hasClass = (element, className) => {
3369 if (element.classList) {
3370 return element.classList.contains(className);
3371 } else {
3372 return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);
3373 }
3374 };
3375
3376 exports.hasClass = hasClass;
3377
3378 function ajax(method, url, args, callback) {
3379 var xhr = new XMLHttpRequest();
3380 xhr.open(method, url);
3381
3382 xhr.onreadystatechange = function () {
3383 if (xhr.readyState === 4) {
3384 if (xhr.status === 200) {
3385 var data = xhr.responseText;
3386 callback(data);
3387 }
3388 }
3389 };
3390
3391 var form = new FormData();
3392
3393 for (var [key, value] of Object.entries(args)) {
3394 form.append(key, value);
3395 }
3396
3397 xhr.send(form);
3398 }
3399
3400 var post = (url, args, callback) => {
3401 ajax('POST', url, args, callback);
3402 };
3403
3404 exports.post = post;
3405
3406 var get = (url, args, callback) => {
3407 ajax('GET', url, args, callback);
3408 };
3409
3410 exports.get = get;
3411
3412 var next = (elem, selector) => {
3413 var sibling = elem.nextElementSibling;
3414 if (!selector) return sibling;
3415
3416 while (sibling) {
3417 if (sibling.matches(selector)) return sibling;
3418 sibling = sibling.nextElementSibling;
3419 }
3420 };
3421
3422 exports.next = next;
3423
3424 var getElement = value => {
3425 var parser = new DOMParser();
3426 var doc = parser.parseFromString(value, 'text/html');
3427 return doc.body;
3428 };
3429
3430 exports.getElement = getElement;
3431
3432 var getText = value => {
3433 // Not using innerHTML because of vulnerability to XSS
3434 if (value == null) {
3435 return '';
3436 }
3437
3438 return value.replace(/<[^>]+>/g, '');
3439 };
3440
3441 exports.getText = getText;
3442
3443 var slideUpDown = (element, state) => {
3444 if (element != null && element.classList) {
3445 if (!element.classList.contains('photonic-can-slide')) {
3446 element.classList.add('photonic-can-slide');
3447 }
3448
3449 if ('show' === state) {
3450 element.classList.remove('photonic-can-slide-hide');
3451 element.style.height = "".concat(element.scrollHeight, "px");
3452 } else {
3453 element.classList.add('photonic-can-slide-hide');
3454 element.style.height = 0;
3455 }
3456 }
3457 };
3458
3459 exports.slideUpDown = slideUpDown;
3460
3461 var slideUpTitle = (element, state) => {
3462 if (element && element.classList) {
3463 if ('show' === state) {
3464 var currentPadding = 0;
3465
3466 if (element.offsetHeight) {
3467 currentPadding = parseInt(getComputedStyle(element).paddingTop.slice(0, -2)) * 2;
3468 }
3469
3470 element.style.height = element.scrollHeight + 6 - currentPadding + 'px';
3471 element.classList.add('slideup-show');
3472 } else {
3473 element.style.height = '';
3474 element.classList.remove('slideup-show');
3475 }
3476 }
3477 };
3478
3479 exports.slideUpTitle = slideUpTitle;
3480
3481 var fadeIn = el => {
3482 if (!hasClass(el, 'fade-in')) {
3483 el.style.display = 'block';
3484 el.style.visibility = 'visible';
3485 el.classList.add('fade-in');
3486 }
3487 };
3488
3489 exports.fadeIn = fadeIn;
3490
3491 var fadeOut = (el, duration) => {
3492 var s = el.style,
3493 step = 25 / (duration || 500);
3494 s.opacity = s.opacity || 1;
3495
3496 (function fade() {
3497 s.opacity -= step;
3498
3499 if (s.opacity < 0) {
3500 s.display = "none";
3501 el.classList.remove('fade-in');
3502 } else {
3503 setTimeout(fade, 25);
3504 }
3505 })();
3506 }; // get the default display style of an element
3507
3508
3509 exports.fadeOut = fadeOut;
3510
3511 var defaultDisplay = tag => {
3512 var iframe = document.createElement('iframe');
3513 iframe.setAttribute('frameborder', 0);
3514 iframe.setAttribute('width', 0);
3515 iframe.setAttribute('height', 0);
3516 document.documentElement.appendChild(iframe);
3517 var doc = (iframe.contentWindow || iframe.contentDocument).document; // IE support
3518
3519 doc.write();
3520 doc.close();
3521 var testEl = doc.createElement(tag);
3522 doc.documentElement.appendChild(testEl);
3523 var display = (window.getComputedStyle ? getComputedStyle(testEl, null) : testEl.currentStyle).display;
3524 iframe.parentNode.removeChild(iframe);
3525 return display;
3526 }; // actual show/hide function used by show() and hide() below
3527
3528
3529 var showHide = (el, show) => {
3530 var value = el.getAttribute('data-olddisplay'),
3531 display = el.style.display,
3532 computedDisplay = (window.getComputedStyle ? getComputedStyle(el, null) : el.currentStyle).display;
3533
3534 if (show) {
3535 if (!value && display === 'none') el.style.display = '';
3536 if (el.style.display === '' && computedDisplay === 'none') value = value || defaultDisplay(el.nodeName);
3537 } else {
3538 if (display && display !== 'none' || !(computedDisplay === 'none')) el.setAttribute('data-olddisplay', computedDisplay === 'none' ? display : computedDisplay);
3539 }
3540
3541 if (!show || el.style.display === 'none' || el.style.display === '') el.style.display = show ? value || '' : 'none';
3542 }; // helper functions
3543
3544
3545 var show = el => showHide(el, true);
3546
3547 exports.show = show;
3548
3549 var hide = el => showHide(el); //JavaScript HTML Sanitizer v2.0.3, (c) Alexander Yumashev, Jitbit Software.
3550 //homepage https://github.com/jitbit/HtmlSanitizer
3551 //License: MIT https://github.com/jitbit/HtmlSanitizer/blob/master/LICENSE
3552
3553
3554 exports.hide = hide;
3555 var HTMLSanitizer = new function () {
3556 var _tagWhitelist = {
3557 'A': true,
3558 'ABBR': true,
3559 'B': true,
3560 'BLOCKQUOTE': true,
3561 'BODY': true,
3562 'BR': true,
3563 'CENTER': true,
3564 'CODE': true,
3565 'DD': true,
3566 'DIV': true,
3567 'DL': true,
3568 'DT': true,
3569 'EM': true,
3570 'FONT': true,
3571 'H1': true,
3572 'H2': true,
3573 'H3': true,
3574 'H4': true,
3575 'H5': true,
3576 'H6': true,
3577 'HR': true,
3578 'I': true,
3579 'IMG': true,
3580 'LABEL': true,
3581 'LI': true,
3582 'OL': true,
3583 'P': true,
3584 'PRE': true,
3585 'SMALL': true,
3586 'SOURCE': true,
3587 'SPAN': true,
3588 'STRONG': true,
3589 'SUB': true,
3590 'SUP': true,
3591 'TABLE': true,
3592 'TBODY': true,
3593 'TR': true,
3594 'TD': true,
3595 'TH': true,
3596 'THEAD': true,
3597 'UL': true,
3598 'U': true,
3599 'VIDEO': true
3600 };
3601 var _contentTagWhiteList = {
3602 'FORM': true,
3603 'GOOGLE-SHEETS-HTML-ORIGIN': true
3604 }; //tags that will be converted to DIVs
3605
3606 var _attributeWhitelist = {
3607 'align': true,
3608 'color': true,
3609 'controls': true,
3610 'height': true,
3611 'href': true,
3612 'id': true,
3613 'src': true,
3614 'style': true,
3615 'target': true,
3616 'title': true,
3617 'type': true,
3618 'width': true
3619 };
3620 var _cssWhitelist = {
3621 'background-color': true,
3622 'color': true,
3623 'font-size': true,
3624 'font-weight': true,
3625 'text-align': true,
3626 'text-decoration': true,
3627 'width': true
3628 };
3629 var _schemaWhiteList = ['http:', 'https:', 'data:', 'm-files:', 'file:', 'ftp:', 'mailto:', 'pw:']; //which "protocols" are allowed in "href", "src" etc
3630
3631 var _uriAttributes = {
3632 'href': true,
3633 'action': true
3634 };
3635
3636 var _parser = new DOMParser();
3637
3638 this.SanitizeHTML = (input, extraSelector) => {
3639 if (input == null) return null;
3640 input = input.trim();
3641 if (input === "") return ""; //to save performance
3642 //firefox "bogus node" workaround for wysiwyg's
3643
3644 if (input === "<br>") return "";
3645 if (input.indexOf("<body") === -1) input = "<body>" + input + "</body>"; //add "body" otherwise some tags are skipped, like <style>
3646
3647 var doc = _parser.parseFromString(input, "text/html"); //DOM clobbering check (damn you firefox)
3648
3649
3650 if (doc.body.tagName !== 'BODY') doc.body.remove();
3651 if (typeof doc.createElement !== 'function') doc.createElement.remove();
3652
3653 function makeSanitizedCopy(node) {
3654 var newNode;
3655
3656 if (node.nodeType === Node.TEXT_NODE) {
3657 newNode = node.cloneNode(true);
3658 } else if (node.nodeType === Node.ELEMENT_NODE && (_tagWhitelist[node.tagName] || _contentTagWhiteList[node.tagName] || extraSelector && node.matches(extraSelector))) {
3659 //is tag allowed?
3660 if (_contentTagWhiteList[node.tagName]) newNode = doc.createElement('DIV'); //convert to DIV
3661 else newNode = doc.createElement(node.tagName);
3662
3663 for (var i = 0; i < node.attributes.length; i++) {
3664 var attr = node.attributes[i];
3665
3666 if (_attributeWhitelist[attr.name]) {
3667 if (attr.name === "style") {
3668 for (var s = 0; s < node.style.length; s++) {
3669 var styleName = node.style[s];
3670 if (_cssWhitelist[styleName]) newNode.style.setProperty(styleName, node.style.getPropertyValue(styleName));
3671 }
3672 } else {
3673 if (_uriAttributes[attr.name]) {
3674 //if this is a "uri" attribute, that can have "javascript:" or something
3675 if (attr.value.indexOf(":") > -1 && !startsWithAny(attr.value, _schemaWhiteList)) continue;
3676 }
3677
3678 newNode.setAttribute(attr.name, attr.value);
3679 }
3680 }
3681 }
3682
3683 for (var _i = 0; _i < node.childNodes.length; _i++) {
3684 var subCopy = makeSanitizedCopy(node.childNodes[_i]);
3685 newNode.appendChild(subCopy, false);
3686 } //remove useless empty spans (lots of those when pasting from MS Outlook)
3687
3688
3689 if ((newNode.tagName === "SPAN" || newNode.tagName === "B" || newNode.tagName === "I" || newNode.tagName === "U") && newNode.innerHTML.trim() === "") {
3690 return doc.createDocumentFragment();
3691 }
3692 } else {
3693 newNode = doc.createDocumentFragment();
3694 }
3695
3696 return newNode;
3697 }
3698
3699 var resultElement = makeSanitizedCopy(doc.body);
3700 return resultElement.innerHTML.replace(/div><div/g, "div>\n<div"); //replace is just for cleaner code
3701 };
3702
3703 function startsWithAny(str, substrings) {
3704 for (var i = 0; i < substrings.length; i++) {
3705 if (str.indexOf(substrings[i]) === 0) {
3706 return true;
3707 }
3708 }
3709
3710 return false;
3711 }
3712
3713 this.AllowedTags = _tagWhitelist;
3714 this.AllowedAttributes = _attributeWhitelist;
3715 this.AllowedCssStyles = _cssWhitelist;
3716 this.AllowedSchemas = _schemaWhiteList;
3717 }();
3718 exports.HTMLSanitizer = HTMLSanitizer;
3719
3720 /***/ })
3721
3722 /******/ });
3723 /************************************************************************/
3724 /******/ // The module cache
3725 /******/ var __webpack_module_cache__ = {};
3726 /******/
3727 /******/ // The require function
3728 /******/ function __webpack_require__(moduleId) {
3729 /******/ // Check if module is in cache
3730 /******/ if(__webpack_module_cache__[moduleId]) {
3731 /******/ return __webpack_module_cache__[moduleId].exports;
3732 /******/ }
3733 /******/ // Create a new module (and put it into the cache)
3734 /******/ var module = __webpack_module_cache__[moduleId] = {
3735 /******/ // no module.id needed
3736 /******/ // no module.loaded needed
3737 /******/ exports: {}
3738 /******/ };
3739 /******/
3740 /******/ // Execute the module function
3741 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
3742 /******/
3743 /******/ // Return the exports of the module
3744 /******/ return module.exports;
3745 /******/ }
3746 /******/
3747 /************************************************************************/
3748 (() => {
3749 /*!***********************************************************!*\
3750 !*** ../include/js/front-end/src/Entries/Featherlight.js ***!
3751 \***********************************************************/
3752 /*! unknown exports (runtime-defined) */
3753 /*! runtime requirements: __webpack_require__ */
3754
3755
3756 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
3757
3758 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
3759
3760 var _Featherlight = __webpack_require__(/*! ../Lightboxes/Featherlight */ "../include/js/front-end/src/Lightboxes/Featherlight.js");
3761
3762 var Listeners = _interopRequireWildcard(__webpack_require__(/*! ../Listeners */ "../include/js/front-end/src/Listeners.js"));
3763
3764 var Layout = _interopRequireWildcard(__webpack_require__(/*! ../Layouts/Layout */ "../include/js/front-end/src/Layouts/Layout.js"));
3765
3766 jQuery(document).ready(function ($) {
3767 var lightbox = new _Featherlight.PhotonicFeatherlight($);
3768
3769 _Core.Core.setLightbox(lightbox);
3770
3771 lightbox.initialize('.photonic-standard-layout,.photonic-random-layout,.photonic-masonry-layout,.photonic-mosaic-layout');
3772
3773 _Core.Core.executeCommon();
3774
3775 Listeners.addAllListeners();
3776 Layout.initializeLayouts(lightbox);
3777 });
3778 })();
3779
3780 /******/ })()
3781 ;