/**
@license
Copyright (c) 2020 Vaadin Ltd.
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
class DirHelper{static detectScrollType(){const e=document.createElement("div");e.textContent="ABCD",e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e);let t="reverse";return e.scrollLeft>0?t="default":(e.scrollLeft=2,e.scrollLeft<2&&(t="negative")),document.body.removeChild(e),t}static getNormalizedScrollLeft(e,t,l){const{scrollLeft:r}=l;if("rtl"!==t||!e)return r;switch(e){case"negative":return l.scrollWidth-l.clientWidth+r;case"reverse":return l.scrollWidth-l.clientWidth-r}return r}static setNormalizedScrollLeft(e,t,l,r){if("rtl"===t&&e)switch(e){case"negative":l.scrollLeft=l.clientWidth-l.scrollWidth+r;break;case"reverse":l.scrollLeft=l.scrollWidth-l.clientWidth-r;break;default:l.scrollLeft=r}else l.scrollLeft=r}}export{DirHelper};