PageSourceSearch

https://unacuhcp.org/wp-content/themes/unac-uhcp/assets/js/app.js?ver=1790982063

js unacuhcp.org collected 2026-10-03 21:48:20 UTC 33,061 bytes, 1,036 lines download raw bytes

1/*!
2 * Initial config and attribute helpers
3 */
4(function(){
5	window.lazySizesConfig = window.lazySizesConfig || {};
6	window.lazySizesConfig.expand = 1500;
7
8	document.addEventListener('DOMContentLoaded', function(){ document.documentElement.setAttribute('ready', ''); });
9	window.addEventListener('load', function(){ document.documentElement.setAttribute('loaded', ''); });
10})();
11
12
13/*!
14 * Manage device/os/helpers classnames 20200830.0200
15 */
16(function(){
17	var ua = navigator.userAgent.toLowerCase();
18	var up = navigator.platform.toLowerCase();
19	var standard = ['firefox','android'];
20	var classes = [];
21
22	for (var i = 0, max = standard.length; i < max; i++) if (ua.indexOf(standard[i]) != -1) classes.push(standard[i]);
23	if (ua.indexOf('opr') > -1) classes.push('opera');
24	if (ua.indexOf('fxios') > -1) classes.push('firefox');
25	if (ua.indexOf('crios') > -1) classes.push('chrome');
26	if (ua.indexOf('chrome') > -1 && ua.indexOf('opr') == -1) classes.push('chrome');
27	if (ua.indexOf('safari') > -1 && ua.indexOf('chrome') == -1 && ua.indexOf('crios') == -1 && ua.indexOf('fxios') == -1) classes.push('safari');
28	if(/(ipad|iphone|ipod)/g.test(ua)) classes.push('ios');
29	if (up.indexOf('mac') > -1) classes.push('mac');
30	if (up.indexOf('win') > -1) classes.push('win');
31
32	document.documentElement.className += ' ' + classes.join(' ');
33})();
34
35
36/*!
37 * Intent Attributes
38 * @requires ten1seven/what-input
39 */
40(function(namespace){
41	var update = function(type) {
42		if(type == 'pointer') type = 'mouse';
43		['keyboard','mouse','touch'].forEach(function(value) {
44			if(type != value) document.documentElement.removeAttribute(value);
45		});
46		document.documentElement.setAttribute(type, '');
47	};
48	update(whatInput.ask('intent'));
49	whatInput.registerOnChange(update, 'intent');
50})('whatintent');
51
52
53/*!
54 * Open external links in a new tab
55 */
56(function(){
57	document.addEventListener('click', function(event){
58		var a = event.target.closest('a[rel*="external"]');
59		if (!a) return;
60		event.preventDefault();
61		window.open(a.getAttribute("href"));
62	});
63})();
64
65
66/*!
67 * Trigger clicks with keyboard on non-interactive elements
68 */
69(function(){
70	document.addEventListener('keypress', function(event){
71		var pressable = event.target.closest('[pressable]');
72		if (!pressable || event.key in [' ','Enter']) return;
73		event.preventDefault();
74		event.target.click();
75	});
76})();
77
78
79/*!
80 * Forms enhancements
81 */
82(function(namespace){
83	var autoresize = function(el) { el.style.height = 'auto'; el.style.height = (el.scrollHeight) + 'px'; };
84	var is_field = function(event) { return event.target && (event.target.matches('input') || event.target.matches('select') || event.target.matches('textarea')); };
85	var is_select = function(event) { return event.target && event.target.matches('select'); };
86	document.body.addEventListener('change', function(event){ if(is_select(event)){ if(event.target.matches('[link]')) window.location = event.target.value; } });
87	document.body.addEventListener('invalid', function(event){ if(is_field(event)) event.target.setAttribute('validated',true); }, true);
88	document.body.addEventListener('focusout', function(event){ if(is_field(event)) event.target.checkValidity(); });
89	document.body.addEventListener('input', function(event){ if(event.target.matches('textarea[autoresize]')) autoresize(event.target); });
90	var init = function() { document.querySelectorAll('textarea[autoresize]').forEach(function(el, index) { autoresize(el); }); };
91	window.addEventListener('reinitialize', init);
92	init();
93})('forms');
94
95
96/*!
97 * Attach window events
98 * @requires v.window.utils
99 */
100(function(){
101	if(typeof window.utils !== 'undefined'){
102		window.utils.listeners.add('scroll', 'throttled', 'throttle',  50);
103		window.utils.listeners.add('scroll', 'debounced', 'debounce', 100);
104		window.utils.listeners.add('resize', 'throttled', 'throttle', 100);
105		window.utils.listeners.add('resize', 'debounced', 'debounce', 200);
106	}
107
108	window.addEventListener('resize/debounced', function(event) {
109		if(event.detail.width) window.dispatchEvent(new CustomEvent('recalculate'));
110	});
111})();
112
113
114/*!
115 * Update --vw/--vh on resize
116 * @requires v.window.utils
117 */
118(function(){
119	var calculate = function() {
120		if(event.detail.width){
121			document.documentElement.style.setProperty('--vw', document.documentElement.clientWidth * 0.01 + 'px');
122			document.documentElement.style.setProperty('--vh', window.innerHeight * 0.01 + 'px');
123		}
124		if(event.detail.height) document.documentElement.style.setProperty('--vha', window.innerHeight * 0.01 + 'px');
125	};
126	window.addEventListener('resize/throttled', calculate);
127	window.addEventListener('resize/debounced', calculate);
128})('vwh');
129
130
131/*!
132 * Breakpoint ID v20240628.1500
133 */
134(function(){
135	var breakpoints = [600,1000,1300];
136	var calculate = function() {
137		var width = window.innerWidth;
138		window.breakpoint_id = breakpoints.findIndex(function(breakpoint){ return width < breakpoint; });
139		if (window.breakpoint_id === -1) window.breakpoint_id = breakpoints.length;
140	};
141
142	calculate();
143	window.addEventListener('resize/debounced', calculate);
144})('breakpoints');
145
146
147/*!
148 * Reveals v20240628.1500
149 * Trigger animations on scroll
150 * @requires wilsonpage/fastdom
151 * @requires v.breakpoints
152 */
153(function(namespace){
154    var selector = '[reveal]:not([reveal*="+"]):not([subreveal])';
155    var margins = '1% 1% -7% 1%';
156
157	var get_delay = function(el) {
158		var data = el.getAttribute('reveal') || false;
159		var delay = (data) ? (data + '').split('/')[1] : false;
160
161		if(el.hasAttribute('delay')){
162			var delays = el.getAttribute('delay');
163			var matches = delays.match(/^([^\/]+)?\/?([^\/]+(?=\/\/))?(?:\/{2})?((?<=\/\/)[^\/]+)?\/?([^\/]+)?$/);
164			for (var i = (window.breakpoint_id || 0); i >= 0; i--) {
165				if (matches[i+1]) return matches[i+1];
166			}
167			return false;
168		}
169		return delay;
170	};
171
172	var process = function(el, sub = false) {
173		var delay = get_delay(el);
174		if(delay && delay >= 25){
175			setTimeout(function(){ reveal(el, sub); }, delay);
176		} else {
177			reveal(el, sub);
178		}
179	};
180
181    var reveal = function(el, sub = false) {
182        fastdom.mutate(function(){
183			if (!sub) {	// subreveals first
184				el.querySelectorAll('[subreveal]').forEach(function(entry) {
185					if(entry.closest('[reveal]:not([subreveal])') == el){
186						process(entry, true);
187					}
188				});
189			}
190
191            var value = el.getAttribute('reveal');
192            if (value == '' || value.substring(0,1) == '/') {
193                el.removeAttribute('reveal');
194                el.setAttribute('revealed', value);
195                el.dispatchEvent(new CustomEvent('revealed'));
196            } else {
197                el.setAttribute('revealing',value);
198                el.dispatchEvent(new CustomEvent('revealing'));
199                el.addEventListener('transitionend', function () {
200                    el.removeAttribute('reveal');
201                    el.removeAttribute('revealing');
202                    el.setAttribute('revealed', value);
203                    el.dispatchEvent(new CustomEvent('revealed'));
204                }, {once: true});
205            }
206        });
207    };
208
209    var init = function() {
210        if ('IntersectionObserver' in window && document.documentElement.matches('[m4n]')) {
211            var observer = new IntersectionObserver(function(entries, observer){
212                entries.forEach(function(entry) {
213                    if(entry.isIntersecting){
214						process(entry.target);
215                        observer.unobserve(entry.target);
216                    }
217                });
218            },{ rootMargin: margins });
219
220            setTimeout(function() {
221                eachOnce(selector, namespace, function(index, root) {
222                    if(root.offsetParent && root.getBoundingClientRect().bottom < 100){
223                        reveal(root);
224                    } else {
225                        observer.observe(root);
226                    }
227                });
228            },100);
229        }  else {
230            eachOnce(selector, namespace, function(index, root) {
231                reveal(root);
232            });
233        }
234    };
235
236    window.addEventListener('reinitialize', init);
237    init();
238})('reveal');
239
240
241/*!
242 * (v) Reveal Delays Sequencer v20240328.1945
243 * Sequence elements in the same row and in groups
244 */
245(function(namespace){
246
247	var init = function(){
248		var els = document.querySelectorAll('[aligned]');
249		var data = {};
250
251		els.forEach(function(el, index) {
252			if(!el.offsetParent) return;
253			var offset = el.getBoundingClientRect();
254			var group = el.getAttribute('aligned') || 0;
255			var id = 't' + Math.ceil(offset.top);
256			if(!data.hasOwnProperty(group)) data[group] = {};
257			if(!data[group].hasOwnProperty(id)) data[group][id] = [];
258			data[group][id].push({el: el, left: Math.ceil(offset.left)});
259		});
260
261		for (var group in data) {
262			if (data.hasOwnProperty(group)) {
263				for (var key in data[group]) {
264					if (data[group].hasOwnProperty(key)) {
265						var set = data[group][key];
266						set.sort(function(obj1, obj2) {
267							return obj1.left - obj2.left;
268						});
269						set.forEach(function(item,index){
270							item.el.style.setProperty('--rvq', index);
271						});
272					}
273				}
274			}
275		}
276	};
277
278	window.addEventListener('reinitialize', init);
279	window.addEventListener('recalculate', init);
280	init();
281
282})('aligned');
283
284
285/*!
286 * Remote hovers
287 * @requires eachOnce
288 */
289(function(namespace){
290	var init = function(){
291		eachOnce('[hoverwatch]', namespace, function(index, root) {
292			root.addEventListener('mouseenter', function(event) {
293				root.closest('[hovercatch]').setAttribute('hover',true);
294			});
295			root.addEventListener('mouseleave', function(event) {
296				root.closest('[hovercatch]').removeAttribute('hover');
297			});
298			root.addEventListener('focus', function(event) {
299				root.closest('[hovercatch]').setAttribute('hover', true);
300			});
301			root.addEventListener('blur', function(event) {
302				root.closest('[hovercatch]').removeAttribute('hover');
303			});
304		});
305	};
306
307	init();
308	window.addEventListener('reinitialize', init);
309})('hoverwatch');
310
311
312/*!
313 * (v) Offset Watcher v20240110.1300
314 */
315(function(namespace){
316    var selector = '[offsetwatch]';
317    var update = function(el) {
318        el.style.removeProperty('--offset-left');
319        el.style.removeProperty('--offset-right');
320        var offset = el.getBoundingClientRect();
321        el.style.setProperty('--offset-left', offset.left + 'px');
322        el.style.setProperty('--offset-right', document.documentElement.clientWidth - offset.right + 'px');
323        el.style.setProperty('--offset-width', offset.width + 'px');
324    };
325    var calculate = function(){
326        document.querySelectorAll(selector)?.forEach(function(el, index) {
327            update(el);
328        });
329        eachOnce(selector, namespace, function(index, el) {
330            el.addEventListener('update', function() { update(el); });
331        });
332    };
333    calculate();
334	setTimeout(function(){ calculate(); }, 500);
335    window.addEventListener('reinitialize', calculate);
336    window.addEventListener('recalculate', calculate);
337})('offsetwatch');
338
339
340/*!
341 * (v) Auto pause/play videos v20250213.1230
342 */
343(function(namespace){
344    if ('IntersectionObserver' in window) {
345        var selector = '[' + namespace + ']';
346        var init = function() {
347			eachOnce(selector, namespace, function(index, root) {
348				var observer = new IntersectionObserver(function(entries, observer){
349					entries.forEach(function(entry) {
350						if (!entry.isIntersecting) {
351							entry.target.pause();
352						}
353						if (root.matches('[autoplay]') && entry.isIntersecting) {
354							entry.target.play();
355						}
356					});
357				}, { root: root, threshold: 0.5 });
358				root.querySelectorAll('video').forEach(function(video){
359					observer.observe(video);
360				});
361            });
362        };
363
364        window.addEventListener('reinitialize', init);
365        init();
366    }
367})('autopause');
368
369
370/*!
371 * (v) Toaster 20211211.2315
372 * Toast notifications
373 */
374(function(namespace){
375	var wrap = document.createElement('div');
376	wrap.classList.add(namespace);
377	document.body.append(wrap);
378
379	window.addEventListener('toast', function(event) {
380		var time = event.detail.time || 2000;
381		var p = document.createElement('p');
382		p.innerHTML = '<span>' + event.detail.message + '</span>';
383		if(event.detail.class) p.setAttribute('class', event.detail.class);
384		p.onClick = function(event) { event.target.classList.remove('-active'); };
385		wrap.append(p);
386		p.getBoundingClientRect();
387		p.classList.add('-active');
388		setTimeout(function() {
389			p.classList.remove('-active');
390			setTimeout(function() {
391				p.remove();
392			},time);
393		},time);
394	});
395
396	window.toast = function(message, classname, time) {
397		window.dispatchEvent(new CustomEvent('toast', { detail: { message: message, class: classname, time: time} }));
398	};
399})('toaster1');
400
401
402/*!
403* Cookie helpers v20240319.1900
404*/
405(function(namespace){
406    window.get_cookie = function(name) {
407		var value = `; ${document.cookie}`;
408		var parts = value.split(`; ${name}=`);
409		if (parts.length === 2) return parts.pop().split(';').shift();
410    };
411    window.set_cookie = function(name, days) {
412        var days = days || 365;
413        var d = new Date;
414        d.setTime(d.getTime() + 24*60*60*1000*days);
415        document.cookie = name + "=1;path=/;expires=" + d.toGMTString();
416    };
417})('cookies');
418
419
420/*!
421 * Fix for ol[start]
422 */
423(function(namespace){
424	var init = function() {
425		document.querySelectorAll('ol[start]').forEach(function(el, index) {
426			el.style.counterReset = 'ordered ' + (parseInt(el.getAttribute('start'),10) - 1);
427		});
428	};
429
430	window.addEventListener('reinitialize', init);
431	init();
432})('olstart');
433
434
435/*!
436 * Lazyload images v20230428.1400
437 * @requires eachOnce
438 */
439(function(namespace){
440	var loaded = function(event){
441		event.currentTarget.removeAttribute('waiting');
442		event.currentTarget.setAttribute('loaded', true);
443	}
444	var error = function(event){
445		event.currentTarget.removeAttribute('waiting');
446		event.currentTarget.setAttribute('error', true);
447	}
448	var init = function(){
449		eachOnce('img[loading="lazy"]:not([loaded])', namespace, function(index, root) {
450			if (!root.complete) {
451				root.setAttribute('waiting', true);
452				root.addEventListener('load', loaded, false);
453				root.addEventListener('error', error, false);
454			} else {
455				root.setAttribute('loaded', true);
456			}
457		});
458	};
459
460	window.addEventListener('reinitialize', init);
461	init();
462})('lazy');
463
464
465/*!
466 * Autosizes v20230428.1400
467 * Set [sizes] attribute of an image automatically
468 */
469(function(namespace){
470	var init = function(){
471		document.querySelectorAll('img[autosizes]')?.forEach(function(el, index) {
472			el.setAttribute('sizes', el.offsetWidth + 'px')
473		});
474	};
475
476	window.addEventListener('reinitialize', init);
477	window.addEventListener('recalculate', init);
478	init();
479})('autosizes');
480
481
482/*!
483 * Sentry v20211120.1930
484 * Event trigger on viewport enter/leave
485 */
486(function(namespace){
487    if ('IntersectionObserver' in window) {
488        var selector = '.' + namespace;
489        var init = function() {
490
491            var observer = new IntersectionObserver(function(entries, observer){
492                entries.forEach(function(entry) {
493                    var top = !(entry.boundingClientRect.top > window.innerHeight / 2);
494                    var visible = entry.isIntersecting;
495                    if (entry.target.dataset.loaded || entry.target.hasAttribute('initial')){
496                        var what = visible ? 'enter' : 'leave';
497                        var where = top ? 'top' : 'bottom';
498                        entry.target.dispatchEvent(new CustomEvent(what));
499                        entry.target.dispatchEvent(new CustomEvent(what + ':' + where));
500                    } else {
501                        entry.target.dataset.loaded = true;
502                    }
503                });
504            });
505
506            eachOnce(selector, namespace, function(index, root) {
507                observer.observe(root);
508            });
509        };
510
511        window.addEventListener('reinitialize', init);
512        init();
513    }
514})('sentry1');
515
516
517/*!
518 * Skippable dropdowns v20250905.1000
519 * @requires eachOnce
520 */
521(function(namespace){
522	document.addEventListener('click', function(event){
523		var button = event.target.closest('[droptoggle]');
524		if (!button) return;
525		event.preventDefault();
526		button.setAttribute('aria-expanded', button.getAttribute('aria-expanded') == 'true' ? 'false' : 'true');
527	});
528
529	var init = function(){
530		eachOnce('[dropmenu]', namespace, function(index, root) {
531			var parent = root.parentNode;
532			parent.addEventListener('focusout', function(event) {
533				if (!parent.contains(event.relatedTarget)) {
534					parent.querySelector('[droptoggle]')?.setAttribute('aria-expanded', false);
535				}
536			});
537		});
538	};
539	init();
540	window.addEventListener('reinitialize', init);
541})('dropdowns');
542
543
544/*!
545 * (v) Equalize v20190423.0200
546 * Equalize height of elements in the same line (with grouping [equalize="1"] > [equalize="2"] > [equalize])
547 */
548(function(namespace){
549	var equalize = function(els){
550		var data = {};
551
552		if(els.length < 2) return false;
553
554		els.forEach(function(el) {
555			el.style.removeProperty('--equalize');
556			var line = Math.ceil(el.getBoundingClientRect().top);
557			var height = el.offsetHeight;
558			if(el.matches('[equalize~="bottom"]')) line += height;
559			var id = 'w' + line;
560			if(!data.hasOwnProperty(id)) data[id] = {max: 0, els: []};
561			data[id].els.push({el: el, line: line, height: height});
562			data[id].max = Math.max(data[id].max,height);
563		});
564
565		Object.keys(data).forEach(function(key) {
566			var entry = data[key];
567			if(entry.els.length < 2) return;
568			entry.els.forEach(function(item,index){
569				item.el.style.setProperty('--equalize', entry.max + 'px');
570			});
571		});
572	};
573
574	var init = function() {
575		var els = document.querySelectorAll('[equalize]');
576		if(els.length < 1) return false;
577		els.forEach(function(el) { el.style.removeProperty('--equalize'); });
578
579		for (var i = 1; i <= 10; i++) {
580			var group = document.querySelectorAll('[equalize~="' + i + '"]');
581			if(group.length < 2) continue;
582			group.forEach(function(el) { el.setAttribute('equalize-group', i); });
583			equalize(group);
584		}
585		equalize(document.querySelectorAll('[equalize]:not([equalize-group])'));
586	};
587
588	window.addEventListener('reinitialize', init);
589	window.addEventListener('recalculate', init);
590	init();
591	setTimeout(init,250);
592})('equalize');
593
594
595/*!
596 * Globals
597 * @requires alpinejs/alpine
598 */
599(function(namespace){
600	document.addEventListener('alpine:init', function(){
601
602		Alpine.store('app', {
603			overlay: false,
604			states: {},
605			unoverlay: function(){ // reset all states that indicate overlay (2+)
606				for (const property in this.states) if(this.states[property] > 1) this.states[property] = false
607			}
608		});
609
610		Alpine.effect(function(){ // watch states and act on overlay
611			var states = Alpine.store('app').states;
612			var status = false;
613			for (const property in states) if(states[property] > 1) status = states[property];
614			Alpine.store('app').overlay = status;
615		});
616
617		Alpine.bind('transitions', function(){
618			return {
619				'x-transition:enter': '-transition -enter',
620				'x-transition:enter-start': '-from -enter-start',
621				'x-transition:enter-end': '-to -enter-end',
622				'x-transition:leave': '-transition -leave',
623				'x-transition:leave-start': '-to -leave-start',
624				'x-transition:leave-end': '-from -leave-end'
625			};
626		});
627
628	});
629})('app');
630
631
632/*!
633 * (v) Archives v20240610.1800
634 * @requires alpinejs/alpine
635 */
636(function(namespace){
637	document.addEventListener('alpine:init', function(){
638
639		// utils
640
641		var compare = function(o1, o2, exclude) { // compare two object excluding some properties
642			var c1 = JSON.parse(JSON.stringify(o1));
643			var c2 = JSON.parse(JSON.stringify(o2));
644			exclude?.forEach(function(el, index) {
645				if(c1.hasOwnProperty(el)) delete c1[el];
646				if(c2.hasOwnProperty(el)) delete c2[el];
647			});
648			return JSON.stringify(c1) === JSON.stringify(c2);
649		};
650
651		var urlbuilder = function(params, base, extras) { // build url from filters
652			var url = new URL(base || window.location.href);
653			url.searchParams.delete('page');
654			url.hash = '';
655
656			// delete and apply filters from blueprint
657			for ([group, value] of Object.entries(Object.assign({}, params, extras || {}))) {
658				if (Array.isArray(value)) {
659					url.searchParams.delete(group + '[]');
660					if (value && value.length){
661						value.forEach(function(el, index) {
662							url.searchParams.append(group + '[]', el);
663						});
664					}
665				} else {
666					url.searchParams.delete(group);
667					if (value && value != '') url.searchParams.set(group, value);
668				}
669			};
670
671			return url;
672		};
673
674		// initialize
675
676		var init = function(){
677			eachOnce('[' + namespace + ']', namespace, function(index, el) {
678				var id = el.getAttribute('id');
679
680				var instant; // load results instantly
681				var initialized; // set after first effects run
682				var debouce; // debouce variable for
683
684				var opts = JSON.parse(el.getAttribute(namespace)) || '{}';
685
686				opts.status = null; // loading status indicator (false - idle, 1 - appending, 2 - replacing)
687				opts.filters = Object.assign({}, opts.blueprint, opts.filters);
688				opts.filtered = !compare(opts.filters, opts.blueprint, opts.exclude); // helper var to know when results are filtered
689
690				opts.unfilter = function(group, value) { // remove filters
691					var that = this;
692					if (group) { // remove particular filter
693						if (typeof value == 'undefined' || this.filters[group] == value){
694							this.filters[group] = this.blueprint[group];
695						} else {
696							var index = this.filters[group].indexOf(value);
697							if (index > -1) this.filters[group] = this.filters[group].filter(function(v,i,a) { return i != index; }); // force filter updates
698						}
699					} else { // remove all except excluded
700						var excluded = {};
701						this.exclude?.forEach(function(el, index) { excluded[el] = that.filters[el]; });
702						this.filters = Object.assign({}, this.blueprint, excluded);
703					}
704				};
705
706				opts.load = function(url, append, extras) { // load url and replace slots
707					var that = this;
708					var url = url || urlbuilder(that.filters, that.base, extras).toString();
709					that.status = append ? 1 : 2;
710
711					fetch(url, { headers: {'X-Requested-With': 'XMLHttpRequest' }}).then(function (response) {
712						return response.text();
713					}).then(function (html) {
714						var parser = new DOMParser();
715						var _html = parser.parseFromString(html, 'text/html');
716
717						document.querySelectorAll('[slot^="' + id + '/"]').forEach(function(el, index) {
718							var name = el.getAttribute('slot');
719							var subname = name.replace(id + '/', '');
720							var updated = _html.querySelector('[slot="' + name + '"]')?.innerHTML;
721							if(!(subname.includes(['entries']) && append)) el.innerHTML = '';
722							if(updated) el.insertAdjacentHTML('beforeend', updated);
723						});
724
725						if (that.urls && !append)
726							history.replaceState(null, null, url + (that.hash ? '#' + that.hash : '')) // update url but not when appending
727
728						that.status = null; // reset status
729						window.dispatchEvent(new CustomEvent('reinitialize'));
730					}).catch(function (err) {
731						console.warn('Something went wrong.', err);
732						if(typeof toast != 'undefined') toast('Error', '-c:e1t -cs:i'); // show error notification
733						that.status = null;  // reset status
734					});
735				};
736
737				opts.sort = function(name) { // sorting helper
738					instant = true;
739					if(this.filters.sort == name){
740						this.filters.order = this.filters.order == 'asc' ? 'desc' : 'asc';
741					} else {
742						this.filters.sort = name;
743						this.filters.order = this.blueprint.order;
744					}
745					setTimeout(function() { instant = false; }, 0);
746				};
747
748				opts.label = function(group, item) { // fetch labels for tags
749					if (!Array.isArray(this.blueprint[group])){ // if group is not array
750						var radio = document.querySelector('[type="radio"][name="' + group + '"][value="' + item + '"]');
751						if(radio){
752							return radio.getAttribute('label');
753						} else {
754							return typeof formatters !== 'undefined' && formatters[group] ? formatters[group].to(item) : item;
755						}
756					} else {
757						return document.querySelector('[name="' + group + '[]"][value="' + item + '"]').getAttribute('label');
758					}
759				};
760
761				opts.init = function() { // initialize watchers
762					var that = this;
763
764					Alpine.effect(function() {
765						for (var [key, value] of Object.entries(that.filters)) {}; // hack to trigget effect deep watch
766						if(!initialized) return initialized = true; // do not run on initial store init
767						that.filtered = !compare(that.filters, that.blueprint, that.exclude); // helper var to know when results are filtered
768						that.status = 2; // set status to replacing
769
770						var delay = that.filtered && !instant ? (that.delay || 1000) : 0; // no delay when resetting or when instant is set
771						clearTimeout(debouce);
772						debouce = setTimeout(function() { that.load(); }, delay);
773					});
774				};
775
776				Alpine.store(id, opts);
777			});
778		};
779
780		window.addEventListener('reinitialize', init);
781		init();
782	});
783})('archives');
784
785
786/*!
787 * (v) Simple Carousel v20240602.1830
788 * @requires alpinejs/alpine
789 */
790(function(namespace){
791	document.addEventListener('alpine:init', function(){
792		Alpine.data(namespace, function(){
793			return {
794				track: null,
795				progress: 0,
796				indicator: 0,
797				wrapper: null,
798				viewport: null,
799				scroll: null,
800				monitor: function() {
801					this.progress = this.wrapper.scrollLeft / this.track;
802				},
803				update: function() {
804					this.track = this.wrapper.scrollWidth - this.wrapper.clientWidth;
805					this.indicator = this.wrapper.clientWidth / this.wrapper.scrollWidth;
806					this.viewport = this.$root.offsetWidth;
807					this.scroll = Math.floor(window.getComputedStyle(this.$root).getPropertyValue('--c') || 1) * this.wrapper.querySelector(':scope > :first-child').offsetWidth;
808					this.monitor();
809				},
810				next: function() {
811					this.wrapper.scrollLeft = this.wrapper.scrollLeft + this.scroll;
812				},
813				prev: function() {
814					this.wrapper.scrollLeft = this.wrapper.scrollLeft - this.scroll;
815				},
816				init: function() {
817					var that = this;
818					this.wrapper = this.$root.querySelector('[wrapper]');
819					this.update();
820
821					this.$root.querySelector('[track]')?.addEventListener('click', function(event) {
822						var box = that.$el.getBoundingClientRect();
823						var progress = (event.clientX - box.left) / that.$el.clientWidth;
824						that.wrapper.scrollLeft = that.wrapper.scrollWidth * progress;
825					});
826
827					this.wrapper.addEventListener('scroll', Alpine.throttle(function() { that.monitor(); }, 40));
828					this.wrapper.addEventListener('scroll', Alpine.debounce(function() { that.monitor(); }, 80));
829					window.addEventListener('recalculate', function() { setTimeout(function() { that.update(); },1); });
830				}
831			};
832		});
833	});
834})('carousel');
835
836
837/*!
838* (v) Tabbed v20220929.1445
839*/
840(function(namespace){
841    window.addEventListener('click', function(event) {
842        var link = event.target.closest('[' + namespace +']');
843        if (!link) return;
844
845        event.preventDefault();
846        var tabs = link.closest('[tabs]');
847        var url = link.getAttribute('href');
848        var selector = link.getAttribute(namespace);
849        var wrapper = document.querySelector(selector);
850
851        wrapper.setAttribute('loading','');
852        fetch(url, { headers: {'X-Requested-With': 'XMLHttpRequest' } }).then(function (response) {
853            return response.text();
854        }).then(function (html) {
855            var parser = new DOMParser();
856            var parsed = parser.parseFromString(html, 'text/html');
857            var _wrapper = parsed.querySelector(selector);
858            wrapper.innerHTML = _wrapper.innerHTML;
859
860            wrapper.removeAttribute('loading');
861            tabs.querySelectorAll(':scope > *').forEach(function(el, index){
862                if(el == link.closest('[tabs] > *')){
863                    el.setAttribute('aria-current','page');
864                } else {
865                    el.removeAttribute('aria-current')
866                }
867            });
868			history.replaceState(null, null, url) // update url but not when appending
869            window.dispatchEvent(new CustomEvent('reinitialize'));
870        }).catch(function (err) {
871            console.warn('Something went wrong.', err);
872            if(typeof toast != 'undefined') toast('Error','-c:e1t -cs:i'); // show error notification
873            wrapper.removeAttribute('loading');
874        });
875
876    });
877})('tabber');
878
879
880/*!
881 * Collapse v20231023.2115
882 * @requires alpinejs/alpine
883 */
884(function(namespace){
885    var act = function (event, root) {
886        if(event.target != root) return
887        window.dispatchEvent(new CustomEvent('recalculate'))
888    };
889
890    var init = function(){
891        eachOnce('[collapse]:not([norecalc])', namespace, function(index, root) {
892            root.addEventListener('transitionend', function(event) { act(event,root); });
893            root.addEventListener('transitioncancel', function(event) { act(event,root); });
894        });
895    };
896
897    init();
898    window.addEventListener('reinitialize', init);
899
900    document.addEventListener('alpine:init', function(){
901        Alpine.data(namespace, function(){
902            return {
903                open: {},
904                show: function(state) {
905                    if (state) this.$el.style.display = null;
906                    this.$el.style.setProperty('--height', this.$el.scrollHeight + 'px');
907                    if (state) this.$el.style.display = 'none';
908                    return state;
909                },
910				toggle: function(id, single) {
911					if(single){
912						this.open = this.open[id] ? {}
912 : {[id]: true};
913					} else {
914						this.open[id] = !this.open[id];
915					}
916				}
917            }
918        });
919    });
920})('collapse');
921
922
923/*!
924 * (v) Tiny Slider v20220325.1630
925 * @requires alpinejs/alpine
926 * @requires ganlanyuan/tiny-slider
927 */
928(function(namespace){
929	window.carousels = window.carousels || {};
930
931	window.carousels.gallery1 = {
932		gutter: 10,
933		items: 1,
934		slideBy: 1,
935		speed: 500,
936		controls: false,
937		nav: false,
938		loop: false,
939		rewind: true,
940		preventScrollOnTouch: 'auto',
941		responsive: { 600: { gutter: 20 } },
942		callbacks: {
943			'indexChanged': function(index, info, alpine) {
944				var caption = alpine.$el.querySelector('[entry="' + index + '"] [caption]');
945				if (caption) alpine.caption = caption.innerHTML;
946			}
947		}
948	};
949
950	document.addEventListener('alpine:init', function(){
951		Alpine.data(namespace, function(){
952			return {
953				first: false,
954				last: false,
955				captions : function() {
956					var caption = this.$el.querySelector('.tns-slide-active[entry] [caption]');
957					this.caption = caption ? caption.innerHTML : '';
958				},
959				update: function() {
960					var info = this.carousel.getInfo();
961					this.transitioning = false;
962					this.first = this.current == 0;
963					this.last = this.current >= this.count - info.items;
964					this.pages = Math.ceil(this.carousel.getInfo().slideCount / this.carousel.getInfo().slideBy);
965					this.page = Math.ceil(this.current / info.slideBy + 1);
966				},
967				create : function(settings_id) {
968					var that = this;
969					var opts = window.carousels[settings_id];
970					opts.container = that.$el.querySelector('[entries]');
971					if(this.$el.hasAttribute('autoplay')) opts.autoplay = this.$el.getAttribute('autoplay');
972
973					that.current = opts.startIndex || 0;
974					that.count = this.$el.querySelectorAll('[entry]').length;
975					if (opts.callbacks && opts.callbacks['beforeInit']) opts.callbacks['beforeInit'](that);
976					this.carousel = tns(opts);
977					this.update();
978
979					this.carousel.events.on('indexChanged', function(info) {
980						that.previous = that.current;
981						that.current = info.displayIndex - 1;
982						that.first = that.current == 0;
983						that.last = that.current >= info.slideCount - info.items;
984						that.page = Math.ceil(that.current / info.items + 1);
985						if (opts.callbacks && opts.callbacks['indexChanged']) opts.callbacks['indexChanged'](info.displayIndex, info, that);
986					});
987					this.carousel.events.on('transitionStart', function(info) {
988						that.transitioning = true;
989					});
990					this.carousel.events.on('transitionEnd', function(info) {
991						that.transitioning = false;
992					});
993
994					window.addEventListener('recalculate', function() {
995						that.update();
996					});
997				}
998			};
999		});
1000	});
1001})('slider');
1002
1003
1004/*!
1005 * Terms collapse
1006 */
1007(function(namespace){
1008
1009    var display_more_entities = document.querySelectorAll('.display-more-terms');
1010    display_more_entities.forEach(function(el){
1011        var stored_text = el.innerHTML;
1012        var display_tab = el.parentElement;
1013        el.addEventListener('click', function(event) {
1014			console.log('click');
1015            display_tab.classList.toggle("-show-all");
1016            el.innerHTML = (el.innerHTML == '- Collapse locals') ? stored_text : '- Collapse locals' ;
1017        });
1018    });
1019
1020})('terms-toggle');
1021
1022
1023/*!
1024 * Initialize Alpine
1025 * @requires alpinejs/alpine
1026 */
1027(function(){
1028    window.Alpine.start();
1029	var init = function() {
1030		document.querySelectorAll('[cloaked]').forEach(function(el, index) {
1031			el.removeAttribute('cloaked');
1032		});
1033	};
1034	window.addEventListener('reinitialize', init);
1035    init();
1036})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.