1"use strict";(self.webpackChunkzerobees=self.webpackChunkzerobees||[]).push([[864],{18762:(e,a,n)=>{n.d(a,{A:()=>i});var s=n(84411),t=(n(25015),n(74725)),o=n(97939),l=n(80256),r=n(70579);const i=e=>{let{onChange:a,data:n,errors:i}=e;const{t:c}=(0,t.B)(),d=(new Date).toISOString().split("T")[0],u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;const a=new Date(e.getTime());return a.setDate(e.getDate()-364),a}().toISOString().split("T")[0],m=e=>{const[a,n,s]=e.split("-");return"".concat(s,"/").concat(n,"/").concat(a)};const h=Math.min((new Date).getTime(),new Date((null===n||void 0===n?void 0:n.periodTo)||"").getTime()-864e5);return(0,r.jsx)(s.CCol,{children:(0,r.jsxs)(s.CRow,{className:"d-flex justify-content-between align-items-end",children:[(0,r.jsxs)(s.CFormGroup,{className:"pl-0 col",children:[(0,r.jsx)(s.CLabel,{children:c("shared.from","From")}),(0,r.jsx)(l.A,{maxDate:new Date(h),name:"periodFrom",onChange:e=>{a(e)},value:n.periodFrom,className:"w-100",placeholderText:m(u),isClearable:!0}),(0,r.jsx)(o.ErrorText,{value:i.periodFrom})]}),(0,r.jsxs)(s.CFormGroup,{className:"col pr-0",children:[(0,r.jsx)(s.CLabel,{children:c("shared.to","To")}),(0,r.jsx)(l.A,{minDate:new Date((null===n||void 0===n?void 0:n.periodFrom)||""),name:"periodTo",onChange:e=>{a(e)},value:n.periodTo,className:"w-100",placeholderText:m(d),isClearable:!0}),(0,r.jsx)(o.ErrorText,{value:i.periodTo})]})]})})}},22055:(e,a,n)=>{n.d(a,{M7:()=>l,WY:()=>t,bj:()=>s,kQ:()=>r,mg:()=>o,zQ:()=>i});const s=210,t=295,o=[46,184,92],l=[0,0,0],r=[255,255,255],i=[249,177,21]},23056:(e,a,n)=>{async function s(e){return new Promise((a,n)=>{fetch(e.src).then(e=>e.blob()).then(e=>{const n=new FileReader;n.onloadend=()=>{a(n.result)},n.readAsDataURL(e)})})}n.d(a,{k:()=>s})},37302:(e,a,n)=>{n.d(a,{A:()=>l});var s=n(37762),t=(n(20557),n(22055));class o extends s.default{constructor(e){let{orgName:a,reportingPeriod:n,whiteLogoImg:s,colorLogoImg:o}=e;super({compress:!0}),this.addCanvas=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;try{let s,o=document.querySelector("#".concat(e));if(s=null!==o&&void 0!==o&&o.height?o:document.querySelector(".element-to-print #".concat(e)),!s)return void this.addCenteredText("No data available",t.M7,20);const l=s.toDataURL("image/png"),r=a*t.bj,i=((e,a)=>e.height*(t.bj/e.width)*a)(s,a),c=(1-a)*t.bj/2;this.addImage(l,"PNG",c,this.yCoord,r,i,void 0,void 0,n),this.yCoord+=i}catch(s){console.error("Error adding ".concat(e)),console.error(s)}},this.addText=function(e,a,n,s,t){let o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];this.setTextColor(...a),this.setFontSize(n),o&&(this.yCoord+=.2*n+6),this.text(e,s,t||this.yCoord,{align:"center"})},this.addCenteredText=function(e,a,n){let s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0;this.addText(e,a,n,t.bj/2,o,s)},this.addQuestionText=function(){this.setFont("helvetica","normal"),this.addCenteredText(...arguments),this.setFont("helvetica","bold")},this.addHeader=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GHG emissions";this.setFillColor(...t.mg),this.rect(0,0,t.bj,e,"F"),this.addImage(this.whiteLogoImg,"PNG",t.bj-60,6,50,8),this.setTextColor(...t.kQ),this.setFontSize(30),this.text(this.orgName,10,15),this.setFontSize(16),this.setFont("helvetica","normal"),this.setTextColor(...t.zQ),this.text(a,10,22),this.setFont("helvetica","bold"),this.setTextColor(...t.kQ),this.setFontSize(12),this.yCoord+=e},this.addFooter=async function(e){this.addImage(this.colorLogoImg,"PNG",10,t.WY-12,18,3),this.addText(String(e),t.M7,10,t.bj-12,t.WY-10,!1)},this.addNewPage=async function(e){this.addPage(),this.yCoord=0,await this.addHeader(),await this.addFooter(this.pageNum++),await e()},this.yCoord=0,this.pageNum=1,this.orgName=a,this.reportingPeriod=n,this.whiteLogoImg=s,this.colorLogoImg=o}}const l=o},46834:(e,a,n)=>{n.d(a,{A:()=>x});var s=n(89379),t=n(80045),o=n(57528),l=n(84411),r=n(65043),i=n(41434),c=n(34960),d=n(30009),u=n(70579);const m=["title","children","style","className","defaultOpen","titleFontSize"];var h;const p=(0,d.default)(l.CCallout)(h||(h=(0,o.A)(["\n li::marker {\n color: #2eb85c !important;\n font-size: 40px !important;\n }\n li {\n max-width: 400px;\n }\n\n background-color: white;\n\n .c-dark-theme & {\n background-color: #2b2b2b;\n color: white;\n }\n\n"]))),x=e=>{let{title:a,children:n,style:o={},className:d="",defaultOpen:h=!1,titleFontSize:x="16px"}=e,g=(0,t.A)(e,m);const[v,b]=(0,r.useState)(h);return(0,u.jsxs)(p,(0,s.A)((0,s.A)({color:"success",className:"position-relative shadow",style:(0,s.A)((0,s.A)({},o),{},{padding:0,width:"100%",maxWidth:"600px"})},g),{},{children:[" ",(0,u.jsxs)(l.CButton,{variant:"ghost",color:"success",className:"w-100 d-flex justify-content-between align-items-center px-2 text-left ",onClick:()=>b(e=>!e),style:{borderTopLeftRadius:0,borderBottomLeftRadius:0},children:[(0,u.jsxs)("span",{style:{fontSize:x,color:"black"},className:"m-0 text-black ",children:[(0,u.jsx)(i.prl,{size:20,className:"mb-1"})," ",a]}),v?(0,u.jsx)(c.nxn,{fontSize:20}):(0,u.jsx)(c.q2p,{fontSize:20})]}),(0,u.jsx)(l.CCollapse,{show:v,className:"p-3 pl-5 ",children:n}),v&&(0,u.jsx)("div",{style:{backgroundColor:"#2eb85c",position:"absolute",top:77,left:62,height:"85%",width:"2px"}})]}))}},48613:(e,a,n)=>{n.d(a,{HT:()=>t,m8:()=>o});var s=n(65043);n(70579);const t=s.createContext(),o=()=>{const e=s.useContext(t);if(void 0===e)throw new Error("useEsgContext must be used within a EsgContext.Provider");return e}},51290:(e,a,n)=>{n.d(a,{A:()=>o});var s=n(84411),t=(n(65043),n(70579));const o=e=>{let{name:a,label:n,onChange:o,defaultValue:l,value:r,className:i,disabled:c,style:d}=e;return(0,t.jsxs)(s.CFormGroup,{className:i,variant:"custom-checkbox",style:{fontSize:"14px"},children:[(0,t.jsx)(s.CInputCheckbox,{custom:!0,id:"".concat(a),onChange:o,defaultChecked:l,checked:r,disabled:c}),(0,t.jsx)(s.CLabel,{style:d,variant:"custom-checkbox",htmlFor:"".concat(a),children:n})]})}},78662:(e,a,n)=>{n.d(a,{G:()=>g});var s=n(84411),t=n(53536),o=n(97939),l=n(80256),r=n(89379),i=n(80045),c=n(70579);const d=["className","options"],u=e=>{let{className:a,options:n}=e,s=(0,i.A)(e,d);return(0,c.jsx)(o.StyledReactSelect,(0,r.A)({menuPortalTarget:document.body,styles:{menuPortal:e=>(0,r.A)((0,r.A)({},e),{},{zIndex:9999})},isMulti:!0,backspaceRemovesValue:!0,className:"".concat(a," w-100"),classNamePrefix:"react-select",options:n},s))};var m=n(95666);const h=[{label:"Employee working from home energy",value:"work-from-home"},{label:"Distribution of advertising (digital or linear)",value:"advertising"},{label:"Energy related to hosting or publishing media",value:"media"},{label:"All purchased goods and services",value:"purchased-goods"},{label:"Capital goods",value:"capital-goods"},{label:"Fuel- and energy-related activities (not included in scope 1 and 2)",value:"fuel-energy"},{label:"Upstream transportation and distribution",value:"upstream-transportation"},{label:"Waste generated in operations",value:"waste"},{label:"Business travel",value:"business-travel"},{label:"Employee commuting",value:"employee-commuting"},{label:"Upstream leased assets",value:"upstream-leased-assets"},{label:"Downstream transportation and distribution",value:"downstream-transportation"},{label:"Processing of sold products",value:"processing"},{label:"Use of sold products",value:"use-of-sold-products"},{label:"End-of-life treatment of sold products",value:"end-of-life-treatment"},{label:"Downstream leased assets",value:"downstream-leased-assets"},{label:"Franchises",value:"franchises"},{label:"Investments",value:"investments"}],p=(new Date).getFullYear(),x=Array.from({length:20},(e,a)=>p-a),g=e=>{var a,n,r,i,d,p;let{onChange:g,values:v={},errors:b={}}=e;
1return{environment:[{component:(0,c.jsx)(m.A,{Component:o.BasicSelect,name:"assessed-ghg",onChange:g,values:v,errors:b,placeholder:"Select option...",options:[{label:"Yes",value:!0},{label:"No",value:!1}]}),label:"Have you assessed your organisation's GHG emissions?",name:"assessed-ghg"},{label:"What was the most recent year of assessment?",name:"ghg-assessment-year",component:(0,c.jsx)(m.A,{Component:o.BasicSelect,name:"ghg-assessment-year",onChange:g,values:v,errors:b,placeholder:"Select option...",options:x.map(e=>({label:e,value:e}))})},{label:"What are your GHG emissions for Scope 1? (tCO2e)",name:"ghg-scope1",component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"ghg-scope1",onChange:g,values:v,errors:b,placeholder:"Enter number...",min:0})},{label:"What are your GHG emissions for Scope 2? (tCO2e)",name:"ghg-scope2",component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"ghg-scope2",onChange:g,values:v,errors:b,placeholder:"Enter number...",min:0})},{label:"What are your GHG emissions for Scope 3? (tCO2e)",name:"ghg-scope3",component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"ghg-scope3",onChange:g,values:v,errors:b,placeholder:"Enter number...",min:0})},{label:"What was included in your scope 3 emissions?",name:"ghg-scope3-includes",component:(0,c.jsx)(u,{name:"ghg-scope3-includes",onChange:e=>g({target:{name:"ghg-scope3-includes",value:e}}),defaultValue:v["ghg-scope3-includes"],options:h})}],community:[{label:"Supplier diversity"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"suppliers-minority",onChange:g,values:v,errors:b,placeholder:"Enter percentage...",min:0,max:100,allowNegative:!1,suffix:" %"}),label:"What percentage of your suppliers are owned by individuals from underrepresented groups?",name:"suppliers-minority"}],employees:[{label:"Workforce numbers"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"fte",onChange:g,values:v,errors:b,placeholder:"Enter number...",min:0}),label:"What was the full-time equivalent number (FTE) of employees in your organization?",name:"fte"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"employee-number",onChange:g,values:v,errors:b,placeholder:"Enter number...",min:0}),label:"What was the number of individuals employed by your organization? (if different from FTE)",name:"employee-number"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"fte-turnover",onChange:g,values:v,errors:b,placeholder:"Enter percentage...",min:0,max:100,suffix:" %"}),label:"What was the percentage of employee turnover (FTE)?",name:"fte-turnover"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"employee-turnover",onChange:g,values:v,errors:b,placeholder:"Enter percentage...",min:0,max:100,suffix:" %"}),label:"What was the percentage of employee turnover (individuals - if different from FTE)?",name:"employee-turnover"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"non-employees",onChange:g,values:v,errors:b,placeholder:"Enter number...",min:0}),label:"How many non-employee workers do you have directly contracted in roles - e.g. contractors, self-employed workers? (as individuals)",name:"non-employees"},{component:(0,c.jsx)(m.A,{Component:o.BasicSelect,name:"non-employees-included",onChange:g,values:v,errors:b,placeholder:"Select option...",options:[{label:"Yes, in both",value:"both"},{label:"Yes, in FTE only",value:"fte-only"},{label:"Yes, in individual employees only",value:"individual-only"},{label:"No",value:"no"}]}),label:"Are these non-employed workers included in your FTE & individual employee numbers above?",name:"non-employees-included"},{label:"Workforce demographics"},{component:(0,c.jsxs)("div",{children:[(0,c.jsxs)(s.CRow,{style:{marginLeft:"-15px"},children:[(0,c.jsxs)(s.CCol,{className:"col-12 col-md-4 mb-3 ",children:[(0,c.jsx)("p",{className:"mb-1",children:"Female"}),(0,c.jsx)(o.BasicNumberInput,{allowNegative:!1,min:0,max:100,name:"workforce-gender.female",defaultValue:null===(a=v["workforce-gender"])||void 0===a?void 0:a.female,onChange:g,placeholder:"Enter percentage...",suffix:" %"})]}),(0,c.jsxs)(s.CCol,{className:"col-12 col-md-4 mb-3 ",children:[(0,c.jsx)("p",{className:"mb-1",children:"Male"}),(0,c.jsx)(o.BasicNumberInput,{allowNegative:!1,min:0,max:100,name:"workforce-gender.male",defaultValue:null===(n=v["workforce-gender"])||void 0===n?void 0:n.male,onChange:g,placeholder:"Enter percentage...",suffix:" %"})]}),(0,c.jsxs)(s.CCol,{className:"col-12 col-md-4 ",children:[(0,c.jsx)("p",{className:"mb-1",children:"Other"}),(0,c.jsx)(o.BasicNumberInput,{allowNegative:!1,min:0,max:100,name:"workforce-gender.other",defaultValue:null===(r=v["workforce-gender"])||void 0===r?void 0:r.other,onChange:g,placeholder:"Enter percentage...",suffix:" %"})]})]}),(0,c.jsx)(o.ErrorText,{value:b["workforce-gender"]})]}),label:"What percentage of your workforce identifies as...?",name:"workforce-gender"},{label:"Leadership representation"}
1,{component:(0,c.jsxs)("div",{children:[(0,c.jsxs)(s.CRow,{style:{marginLeft:"-15px"},children:[(0,c.jsxs)(s.CCol,{className:"col-12 col-md-4 mb-3 ",children:[(0,c.jsx)("p",{className:"mb-1",children:"Female"}),(0,c.jsx)(o.BasicNumberInput,{allowNegative:!1,min:0,max:100,name:"leadership-gender.female",defaultValue:null===(i=v["leadership-gender"])||void 0===i?void 0:i.female,onChange:g,placeholder:"Enter percentage...",suffix:" %"})]}),(0,c.jsxs)(s.CCol,{className:"col-12 col-md-4 mb-3 ",children:[(0,c.jsx)("p",{className:"mb-1",children:"Male"}),(0,c.jsx)(o.BasicNumberInput,{allowNegative:!1,min:0,max:100,name:"leadership-gender.male",defaultValue:null===(d=v["leadership-gender"])||void 0===d?void 0:d.male,onChange:g,placeholder:"Enter percentage...",suffix:" %"})]}),(0,c.jsxs)(s.CCol,{className:"col-12 col-md-4 ",children:[(0,c.jsx)("p",{className:"mb-1",children:"Other"}),(0,c.jsx)(o.BasicNumberInput,{allowNegative:!1,min:0,max:100,name:"leadership-gender.other",defaultValue:null===(p=v["leadership-gender"])||void 0===p?void 0:p.other,onChange:g,placeholder:"Enter percentage...",suffix:" %"})]})]}),(0,c.jsx)(o.ErrorText,{value:b["leadership-gender"]})]}),label:"What percentage of your executive leadership team identifies as...?",name:"leadership-gender"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"leadership-minority",onChange:g,values:v,errors:b,placeholder:"Enter percentage...",allowNegative:!1,min:0,max:100,suffix:" %"}),label:"What percentage of your executive leadership team identifies as belonging to racial or ethnic minority groups?",name:"leadership-minority"},{label:"Accessibility and inclusion"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"leadership-disability",onChange:g,values:v,errors:b,placeholder:"Enter percentage...",min:0,max:100,suffix:" %"}),label:"What percentage of your workforce has disclosed a disability or accessibility need?",name:"leadership-disability"},{label:"LGBTQ+ representation"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"leadership-lgbtq",onChange:g,values:v,errors:b,placeholder:"Enter percentage...",min:0,max:100,suffix:" %"}),label:"What percentage of your workforce identifies as LGBTQ+?",name:"leadership-lgbtq"},{label:"Gender pay equity"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"pay-gap",onChange:g,values:v,errors:b,placeholder:"Enter percentage...",min:0,max:100,suffix:" %"}),label:"What is the gender pay gap within your organisation, expressed as a percentage?",name:"pay-gap"},{component:(0,c.jsxs)(s.CFormGroup,{children:[(0,c.jsx)(l.A,{maxDate:new Date,name:"pay-gap-date",onCh
1ange:g,value:v["pay-gap-date"],className:"w-100",placeholderText:"Select date...",isClearable:!0}),b&&(0,c.jsx)(o.ErrorText,{value:(0,t.get)(b,"pay-gap-date")})]}),label:"When did we last assess our gender pay gap?",name:"pay-gap-date"},{label:"Training and development"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"di-training",onChange:g,values:v,errors:b,placeholder:"Enter percentage...",min:0,max:100,suffix:" %"}),label:"What percentage of your workforce has participated in diversity and inclusion training programs in the last year?",name:"di-training"},{label:"Ethnic and racial diversity"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"workforce-minority",onChange:g,values:v,errors:b,placeholder:"Enter percentage...",min:0,max:100,suffix:" %"}),label:"What percentage of your workforce identifies as belonging to racial or ethnic minority groups?",name:"workforce-minority"},{component:(0,c.jsx)(m.A,{Component:o.BasicInput,name:"minority-classification",onChange:g,values:v,errors:b}),label:" What classification have you used to define your racial/ethic minority groups?",name:"minority-classification"},{label:"Employee satisfaction"},{component:(0,c.jsx)(m.A,{Component:o.BasicNumberInput,name:"employee-satisfaction",onChange:g,values:v,errors:b,placeholder:"Enter percentage...",min:0,max:100,suffix:" %"}),label:" What is the overall employee satisfaction rate within your organisation (as a percentage based on survey responses)?",name:"employee-satisfaction",info:'Please report as a percentage. If you used a scale such as "not at all satisfied - somewhat dissatisfied - neither satisfied nor dissatisfied - satisfied - very satisfied", then give each a score (0, 1, 2, 3, 4) and then average your score and report as a %age. e.g. an average score of 3.2 would be 80%.'},{component:(0,c.jsxs)(s.CFormGroup,{children:[(0,c.jsx)(l.A,{maxDate:new Date,name:"satisfaction-survey-date",onCh
1ange:g,value:v["satisfaction-survey-date"],className:"w-100",placeholderText:"Select date...",isClearable:!0}),b&&(0,c.jsx)(o.ErrorText,{value:(0,t.get)(b,"satisfaction-survey-date")})]}),label:"When was the last time you conducted an employee satisfaction survey?",name:"satisfaction-survey-date"}]}}},95666:(e,a,n)=>{n.d(a,{A:()=>u});var s=n(89379),t=n(80045),o=n(84411),l=n(53536),r=n(80126),i=n(97939),c=n(70579);const d=["Component","name","errors","values","customDefault","label","labelClassName","info","className"],u=e=>{var a;let{Component:n,name:u,errors:m,values:h,customDefault:p,label:x,labelClassName:g,info:v,className:b}=e,f=(0,t.A)(e,d);return(0,c.jsxs)(o.CFormGroup,{className:b,children:[x&&(0,c.jsxs)(o.CLabel,{className:g,htmlFor:u,children:[x,!!v&&(0,c.jsx)(i.InfoTooltip,{content:v})]}),(0,c.jsx)(n,(0,s.A)({defaultValue:null!==(a=(0,l.get)(h,u))&&void 0!==a?a:p,name:u,id:u},f)),m&&(0,c.jsx)(r.A,{value:(0,l.get)(m,u)})]})}},97864:(e,a,n)=>{n.d(a,{AY:()=>he,RX:()=>V,xU:()=>Ee,l_:()=>z,PF:()=>_,ZE:()=>Q,pn:()=>ke,fL:()=>ne,pA:()=>de});var s=n(84411),t=n(65043),o=n(74725),l=n(97939),r=n(70579);const i=e=>{let{className:a,handleAdd:n,areas:i}=e;const[c,d]=(0,t.useState)(),{t:u}=(0,o.B)();return(0,r.jsxs)("div",{className:"d-flex align-self-start justify-content-between p-2 mb-3 align-items-center border bg-light rounded ".concat(a),children:[(0,r.jsx)("span",{style:{width:"250px"},children:"Add new question in:"}),(0,r.jsx)(l.BasicSelect,{className:" mr-3 mb-0",placeholder:"Select area",value:c,options:i,onChange:e=>d(e.target.value),required:!0}),(0,r.jsx)(s.CButton,{className:"ml-3",color:"success",variant:"outline",onClick:()=>n(c),disabled:void 0===c,children:u("shared.add","Add")})]})};var c=n(53536),d=n(24858),u=n(76381),m=n(64739),h=n(40517),p=n(48613);const x=e=>{let{handleChange:a,name:n,value:t,errors:o,label:i,info:d,labelClassname:u,className:m}=e;return(0,r.jsxs)(s.CFormGroup,{className:m,children:[(0,r.jsxs)(s.CLabel,{htmlFor:n,className:u,children:[i,!!d&&(0,r.jsx)(l.InfoTooltip,{content:d})]}),(0,r.jsx)(l.RichTextEditor,{id:n,value:t,onChange:e=>{(e||""===e)&&a({target:{name:n,value:e}})}}),o&&(0,r.jsx)(l.ErrorText,{value:(0,c.get)(o,n)})]})},g=e=>{let{question:a,errors:n,handleChange:s}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x,{handleChange:s,name:"label",value:null===a||void 0===a?void 0:a.label,errors:n,label:"Question",labelClassname:"font-bold"}),(0,r.jsx)(x,{value:null===a||void 0===a?void 0:a.labelExternal,name:"labelExternal",handleChange:s,label:"External Question",errors:n,info:"Use {ORG_NAME} to insert the organization name in the question.",labelClassname:"font-bold"})]})};var v=n(14556);const b=e=>{let{question:a,errors:n,handleChange:s,control:t}=e;const{fields:o,append:i,remove:c}=(0,d.jz)({control:t,name:"answers"}),u=(0,v.d4)(e=>e.coreui.darkMode);return a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x,{handleChange:s,name:"label",value:null===a||void 0===a?void 0:a.label,errors:n,label:"Question",labelClassname:"font-bold"}),(0,r.jsx)(x,{value:null===a||void 0===a?void 0:a.labelExternal,name:"labelExternal",handleChange:s,label:"External Question",errors:n,info:"Use {ORG_NAME} to insert the organization name in the question.",labelClassname:"font-bold"}),(0,r.jsx)("p",{className:" mb-0 font-bold",children:"Answers:"}),(0,r.jsxs)("div",{className:"pr-3 ",children:[null===o||void 0===o?void 0:o.map((e,a)=>(0,r.jsxs)("div",{style:u?{}:{backgroundColor:"#f8f9fa"},className:"w-100 rounded border p-3 mb-3",children:[(0,r.jsxs)("div",{className:"d-flex w-100 justify-content-between",children:[(0,r.jsxs)("div",{className:"d-flex align-items-baseline ",children:[(0,r.jsx)("span",{className:"mr-2 font-bold",children:"Points"}),(0,r.jsx)(l.BasicNumberInput,{value:e.value,name:"answers.".concat(a,".value"),onChange:s,label:"Points",errors:n,min:0,max:10,decimalScale:0})]}),(0,r.jsx)(l.DeleteButton,{onClick:()=>c(a),style:{height:"40px"}})]}),(0,r.jsx)(x,{value:e.label,name:"answers.".concat(a,".label"),handleChange:s,errors:n,className:"mb-3"})]},e.id)),(0,r.jsx)(l.AddMoreButton,{label:"Add answer",onClick:()=>i({label:"",value:0})})]})]}):null},f=[{value:"select",label:"Select"},{value:"text",label:"Text"},{value:"number",label:"Number"},{value:"date",label:"Date"},{value:"date-range",label:"Date Range"}],y=e=>{let{formMethods:a,showModal:n,closeModal:o,questionPath:i,isNew:m,isUsingGlobal:v,setRefresh:y,currentVersionId:j}=e;const{orgId:C,updateSurveyVersion:A}=(0,p.m8)(),{setValue:w,formState:{errors:N},getValues:B}=a,{reset:S,control:I,handleSubmit:k,setValue:E,watch:F}=(0,d.mN)(),[V,G]=(0,t.useState)({});(0,t.useEffect)(()=>
1{if(!i)return;const e=B(i);G((0,c.cloneDeep)(e)),S(e)},[i]);const T=F("type"),L=!T||"select"===T,D=i?B(i):null,{tryAndNotify:q}=(0,h.Yf)(),[W,M]=(0,t.useState)(""),Q=e=>{E(e.target.name,e.target.value,{shouldTouch:!0})},P=()=>{w(i,m?null:V),o()},Y="number"===T;return(0,r.jsxs)(u.A,{size:"xl",show:n,onClose:P,centered:!0,children:[(0,r.jsx)(s.CModalHeader,{closeButton:!0,className:"d-flex justify-content-center pb-0",children:(0,r.jsxs)("h3",{className:"my-4 px-4",children:[m?"Add":"Edit"," question"]})}),(0,r.jsxs)(s.CForm,{onSubmit:k(async e=>{if(null===e||void 0===e||!e.answers)return;if(!e.answers.map(e=>e.value).every((e,a,n)=>n.indexOf(e)===a))return void M("Answer points must be unique. If you want the question to be unscored, set the weight to 0.");M(""),w(i,e);const a=(0,c.cloneDeep)(B());a.areas.forEach(e=>{e.questions=e.questions.filter(Boolean)}),await q(async()=>A({data:a,isUsingGlobal:v,orgId:C,currentVersionId:j}),"Survey updated successfully","Error updating survey"),o(),v&&y(e=>++e)}),children:[D&&(0,r.jsxs)(s.CModalBody,{className:"px-5 pb-5 pt-0 d-flex flex-column",style:{gap:"1rem"},children:[(0,r.jsxs)(s.CFormGroup,{children:[(0,r.jsx)(s.CLabel,{className:"font-bold",htmlFor:"type",children:"Question Type"}),(0,r.jsx)(l.BasicSelect,{id:"type",name:"type",options:f,onChange:Q,value:T||"select"})]}),Y&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.CFormGroup,{children:[(0,r.jsx)(s.CLabel,{htmlFor:"min",className:"font-bold",children:"Min"}),(0,r.jsx)(l.BasicNumberInput,{id:"min",name:"min",defaultValue:(null===D||void 0===D?void 0:D.min)||0,onChange:Q})]}),(0,r.jsxs)(s.CFormGroup,{children:[(0,r.jsx)(s.CLabel,{htmlFor:"max",className:"font-bold",children:"Max"}),(0,r.jsx)(l.BasicNumberInput,{id:"max",name:"max",defaultValue:(null===D||void 0===D?void 0:D.max)||0,onChange:Q})]}),(0,r.jsxs)(s.CFormGroup,{children:[(0,r.jsx)(s.CLabel,{htmlFor:"suffix",className:"font-bold",children:"Suffix"}),(0,r.jsx)(l.BasicInput,{id:"suffix",name:"suffix",defaultValue:(null===D||void 0===D?void 0:D.suffix)||"",onChange:Q})]})]}),L?(0,r.jsx)(b,{question:D,handleChange:Q,errors:N,control:I}):(0,r.jsx)(g,{question:D,handleChange:Q,errors:N}),(0,r.jsx)(x,{handleChange:Q,name:"guidance",value:null===D||void 0===D?void 0:D.guidance,errors:N,label:"Guidance and detail",labelClassname:"font-bold"}),v&&(0,r.jsx)("p",{className:"text-danger mb-0",children:"WARNING: You are editing a global version of the survey. It may be used by multiple organisations."}),(0,r.jsx)(l.ErrorText,{value:W,customMessage:W})]}),(0,r.jsxs)(s.CModalFooter,{children:[(0,r.jsx)(l.ButtonBasic,{className:"mr-auto",onClick:async()=>{w(i,null);const e=(0,c.cloneDeep)(B());e.areas.forEach(e=>{e.questions=e.questions.filter(Boolean),e.questions.forEach(e=>{if("select"===e.type){e.answers=e.answers.filter(Boolean);if(e.answers.map(e=>e.value).some((e,a,n)=>a!==n.lastIndexOf(e)))for(let a=0;a<e.answers.length;a++){let n=0;for(let s=a+1;s<e.answers.length;s++)if(e.answers[a].value===e.answers[s].value){const a=String.fromCharCode(97+n);e.answers[s].value=e.answers[s].value+a,n++}}}})}),await q(async()=>A({data:e,isUsingGlobal:v,orgId:C,currentVersionId:j}),"Survey updated successfully","Error updating survey"),o(),v&&y(e=>++e)},type:"button",bgcolor:"#ff4136",hovercolor:"darkred",children:"Delete"}),(0,r.jsx)(l.ButtonBasic,{onClick:P,type:"button",bgcolor:"var(--secondary)",hovercolor:"var(--secondary-dark)",children:"Cancel"}),(0,r.jsx)(l.ButtonBasic,{type:"submit",bgcolor:"green",hovercolor:"darkgreen",children:"Save"})]})]})]})};var j=n(89379),C=n(4306),A=n(68045),w=n(33905);const N=e=>{let{onAdd:a,show:n,handleClose:t,isGlobal:o}=e;const{handleSubmit:i,setValue:c}=(0,d.mN)(),m=e=>{c(e.target.name,e.target.value,{shouldTouch:!0})},h=o?"You will add a new global survey version and set it as default - new organisations will use it. Existing organisations will not be affected.":"You will add a new survey version for organisation and set is as current.";return(0,r.jsx)(u.A,{show:n,onClose:t,centered:!0,children:(0,r.jsxs)(s.CForm,{onSubmit:i(e=>{a(e),t()}),children:[(0,r.jsxs)(s.CModalBody,{children:[(0,r.jsx)("h4",{children:"Add new survey version"}),(0,r.jsx)("p",{className:"text-info",children:h}),(0,r.jsxs)(s.CFormGroup,{children:[(0,r.jsx)(s.CLabel,{children:"Label (optional)"}
1),(0,r.jsx)(l.BasicInput,{name:"label",onChange:m})]}),(0,r.jsxs)(s.CFormGroup,{className:"mt-4",children:[(0,r.jsx)(s.CLabel,{children:"Description (optional)"}),(0,r.jsx)(s.CTextarea,{name:"description",onChange:m,rows:2})]})]}),(0,r.jsxs)(s.CModalFooter,{children:[(0,r.jsx)(l.ButtonBasic,{onClick:t,type:"button",bgcolor:"var(--secondary)",hovercolor:"var(--secondary-dark)",children:"Cancel"}),(0,r.jsx)(l.ButtonBasic,{type:"submit",bgcolor:"green",hovercolor:"darkgreen",children:"Save"})]})]})})},B=e=>{let{setValue:a,control:n}=e;const t=e=>{const{name:n,value:s}=e.target;a(n,s,{shouldTouch:!0})},[o,i]=(0,d.FH)({control:n,name:["label","description"]});return(0,r.jsxs)("div",{className:"rounded bg-light p-3 mb-3",children:[(0,r.jsxs)(s.CFormGroup,{children:[(0,r.jsx)(s.CLabel,{children:"Label"}),(0,r.jsx)(l.BasicInput,{name:"label",onChange:t,value:o})]}),(0,r.jsxs)(s.CFormGroup,{className:"mt-4",children:[(0,r.jsx)(s.CLabel,{children:"Description"}),(0,r.jsx)(s.CTextarea,{name:"description",onChange:t,rows:2,value:i})]})]})};var S=n(40624),I=n(32542);const k=e=>{let{title:a,options:n,currentVersionId:t,onSwitch:o,onAdd:i,color:c,switchBtnLabel:u,addBtnLabel:m}=e;const p=(0,d.mN)(),{width:x}=(0,h.wY)(),g=x<=768;if(!t)return null;const{setValue:v,formState:{touchedFields:b},handleSubmit:f}=p,y=null===n||void 0===n?void 0:n.find(e=>e.value===t);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{style:{fontSize:20},children:[a,(0,r.jsx)("span",{style:{fontSize:20},className:"text-".concat(c),children:null===y||void 0===y?void 0:y.label})]}),(0,r.jsxs)(s.CForm,{className:"d-flex ".concat(g&&"flex-column gap-3"," align-items-baseline"),onSubmit:f(e=>{const{version:a}=e;a&&a!==t&&o(a)}),children:[(0,r.jsx)("span",{className:"flex-shrink-0 mr-2",children:"Available versions: "}),(0,r.jsx)(l.BasicSelect,{options:n,onChange:e=>{v("version",e.target.value,{shouldTouch:!0})},defaultValue:t,placeholder:"Select...",className:" mr-2",style:{maxWidth:g?"300px":"500px"}}),(0,r.jsxs)(l.SquareButtonOutline,{disabled:void 0===(null===b||void 0===b?void 0:b.version),className:" flex-shrink-0",type:"submit",style:g?void 0:{width:"200px"},color:c,children:[u,(0,r.jsx)(I.Ay,{className:"ml-1",name:"cilSwapVertical"})]})]}),(0,r.jsxs)(l.SquareButtonOutline,{onClick:i,color:c,className:"mt-3",type:"button",children:[m," ",(0,r.jsx)(I.Ay,{name:"cil-plus"})]})]})},E=e=>{let{currentVersionId:a}=e;const[n,s]=(0,t.useState)([]),[o,l]=(0,t.useState)(null),[i,c]=(0,t.useState)(""),{orgId:d,respondentName:u,addNewVersion:x,currentVersionIdPath:g}=(0,p.m8)(),[v,b]=(0,t.useState)(0);(0,t.useEffect)(()=>{let e,a;return(async()=>{try{const n=(0,S.or)(["global","esg-survey","questions"]).where("org","in",["global",d]);e=n.onSnapshot(e=>{const a=e.docs.map(e=>e.data());s(a)});const t=await(0,S.or)(["global","esg-survey"]);a=t.onSnapshot(e=>{e.exists&&l(e.data().currentGlobalVersion)})}catch(n){console.log(n)}})(),()=>{var n,s;null===(n=e)||void 0===n||n(),null===(s=a)||void 0===s||s()}},[v]);const f=e=>{const a="global"===e.org?"Global":u,n=new Date(e.createdAt).toLocaleDateString(),s="".concat(a," - ").concat(n);return e.label?"".concat(s," - (").concat(e.label,")"):s},y=n.map(e=>({label:f(e),value:e.id,description:e.description})),j=n.filter(e=>"global"===e.org).map(e=>({label:f(e),value:e.id})),{setOrUpdateDocument:C}=(0,h.u_)(),A=async e=>{let{currentVersionId:a,orgId:n,metadata:s,currentVersionIdPath:t}=e;await x({currentVersionId:a,orgId:n,metadata:s,currentVersionIdPath:t}),b(e=>e+1)};return a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"rounded bg-light p-3 mb-3",children:[(0,r.jsx)(k,{title:"Current version used by this organisation: ",addBtnLabel:"Add org version",switchBtnLabel:"Switch version used",options:y,currentVersionId:a,onSwitch:async e=>{await C(g,{currentVersion:e})},color:"info",onAdd:()=>c("org")}),(0,r.jsx)("hr",{}),(0,r.jsx)(k,{title:"Default version: ",addBtnLabel:"Add global version",switchBtnLabel:"Switch default version",options:j,currentVersionId:o,onSwitch:async e=>{await C(m.DB_PATHS.globalSurvey,{currentGlobalVersion:e})},color:"success",onAdd:()=>c("global")})]}),(0,r.jsx)(N,{show:!!i,handleClose:()=>c(""),onAdd:e=>{A("org"===i?{currentVersionId:a,orgId:d,metadata:e,currentVersionIdPath:g}:{currentVersionId:a,orgId:"global",metadata:e})},isGlobal:"global"===i})]}):null},F={label:"",labelExternal:"",key:"",weight:1,answers:[{label:"",value:0},{label:"",value:1},{label:"",value:2},{label:"",value:3},{label:"",value:4}],isNew:!0},V=()=>{const[e,a]=(0,t.useState)(null),[n,o]=(0,t.useState)(!1),{width:c}=(0,h.wY)(),{updateSurveyVersion:u,currentSurvey:m,setRefresh:x}=(0,p.m8)(),g=(null===m||void 0===m?void 0:m.areas)||[],v=null===m||void 0===m?void 0:m.id,b="global"===(null===m||void 0===m?void 0:m.org),f=(null===g||void 0===g?void 0:g.map((e,a)=>({label:e.label,value:a})))||[],S=(0,d.mN)(),{reset:I,getValues:k,setValue:V,handleSubmit:G,control:T,trigger:L}=S;(0,t.useEffect)(()=>{const e=(null===m||void 0===m?void 0:m.areas)||[],a=(null===m||void 0===m?void 0:m.label)||"",n=(null===m||void 0===m?void 0:m.description)||"";null!==e&&void 0!==e&&e.length&&I({areas:e,label:a,description:n})},[m]);const D=!(null!==g&&void 0!==g&&g.length);let q=[];D||(q=(0,w.ZP)({surveyAreas:g}));const{tryAndNotify:W}=(0,h.Yf)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(E,{currentVersionId:v}),(0,r.jsx)("h2",{className:"mt-4",children:"Edit current version"}),(0,r.jsx)(B,{setValue:V,control:T}),(0,r.jsx)(i,{areas:f,handleAdd:e=>{const n=g[e].questions.length;V("areas.".concat(e,".questions.").concat(n),(0,j.A)((0,j.A)({},F),{},{key:"q".concat(n)})),o(!0),a("areas.".concat(e,".questions.").concat(n))}})]}
1),D?(0,r.jsx)(l.LoadingSpinner,{}):(0,r.jsxs)(s.CForm,{onSubmit:G(async e=>{e.areas.forEach(e=>{e.questions=e.questions.filter(Boolean)}),await W(async()=>u({data:e,currentVersionId:v}),"Survey updated successfully","Error updating survey")}),children:[(0,r.jsx)(l.BasicTableContainer,{children:(0,r.jsx)(s.CDataTable,{items:q,fields:A.p9,scopedSlots:{question:(e,a)=>(0,r.jsx)("td",{children:(0,r.jsx)(l.DisplayRichText,{value:e.question})}),weight:(e,a)=>(0,r.jsx)("td",{children:e.edit?(0,r.jsx)(C.A,{Component:l.BasicSelect,options:[0,1,2,3,4,5],name:e.questionName+".weight",control:T,trigger:L,getValues:k}):(0,r.jsx)("span",{children:e.weight})}),edit:(e,n)=>(0,r.jsx)("td",{children:e.edit?(0,r.jsx)(l.SquareButtonOutline,{style:{width:"65px"},onClick:()=>{return n=e.areaIdx,s=e.questionIdx,o(!1),void a("areas.".concat(n,".questions.").concat(s));var n,s},children:"Edit"}):null})}})}),b&&(0,r.jsx)("p",{className:"text-danger mb-2",children:"WARNING: You are editing a global version of the survey. It may be used by multiple organisations."}),(0,r.jsx)(l.SaveButton,{className:"mt-3"})]}),(0,r.jsx)(y,{questionPath:e,showModal:!!e,closeModal:()=>a(""),formMethods:S,isNew:n,isUsingGlobal:b,setRefresh:x,currentVersionId:v}),(0,r.jsx)(N,{})]})};var G=n(51290),T=n(98289);const L=e=>{let{storagePath:a,allowDelete:n=!1,className:s}=e;const[o,i]=(0,t.useState)([]);return(0,t.useEffect)(()=>{a&&(async(e,a)=>{var n;const s=T.A.storage(),t=s.ref().child(e),o=await t.listAll();if(null!==(n=o.items)&&void 0!==n&&n.length){const e=[];for(let a of o.items){const n=await a.getDownloadURL(),t=s.refFromURL(n);e.push(t)}a(e)}})(a,i)},[a]),o.length?(0,r.jsx)("div",{className:"d-flex flex-column align-items-start ".concat(s),children:o.map((e,a)=>(0,r.jsxs)("small",{className:"text-info mb-2",children:["File:"," ",(0,r.jsx)(l.TextButton,{type:"button",className:"text-info font-bold",onClick:()=>(async e=>{if(e)try{const n=await e.getDownloadURL(),s=await window.showSaveFilePicker({suggestedName:e.name});var a=new XMLHttpRequest;a.responseType="blob",a.onload=async e=>{var n=a.response;const t=await s.createWritable();await t.write(n),await t.close()},a.open("GET",n),a.send()}catch(n){console.log(n)}})(e),children:e.name}),n&&(0,r.jsx)(l.DeleteButton,{size:"sm",style:{border:"none"},className:"ml-1 p-1",onClick:()=>(async e=>{if(e)try{await e.delete()}catch(a){console.log(a)}})(e)})]},a))}):null};var D=n(7270),q=n(53081),W=n(46475);const M=e=>{let{item:a,control:n,onChange:s}=e;const{area:t,key:o}=a;return t?(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(l.StyledTextArea,{className:"mt-2",defaultValue:a.adminComment,name:"".concat(t,".").concat(o,".adminComment"),onChange:s,placeholder:"Admin comment"})}):null},Q=()=>{let e=[];const[a,n]=(0,t.useState)(!1),{internalSurveyResponses:o,adminSurveyResponses:i,currentSurvey:c,orgId:d,periodId:u,isStandalone:x}=(0,p.m8)(),g=(null===c||void 0===c?void 0:c.areas)||[];o&&(e=(0,w.IA)({orgId:d,internalSurveyResponses:o,adminSurveyResponses:i,surveyAreas:g,isStandalone:x}));const{setOrUpdateDocument:v}=(0,h.u_)();let b=[];b=x?["esg-survey",d,"entries","admin"]:[...m.DB_PATHS.assessmentSurveyEntries.join("/").replace("ORG_ID",d).replace("PERIOD_ID",u).split("/"),"admin"];const{onFormFieldChange:f,onFormSubmit:y,formMethods:{control:C}}=(0,h.i2)({writeToDB:async e=>{await v(b,(0,j.A)((0,j.A)({},e),{},{isVerified:!0,isFinal:k,id:"admin"}))}}),{sendEsgEmail:N}=(0,q.A)(),{sendEmails:B}=o,[S,I]=(0,t.useState)(!1),[k,E]=(0,t.useState)(!1);(0,t.useEffect)(()=>{E((null===i||void 0===i?void 0:i.isFinal)||!1)},[null===i||void 0===i?void 0:i.isFinal]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"my-3",children:(0,r.jsx)(l.NestedTablesContainer,{children:(0,r.jsx)(s.CDataTable,{fields:A.Op,items:e,addTableClasses:"upper",scopedSlots:{question:(e,a)=>(0,r.jsx)("td",{children:(0,r.jsx)(l.DisplayRichText,{value:e.question})}),"self-score":(e,a)=>(0,r.jsx)("td",{children:"select"===e.type?(0,r.jsx)(l.DisplayRichText,{value:e["self-score"]}):"text"===e.type?(0,r.jsx)(l.DisplayRichText,{value:e.answer}):"number"===e.type||"date"===e.type||"date-range"===e.type?(0,r.jsx)("span",{children:e.answer}):null}),details:e=>{const{evidence:a,storagePath:n}=e;return(0,r.jsxs)("div",{className:" px-3",children:[(0,r.jsxs)("div",{children:[!!a&&(0,r.jsx)("div",{children:(0,r.jsxs)("p",{className:"p-0 mb-1",children:[(0,r.jsx)("b",{children:"Explanation:"})," ",a]})}),(0,r.jsx)(L,{storagePath:n})]}),(0,r.jsx)(M,{item:e,control:C,onChange:f})]})},"admin-score":e=>{var a,n,s;if("Total"===e.question)return(0,r.jsx)("td",{children:e["admin-score"]});if(void 0!==e.weight&&0===+e.weight)return(0,r.jsx)("td",{children:"Unscored"});const{area:t,key:o}=e,i=[...((null===g||void 0===g||null===(a=g.find(e=>e.key===t))||void 0===a||null===(n=a.questions)||void 0===n||null===(s=n.find(e=>e.key===o))||void 0===s?void 0:s.answers)||[]).map(e=>({value:e.value,label:e.value}))];return(0,W.$W)(e)&&i.unshift({label:"Agree with them",value:"n/a"}),(0,r.jsx)("td",{style:{minWidth:"200px"},children:t&&(0,r.jsx)(l.BasicSelect,{defaultValue:e["admin-score"],options:i,showNone:!1,name:"".concat(t,".").concat(o,".score"),onChange:f})})}}})})}
1),(0,r.jsx)(G.A,{className:"mt-4 mb-2",name:"sendEmails",id:"sendEmails",label:"Send notification email",disabled:!B,onChange:e=>{const a=(0,D.convertStrToBool)(e.target.checked);n(a)},value:a}),(0,r.jsx)(G.A,{className:"mt-4 mb-2",style:{fontSize:"18px"},name:"isFinal",id:"isFinal",label:"Finalize the survey",onChange:e=>{const a=(0,D.convertStrToBool)(e.target.checked);E(a),f({target:{name:"isFinal",value:a}})},value:k}),(0,r.jsx)(l.SaveButton,{loading:S,onClick:async()=>{I(!0);try{if(y(),a&&B){const{email:e,name:a,orgName:n}=o;await N({respondentId:d,orgName:n,firstName:a.split(" ")[0],email:e,type:"admin"})}}catch(e){console.log(e)}finally{I(!1)}}})]})};var P=n(46834),Y=n(98078);const z=e=>{let{track:a}=e;const n="self-assessment"===a?Y.w:Y.s;return(0,r.jsx)(P.A,{title:"What is the assessment process?",children:(0,r.jsx)("ul",{style:{fontSize:"16px"},children:n.map((e,a)=>(0,r.jsx)("li",{className:"mb-4",children:e},a))})})};var R,U=n(57528),H=n(30009);const O=(0,H.default)(s.CModalHeader)(R||(R=(0,U.A)(["\n padding-right: 3rem !important;\n p {\n font-size: 20px !important;\n }\n"]))),X=e=>{let{question:a,onClose:n}=e;return a?(0,r.jsxs)(u.A,{show:!!a,onClose:n,centered:!0,children:[(0,r.jsx)(O,{closeButton:!0,children:(0,r.jsx)(l.DisplayRichText,{value:a.question})}),(0,r.jsxs)(s.CModalBody,{children:[(0,r.jsxs)("p",{className:"text-left",children:["Current score: ",a["final-score"]," pts"]}),(0,r.jsx)("p",{style:{fontSize:"18px"},className:"text-left font-semibold",children:"Next goal to achieve:"}),(0,r.jsx)(l.DisplayRichText,{value:a.nextAnswerLabel})]}),(0,r.jsx)(s.CModalFooter,{children:(0,r.jsx)(s.CButton,{color:"dark border",onClick:n,className:"text-white",children:"Close"})})]}):null};var Z=n(23056),J=n(22055),K=n(37302);const _=e=>{let{finalPercentage:a,finalScore:n,orgName:s}=e;const[o,i]=(0,t.useState)(!1),{createEsgReport:c}={createEsgReport:async e=>{let{orgName:a,reportingPeriod:n,finalPercentage:s,finalScore:t,totalPoints:o}=e;const l=document.getElementById("white-logo"),r=await(0,Z.k)(l),i=document.getElementById("logo"),c=await(0,Z.k)(i),d="".concat(a.replaceAll(" ","_"),"_").concat((new Date).toLocaleDateString(),"_esg.pdf");let u=new K.A({orgName:a,reportingPeriod:n,whiteLogoImg:r,colorLogoImg:c});u.setFont("helvetica","bold");let m=1;u.yCoord=5,await u.addHeader(36,"ESG survey"),u.yCoord+=15,u.addCenteredText("Score",J.mg,36),u.yCoord+=5,u.addCenteredText(String(s)+"%",J.zQ,50),u.yCoord+=5,u.addCenteredText("The total number of points: ".concat(t),J.M7,18),u.yCoord+=15,await u.addCanvas("esg-chart",.7),await u.addFooter(m++),u.addPage(),u.yCoord=0,u.autoTable({html:"#esg-table",margin:{top:58},tableLineWidth:.1,headStyles:{fillColor:J.mg,textColor:J.M7,padding:2},didDrawPage:async e=>{u.addCenteredText("Survey results",J.mg,20,!1,50),u.addHeader(36,"ESG survey"),u.addFooter(m++)}}),u.save(d)}},{width:d}=(0,h.wY)();if(d<1e3)return null;return(0,r.jsx)(l.ButtonOutline,{disabled:o,onClick:async()=>{i(!0);try{await c({orgName:s,finalPercentage:a,finalScore:n})}catch(e){console.log(e)}finally{i(!1)}},children:"Print report"})};var $=n(79976),ee=n(27893),ae=n(40411);const ne=e=>{let{areas:a=[],finalPercentage:n,totalPossible:s,isFinal:o}=e;$.t1.register($.Bs,$.m_,$.s$),$.t1.register(ee.A);const l=["#009245","#FFDF07","#A421D1","#487db2","gainsboro"],{width:i}=(0,h.wY)(),c=i<1e3,d=s-a.reduce((e,a)=>e+a.score,0),u=(0,t.useRef)(null),m={labels:[...a.map(e=>e.label)],datasets:[{tooltip:{callbacks:{label:function(e){let a=e.label,n=e.formattedValue;return a||(a="Remaining"),"".concat(a,": ").concat(n,"pt")}}},data:[...a.map(e=>e.score),d],backgroundColor:l,borderColor:l,borderWidth:1}]},p={cutout:c?"40%":"60%",plugins:{bgColor:{backgroundColor:"transparent"},datalabels:{formatter:(e,a)=>e&&e>0?"".concat(e," pt"):"",align:"center",font:{size:c?12:14},backgroundColor:function(e){const a=e.dataIndex;return e.dataset.data[a]>0?"rgba(0,0,0,0.3)":"transparent"},borderRadius:"5",color:"#ffffff",textAlign:"center"},legend:{position:"bottom",title:{padding:c?0:5,display:!0},labels:{padding:c?void 0:20,font:{size:c?14:18}}}}},x=isNaN(n)?0:n;return isNaN(+n)?null:(0,r.jsxs)("div",{style:{maxWidth:"700px",marginInline:"auto"},className:"position-relative",children:[(0,r.jsxs)("div",{style:c?{position:"static",fontSize:"2rem",fontWeight:"bold"}:{position:"absolute",top:"47%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"2rem",fontWeight:"bold"},children:[(0,r.jsx)("h3",{className:"mb-1 circle-text",children:o?"FINAL SCORE":"SCORE"}),(0,r.jsxs)("h1",{style:{fontSize:"5rem",textAlign:"center"},children:[x,"%"]})]}),(0,r.jsx)(ae.nu,{id:"esg-chart",data:m,options:p,ref:u,onClick:e=>{var a,n,s;const t=null===(a=(0,ae.CK)(u.current,e))||void 0===a||null===(n=a[0])||void 0===n?void 0:n.index;void 0!==t&&(null===(s=document.querySelector(".section-".concat(t)))||void 0===s||s.scrollIntoView({behavior:"smooth"}))}})]})};var se,te=n(87652),oe=n(55009);const le=[{key:"idx",label:""},"question",{key:"self-score",label:"Your answer"},{key:"final-score",label:"Score",_style:{width:"15%"}},{key:"next",label:"What's next?"}],re=["idx","question",{key:"self-score",label:"Your answer"},{key:"final-score",label:"Score",_style:{width:"30%"}}],ie=H.default.td(se||(se=(0,U.A)(["\n p {\n font-size: 17px;\n font-weight: 500;\n }\n"])));function ce(e){return null===e||void 0===e?void 0:e.replace(/\)/gm,"): ")}const de=e=>{let{rows:a,isPrint:n=!1,addTableClasses:o}=e;(0,t.useEffect)(()=>{const e=document.querySelector(".esg-table");null===e||void 0===e||e.setAttribute("id","esg-table")},[]);const[i,c]=t.useState(null),{totalScore:d,totalPercentage:u}=(0,oe.aD)(a),m={question:"Total",idx:"","self-score":d+" points","final-score":u+" %",_classes:"table-sector"},h=n?a:[...a,m];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.CDataTable,{addTableClasses:(n?"invisible position-absolute esg-table ":"")+o,fields:n?re:le,items:h,columnHeaderSlot:{idx:(e,a)=>(0,r.jsx)(ie,{children:(0,r.jsx)("span",{className:"font-bold",children:e.idx})}),question:(e,a)=>(0,r.jsx)(ie,{children:(0,r.jsx)(l.DisplayRichText,{value:e.question})}),"external-average":(0,r.jsxs)("div",{className:"d-flex",children:[(0,r.jsx)("span",{children:"Exter
1nal score"}),(0,r.jsx)(l.InfoTooltip,{content:"If more than 3 responses - average of central 3, otherwise average of all responses"})]}),weight:(0,r.jsxs)("div",{className:"d-flex",children:[(0,r.jsx)("span",{children:"Weight"}),(0,r.jsx)(l.InfoTooltip,{content:"Question weight between 1-5, assigned by Admin"})]})},scopedSlots:{question:(e,a)=>(0,r.jsx)("td",{children:(0,r.jsx)(l.DisplayRichText,{value:e.question})}),details:n?null:e=>e.adminComment?(0,r.jsxs)("td",{style:{border:"none"},children:[(0,r.jsx)("span",{className:"font-semibold text-muted",children:"Admin comment:"})," ",e.adminComment]}):null,"self-score":(e,a)=>{return(0,r.jsx)("td",{children:n?(0,r.jsx)("div",{children:ce((s=e["self-score"]||e.answer,null===s||void 0===s?void 0:s.replace(/<[^>]*>?/gm,"")))}):"select"===e.type?(0,r.jsx)(r.Fragment,{children:"string"===typeof e["self-score"]?(0,r.jsx)(l.DisplayRichText,{value:e["self-score"]}):e["self-score"]}):"text"===e.type?(0,r.jsx)(l.DisplayRichText,{value:e.answer}):"number"===e.type||"date"===e.type||"date-range"===e.type?(0,r.jsx)("span",{children:e.answer}):null});var s},"admin-score":e=>{const a="n/a"!==e["admin-score"],n=e["admin-score"]<e["self-value"],s=e["admin-score"]===e["self-value"];let t=n?"text-danger":s?"":"text-success";return"Total"===e.question&&(t=""),(0,r.jsx)("td",{children:a&&(0,r.jsx)("span",{className:"".concat(t," font-bold"),children:e["admin-score"]})})},weight:(e,a)=>(0,r.jsx)("td",{children:!!e.weight&&Array(+e.weight).fill(0).map(e=>(0,r.jsx)("span",{className:"dot ml-1"},Math.random()))}),next:(e,a)=>{const n=e._classes.includes("table-question");return(0,r.jsx)("td",{children:n?(0,r.jsx)(l.SquareButtonOutline,{disabled:!e.nextAnswerLabel,style:{width:"65px"},onClick:()=>c(e),children:"Next"}):(0,r.jsx)(r.Fragment,{})})},"final-score":(e,a)=>{const n=e._classes.includes("table-question"),s=n?isNaN(+e["final-score"])?0:+e["final-score"]:e["final-score"];return(0,r.jsx)("td",{children:n?(0,r.jsx)(te.Ay,{width:150,height:150,value:s,maxValue:e.maxScore,needleColor:"darkred",startColor:"orange",endColor:"darkgreen",maxSegmentLabels:0,paddingHorizontal:2,valueTextFontSize:"18px",needleHeightRatio:.7,r
1ingWidth:20}):(0,r.jsx)("span",{className:"font-bold",children:s})})}}}),!n&&(0,r.jsx)(X,{question:i,onClose:()=>{c(null)}})]})},ue=()=>(0,r.jsxs)("div",{className:"d-flex w-100 flex-column justify-content-center align-items-center text-center",children:[(0,r.jsx)("h1",{style:{fontSize:"40px",lineHeight:1},className:"text-success mt-2",children:"Business Impact Tracker"}),(0,r.jsx)("h3",{className:" mb-4",children:"Assessing the ESG maturity of your business"})]});var me=n(94002);const he=()=>{const{nextClickHandler:e}=(0,d.xW)();return(0,r.jsxs)(me.A,{showTop:!1,showReportingPeriod:!1,showMenuButton:!0,aboveCardSlot:(0,r.jsx)(ue,{}),children:[(0,r.jsx)("h1",{className:"mb-2 text-center",children:"Thank you for your time"}),(0,r.jsx)("h2",{className:"mb-4 text-center",children:"The survey is complete."}),(0,r.jsx)(l.ButtonOutline,{size:"lg",className:"mb-5",onClick:()=>{e()},children:"View Results"}),(0,r.jsx)("p",{style:{fontSize:"20px",fontWeight:600,lineHeight:1.5,color:"#3C4B64"},className:"text-center mb-1",children:"Visit us at ZeroBees to learn how we
1can support you on your sustainability journey."}),(0,r.jsxs)("a",{target:"_blank",rel:"noreferrer",color:"primary",className:"d-flex align-items-center p-3 text-info",href:"https://www.zerobees.com/",children:[(0,r.jsx)("span",{style:{fontSize:"24px",fontWeight:600},className:" mr-2",children:"ZeroBees"}),(0,r.jsx)(s.CImg,{size:"2rem",style:{width:"24px",height:"24px",lineHeight:1},src:"data:image/png;base64,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"})]})]})};var pe;const{ButtonOutline:xe}=n(97939),ge=((0,H.default)(xe)(pe||(pe=(0,U.A)(["\n\n &:not(:hover) {\n background-color: ",";\n color: ",";\n }\n"])),e=>{let{selected:a}=e;return a?"#035eba":"transparent"},e=>{let{selected:a}=e;return a?"white":"#035eba"}),e=>{let{show:a,closeModal:n,guidance:t}=e;return(0,r.jsxs)(u.A,{show:a,onClose:n,centered:!0,children:[(0,r.jsxs)(s.CModalHeader,{className:"pb-0 pt-4 flex-column align-items-center text-center position-relative",children:[(0,r.jsx)(s.CButton,{style:{position:"absolute",top:"1rem",right:"1rem"},variant:"ghost",type:"button",color:"primary",onClick:n,children:(0,r.jsx)(I.Ay,{name:"cilX"})}),(0,r.jsx)("h3",{style:{fontWeight:400},className:"mb-3",children:"Guidance"})]}),(0,r.jsx)(s.CModalBody,{className:"p-4",children:(0,r.jsx)(l.DisplayRichText,{style:{color:"white!important"},value:t})})]})});n(78193),n(18762);var ve=n(80045);const be=["data","name","onChange","className","defaultValue","otherIsChecked"],fe=e=>{let{data:a,name:n,onChange:t=()=>{},className:o,defaultValue:i,otherIsChecked:c=!1}=e,d=(0,ve.A)(e,be);return(0,r.jsx)("div",(0,j.A)((0,j.A)({className:"d-flex flex-column align-self-start ".concat(o)},d),{},{children:a.map((e,a)=>(0,r.jsxs)(s.CFormGroup,{variant:"custom-radio",className:"mb-3",children:[(0,r.jsx)(s.CInputRadio,{custom:!0,id:"".concat(n,"-").concat(a),name:n,value:e.value,onChange:t,defaultChecked:e.value===i,checked:!(!c||!e.value.includes("Other"))||void 0}),(0,r.jsx)(s.CLabel,{variant:"custom-checkbox",htmlFor:"".concat(n,"-").concat(a),children:(0,r.jsx)(l.DisplayRichText,{value:e.label})})]},a))}))};var ye,je=n(76145);const Ce=[".csv",".doc",".docx",".xml",".pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","image/*"],Ae=(0,H.default)(l.TextButton)(ye||(ye=(0,U.A)(["\n transition: all 0.2s ease-in-out;\n &:hover {\n background-color: #0d6efd;\n color: white !important;\n border-color: #0d6efd;\n text-decoration: none !important;\n\n svg {\n color: white;\n }\n }\n"]))),we=e=>{var a;let{area:n,idx:t,values:o,onChange:i,errors:u,q:m,handleGuidance:h,respondentId:p}=e;const x=(0,d.FH)({name:"".concat(n,".").concat(m.key,".score")}),g="validation"===(0,v.d4)(je.k7),b=m.label,f=m.answers;const y=!(null===(a=m.guidance)||void 0===a||!a.replaceAll(/<.+?>/g,"")),j=(null===m||void 0===m?void 0:m.type)||"select";function C(e){if(e){const a=new Date(e);if("Invalid Date"===a.toString())return;return a.toISOString().split("T")[0]}}let A=null;return"select"===j?A=(0,r.jsx)(fe,{data:f,name:"".concat(n,".").concat(m.key,".score"),onChange:i,defaultValue:function(e){return"n/a"===e||isNaN(+e)?e:+e}((0,c.get)(o,"".concat(n,".").concat(m.key,".score"))),className:"mt-4"}):"text"===j?A=(0,r.jsx)(l.StyledTextArea,{name:"".concat(n,".").concat(m.key,".answer"),className:"mt-4",onCh
1ange:i,rows:2,defaultValue:(0,c.get)(o,"".concat(n,".").concat(m.key,".answer")),placeholder:"Please enter your answer"}):"number"===j?A=(0,r.jsx)(l.BasicNumberInput,{name:"".concat(n,".").concat(m.key,".answer"),defaultValue:(0,c.get)(o,"".concat(n,".").concat(m.key,".answer")),className:"mt-4",onChange:i,placeholder:"Please enter your answer",min:null===m||void 0===m?void 0:m.min,max:null===m||void 0===m?void 0:m.max,suffix:null!==m&&void 0!==m&&m.suffix?" "+m.suffix:void 0}):"date"===j?A=(0,r.jsx)(s.CInput,{type:"date",name:"".concat(n,".").concat(m.key,".answer"),defaultValue:C((0,c.get)(o,"".concat(n,".").concat(m.key,".answer"))),className:"mt-4",onChange:i}):"date-range"===j&&(A=(0,r.jsx)(s.CCol,{className:"mt-4",children:(0,r.jsxs)(s.CRow,{className:"d-flex justify-content-between align-items-end",children:[(0,r.jsxs)(s.CFormGroup,{className:"pl-0 col",children:[(0,r.jsx)(s.CLabel,{children:"From"}),(0,r.jsx)(s.CInput,{type:"date",name:"".concat(n,".").concat(m.key,".answer.from"),defaultValue:C((0,c.get)(o,"".concat(n,".").concat(m.key,".answer.from"))),onChange:i,className:"w-100",placeholderText:"Select date"}),(0,r.jsx)(l.ErrorText,{value:u["report-date-from"]})]}),(0,r.jsxs)(s.CFormGroup,{className:"col pr-0",children:[(0,r.jsx)(s.CLabel,{children:"To"}),(0,r.jsx)(s.CInput,{type:"date",onChange:i,name:"".concat(n,".").concat(m.key,".answer.to"),defaultValue:C((0,c.get)(o,"".concat(n,".").concat(m.key,".answer.to"))),className:"w-100",placeholderText:"Select date"}),(0,r.jsx)(l.ErrorText,{value:u["report-date-to"]})]})]})})),(0,r.jsxs)("div",{id:"".concat(n,"-").concat(m.key),className:"mb-5 w-100",children:[(0,r.jsxs)("div",{className:"d-flex align-items-baseline",children:[(0,r.jsx)("span",{style:{fontSize:"20px"},className:"mr-2",children:t+1+". "}),(0,r.jsx)(l.DisplayRichText,{value:b,fontSize:"20px",className:"mr-2"}),y&&(0,r.jsx)(Ae,{type:"button",onClick:h,className:"text-info ml-3 d-flex p-2 border border-info ",style:{fontSize:"12px",lineHeight:"1"},children:"Guidance"})]}),A,(0,r.jsx)(l.ErrorText,{value:(0,c.get)(u,"".concat(n,".").concat(m.key,".score"))}),g&&!!x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.StyledTextArea,{name:"".concat(n,".").concat(m.key,".evidence"),className:"mt-4",onChange:i,rows:2,defaultValue:(0,c.get)(o,"".concat(n,".").concat(m.key,".evidence")),placeholder:"Please justify your answer"}),(0,r.jsx)(l.UploadFileToStorage,{storagePath:"survey/standalone/".concat(p,"/").concat(n,"/").concat(m.key),label:"Upload evidence",acceptFormats:Ce.join(",")})]})]})},Ne=e=>{let{idx:a,label:n,info:t,children:o,name:i,onChange:c,values:u}=e;const m=-1===(0,d.FH)({name:i});return(0,r.jsxs)("div",{id:i,className:"mb-5 w-100",children:[(0,r.jsxs)("div",{className:"d-flex align-items-baseline",children:[(0,r.jsx)("span",{style:{fontSize:"20px"},className:"mr-2",children:a+1+". "}),(0,r.jsxs)("p",{style:{fontSize:"20px"},children:[n," ",t&&(0,r.jsx)(l.InfoTooltip,{content:t})]})]}),!m&&o,(0,r.jsxs)(s.CFormGroup,{className:"mt-3 d-flex align-items-center",variant:"custom-checkbox",children:[(0,r.jsx)(s.CInputCheckbox,{custom:!0,id:"".concat(i,"-checkbox"),onChange:e=>{e.target.checked?c({target:{name:i,value:-1}}):c({target:{name:i,value:void 0}})},defaultChecked:-1===u[i],style:{borderRadius:0}}),(0,r.jsx)(s.CLabel,{style:{fontSize:"14px"},variant:"custom-checkbox",htmlFor:"".concat(i,"-checkbox"),children:"Dont' know / Prefer not to say"})]})]})};var Be=n(78662);const Se=e=>{let{onChange:a,values:n,errors:o,area:l}=e;const i={onChange:a,values:n,errors:o},c=Object.keys(o).length;(0,t.useEffect)(()=>{if(c>0){const e=Object.keys(o)[0],a=document.getElementById(e);null===a||void 0===a||a.scrollIntoView({behavior:"smooth",block:"center"})}},[c,o]);if(!(0,Be.G)(i)[l])return null;const d=(0,Be.G)(i)[l].filter(e=>e.component).map(e=>e.label);return(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{style:{fontSize:"22px"},className:"font-bold text-center text-info mb-3",children:"Data collection"}),(0,r.jsx)("p",{className:"text-center",children:"This questions are standardised to allow for single collection from you to provide to multiple stakeholders (agencies, customers etc)."}),(0,r.jsx)("p",{className:"text-center",children:"These are unscored questions and will not impact your Business Impact Tracker ESG score. If you have been requested by a customer to provide this information, and
1you are happy to disclose it please ensure you tick the appropriate box below"}),(0,r.jsxs)(s.CFormGroup,{className:"my-3 w-100",variant:"custom-checkbox",children:[(0,r.jsx)(s.CInputCheckbox,{custom:!0,id:"permission-to-share",name:"permission-to-share",onChange:a,defaultChecked:n["permission-to-share"],style:{borderRadius:0}}),(0,r.jsx)(s.CLabel,{style:{fontSize:"18px"},variant:"custom-checkbox",htmlFor:"permission-to-share",children:"I am happy to share this information"})]}),(0,r.jsx)("div",{className:"d-flex flex-column align-items-start py-3",children:(0,Be.G)(i)[l].map((e,s)=>(0,r.jsx)(r.Fragment,{children:e.component?(0,r.jsx)(Ne,{idx:d.indexOf(e.label),label:e.label,name:e.name,info:e.info,values:n,onChange:a,children:e.component},s):(0,r.jsx)("p",{style:{fontSize:"20px",fontWeight:600},children:e.label})}))})]})},Ie=[{key:"survey",label:"Impact Survey"}],ke=e=>{let{area:a,onChange:n,values:o,errors:i,orgName:c,isExternal:d,respondentId:u}=e;const{label:m,key:h,questions:p}=a,x=(0,v.d4)(je.k7);let g=Ie;"validation"===x&&(g=[...Ie,{key:"data-collection",label:"Data Collection"}]);const[b,f]=(0,t.useState)("");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.FormStepWrapper,{showTop:!1,showReportingPeriod:!1,showMenuButton:!0,aboveCardSlot:(0,r.jsx)(ue,{}),children:[(0,r.jsx)("p",{style:{fontSize:"28px"},className:"font-bold text-center mb-0 text-info",children:m}),(0,r.jsxs)(s.CTabs,{activeTab:"survey",children:["validation"===x&&(0,r.jsx)(s.CNav,{className:" d-flex mt-4 justify-content-center w-100 border-bottom",variant:"pills",children:g.map((e,a)=>(0,r.jsx)(s.CNavItem,{children:(0,r.jsx)(s.CNavLink,{"data-tab":e.key,children:e.label})},e.key))}),(0,r.jsxs)(s.CTabContent,{className:"w-100 pt-4 d-flex flex-column align-items-center",children:[(0,r.jsx)(s.CTabPane,{"data-tab":"survey",children:p.map((e,a)=>(0,r.jsx)(we,{area:h,idx:a,values:o,onChange:n,errors:i,q:e,respondentId:u,isExternal:d,orgName:c,handleGuidance:()=>f(e.guidance)},a))}),(0,r.jsx)(s.CTabPane,{className:"w-100","data-tab":"data-collection",children:"validation"===x&&(0,r.jsx)(Se,{onChange:n,values:o,errors:i,area:h})})]})]})]}),(0,r.jsx)(ge,{show:!!b,closeModal:()=>f(""),guidance:b})]})},Ee=e=>{let{maxWidth:a="690px",children:n}=e;return(0,r.jsx)(l.BaseContainer,{children:(0,r.jsx)("div",{className:"w-100 mx-auto mt-4 d-flex flex-column align-items-left position-relative",style:{maxWidth:a},children:(0,r.jsx)(l.StepCard,{children:(0,r.jsx)("div",{className:"px-2 py-3 text-center",children:n})})})})}},98078:(e,a,n)=>{n.d(a,{s:()=>o,w:()=>t});var s=n(70579);const t=[(0,s.jsx)("p",{children:"Enter some organisational details"}),(0,s.jsxs)("p",{children:[(0,s.jsx)("b",{children:"Score"})," yourself against questions covering Environment, Workers, Community & Governance"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("b",{children:"Get your results:"})," your self-assessment results area available immediately."]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("b",{children:"Check your next steps"})," and plan how to improve!"]}),(0,s.jsxs)("p",{children:["When you're ready, ",(0,s.jsx)("b",{children:"switch to validation track and upload evidence."})]})],o=[(0,s.jsx)("p",{children:"Enter some organisational details"}),(0,s.jsxs)("p",{children:[(0,s.jsx)("b",{children:"Score"})," yourself against questions covering Environment, Workers, Community & Governance"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("b",{children:"Upload evidence"})," for each question, following the guidance provided."]}),(0,s.jsxs)("p",{children:["Answer additional(non-scored) ",(0,s.jsx)("b",{children:"ESG stats questions"})," (optional)"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("b",{children:"Get your provisional results:"})," your unvalidated results are available immediately."]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("b",{children:"Submit for verification:"})," confirm you have uploaded your evidence and pay the ",(0,s.jsx)("b",{children:"verification fee"})]}),(0,s.jsx)("p",{children:(0,s.jsx)("b",{children:"Additional evidence requests/ clarifications from validator"})}),(0,s.jsxs)("p",{children:[(0,s.jsx)("b",{children:"Final score approved:"}),' Score provided to you as "VERIFIED" and published via LEGACY\'s ESG data platform']}),(0,s.jsxs)("p",{children:[(0,s.jsx)("b",{children:"Check your next steps"})," and plan how to improve!"]}
1)]}}]); 2//# sourceMappingURL=864.41ca3f0a.chunk.js.map
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.