import{$ as i}from"./iframe-DSGyX7_4.js";import{c as s,f as h}from"./helpers-DDTkKuvc.js";class d{constructor(e){this.header=e.addClass("initiated"),this.gradient=e.find(".gradient"),this.title=e.find(".title"),this.window=i(window),this.minScale=0,this.preventResize=!1,this.initSizeObserver(),this.initScroll(),i("body").on("overlay-open",()=>{this.preventResize=!0}).on("overlay-close",()=>{this.preventResize=!1})}initSizeObserver(){new ResizeObserver(()=>{this.getMinScale()}).observe(this.header.get(0))}initScroll(){window.addEventListener("scroll",()=>{window.requestAnimationFrame(()=>{this.preventResize||this.checkScroll()})},{passive:!0}),this.checkScroll()}checkScroll(){const e=this.window.scrollTop();let t=1-Math.round(e/4)/100;const a=1-Math.round(e/2)/100;t<0&&(t=0),this.gradient.css({transform:"scale(1, "+(t>this.minScale?t:this.minScale)+")"}),this.title.css({transform:"translate(-50%, -50%) scale("+t+")",opacity:a>0?a:0})}getMinScale(){this.minScale=Math.round(1e3/this.header.outerHeight())/100}}i("body").on("ihk-init dynamic-component-loaded gfi-dynamic-init",function(){i(this),i(".magazine-header:not(.initiated)").each(function(l){new d(i(this))})});const m=({size:l="regular",logo:e="./logos/wirtschaftsdialoge.svg",title:t="Wirtschaftsdialoge",imgtext:a="regular",smalltext:c="",backgroundColor:f="",inlineStyles:g="background: "+f+";"})=>{const r=s("section",["magazine-header","variant-solid",l],null,null);r.setAttribute("aria-label","Kopfbereich"),s("span",["gradient"],null,r,g),e&&e.length>0&&c.length>0&&(a="image-and-text");const n=s("a",["title",a],null,r);if(n.href="#",n.tabIndex=-1,e&&e.length>0&&c.length===0)h(e,400,100,"Wirtschaftsdialoge Logo",[],n);else if(e&&e.length>0&&c.length>0){h(e,100,100,"",[],n);const o=s("div",["text"],null,n);s("span",["title-text"],t,o),s("span",["small-text"],c,o)}else n.innerText=t;return new d(i(r)),r};export{m as c};
