PageSourceSearch

https://cdn.prod.www.manager-magazin.de/public/shared/generated/js/index.c35db40b285047629e78.js

js manager-magazin.de collected 2026-10-01 08:34:04 UTC 236,457 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunksource=self.webpackChunksource||[]).push([[921],{693(e,t,i){var s=i(24);const n=s.A.instance;i.p=`${n.urls.assetsBasePath}/public/`;var a=i(705),o=i(211);var r=i(540),l=i(674),c=i(606),d=i(137);const h={breakpointQueries:[],breakpoint:"",colorSchemeQuery:window.matchMedia("(prefers-color-scheme: dark)"),colorScheme:"",init(){(s.A.instance.breakpoints?Object.keys(s.A.instance.breakpoints):[]).forEach(e=>{const{min:t,max:i}=s.A.instance.breakpoints[e];let n;t&&i?n=`(min-width: ${t}px) and (max-width: ${i}px)`:t?n=`(min-width: ${t}px)`:i&&(n=`(max-width: ${i}px)`),n&&this.breakpointQueries.push({breakpoint:e,query:window.matchMedia(n)})}),this.onBreakpointChanged(),this.onColorSchemeChanged(),"function"==typeof this.colorSchemeQuery.addEventListener?(this.colorSchemeQuery.addEventListener("change",()=>this.onColorSchemeChanged()),this.breakpointQueries.forEach(e=>{e.query.addEventListener("change",()=>this.onBreakpointChanged())})):"function"==typeof this.colorSchemeQuery.addListener&&(this.colorSchemeQuery.addListener(()=>this.onColorSchemeChanged()),this.breakpointQueries.forEach(e=>{e.query.addListener(()=>this.onBreakpointChanged())}))},onColorSchemeChanged(){this.colorScheme=this.colorSchemeQuery.matches?r.xP:r.zF,c.A.publish(o.Bc,{colorScheme:this.colorScheme})},onBreakpointChanged(){if(0===this.breakpointQueries.length)return;const e=this.breakpointQueries.filter(e=>e.query.matches).pop().breakpoint;this.breakpoint!==e&&(this.breakpoint=e,c.A.publish(o.Dz,{breakpoint:this.breakpoint}))}},u={get instance(){return a.A.store("MediaQuery")}};var p=i(434),g=i(358);const m=Symbol("INSTANCE"),y=Symbol("SINGELTONENFORCER");class f{constructor(e){if(e!==y)throw new Error("Instantiation failed: Use ConsentManagementPlatformAPI.instance instead of new.")}static get instance(){return this[m]||(this[m]=new f(y)),this[m]}get __tcfapi(){if(window.self!==window.top)try{if(window.top.__tcfapiLocator)return window.top.__tcfapi}catch(e){}return window.__tcfapi}addEventListener(e){"function"==typeof e&&("function"==typeof this.__tcfapi?this.__tcfapi("addEventListener",2,(t,i)=>e(t,i)):console.error("ConsentManagementPlatformAPI addEventListener - __tcfapi is not available!"))}getTCData(){return"function"!=typeof this.__tcfapi?Promise.reject(new Error("ConsentManagementPlatformAPI getTCData - __tcfapi is not available!")):new Promise((e,t)=>{this.__tcfapi("addEventListener",2,(i,s)=>{const n=i&&i.listenerId?i.listenerId:null;n&&this.__tcfapi("removeEventListener",2,()=>{},n),s?e(i):t(new Error("ConsentManagementPlatformAPI getTCData - unknown error"))})})}getCustomVendorConsents(){return"function"!=typeof this.__tcfapi?Promise.reject(new Error("ConsentManagementPlatformAPI getCustomVendorConsents - __tcfapi is not available!")):new Promise((e,t)=>{this.__tcfapi("getCustomVendorConsents",2,(i,s)=>{s?e(i):t(new Error("ConsentManagementPlatformAPI getCustomVendorConsents - unknown error"))})})}getVendorPurposeMapping(){return"function"!=typeof this.__tcfapi?Promise.reject(new Error("ConsentManagementPlatformAPI getVendorPurposeMapping - __tcfapi is not available!")):new Promise((e,t)=>{this.__tcfapi("getVendorPurposeMapping",2,(i,s)=>{s&&i&&Array.isArray(i)&&i.length>0?e(i):t(new Error("ConsentManagementPlatformAPI getVendorPurposeMapping - no mapping received"))})})}postCustomConsent({vendorIds:e,purposeIds:t,legitimateInterestPurposeIds:i}){return"function"!=typeof this.__tcfapi?Promise.reject(new Error("ConsentManagementPlatformAPI postCustomConsent - __tcfapi is not available!")):e&&Array.isArray(e)&&e.length>0||t&&Array.isArray(t)&&t.length>0||i&&Array.isArray(i)&&i.length>0?new Promise((s,n)=>{this.__tcfapi("postCustomConsent",2,(e,t)=>{t?s(e):n(new Error("ConsentManagementPlatformAPI postCustomConsent - unknown error"))},e,t,i)}):Promise.reject(new Error("ConsentManagementPlatformAPI postCustomConsent - missing function params vendorIds, purposeIds and/or legitimateInterestPurposeIds"))}postRejectAll(){return"function"!=typeof this.__tcfapi?Promise.reject(new Error("ConsentManagementPlatformAPI postRejectAll - __tcfapi is not available!")):new Promise((e,t)=>
1{this.__tcfapi("postRejectAll",2,(i,s)=>{s?e(i):t(new Error("ConsentManagementPlatformAPI postRejectAll - unknown error"))})})}}var b=i(646),A=i(202);class w extends A.A{constructor(e){super(),this._firebaseAnalytics=!!e?.firebaseAnalytics,this._firebaseInAppMessaging=!!e?.firebaseInAppMessaging}get id(){return b.Pv}get firebaseAnalytics(){return this._firebaseAnalytics}get firebaseInAppMessaging(){return this._firebaseInAppMessaging}}var I=i(743);const v=Symbol("INSTANCE"),E=Symbol("SINGELTONENFORCER");class P{constructor(e){if(e!==E)throw new Error("Instantiation failed: Use TCDataModel.instance instead of new.");this.consentManagementPlatformAPI=f.instance,this._ready=!1,this._errorOccurred=!1,this._tcData=void 0,this._consentedPurposeIds=[],this._customVendorConsents=void 0,this.isPurposeOneGranted=!1,this.init()}static get instance(){return this[v]||(this[v]=new P(E)),this[v]}init(){s.A.instance.disableSourcepoint||(c.A.subscribe(o.Pd,()=>this.onSourcepointReloadMessagesExecuted(),this),this.consentManagementPlatformAPI.addEventListener((e,t)=>{this.tcfapiTCDataCallback(e,t)}))}tcfapiTCDataCallback(e,t){t?e&&this.onTCDataReceived(e):this.onError()}updateTCData(){this.consentManagementPlatformAPI.getTCData().then(e=>{this.onTCDataReceived(e)}).catch(()=>{this.onError()})}onTCDataReceived(e){if(e&&e.cmpStatus&&"error"===e.cmpStatus)return void this.onError();this._tcData=e;const t=this.isPurposeOneGranted;if(this.isPurposeOneGranted=this.isPurposeGranted(r.cg.store_and_access_information_on_a_device),l.A.isApp&&this._ready&&t&&!this.isPurposeOneGranted)return c.A.publish(o.pN,new w({firebaseAnalytics:!1,firebaseInAppMessaging:!1})),void window.location.reload();e&&e.eventStatus&&("tcloaded"===e.eventStatus||"useractioncomplete"===e.eventStatus)&&(this._ready||this.onReady(),this.updateCustomVendorConsents(),c.A.publish(o.Ud,this._tcData))}updateCustomVendorConsents(){this.consentManagementPlatformAPI.getCustomVendorConsents().then(e=>{this.onCustomVendorConsentsReceived(e)}).catch()}onCustomVendorConsentsReceived(e){this._customVendorConsents=e,this._consentedPurposeIds=[],this._customVendorConsents&&Array.isArray(this._customVendorConsents.consentedPurposes)&&this._customVendorConsents.consentedPurposes.forEach(e=>{e&&e._id&&this._consentedPurposeIds.push(e._id)}),c.A.publish(o.Nk,this._customVendorConsents)}onReady(){this._ready=!0,c.A.publish(o.YF,this._tcData),window.self===window.top||window.__tcfapiLocator||"useractioncomplete"!==this._tcData.eventStatus||c.A.publish(o.X2)}onSourcepointReloadMessagesExecuted(){this.updateTCData()}onError(){console.error("TCDataModel onError"),this._errorOccurred=!0,c.A.publish(o.pU)}isPurposeGranted(e){return!(!this._tcData||!(void 0!==this.tcData.gdprApplies&&!this.tcData.gdprApplies||this._tcData.purpose&&this._tcData.purpose.consents&&"boolean"==typeof this._tcData.purpose.consents[e]&&this._tcData.purpose.consents[e]))}isPurposeGrantedById(e){return!!this.tcData&&(void 0!==this.tcData.gdprApplies&&!this.tcData.gdprApplies||Array.isArray(this._consentedPurposeIds)&&this._consentedPurposeIds.includes(e))}grantPurposeById(e){return!e||this.isPurposeGrantedById(e)?Promise.resolve():new Promise((t,i)=>{if(!p.A.instance.hasNoAdsAccess){const e=s.A.instance,t=e.thirdparty&&e.thirdparty.sourcepoint&&e.thirdparty.sourcepoint.default?e.thirdparty.sourcepoint.default:void 0,{siteId:n}=t;let a;try{a=JSON.parse(I.A.getItem(`_sp_user_consent_${n}`))}catch(e){}let o=!1;if(o=a&&a.gdpr&&a.gdpr.consentStatus&&a.gdpr.consentStatus.hasConsentData&&a.gdpr.consentStatus.consentedToAny,o=o||a&&a.consentStatus&&a.consentStatus.hasConsentData&&a.consentStatus.consentedToAny,!o)return void i(new Error("TCDataModel grantPurposeById only allowed to be executed with valid consent status"))}this.consentManagementPlatformAPI.getVendorPurposeMapping().then(t=>{const i=[],s=[],n=[];return t.forEach(t=>{if(!t.vendorId||i.includes(t.vendorId))return;let a=!1;Array.isArray(t.categories)&&t.categories.forEach(t=>{t._id&&t._id===e&&"NOT_ALLOWED"!==t.type&&"DISCLOSURE_ONLY"!==t.type&&(a=!0,"LEGITIMATE_INTEREST"!==t.type||n.includes(t._id)||n.push(t._id),s.includes(t._id)||s.push(t._id))}),a&&i.push(t.vendorId)}),{vendorIds:i,purposeIds:s,legitimateInterestPurposeIds:n}}
1).then(({vendorIds:e,purposeIds:t,legitimateInterestPurposeIds:i})=>this.consentManagementPlatformAPI.postCustomConsent({vendorIds:e,purposeIds:t,legitimateInterestPurposeIds:i})).then(()=>{this.updateTCData(),t()}).catch(t=>{console.error(`TCDataModel grantPurposeById - failed for purposeId: ${e}`,t),i(t)})})}isVendorGranted(e){return!(!this._tcData||!(void 0!==this.tcData.gdprApplies&&!this.tcData.gdprApplies||this._tcData.vendor&&this._tcData.vendor.consents&&"boolean"==typeof this._tcData.vendor.consents[e]&&this._tcData.vendor.consents[e]))}get ready(){return this._ready}get errorOccurred(){return this._errorOccurred}get tcData(){return this._tcData}get customVendorConsents(){return this._customVendorConsents}}function S(e=[]){for(let t=0;t<e.length;t++){const i=e[t];if(!P.instance.isPurposeGranted(i))return!1}return!0}function k(e=[]){if(0===e.length)return!0;for(let t=0;t<e.length;t++){const i=e[t];if(!P.instance.isPurposeGrantedById(i))return!1}return!!P.instance.customVendorConsents}function C(e=[],t=[],i=[]){return P.instance.ready&&S(e)&&k(t)&&function(e=[]){for(let t=0;t<e.length;t++){const i=e[t];if(!P.instance.isVendorGranted(i))return!1}return!0}(i)}function _(e=[],t=[],i=[]){const n=!(!s.A.instance.consent||"boolean"!=typeof s.A.instance.consent.globallyDisabled)&&s.A.instance.consent.globallyDisabled;return s.A.instance.preview||C(e,t,i)||n&&0===e.length&&0===t.length&&0===i.length?Promise.resolve():new Promise(s=>{c.A.subscribe(o.YF,()=>{C(e,t,i)&&s()}),t.length>0&&c.A.subscribe(o.Nk,()=>{C(e,t,i)&&s()})})}function L(){const e=!(!s.A.instance.consent||"boolean"!=typeof s.A.instance.consent.globallyDisabled)&&s.A.instance.consent.globallyDisabled;return s.A.instance.preview||e||P.instance.customVendorConsents?Promise.resolve():new Promise(e=>{c.A.subscribe(o.Nk,()=>{e()})})}const T=Symbol("INSTANCE"),O=Symbol("SINGELTONENFORCER");class x{constructor(e){if(e!==O)throw new Error("Instantiation failed: Use IQDBridge.instance instead of new.");this.isInitialized=!1,this.hasError=!1,this.renderedPositions=[],this.pendingPostMessages=[],this.init()}static get instance(){return this[T]||(this[T]=new x(O)),this[T]}init(){const e=s.A.instance;if(this.iqdSettings=e.iqd,this.platform=this.getPlatform(),c.A.subscribe(o.gY,(e,t)=>this.onTargetAdPositionLoaded(e,t)),e.noAds&&!e.preview&&window.AdPositions&&Array.isArray(window.AdPositions)&&window.AdPositions.forEach(e=>{e.sitetype&&e.sitetype!==this.platform||c.A.publish(o.zG,{positionName:e.id,platform:this.platform})}),e.preview&&e.preview.showAds&&(c.A.subscribe(o.Dz,()=>this.onMediaQueryBreakpointChanged()),this.refreshAdContainersFilledState(!0)),void 0!==window.AdController){if("function"==typeof window.AdController.getRenderController&&"ready"===window.AdController.getRenderController()._state)return void this.onAdControllerReady();if("function"==typeof window.AdController.ready)return void window.AdController.ready(()=>this.onAdControllerReady());console.error("IQDBridge AdController ready handling error.")}}getPlatform(){const{preview:e}=s.A.instance,{breakpoint:t}=u.instance;return g.A.isMobile||e&&"sm"===t?"mobile":"desktop"}createCmsObject(){if(!this.iqdSettings||!this.iqdSettings.handle)return;const e="string"!=typeof this.iqdSettings.level2||this.iqdSettings.level2.startsWith("###")&&this.iqdSettings.level2.endsWith("###")?"":this.iqdSettings.level2,t="string"!=typeof this.iqdSettings.level3||this.iqdSettings.level3.startsWith("###")&&this.iqdSettings.level3.endsWith("###")?"":this.iqdSettings.level3,i="string"!=typeof this.iqdSettings.level4||this.iqdSettings.level4.startsWith("###")&&this.iqdSettings.level4.endsWith("###")?"":this.iqdSettings.level4,n=Array.isArray(this.iqdSettings.keywords)?this.iqdSettings.keywords:[];i&&n.unshift(i),t&&n.unshift(t),e&&n.unshift(e);const a=s.A.instance;a.noAds&&n.push("iqdnoads"),a.consent?.utiqDisabled&&n.push("utiq_off");const o=decodeURIComponent(d.A.getItem(r.AZ.saraTargetAdbrain.name));o&&0===o.indexOf("adb=true:")&&o.split("adb=true:")[1]&&n.push(o.split("adb=true:")[1]),d.A.getItem("polygon_iqkeywords")&&d.A.getItem("polygon_iqkeywords").split(",").forEach(e
1=>{n.push(this.sanitizeCmsObjectValue(e))}),p.A.instance.hasPaidAccess&&n.push("iqdpaid");const c=n.filter((e,t)=>n.indexOf(e)===t);this.cmsObject={$handle:this.iqdSettings.handle,level2:e,level3:t,level4:i,isWrapperApp:l.A.isApp,keywords:c.join(","),tma:"string"==typeof this.iqdSettings.tma?this.iqdSettings.tma:"",platform:this.platform},p.A.instance.id5Hash&&(this.cmsObject.userData={hashedEmail:p.A.instance.id5Hash}),window.cmsObject=this.cmsObject}onAdControllerReady(){if("function"==typeof window.AdController.setPageInfo&&"function"==typeof window.AdController.initialize){if(this.boundOnWindowMessage=e=>this.onWindowMessage(e),window.addEventListener("message",this.boundOnWindowMessage),"boolean"==typeof this.iqdSettings.initialize&&!this.iqdSettings.initialize)return;this.createCmsObject(),window.AdController.setPageInfo(this.cmsObject);try{window.AdController.stage()}catch(e){}_().then(()=>{const e=window.AdController.initialize();if(window.AdController.finalize(),e)for(this.isInitialized=!0,c.A.publish(o.Ap);this.pendingPostMessages.length>0;)this.sendPostMessage(this.pendingPostMessages.pop());else this.hasError=!0,c.A.publish(o.KO)})}}onWindowMessage(e){let t=e.data;if(e.source===window){try{t=JSON.parse(t)}catch(e){return}if(t.render_event)switch(t.render_event){case"IQTileLoaded":{const e=Array.isArray(t.position_size)&&2===t.position_size.length?t.position_size:[void 0,void 0];this.onIQTileLoaded(t.position,t.position_tile,e,!!t.position_filled);break}}}}onIQTileLoaded(e,t,i,s=!0){if(!e)return;const n={positionName:e,positionTile:t,platform:this.platform,containsAd:s,size:i};if(window.AdPositions&&Array.isArray(window.AdPositions)){const t=window.AdPositions.find(t=>t.id&&t.id===e&&t.sitetype&&t.sitetype===this.platform);t&&void 0!==t.cls&&(n.cls=t.cls)}this.refreshAdContainerStyle(e,s,i),this.refreshAdContainerFilledState(e,s),c.A.publish(o.zG,n),s&&c.A.publish(o.cG,e,this.platform)}onTargetAdPositionLoaded(e,t=!0){if(e)if(this.refreshAdContainerFilledState(e,t),t){const t=document.querySelector(`[data-advertisement][data-placement="${e}"][data-device="${this.platform}"]`);t&&(t.className="",t.parentElement.getAttribute("data-advertisement")&&t.parentElement.getAttribute("data-advertisement").indexOf(e)>=0&&(t.parentElement.className=""),t.style.display=""),c.A.publish(o.cG,e,this.platform)}else this.closeAdContainer(e)}closeAdContainer(e){document.querySelectorAll(`[data-advertisement~="${e}:${this.platform}"]:not([data-advertisement~="closed"])`).forEach(e=>{const t=e.dataset.advertisement.split(" ");t.includes("closed")||t.push("closed"),e.dataset.advertisement=t.join(" ")})}onMediaQueryBreakpointChanged(){const e=this.getPlatform();this.platform!==e&&(this.refreshAdContainersFilledState(!1),this.platform=e,this.refreshAdContainersFilledState(!0))}refreshAdContainerStyle(e,t,i){const s=document.querySelector(`[data-advertisement~="${e}:${this.platform}"][class*="float"]:not([data-placement])`);if(!s)return;if(!t)return void s.setAttribute("style","");let n;if(Array.isArray(i)&&i[0])n=i[0],300===n&&i[1]&&200===i[1]&&(n=640);else if(s.querySelector('[id$="_placeholder_iq"]')){n=s.querySelector('[id$="_placeholder_iq"]').getBoundingClientRect().width}n&&n>300?(s.setAttribute("style",""),s.style.setProperty("float","none","important"),s.style.setProperty("clear","both","important"),s.style.setProperty("padding-left","0","important"),s.style.setProperty("padding-right","0","important"),s.style.setProperty("margin-left","0","important"),s.style.setProperty("margin-right","0","important")):s.setAttribute("style","")}refreshAdContainersFilledState(e){window.AdPositions&&Array.isArray(window.AdPositions)&&window.AdPositions.forEach(t=>{t.sitetype&&t.sitetype!==this.platform||this.refreshAdContainerFilledState(t.id,e)})}refreshAdContainerFilledState(e,t){if(!t)return;let i="";i=t?`[data-advertisement~="${e}:${this.platform}"]:not([data-advertisement~="disabled"]):not([data-advertisement~="filled"])`:`[data-advertisement~="${e}:${this.platform}"][data-advertisement~="filled"]:not([data-advertisement~="disabled"])`;
1document.querySelectorAll(i).forEach(e=>{if(!e.dataset.device||e.dataset.device===this.platform){let i=e.dataset.advertisement.split(" ");t?i.push("filled"):i=i.filter(e=>"filled"!==e),e.dataset.advertisement=i.join(" ")}})}reloadAds(e){if(!this.isInitialized)return;let t=Array.from(document.querySelectorAll(`[data-advertisement][data-placement][data-device="${this.platform}"]:not([data-advertisement~="disabled"])`));Array.isArray(e)&&(t=t.filter(t=>{const i=t.dataset.placement;return!!i&&e.includes(i)})),t.forEach(e=>{this.clearAdPositionContainer(e)}),this.sendPostMessage("iq_refresh_ads")}reloadAd(e){if(!e||!this.isInitialized)return;const t=document.querySelector(`[data-advertisement][data-placement="${e}"][data-device="${this.platform}"]:not([data-advertisement~="disabled"])`);this.clearAdPositionContainer(t);const i={info:"iq_refresh_ads",position:e};this.sendPostMessage(JSON.stringify(i))}createDynamicAds(){this.sendPostMessage("iq_create_dynamic_positions")}removeDynamicAds(){this.sendPostMessage("iq_remove_dynamic_positions")}clearAdPositionContainer(e){e instanceof HTMLElement&&(e.children.forEach(e=>{e.id&&-1!==e.id.indexOf("iqadtile")||e.remove()}),e.offsetHeight>0&&(e.style.minHeight=`${e.offsetHeight}px`))}sendPostMessage(e){e&&"string"==typeof e&&(this.isInitialized?window.top.postMessage(e,window.origin):this.pendingPostMessages.includes(e)||this.pendingPostMessages.push(e))}sanitizeCmsObjectValue(e){return"string"!=typeof e||0===e.length?"":e=(e=(e=(e=(e=e.replace(/[ÄäÖöÜüß]/g,e=>{switch(e.charCodeAt(0)){case 196:return"Ae";case 228:return"ae";case 214:return"Oe";case 246:return"oe";case 220:return"Ue";case 252:return"ue";case 223:return"ss";default:return e}})).replace(/[^a-zA-Z0-9]/g,"_")).replace(/[_]/g,(t,i)=>0===i||i===e.length-1||95===e.charCodeAt(i-1)?"":t)).replace(/[_]/g,(t,i)=>0===i||i===e.length-1?"":t)).toLowerCase()}}const N=Symbol("INSTANCE"),U=Symbol("SINGELTONENFORCER");class B{constructor(e){if(e!==U)throw new Error("Instantiation failed: Use AdBridge.instance instead of new.");this.adBridge=null,this.init()}static get instance(){return this[N]||(this[N]=new B(U)),this[N]}init(){this.adBridge=x.instance}reloadAd(e){this.adBridge&&"function"==typeof this.adBridge.reloadAd&&this.adBridge.reloadAd(e)}reloadAds(e){this.adBridge&&"function"==typeof this.adBridge.reloadAds&&this.adBridge.reloadAds(e)}createDynamicAds(){this.adBridge&&"function"==typeof this.adBridge.createDynamicAds&&this.adBridge.createDynamicAds()}removeDynamicAds(){this.adBridge&&"function"==typeof this.adBridge.removeDynamicAds&&this.adBridge.removeDynamicAds()}get platform(){return this.adBridge&&"string"==typeof this.adBridge.platform?this.adBridge.platform:""}}const R=Symbol("INSTANCE"),M=Symbol("SINGELTONENFORCER");class D{constructor(e){if(e!==M)throw new Error("Instantiation failed: Use Depot.instance instead of new.");this.init()}static get instance(){return this[R]||(this[R]=new D(M)),this[R]}init(){const e=s.A.instance;e.thirdparty&&e.thirdparty.depot&&e.thirdparty.depot.apiUrl?this.apiUrl=e.thirdparty.depot.apiUrl:console.error("Depot requires apiUrl for correct instantiation.")}getBookmarks(){const e=`${this.apiUrl}/bookmarks`;return new Promise((t,i)=>{this.fetchUrl(e,"GET").then(e=>{Array.isArray(e)?t(e):t([])}).catch(e=>i(e))})}deleteBookmarks(){const e=`${this.apiUrl}/bookmarks`;return new Promise((t,i)=>{this.fetchUrl(e,"DELETE").then(()=>{t()}).catch(e=>i(e))})}addBookmark(e,t){if(!e||"string"!=typeof e)return Promise.reject(new Error("Depot addBookmark - missing valid documentId function param"));let i;return i=t&&"article"!==t?`${this.apiUrl}/bookmarks/${t}@${e}`:`${this.apiUrl}/bookmarks/${e}`,new Promise((e,t)=>{this.fetchUrl(i,"PUT").then(()=>{e()}).catch(e=>t(e))})}deleteBookmark(e,t){if(!e||"string"!=typeof e)return Promise.reject(new Error("Depot deleteBookmark - missing valid documentId function param"));let i;i=t&&"article"!==t?`${this.apiUrl}/bookmarks/${t}@${e}`:`${this.apiUrl}/bookmarks/${e}`;return new Promise((e,t)=>{this.fetchUrl(i,"DELETE").then(()=>{e()}).catch(e=>t(e))})}fetchUrl(e,t="GET"){return fetch(e,{method:t,cache:"no-cache",headers:{"Content-Type":"text/plain"}}).then(e=>200!==e.status?e.text().then(e=>{throw new Error(e)}).catch(t=>Promise.reject(new Error(`Depot fetchUrl - failed to get data from API, URL: ${e.url}, error: ${t.message}`))):"GET"===t?e.json():Promise.resolve())}}var $=i(148),V=i(573);const F=Symbol("INSTANCE"),j=Symbol("SINGELTONENFORCER");class z{constructor(e){if(e!==j)throw new Error("Instantiation failed: Use Bookmarks.instance instead of new.");this.depot=D.instance,this.localStorage=new V.A("bookmarks","local"),this._documentIds=[],this._documentIdsByCollection={},this._updatedAt=null,this._syncedAt=null,this._isInitialized=!1,this.init()}static get instance(){return this[F]||(this[F]=new z(j)),this[F]}init(){const e=p.A.instance;if(!e.isLoggedIn||s.A.instance.disableBookmarks)return;const t=$.A.instance;e.isLoggedIn&&e.isNewLoggedIn&&this.reset();let i=e.isNewLoggedIn||"homepage"===t.route||"fuermich"===t.route||"bookmarks"===t.route;if(!e.isNewLoggedIn){this.loadDocumentIdsFromLocalStorage()&&!i&&(this.isInitialized=!0)}i=i||!this.isInitialized||!this.syncedAt,i&&this.loadDocumentIdsFromServer().then(()=>{this.isInitialized=!0}).catch(()=>{this.documentIds.length>0?this.isInitialized=!0:c.A.publish(o.Bb,{type:r.f0})}),window.addEventListener("pageshow",()=>{this.reloadLocaLStorage(),Promise.resolve().then(()=>c.A.publish(o.OL))})}loadDocumentIdsFromLocalStorage(){return!!Array.isArray(this.localStorage.getItem("documentIds"))&&(this.documentIds=this.localStorage.getItem("documentIds"),this._updatedAt=this.localStorage.getItem("updatedAt")||null,this._syncedAt=this.localStorage.getItem("syncedAt")||null,!0)}reloadLocaLStorage(){this.localStorage.reload(),this.loadDocumentIdsFromLocalStorage()}loadDocumentIdsFromServer(){return new Promise((e,t)=>
1{this.depot.getBookmarks().then(i=>{Array.isArray(i)?(this.documentIds=i.map(e=>e.includes("@")?e.split("@")[1]:e),i.forEach(e=>{let t="article",i=e;if(e.includes("@")){const s=e.split("@");t=s[0],i=s[1]}this._documentIdsByCollection[t]||(this._documentIdsByCollection[t]=[]),this._documentIdsByCollection[t].push(i)}),this._syncedAt=Date.now(),this.save(),e()):t(new Error("Bookmarks loadDocumentIdsFromServer - received invalid documentIds data from Depot"))}).catch(e=>{console.error(e.message),t(e)})})}reset(){this.documentIds=[],this._updatedAt=null,this._syncedAt=null,this.save()}save(){let e=this.localStorage.setItem("documentIds",this._documentIds);return this._updatedAt=Date.now(),e=e&&this.localStorage.setItem("updatedAt",this._updatedAt),e=e&&this.localStorage.setItem("syncedAt",this._syncedAt),e}add(e,t){if(!e||"string"!=typeof e||!t||"string"!=typeof t||!Array.isArray(this._documentIds))return Promise.reject(new Error("Bookmarks add - missing valid documentId and/or collection function param or bookmarks are not yet initialized"));return this._documentIds.indexOf(e)>-1?Promise.resolve():new Promise((i,s)=>{this.depot.addBookmark(e,t).then(()=>{this._documentIds.push(e),this._documentIdsByCollection[t]||(this._documentIdsByCollection[t]=[]),-1===this._documentIdsByCollection[t].indexOf(e)&&this._documentIdsByCollection[t].push(e);if(!this.save())throw new Error("Bookmarks add - error while updating data");return i()}).catch(e=>s(e))})}delete(e,t){if(!e||"string"!=typeof e||!t||"string"!=typeof t||!Array.isArray(this._documentIds))return Promise.reject(new Error("Bookmarks delete - missing valid documentId and/or collection function param or bookmarks are not yet initialized"));const i=this._documentIds.indexOf(e);return-1===i?Promise.resolve():new Promise((s,n)=>{this.depot.deleteBookmark(e,t).then(()=>{if(this._documentIds.splice(i,1),this._documentIdsByCollection&&this._documentIdsByCollection[t]){const i=this._documentIdsByCollection[t].indexOf(e);-1!==i&&this._documentIdsByCollection[t].splice(i,1)}if(!this.save())throw new Error("Bookmarks delete - error while updating data");return s()}).catch(e=>n(e))})}deleteAll(){return 0===this._documentIds.length?Promise.resolve():new Promise((e,t)=>{this.depot.deleteBookmarks().then(()=>{this._documentIds=[],this._documentIdsByCollection={};if(!this.save())throw new Error("Bookmarks deleteAll - error while updating data");return e()}).catch(e=>t(e))})}contains(e,t){return!!(e&&"string"==typeof e&&t&&"string"==typeof t&&Array.isArray(this._documentIds))&&-1!==this._documentIds.indexOf(e)}get documentIds(){return Array.isArray(this._documentIds)?this._documentIds:[]}set documentIds(e){if(!Array.isArray(e))return;let t=!this.isInitialized||!Array.isArray(this._documentIds)||this._documentIds.length!==e.length;t||e.forEach((e,i)=>{this._documentIds.indexOf(e)!==i&&(t=!0)}),t&&(this._documentIds=e,Promise.resolve().then(()=>c.A.publish(o.OL)))}get documentIdsByCollection(){return this._documentIdsByCollection}get isInitialized(){return this._isInitialized}set isInitialized(e){this._isInitialized!==!!e&&(this._isInitialized=!!e,this._isInitialized&&c.A.publish(o.n8))}get updatedAt(){return this._updatedAt}get syncedAt(){return this._syncedAt}}class q extends A.A{constructor(e,t,i){super(),this._documentId=e,this._collection=t,this._isBookmarked=!!i}get id(){return b.k3}get documentId(){return this._documentId}get isBookmarked(){return this._isBookmarked}}var W=i(663);class G{constructor(){this.documentId=null,this.collection=null,this.bookmarks=z.instance,this.boundNotificationCallback=()=>this.notificationCallback()}execute(e,t){if(!p.A.instance.isLoggedIn)return c.A.publish(o.XA,{type:"bookmarks"}),void this.destroy();this.documentId=e,this.collection=t,this.addBookmark()}addBookmark(){const e=s.A.instance;this.bookmarks.add(this.documentId,this.collection).then(()=>{c.A.publish(o.Gr,this.documentId,this.collection);const t=e?.translations?.notification?.addBookmarkSuccess,i="recipe"===this.collection?"Rezept":"Artikel",s=t?.description?.replace("###COLLECTION###",i);W.A.instance.addNotification({type:r.Fn,headline:t?.headline||"",description:s||""}
1),l.A.isApp&&e?.app?.pageContext?.documentId===this.documentId&&e?.app?.pageContext?.collection===this.collection&&c.A.publish(o.pN,new q(this.documentId,this.collection,!0)),this.destroy()}).catch(()=>{c.A.publish(o.Bb,{type:r.Yj,documentId:this.documentId,collection:this.collection});const t=e?.translations?.notification?.addBookmarkFailure;W.A.instance.addNotification({type:r.KP,headline:t?.headline||"",description:t?.description||"",callback:this.boundNotificationCallback})})}notificationCallback(){setTimeout(()=>{this.addBookmark()},1e3)}destroy(){this.documentId=null,this.collection=null,this.bookmarks=null,this.boundNotificationCallback=null}}var H=i(902);class J{execute(e){Array.isArray(e)?!l.A.isApp||l.A.appVersion<H.A.instance.minAudioPlaylistVersion||"function"!=typeof H.A.instance.triggerAddToAudioPlaylist||0===e.length||(p.A.instance.isLoggedIn?H.A.instance.triggerAddToAudioPlaylist(e):c.A.publish(o.XA,{type:"playlist"})):console.warn("AddToPlaylistController - missing or malformed parameter `clips`",e)}}class Z extends A.A{constructor(e){super(),this._target=e}get id(){return b.TK}get target(){return this._target}}const Q={appinfo:{isLoginRequired:!1},darkmode:{isLoginRequired:!1},fontsize:{isLoginRequired:!1},appratingdialog:{isLoginRequired:!1},offlinelibrary:{isLoginRequired:!0,loginLayerType:"offlinelibrary"},playlist:{isLoginRequired:!0,loginLayerType:"playlist"},push:{isLoginRequired:!1},homepage:{isLoginRequired:!1}};class K{execute({targetId:e=""}){if(!l.A.isApp||!e)return;const t=Q[e];t&&(!t.isLoginRequired||p.A.instance.isLoggedIn?c.A.publish(o.pN,new Z(e)):t.loginLayerType&&c.A.publish(o.XA,{type:t.loginLayerType}))}}class Y extends A.A{get id(){return b.Lw}}class X{execute(){if(!l.A.isApp)return;this.initBookmark();const e=a.A.store("AppProducts");"function"==typeof e?.updateStatus&&e.updateStatus(),c.A.publish(o.pN,new Y),this.disableLinks(),this.blockAboshopLinks(),this.modifySpiegelShopLinks(),this.initConsent()}initBookmark(){const e=s.A.instance;if(("article"===$.A.instance.route||"recipe"===$.A.instance.route)&&e.app&&e.app.pageContext&&e.app.pageContext.documentId&&e.app.pageContext.collection){const t=z.instance;c.A.publish(o.pN,new q(e.app.pageContext.documentId,e.app.pageContext.collection,t.contains(e.app.pageContext.documentId,e.app.pageContext.collection)))}}disableLinks(){if(!(l.A.appCode&&s.A.instance.app&&s.A.instance.app.disabledLinks&&Array.isArray(s.A.instance.app.disabledLinks[l.A.appCode])))return;const e=s.A.instance.app.disabledLinks[l.A.appCode];let t=[];e.forEach(e=>{const i=Array.from(document.querySelectorAll(`a[href*="${e}"]`));t=t.concat(i)}),t.forEach(e=>{e.insertAdjacentHTML("afterend",e.textContent),e.remove()})}blockAboshopLinks(){!l.A.isIOSApp&&s.A.instance?.urls?.aboshopBaseUrl&&document.addEventListener("click",e=>{const t=e.target.closest("a");"function"==typeof t?.href?.startsWith&&t.href.startsWith(s.A.instance.urls.aboshopBaseUrl)&&!t.hasAttribute("@click.prevent")&&(e.preventDefault(),W.A.instance.addNotification({type:r.KP,headline:"Es tut uns leid",description:"Dieser Link kann in der App nicht geöffnet werden."}))})}modifySpiegelShopLinks(){Array.from(document.querySelectorAll('a[href^="https://shop.spiegel.de"]')).forEach(e=>{const t=new URL(e.href);t.hash="#ref=app",e.setAttribute("href",t.href)})}initConsent(){p.A.instance.hasNoAdsAccess?c.A.publish(o.pN,new w({firebaseAnalytics:!1,firebaseInAppMessaging:!1})):_().then(()=>{const e=S([r.cg.store_and_access_information_on_a_device]);c.A.publish(o.pN,new w({firebaseAnalytics:e,firebaseInAppMessaging:e}))})}}var ee=i(893);const te=["emptied","loadstart","pause","play","playing","progress","ratechange","timeupdate","volumechange","waiting"],ie="MODE_DEFAULT",se="MODE_AUTOPLAY",ne="MODE_RESUME",ae=new V.A("audio","local");let oe=null,re=!1;const le={mode:ie,_clip:null,_currentTime:0,_currentTimeUpdateTimeout:null,_playbackRate:1,_seekTime:0,_volume:1,buffered:[],duration:0,isClipFromLocalStorage:!1,isEnded:!1,isLoading:!1,isPaused:!0,isPlaying:!1,isRestored:!1,isSeeking:!1,init(){this.boundOnStateChanged=(0,ee.X)(this.onStateChanged,100,this),this.boundOnCanPlay=e=>this.onCanPlay(e),this.boundOnLoadedMetadata=e=>this.onLoadedMetadata(e),this.boundOnWindowStorage=e=>this.onWindowStorage(e),this.boundOnPointerInteractionEnd=e=>this.onPointerInteractionEnd(e),this.restoreFromLocalStorage()}
1,onStateChanged(){this.updateStore(),this.updateLocalStorage()},onLoadedMetadata(){oe.removeEventListener("loadedmetadata",this.boundOnLoadedMetadata),this.onCanPlay()},onCanPlay(){oe.removeEventListener("canplay",this.boundOnCanPlay),window.removeEventListener("storage",this.boundOnWindowStorage),g.A.isMobileSafari||l.A.isIOSApp||this.restoreAudio(),oe.play().then(()=>{(g.A.isMobileSafari||l.A.isIOSApp)&&this.restoreAudio(),re=!1}).catch(()=>{this.mode===se&&(this.mode=ne,this.isRestored=!0,re=!0,this.detachAudio(),this.onStateChanged())})},onWindowStorage(e){e.key===ae.name&&(window.removeEventListener("storage",this.boundOnWindowStorage),this.mode=ne,this.isRestored=!0,this.detachAudio(),this.updateStore())},onPointerInteractionEnd(){if(this.isSeeking){if(!oe)return this._currentTime=this._seekTime,void this.endSeekingState();oe.addEventListener("timeupdate",()=>this.endSeekingState(),{once:!0}),oe.currentTime=this._seekTime}},updateStore(){let e=oe&&oe.duration?oe.duration:0;!e&&this.clip&&Number.isInteger(this.clip.duration)&&(e=this.clip.duration/1e3);const t=[];if(oe&&oe.buffered&&oe.buffered.length>0)for(let e=0;e<oe.buffered.length;e++)t.push({start:oe.buffered.start(e),end:oe.buffered.end(e)});!re&&oe&&oe instanceof HTMLAudioElement&&(this._currentTime=oe.currentTime,this._playbackRate=oe.playbackRate,this._volume=oe.volume),this.buffered=t,this.duration=e,this.isLoading=oe&&oe.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&!oe.ended,this.isPlaying=oe&&!oe.paused&&!oe.ended&&!this.isLoading,this.isEnded=oe&&oe.ended,this.isPaused=!oe||oe.paused},updateLocalStorage(){ae.setItem("clip",this.clip),ae.setItem("currentTime",this.currentTime),ae.setItem("volume",this.volume),ae.setItem("playbackRate",this.playbackRate),ae.setItem("isPlaying",oe&&!oe.paused&&!oe.ended),ae.setItem("updatedAt",(new Date).getTime())},play(){if(!this.clip)return;let e;switch(this.mode){case se:e=this.clip.autoplayUrl?this.clip.autoplayUrl:this.clip.audioUrl;break;case ne:e=this.clip.resumeUrl?this.clip.resumeUrl:this.clip.audioUrl;break;default:e=this.clip.audioUrl}e&&(oe||this.attachAudio(),this.isRestored=!1,oe.src!==e?((g.A.isMobileSafari||l.A.isIOSApp)&&oe.addEventListener("loadedmetadata",this.boundOnLoadedMetadata),oe.addEventListener("canplay",this.boundOnCanPlay),re=!0,oe.src=e):(oe.play(),re=!1))},pause(){oe&&this.isPlaying&&"function"==typeof oe.pause&&oe.pause()},clear(){this._clip=null,this._currentTime=0,this._seekTime=0,this.isSeeking=!1,oe&&this.detachAudio(),this.onStateChanged()},attachAudio(){oe||(oe=document.createElement("audio"),(g.A.isMobileSafari||l.A.isIOSApp)&&oe.addEventListener("loadedmetadata",this.boundOnLoadedMetadata),oe.addEventListener("canplay",this.boundOnCanPlay),te.forEach(e=>{oe.addEventListener(e,this.boundOnStateChanged)}),document.body.appendChild(oe),window.addEventListener("mouseup",this.boundOnPointerInteractionEnd),window.addEventListener("touchend",this.boundOnPointerInteractionEnd))},detachAudio(){window.removeEventListener("mouseup",this.boundOnPointerInteractionEnd),window.removeEventListener("touchend",this.boundOnPointerInteractionEnd),te.forEach(e=>{oe.removeEventListener(e,this.boundOnStateChanged)}),oe.removeEventListener("loadedmetadata",this.boundOnLoadedMetadata),oe.removeEventListener("canplay",this.boundOnCanPlay),oe.remove(),oe=null},restoreFromLocalStorage(){const e=ae.getItem("playbackRate");if("number"!=typeof e||Number.isNaN(e)||(this._playbackRate=e),!ae.getItem("clip"))return void this.clearLocalStorage();if((new Date).getTime()-(ae.getItem("updatedAt")||0)>108e5)this.clearLocalStorage();else{this._clip=ae.getItem("clip"),this.isClipFromLocalStorage=!0;const e=ae.getItem("currentTime"),t=ae.getItem("volume");this.mode=ae.getItem("isPlaying")?se:ie,"number"!=typeof e||Number.isNaN(e)||(this._currentTime=e),"number"!=typeof t||Number.isNaN(t)||(this._volume=t),this.updateStore(),this.mode===se&&(window.addEventListener("storage",this.boundOnWindowStorage),this.play())}},restoreAudio(){oe.currentTime=this._currentTime,oe.volume=this._volume,oe.playbackRate=this._playbackRate},reloadLocaLStorage(){ae.reload(),this.restoreFromLocalStorage()},clearLocalStorage(){ae.removeItem("clip"),ae.removeItem("isPlaying"),ae.removeItem("currentTime"),ae.removeItem("volume"),ae.removeItem("updatedAt")},endSeekingState(){this._seekTime=0,this.isSeeking=!1,this._currentTimeUpdateTimeout&&clearTimeout(this._currentTimeUpdateTimeout)},get clip(){return this._clip},set clip(e){e&&e.id&&e.audioUrl&&(this.mode=ie,this.isClipFromLocalStorage=!1,re=!0,oe&&oe.src&&(oe.src=""),this._currentTime=0,this._clip={audioUrl:e.audioUrl,autoplayUrl:e.autoplayUrl,resumeUrl:e.resumeUrl,downloadUrl:e.downloadUrl||e.audioUrl,duration:e.duration||0,headline:e.headline||"",id:e.id,kicker:e.kicker||"",posterUrl:e.posterUrl||"",chapters:e.chapters||null},this.onStateChanged())},get currentTime(){return this.isSeeking?this._seekTime:this._currentTime},set currentTime(e){const t=Math.max(parseFloat(e),0);Number.isNaN(t)||t>this.duration||(this._currentTimeUpdateTimeout&&(clearTimeout(this._currentTimeUpdateTimeout),this._currentTimeUpdateTimeout=null,this.isSeeking=!0),this.isSeeking?this._seekTime=t:this._currentTimeUpdateTimeout=setTimeout(()=>{this._currentTimeUpdateTimeout=null,oe?oe.currentTime=t:this._currentTime=t},250))},get playbackRate(){return this._playbackRate},set playbackRate(e){const t=parseFloat(e);Number.isNaN(t)||t<.25||t>4||(oe?oe.playbackRate=t:(this._playbackRate=t,ae.setItem("playbackRate",t)))},get volume(){return this._volume},set volume(e){const t=parseFloat(e);Number.isNaN(t)||t<0||t>1||(oe?oe.volume=t:this._volume=t)},get chapterPositions(){return this.clip&&Array.isArray(this.clip.chapters)?this.clip.chapters.map(e=>e.position):[]},get chapter(){if(!this.clip||!Array.isArray(this.clip.chapters))return null;let e=null;
1return this.clip.chapters.forEach(t=>{const i=e?e.position:-1;t.position>i&&t.position<=this.currentTime&&(e=t)}),e},get isDebuggingActive(){try{return"1"===localStorage.getItem("polygon_audio_debugging")}catch(e){return!1}}},ce={get instance(){return a.A.store("WebAudio")}};class de{execute(){l.A.isApp&&H.A.instance.isSupported(r.ih.native_audio_player)||ce.instance.clear()}}class he{execute(){l.A.isApp&&H.A.instance.isSupported(r.ih.native_audio_player)||ce.instance.pause()}}class ue{execute(e){e&&e.id&&e.audioUrl&&!s.A.instance.preview&&(l.A.isApp&&H.A.instance.isSupported(r.ih.native_audio_player)?H.A.instance.triggerNativeAudioPlayer(e):(ce.instance.clip=e,ce.instance.play()))}}class pe{execute(){l.A.isApp&&H.A.instance.isSupported(r.ih.native_audio_player)||ce.instance.play()}}class ge{execute(e){l.A.isApp&&H.A.instance.isSupported(r.ih.native_audio_player)||(ce.instance.playbackRate=e)}}class me{execute(e){l.A.isApp&&H.A.instance.isSupported(r.ih.native_audio_player)||(ce.instance.currentTime=e)}}class ye{execute(e){l.A.isApp&&H.A.instance.isSupported(r.ih.native_audio_player)||(ce.instance.volume=e)}}var fe=i(766);const be=Symbol("INSTANCE"),Ae=Symbol("SINGELTONENFORCER");class we{constructor(e){if(e!==Ae)throw new Error("Instantiation failed: Use BreakingNewsData.instance instead of new.");s.A.instance.disableBreakingnews||(this.init(),this.fetchBreakingNews())}static get instance(){return this[be]||(this[be]=new we(Ae)),this[be]}init(){if(fe.A.getItem(r.AZ.breakingNews.name)){let e;try{e=JSON.parse(fe.A.getItem(r.AZ.breakingNews.name))}catch(e){}
1if(e){const t=s.A.instance,i=t.cacheControl&&t.cacheControl.breakingnews&&Number.isInteger(t.cacheControl.breakingnews.sessionStorageMaxAge)?t.cacheControl.breakingnews.sessionStorageMaxAge:900,n=Date.now()-1e3*i;if(e.updated_at&&e.updated_at>=n&&e.items&&Array.isArray(e.items))return void(this._items=e.items)}}this._items=[]}fetchBreakingNews(){const e=s.A.instance;if(!e.urls||"string"!=typeof e.urls.assetsBasePath)return;const t=`${e.urls.assetsBasePath}/assets/news/breakingnews.json`;fetch(t,{method:"GET"}).then(e=>e.json()).then(e=>this.parseFetchedBreakingNews(e)).catch(()=>console.error("Error while fetching breaking news."))}parseFetchedBreakingNews(e){e&&Array.isArray(e)&&(this.items=e)}updateSessionStorage(e){const t={items:e&&Array.isArray(e)?e:[],updated_at:Date.now()};fe.A.setItem(r.AZ.breakingNews.name,JSON.stringify(t))}get items(){return this._items}set items(e){if(!e||!Array.isArray(e))return;let t=e.length!==this._items.length;t||e.forEach(e=>{-1===this._items.findIndex(t=>t.id===e.id)&&(t=!0)}),this._items=e,this.updateSessionStorage(e),t&&window.polygon&&window.polygon.componentLoader&&window.polygon.componentLoader.publish(o.TD,e)}}var Ie=i(117);class ve{constructor(){this.link=null,this.boundNotificationCallback=()=>this.notificationCallback()}execute(e){e?(this.link=e,this.copyLinkToClipboard()):this.destroy()}copyLinkToClipboard(){const e=s.A.instance,t=Ie.A.copyToClipboard(this.link),i=e?.translations?.notification;t?W.A.instance.addNotification({type:r.Fn,headline:i?.copyGiftArticleLinkSuccess?.headline||"",description:i?.copyGiftArticleLinkSuccess?.description||""}):W.A.instance.addNotification({type:r.KP,headline:i?.copyGiftArticleLinkFailure?.headline||"",description:i?.copyGiftArticleLinkFailure?.description||"",callback:this.boundNotificationCallback})}notificationCallback(){setTimeout(()=>{this.copyLinkToClipboard()},1e3)}destroy(){this.link=null,this.boundNotificationCallback=null}}const Ee=Symbol("INSTANCE"),Pe=Symbol("SINGELTONENFORCER");class Se{constructor(e){if(e!==Pe)throw new Error("Instantiation failed: Use GiftService.instance instead of new.");this.init()}static get instance(){return this[Ee]||(this[Ee]=new Se(Pe)),this[Ee]}init(){const e=s.A.instance;e.thirdparty&&e.thirdparty.gift&&e.thirdparty.gift.apiUrl?this.apiUrl=e.thirdparty.gift.apiUrl:console.error("GiftService requires apiUrl for correct instantiation.")}getGiftCredits(){const e=`${this.apiUrl}/credits`;return new Promise((t,i)=>{this.fetchUrl(e,"GET").then(e=>{e&&Number.isInteger(e.giftCredit)?t(e.giftCredit):t(0)}).catch(e=>i(e))})}createGiftArticle(e){if(!e||"string"!=typeof e)return Promise.reject(new Error("GiftService createGiftArticle - missing valid documentId function param"));const t=new URL(`${this.apiUrl}/create`);t.searchParams.set("article",e);return new Promise((e,i)=>{this.fetchUrl(t.href,"GET").then(t=>{e(t)}).catch(e=>i(e))})}fetchUrl(e,t="GET"){return fetch(e,{method:t,headers:{"Content-Type":"text/plain"}}).then(e=>200!==e.status&&201!==e.status?e.text().then(e=>{throw new Error(e)}).catch(t=>Promise.reject(new Error(`GiftService fetchUrl - failed to get data from API, URL: ${e.url}, error: ${t.message}`))):"GET"===t?e.json():Promise.resolve())}}const ke={isInitialized:!1,credits:null,tokenLookup:{},initialize(){Se.instance.getGiftCredits().then(e=>{Number.isInteger(e)&&(this.credits=e,this.isInitialized=!0)}).catch(()=>{})},addToken(e,t){e&&"string"==typeof e&&t&&(this.tokenLookup[e]=t)},getToken(e){return this.tokenLookup[e]}},Ce={get instance(){return a.A.store("Gift")}};class _e{constructor(){this.documentId=null,this.giftService=Se.instance,this.boundNotificationCallback=()=>this.notificationCallback()}execute(e){const t=p.A.instance;t.isLoggedIn&&t.hasPaidAccess?(this.documentId=e,this.createGiftArticle()):this.destroy()}createGiftArticle(){this.giftService.createGiftArticle(this.documentId).then(e=>{if(e.articleId!==this.documentId||!e.token)throw new Error("Invalid response");const t=Ce.instance;t.addToken(this.documentId,e.token),c.A.publish(o.aw,this.documentId,e.token),Number.isInteger(e.giftCredit)&&(t.credits=e.giftCredit),this.destroy()}).catch(()=>{W.A.instance.addNotification({type:r.KP,headline:"Fehler",description:'Beim Erstellen des Links ist ein Fehler aufgetreten. <a href="#" data-notification-el="trigger">Erneut versuchen</a>',callback:this.boundNotificationCallback})})}notificationCallback(){setTimeout(()=>{this.createGiftArticle()},1e3)}destroy(){this.documentId=null,this.giftService=null,this.boundNotificationCallback=null}}class Le{execute(){I.A.clear(),fe.A.clear(),setTimeout(()=>{const e=d.A.getAllItems();
1e&&Object.keys(e).forEach(e=>{d.A.removeItem(e),s.A.instance.cookieDomains&&Array.isArray(s.A.instance.cookieDomains)&&s.A.instance.cookieDomains.forEach(t=>{d.A.removeItem(e,{path:"/",domain:t,secure:!1}),d.A.removeItem(e,{path:"/",domain:t,secure:!0}),d.A.removeItem(e,{path:"/",domain:t,secure:!0,sameSite:"none"})})}),c.A.publish(o.OF);const t=s.A.instance?.translations?.notification?.deleteCookiesSuccess?.headline;t&&W.A.instance.addNotification({type:r.Fn,headline:t})},1e3)}}class Te{constructor(){this.documentId=null,this.collection=null,this.bookmarks=z.instance,this.boundNotificationCallback=()=>this.notificationCallback()}execute(e,t){if(!p.A.instance.isLoggedIn)return c.A.publish(o.XA,{type:"bookmarks"}),void this.destroy();this.documentId=e,this.collection=t,this.deleteBookmark()}deleteBookmark(){const e=s.A.instance;this.bookmarks.delete(this.documentId,this.collection).then(()=>{c.A.publish(o.XH,this.documentId,this.collection);const t=e?.translations?.notification?.deleteBookmarkSuccess,i="recipe"===this.collection?"Rezept":"Artikel",s=t?.description?.replace("###COLLECTION###",i);W.A.instance.addNotification({type:r.Fn,headline:t?.headline||"",description:s||""}
1),l.A.isApp&&e?.app?.pageContext?.documentId===this.documentId&&e?.app?.pageContext?.collection===this.collection&&c.A.publish(o.pN,new q(this.documentId,this.collection,!1)),this.destroy()}).catch(()=>{c.A.publish(o.Bb,{type:r.qd,documentId:this.documentId,collection:this.collection});const t=e?.translations?.notification?.deleteBookmarkFailure,i="recipe"===this.collection?"Rezepts":"Artikels",s=t?.description?.replace("###COLLECTION###",i);W.A.instance.addNotification({type:r.KP,headline:t?.headline||"",description:s||"",callback:this.boundNotificationCallback})})}notificationCallback(){setTimeout(()=>{this.deleteBookmark()},1e3)}destroy(){this.documentId=null,this.collection=null,this.bookmarks=null,this.boundNotificationCallback=null}}var Oe=i(21);class xe{constructor(e,t,i,s="Ok",n="Abbrechen"){this.callback="function"==typeof e?e:null,this.headline=t,this.description=i,this.confirmButtonLabel=s,this.cancelButtonLabel=n,this.boundOnConfirmButtonClick=()=>this.onConfirmTriggered(),this.boundOnCancelTriggered=()=>this.onCancelTriggered(),this.boundOnKeyDown=e=>this.onKeyDown(e),this.init()}init(){if(this.container=document.querySelector('[data-confirmationlayer-el="container"]'),this.container||(this.container=document.body),this.el=Oe.A.createElementByPrototypeId(this.prototypeId),!this.el)return;const e=this.el.querySelector('[data-confirmationlayer-el="headline"]');e&&(this.headline?e.innerHTML=this.headline:c.A.toggleElementVisibility(e,!1));const t=this.el.querySelector('[data-confirmationlayer-el="description"]');if(t&&(this.description?t.innerHTML=this.description:c.A.toggleElementVisibility(t,!1)),this.confirmButton=this.el.querySelector('[data-confirmationlayer-el="confirmButton"]'),this.confirmButton)if(this.confirmButtonLabel){const e=this.confirmButton.querySelector("[data-label]");e&&(e.innerHTML=this.confirmButtonLabel),this.confirmButton.addEventListener("click",this.boundOnConfirmButtonClick)}else c.A.toggleElementVisibility(this.confirmButton,!1);if(this.cancelButton=this.el.querySelector('[data-confirmationlayer-el="cancelButton"]'),this.cancelButton)if(this.cancelButtonLabel){const e=this.cancelButton.querySelector("[data-label]");e&&(e.innerHTML=this.cancelButtonLabel),this.cancelButton.addEventListener("click",this.boundOnCancelTriggered)}else c.A.toggleElementVisibility(this.cancelButton,!1);this.closeIcon=this.el.querySelector('[data-confirmationlayer-el="closeIcon"]'),this.closeIcon&&this.closeIcon.addEventListener("click",this.boundOnCancelTriggered),this.background=this.el.querySelector('[data-confirmationlayer-el="background"]'),this.background&&this.background.addEventListener("click",this.boundOnCancelTriggered)}open(){this.container.appendChild(this.el),this.el.style.opacity=0,c.A.toggleElementVisibility(this.el,!0),this.returnFocusElement=window.document.activeElement,this.closeIcon.focus(),setTimeout(()=>{this.el.style.opacity=1},0),window.document.addEventListener("keydown",this.boundOnKeyDown,!0)}close(){c.A.toggleElementVisibility(this.el,!1),this.returnFocusElement&&(this.returnFocusElement.focus(),this.returnFocusElement=null),c.A.publish(o.BQ),this.destroy()}onConfirmTriggered(){"function"==typeof this.callback&&this.callback(r.FQ),this.close()}onCancelTriggered(){"function"==typeof this.callback&&this.callback(r.BO),this.close()}onKeyDown(e){e.defaultPrevented||"Escape"!==e.key&&"Esc"!==e.key&&27!==e.keyCode||(e.preventDefault(),this.close())}destroy(){this.closeIcon&&this.closeIcon.removeEventListener("click",this.boundOnCancelTriggered),this.confirmButton&&this.confirmButton.removeEventListener("click",this.boundOnConfirmButtonClick),this.cancelButton&&this.cancelButton.removeEventListener("click",this.boundOnCancelTriggered),this.background&&this.closeIcon.removeEventListener("click",this.boundOnCancelTriggered),window.document.removeEventListener("keydown",this.boundOnKeyDown,!0),this.callback=null,this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null}get prototypeId(){return"prototype-confirmation-layer"}}const Ne=Symbol("INSTANCE"),Ue=Symbol("SINGELTONENFORCER");class Be{constructor(e){if(e!==Ue)throw new Error("Instantiation failed: Use ConfirmationLayerService.instance instead of new.");this.queue=[],this.currentConfirmationLayer=null,this.boundOnConfirmationLayerClosed=()=>this.onConfirmationLayerClosed(),this.init()}static get instance(){return this[Ne]||(this[Ne]=new Be(Ue)),this[Ne]}init(){c.A.subscribe(o.BQ,this.boundOnConfirmationLayerClosed)}addConfirmationLayer(e){if(!e)return;this.removeConfirmationLayerById(e.id);const t=new xe(e.callback,e.headline,e.description,e.confirmButtonLabel,e.cancelButtonLabel);this.queue.unshift({id:e.id||"",view:t}),this.currentConfirmationLayer||this.showNextConfirmationLayer()}
1removeConfirmationLayerById(e){if(!e)return;this.queue.filter(t=>t.id===e).forEach(e=>{const t=this.queue.indexOf(e);-1!==t&&(e.view.destroy(),this.queue.splice(t,1))})}showNextConfirmationLayer(){if(this.currentConfirmationLayer)return void this.currentConfirmationLayer.destroy();if(0===this.queue.length)return;const e=this.queue.pop();e.view&&(this.currentConfirmationLayer=e.view,this.currentConfirmationLayer.open())}onConfirmationLayerClosed(){this.currentConfirmationLayer&&(this.currentConfirmationLayer=null),setTimeout(()=>{this.showNextConfirmationLayer()},400)}}class Re{constructor(){this.bookmarks=z.instance,this.boundConfirmationLayerCallback=e=>this.confirmationLayerCallback(e),this.boundNotificationCallback=()=>this.notificationCallback()}execute(){const e=s.A.instance,t=e?.translations?.confirmationLayer?.deleteAllBookmarks;Be.instance.addConfirmationLayer({id:"DeleteAllBookmarks",headline:t?.headline||"",description:t?.description||"",confirmButtonLabel:t?.confirmButtonLabel||"",cancelButtonLabel:t?.cancelButtonLabel||"",callback:this.boundConfirmationLayerCallback})}deleteAllBookmarks(){const e=s.A.instance;this.bookmarks.deleteAll().then(()=>{c.A.publish(o.sK);const t=e?.translations?.notification?.deleteAllBookmarksSuccess;W.A.instance.addNotification({type:r.Fn,headline:t?.headline||"",description:t?.description||""}
1),l.A.isApp&&e?.app?.pageContext?.documentId&&e?.app?.pageContext?.collection&&c.A.publish(o.pN,new q(e.app.pageContext.documentId,e.app.pageContext.collection,!1)),this.destroy()}).catch(t=>{c.A.publish(o.Bb,{type:r.oY});const i=e?.translations?.notification?.deleteAllBookmarksFailure;W.A.instance.addNotification({type:r.KP,headline:i?.headline||"",description:i?.description||"",callback:this.boundNotificationCallback}),console.error(t.message)})}notificationCallback(){setTimeout(()=>{this.deleteAllBookmarks()},1e3)}confirmationLayerCallback(e){e!==r.FQ?this.destroy():this.deleteAllBookmarks()}destroy(){this.bookmarks=null,this.boundConfirmationLayerCallback=null,this.boundNotificationCallback=null}}const Me=Symbol("INSTANCE"),De=Symbol("SINGELTONENFORCER");class $e{constructor(e){if(e!==De)throw new Error("Instantiation failed: Use EventObserver.instance instead of new.");this.init()}static get instance(){return this[Me]||(this[Me]=new $e(De)),this[Me]}init(){this.boundOnMouseDown=e=>this.onMouseDown(e),this.boundOnPageShow=e=>this.onPageShow(e),window.document.addEventListener("mousedown",this.boundOnMouseDown),window.addEventListener("pageshow",this.boundOnPageShow),this.initPageVisibilityAPI()}initPageVisibilityAPI(){this.hiddenPropertyName=void 0,this.visibilityChangeEventName=void 0,void 0!==document.hidden?(this.hiddenPropertyName="hidden",this.visibilityChangeEventName="visibilitychange"):void 0!==document.mozHidden?(this.hiddenPropertyName="mozHidden",this.visibilityChangeEventName="mozvisibilitychange"):void 0!==document.msHidden?(this.hiddenPropertyName="msHidden",this.visibilityChangeEventName="msvisibilitychange"):void 0!==document.webkitHidden?(this.hiddenPropertyName="webkitHidden",this.visibilityChangeEventName="webkitvisibilitychange"):this.visibilityChangeEventName="visibilitychange",this.currentVisibilityState=this.visibilityState,this.boundOnVisibilityChange=()=>this.onVisibilityChange(this.visibilityState),window.document.addEventListener(this.visibilityChangeEventName,this.boundOnVisibilityChange),this.boundOnPageHide=()=>this.onVisibilityChange("hidden"),window.addEventListener("pagehide",this.boundOnPageHide)}onVisibilityChange(e){this.currentVisibilityState!==e&&(this.currentVisibilityState=e,c.A.publish(o.oe,e))}get visibilityState(){return this.hiddenPropertyName?window.document[this.hiddenPropertyName]?"hidden":"visible":void 0!==window.document.visibilityState?window.document.visibilityState:void 0}onMouseDown(e){c.A.publish(o.D1,e)}onPageShow(e){e.persisted&&c.A.publish(o.wZ)}destroy(){window.document.removeEventListener("mousedown",this.boundOnMouseDown),window.removeEventListener("pageshow",this.boundOnPageShow),window.removeEventListener("pagehide",this.boundOnPageHide),window.document.removeEventListener(this.visibilityChangeEventName,this.boundOnVisibilityChange),window.removeEventListener("scroll",this.boundOnScroll),super.destroy()}}class Ve{constructor(){this.origin=null,this.target=null,this.targetImage=null,this.animationDuration=null,this.el=null}execute(e,t){if(this.origin=document.querySelector(`[data-image-animation-origin="${e}"]`),this.target=document.querySelector(`[data-image-animation-target="${e}"]`),!this.origin||!this.target)return void this.destroy();if(this.targetImage=this.target.querySelector("img"),this.animationDuration=t,this.el=Oe.A.createElementByPrototypeId("prototype-image-animation-element"),!this.el)return void this.destroy();const i=this.origin.getBoundingClientRect(),s={imageSrc:this.origin.currentSrc,animationDuration:this.animationDuration,width:this.origin.width,height:this.origin.height,top:i.top,left:i.left};this.el=Oe.A.populateElement(this.el,s),this.target.parentNode.insertBefore(this.el,this.target.nextSibling),this.el.style.transform=this.cssTransform,this.el.style.filter=this.cssFilter,window.setTimeout(()=>this.onAnimationCompleted(),this.animationDuration)}get cssTransform(){if(!this.el||!this.target)return"";const e=this.target.getBoundingClientRect(),t=this.el.getBoundingClientRect(),i=(e.height<window.innerHeight?e.height:window.innerHeight)/this.el.height,s=(e.width-this.el.width*i)/2;return`translate(${e.left-parseFloat(t.left)+s}px, ${e.top-parseFloat(t.top)}px) scale(${i})`}get cssFilter(){const e=this.target.getBoundingClientRect().height/this.el.height-1;return e<0?"blur(0)":`blur(${e}px)`}onAnimationCompleted(){this.targetImage.classList.contains("lazyloaded")||this.targetImage.classList.contains("ls-is-cached")||this.targetImage.complete?this.onTargetImageLoaded():(this.boundOnTargetImageLoaded=()=>this.onTargetImageLoaded(),this.targetImage.addEventListener("load",this.boundOnTargetImageLoaded))}onTargetImageLoaded(){window.setTimeout(()=>this.destroy(),this.animationDuration)}destroy(){this.boundOnTargetImageLoaded&&this.targetImage.removeEventListener("load",this.boundOnTargetImageLoaded),this.origin=null,this.target=null,this.targetImage=null,this.el&&(this.el.remove(),this.el=null)}}class Fe{execute(){const e=p.A.instance;e.isLoggedIn&&e.hasPaidAccess&&Ce.instance.initialize()}}const je=[],ze=()=>{const e=e=>{if(!e||!e.target)return;const t=e.target,i=(e.pageX-t.getBoundingClientRect().left)/(t.getBoundingClientRect().right-t.getBoundingClientRect().left),s=parseFloat(t.getAttribute("min"))||0,n=parseFloat(t.getAttribute("max"))||100,a=parseFloat(t.getAttribute("step"))||1,o=Math.floor(a)===a?0:a.toString().split(".")[1].length||0;let r=(n-s)*i+s;r=r%a!==0?parseFloat(r-r%a+a).toFixed(o):r,t.value=r;const l=new Event("input",{bubbles:!0,cancelable:!0});t.dispatchEvent(l)};document.querySelectorAll("input[type=range]").forEach(t=>{t.hasAttribute("data-polyfilled")||(t.addEventListener("touchend",e,{passive:!0}),t.setAttribute("data-polyfilled",""))}),c.A.subscribe(o.zn,()=>ze())};window.IntersectionObserver&&window.IntersectionObserverEntry||je.pu
1sh(i.e(608).then(i.t.bind(i,127,23))),je.push(i.e(608).then(i.t.bind(i,196,23)).then(e=>{e.polyfill()})),"function"!=typeof window.queueMicrotask&&je.push(void(window.queueMicrotask=e=>{Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))})),Array.prototype.flatMap||je.push(void Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,writable:!0,value:()=>Array.prototype.map.apply(void 0,arguments).flat(1)})),(g.A.isMobileSafari||l.A.isIOSApp)&&je.push(ze());const qe=Promise.all(je),We=Symbol("INSTANCE"),Ge=Symbol("SINGELTONENFORCER");class He{constructor(e){if(e!==Ge)throw new Error("Instantiation failed: Use KeyboardDetection.instance instead of new.");this.init()}static get instance(){return this[We]||(this[We]=new He(Ge)),this[We]}init(){this.el=document.documentElement,window.addEventListener("keydown",e=>this.onKeyDown(e)),c.A.subscribe(o.D1,()=>this.onMouseDown())}onKeyDown(e){"Tab"!==e.key&&9!==e.keyCode||this.el.classList.add("keyboard-control")}onMouseDown(){this.el.classList.remove("keyboard-control")}}var Je=i(144),Ze=i.n(Je);const Qe=Symbol("INSTANCE"),Ke=Symbol("SINGELTONENFORCER");class Ye{constructor(e){if(e!==Ke)throw new Error("Instantiation failed: Use LazyLoading.instance instead of new.");this.init()}static get instance(){return this[Qe]||(this[Qe]=new Ye(Ke)),this[Qe]}init(){this.lazyload=new(Ze())({elements_selector:".lazyload",use_native:!1,unobserve_entered:!0,unobserve_completed:!0,callback_error:e=>{e instanceof Image&&c.A.publish(o.jg,e)}}),this.lazytrigger=new(Ze())({elements_selector:".lazytrigger",use_native:!1,unobserve_entered:!0,unobserve_completed:!0,callback_enter:e=>{e.dispatchEvent(new Event("lazybeforeunveil"))},callback_loaded:e=>{e.dispatchEvent(new Event("lazyloaded"))}}),c.A.subscribe(o.ph,()=>this.onUpdateRequested())}onUpdateRequested(){this.lazyload&&"function"==typeof this.lazyload.update&&this.lazyload.update(),this.lazytrigger&&"function"==typeof this.lazytrigger.update&&this.lazytrigger.update(
1)}}class Xe extends A.A{constructor(e,t){super(),this._documentId=e,this._collection=t}get id(){return b.lc}get documentId(){return this._documentId}get collection(){return this._collection}}class et{execute(e){e.documentId&&c.A.publish(o.HE,e.documentId,e.collection||"article")}}class tt{execute(){if(l.A.isApp){if(!(s.A.instance&&s.A.instance.app&&s.A.instance.app.pageContext&&s.A.instance.app.pageContext.isAudioEnabled&&s.A.instance.app.pageContext.clip&&s.A.instance.app.pageContext.clip.hasAccess)){const e=s.A.instance,t=e?.translations?.notification?.addDocumentAudioToPlaylistFailure;return void W.A.instance.addNotification({type:r.KP,headline:t?.headline,description:t?.description})}c.A.publish(o.cB,[s.A.instance.app.pageContext.clip])}}}A.A;class it{execute(e){const t=p.A.instance;e.documentId&&t.isLoggedIn&&t.hasPaidAccess&&c.A.publish(o.ys,{documentId:e.documentId,documentUrl:e.documentUrl})}}class st extends A.A{constructor(e,t){super(),this._documentId=e,this._collection=t}get id(){return b.tH}get documentId(){return this._documentId}get collection(){return this._collection}}class nt{execute(e){e.documentId&&c.A.publish(o.ZO,e.documentId,e.collection||"article")}}A.A;class at{execute(e){if(!e.productId||"boolean"!=typeof e.isEligible)return;a.A.store("AppProducts").setIsEligible({productId:e.productId,basePlanId:e.basePlanId,offerId:e.offerId,isEligible:e.isEligible,hasError:e.hasError})}}A.A;class ot{execute(e){if(!e.productId||"string"!=typeof e.formattedPrice)return;a.A.store("AppProducts").setFormattedPrice({productId:e.productId,basePlanId:e.basePlanId,offerId:e.offerId,formattedPrice:e.formattedPrice,hasError:e.hasError})}}class rt{execute(e){c.A.publish(o.uO)}}class lt extends A.A{constructor(e,t){super(),this._consentUUID=e,this._euconsent=t}get id(){return b.NS}get consentUUID(){return this._consentUUID}get euconsent(){return this._euconsent}}class ct extends A.A{constructor({productId:e,basePlanId:t,basePlanIds:i,offers:s,offerId:n,isSubscription:a=!0}){super(),this._productId=e,this._basePlanId=t,this._basePlanIds=Array.isArray(i)?i:[],this._offers=Array.isArray(s)?s:[],this._offerId=n,this._isSubscription=!!a}get id(){return b.u1}get productId(){return this._productId}get basePlanId(){return this._basePlanId}get basePlanIds(){return this._basePlanIds}get offers(){return this._offers}get offerId(){return this._offerId}get isSubscription(){return this._isSubscription}}class dt extends A.A{constructor({offers:e}){super(),this._offers=Array.isArray(e)?e:[]}get id(){return b.iT}get offers(){return this._offers}}var ht=i(78);class ut extends A.A{constructor(e,t){super(),this._link=e,this._title=t}get id(){return b.BG}get link(){return this._link}get title(){return this._title}}class pt extends A.A{constructor(e){super(),this._pushTags=[],this._postponePermissionDialog=e&&e.postponePermissionDialog,e&&e.pushTags&&Array.isArray(e.pushTags)&&e.pushTags.forEac
1h(e=>{"string"==typeof e.tag&&"boolean"==typeof e.isSubscribed?this._pushTags.push(e):console.warn("SubmitOnboardingMessage: malformed payload option `pushTags`, value is not a valid push tag",e)})}get id(){return b.vQ}get pushTags(){return this._pushTags}get postponePermissionDialog(){return this._postponePermissionDialog}}const gt=Symbol("INSTANCE"),mt=Symbol("SINGELTONENFORCER");class yt{constructor(e){if(e!==mt)throw new Error("Instantiation failed: Use Messenger.instance instead of new.");this.handlerLookup={},this.messageLookup={},this.init()}static get instance(){return this[gt]||(this[gt]=new yt(mt)),this[gt]}init(){this.initHandlerLookup(),this.initMessageLookup(),c.A.subscribe(o.yv,this.onMessageReceived,this),c.A.subscribe(o.pN,this.onMessageSend,this)}initHandlerLookup(){this.handlerLookup[b.lc]=et,this.handlerLookup[b.G7]=tt,this.handlerLookup[b.zr]=it,this.handlerLookup[b.$l]=at,this.handlerLookup[b.Dj]=ot,this.handlerLookup[b.tH]=nt,this.handlerLookup[b.uO]=rt}initMessageLookup(){this.messageLookup[b.lc]=Xe,this.messageLookup[b.TK]=Z,this.messageLookup[b.NS]=lt,this.messageLookup[b.Pv]=w,this.messageLookup[b.tH]=st,this.messageLookup[b.u1]=ct,this.messageLookup[b.iT]=dt,this.messageLookup[b.L$]=ht.A,this.messageLookup[b.BG]=ut,this.messageLookup[b.vQ]=pt,this.messageLookup[b.Lw]=Y}onMessageReceived(e){if(!e||!e.id||!this.handlerLookup[e.id])return void console.error("Messenger received invalid or unknown message.");const t=new this.handlerLookup[e.id];"function"==typeof t.execute?t.execute(e):console.error(`Messenger "${t.constructor.name}" is missing an execute function.`)}onMessageSend(e){e&&e.id&&"function"==typeof e.toObject?H.A.instance.sendMessage(e.toObject()):console.error("Messenger cannot send invalid or unknown message.")}}class ft{execute(){l.A.isApp&&this.updateBookmark()}updateBookmark(){const e=s.A.instance;if(("article"===$.A.instance.route||"recipe"===$.A.instance.route)&&e.app&&e.app.pageContext&&e.app.pageContext.documentId&&e.app.pageContext.collection){const t=z.instance;c.A.publish(o.pN,new q(e.app.pageContext.documentId,e.app.pageContext.collection,t.contains(e.app.pageContext.documentId,e.app.pageContext.collection)))}}}class bt{constructor(){this.user=p.A.instance,this.currentUserAccess={...this.user.access},this.settings=s.A.instance,this.tcDataModel=P.instance,this.bookmarks=z.instance,this.webAudio=ce.instance}execute(e){if(this.user.update(),this.currentUserAccess.paid===this.user.access.paid&&this.currentUserAccess.conditional===this.user.access.conditional&&this.currentUserAccess.noAds===this.user.access.noAds){if(this.currentUserAccess={...this.user.access},l.A.isApp?window.navigator.webBridge.globalFontsize(H.A.instance.appFontSize):this.webAudio.reloadLocaLStorage(),!this.user.hasNoAdsAccess&&this.tcDataModel.ready){const e=B.instance;e&&"function"==typeof e.reloadAds&&e.reloadAds()}this.bookmarks.reloadLocaLStorage()}else window.location.reload()}}class At{execute(e){if(!(e instanceof Image&&e?.width&&e.height))return;e.classList.add("bg-shade-lightest","dark:bg-shade-darkest");const t="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 <WIDTH> <HEIGHT>' width='<WIDTH>' height='<HEIGHT>' %3E%3C/svg%3E".replaceAll("<WIDTH>",e.width).replaceAll("<HEIGHT>",e.height);if(e.setAttribute("src",t),e.parentElement instanceof Element){e.parentElement.querySelectorAll("source").forEach(e=>{e.remove()})}e.removeAttribute("srcset")}}var wt=i(735);const It=Symbol("INSTANCE"),vt=Symbol("SINGELTONENFORCER");class Et{constructor(e){if(e!==vt)throw new Error("Instantiation failed: Use SourcepointModel.instance instead of new.");this.init()}static get instance(){return this[It]||(this[It]=new Et(vt)),this[It]}init(){this.message="",this.errorOccurred=!1}}const Pt=Symbol("INSTANCE"),St=Symbol("SINGELTONENFORCER");class kt{constructor(e){if(e!==St)throw new Error("Instantiation failed: Use LanguageModel.instance instead of new.");this.init()}static get instance(){return this[Pt]||(this[Pt]=new kt(St)),this[Pt]}init(){window.polygon&&window.polygon.componentLoader&&window.polygon.componentLoader.subscribe(o.Fw,this.onSwitchLanguageTriggered,this)}determineLanguage(){const e=fe.A.getItem(r.AZ.lang.name),t=navigator.language.slice(0,2);let i=e;i||(i="de"===t?"de":"en"),this._language=i}onSwitchLanguageTriggered(e){e&&(this.language=e)}get language(){return this._language||this.determineLanguage(),this._language}set language(e){if(this._language===e)return this._language;return fe.A.setItem(r.AZ.lang.name,e)||console.warn("LanguageModel: Unable to store new language value permantly because sessionStorage is not available"),this._language=e,window.polygon&&window.polygon.componentLoader&&window.polygon.componentLoader.publish(o.jV,this._language),this._language}}const Ct=Symbol("INSTANCE"),_t=Symbol("SINGELTONENFORCER");class Lt{constructor(e){if(e!==_t)throw new Error("Instantiation failed: Use ScriptUtils.instance instead of new.");this.pendingScripts={},this.loadedScripts={},this.scriptUrls=s.A.instance&&s.A.instance.thirdparty&&s.A.instance.thirdparty.jsSources?s.A.instance.thirdparty.jsSources:{}}static get instance(){return this[Ct]||(this[Ct]=new Lt(_t)),this[Ct]}load(e){return this.scriptUrls[e]?this.loadedScripts[e]?Promise.resolve():new Promise((t,i)=>{let s=this.pendingScripts[e];s||(s=document.createElement("script"),s.src=this.scriptUrls[e],s.dataset.name=e),s.addEventListener("load",e=>this.onScriptLoaded(e,t),{once:!0}),s.addEventListener("error",e=>this.onScriptError(e,i),{once:!0}),this.pendingScripts[e]||(this.pendingScripts[e]=s,document.body.appendChild(s))}):Promise.reject(new Error(`ScriptUtils error: unknown script name "${e}"`))}getScriptUrl(e){return this.scriptUrls[e]?this.scriptUrls[e]:""}onScriptLoaded(e,t){const i=e.target,s=i.dataset.name;this.loadedScripts[s]=i,delete this.pendingScripts[s],t()}onScriptError(e,t){const i=e.target.dataset.name;delete this.pendingScripts[i],t(new Error(`ScriptUtils error: failed to load script "${i}" from ${this.scriptUrls[i]}`))}}const Tt=["de","en"],Ot=Symbol("INSTANCE"),xt=Symbol("SINGELTONENFORCER");class Nt{constructor(e){if(e!==xt)throw new Error("Instantiation failed: Use Sourcepoint.instance instead of new.");const t=s.A.instance;if(this.settingsType=p.A.instance.hasNoAdsAccess?"noads":"default",this.settings=t.thirdparty&&t.thirdparty.sourcepoint&&t.thirdparty.sourcepoint[this.settingsType]?t.thirdparty.sourcepoint[this.settingsType]:void 0,t.disableSourcepoint||!this.settings)return;const i=!(!t.consent||"boolean"!=typeof t.consent.disabled)&&t.consent.disabled;p.A.instance.hasNoAdsAccess||i||g.A.isCrawler||(this.requestMessage="consent-layer"),this.pendingChoiceId=null,this.isReloadMessagesPending=!1,this.isMessagePending=!1,this.init()}static get instance(){return this[Ot]||(this[Ot]=new Nt(xt)),this[Ot]}init(){c.A.subscribe(o.GQ,this.openPrivacyManager,this),c.A.subscribe(o.iU,this.rejectAll,this),c.A.subscribe(o.X2,this.reloadMessages,this),c.A.subscribe(o.vu,this.onChoiceSelect,this),c.A.subscribe(o.Ud,this.onTCDataUpdated,this),c.A.subscribe(o.Fw,this.onLanguageSwitched,this),c.A.subscribe(o.wZ,this.onPageResume,this),window.addEventListener("error",e=>{this.onWindowError(e)}),this.initAuthIdCookie(),this.initSourcepointConfig(),this.initPrivacyManagerButtons(),p.A.instance.isNewLoggedIn&&p.A.instance.hasNoAdsAccess?this.deleteConsentDataHistory().catch(e=>{console.error(e.message)}).finally(()=>{this.initSourcepointScript()}):this.initSourcepointScript()}initAuthIdCookie(){const e=p.A.instance.hasNoAdsAccess&&p.A.instance.userId;if(!e)return void d.A.removeItem(r.AZ.authId.name);const t=d.A.getItem(r.AZ.authId.name);let i;e&&(i=p.A.instance.userId),!i||t&&t===i||d.A.setItem(r.AZ.authId.name,i,r.AZ.authId.expires)}initSourcepointConfig(){const{accountId:e,baseEndpoint:t,propertyHref:i,propertyId:n,campaignEnv:a}=this.settings,o=s.A.instance,r=p.A.instance,c=o.page&&o.page.category&&o.page.category.route?o.page.category.route:"";window._sp_queue=[],window._sp_={config:{accountId:e,baseEndpoint:t,isSPA:!0,consentLanguage:Tt.includes(kt.instance.language)?kt.instance.language:"de",gdpr:{},events:{onPrivacyManagerAction:(...e)=>{2===e.length&&e[0];const t=2===e.length?e[1]:e[0];this.onPrivacyManagerAction(t)},onPMCancel:()=>{this.onPrivacyManagerCancel()},onMessageReady:(...e)=>{e[0]&&"string"==typeof e[0]&&e[0];this.onMessageReady()},onMessageReceiveData:(...e)=>{2===e.length&&e[0];const t=2===e.length?e[1]:e[0];this.onReceiveMessageData(t)},onMessageChoiceSelect:(...e)=>{3===e.length&&e[0];const t=3===e.length?e[1]:e[0],i=3===e.length?e[2]:e[1];this.onMessageChoiceSelect(t,i)},onMessageChoiceError:e=>{this.onMessageChoiceError(e)},onConsentReady:(...e)=>{4===e.length&&e[0];const t=4===e.length?e[1]:e[0],i=4===e.length?e[2]:e[1];this.onConsentReady(t,i)},onError:(...e)=>{console.error("Sourcepoint onError",e)}},targetingParams:{platform:l.A.isApp?"app":"web",is_phone:g.A.isPhone,is_tablet:g.A.isTablet,is_mobile:g.A.isMobile,route:c,is_loggedIn:r.isLoggedIn,has_paid_access:r.hasPaidAccess,has_noAds_access:r.hasNoAdsAccess,has_conditional_access:r.hasConditionalAccess,disable_consent:!(!o.consent||"boolean"!=typeof o.consent.disabled)&&o.consent.disabled,lang:kt.instance.language}}},i?window._sp_.config.propertyHref=i:n&&(window._sp_.config.propertyId=n),a&&"public"!==a&&(window._sp_.config.campaignEnv=a),"article"===c&&(window._sp_.config.targetingParams.paywall_is_active=o.paywall&&o.paywall.attributes&&o.paywall.attributes.is_active,window._sp_.config.targetingParams.paywall_type=o.paywall&&o.paywall.category&&o.paywall.category.type?o.paywall.category.type:""),l.A.isApp&&(l.A.isAndroidApp?window._sp_.config.targetingParams.os="Android":l.A.isIOSApp&&(window._sp_.config.targetingParams.os="iOS"),window._sp_.config.targetingParams.app_version=l.A.appVersion),this.requestMessage&&(window._sp_.config.targetingParams.requestMessage=this.requestMessage)}initPrivacyManagerButtons(){const e=Array.from(document.querySelectorAll('a[href^="#sp_privacy_manager"]'));if(e&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t],s=i.hash.split("#sp_privacy_manager_")[1]?i.hash.split("#sp_privacy_manager_")[1]:"";i.addEventListener("click",e=>{e.preventDefault(),c.A.publish(o.GQ,s)})}}initSourcepointScript(){Lt.instance.load(`sourcepoint_${this.settingsType}`).then(()=>{this.onScriptElementLoaded()}).catch(e=>{this.onScriptElementError(e)})}openPrivacyManager(e=""){const{privacyManagerId:t}=this.settings;if(t&&window._sp_){if("function"==typeof window._sp_.loadPrivacyManagerModal)window._sp_.loadPrivacyManagerModal(t,e);else{if(!window._sp_.gdpr||"function"!=typeof window._sp_.gdpr.loadPrivacyManagerModal)return;window._sp_.gdpr.loadPrivacyManagerModal(t,e)}this.attachPrivacyManagerResizeFix(),c.A.publish(o.bA)}}reloadMessages(){this.isReloadMessagesPending=!0,this.destroyMessages(),this.executeMessaging()}rejectAll(){const e=s.A.instance?.translations?.notification;f.instance.postRejectAll().then(()=>{W.A.instance.addNotification({type:r.Fn,headline:e?.rejectConsentSuccess?.headline}),this.requestMessage&&"consent-layer"!==this.requestMessage||this.reloadMessages()}).catch(()=>{W.A.instance.addNotification({type:r.KP,headline:e?.rejectConsentFailure?.headline,description:e?.rejectConsentFailure?.description})})}deleteConsentDataHistory(){return new Promise((e,t)=>
1{const i=s.A.instance,n=i.thirdparty&&i.thirdparty.sourcepoint&&i.thirdparty.sourcepoint.default?i.thirdparty.sourcepoint.default:void 0,{siteId:a,baseEndpoint:o}=n;let r,l,c;try{r=JSON.parse(I.A.getItem(`_sp_user_consent_${a}`))}catch(e){}if(r&&r.gdpr&&r.gdpr.authId?l=r.gdpr.authId:r&&r.authId?l=r.authId:r&&r.gdpr&&r.gdpr.uuid?c=r.gdpr.uuid:r&&r.consentUUID&&(c=r.consentUUID),a&&(c||l)){const i=new URL(`${o}/consent/tcfv2/consent/v3/${a}`);l?i.searchParams.set("authId",l):c&&i.searchParams.set("consentUUID",c);const s={method:"DELETE",headers:{"Content-Type":"text/plain"}};fetch(i.href,s).then(i=>{200!==i.status&&t(new Error(`Sourcepoint failed to delete consent data history, consentUUID: ${c}`)),e()}).catch(()=>{t(new Error(`Sourcepoint failed to delete consent data history, consentUUID: ${c}`))}).finally(()=>{I.A.removeItem(`_sp_user_consent_${a}`)})}else t(new Error("Sourcepoint failed to delete consent data history, no data"))})}onReceiveMessageData(e){this.isReloadMessagesPending&&(c.A.publish(o.Pd),this.isReloadMessagesPending=!1),e&&e.msgDescription?(this.isMessagePending=!0,Et.instance.message=e.msgDescription):c.A.publish(o._9)}onMessageReady(){l.A.isAndroidApp&&window.scrollY<=0&&setTimeout(()=>{window.scrollTo({top:10,left:0,behavior:"smooth"})},100),this.isMessagePending&&(c.A.publish(o.Co,Et.instance.message),this.isMessagePending=!1)}onMessageChoiceSelect(e,t){t&&(c.A.publish(o.o$,t),this.onChoiceSelect(t))}onMessageChoiceError(e){c.A.publish(o.VR),Et.instance.errorOccurred=!0}onPrivacyManagerAction(e){if(this.detachPrivacyManagerResizeFix(),e&&e.purposeConsent&&e.vendorConsent){let t;"all"===e.purposeConsent&&"all"===e.vendorConsent?(t=r.PH.accept_all,this.onChoiceSelect(r.r7.accept_all)):"none"===e.purposeConsent&&"none"===e.vendorConsent?(t=r.PH.reject_all,this.onChoiceSelect(r.r7.reject_all)):"some"!==e.purposeConsent&&"some"!==e.vendorConsent||(t=r.PH.save_and_exit,this.onChoiceSelect(r.r7.accept_some)),c.A.publish(o._0,t)}}onPrivacyManagerCancel(){c.A.publish(o._0,r.PH.cancel)}onChoiceSelect(e){this.pendingChoiceId||(e===r.r7.accept_all||e===r.r7.accept_some||e===r.r7.reject_all?this.pendingChoiceId=e:c.A.publish(o.fw,e))}onConsentReady(e,t){void 0!==this.consentReadyTimeoutId&&clearTimeout(this.consentReadyTimeoutId),this.pendingChoiceId&&(this.consentReadyTimeoutId=setTimeout(()=>{const e=this.pendingChoiceId;this.pendingChoiceId=null,c.A.publish(o.fw,e),e!==r.r7.reject_all||this.requestMessage&&"consent-layer"!==this.requestMessage||this.reloadMessages()},2e3)),l.A.isApp&&c.A.publish(o.pN,new lt(e,t))}onTCDataUpdated(e){}onScriptElementLoaded(){window._sp_&&window._sp_.config&&window._sp_.config.isSPA&&"function"==typeof window._sp_.executeMessaging&&window._sp_.executeMessaging()}onLanguageSwitched(e){e&&window._sp_&&window._sp_.config&&(window._sp_.config.consentLanguage=Tt.includes(e)?e:"de",this.executeMessaging())}onPageResume(){this.reloadMessages()}onScriptElementError(e){console.error("Sourcepoint onScriptElementError",e),c.A.publish(o.VR),Et.instance.errorOccurred=!0}onWindowError(e){const t=Lt.instance.getScriptUrl(`sourcepoint_${this.settingsType}`);t&&e.filename&&e.filename===t&&(console.error("Sourcepoint onWindowError",e),c.A.publish(o.VR),Et.instance.errorOccurred=!0)}destroyMessages(){Array.from(document.querySelectorAll('body [id^="sp_message_container"]')).filter(e=>e&&e.style&&"none"!==e.style.display).length>0&&window._sp_&&"function"==typeof window._sp_.destroyMessages&&window._sp_.destroyMessages()}executeMessaging(){window._sp_&&"function"==typeof window._sp_.executeMessaging&&window._sp_.executeMessaging()}attachPrivacyManagerResizeFix(){g.A.isMobileSafari&&(this.boundOnWindowResize||(this.boundOnWindowResize=()=>{setTimeout(()=>{window.scrollTo(0,1)},500)}),window.addEventListener("resize",this.boundOnWindowResize))}detachPrivacyManagerResizeFix(){g.A.isMobileSafari&&this.boundOnWindowResize&&window.removeEventListener("resize",this.boundOnWindowResize)}}class Ut{static isUrlArticleContent(e){let t=!1;if(e){const i=new URL(e).pathname.split("/");if(i.length>1){const s=i[i.length-1];let n=-1!==s.indexOf("-a-");n=n||-1!==s.indexOf("-fotostrecke-"),n=n||-1!==s.indexOf("-video-"),n=n||0===s.indexOf("a-"),n=n||0===s.indexOf("fotostrecke-"),n=n||0===s.indexOf("video-"),t=this.isHomeDomain(e)&&n}}return t}static isHomeDomain(e){let t=!1;if(null!=e){const i=new URL(e);t=i.host&&i.host===window.location.host}return t}static fixUrlParamsFragmentsOrder(e){let t;const i=e.indexOf("#"),s=e.indexOf("?");return-1!==i&&s>i?(t=e.substr(0,i),t+=e.substr(s),t+=e.substr(i,s-i)):t=e,t}static getReferrerFromUrl(e){const t=new URL(e);return t.searchParams.get("ref")?t.searchParams.get("ref"):void 0}}const Bt={products:[],init(){const e=s.A.instance.app;if(!l.A.isApp||!e?.products?.[l.A.appCode])return;const t=e.products[l.A.appCode];
1this.storageObject=new V.A(r.AZ.info.name,"cookie",r.AZ.info.expires,"");const i=this.storageObject.getItem("appProducts"),n=Date.now()-36e5,a=Number.parseInt(i?.updatedAt,10);let o=null;if(Array.isArray(i?.products)&&!Number.isNaN(a)&&a>=n){const e=i.products.some(e=>!!e.hasError),t=Date.now()-6e5;(!e||a>=t)&&(o=i.products)}Object.keys(t).forEach(e=>{t[e].forEach(t=>{if(t.minVersion>l.A.appVersion)return;const i={productId:t.id,subscription:e,minVersion:t.minVersion??0,_defaultFormattedPrice:t.defaultFormattedPrice??"",get formattedPrice(){return this._formattedPrice?this._formattedPrice:this._defaultFormattedPrice??""},plan:t.plan??"default",offer:t.offer,basePlanId:t.basePlanId,offerId:t.offerId,isEligible:"boolean"==typeof t.isEligible?t.isEligible:void 0,isSubscription:"boolean"!=typeof t.isSubscription||t.isSubscription};let s;i.defaultPrice=this.convertFormattedPriceToPriceValue(i._defaultFormattedPrice),o&&Array.isArray(o)&&(s=o.find(e=>this.isProductEqual(e,i))),i._formattedPrice=s?._formattedPrice||"",i.price=s?.price||void 0,i.isEligible="boolean"!=typeof i.isEligible?s?.isEligible:i.isEligible,i.isReady=i._formattedPrice&&i.isEligible||"boolean"==typeof i.isEligible&&!i.isEligible||!H.A.instance.isSupported(r.ih.formatted_price);const n=this.products.findIndex(e=>this.isProductEqual(e,i));n<0?this.products.push(i):this.products[n].minVersion<i.minVersion&&(this.products[n]=i)})})},updateStatus(){this.getIsEligibleStatus()},setFormattedPrice({productId:e,subscription:t,plan:i,offer:s,basePlanId:n,offerId:a,formattedPrice:o,hasError:r}){if(!l.A.isApp||!e||"string"!=typeof o)return;const c=this.getProducts({productId:e,subscription:t,plan:i||n||!l.A.isAndroidApp?null:"default",offer:s,basePlanId:n,offerId:a}).filter(e=>a||!e.offerId);if(0===c.length)return;const d=this.convertFormattedPriceToPriceValue(o);c.forEach(e=>{e._formattedPrice=o,e.price=d,e.hasError=e.hasError||r,e.isReady=void 0!==e.isEligible}),this.saveProductsInStorage()},getFormattedPriceBySubscription(e){if(!l.A.isApp||!e)return;const t=this.products.filter(t=>t.subscription===e&&!t.isReady);if(0!==t.length){if(H.A.instance.isSupported(r.ih.product_offers)){const e=new ct({offers:t.map(e=>({productId:e.productId,basePlanId:e.basePlanId,offerId:e.offerId,isSubscription:e.isSubscription}))});return void c.A.publish(o.pN,e)}if(l.A.isAndroidApp){const{productId:e}=t[0],i=!!t[0].isSubscription,s=new ct({productId:e,isSubscription:i,basePlanIds:t.map(e=>e.basePlanId).filter((e,t,i)=>i.indexOf(e)===t)});return void c.A.publish(o.pN,s)}t.forEach(e=>{const t=new ct(e);c.A.publish(o.pN,t)})}},getIsEligibleStatus(){if(!l.A.isApp)return;const e=this.products.filter(e=>void 0===e.isEligible);if(0!==e.length){if(H.A.instance.isSupported(r.ih.product_offers)){const t=new dt({offers:e.map(e=>({productId:e.productId,basePlanId:e.basePlanId,offerId:e.offerId,isSubscription:e.isSubscription}))});return void c.A.publish(o.pN,t)}e.forEach(e=>{e.isEligible=!1,this.setIsEligible(e)})}},setIsEligible({productId:e,subscription:t,plan:i,offer:s,basePlanId:n,offerId:a,isEligible:o,hasError:r}){if(!l.A.isApp||!e||"boolean"!=typeof o)return;const c=this.getProducts({productId:e,subscription:t,plan:i||n||!l.A.isAndroidApp?null:"default",offer:s,basePlanId:n,offerId:a});0!==c.length&&(c.forEach(e=>{e.isEligible=o,e.hasError=e.hasError||r,e.isReady=o&&!!e._formattedPrice||!o}),this.saveProductsInStorage())},getProducts({productId:e,subscription:t,plan:i,offer:s,isSubscription:n=!0,basePlanId:a,offerId:o}){return l.A.isApp?this.products.filter(r=>(!e||r.productId===e)&&(!t||r.subscription===t)&&(!i||r.plan===i)&&(!a||r.basePlanId===a)&&(o&&r.offerId===o||!o&&!s&&!r.offer||s&&r.offer===s)&&r.isSubscription===n):[]},getProduct(e){const t=this.getProducts(e);return t.length>0?t[0]:void 0},saveProductsInStorage(){"function"==typeof this.storageObject?.setItem&&this.storageObject.setItem("appProducts",{products:a.A.raw(this.products),updatedAt:Date.now()})},isProductEqual:(e,t)=>"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&e.subscription===t.subscription&&e.plan===t.plan&&e.offer===t.offer&&e.basePlanId===t.basePlanId&&e.offerId===t.offerId&&e.isSubscription===t.isSubscription,convertFormattedPriceToPriceValue(e){if(e&&"string"==typeof e)return parseFloat(e.replace(/,/g,"."))}},Rt={get instance(){return a.A.store("AppProducts")}},Mt=Symbol("INSTANCE"),Dt=Symbol("SINGELTONENFORCER");class $t{constructor(e){if(e!==Dt)throw new Error("Instantiation failed: Use SARAsData.instance instead of new.");this.init()}static get instance(){return this[Mt]||(this[Mt]=new $t(Dt)),this[Mt]}init(){const e=s.A.instance;this.application=e.application?e.application:{},this.editorial=e.editorial?e.editorial:void 0,this.external=e.external?e.external:{},this.page=e.page?e.page:{},this.paywall=e.paywall?e.paywall:void 0}set application(e){if(this._application={},e&&e.info&&(this._application.info=e.info),l.A.isApp){let e="";l.A.isAndroidApp?e="Android:":l.A.isIOSApp&&(e="iOS:"),e+=l.A.appVersion,this._application.info||(this._application.info={}),this._application.info.app_version=e}}get application(){return this._application}set editorial(e){this._editorial=e?{info:{...e.info?e.info:{}},attributes:{...e.attributes?e.attributes:{}},category:{...e.category?e.category:{}},author:{...e.author?e.author:{}}}:void 0}get editorial(){return this._editorial}set external(e){this._external={},e.vg_wort&&(this._external.vg_wort=e.vg_wort)}get external(){return this._external}set page(e){const t={platform:l.A.isApp?"app":"web"},i=Ut.getReferrerFromUrl(window.location.href);i&&(t.referrer=i);let s="";switch(u.instance.breakpoint){case"lg":s="desktop";break;case"md":s="tablet";break;case"sm":s="mobile"}const n={viewport:s,is_darkmode:u.instance.colorScheme===r.xP};this._page={info:Object.assign(t,e.info?e.info:{}),attributes:Object.assign(n,e.attributes?e.attributes:{}),category:{...e.category?e.category:{}}}}get page(){return this._page}set paywall(e){this._paywall=e?{...e}:void 0}get paywall(){return this._paywall}get user(){const e=p.A.instance,t=s.A.instance,i={};e.trackingId&&(i.sso_tracking_id=e.trackingId),H.A.instance.advertisingId&&(i.device_advertising_id=H.A.instance.advertisingId);const n={is_phone:g.A.isPhone,is_tablet:g.A.isTablet,is_mobile:g.A.isMobile},a={access:e.accessInfo,is_loggedIn:e.isLoggedIn,is_loggedIn_impersonated:!!e.sessionFlags?.impersonated,is_staff:!!e.sessionFlags?.isStaff,has_adbrain_enabled:e.hasAdbrainEnabled,has_paid_access:e.hasPaidAccess,has_spiegelNoAdsMonthly_access:e.hasNoAdsAccess,has_conditional_access:e.hasConditionalAccess,is_appIntroductoryOffer_eligible:l.A.isApp&&!!Rt.instance.getProduct({plan:"default",offer:"introductory"}
1)?.isEligible,is_appAnnualIntroductoryOffer_eligible:l.A.isApp&&!!Rt.instance.getProduct({plan:"annual",offer:"introductory"})?.isEligible};return void 0!==e.meteredStatus?.credits&&(a.metered_access_count=`${e.meteredStatus.credits}/${e.meteredStatus.maxCredits??"4"}|${e.meteredStatus?.nextRefresh??""}`),$.A.instance.isGiftArticle&&(a.has_gift_article_access=!(e.hasPaidAccess||t.paywall&&t.paywall.attributes&&t.paywall.attributes.is_active)),{info:{...i},segment:a,device:n}}}const Vt=Symbol("INSTANCE"),Ft=Symbol("SINGELTONENFORCER"),jt="tlp";class zt{constructor(e){if(e!==Ft)throw new Error("Instantiation failed: Use SARAs.instance instead of new.");this.init()}static get instance(){return this[Vt]||(this[Vt]=new zt(Ft)),this[Vt]}init(){s.A.instance.disableAdobeLaunch?this.data={}:(this.data=$t.instance,c.A.subscribe(o.zG,this.onAdPositionInitialized,this),c.A.subscribe(o.UY,this.onJWPlayerInitialized,this),c.A.subscribe(o.wZ,this.onPageResume,this),c.A.subscribe(o.HE,this.onAddBookmark,this),c.A.subscribe(o.ZO,this.onDeleteBookmark,this),c.A.subscribe(o.y9,this.onDeleteAllBookmarks,this),c.A.subscribe(o.Z$,this.push,this),!p.A.instance.hasMeteredStatus||p.A.instance.meteredStatus?.isReady?this.sendPageLoadEvent():c.A.subscribe(o.XN,this.sendPageLoadEvent,this))}onAdPositionInitialized(e){if(!e||!e.positionName||"string"!=typeof e.positionName)return;const t=!!e.containsAd,i=!!e.isEmpty,s=!!e.isBackfill,n=Array.isArray(e.size)?e.size:[void 0,void 0],a=e.platform||"",o=e.cls||void 0;this.sendAdPositionInitializedEvent(e.positionName,e.positionTile,t,i,s,n,a,o)}onAddBookmark(e,t){e&&t&&("article"===t||"recipe"===t)&&this.sendCustomButtonClickEvent("add bookmark",{articleId:e,source:"bookmark-button"})}onDeleteBookmark(e,t){e&&t&&("article"===t||"recipe"===t)&&this.sendCustomButtonClickEvent("delete bookmark",{articleId:e,source:"bookmark-button"})}onDeleteAllBookmarks(e){!e||"article"!==e&&"recipe"!==e||this.sendCustomButtonClickEvent("delete all bookmarks",{source:"bookmark-button"})}onJWPlayerInitialized(e,t){e&&this.sendJWPlayerInitializedEvent(e,t)}onPageResume(e={}){e&&e.platform&&"app"===e.platform&&this.sendVirtualPageEvent("app_call",e.trigger,e.referrer)}sendCustomButtonClickEvent(e,t){if(!e)return;const i={event:{info:{action:"button_click",name:e},attributes:{source:`${jt}|webview|${t&&t.source?t.source:"button"}`}}};t&&t.articleId&&(i.editorial={info:{article_id:t.articleId}}),this.push(i)}sendJWPlayerInitializedEvent(e,t){if(!e)return;const i={event:{info:{action:"jw-init"},attributes:{player_id:e,source:`${jt}|webview|video-player`}}};t&&(i.event.attributes.orientation=t),this.push(i)}sendComponentViewEvent(e,t=""){if(!e)return;const i={event:{info:{action:"component_load",name:t},attributes:{component_id:e,source:`${jt}|webview|component`}}};this.push(i)}sendAdPositionInitializedEvent(e,t,i,s,n,a,o,r){if(!e)return;const l={event:{info:{action:"adpos-init"},attributes:{pos:e,tile:t,contains_ad:i,is_empty:s,is_backfill:n,size:a,platform:o,cls:r,source:`${jt}|webview|advertisement`}}};this.push(l)}sendTargetPositionInitializedEvent(e){if(!e||"string"!=typeof e)return;const{preview:t}=s.A.instance,{breakpoint:i}=u.instance,n={event:{info:{action:`${e}-init`,name:`view - ${e} position`},attributes:{pos:e,contains_ad:!1,is_empty:!1,is_backfill:!1,platform:g.A.isMobile||t&&"sm"===i?"mobile":"desktop",source:`${jt}|webview|advertisement`}}};this.push(n)}sendPageLoadEvent(){let e={};e=Object.assign(e,{event:{info:{action:"page_data_ready",name:"generic"},attributes:{current_url:`${s.A.instance.urls.base}${window.location.pathname}${window.location.search}`,source:`${jt}|webview|page-tracking`}}}),this.data.application&&(e=Object.assign(e,{application:this.data.application})),this.data.external&&(e=Object.assign(e,{external:this.data.external})),this.data.page&&(e=Object.assign(e,{page:this.data.page})),this.data.editorial&&(e=Object.assign(e,{editorial:this.data.editorial})),this.data.paywall&&(e=Object.assign(e,{paywall:this.data.paywall})),this.data.user&&(e=Object.assign(e,{user:this.data.user})),this.push(e)}sendVirtualPageEvent(e="generic",t="generic_recall",i=void 0){let s={};s=Object.assign(s,{event:{info:{action:"virtual_page",name:e},attributes:{label:t,source:`${jt}|webview|page-tracking`}}}),i&&(s.page={info:{referrer:i}}),this.push(s)}push(e){return!s.A.instance.disableAdobeLaunch&&(e.event&&e.event.info&&e.event.info.action?window.SARAs_data?(window.SARAs_data.push(e),!0):(console.error(`SARAs->push: SARAs_data is not defined: ${JSON.stringify(e)}`),!1):(console.error(`SARAs->push: Event Param action is required: ${JSON.stringify(e)}`),!1))}}class qt{execute(e){const{query:t,form:i}=e;if(t.startsWith("//iqkeywords:")||t.startsWith("//iqdeployment:")){const e=t.startsWith("//iqkeywords:")?"iqkeywords":"iqdeployment",s=t.split(`//${e}:`)[1];let n=!1;n=s?d.A.setItem(`polygon_${e}`,s):d.A.removeItem(`polygon_${e}`),W.A.instance.addNotification({type:n?r.Fn:r.KP,headline:`${e} update ${n?"successful":"failed"}`}),n&&i&&"function"==typeof i.reset&&i.reset()}}}class Wt{execute(e){const{to:t,subject:i,body:s}=e,n=Ie.A.getMailtoUrl(t,i,s);n&&(window.location.href=n)}}class Gt{execute(e){const t=[];
1e&&Array.isArray(e.pushTags)&&e.pushTags.forEach(e=>{"string"==typeof e.tag&&"boolean"==typeof e.isSubscribed&&t.push({tag:e.tag,isSubscribed:e.isSubscribed})});const i=new pt({pushTags:t,postponePermissionDialog:e&&e.postponePermissionDialog});c.A.publish(o.pN,i)}}const Ht=Symbol("INSTANCE"),Jt=Symbol("SINGELTONENFORCER");class Zt{constructor(e){if(e!==Jt)throw new Error("Instantiation failed: Use TriggerHandler.instance instead of new.");this.init()}static get instance(){return this[Ht]||(this[Ht]=new Zt(Jt)),this[Ht]}init(){this.registerEventHandlers()}registerEventHandlers(){window.polygon&&window.polygon.componentLoader&&(window.polygon.componentLoader.subscribe(o.h$,this.onAccountTriggered,this),window.polygon.componentLoader.subscribe(o.fX,this.onLoginTriggered,this),window.polygon.componentLoader.subscribe(o.cs,this.onLogoutTriggered,this),window.polygon.componentLoader.subscribe(o.pS,this.onRegisterTriggered,this),window.polygon.componentLoader.subscribe(o.MG,this.onOfferTriggered,this),window.polygon.componentLoader.subscribe(o.F,this.onRestorePurchasesTriggered,this),window.polygon.componentLoader.subscribe(o.Ox,this.onNavigationTriggered,this))}onAccountTriggered(e={}){const{path:t}=e,{isApp:i}=l.A,{urls:n}=s.A.instance;if(i){H.A.instance.triggerAccount(e)}else if(t&&n&&n.backofficeBaseUrl){const e=new URL(t,n.backofficeBaseUrl);window.location.assign(e.href)}else n&&n.user&&n.user.account&&window.location.assign(n.user.account)}onLoginTriggered(e={}){const{targetUrl:t,domain:i}=e,{isApp:n}=l.A;if(n){H.A.instance.triggerLogin({targetUrl:t,domain:i})}else{const{urls:e}=s.A.instance;if(e?.user?.login?.[i]||e?.user?.login?.default){let s;s=i&&e.user.login[i]?new URL(e.user.login[i]):new URL(e.user.login.default),t?s.searchParams.set("targetUrl",t):s.searchParams.has("targetUrl")||s.searchParams.set("targetUrl",this.defaultTargetUrl),window.location.assign(s.href)}}}onLogoutTriggered(){const{isApp:e}=l.A;if(e){H.A.instance.triggerLogout()}else{const{urls:e}=s.A.instance;e&&e.user&&e.user.logout&&window.location.assign(e.user.logout)}}onRegisterTriggered(e={}){const{targetUrl:t}=e,{isApp:i}=l.A;if(i){H.A.instance.triggerRegister({targetUrl:t})}else{const{urls:e}=s.A.instance;if(e&&e.user&&e.user.register){const i=new URL(e.user.register);t?i.searchParams.set("targetUrl",t):i.searchParams.has("targetUrl")||i.searchParams.set("targetUrl",this.defaultTargetUrl),window.location.assign(i.href)}}}onOfferTriggered(e={}){const{product:t,targetUrl:i}=e;let{plan:n,offer:a}=e;if(!t)return;"introductory"===n&&(n="default",a="introductory");const{isApp:o}=l.A;if(o){let e;const{subscriptions:i}=s.A.instance;"object"==typeof i&&Object.keys(i).includes(t)&&("string"==typeof i[t]?e=i[t]:Array.isArray(i[t])&&i[t].length>0&&(e=i[t][0])),e=e||t;H.A.instance.triggerInAppPurchase({product:e,plan:n,offer:a})}else{const{urls:e}=s.A.instance;if(e&&e.offers&&e.offers[t]){const s=new URL(e.offers[t]);i?s.searchParams.set("targetUrl",i):s.searchParams.has("targetUrl")||s.searchParams.set("targetUrl",this.defaultTargetUrl),window.location.assign(s.href)}}}onRestorePurchasesTriggered(e={}){const{targetUrl:t}=e,{isApp:i}=l.A;if(i){H.A.instance.triggerRestorePurchases({targetUrl:t||this.defaultTargetUrl})}}onNavigationTriggered(e={}){const{page:t}=e,{targetUrl:i}=e,{urls:n}=s.A.instance;if(n?.pages&&n.pages[t]){const e=new URL(n.pages[t]);i?e.searchParams.set("targetUrl",i):e.searchParams.has("targetUrl")||e.searchParams.set("targetUrl",this.defaultTargetUrl),window.location.assign(e.href)}}get defaultTargetUrl(){const e=new URLSearchParams(window.location.search);return(e.get("targetUrl")?decodeURIComponent(e.get("targetUrl")):void 0)||window.location.href}}var Qt=i(732);const Kt="WARDEN_LIMIT_EXCEEDED",Yt="WARDEN_LIMIT_OK";class Xt extends Qt.A{constructor({baseUrl:e,site:t,userId:i,fingerprint:s,limit:n}
1){super(),e&&t&&i&&s&&n?(this.baseUrl=e,this.site=t,this.userId=i,this.fingerprint=s,this.limit=n,this.tickTimeoutRef=null,this.baseUrl.endsWith("/")||(this.baseUrl+="/"),this.init()):console.error("Warden requires baseUrl, site, userId, limit for correct instantiation.")}init(){this.initPageVisibilityAPI(),this.tick()}initPageVisibilityAPI(){this.hiddenPropertyName=void 0,this.visibilityChangeEventName=void 0,void 0!==document.hidden?(this.hiddenPropertyName="hidden",this.visibilityChangeEventName="visibilitychange"):void 0!==document.mozHidden?(this.hiddenPropertyName="mozHidden",this.visibilityChangeEventName="mozvisibilitychange"):void 0!==document.msHidden?(this.hiddenPropertyName="msHidden",this.visibilityChangeEventName="msvisibilitychange"):void 0!==document.webkitHidden?(this.hiddenPropertyName="webkitHidden",this.visibilityChangeEventName="webkitvisibilitychange"):this.visibilityChangeEventName="visibilitychange",this.currentVisibilityState=this.visibilityState,this.boundOnVisibilityChange=()=>this.onVisibilityChange(this.visibilityState),window.document.addEventListener(this.visibilityChangeEventName,this.boundOnVisibilityChange),this.boundOnPageHide=()=>this.onVisibilityChange("hidden"),window.addEventListener("pagehide",this.boundOnPageHide)}onVisibilityChange(e){this.currentVisibilityState!==e&&(this.currentVisibilityState=e,"visible"===e?this.handleWindowIsActive():"hidden"===e&&this.handleWindowIsInactive())}get visibilityState(){return this.hiddenPropertyName?window.document[this.hiddenPropertyName]?"hidden":"visible":void 0!==window.document.visibilityState?window.document.visibilityState:void 0}handleWindowIsInactive(){this.tickTimeoutRef&&(clearTimeout(this.tickTimeoutRef),this.tickTimeoutRef=null,this.remove())}handleWindowIsActive(){this.dispatchWardenEvent(Yt),this.tickTimeoutRef||this.tick()}tick(){"visible"===this.visibilityState?fetch(this.tickUrl,{method:"GET"}).then(e=>{403===e.status?this.dispatchWardenEvent(Kt):this.dispatchWardenEvent(Yt)}).catch(e=>console.error("Warden - Error while fetching tick:",e)).finally(()=>{this.tickTimeoutRef=setTimeout(()=>this.tick(),3e3)}):this.tickTimeoutRef=null}remove(){fetch(this.removeUrl,{method:"GET",keepalive:!0}).then(()=>this.dispatchWardenEvent(Yt)).catch(e=>console.error("Warden - Error while fetching delete:",e))}allow(){fetch(this.allowUrl,{method:"GET"}).then(()=>this.dispatchWardenEvent(Yt)).catch(e=>console.error("Warden - Error while fetching allow:",e))}dispatchWardenEvent(e){if(!e)return;const t=new CustomEvent(e);super.dispatchEvent(t)}get tickUrl(){const e=new URL(`${this.baseUrl}api/v1/tick`);return e.searchParams.set("site",this.site),e.searchParams.set("user_id",this.userId),e.searchParams.set("fingerprint",this.fingerprint),e.searchParams.set("limit",this.limit),e.href}get removeUrl(){const e=new URL(`${this.baseUrl}api/v1/remove`);return e.searchParams.set("site",this.site),e.searchParams.set("user_id",this.userId),e.searchParams.set("fingerprint",this.fingerprint),e.searchParams.set("limit",this.limit),e.href}get allowUrl(){const e=new URL(`${this.baseUrl}api/v1/allow`);return e.searchParams.set("site",this.site),e.searchParams.set("user_id",this.userId),e.searchParams.set("fingerprint",this.fingerprint),e.searchParams.set("limit",this.limit),e.href}destroy(){window.document.removeEventListener(this.visibilityChangeEventName,this.boundOnVisibilityChange),window.removeEventListener("pagehide",this.boundOnPageHide),super.destroy()}}class ei{static endsWith(e,t){return!(!e||"string"!=typeof e||!t||"string"!=typeof t)&&(-1!==e.indexOf(t)&&e.indexOf(t)+t.length===e.length)}static getRandomString(e=4,t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"){const i=t.length;let s="";for(let n=0;n<e;n++)s+=t.charAt(Math.floor(Math.random()*i));return s}static kebabCase(e){return[" ","_"].includes(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}static capitalizeFirstLetter(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}}const ti=Symbol("INSTANCE"),ii=Symbol("SINGELTONENFORCER");class si{constructor(e){if(e!==ii)throw new Error("Instantiation failed: Use UserCapping.instance instead of new.");this.storageObject=null,this.boundOnWardenLimitExceeded=null,this.boundOnWardenLimitOk=null,this.init()}static get instance(){return this[ti]||(this[ti]=new si(ii)),this[ti]}init(){const e=s.A.instance.warden||{},t=!!e.enabled,{hasPaidAccess:i,hasNoAdsAccess:n,userId:a,sessionLimit:r}=p.A.instance;if(!t||!a||!r||!i&&!n)return;
1this.storageObject=new V.A("warden","local");let l="";this.storageObject.getItem("fingerprint")?l=this.storageObject.getItem("fingerprint"):(l=ei.getRandomString(16),this.storageObject.setItem("fingerprint",l)),this.warden=new Xt({baseUrl:e.baseUrl||"",site:s.A.instance.domain||"",userId:a,fingerprint:l,limit:r}),this.boundOnWardenLimitExceeded=()=>this.onWardenLimitExceeded(),this.warden.addEventListener(Kt,this.boundOnWardenLimitExceeded),this.boundOnWardenLimitOk=()=>this.onWardenLimitOk(),this.warden.addEventListener(Yt,this.boundOnWardenLimitOk),c.A.subscribe(o.b6,this.onUserCappingAllow,this)}onWardenLimitExceeded(){c.A.publish(o.$M)}onWardenLimitOk(){c.A.publish(o.w1)}onUserCappingAllow(){this.warden&&"function"==typeof this.warden.allow&&this.warden.allow()}}class ni extends Qt.A{constructor(){super(),this.state=null,this.isInitialized=!1,this.isPlayPending=!0,this.init()}init(){const e=ce.instance;e&&(this.state={mode:e.mode,clip:e.clip?JSON.parse(JSON.stringify(e.clip)):null,isPaused:e.isPaused,isEnded:e.isEnded,currentTime:e.currentTime,duration:e.duration,playbackRate:e.playbackRate,volume:e.volume},a.A.effect(()=>this.onUpdateMode(e.mode)),a.A.effect(()=>this.onUpdateClip(e.clip)),a.A.effect(()=>this.onUpdateIsPaused(e.isPaused)),a.A.effect(()=>this.onUpdateIsEnded(e.isEnded)),a.A.effect(()=>this.onUpdateDuration(e.duration)),a.A.effect(()=>this.onUpdateCurrentTime(e.currentTime)),a.A.effect(()=>this.onUpdatePlaybackRate(e.playbackRate)),a.A.effect(()=>this.onUpdateVolume(e.volume)),this.isInitialized=!0)}onUpdateMode(e){this.state.mode=e}onUpdateClip(e){this.state.clip=e?JSON.parse(JSON.stringify(e)):null,this.isPlayPending=!0,e?this.dispatchWebAudioEvent("WEB_AUDIO_EVENT_CLIP"):this.dispatchWebAudioEvent("WEB_AUDIO_EVENT_CLEAR")}onUpdateIsPaused(e){this.state.isPaused=!!e,e?this.dispatchWebAudioEvent("WEB_AUDIO_EVENT_PAUSE"):this.isPlayPending?(this.dispatchWebAudioEvent("WEB_AUDIO_EVENT_PLAY"),this.isPlayPending=!1):this.dispatchWebAudioEvent("WEB_AUDIO_EVENT_RESUME")}onUpdateIsEnded(e){this.state.isEnded=!!e,e&&this.dispatchWebAudioEvent("WEB_AUDIO_EVENT_END")}onUpdateDuration(e){this.state.duration=e}onUpdateCurrentTime(e){this.state.currentTime=e,this.dispatchWebAudioEvent("WEB_AUDIO_EVENT_TIME")}onUpdatePlaybackRate(e){this.state.playbackRate=e,this.dispatchWebAudioEvent("WEB_AUDIO_EVENT_PLAYBACK_RATE")}onUpdateVolume(e){this.state.volume=e,this.dispatchWebAudioEvent("WEB_AUDIO_EVENT_VOLUME")}dispatchWebAudioEvent(e){if(!this.isInitialized)return;const t=Object.assign(this.state,{action:e});super.dispatchEvent(new CustomEvent("WEB_AUDIO_EVENT",{detail:t}))}}class ai{defaultData(){return{}}constructor(){this.el=arguments[0],"undefined"!=typeof jQuery&&(this.$el=jQuery(this.el)),this.data=arguments[1],this.__mediator=arguments[2],this._configureData()}_configureData(){const e={};this.el&&this.el.attributes&&[].forEach.call(this.el.attributes,t=>{if(t&&t.name&&/^data-/.test(t.name)){var i=t.name.substr(5).replace(/-(.)/g,(e,t)=>t.toUpperCase());e[i]=t.value}}),this.data=Object.assign(this.defaultData?this.defaultData():{},e,this.data)}bind(){for(var e=0;e<arguments.length;e++){const t=arguments[e];this[t]=this[t].bind(this)}}publish(){this.__mediator.publish(...arguments)}subscribe(e,t){this.__mediator.subscribe(e,t,this)}unsubscribe(e,t){this.__mediator.unsubscribe(e,t,this)}scan(e){this.__mediator.scan(e)}defer(e,t=17){setTimeout(e,t)}destroy(){}}class oi{static isEqual(e,t){if(!Array.isArray(e)||!Array.isArray(t))throw new Error("ArrayUtils isEqual: Missing or malformed parameters, expected two Arrays");if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}static shuffle(e){if(!Array.isArray(e))throw new Error("ArrayUtils shuffle: Missing or malformed parameters, expected an Array");const t=e.slice();for(let e=0;e<t.length;e++){const i=e+Math.floor(Math.random()*(t.length-e));[t[e],t[i]]=[t[i],t[e]]}return t}}const ri=Symbol("INSTANCE"),li=Symbol("SINGELTONENFORCER");class ci{constructor(e){if(e!==li)throw new Error("Instantiation failed: Use TeaserRenderer.instance instead of new.");this.init()}static get instance(){return this[ri]||(this[ri]=new ci(li)),this[ri]}init(){this.prototypes={};document.querySelectorAll("template[data-teaser-prototype]").forEach(e
1=>{const{variant:t,type:i,domain:s}=e.dataset;t&&i&&s&&(this.prototypes[`${t}-${i}-${s}`]=e)})}create(e={},t=r.Y7){const i=s.A.instance.domain,n=e.domain||"",a=e.type||"",o=Array.isArray(e.flags)?e.flags:[],l=Array.isArray(e.iconAuxiliaries)?e.iconAuxiliaries:[],c=this.prototypes[`${t}-${a}-${n}`]||this.prototypes[`${t}-news-${n}`]||this.prototypes[`${t}-${a}-${i}`]||this.prototypes[`${t}-news-${i}`]||this.prototypes[`${t}-card-${n}`]||this.prototypes[`${t}-card-${i}`],d=c&&c.content&&c.content.firstElementChild?c.content.firstElementChild.cloneNode(!0):null;if(!d)return console.warn(`TeaserFactory.render failed: No prototype found for teaser variant "${t}"`),null;const h=Array.from(d.querySelectorAll("[data-topmark-flag-name]"));let u=!1;Array.isArray(h)&&h.forEach(e=>{Array.isArray(o)&&o.includes(e.dataset.topmarkFlagName)?u=!0:e.parentElement.remove()});const p=d.querySelector('[data-topmark-el="text"]');e.headline&&e.topmark&&(u||!p)&&(e.headline=`${e.topmark}: ${e.headline}`,delete e.topmark);const g=Array.from(d.querySelectorAll("[data-topmarkprefix-name]"));let m=!1;Array.isArray(g)&&g.forEach(t=>{e.topmarkPrefix&&t.dataset.topmarkprefixName===e.topmarkPrefix?m=!0:t.remove()}),e.topmark||m||!p||p.remove();const y=d.querySelector('[data-topmark-el="container"]');if(y&&((0!==o.length||e.topmark||m)&&0!==y.children.length||y.remove()),!m||!e.topmark&&y){const e=d.querySelector('[data-topmark-el="bull"]');e&&e.remove()}const f=Array.from(d.querySelectorAll("[data-flag-name]"));Array.isArray(f)&&Array.isArray(o)&&f.forEach(e=>{o.includes(e.dataset.flagName)||e.remove()});const b=Array.from(d.querySelectorAll("[data-contains-flags]"));Array.isArray(b)&&b.forEach(e=>{Array.isArray(o)&&e.setAttribute("data-contains-flags",o.join(" ")),0===e.children.length&&e.remove()});const A=Array.from(d.querySelectorAll("[data-flag-button-name]"));if(Array.isArray(A)&&A.forEach(t=>{e.style&&e.style===t.dataset.flagButtonName||t.remove()}),"video"!==e.style){const e=Array.from(d.querySelectorAll("[data-play-button]"));Array.isArray(e)&&e.forEach(e=>{e&&e.remove()})}const w=Array.from(d.querySelectorAll("[data-icon-auxiliary]"));Array.isArray(w)&&Array.isArray(l)&&w.forEach(e=>{const t=e.dataset.iconAuxiliary||"";l.includes(t)||e.remove()}),e.imageId&&(e.imageZoomSuffix=e.imageZoomSuffix||"");const I=Array.from(d.querySelectorAll("[data-image]"));Array.isArray(I)&&!e.imageId&&I.forEach(t=>{if(e.imageSrc){t.querySelector("img").dataset.src=e.imageSrc}else t.remove()});const v=Array.from(d.querySelectorAll("[data-headline-image]"));Array.isArray(v)&&!e.headlineImageId&&v.forEach(e=>{e.remove()});const E=Oe.A.populateElement(d,e);let P=E.querySelectorAll("[data-auxiliary]");P.forEach(e=>{0===e.textContent.length&&(e.nextElementSibling.hasAttribute("data-auxiliary-bull")&&e.nextElementSibling.remove(),e.remove())}),P=E.querySelectorAll("[data-auxiliary]");const S=E.querySelector("[data-icon-auxiliary][data-auxiliary-bull]");return S&&0===P.length&&S.remove(),E}blocksContentArticleTeaserFull({teasers:e=[],headlineOffset:t=!1,showSeparator:i=!0}){const s=document.createElement("div");if(s.className="relative w-full flex flex-wrap",0===e.length)return s;let n=0,a=0,o=0;return e.forEach((l,c)=>{const d=0===c,h=c>=e.length-1,u=this.createTeaserWrapper(l);if(d&&t&&u.classList.add("sm:-mt-16"),"xxl"===l.layout){if(n=12,a=12,o=12,!d){const e=this.createBorderSeparator({direction:"horizontal",additionalClassesString:"sm:hidden"});s.appendChild(e)}const e=this.create({...l},r.e_);u.appendChild(e),s.appendChild(u)}else if("l-wide"===l.layout){if(n=12,a=12,o=12,!d){const e=this.createBorderSeparator({direction:"horizontal"});s.appendChild(e)}const e=this.create({...l},r.Wn);u.appendChild(e),s.appendChild(u)}else if("m"===l.layout){if(n=12,a+=6,o+=4,!d&&i){const e=this.createBorderSeparator({direction:"horizontal",additionalClassesString:`${o<=12?"lg:hidden":""}${a<=12?" md:hidden":""}`});s.appendChild(e)}a>12&&(a=6),o>12&&(o=4);const e=this.create({...l},r.dT);if(u.appendChild(e),i&&!h){const e=this.createBorderSeparator({direction:"vertical",additionalClassesString:`${o>=12?"lg:hidden":""}${a>=12?" md:hidden":""} sm:hidden`});u.appendChild(e)}s.appendChild(u)}else if("s-list"===l.layout){n=12,a=12,o+=4,o>12&&(o=4);const e=this.create({...l,number:c+1},r.ux);if(!e)return;
1if(u.appendChild(e),i&&!h){const e=this.createBorderSeparator({direction:"vertical",additionalClassesString:(o>=12?"lg:hidden":"")+" md:hidden sm:hidden"});u.appendChild(e)}if(d){const e=document.createElement("div");e.className="w-full lg:hidden md:h-12 sm:h-8",s.appendChild(e)}if(s.appendChild(u),h){const e=document.createElement("div");e.className="w-full sm:h-8 md:h-12 lg:hidden",s.appendChild(e)}}}),s}createTeaserWrapper(e){const t=document.createElement("div");return"xxl-title"===e.layout?t.className="z-10 lg:w-10/12 md:w-full sm:w-full":"m"===e.layout?t.className="z-10 lg:w-4/12 md:w-6/12 sm:w-full relative":"s-list"===e.layout?t.className="z-10 lg:w-4/12 md:w-full sm:w-full relative":t.className="z-10 w-full",t.setAttribute("data-area",`article_teaser>${e.type?e.type:"unknown"}${e.layout?`-${e.layout}`:""}`),t.setAttribute("data-block-el","articleTeaser"),t.setAttribute("data-sara-click-el","article_teaser"),t.setAttribute("data-pos",`${e.pos}`),t}createBorderSeparator({direction:e="horizontal",additionalClassesString:t=""}){let i;return i="vertical"===e?Oe.A.createElementByPrototypeId("prototype-border-separator-secondary-vertical"):Oe.A.createElementByPrototypeId("prototype-border-separator-secondary"),i&&(i=Oe.A.populateElement(i,{additionalClassesString:t})),i}}class di{static convertArticleToTeaser(e){const t={};if(t.id=e.id?e.id:"",t.collection="article",t.domain=e.domain?e.domain:s.A.instance.domain,t.channel=e.channel&&e.channel.title?e.channel.title:"",t.headline=e.title?e.title:"",t.topmark=e.heading?e.heading:"",t.text=e.intro?e.intro:"",t.type=e.type?e.type:"news",t.style=e.teaser&&e.teaser.type?e.teaser.type:e.style||"default",t.url=e.url?e.url:"",t.imageId=e.header_image?e.header_image:"",t.topmarkPrefix="",e.is_live?t.topmarkPrefix="live":"opinion"!==e.type||e.hide_heading_prefix||(t.topmarkPrefix="meinung"),!t.url||!t.url.length)return null;t.flags=[];const i=di.getArticlePaidFlag(e);i&&t.flags.push(i);const n=s.A.instance.domain;let a=e.domain?e.domain:"";const o=di.getArticleSubdomain(e);o&&(a=o,t.domain=o),e.forward_to_canonical_url&&e.canonical_url&&(e.canonical_url.includes("spiegel.de/dein/")?(t.domain="spon",a="dein"):e.canonical_url.includes("spiegel.de/effilee/")?(t.domain="effi",a="effi"):e.canonical_url.includes("spiegel.de")?(t.domain="spon",a="spon"):e.canonical_url.includes("manager-magazin.de/hbm/")||e.canonical_url.includes("manager-magazin.de/harvard/")?(t.domain="hbm",a="hbm"):e.canonical_url.includes("manager-magazin.de")?(t.domain="mmo",a="mmo"):e.canonical_url.includes("11freunde.de")&&(t.domain="elf",a="elf"),t.flags.push("mmo")),n!==a&&t.flags.push(a),e.is_live&&t.flags.push("live"),e.is_breaking&&t.flags.push("breaking");t.style&&["gallery","video","audio"].includes(t.style)&&t.flags.push(t.style),t.iconAuxiliaries=[],"audio"===t.style?t.iconAuxiliaries.push("Audio"):"video"===t.style?t.iconAuxiliaries.push("Video"):"gallery"===t.style?t.iconAuxiliaries.push("Gallery"):t.iconAuxiliaries.push("Text");const r=e.teaser&&Number.isInteger(e.teaser.length)?e.teaser.length:0;if(r)if("gallery"===t.style)t.length=`${r} ${1===r?"Bild":"Bilder"}`,t.auxiliaryLength=t.length;else{const e=Math.round(r/60),i=r%60;t.length=`${`${e}`.padStart(2,"0")}:${`${i}`.padStart(2,"0")}`,t.auxiliaryLength=`${e<1?1:e} Min`}const l=e.publish_date?new Date(1e3*e.publish_date).toLocaleDateString("de-DE",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"";t.timestamp=l?`${l} Uhr`:"";const c=e.author_details_prefix?`${e.author_details_prefix} `:"Von ";let d=e.author_details_suffix?e.author_details_suffix:"";if(t.meta="",Array.isArray(e.authors)&&e.authors.length>0){let i="";e.authors.length>0&&(i=c,e.authors.forEach((s,n)=>{if(!s||!s.name)return;const a=0===n,o=n===e.authors.length-1;a&&s.image&&!t.headlineImageId&&(t.headlineImageId=s.image),o&&e.authors.length>1?i+=" und ":0!==n&&(i+=", "),i+=s.name}));const n=s.A.instance.text&&s.A.instance.text.authorDetailsSuffix&&s.A.instance.text.authorDetailsSuffix.removeWhitespaceBeforeCharacters?s.A.instance.text.authorDetailsSuffix.removeWhitespaceBeforeCharacters:[];d&&Array.isArray(n)&&(n.includes(d.charAt(0))||(d=` ${d}`)),t.meta=i+d}return t}static getArticlePaidFlag(e){let t="",i=e.access_level?e.access_level:"free";"conditional"===i&&(i=p.A.instance.hasConditionalAccess?"free":"paid");const n=Array.isArray(s.A.instance.hidePaidFlagsDomains)&&s.A.instance.hidePaidFlagsDomains.includes(e.domain||s.A.instance.domain);return"paid"!==i||n||(t="plus-paid"),t}static getArticleSubdomain(e){let t="";const i=e.channel&&e.channel.slug?e.channel.slug:"";return"hbm"===i&&(t="hbm"),"deinspiegel"===i&&(t="dein"),"effilee"===i&&(t="effi"),t}}class hi{static convertRecipeToTeaser(e){const t={};if(t.id=e.id?e.id:"",t.collection="recipe",t.domain="effi",t.headline=e.title?e.title:"",t.topmark=e.heading?e.heading:"",t.text=e.intro?e.intro:"",t.type="recipe",t.style="default",t.url=e.url?e.url:"",t.imageId=e.header_image?e.header_image:"",!t.url||!t.url.length)return null;t.flags=[];const i=hi.getRecipePaidFlag(e);i&&t.flags.push(i);const n=s.A.instance.domain,a=e.domain?e.domain:"";n!==a&&t.flags.push(a);const o=(e.prep_time&&Number.isInteger(e.prep_time)?e.prep_time:0)+(e.cook_time&&Number.isInteger(e.cook_time)?e.cook_time:0);let r=Math.round(o);const l=Math.floor(r/60);let c;r%=60,l>0&&(c=`${l} Std`),r>0&&(c=c?`${c} `:"",c=`${c+r}
1 Min`),c&&(t.iconAuxiliaries=["Briefing"]),t.auxiliaryLength=c;const d=[];return["cuisine","main_ingredient","categories"].forEach(t=>{Array.isArray(e[t])&&e[t].length>0&&e[t].forEach(e=>{e.title&&d.push(e.title)})}),t.meta=d.join(", "),t}static getRecipePaidFlag(e){let t="",i=e.access_level?e.access_level:"free";"conditional"===i&&(i=p.A.instance.hasConditionalAccess?"free":"paid");const n=Array.isArray(s.A.instance.hidePaidFlagsDomains)&&s.A.instance.hidePaidFlagsDomains.includes(e.domain||s.A.instance.domain);return"paid"!==i||n||(t="plus-paid"),t}}const ui=Symbol("INSTANCE"),pi=Symbol("SINGELTONENFORCER");class gi{constructor(e){if(e!==pi)throw new Error("Instantiation failed: Use SiteSearchAPI.instance instead of new.");this.init()}static get instance(){return this[ui]||(this[ui]=new gi(pi)),this[ui]}init(){const e=s.A.instance;e.thirdparty&&e.thirdparty.sitesearch&&e.thirdparty.sitesearch.apiUrl?this.apiUrl=e.thirdparty.sitesearch.apiUrl:console.error("SiteSearchAPI requires apiUrl for correct instantiation.")}getTeasersBySearchOptions(e={}){const{query:t,segments:i,author:s,fields:n,after:a,before:o,cooktimeMin:r,cooktimeMax:l,subdimensions:c,pageSize:d,page:h}=e;if(!i||!Array.isArray(i))return Promise.reject(new Error("SiteSearchAPI getTeasersBySearchOptions - missing required param `segments`"));if((!t||"string"!=typeof t)&&(!s||"string"!=typeof s)&&!i.length>0)return Promise.reject(new Error("SiteSearchAPI getTeasersBySearchOptions - missing required param `query` or `author`, please provide either or both"));const u=new URL(`${this.apiUrl}/search`);if(u.searchParams.set("segments",i.join(",")),t&&"string"==typeof t&&u.searchParams.set("q",t),s&&"string"==typeof s&&u.searchParams.set("author",s),n&&"string"==typeof n&&u.searchParams.set("fields",n),Number.isInteger(a)&&u.searchParams.set("after",a),Number.isInteger(o)&&u.searchParams.set("before",o),Number.isInteger(r)&&u.searchParams.set("cook_time_min",r),Number.isInteger(l)&&u.searchParams.set("cook_time_max",l),d&&Number.isInteger(d)&&d>=10&&u.searchParams.set("page_size",d),Number.isInteger(h)&&u.searchParams.set("page",h),c&&Object.keys(c).length>0){let e="";Object.keys(c).forEach(t=>{Array.isArray(c[t])&&c[t].length>0&&(e&&(e+="|"),e+=`${t}:${c[t]}`)}),e&&u.searchParams.set("recipe_dimensions",e)}return this.fetchUrl(u).then(e=>(e.success&&(e.teasers=Array.isArray(e.results)?e.results.map(e=>"recipe"===e.collection?hi.convertRecipeToTeaser(e):di.convertArticleToTeaser(e)):[],delete e.results),Promise.resolve(e)))}getTeasersByIds(e=[]){if(!e||!Array.isArray(e)||0===e.length||e.filter(e=>"string"!=typeof e).length)return Promise.reject(new Error("SiteSearchAPI getTeasersByIds - missing or malformed required param `id`"));const t=new URL(`${this.apiUrl}/fetch`);return t.searchParams.set("ids",e.join(",")),this.fetchUrl(t).then(e=>{if(!e.success||!e.results||!Array.isArray(e.results))return Promise.resolve({success:!1,code:e.code||""});const t=e.results.map(e=>"recipe"===e.collection?hi.convertRecipeToTeaser(e):di.convertArticleToTeaser(e)),i=e.numResults||t.length;return Promise.resolve({success:!0,numResults:i,teasers:t})})}fetchUrl(e){return fetch(e,{method:"GET",headers:{"Content-Type":"text/plain"}}).then(e=>e.json()).then(e=>{if(e.code)return Promise.resolve({success:!1,code:e.code});const t=e.results&&Array.isArray(e.results)?e.results:[],i=Number.isInteger(e.num_results)?e.num_results:t.length,s=e.aggregations?e.aggregations:{};return Promise.resolve({success:!0,numResults:i,results:t,aggregations:s})}).catch(()=>(console.warn(`SiteSearchAPI fetchUrl – failed to fetch url "${e}"`),Promise.resolve({success:!1,code:""})))}}const mi="STATE_LOADING",yi="STATE_EMPTY",fi="STATE_ERROR",bi="STATE_DEFAULT";const Ai="STATE_ACTIVE",wi="STATE_INACTIVE";const Ii="STATE_LOADING",vi="STATE_EMPTY",Ei="STATE_ERROR",Pi="STATE_DEFAULT";const Si="STATE_LOADING",ki="STATE_EMPTY",Ci="STATE_ERROR",_i="STATE_DEFAULT";const Li=Symbol("INSTANCE"),Ti=Symbol("SINGELTONENFORCER");class Oi{constructor(e){if(e!==Ti)throw new Error("Instantiation failed: Use BrowserHistoryService.instance instead of new.");this.registeredLayers={},this.browserHistoryLayers=[],this.currentIndex=window.history?0:-1,this.currentHash="",this.id=Date.now(),this.init()}static get instance(){return this[Li]||(this[Li]=new Oi(Ti)),this[Li]}init(){window.history&&(window.history.state&&Number.isInteger(window.history.state.index)?this.currentIndex=window.history.state.index:(this.currentIndex=window.history.length-1,window.history.replaceState({layerServiceId:this.id,index:this.currentIndex,hash:"",isInitState:!0},""))),this.boundOnKeyDown=e=>this.onKeyDown(e),window.document.addEventListener("keydown",this.boundOnKeyDown),window.polygon&&window.polygon.componentLoader&&(window.polygon.componentLoader.subscribe(o.vh,this.onCloseLayerTriggered,this),window.polygon.componentLoader.subscribe(o.no,this.onOpenLayerTriggered,this)),window.addEventListener("popstate",e=>this.onPopstate(e))}register(e){e&&"string"==typeof e.id&&"string"==typeof e.hash&&"function"==typeof e.close&&"function"==typeof e.o
1pen?this.registeredLayers[e.id]=e:console.error("LayerService registration failed: layer needs to implement an id and hash string and a close and open function")}addLayerToBrowserHistory(e){if(this.currentHash&&this.currentHash===e.hash)return!1;if(window.history)if(window.history.state&&window.history.state.hash&&window.history.state.hash===e.hash){this.currentHash=e.hash?e.hash:"";const t={layerServiceId:this.id,index:this.currentIndex,hash:this.currentHash};window.history.replaceState(t,"",e.hash?`#${e.hash}`:"")}else{this.currentIndex<this.browserHistoryLayers.length-1&&(this.browserHistoryLayers=this.browserHistoryLayers.slice(0,this.currentIndex+1)),this.currentIndex+=1,this.currentHash=e.hash?e.hash:"";const t={layerServiceId:this.id,index:this.currentIndex,hash:this.currentHash};window.history.pushState(t,"",this.currentHash?`#${this.currentHash}`:"")}else this.currentIndex+=1;return this.browserHistoryLayers[this.currentIndex]=e,this.openLayer(this.currentIndex),this.onActiveLayerChanged(),!0}openLayer(e){const t=this.browserHistoryLayers[e];return!(!t||"function"!=typeof t.open)&&(t.open(),window.polygon&&window.polygon.componentLoader&&window.polygon.componentLoader.publish(o.aj,t.id),!0)}closeLayer(e){const t=this.browserHistoryLayers[e];return!(!t||"function"!=typeof t.close)&&(t.close(),window.polygon&&window.polygon.componentLoader&&window.polygon.componentLoader.publish(o.ru,t.id),!0)}back(){void 0!==this.browserHistoryLayers[this.currentIndex]&&(window.history&&"function"==typeof window.history.go?window.history.go(-1):(this.closeLayer(this.currentIndex),this.currentIndex=this.currentIndex>=0?this.currentIndex-1:-1,this.onActiveLayerChanged()))}goTo(e){if(this.currentIndex>e){const t=e>=0?e+1:0;for(let e=this.currentIndex;e>=t;e--)this.closeLayer(e);this.currentIndex=e,this.onActiveLayerChanged()}else if(this.currentIndex<e){for(let t=this.currentIndex>=0?this.currentIndex+1:0;t<=e;t++)this.openLayer(t);this.currentIndex=e,this.onActiveLayerChanged()}}restoreLayerByHash(e){let t=!1;Object.keys(this.registeredLayers).forEach(i=>{const s=this.registeredLayers[i];t||s.hash!==e||(this.addLayerToBrowserHistory(s),t=!0)})}onPopstate(e){if(!e||!e.state)return;let t,i="",s="";if(e.state.layerServiceId===this.id){if(t=e.state&&Number.isInteger(e.state.index)?e.state.index:void 0,i=e.state&&e.state.hash?e.state.hash:"",e.state&&e.state.isInitState&&this.windowHash&&window.history){const e={layerServiceId:this.id,index:Number.isInteger(t)?t:this.currentIndex,hash:""};window.history.replaceState(e,"",window.location.pathname+window.location.search)}}else if(t=e.state&&Number.isInteger(e.state.index)?e.state.index:void 0,this.currentHash!==this.windowHash)s=this.windowHash;else if(window.history){const e={layerServiceId:this.id,index:Number.isInteger(t)?t:this.currentIndex,hash:""};window.history.replaceState(e,"",window.location.pathname+window.location.search)}void 0!==t&&this.currentIndex!==t&&(this.goTo(t),this.currentHash=i),s&&this.restoreLayerByHash(s)}onKeyDown(e){e.defaultPrevented||"Escape"!==e.key&&"Esc"!==e.key&&27!==e.keyCode||void 0===this.browserHistoryLayers[this.currentIndex]||(e.preventDefault(),this.back())}onOpenLayerTriggered(e){this.registeredLayers[e]&&"function"==typeof this.registeredLayers[e].close&&"function"==typeof this.registeredLayers[e].open&&this.addLayerToBrowserHistory(this.registeredLayers[e])}onCloseLayerTriggered(){this.back()}onActiveLayerChanged(){const e=this.browserHistoryLayers[this.currentIndex];e&&e.id&&window.polygon&&window.polygon.componentLoader&&window.polygon.componentLoader.publish(o.M2,e.id)}get windowHash(){return window.location.hash?window.location.hash.substring(1):""}}class xi{constructor(e,t){e&&e instanceof Element?(this.pinchCanvas=e,this.pinchTarget=t||this.pinchCanvas,this.scaleMin=1,this.scaleMax=2.3,this.scaleThreshold=1.65,this.transformProperty=Array.prototype.slice.call(getComputedStyle(this.pinchCanvas)).filter(e=>e.match(/^(-webkit-|-moz-|-ms-|-o-)?transform$/)).pop(),this.isInitalized=!1,this.isAttached=!1,this.isZoomed=!1,this.isZoomOngoing=!1,this.isPinchOngoing=!1,this.transitionDuration=200,this.scalingFactor=1,this.pinchStartScalingFactor=null,this.isPanning=!1,this.translation={x:0,y:0},this.panStartPointerPosition={x:null,y:null},this.panStartTranslation={x:null,y:null},this.isNativeTouchOngoing=!1,this.nativeTouchStartPosition={x:null,y:null},this.boundOnPinch=e=>this.onPinch(e),this.boundOnPinchStart=()=>this.onPinchStart(),this.boundOnPinchEnd=()=>this.onPinchEnd(),this.boundOnZoomedIn=()=>this.onZoomedIn(),this.boundOnZoomedOut=()=>this.onZoomedOut(),this.boundOnPanStart=e=>this.onPanStart(e),this.boundOnPan=e=>this.onPan(e),this.boundOnPanEnd=()=>this.onPanEnd(),this.boundOnTouchStart=e=>this.onTouchStart(e),this.boundOnTouchEnd=e=>this.onTouchEnd(e)):console.warn("PinchToZoom: invalid required argument `canvasElement`, must be of type `Element`")}init(){return g.A.isPhone?window.Hammer?(this.isInitalized=!0,Promise.resolve()):new Promise((e,t)=>
1{Lt.instance.load("hammerjs").then(()=>{this.isInitalized=!0,e()}).catch(()=>t())}):Promise.reject()}attach(){this.isInitalized&&!this.isAttached&&(this.zoomOut(),this.attachPinch(),this.isAttached=!0)}detach(){this.isInitalized&&this.isAttached&&(this.zoomOut(),this.detachPinch(),this.isAttached=!1)}onTouchStart(e){this.isNativeTouchOngoing=!0;const t=e.changedTouches[0];this.nativeTouchStartPosition.x=t.clientX,this.nativeTouchStartPosition.y=t.clientY}onTouchEnd(e){const t=e.changedTouches[0];this.isNativeTouchOngoing&&t.clientX!==this.nativeTouchStartPosition.x&&t.clientY!==this.nativeTouchStartPosition.y&&(this.detachPan(),this.detachPinch(),this.attachPinch(),this.attachPan(),this.isNativeTouchOngoing=!1)}onPinchStart(){this.isNativeTouchOngoing=!1,this.isPinchOngoing=!0,this.pinchStartScalingFactor=this.scalingFactor,this.updateZoom()}onPinch(e){const t=e.scale,i=Math.floor(100*t)/100,s=this.pinchStartScalingFactor*i;s>=this.scaleMin&&s<=this.scaleMax&&(this.scalingFactor=s)}onPinchEnd(){this.pinchStartScalingFactor=null,this.isPinchOngoing=!1,this.scalingFactor>=this.scaleThreshold?this.zoomIn():this.zoomOut()}onPanStart(e){this.isNativeTouchOngoing=!1,this.resetPan(),this.isPanning=!0,this.panStartPointerPosition={x:e.center.x,y:e.center.y},this.panStartTranslation=this.translation}onPan(e){if(this.isPanning){const t={x:(e.center.x-this.panStartPointerPosition.x)/this.scalingFactor,y:(e.center.y-this.panStartPointerPosition.y)/this.scalingFactor},i={x:this.translation.x-this.panStartTranslation.x,y:this.translation.y-this.panStartTranslation.y},s={x:t.x-i.x,y:t.y-i.y};(s.x||s.y)&&this.panBy(s)}}onPanEnd(){this.resetPan()}onZoomedIn(){this.resetTransition(),this.isZoomed=!0,this.attachPan(),this.isZoomOngoing=!1}onZoomedOut(){this.resetTransition(),this.isZoomed=!1,this.isZoomOngoing=!1}attachPinch(){this.hammer=new window.Hammer(this.pinchCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("pinchstart",this.boundOnPinchStart),this.hammer.on("pinch",this.boundOnPinch),this.hammer.on("pinchend",this.boundOnPinchEnd)}detachPinch(){this.hammer&&(this.hammer.off("pinchstart",this.boundOnPinchStart),this.hammer.off("pinch",this.boundOnPinch),this.hammer.off("pinchend",this.boundOnPinchEnd),this.hammer.destroy(),this.hammer=null)}attachPan(){this.hammer&&(this.hammer.on("panstart",this.boundOnPanStart),this.hammer.on("panmove",this.boundOnPan),this.hammer.on("panend",this.boundOnPanEnd),this.pinchCanvas.addEventListener("touchstart",this.boundOnTouchStart),this.pinchCanvas.addEventListener("touchend",this.boundOnTouchEnd))}detachPan(){this.hammer&&(this.resetPan(),this.resetTranslation(),this.hammer.off("panstart",this.boundOnPanStart),this.hammer.off("panmove",this.boundOnPan),this.hammer.off("panend",this.boundOnPanEnd),this.pinchCanvas.removeEventListener("touchstart",this.boundOnTouchStart),this.pinchCanvas.removeEventListener("touchend",this.boundOnTouchEnd))}updateZoom(){this.isPinchOngoing&&(this.applyTransform({scale:this.scalingFactor}),window.setTimeout(this.updateZoom.bind(this),15))}zoomIn(){this.isZoomOngoing=!0,this.scalingFactor=2.3,this.pinchTarget.style.transition=`${this.transformProperty} ${this.transitionDuration}ms ease-out`,this.applyTransform({scale:this.scalingFactor}),window.setTimeout(this.boundOnZoomedIn,this.transitionDuration);const e=new CustomEvent(o.w3,{detail:{zoomIn:!0,transitionDuration:this.transitionDuration}});this.pinchTarget.dispatchEvent(e)}zoomOut(){this.isZoomOngoing=!0,this.detachPan(),this.pinchTarget.style.transition=`${this.transformProperty} ${this.transitionDuration}ms ease-out`,this.scalingFactor=1,this.applyTransform({scale:1}),window.setTimeout(this.boundOnZoomedOut,this.transitionDuration);const e=new CustomEvent(o.w3,{detail:{zoomIn:!1,transitionDuration:this.transitionDuration}});this.pinchTarget.dispatchEvent(e)}panBy(e){if(!e.x&&!e.y)return;const t=this.pinchTarget.offsetWidth*this.scalingFactor,i=this.pinchTarget.offsetHeight*this.scalingFactor,s=(t-window.innerWidth)/2,n=(i-window.innerHeight)/2,a=s/this.scalingFactor,o=n/this.scalingFactor,r={x:this.translation.x+e.x,y:this.translation.y+e.y};Math.abs(r.x)>a&&(r.x=this.translation.x),Math.abs(r.y)>o&&(r.y=this.translation.y),r.x===this.translation.x&&r.y===this.translation.y||(this.translation=r,this.applyTransform({translation:r}))}applyTransform(e){let t=e.scale||this.scalingFactor,i=this.translation.x,s=this.translation.y;if(e.translation&&e.translation.x&&(i=e.translation.x),e.translation&&e.translation.y&&(s=e.translation.y),t>this.scaleMax&&(t=this.scaleMax),t<this.scaleMin&&(t=this.scaleMin),t<this.scaleMax){const e=(t-this.scaleMin)/(this.scaleMax-this.scaleMin);i*=e,s*=e}window.requestAnimationFrame(()=>{this.pinchTarget.style[this.transformProperty]=`scale(${t}) translate3d(${i}px,${s}px,0)`})}resetTransition(){this.pinchTarget.style.transition=""}resetTranslation(){this.translation={x:0,y:0}}resetPan(){this.isPanning=!1,this.panStartPointerPosition={x:null,y:null},this.panStartTranslation={x:null,y:null}}destroy(){this.detach()}}const Ni=Symbol("INSTANCE"),Ui=Symbol("SINGELTONENFORCER");class Bi{constructor(e){if(e!==Ui)throw new Error("Instantiation failed: Use JWPlayerDeliveryAPI.instance instead of new.");this.init()}static get instance(){return this[Ni]||(this[Ni]=new Bi(Ui)),this[Ni]}init(){const e=s.A.instance;this.apiUrl=e.thirdparty?.jwplayer?.apiUrl??"https://cdn.jwplayer.com",this.adConfigId=e.thirdparty?.jwplayer?.adConfigId??"",this.siteId=e.thirdparty?.jwplayer?.siteId??""}getPlaybackMetadataByMediaId(e){if(!this.siteId)return Promise.reject(new Error("JWPlayerDeliveryAPI getPlaybackMetadataByMediaId - requires a configured JW Player site ID"));if(!e||"string"!=typeof e)return Promise.reject(new Error("JWPlayerDeliveryAPI getPlaybackMetadataByMediaId - missing valid mediaId function param"));const t=`${this.apiUrl}/v2/sites/${this.siteId}/media/${e}/playback.json`;return new Promise((i,s)=>{this.fetchUrl({url:t}).then(t=>{t?i(t):s(new Error(`JWPlayerDeliveryAPI getPlaybackMetadataByMediaId - no playback metadata found for clipId: ${e}`))}).catch(e=>s(e))})}getMediaObjectByMediaId(e){if(!e||"string"!=typeof e)return Promise.reject(new Error("JWPlayerDeliveryAPI getMediaObjectByMediaId - missing valid mediaId function param"));const t=`${this.apiUrl}/v2/media/${e}`;return new Promise((i,s)=>{this.fetchUrl({url:t}).then(t=>{t?i(t):s(new Error(`JWPlayerDeliveryAPI getMediaObjectByMediaId - no media object found for clipId: ${e}`))}).catch(e=>s(e))})}getPlaylistByPlaylistId(e){if(!e||"string"!=typeof e)return Promise.reject(new Error("JWPlayerDeliveryAPI getPlaylistByPlaylistId - missing valid playlistId function param"));const t=`${this.apiUrl}/v2/playlists/${e}`;return new Promise((i,s)=>{this.fetchUrl({url:t}).then(t=>{t?i(t):s(new Error(`JWPlayerDeliveryAPI getPlaylistByPlaylistId - no playlist found for playlistId: ${e}`))}).catch(e=>s(e))})}getImageThumbnailByMediaObject(e,t=0){return this._getThumbnailByMediaObject(e,t,"image")}getVideoThumbnailByMediaObject(e,t=0){return this._getThumbnailByMediaObject(e,t,"video")}getVideoThumbnailByMediaId(e){return e?`${this.apiUrl}/v2/media/${e}/poster.mp4?width=640`:""}_getThumbnailByMediaObject(e,t=0,i="image"){if(!e)return"";let s=null;if(e.playlist&&Array.isArray(e.playlist)&&e.playlist.length>0){const n=e.playlist[0];if(n.images&&Array.isArray(n.images)&&n.images.length>0){const e="image"===i||"video"===i?i:"image",a=n.images.filter(t=>0===t.type.indexOf(e));a.sort((e,t)=>
1e.width-t.width),a.forEach(e=>{(!s||e.width>s.width&&0===t||e.width>s.width&&s.width<t)&&(s=e)})}}return s&&s.src?s.src:""}getVideoByMediaObject(e,t=0){if(!e)return"";let i=null;if(e.playlist&&Array.isArray(e.playlist)&&e.playlist.length>0){const s=e.playlist[0];if(s.sources&&Array.isArray(s.sources)&&s.sources.length>0){const e=s.sources.filter(e=>0===e.type.indexOf("video"));e.sort((e,t)=>e.width-t.width),e.forEach(e=>{(!i||e.width>i.width&&0===t||e.width>i.width&&i.width<t)&&(i=e)})}}return i&&i.file?i.file:""}getAdScheduleById(e){return new Promise((t,i)=>{e&&"string"==typeof e||i(new Error("JWPlayerDeliveryAPI getAdScheduleById - missing valid id function param"));const s=`${this.apiUrl}/v2/advertising/schedules/${e}.json`;this.fetchUrl({url:s}).then(s=>{s?t(s):i(new Error(`JWPlayerDeliveryAPI getAdScheduleById - no ad schedule found for id: ${e}`))}).catch(e=>i(e))})}getPlayerConfigById(e){return new Promise((t,i)=>{e&&"string"==typeof e||i(new Error("JWPlayerDeliveryAPI getPlayerConfigById - missing valid id function param"));const n=`${this.apiUrl}/libraries/${e}.js`;this.fetchUrl({url:n,responseContentType:"text"}).then(i=>{if(!i)throw new Error(`JWPlayerDeliveryAPI getPlayerConfigById - no player found for id: ${e}`);{const s=i.match(/^[^]*?var jwDefaults = (?<json>.*[^]*?);[^]*?$/),n=s.groups?.json||null;let a=null;try{a=JSON.parse(n)}catch(e){}if(!a)throw new Error(`JWPlayerDeliveryAPI getPlayerConfigById - unable to extract config for id: ${e}`);t(a)}}).catch(n=>{s.A.instance.thirdparty?.jwplayer?.config?(console.warn(`JWPlayerDeliveryAPI getPlayerConfigById - unable to extract config for id: ${e} - using fallback config instead`),t(s.A.instance.thirdparty.jwplayer.config)):i(n)})})}getCustomAdCuepointsByMediaId(e){if(!e||"string"!=typeof e||!this.siteId||!this.adConfigId)return Promise.reject(new Error("JWPlayerDeliveryAPI getMediaObjectByMediaId - missing valid mediaId function param or siteId and/or adConfigId are not defined"));const t=`${this.apiUrl}/v2/sites/${this.siteId}/ad_configs/${this.adConfigId}/schedule.json?media_id=${e}`;return new Promise((i,s)=>{this.fetchUrl({url:t,headers:null}).then(t=>{t?i(t):s(new Error(`JWPlayerDeliveryAPI getCustomAdCuepoints - no custom ad cuepoints found for id: ${e} `))}).catch(e=>s(e))})}fetchUrl({url:e,headers:t={"Content-Type":"text/plain"},responseContentType:i="json"}){const s={method:"GET"};return t&&(s.headers=t),fetch(e,s).then(e=>200!==e.status?Promise.reject(new Error(`JWPlayerDeliveryAPI fetchUrl - failed to get data from API, URL: ${e.url}`)):"text"===i?e.text():e.json())}convertTimecodeToOffset(e){if(!e||"string"!=typeof e)return null;const t=e.split(":");let i=0,s=0,n=0,a=0;if(3===t.length)[i,s,n]=t.map(Number);else if(2===t.length)[s,n]=t.map(Number);else{if(1!==t.length)return null;n=Number(t[0])}n%1!=0&&(a=n%1,n=Math.floor(n));const o=3600*i+60*s+n+a;return Math.round(o)}}class Ri{constructor(){const e=s.A.instance;this.pubadsSettings=e.video&&e.video.pubads?e.video.pubads:void 0}getAdTag({type:e="default",pos:t="pre",overrideParams:i={}}){if(!(this.pubadsSettings&&this.pubadsSettings.baseUrl&&this.pubadsSettings.params&&this.pubadsSettings.params[e]))return"";const n=new URL(this.pubadsSettings.baseUrl);return Object.entries(this.pubadsSettings.params[e]).forEach(([e,a])=>{if("cust_params"===e){let o=a;o=o.replace(/<POS>/g,t),o=o.replace(/<TILE_SUFFIX>/g,"pre"===t?"":2);const r=[window.IQD_varPack?.iqd_TestKW?window.IQD_varPack.iqd_TestKW:"iqlive"],l=s.A.instance;if(l.editorial?.info?.channel&&r.push(ei.kebabCase(l.editorial?.info?.channel)),o=o.replace(/<KW>/g,r.join(",")),i?.cust_params){const e=new URLSearchParams(o);new URLSearchParams(i.cust_params).forEach((t,i)=>{if("kw"===i&&t){const i=e.get("kw")?`${e.get("kw")},${t}`:t;e.set("kw",i)}else"kw"!==i&&e.set(i,t)}),o=e.toString().replace(/%2C/g,",")}n.searchParams.set(e,o)}else"vpos"===e?n.searchParams.set(e,a.replace(/<VPOS>/g,"pre"===t?"preroll":"midroll")):"pod"===e?n.searchParams.set(e,a.replace(/<POD>/g,"pre"===t?1:2)):n.searchParams.set(e,a)}
1),i&&Object.keys(i).forEach(e=>{"cust_params"!==e&&n.searchParams.set(e,i[e])}),n.href}get initialized(){return new Promise(e=>{if(x.instance.isInitialized||x.instance.hasError)return void e(!0);const t=setTimeout(()=>{console.error("GoogleIMATagBuilder: IQD init timeout"),e(!1)},2e3),i=()=>{void 0!==t&&clearTimeout(t),e(!0)};c.A.subscribe(o.Ap,i,this),c.A.subscribe(o.KO,i,this)})}}class Mi{static deepclone(e){try{return JSON.parse(JSON.stringify(e))}catch(t){return e}}}const Di=Symbol("INSTANCE"),$i=Symbol("SINGELTONENFORCER");class Vi{constructor(e){if(e!==$i)throw new Error("Instantiation failed: Use RECO.instance instead of new.");this.init()}static get instance(){return this[Di]||(this[Di]=new Vi($i)),this[Di]}init(){const e=s.A.instance;e.thirdparty&&e.thirdparty.reco&&e.thirdparty.reco.apiUrl?(this.apiUrl=e.thirdparty.reco.apiUrl,this.responses={},this.pendingPromises={}):console.error("RECO service requires apiUrl for correct instantiation.")}getRecommendedArticles(e){if(!p.A.instance.trackingId)return Promise.reject(new Error("RECO getRecommendedArticles - User trackingId is missing"));let t="/v1/recommendations";if("smartfeed"===e&&(t="/v1/end-of-article-recommendations"),this.responses[t])return Promise.resolve(this.responses[t]);this.pendingPromises[t]=this.pendingPromises[t]||[];const i=new Promise((e,i)=>{this.pendingPromises[t].push({resolve:e,reject:i})});if(this.pendingPromises[t].length>1)return i;const s=new URL(t,this.apiUrl);return s.searchParams.set("trackingId",p.A.instance.trackingId),this.fetchUrl(s.href).then(e=>{const i={articleIds:e.article_ids&&Array.isArray(e.article_ids)?e.article_ids:[],runId:e.metadata?.run_id??"none",createdAt:e.metadata?.created_at??void 0};if(this.responses[t]=i,Array.isArray(this.pendingPromises[t]))for(;this.pendingPromises[t].length>0;){const e=this.pendingPromises[t].pop();"function"==typeof e.resolve&&e.resolve(i)}}).catch(e=>{if(Array.isArray(this.pendingPromises[t]))for(;this.pendingPromises[t].length>0;){const i=this.pendingPromises[t].pop();"function"==typeof i.reject&&i.reject(e)}}),i}fetchUrl(e){return fetch(e,{method:"GET",headers:{"Content-Type":"text/plain"}}).then(e=>200!==e.status?e.text().then(e=>{throw new Error(e)}).catch(t=>Promise.reject(new Error(`RECO fetchUrl - failed to get data from API, URL: ${e.url}, error: ${t.message}`))):e.json())}}const Fi="STATE_LOADING",ji="STATE_DEFAULT";const zi="MODE_PLAY",qi="MODE_PAUSE",Wi="MODE_STOP",Gi="STATE_DEFAULT",Hi="STATE_LOADING",Ji="STATE_WAITING",Zi="STATE_PLAYING",Qi="STATE_ERROR",Ki="AUTOPLAY_INTERSECTION",Yi="AUTOPLAY_MOUSEOVER",Xi="AUTOPLAY_NONE";const es={_accepted:!1,eventName:o.Oh,init(){const e=d.A.getItem(r.AZ.affiliateConsent.name);this._accepted="true"===e},get accepted(){return this._accepted},set accepted(e){return this._accepted===e||(d.A.setItem(r.AZ.affiliateConsent.name,e,r.AZ.affiliateConsent.expires),this._accepted=e,c.A.publish(o.Oh,{accepted:e})),this._accepted}};const ts={_accepted:!1,eventName:o.Hu,init(){this.tcDataModel=P.instance;const e=s.A.instance,t=p.A.instance.hasNoAdsAccess?"noads":"default",i=e.thirdparty&&e.thirdparty.sourcepoint&&e.thirdparty.sourcepoint[t]?e.thirdparty.sourcepoint[t]:void 0;this.purposeId=i&&i.purposeIds&&i.purposeIds.thirdparty?i.purposeIds.thirdparty:void 0,this._accepted=this.tcDataModel.isPurposeGrantedById(this.purposeId),c.A.subscribe(o.Nk,()=>{this.accepted=this.tcDataModel.isPurposeGrantedById(this.purposeId)})},accept(){this.accepted&&this.tcDataModel.isPurposeGrantedById(this.purposeId)||(this.tcDataModel.isPurposeGrantedById(this.purposeId)?this.accepted=!0:this.tcDataModel.grantPurposeById(this.purposeId).then(()=>{}).catch(()=>{c.A.publish(o.GQ)}))},reject(){},get accepted(){return this._accepted},set accepted(e){this._accepted!==e&&(this._accepted=e,c.A.publish(o.Hu,{accepted:e}))}};const is={eventName:o.U7,consents:{},init(){this.storageObject=new V.A(r.AZ.htmlEmbedConsent.name,"cookie",r.AZ.htmlEmbedConsent.expires,"");const e=this.storageObject.getItems();Object.keys(e).forEach(t=>{this.consents[t]=!!e[t]})},setConsent({type:e="default",value:t=!1}){this.storageObject.getItem(e)!==t&&(this.storageObject.setItem(e,!!t),this.consents[e]=!!t,c.A.publish(o.U7,{type:e,value:!!t}))}};const ss=i(670).A.instance;const ns=p.A.instance;var as=i(342);class os{static getPodcastPlatformLinks(e){const t=[],{itunesId:i,feedUrl:s,spotifyId:n,amazonMusicId:a,youtubeMusicId:o}=e;
1return i&&t.push({id:"apple-podcasts",platform:"Apple Podcasts",link:`https://podcasts.apple.com/podcast/id${i}`},{id:"castbox",platform:"Castbox",link:`https://castbox.fm/vic/${i}`}),s&&t.push({id:"google-podcasts",platform:"Google Podcasts",link:`https://podcasts.google.com/?feed=${as.A.encodeBase64(s)}`},{id:"rss",platform:"RSS",link:s}),n&&t.push({id:"spotify",platform:"Spotify",link:`https://open.spotify.com/show/${n}`}),a&&t.push({id:"amazon-music",platform:"Amazon Music",link:`https://music.amazon.com/podcasts/${a}`}),o&&t.push({id:"youtube-music",platform:"Youtube Music",link:`https://music.youtube.com/playlist?list=${o}`}),t}}const rs=Symbol("INSTANCE"),ls=Symbol("SINGELTONENFORCER");class cs{constructor(e){if(e!==ls)throw new Error("Instantiation failed: Use OmnyStudio.instance instead of new.");this.init()}static get instance(){return this[rs]||(this[rs]=new cs(ls)),this[rs]}init(){const e=s.A.instance;e.thirdparty&&e.thirdparty.omny&&e.thirdparty.omny.apiUrl&&e.thirdparty.omny.orgId?(this.apiUrl=e.thirdparty.omny.apiUrl,this.orgId=e.thirdparty.omny.orgId,this.programs=e.thirdparty.omny.programs?e.thirdparty.omny.programs:{}):console.error("OmnyStudio requires apiUrl and orgId for correct instantiation.")}getClipByClipId(e){if(!e||"string"!=typeof e)return Promise.reject(new Error("OmnyStudio getClipByClipId - missing valid clipId function param"));const t=`${this.apiUrl}/orgs/${this.orgId}/clips/${e}`;return new Promise((i,s)=>{this.fetchUrl(t).then(t=>{if(t){const e=this.sanitizeFieldsInObject(t,["Title","Description"]);i(e)}else s(new Error(`OmnyStudio getClipByClipId - no clip found for clipId: ${e}`))}).catch(e=>s(e))})}getClipByPlaylistId(e){if(!e||"string"!=typeof e)return Promise.reject(new Error("OmnyStudio getClipByPlaylistId - missing valid playlistId function param"));const t=`${this.apiUrl}/orgs/${this.orgId}/playlists/${e}/clips/v2?pageSize=1`;return new Promise((i,s)=>{this.fetchUrl(t).then(t=>{const n=t.Clips&&Array.isArray(t.Clips)&&"undefined"!==t.Clips[0]?t.Clips[0]:void 0;if(n){const e=this.sanitizeFieldsInObject(n,["Title","Description"]);i(e)}else s(new Error(`OmnyStudio getClipByPlaylistId - no clip found for playlistId: ${e}`))}).catch(e=>s(e))})}getClipsByPlaylistId(e,t=7){if(!e||"string"!=typeof e)return Promise.reject(new Error("OmnyStudio getClipByPlaylistId - missing valid playlistId function param"));const i=`${this.apiUrl}/orgs/${this.orgId}/playlists/${e}/clips/v2?pageSize=${t}`;return new Promise((t,s)=>{this.fetchUrl(i).then(i=>{const n=i.Clips&&Array.isArray(i.Clips)&&i.Clips.length>0?i.Clips:void 0;if(n){const e=n.map(e=>this.sanitizeFieldsInObject(e,["Title","Description"]));t(e)}else s(new Error(`OmnyStudio getClipsByPlaylistId - no clips found for playlistId: ${e}`))}).catch(e=>s(e))})}getPlaylistByPlaylistId(e){if(!e||"string"!=typeof e)return Promise.reject(new Error("OmnyStudio getPlaylistByPlaylistId - missing valid playlistId function param"));const t=`${this.apiUrl}/orgs/${this.orgId}/playlists/${e}`;return new Promise((i,s)=>{this.fetchUrl(t).then(t=>{if(t){const e=this.sanitizeFieldsInObject(t,["Title","Description"]);i(e)}else s(new Error(`OmnyStudio getPlaylistByPlaylistId - no playlist found for playlistId: ${e}`))}).catch(e=>s(e))})}getPlaylistIdFromClip(e){return void 0!==e&&e.PlaylistIds&&Array.isArray(e.PlaylistIds)?e.PlaylistIds[0]:""}getProgramIdFromClip(e){return void 0!==e&&e.ProgramId?e.ProgramId:""}getProgramNameByProgramId(e){return this.programs[e]&&this.programs[e].name?this.programs[e].name:""}getPlayButtonLabelByProgramId(e){return e&&this.programs[e]&&this.programs[e].playButtonLabel?this.programs[e].playButtonLabel:"Anhören"}getReplayButtonLabelByProgramId(e){return e&&this.programs[e]&&this.programs[e].replayButtonLabel?this.programs[e].replayButtonLabel:"Erneut anhören"}getPlatformLinksByPlaylistId(e){return new Promise((t,i)=>{this.getPlaylistByPlaylistId(e).then(e=>{const i=this.getPlatformLinksByPlaylist(e);t(i)}).catch(e=>i(e))})}getPlatformLinksByClipId(e){return new Promise((t,i)=>{this.getClipByClipId(e).then(t=>{const s=this.getPlaylistIdFromClip(t);return s||i(new Error(`OmnyStudio getPlatformLinksByClipId - no playlist found for clipId: ${e}`)),cs.instance.getPlaylistByPlaylistId(s)}).then(e=>{const i=this.getPlatformLinksByPlaylist(e);t(i)}).catch(e=>i(e))})}getPlatformLinksByPlaylist(e){if(!e||!e.Id)return this.onError(),null;const t=cs.instance.getItunesIdByPlaylist(e),i=cs.instance.getSpotifyIdByPlaylist(e),s=cs.instance.getFeedUrlByPlaylist(e),n=cs.instance.getAmazonMusicIdByPlaylist(e),a=cs.instance.getYoutubeMusicIdByPlaylist(e);return os.getPodcastPlatformLinks({itunesId:t,feedUrl:s,spotifyId:i,amazonMusicId:n,youtubeMusicId:a})}getAmazonMusicIdByPlaylist(e){if(!e||!e.CustomFieldData||!e.CustomFieldData["amazon-music"])return null;const t=e.CustomFieldData["amazon-music"].match(/podcasts\/(?<amazonMusicId>[a-zA-Z0-9-]+)/);return t&&t.groups&&t.groups.amazonMusicId?t.groups.amazonMusicId:null}getYoutubeMusicIdByPlaylist(e){if(!e||!e.CustomFieldData||!e.CustomFieldData["youtube-music"])return null;const t=e.CustomFieldData["youtube-music"].match(/[?&]list=(?<youtubeMusicId>[^&#]+)/);return t&&t.groups&&t.groups.youtubeMusicId?t.groups.youtubeMusicId:null}getItunesIdByPlaylist(e){if(!e||!e.DirectoryLinks||!e.DirectoryLinks.ApplePodcasts)return null;const t=e.DirectoryLinks.ApplePodcasts.match(/id(?<itunesId>\d+)/);return t&&t.groups&&t.groups.itunesId?t.groups.itunesId:null}getSpotifyIdByPlaylist(e){if(!e||!e.DirectoryLinks||!e.DirectoryLinks.Spotify)return null;const t=e.DirectoryLinks.Spotify.match(/show\/(?<spotifyId>([A-Za-z]|\d)+)/);return t&&t.groups&&t.groups.spotifyId?t.groups.spotifyId:null}getFeedUrlByPlaylist(e){return e&&e.DirectoryLinks&&e.DirectoryLinks.RssFeed?e.DirectoryLinks.RssFeed:null}fetchUrl(e){return fetch(e,{method:"GET",headers:{"Content-Type":"text/plain"}}).then(e=>{if(200!==e.status)throw new Error(`OmnyStudio fetchUrl - failed to get data from API, URL: ${e.url}`);return e.json()}).catch(()=>{throw new Error(`OmnyStudio fetchUrl - failed to get data from API, URL: ${e}`)})}sanitizeFieldsInObject(e,t){const i={...e};
1return t.forEach(e=>{i[e]&&"string"==typeof i[e]&&(i[e]=this.sanitizeString(i[e]))}),i}sanitizeString(e){return e.replace(/[AOUaou]\u0308/g,e=>{switch(e.charCodeAt(0)){case 65:return"Ä";case 79:return"Ö";case 85:return"Ü";case 97:return"ä";case 111:return"ö";case 117:return"ü";default:return e}})}}var ds=i(833),hs=i(265);const us=Symbol("INSTANCE"),ps=Symbol("SINGELTONENFORCER"),gs="STATE_READY",ms="STATE_LOADING",ys="STATE_ERROR";class fs{constructor(e){if(e!==ps)throw new Error("Instantiation failed: Use Secretbox.instance instead of new.");this._state=ms,this._tweetnaclTimeout=null,this.key=p.A.instance.secretboxKey,this.key?this.init():this._state=ys}static get instance(){return this[us]||(this[us]=new fs(ps)),this[us]}init(){window.nacl&&window.nacl.secretbox?this.onTweetnaclSourceReady():Lt.instance.load("tweetnacl").then(()=>this.onTweetnaclSourceReady()).catch(e=>this.onTweetnaclSourceError(e))}onTweetnaclSourceReady(){this.secretbox=window.nacl.secretbox,this._state=gs,c.A.publish(o.Q_)}onTweetnaclSourceError(e){this._state=ys,console.warn(e.message)}decrypt(e){if(this.state!==gs){let e="";switch(this.state){case ys:e="Secretbox is not available";break;case ms:e="Secretbox is not yet ready";break;default:e="Secretbox has not been initialized"}return console.error(e),""}const t=(0,ds.D4)(this.key),i=(0,ds.D4)(e),s=i.slice(0,this.secretbox.nonceLength),n=i.slice(this.secretbox.nonceLength),a=this.secretbox.open(n,s,t);if(!a)return console.error("Could not decrypt message"),"";return(0,hs.D4)(a)}get ready(){return this.state===gs}get state(){return this._state}}function bs(e){e.magic("audio",t=>e.$data(t)._audio),e.directive("audio-omny",(t,{expression:i})=>{const s=e.closestDataStack(t)[0];if(!s)throw new Error("x-audio-omny could not find data stack – use x-data to define one");s._audio={isInitialized:!1,hasError:!1,clips:[],clip:{},loadData:u};const n=c.A.parseBase64Settings(i),a=(Array.isArray(n.audios)?n.audios:[]).filter(e=>function(e){const{secretboxKey:t,subscriptions:i,hasGiftArticleAccess:s,hasMeteredAccess:n}=p.A.instance;let a=!e.isEncrypted;e.isEncrypted&&t&&Array.isArray(e.subscriptions)&&e.subscriptions.forEach(e=>{a=a||s||n||i.includes(e)});return a}(e)),r=a.filter(e=>e.isEncrypted).length>0;function d(){const e=fs.instance;a.forEach(t=>{t.isEncrypted&&t.omnystudioClipId&&(t.omnystudioClipId=e.decrypt(t.omnystudioClipId)),t.isEncrypted&&t.omnystudioPlaylistId&&(t.omnystudioPlaylistId=e.decrypt(t.omnystudioPlaylistId))}),h()}function h(){s._audio.isInitialized=!0,t.dispatchEvent(new CustomEvent("audio-omny-initialized")),n.autoload&&u()}function u(){return s._audio.isInitialized?new Promise((e,i)=>{Promise.all(a.map(e=>{return e.omnystudioPlaylistId?(t=e.omnystudioPlaylistId,new Promise((e,i)=>{const s={};cs.instance.getClipByPlaylistId(t).then(e=>(s.clip=e,cs.instance.getPlaylistByPlaylistId(t))).then(t=>{s.playlist=t,e(s)}).catch(e=>i(e))})):e.omnystudioClipId?(i=e.omnystudioClipId,new Promise((e,t)=>{const s={};cs.instance.getClipByClipId(i).then(t=>(s.clip=t,s.playlistId=cs.instance.getPlaylistIdFromClip(t),s.programId=cs.instance.getProgramIdFromClip(t),s.playlistId||(s.programName=s.programId?cs.instance.getProgramNameByProgramId(s.programId):"",e(s)),cs.instance.getPlaylistByPlaylistId(s.playlistId))).then(t=>{s.playlist=t,e(s)}).catch(e=>t(e))})):Promise.resolve(null);var t,i})).then(a=>{const o=[];if(Array.isArray(a)&&a.forEach(e=>{if(e){const t=function(e){if(!e.clip)return null;const t=n.posterSize||"small";let i=null;e.clip.ImageUrl?(i=new URL(e.clip.ImageUrl),i.searchParams.set("size",t)):e.playlist&&e.playlist.ArtworkUrl&&(i=new URL(e.playlist.ArtworkUrl),i.searchParams.set("size",t));const s=[];e.playlist&&e.playlist.DirectoryLinks&&Object.keys(e.playlist.DirectoryLinks).forEach(t=>{if(e.playlist.DirectoryLinks[t])switch(t){case"ApplePodcasts":{const t=e.playlist.DirectoryLinks.ApplePodcasts;-1===t.indexOf("https://podcasts.apple.com/")&&-1===t.indexOf("https://geo.itunes.apple.com/")||s.push({id:"apple-podcasts",service:t});break}case"GooglePodcasts":{const t=e.playlist.DirectoryLinks.GooglePodcasts;t&&s.push({id:"google-podcasts",service:t});break}case"Spotify":{const t=e.playlist.DirectoryLinks.Spotify;-1!==t.indexOf("https://open.spotify.com/")&&s.push({id:"spotify",service:t});break}case"Stitcher":{const t=e.playlist.DirectoryLinks.Stitcher;-1!==t.indexOf("https://castbox.fm/")&&s.push({id:"castbox",service:t});break}case"TuneIn":case"GooglePlay":default:break;case"RssFeed":{const t=e.playlist.DirectoryLinks.RssFeed;t&&s.push({id:"rss",service:t});break}}});s.find(e=>"apple-podcasts"===e.id)||s.push({id:"apple-podcasts",service:""});const a=[];
1Array.isArray(e.clip.Chapters)&&e.clip.Chapters.forEach(e=>{const t=("string"==typeof e.Position?e.Position:"").match(/(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})\.?(?<fraction>\d+)?/);if(!t||!t.groups)return;const{hours:i,minutes:s,seconds:n,fraction:o}=t.groups,r=60*("string"==typeof i?parseInt(i,10):0)*60+60*("string"==typeof s?parseInt(s,10):0)+("string"==typeof n?parseInt(n,10):0)+("string"==typeof o?parseFloat(`0.${o}`):0);a.push({position:r,title:e.Name?e.Name:""})});return{id:e.clip.Id?e.clip.Id:"",audioUrl:g(e.clip),autoplayUrl:m(e.clip),resumeUrl:y(e.clip),downloadUrl:f(e.clip),posterUrl:i?i.href:"",clients:s,duration:e.clip.DurationSeconds?Math.round(1e3*e.clip.DurationSeconds):-1,headline:e.clip.Title?e.clip.Title:"",kicker:e.playlist&&e.playlist.Title?e.playlist.Title:e.programName?e.programName:"",flags:b(e.clip.Id),playButtonLabel:cs.instance.getPlayButtonLabelByProgramId(e.programId),replayButtonLabel:cs.instance.getReplayButtonLabelByProgramId(e.programId),articleId:e.clip.Id?A(e.clip.Id):"",playlistId:cs.instance.getPlaylistIdFromClip(e.clip),chapters:a}}(e);t&&o.push(t)}}),0===o.length){const e=new Error("Error while fetching and parsing Omny data.");console.error(e.message),s._audio.hasError=!0,i(e)}s._audio.clips=o,s._audio.clip=o[0]||{},t.dispatchEvent(new CustomEvent("audio-omny-loaded")),e()}).catch(e=>{console.error(e.message),s._audio.hasError=!0,t.dispatchEvent(new CustomEvent("audio-omny-error")),i(e)})}):Promise.reject(new Error("x-audio-omny audioLoadData() function called too early – audio is not initialized"))}function g(e){if(!e.MediaUrls?.AudioUrl)return"";const t=new URL(e.MediaUrls.AudioUrl);if(p.A.instance.hasNoAdsAccess&&t.searchParams.set("ttag","offer:pur"),e.ModifiedAtUtc){const i=new Date(e.ModifiedAtUtc);i instanceof Date&&!Number.isNaN(i)&&!Number.isNaN(i.getTime())&&t.searchParams.set("d",i.getTime())}return l.A.isIOSApp?t.searchParams.set("utm_source","CustomPlayer3"):l.A.isAndroidApp?t.searchParams.set("utm_source","CustomPlayer4"):t.searchParams.set("utm_source","CustomPlayer1"),t.href}function m(e){if(!e.MediaUrls?.AudioUrl)return"";const t=new URL(e.MediaUrls.AudioUrl);if(p.A.instance.hasNoAdsAccess&&t.searchParams.set("ttag","offer:pur"),e.ModifiedAtUtc){const i=new Date(e.ModifiedAtUtc);i instanceof Date&&!Number.isNaN(i)&&!Number.isNaN(i.getTime())&&t.searchParams.set("d",i.getTime())}return t.searchParams.set("utm_source","CustomPlayer10"),t.href}function y(e){if(!e.MediaUrls?.AudioUrl)return"";const t=new URL(e.MediaUrls.AudioUrl);if(p.A.instance.hasNoAdsAccess&&t.searchParams.set("ttag","offer:pur"),e.ModifiedAtUtc){const i=new Date(e.ModifiedAtUtc);i instanceof Date&&!Number.isNaN(i)&&!Number.isNaN(i.getTime())&&t.searchParams.set("d",i.getTime())}return t.searchParams.set("utm_source","CustomPlayer11"),t.href}function f(e){if(!e.MediaUrls?.AudioUrl)return"";const t=new URL(e.MediaUrls.AudioUrl);if(p.A.instance.hasNoAdsAccess&&t.searchParams.set("ttag","offer:pur"),e.ModifiedAtUtc){const i=new Date(e.ModifiedAtUtc);i instanceof Date&&!Number.isNaN(i)&&!Number.isNaN(i.getTime())&&t.searchParams.set("d",i.getTime())}return l.A.isIOSApp?t.searchParams.set("utm_source","CustomPlayer8"):l.A.isAndroidApp?t.searchParams.set("utm_source","CustomPlayer9"):t.searchParams.set("utm_source","CustomPlayer2"),t.searchParams.set("download","true"),t.href}function b(e){const t=[];return a.forEach(i=>{i.omnystudioClipId===e&&Array.isArray(i.flags)&&i.flags.forEach(e=>{const i=e.replace(/-(paid|conditional)/g,"");t.push(i)})}),t}function A(e){let t="";return a.forEach(i=>{i.omnystudioClipId===e&&i.articleId&&(t=i.articleId)}),t}0===a.length||r&&!p.A.instance.secretboxKey||(r?fs.instance.ready?d():c.A.subscribe(o.Q_,d,this):h())})}function As(e){const t=["resize","track","login","logout","register"],i=["getUserId"],s=(e,t,s)=>{if(!e?.src)return;if(!t)return;if(!i.includes(t))return;let n;try{n=new URL(e.src).origin}catch(e){return}const a=JSON.stringify({event:t,payload:s});e.contentWindow.postMessage(a,n)};e.directive("embed-bridge-message",(n,{expression:a},{evaluateLater:o,cleanup:r})=>{const l=o(a),c=a=>{let o,r=a.data;try{o=new URL(n.src).origin}catch(e){return}if(a.origin===o&&a.source===n.contentWindow){try{r=JSON.parse(r)}catch(e){return}if(t.includes(r.event)||i.includes(r.event)){if("getUserId"===r.event){const t=e.store("User"),i=t?.isLoggedIn?t.userId:"";return void s(n,r.event,i)}l(()=>{},{scope:{$message:r}})}}};window.addEventListener("message",c),r(()=>{window.removeEventListener("message",c)})}),e.directive("embed-bridge-handler",(n,a,{cleanup:o})=>{const r=a=>
1{Array.from(n.querySelectorAll("iframe")).forEach(n=>{if(!n.src)return;let o,r;try{o=new URL(n.src).origin}catch(e){return}if(a.origin===o&&a.source===n.contentWindow){try{r=JSON.parse(a.data)}catch(e){return}if(t.includes(r.event)||i.includes(r.event))if("track"!==r.event)if("login"!==r.event)if("logout"!==r.event)if("register"!==r.event){if("getUserId"===r.event){const t=e.store("User"),i=t?.isLoggedIn?t.userId:"";return void s(n,r.event,i)}"resize"===r.event&&"number"==typeof r.height&&n.style.height!==`${r.height}px`&&(n.setAttribute("scrolling","no"),n.style.overflow="hidden",n.style.height=`${r.height}px`)}else window.polygon?.componentLoader?.publish&&window.polygon.componentLoader.publish("TRIGGER_REGISTER",{targetUrl:r.targetUrl});else window.polygon?.componentLoader?.publish&&window.polygon.componentLoader.publish("TRIGGER_LOGOUT");else window.polygon?.componentLoader?.publish&&window.polygon.componentLoader.publish("TRIGGER_LOGIN",{targetUrl:r.targetUrl});else window.polygon?.componentLoader?.publish&&r.payload&&window.polygon.componentLoader.publish("SARAS_PUSH_DATA",r.payload)}})};window.addEventListener("message",r),o(()=>{window.removeEventListener("message",r)})})}function ws(e){if(l.A.isApp){Array.from(document.querySelectorAll("[x-app-ignore]")).forEach(e=>{e.setAttribute("x-ignore","")})}}var Is=i(533);function vs(e){document.addEventListener("alpine:init",()=>{Array.from(document.querySelectorAll("[x-lazyload]")).forEach(e=>{e.setAttribute("x-ignore","")});const t=new(Ze())({elements_selector:"[x-lazyload]",use_native:!1,unobserve_entered:!0,unobserve_completed:!0,callback_enter:t=>{t.removeAttribute("x-ignore"),"function"==typeof e.nextTick&&"function"==typeof e.initTree&&e.nextTick(()=>e.initTree(t))}});c.A.subscribe(o.ph,()=>{t&&"function"==typeof t.update&&t.update()})})}class Es{static formatTime(e){if(!e||"number"!=typeof e)return"0:00";return`${Math.floor(e/60)}:${`${Math.floor(e%60)}`.padStart(2,"0")}`}static formatDate(e){if(!e)return"Ungültiges Datum";const t=new Date(e);if(Number.isNaN(t.getTime()))return"Ungültiges Datum";return t.toLocaleDateString("de-DE",{hour:"2-digit",minute:"2-digit",hour12:!1,weekday:"long",day:"numeric",month:"long",year:"numeric"})}}var Ps=i(764);const Ss=Symbol("INSTANCE"),ks=Symbol("SINGELTONENFORCER");class Cs{constructor(e){if(e!==ks)throw new Error("Instantiation failed: Use SmartfeedAPI.instance instead of new.");this.init()}static get instance(){return this[Ss]||(this[Ss]=new Cs(ks)),this[Ss]}init(){const e=s.A.instance;e.thirdparty?.smartfeed?.apiUrl?this.apiUrl=e.thirdparty.smartfeed.apiUrl:console.error("SmartfeedAPI requires base api url for correct instantiation.")}getTeasersByDomain({domain:e="",sortBy:t="newest",pageSize:i=10,cursor:s=1,cluster:n=""}){if(!e)return Promise.reject(new Error("SmartfeedAPI getTeasersByDomain - missing required param `domain`"));let a=`${this.apiUrl}/domains/${e}/teasers/`;return t&&(a+=`sortby${t}/`),i&&(a+=`pagesize${i}/`),s>1&&(a+=`cursor${s}/`),n&&(a+=`cluster${n}/`),this.fetchUrl(a).then(t=>{const i=t?.teasers;if(!Array.isArray(i))throw new Error(`SmartfeedAPI getTeasersByDomain - no data found for domain: ${e}`);return i})}
1getTeasersByChannel({channel:e="",subchannel:t="",sortBy:i="newest",pageSize:s=10,cursor:n=1,cluster:a=""}){if(!e)return Promise.reject(new Error("SmartfeedAPI getTeasersByChannel - missing required param `channel`"));let o=`${this.apiUrl}/channels/${e}/`;return t&&(o+=`subchannels/${t}/`),o+="teasers/",i&&(o+=`sortby${i}/`),s&&(o+=`pagesize${s}/`),n>1&&(o+=`cursor${n}/`),a&&(o+=`cluster${a}/`),this.fetchUrl(o).then(t=>{const i=t?.teasers;if(!Array.isArray(i))throw new Error(`SmartfeedAPI getTeasersByChannel - no data found for channel: ${e}`);return i})}getTeasersByStyle({style:e="",sortBy:t="newest",pageSize:i=10,cursor:s=1,cluster:n=""}){if(!e)return Promise.reject(new Error("SmartfeedAPI getTeasersByStyle - missing required param `style`"));let a=`${this.apiUrl}/styles/${e}/teasers/`;return t&&(a+=`sortby${t}/`),i&&(a+=`pagesize${i}/`),s>1&&(a+=`cursor${s}/`),n&&(a+=`cluster${n}/`),this.fetchUrl(a).then(t=>{const i=t?.teasers;if(!Array.isArray(i))throw new Error(`SmartfeedAPI getTeasersByStyle - no data found for style: ${e}`);return i})}fetchUrl(e){return fetch(e,{method:"GET",headers:{"Content-Type":"text/plain"}}).then(e=>{if(200!==e.status)throw new Error(`SmartfeedAPI fetchUrl - failed to get data from API, URL: ${e.url}`);return e.json()}).catch(()=>{throw new Error(`SmartfeedAPI fetchUrl - failed to get data from API, URL: ${e}`)})}}const _s=Symbol("INSTANCE"),Ls=Symbol("SINGELTONENFORCER");class Ts{constructor(e){if(e!==Ls)throw new Error("Instantiation failed: Use TickarooAPI.instance instead of new.");this.init()}static get instance(){return this[_s]||(this[_s]=new Ts(Ls)),this[_s]}init(){const e=s.A.instance;this.apiUrl=e.thirdparty?.tickaroo?.apiUrl,this.clientId=e.thirdparty?.tickaroo?.clientId,this.apiUrl&&this.clientId||console.error("TickarooAPI requires apiUrl and clientId for correct instantiation.")}getHighlightPostsByLiveblogId({liveblogId:e,limit:t=5,reverse:i=!1}){return new Promise((s,n)=>{e&&"string"==typeof e||n(new Error("TickarooAPI getHighlightPostsByLiveblogId - missing valid liveblogId function param"));const a=new URL(`${this.apiUrl}/api/v6/ticker/show.json`);a.searchParams.set("id",e),a.searchParams.set("client_id",this.clientId),a.searchParams.set("limit",t),a.searchParams.set("reverse",i),a.searchParams.set("highlights","inplace"),this.fetchUrl(a.href).then(t=>{if(Array.isArray(t?.events)){const e=[];t?.events.forEach(t=>{if(!t.contents||!t.contents[0]?.text)return;const i=t.contents[0].text.match(/<h2[^>]*>(?<headline>[\s\S]+?)<\/h2>/);if(!i.groups?.headline||!t.created_at)return;const s=i.groups.headline.replaceAll(/<[^>]+>/g,"");e.unshift({headline:s,createdAt:t.created_at||0})}),e.sort((e,t)=>t.createdAt-e.createdAt),s(e)}else n(new Error(`TickarooAPI getHighlightPostsByLiveblogId - no posts found for liveblogId: ${e}`))}).catch(e=>n(e))})}fetchUrl(e){return fetch(e,{method:"GET",headers:{"Content-Type":"text/plain"}}).then(e=>200!==e.status?Promise.reject(new Error(`TickarooAPI fetchUrl - failed to get data from API, URL: ${e.url}`)):e.json())}}const Os=Symbol("INSTANCE"),xs=Symbol("SINGLETON_ENFORCER");class Ns{constructor(e){if(e!==xs)throw new Error("Instantiation failed: Use SmartArticleService.instance instead of new.");this.init()}static get instance(){return this[Os]||(this[Os]=new Ns(xs)),this[Os]}init(){const e=s.A.instance;this.apiUrl=e?.thirdparty?.smartArticle?.apiUrl,this.apiUrl||console.error("SmartArticleService requires apiUrl")}sanitizeSummaryHtml(e){if(!e)return"";const t=["p","ul","li","br"];return e.replace(/<\/?([^>\s/]+)([^>]*)>/gi,(e,i)=>{const s=i.toLowerCase();return t.includes(s)?"br"===s?"<br>":e.startsWith("</")?`</${s}>`:`<${s}>`:""})}getSummary(e){const t=p.A.instance.smartArticleTargetUid;if(!e)return Promise.reject(new Error("SmartArticleService getSummary - missing articleId"));if(!t)return Promise.reject(new Error("SmartArticleService getSummary - user not eligible for SmartArticle"));const i=new URL(`${e}/${t}/summary.json`,`${this.apiUrl}/`);return this.fetchJson(i.href).then(e=>{const t="string"==typeof e?.data?.content?e.data.content:"",i=t?this.sanitizeSummaryHtml(t):"";return{title:"string"==typeof e?.data?.title?e.data.title:"Zusammenfassung",links:e?.links||{},summary:i}})}fetchJson(e){return fetch(e,{method:"GET",headers:{"Content-Type":"text/plain"}}).then(e=>200!==e.status?e.text().then(e=>{throw new Error(e)}).catch(t=>Promise.reject(new Error(`SmartArticleService fetchJson - failed to get data from API, URL: ${e.url}, error: ${t.message}`))):e.json())}}const Us=Symbol("INSTANCE"),Bs=Symbol("SINGELTONENFORCER"),Rs=["article","recipe"];class Ms{constructor(e){if(e!==Bs)throw new Error("Instantiation failed: Use Sophi.instance instead of new.")}static get instance(){return this[Us]||(this[Us]=new Ms(Bs)),this[Us]}init(){this.isInitialized||(this.isInitialized=!0,p.A.instance.hasNoAdsAccess||(this.initSophi(),this.addNotificationCallbacks(),c.A.subscribe(o.wZ,this.onPageResume,this)))}initSophi(){window.sophi=window.sophi||{},window.sophi.demeter={actions:[]},window.demeter=window.demeter||function(...e){let t,i;const s=new Promise((e,s)=>{t=e,i=s});return window.sophi.demeter.actions.push([e,t,i]),s},l.A.isApp&&(window.sophiAppContext={deviceType:"native",isConsented:!0})}addNotificationCallbacks(){if("function"!=typeof window.demeter)return;const{visitorType:e}=this;if(window.demeter("userProperties",{args:{visitorType:e}}),"none"!==this.wallType){const{wallType:e,section:t}=this;window.demeter("wall",{args:{wallType:e,section:t}})}else{const{isArticle:e,section:t}=this;window.demeter("pageview",{args:{article:e,section:t}})}}get wallType(){const{paywall:e}=s.A.instance;return!!e?.attributes?.is_active?"paywall":"none"}get isArticle(){return Rs.includes($.A.instance.route)}get section(){return s.A.instance.page&&s.A.instance.page.attributes?s.A.instance.page.attributes.channel_slug:void 0}get visitorType(){return p.A.instance.hasPaidAccess?"subscriber":p.A.instance.isLoggedIn?"registered":"anonymous"}onPageResume(e={}){"app"===e?.platform&&this.addNotificationCallbacks()}}function Ds(e){e.magic("focus",t=>i=>{const s=i||t;return e.nextTick(()=>s.focus())});let t=null,i=null,n=null;e.magic("getPodcastPlatformLinks",()=>async({playlistId:e,clipId:s})=>{if(e&&e===t&&n||!e&&s&&s===i&&n)return n;t=null,i=null,n=null;try{e?(t=e,n=await cs.instance.getPlatformLinksByPlaylistId(e)):s&&(i=s,n=await cs.instance.getPlatformLinksByClipId(s))}catch(e){console.warn(`$getPodcastPlatformLinks error: ${e.message}`)}return n}),e.magic("cooldown",t=>(i,s)=>new Promise(n=>{const a=Number.isInteger(i)?i:2e3,o=e.$data(t);t.setAttribute("disabled",!0),s&&(o[s]=!0),window.setTimeout(()=>{t.removeAttribute("disabled"),s&&(o[s]=!1),n()},a)})),e.magic("deepclone",()=>e=>{try{return JSON.parse(JSON.stringify(e))}catch(t){return e}}),e.magic("searchParams",()=>new URLSearchParams(window.location.search)),e.magic("tcfv2Purposes",()=>r.cg),e.magic("waitForConsent",()=>_),e.magic("waitForCustomVendorConsents",()=>L),e.magic("arePurposeIdsVerified",()=>k),e.magic("adBridge",()=>B.instance);let a=null;e.magic("adTagBuilder",()=>a||(a=new Ri,a)),e.magic("appBridge",()=>H.A.instance),e.magic("appUtils",()=>l.A),e.magic("arrayUtils",()=>oi),e.magic("browserHistory",()=>Oi.instance),e.magic("cookieStorageHelper",()=>d.A),e.magic("dateUtils",()=>Es),e.magic("jwPlayerDeliveryAPI",()=>Bi.instance),e.magic("meteredService",()=>Ps.A.instance),e.magic("notificationService",()=>W.A.instance),e.magic("omnyStudio",()=>cs.instance),e.magic("RECO",()=>Vi.instance),e.magic("scriptUtils",()=>Lt.instance),e.magic("settings",()=>s.A.instance),e.magic("smartfeedAPI",()=>Cs.instance),e.magic("sophi",()=>Ms.instance),e.magic("bookmarks",()=>z.instance),e.magic("siteSearchAPI",()=>gi.instance),e.magic("SARAs",()=>zt.instance),e.magic("storageObject",()=>V.A),e.magic("teaserFactory",()=>ci.instance),e.magic("tickarooAPI",()=>Ts.instance),e.magic("smartArticle",()=>Ns.instance),e.magic("userAgentUtils",()=>g.A),e.magic("webUtils",()=>Ie.A),e.magic("route",()=>$.A.instance)}function $s(e){e.magic("sendMessage",()=>(...e)=>{const t=e.shift(),i=yt.instance;if(i&&i.messageLookup&&i.messageLookup[t]){const s=new i.messageLookup[t](...e);s&&c.A.publish(o.pN,s)}})}function Vs(e){e.magic("publish",()=>(e,...t)=>{window.polygon&&window.polygon.componentLoader&&"function"==typeof window.polygon.componentLoader.publish&&window.polygon.componentLoader.publish(e,...t)}),e.magic("subscribe",()=>(e,t,i)=>{window.polygon&&window.polygon.componentLoader&&"function"==typeof window.polygon.componentLoader.subscribe&&window.polygon.componentLoader.subscribe(e,t,i)}),e.magic("unsubscribe",()=>(e,t)=>{window.polygon&&window.polygon.componentLoader&&"function"==typeof window.polygon.componentLoader.unsubscribe&&window.polygon.componentLoader.unsubscribe(e,t)}),e.directive("subscribe",(e,{modifiers:t,expression:i},{evaluateLater:s,cleanup:n})=>{if(!(Array.isArray(t)&&0!==t.length&&i&&window.polygon&&window.polygon.componentLoader&&"function"==typeof window.polygon.componentLoader.subscribe&&"function"==typeof window.polygon.componentLoader.unsubscribe))return;const a=t[0].toUpperCase(),o=s(i),r=(...e)=>{o(()=>{},{scope:{$payload:e,$topic:a}})};window.polygon.componentLoader.subscribe(a,r),n(()=>{window.polygon.componentLoader.unsubscribe(a,r)})})}
1var Fs=i(612),js=i(555),zs=i(998),qs=i(385),Ws=i(698);function Gs(e,t,i){if(!(e instanceof Element&&t))return;const s=`swiper-${ei.kebabCase(t)}`,n=new CustomEvent(s,{bubbles:!0,detail:i});e.dispatchEvent(n)}function Hs(e){e.magic("swiper",t=>e.$data(t)._swiper),e.directive("swiper",(t,{expression:i},{evaluate:s,cleanup:n})=>{const a=e.closestDataStack(t)[0];if(!a)throw new Error("x-swiper could not find data stack – use x-data to define one");a._swiper&&"function"==typeof a._swiper.destroy&&a._swiper.destroy();const o=t.querySelector(".polygon-swiper")||t,r=t.querySelector(".polygon-swiper-button-prev"),l=t.querySelector(".polygon-swiper-button-next"),c=t.querySelector(".polygon-swiper-pagination"),d={containerModifierClass:"polygon-swiper-",slideClass:"polygon-swiper-slide",slideActiveClass:"polygon-swiper-slide-active",slideDuplicateActiveClass:"polygon-swiper-slide-duplicate-active",slideVisibleClass:"polygon-swiper-slide-visible",slideDuplicateClass:"polygon-swiper-slide-duplicate",slideNextClass:"polygon-swiper-button-next",slideDuplicateNextClass:"polygon-swiper-slide-duplicate-next",slidePrevClass:"polygon-swiper-button-prev",slideDuplicatePrevClass:"polygon-swiper-slide-duplicate-prev",wrapperClass:"polygon-swiper-wrapper",buttonDisabledClass:"polygon-swiper-button-disabled",noSwipingClass:"polygon-swiper-no-swiping",lazyLoadingClass:"polygon-swiper-lazy",lazyStatusLoadingClass:"polygon-swiper-lazy-loading",lazyStatusLoadedClass:"polygon-swiper-lazy-loaded",lazyPreloaderClass:"polygon-swiper-lazy-preloader",notificationClass:"polygon-swiper-notification",zoomContainerClass:"polygon-swiper-zoom-container",modules:[js.A,zs.A,qs.A,Ws.A],navigation:{prevEl:r,nextEl:l,disabledClass:"hidden"},pagination:{el:c,bulletClass:"rounded-circle w-8 h-8 bg-white opacity-moderate mr-6",bulletActiveClass:"pol
1ygon-swiper-pagination-bullet-active [&.polygon-swiper-pagination-bullet-active]:opacity-full",clickableClass:"polygon-swiper-pagination-clickable",currentClass:"polygon-swiper-pagination-current",hiddenClass:"polygon-swiper-pagination-hidden",horizontalClass:"polygon-swiper-pagination-horizontal",lockClass:"polygon-swiper-pagination-lock",modifierClass:"polygon-swiper-pagination-",paginationDisabledClass:"polygon-swiper-pagination-disabled",progressbarFillClass:"polygon-swiper-pagination-progressbar-fill",progressbarOppositeClass:"polygon-swiper-pagination-progressbar-opposite",totalClass:"polygon-swiper-pagination-total",verticalClass:"polygon-swiper-pagination-vertical"},on:{init(){e.nextTick(()=>Gs(o,"init"),0)}},threshold:12},h=s(i);Object.keys(h).forEach(e=>{const t=d[e],i=h[e];d[e]="object"==typeof t&&"object"==typeof i?{...t,...i}:i}),a._swiper=new Fs.A(o,d),a._swiper.onAny((e,t,...i)=>{Gs(o,e,i)}),n(()=>{a._swiper&&(a._swiper.destroy(),delete a._swiper)})})}function Js(e){const t={};e.directive("unique",(e,{expression:i})=>{i&&(t[i]=t[i]+1||1,t[i]>1&&e.remove())})}window.polygon=window.polygon||{};const Zs=new class{constructor(e={},t={}){const i={contextEl:document,prefix:""};this.options=Object.assign({},i,t),this.initializedComponents={},this.numberOfInitializedComponents=0,this.components={},this.topics={},this._queuedScans=0,this._isScanning=!1,this.register(e)}register(e={}){Object.keys(e).forEach(t=>{this.components[t]=e[t]})}unregister(e){delete this.components[e]}subscribe(e,t,i){this.topics.hasOwnProperty(e)||(this.topics[e]=[]),this.topics[e].push({context:i,callback:t})}unsubscribe(e,t,i){if(!this.topics.hasOwnProperty(e))return!1;for(let s=0,n=this.topics[e].length;s<n;s++)if(this.topics[e][s].callback===t&&(!i||this.topics[e][s].context===i))return this.topics[e].splice(s,1),!0;return!1}publish(e){if(!this.topics.hasOwnProperty(e))return!1;const t=new Array(arguments.length-1);for(var i=0;i<t.length;++i)t[i]=arguments[i+1];for(let i=0,s=this.topics[e].length;i<s;i++){let s=this.topics[e][i];s&&s.callback&&s.callback.apply(s.context,t)}return!0}scan(e={}){if(this._isScanning)return void(this._queuedScans+=1);this._isScanning=!0;const t={},i=this.options.contextEl.querySelectorAll(`[data-${this.options.prefix}component]`);[].forEach.call(i,i=>{this._scanElement(i,t,e)}),this.numberOfInitializedComponents>0&&this.cleanUp_(t),this._isScanning=!1,this._queuedScans>0?(this._queuedScans-=1,this.scan()):this.publish(o.Zk)}_scanElement(e,t,i){let s=e.getAttribute(`data-${this.options.prefix}component-id`);s||(s=this._generateUUID(),e.setAttribute(`data-${this.options.prefix}component-id`,s));e.getAttribute(`data-${this.options.prefix}component`).match(/\S+/g).forEach(n=>{const a=`${n}-${s}`;t[a]=!0,this.initializedComponents[a]||this._initializeComponent(n,a,e,i)})}_initializeComponent(e,t,i,s){const n=this.components[e];if("function"!=typeof n)return void(window.console&&window.console.warn&&window.console.warn(`ComponentLoader: unknown component '${e}'`));let a=new n(i,s,this);this.initializedComponents[t]=a,this.numberOfInitializedComponents++}_destroyComponent(e){const t=this.initializedComponents[e];t&&"function"==typeof t.destroy&&t.destroy(),delete this.initializedComponents[e],this.numberOfInitializedComponents--}cleanUp_(e={}){Object.keys(this.initializedComponents).forEach(t=>{e[t]||this._destroyComponent(t)})}_generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})}}({BookmarksCardsSlider:class extends ai{constructor(...e){super(...e),p.A.instance.isLoggedIn&&(this.dataSettings=this.data.settings?JSON.parse(this.data.settings):{},this.collection=this.dataSettings.collection,this.documentIds=[],this.teaserLookup={},this.bookmarks=z.instance,this.content=this.el.querySelector('[data-bookmarkscardsslider-el="content"]'),this.teaserlist=this.el.querySelector('[data-bookmarkscardsslider-el="teaserlist"]'),this.loader=this.el.querySelector('[data-bookmarkscardsslider-el="loader"]'),this.loaderOverlay=this.el.querySelector('[data-bookmarkscardsslider-el="loader-overlay"]'),this.emptyState=this.el.querySelector('[data-bookmarkscardsslider-el="emptyState"]'),this.error=this.el.querySelector('[data-bookmarkscardsslider-el="error"]'),this.state=mi,this.subscribe(o.Bb,this.onBookmarksError),this.bookmarks.isInitialized?this.init():this.subscribe(o.n8,this.init))}init(){this.subscribe(o.Gr,()=>this.refresh()),this.subscribe(o.XH,()=>this.refresh()),this.subscribe(o.sK,()=>
1this.refresh()),this.subscribe(o.OL,()=>this.refresh()),this.refresh()}onBookmarksError(e){e&&e.collection&&e.collection!==this.collection||(!e||e.type!==r.Yj&&e.type!==r.qd?this.state!==bi&&(this.state=fi):this.refresh())}refresh(){const e=this.bookmarks.documentIdsByCollection[this.collection]||[],t=e.length,i=e.length>3?e.length-3:0,s=e.slice(i,t);if(s.reverse(),oi.isEqual(s,this.documentIds)&&this.state===bi)return Promise.resolve();this.state=mi,this.documentIds=s;const n=this.documentIds.filter(e=>!this.teaserLookup[e]);return 0===n.length?(this.updateView(),Promise.resolve()):gi.instance.getTeasersByIds(n).then(e=>e.success?(Array.isArray(e.teasers)&&e.teasers.length&&e.teasers.forEach(e=>{if(!e.id)return;const t={...e};this.dataSettings.fallbackImageSrc&&(t.imageSrc=this.dataSettings.fallbackImageSrc),this.teaserLookup[t.id]=t}),this.updateView(),Promise.resolve()):n.length<this.documentIds.length?(this.updateView(),Promise.resolve()):(this.state=fi,Promise.reject()))}updateView(){const e=this.documentIds.filter(e=>!this.teaserLookup[e]),t=this.documentIds&&this.documentIds.length&&e.length<this.documentIds.length;this.state=t?bi:yi,this.renderTeasers()}renderTeasers(){this.teaserlist.innerHTML="",this.documentIds.forEach((e,t)=>{const i=this.teaserLookup[e];if(!i)return;const s={...i},n=t===this.documentIds.length-1;s.additionalClassesString=n?"lg:mx-24 md:mx-24 sm:mx-16":"lg:ml-24 md:ml-24 sm:ml-16";const a=ci.instance.create(s,r.aj);a&&this.teaserlist.append(a)}),this.publish(o.ph),this.scan(),this.updateSwiper()}updateSwiper(){const e=this.el.querySelector('[data-bookmarkscardsslider-el="swiper"]');e&&e.swiper&&"function"==typeof e.swiper.update&&e.swiper.update()}get state(){return this._state||(this._state=bi),this._state}set state(e){switch(this._state=e,e){case mi:c.A.toggleElementVisibility(this.content,!0),c.A.toggleElementVisibility(this.loader,!0),c.A.toggleElementVisibility(this.loaderOverlay,this.teaserlist.hasChildNodes()),c.A.toggleElementVisibility(this.emptyState,!1),c.A.toggleElementVisibility(this.error,!1);break;case yi:c.A.toggleElementVisibility(this.content,!1),c.A.toggleElementVisibility(this.loader,!1),c.A.toggleElementVisibility(this.emptyState,!0),c.A.toggleElementVisibility(this.error,!1);break;case fi:c.A.toggleElementVisibility(this.content,!1),c.A.toggleElementVisibility(this.loader,!1),c.A.toggleElementVisibility(this.emptyState,!1),c.A.toggleElementVisibility(this.error,!0);break;default:c.A.toggleElementVisibility(this.content,!0),c.A.toggleElementVisibility(this.loader,!1),c.A.toggleElementVisibility(this.emptyState,!1),c.A.toggleElementVisibility(this.error,!1)}}},BookmarkButton:class extends ai{constructor(...e){super(...e),this.settings=this.data.settings?JSON.parse(this.data.settings):{},this.documentId=this.settings.documentId,this.collection=this.settings.collection,this.documentId&&this.collection?(this.bookmarks=z.instance,this.iconInactive=this.el.querySelector('[data-bookmark-button-el="icon-inactive"]'),this.iconActive=this.el.querySelector('[data-bookmark-button-el="icon-active"]'),this.label=this.el.querySelector('[data-bookmark-button-el="label"]'),this.boundOnClick=e=>this.onClick(e),this.init()):c.A.toggleElementVisibility(this.el,!1)}init(){this.state=this.bookmarks.contains(this.documentId,this.collection)?Ai:wi,this.subscribe(o.Gr,this.onBookmarkAdded),this.subscribe(o.XH,this.onBookmarkDeleted),this.subscribe(o.sK,this.onAllBookmarksDeleted),this.subscribe(o.O
1L,this.onBookmarksUpdated),this.subscribe(o.Bb,this.onBookmarksError),this.el.addEventListener("click",this.boundOnClick)}onClick(e){if("function"==typeof e.stopPropagation&&e.stopPropagation(),this.el.hasAttribute("disabled"))return;const t=this.state===wi?o.HE:o.ZO;this.publish(t,this.documentId,this.collection),this.state=this.state===wi&&p.A.instance.isLoggedIn?Ai:wi,this.el.setAttribute("disabled",""),setTimeout(()=>{this.el.removeAttribute("disabled")},200)}onBookmarkAdded(e,t){this.documentId===e&&this.collection===t&&this.state!==Ai&&(this.state=Ai)}onBookmarkDeleted(e,t){this.documentId===e&&this.collection===t&&this.state!==wi&&(this.state=wi)}onAllBookmarksDeleted(e){this.collection===e&&this.state!==wi&&(this.state=wi)}onBookmarksUpdated(){this.refreshState()}onBookmarksError(e){!e||e.type!==r.Yj&&e.type!==r.qd||e.documentId!==this.documentId||e.collection!==this.collection||this.refreshState()}refreshState(){this.state=this.bookmarks.contains(this.documentId,this.collection)?Ai:wi}get labelText(){let e="";return this.state===Ai?e=s.A.instance?.translations?.bookmarkButton?.labelDelete:this.state===wi&&(e=s.A.instance?.translations?.bookmarkButton?.labelAdd),e||"Zur Merkliste hinzufügen"}get state(){return this._state||(this._state=wi),this._state}set state(e){e===Ai?(this._state=Ai,c.A.toggleElementVisibility(this.iconInactive,!1),c.A.toggleElementVisibility(this.iconActive,!0)):(this._state=wi,c.A.toggleElementVisibility(this.iconActive,!1),c.A.toggleElementVisibility(this.iconInactive,!0)),this.label.textContent=this.labelText,this.el.title=this.labelText}destroy(){this.el.removeEventListener("click",this.boundOnClick)}},BookmarksList:class extends ai{constructor(...e){super(...e),p.A.instance.isLoggedIn&&(this.dataSettings=this.data.settings?JSON.parse(this.data.settings):{},this.collection=this.dataSettings.collection,this.documentIds=[],this.teaserLookup={},this.bookmarks=z.instance,this.content=this.el.querySelector('[data-bookmarkslist-el="content"]'),this.teaserlist=this.el.querySelector('[data-bookmarkslist-el="teaserlist"]'),this.loader=this.el.querySelector('[data-bookmarkslist-el="loader"]'),this.loaderOverlay=this.el.querySelector('[data-bookmarkslist-el="loader-overlay"]'),this.error=this.el.querySelector('[data-bookmarkslist-el="error"]'),this.emptyState=this.el.querySelector('[data-bookmarkslist-el="emptyState"]'),this.emptyStateTitle=this.emptyState.querySelector("[data-title]"),this.emptyStateText=this.emptyState.querySelector("[data-text]"),this.headline=this.el.querySelector("[data-title]"),this.paginationEl=this.el.querySelector('[data-bookmarkslist-el="pagination"]'),this.paginationBackEl=this.el.querySelector('[data-pagination-el="back"]'),this.paginationForwardEl=this.el.querySelector('[data-pagination-el="forward"]'),this.paginationCurrentEl=this.el.querySelector('[data-pagination-el="current"]'),this.paginationTotalEl=this.el.querySelector('[data-pagination-el="total"]'),this.paginationPageSize=20,this._paginationItemsTotal=0,this._paginationPagesTotal=0,this._paginationCurrentPage=1,this.boundOnPaginationBackClick=e=>this.onPaginationBackClick(e),this.boundOnPaginationForwardClick=e=>this.onPaginationForwardClick(e),this.state=Ii,this.subscribe(o.Bb,this.onBookmarksError),this.bookmarks.isInitialized?this.init():this.subscribe(o.n8,this.init))}init(){this.paginationBackEl&&this.paginationBackEl.addEventListener("click",this.boundOnPaginationBackClick),this.paginationForwardEl&&this.paginationForwardEl.addEventListener("click",this.boundOnPaginationForwardClick),this.subscribe(o.Gr,()=>this.refresh()),this.subscribe(o.XH,()=>this.refresh()),this.subscribe(o.sK,()=>
1this.refresh()),this.subscribe(o.OL,()=>this.refresh()),this.subscribe(o.dM,e=>{this.onChangeCollectionTriggered(e)}),this.refresh()}onChangeCollectionTriggered(e){e&&this.collection!==e&&(this.collection=e,this._paginationCurrentPage=1,this.updateCollectionSpecificTexts(e),this.refresh())}updateCollectionSpecificTexts(e){const t=s.A.instance?.translations,i=t?.bookmarksListTitle[e]||"",n=t?.bookmarksEmptyState?.title[e]||"",a=t?.bookmarksEmptyState?.text[e]||"";this.headline.textContent=i,this.emptyStateTitle.textContent=n,this.emptyStateText.textContent=a}onPaginationBackClick(e){e.preventDefault(),this.paginationCurrentPage>1&&(this.paginationCurrentPage-=1,this.refresh().then(()=>this.scrollToTop()).catch(()=>{}))}onPaginationForwardClick(e){e.preventDefault(),this.paginationCurrentPage<this.paginationPagesTotal&&(this.paginationCurrentPage+=1,this.refresh().then(()=>this.scrollToTop()).catch(()=>{}))}onBookmarksError(e){e&&e.collection&&e.collection!==this.collection||(!e||e.type!==r.Yj&&e.type!==r.qd?this.state=Ei:this.refresh())}refresh(){const e=this.bookmarks.documentIdsByCollection[this.collection]||[];this.paginationItemsTotal=e.length;const t=this.paginationItemsTotal-(this.paginationCurrentPage-1)*this.paginationPageSize,i=t-this.paginationPageSize>0?t-this.paginationPageSize:0,s=e.slice(i,t);if(s.reverse(),oi.isEqual(s,this.documentIds)&&this.state===Pi)return Promise.resolve();this.state=Ii,this.documentIds=s;const n=this.documentIds.filter(e=>!this.teaserLookup[e]);return 0===n.length?(this.updateView(),Promise.resolve()):gi.instance.getTeasersByIds(n).then(e=>e.success?(Array.isArray(e.teasers)&&e.teasers.length&&e.teasers.forEach(e=>{if(!e.id)return;const t={...e};t.imageId||(t.classmodifier="disable-"),this.teaserLookup[t.id]=t}),this.updateView(),Promise.resolve()):n.length<this.documentIds.length?(this.updateView(),Promise.resolve()):(this.state=Ei,Promise.reject()))}updateView(){const e=this.documentIds.filter(e=>!this.teaserLookup[e]),t=this.documentIds&&this.documentIds.length&&e.length<this.documentIds.length;this.state=t?Pi:vi,c.A.toggleElementVisibility(this.deleteAllLink,t),c.A.toggleElementVisibility(this.paginationEl,t),this.renderTeasers()}renderTeasers(){this.teaserlist.innerHTML="",this.documentIds.forEach(e=>{const t=this.teaserLookup[e];if(!t)return;const i=ci.instance.create(t,r.qi);if(i){if(this.teaserlist.hasChildNodes()){let e=Oe.A.createElementByPrototypeId("prototype-border-separator-secondary");e=Oe.A.populateElement(e),e&&this.teaserlist.append(e)}this.teaserlist.append(i)}}),this.publish(o.ph),this.scan()}scrollToTop(){window.scrollY>this.el.getBoundingClientRect().y&&Ie.A.scrollToElement(this.el)}get paginationCurrentPage(){return this._paginationCurrentPage}set paginationCurrentPage(e){!Number.isInteger(e)||e<=0||(this._paginationCurrentPage=e,c.A.toggleElementVisibility(this.paginationBackEl,e>1),c.A.toggleElementVisibility(this.paginationForwardEl,e<this.paginationPagesTotal),this.paginationCurrentEl.textContent=e)}get paginationPagesTotal(){return this._paginationPagesTotal}set paginationPagesTotal(e){!Number.isInteger(e)||e<0||(this._paginationPagesTotal=e,this.paginationTotalEl.textContent=e,0===e?this.paginationCurrentPage=1:this.paginationCurrentPage>e&&(this.paginationCurrentPage=e))}get paginationItemsTotal(){return this._paginationItemsTotal}set paginationItemsTotal(e){!Number.isInteger(e)||e<0||(this._paginationItemsTotal=e,this.paginationPagesTotal=Math.ceil(e/this.paginationPageSize),this.paginationCurrentPage=this.paginationCurrentPage||1)}get state(){return this._state||(this._state=Pi),this._state}set state(e){switch(this._state=e,e){case Ii:c.A.toggleElementVisibility(this.content,!0),c.A.toggleElementVisibility(this.loader,!0),c.A.toggleElementVisibility(this.loaderOverlay,this.teaserlist.hasChildNodes()),c.A.toggleElementVisibility(this.emptyState,!1),c.A.toggleElementVisibility(this.error,!1);break;case vi:c.A.toggleElementVisibility(this.content,!1),c.A.toggleElementVisibility(this.loader,!1),c.A.toggleElementVisibility(this.emptyState,!0),c.A.toggleElementVisibility(this.error,!1);break;case Ei:c.A.toggleElementVisibility(this.content,!1),c.A.toggleElementVisibility(this.loader,!1),c.A.toggleElementVisibility(this.emptyState,!1),c.A.toggleElementVisibility(this.error,!0),this.scrollToTop();break;default:c.A.toggleElementVisibility(this.content,!0),c.A.toggleElementVisibility(this.loader,!1),c.A.toggleElementVisibility(this.emptyState,!1),c.A.toggleElementVisibility(this.error,!1)}}destroy(){this.deleteAllLink&&this.deleteAllLink.removeEventListener("click",this.boundOnDeleteAllClick)}},BookmarksShortList:class extends ai{constructor(...e){super(...e),p.A.instance.isLoggedIn&&(this.dataSettings=this.data.settings?JSON.parse(this.data.settings):{},this.collection=this.dataSettings.collection,this.bookmarks=z.instance,this.documentIds=[],this.teaserLookup={},this.loader=this.el.querySelector('[data-bookmarksshortlist-el="loader"]'),this.loaderOverlay=this.el.querySelector('[data-bookmarksshortlist-el="loader-overlay"]'),this.emptyState=this.el.querySelector('[data-bookmarksshortlist-el="emptyState"]'),this.error=this.el.querySelector('[data-bookmarksshortlist-el="error"]'),this.content=this.el.querySelector('[data-bookmarksshortlist-el="content"]'),this.teaserlist=this.el.querySelector('[data-bookmarksshortlist-el="teaserlist"]'),this.state=Si,this.subscribe(o.Bb,this.onBookmarksError),this.boundOnLazyLoad=e=>this.onLazyLoad(e),this.el.addEventListener("lazybeforeunveil",this.boundOnLazyLoad))}init(){this.subscribe(o.Gr,()=>this.refresh()),this.subscribe(o.XH,()=>this.refresh()),this.subscribe(o.sK,()=>
1this.refresh()),this.subscribe(o.OL,()=>this.refresh()),this.refresh()}onLazyLoad(e){e.target===this.el&&(this.bookmarks.isInitialized?this.init():this.subscribe(o.n8,this.init))}onBookmarksError(e){e&&e.collection&&e.collection!==this.collection||(!e||e.type!==r.Yj&&e.type!==r.qd?this.state!==_i&&(this.state=Ci):this.refresh())}refresh(){const e=this.bookmarks.documentIdsByCollection[this.collection]||[],t=e.length,i=e.length>3?e.length-3:0,s=e.slice(i,t);if(s.reverse(),oi.isEqual(s,this.documentIds)&&this.state===_i)return Promise.resolve();this.state=Si,this.documentIds=s;const n=this.documentIds.filter(e=>!this.teaserLookup[e]);return 0===n.length?(this.updateView(),Promise.resolve()):gi.instance.getTeasersByIds(n).then(e=>e.success?(Array.isArray(e.teasers)&&e.teasers.length&&e.teasers.forEach(e=>{e.id&&(this.teaserLookup[e.id]=e)}),this.updateView(),Promise.resolve()):n.length<this.documentIds.length?(this.updateView(),Promise.resolve()):(this.state=Ci,Promise.reject()))}updateView(){const e=this.documentIds.filter(e=>!this.teaserLookup[e]),t=this.documentIds&&this.documentIds.length&&e.length<this.documentIds.length;this.state=t?_i:ki,this.renderTeasers()}renderTeasers(){this.teaserlist.innerHTML="",this.documentIds.forEach((e,t)=>{const i=this.teaserLookup[e];if(!i)return;const s={...i},n=0===t,a=t===this.documentIds.length-1;s.additionalClassesString=n?"lg:border-separator-secondary-r lg:pr-16 lg:w-4/12 md:mb-24 sm:mb-16":a?"lg:w-4/12 lg:pl-24 md:mb-24 sm:mb-16":"lg:border-separator-secondary-r lg:pl-24 lg:pr-16 lg:w-4/12 md:mb-24 sm:mb-16";const o=ci.instance.create(s,r.x8);o&&this.teaserlist.append(o)}),this.publish(o.ph)}get state(){return this._state||(this._state=_i),this._state}set state(e){switch(this._state=e,e){case Si:c.A.toggleElementVisibility(this.content,!0),c.A.toggleElementVisibility(this.loader,!0),c.A.toggleElementVisibility(this.loaderOverlay,this.teaserlist.hasChildNodes()),c.A.toggleElementVisibility(this.emptyState,!1),c.A.toggleElementVisibility(this.error,!1);break;case ki:c.A.toggleElementVisibility(this.content,!1),c.A.toggleElementVisibility(this.loader,!1),c.A.toggleElementVisibility(this.emptyState,!0),c.A.toggleElementVisibility(this.error,!1);break;case Ci:c.A.toggleElementVisibility(this.content,!1),c.A.toggleElementVisibility(this.loader,!1),c.A.toggleElementVisibility(this.emptyState,!1),c.A.toggleElementVisibility(this.error,!0);break;default:c.A.toggleElementVisibility(this.content,!0),c.A.toggleElementVisibility(this.loader,!1),c.A.toggleElementVisibility(this.emptyState,!1),c.A.toggleElementVisibility(this.error,!1)}}},ImageZoomLayer:class extends ai{constructor(...e){super(...e),(this.el.dataset.settings||this.el.dataset.settings.id)&&(this.focusCatcher=this.el.querySelector("[data-zoom-focus]"),this.closeButton=this.el.querySelector("[data-zoom-close]"),this.backdrop=this.el.querySelector("[data-zoom-backdrop]"),this.background=this.el.querySelector("[data-zoom-background]"),this.isCaptionShown=!1,this.caption=this.el.querySelector("[data-zoom-caption]"),this.imageWrapper=this.el.querySelector("[data-zoom-image]"),this.image=this.el.querySelector('[data-image-el="img"]'),this.settings=JSON.parse(this.el.dataset.settings),this.hash=`bild-${this.settings.imageId}`,this.animationDuration=250,this.ignoreClicks=!1,this.pinchToZoom=new xi(this.el,this.image),this.image.classList.remove("opacity-full"),this.image.classList.add("opacity-none"),this.boundRepositionCloseButton=()=>this.repositionCloseButton(),this.boundCenterImage=()=>this.centerImage(),this.boundHandleWheel=e=>this.handleWheel(e),this.boundHandleClick=()=>this.handleClick(),this.boundClose=()=>{this.publish(o.vh)},this.boundOnPinchZoomChanged=e=>this.onPinchZoomChanged(e),this.pinchToZoom.init().catch(()=>{this.pinchToZoom.destroy(),this.pinchToZoom=null}).finally(()=>{Oi.instance.register(this),window.location.hash===`#${this.hash}`&&this.publish(o.no,this.id)}))}open(){g.A.isPhone&&g.A.isIOS&&(window.addEventListener("resize",this.boundRepositionCloseButton),window.addEventListener("resize",this.boundCenterImage),this.centerImage()),g.A.isPhone||this.el.addEventListener("wheel",this.boundHandleWheel),this.background&&this.background.addEventListener("click",this.boundHandleClick),this.toggleZoomLayer(!0),this.publish(o.L$,this),this.settings.zoomAnimation&&this.settings.zoomId?(this.publish(o.pH,this.settings.zoomId,this.animationDuration),window.setTimeout(()=>this.showImageOnLazyload(),this.animationDuration)):this.showImageOnLazyload(),this.showOverlay(),this.focusOverlay(),this.toggleInterface(!1),this.pinchToZoom&&(this.pinchToZoom.attach(),this.image.addEventListener(o.w3,this.boundOnPinchZo
1omChanged))}close(){window.removeEventListener("scroll",this.boundHandleScroll),window.removeEventListener("resize",this.boundRepositionCloseButton),window.removeEventListener("resize",this.boundCenterImage),this.background&&this.background.removeEventListener("click",this.boundHandleClick),this.hideOverlay(),this.hideImage(),this.toggleInterface(!0),this.publish(o.c3,this),window.setTimeout(()=>{this.toggleZoomLayer(!1)},this.animationDuration),this.pinchToZoom&&(this.image.removeEventListener(o.w3,this.boundOnPinchZoomChanged),this.pinchToZoom.detach())}handleWheel(e){this.caption&&this.caption.contains(e.target)||(this.el.removeEventListener("wheel",this.boundHandleWheel),this.boundClose())}handleClick(){this.ignoreClicks||this.toggleInterface(this.isCaptionShown)}onPinchZoomChanged(e){e.detail&&"boolean"==typeof e.detail.zoomIn&&(this.toggleInterface(e.detail.zoomIn),Number.isInteger(e.detail.transitionDuration)&&(this.ignoreClicks=!0,window.setTimeout(()=>{this.ignoreClicks=!1},e.detail.transitionDuration)))}toggleInterface(e){e?(this.hideCaption(),this.hideCloseButton(),this.isCaptionShown=!1):(this.showCaption(),this.showCloseButton(),this.isCaptionShown=!0)}toggleZoomLayer(e){this.el.classList.toggle("hidden",!e)}repositionCloseButton(){window.requestAnimationFrame(()=>{if(this.buttonTargetDistance=this.buttonTargetDistance?this.buttonTargetDistance:Number(window.getComputedStyle(this.closeButton).top.split("px")[0]),window.innerHeight>window.innerWidth)this.closeButton.style.top=`${this.buttonTargetDistance}px`;else{const e=this.closeButton.getBoundingClientRect().top;e!==this.buttonTargetDistance&&(this.closeButton.style.top=2*this.buttonTargetDistance-e+"px")}})}centerImage(){window.requestAnimationFrame(()=>{window.innerHeight>window.innerWidth?this.image.offsetHeight>0&&window.setTimeout(()=>{const e=window.innerHeight-this.image.offsetHeight;this.imageWrapper.classList.add("absolute"),this.imageWrapper.style.top=e/2+"px"},this.animationDuration):(this.imageWrapper.classList.remove("absolute"),this.imageWrapper.style.top="")})}showOverlay(){this.backdrop.setAttribute("style",`transition: background-color ${this.animationDuration}ms ease-out;`),window.setTimeout(()=>{this.backdrop.classList.remove("bg-opacity-none")},0)}focusOverlay(){this.focusCatcher.focus()}hideOverlay(){this.backdrop.classList.add("bg-opacity-none")}showCaption(){this.caption&&(this.caption.style.transform="translateY(100%)",window.setTimeout(()=>{this.caption.setAttribute("style",`transition: transform ${this.animationDuration}ms ease-out;`),this.caption.style.transform="translateY(0)"},0))}hideCaption(){this.caption&&(this.caption.style.transform="translateY(100%)")}showCloseButton(){this.closeButton.addEventListener("click",this.boundClose),this.closeButton.style.transform="translateX(150%)",window.setTimeout(()=>{this.closeButton.setAttribute("style",`transition: transform ${this.animationDuration}ms ease-out;`),this.closeButton.style.transform="translateX(0)",this.repositionCloseButton()},0)}hideCloseButton(){this.closeButton.removeEventListener("click",this.boundClose),this.closeButton.style.transform="translateX(150%)"}showImage(){this.image.classList.remove("opacity-full"),this.image.classList.add("opacity-none"),window.setTimeout(()=>{this.image.setAttribute("style",`transition: opacity ${this.animationDuration}ms ease-out;`),this.image.classList.remove("opacity-none"),this.image.classList.add("opacity-full")},0),this.image.removeEventListener("load",this.boundShowImage)}hideImage(){this.image.classList.remove("opacity-full"),this.image.classList.add("opacity-none")}showImageOnLazyload(){this.image.classList.contains("lazyloaded")||this.image.classList.contains("ls-is-cached")||this.image.complete?this.showImage():(this.boundShowImage=()=>this.showImage(),this.image.addEventListener("load",this.boundShowImage))}get id(){return this.settings.zoomId}get preventScrolling(){return!0}destroy(){this.hideZoomLayer(),this.image.removeEventListener("load",this.boundShowImage),this.image.removeEventListener(o.w3,this.boundOnPinchZoomChanged),super.destroy()}},JWPlayer:class extends ai{constructor(...e){super(...e),this.settings=this.data.settings?JSON.parse(this.data.settings):{},this.id=this.settings.id,this.mediaId="",this.playlistItem=null,this.playlistId=null,this.adScheduleId=this.settings.adScheduleId?this.settings.adScheduleId:null,this.isConfigInitialized=!1,this.isJWPlayerReady=!1,this.isJWContentLoaded=!1,this.tcdataInitializationTimeoutId=null,this.loader=this.el.querySelector('[data-vi
1deo-el="loader"]'),this.poster=this.el.querySelector('[data-video-el="poster"]'),this.hasVideo=!1,this.hasAudio=!1,this.hasAdvertisement=!1,this.isAutoPaused=!1,this.hasCustomAdCuepoints=!1,this.playMidrollsFromLength=this.settings.playMidrollsFromLength?this.settings.playMidrollsFromLength:0;const{mediaIdFromUrl:t,durationInSeconds:i}=this.settings;this.durationInSeconds=Number.isInteger(i)?i:0;const n=new URLSearchParams(window.location.search);if(t?this.mediaId=decodeURIComponent(n.get("mediaid")):(this.mediaId=this.settings.mediaId?this.settings.mediaId:void 0,this.playlistId=this.settings.playlistId?this.settings.playlistId:void 0),!this.mediaId&&!this.playlistId)return void this.onError();const a=s.A.instance,r=p.A.instance,l=a.editorial&&a.editorial.attributes?a.editorial.attributes:{},c=a.editorial&&a.editorial.category?a.editorial.category:"";if(this.suppressAds=a.noAds||r.hasNoAdsAccess||"never"===this.settings.adBehavior||l.has_noAds||l.has_noContentAds||"sponsored"===c,this.consentGloballyDisabled=!(!a.consent||"boolean"!=typeof a.consent.globallyDisabled)&&a.consent.globallyDisabled,!this.suppressAds&&this.consentGloballyDisabled){this.suppressAds=!0;P.instance.ready?this.onTCDataReady():(this.tcdataInitializationTimeoutId=setTimeout(()=>{console.error("JWPlayer: TCData init timeout"),this.onTCDataReady()},2e3),this.subscribe(o.YF,this.onTCDataReady,this))}else this.initConfig()}onTCDataReady(){if(this.tcdataInitializationTimeoutId&&clearTimeout(this.tcdataInitializationTimeoutId),this.suppressAds&&this.consentGloballyDisabled){P.instance.isPurposeGranted(r.cg.store_and_access_information_on_a_device)&&(this.suppressAds=!1)}this.initConfig()}initConfig(){if(this.isConfigInitialized)return;this.isConfigInitialized=!0;const{autostart:e,disableRelated:t,errors:i,skinUrl:s}=this.settings;this.config={mediaid:this.mediaId,playlist:[],intl:{de:{errors:i}}},e&&(this.config.autostart="viewable"),t&&(this.config.related={}),s&&(this.config.skin={url:s,name:"spgl"}),this.isJWPlayerReady="function"==typeof window.jwplayer,this.isJWPlayerReady?this.onJWPlayerSourceReady():this.subscribe(o.tA,this.onJWPlayerSourceReady,this)}onJWPlayerSourceReady(){this.isJWPlayerReady=!0,window.jwDefaults&&(this.config={...window.jwDefaults,...this.config}),this.config.advertising?.adscheduleid&&(this.adScheduleId=this.config.advertising.adscheduleid),this.loadJWContent()}async loadJWContent(){if(!this.isJWContentLoaded){if(this.isJWContentLoaded=!0,this.mediaId){let e=null;try{e=await Bi.instance.getMediaObjectByMediaId(this.mediaId)}catch(e){return void this.onError()}if(e&&this.parseJwPlayerMediaObject(e),!this.playlistItem||!Array.isArray(this.playlistItem.sources)||0===this.playlistItem.sources.length)return void this.onError();if(this.playlistId)try{const e=await Bi.instance.getPlaylistByPlaylistId(this.playlistId);e&&this.parseJwPlayerPlaylist(e)}catch(e){}}else if(this.playlistId){let e=null;try{e=await Bi.instance.getPlaylistByPlaylistId(this.playlistId)}catch(e){return void this.onError()}if(!(e?.playlist?.length>0))return void this.onError();{const t=e.playlist.shift();this.playlistItem=this.parseJwPlayerPlaylistItem(t),this.mediaId=this.playlistItem?.mediaid||this.mediaId,this.parseJwPlayerPlaylist(e)}}Array.isArray(this.config.playlist)&&0!==this.config.playlist.length||!this.playlistItem||(this.config.playlist=[this.playlistItem],this.config.playlistIndex=0),this.initJWPlayer()}}parseJwPlayerMediaObject(e){e.feed_instance_id&&(this.config.feed_instance_id=e.feed_instance_id),e.jwpseg&&(this.config.jwpseg=e.jwpseg);let t=null;if(e.playlist&&Array.isArray(e.playlist)&&e.playlist.length>0){const i=e.playlist[0];i.ad_schedule_id&&(this.adScheduleId=i.ad_schedule_id),i.has_custom_ad_schedule&&(this.hasCustomAdCuepoints="true"===i.has_custom_ad_schedule.toLowerCase()),i.playlist_id&&(this.playlistId=i.playlist_id),t=this.parseJwPlayerPlaylistItem(i),this.settings.alternativeTitle&&(t.title=this.settings.alternativeTitle),this.settings.alternativeDescription&&(t.description=this.settings.alternativeDescription),this.hasAudio=t.sources.some(e=>"string"==typeof e.type&&e.type.includes("audio/")),this.hasVideo=t.sources.some(e=>"string"==typeof e.type&&e.type.includes("video/")),Number.isInteger(t.duration)&&(this.durationInSeconds=t.duration)}this.hasAudio&&!this.hasVideo&&(this.suppressAds=!0),this.playlistItem=t}parseJwPlayerPlaylist(e){if(!e||!Array.isArray(e.playlist)||0===e.playlist.length)return;const t=e.playlist.map(e=>this.parseJwPlayerPlaylistItem(e)),i=t.findIndex(e=>e.mediaid===this.mediaId);i>=0?(t.splice(i,1,this.playlistItem),this.config.playlist=t,this.config.playlistIndex=i):this.config.playlist=[this.playlistItem,...t]}parseJwPlayerPlaylistItem(e){const t={sources:[]};return e.title&&(t.title=e.title),e.description&&(t.description=e.description),e.image&&(t.image=e.image),Array.isArray(e.images)&&e.images.length>0&&(t.images=e.images.filter(e=>!e.type||"image"===e.type.split("/")[0])),e.mediaid&&(t.mediaid=e.mediaid),"number"==typeof e.pubdate&&(t.pubdate=e.pubdate),e.sources&&Array.isArray(e.sources)&&e.sources.length>
10&&e.sources.forEach(e=>{const i={...e};Number.isInteger(e.height)&&e.height>0&&(i.label=`${e.height}p`),t.sources.push(i)}),Number.isInteger(e.duration)&&(t.duration=e.duration),e.tracks&&Array.isArray(e.tracks)&&e.tracks.length>0&&(t.tracks=e.tracks),e.jwpseg&&Array.isArray(e.jwpseg)&&e.jwpseg.length>0&&(t.jwpseg=e.jwpseg),e.jwpseg_client_side&&Array.isArray(e.jwpseg_client_side)&&e.jwpseg_client_side.length>0&&(t.jwpseg_client_side=e.jwpseg_client_side),t}async initJWPlayer(){this.suppressAds?this.config.advertising={}:this.config.advertising=await this.getAdvertisingConfig();const e=this.getAutopauseConfig();e&&(this.config.autoPause=e),window.jwplayer?(window.jwplayer.key=s.A.instance.thirdparty?.jwplayer?.licenseKey??"",this.jwplayer=window.jwplayer(this.id).setup(this.config),this.jwplayer.on("beforePlay",e=>this.onBeforePlay(e)),this.suppressAds||"googima"!==this.config.advertising?.client||(Lt.instance.load("googleImaVansAdapter"),this.jwplayer.on("adsManager",e=>this.onAdsManager(e))),this.jwplayer.on("ready",()=>{this.onReady()})):this.onError()}onBeforePlay(){if(this.isAutoPaused){this.jwplayer.pause();try{this.jwplayer.pauseAd(!0)}catch(e){console.error(`JWPlayer API - pauseAd error: ${e.message}`)}}}onAdsManager(e){const{iasConfig:t}=this.settings;if(!t)return;const{adsManager:i,videoElement:s}=e;window.googleImaVansAdapter&&"function"==typeof window.googleImaVansAdapter.init?this.initGoogleImaVansAdapter(i,s,t):Lt.instance.load("googleImaVansAdapter").then(()=>this.initGoogleImaVansAdapter(i,s,t)).catch(()=>{})}initGoogleImaVansAdapter(e,t,i){window.googleImaVansAdapter&&"function"==typeof window.googleImaVansAdapter.init&&e&&t&&i&&window.googleImaVansAdapter.init(window.google,e,t,i)}getAutopauseConfig(){return l.A.isAndroidApp?{viewability:!0,pauseAds:!0}:this.hasAudio&&!this.hasVideo?{viewability:!1,pauseAds:!1}:!this.hasAdvertisement||"object"!=typeof this.config.autoPause||this.settings.multiboxId&&this.settings.multiboxId.length>0?void 0:{viewability:!0,pauseAds:!0}}async getAdvertisingConfig(){if(!this.config.advertising||"object"!=typeof this.config.advertising)return{};const e=Mi.deepclone(this.config.advertising);let t;if(this.adScheduleId&&(this.adScheduleId!==e.adscheduleid||!e.schedule)){const e=Bi.instance;t=await e.getAdScheduleById(this.adScheduleId)}let i=[];const s=[];if(t&&t.schedule&&Array.isArray(t.schedule)&&t.schedule.length>0?(Object.keys(t).forEach(i=>{"schedule"!==i&&(e[i]=t[i])}),i=t.schedule):e.schedule&&Array.isArray(e.schedule)&&e.schedule.length>0&&(i=e.schedule),this.hasCustomAdCuepoints){const e=Bi.instance,t=await e.getCustomAdCuepointsByMediaId(this.mediaId);if(t.media_timings&&t.media_timings.length>0){const s=[];i.forEach(i=>{const n={...i};if("number"==typeof n.offset){const i=t.media_timings.shift();i?.timecode&&(n.offset=e.convertTimecodeToOffset(i.timecode)??n.offset,s.push(n))}else s.push(n)}),i=s}else this.hasCustomAdCuepoints=!1}const n=e.client?e.client:"googima",a=new Ri;await a.initialized;const o=(e,t="mid")=>{const i={};try{new URL(e).searchParams.forEach((e,t)=>{i[t]=e})}catch(e){}return a&&"function"==typeof a.getAdTag?a.getAdTag({pos:t,videoContentDuration:this.durationInSeconds,overrideParams:i}):""};"googima"===n&&(e.omidSupport="enabled");const r=!this.durationInSeconds||this.durationInSeconds>=this.playMidrollsFromLength;return"never"===this.settings.adBehavior||r||this.hasCustomAdCuepoints||(this.settings.adBehavior="prerolls"),i.forEach(e=>{if(!e.offset||!e.tag||Array.isArray(e.tag)&&0===e.tag.length)return;const t="pre"===e.offset||"post"===e.offset?e.offset:"mid";"pre"!==t&&"prerolls"===this.settings.adBehavior||("string"==typeof e.tag?e.tag=o(e.tag,t):Array.isArray(e.tag)&&(e.tag=e.tag.map(e=>o(e,t))),s.push(e))}),e.schedule=s,this.hasAdvertisement=e.schedule&&Array.isArray(e.schedule)&&e.schedule.length>0,e}onReady(){this.loader&&this.loader.classList.add("hidden"),this.poster&&this.poster.classList.add("hidden"),this.publish(o.UY,this.id),this.subscribe(o.oe,this.onVisibilityChange,this),this.jwplayer.on("adPause",e=>{this.onAdPause(e)}),this.settings.multiboxId&&this.settings.multiboxId.length>0&&this.subscribe(o.Kn,e=>{this.onCloseAccordion(e.id)})}onError(){this.el.classList.add("hidden"),console.error(`JWPLayer: Unable to load video - mediaid: ${this.mediaId?this.mediaId:"undefined"}`)}
1onCloseAccordion(e){if(this.settings.multiboxId===e){this.jwplayer.pause();try{this.jwplayer.pauseAd(!0)}catch(e){console.error(`JWPlayer API - pauseAd error: ${e.message}`)}}}onVisibilityChange(e){if(this.jwplayer)if("hidden"===e){if(this.isPlaying)try{this.jwplayer.pauseAd(!0)}catch(e){console.error(`JWPlayer API - pauseAd error: ${e.message}`)}this.isAutoPaused=!0}else if("visible"===e&&this.isAutoPaused){try{this.jwplayer.pauseAd(!1)}catch(e){console.error(`JWPlayer API - pauseAd error: ${e.message}`)}this.isAutoPaused=!1}}onAdPause(e){e&&"object"==typeof e&&"pauseReason"in e&&"clickthrough"===e.pauseReason&&(this.isAutoPaused=!0)}get isPlaying(){if(!this.jwplayer||"function"!=typeof this.jwplayer.getState)return!1;const e=this.jwplayer.getState();return e&&"playing"===e}destroy(){super.destroy()}},RecommendationsBlock:class extends ai{constructor(...e){super(...e),this.dataSettings=this.data.settings?JSON.parse(this.data.settings):{},this.componentId=this.dataSettings.componentId??void 0,this.minRecoTeasers=this.dataSettings.minRecoTeasers??4,this.blockIndex=this.dataSettings.blockIndex??0,this.articleIds=this.dataSettings.articleIds??[],this.recommendationsBlockTitle=this.dataSettings.recommendationsBlockTitle??"",this.source=void 0,this.runId=void 0,this.createdAt=void 0,this.topmarksEnabled=!!this.dataSettings.topmarksEnabled,this.headlineOffset=!!this.dataSettings.headlineOffset,this.teaserLookup={},this.contentEl=this.el.querySelector('[data-recommendationsblock-el="content"]'),this.teasersEl=this.el.querySelector('[data-recommendationsblock-el="teasers"]'),this.loaderEl=this.el.querySelector('[data-recommendationsblock-el="loader"]'),this.state=Fi,this.boundOnLazyLoad=e=>this.onLazyLoad(e),this.el.addEventListener("lazybeforeunveil",this.boundOnLazyLoad)}onLazyLoad(e){e.target===this.el&&this.init().then(()=>{this.updateTitle()}).finally(()=>{this.state=ji,this.updateDataAttributes(),zt.instance.sendComponentViewEvent(this.componentId,"recommendation")})}init(){return new Promise((e,t)=>{const i=p.A.instance;if(!i.isLoggedIn||!i.recommendations?.homepage)throw new Error("user is not eligible for recommendations");L().then(()=>{const t=s.A.instance,n=i.hasNoAdsAccess?"noads":"default",a=t?.thirdparty?.sourcepoint?.[n]||void 0;if(!k([a?.purposeIds?.recommendations||void 0]))throw new Error("user did not consent to recommendations");return this.load().then(()=>{e()})}).catch(e=>{t(e)})})}load(){return this.state=Fi,Vi.instance.getRecommendedArticles().then(e=>{if(!e?.articleIds||!Array.isArray(e.articleIds)||e.articleIds.length<this.minRecoTeasers)throw new Error("no or not enough recommandations received");return this.runId=e.runId,this.createdAt=e.createdAt??void 0,gi.instance.getTeasersByIds(e.articleIds).then(t=>{if(!t.success||!Array.isArray(t.teasers)||t.teasers.length<this.minRecoTeasers)throw new Error("no or not enough teasers found");t.teasers.forEach(e=>{if(!e.id)return;const t={...e};t.imageId||(t.classmodifier="disable-"),this.topmarksEnabled||(t.topmark=""),this.teaserLookup[t.id]=t});const i=e.articleIds.filter(e=>!!this.teaserLookup[e]);if(i.length<this.minRecoTeasers)throw new Error("no or not enough valid teasers found");return this.articleIds=i,this.renderTeasers(),this.source="RECO",Promise.resolve()})})}updateDataAttributes(){if(this.runId){const e=this.el.dataset.saraComponent?JSON.parse(this.el.dataset.saraComponent):{};if(e.run_id=this.runId,e.created_at=this.createdAt,this.source){const t=this.articleIds.map((e,t)=>({item_id:e,item_title:this.teaserLookup[e]?.headline||"",item_pos:t+1}));e.item_source=this.source,e.items=t,this.el.dataset.teaserCount=t.length}this.el.dataset.saraComponent=JSON.stringify(e)}this.el.dataset.saraAction="impression"}updateTitle(){if(!this.recommendationsBlockTitle)return;const e=this.el.querySelector('[data-block-el="title"]');if(!e)return;const t=e.querySelector("[data-title]");t&&(t.textContent=this.recommendationsBlockTitle);const i=e.querySelector("a[title]");i&&i.setAttribute("title",this.recommendationsBlockTitle)}renderTeasers(){const e=[];if(this.articleIds.forEach(t=>{const i=this.teaserLookup[t];i&&e.push(i)}),e.forEach((e,t)=>{e.pos=`${this.blockIndex+1}:${t+1}`,e.layout=0===t?"xxl":"m"}),this.teasersEl&&e.length>0){this.teasersEl.innerHTML="";const t=ci.instance.blocksContentArticleTeaserFull({teasers:e.slice(0,this.minRecoTeasers),headlineOffset:this.headlineOffset});this.teasersEl.appendChild(t),this.publish(o.ph),this.scan()}}get state(){return this._state??""}set state(e){if(this._state=e,e===Fi)c.A.toggleElementVisibility(this.teasersEl,!1),c.A.toggleElementVisibility(this.loaderEl,!0);else c.A.toggleElementVisibility(this.teasersEl,!0),c.A.toggleElementVisibility(this.loaderEl,!1)}},Search:class extends ai{constructor(...e){super(...e),this.settings=JSON.parse(this.data.settings),this.searchForm=this.el.querySelector("[data-search-form]"),this.searchHeadline=this.el.querySelector("[data-search-headline]"),this.searchInput=this.el.querySelector("[data-search-input] input"),this.searchInputClearIcon=this.el.querySelector('[data-search-input] [data-input-el="icon"]'),this.searchInputClearButton=this.el.querySelector("[data-search-input-clear-button]"),this.searchButton=this.el.querySelector("[data-search-button]"),this.searchFilters=document.querySelector("[data-search-filters]"),this.searchFilterIcon=this.el.querySelector("[data-search-filter-icon]"),this.searchFilterNotificationIcon=this.el.querySelector("[data-search-filter-notification-icon]"),this.searchFilterResetButtons=this.el.querySelectorAll("[data-search-filter-reset-button]"),this.searchLoader=this.el.querySelector("[data-search-loading]"),this.searchTimespanSelect=this.el.querySelector("[data-search-timespan-select] select"),this.searchFieldsetRadioGroup=this.searchFilters.elements.namedItem("fieldset"),this.searchCooktimeRadioGroup=this.searchFilters.elements.namedItem("cooktime"),this.searchSegmentsCheckboxes=this.searchFilters.elements.namedItem("segment")?Array.from(this.searchFilters.elements.namedItem("segment")):[],this.searchResultButton=this.searchFilters.querySelector("[data-search-result-button]"),this.searchSubdimensionCheckboxes={},this.settings.dimensions&&this.settings.dimensions.length>
10&&this.settings.dimensions.forEach(e=>{this.searchSubdimensionCheckboxes[e]=Array.from(this.searchFilters.querySelectorAll(`[data-search-dimension="${e}"] [name="subdimension"]`))}),this.searchError=this.el.querySelector("[data-search-error]"),this.searchEmpty=this.el.querySelector("[data-search-empty]"),this.resultsList=this.el.querySelector("[data-search-results]"),this.pagination=this.el.querySelector("[data-search-pagination]"),this.paginationPrev=this.el.querySelector('[data-pagination-el="back"]'),this.paginationNext=this.el.querySelector('[data-pagination-el="forward"]'),this.paginationCurrentPage=this.el.querySelector('[data-pagination-el="current"]'),this.paginationLastPage=this.el.querySelector('[data-pagination-el="total"]'),this.searchResults=document.querySelector("#suchergebnisse"),this.urlSearchString="",this.searchResultsTotal=0,this.teasers=[],this.searchTopics=[],this.scrollTrigger=!1,this.searchResultPagination={current:1,last:0,pageSize:20},this.searchResultAggregations={},this.updateHtmlInputFieldsByUrlParams(),this.searchOptions={query:this.urlSearchString,displayQuery:this.urlSearchString,fields:"",before:null,after:null,segments:[],cookTimeMin:null,cooktimeMax:null,subdimensions:{}},this.updateFilters(),this.domain=s.A.instance&&s.A.instance.domain?s.A.instance.domain:"",this.init()}init(){this.user=p.A.instance,this.boundExecuteSearch=e=>this.executeSearch(e),this.searchForm.addEventListener("submit",this.boundExecuteSearch),this.searchFilters.addEventListener("submit",this.boundExecuteSearch),this.boundFilterResults=()=>{this.updateFilters(),this.executeSearch()},this.searchFilters.addEventListener("change",this.boundFilterResults),this.boundGoToNextPage=e=>{this.goToPage(e,this.searchResultPagination.current+1),Ie.A.scrollToElement(this.searchResults)},this.paginationNext.addEventListener("click",this.boundGoToNextPage),this.boundGoToPrevPage=e=>{this.goToPage(e,this.searchResultPagination.current-1),Ie.A.scrollToElement(this.searchResults)},this.paginationPrev.addEventListener("click",this.boundGoToPrevPage),this.boundResetFilters=e=>this.resetFilters(e),this.searchFilterResetButtons.forEach(e=>{e.addEventListener("click",this.boundResetFilters)}),c.A.toggleElementVisibility(this.searchInputClearIcon,""!==this.searchInput.value),c.A.toggleElementVisibility(this.searchInputClearButton,""!==this.searchInput.value),this.boundOnSearchInputValueChanged=()=>{c.A.toggleElementVisibility(this.searchInputClearIcon,""!==this.searchInput.value),c.A.toggleElementVisibility(this.searchInputClearButton,""!==this.searchInput.value)},this.searchInput.addEventListener("input",this.boundOnSearchInputValueChanged),this.boundOnClearIconClicked=()=>{this.searchInput.value="",c.A.toggleElementVisibility(this.searchInputClearIcon,!1),c.A.toggleElementVisibility(this.searchInputClearButton,!1),this.searchInput.focus(),this.settings.autostart&&this.executeSearch()},this.searchInputClearButton.addEventListener("click",this.boundOnClearIconClicked),this.subscribe(o.U9,()=>{this.updateHtmlInputFieldsByAggregations(),this.createResultList(),this.updateResultTexts(),c.A.toggleElementVisibility(this.searchHeadline,!0),this.updatePagination()}),this.subscribe(o.c3,e=>{"suchfilter"===e?.id&&this.updateUrlParams()}),this.executeSearch()}updateHtmlInputFieldsByUrlParams(){const e=new URL(window.location.href);this.urlSearchString=e.searchParams.get("suchbegriff")??"";const t=e.searchParams.get("zeitraum")??"",i=e.searchParams.get("inhalt")??"",s=e.searchParams.get("zubereitungszeit")??"",n=e.searchParams.get("erschienenBei")?e.searchParams.get("erschienenBei").split(","):[],a=e.searchParams.get("seite");this.searchResultPagination.current=a?Math.max(parseInt(a,10),1):1,this.searchFilters.removeEventListener("change",this.boundFilterResults),this.searchInput.value=this.urlSearchString,t&&this.searchTimespanSelect&&(this.searchTimespanSelect.value=t),this.searchFieldsetRadioGroup&&(this.searchFieldsetRadioGroup.value=i||this.defaultFieldsetSlug),this.searchCooktimeRadioGroup&&(this.searchCooktimeRadioGroup.value=s||this.defaultCooktimeSlug),n.length>0&&this.searchSegmentsCheckboxes&&this.searchSegmentsCheckboxes.length>
10&&this.searchSegmentsCheckboxes.forEach(e=>{e.checked=n.includes(e.value)}),this.settings.dimensions&&this.settings.dimensions.length>0&&this.settings.dimensions.forEach(t=>{const i=e.searchParams.get(t)?e.searchParams.get(t).split(","):[];i.length>0&&this.searchSubdimensionCheckboxes[t]&&this.searchSubdimensionCheckboxes[t].length>0&&this.searchSubdimensionCheckboxes[t].forEach(e=>{e.checked=i.includes(e.value)})}),this.searchFilters.addEventListener("change",this.boundFilterResults)}updateHtmlInputFieldsByAggregations(){Object.keys(this.searchSubdimensionCheckboxes).forEach(e=>{const t=this.searchResultAggregations[e]?.buckets||[];this.searchSubdimensionCheckboxes[e]&&this.searchSubdimensionCheckboxes[e].length>0&&this.searchSubdimensionCheckboxes[e].forEach(e=>{const i=t.find(t=>e.value===t.key);if(i?.doc_count||e.checked){const t=e.parentElement.querySelector("[data-label-suffix]");t&&(t.innerText=`(${i?.doc_count||0})`),c.A.toggleElementVisibility(e.parentElement,!0)}else c.A.toggleElementVisibility(e.parentElement,!1),e.checked=!1})})}executeSearch(e){e&&(e.preventDefault(),"submit"===e.type&&e.target===this.searchForm&&(this.searchResultPagination.current=1,document.activeElement.blur())),this.teasers=[],this.searchOptions.query=this.searchInput.value,this.parseNeedle(),this.parseDisplaySearchString(),this.searchResultsTotal=0,this.clearResults(),c.A.toggleElementVisibility(this.searchHeadline,!1),c.A.toggleElementVisibility(this.searchError,!1),c.A.toggleElementVisibility(this.pagination,!1),this.updateUrlParams(),this.validateSearchInput()||this.settings.autostart?(c.A.toggleElementVisibility(this.searchResults,!0),c.A.toggleElementVisibility(this.searchLoader,!0),c.A.toggleElementVisibility(this.searchEmpty,!1),this.fetchResults()):(c.A.toggleElementVisibility(this.searchEmpty,!0),this.updateResultTexts())}parseNeedle(){this.searchOptions.displayQuery=this.searchOptions.query,this.searchOptions.query=this.searchOptions.query.replace(/ /g,"+")}parseDisplaySearchString(){this.searchOptions.displayQuery=0===this.searchOptions.displayQuery.indexOf('"')?this.searchOptions.displayQuery.substring(1):this.searchOptions.displayQuery,this.searchOptions.displayQuery='"'===this.searchOptions.displayQuery.charAt(this.searchOptions.displayQuery.length-1)?this.searchOptions.displayQuery.slice(0,-1):this.searchOptions.displayQuery}validateSearchInput(){return this.searchOptions.query.length>0}validateSearchFilter(){if(this.timespanSlug&&this.timespanSlug!==this.defaultTimespanSlug)return!0;if(this.fieldsetSlug&&this.fieldsetSlug!==this.defaultFieldsetSlug)return!0;if(this.cooktimeSlug&&this.cooktimeSlug!==this.defaultCooktimeSlug)return!0;if(this.searchSegmentsCheckboxes&&this.searchSegmentsCheckboxes.length>0){if(this.searchSegmentsCheckboxes.some(e=>{const t=this.settings.segments[e.value];return t&&e.checked!==t.default}))return!0}if(this.searchSubdimensionCheckboxes&&Object.keys(this.searchSubdimensionCheckboxes).length>0){if(Object.keys(this.searchSubdimensionCheckboxes).some(e=>!!this.searchSubdimensionCheckboxes[e]&&this.searchSubdimensionCheckboxes[e].some(e=>e.checked)))return!0}return!1}updateUrlParams(){if(!window.history||"function"!=typeof window.history.replaceState)return;const e=new URL(`${s.A.instance.urls.base}${window.location.pathname}`);if(e.hash=window.location.hash,this.searchOptions.query||this.settings.autostart){this.searchOptions.query?e.searchParams.set("suchbegriff",this.searchOptions.query):e.searchParams.delete("suchbegriff"),this.searchResultPagination.current>1&&e.searchParams.set("seite",this.searchResultPagination.current),this.timespanSlug&&this.timespanSlug!==this.defaultTimespanSlug&&e.searchParams.set("zeitraum",this.timespanSlug),this.fieldsetSlug&&this.fieldsetSlug!==this.defaultFieldsetSlug&&e.searchParams.set("inhalt",this.fieldsetSlug),this.cooktimeSlug&&this.cooktimeSlug!==this.defaultCooktimeSlug&&e.searchParams.set("zubereitungszeit",this.cooktimeSlug);let t=!0;this.searchSegmentsCheckboxes&&this.searchSegmentsCheckboxes.length>0&&this.searchSegmentsCheckboxes.forEach(e=>{const i=this.settings.segments[e.value];i&&e.checked!==i.default&&(t=!1)}),t||e.searchParams.set("erschienenBei",this.segmentSlugs),this.subdimensionSlugs&&Object.keys(this.subdimensionSlugs).length>
10&&Object.keys(this.subdimensionSlugs).forEach(t=>{if(this.subdimensionSlugs[t].length>0){const i=this.subdimensionSlugs[t];e.searchParams.set(t,i)}})}window.location.href!==e.href&&window.history.replaceState(window.history.state,"",e.href)}clearResults(){this.resultsList.innerHTML=""}fetchResults(){const e={...Mi.deepclone(this.searchOptions),pageSize:this.searchResultPagination.pageSize,page:this.searchResultPagination.current};this.settings.fixedSegments&&this.settings.fixedSegments.length>0&&e.segments.push(...this.settings.fixedSegments),"authors"===e.fields&&(e.author=e.query,e.query="",e.fields=""),gi.instance.getTeasersBySearchOptions(e).then(e=>{if(e.code&&"page_out_of_range"===e.code)return this.searchResultPagination.current=1,void this.executeSearch();e.success?(this.teasers=Array.isArray(e.teasers)?e.teasers:[],this.searchResultsTotal=Number.isInteger(e.numResults)?e.numResults:0,this.searchResultPagination.last=Math.ceil(this.searchResultsTotal/this.searchResultPagination.pageSize),this.searchResultAggregations=e.aggregations?e.aggregations:{},this.publish(o.U9)):this.showFetchError()}).catch(()=>
1this.showFetchError())}showFetchError(){c.A.toggleElementVisibility(this.searchLoader,!1),c.A.toggleElementVisibility(this.searchError,!0)}createResultList(){c.A.toggleElementVisibility(this.searchLoader,!1),0!==this.teasers.length?(this.teasers.forEach(e=>{const t="article"===e.collection;let i="m-list-wide-compact";t||(i="m-list-wide-left",e.imageId||(e.classmodifier="disable-"));const s=ci.instance.create(e,i);if(s){if(t){const e=Oe.A.populateElement(Oe.A.createElementByPrototypeId("prototype-border-separator-secondary"));e&&this.resultsList.append(e)}else s.classList.add("lg:mb-24","md:mb-16","sm:mb-16");this.resultsList.append(s)}}),c.A.toggleElementVisibility(this.pagination,!0),this.publish(o.ph),this.scan()):c.A.toggleElementVisibility(this.searchEmpty,!0)}updateFilters(){const e=this.settings.fieldsets[this.fieldsetSlug];this.searchOptions.fields=e&&e.value?e.value:"";const t=this.segmentSlugs.length>0?this.segmentSlugs:this.defaultSegmentSlugs;this.searchOptions.segments=t.map(e=>this.settings.segments&&this.settings.segments[e]&&this.settings.segments[e].value?this.settings.segments[e].value:"");const i=this.settings.timespans[this.timespanSlug];i&&Number.isInteger(i.after)&&Number.isInteger(i.before)&&(this.searchOptions.after=i.after,this.searchOptions.before=i.before);const s=this.settings.cooktimes[this.cooktimeSlug];this.searchOptions.cooktimeMin=s&&Number.isInteger(s.cooktimeMin)?s.cooktimeMin:null,this.searchOptions.cooktimeMax=s&&Number.isInteger(s.cooktimeMax)?s.cooktimeMax:null,this.searchOptions.subdimensions=this.subdimensionSlugs,this.searchFilterIcon&&this.searchFilterNotificationIcon&&(c.A.toggleElementVisibility(this.searchFilterIcon,!this.validateSearchFilter()),c.A.toggleElementVisibility(this.searchFilterNotificationIcon,this.validateSearchFilter())),this.searchFilterResetButtons.forEach(e=>{c.A.toggleElementVisibility(e,this.validateSearchFilter())})}updateResultTexts(){const e=`${new Intl.NumberFormat("de-DE",{style:"decimal"}).format(this.searchResultsTotal)} Ergebnis${1!==this.searchResultsTotal?"se":""}`,t=this.searchHeadline.querySelector("[data-search-result-headline]");if(t)if(this.validateSearchFilter()||this.validateSearchInput()){const i=this.searchOptions.displayQuery||this.searchOptions.query;let s=e;i&&(s+=` für „${ei.capitalizeFirstLetter(i)}“`),t.textContent=s}else this.validateSearchFilter()||this.validateSearchInput()||0===this.searchResultsTotal||(t.textContent=this.settings.resultHeadlineAll?this.settings.resultHeadlineAll:"Alle Ergebnisse");if(this.searchResultButton){const t=this.searchResultButton.querySelector("[data-label]");t&&(t.textContent=e)}}updatePagination(){this.paginationCurrentPage.innerText=this.searchResultPagination.current,this.paginationLastPage.innerText=this.searchResultPagination.last,this.paginationPrev.classList.toggle("hidden",this.searchResultPagination.current<=1),this.paginationNext.classList.toggle("hidden",this.searchResultPagination.current===this.searchResultPagination.last)}goToPage(e,t){e.preventDefault();let i=t||1;i=i>1?t:1,i=i<this.searchResultPagination.last?i:this.searchResultPagination.last,this.searchResultPagination.current=i,this.executeSearch(),this.searchResults&&(this.scrollTrigger=!0)}resetFilters(e){e.preventDefault(),this.searchTimespanSelect&&(this.searchTimespanSelect.value=this.defaultTimespanSlug||this.searchTimespanSelect.querySelector("option").value),this.searchFieldsetRadioGroup&&(this.searchFieldsetRadioGroup.value=this.defaultFieldsetSlug),this.searchCooktimeRadioGroup&&(this.searchCooktimeRadioGroup.value=this.defaultCooktimeSlug),this.searchSegmentsCheckboxes&&this.searchSegmentsCheckboxes.length>0&&this.searchSegmentsCheckboxes.forEach(e=>{const t=this.settings.segments[e.value];e.checked=t&&t.default}),this.searchSubdimensionCheckboxes&&Object.keys(this.searchSubdimensionCheckboxes).forEach(e=>{this.searchSubdimensionCheckboxes[e].forEach(e=>{e.checked=!1})}),this.updateUrlParams(),this.updateFilters(),this.executeSearch()}get timespanSlug(){return this.searchTimespanSelect?this.searchTimespanSelect.value:""}get defaultTimespanSlug(){return this.settings.timespans?Object.keys(this.settings.timespans).find(e=>!!this.settings.timespans[e].default):""}get fieldsetSlug(){return this.searchFieldsetRadioGroup?this.searchFieldsetRadioGroup.value:""}get defaultFieldsetSlug(){return this.settings.fieldsets?Object.keys(this.settings.fieldsets).find(e=>!!this.settings.fieldsets[e].default):""}get cooktimeSlug(){return this.searchCooktimeRadioGroup?this.searchCooktimeRadioGroup.value:""}get defaultCooktimeSlug(){return this.settings.cooktimes?Object.keys(this.settings.cooktimes).find(e=>!!this.settings.cooktimes[e].default):""}get segmentSlugs(){return this.searchSegmentsCheckboxes?this.searchSegmentsCheckboxes.filter(e=>!!e.checked).map(e=>e.value):[]}get defaultSegmentSlugs(){return this.settings.segments?Object.keys(this.settings.segments).filter(e=>!!this.settings.segments[e].default):[]}get subdimensionSlugs(){return!this.settings.dimensions||!this.settings.dimensions.length>0?{}:Object.fromEntries(this.settings.dimensions.map(e=>{if(!this.searchSubdimensionCheckboxes[e])return[e,[]];return[e,this.searchSubdimensionCheckboxes[e].filter(e=>!!e.checked).map(e=>e.value)]}))}destroy(){this.searchForm.removeEventListener("submit",this.boundExecuteSearch),this.searchFilters.removeEventListener("submit",this.boundExecuteSearch),this.searchFilters.removeEventListener("change",this.boundFilterResults),this.searchFilterResetButtons.forEach(e
1=>{e.removeEventListener("click",this.boundResetFilters)}),this.paginationNext.removeEventListener("click",this.boundGoToNextPage),this.paginationPrev.removeEventListener("click",this.boundGoToPrevPage),this.searchInput.removeEventListener("input",this.boundOnSearchInputValueChanged),this.searchInputClearButton.removeEventListener("click",this.boundOnClearIconClicked),super.destroy()}},Video:class extends ai{constructor(...e){super(...e),this.video=this.el.querySelector('[data-video-el="video"]'),this.poster=this.el.querySelector('[data-video-el="poster"]'),this.loader=this.el.querySelector('[data-video-el="loader"]'),!g.A.isInternetExplorer&&Element.prototype.closest&&(this.mouseTarget=this.el.closest('[data-video-el="mouseTarget"]')),this.mouseTarget=this.mouseTarget||this.el,this.settings=this.data.settings?JSON.parse(this.data.settings):{},this.dataSrc=this.video?this.video.getAttribute("data-src"):"",this.jwplayerMediaId=this.settings.jwplayerMediaId?this.settings.jwplayerMediaId:"",this.useJwplayerVideoThumbnail=!!this.settings.useJwplayerVideoThumbnail,this.useJwplayerDeliveryAPI=!!this.settings.useJwplayerDeliveryAPI,this.lazyload=!!this.settings.lazyload,this.loop=!!this.settings.loop,this.backgroundColor=this.settings.backgroundColor?this.settings.backgroundColor:"",this.blurredBackgroundClasses=Array.isArray(this.settings.blurredBackgroundClasses)?this.settings.blurredBackgroundClasses:[],this.autoplayModeOnMouseOver=!!this.settings.autoplayOnMouseOver,this.maxPlays=Number.isInteger(this.settings.maxPlays)?this.settings.maxPlays:null,this.jwplayerPlaylistId=this.settings.jwplayerPlaylistId?this.settings.jwplayerPlaylistId:"",this.settings.autoplay?this.autoplayMode=!g.A.isMobile&&this.autoplayModeOnMouseOver?Yi:Ki:this.autoplayMode=Xi,this.boundOnMouseEnter=e=>this.onMouseEnter(e),this.boundOnMouseMove=e=>this.onMouseMove(e),this.boundOnLazyLoad=e=>this.onLazyLoad(e),this.boundOnVideoCanPlay=()=>this.onVideoCanPlay(),this.boundOnVideoLoadedMetadata=()=>this.onVideoLoadedMetadata(),this.boundOnVideoPlaying=()=>this.onVideoPlaying(),this.boundOnVideoWaiting=()=>this.onVideoWaiting(),this.boundOnVideoEnded=()=>this.onVideoEnded(),this.boundOnVideoError=()=>this.onError(),this.completedPlays=0,this.isInitialized=!1,this.isLoaded=!1,this.mode=Wi,this.state=Gi,this.video&&(this.dataSrc||this.jwplayerMediaId||this.jwplayerPlaylistId)?this.init():this.onError()}init(){(g.A.isMobileSafari||l.A.isIOSApp)&&this.video.addEventListener("loadedmetadata",this.boundOnVideoLoadedMetadata),this.video.addEventListener("canplay",this.boundOnVideoCanPlay),this.video.addEventListener("playing",this.boundOnVideoPlaying),this.video.addEventListener("waiting",this.boundOnVideoWaiting),this.video.addEventListener("ended",this.boundOnVideoEnded),this.video.addEventListener("error",this.boundOnVideoError),this.autoplayMode!==Xi&&(this.intersectionObserverTarget=this.el,this.intersectionObserver=null,this.initIntersectionObserver(),this.autoplayMode===Yi&&this.mouseTarget.addEventListener("mouseenter",this.boundOnMouseEnter)),this.lazyload?this.el.addEventListener("lazybeforeunveil",this.boundOnLazyLoad):this.loadVideo()}loadVideo(){this.dataSrc?(this.loadVideoByDataSrc(),this.loadPosterFallback()):this.jwplayerPlaylistId?this.loadJwPlaylistFromApi():this.jwplayerMediaId&&this.useJwplayerVideoThumbnail?(this.loadJwVideoThumbnailWithAssembledUrl(),this.loadPosterFallback()):this.jwplayerMediaId&&this.useJwplayerDeliveryAPI?this.loadJwVideoFromApi():this.onError()}loadVideoByDataSrc(){this.dataSrc&&(this.src=this.dataSrc)}loadJwVideoThumbnailWithAssembledUrl(){if(!this.jwplayerMediaId)return;const e=Bi.instance.getVideoThumbnailByMediaId(this.jwplayerMediaId);e?this.src=e:this.onError()}loadJwPlaylistFromApi(){if(!this.jwplayerPlaylistId)return;const e=Bi.instance;e.getPlaylistByPlaylistId(this.jwplayerPlaylistId).then(e=>{if(e.playlist&&e.playlist.length>0){return{playlist:[e.playlist[0]]}}throw new Error("Empty playlist")}).then(t=>{let i="";i=this.useJwplayerVideoThumbnail?e.getVideoThumbnailByMediaObject(t,this.offsetWidth):e.getVideoByMediaObject(t,this.offsetWidth),i?(this.src=i,this.poster||this.videoPoster||(this.videoPoster=e.getImageThumbnailByMediaObject(t,this.offsetWidth))
1):this.onError()}).catch(()=>this.onError())}loadJwVideoFromApi(){if(!this.jwplayerMediaId)return;const e=Bi.instance;e.getMediaObjectByMediaId(this.jwplayerMediaId).then(t=>{let i="";i=this.useJwplayerVideoThumbnail?e.getVideoThumbnailByMediaObject(t,this.offsetWidth):e.getVideoByMediaObject(t,this.offsetWidth),i?(this.src=i,this.poster||this.videoPoster||(this.videoPoster=e.getImageThumbnailByMediaObject(t,this.offsetWidth))):this.onError()}).catch(()=>this.onError())}loadPosterFallback(){if(!this.poster&&!this.videoPoster&&this.jwplayerMediaId){const e=Bi.instance;e.getMediaObjectByMediaId(this.jwplayerMediaId).then(t=>{this.videoPoster=e.getImageThumbnailByMediaObject(t,this.offsetWidth)}).catch(()=>{})}}initIntersectionObserver(){this.intersectionObserverTarget&&(this.intersectionObserver=new IntersectionObserver(e=>this.onIntersectionChanged(e),{threshold:[0,.5]}),this.intersectionObserver.observe(this.intersectionObserverTarget))}play(){"function"==typeof this.video.play&&this.video.play()}pause(){this.isPlaying&&"function"==typeof this.video.pause&&this.video.pause()}stop(){this.isPlaying&&"function"==typeof this.video.pause&&(this.video.pause(),this.video.currentTime=0,this.videoPoster&&"function"==typeof this.video.load&&this.video.load())}onLazyLoad(e){e.target===this.el&&this.loadVideo()}onVideoLoadedMetadata(){this.onVideoCanPlay()}onVideoCanPlay(){this.isLoaded||(this.isLoaded=!0,this.mode===zi&&this.play())}onVideoPlaying(){this.mode===Wi?this.stop():this.state=Zi}onVideoWaiting(){this.state=Ji}onVideoEnded(){this.completedPlays+=1,Number.isInteger(this.maxPlays)&&this.completedPlays>=this.maxPlays?(this.mode=Wi,this.destroy()):this.loop&&this.completedPlays<this.maxPlays?this.play():this.mode=Wi}onIntersectionChanged(e){e[0].isIntersecting?this.autoplayMode===Ki&&e[0].intersectionRatio>=.5&&(this.mode=zi):!this.maxPlays&&this.useJwplayerVideoThumbnail?this.mode=Wi:this.mode=qi}onMouseEnter(){this.mode=zi}onMouseMove(e){this.isMousePositionInside(e.clientX,e.clientY)||(this.mode=Wi)}onError(){this.state=Qi,this.destroy()}isMousePositionInside(e,t){if(!Number.isInteger(e)||!Number.isInteger(t))return!1;const i=this.mouseTarget.getBoundingClientRect(),s=e-i.left,n=t-i.top;return s>=0&&s<=i.width&&n>=0&&n<=i.height}togglePoster(e){"blur"===this.backgroundColor&&this.blurredBackgroundClasses.length>0?this.blurredBackgroundClasses.forEach(t=>{this.poster.classList.toggle(t,!e)}):c.A.toggleElementVisibility(this.poster,e)}get offsetWidth(){return this.el&&this.el.offsetWidth?this.el.offsetWidth:0}get isPlaying(){return this.video&&this.video.currentTime>0&&!this.video.paused&&!this.video.ended&&this.video.readyState>this.video.HAVE_CURRENT_DATA}get src(){return this._src?this._src:""}set src(e){e&&this.video&&!this.video.getAttribute("src")&&(this._src=e,this.video.setAttribute("src",e))}get videoPoster(){return this.video&&this.video.getAttribute("poster")?this.video.getAttribute("poster"):""}set videoPoster(e){e&&this.video&&!this.video.getAttribute("poster")&&this.video.setAttribute("poster",e)}get mode(){return this._mode?this._mode:""}set mode(e){if(this._mode!==e)switch(this._mode=e,e){case zi:this.isLoaded?this.play():this.state=Hi,this.autoplayMode===Yi&&window.addEventListener("mousemove",this.boundOnMouseMove);break;case qi:this.isLoaded&&this.pause(),this.autoplayMode===Yi&&window.removeEventListener("mousemove",this.boundOnMouseMove);break;default:this.state=Gi,this.isLoaded&&this.stop(),this.autoplayMode===Yi&&window.removeEventListener("mousemove",this.boundOnMouseMove)}}set state(e){if(this._state!==e)switch(this._state=e,e){case Hi:c.A.toggleElementVisibility(this.loader,!0),this.poster?(this.togglePoster(!0),c.A.toggleElementVisibility(this.video,!1)):c.A.toggleElementVisibility(this.video,!0);break;case Ji:c.A.toggleElementVisibility(this.loader,!0),this.togglePoster(!1),c.A.toggleElementVisibility(this.video,!0);break;case Zi:c.A.toggleElementVisibility(this.loader,!1),this.togglePoster(!1),c.A.toggleElementVisibility(this.video,!0);break;default:c.A.toggleElementVisibility(this.loader,!1),this.poster?(this.togglePoster(!0),c.A.toggleElementVisibility(this.video,!1)):c.A.toggleElementVisibility(this.video,!0)}}destroy(){this.el.removeEventListener("lazybeforeunveil",this.boundOnLazyLoad),this.mouseTarget.removeEventListener("mouseenter",this.boundOnMouseEnter),window.removeEventListener("mousemove",this.boundOnMouseMove),this.intersectionObserver&&"function"==typeof this.intersectionObserver.disconnect&&this.intersectionObserver.disconnect(),this.video&&(this.video.removeEventListener("canplay",this.boundOnVideoCanPlay),this.video.removeEventListener("loadedmetadata",this.boundOnVideoLoadedMetadata),this.video.removeEventListener("playing",this.boundOnVideoPlaying),this.video.removeEventListener("waiting",this.boundOnVideoWaiting),this.video.removeEventListener("ended",this.boundOnVideoEnded),this.video.removeEventListener("error",this.boundOnVideoError)),super.destroy()}}});qe.then(()=>(()=>{const e={};e[o.TK]=K,e[o.gw]=X,e[o.pM]=de,e[o.IO]=he,e[o.uf]=ue,e[o.ZV]=pe,e[o.GS]=me,e[o.Vv]=ge,e[o.nw]=ye,e[o.HE]=G,e[o.ZO]=Te,e[o.y9]=Re,e[o.OL]=ft,e[o.qT]=Le,e[o.eY]=ve,e[o.oW]=_e,e[o.BJ]=Fe,e[o.pH]=Ve,e[o.jg]=At,e[o.wZ]=bt,e[o.JI]=Gt,e[o.cB]=J,e[o.$S]=qt,e[o.K_]=Wt,Object.keys(e).forEach(t=>
1{c.A.subscribe(t,(...i)=>{const s=new e[t];"function"==typeof s.execute?s.execute(...i):console.error(`Controller "${s.constructor.name}" is missing an execute function.`)})}),window.polygon.componentLoader&&"function"==typeof window.polygon.componentLoader.destroy?window.polygon.componentLoader.destroy(Zs):window.polygon.componentLoader=Zs,setTimeout(()=>{window.Alpine=a.A,a.A.plugin(bs),a.A.plugin(As),a.A.plugin(ws),a.A.plugin(Is.A),a.A.plugin(vs),a.A.plugin(Ds),a.A.plugin($s),a.A.plugin(Vs),a.A.plugin(Hs),a.A.plugin(Js),a.A.store("AffiliateConsent",es),a.A.store("AppProducts",Bt),a.A.store("HtmlEmbedConsent",is),a.A.store("Gift",ke),a.A.store("MediaQuery",h),a.A.store("StoryHistory",ss),a.A.store("User",ns),a.A.store("ThirdpartyConsent",ts),a.A.store("WebAudio",le)},0),setTimeout(()=>{window.polygon.saras=zt.instance,window.polygon.appBridge=H.A.instance,window.polygon.adBridge=B.instance,window.polygon.keyboardDetection=He.instance,window.polygon.breakingNewsData=we.instance,window.polygon.tcDataModel=P.instance,window.polygon.triggerHandler=Zt.instance,window.polygon.browserHistoryService=Oi.instance,window.polygon.overlayHandler=wt.A.instance,window.polygon.messenger=yt.instance,window.polygon.bookmarks=z.instance,window.polygon.eventObserver=$e.instance,window.polygon.userCapping=si.instance,window.polygon.sourcepoint=Nt.instance,c.A.publish(o.gw),window.polygon.lazyLoading=Ye.instance,window.polygon.componentLoader.scan(),window.polygon.webAudio=new ni},0),setTimeout(()=>{a.A.start()},0)})())}},e=>{e.O(0,[608],()=>{return t=693,e(e.s=t);var t});e.O()}]);

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.