import{aw as P,j as e,az as _,ax as h,aO as D,a8 as f,h as m,i as c,o as S,at as R,bk as x}from"./app-BgLa5dit.js";import{S as C}from"./DAgrGerj.chunk.js";import{O as E}from"./DNClpFKN.chunk.js";import{S as r}from"./CIRO_mWB.chunk.js";import{P as g}from"./B4GQiiZ9.chunk.js";import{S as M}from"./DV8zX5C-.chunk.js";import{O as b,a as j}from"./FnDeqFLV.chunk.js";import{O as A}from"./u6fIQ8Ti.chunk.js";import"./DJ0pq8J_.chunk.js";import"./CCcwLDvu.chunk.js";import"./DDfKZ_ng.chunk.js";import"./BUT90D7O.chunk.js";const T=[r.CleverStreamable,r.Classlink,r.Clever],U=[r.CleverStreamable];function v(i,s,n){return i?"Already mapped to this provider":s?`Please set up ${f.toTitleCase(n)} on a customer level`:""}function L(i){const s=P(),n=M.filter(t=>T.includes(t.id)).sort((t,o)=>t.name.localeCompare(o.name));function d(t){return[{label:"Edit IDP",appLink:{application:c.CRM_STUDIO,action:m.CrmStudio.CUSTOMER_SSO_WIZARD_EDIT_IDP_POPUP,args:[i.orgId],params:{isOrg:!0,idpId:t}}},{label:"Delete IDP",appLink:{application:c.CRM_STUDIO,action:m.CrmStudio.CUSTOMER_SSO_WIZARD_DELETE_IDP_POPUP,args:[t],params:{isOrg:!0}}}]}return e.jsx("div",{className:"mt-4",children:e.jsx(_,{children:e.jsx(h,{type:"radio",checkboxLabelFontWeight:"normal",name:"idpId",id:"idpId",children:()=>{var t,o;return e.jsxs("div",{className:"d-flex flex-wrap gap-3 mt-4 text-center",children:[n.map(a=>{var I;const l=a.id===s.values.idpId,p=!U.includes(a.id),u=(I=i.idpMappings)==null?void 0:I.some(O=>O.idpId===a.id);return e.jsx(g,{id:a.id,label:a.name,imageUrl:a.logo,isSelected:l,isDisabled:p||u,tooltip:v(u,p,a.name),onClick:()=>{a.id!==s.values.idpId&&s.setValues({idpId:a.id})}},a.id)}),!!((t=i.customIdps)!=null&&t.length)&&((o=i.customIdps)==null?void 0:o.map(a=>{const l=a.idpId===s.values.idpId;return e.jsx(g,{id:a.idpId,label:a.displayName,imageUrl:a.logoUrl||D.SsoWizard.SAML_LOGO,isSelected:l,onClick:()=>{a.idpId!==s.values.idpId&&s.setValues({idpId:a.idpId,orgId:i.orgId})},actions:d(a.idpId)},a.idpId)}))]})}})})})}function H(i){var t;const n=(t=S(E.getAuthenticationMethods(i.id)).data)==null?void 0:t.filter(o=>o.type===r.SAML2),d=S(A.getIdpMappings(i.id));return e.jsxs(b,{id:i.id,currentStepId:j.PROVIDER,queryParams:i.queryParams,rightContent:e.jsx(R,{svg:x,className:"btn btn-outline-dark",appLink:{application:c.CRM_STUDIO,action:m.CrmStudio.CUSTOMER_SSO_WIZARD_CREATE_IDP_POPUP,args:[i.id],params:{isOrg:!0}},children:"Create custom IDP"}),children:[e.jsx("h2",{className:"h3",children:"Select an IDP provider"}),e.jsx("div",{className:"mt-4",children:e.jsx(C,{type:"organisation"})}),e.jsx(L,{idpMappings:d.data,customIdps:n,orgId:i.id})]})}export{H as OrgnisationSsoWizardProviderView};
//# sourceMappingURL=_3al_D2n.chunk.js.map
