import{n as e}from"./rolldown-runtime-DAXXjFlN.js";import{i as t,r as n}from"./useLyricPrecisionTick-Cuc-PWwe.js";function r(e,n){i(e);let r={binding:n,unsubscribe:()=>{}};r.unsubscribe=t(t=>{let n=r.binding.end-r.binding.start;if(n<=0){e.style.setProperty(`--lyric-duration-completion-rate`,`0%`),e.style.setProperty(`--lyric-duration-completion-multi`,`0`);return}let i=(t-r.binding.start)/n;i<0?i=0:i>1&&(i=1),e.style.setProperty(`--lyric-duration-completion-rate`,`${i*100}%`),e.style.setProperty(`--lyric-duration-completion-multi`,String(i))}),o.set(e,r)}function i(e){let t=o.get(e);t&&(t.unsubscribe(),o.delete(e))}function a(e,t){return e.start===t.start&&e.end===t.end}var o,s,c=e((()=>{n(),o=new WeakMap,s={mounted(e,t){t.value&&r(e,t.value)},updated(e,t){if(!t.value){i(e);return}let n=o.get(e);if(n&&a(n.binding,t.value)){n.binding=t.value;return}r(e,t.value)},unmounted(e){i(e)}}}));export{s as n,c as t};