"use strict";function timePassed({current:e,duration:i,showAfter:t=null}){if(0===t)return!0;if(null===t||!i)return!1;if(e===t)return!0;let n=e/i*100;return 99.9<n&&(n=100),n>=t}function lightOrDark(e){if(!e)return;let i,t,n,r;if(e.match(/^rgb/)){const r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);i=r[1],t=r[2],n=r[3]}else{const r=+("0x"+e.slice(1).replace(e.length<5&&/./g,"$&$&"));i=r>>16,t=r>>8&255,n=255&r}return r=Math.sqrt(i*i*.299+t*t*.587+n*n*.114),r>127.5?"light":"dark"}function timeToSeconds(e){let i,t=e.split(":");return t.length>1&&(i=60*parseInt(t[0])),parseInt(t[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(),t=/safari/.test(i);return/iphone|ipod|ipad/.test(i)?!(!e&&t)&&(!e&&!t||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,t,n,r,o;if(isMobile()&&!(null===(t=null===(i=null==e?void 0:e.config)||void 0===i?void 0:i.blockAttributes)||void 0===t?void 0:t.playsInline)&&("function"==typeof(null===(n=null==e?void 0:e.media)||void 0===n?void 0:n.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})}}exports.exitFullScreen=exitFullScreen,exports.isAndroidWebView=isAndroidWebView,exports.isIOS=isIOS,exports.lightOrDark=lightOrDark,exports.parseColor=parseColor,exports.timePassed=timePassed,exports.timeToSeconds=timeToSeconds;