scandit-web-datacapture-core
Version:
Scandit Data Capture SDK for the Web
6 lines (3 loc) • 568 B
JavaScript
import { a } from './chunk-O7TZTIHO.js';
function u(t){return t.endsWith("ms")?Number.parseFloat(t):t.endsWith("s")?Number.parseFloat(t)*1e3:0}function c(t){let e=getComputedStyle(t),r=e.transitionDuration.split(",").map(n=>u(n)),i=e.transitionDelay.split(",").map(n=>u(n)),o=r.map((n,s)=>{let m=i[s];return n+m});return Math.max(...o)}async function l(t){let{promise:e,resolve:r,reject:i}=new a,o=c(t),n=setTimeout(()=>{i(new Error("Transition timeout"));},o+50);return t.addEventListener("transitionend",s=>{clearTimeout(n),r(s);},{once:!0}),e}
export { l as a };