@dreher-media/dm-js-lib 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dm-js-lib.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! dm-js-lib v0.4.
|
|
2
|
-
!function(){"use strict";function t(t){const e=t.dataset.langLink;if(e)return e;const a=t.textContent?.trim().toLowerCase();return a||null}function e(e){sessionStorage.setItem("selected_lang",e),document.querySelectorAll("[data-lang-content]").forEach(t=>{const a=t;a.dataset.langContent===e?(a.style.display="",a.classList.add("lang-active")):(a.style.display="none",a.classList.remove("lang-active"))}),document.querySelectorAll(`.biography-text:not([data-lang-content]):not(.${e})`).forEach(t=>{t.style.display="none"}),document.querySelectorAll(`.biography-text:not([data-lang-content]).${e}`).forEach(t=>{t.style.display="block"}),document.querySelectorAll("[data-lang-link]").forEach(a=>{const n=a;t(n)===e?n.classList.add("active"):n.classList.remove("active")}),document.querySelectorAll(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link]):not([data-lang="${e}"])`).forEach(t=>{t.classList.remove("active")}),document.querySelectorAll(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${e}"]`).forEach(t=>{t.classList.add("active")})}function a(t){const e=t.match(/^([a-z]{2})(?:-|$)/i);return e?e[1].toLowerCase():null}function n(t){if(document.querySelector(`[data-lang-link="${t}"]`))return!0;if(document.querySelector(`[data-lang-content="${t}"]`))return!0;if(document.querySelector(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${t}"]`))return!0;return!!document.querySelector(`.biography-text.${t}`)}function o(){let t=sessionStorage.getItem("selected_lang");if(!t){const e=function(){if(navigator.languages&&navigator.languages.length>0)for(const t of navigator.languages){const e=a(t);if(e)return e}return navigator.language?a(navigator.language):null}();if(e&&n(e))t=e;else{if(!n("en"))return;t="en"}}if(t){const a=document.querySelector(`[data-lang-link="${t}"]`);if(a)return void a.click();const n=document.querySelector(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${t}"]`);if(n)return void n.click();e(t)}}function r(t,e="script"){return new Promise((a,n)=>{const o="script"===e?`script[src="${t}"]`:`link[rel="stylesheet"][href="${t}"]`;if(document.querySelector(o))a();else if("script"===e){const e=document.createElement("script");e.src=t,e.async=!0,e.onload=()=>a(),e.onerror=()=>n(new Error(`Failed to load script: ${t}`)),document.head.appendChild(e)}else if("stylesheet"===e){const e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onload=()=>a(),e.onerror=()=>n(new Error(`Failed to load stylesheet: ${t}`)),document.head.appendChild(e)}else n(new Error(`Unsupported resource type: ${e}`))})}function l(t){return r(t,"script")}"undefined"!=typeof window&&void 0===window.videoSwipers&&(window.videoSwipers=[]);const i=()=>"undefined"!=typeof window?window.videoSwipers:void 0;function d(t){const e=document.querySelectorAll(".youtube");return Array.from(e).some(e=>e.dataset.type===t)}!function(){let t=!1;const e=()=>{window.FsCC?(t||(window.FsCC.consentController.on("updateconsents",()=>{e()}),t=!0),document.querySelectorAll("[fs-cc-reject]").forEach(t=>{const e=t.getAttribute("fs-cc-reject");if(!e)return;const a=window.FsCC?.store.consents[e]??!1,n=document.querySelector(`[fs-cc="${e}"]`);a?(t.style.display="none",n&&(n.style.display="block")):(t.style.display="block",n&&(n.style.display="none"))})):setTimeout(e,200)};document.addEventListener("DOMContentLoaded",e)}(),void 0!==window.Webflow&&window.Webflow.push(()=>{document.querySelectorAll(".copyright-year").forEach(t=>{t.textContent=(new Date).getFullYear().toString()})}),function(){const t=t=>{const e=(t||"").replace(/\/+$/,"").replace(/\.html?$/i,"");return""===e?"/":e};window.addEventListener("load",()=>{const e=t(window.location.pathname);document.querySelectorAll("a[href]").forEach(a=>{const n=a.getAttribute("href");if(!n)return;if(n.startsWith("#")||n.toLowerCase().startsWith("javascript:"))return;let o;try{o=new URL(n,window.location.href)}catch{return}if(o.origin!==window.location.origin)return;t(o.pathname)===e&&a.classList.add("w--current")})})}(),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-separator]").forEach(t=>{const e=t.getAttribute("data-separator");if(!e)return;const a=Array.from(t.children);a.forEach((t,n)=>{if(n<a.length-1){const a=document.createElement("span");a.innerHTML=` ${e} `,t.insertAdjacentElement("afterend",a)}})})}),document.addEventListener("DOMContentLoaded",()=>{const t=t=>{const e=t.dataset.tabTarget;if(e)return e;const a=t.dataset.tabLink;if(a)return a;const n=t.getAttribute("href");return n?.startsWith("#")?n.slice(1):null},e=t=>Array.from(document.querySelectorAll(`[data-tab-content="${t}"]`)),a=e=>{const a=[];return document.querySelectorAll(`.tab-link[data-tab-group="${e}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${e}"]`).forEach(e=>{const n=t(e);n&&a.push(n)}),a},n=e=>{const a=[];return e.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(e=>{const n=t(e);n&&a.push(n)}),a},o=o=>{const r=o.dataset.tabGroup,l=t(o),i=l?e(l):[];if(r)document.querySelectorAll(`.tab-link[data-tab-group="${r}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${r}"]`).forEach(t=>{t.classList.remove("active")}),a(r).forEach(t=>{e(t).forEach(t=>{t.style.display="none",t.classList.remove("active")})});else{const t=o.parentNode;t&&(t.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(t=>{t.classList.remove("active")}),n(t).forEach(t=>{e(t).forEach(t=>{t.style.display="none",t.classList.remove("active")})}))}o.classList.add("active"),i.forEach(t=>{t.style.display="block",t.classList.add("active")})},r=new URLSearchParams(window.location.search),l=r.get("tab"),i=r.get("tabGroup");if(l){let e=null;i?document.querySelectorAll(`.tab-link[data-tab-group="${i}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${i}"]`).forEach(a=>{t(a)===l&&(e=a)}):document.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(a=>{t(a)===l&&(e=a)}),e&&o(e)}if(document.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(t=>{t.addEventListener("click",t=>{t.preventDefault();const e=t.currentTarget;o(e)})}),l||document.querySelectorAll(".tab-link.active:not([data-lang-link]):not([data-lang]), [data-tab-link].active").forEach(o=>{const r=o,l=r.dataset.tabGroup,i=t(r),d=i?e(i):[];if(d.length>0){if(l)a(l).forEach(t=>{e(t).forEach(t=>{d.includes(t)||(t.style.display="none",t.classList.remove("active"))})});else{const t=r.parentNode;t&&n(t).forEach(t=>{e(t).forEach(t=>{d.includes(t)||(t.style.display="none",t.classList.remove("active"))})})}d.forEach(t=>{t.style.display="block",t.classList.add("active")})}}),!l){const t=new Set;document.querySelectorAll(".tab-link[data-tab-first-active]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-first-active]").forEach(e=>{const a=e,n=a.dataset.tabGroup;if(!(i&&n===i||a.classList.contains("active")))if(n){if(t.has(n))return;if(null!==document.querySelector(`.tab-link.active[data-tab-group="${n}"]:not([data-lang-link]):not([data-lang]), [data-tab-link].active[data-tab-group="${n}"]`))return void t.add(n);t.add(n);const e=document.querySelector(`.tab-link[data-tab-group="${n}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${n}"]`);e&&o(e)}else{const t=a.parentNode;t&&null!==t.querySelector(".tab-link.active:not([data-lang-link]):not([data-lang]), [data-tab-link].active")||o(a)}}),document.querySelectorAll("[data-tab-first-active][data-tab-group]").forEach(e=>{const a=e.dataset.tabGroup;if(!a)return;if(i&&a===i)return;if(t.has(a))return;if(null!==document.querySelector(`.tab-link.active[data-tab-group="${a}"]:not([data-lang-link]):not([data-lang]), [data-tab-link].active[data-tab-group="${a}"]`))return void t.add(a);t.add(a);const n=document.querySelector(`.tab-link[data-tab-group="${a}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${a}"]`);n&&o(n)})}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-lang-link]").forEach(a=>{a.addEventListener("click",a=>{a.preventDefault();const n=t(a.currentTarget);n&&e(n)})}),document.querySelectorAll(".biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang]").forEach(t=>{t.addEventListener("click",t=>{t.preventDefault();const a=t.currentTarget,n=a.dataset?.lang;n&&e(n)})}),o()}),"interactive"!==document.readyState&&"complete"!==document.readyState||o(),document.addEventListener("DOMContentLoaded",()=>{let t=[];const e=document.querySelectorAll(".youtube"),a={};let n=!1;const o=document.querySelectorAll("._init-plyr").length>0,c=d("youtube"),s=d("vimeo"),u=d("dailymotion"),y=()=>{void 0!==window.Plyr&&(t=window.Plyr.setup("._init-plyr"),t.forEach(t=>{t.on("play",()=>{p();const t=i();t&&t.forEach(t=>{t.autoplay.stop()})}),t.on("pause",()=>{const t=i();t&&t.forEach(t=>{t.autoplay.start()})})}))},p=(e=null)=>{t.forEach(t=>{t.pause()});for(const[t,n]of Object.entries(a))e!==t&&("youtube"===n.type?n.player.pauseVideo():("vimeo"===n.type||"dailymotion"===n.type)&&n.player.pause())},f=t=>{p(t);const e=i();e&&e.forEach(t=>{t.autoplay.stop()})},g=t=>{const e=i();e&&e.forEach(t=>{t.autoplay.start()})},m=()=>{n||(n=!0,e.forEach(t=>{t.addEventListener("click",()=>{const e=t.querySelector("[data-custom-embed]");e&&(t.innerHTML=e.innerHTML);const n=t,o=`player_${n.dataset.id}`,r=n.dataset.type,l=n.dataset.videoId,i=parseInt(n.dataset.time||"0",10);if(l&&r)if(f(o),"youtube"===r&&window.YT){const t=new window.YT.Player(o,{videoId:l,playerVars:{start:i},events:{onReady:t=>{t.target.playVideo()},onStateChange:t=>{t.data===window.YT.PlayerState.PLAYING?f(o):t.data!==window.YT.PlayerState.PAUSED&&t.data!==window.YT.PlayerState.ENDED||g()}}});a[o]={type:r,player:t}}else if("vimeo"===r&&window.Vimeo){const t=document.getElementById(o);t&&(t.innerHTML="");const e=new window.Vimeo.Player(o,{id:l,autoplay:!0,start:i});e.on("play",()=>f(o)),e.on("pause",()=>g()),a[o]={type:r,player:e}}else"dailymotion"===r&&window.dailymotion&&window.dailymotion.createPlayer(o,{video:l,params:{autoplay:1,start:i,mute:!1}}).then(t=>{t.on("play",()=>f(o)),t.on("pause",()=>g()),t.on("ended",()=>g()),a[o]={type:"dailymotion",player:t}}).catch(t=>{console.error("Error initializing Dailymotion player:",t)})})}))};c&&(window.onYouTubeIframeAPIReady=()=>{m()});const h=[];var w;o&&h.push(window.Plyr&&"function"==typeof window.Plyr.setup?Promise.resolve():Promise.all([(w="https://cdn.plyr.io/3.7.8/plyr.css",r(w,"stylesheet")),l("https://cdn.plyr.io/3.7.8/plyr.polyfilled.js")]).then(()=>{}).catch(t=>{throw console.error("Failed to load Plyr resources:",t),t})),c&&h.push(window.YT&&"function"==typeof window.YT.Player?Promise.resolve():l("https://www.youtube.com/iframe_api").catch(t=>{console.error("Failed to load YouTube API:",t)})),s&&h.push(window.Vimeo&&"function"==typeof window.Vimeo.Player?Promise.resolve():l("https://player.vimeo.com/api/player.js").catch(t=>{console.error("Failed to load Vimeo API:",t)})),u&&h.push(window.dailymotion&&"function"==typeof window.dailymotion.createPlayer?Promise.resolve():l("https://api.dmcdn.net/all.js").catch(t=>{console.error("Failed to load Dailymotion API:",t)})),h.length>0?Promise.all(h).then(()=>{o&&y(),c?setTimeout(()=>{n||m()},1e3):setTimeout(()=>{m()},100)}).catch(t=>{console.error("Error loading video player APIs:",t),o&&void 0!==window.Plyr&&y(),setTimeout(()=>{m()},500)}):(o&&void 0!==window.Plyr&&y(),m());const b=i();b&&b.forEach(t=>{t.on("slideChange",()=>{p()})})}),document.addEventListener("DOMContentLoaded",()=>{const t=["maxresdefault","sddefault","hqdefault","mqdefault","default"],e=(a,n=0)=>{if(a.naturalWidth>120)return;if(n>=t.length)return;const o=t[n],r=a.src,l=new Image;l.onload=()=>{l.naturalWidth>120?a.src=l.src:e(a,n+1)},l.onerror=()=>{e(a,n+1)},l.src=r.replace(/maxresdefault/,o)};document.querySelectorAll(".youtube img").forEach(t=>{e(t)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-download-href]").forEach(t=>{t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const a=t.getAttribute("data-download-href"),n=t.getAttribute("data-download-filename");a&&((t,e)=>{const a=document.createElement("a");a.href=t,a.download=e||t.split("/").pop()||"download",document.body.appendChild(a),a.click(),document.body.removeChild(a)})(a,n)})})})}();
|
|
1
|
+
/*! dm-js-lib v0.4.3 */
|
|
2
|
+
!function(){"use strict";function t(t){const e=t.dataset.langLink;if(e)return e;const a=t.textContent?.trim().toLowerCase();return a||null}function e(e){sessionStorage.setItem("selected_lang",e),document.querySelectorAll("[data-lang-content]").forEach(t=>{const a=t;a.dataset.langContent===e?(a.style.display="",a.classList.add("lang-active")):(a.style.display="none",a.classList.remove("lang-active"))}),document.querySelectorAll(`.biography-text:not([data-lang-content]):not(.${e})`).forEach(t=>{t.style.display="none"}),document.querySelectorAll(`.biography-text:not([data-lang-content]).${e}`).forEach(t=>{t.style.display="block"}),document.querySelectorAll("[data-lang-link]").forEach(a=>{const n=a;t(n)===e?n.classList.add("active"):n.classList.remove("active")}),document.querySelectorAll(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link]):not([data-lang="${e}"])`).forEach(t=>{t.classList.remove("active")}),document.querySelectorAll(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${e}"]`).forEach(t=>{t.classList.add("active")})}function a(t){const e=t.match(/^([a-z]{2})(?:-|$)/i);return e?e[1].toLowerCase():null}function n(t){if(document.querySelector(`[data-lang-link="${t}"]`))return!0;if(document.querySelector(`[data-lang-content="${t}"]`))return!0;if(document.querySelector(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${t}"]`))return!0;return!!document.querySelector(`.biography-text.${t}`)}function o(){let t=sessionStorage.getItem("selected_lang");if(!t){const e=function(){if(navigator.languages&&navigator.languages.length>0)for(const t of navigator.languages){const e=a(t);if(e)return e}return navigator.language?a(navigator.language):null}();if(e&&n(e))t=e;else{if(!n("en"))return;t="en"}}if(t){const a=document.querySelector(`[data-lang-link="${t}"]`);if(a)return void a.click();const n=document.querySelector(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${t}"]`);if(n)return void n.click();e(t)}}function l(t,e="script"){return new Promise((a,n)=>{const o="script"===e?`script[src="${t}"]`:`link[rel="stylesheet"][href="${t}"]`;if(document.querySelector(o))a();else if("script"===e){const e=document.createElement("script");e.src=t,e.async=!0,e.onload=()=>a(),e.onerror=()=>n(new Error(`Failed to load script: ${t}`)),document.head.appendChild(e)}else if("stylesheet"===e){const e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onload=()=>a(),e.onerror=()=>n(new Error(`Failed to load stylesheet: ${t}`)),document.head.appendChild(e)}else n(new Error(`Unsupported resource type: ${e}`))})}function r(t){return l(t,"script")}"undefined"!=typeof window&&void 0===window.videoSwipers&&(window.videoSwipers=[]);const i=()=>"undefined"!=typeof window?window.videoSwipers:void 0;function c(t){const e=document.querySelectorAll(".youtube");return Array.from(e).some(e=>e.dataset.type===t)}!function(){let t=!1;const e=()=>{window.FsCC?(t||(window.FsCC.consentController.on("updateconsents",()=>{e()}),t=!0),document.querySelectorAll("[fs-cc-reject]").forEach(t=>{const e=t.getAttribute("fs-cc-reject");if(!e)return;const a=window.FsCC?.store.consents[e]??!1,n=document.querySelector(`[fs-cc="${e}"]`);a?(t.style.display="none",n&&(n.style.display="block")):(t.style.display="block",n&&(n.style.display="none"))})):setTimeout(e,200)};document.addEventListener("DOMContentLoaded",e)}(),void 0!==window.Webflow&&window.Webflow.push(()=>{document.querySelectorAll(".copyright-year").forEach(t=>{t.textContent=(new Date).getFullYear().toString()})}),function(){const t=t=>{const e=(t||"").replace(/\/+$/,"").replace(/\.html?$/i,"");return""===e?"/":e};window.addEventListener("load",()=>{const e=t(window.location.pathname);document.querySelectorAll("a[href]").forEach(a=>{const n=a.getAttribute("href");if(!n)return;if(n.startsWith("#")||n.toLowerCase().startsWith("javascript:"))return;let o;try{o=new URL(n,window.location.href)}catch{return}if(o.origin!==window.location.origin)return;t(o.pathname)===e&&a.classList.add("w--current")})})}(),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-separator]").forEach(t=>{const e=t.getAttribute("data-separator");if(!e)return;const a=Array.from(t.children);a.forEach((t,n)=>{if(n<a.length-1){const a=document.createElement("span");a.innerHTML=` ${e} `,t.insertAdjacentElement("afterend",a)}})})}),document.addEventListener("DOMContentLoaded",()=>{const t=t=>{const e=t.dataset.tabTarget;if(e)return e;const a=t.dataset.tabLink;if(a)return a;const n=t.getAttribute("href");return n?.startsWith("#")?n.slice(1):null},e=t=>Array.from(document.querySelectorAll(`[data-tab-content="${t}"]`)),a=e=>{const a=[];return document.querySelectorAll(`.tab-link[data-tab-group="${e}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${e}"]`).forEach(e=>{const n=t(e);n&&a.push(n)}),a},n=e=>{const a=[];return e.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(e=>{const n=t(e);n&&a.push(n)}),a},o=o=>{const l=o.dataset.tabGroup,r=t(o),i=r?e(r):[];if(l)document.querySelectorAll(`.tab-link[data-tab-group="${l}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${l}"]`).forEach(t=>{t.classList.remove("active")}),document.querySelectorAll(`[data-tab-content][data-tab-group="${l}"]`).forEach(t=>{t.style.display="none",t.classList.remove("active")}),a(l).forEach(t=>{e(t).forEach(t=>{t.style.display="none",t.classList.remove("active")})});else{const t=o.parentNode;t&&(t.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(t=>{t.classList.remove("active")}),n(t).forEach(t=>{e(t).forEach(t=>{t.style.display="none",t.classList.remove("active")})}))}o.classList.add("active"),i.forEach(t=>{t.style.display="block",t.classList.add("active")})},l=new URLSearchParams(window.location.search),r=l.get("tab"),i=l.get("tabGroup");if(r){let n=null;i?(document.querySelectorAll(`.tab-link[data-tab-group="${i}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${i}"]`).forEach(e=>{t(e)===r&&(n=e)}),document.querySelectorAll(`.tab-link[data-tab-group="${i}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${i}"]`).forEach(t=>{t.classList.remove("active")}),document.querySelectorAll(`[data-tab-content][data-tab-group="${i}"]`).forEach(t=>{t.style.display="none",t.classList.remove("active")}),a(i).forEach(t=>{e(t).forEach(t=>{t.style.display="none",t.classList.remove("active")})})):document.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(e=>{t(e)===r&&(n=e)}),n&&o(n)}if(document.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(t=>{t.addEventListener("click",t=>{t.preventDefault();const e=t.currentTarget;o(e)})}),r||document.querySelectorAll(".tab-link.active:not([data-lang-link]):not([data-lang]), [data-tab-link].active").forEach(o=>{const l=o,r=l.dataset.tabGroup,i=t(l),c=i?e(i):[];if(c.length>0){if(r)document.querySelectorAll(`[data-tab-content][data-tab-group="${r}"]`).forEach(t=>{c.includes(t)||(t.style.display="none",t.classList.remove("active"))}),a(r).forEach(t=>{e(t).forEach(t=>{c.includes(t)||(t.style.display="none",t.classList.remove("active"))})});else{const t=l.parentNode;t&&n(t).forEach(t=>{e(t).forEach(t=>{c.includes(t)||(t.style.display="none",t.classList.remove("active"))})})}c.forEach(t=>{t.style.display="block",t.classList.add("active")})}}),!r){const t=new Set;document.querySelectorAll(".tab-link[data-tab-first-active]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-first-active]").forEach(e=>{const a=e,n=a.dataset.tabGroup;if(!(i&&n===i||a.classList.contains("active")))if(n){if(t.has(n))return;if(null!==document.querySelector(`.tab-link.active[data-tab-group="${n}"]:not([data-lang-link]):not([data-lang]), [data-tab-link].active[data-tab-group="${n}"]`))return void t.add(n);t.add(n);const e=document.querySelector(`.tab-link[data-tab-group="${n}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${n}"]`);e&&o(e)}else{const t=a.parentNode;t&&null!==t.querySelector(".tab-link.active:not([data-lang-link]):not([data-lang]), [data-tab-link].active")||o(a)}}),document.querySelectorAll("[data-tab-first-active][data-tab-group]").forEach(e=>{const a=e.dataset.tabGroup;if(!a)return;if(i&&a===i)return;if(t.has(a))return;if(null!==document.querySelector(`.tab-link.active[data-tab-group="${a}"]:not([data-lang-link]):not([data-lang]), [data-tab-link].active[data-tab-group="${a}"]`))return void t.add(a);t.add(a);const n=document.querySelector(`.tab-link[data-tab-group="${a}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${a}"]`);n&&o(n)})}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-lang-link]").forEach(a=>{a.addEventListener("click",a=>{a.preventDefault();const n=t(a.currentTarget);n&&e(n)})}),document.querySelectorAll(".biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang]").forEach(t=>{t.addEventListener("click",t=>{t.preventDefault();const a=t.currentTarget,n=a.dataset?.lang;n&&e(n)})}),o()}),"interactive"!==document.readyState&&"complete"!==document.readyState||o(),document.addEventListener("DOMContentLoaded",()=>{let t=[];const e=document.querySelectorAll(".youtube"),a={};let n=!1;const o=document.querySelectorAll("._init-plyr").length>0,d=c("youtube"),s=c("vimeo"),u=c("dailymotion"),y=()=>{void 0!==window.Plyr&&(t=window.Plyr.setup("._init-plyr"),t.forEach(t=>{t.on("play",()=>{p();const t=i();t&&t.forEach(t=>{t.autoplay.stop()})}),t.on("pause",()=>{const t=i();t&&t.forEach(t=>{t.autoplay.start()})})}))},p=(e=null)=>{t.forEach(t=>{t.pause()});for(const[t,n]of Object.entries(a))e!==t&&("youtube"===n.type?n.player.pauseVideo():("vimeo"===n.type||"dailymotion"===n.type)&&n.player.pause())},f=t=>{p(t);const e=i();e&&e.forEach(t=>{t.autoplay.stop()})},g=t=>{const e=i();e&&e.forEach(t=>{t.autoplay.start()})},m=()=>{n||(n=!0,e.forEach(t=>{t.addEventListener("click",()=>{const e=t.querySelector("[data-custom-embed]");e&&(t.innerHTML=e.innerHTML);const n=t,o=`player_${n.dataset.id}`,l=n.dataset.type,r=n.dataset.videoId,i=parseInt(n.dataset.time||"0",10);if(r&&l)if(f(o),"youtube"===l&&window.YT){const t=new window.YT.Player(o,{videoId:r,playerVars:{start:i},events:{onReady:t=>{t.target.playVideo()},onStateChange:t=>{t.data===window.YT.PlayerState.PLAYING?f(o):t.data!==window.YT.PlayerState.PAUSED&&t.data!==window.YT.PlayerState.ENDED||g()}}});a[o]={type:l,player:t}}else if("vimeo"===l&&window.Vimeo){const t=document.getElementById(o);t&&(t.innerHTML="");const e=new window.Vimeo.Player(o,{id:r,autoplay:!0,start:i});e.on("play",()=>f(o)),e.on("pause",()=>g()),a[o]={type:l,player:e}}else"dailymotion"===l&&window.dailymotion&&window.dailymotion.createPlayer(o,{video:r,params:{autoplay:1,start:i,mute:!1}}).then(t=>{t.on("play",()=>f(o)),t.on("pause",()=>g()),t.on("ended",()=>g()),a[o]={type:"dailymotion",player:t}}).catch(t=>{console.error("Error initializing Dailymotion player:",t)})})}))};d&&(window.onYouTubeIframeAPIReady=()=>{m()});const h=[];var b;o&&h.push(window.Plyr&&"function"==typeof window.Plyr.setup?Promise.resolve():Promise.all([(b="https://cdn.plyr.io/3.7.8/plyr.css",l(b,"stylesheet")),r("https://cdn.plyr.io/3.7.8/plyr.polyfilled.js")]).then(()=>{}).catch(t=>{throw console.error("Failed to load Plyr resources:",t),t})),d&&h.push(window.YT&&"function"==typeof window.YT.Player?Promise.resolve():r("https://www.youtube.com/iframe_api").catch(t=>{console.error("Failed to load YouTube API:",t)})),s&&h.push(window.Vimeo&&"function"==typeof window.Vimeo.Player?Promise.resolve():r("https://player.vimeo.com/api/player.js").catch(t=>{console.error("Failed to load Vimeo API:",t)})),u&&h.push(window.dailymotion&&"function"==typeof window.dailymotion.createPlayer?Promise.resolve():r("https://api.dmcdn.net/all.js").catch(t=>{console.error("Failed to load Dailymotion API:",t)})),h.length>0?Promise.all(h).then(()=>{o&&y(),d?setTimeout(()=>{n||m()},1e3):setTimeout(()=>{m()},100)}).catch(t=>{console.error("Error loading video player APIs:",t),o&&void 0!==window.Plyr&&y(),setTimeout(()=>{m()},500)}):(o&&void 0!==window.Plyr&&y(),m());const w=i();w&&w.forEach(t=>{t.on("slideChange",()=>{p()})})}),document.addEventListener("DOMContentLoaded",()=>{const t=["maxresdefault","sddefault","hqdefault","mqdefault","default"],e=(a,n=0)=>{if(a.naturalWidth>120)return;if(n>=t.length)return;const o=t[n],l=a.src,r=new Image;r.onload=()=>{r.naturalWidth>120?a.src=r.src:e(a,n+1)},r.onerror=()=>{e(a,n+1)},r.src=l.replace(/maxresdefault/,o)};document.querySelectorAll(".youtube img").forEach(t=>{e(t)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-download-href]").forEach(t=>{t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const a=t.getAttribute("data-download-href"),n=t.getAttribute("data-download-filename");a&&((t,e)=>{const a=document.createElement("a");a.href=t,a.download=e||t.split("/").pop()||"download",document.body.appendChild(a),a.click(),document.body.removeChild(a)})(a,n)})})})}();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! dm-js-lib/previewDetailSwitcher v0.4.
|
|
1
|
+
/*! dm-js-lib/previewDetailSwitcher v0.4.3 */
|
|
2
2
|
var PreviewDetailSwitcher=function(e){"use strict";function t(e={}){const{container:t,itemSelector:r="[data-detail-item]",previewIdAttribute:n="data-preview-id",detailIdAttribute:i="data-detail-id",initialIndex:o=0,displayValue:a="block"}=e,c=(()=>{if(!t)return document;if("string"==typeof t){return document.querySelector(t)||document}return t})(),d=e=>{const t=e.currentTarget;if(!t)return;const o=t.getAttribute(n);if(!o)return;const d=c.querySelector(`${r}[${i}="${o}"]`);if(!d)return;c.querySelectorAll(r).forEach(e=>{e&&(e.style.display="none")}),d.style.display=a},l=()=>{const e=c.querySelectorAll(r);if(0===e.length)return;e.forEach(e=>{e&&(e.style.display="none")});const t=e[o];t?t.style.display=a:e[0]&&(e[0].style.display=a);c.querySelectorAll(`[${n}]`).forEach(e=>{e&&e.addEventListener("click",d)})};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",l):l()}return e.initPreviewDetailSwitcher=t,e.initPreviewDetailSwitchers=function(e,r={}){const n=()=>{document.querySelectorAll(e).forEach(e=>{e&&t({...r,container:e})})};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",n):n()},e}({});
|