import{a as W}from"./apiAdmin-B6-2qm0d.js";import{_ as q,d as H,k as C,l as $,a as N,m as T,e as d,w as a,g as t,b as B,i as c,t as u,c as _,h as D,j,F as E,o as l}from"./app-D7zH3Nl5.js";import{i as z}from"./isSameOrAfter-CflD8PhX.js";import{F as L}from"./FormItemHeading-SJw_nlda.js";import{C as M}from"./CalendarOutlined-m89BWwmS.js";import{D as R,a as G}from"./index-EPVsqf28.js";import{F as J,_ as K}from"./index-DZxk72Vu.js";import{I as P}from"./index-Cu62pBdq.js";import{S as Q}from"./index-_ApNSgqk.js";import{B as X}from"./useFlexGapSupport-CpBR-RD-.js";import{a as Y,_ as Z}from"./index-Cv7zOydE.js";import{_ as F}from"./index-Dp3l5p__.js";import{_ as x}from"./TextArea-C1mL3q5m.js";import{_ as ee}from"./index-BivgQiQE.js";const ae=H({props:["data","visible","pageTitle"],components:{CalendarOutlined:M,FormItemHeading:L},setup(e,{emit:f}){const n=C({}),{addEditRequestAdmin:v,loading:h,rules:y}=W(),p=C(!0);$.extend(z);const{formatDate:i,user:b}=N(),s=()=>{y.value={},f("close")},r=()=>{v({url:"self/employee-feedback",data:n.value,successMessage:"Success",success:m=>{f("addSuccess")}})};return T(()=>e.visible,(m,w)=>{m&&(n.value=e.data,n.value.feedback&&n.value.feedback.last_date&&$().isAfter(n.value.feedback.last_date,"date")?p.value=!1:p.value=!0)}),{rules:y,loading:h,onSubmit:r,feedback:n,toShowFeedbackForm:p,user:b,onClose:s,formatDate:i,drawerWidth:window.innerWidth<=991?"90%":"45%"}}}),te={key:0,style:{"white-space":"pre-wrap"}},oe={key:1};function le(e,f,n,v,h,y){const p=B("FormItemHeading"),i=G,b=R,s=Y,r=Z,m=B("CalendarOutlined"),w=F,I=P,k=K,A=x,O=J,S=X,U=Q,V=ee;return l(),d(V,{title:e.pageTitle,width:e.drawerWidth,open:e.visible,"body-style":{paddingBottom:"80px"},"footer-style":{textAlign:"right"},maskClosable:!1},{footer:a(()=>[t(k,null,{default:a(()=>[t(U,null,{default:a(()=>[e.toShowFeedbackForm?(l(),d(S,{key:0,type:"primary",onClick:e.onSubmit,loading:e.loading},{default:a(()=>[c(u(e.$t("common.submit")),1)]),_:1},8,["onClick","loading"])):D("",!0),t(S,{key:"back",onClick:e.onClose},{default:a(()=>[c(u(e.$t("common.cancel")),1)]),_:1},8,["onClick"])]),_:1})]),_:1})]),default:a(()=>[t(r,{gutter:16},{default:a(()=>[t(s,{xs:24,sm:24,md:24,lg:24},{default:a(()=>[t(p,null,{default:a(()=>[c(u(e.$t("feedback.survey_info")),1)]),_:1}),t(b,{labelStyle:{fontWeight:"bold"},contentStyle:{marginBottom:"15px"},column:1,layout:"vertical",size:"small"},{default:a(()=>[t(i,{label:e.$t("feedback.last_date")},{default:a(()=>[c(u(e.feedback.feedback?e.formatDate(e.feedback.last_date):"-"),1)]),_:1},8,["label"]),t(i,{label:e.$t("feedback.description")},{default:a(()=>[e.feedback.feedback.description?(l(),_("div",te,u(e.feedback.feedback.description),1)):(l(),_("span",oe,"-"))]),_:1},8,["label"])]),_:1})]),_:1})]),_:1}),e.toShowFeedbackForm?(l(),d(r,{key:1},{default:a(()=>[t(s,{span:24},{default:a(()=>[e.feedback.feedback?(l(),d(O,{key:0,layout:"vertical",class:"mt-30"},{default:a(()=>[(l(!0),_(E,null,j(e.feedback.feedback.feedback_form_fields,o=>(l(),_("div",{key:o.id},[o.type=="input"?(l(),d(r,{key:0,gutter:16},{default:a(()=>[t(s,{xs:24,sm:24,md:24,lg:24},{default:a(()=>[t(k,{label:o.name,help:e.rules.reply&&!o.reply?e.rules.reply.message:null,validateStatus:e.rules.reply&&!o.reply?"error":null,class:"required"},{default:a(()=>[t(I,{value:o.reply,"onUpdate:value":g=>o.reply=g,placeholder:e.$t("common.placeholder_default_text",[e.$t("feedback.answers")])},null,8,["value","onUpdate:value","placeholder"])]),_:2},1032,["label","help","validateStatus"])]),_:2},1024)]),_:2},1024)):(l(),d(r,{key:1,gutter:16},{default:a(()=>[t(s,{xs:24,sm:24,md:24,lg:24},{default:a(()=>[t(k,{help:e.rules.reply&&!o.reply?e.rules.reply.message:null,validateStatus:e.rules.reply&&!o.reply?"error":null,label:o.name,class:"required"},{default:a(()=>[t(A,{value:o.reply,"onUpdate:value":g=>o.reply=g,placeholder:e.$t("common.placeholder_default_text",[e.$t("feedback.answers")])},null,8,["value","onUpdate:value","placeholder"])]),_:2},1032,["help","validateStatus","label"])]),_:2},1024)]),_:2},1024))]))),128))]),_:1})):D("",!0)]),_:1})]),_:1})):(l(),d(r,{key:0,gutter:16},{default:a(()=>[t(s,{span:24},{default:a(()=>[t(w,{message:e.$t("common.expired"),description:e.$t("feedback.submittion_date_expired"),type:"error","show-icon":""},{icon:a(()=>[t(m)]),_:1},8,["message","description"])]),_:1})]),_:1}))]),_:1},8,["title","width","open"])}const ge=q(ae,[["render",le]]);export{ge as F};
