1import C from"./BCeEtyep.js";import{V as U}from"./DyJ9bgkC.js";import{_ as E}from"./6Py2VufL.js";import{b as h}from"./DgJsqxrV.js";import{c as q,u as D}from"./BWxOVg1T.js";import{P as o,g as M}from"./7qTxhUhY.js";import{d as T,b as j,e as L,u as G,s as H,a4 as I,B as _,h as p,w as g,i as m,k as e,g as y,F as W,A as X,j as $,P as S,l as z,p as J,t as x}from"./CTwjLVo9.js";import"./B_dCBO1A.js";import"./hBKOvaze.js";import"./BbON9zhe.js";import"./DMsxsjxB.js";import"./D8B-1ICt.js";import"./w1MSXho_.js";import"./BXWXHAo2.js";import"./Doz9SQD6.js";import"./B4T6mMwU.js";import"./Cu3muj1h.js";import"./DHXce0Ej.js";import"./CoaiQWn1.js";import"./tYFpoIGl.js";import"./DBwbgBsa.js";import"./_NEqh_RT.js";import"./BUvHj3Vh.js";import"./C1cNuOjh.js";import"./D6FiFRGy.js";import"./DefbZRoK.js";import"./CrbD28v0.js";import"./CBpn5Y-S.js";import"./BuARviLB.js";import"./BR4j18LI.js";import"./zIbvibQJ.js";import"./DVIWoQ5A.js";import"./BM_IL8oE.js";import"./CWIR64Hc.js";import"./CNmkNace.js";import"./BizVsW3B.js";import"./FnfSbE9v.js";import"./Dw3T67Oi.js";import"./BLLy1Pkf.js";import"./CPZB70ki.js";import"./-G3Hnvrk.js";import"./C3ItkHHn.js";import"./D4M5UUJb.js";import"./LScJjpcz.js";import"./BYQOmsHC.js";import"./CMlw_LNr.js";import"./BLTQRpBh.js";import"./kepbfOvd.js";import"./D4ZtNCQx.js";import"./BCC6s2Rd.js";import"./BNgC7t8K.js";import"./CJCLWPnE.js";import"./bBw5zPAx.js";import"./CMoc2OPY.js";import"./CBuFA1d7.js";import"./BAXG3Ijl.js";import"./BLXxdsiG.js";import"./DEkXRZ63.js";import"./DzjCX4Hv.js";import"./BceJSyN2.js";import"./CS_3-pzy.js";import"./SMfikpvB.js";import"./CXVllUO5.js";import"./Dcfwd_VN.js";import"./BcKfL3iI.js";const K={class:"flex flex-col gap-2"},Q=["for"],Y={type:"submit",form:"changePeerReviewAvailibilityForm",class:"app-button app-button--dark"},P=250,ut=T({__name:"ChangePeerReviewAvailibilityDialog",setup(Z){var V,b;const{t:a}=j(),d=L(),A=G(),{user:v}=H(d),B=q().shape({peerReviewValue:h.requiredEnum(o),peerReviewReason:h.string(P).when("peerReviewValue",{is:t=>t===o.Other,then:t=>t.required(a("errors.required"))})}),{defineField:R,handleSubmit:F,validate:k,errors:w}=D({validationSchema:B,initialValues:{peerReviewValue:(V=v.value)==null?void 0:V.peerReviewValue,peerReviewReason:((b=v.value)==null?void 0:b.peerReviewReason)||""}}),[l]=R("peerReviewValue"),[n]=R("peerReviewReason"),s=I("dialogRef"),f=F(async t=>{const{valid:r}=await k();if(!r)return;const u={peerReviewValue:t.peerReviewValue,peerReviewReason:t.peerReviewValue===o.Other?t.peerReviewReason:null};d.updateUserProfile(u).then(()=>{A.showBanner({type:"success",message:a("accountSettings.peerReviewPreferences.availibilitySubmitSuccess")}),s!=null&&s.value&&s.value.close()})});return(t,r)=>{const u=C,N=U,O=E;return p(),_(O,null,{actions:g(()=>[m("button",Y,x(e(a)("accountSettings.peerReviewPreferences.changeAvailibilitySubmit")),1)]),default:g(()=>[m("form",{id:"changePeerReviewAvailibilityForm",onSubmit:r[2]||(r[2]=(...i)=>e(f)&&e(f)(...i))},[m("div",K,[(p(!0),y(W,null,X(e(M)(),i=>(p(),y("div",{key:i.value,class:"flex items-start gap-2 w-full"},[$(u,{modelValue:e(l),"onUpdate:modelValue":r[0]||(r[0]=c=>S(l)?l.value=c:null),"input-id":i.value,name:"dynamic",invalid:!!e(w).peerReviewValue,value:i.value},null,8,["modelValue","input-id","invalid","value"]),m("label",{for:i.value,class:"text-body-l text-primary-950 w-full flex flex-col gap-1"},[z(x(i.label)+" ",1),i.value===e(o).Other?(p(),_(N,{key:0,modelValue:e(n),"onUpdate:modelValue":r[1]||(r[1]=c=>S(n)?n.value=c:null),errors:e(w).peerReviewReason,"field-props":{disabled:e(l)!==e(o).Other},"omit-label":"",type:"textarea",placeholder:e(a)("accountSettings.peerReviewPreferences.reasonPlaceholder"),"chars-limit":P},null,8,["modelValue","errors","field-props","placeholder"])):J("",!0)],8,Q)]))),128))])],32)]),_:1})}}});
1export{ut as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.