1import{r as s,c as e,h as t,m as o,a as i}from"./p-CLQce7zD.js";import{i as l}from"./p-Dojwmvde.js";const n=class{constructor(t){s(this,t),this.ionSegmentViewScroll=e(this,"ionSegmentViewScroll",7),this.scrollEndTimeout=null,this.isTouching=!1,this.disabled=!1,this.swipeGesture=!0}handleScroll(s){var e;const{scrollLeft:t,scrollWidth:o,clientWidth:i}=s.target,n=o-i,a=(l(this.el)?-1:1)*(t/n);this.ionSegmentViewScroll.emit({scrollRatio:a,isManualScroll:null===(e=this.isManualScroll)||void 0===e||e}),this.resetScrollEndTimeout()}handleScrollStart(){this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.isTouching=!0}handleTouchEnd(){this.isTouching=!1}resetScrollEndTimeout(){this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.scrollEndTimeout=setTimeout((()=>{this.checkForScrollEnd()}),100)}checkForScrollEnd(){this.isTouching||(this.isManualScroll=void 0)}async setContent(s,e=!0){const t=this.getSegmentContents().findIndex((e=>e.id===s));if(-1===t)return;this.isManualScroll=!1,this.resetScrollEndTimeout();const o=t*this.el.offsetWidth;this.el.scrollTo({top:0,left:(l(this.el)?-1:1)*o,behavior:e?"smooth":"instant"})}getSegmentContents(){return Array.from(this.el.querySelectorAll("ion-segment-content"))}render(){const{disabled:s,isManualScroll:e,swipeGesture:i}=this;return t(o,{key:"b3cd48fead5d2877ead68cf6d81955fc31530c7a",class:{"segment-view-disabled":s,"segment-view-scroll-disabled":!1===e,"segment-view-swipe-disabled":!1===i}},t("slot",{key:"ad5aa8b79790c490e13438afa0cbb2c241eab0a1"}))}get el(){return i(this)}};n.style={ios:":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled),:host(.segment-view-swipe-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}",md:":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled),:host(.segment-view-swipe-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}"};export{n as ion_segment_view}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.