import{_ as x,d as g,n as k,ff as y,p as b,o as l,c as u,F as C,z as T,x as B,G as E}from"./index.js";const w={fixed:"","p-5":"","text-sm":"","font-bold":""},D=["onClick"],N=g({__name:"anchor",props:{map:{type:Map,required:!0}},setup(_){const n=_,r=k(null),{y:t}=y(r);b(()=>{r.value=document.getElementsByClassName("el-scrollbar__wrap")[1]});function d(s){const{top:e}=n.map.get(s);r.value.scrollTo({top:Number(e)})}function m(s){let e=0,o=0;const a=[...n.map.entries()],{top:v,index:c}=n.map.get(s);return a.forEach(([z,{index:i,top:p}])=>{const f=c+1===i,h=c-1===i;f&&(e=p),h&&(o=p)}),c===0?t.value>=0&&t.value<e:t.value>o&&t.value<e&&t.value>=v}return(s,e)=>(l(),u("ul",w,[(l(!0),u(C,null,T(s.map.entries(),([o],a)=>(l(),u("li",{class:B(["hover:text-blue hover:bg-#f7f7f7 cursor-pointer duration-200ms p-1.5 m-1 rounded",{"is-active":m(o)}]),onClick:()=>d(o),key:a},E(o),11,D))),128))]))}});var F=x(N,[["__scopeId","data-v-5d3b9dd1"],["__file","D:/work/jiesuan/settle-vue3/src/views/search/standBook/components/anchor.vue"]]);export{F as default};
