PageSourceSearch

https://axen.ch/js/default.js?1790311354

js axen.ch collected 2026-09-25 04:42:46 UTC 91,048 bytes, 2,498 lines download raw bytes

1"use strict";
vendor: 9,398 bytes, lines 2-5
2
3function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
5function asyncGeneratorStep(
5n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
6function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
7// declare match media globally
8var mm = gsap.matchMedia();
9function isMobile() {
10  return window.matchMedia("(max-width: 768px)").matches;
11}
12window.addEventListener("load", function () {
13  "use strict";
14
15  //** GSAP registerPlugins */
16  gsap.registerPlugin(ScrollTrigger);
17  gsap.config({
18    nullTargetWarn: false
19  });
20  watchBreakpoint();
21  load_html();
22  //lenis();
23  //anchorLinks();
24  navigation(); // Dynamisch geladene Navigation basierend auf Config
25  handleHeader();
26  sliderHeight();
27  fancybox();
28  animations();
29  //cookies();
30  loadTimeline();
31  loadNewsButton();
32  loadMore();
33  loadMoreGalerie();
34  //maps();
35
36  if (document.querySelector('.news-grid')) {
37    loadMore();
38    channelFilter();
39  }
40
41  //barbaRun();
42
43  // Initialize nextEntryReveal if we're on a _entry page
44  if (document.querySelector('[data-barba-namespace="entry-page"]')) {
45    nextEntryReveal();
46  }
47});
48
49//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
50// WATCH BREAKPOINT
51//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
52
53function watchBreakpoint() {
54  function debounce(func, wait) {
55    var timeout;
56    return function executedFunction() {
57      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
58        args[_key] = arguments[_key];
59      }
60      var later = function later() {
61        clearTimeout(timeout);
62        func.apply(void 0, args);
63      };
64      clearTimeout(timeout);
65      timeout = setTimeout(later, wait);
66    };
67  }
68  function isMobileLandscape() {
69    return window.matchMedia('(orientation: landscape)').matches && window.innerWidth <= 767 && window.innerHeight <= 500;
70  }
71  var lastMobile = isMobile();
72  var lastMobileLandscape = isMobileLandscape();
73  window.addEventListener('resize', debounce(function () {
74    var nowMobile = isMobile();
75    var nowMobileLandscape = isMobileLandscape();
76    if (nowMobile === lastMobile && nowMobileLandscape === lastMobileLandscape) return;
77    lastMobile = nowMobile;
78    lastMobileLandscape = nowMobileLandscape;
79
80    // Navigation: DOM-Listener via cloneNode bereinigen, dann neu init
81    var navEl = document.querySelector('nav.navigation');
82    if (navEl) {
83      var fresh = navEl.cloneNode(true);
84      navEl.parentNode.replaceChild(fresh, navEl);
85      gsap.set(fresh, {
86        clearProps: 'opacity,visibility'
87      });
88    }
89    navigation();
90    handleHeader();
91    sliderHeight();
92
93    // GSAP ScrollTrigger zurücksetzen
94    ScrollTrigger.getAll().forEach(function (t) {
95      return t.kill();
96    });
97    animations();
98  }, 300));
99}
100
101//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
102// LOAD HTML
103//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
104
105function load_html() {
106  gsap.to("html", {
107    opacity: 1,
108    duration: 1,
109    ease: "power4.inOut"
110  });
111}
112
113//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
114// LENIS
115//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
116
117function lenis() {
118  // Initialize Lenis
119  var lenis = new Lenis({
120    lerp: 0.05,
121    wheelMultiplier: 0.8,
122    smoothTouch: true,
123    touchMultiplier: 0.7,
124    infinite: false,
125    orientation: 'vertical'
126  });
127
128  // Make lenis available globally (optional but useful)
129  window.lenis = lenis;
130
131  // Synchronize Lenis with GSAP's ScrollTrigger
132  lenis.on('scroll', ScrollTrigger.update);
133
134  // Add Lenis's raf method to GSAP's ticker
135  gsap.ticker.add(function (time) {
136    lenis.raf(time * 1000); // GSAP time is in seconds, Lenis expects ms
137  });
138
139  // Disable GSAP lag smoothing to ensure real-time syncing
140  gsap.ticker.lagSmoothing(0);
141}
142
143//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
144// ANCHOR LINKS
145//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
146
147function anchorLinks() {
148  var offset = 50;
149
150  // Scroll to anchor on click
151  var anchorLinks = document.querySelectorAll('a.anchor[href^="#"], a.anchor[href^="/#"]');
152  anchorLinks.forEach(function (anchor) {
153    anchor.addEventListener("click", function (e) {
154      var targetID = this.getAttribute("href");
155      targetID = targetID.substring(targetID.indexOf('#'));
156
157      // Current class management
158      document.querySelectorAll('.mainmenu li').forEach(function (li) {
159        return li.classList.remove('current');
160      });
161      this.closest('li').classList.add('current');
162
163      // Nur auf der Startseite das native Verhalten überschreiben
164      if (window.location.pathname !== '/') return;
165      e.preventDefault();
166      var targetElement = document.querySelector(targetID);
167      if (targetElement) {
168        var top = targetElement.getBoundingClientRect().top + window.scrollY - offset;
169        window.scrollTo({
170          top: top,
171          behavior: "smooth"
172        });
173      }
174    });
175  });
176
177  // Scroll to anchor on page load
178  var hash = window.location.hash;
179  if (!hash) return;
180
181  // Current class bei page load anhand des Hash setzen
182  document.querySelectorAll('.mainmenu li').forEach(function (li) {
183    return li.classList.remove('current');
184  });
185  var activeAnchor = document.querySelector(".mainmenu a.anchor[href=\"".concat(hash, "\"], .mainmenu a.anchor[href=\"/").concat(hash, "\"]"));
186  if (activeAnchor) {
187    activeAnchor.closest('li').classList.add('current');
188  }
189  var target = document.querySelector(hash);
190  if (!target) return;
191  setTimeout(function () {
192    var top = target.getBoundingClientRect().top + window.scrollY - offset;
193    window.scrollTo({
194      top: top,
195      behavior: 'smooth'
196    });
197  }, 300);
198}
199
200//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
201// HEADER HANDLING
202//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
203
204function handleHeader() {
205  // VARIANT 1: Fade in on upscroll / VARIANT 2: Fade in on downscroll / VARIANT 3: Fixed header
206  var HEADER_VARIANT = 1;
207  var header, placeholder, logo;
208  var headerHeight, fadeOutOffset, fadeInClearance;
209  var hasScrolledPastFadeOutOffset = false;
210  var originalPosition;
211  var lastScrollTop = 0;
212  var ticking = false;
213  var scrollDirection = 'down';
214  var headerVisible = false;
215  var headerShowTime = 0;
216  var isScrollingUp = false;
217  var scrollEndTimer = null;
218  var MIN_VISIBLE_TIME = 200;
219  var SCROLL_END_DELAY = 50;
220  function debounce(func, wait) {
221    var timeout;
222    return function executedFunction() {
223      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
224        args[_key2] = arguments[_key2];
225      }
226      var later = function later() {
227        clearTimeout(timeout);
228        func.apply(void 0, args);
229      };
230      clearTimeout(timeout);
231      timeout = setTimeout(later, wait);
232    };
233  }
234  function initializeElements() {
235    header = document.querySelector("header");
236    placeholder = document.createElement("div");
237    logo = document.querySelector("a.logo");
238    header.classList.remove("fadein");
239    logo.classList.remove("fadein");
240    void header.offsetHeight;
241    var computedStyle = window.getComputedStyle(header);
242    headerHeight = parseInt(computedStyle.height);
243    fadeOutOffset = headerHeight * 4;
244    fadeInClearance = headerHeight * 3;
245    originalPosition = computedStyle.position;
246    placeholder.classList.add("header-placeholder");
247    header.parentNode.insertBefore(placeholder, header);
248    placeholder.style.height = headerHeight + "px";
249    placeholder.style.minHeight = headerHeight + "px";
250    placeholder.style.maxHeight = headerHeight + "px";
251    placeholder.style.overflow = "hidden";
252    placeholder.style.display = "none";
253    placeholder.style.position = originalPosition === "absolute" ? "absolute" : "relative";
254    if (HEADER_VARIANT === 3) {
255      // Variante 3: sofort fixed, initial versteckt
256      header.style.position = 'fixed';
257      header.style.transition = 'none';
258      placeholder.style.display = 'block';
259    } else {
260      // Variante 1 + 2: position gemäss CSS
261      header.style.position = originalPosition;
262      header.style.transform = 'translateY(0)';
263    }
264    lastScrollTop = window.pageYOffset || document.documentElement.scrollTop;
265    updateHeaderAndPlaceholder(lastScrollTop);
266  }
267  function updateHeaderAndPlaceholder(scrollTop) {
268    var currentTime = Date.now();
269    var updatePlaceholder = function updatePlaceholder() {
270      requestAnimationFrame(function () {
271        var currentHeaderHeight = header.offsetHeight;
272        if (placeholder.style.height !== currentHeaderHeight + "px") {
273          placeholder.style.height = currentHeaderHeight + "px";
274        }
275      });
276    };
277
278    // ── Variante 2 ───────────────────────────────────────────────────────
279    if (HEADER_VARIANT === 2) {
280      if (scrollTop <= headerHeight) {
281        header.style.transition = 'none';
282        header.style.position = originalPosition;
283        header.style.transform = 'translateY(0)';
284        placeholder.style.display = 'none';
285        header.classList.remove("fadein"); // ← erst hier entfernen
286        logo.classList.remove("fadein");
287        headerVisible = false;
288        headerShowTime = 0;
289        isScrollingUp = false;
290        if (scrollEndTimer) {
291          clearTimeout(scrollEndTimer);
292          scrollEndTimer = null;
293        }
294      } else if (scrollTop > headerHeight && scrollTop <= fadeOutOffset) {
295        header.style.position = 'fixed';
296        header.style.transform = 'translateY(-100%)';
297        placeholder.style.display = 'block';
298        headerVisible = false;
299        // fadein NICHT entfernen – header animiert noch
300        if (isScrollingUp) {
301          header.style.transition = 'transform 0.3s ease-out';
302        } else {
303          header.style.transition = 'none';
304        }
305        updatePlaceholder();
306      } else if (scrollTop > fadeOutOffset) {
307        var hadFadein = header.classList.contains("fadein");
308        header.classList.add("fadein"); // ← hier setzen
309        logo.classList.add("fadein");
310        if (!hadFadein) updatePlaceholder();
311        header.style.position = 'fixed';
312        header.style.transition = 'transform 0.3s ease-out';
313        header.style.transform = 'translateY(0)';
314        placeholder.style.display = 'block';
315        headerVisible = true;
316        updatePlaceholder();
317      }
318      return;
319    }
320
321    // ── Variante 3 ───────────────────────────────────────────────────────
322    if (HEADER_VARIANT === 3) {
323      header.style.transition = 'all 0.3s ease-out';
324      if (scrollTop <= headerHeight) {
325        header.classList.remove("fadein");
326        logo.classList.remove("fadein");
327      } else if (scrollTop > fadeOutOffset) {
328        var _hadFadein = header.classList.contains("fadein");
329        header.classList.add("fadein");
330        logo.classList.add("fadein");
331        if (!_hadFadein) updatePlaceholder();
332      }
333      updatePlaceholder();
334      return;
335    }
336
337    // ── Variante 1 (original) ────────────────────────────────────────────
338    if (scrollTop <= headerHeight) {
339      header.style.transition = 'none';
340      header.style.position = originalPosition;
341      header.style.transform = 'translateY(0)';
342      placeholder.style.display = 'none';
343      header.classList.remove("fadein"); // ← erst hier entfernen
344      logo.classList.remove("fadein");
345      hasScrolledPastFadeOutOffset = false;
346      headerVisible = false;
347      headerShowTime = 0;
348      isScrollingUp = false;
349      if (scrollEndTimer) {
350        clearTimeout(scrollEndTimer);
351        scrollEndTimer = null;
352      }
353    } else if (scrollTop > headerHeight && scrollTop <= fadeOutOffset) {
354      header.style.transition = 'none';
355      header.style.position = 'fixed';
356      header.style.transform = 'translateY(-100%)';
357      placeholder.style.display = 'block';
358      headerVisible = false;
359      // fadein NICHT entfernen – header animiert noch raus
360      if (isScrollingUp) {
361        header.style.transition = 'transform 0.3s ease-out';
362      }
363      updatePlaceholder();
364    } else if (scrollTop > fadeOutOffset) {
365      hasScrolledPastFadeOutOffset = true;
366      var _hadFadein2 = header.classList.contains("fadein");
367      header.classList.add("fadein"); // ← hier setzen
368      logo.classList.add("fadein");
369      if (!_hadFadein2) updatePlaceholder();
370      header.style.position = 'fixed';
371      if (isScrollingUp) {
372        header.style.transition = 'transform 0.2s ease-out';
373        header.style.transform = 'translateY(0)';
374        if (!headerVisible) {
375          headerVisible = true;
376          headerShowTime = currentTime;
377        }
378      } else {
379        if (headerVisible) {
380          var timeSinceShow = currentTime - headerShowTime;
381          if (timeSinceShow >= MIN_VISIBLE_TIME) {
382            header.style.transition = 'transform 0.3s ease-out';
383            header.style.transform = 'translateY(-100%)';
384            headerVisible = false;
385          }
386        } else {
387          header.style.transition = 'transform 0.3s ease-out';
388          header.style.transform = 'translateY(-100%)';
389        }
390      }
391    }
392  }
393  function updatePlaceholderHeight() {
394    var hadFadein = header.classList.contains("fadein");
395    if (hadFadein) {
396      header.classList.remove("fadein");
397      logo.classList.remove("fadein");
398    }
399    var newHeaderHeight = header.offsetHeight;
400    if (hadFadein) {
401      header.classList.add("fadein");
402      logo.classList.add("fadein");
403    }
404    if (newHeaderHeight !== headerHeight) {
405      headerHeight = newHeaderHeight;
406      fadeOutOffset = headerHeight * 4;
407      fadeInClearance = headerHeight * 3;
408      placeholder.style.height = headerHeight + "px";
409    }
410  }
411  function handleScroll() {
412    if (!ticking) {
413      ticking = true;
414      requestAnimationFrame(function () {
415        var _document$querySelect;
416        var scrollTop = window.pageYOffset;
417        if ((_document$querySelect = document.querySelector("nav.navigation")) !== null && _document$querySelect !== void 0 && _document$querySelect.classList.contains("active")) {
418          ticking = false;
419          return;
420        }
421        var scrollDelta = scrollTop - lastScrollTop;
422        var upThreshold = 3;
423        var downThreshold = 8;
424        var threshold = scrollDelta < 0 ? upThreshold : downThreshold;
425        if (Math.abs(scrollDelta) >= threshold) {
426          var newDirection = scrollDelta > 0 ? 'down' : 'up';
427          if (newDirection !== scrollDirection) {
428            scrollDirection = newDirection;
429            isScrollingUp = scrollDirection === 'up';
430          }
431        }
432
433        // scrollEndTimer nur für Variante 1 relevant
434        if (HEADER_VARIANT === 1) {
435          if (scrollEndTimer) clearTimeout(scrollEndTimer);
436          scrollEndTimer = setTimeout(function () {
437            if (scrollTop > fadeOutOffset && !isScrollingUp && headerVisible) {
438              var timeSinceShow = Date.now() - headerShowTime;
439              if (timeSinceShow >= MIN_VISIBLE_TIME) {
440                header.style.transition = 'transform 0.3s ease-out';
441                header.style.transform = 'translateY(-100%)';
442                headerVisible = false;
443              }
444            }
445          }, SCROLL_END_DELAY);
446        }
447        lastScrollTop = scrollTop;
448        updateHeaderAndPlaceholder(scrollTop);
449        ticking = false;
450      });
451    }
452  }
453  window.addEventListener('beforeunload', function () {
454    if (scrollEndTimer) clearTimeout(scrollEndTimer);
455  });
456  initializeElements();
457  window.addEventListener("scroll", handleScroll, {
458    passive: true
459  });
460  window.addEventListener('resize', debounce(function () {
461    updatePlaceholderHeight();
462  }, 150));
463}
464
465//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
466// SLIDER HEIGHT 100% The trick to viewport units on mobile
467//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
468
469function sliderHeight() {
470  // First we get the viewport height and we multiple it by 1% to get a value for a vh unit
471  var vh = window.innerHeight * 0.01;
472  // Then we set the value in the --vh custom property to the root of the document
473  document.documentElement.style.setProperty("--vh", "".concat(vh, "px"));
474}
475
476//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
477// FANCYBOX
478//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
479
480function fancybox() {
481  Fancybox.bind("[data-fancybox]", {
482    // THE FANCYBOX INITIALIZES ALL IMAGES WITH THE ATTR data-fancybox. Only with img tag, not a href!
483  });
484}
485
486//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
487// CHANNEL FILTER
488//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
489
490function channelFilter() {
491  var categorySelect = document.querySelector('[data-category-select]');
492  var searchInput = document.querySelector('[data-search-input]');
493  var resetButton = document.querySelector('[data-reset-filter]');
494  var noResults = document.querySelector('[data-no-results]');
495  var resultCount = document.querySelector('[data-result-count]');
496  var newsGrid = document.querySelector('[data-news-grid]');
497  if (!newsGrid) return;
498  function applyFilter() {
499    // Fix: kein Zugriff mehr auf globales currentObserver –
500    // loadMore() am Ende übernimmt cleanup/reinit des Observers
501    var selectedCategory = categorySelect ? categorySelect.value : 'all';
502    var searchTerm = searchInput ? searchInput.value.toLowerCase().trim() : '';
503    var allItems = Array.from(newsGrid.querySelectorAll('[data-news-item]'));
504    var visibleCount = 0;
505    allItems.forEach(function (item) {
506      var _item$getAttribute, _item$getAttribute2;
507      var itemCategories = ((_item$getAttribute = item.getAttribute('data-categories')) === null || _item$getAttribute === void 0 ? void 0 : _item$getAttribute.split(',').filter(Boolean)) || [];
508      var itemTitle = ((_item$getAttribute2 = item.getAttribute('data-title')) === null || _item$getAttribute2 === void 0 ? void 0 : _item$getAttribute2.toLowerCase()) || '';
509      var matchesCategory = selectedCategory === 'all' || itemCategories.includes(selectedCategory);
510      var matchesSearch = searchTerm === '' || itemTitle.includes(searchTerm);
511
512      // Fix: '' statt 'grid'
513      item.style.display = matchesCategory && matchesSearch ? '' : 'none';
514      if (matchesCategory && matchesSearch) visibleCount++;
515    });
516    if (resultCount) resultCount.textContent = visibleCount;
517    if (noResults) {
518      noResults.classList.toggle('is-hidden', visibleCount > 0);
519      noResults.classList.toggle('is-visible', visibleCount === 0);
520    }
521
522    // Fix: loadMore() nach dem Filtern aufrufen damit der Observer den
523    // neuen sichtbaren Item-Set korrekt beobachtet
524    requestAnimationFrame(function () {
525      ScrollTrigger.refresh();
526      if (typeof loadMore === 'function') loadMore();
527    });
528  }
529  if (categorySelect) categorySelect.addEventListener('change', applyFilter);
530  if (searchInput) searchInput.addEventListener('input', applyFilter);
531  if (resetButton) {
532    resetButton.addEventListener('click', function () {
533      if (categorySelect) categorySelect.value = 'all';
534      if (searchInput) searchInput.value = '';
535      applyFilter();
536    });
537  }
538
539  // Initialzählung
540  applyFilter();
541}
542
543//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
544// ANIMATIONS
545//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
546
547function animations() {
548  var revealBottom = gsap.utils.toArray("[data-a-reveal]");
549  revealBottom.forEach(function (elem) {
550    gsap.set(elem, {
551      autoAlpha: 0,
552      y: 50
553    });
554    gsap.fromTo(elem, {
555      autoAlpha: 0,
556      y: 50
557    }, {
558      autoAlpha: 1,
559      y: 0,
560      delay: 0.25,
561      ease: "easeIn.Power2",
562      duration: 1,
563      scrollTrigger: {
564        trigger: elem,
565        start: "top bottom",
566        toggleActions: "play none none pause"
567      }
568    });
569  });
570
571  // IMAGE BASIC REVEAL
572  var imgReveal = gsap.utils.toArray(".img-cover:not(.noreveal)");
573  imgReveal.forEach(function (elem) {
574    gsap.fromTo(elem, {
575      autoAlpha: 0,
576      scale: 1.1
577    }, {
578      autoAlpha: 1,
579      scale: 1,
580      ease: "cubicbezier",
581      duration: 2,
582      scrollTrigger: {
583        trigger: elem,
584        start: "top bottom",
585        toggleActions: "play none none pause"
586      }
587    });
588  });
589
590  // IMAGE INCREASE
591  var imgIncreases = gsap.utils.toArray(".img-increase");
592  imgIncreases.forEach(function (imgIncrease) {
593    var growTl = gsap.timeline({
594      scrollTrigger: {
595        trigger: imgIncrease,
596        scrub: 1,
597        start: "top center",
598        end: "top top"
599      }
600    });
601    growTl.to(imgIncrease.querySelector(".img-increase-image"), {
602      duration: 1,
603      scale: 1
604    }, 0);
605    growTl.to(imgIncrease, {
606      clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)",
607      duration: 1.2
608    }, 0);
609  });
610
611  // PARALLAX
612
613  gsap.utils.toArray('.parallax').forEach(function (container) {
614    gsap.set(container, {
615      force3D: true
616    });
617    var img = container.querySelector('.parallax-img');
618    var tl = gsap.timeline({
619      scrollTrigger: {
620        trigger: container,
621        scrub: 0.5,
622        invalidateOnRefresh: true
623      }
624    });
625    tl.to(img, {
626      yPercent: isMobile() ? 25 : 40,
627      ease: 'none'
628    });
629  });
630
631  // HERO PARALLAX
632  var heroImg = document.querySelector(".hero .hero-img");
633  if (heroImg) {
634    if (!isMobile()) {
635      gsap.fromTo(heroImg, {
636        scale: 1.2
637      }, {
638        scale: 1,
639        y: "25%",
640        ease: "none",
641        scrollTrigger: {
642          trigger: ".hero",
643          start: "top top",
644          end: "bottom top",
645          scrub: true,
646          invalidateOnRefresh: true
647        }
648      });
649    } else {
650      gsap.to(heroImg, {
651        y: "25%",
652        ease: "none",
653        scrollTrigger: {
654          trigger: ".hero",
655          start: "top top",
656          end: "bottom top",
657          scrub: 1,
658          invalidateOnRefresh: true
659        }
660      });
661    }
662  }
663
664  // DATA SPEED
665
666  gsap.utils.toArray("[data-speed]").forEach(function (el) {
667    gsap.to(el, {
668      y: function y() {
669        return (1 - parseFloat(el.getAttribute("data-speed"))) * (ScrollTrigger.maxScroll(window) - (this.scrollTrigger ? this.scrollTrigger.start : 0));
670      },
671      ease: "none",
672      scrollTrigger: {
673        trigger: el,
674        start: "top bottom",
675        end: "max",
676        invalidateOnRefresh: true,
677        scrub: 0.5
678      }
679    });
680  });
681  ScrollTrigger.refresh();
682  if (isMobile()) {
683    // Extra refresh für mobile nach kurzer Verzögerung
684    setTimeout(function () {
685      ScrollTrigger.refresh();
686    }, 100);
687  }
688}
689
690/*------------------
691    TIMELINE
692-------------------*/
693
694function loadTimeline() {
695  // Assign a fallback hash if missing
696  document.querySelectorAll('.zeitachse .nav li a').forEach(function (link) {
697    if (!link.hash) link.hash = "#zeitachse";
698  });
699  if (window.innerWidth > 800) {
700    // Arrow up: vertical scroll
701    document.querySelectorAll('.arrow-up').forEach(function (btn) {
702      btn.addEventListener('click', function () {
703        console.log('arrow up clicked');
704        var menu = document.querySelector('.zeitachse ul.menu');
705        if (menu) {
706          menu.scrollBy({
707            top: -150,
708            behavior: 'smooth'
709          });
710        }
711      });
712    });
713
714    // Arrow down: vertical scroll
715    document.querySelectorAll('.arrow-down').forEach(function (btn) {
716      btn.addEventListener('click', function () {
717        console.log('arrow down clicked');
718        var menu = document.querySelector('.zeitachse ul.menu');
719        if (menu) {
720          menu.scrollBy({
721            top: 150,
722            behavior: 'smooth'
723          });
724        }
725      });
726    });
727
728    // Center active menu item
729    if (document.querySelector('.zeitachse')) {
730      var menu = document.querySelector('.zeitachse ul.menu');
731      var currentItem = menu ? menu.querySelector('li.current') : null;
732      if (menu && currentItem) {
733        // OffsetTop relative to parent menu
734        var menuRect = menu.getBoundingClientRect();
735        var itemRect = currentItem.getBoundingClientRect();
736        var currentItemOffset = itemRect.top - menuRect.top;
737        var menuHeight = menu.clientHeight;
738        var currentItemHeight = currentItem.offsetHeight;
739
740        // Center scroll calculation
741        var scrollPosition = currentItemOffset - menuHeight / 2 + currentItemHeight / 2;
742        scrollPosition = Math.max(0, scrollPosition);
743        menu.scrollTop = scrollPosition;
744      }
745    }
746  } else {
747    // Arrow up: horizontal scroll
748    document.querySelectorAll('.arrow-up').forEach(function (btn) {
749      btn.addEventListener('click', function () {
750        var menu = document.querySelector('.zeitachse ul.menu');
751        if (menu) {
752          menu.scrollBy({
753            left: -150,
754            behavior: 'smooth'
755          });
756        }
757      });
758    });
759
760    // Arrow down: horizontal scroll
761    document.querySelectorAll('.arrow-down').forEach(function (btn) {
762      btn.addEventListener('click', function () {
763        var menu = document.querySelector('.zeitachse ul.menu');
764        if (menu) {
765          menu.scrollBy({
766            left: 150,
767            behavior: 'smooth'
768          });
769        }
770      });
771    });
772
773    // On page load, scroll to current menu item if exists
774    if (document.querySelector(".zeitachse")) {
775      var _menu = document.querySelector('.zeitachse ul.menu');
776      var _currentItem = _menu ? _menu.querySelector('li.current') : null;
777      if (_menu && _currentItem) {
778        // OffsetLeft relative to parent menu
779        var _menuRect = _menu.getBoundingClientRect();
780        var _itemRect = _currentItem.getBoundingClientRect();
781        var offsetLeft = _itemRect.left - _menuRect.left;
782        // Optionally log offsetLeft
783        console.log(offsetLeft);
784        _menu.scrollLeft = offsetLeft - 200;
785      }
786    }
787  }
788}
789
790/*------------------
791   NEWS BUTTON
792-------------------*/
793
794function loadNewsButton() {
795  // Mouseover: show latest news, remove 'attention', set close icon
796  document.querySelectorAll(".news-button").forEach(function (btn) {
797    btn.addEventListener("mouseover", function () {
798      document.querySelectorAll(".latest-news").forEach(function (news) {
799        news.style.display = "block";
800      });
801      document.querySelectorAll(".news-button").forEach(function (b) {
802        b.classList.remove("attention");
803      });
804      btn.setAttribute("src", "/images/news-button-close.svg");
805    });
806  });
807
808  // Click: toggle showing latest news and change icon + attention as needed
809  document.querySelectorAll(".news-button").forEach(function (btn) {
810    btn.addEventListener("click", function () {
811      var isClose = btn.getAttribute("src") === "/images/news-button-close.svg";
812      document.querySelectorAll(".latest-news").forEach(function (news) {
813        news.style.display = isClose ? "none" : "block";
814      });
815      if (isClose) {
816        btn.setAttribute("src", "/images/news-button.svg");
817      } else {
818        document.querySelectorAll(".news-button").forEach(function (b) {
819          b.classList.remove("attention");
820        });
821        btn.setAttribute("src", "/images/news-button-close.svg");
822      }
823    });
824  });
825}
826
827/*------------------
828    NEWSFLASH LOADMORE
829-------------------*/
830
831function loadMore() {
832  var INITIAL_COUNT = 6;
833  var BATCH_SIZE = 12;
834  var newsItems = Array.from(document.querySelectorAll(".newscontent"));
835  var loadMoreBtn = document.getElementById("loadMore");
836  var loadMoreArea = document.getElementById("loadmore-area");
837  if (!newsItems.length) return;
838  newsItems.forEach(function (item, index) {
839    item.style.display = index < INITIAL_COUNT ? "" : "none";
840  });
841  if (!loadMoreBtn) return;
842  if (newsItems.length <= INITIAL_COUNT) {
843    if (loadMoreArea) loadMoreArea.style.display = "none";
844    return;
845  }
846  if (loadMoreArea) loadMoreArea.style.display = "";
847  loadMoreBtn.textContent = "Weitere laden";
848  loadMoreBtn.classList.remove("noContent");
849  loadMoreBtn.onclick = function (e) {
850    e.preventDefault();
851    var hiddenItems = newsItems.filter(function (item) {
852      return item.style.display === "none";
853    });
854    var nextBatch = hiddenItems.slice(0, BATCH_SIZE);
855    nextBatch.forEach(function (item) {
856      item.style.display = "";
857      item.style.maxHeight = "0";
858      item.style.overflow = "hidden";
859      item.style.transition = "max-height 0.5s ease";
860      requestAnimationFrame(function () {
861        item.style.maxHeight = item.scrollHeight + "px";
862      });
863      item.addEventListener("transitionend", function handler() {
864        item.style.maxHeight = "";
865        item.style.overflow = "";
866        item.style.transition = "";
867        item.removeEventListener("transitionend", handler);
868      });
869    });
870    if (newsItems.filter(function (item) {
871      return item.style.display === "none";
872    }).length === 0) {
873      loadMoreBtn.textContent = "Keine weiteren Beiträge";
874      loadMoreBtn.classList.add("noContent");
875    }
876  };
877}
878
879/*------------------
880GALERIE LOADMORE
881-------------------*/
882
883function loadMoreGalerie() {
884  var INITIAL_COUNT = 15;
885  var BATCH_SIZE = 12;
886  function revealItems(items) {
887    items.forEach(function (item) {
888      item.style.display = "";
889      item.style.maxHeight = "0";
890      item.style.overflow = "hidden";
891      item.style.transition = "max-height 0.5s ease";
892      requestAnimationFrame(function () {
893        item.style.maxHeight = item.scrollHeight + "px";
894      });
895      item.addEventListener("transitionend", function handler() {
896        item.style.maxHeight = "";
897        item.style.overflow = "";
898        item.style.transition = "";
899        item.removeEventListener("transitionend", handler);
900      });
901    });
902  }
903  document.querySelectorAll("[data-gallery-grid]").forEach(function (grid) {
904    var _grid$nextElementSibl;
905    var items = Array.from(grid.querySelectorAll(".gallery-item"));
906    var loadMoreArea = (_grid$nextElementSibl = grid.nextElementSibling) !== null && _grid$nextElementSibl !== void 0 && _grid$nextElementSibl.matches("[data-gallery-loadmore]") ? grid.nextElementSibling : null;
907    var loadMoreBtn = loadMoreArea === null || loadMoreArea === void 0 ? void 0 : loadMoreArea.querySelector(".load-more-gallery");
908    var isArchiveMode = grid.dataset.galleryMode === "archive";
909    if (!items.length) return;
910
911    // Archiv-Modus: nur nicht-archivierte Bilder zeigen,
912    // «Weitere laden» blendet alle archivierten ein
913    if (isArchiveMode) {
914      var archivedItems = items.filter(function (item) {
915        return item.hasAttribute("data-archived");
916      });
917      items.forEach(function (item) {
918        item.style.display = item.hasAttribute("data-archived") ? "none" : "";
919      });
920      if (!loadMoreBtn) return;
921      if (!archivedItems.length) {
922        loadMoreArea.style.display = "none";
923        return;
924      }
925      loadMoreArea.style.display = "";
926      loadMoreBtn.textContent = "Weitere laden";
927      loadMoreBtn.classList.remove("noContent");
928      loadMoreBtn.onclick = function (e) {
929        e.preventDefault();
930        revealItems(archivedItems);
931        loadMoreBtn.textContent = "Keine weiteren Bilder";
932        loadMoreBtn.classList.add("noContent");
933      };
934      return;
935    }
936
937    // Standard: initial begrenzt, danach in Batches nachladen
938    items.forEach(function (item, index) {
939      item.style.display = index < INITIAL_COUNT ? "" : "none";
940    });
941    if (!loadMoreBtn) return;
942    if (items.length <= INITIAL_COUNT) {
943      loadMoreArea.style.display = "none";
944      return;
945    }
946    loadMoreArea.style.display = "";
947    loadMoreBtn.textContent = "Weitere laden";
948    loadMoreBtn.classList.remove("noContent");
949    loadMoreBtn.onclick = function (e) {
950      e.preventDefault();
951      var nextBatch = items.filter(function (item) {
952        return item.style.display === "none";
953      }).slice(0, BATCH_SIZE);
954      revealItems(nextBatch);
955      if (items.filter(function (item) {
956        return item.style.display === "none";
957      }).length === 0) {
958        loadMoreBtn.textContent = "Keine weiteren Bilder";
959        loadMoreBtn.classList.add("noContent");
960      }
961    };
962  });
963}
964
965//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
966// COOKIES
967//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
968
969function cookies() {
970  var cookieContainer = document.querySelector(".popup");
971  var cookieButton = document.querySelector(".primary-btn");
972  cookieButton.addEventListener("click", function () {
973    cookieContainer.classList.remove("visible");
974    localStorage.setItem("cookieBannerDisplayed", "true");
975  });
976  setTimeout(function () {
977    if (!localStorage.getItem("cookieBannerDisplayed")) {
978      cookieContainer.classList.add("visible");
979    }
980  }, 2000);
981}
982
983//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
984// MAPS
985//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
986
987function maps() {
988  document.querySelectorAll('.map').forEach(function (map) {
989    map.addEventListener('click', function () {
990      document.querySelectorAll('.map iframe').forEach(function (iframe) {
991        iframe.style.pointerEvents = 'auto';
992      });
993    });
994    map.addEventListener('mouseleave', function () {
995      document.querySelectorAll('.map iframe').forEach(function (iframe) {
996        iframe.style.pointerEvents = 'none';
997      });
998    });
999  });
1000}
1001
1002//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1003// BARBA/TRANSITIONS
1004//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1005
1006function barbaRun() {
1007  //-1- ANIMATIONS FUNCTIONS (will be called inside barba.init lifecycle hooks):
1008
1009  // - LEAVE animations (goes here): --
1010
1011  //-- BEFORE ENTERING THE NEW PAGE: --
1012  // Set elements to initial state before entering the new page
1013  function beforeEnterSetup(container) {}
1014
1015  //-- ENTERING THE NEW PAGE: --
1016  // Animation for when entering the new page
1017  function contentAnimation(container) {}
1018
1019  //-2- INITIALIZE BARBA:
1020  barba.init({
1021    // debug: true,
1022    preventRunning: true,
1023    // Define which links Barba should handle
1024    linkSelector: 'a[href^="/"]:not([target="_blank"]):not([href^="#"]), a[data-barba="link"]:not([target="_blank"])',
1025    //-- Define the transitions for each page: --
1026    transitions: [
1027    //-- Global Transition: --
1028    {
1029      name: "all-pages-transition",
1030      to: {
1031        namespace: ["global"]
1032      },
1033      //-- Lifecycle hooks --
1034      // when page is leaving
1035      leave: function leave(data) {
1036        var _this = this;
1037        return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1038          var done;
1039          return _regeneratorRuntime().wrap(function _callee$(_context) {
1040            while (1) switch (_context.prev = _context.next) {
1041              case 0:
1042                console.log("leave hooked triggered");
1043                done = _this.async(); // Reset navigation state before leaving
1044                if (window.resetNavigationState) {
1045                  window.resetNavigationState();
1046                }
1047
1048                // Since no leave animation, call done immediately
1049                done();
1050              case 4:
1051              case "end":
1052                return _context.stop();
1053            }
1054          }, _callee);
1055        }))();
1056      },
1057      // before new page enters
1058      beforeEnter: function beforeEnter(data) {
1059        return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1060          return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1061            while (1) switch (_context2.prev = _context2.next) {
1062              case 0:
1063                console.log("beforeEnter hooked triggered");
1064                if (window.lenis) {
1065                  window.lenis.start();
1066                  window.lenis.resize();
1067                  lenis.on("scroll", ScrollTrigger.update);
1068                }
1069                beforeEnterSetup(data.next.container);
1070
1071                // Initialize next entry reveal
1072                nextEntryReveal();
1073              case 4:
1074              case "end":
1075                return _context2.stop();
1076            }
1077          }, _callee2);
1078        }))();
1079      },
1080      once: function once(data) {
1081        return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1082          return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1083            while (1) switch (_context3.prev = _context3.next) {
1084              case 0:
1085                console.log("once hooked triggered");
1086                contentAnimation(data.next.container);
1087              case 2:
1088              case "end":
1089                return _context3.stop();
1090            }
1091          }, _callee3);
1092        }))();
1093      }
1094    },
1095    //-- _Entry pages only Transition: --
1096    {
1097      name: "entry-page-transition",
1098      to: {
1099        namespace: ["entry-page"]
1100      },
1101      // When page is leaving
1102      leave: function leave(data) {
1103        return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
1104          return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1105            while (1) switch (_context4.prev = _context4.next) {
1106              case 0:
1107                // Reset navigation state before leaving
1108                if (window.resetNavigationState) {
1109                  window.resetNavigationState();
1110                }
1111
1112                // Fade out current container
1113                gsap.to(data.current.container, {
1114                  opacity: 0,
1115                  duration: 0.8
1116                });
1117              case 2:
1118              case "end":
1119                return _context4.stop();
1120            }
1121          }, _callee4);
1122        }))();
1123      },
1124      // Before _entry page enters
1125      beforeEnter: function beforeEnter(data) {
1126        return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
1127          return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1128            while (1) switch (_context5.prev = _context5.next) {
1129              case 0:
1130                // Refresh Lenis instance after page transition
1131                if (window.lenis) {
1132                  window.lenis.start();
1133                  window.lenis.resize();
1134                  // Synchronize Lenis with GSAP's ScrollTrigger
1135                  lenis.on("scroll", ScrollTrigger.update);
1136                }
1137                beforeEnterSetup(data.next.container);
1138              case 2:
1139              case "end":
1140                return _context5.stop();
1141            }
1142          }, _callee5);
1143        }))();
1144      },
1145      // When new _entry page enters
1146      once: function once(data) {
1147        return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
1148          return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1149            while (1) switch (_context6.prev = _context6.next) {
1150              case 0:
1151                contentAnimation(data.next.container);
1152              case 1:
1153              case "end":
1154                return _context6.stop();
1155            }
1156          }, _callee6);
1157        }))();
1158      }
1159    }]
1160  });
1161
1162  // Reinitialize on Barba page changes
1163  barba.hooks.after(function () {
1164    // Reset for _entry page
1165    if (document.querySelector('[data-barba-namespace="entry-page"]')) {
1166      nextEntryReveal();
1167    }
1168    // Reinitialize navigation image hover
1169    navigationImageHover();
1170
1171    // Ensure navigation state is reset after page transition
1172    if (window.resetNavigationState) {
1173      window.resetNavigationState();
1174    }
1175  });
1176}
1177// src/global/js/navigation/modes/desktop-hamburger-frame-rtl.js
1178// Desktop: RTL frame slide-in (1 layer) + accordion subnav
1179
1180function desktopHamburgerFrameRtlNavigation() {
1181  const stickyMenu = document.querySelector(".sticky-menu");
1182  const hamburgerBtn = document.querySelector(".hamburger");
1183  const menuText = document.querySelector(".menu-text");
1184  const nav = document.querySelector("nav.navigation");
1185  const navWrap = document.querySelector(".navigation");
1186  const underlay = document.querySelector(".navigation-underlay");
1187  const submenuParents = document.querySelectorAll("li.subentry");
1188  const subSubParents = document.querySelectorAll("li.subsubentry");
1189  const isRTL = true;
1190
1191  const menuState = {
1192    openMenus: new Map(),
1193    currentMainIndex: undefined,
1194    isNavOpen: false,
1195    tweenMap: new Map(),
1196  };
1197
1198  const navTimeline = gsap
1199    .timeline({ paused: true })
1200    .set(nav, { xPercent: isRTL ? 100 : -100 })
1201    .to(nav, { autoAlpha: 1, xPercent: isRTL ? -100 : 100, duration: 0.3 });
1202
1203  function hasCurrentMenuItem() {
1204    return (
1205      document.querySelector(
1206        ".subentry.current, .subsubentry.current, .submainentry.current, .subsubmainentry.current"
1207      ) !== null
1208    );
1209  }
1210
1211  function getCurrentMenuPath() {
1212    const path = [];
1213    const currentElement = document.querySelector(
1214      ".subentry.current, .subsubentry.current, .submainentry.current, .subsubmainentry.current"
1215    );
1216    if (!currentElement) return path;
1217
1218    let element = currentElement;
1219    while (element) {
1220      if (
1221        element.classList.contains("subentry") ||
1222        element.classList.contains("subsubentry")
1223      ) {
1224        path.unshift(element);
1225      }
1226      element = element.parentElement?.closest(".subentry, .subsubentry");
1227    }
1228
1229    return path;
1230  }
1231
1232  function updateParentHeights(changedPanel) {
1233    let currentPanel = changedPanel;
1234
1235    while (currentPanel) {
1236      const parentSubmenu = currentPanel.closest(
1237        ".submenu-panel, .subsubmenu-panel"
1238      );
1239      if (parentSubmenu && parentSubmenu !== currentPanel) {
1240        setTimeout(() => {
1241          gsap.set(parentSubmenu, { height: "auto" });
1242        }, 50);
1243        currentPanel = parentSubmenu;
1244      } else {
1245        break;
1246      }
1247    }
1248  }
1249
1250  function createAccordionTween(panel, list) {
1251    gsap.set(panel, { height: 0, scaleY: 0 });
1252    gsap.set(list.children, { autoAlpha: 0, y: 20 });
1253
1254    let isReversed = true;
1255
1256    return {
1257      play(skipAnimation = false) {
1258        isReversed = false;
1259
1260        if (skipAnimation) {
1261          gsap.set(panel, {
1262            height: "auto",
1263            scaleY: 1,
1264            transformOrigin: "top left",
1265          });
1266          gsap.set(list.children, { autoAlpha: 1, y: 0 });
1267          updateParentHeights(panel);
1268          return this;
1269        }
1270
1271        const tl = gsap.timeline({
1272          onComplete: () => updateParentHeights(panel),
1273        });
1274
1275        tl.to(panel, {
1276          height: "auto",
1277          scaleY: 1,
1278          transformOrigin: "top left",
1279          duration: 0.6,
1280          ease: "expo.inOut",
1281        });
1282
1283        tl.to(
1284          list.children,
1285          {
1286            autoAlpha: 1,
1287            y: 0,
1288            stagger: 0.05,
1289            duration: 0.3,
1290            ease: "power2.out",
1291          },
1292          0.4
1293        );
1294
1295        return this;
1296      },
1297
1298      reverse() {
1299        isReversed = true;
1300
1301        const tl = gsap.timeline({
1302          onComplete: () => updateParentHeights(panel),
1303        });
1304
1305        tl.to(list.children, {
1306          autoAlpha: 0,
1307          y: -10,
1308          stagger: 0.02,
1309          duration: 0.25,
1310          ease: "power2.in",
1311        });
1312
1313        tl.to(
1314          panel,
1315          {
1316            height: 0,
1317            scaleY: 0,
1318            transformOrigin: "top left",
1319            duration: 0.5,
1320            ease: "expo.inOut",
1321          },
1322          0.15
1323        );
1324
1325        return this;
1326      },
1327
1328      reversed() {
1329        return isReversed;
1330      },
1331    };
1332  }
1333
1334  function getMenuId(element) {
1335    if (!element.id) {
1336      element.id = "menu-" + Math.random().toString(36).substr(2, 9);
1337    }
1338    return element.id;
1339  }
1340
1341  function storeTween(element, tween) {
1342    menuState.tweenMap.set(getMenuId(element), tween);
1343  }
1344
1345  function getTween(element) {
1346    return menuState.tweenMap.get(getMenuId(element));
1347  }
1348
1349  function closeMenu(menuElement) {
1350    const menuId = getMenuId(menuElement);
1351    const menuData = menuState.openMenus.get(menuId);
1352    const tween = getTween(menuElement);
1353
1354    if (menuData || tween) {
1355      const tweenToUse = menuData ? menuData.tween : tween;
1356
1357      closeChildMenus(menuElement);
1358      updateParentHeights(menuElement);
1359
1360      if (tweenToUse && typeof tweenToUse.reverse === "function") {
1361        tweenToUse.reverse();
1362      }
1363
1364      menuElement.classList.remove("open");
1365      menuState.openMenus.delete(menuId);
1366      return true;
1367    }
1368
1369    return false;
1370  }
1371
1372  function openMenu(menuElement, tween, skipAnimation = false) {
1373    const menuId = getMenuId(menuElement);
1374
1375    menuState.openMenus.set(menuId, {
1376      element: menuElement,
1377      tween: tween,
1378    });
1379    storeTween(menuElement, tween);
1380    tween.play(skipAnimation);
1381    menuElement.classList.add("open");
1382  }
1383
1384  function closeChildMenus(parentElement) {
1385    parentElement
1386      .querySelectorAll(".subentry.open, .subsubentry.open")
1387      .forEach((child) => closeMenu(child));
1388  }
1389
1390  function closeSiblingMenus(currentElement, parentSelector) {
1391    const parent = currentElement.closest(parentSelector);
1392    if (parent) {
1393      parent.querySelectorAll(".subentry.open, .subsubentry.open").forEach((sibling) => {
1394        if (sibling !== currentElement) {
1395          closeMenu(sibling);
1396        }
1397      });
1398    }
1399  }
1400
1401  function isMenuOpen(menuElement) {
1402    const menuId = getMenuId(menuElement);
1403    return (
1404      menuState.openMenus.has(menuId) || menuElement.classList.contains("open")
1405    );
1406  }
1407
1408  function resetAllMenus() {
1409    menuState.openMenus.forEach((menuData) => {
1410      menuData.tween.reverse();
1411      menuData.element.classList.remove("open");
1412    });
1413    menuState.openMenus.clear();
1414    menuState.currentMainIndex = undefined;
1415  }
1416
1417  function openCurrentPathAccordions() {
1418    if (!hasCurrentMenuItem()) return;
1419
1420    getCurrentMenuPath().forEach((menuElement) => {
1421      const tween = getTween(menuElement);
1422      if (!tween) return;
1423
1424      openMenu(menuElement, tween, true);
1425
1426      if (menuElement.classList.contains("subentry")) {
1427        menuState.currentMainIndex = Array.from(submenuParents).indexOf(
1428          menuElement
1429        );
1430      }
1431    });
1432  }
1433
1434  function initializeTweens() {
1435    submenuParents.forEach((parent) => {
1436      const submenu = parent.querySelector(".submenu-panel");
1437      const submenuList = submenu?.querySelector(".submenu-list");
1438
1439      if (submenu && submenuList) {
1440        storeTween(parent, createAccordionTween(submenu, submenuList));
1441      }
1442    });
1443
1444    subSubParents.forEach((subParent) => {
1445      const subSubPanel = subParent.querySelector(":scope > .subsubmenu-panel");
1446      const subSubList = subSubPanel?.querySelector(":scope > .subsubmenu-list");
1447
1448      if (subSubPanel && subSubList) {
1449        storeTween(subParent, createAccordionTween(subSubPanel, subSubList));
1450      }
1451    });
1452  }
1453
1454  const openNav = () => {
1455    menuState.isNavOpen = true;
1456    document.body.classList.add("overflow-hidden");
1457    navWrap?.classList.add("active");
1458    underlay?.classList.add("active");
1459    hamburgerBtn?.classList.add("is-active");
1460    if (menuText) menuText.textContent = "Schliessen";
1461    menuText?.classList.add("active");
1462    nav?.classList.add("active");
1463
1464    navTimeline.play().then(() => {
1465      openCurrentPathAccordions();
1466    });
1467  };
1468
1469  const closeNav = () => {
1470    menuState.isNavOpen = false;
1471    navTimeline.reverse();
1472    hamburgerBtn?.classList.remove("is-active");
1473    menuText?.classList.remove("active");
1474    if (menuText) menuText.textContent = "Menü";
1475    document.body.classList.remove("overflow-hidden");
1476    underlay?.classList.remove("active");
1477    navWrap?.classList.remove("active");
1478    nav?.classList.remove("active");
1479    resetAllMenus();
1480  };
1481
1482  stickyMenu?.addEventListener("click", (event) => {
1483    event.preventDefault();
1484    event.stopPropagation();
1485    menuState.isNavOpen ? closeNav() : openNav();
1486  });
1487
1488  document.addEventListener("click", (event) => {
1489    if (
1490      !event.target.closest(".navigation, .sticky-menu") &&
1491      menuState.isNavOpen
1492    ) {
1493      closeNav();
1494    }
1495  });
1496
1497  submenuParents.forEach((parent, index) => {
1498    const toggleBtn = parent.querySelector(".subentry-title");
1499    if (!toggleBtn) return;
1500
1501    toggleBtn.addEventListener("click", (event) => {
1502      event.preventDefault();
1503
1504      const tween = getTween(parent);
1505      if (!tween) return;
1506
1507      if (isMenuOpen(parent)) {
1508        closeMenu(parent);
1509        if (menuState.currentMainIndex === index) {
1510          menuState.currentMainIndex = undefined;
1511        }
1512      } else {
1513        if (
1514          menuState.currentMainIndex !== undefined &&
1515          menuState.currentMainIndex !== index
1516        ) {
1517          closeMenu(submenuParents[menuState.currentMainIndex]);
1518        }
1519
1520        openMenu(parent, tween, false);
1521        menuState.currentMainIndex = index;
1522      }
1523    });
1524  });
1525
1526  subSubParents.forEach((subParent) => {
1527    const toggleBtn = subParent.querySelector(":scope > .subsubentry-title");
1528    if (!toggleBtn) return;
1529
1530    toggleBtn.addEventListener("click", (event) => {
1531      event.preventDefault();
1532      event.stopPropagation();
1533
1534      const tween = getTween(subParent);
1535      if (!tween) return;
1536
1537      if (isMenuOpen(subParent)) {
1538        closeMenu(subParent);
1539      } else {
1540        closeSiblingMenus(subParent, ".submenu-panel, .subsubmenu-panel");
1541        openMenu(subParent, tween, false);
1542      }
1543    });
1544  });
1545
1546  initializeTweens();
1547}
1548
1549window.desktopHamburgerFrameRtlNavigation = desktopHamburgerFrameRtlNavigation;
1550
1551// src/global/js/navigation/modes/mobile-accordion.js
1552// Mobile Accordion Navigation Mode
1553
1554function mobileAccordionNavigation() {
1555  //////////////////////////////////////////////////////
1556  // GLOBAL VARS
1557  //////////////////////////////////////////////////////
1558
1559  const stickyMenu = document.querySelector(".sticky-menu");
1560  const hamburger = document.querySelector(".hamburger");
1561  const nav = document.querySelector("nav.navigation");
1562  const navWrap = document.querySelector(".navigation");
1563  const header = document.querySelector("header");
1564  const underlay = document.querySelector(".navigation-underlay");
1565  const submenuParents = document.querySelectorAll("li.subentry");
1566  const subSubParents = document.querySelectorAll("li.subsubentry");
1567  const logo = document.querySelector("a.logo");
1568  const logoNav = document.querySelector("a.logo-nav");
1569  const logoNav2 = document.querySelector("a.logo-nav-fadein");
1570  const allNavItems = nav.querySelectorAll(
1571    ".mainmenu > li:not(.protectarea) > a, .mainmenu > li:not(.protectarea) > span"
1572  );
1573
1574  // Get logo-nav-count config from CSS variable
1575  const getLogoNavCount = () => {
1576    const count = getComputedStyle(document.documentElement)
1577      .getPropertyValue("--nav-logo-nav-count")
1578      .trim();
1579    return parseInt(count) || 1;
1580  };
1581
1582  // Globales State Management
1583  const menuState = {
1584    openMenus: new Map(),
1585    currentMainIndex: undefined,
1586    isNavOpen: false,
1587    hasCurrentPage: false,
1588    tweenMap: new Map(),
1589  };
1590
1591  //////////////////////////////////////////////////////
1592  // HELPER FUNCTIONS
1593  //////////////////////////////////////////////////////
1594
1595  // Prüft ob wir auf einer Unterseite sind
1596  function hasCurrentMenuItem() {
1597    return (
1598      document.querySelector(
1599        ".subentry.current, .subsubentry.current, .submainentry.current, .subsubmainentry.current"
1600      ) !== null
1601    );
1602  }
1603
1604  // Sammelt alle Menüs die geöffnet werden müssen um current item zu zeigen
1605  function getCurrentMenuPath() {
1606    const path = [];
1607
1608    // Finde das aktuelle Element
1609    const currentElement = document.querySelector(
1610      ".subentry.current, .subsubentry.current, .submainentry.current, .subsubmainentry.current"
1611    );
1612    if (!currentElement) return path;
1613
1614    // Baue den Pfad zu allen übergeordneten Menüs auf
1615    let element = currentElement;
1616    while (element) {
1617      if (
1618        element.classList.contains("subentry") ||
1619        element.classList.contains("subsubentry")
1620      ) {
1621        path.unshift(element); // Am Anfang hinzufügen für richtige Reihenfolge
1622      }
1623      element = element.parentElement?.closest(".subentry, .subsubentry");
1624    }
1625
1626    return path;
1627  }
1628
1629  //////////////////////////////////////////////////////
1630  // TWEEN HELPERS
1631  //////////////////////////////////////////////////////
1632
1633  // Aktualisiert die Höhen aller übergeordneten Panels
1634  function updateParentHeights(changedPanel) {
1635    let currentPanel = changedPanel;
1636
1637    // Finde alle übergeordneten Panels und aktualisiere ihre Höhen
1638    while (currentPanel) {
1639      const parentSubmenu = currentPanel.closest(
1640        ".submenu-panel, .subsubmenu-panel"
1641      );
1642      if (parentSubmenu && parentSubmenu !== currentPanel) {
1643        // Warte kurz, damit die Animation des aktuellen Panels abgeschlossen ist
1644        setTimeout(() => {
1645          gsap.set(parentSubmenu, { height: "auto" });
1646        }, 50);
1647        currentPanel = parentSubmenu;
1648      } else {
1649        break;
1650      }
1651    }
1652  }
1653
1654  // ACCORDION TWEEN
1655  function createAccordionTween(panel, list) {
1656    gsap.set(panel, { height: 0, scaleY: 0 });
1657    gsap.set(list.children, { autoAlpha: 0, y: 20 });
1658
1659    let isReversed = true;
1660
1661    const tweenObject = {
1662      play: function (skipAnimation = false) {
1663        isReversed = false;
1664
1665        if (skipAnimation) {
1666          // Sofort ohne Animation öffnen
1667          gsap.set(panel, {
1668            height: "auto",
1669            scaleY: 1,
1670            transformOrigin: "top left",
1671          });
1672          gsap.set(list.children, {
1673            autoAlpha: 1,
1674            y: 0,
1675          });
1676          updateParentHeights(panel);
1677          return this;
1678        }
1679
1680        // Opening Timeline mit Animation
1681        const tl = gsap.timeline({
1682          onComplete: () => updateParentHeights(panel),
1683        });
1684
1685        tl.to(panel, {
1686          height: "auto",
1687          scaleY: 1,
1688          transformOrigin: "top left",
1689          duration: 0.6,
1690          ease: "expo.inOut",
1691        });
1692
1693        tl.to(
1694          list.children,
1695          {
1696            autoAlpha: 1,
1697            y: 0,
1698            stagger: 0.05,
1699            duration: 0.3,
1700            ease: "power2.out",
1701          },
1702          0.4
1703        );
1704
1705        return this;
1706      },
1707
1708      reverse: function () {
1709        isReversed = true;
1710
1711        // Closing Timeline - zuerst Kinder, dann Panel
1712        const tl = gsap.timeline({
1713          onComplete: () => updateParentHeights(panel),
1714        });
1715
1716        // Zuerst Kinder ausblenden
1717        tl.to(list.children, {
1718          autoAlpha: 0,
1719          y: -10,
1720          stagger: 0.02,
1721          duration: 0.25,
1722          ease: "power2.in",
1723        });
1724
1725        // Dann Panel schließen mit leichter Überlappung
1726        tl.to(
1727          panel,
1728          {
1729            height: 0,
1730            scaleY: 0,
1731            transformOrigin: "top left",
1732            duration: 0.5,
1733            ease: "expo.inOut",
1734          },
1735          0.15
1736        );
1737
1738        return this;
1739      },
1740
1741      reversed: function () {
1742        return isReversed;
1743      },
1744    };
1745
1746    return tweenObject;
1747  }
1748
1749  //////////////////////////////////////////////////////
1750  // STATE MANAGEMENT FUNCTIONS
1751  //////////////////////////////////////////////////////
1752
1753  // Generiert eine eindeutige ID für ein Menü-Element
1754  function getMenuId(element) {
1755    if (!element.id) {
1756      element.id = "menu-" + Math.random().toString(36).substr(2, 9);
1757    }
1758    return element.id;
1759  }
1760
1761  // Speichert einen Tween für ein Element
1762  function storeTween(element, tween) {
1763    const menuId = getMenuId(element);
1764    menuState.tweenMap.set(menuId, tween);
1765  }
1766
1767  // Holt einen Tween für ein Element
1768  function getTween(element) {
1769    const menuId = getMenuId(element);
1770    return menuState.tweenMap.get(menuId);
1771  }
1772
1773  // Schließt ein spezifisches Menü
1774  function closeMenu(menuElement) {
1775    const menuId = getMenuId(menuElement);
1776    const menuData = menuState.openMenus.get(menuId);
1777    const tween = getTween(menuElement);
1778
1779    if (menuData || tween) {
1780      const tweenToUse = menuData ? menuData.tween : tween;
1781
1782      closeChildMenus(menuElement);
1783      updateParentHeights(menuElement);
1784
1785      if (tweenToUse && typeof tweenToUse.reverse === "function") {
1786        tweenToUse.reverse();
1787      }
1788
1789      menuElement.classList.remove("open");
1790      menuState.openMenus.delete(menuId);
1791
1792      return true;
1793    }
1794
1795    return false;
1796  }
1797
1798  // Öffnet ein Menü
1799  function openMenu(menuElement, tween, skipAnimation = false) {
1800    const menuId = getMenuId(menuElement);
1801
1802    // Speichere den Tween sowohl in openMenus als auch in tweenMap
1803    menuState.openMenus.set(menuId, {
1804      element: menuElement,
1805      tween: tween,
1806    });
1807    storeTween(menuElement, tween);
1808
1809    // Accordion
1810    tween.play(skipAnimation);
1811
1812    menuElement.classList.add("open");
1813  }
1814
1815  // Schließt alle Kinder-Menüs eines Elements
1816  function closeChildMenus(parentElement) {
1817    const childMenus = parentElement.querySelectorAll(
1818      ".subentry.open, .subsubentry.open"
1819    );
1820    childMenus.forEach((child) => {
1821      closeMenu(child);
1822    });
1823  }
1824
1825  // Schließt alle Menüs einer bestimmten Ebene (außer dem angegebenen)
1826  function closeSiblingMenus(currentElement, parentSelector) {
1827    const parent = currentElement.closest(parentSelector);
1828    if (parent) {
1829      const siblings = parent.querySelectorAll(
1830        ".subentry.open, .subsubentry.open"
1831      );
1832      siblings.forEach((sibling) => {
1833        if (sibling !== currentElement) {
1834          closeMenu(sibling);
1835        }
1836      });
1837    }
1838  }
1839
1840  // Prüft ob ein Menü geöffnet ist
1841  function isMenuOpen(menuElement) {
1842    const menuId = getMenuId(menuElement);
1843    return (
1844      menuState.openMenus.has(menuId) || menuElement.classList.contains("open")
1845    );
1846  }
1847
1848  //////////////////////////////////////////////////////
1849  // TWEEN INITIALIZATION
1850  //////////////////////////////////////////////////////
1851
1852  function initializeTweens() {
1853    // Erstelle Tweens für alle Hauptmenüs
1854    submenuParents.forEach((parent) => {
1855      const submenu = parent.querySelector(".submenu-panel");
1856      const submenuList = submenu?.querySelector(".submenu-list");
1857
1858      if (submenu && submenuList) {
1859        const tween = createAccordionTween(submenu, submenuList);
1860        storeTween(parent, tween);
1861      }
1862    });
1863
1864    // Erstelle Tweens für alle Untermenüs
1865    subSubParents.forEach((subParent) => {
1866      const subSubPanel = subParent.querySelector(":scope > .subsubmenu-panel");
1867      const subSubList = subSubPanel?.querySelector(
1868        ":scope > .subsubmenu-list"
1869      );
1870
1871      if (subSubPanel && subSubList) {
1872        const tween = createAccordionTween(subSubPanel, subSubList);
1873        storeTween(subParent, tween);
1874      }
1875    });
1876  }
1877
1878  //////////////////////////////////////////////////////
1879  // MOBILE NAVIGATION
1880  //////////////////////////////////////////////////////
1881
1882  const openMobileNav = () => {
1883    menuState.isNavOpen = true;
1884    menuState.hasCurrentPage = hasCurrentMenuItem();
1885
1886    document.body.classList.add("overflow-hidden");
1887    navWrap.classList.add("active");
1888    underlay?.classList.add("active");
1889    hamburger.classList.add("is-active");
1890    header.classList.add("active");
1891    nav.classList.add("active");
1892
1893    // Determine which logo to show based on fadein state and config
1894    const logoNavCount = getLogoNavCount();
1895    const isHeaderFadein = header.classList.contains("fadein");
1896    const shouldUseLogoNav2 = logoNavCount === 2 && isHeaderFadein && logoNav2;
1897
1898    if (shouldUseLogoNav2) {
1899      logoNav2.classList.add("active");
1900      logoNav.classList.remove("active");
1901    } else {
1902      logoNav.classList.add("active");
1903      if (logoNav2) {
1904        logoNav2.classList.remove("active");
1905      }
1906    }
1907
1908    const placeholder = document.querySelector(".header-placeholder");
1909
1910    if (header && placeholder) {
1911      header.style.position = "fixed";
1912      placeholder.style.display = "block";
1913    }
1914
1915    const tl = gsap.timeline();
1916    const activeLogoNav = shouldUseLogoNav2 ? logoNav2 : logoNav;
1917
1918    gsap.set(allNavItems, { autoAlpha: 1, y: 0 });
1919
1920    tl.set(nav, { autoAlpha: 0 })
1921      .set(logoNav, { autoAlpha: 0 })
1922      .set(logoNav2, { autoAlpha: 0 })
1923      .to(nav, { autoAlpha: 1, ease: "power4.inOut", duration: 0.3 }, 0)
1924      .to(logo, { autoAlpha: 0, ease: "power4.inOut", duration: 0.3 }, 0)
1925      .to(
1926        activeLogoNav,
1927        { autoAlpha: 1, ease: "power4.inOut", duration: 0.3 },
1928        0
1929      );
1930
1931    // Handle current menu states - SOFORT ohne Timeout
1932    if (menuState.hasCurrentPage) {
1933      const currentPath = getCurrentMenuPath();
1934
1935      // Öffne alle Menüs im Pfad sofort ohne Animation
1936      currentPath.forEach((menuElement, index) => {
1937        const tween = getTween(menuElement);
1938
1939        if (tween) {
1940          openMenu(menuElement, tween, true);
1940 // skipAnimation = true
1941
1942          // Setze currentMainIndex für das Hauptmenü
1943          if (menuElement.classList.contains("subentry")) {
1944            menuState.currentMainIndex =
1945              Array.from(submenuParents).indexOf(menuElement);
1946          }
1947        }
1948      });
1949    }
1950  };
1951
1952  const closeMobileNav = () => {
1953    menuState.isNavOpen = false;
1954    menuState.hasCurrentPage = false;
1955
1956    document.body.classList.remove("overflow-hidden");
1957    navWrap.classList.remove("active");
1958    underlay?.classList.remove("active");
1959    hamburger.classList.remove("is-active");
1960    logoNav.classList.remove("active");
1961    if (logoNav2) {
1962      logoNav2.classList.remove("active");
1963    }
1964    header.classList.remove("active");
1965    nav.classList.remove("active");
1966
1967    const placeholder = document.querySelector(".header-placeholder");
1968    const originalPosition =
1969      window.getComputedStyle(placeholder).position === "absolute"
1970        ? "absolute"
1971        : "relative";
1972
1973    if (window.pageYOffset <= header?.offsetHeight) {
1974      header.style.position = originalPosition;
1975      placeholder && (placeholder.style.display = "none");
1976    }
1977
1978    const tl = gsap.timeline();
1979
1980    tl.to(logo, { autoAlpha: 1, ease: "power4.inOut", duration: 0.3 }, "-=0.1")
1981      .to(logoNav, { autoAlpha: 0, ease: "power4.inOut", duration: 0.3 }, "-=1")
1982      .to(
1983        logoNav2,
1984        { autoAlpha: 0, ease: "power4.inOut", duration: 0.3 },
1985        "-=1"
1986      )
1987      .to(nav, { autoAlpha: 0, ease: "power4.inOut", duration: 0.3 }, "-=0.1");
1988
1989    // Reset all menu states
1990    menuState.openMenus.forEach((menuData) => {
1991      menuData.tween.reverse();
1992      menuData.element.classList.remove("open");
1993    });
1994    menuState.openMenus.clear();
1995    menuState.currentMainIndex = undefined;
1996
1997    gsap.set(allNavItems, { autoAlpha: 1, y: 0, clearProps: "transform,opacity,visibility" });
1998  };
1999
2000  //////////////////////////////////////////////////////
2001  // EVENT HANDLERS
2002  //////////////////////////////////////////////////////
2003
2004  stickyMenu?.addEventListener("click", (e) => {
2005    e.preventDefault();
2006    e.stopPropagation();
2007    menuState.isNavOpen ? closeMobileNav() : openMobileNav();
2008  });
2009
2010  document.addEventListener("click", (e) => {
2011    const isInsideNav = navWrap.contains(e.target);
2012    const isStickyMenu = stickyMenu.contains(e.target);
2013    if (!isInsideNav && !isStickyMenu && menuState.isNavOpen) {
2014      closeMobileNav();
2015    }
2016  });
2017
2018  // MAIN MENU ENTRIES (1. Ebene)
2019  submenuParents.forEach((parent, index) => {
2020    const toggleBtn = parent.querySelector(".subentry-title");
2021
2022    if (!toggleBtn) return;
2023
2024    toggleBtn.addEventListener("click", (e) => {
2025      e.preventDefault();
2026
2027      const tween = getTween(parent);
2028      if (!tween) return;
2029
2030      if (isMenuOpen(parent)) {
2031        // Schließe das aktuelle Menü
2032        closeMenu(parent);
2033        if (menuState.currentMainIndex === index) {
2034          menuState.currentMainIndex = undefined;
2035        }
2036      } else {
2037        // Schließe andere Hauptmenüs
2038        if (
2039          menuState.currentMainIndex !== undefined &&
2040          menuState.currentMainIndex !== index
2041        ) {
2042          const otherMenu = submenuParents[menuState.currentMainIndex];
2043          closeMenu(otherMenu);
2044        }
2045
2046        // Öffne das neue Menü (mit Animation)
2047        openMenu(parent, tween, false);
2048        menuState.currentMainIndex = index;
2049      }
2050    });
2051  });
2052
2053  // SUB MENU ENTRIES (2+ Ebenen)
2054  subSubParents.forEach((subParent) => {
2055    const toggleBtn = subParent.querySelector(":scope > .subsubentry-title");
2056
2057    if (!toggleBtn) return;
2058
2059    toggleBtn.addEventListener("click", (e) => {
2060      e.preventDefault();
2061
2062      const tween = getTween(subParent);
2063      if (!tween) return;
2064
2065      if (isMenuOpen(subParent)) {
2066        closeMenu(subParent);
2067      } else {
2068        // Schließe Geschwister-Menüs auf derselben Ebene
2069        closeSiblingMenus(subParent, ".submenu-panel, .subsubmenu-panel");
2070        openMenu(subParent, tween, false); // Mit Animation
2071      }
2072    });
2073  });
2074
2075  nav.querySelectorAll('a[href^="/#"]').forEach((anchor) => {
2076    anchor.addEventListener('click', () => {
2077      closeMobileNav();
2078    });
2079  });
2080
2081  //////////////////////////////////////////////////////
2082  // INITIALIZATION
2083  //////////////////////////////////////////////////////
2084
2085  // Initialisiere alle Tweens beim Start
2086  initializeTweens();
2087}
2088
2089window.mobileAccordionNavigation = mobileAccordionNavigation;
2090
2091"use strict";
2092
2093// Auto-generated navigation index
2094// Desktop Mode: hamburger-frame-rtl
2095// Mobile Mode: accordion
2096// Generated at: 2026-08-18T09:22:40.182Z
2097
2098function navigation() {
2099  function getRootCSSVariable(varName) {
2100    return getComputedStyle(document.documentElement).getPropertyValue(varName).trim();
2101  }
2102  var isMobile = function isMobile() {
2103    return window.matchMedia("(max-width: 768px)").matches;
2104  };
2105  var getDesktopMode = function getDesktopMode() {
2106    return getRootCSSVariable('--nav-desktop-mode') || 'hamburger-frame-rtl';
2107  };
2108  var getMobileMode = function getMobileMode() {
2109    return getRootCSSVariable('--nav-mobile-mode') || 'accordion';
2110  };
2111  var universalHandlers = {
2112    'tabs': function tabs() {
2113      return typeof desktopTabsNavigation === 'function' && desktopTabsNavigation();
2114    },
2115    'tabs-panel': function tabsPanel() {
2116      return typeof desktopTabsPanelNavigation === 'function' && desktopTabsPanelNavigation();
2117    },
2118    'hamburger-panel': function hamburgerPanel() {
2119      return typeof desktopHamburgerPanelNavigation === 'function' && desktopHamburgerPanelNavigation();
2120    },
2121    'hamburger-frame-ltr': function hamburgerFrameLtr() {
2122      return typeof desktopHamburgerFrameLtrNavigation === 'function' && desktopHamburgerFrameLtrNavigation();
2123    },
2124    'hamburger-frame-rtl': function hamburgerFrameRtl() {
2125      return typeof desktopHamburgerFrameRtlNavigation === 'function' && desktopHamburgerFrameRtlNavigation();
2126    },
2127    'hamburger-overlay-accordion': function hamburgerOverlayAccordion() {
2128      return typeof desktopHamburgerOverlayAccordionNavigation === 'function' && desktopHamburgerOverlayAccordionNavigation();
2129    },
2130    'hamburger-overlay-tabs': function hamburgerOverlayTabs() {
2131      return typeof desktopHamburgerOverlayTabsNavigation === 'function' && desktopHamburgerOverlayTabsNavigation();
2132    },
2133    'accordion': function accordion() {
2134      return typeof mobileAccordionNavigation === 'function' && mobileAccordionNavigation();
2135    },
2136    'layers': function layers() {
2137      return typeof mobileLayersNavigation === 'function' && mobileLayersNavigation();
2138    }
2139  };
2140  if (!isMobile()) {
2141    var mode = getDesktopMode();
2142    if (universalHandlers[mode]) {
2143      universalHandlers[mode]();
2144    } else {
2145      console.warn('Unknown desktop navigation mode:', mode);
2146    }
2147  } else {
2148    var _mode = getMobileMode();
2149    if (universalHandlers[_mode]) {
2150      universalHandlers[_mode]();
2151    } else {
2152      console.warn('Unknown mobile navigation mode:', _mode);
2153    }
2154  }
2155}
2156"use strict";
2157
2158// GSAP Search Animation Script
2159(function () {
2160  'use strict';
2161
2162  // Elemente selektieren
2163  var searchIcon = document.querySelector('.icon-search');
2164  var searchContainer = document.querySelector('.suche');
2165  var searchForm = document.querySelector('.search-form');
2166  var searchInput = document.querySelector('input[type="search"]');
2167
2168  // Prüfen ob alle Elemente vorhanden sind
2169  if (!searchIcon || !searchContainer || !searchForm) {
2170    console.warn('Search elements not found');
2171    return;
2172  }
2173
2174  // Initialer Zustand setzen
2175  gsap.set(searchContainer, {
2176    scaleY: 0,
2177    transformOrigin: "center top"
2178  });
2179  gsap.set(searchForm, {
2180    autoAlpha: 0,
2181    y: -20
2182  });
2183
2184  // Status Variable
2185  var isSearchOpen = false;
2186
2187  // Timeline für das Öffnen der Suche
2188  function openSearch() {
2189    var tl = gsap.timeline();
2190
2191    // Container öffnen
2192    tl.to(searchContainer, {
2193      scaleY: 1,
2194      duration: 0.5,
2195      ease: "power3.out"
2196    })
2197    // Form einblenden (nach Container-Animation)
2198    .to(searchForm, {
2199      autoAlpha: 1,
2200      y: 0,
2201      duration: 0.4,
2202      ease: "power2.out"
2203    }, "-=0.1") // Leicht überlappend
2204    // Focus auf Input setzen
2205    .call(function () {
2206      searchInput.focus();
2207    });
2208
2209    // Klasse für CSS-Styling hinzufügen
2210    searchContainer.classList.add('open');
2211    isSearchOpen = true;
2212  }
2213
2214  // Timeline für das Schließen der Suche
2215  function closeSearch() {
2216    var tl = gsap.timeline();
2217
2218    // Form ausblenden
2219    tl.to(searchForm, {
2220      autoAlpha: 0,
2221      y: -20,
2222      duration: 0.3,
2223      ease: "power2.in"
2224    })
2225    // Container schließen
2226    .to(searchContainer, {
2227      scaleY: 0,
2228      duration: 0.4,
2229      ease: "power3.in"
2230    }, "-=0.1") // Leicht überlappend
2231    // Cleanup nach Animation
2232    .call(function () {
2233      searchContainer.classList.remove('open');
2234      searchInput.blur();
2235      searchInput.value = ''; // Input leeren
2236    });
2237    isSearchOpen = false;
2238  }
2239
2240  // Click-Handler für das Such-Icon
2241  searchIcon.addEventListener('click', function (e) {
2242    e.preventDefault();
2243    e.stopPropagation();
2244    if (isSearchOpen) {
2245      closeSearch();
2246    } else {
2247      openSearch();
2248    }
2249  });
2250
2251  // Click-Handler für Clicks außerhalb des Containers
2252  document.addEventListener('click', function (e) {
2253    // Prüfen ob der Klick außerhalb der Suche war
2254    if (isSearchOpen && !searchContainer.contains(e.target) && !searchIcon.contains(e.target)) {
2255      closeSearch();
2256    }
2257  });
2258
2259  // Escape-Taste zum Schließen
2260  document.addEventListener('keydown', function (e) {
2261    if (e.key === 'Escape' && isSearchOpen) {
2262      closeSearch();
2263    }
2264  });
2265
2266  // Prevent event bubbling auf dem Search-Container
2267  searchContainer.addEventListener('click', function (e) {
2268    e.stopPropagation();
2269  });
2270
2271  // Optional: Form-Submit-Handler (falls gewünscht)
2272  searchForm.addEventListener('submit', function (e) {
2273    var query = searchInput.value.trim();
2274    if (!query) {
2275      e.preventDefault();
2276      // Ggf. Warnung anzeigen oder Input highlighten
2277      gsap.to(searchInput, {
2278        x: [-10, 10, -5, 5, 0],
2279        duration: 0.5,
2280        ease: "power2.out"
2281      });
2282    }
2283    // Ansonsten wird das Formular normal submitted
2284  });
2285})();
2286"use strict";
2287
2288(function () {
2289  'use strict';
2290
2291  var backButtons = document.querySelectorAll("#back-button");
2292  backButtons.forEach(function (backButton) {
2293    backButton.addEventListener("click", function (event) {
2294      // Prüfen, ob ein Referer vorhanden ist
2295      if (document.referrer && new URL(document.referrer).hostname === window.location.hostname) {
2296        event.preventDefault(); // Standard-Link-Verhalten verhindern
2297        window.history.back(); // Zurück zur vorherigen Seite
2298      } else {
2299        // Kein gültiger Referer, Standard-Link bleibt aktiv (führt zu /news)
2300      }
2301    });
2302  });
2303})();
2304"use strict";
2305
2306(function () {
2307  'use strict';
2308
2309  document.querySelectorAll('.accordion').forEach(function (accordion) {
2310    var items = accordion.querySelectorAll('.accordion_item');
2311    items.forEach(function (item) {
2312      var title = item.querySelector('.accordion_title');
2313      title.addEventListener('click', function () {
2314        var opened_item = accordion.querySelector('.is-open');
2315        var currentItem = this.closest('.accordion_item');
2316
2317        // Toggle current item
2318        toggle_item(currentItem);
2319
2320        // Scroll to open Tab - intelligente Positionierung
2321        function scrollToAccordion(item) {
2322          var timeout = /Mobi|Android/i.test(navigator.userAgent) ? 400 : 200;
2323          setTimeout(function () {
2324            var itemRect = item.getBoundingClientRect();
2325            var itemHeight = itemRect.height;
2326            var windowHeight = window.innerHeight;
2327            var offset;
2328            // SCHWELLENWERT: Wenn das Accordion höher als 80% des Viewports ist
2329            if (itemHeight > windowHeight * 0.8) {
2330              // Bei großen Accordions: Titel 20px vom oberen Rand
2331              offset = item.getBoundingClientRect().top + window.scrollY - 100;
2332            } else {
2333              // Bei normalen Accordions: Zentrieren
2334              offset = item.getBoundingClientRect().top + window.scrollY - windowHeight / 2 + itemHeight / 2;
2335            }
2336            window.scrollTo({
2337              top: offset,
2338              behavior: 'smooth'
2339            });
2340            if (typeof ScrollTrigger !== 'undefined') {
2341              setTimeout(function () {
2342                ScrollTrigger.refresh();
2343              }, 800); // Mehr Zeit für das Smooth-Scrolling
2344            }
2345          }, timeout);
2346        }
2347        scrollToAccordion(currentItem);
2348
2349        // Close earlier opened item if exists
2350        if (opened_item && opened_item !== currentItem) {
2351          toggle_item(opened_item);
2352        }
2353      });
2354    });
2355    function toggle_item(item) {
2356      var body = item.querySelector('.accordion_body');
2357      if (item.classList.contains('is-open')) {
2358        body.removeAttribute('style');
2359        item.classList.remove('is-open');
2360      } else {
2361        body.style.height = body.scrollHeight + 'px';
2362        item.classList.add('is-open');
2363      }
2364    }
2365  });
2366})();
2367"use strict";
2368
2369(function () {
2370  'use strict';
2371
2372  // Function to handle tab switching
2373  function switchTab(tab) {
2374    var target = tab.dataset.tab;
2375
2376    // Remove current class from all tabs and contents
2377    document.querySelectorAll('.tabs li').forEach(function (el) {
2378      return el.classList.remove('current');
2379    });
2380    document.querySelectorAll('.tab-content').forEach(function (el) {
2381      return el.classList.remove('current');
2382    });
2383
2384    // Add current class to the clicked tab and corresponding content
2385    tab.classList.add('current');
2386    document.getElementById(target).classList.add('current');
2387
2388    // Scroll to the top of the tabs
2389    var clickedTabsContainer = tab.closest('.tabs');
2390
2391    // Get the actual position of the tabs container
2392    var rect = clickedTabsContainer.getBoundingClientRect();
2393    var absoluteTop = rect.top + window.pageYOffset;
2394
2395    // Use the calculated absolute position
2396    var scrollTarget = absoluteTop - 200;
2397    window.scrollTo({
2398      top: scrollTarget,
2399      behavior: 'smooth'
2400    });
2401  }
2402
2403  // Add click event to each tab
2404  document.querySelectorAll('.tabs li').forEach(function (tab) {
2405    tab.addEventListener('click', function () {
2406      return switchTab(tab);
2407    });
2408  });
2409
2410  // Check URL hash and switch to the corresponding tab
2411  function handleHashChange() {
2412    var hash = window.location.hash.substring(1); // Remove the #
2413    if (hash) {
2414      var targetTab = document.querySelector(".tabs li[data-tab=\"".concat(hash, "\"]"));
2415      if (targetTab) {
2416        switchTab(targetTab);
2417      }
2418    }
2419  }
2420
2421  // Handle initial hash and future hash changes
2422  handleHashChange();
2423  window.addEventListener('hashchange', handleHashChange);
2424})();
2425"use strict";
2426
2427function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2428function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2429function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
2430function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
2431function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
2432function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
2433document.addEventListener("DOMContentLoaded", function () {
2434  var swiperContainers = document.querySelectorAll(".swiper-container");
2435  var swiperInstances = {};
2436
2437  // Erst Thumbs-Swiper initialisieren, dann die mit thumbs-Referenz
2438  var sorted = _toConsumableArray(swiperContainers).sort(function (a, b) {
2439    var aHasThumbs = !!a.getAttribute("data-swiper-thumbs");
2440    var bHasThumbs = !!b.getAttribute("data-swiper-thumbs");
2441    return aHasThumbs - bHasThumbs; // Thumbs-Swiper kommen zuerst
2442  });
2443  sorted.forEach(function (container) {
2444    try {
2445      var configAttr = container.getAttribute("data-swiper-config");
2446      if (!configAttr) return;
2447      var config = JSON.parse(configAttr);
2448
2449      // Thumbs-Referenz auflösen falls vorhanden
2450      var thumbsSelector = container.getAttribute("data-swiper-thumbs");
2451      if (thumbsSelector && swiperInstances[thumbsSelector]) {
2452        config.thumbs = {
2453          swiper: swiperInstances[thumbsSelector]
2454        };
2455      }
2456      var instance = new Swiper(container, config);
2457
2458      // Instanz speichern damit andere Swiper sie als Thumbs nutzen können
2459      container.classList.forEach(function (cls) {
2460        if (cls.startsWith("swiper")) {
2461          swiperInstances[".".concat(cls)] = instance;
2462        }
2463      });
2464    } catch (error) {
2465      console.error("Error initializing Swiper:", error);
2466    }
2467  });
2468});
2469"use strict";
2470
2471document.addEventListener("DOMContentLoaded", function () {
2472  console.log('default');
2473  sliderGalerie();
2474
2475  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2476  // SLIDER GALERIE
2477  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2478
2479  function sliderGalerie() {
2480    // foreach slider-galerie
2481    document.querySelectorAll('.slider-galerie').forEach(function (sliderEl, idx) {
2482      // Ensure unique navigation selectors for each slider (optional, if needed)
2483      var nextBtn = sliderEl.parentElement.querySelector('.swiper-button-next-slider-galerie');
2484      var prevBtn = sliderEl.parentElement.querySelector('.swiper-button-prev-slider-galerie');
2485      new Swiper(sliderEl, {
2486        spaceBetween: 30,
2487        effect: "fade",
2488        fadeEffect: {
2489          crossFade: true
2490        },
2491        navigation: {
2492          nextEl: nextBtn || ".swiper-button-next-slider-galerie",
2493          prevEl: prevBtn || ".swiper-button-prev-slider-galerie"
2494        }
2495      });
2496    });
2497  }
2498});

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.