import{d3 as p,bI as a}from"./index-DDZqnj79.js";import{T as f,aR as y}from"./vendor-CT-JknSv.chunk.js";const c="player-v2-speed",s="player-v2-quality",n="player-v2-subtitle-track",u="autoplay-enabled",d="player-v2-volume-status",i="podcast-player-speed",E="podcast-autoplay-enabled",o=p(),g="player-v2-theater-mode";function _(e){try{e===""?o.removeItem(n):o.setItem(n,e)}catch(t){a.warn(`Unable to update stored subtitle track, error ${t}`)}}function b(){return o.getItem(n)}function I(e){try{e==="auto"?o.removeItem(s):o.setItem(s,JSON.stringify(e))}catch(t){a.warn(`Unable to update stored playback quality, error ${t}`)}}function v(){try{const e=o.getItem(s);if(!e)return;const t=JSON.parse(e);return t?y(t):void 0}catch(e){a.warn(`Unable to restore preferred player quality, error ${e}`)}}const O=f(e=>{try{o.setItem(d,JSON.stringify(e))}catch(t){a.warn(`Unable to update stored volume status, error ${t}`)}},100);function P(){try{const e=o.getItem(d);if(!e)return;const t=JSON.parse(e);if(t)return t}catch(e){a.warn(`Unable to restore previous volume status, error ${e}`)}}function U(e,t){try{const r=t==="video"?c:i;e===1?o.removeItem(r):o.setItem(r,JSON.stringify(e))}catch(r){a.warn(`Unable to update stored playback rate, error ${r}`)}}function h(e){try{const t=e==="video"?c:i,r=o.getItem(t);return r?parseFloat(JSON.parse(r)):void 0}catch(t){a.warn(`Unable to restore playback rate, error ${t}`)}}function N(e){try{const t=e==="video"?u:E,r=o.getItem(t);if(r!==null){const l=JSON.parse(r);return typeof l=="boolean"?l:!1}}catch(t){a.warn(`Unable to get stored autoplay enabled setting ${t}`)}return!1}function R(e,t){try{const r=t==="video"?u:E;e?o.setItem(r,JSON.stringify(e)):o.removeItem(r)}catch(r){a.warn(`Unable to update stored autoplay enabled setting, error ${r}`)}}export{g as T,P as a,h as b,O as c,R as d,_ as e,b as f,N as g,I as h,v as i,U as s};