import{aw as u,j as e,az as m,Y as f,h as g,i as p,ax as c,aS as h,o as x}from"./app-BgLa5dit.js";import{O}from"./u6fIQ8Ti.chunk.js";import{O as t}from"./DG_07YWO.chunk.js";import{C as y}from"./CQCJQXSQ.chunk.js";import{N as I,a as j}from"./BY5LkID7.chunk.js";import"./DJ0pq8J_.chunk.js";import"./CCcwLDvu.chunk.js";import"./DDfKZ_ng.chunk.js";import"./Bs6fQ2wT.chunk.js";import"./BUT90D7O.chunk.js";function v(r){var n,o,l;const a=u(),d=(n=r.salesforceOrg)==null?void 0:n.masterId;return e.jsx("div",{children:e.jsxs(m,{children:[e.jsx("h1",{className:"mb-4",children:"Organisation Details"}),e.jsx("div",{className:"crm-studio-wizard-form mt-3",children:e.jsxs(e.Fragment,{children:[d&&e.jsxs("p",{className:"alert alert-danger",children:["This Salesforce account is currently linked to the organisation ",e.jsx(f,{className:"text-info",openInNewTab:!0,appLink:{application:p.CRM_STUDIO,action:g.CrmStudio.ORGANISATION_OVERVIEW,args:[r.salesforceOrg.masterId]},children:(o=r.salesforceOrg)==null?void 0:o.name}),` . Creating a new organisation may affect any customers that have been set up within ${(l=r.salesforceOrg)==null?void 0:l.name}.
                Please reach out to the Product team if creating a new organisation is still required.`]}),e.jsx(c,{name:"name",id:"name",label:"Organisation Name",type:"text",placeholder:"Enter organisation name",disabled:!!a.values.salesforceAccountId,value:a.values.name||"",required:!0,infoText:a.values.salesforceAccountId&&"To change this organisation's name, please do so in Salesforce, then refresh this page."}),e.jsxs(c,{as:"select",label:"Type",name:"orgType",id:"orgType",value:a.values.type||"",onChange:s=>{a.setFieldValue("type",s.target.value)},disabled:!!a.values.salesforceAccountId&&!!a.values.type,infoText:a.values.salesforceAccountId&&a.values.type?"To change this organisation's type, please do so in Salesforce, then refresh this page.":"",children:[e.jsx("option",{value:"",children:"Select organisation type"}),h.values(t).filter(s=>typeof s=="number"&&s!==t.System).sort((s,i)=>s===t.Educational?-1:i===t.Educational||s===t.Unclassified?1:i===t.Unclassified?-1:s-i).map(s=>e.jsx("option",{value:s,className:"text-dark",children:y.mapOrgTypeToLabel(s)},s))]})]})})]})})}const E=r=>{const a=x(r.queryParams.accountId&&O.salesforceOrganisation(r.queryParams.accountId));return e.jsx(I,{queryParams:r.queryParams||{},currentStepId:j.DETAILS,loaded:!r.queryParams.accountId||r.queryParams.accountId&&!!a.data,children:e.jsx(v,{salesforceOrg:a.data})})};export{E as NewOrganisationWizardDetailsView};
//# sourceMappingURL=DBXNaYoh.chunk.js.map
