1import{aG as U}from"./Dq6yr8be.js";import{e as k,f as I}from"./Bfn4DVvf.js";import{j as M,a as B,B as T,n as $,l as O,a0 as j}from"./HrPAxp1u.js";const n="v-hidden",N=I("[v-hidden]",{display:"none!important"}),q=M({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:m}){const v=B(null),A=B(null);function p(S){const{value:r}=v,{getCounter:b,getTail:u}=t;let o;if(b!==void 0?o=b():o=A.value,!r||!o)return;o.hasAttribute(n)&&o.removeAttribute(n);const{children:C}=r;if(S.showAllItemsBeforeCalculate)for(const e of C)e.hasAttribute(n)&&e.removeAttribute(n);const c=r.offsetWidth,W=[],i=m.tail?u==null?void 0:u():null;let f=i?i.offsetWidth:0,d=!1;const w=r.children.length-(m.tail?1:0);for(let e=0;e<w-1;++e){if(e<0)continue;const l=C[e];if(d){l.hasAttribute(n)||l.setAttribute(n,"");continue}else l.hasAttribute(n)&&l.removeAttribute(n);const y=l.offsetWidth;if(f+=y,W[e]=y,f>c){const{updateCounter:x}=t;for(let s=e;s>=0;--s){const h=w-1-s;x!==void 0?x(h):o.textContent=`${h}`;const g=o.offsetWidth;if(f-=W[s],f+g<=c||s===0){d=!0,e=s-1,i&&(e===-1?(i.style.maxWidth=`${c-g}px`,i.style.boxSizing="border-box"):i.style.maxWidth="");const{onUpdateCount:F}=t;F&&F(h);break}}}}const{onUpdateOverflow:a}=t;d?a!==void 0&&a(!0):(a!==void 0&&a(!1),o.setAttribute(n,""))}const R=U();return N.mount({id:"vueuc/overflow",head:!0,anchorMetaName:k,ssr:R}),T(()=>p({showAllItemsBeforeCalculate:!1})),{selfRef:v,counterRef:A,sync:p}},render(){const{$slots:t}=this;return $(()=>this.sync({showAllItemsBeforeCalculate:!1})),O("div",{class:"v-overflow",ref:"selfRef"},[j(t,"default"),t.counter?t.counter():O("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});export{q as V};
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.