1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="d0ce2726-7878-4586-ba61-76bf546aa5e7",e._sentryDebugIdIdentifier="sentry-dbid-d0ce2726-7878-4586-ba61-76bf546aa5e7")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[566],{19783:function(e,a,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/hr/[tenant]/performance/appeals/[raid]",function(){return n(35667)}])},35491:function(e,a,n){"use strict";n.d(a,{u:function(){return b}});var s=n(52322),i=n(13980),t=n.n(i),r=n(2784),o=n(31776),l=n(47023),d=n(18427),c=n(63798),u=n(62372),p=n(88921),h=n(79413),g=n(76467),m=n(69682),x=n(62399);let v="appeal_assignee",f=new Set([401,403]),b=Object.freeze({ASSIGN:"assign",DECIDE:"decide"}),j=e=>(a,n,s)=>a.mode!==e||"function"==typeof a[n]?null:Error("The prop `".concat(n,"` is required on `").concat(s,'` in "').concat(e,'" mode, but its value is `').concat(a[n],"`.")),y=[{value:"upheld",label:"Upheld"},{value:"rejected",label:"Rejected"}],w=e=>{let{subjectName:a,cycleName:n}=e;return(0,s.jsxs)("div",{className:"flex flex-col rounded bg-blue-50 px-3 py-2",children:[(0,s.jsx)(g.Z,{as:"p",color:"text-gray-900",variant:"labelValue",children:"Appeal from ".concat(a)}),!!n&&(0,s.jsx)(g.Z,{as:"p",color:"text-gray-600",variant:"caption",children:n})]})};w.propTypes={subjectName:t().string.isRequired,cycleName:t().string};let _=e=>{var a;let{mode:n,isOpen:i,onClose:t,onAssign:j,onDecide:_,isSubmitting:Z=!1,error:N,raid:k,subjectName:C,cycleName:P}=e,[S,E]=(0,r.useState)(null),[R,A]=(0,r.useState)(""),[W,T]=(0,r.useState)("");(0,r.useEffect)(()=>{i&&(E(null),A(""),T(""))},[i,n]);let I=n===b.ASSIGN,D=(0,p._r)({raid:k,enabled:!!(i&&I&&k)}),O=(0,r.useMemo)(()=>D.hearers.map(e=>({value:e.uid,label:e.name}
1)),[D.hearers]),L=!!(i&&I&&k&&!D.isMissingContext&&D.isPending),q=!!(!L&&i&&I&&(D.isMissingContext||D.appealError||!Array.isArray(D.data))),z=f.has(null===(a=D.appealError)||void 0===a?void 0:a.status)?"You are not allowed to choose who hears this appeal. It has to be assigned by a colleague who can hear appeals and was not involved in the review being appealed.":"We could not load the colleagues who can hear this appeal. Close this and try again.",F=e=>{if(null==e||e.preventDefault(),I){if(!(null==S?void 0:S.value))return;j({assignedToUserId:S.value});return}R&&W.trim()&&_({outcome:R,outcomeNote:W})},M=(null==N?void 0:N.fieldErrors)||{},H=!!(M.assigned_to_user_id||M.outcome||M.outcome_note),G=(0,x.Z)(N,p.or,H),U=Z||I&&!(null==S?void 0:S.value)||!I&&(!R||!W.trim()),K=I?"Assign this appeal":"Record a decision",V=I?"Assign appeal":"Record decision";return(0,s.jsx)(d.Z,{footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Z,{design:"outlined",disabled:Z,onClick:t,size:"sm",children:"Cancel"}),(0,s.jsx)(l.Z,{disabled:U,isLoading:Z,onClick:F,size:"sm",children:V})]}),onClose:t,show:i,title:K,children:(0,s.jsxs)("form",{...(0,m.p)("flex flex-col gap-4"),onSubmit:F,children:[!!C&&(0,s.jsx)(w,{cycleName:P,subjectName:C}),!!G&&(0,s.jsx)(h.Z,{message:G,variant:"warning"}),!!I&&(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(g.Z,{as:"label",htmlFor:v,variant:"label",children:"Who should hear this appeal?"}),(0,s.jsx)(o.ZP,{"aria-label":"Who should hear this appeal?",className:"c-react-select",classNamePrefix:"crs",inputId:v,isDisabled:L||q,isLoading:L,noOptionsMessage:()=>q?z:"No colleague matches that name",onChange:e=>E(e||null),options:O,placeholder:L?"Loading colleaguesâ¦":"Choose a colleague",value:S}),!!M.assigned_to_user_id&&(0,s.jsx)(g.Z,{color:"text-red-600",role:"alert",variant:"caption",children:M.assigned_to_user_id}),!!q&&(0,s.jsx)(g.Z,{color:"text-red-600",role:"alert",variant:"caption",children:z}),!!(!L&&!q&&0===O.length)&&(0,s.jsx)(g.Z,{color:"text-gray-600",role:"status",variant:"caption",children:'Nobody in this workspace can hear this appeal. Someone other than the employee needs the "hear review appeals" permission before it can be assigned.'}),O.length>0&&(0,s.jsx)(g.Z,{color:"text-gray-500",variant:"caption",children:"These are the colleagues who can hear appeals. Some cannot hear this one â anybody involved in the review being appealed is excluded, and we will say so if you pick them."})]}),!I&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.P,{defaultOption:"Choose an outcome",error:M.outcome,label:"Outcome",name:"appeal_outcome",onChange:e=>A(e.target.value),options:y,required:!0,selected:R}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(u.K,{error:M.outcome_note,label:"What the employee should be told",name:"appeal_outcome_note",onChange:e=>T(e.target.value),required:!0,rows:4,value:W}),(0,s.jsx)(g.Z,{color:"text-gray-500",variant:"caption",children:"Recording a decision does not change the review itself. Reopening it is a separate step."})]})]})]})})};_.propTypes={mode:t().oneOf(Object.values(b)).isRequired,isOpen:t().bool.isRequired,onClose:t().func.isRequired,onAssign:j(b.ASSIGN),onDecide:j(b.DECIDE),isSubmitting:t().bool,raid:t().string,subjectName:t().string,cycleName:t().string,error:t().shape({reason:t().string,message:t().string,fieldErrors:t().object})},a.Z=_},76368:function(e,a,n){"use strict";n.d(a,{sL:function(){return c},zy:function(){return u}});var s=n(52322),i=n(39097),t=n.n(i),r=n(13980),o=n.n(r),l=n(76467),d=n(69682);let c=new Set(["moderating","closed","released"]),u=e=>{let{tenantName:a,rsid:n}=e;return"/hr/".concat(a,"/performance/my-results/").concat(n)},p=e=>e||"an employee we could not name",h=e=>{let{tenantName:a,rsid:n,subjectName:i=null}=e;return(0,s.jsxs)(t(),{className:"text-blue-dark text-sm font-medium underline",href:u({tenantName:a,rsid:n}),...(0,d.x)("ResultsLinkRowLink"),children:["View results",(0,s.jsx)(l.Z,{as:"span",className:"sr-only",variant:"caption",children:" for ".concat(p(i))})]})};h.propTypes={tenantName:o().string.isRequired,rsid:o().string.isRequired,subjectName:o().string},a.ZP=h},35667:function(e,a,n){"use strict";n.r(a);var s=n(52322),i=n(14010),t=n(13980),r=n.n(t),o=n(2784),l=n(62202),d=n(47023),c=n(65232),u=n(17047),p=n(1973),h=n(77590),g=n(30900),m=n(31515),x=n(43493),v=n(88921),f=n(20270),b=n(82292),j=n(23627),y=n(75588),w=n(79413),_=n(76467),Z=n(84475),N=n(79337),k=n(3549
11),C=n(87950),P=n(81319),S=n(76368),E=n(69682),R=n(1626);let A=/^[A-Za-z0-9_-]{1,64}$/,W=(e,a)=>(null==e?void 0:e.name)||a,T=(e,a)=>e&&a?e===a?{title:"Your appeal",description:"What you disputed, who is hearing it, and where it stands",groundsHeading:"What you asked us to look at again"}:{title:"Appeal",description:"Read what this employee is disputing, then record what you decided",groundsHeading:"What this employee is disputing"}:{title:"Appeal",description:"What this appeal disputes, who is hearing it, and where it stands",groundsHeading:"What this appeal disputes"},I=e=>{var a,n,t,r,Z,I,D;let{tenantName:O,raid:L}=e,q="string"==typeof L&&A.test(L)?L:void 0,[z,F]=(0,o.useState)(null),M=(0,i.NL)(),{track:H}=(0,j.Ke)({app:"portal"}),{data:G}=(0,f.Pi)({enabled:!0}),U=(0,v.Kd)({raid:q}),K=U.data,V=null==K?void 0:null===(a=K.review_subject)||void 0===a?void 0:a.rsid,Y=(0,v.iA)(),B=(0,v.GP)(),X=(0,v.ux)({onSuccess:()=>{V&&M.invalidateQueries({queryKey:b.VF.subject(V)})}}),Q=(0,o.useCallback)(()=>{F(null),Y.reset(),B.reset()},[Y,B]),$=(0,o.useCallback)(e=>{Y.reset(),B.reset(),F(e)},[Y,B]),J=(0,o.useCallback)(e=>{let{assignedToUserId:a}=e;Y.mutate({raid:q,assignedToUserId:a},{onSuccess:()=>{F(null),l.default.success("This appeal has been assigned.")}})},[Y,q]),ee=(0,o.useCallback)(e=>{let{outcome:a,outcomeNote:n}=e;B.mutate({raid:q,outcome:a,outcomeNote:n},{onSuccess:()=>{F(null),H(g.dW.PERF_APPEAL_DECIDED,{outcome:a,surface:g.S9.PERFORMANCE_REVIEWS}),l.default.success("This decision has been recorded.")}})},[B,q,H]),ea=(0,o.useCallback)(()=>{(0,u.Z)({title:"Reopen this review?",message:"The review goes back into moderation so its rating can be corrected. This cannot be undone from here.",confirmButtonText:"Yes, reopen it",cancelButtonText:"No, leave it as it is",handler:async()=>{await X.mutateAsync({rsid:V,raid:q}),l.default.success("This review has been reopened.")}})},[q,X,V]),en=(0,o.useMemo)(()=>X.error?(0,v.Fj)(X.error,{fallback:"We could not reopen this review. Please try again."}):null,[X.error]),es=(0,o.useMemo)(()=>{let e=z===k.u.ASSIGN,a=e?Y.error:B.error;return a?(0,v.Fj)(a,{fallback:e?"We could not assign this appeal. Please try again.":"We could not record this decision. Please try again."}):null},[Y.error,B.error,z]),ei=(0,o.useMemo)(()=>{var e;let a=[{href:"/hr/".concat(O,"/performance"),name:"Performance",nodeType:"Link"}],n=null==G?void 0:G.uid,s=null==K?void 0:null===(e=K.raised_by)||void 0===e?void 0:e.uid;return n&&s&&n!==s?[...a,{href:"/hr/".concat(O,"/performance/appeals"),name:"Appeals",nodeType:"Link"}]:a},[null==K?void 0:null===(n=K.raised_by)||void 0===n?void 0:n.uid,null==G?void 0:G.uid,O]),{appealError:et,isMissingContext:er,isUnreadable:eo}=U,el=!er&&U.isPending,ed=(0,o.useMemo)(()=>q?er?{message:"We could not tell which workspace you are in",description:"Check you are signed in to the right workspace, then try again."}:eo?{message:"We could not read this appeal",description:"What came back was not an appeal we could read. Refresh the page, and let an admin know if it keeps happening."}:{message:"We could not load this appeal",description:null==et?void 0:et.message}:{message:"We could not find this appeal",description:"The link you followed does not point at an appeal we can open. Go back to Performance and open it again from there."},[et,er,eo,q]),ec=!!(!q||er||et||eo),eu=null==G?void 0:G.uid,ep=null==K?void 0:null===(t=K.raised_by)||void 0===t?void 0:t.uid,eh=null==K?void 0:null===(r=K.assigned_to)||void 0===r?void 0:r.uid,eg=!!eu&&eu===eh,em=!!((null==K?void 0:K.can_assign)&&(0,x.userCan)(G,"hear_review_appeals")&&ep&&eu!==ep),ex=!!((null==K?void 0:K.can_decide)&&eg),ev=!!((null==K?void 0:K.status)===v.NT.UPHELD&&V&&eg),{title:ef,description:eb,groundsHeading:ej}=T(eu,ep);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.Z,{thirdParty:!1,title:"".concat((0,h.kC)((0,h.parseUnderScore)(O))," - Appeal")}),(0,s.jsxs)("main",{className:"container flex flex-col gap-4 mx-auto px-4 md:px-8 lg:px-12 pb-6",children:[(0,s.jsx)(y.Z,{breadcrumbs:ei,description:eb,tenantName:O,title:ef}),!!(el||ec)&&(0,s.jsx)(c.ZP,{children:(0,s.jsx)(c.eW,{children:(0,s.jsx)(p.Z,{description:ed.description,design:"wrapped",isError:ec,isLoading:!!el&&!ec,message:ed.message})})}),!!(!el&&!ec&&K)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.ZP,{children:(0,s.jsx)(c.eW,{children:(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("div",{...(0,E.p)("flex flex-col"),children:[(0,s.jsx)(_.Z,{variant:"heading3",children:W(null===(Z=K.review_subject)||void 0===Z?void 0:Z.user,"Name unavailable")}),(0,s.jsx)(_.Z,{color:"text-gray-600",variant:"caption",children:"Hearing it: ".concat(W(K.assigned_to,"nobody yet"))}),(0,s.jsx)(_.Z,{color:"text-gray-600",variant:"caption",children:(null===(D=K.review_subject)||void 0===D?void 0:null===(I=D.review_cycle)||void 0===I?void 0:I.name)||"Cycle unavailable"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(C.Z,{appeal:K}),(0,s.jsx)(_.Z,{color:"text-gray-600",variant:"caption",children:"Raised ".concat((0,m.mn)(K.created_at,"on a date we could not read"))})]}),!!K.resolved_at&&(0,s.jsx)("div",{...(0,E.p)(),children:(0,s.jsx)(_.Z,{color:"text-gray-600",variant:"caption",children:"Closed ".concat((0,m.mn)(K.resolved_at,"on a date we could not read")," by ").concat(W(K.resolved_by,"someone we could not name"))})})]}),(0,s.jsxs)("div",{className:"flex flex-shrink-0 flex-wrap gap-2",children:[!!em&&(0,s.jsx)(d.Z,{design:"outlined",onClick:()=>$(k.u.ASSIGN),size:"sm",children:"Assign"}),!!V&&(0,s.jsx)(d.Z,{design:"outlined",href:(0,S.zy)({tenantName:O,rsid:V}),size:"sm",children:"Open the review"}),!!ex&&(0,s.jsx)(d.Z,{onClick:()=>$(k.u.DECIDE),size:"sm",children:"Record decision"})]})]})})}),(0,s.jsxs)(c.ZP,{children:[(0,s.jsx)(c.Ol,{children:(0,s.jsx)(_.Z,{variant:"sectionHeader",children:ej})}),(0,s.jsx)(c.eW,{children:(0,s.jsx)("div",{...(0,E.p)(),children:(0,s.jsx)(R.Z,{emptyLabel:"No grounds were recorded.",state:(0,v.Z)(K,"grounds"),value:K.grounds})})})]}),(0,s.jsxs)(c.ZP,{children:[(0,s.jsx)(c.Ol,{children:(0,s.jsx)(_.Z,{variant:"sectionHeader",children:"Decision"})}),(0,s.jsx)(c.eW,{children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("div",{...(0,E.p)(),children:(0,s.jsx)(R.Z,{emptyLabel:"No decision note yet.",state:(0,v.Z)(K,"outcome_note"),value:K.outcome_note})}),!!(K.can_decide&&!ex)&&(0,s.jsx)(_.Z,{color:"text-gray-600",variant:"caption",children:eh?"Only ".concat(W(K.assigned_to,"the assignee")," can record a decision on this appeal."):"Nobody is hearing this appeal yet. Assign it first, and its assignee records the decision."}),!!en&&(0,s.jsx)(w.Z,{message:en.message,variant:"warning"}),!!ev&&(0,s.jsxs)("div",{children:[(0,s.jsx)(d.Z,{design:"outlined",isLoading:X.isPending,onClick:ea,size:"sm",children:"Reo
1pen this review"}),(0,s.jsx)(_.Z,{color:"text-gray-500",variant:"caption",children:"Upholding an appeal records the ruling. Reopening sends the review back so its rating can be corrected."})]})]})})]}),(0,s.jsxs)(c.ZP,{children:[(0,s.jsx)(c.Ol,{children:(0,s.jsx)(_.Z,{variant:"sectionHeader",children:"History"})}),(0,s.jsx)(c.eW,{children:(0,s.jsx)(P.Z,{events:K.events,isWithheld:(0,v.jM)(K)})})]})]})]}),(0,s.jsx)(k.Z,{error:es,isOpen:!!z,isSubmitting:Y.isPending||B.isPending,mode:z||k.u.ASSIGN,onAssign:J,onClose:Q,onDecide:ee,raid:q})]})};I.getInitialProps=async e=>{let{tenant:a,raid:n}=e.query;return{tenantName:encodeURIComponent(a),raid:n}},I.propTypes={tenantName:r().string.isRequired,raid:r().oneOfType([r().string,r().arrayOf(r().string)])},a.default=(0,Z.withAuthSync)(I)},31776:function(e,a,n){"use strict";n.d(a,{ZP:function(){return o}});var s=n(88137),i=n(7896),t=n(2784),r=n(26202);n(2107),n(28316),n(84337);var o=(0,t.forwardRef)(function(e,a){var n=(0,s.u)(e);return t.createElement(r.S,(0,i.Z)({ref:a},n))})}},function(e){e.O(0,[5351,9436,9400,270,9277,2292,9574,3790,4249,4326,2888,9774,179],function(){return e(e.s=19783)}),_N_E=e.O()}]);
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.