function timePassed({current:e,duration:i,showAfter:n=null}){if(0===n)return!0;if(null===n||!i)return!1;if(e===n)return!0;let t=e/i*100;return 99.9<t&&(t=100),t>=n}function lightOrDark(e){if(!e)return;let i,n,t,r;if(e.match(/^rgb/)){const r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);i=r[1],n=r[2],t=r[3]}else{const r=+("0x"+e.slice(1).replace(e.length<5&&/./g,"$&$&"));i=r>>16,n=r>>8&255,t=255&r}return r=Math.sqrt(i*i*.299+n*n*.587+t*t*.114),r>127.5?"light":"dark"}function timeToSeconds(e){let i,n=e.split(":");return n.length>1&&(i=60*parseInt(n[0])),parseInt(n[1])+parseInt(i)}function getMobileOperatingSystem(){var e=navigator.userAgent||navigator.vendor;return/windows phone/i.test(e)?"Windows Phone":/android/i.test(e)?"Android":"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||/(iPad|iPhone|iPod)/gi.test(navigator.platform)?"iOS":"unknown"}function isIOS(){return"iOS"===getMobileOperatingSystem()}function isMobile(){return"unknown"!==getMobileOperatingSystem()}function isWebView(){var e=window.navigator.standalone,i=window.navigator.userAgent.toLowerCase(),n=/safari/.test(i);return/iphone|ipod|ipad/.test(i)?!(!e&&n)&&(!e&&!n||void 0):!!i.includes("wv")}function isAndroidWebView(){return!("Android"!==getMobileOperatingSystem()||!isWebView())}function parseColor(e){var i=e.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);return i?[i[1],i[2],i[3],"1"]:(i=e.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((0.)?\d+)\s*\)$/i))?[i[1],i[2],i[3],i[4]]:void 0}function exitFullScreen(e){var i,n,t,r,o;if(isMobile()&&!(null===(n=null===(i=null==e?void 0:e.config)||void 0===i?void 0:i.blockAttributes)||void 0===n?void 0:n.playsInline)&&("function"==typeof(null===(t=null==e?void 0:e.media)||void 0===t?void 0:t.webkitExitFullScreen)&&(null==e||e.media.webkitExitFullScreen()),"function"==typeof(null===(r=null==e?void 0:e.embed)||void 0===r?void 0:r.exitFullscreen)&&(null===(o=null==e?void 0:e.embed)||void 0===o||o.exitFullscreen()),"youtube"===e.provider)){const i=e.currentTime;e.currentTime=e.duration,e.once("playing",()=>{e.currentTime=i})}}export{timeToSeconds as a,isIOS as b,exitFullScreen as e,isAndroidWebView as i,lightOrDark as l,parseColor as p,timePassed as t};