1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2511],{45840:function(e){function t(e){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=function(){return[]},t.resolve=t,t.id=45840,e.exports=t},38082:function(e,t,a){"use strict";var l=a(67294);let n=e=>new Promise(t=>{setTimeout(()=>t(),e)});t.Z=function(e,t){let{delay:a,skip:s}=t||{},[r,o]=(0,l.useState)(void 0),[i,c]=(0,l.useState)(!1);(0,l.useEffect)(()=>{(async()=>{let t;if(e&&!s){a&&await n(a);try{t=await fetch(e)}catch(t){console.error("Failed to fetch: ".concat(e),t),c(!0);return}if(!t.ok){c(!0);return}c(!1),o(await t.json())}})()},[e,a,s]);let u=[r,i];return u.data=r,u.error=i,u}},33723:function(e,t,a){"use strict";var l=a(85893),n=a(19490),s=a(35474),r=a(23855),o=a(98607),i=a(94184),c=a.n(i),u=a(67294);t.Z=e=>{let{comments:t,onSubmit:a,hideCommentInput:i}=e,{showNotification:d}=(0,n.lm)(),[m,h]=(0,u.useState)(""),[p,f]=(0,u.useState)(!1),[y,x]=(0,u.useState)(!1);return!t.length&&i?null:(0,l.jsxs)("div",{className:"comment",children:[(0,l.jsxs)("div",{className:"comment__header",children:[(0,l.jsx)("p",{className:"comment__input-title mb-0",children:"Comments"}),!i&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("textarea",{className:c()("comment__input-textarea form-control",{"is-invalid":y}),placeholder:"Add a comment...",value:m,disabled:p,onChange:e=>{h(e.target.value)}}),!!(null==m?void 0:m.trim())&&(0,l.jsxs)("div",{children:[(0,l.jsx)(o.Z,{type:"button",className:"btn btn-primary theme--accent btn-sm text-uppercase me-3",buttonText:"Submit",isLoading:p,onClick:async()=>{x(!1),f(!0);try{await (null==a?void 0:a(m))?h(""):x(!0)}catch(e){(0,r.ZP)({error:e,customData:{newComment:m}}),x(!0),d({type:"Danger",title:"Submit Comment Error",body:n.Ex})}finally{f(!1)}}}),(0,l.jsx)("button",{type:"button",className:"btn btn-outline-primary btn-sm text-uppercase",onClick:()=>h(""),children:"Cancel"})]})]})]}),(0,l.jsx)("div",{className:"comment__body",children:t.map(e=>{let{id:t,name:a,comment:n,createdAt:r}=e;return(0,l.jsxs)("div",{className:"comment__card mb-4",children:[(0,l.jsxs)("div",{className:"comment__card-header",children:[(0,l.jsx)("p",{className:"comment__card-name mb-0",children:a}),!!r&&(0,l.jsx)("p",{className:"comment__card-created-at mb-0",children:(0,s.p6)(r,s.t6.DateTime)})]}),(0,l.jsx)("p",{className:"comment__card-comment mb-0",children:n})]},t)})})]})}},90672:function(e,t,a){"use strict";var l=a(85893),n=a(51717),s=a(83959),r=a(38082),o=a(28035),i=a(90446),c=a(19490),u=a(23855),d=a(65612),m=a(96678),h=a(33723),p=a(98270),f=a(36287),y=a(98607),x=a(34308),g=a(51501),b=a(27267),v=a(45090),j=a(35823),N=a.n(j),C=a(67294),w=a(84380);let F=/(?:\.([^.]+))?$/,Z=e=>{let{className:t,label:a,options:n,formData:s,mergeFormData:r}=e;return(0,l.jsx)(f.Z,{className:t,groupName:o.HN.ContributingFactors,label:a,defaultValue:s[o.HN.ContributingFactors],options:n,onChange:(e,t)=>
1{let a=(0,f.C)(s[o.HN.ContributingFactors],e,t);null==r||r({[o.HN.ContributingFactors]:a})}})};t.Z=e=>{var t,a,j,D;let{user:k,reviewMode:E,formData:_,mergeFormData:S,forPdf:O,preloadedComments:P}=e,{Reporter:H,ActualSeverity:T,ControlFailure:L,ControlFailureFactors:I,OtherControlFailureFactor:V,ContributingFactors:q,OtherContributingFactors:G,EquityOrInclusion:A,EquityOrInclusionDetails:U,KeyLearnings:M,OtherComments:W}=_,R=(0,o.Hm)(null!=T?T:0),{showNotification:Y}=(0,c.lm)(),{incidentId:z=""}=(0,o.YR)(),[B,J]=(0,C.useState)(Date.now()),{data:K}=(0,r.Z)("".concat((0,n.Dk)(z),"?t=").concat(B),{skip:!z||!!P}),Q=null!==(t=null!=P?P:null==K?void 0:K.comments)&&void 0!==t?t:[],[$,X]=(0,C.useState)(Date.now()),{data:ee}=(0,r.Z)("".concat((0,n.KT)(z),"?t=").concat($),{skip:!z}),et=null!==(a=null==ee?void 0:ee.attachments)&&void 0!==a?a:[],[ea,el]=(0,C.useState)([]),en=ea[0],[es,er]=(0,C.useState)(!1),[eo,ei]=(0,C.useState)(),[ec,eu]=(0,C.useState)(!1),ed=async()=>{if(!z){let{success:e,errorMessage:t}=await (0,i.Z)({complete:!1});if(!e){Y({type:"Danger",title:"Failed to save report",body:t});return}}return(0,o.YR)().incidentId};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.Z,{className:"form-group mt-4",label:"Was this a control failure (i.e., did a safety measure such as equipment, procedure, or supervision fail)?".concat(R?"*":""),groupName:o.HN.ControlFailure,defaultValue:L,options:["Yes","No"],onChange:e=>null==S?void 0:S({[o.HN.ControlFailure]:e}),reviewMode:E,reviewModeValue:L}),"Yes"===L&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(f.Z,{className:"form-group mt-4",groupName:o.HN.ControlFailureFactors,label:"Type of control failure*",defaultValue:I,options:v.ie,onChange:(e,t)=>
1{let a=(0,f.C)(I,e,t);null==S||S({[o.HN.ControlFailureFactors]:a})},reviewMode:E,reviewModeValue:(0,d.Pd)(...null!==(j=null==I?void 0:I.filter(e=>e!==v.WA.Other).map(e=>v.pA[e]))&&void 0!==j?j:[],V)}),!E&&(null==I?void 0:I.includes(v.WA.Other))&&(0,l.jsxs)(w.Z.Group,{className:"form-group",children:[(0,l.jsx)(w.Z.Label,{children:"Other*"}),(0,l.jsx)(w.Z.Control,{placeholder:"Please specify",defaultValue:V,onChange:e=>null==S?void 0:S({[o.HN.OtherControlFailureFactor]:e.target.value})})]})]}),!E&&(0,l.jsx)("hr",{}),(0,l.jsxs)(w.Z.Group,{className:"form-group mt-4",children:[(0,l.jsxs)(w.Z.Label,{children:["What conditions or factors may have contributed to this incident?",R&&"*"]}),!E&&(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)(Z,{className:"mt-4 col-12 col-sm-6",label:"Slips, Trips, and Falls",options:b.oR,formData:_,mergeFormData:S}),(0,l.jsx)(Z,{className:"mt-4 col-12 col-sm-6",label:"Equipment",options:b.Lu,formData:_,mergeFormData:S}),(0,l.jsx)(Z,{className:"mt-4 col-12 col-sm-6",label:"Environment",options:b.xI,formData:_,mergeFormData:S}),(0,l.jsx)(Z,{className:"mt-4 col-12 col-sm-6",label:"Human Factors",options:b.IV,formData:_,mergeFormData:S}),(0,l.jsx)(Z,{className:"mt-4 col-12 col-sm-6",label:"Systems & Processes",options:b.he,formData:_,mergeFormData:S}),(0,l.jsxs)("div",{className:"mt-4 col-12 col-sm-6",children:[(0,l.jsx)(Z,{label:"Other",options:b.Q2,formData:_,mergeFormData:S}),!E&&(null==q?void 0:q.includes(b.Fu.Other))&&(0,l.jsx)(w.Z.Group,{className:"form-group",children:(0,l.jsx)(w.Z.Control,{placeholder:"Please specify",defaultValue:G,onChange:e=>null==S?void 0:S({[o.HN.OtherContributingFactors]:e.target.value})})})]})]}),E&&(0,l.jsx)("div",{children:(0,d.Pd)(...null!==(D=null==q?void 0:q.filter(e=>e!==b.Fu.Other).map(e=>b.pj[e]))&&void 0!==D?D:[],G)})]}),!E&&(0,l.jsx)("hr",{}),(0,l.jsx)(x.Z,{className:"form-group mt-4",label:"Did any factors related to equity or inclusion contribute?".concat(R?"*":""),helpText:"(e.g., bias, discrimination, language barriers, accessibility needs, cultural expectations)",groupName:o.HN.EquityOrInclusion,defaultValue:A,options:["Yes","No","Unsure"],onChange:e=>null==S?void 0:S({[o.HN.EquityOrInclusion]:e}),reviewMode:E,reviewModeValue:A}),("Yes"===A||"Unsure"===A)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(w.Z.Label,{children:"Please briefly describe what you noticed or what you think may have contributed.*"}),(0,l.jsx)(w.Z.Control,{as:"textarea",rows:3,placeholder:"enter your answer",defaultValue:U,onChange:e=>null==S?void 0:S({[o.HN.EquityOrInclusionDetails]:e.target.value})})]}),!E&&(0,l.jsx)("hr",{}),(0,l.jsxs)(w.Z.Group,{className:"form-group mt-4",children:[(0,l.jsxs)(w.Z.Label,{children:["What are the key learnings from this incident?",R&&"*"]}),(0,l.jsx)(w.Z.Text,{className:"d-block mt-0",children:"Include any actions, if any, that may reduce the likelihood of a similar incident in the future"}),!E&&(0,l.jsx)(w.Z.Control,{as:"textarea",rows:3,placeholder:"Start typing",defaultValue:M,onChange:e=>null==S?void 0:S({[o.HN.KeyLearnings]:e.target.value})}),E&&M]}),(0,l.jsxs)(w.Z.Group,{className:"form-group mt-4",children:[(0,l.jsx)(w.Z.Label,{children:"Anything Else?"}),(0,l.jsx)(w.Z.Text,{className:"d-block mt-0",children:"Other comments not already covered."}),!E&&(0,l.jsx)(w.Z.Control,{as:"textarea",rows:3,placeholder:"Start typing",defaultValue:W,onChange:e=>null==S?void 0:S({[o.HN.OtherComments]:e.target.value})}),E&&W]}),(0,l.jsx)("hr",{}),(0,l.jsx)(h.Z,{comments:Q.map(e=>{let{id:t,Note_Title:a,Note_Content:l,Created_Time:n}=e;return{id:t,name:a,comment:l,createdAt:n}}),onSubmit:async e=>{let t=await ed();if(!t)return!1;let a=(0,n.Dk)(t);try{let t=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comment:e})});if(!t.ok){let e=await t.json();return Y({type:"Danger",title:"Failed to add comment",body:e.message}),!1}}catch(e){return Y({type:"Danger",title:"Failed to add comment",body:c.Ex}),!1}return J(Date.now()),!0},hideCommentInput:O||!H||H.id===k.id}),(0,l.jsx)(w.Z.Label,{className:"mt-3",children:"Please include any photos or files related to this incident."}),!O&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.Z,{selectedFiles:ea,setSelectedFiles:el}),en&&(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(y.Z,{type:"button",className:"btn btn-primary theme--accent btn-sm text-uppercase me-3",buttonText:"Upload",isLoading:es,onClick:async()=>
1{if(en.size>s.fT){Y({type:"Danger",title:"Error",body:"Selected file exceeds maximum allowed size (".concat(s.fM,"MB). Please reduce your file size and try again.")});return}er(!0);try{let e=await ed();if(!e)return;let t=(0,n.KT)(e),a=new FormData;if(a.append("file",en),!(await fetch(t,{method:"POST",body:a})).ok){Y({type:"Danger",title:"Error",body:"Failed to upload. Please check your file and try again."});return}Y({type:"Success",title:"File uploaded",body:"File uploaded successfully."}),el([]),X(Date.now())}catch(a){let{name:e,size:t}=en;(0,u.ZP)({error:a,customData:{filename:e,size:t}}),Y({type:"Danger",title:"Upload file error",body:c.Ex})}finally{er(!1)}}}),(0,l.jsx)("button",{type:"button",className:"btn btn-outline-primary btn-sm text-uppercase",onClick:()=>el([]),children:"Cancel"})]})]}),et.map(e=>{var t;let{File_Name:a,id:s}=e,r=null===(t=F.exec(a))||void 0===t?void 0:t[1];return(0,l.jsx)(m.P,{className:"mt-4",extension:r,title:a,footer:(0,l.jsxs)("button",{type:"button",className:"btn btn-link d-flex gap-1 p-0",onClick:async()=>{if(!ec){eu(!0),ei(s);try{let e=(0,n.dl)(z,s),t=await fetch(e);if(!t.ok){Y({type:"Danger",title:"Error",body:"Failed to download. Please refresh the page and try again."});return}let l=await t.arrayBuffer();N()(l,a)}catch(e){(0,u.ZP)({error:e,customData:{incidentId:z,filename:a,attachmentId:s}}),Y({type:"Danger",title:"Upload file error",body:c.Ex})}finally{eu(!1),ei(void 0)}}},children:["Download",(0,l.jsx)(p.Z,{asset:"/assets/ic-download.svg",width:16,height:16})]}),downloading:ec&&eo===s},s)})]})}},34308:function(e,t,a){"use strict";var l=a(85893),n=a(82015),s=a(94184),r=a.n(s);a(67294);var o=a(84380);t.Z=function(e){let{className:t,label:a,helpText:s,groupName:i,defaultValue:c,options:u,onChange:d,touched:m,error:h,reviewMode:p,reviewModeValue:f,radioStyle:y="Default",labelFormatter:x}=e,g=m&&!!h;return(0,l.jsxs)(o.Z.Group,{className:r()(t,(0,n.wH)("radio-button-group",{coloured:"Coloured"===y})),onChange:e=>null==d?void 0:d(e.target.value),children:[a&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.Z.Label,{className:r()({"mb-0":!!s}),children:a}),s&&(0,l.jsx)(o.Z.Text,{className:"d-block mt-0 mb-2",children:s})]}),(0,l.jsxs)("div",{className:"radio-button-group__options",children:[!p&&u.map((e,t)=>{let{key:a,value:n}="string"==typeof e?{key:e,value:e}:e;return(0,l.jsx)(o.Z.Check,{className:r()({"is-invalid":g}),name:i,defaultChecked:c===a,type:"radio",label:(null==x?void 0:x(n,t))||n,value:a,isInvalid:g},a)}),p&&(0,l.jsx)("div",{children:f})]}),h&&(0,l.jsx)(o.Z.Control.Feedback,{type:"invalid",children:h})]})}},51501:function(e,t,a){"use strict";a.d(t,{Z:function(){return b}});var l=a(85893),n=a(19490),s=a(42221),r=a.n(s),o=a(23855);let i=["image/heic","image/heif","image/heic-sequence","image/heif-sequence"],c=[".heic",".heif"],u=e=>{let t=e.type.toLowerCase();if(i.some(e=>e===t))return!0;let a=e.name.toLowerCase();return c.some(e=>a.endsWith(e))},d=async e=>{if(!u(e))return e;let t=new Uint8Array(await e.arrayBuffer()),a=await r()({buffer:t,format:"JPEG",quality:1}),l=c.find(t=>e.name.toLowerCase().endsWith(t)),n=l?e.name.slice(0,-l.length):e.name;return new File([new Uint8Array(a)],"".concat(n,".jpg"),{type:"image/jpeg"})},m=async e=>{let{results:t,errors:a}=await (0,o.vE)(e,e=>d(e).catch(t=>{throw new o.Gs('Failed to convert file "'.concat(e.name,'" to JPEG'),{cause:t,customData:{filename:e.name,type:e.type,size:e.size}})}));if(a.length)throw new o.GN("Failed to convert files to JPEG",a);return t};var h=a(96678),p=a(98270),f=a(94184),y=a.n(f),x=a(67294);let g="file-upload";var b=e=>{let{className:t,accept:a,selectedFiles:s,setSelectedFiles:r,multiple:i}=e,{showNotification:c}=(0,n.lm)(),[u,d]=(0,x.useState)(!1),f=async e=>{if(!e)return;let t=Array.from(e);d(!0);try{let e=await m(t);r(e)}catch(e){(0,o.ZP)({error:e,customData:{filenames:t.map(e=>e.name)}}),c({type:"Danger",title:"Error",body:"Failed to process the selected file(s). Please try a different file."})}finally{d(!1)}},b=e=>{r(s.filter((t,a)=>a!==e))};return(0,l.jsxs)("div",{className:y()("file-selector",t),children:[(0,l.jsx)("input",{className:"d-none",id:g,type:"file",accept:a,multiple:i,onChange:e=>{let{target:t}=e;f(t.files),t.value=""}}),0===s.length&&(0,l.jsxs)("button",{type:"button",className:"no-file",disabled:u,onClick:()=>{var e;return null===(e=document.getElementById(g))||void 0===e?void 0:e.click()},children:[(0,l.jsx)("span",{className:"text-uppercase",children:u?"Processing file(s)â¦"
1:"Upload file(s) here"}),(0,l.jsx)(p.Z,{className:"ms-2",asset:"/assets/ic-upload.svg",width:16,height:16})]}),s.length>0&&s.map((e,t)=>{let a=e.name,n=e.type.startsWith("image/")?e.type.split("/")[1]:"pdf";return(0,l.jsx)(h.P,{className:y()({"mt-2":t>0}),extension:n,title:a,footer:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("button",{type:"button",className:"btn btn-link d-flex gap-1 p-0",onClick:()=>{var e;return null===(e=document.getElementById(g))||void 0===e?void 0:e.click()},children:["Replace file(s)",(0,l.jsx)(p.Z,{asset:"/assets/ic-upload.svg",width:16,height:16})]}),(0,l.jsxs)("button",{type:"button",className:"btn btn-link d-flex gap-1 p-0",onClick:()=>b(t),children:[(0,l.jsx)("span",{className:"d-none d-sm-inline-block",children:"Remove"}),(0,l.jsx)(p.Z,{asset:"/assets/ic-close.svg",width:16,height:16})]})]})},a)})]})}}}]);
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.