import{useInjectRange as e}from"../../RangeContext.mjs";import t from"../../hooks/useMergeProps.mjs";import n from"../PanelBody.mjs";import{formatValue as r,isSameYear as i}from"../../utils/dateUtil.mjs";import a from"../../hooks/useCellClassName.mjs";import{createVNode as o}from"vue";var s=4;function c(c){let l=t(c),{prefixCls:u,value:d,viewDate:f,locale:p,generateConfig:m}=l,{rangedValue:h,hoverRangedValue:g}=e(),_=`${u}-cell`,v=m.getYear(f),y=Math.floor(v/10)*10,b=y+10-1,x=m.setYear(f,y-Math.ceil((3*s-10)/2)),S=a({cellPrefixCls:_,value:d,generateConfig:m,rangedValue:h.value,hoverRangedValue:g.value,isSameCell:(e,t)=>i(m,e,t),isInView:e=>{let t=m.getYear(e);return y<=t&&t<=b},offsetCell:(e,t)=>m.addYear(e,t)});return o(n,{...l,rowNum:s,colNum:3,baseDate:x,getCellText:m.getYear,getCellClassName:S,getCellDate:m.addYear,titleCell:e=>r(e,{locale:p,format:`YYYY`,generateConfig:m})},null)}c.displayName=`YearBody`,c.inheritAttrs=!1;export{c as default};