1import{r as b,j as e,aO as M,B as A,aP as J,aQ as $,F as N,aR as T,S as O,n as D,u as F,a2 as q,aS as I,aT as P,aU as z,aV as R,aW as ee,k as C,v as se,q as K,aX as ae,aL as te,aY as re,z as Y,aZ as ne,al as oe}from"./elements-DVh2jUIM.js";import{T as i,W as k,G as W,p as le,j as ie,x as ce,X as de,u as me,N as xe,Y as ue,P as pe,Z as be,_ as fe}from"./index-DeQvL4I7.js";import{A as he}from"./authorization-CE7gncHO.js";import{u as ge}from"./useRedesign-DVyq07A4.js";import{u as je}from"./useRedirectOnAssociationChange-DZlWegyT.js";import{N as Z}from"./NoteContent-T4pgf4E0.js";import{u as G}from"./useAttachmentViewer-CxkfXrEj.js";import{u as U,C as S}from"./index.esm-BsOhZrKM.js";import{y as ve,A as Ne}from"./arcs._id_-DYJuPUGw.js";import{i as ye}from"./board-arc-requests-DriAzWiq.js";import"./grids-DXrfAsUA.js";import"./startOfDay-AazlW55I.js";import"./useAuthorization-D7B2eQha.js";import"./index-DWdRGcKw.js";import"./tslib.es6-CcB4Nn7-.js";import"./index-Dh4i1-J3.js";import"./startOfMonth-FrfBe6WJ.js";import"./endOfMonth-ypFnROgy.js";import"./addMonths-BU5XNL5s.js";import"./isSameDay-CQTDJwZ-.js";import"./addDays-Le9Cqm9z.js";import"./subDays-BmZFCyDz.js";import"./useMutation-CfDMVIpo.js";import"./board-requests-BufpzAUw.js";function B({isEditingVote:s,onSubmit:a,isLoading:n,attachmentsAvailable:t=!0,stepOptions:r=null}){const o=b.useRef(null),[l,c]=b.useState(0),[m,u]=b.useState([]),{control:f,handleSubmit:x,reset:g,watch:y,setValue:V,formState:{errors:h}}=U(),j=y("vote");b.useEffect(()=>{r&&(j||u([]),j==="approve"&&u(r.yesSteps),j==="decline"&&u(r.noSteps)),g({vote:j})},[j]),b.useEffect(()=>{V("step",m[0])},[m]);const w=()=>{g({vote:void 0,step:void 0,message:void 0}),o.current&&(o.current.value=""),c(0)},_=x(async p=>{var d,v;await a(p.vote,p.message,((d=o.current)==null?void 0:d.files)??void 0,((v=p.step)==null?void 0:v.id)??void 0).then(w)});return e.jsxs("form",{className:"px-4 flex flex-col gap-4",id:"arc-vote-form",onSubmit:_,children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx(S,{name:"vote",control:f,rules:{required:!0},render:({field:p})=>e.jsxs(M,{...p,children:[e.jsx(M.Label,{className:"sr-only",children:i("board.arcVoting.approvalOptions")}),e.jsxs("div",{className:"flex items-center justify-center gap-4 flex-wrap",children:[e.jsx(M.Option,{value:"decline",children:e.jsx(A,{type:"button",variant:p.value!=="decline"?"dangerOutline":"danger",className:"md:w-44 w-full",id:"decline",children:i("board.arcVoting.decline")})}),e.jsx(M.Option,{value:"approve",children:e.jsx(A,{type:"button",variant:p.value!=="approve"?"additiveOutline":"additive",className:"md:w-44 w-full",id:"approve",children:i("board.arcVoting.approve")})}),s&&e.jsx(M.Option,{value:"retract",children:e.jsx(A,{type:"button",variant:p.value!=="retract"?"passiveOutline":"passive",className:"md:w-44 w-full",id:"retract",children:i("board.arcVoting.retract")})})]})]},j)}),h.vote&&e.jsx("p",{className:"text-error",children:h.vote.message})]}),j&&e.jsxs("div",{className:"flex flex-col gap-4",children:[j!=="retract"?e.jsxs(e.Fragment,{children:[m.length>0&&e.jsx(S,{name:"step",control:f,defaultValue:m[0],rules:{required:!0},render:({field:p})=>e.jsx(J,{label:i("Decision"),options:m,deriveKey:d=>`stepOption-${d==null?void 0:d.name}`,displayOption:d=>
1(d==null?void 0:d.name)??"",displaySelected:d=>(d==null?void 0:d.name)??"",id:"step-select",...p})}),h.step&&e.jsx("p",{className:"text-error",children:h.step.message}),e.jsx(S,{name:"message",control:f,defaultValue:"",render:({field:p})=>e.jsx($,{...p,className:"h-full",footer:t&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{htmlFor:"vote-attachments",className:"flex justify-between items-center gap-2 text-base-fg text-base",children:[e.jsx(N,{icon:T,className:"cursor-pointer py-1"}),l>0&&e.jsx("span",{children:l})]}),e.jsx("input",{multiple:!0,hidden:!0,type:"file",id:"vote-attachments",ref:o,onChange:()=>{var d,v;c(((v=(d=o.current)==null?void 0:d.files)==null?void 0:v.length)??0)}})]})})}),h.message&&e.jsx("p",{className:"text-error",children:h.message.message})]}):e.jsx("p",{className:"py-11 text-center",children:i("board.arcVoting.retractMessage")}),e.jsxs("div",{className:"flex items-center justify-end gap-4",children:[e.jsx(A,{variant:"passive",type:"button",onClick:w,id:"cancel-button",children:i("board.arcVoting.cancel")}),e.jsx(A,{type:"submit","data-qa":"vote-submit-button",children:n?e.jsx(O,{color:"white",className:"h-6"}):j!=="retract"?i("board.arcVoting.submit"):i("board.arcVoting.retract")})]})]})]})}function we({arcRequest:s,onClose:a,refresh:n,onVote:t,hideClose:r}){const[o,l]=b.useState(!1),c=async(m,u,f,x)=>{m!=="retract"&&(l(!0),k.updateChairArcVote(s.actionItemId,{decision:m,comment:u,nextStepId:x}).then(()=>{D({message:"Your vote has been submitted successfully",type:"success",duration:3e3}),n==null||n()}).catch(console.error).finally(()=>l(!1)))};return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{arcRequest:s,onVote:t,onClose:a,hideClose:r}),e.jsxs("div",{className:"w-screen flex flex-col h-full bg-base-fill gap-7 overflow-y-scroll no-scrollbar pt-2 max-w-2xl",children:[e.jsx(Ae,{arcRequest:s}),s.actions.includes("boardChairApproval")&&e.jsx(B,{onSubmit:c,isLoading:o,attachmentsAvailable:!1,stepOptions:{yesSteps:s.yesSteps,noSteps:s.noSteps}}),e.jsx(Se,{actionItemId:s.actionItemId})]})]})}function Ve({arcRequest:s,onVote:a,onClose:n,hideClose:t}){var c,m,u;const{t:r}=F(),{showAttachments:o}=G(),l=W();return e.jsxs("div",{className:"w-screen flex flex-col gap-4 px-4 pb-2 border-b-2 border-base-border max-w-2xl",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"text-lg font-bold text-base-header flex items-center gap-3",children:[r("board.arcVoting.popoverTitle",{type:(l==null?void 0:l.arcName)||"ARC"}),e.jsxs("button",{id:"arc__open-attachments",onClick:()=>o({actionItemId:s.actionItemId,title:r("board.arcVoting.popoverTitle",{type:(l==null?void 0:l.arcName)||"ARC"})}),children:[e.jsx("span",{className:"sr-only",children:r("board.arcVoting.downloadAttachments")}),e.jsx(N,{icon:T,className:"text-base-fg text-base"})]})]}),!t&&e.jsx("div",{className:"ml-3 flex h-7 items-center",children:e.jsxs("button",{onClick:n,className:"cursor-pointer px-1 outline-none rounded-sm text-base-header","data-qa":"close-button",children:[e.jsx("span",{className:"sr-only",children:r("board.arcVoting.close")}),e.jsx(N,{icon:q,className:"h-4 w-4 stroke-[3px]"})]})})]}),e.jsx("div",{className:"flex items-center justify-between",children:s.actions.includes("vote")&&e.jsxs(e.Fragment,{children:[e.jsx(A,{className:"h-8",onClick:()=>a(!0),"data-qa":"vote-button",children:r("board.arcVoting.vote")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(I,{variant:"success",text:((c=s.votes)==null?void 0:c.approve.length.toString())||"0",icon:P}),e.jsx(I,{variant:"danger",text:((m=s.votes)==null?void 0:m.decline.length.toString())||"0",icon:z}),e.jsx(I,{variant:"passive",text:((u=s.votes)==null?void 0:u.remaining.toString())||"0",icon:R})]})]})})]})}function Ae({arcRequest:s}){var t,r;const{t:a}=F(),n=[{dt:"XN",dd:s.actionItemId,qa:"arc-request-id"},{dt:a("board.arcVoting.details.step"),dd:s.step,qa:"arc-step"},{dt:a("board.arcVoting.details.homeowner"),dd:s.homeowner??"N/A",qa:"arc-homeowner"},{dt:a("board.arcVoting.details.address"),dd:s.propertyAddress?ee(s.propertyAddress,"full"):"N/A",qa:"arc-address"},{dt:a("board.arcVoting.details.type"),dd:s.arcType??s.type,qa:"arc-type"},{dt:a("board.arcVoting.details.dateSubmitted"),dd:C(s.createdDateTime,{format:"numeric"}),qa:"arc-date-submitted"},{dt:a("board.arcVoting.details.dueDate"),dd:s.dueDate?C(s.dueDate,{format:"numeric"}):"N/A",qa:"arc-due-date"},{dt:a("board.arcVoting.details.accountNumber"),dd:s.accountNumber??"N/A",qa:"arc-account-number"}];return e.jsxs("div",{className:"flex flex-col gap-5 px-4 pb-4 border-b-2 border-base-border",children:[e.jsx("dl",{className:"flex justify-between flex-col text-base-header md:flex flex-wrap md:gap-x-14 gap-3 [&_dt]:font-bold [&_dd]:font-normal",children:n.map(o=>e.jsxs("span",{className:"flex w-full justify-between gap-4",children:[e.jsx("dt",{children:o.dt}),e.jsx("dd",{"data-qa":o.qa,children:o.dd})]}))}),e.jsx("div",{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"text-base-header font-bold",children:a("board.arcVoting.homeownerMessage")}),e.jsx(Z,{content:(t=s.homeownerRequestMessage)==null?void 0:t.content,isHtml:(r=s.homeownerRequestMessage)==null?void 0:r.isHtml,className:"text-base-header font-normal","data-qa":"homeowner-request"})]})})]})}function Se({actionItemId:s}){const{t:a}=F(),n=async l=>{try{return await k.getBoardArcMessages(l)}catch(c){throw console.error(c),new Error("Failed to fetch messages")}},{data:t,isLoading:r}=le({queryKey:["boardMessages",s],queryFn:()=>n(s),enabled:!!s}),o=()=>r?e.jsx("div",{className:"flex justify-center items-center h-full",children:e.jsx(O,{})}):!t||t.length===0?e.jsx("div",{children:"No messages"}):t.map((l,c)=>e.jsx(Ce,{message:l},c));return e.jsx("div",{className:"h-full",children:e.jsxs("div",{className:"px-4 flex flex-col gap-3 h-full","data-qa":"board-messages",children:[e.jsx("h1",{className:"text-base-header font-extrabold",children:a("board.arcVoting.boardMessages")}),o()]})})}function Ce({message:s}){const{t:a}=F();return e.jsxs("div",{className:"pb-2 border-b-2 border-base-border last:border-b-0","data-qa":"board-message",children:[e.jsxs("span",{className:"flex gap-2 items-center text-base-header",children:[e.jsx("p",{className:"font-bold","data-qa":"board-message-from",children:s.from}),e.jsx("time",{"data-qa":"date-sent",children:C(s.created,{format:"numeric"})})]}),e.jsx("p",{className:"text-base-header","data-qa":"board-message-to",children:a("board.arcVoting.messageTo",{names:s.to.join(", ")})}),e.jsx(Z,{content:s.content,isHtml:s.isHtml,className:"mt-2 text-base-fg","data-qa":"board-message-text"})]})}function Me({arcRequest:s,onClose:a,onVote:n,refresh:t,hideClose:r}){var V;const o=ie(h=>h.userId),{showAttachments:l}
1=G(),[c,m]=b.useState(!1),[u,f]=b.useState(!1),[x,g]=b.useState(null);b.useEffect(()=>{f(!1),g(s.history.filter(h=>h.userId===o).pop()??null)},[s]);const y=async(h,j,w)=>{m(!0),await k.updateBoardArcVote(s.actionItemId,{vote:h,comment:j,attachments:w}).then(()=>{D({message:h!=="retract"?"Your vote has been submitted successfully":"Your vote has been retracted. Please submit a new vote before the deadline.",type:"success",duration:3e3}),t==null||t()}).catch(console.error).finally(()=>m(!1))};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-2 px-4 pb-2 border-b-2 border-base-border max-w-2xl w-screen",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("button",{className:"flex gap-2 items-center",onClick:()=>n(!1),"data-qa":"back-button",children:[e.jsx(N,{icon:se,className:"h-4 w-4 stroke-[3px] text-base-fg"}),e.jsx("span",{className:"font-bold text-base-header",children:i("board.arcVoting.vote")})]}),!r&&e.jsx("div",{className:"ml-3 flex h-7 items-center",children:e.jsxs("button",{onClick:a,className:"cursor-pointer px-1 outline-none rounded-sm text-base-header","data-qa":"close-button",children:[e.jsx("span",{className:"sr-only",children:i("board.arcVoting.close")}),e.jsx(N,{icon:q,className:"h-4 w-4 stroke-[3px]"})]})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"text-2xl font-bold text-base-header flex items-center gap-3",children:["XN ",s==null?void 0:s.actionItemId,e.jsx("div",{className:"flex items-center mb-1",children:e.jsxs("button",{id:"arc__open-attachments",onClick:()=>l({actionItemId:s.actionItemId,title:i("board.arcVoting.vote")}),children:[e.jsx("span",{className:"sr-only",children:i("board.arcVoting.downloadAttachments")}),e.jsx(N,{icon:T,className:"text-base-fg text-base"})]})})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-base-fg",children:i("board.arcVoting.details.dueDate")}),e.jsx("span",{className:"text-base-header font-medium","data-qa":"due-date",children:s.dueDate?C(s.dueDate,{format:"numeric"}):"N/A"})]})]})]}),e.jsxs("div",{className:"flex flex-col h-full bg-base-fill gap-10 overflow-y-scroll no-scrollbar max-w-2xl w-screen",children:[e.jsx("div",{className:"px-4",children:e.jsxs("div",{className:"bg-[#E7B82014] px-4 py-5 flex flex-col gap-3 mt-4",children:[e.jsx("h1",{className:"text-base-header font-extrabold",children:i("board.arcVoting.homeownerMessage")}),e.jsx("p",{className:"text-base-header","data-qa":"homeowner-request",children:(V=s.homeownerRequestMessage)==null?void 0:V.content})]})}),x&&x.action!=="retract"?u?e.jsx(B,{isEditingVote:u,onSubmit:y,isLoading:c}):e.jsxs("div",{className:"px-4 flex items-center justify-between",children:[e.jsx(I,{text:(x.action==="approve"||x.action==="updateApprove"?i("board.arcVoting.approved"):i("board.arcVoting.declined"))+" "+C(x.dateTime,{format:"numeric"}),variant:x.action==="approve"||x.action==="updateApprove"?"success":"danger",icon:x.action==="approve"||x.action==="updateApprove"?P:q}),e.jsx("button",{className:"text-base-link",onClick:()=>f(!0),"data-qa":"edit-button",children:i("board.arcVoting.editVote")})]}):e.jsx(B,{onSubmit:y,isLoading:c}),s.votes&&e.jsx(qe,{votes:s.votes}),e.jsxs("div",{className:"px-4 flex flex-col gap-4 my-4 text-base-header font-extrabold",children:[i("board.arcVoting.activity"),s.history.slice().reverse().map((h,j)=>e.jsx(Fe,{arcInfo:h},j))]})]})]})}function qe({votes:s}){const a=f=>`${f} ${f===1?"vote":"votes"}`,n=s.approve.length,t=s.decline.length,r=s.remaining,o=n+t+r,l=Math.round(n/o*100),c=Math.round(t/o*100),m=Math.round(r/o*100),u=[{status:"approve",count:n},{status:"decline",count:t},{status:"remaining",count:r}];return e.jsxs("div",{className:"px-4 flex gap-6 sm:flex-row flex-col items-center text-base-fg",children:[e.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[e.jsx("span",{className:"text-base-header font-bold",children:i("board.arcVoting.votesByStatus")}),e.jsx(ve,{className:"w-44 [&_.fill-green-500]:fill-success [&_.bg-green-500]:bg-success [&_.fill-red-500]:fill-error [&_.bg-red-500]:bg-error [&_.fill-slate-500]:fill-neutral [&_.bg-slate-500]:bg-neutral [&_.fill-tremor-content-emphasis]:fill-base-fg",data:u,category:"count",valueFormatter:()=>a(n+t),colors:["green","red","slate"],showTooltip:!1})]}),e.jsxs("div",{className:"pt-1 w-64 flex flex-col justify-center gap-3 mt-5","data-qa":"vote-status-count",children:[e.jsxs("div",{className:"flex justify-between border-solid border-b border-base-border pb-2",children:[e.jsxs("span",{className:"flex gap-1 items-center",children:[e.jsx("div",{className:"w-4 h-4 bg-success rounded-lg"}),i("board.arcVoting.yes")]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsx("span",{"data-qa":"approved-vote-count",children:n}),e.jsxs("span",{children:[l,"%"]})]})]}),e.jsxs("div",{className:"flex justify-between border-solid border-b border-base-border pb-2",children:[e.jsxs("span",{className:"flex gap-1 items-center",children:[e.jsx("div",{className:"w-4 h-4 bg-error roun
1ded-lg"}),i("board.arcVoting.no")]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsx("span",{"data-qa":"declined-vote-count",children:t}),e.jsxs("span",{children:[c,"%"]})]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("span",{className:"flex gap-1 items-center",children:[e.jsx("div",{className:"w-4 h-4 bg-neutral rounded-lg"}),i("board.arcVoting.remaining")]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsx("span",{"data-qa":"pending-vote-count",children:r}),e.jsxs("span",{children:[m,"%"]})]})]})]})]})}function Fe({arcInfo:s}){const a=W();let n=null,t="",r="";return s.action==="approve"||s.action==="updateApprove"?(n=P,t="bg-success",r=i("board.arcVoting.approvedARC",{type:(a==null?void 0:a.arcName)||"ARC",edited:s.action==="updateApprove"?"(edited)":""})):s.action==="decline"||s.action==="updateDecline"?(n=q,t="bg-error",r=i("board.arcVoting.deniedARC",{type:(a==null?void 0:a.arcName)||"ARC",edited:s.action==="updateDecline"?"(edited)":""})):(n=ae,t="bg-black",r=i("board.arcVoting.retractedVote")),e.jsxs("div",{className:"border-b-2 border-base-border last:border-b-0 pb-3","data-qa":"request-activity",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("div",{className:K(t,"w-5 h-5 p-1 rounded-full flex items-center justify-center"),children:e.jsx(N,{icon:n,className:"text-sm text-white"})}),e.jsx("span",{className:"font-semibold","data-qa":"user",children:s.name}),e.jsx("span",{className:"font-normal text-base-base","data-qa":"status",children:r}),e.jsx("span",{className:"font-normal text-base-fg","data-qa":"date",children:C(s.dateTime,{format:"numeric"})})]}),s.comment&&e.jsx("p",{"data-qa":"comment",className:"border-l-2 border-base-border pl-4 ml-[9px] mt-1 font-normal text-base-fg",children:s.comment})]})}function ke({actionItemId:s,roles:a,refreshArcData:n}){const{t}=F(),{handleSubmit:r,control:o,setValue:l,formState:{errors:c},reset:m,register:u}=U(),[f,x]=b.useState(!1),[g,y]=b.useState(!1),[V,h]=b.useState(0),j=b.useRef(null),w=b.useRef(null),_=r(async({to:p,message:d,isImportant:v,attachments:E})=>{try{y(!0),await k.sendMessage({xnId:s,message:d,isImportant:v,attachments:E,recipients:p}),D({message:t("board.arcVoting.sendMessaging.success").toString(),type:"success",duration:3e3}),n(),x(!1)}catch(L){console.error(L),D({message:t("board.arcVoting.sendMessaging.failure").toString(),type:"error"})}finally{y(!1)}});return b.useEffect(()=>{f||m()},[f,m]),te(j,()=>{x(!1)}),f?e.jsx("div",{ref:j,className:"flex flex-col gap-4 bg-base-bg pb-4 pt-2 border-t-2 border-base-border","data-qa":"board-message-component",children:e.jsxs("div",{className:"px-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"whitespace-nowrap text-base-header mb-2 font-semibold",children:t("board.arcVoting.sendAMessage")}),e.jsx("button",{onClick:()=>x(!1),"data-qa":"close-message",children:e.jsx(N,{icon:q,className:"h-4 w-4 text-base-fg"})})]}),e.jsxs("form",{id:"send-message-form",noValidate:!0,onSubmit:_,className:"flex flex-col w-full gap-4",children:[e.jsx(S,{name:"to",control:o,render:({field:p})=>{var d;return e.jsx(re,{...p,label:t("board.arcVoting.sendTo"),error:((d=c.to)==null?void 0:d.message)&&String(c.to.message),emptyMessage:t("board.arcVoting.noResults").toString(),onChange:v=>{l("to",v)},items:a.map(v=>({value:v.roleTypeId,label:v.name}))})},rules:{required:t("board.arcVoting.sendMessaging.fieldRequired").toString()}}),e.jsx(S,{name:"message",control:o,rules:{required:t("board.arcVoting.sendMessaging.messageRequired").toString()},render:({field:p})=>{var d;return e.jsx($,{...p,error:(d=c.message)==null?void 0:d.message,footer:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-1 items-center",children:[e.jsx(S,{name:"",control:o,render:({field:{onChange:v,...E}})=>e.jsxs(e.Fragment,{children:[e.jsxs("label",{htmlFor:"vote-attachments",className:"flex justify-between items-center gap-2 text-base-fg text-base",children:[e.jsx(N,{icon:T,className:"cursor-pointer"}),V>0&&e.jsx("span",{children:V})]}),e.jsx("input",{...E,onChange:L=>{var H,Q,X;h(((Q=(H=w.current)==null?void 0:H.files)==null?void 0:Q.length)??0),l("attachments",((X=w.current)==null?void 0:X.files)??void 0),v(L)},multiple:!0,hidden:!0,type:"file",id:"vote-attachments",ref:w}
1)]})}),e.jsx("label",{htmlFor:"vote-important",className:K("flex justify-between text-base-fg text-base px-2",p.value&&"text-error"),children:e.jsx(N,{icon:z,className:"cursor-pointer w-5"})}),e.jsx("input",{...u("isImportant"),hidden:!0,type:"checkbox",id:"vote-important",className:"hidden"})]}),e.jsx("button",{type:"submit",disabled:g,children:g?e.jsx(O,{}):e.jsx(N,{icon:Y,className:"cursor-pointer"})})]})})}})]})]})}):e.jsx("div",{className:"flex items-center flex-row-reverse bg-transparent mr-4 h-24 absolute bottom-0 right-0 -mb-2",children:e.jsx("button",{className:"bg-base-bg w-14 h-14 rounded-full border-base-border border-2",onClick:()=>x(!0),"data-qa":"board-message-button",children:e.jsx(N,{icon:Y,className:"text-2xl text-base-fg"})})})}const Ie=({actionItemPromise:s})=>{const a=ce(),{revalidate:n}=de(),t=me(),{embedded:r}=xe(),[o,l]=b.useState(!1),[c,m]=b.useState(!1);ne(()=>{l(!0)},r?null:200);const u=()=>{if(r){a("/board/arcs",{state:{refresh:!0}});return}l(!1),setTimeout(()=>{a("/board/arcs",{state:{refresh:!0}})},500)},f=()=>{ye(t),n()},x=e.jsx(b.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center py-24 w-screen max-w-2xl",children:e.jsx(O,{})}),children:e.jsx(ue,{resolve:s,children:g=>{var y;return e.jsxs(e.Fragment,{children:[g?c?e.jsx(Me,{arcRequest:g,onClose:u,refresh:f,onVote:m,hideClose:r}):e.jsx(we,{arcRequest:g,onClose:u,refresh:f,onVote:m,hideClose:r}):l(!1),((y=g==null?void 0:g.roleTypes)==null?void 0:y.length)>0&&e.jsx(ke,{actionItemId:g.actionItemId,roles:g.roleTypes,refreshArcData:f})]})}})});return r?e.jsx("div",{className:"w-full overflow-y-auto pt-8","data-qa":c?"arc-vote-panel":"arc-request-panel",children:x}):e.jsx(oe,{isOpen:o,onClose:u,dataQa:c?"arc-vote-panel":"arc-request-panel",children:x})},ts={showPropertySelector:!1,showAi:!1};async function rs({params:s}){const a=parseInt(s.id??"");if(!a)return be("/board/arcs");const n=k.getBoardArcRequest(a).catch(t=>(console.error(t),null));return fe({actionItem:n})}function ns(){je("/board/arcs");const s=ge(),{actionItem:a}=pe();return e.jsx(he,{controller:"Board_v2",action:"ActionItems_ARC",children:s?e.jsx(Ne,{actionItemPromise:a}):e.jsx(Ie,{actionItemPromise:a})})}export{ns as Component,ts as handle,rs as loader};
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.