"use strict";(globalThis.webpackChunk_plex_client_qt=globalThis.webpackChunk_plex_client_qt||[]).push([["packages_app-splash_showSplashScreen_ts"],{5834:(e,t,o)=>{o.d(t,{showSplashScreen:()=>i});var s=o(22238),n=o.n(s);const a=500,l=2e3;function i(e){const t=document.createElement("div");t.style.position="fixed",t.style.top="0",t.style.right="0",t.style.bottom="0",t.style.left="0",t.style.backgroundColor="#000",t.style.zIndex="13",t.style.transition=`opacity ${a}ms`,document.body.appendChild(t),console.debug("[AppSplash] Loading Animation...");const o=n().loadAnimation({container:t,renderer:"svg",loop:!1,autoplay:!1,animationData:e});let s,i;return{start:()=>(s=new Promise((e=>{console.debug("[AppSplash] Playing animation.");const t=()=>{console.debug("[AppSplash] Animation complete."),e(),o.removeEventListener("complete",t),i=Date.now()};o.addEventListener("complete",t),o.play()})),s),dismiss:async()=>{if(!s)return console.debug("[AppSplash] Animation failed."),Promise.resolve();await s;const e=Date.now()-i;e<l&&await new Promise((t=>{setTimeout(t,l-e)})),t.style.opacity="0",setTimeout((()=>{console.debug("[AppSplash] Destroying splash screen."),o.destroy(),t.remove()}),a)}}}}}]);