1import{j as s}from"./vendor-maps-BinVss3u.js";import{T as cs,a as ds,b as T,c as q}from"./tabs-BHyhqdwX.js";import gs from"./index-D_ltyFmq.js";import{r as h,u as W}from"./vendor-react-CL3VIz2f.js";import{u as Y,a as D,b as P}from"./vendor-state-B-LfYkwK.js";import{q as k,e as j,a2 as y,b as L,t as Z,af as _s,al as us,am as ms,an as ps,C as ss,ah as B}from"./index-BUnNshJS.js";import{u as O}from"./vendor-i18n-DT4UeBBY.js";import{M as V,j as S,s as hs,v as fs,E as xs,b as es,r as G,T as as,w as js,x as ys,X as ws,U as X,y as bs,z as zs}from"./vendor-utils-CyyXNMuU.js";import{B as z}from"./button-DSv2gxWi.js";import{c as ts,a as N,e as Ns,F as ns,b as rs,d as M,E as is}from"./vendor-forms-C1BFdZKp.js";import"./index-ChWM3NvT.js";import"./index-BjU_3P_O.js";import"./vendor-phone-DJv9vbhJ.js";import"./vendor-antd-lHkVxrW4.js";import"./vendor-animation-Bfx_LFm5.js";import"./vendor-realtime-DKMORxsZ.js";import"./clsx-B-dksMZM.js";function vs(e,t){return e.response?.data?.message?.trim()||t}function Cs(e){return Y({queryKey:k.organization.notificationSettings(),queryFn:async()=>{const n=(await j.get(y.notificationSettings)).data?.data;return{notify_mail_ride_created:n?.notify_mail_ride_created!==!1,notify_mail_ride_confirmed:n?.notify_mail_ride_confirmed!==!1,notify_mail_ride_finished:n?.notify_mail_ride_finished!==!1}},enabled:!0})}function Ss(){const e=D();return P({mutationFn:async t=>(await j.put(y.notificationSettings,t)).data.data,onSuccess:t=>{e.setQueryData(k.organization.notificationSettings(),t)}})}const Ps=[{key:"notify_mail_ride_created",labelKey:"organization.settings_notifications_ride_created"},{key:"notify_mail_ride_confirmed",labelKey:"organization.settings_notifications_ride_confirmed"},{key:"notify_mail_ride_finished",labelKey:"organization.settings_notifications_ride_finished"}],ks=()=>{const{t:e}=O(),{showError:t,showSuccess:n}=L(),{data:i,isLoading:c,isError:l,refetch:d}=Cs(),g=Ss(),m=async o=>{if(!i||g.isPending)return;const _={...i,[o]:!i[o]};try{await g.mutateAsync(_),n(e("organization.settings_notifications_saved"))}catch(u){t(vs(u,e("organization.settings_notifications_save_error")))}};return s.jsxs("section",{className:"org-settings-page",children:[s.jsx("header",{className:"org-settings-page__header",children:s.jsx("p",{className:"org-settings-page__lead",children:e("organization.settings_notifications_lead")})}),c?s.jsx("p",{className:"org-settings-page__hint",children:e("organization.settings_notifications_loading")}):null,l?s.jsxs("div",{className:"org-settings-notifications__error",children:[s.jsx("p",{className:"org-settings-page__hint org-settings-page__hint--error",children:e("organization.settings_notifications_load_error")}),s.jsx("button",{type:"button",className:"org-toolbar-btn",onClick:()=>void d(),children:e("common.retry")})]}):null,i?s.jsx("ul",{className:"org-settings-notifications",children:Ps.map(o=>{const _=i[o.key];return s.jsxs("li",{className:"org-settings-notifications__item",children:[s.jsx("span",{className:"org-settings-notifications__icon","aria-hidden":!0,children:s.jsx(V,{className:"size-4"})}),s.jsx("span",{className:"org-settings-notifications__label",id:`org-notif-${o.key}`,children:e(o.labelKey)}),s.jsx("button",{type:"button",role:"switch","aria-checked":_,"aria-labelledby":`org-notif-${o.key}`,disabled:g.isPending,className:["org-settings-notifications__switch",_?"org-settings-notifications__switch--on":""].filter(Boolean).join(" "),onClick:()=>void m(o.key),children:s.jsx("span",{className:"org-settings-notifications__thumb","aria-hidden":!0})})]},o.key)})}):null]})};function $(e,t){return e.response?.data?.message?.trim()||t}function Os(e=1,t){return Y({queryKey:k.organization.portalUsersList(e),queryFn:async()=>{const i=(await j.get(y.portalUsers,{params:{page:e,per_page:15}})).data?.data;return{items:Array.isArray(i?.items)?i.items:[],pagination:i?.pagination??{current_page:1,last_page:1,per_page:15,total:0}}},enabled:t?.enabled??!0})}function Us(){const e=D();return P({mutationFn:async t=>(await j.post(y.portalUsers,t)).data.data,onSuccess:()=>{e.invalidateQueries({queryKey:k.organization.portalUsers()})}})}function As(){const e=D();return P({mutationFn:async({id:t,is_active:n})=>(await j.patch(y.portalUserDetail(t),{is_active:n})).data.data,onSuccess:()=>
1{e.invalidateQueries({queryKey:k.organization.portalUsers()})}})}function Es(){const e=D();return P({mutationFn:async t=>{await j.delete(y.portalUserDetail(t))},onSuccess:()=>{e.invalidateQueries({queryKey:k.organization.portalUsers()})}})}function Ts(){return P({mutationFn:async e=>{await j.post(y.portalUserResend(e))}})}function qs(){return P({mutationFn:async e=>(await j.post(y.passwordChange,e)).data})}const Q=({name:e,label:t,placeholder:n,autoComplete:i})=>{const{t:c}=O(),[l,d]=h.useState(!1);return s.jsxs("div",{className:"org-settings-password__field",children:[s.jsx("label",{className:"org-settings-password__label",htmlFor:`org-password-${e}`,children:t}),s.jsxs("div",{className:"org-settings-password__input-wrap",children:[s.jsx("span",{className:"org-settings-password__icon","aria-hidden":!0,children:s.jsx(hs,{className:"size-4"})}),s.jsx(M,{id:`org-password-${e}`,name:e,type:l?"text":"password",className:"org-settings-password__input",autoComplete:i,placeholder:n}),s.jsx("button",{type:"button",className:"org-settings-password__toggle",onClick:()=>d(g=>!g),"aria-label":c(l?"common.hide_password":"common.show_password"),children:l?s.jsx(fs,{className:"size-4","aria-hidden":!0}):s.jsx(xs,{className:"size-4","aria-hidden":!0})})]}),s.jsx(is,{name:e,component:"p",className:"org-settings-password__error"})]})},Fs=()=>{const{t:e}=O(),{showError:t,showSuccess:n}=L(),i=qs(),{user:c}=Z(),l=ts({old_password:N().required(e("form.field_required")),password:N().required(e("form.field_required")).min(8,e("form.min_password")),password_confirmation:N().oneOf([Ns("password")],e("error.password_not_match")).required(e("form.field_required"))});return s.jsxs("section",{className:"org-settings-page org-settings-page--centered",children:[s.jsx("header",{className:"org-settings-page__header",children:s.jsx("p",{className:"org-settings-page__lead",children:c?.portal_user?.email?e("organization.settings_password_lead_account",{email:c.portal_user.email}):e("organization.settings_password_lead")})}),s.jsx(ns,{initialValues:{old_password:"",password:"",password_confirmation:""},validationSchema:l,onSubmit:async(d,{setSubmitting:g,resetForm:m,setFieldError:o})=>{try{await i.mutateAsync(d),n(e("organization.settings_password_success")),m()}catch(_){const f=_.response?.data?.data?.old_password?.[0];f?o("old_password",f):t($(_,e("organization.settings_password_error")))}finally{g(!1)}},children:({handleSubmit:d,isSubmitting:g})=>s.jsxs(rs,{className:"org-settings-password",onSubmit:d,noValidate:!0,children:[s.jsx(Q,{name:"old_password",label:e("organization.settings_password_current"),placeholder:e("organization.settings_password_placeholder_current"),autoComplete:"current-password"}),s.jsx(Q,{name:"password",label:e("organization.settings_password_new"),placeholder:e("organization.settings_password_placeholder_new"),autoComplete:"new-password"}),s.jsx(Q,{name:"password_confirmation",label:e("organization.settings_password_confirm"),placeholder:e("organization.settings_password_placeholder_confirm"),autoComplete:"new-password"}),s.jsx("div",{className:"org-settings-password__actions",children:s.jsxs(z,{type:"submit",className:"org-toolbar-btn org-settings-page__add-btn",disabled:g,children:[g?s.jsx(S,{className:"size-4 animate-spin","aria-hidden":!0}):null,e("organization.settings_password_submit")]})})]})})]})};function H(e){if(!e)return null;const t=/^(\d{4})-(\d{2})/.exec(e);return t?`${t[2]}/${t[1].slice(2)}`:e}function Ms(e){if(!e)return"â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢";const t=e.replace(/\D/g,"");return t.length>=4?`â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢ ${t.slice(-4)}`:`â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢ ${e}`}const $s=()=>{const{t:e}=O(),{showError:t,showSuccess:n}=L(),[i,c]=W(),{data:l=[],isLoading:d,isError:g,refetch:m}=_s(),o=us(),_=ms(),u=ps(),[f,w]=h.useState(null),[U,b]=h.useState(null),[v,C]=h.useState(null);h.useEffect(()=>{if(i.get("card")!=="success")return;n(e("organization.settings_cards_registered")),m();const r=new URLSearchParams(i);r.delete("card"),c(r,{replace:!0})},[m,i,c,n,e]);const K=async()=>{try{const r=await o.mutateAsync(`${window.location.origin}/organization/settings?tab=payments&card=success`);if(r.checkout_url){window.location.href=r.checkout_url;return}t(e("organization.settings_cards_register_error"))}catch(r){t(B(r,e("organization.settings_cards_register_error")))}},I=async r=>{try{w(r.id),b("default"),await _.mutateAsync(r.id),n(e("organization.settings_cards_default_updated"))}catch(x){t(B(x,e("organization.settings_cards_default_error")))}finally{w(null),b(null)}},A=async()=>
1{if(!(!v||u.isPending))try{w(v.id),b("delete"),await u.mutateAsync(v.id),C(null),n(e("organization.settings_cards_deleted"))}catch(r){t(B(r,e("organization.settings_cards_delete_error")))}finally{w(null),b(null)}};return s.jsxs("section",{className:"org-settings-page",children:[s.jsxs("header",{className:"org-settings-page__header",children:[s.jsx("p",{className:"org-settings-page__lead",children:e("organization.settings_cards_lead")}),s.jsxs(z,{type:"button",size:"sm",className:"org-toolbar-btn org-settings-page__add-btn",disabled:o.isPending,onClick:()=>{K()},children:[o.isPending?s.jsx(S,{className:"size-4 animate-spin","aria-hidden":!0}):s.jsx(es,{className:"size-4","aria-hidden":!0}),e("organization.settings_cards_add")]})]}),d?s.jsx("p",{className:"org-settings-page__hint",children:e("organization.settings_cards_loading")}):g?s.jsx("p",{className:"org-settings-page__hint org-settings-page__hint--error",children:e("organization.settings_cards_load_error")}):l.length===0?s.jsxs("div",{className:"org-settings-page__empty",children:[s.jsx("span",{className:"org-settings-page__empty-icon","aria-hidden":!0,children:s.jsx(G,{className:"size-6"})}),s.jsx("p",{className:"org-settings-page__empty-title",children:e("organization.settings_cards_empty_title")}),s.jsx("p",{className:"org-settings-page__empty-lead",children:e("organization.settings_cards_empty_lead")})]}):s.jsx("ul",{className:"org-settings-page__cards",children:l.map(r=>{const x=f===r.id,R=l.length>1;return s.jsxs("li",{className:r.is_default?"org-settings-card org-settings-card--default":"org-settings-card",children:[s.jsxs("div",{className:"org-settings-card__top",children:[s.jsxs("div",{className:"org-settings-card__brand-wrap",children:[s.jsx("span",{className:"org-settings-card__icon","aria-hidden":!0,children:s.jsx(G,{className:"size-5"})}),s.jsx("p",{className:"org-settings-card__brand",children:r.brand?.trim()||e("organization.settings_cards_fallback")})]}),s.jsx("button",{type:"button",className:"org-settings-card__action",disabled:x,title:e("organization.settings_cards_delete"),"aria-label":e("organization.settings_cards_delete"),onClick:()=>{C(r)},children:x&&U==="delete"?s.jsx(S,{className:"size-4 animate-spin","aria-hidden":!0}):s.jsx(as,{className:"size-4","aria-hidden":!0})})]}),s.jsx("p",{className:"org-settings-card__number",children:Ms(r.masked_number)}),H(r.expiry_date)?s.jsxs("p",{className:"org-settings-card__expiry",children:[e("organization.settings_cards_expires")," ",H(r.expiry_date)]}):null,R?s.jsxs("label",{className:"org-settings-card__default-choice",children:[s.jsx("input",{type:"checkbox",className:"org-settings-card__checkbox",checked:r.is_default,disabled:x,onChange:()=>{r.is_default||I(r)}}),x&&U==="default"?s.jsx(S,{className:"size-3.5 animate-spin","aria-hidden":!0}):null,e("organization.settings_cards_default")]}):null]},r.id)})}),s.jsx(ss,{isOpen:v!==null,setIsOpen:r=>{!r&&!u.isPending&&C(null)},title:e("organization.settings_cards_delete_confirm_title"),description:e("organization.settings_cards_delete_confirm"),onSubmit:()=>{A()}})]})};function Ds(e){const t=e.first_name?.charAt(0)??"",n=e.last_name?.charAt(0)??"";return t||n?`${t}${n}`.toUpperCase():e.email.charAt(0).toUpperCase()}const Ls=()=>{const{t:e}=O(),{user:t}=Z(),{showError:n,showSuccess:i}=L(),c=t?.portal_user?.can_manage_users!==!1,[l,d]=h.useState(1),[g,m]=h.useState(!1),[o,_]=h.useState(null),[u,f]=h.useState(null),{data:w,isLoading:U,isError:b}=Os(l,{enabled:c}),v=Us(),C=As(),K=Es(),I=Ts(),A=w?.items??[],r=w?.pagination.last_page??1;h.useEffect(()=>{if(!g)return;const a=E=>{E.key==="Escape"&&m(!1)},p=document.body.style.overflow;return document.body.style.overflow="hidden",window.addEventListener("keydown",a),()=>{document.body.style.overflow=p,window.removeEventListener("keydown",a)}},[g]);const x=async a=>{if(!(a.role==="owner"||o!==null)){if(a.is_active){f({type:"deactivate",user:a});return}_(a.id);try{await C.mutateAsync({id:a.id,is_active:!0}),i(e("organization.settings_users_activated"))}catch(p){n($(p,e("organization.settings_users_action_error")))}finally{_(null)}}},R=async()=>
1{if(!u||u.user.role==="owner")return;const a=u.user,p=u.type;_(a.id);try{p==="delete"?(await K.mutateAsync(a.id),i(e("organization.settings_users_deleted"))):(await C.mutateAsync({id:a.id,is_active:!1}),i(e("organization.settings_users_deactivated"))),f(null)}catch(E){n($(E,e("organization.settings_users_action_error")))}finally{_(null)}},os=async a=>{if(!(a.role==="owner"||o!==null)){_(a.id);try{await I.mutateAsync(a.id),i(e("organization.settings_users_credentials_resent"))}catch(p){n($(p,e("organization.settings_users_action_error")))}finally{_(null)}}};return s.jsxs("section",{className:"org-settings-page",children:[s.jsxs("header",{className:"org-settings-page__header",children:[s.jsx("p",{className:"org-settings-page__lead",children:e("organization.settings_users_lead")}),c?s.jsxs(z,{type:"button",size:"sm",className:"org-toolbar-btn org-settings-page__add-btn",onClick:()=>m(!0),children:[s.jsx(es,{className:"size-4","aria-hidden":!0}),e("organization.settings_users_add")]}):null]}),c?null:s.jsx("p",{className:"org-settings-page__hint",children:e("organization.settings_users_no_access")}),c&&U?s.jsx("p",{className:"org-settings-page__hint",children:e("organization.settings_users_loading")}):null,c&&b?s.jsx("p",{className:"org-settings-page__hint org-settings-page__hint--error",children:e("organization.settings_users_load_error")}):null,c&&!U&&!b&&A.length===0?s.jsxs("div",{className:"org-settings-page__empty",children:[s.jsx("span",{className:"org-settings-page__empty-icon","aria-hidden":!0,children:s.jsx(js,{className:"size-6"})}),s.jsx("p",{className:"org-settings-page__empty-title",children:e("organization.settings_users_empty_title")}),s.jsx("p",{className:"org-settings-page__empty-lead",children:e("organization.settings_users_empty_lead")})]}):null,c&&A.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"org-data-page__table-wrap",children:s.jsxs("table",{className:"org-data-page__table org-settings-users__table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{scope:"col",children:e("organization.settings_users_col_user")}),s.jsx("th",{scope:"col",children:e("organization.settings_users_role")}),s.jsx("th",{scope:"col",children:e("organization.settings_users_col_status")}),s.jsx("th",{scope:"col",className:"org-data-page__th-actions",children:e("organization.col_actions")})]})}),s.jsx("tbody",{children:A.map(a=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{className:"org-settings-users__identity-cell",children:[s.jsx("span",{className:"org-settings-users__avatar","aria-hidden":!0,children:Ds(a)}),s.jsxs("div",{children:[s.jsx("p",{className:"org-settings-users__name",children:a.full_name}),s.jsx("p",{className:"org-settings-users__email",children:a.email})]})]})}),s.jsx("td",{children:e(`organization.settings_users_roles.${a.role}`)}),s.jsx("td",{children:s.jsx("span",{className:a.is_active?"org-settings-users__status org-settings-users__status--active":"org-settings-users__status",children:a.is_active?e("organization.settings_users_status_active"):e("organization.settings_users_status_inactive")})}),s.jsx("td",{className:"org-data-page__cell-actions",children:a.role==="owner"?s.jsx("span",{className:"org-settings-users__owner-note",children:e("organization.settings_users_owner_locked")}):s.jsxs("div",{className:"org-settings-users__actions",children:[s.jsxs("button",{type:"button",className:"org-settings-users__action-btn",disabled:o===a.id,onClick:()=>{x(a)},children:[s.jsx(ys,{className:"size-4","aria-hidden":!0}),a.is_active?e("organization.settings_users_deactivate"):e("organization.settings_users_activate")]}),s.jsx("button",{type:"button",className:"org-settings-users__action-btn org-settings-users__action-btn--icon",disabled:o===a.id,title:e("organization.settings_users_resend"),"aria-label":e("organization.settings_users_resend"),onClick:()=>{os(a)},children:o===a.id?s.jsx(S,{className:"size-4 animate-spin","aria-hidden":!0}):s.jsx(V,{className:"size-4","aria-hidden":!0})}),s.jsxs("button",{type:"button",className:"org-settings-users__action-btn org-settings-users__action-btn--danger",disabled:o===a.id,onClick:()=>f({type:"delete",user:a}),children:[s.jsx(as,{className:"size-4","aria-hidden":!0}),e("organization.settings_users_delete")]})]})})]},a.id))})]})}),r>1?s.jsxs("div",{className:"org-settings-users__pager",children:[s.jsx(z,{type:"button",size:"sm",variant:"outline",disabled:l<=1,onClick:()=>d(a=>Math.max(1,a-1)),children:e("organization.settings_users_prev")}),s.jsx(z,{type:"button",size:"sm",variant:"outline",disabled:l>=r,onClick:()=>d(a=>a+1),children:e("organization.settings_users_next")})]}):null]}):null,g?s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"org-settings-drawer__backdrop","aria-label":e("common.cancel"),onClick:()=>m(!1)}),s.jsxs("aside",{className:"org-settings-drawer",role:"dialog","aria-modal":"true","aria-labelledby":"org-settings-users-drawer-title",children:[s.jsxs("header",{className:"org-settings-drawer__header",children:[s.jsxs("div",{children:[s.jsx("h3",{id:"org-settings-users-drawer-title",className:"org-settings-drawer__title",children:e("organization.settings_users_add")}),s.jsx("p",{className:"org-settings-drawer__lead",children:e("organization.settings_users_drawer_lead")})]}),s.jsx("button",{type:"button",className:"org-settings-drawer__close","aria-label":e("common.cancel"),onClick:()=>m(!1),children:s.jsx(ws,{className:"size-4","aria-hidden":!0})})]}),s.jsx(ns,{initialValues:{email:"",first_name:"",last_name:"",role:"member"}
1,validationSchema:ts({email:N().email(e("form.invalid_email")).required(e("form.field_required")),first_name:N().max(100),last_name:N().max(100),role:N().oneOf(["admin","member"]).required()}),onSubmit:async(a,{setSubmitting:p,resetForm:E})=>{try{await v.mutateAsync({email:a.email.trim(),first_name:a.first_name.trim()||void 0,last_name:a.last_name.trim()||void 0,role:a.role}),i(e("organization.settings_users_created")),E(),m(!1),d(1)}catch(ls){n($(ls,e("organization.settings_users_create_error")))}finally{p(!1)}},children:({handleSubmit:a,isSubmitting:p})=>s.jsxs(rs,{className:"org-settings-drawer__form",onSubmit:a,noValidate:!0,children:[s.jsxs("div",{className:"org-settings-drawer__field",children:[s.jsx("label",{htmlFor:"org-user-email",children:e("organization.settings_users_email")}),s.jsxs("div",{className:"org-settings-drawer__input-wrap",children:[s.jsx("span",{className:"org-settings-drawer__icon","aria-hidden":!0,children:s.jsx(V,{className:"size-4"})}),s.jsx(M,{id:"org-user-email",name:"email",type:"email",autoComplete:"email",placeholder:e("organization.settings_users_placeholder_email")})]}),s.jsx(is,{name:"email",component:"p",className:"org-settings-password__error"})]}),s.jsxs("div",{className:"org-settings-drawer__field",children:[s.jsx("label",{htmlFor:"org-user-first",children:e("organization.settings_users_first_name")}),s.jsxs("div",{className:"org-settings-drawer__input-wrap",children:[s.jsx("span",{className:"org-settings-drawer__icon","aria-hidden":!0,children:s.jsx(X,{className:"size-4"})}),s.jsx(M,{id:"org-user-first",name:"first_name",type:"text",autoComplete:"given-name",placeholder:e("organization.settings_users_placeholder_first_name")})]})]}),s.jsxs("div",{className:"org-settings-drawer__field",children:[s.jsx("label",{htmlFor:"org-user-last",children:e("organization.settings_users_last_name")}),s.jsxs("div",{className:"org-settings-drawer__input-wrap",children:[s.jsx("span",{className:"org-settings-drawer__icon","aria-hidden":!0,children:s.jsx(X,{className:"size-4"})}),s.jsx(M,{id:"org-user-last",name:"last_name",type:"text",autoComplete:"family-name",placeholder:e("organization.settings_users_placeholder_last_name")})]})]}),s.jsxs("div",{className:"org-settings-drawer__field",children:[s.jsx("label",{htmlFor:"org-user-role",children:e("organization.settings_users_role")}),s.jsxs("div",{className:"org-settings-drawer__input-wrap org-settings-drawer__input-wrap--select",children:[s.jsx("span",{className:"org-settings-drawer__icon","aria-hidden":!0,children:s.jsx(bs,{className:"size-4"})}),s.jsxs(M,{id:"org-user-role",name:"role",as:"select",children:[s.jsx("option",{value:"member",children:e("organization.settings_users_roles.member")}),s.jsx("option",{value:"admin",children:e("organization.settings_users_roles.admin")})]}),s.jsx("span",{className:"org-settings-drawer__chevron","aria-hidden":!0,children:s.jsx(zs,{className:"size-4"})})]})]}),s.jsxs("div",{className:"org-settings-drawer__actions",children:[s.jsx(z,{type:"button",variant:"outline",className:"org-toolbar-btn",onClick:()=>m(!1),children:e("common.cancel")}),s.jsxs(z,{type:"submit",className:"org-toolbar-btn org-settings-page__add-btn",disabled:p,children:[p?s.jsx(S,{className:"size-4 animate-spin","aria-hidden":!0}):null,e("organization.settings_users_create_submit")]})]})]})})]})]}):null,s.jsx(ss,{isOpen:u!==null,setIsOpen:a=>{!a&&o===null&&f(null)},title:u?.type==="deactivate"?e("organization.settings_users_deactivate_confirm_title"):e("organization.settings_users_delete_confirm_title"),description:u?.type==="deactivate"?e("organization.settings_users_deactivate_confirm",{name:u.user.full_name}):e("organization.settings_users_delete_confirm",{name:u?.user.full_name??""}),onSubmit:()=>{R()}})]})},Ks=["profile","payments","users","password","notifications"],F="org-settings-tabs__trigger rounded-none border-0 bg-transparent shadow-none data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=active]:text-[#a80606] dark:text-white dark:data-[state=active]:bg-transparent dark:data-[state=active]:text-white";function J(e){return Ks.includes(e)}const re=()=>{const{t:e}
1=O(),[t,n]=W(),i=h.useMemo(()=>{if(t.get("card")==="success")return"payments";const l=t.get("tab");return J(l)?l:"profile"},[t]),c=l=>{if(!J(l))return;const d=new URLSearchParams(t);d.set("tab",l),l!=="payments"&&d.delete("card"),n(d,{replace:!0})};return s.jsx("div",{className:"org-settings",children:s.jsxs(cs,{value:i,onValueChange:c,className:"org-settings-tabs",children:[s.jsxs(ds,{className:"org-settings-tabs__list h-auto w-full justify-start rounded-none bg-transparent p-0",children:[s.jsx(T,{value:"profile",className:F,children:e("organization.settings_tab_profile")}),s.jsx(T,{value:"payments",className:F,children:e("organization.settings_tab_payments")}),s.jsx(T,{value:"users",className:F,children:e("organization.settings_tab_users")}),s.jsx(T,{value:"password",className:F,children:e("organization.settings_tab_password")}),s.jsx(T,{value:"notifications",className:F,children:e("organization.settings_tab_notifications")})]}),s.jsx(q,{value:"profile",className:"org-settings-tabs__panel",children:s.jsxs("section",{className:"org-settings-page",children:[s.jsx("header",{className:"org-settings-page__header",children:s.jsx("p",{id:"org-settings-profile-heading",className:"org-settings-page__lead",children:e("organization.settings_profile_lead")})}),s.jsx(gs,{embedded:!0})]})}),s.jsx(q,{value:"payments",className:"org-settings-tabs__panel",children:s.jsx($s,{})}),s.jsx(q,{value:"users",className:"org-settings-tabs__panel",children:s.jsx(Ls,{})}),s.jsx(q,{value:"password",className:"org-settings-tabs__panel",children:s.jsx(Fs,{})}),s.jsx(q,{value:"notifications",className:"org-settings-tabs__panel",children:s.jsx(ks,{})})]})})};export{re as default};
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.