const e=require("../_util/classNames.js"),t=require("../locale/en_US.js"),n=require("../locale/LocaleReceiver.js"),r=require("../tooltip/index.js"),i=require("../grid/Col.js"),a=require("./context.js");let o=require("vue"),s=require("@antsoo-lib/icons");var c=(c,{slots:l,emit:u,attrs:d})=>{let{prefixCls:f,htmlFor:p,labelCol:m,labelAlign:h,colon:g,required:_,requiredMark:v}={...c,...d},[y]=n.useLocaleReceiver(`Form`),b=c.label??l.label?.();if(!b)return null;let{vertical:x,labelAlign:S,labelCol:C,labelWrap:w,colon:T}=a.useInjectForm(),E=m||C?.value||{},D=h||S?.value,O=`${f}-item-label`,k=e.default(O,D===`left`&&`${O}-left`,E.class,{[`${O}-wrap`]:!!w.value}),A=b,j=g===!0||T?.value!==!1&&g!==!1;if(j&&!x.value&&typeof b==`string`&&b.trim()!==``&&(A=b.replace(/[:|：]\s*$/,``)),c.tooltip||l.tooltip){let e=(0,o.createVNode)(`span`,{class:`${f}-item-tooltip`},[(0,o.createVNode)(r.default,{title:c.tooltip},{default:()=>[(0,o.createVNode)(s.QuestionCircleOutlined,null,null)]})]);A=(0,o.createVNode)(o.Fragment,null,[A,l.tooltip?l.tooltip?.({class:`${f}-item-tooltip`}):e])}v===`optional`&&!_&&(A=(0,o.createVNode)(o.Fragment,null,[A,(0,o.createVNode)(`span`,{class:`${f}-item-optional`},[y.value?.optional||t.default.Form?.optional])]));let M=e.default({[`${f}-item-required`]:_,[`${f}-item-required-mark-optional`]:v===`optional`,[`${f}-item-no-colon`]:!j});return(0,o.createVNode)(i.default,{...E,class:k},{default:()=>[(0,o.createVNode)(`label`,{for:p,class:M,title:typeof b==`string`?b:``,onClick:e=>u(`click`,e)},[A])]})};c.displayName=`FormItemLabel`,c.inheritAttrs=!1,exports.default=c;