const e=require("../../_util/classNames.js"),t=require("../locale/en_US.js"),n=require("../../locale/LocaleReceiver.js"),r=require("../../config-provider/hooks/useConfigInject.js"),i=require("../../_util/statusUtils.js"),a=require("../../form/FormItemContext.js"),o=require("../../space/Compact.js"),s=require("../../vc-picker/index.js"),c=require("../style/index.js"),l=require("../util.js"),u=require("./props.js"),d=require("./index.js");let f=require("vue"),p=require("@antsoo-lib/icons");function m(m,h){function g(g,_){return(0,f.defineComponent)({compatConfig:{MODE:3},name:_,inheritAttrs:!1,props:{...u.commonProps(),...u.datePickerProps(),...h},slots:Object,setup(u,{slots:h,expose:_,attrs:v,emit:y}){let b=u,x=a.useInjectFormItemContext(),S=a.FormItemInputContext.useInject(),{prefixCls:C,direction:w,getPopupContainer:T,size:E,rootPrefixCls:D,disabled:O}=r.default(`picker`,b),{compactSize:k,compactItemClassnames:A}=o.useCompactItemContext(C,w),j=(0,f.computed)(()=>k.value||E.value),[M,N]=c.default(C),P=(0,f.ref)();_({focus:()=>{P.value?.focus()},blur:()=>{P.value?.blur()}});let F=e=>b.valueFormat?m.toString(e,b.valueFormat):e,I=(e,t)=>{let n=F(e);y(`update:value`,n),y(`change`,n,t),x.onFieldChange()},L=e=>{y(`update:open`,e),y(`openChange`,e)},R=e=>{y(`focus`,e)},z=e=>{y(`blur`,e),x.onFieldBlur()},B=(e,t)=>{y(`panelChange`,F(e),t)},V=e=>{y(`ok`,F(e))},[H]=n.useLocaleReceiver(`DatePicker`,t.default),U=(0,f.computed)(()=>b.value?b.valueFormat?m.toDate(b.value,b.valueFormat):b.value:b.value===``?void 0:b.value),W=(0,f.computed)(()=>b.defaultValue?b.valueFormat?m.toDate(b.defaultValue,b.valueFormat):b.defaultValue:b.defaultValue===``?void 0:b.defaultValue),G=(0,f.computed)(()=>b.defaultPickerValue?b.valueFormat?m.toDate(b.defaultPickerValue,b.valueFormat):b.defaultPickerValue:b.defaultPickerValue===``?void 0:b.defaultPickerValue);return()=>{let t={...H.value,...b.locale},n={...b,...v},{bordered:r=!0,placeholder:a,suffixIcon:o=h.suffixIcon?.(),showToday:c=!0,transitionName:u,allowClear:_=!0,dateRender:y=h.dateRender,renderExtraFooter:E=h.renderExtraFooter,monthCellRender:k=h.monthCellRender||b.monthCellContentRender||h.monthCellContentRender,clearIcon:F=h.clearIcon?.(),id:K=x.id.value,...q}=n,J=n.showTime===``||n.showTime,{format:Y}=n,X={};g&&(X.picker=g);let Z=g||n.picker||`date`;X={...X,...J?d.getTimeProps({format:Y,picker:Z,...typeof J==`object`?J:{}}):{},...Z===`time`?d.getTimeProps({format:Y,...q,picker:Z}):{}};let Q=C.value,$=(0,f.createVNode)(f.Fragment,null,[o||(g===`time`?(0,f.createVNode)(p.ClockCircleOutlined,null,null):(0,f.createVNode)(p.CalendarOutlined,null,null)),S.hasFeedback&&S.feedbackIcon]);return M((0,f.createVNode)(s.default,{monthCellRender:k,dateRender:y,renderExtraFooter:E,ref:P,placeholder:l.getPlaceholder(t,Z,a),suffixIcon:$,dropdownAlign:l.transPlacement2DropdownAlign(w.value,b.placement),clearIcon:F||(0,f.createVNode)(p.CloseCircleFilled,null,null),allowClear:_,transitionName:u||`${D.value}-slide-up`,...q,...X,id:K,picker:Z,value:U.value,defaultValue:W.value,defaultPickerValue:G.value,showToday:c,locale:t.lang,class:e.default({[`${Q}-${j.value}`]:j.value,[`${Q}-borderless`]:!r},i.getStatusClassNames(Q,i.getMergedStatus(S.status,b.status),S.hasFeedback),v.class,N.value,A.value),disabled:O.value,prefixCls:Q,getPopupContainer:v.getCalendarContainer||T.value,generateConfig:m,prevIcon:h.prevIcon?.()||(0,f.createVNode)(`span`,{class:`${Q}-prev-icon`},null),nextIcon:h.nextIcon?.()||(0,f.createVNode)(`span`,{class:`${Q}-next-icon`},null),superPrevIcon:h.superPrevIcon?.()||(0,f.createVNode)(`span`,{class:`${Q}-super-prev-icon`},null),superNextIcon:h.superNextIcon?.()||(0,f.createVNode)(`span`,{class:`${Q}-super-next-icon`},null),components:d.Components,direction:w.value,dropdownClassName:e.default(N.value,b.popupClassName,b.dropdownClassName),onChange:I,onOpenChange:L,onFocus:R,onBlur:z,onPanelChange:B,onOk:V},null))}}})}return{DatePicker:g(void 0,`ADatePicker`),WeekPicker:g(`week`,`AWeekPicker`),MonthPicker:g(`month`,`AMonthPicker`),YearPicker:g(`year`,`AYearPicker`),TimePicker:g(`time`,`TimePicker`),QuarterPicker:g(`quarter`,`AQuarterPicker`)}}exports.default=m;