import{$ as u}from"./iframe-DSGyX7_4.js";import{p,c as a}from"./helpers-DDTkKuvc.js";const m=[{letter:"A",url:"./html/az-letter-content.html"},{letter:"B",url:"./html/az-letter-content.html"},{letter:"C",url:"./html/az-letter-content.html"},{letter:"D",url:null},{letter:"E",url:"./html/az-letter-content.html"},{letter:"F",url:"./html/az-letter-content.html"},{letter:"G",url:"./html/az-letter-content.html"},{letter:"H",url:"./html/az-letter-content.html"},{letter:"I",url:"./html/az-letter-content.html"},{letter:"J",url:null},{letter:"K",url:"./html/az-letter-content.html"},{letter:"L",url:"./html/az-letter-content.html"},{letter:"M",url:"./html/az-letter-content.html"},{letter:"N",url:null},{letter:"O",url:null},{letter:"P",url:null},{letter:"Q",url:null},{letter:"R",url:"./html/az-letter-content.html"},{letter:"S",url:"./html/az-letter-content.html"},{letter:"T",url:null},{letter:"U",url:"./html/az-letter-content.html"},{letter:"V",url:"./html/az-letter-content.html"},{letter:"W",url:"./html/az-letter-content.html"},{letter:"X",url:null},{letter:"Y",url:null},{letter:"Z",url:"./html/az-letter-content.html"},{letter:"Ä",url:"./html/az-letter-content.html"},{letter:"Ö",url:null},{letter:"Ü",url:null},{letter:"#",url:"./html/az-letter-content.html"}],e=global.$;class h{constructor(t){this.anchorLink=window.location.href.match(/#(.*)/),this.section=t.addClass("initiated"),this.letterWrapper=t.find(".letters"),this.letters=this.letterWrapper.find("a"),this.contentWrapper=e('<div class="letter-content" />').insertAfter(this.letterWrapper),this.initContentWrappers(),this.handleClicks()}initContentWrappers(){this.letters.each((t,l)=>{const r=e(l).attr("data-index",t);e('<div class="a-z-content-wrapper" />').attr("data-source",r.attr("href")).appendTo(this.contentWrapper)}),this.contents=this.contentWrapper.children()}handleClicks(){const t=p("letter"),l=this.section.find("[data-letter='"+t+"']");this.letters.on("click",r=>{r.preventDefault();const s=e(r.currentTarget),n=parseInt(s.attr("data-index"));s.parent("li").addClass("active").siblings(".active").removeClass("active"),this.contentWrapper.css("height",this.contentWrapper.outerHeight()+"px"),this.contents.eq(n).addClass("current").siblings(".current").removeClass("current"),!this.contents.eq(n).hasClass("loading")&&!this.contents.eq(n).hasClass("loaded")?this.loadContent(n):this.updateHeight()}),t&&l.length>0?l.find("a").trigger("click"):this.letters.first().trigger("click")}initHeightCheck(){e(window).on("resize",t=>{this.handleResize()}),this.handleResize()}handleResize(){this.letterWrapper.height()>60?this.letterWrapper.addClass("not-sticky"):this.letterWrapper.removeClass("not-sticky")}loadContent(t){const l=this,r=this.contents.eq(t).addClass("loading"),s=e('<div class="outer accordion" />').appendTo(r);let n=this.section.attr("data-letter-content-url");const o=this.letters.eq(t).parent().data("letter");n||(n=this.letters.eq(t).attr("href"));const c={letter:o};e.ajax({url:n,data:c,type:"GET",success:d=>{s.html(d),r.removeClass("loading").addClass("loaded"),e("body").trigger("dynamic-component-loaded"),l.updateHeight()}})}updateHeight(){if(setTimeout(()=>{this.contentWrapper.css("height",this.contentWrapper.children(".current").outerHeight()+"px")},40),setTimeout(()=>{this.contentWrapper.removeAttr("style")},500),this.anchorLink!=null){const t=this.anchorLink[1].length>10?this.anchorLink[1].substr(0,this.anchorLink[1].indexOf("&")):this.anchorLink[1],l=e("#"+t);l.css("display","block"),l.parent().addClass("open"),this.scrollToTarget(l),this.anchorLink=null}else{let t=this.section.offset().top-100;e(window).width()<768&&(t=this.section.offset().top-80),e(window).scrollTop()>t&&e("html, body").animate({scrollTop:t},500,"easeInOutQuad")}}scrollToTarget(t){t.length>0&&e("html, body").animate({scrollTop:t.first().offset().top-250},200)}}e("body").on("ihk-init dynamic-component-loaded gfi-dynamic-init",function(){e(".a-z:not(.initiated)").each(function(i){new h(e(this))})});const z=({items:i=m})=>{const t=a("section",["a-z","variant-base"]),l=a("ul",["letters"],null,t);return i.map(r=>{const s=r.url&&r.url.length>0,n=a("li",[],null,l),o=a(s?"a":"span",["letter"],r.letter,n);s?o.href=r.url:n.classList.add("disabled")}),new h(u(t)),t};export{m as a,z as c};
