const e=require("../_util/vue-types/index.js"),t=require("../_util/BaseInput.js"),n=require("./KeyCode.js");let r=require("vue");var i=(0,r.defineComponent)({compatConfig:{MODE:3},props:{disabled:{type:Boolean,default:void 0},changeSize:Function,quickGo:Function,selectComponentClass:e.default.any,current:Number,pageSizeOptions:e.default.array.def([`10`,`20`,`50`,`100`]),pageSize:Number,buildOptionText:Function,locale:e.default.object,rootPrefixCls:String,selectPrefixCls:String,goButton:e.default.any},setup(e){let i=(0,r.ref)(``),a=(0,r.computed)(()=>!i.value||isNaN(i.value)?void 0:Number(i.value)),o=t=>`${t.value} ${e.locale.items_per_page}`,s=e=>{let{value:t}=e.target;i.value!==t&&(i.value=t)},c=t=>{let{goButton:n,quickGo:r,rootPrefixCls:o}=e;n||i.value===``||(t.relatedTarget&&(t.relatedTarget.className.includes(`${o}-item-link`)||t.relatedTarget.className.includes(`${o}-item`))||r(a.value),i.value=``)},l=t=>{i.value!==``&&(t.keyCode===n.default.ENTER||t.type===`click`)&&(e.quickGo(a.value),i.value=``)},u=(0,r.computed)(()=>{let{pageSize:t,pageSizeOptions:n}=e;return n.some(e=>e.toString()===t.toString())?n:n.concat([t.toString()]).sort((e,t)=>(isNaN(Number(e))?0:Number(e))-(isNaN(Number(t))?0:Number(t)))});return()=>{let{rootPrefixCls:n,locale:a,changeSize:d,quickGo:f,goButton:p,selectComponentClass:m,selectPrefixCls:h,pageSize:g,disabled:_}=e,v=`${n}-options`,y=null,b=null,x=null;if(!d&&!f)return null;if(d&&m){let t=e.buildOptionText||o,n=u.value.map((e,n)=>(0,r.createVNode)(m.Option,{key:n,value:e},{default:()=>[t({value:e})]}));y=(0,r.createVNode)(m,{disabled:_,prefixCls:h,showSearch:!1,class:`${v}-size-changer`,optionLabelProp:`children`,value:(g||u.value[0]).toString(),onChange:e=>d(Number(e)),getPopupContainer:e=>e.parentNode},{default:()=>[n]})}return f&&(p&&(x=typeof p==`boolean`?(0,r.createVNode)(`button`,{type:`button`,onClick:l,onKeyup:l,disabled:_,class:`${v}-quick-jumper-button`},[a.jump_to_confirm]):(0,r.createVNode)(`span`,{onClick:l,onKeyup:l},[p])),b=(0,r.createVNode)(`div`,{class:`${v}-quick-jumper`},[a.jump_to,(0,r.createVNode)(t.default,{disabled:_,type:`text`,value:i.value,onInput:s,onChange:s,onKeyup:l,onBlur:c},null),a.page,x])),(0,r.createVNode)(`li`,{class:`${v}`},[y,b])}}});exports.default=i;