import{a as e,s as t}from"./appearance-BS3s9rl-.js";var n=`0 0 0 transparent`,r={none:n,soft:`0 0 6px rgba(255,255,255,.45)`,strong:`0 0 8px currentColor, 0 0 16px currentColor`},i=`-1.5px -1.5px 0 #0a0a14, 1.5px -1.5px 0 #0a0a14, -1.5px 1.5px 0 #0a0a14, 1.5px 1.5px 0 #0a0a14`,a=new WeakMap;function o(o,s,c){let l={...s?.vars??{}};if(s?.font&&(e(s.font),l.font=t(s.font)),c){c.font&&=(e(c.font),t(c.font));for(let[e,t]of Object.entries(c))t!=null&&t!==``&&(l[e]=t)}l.glow&&r[l.glow]&&(l.glow=r[l.glow]),`outline`in l&&(l.outline=l.outline===`1`||l.outline===`true`?i:n);let u=a.get(o);if(u)for(let e of u)e in l||o.style.removeProperty(`--oi-${e}`);for(let[e,t]of Object.entries(l))o.style.setProperty(`--oi-${e}`,t);return a.set(o,Object.keys(l)),s?.digitStyle??`normal`}var s=new Set([`-`,`.`,`:`,`/`,` `]);function c(e,t,n=0){let r=[...t],i=Math.max(0,n-r.length),a=[];for(let e=0;e<i;e++)a.push(`<span class="oi-dg" aria-hidden="true">&nbsp;</span>`);for(let e of r){let t=s.has(e)?`oi-dg oi-dg-narrow`:`oi-dg`;a.push(`<span class="${t}">${e===` `?`&nbsp;`:e}</span>`)}e.innerHTML=a.join(``),e.setAttribute(`aria-label`,t)}var l=`
.oi-dg{display:inline-block;width:1ch;text-align:center}
.oi-dg-narrow{width:.6ch}
`;function u(e){let t=null,n=!1,r=null,i=new URLSearchParams(location.search).get(`platform`)??`tiktok`,a=()=>{if(n)return;let o=location.protocol===`https:`?`wss:`:`ws:`;t=new WebSocket(`${o}//${location.host}/ws?platform=${encodeURIComponent(i)}`),t.onmessage=t=>{try{e(JSON.parse(t.data))}catch{}},t.onclose=()=>{n||(r=setTimeout(a,1500))},t.onerror=()=>{try{t?.close()}catch{}}};return a(),()=>{n=!0,r&&clearTimeout(r);try{t?.close()}catch{}}}export{c as i,o as n,u as r,l as t};