PageSourceSearch

https://portal.commoninterest.com/assets/inspections._id_-CeiR6ep4.js

js commoninterest.com collected 2026-09-24 13:27:45 UTC 13,652 bytes, 1 lines download raw bytes

1import{u as y,j as e,F as f,aR as S,k as z,B as w,r as h,bL as A,cr as B,n as I,bP as U,S as q}from"./elements-DVh2jUIM.js";import{B as E}from"./BoardDetailNotFound-B1R5bN6J.js";import{B as H}from"./BoardDetailSlideOverLayout-CDAgiebb.js";import{u as O}from"./useAttachmentViewer-CxkfXrEj.js";import{Y as W,X as _,L as $,x as Q,P as X,Z as C,W as Y,_ as Z}from"./index-DeQvL4I7.js";import{N as G}from"./NoteContent-T4pgf4E0.js";import{f as J,g as K}from"./board-inspections-B1QbFt9J.js";import{B as ee,a as se}from"./BoardDetailPresentation-6kScNe0a.js";import{A as te}from"./authorization-CE7gncHO.js";import{u as ie}from"./useRedirectOnAssociationChange-DZlWegyT.js";import"./grids-DXrfAsUA.js";import"./startOfDay-AazlW55I.js";import"./index-DWdRGcKw.js";import"./useMutation-CfDMVIpo.js";import"./useBoardFrustrationEnabled-DO3xOrwY.js";import"./useAuthorization-D7B2eQha.js";const ae=({detail:s,onViewAttachments:n})=>{const{t}=y();return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-xl mobile:text-2xl font-semibold text-base-header",children:s.stepDescription??t("board.inspections.violationDetails")}),s.lastNoteIdWithAttachments>0&&e.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 font-semibold text-base-link hover:underline",onClick:n,title:t("board.inspections.viewAttachments"),children:[t("board.inspections.viewAttachments"),e.jsx(f,{icon:S,"aria-hidden":"true"})]})]}),s.actionTypeDescription&&e.jsx("div",{className:"text-sm mobile:text-base font-medium text-base-header",children:s.actionTypeDescription}),s.subjectAndDescription&&e.jsx("p",{className:"text-sm mobile:text-base text-base-fg",children:s.subjectAndDescription})]})},ne=({items:s})=>{if(!s||s.length===0)return null;const n=s.slice(0,4);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"max-mobile:hidden border border-base-border rounded-lg overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-gray-50",children:n.map((t,o)=>e.jsx("th",{className:"px-4 py-2 text-left text-sm font-medium text-gray-600 border-b border-base-border",children:t.title},o))})}),e.jsx("tbody",{children:e.jsx("tr",{children:n.map((t,o)=>e.jsx("td",{className:"px-4 py-3 text-sm text-base-header",children:t.text},o))})})]})}),e.jsx("div",{className:"mobile:hidden border border-base-border rounded-lg overflow-hidden bg-white",children:e.jsx("div",{className:"divide-y divide-base-border",children:n.map((t,o)=>e.jsxs("div",{className:"px-4 py-3 flex justify-between items-start gap-4",children:[e.jsx("span",{className:"text-sm font-medium text-gray-600 shrink-0",children:t.title}),e.jsx("span",{className:"text-sm text-base-header text-right",children:t.text})]},o))})})]})},oe=({message:s,onViewAttachments:n})=>{const{t}=y(),o=s.createdUtc?z(s.createdUtc,{format:"numeric"}):"",l=s.createdUtc?new Date(s.createdUtc).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):"";return e.jsxs("div",{className:"space-y-2 p-3 mobile:p-0 bg-gray-50 mobile:bg-transparent rounded-lg mobile:rounded-none",children:[e.jsxs("div",{className:"flex flex-col mobile:flex-row mobile:justify-between mobile:items-start gap-1 mobile:gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm text-base-header",children:[e.jsxs("span",{className:"font-medium",children:[t("board.inspections.author"),":"]})," ",s.author??t("board.inspections.unknown")]}),s.showSentToList&&s.sentToList&&e.jsxs("div",{className:"text-sm text-base-header",children:[e.jsxs("span",{className:"font-medium",children:[t("board.inspections.sentTo"),":"]})," ",s.sentToList]})]}),e.jsxs("div",{className:"text-left mobile:text-right text-sm text-gray-500",children:[e.jsx("span",{className:"mobile:block",children:o}),e.jsx("span",{className:"ml-2 mobile:ml-0 mobile:block",children:l})]})]}),e.jsx(G,{content:s.note,isHtml:s.isHtml,className:"text-sm text-base-fg"}),s.hasAttachments&&e.jsx("div",{children:e.jsx(w,{variant:"passiveOutline",size:"xs",startIcon:e.jsx(f,{icon:S,className:"w-3 h-3"}),onClick:()=>n(s.actionItemId),children:t("board.inspections.viewAttachment")})})]})},re=({violationId:s,associationId:n,inspectionId:t,onSuccess:o,onCancel:l})=>{const{t:i}=y(),[r,m]=h.useState(""),[c,u]=h.useState(!1),[x,k]=h.useState([]),[p,N]=h.useState([]),{data:g=[],isLoading:v}=J(s,n),b=K(),D=a=>{if(a.target.files){const d=Array.from(a.target.files);N(j=>[...j,...d])}a.target.value=""},P=a=>{N(d=>d.filter((j,V)=>V!==a))},T=a=>{k(d=>d.includes(a)?d.filter(j=>j!==a):[...d,a])},R=async a=>{if(a.preventDefault(),!r.trim()){I({type:"error",message:i("board.inspections.messageRequired")});return}if(g.length>0&&x.length===0){I({type:"error",message:i("board.inspections.recipientRequired")});return}try{const d=U(p),j=await b.mutateAsync({violationId:s,request:{associationId:n,message:r.trim(),highImportance:c,recipients:x.length>0?x:void 0,attachments:d.length>0?d:void 0,inspectionId:t}}
1);j.success&&(I({type:"success",message:j.message||i("board.inspections.messageSentSuccess")}),o())}catch(d){console.error("Failed to send message:",d),I({type:"error",message:i("board.inspections.messageSendError")})}},L=p.reduce((a,d)=>a+d.size,0),M=25*1024*1024,F=L>M;return e.jsxs("form",{onSubmit:R,className:"space-y-4 p-4 bg-gray-50 rounded-lg border border-base-border",children:[e.jsx("h3",{className:"text-lg font-semibold text-base-header",children:i("board.inspections.replyTitle")}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[i("board.inspections.sendTo"),g.length>0&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),v?e.jsxs("div",{className:"flex items-center gap-2 text-gray-500 text-sm",children:[e.jsx(f,{icon:A,className:"animate-spin"}),i("board.inspections.loadingRecipients")]}):e.jsx("div",{className:"flex flex-wrap gap-2",children:g.map(a=>e.jsx("button",{type:"button",onClick:()=>T(a.roleTypeId),className:`px-3 py-1 text-sm rounded-full border transition-colors ${x.includes(a.roleTypeId)?"bg-primary text-white border-primary":"bg-white text-gray-700 border-gray-300 hover:border-primary"}`,children:a.description},a.roleTypeId))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"highImportance",checked:c,onChange:a=>u(a.target.checked),className:"w-4 h-4 text-primary border-gray-300 rounded focus:ring-primary"}),e.jsx("label",{htmlFor:"highImportance",className:"text-sm text-gray-700",children:i("board.inspections.highImportance")})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[i("board.inspections.message")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{value:r,onChange:a=>m(a.target.value),rows:5,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary resize-none"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:i("board.inspections.attachments")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("label",{className:"cursor-pointer",children:[e.jsx("input",{type:"file",multiple:!0,onChange:D,className:"hidden"}),e.jsxs("span",{className:"inline-flex items-center gap-2 px-3 py-2 text-sm border border-gray-300 rounded-md bg-white hover:bg-gray-50 transition-colors",children:[e.jsx(f,{icon:S}),i("board.inspections.addFiles")]})]}),e.jsx("span",{className:"text-xs text-gray-500",children:i("board.inspections.maxFileSize")})]}),p.length>0&&e.jsx("ul",{className:"space-y-1",children:p.map((a,d)=>e.jsxs("li",{className:"flex items-center justify-between px-3 py-2 text-sm bg-white border border-gray-200 rounded",children:[e.jsx("span",{className:"truncate flex-1",children:i("board.inspections.fileSize",{name:a.name,size:(a.size/1024).toFixed(1)})}),e.jsx("button",{type:"button",onClick:()=>P(d),className:"ml-2 text-gray-400 hover:text-red-500",children:e.jsx(f,{icon:B})})]},d))}),F&&e.jsx("p",{className:"text-sm text-red-500",children:i("board.inspections.fileSizeExceeded")})]}),e.jsxs("div",{className:"flex flex-col-reverse mobile:flex-row items-stretch mobile:items-center gap-2 mobile:gap-3 pt-2",children:[e.jsx(w,{type:"button",variant:"passiveOutline",onClick:l,disabled:b.isPending,className:"w-full mobile:w-auto",children:i("board.inspections.cancel")}),e.jsx(w,{type:"submit",variant:"primary",disabled:b.isPending||!r.trim()||F||g.length>0&&x.length===0,className:"w-full mobile:w-auto",children:b.isPending?e.jsxs(e.Fragment,{children:[e.jsx(f,{icon:A,className:"animate-spin mr-2"}),i("board.inspections.sending")]}):i("board.inspections.sendMessage")})]})]})},ce=({messages:s,violationId:n,associationId:t,inspectionId:o,showMessageForm:l,onShowMessageForm:i,onHideMessageForm:r,onMessageSuccess:m,onViewAttachments:c})=>{const{t:u}=y();return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border-b border-base-border",children:e.jsx("div",{className:"inline-block px-4 py-2 text-base-link font-medium border-b-2 border-base-link",children:u("board.inspections.messages")})}),l?e.jsx(re,{violationId:n,associationId:t,inspectionId:o,onSuccess:m,onCancel:r}):e.jsx("div",{children:e.jsx(w,{variant:"primary",size:"sm",onClick:i,children:u("board.inspections.reply")})}),e.jsx("div",{className:"space-y-6",children:s.length===0?e.jsx("p",{className:"text-gray-500 text-center py-8",children:u("board.inspections.noMessages")}):s.map(x=>e.jsx(oe,{message:x,onViewAttachments:c},x.actionItemNoteId))})]})},le=({violationDetailPromise:s,violationId:n,associationId:t,inspectionId:o,isSli
1deOver:l=!1,onClose:i,slideOverNavigation:r})=>e.jsx("div",{className:l?"w-full px-9 py-6":"w-full bg-base-fill rounded-xl px-9 py-6 max-mobile:px-4",children:e.jsx(h.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center py-24",children:e.jsx(q,{})}),children:e.jsx(W,{resolve:s,children:m=>m?e.jsx(de,{data:m,associationId:t,inspectionId:o,isSlideOver:l,onClose:i,slideOverNavigation:r}):e.jsx(me,{violationId:n})})})}),de=({data:s,associationId:n,inspectionId:t,isSlideOver:o,onClose:l,slideOverNavigation:i})=>{const{t:r}=y(),{showAttachments:m}=O(),{detail:c,messages:u}=s,{revalidate:x}=_(),[k,p]=h.useState(!1),N=h.useCallback(()=>{p(!1),x()},[x]),g=h.useCallback(()=>{m({actionItemId:c.actionItemId,title:r("board.violations.violation")})},[m,c.actionItemId]),v=e.jsx(ce,{messages:u,violationId:c.actionItemId,associationId:n,inspectionId:t,showMessageForm:k,onShowMessageForm:()=>p(!0),onHideMessageForm:()=>p(!1),onMessageSuccess:N,onViewAttachments:b=>m({actionItemId:b,title:r("board.violations.violation")})});return o?e.jsx(H,{title:r("board.inspections.violationDetails"),itemId:c.actionItemId,subtitle:c.stepDescription,navigation:i,onClose:l,attachments:c.lastNoteIdWithAttachments>0?e.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 font-semibold text-base-link hover:underline",onClick:g,children:[r("board.inspections.viewAttachments"),e.jsx(f,{icon:S,"aria-hidden":"true"})]}):void 0,summary:e.jsxs(e.Fragment,{children:[c.actionTypeDescription&&e.jsx("div",{className:"text-sm mobile:text-base font-medium text-base-header",children:c.actionTypeDescription}),c.subjectAndDescription&&e.jsx("p",{className:"mt-2 text-sm mobile:text-base text-base-fg",children:c.subjectAndDescription})]}),infoItems:(c.sidePanelItems??[]).map(({title:b,text:D})=>({label:b,value:D})),children:v}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("nav",{className:"flex items-center gap-2 text-sm",children:[e.jsx($,{to:"/board/inspections",className:"text-base-link hover:underline",children:r("board.inspections.breadcrumb")}),e.jsx("span",{className:"text-gray-400",children:">"}),e.jsx("span",{className:"text-base-header font-medium",children:r("board.inspections.violationId",{id:c.actionItemId})})]}),e.jsx(ae,{detail:c,onViewAttachments:g}),e.jsx(ne,{items:c.sidePanelItems}),v]})},me=({violationId:s})=>{const{t:n}=y();return e.jsx(E,{title:n("board.inspections.violationNotFound"),description:n("board.inspections.violationNotFoundDescription",{id:s}),backTo:{path:"/board/inspections",label:n("board.inspections.backToInspections")}})},Fe={showPropertySelector:!0,showAi:!1,requiresRedesignPage:"inspectionsPage"};async function Ae({params:s,request:n}){const t=parseInt(s.id??"");if(!t)return C("/board/inspections");const o=new URL(n.url),l=parseInt(o.searchParams.get("associationId")??"0"),i=o.searchParams.get("inspectionId")?parseInt(o.searchParams.get("inspectionId")??"0"):void 0;if(!l)return C("/board/inspections");const r=Y.getViolationDetail(t,l,i).catch(m=>(console.error(m),null));return Z({violationDetail:r,violationId:t,associationId:l,inspectionId:i})}function Ce(){ie("/board/inspections");const s=Q(),{violationDetail:n,violationId:t,associationId:o,inspectionId:l}=X();return e.jsx(te,{controller:"Board_v2",action:"Inspections",children:e.jsx(ee,{dataQa:"inspection-detail-panel",onClose:()=>s("/board/inspections"),children:({isSlideOver:i,onClose:r})=>e.jsx(le,{violationDetailPromise:n,violationId:t,associationId:o,inspectionId:l,isSlideOver:i,onClose:r,slideOverNavigation:e.jsx(se,{currentItemId:t,getItemPath:m=>`/board/inspections/${m}?${new URLSearchParams({associationId:o.toString(),...l?{inspectionId:l.toString()}:{}})}`})})})})}export{Ce as Component,Fe as handle,Ae 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.