@strapi/admin 4.11.3 → 4.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/admin/src/components/AuthenticatedApp/index.js +2 -2
  2. package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +8 -5
  3. package/admin/src/content-manager/components/Inputs/index.js +3 -47
  4. package/admin/src/content-manager/components/RelationInput/RelationInput.js +99 -178
  5. package/admin/src/content-manager/components/RelationInput/components/Option.js +17 -15
  6. package/admin/src/content-manager/components/RelationInput/components/RelationList.js +2 -2
  7. package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +34 -37
  8. package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +0 -27
  9. package/admin/src/content-manager/pages/ListView/components/TableRows/index.js +93 -14
  10. package/admin/src/content-manager/pages/ListView/index.js +65 -47
  11. package/admin/src/content-manager/pages/ListView/utils/buildValidGetParams.js +30 -0
  12. package/admin/src/content-manager/pages/ListView/utils/index.js +1 -1
  13. package/admin/src/hooks/useAdminUsers/useAdminUsers.js +3 -3
  14. package/admin/src/hooks/useEnterprise/useEnterprise.js +4 -4
  15. package/admin/src/hooks/useSettingsMenu/index.js +35 -21
  16. package/admin/src/pages/App/index.js +0 -3
  17. package/admin/src/pages/AuthPage/components/Register/index.js +5 -1
  18. package/admin/src/pages/ProfilePage/index.js +12 -12
  19. package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +13 -11
  20. package/admin/src/pages/SettingsPage/components/Tokens/Table/index.js +15 -1
  21. package/admin/src/pages/SettingsPage/components/Tokens/TokenBox/index.js +1 -1
  22. package/admin/src/pages/SettingsPage/pages/Roles/ProtectedEditPage/index.js +4 -10
  23. package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +2 -2
  24. package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/utils/makeWebhookValidationSchema.js +11 -5
  25. package/admin/src/translations/ca.json +1 -0
  26. package/admin/src/translations/en.json +4 -1
  27. package/admin/src/translations/es.json +5 -0
  28. package/admin/src/translations/fr.json +1 -0
  29. package/admin/src/translations/zh-Hans.json +1 -1
  30. package/build/2799.cf9b491f.chunk.js +1 -0
  31. package/build/539.865446c0.chunk.js +1 -0
  32. package/build/{5542.64b623c9.chunk.js → 5542.c62d0daf.chunk.js} +1 -1
  33. package/build/{5563.86f9aa9c.chunk.js → 5563.27e2de0c.chunk.js} +3 -3
  34. package/build/5932.f8be7e31.chunk.js +1 -0
  35. package/build/7259.0e25ab5d.chunk.js +1 -0
  36. package/build/{6405.27e1bee5.chunk.js → 970.89601f27.chunk.js} +2 -2
  37. package/build/{9932.7e2b71de.chunk.js → 9932.9f3790a5.chunk.js} +81 -81
  38. package/build/9944.29289a16.chunk.js +26 -0
  39. package/build/Admin-authenticatedApp.7f04c595.chunk.js +79 -0
  40. package/build/{Admin_profilePage.2131eb68.chunk.js → Admin_profilePage.0adb571e.chunk.js} +2 -2
  41. package/build/{Admin_settingsPage.4069bb8a.chunk.js → Admin_settingsPage.36152558.chunk.js} +9 -9
  42. package/build/admin-app.3ea6009c.chunk.js +61 -0
  43. package/build/{admin-edit-roles-page.2040034a.chunk.js → admin-edit-roles-page.3fdd6b9d.chunk.js} +11 -11
  44. package/build/admin-edit-users.78552758.chunk.js +10 -0
  45. package/build/admin-users.c23322fc.chunk.js +11 -0
  46. package/build/api-tokens-list-page.a103f526.chunk.js +16 -0
  47. package/build/audit-logs-settings-page.37fe915c.chunk.js +1 -0
  48. package/build/ca-json.1fed5d8b.chunk.js +1 -0
  49. package/build/content-manager.552c7418.chunk.js +1094 -0
  50. package/build/{content-type-builder-list-view.0c3ceb4e.chunk.js → content-type-builder-list-view.82cfadc0.chunk.js} +7 -7
  51. package/build/content-type-builder.238687f9.chunk.js +166 -0
  52. package/build/{email-settings-page.6b38222d.chunk.js → email-settings-page.45695daa.chunk.js} +1 -1
  53. package/build/en-json.fb9f6ddd.chunk.js +1 -0
  54. package/build/es-json.42096084.chunk.js +1 -0
  55. package/build/fr-json.69789980.chunk.js +1 -0
  56. package/build/{i18n-settings-page.ff863f20.chunk.js → i18n-settings-page.29308d0b.chunk.js} +1 -1
  57. package/build/index.html +1 -1
  58. package/build/main.3d752c03.js +2927 -0
  59. package/build/runtime~main.87232977.js +2 -0
  60. package/build/sso-settings-page.0cdb96a6.chunk.js +1 -0
  61. package/build/transfer-tokens-list-page.7237443d.chunk.js +16 -0
  62. package/build/{upload-settings.43cf16cd.chunk.js → upload-settings.cb6c14c3.chunk.js} +1 -1
  63. package/build/{upload.72f8f8fc.chunk.js → upload.7e629643.chunk.js} +2 -2
  64. package/build/users-advanced-settings-page.750b1f76.chunk.js +9 -0
  65. package/build/{users-email-settings-page.33359797.chunk.js → users-email-settings-page.e9bcd865.chunk.js} +1 -1
  66. package/build/{users-providers-settings-page.1e7a4a71.chunk.js → users-providers-settings-page.a94253e9.chunk.js} +1 -1
  67. package/build/{users-roles-settings-page.235378b6.chunk.js → users-roles-settings-page.d286426a.chunk.js} +5 -5
  68. package/build/webhook-edit-page.77ef4f1a.chunk.js +33 -0
  69. package/build/{zh-Hans-json.4cfef87d.chunk.js → zh-Hans-json.fada6f40.chunk.js} +1 -1
  70. package/ee/admin/content-manager/{components/DynamicTable/CellContent/ReviewWorkflowsStage → pages/ListView/ReviewWorkflowsColumn}/ReviewWorkflowsStageEE.js +7 -2
  71. package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/constants.js +24 -0
  72. package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/index.js +1 -0
  73. package/ee/admin/hooks/useLicenseLimitNotification/index.js +17 -6
  74. package/ee/admin/hooks/useLicenseLimits/index.js +1 -32
  75. package/ee/admin/hooks/useLicenseLimits/useLicenseLimits.js +44 -0
  76. package/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/index.js +6 -4
  77. package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/hooks/useAuditLogsData.js +6 -4
  78. package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/index.js +4 -9
  79. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/hooks/useReviewWorkflows.js +3 -5
  80. package/ee/admin/pages/SettingsPage/pages/SingleSignOn/index.js +4 -9
  81. package/ee/admin/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +9 -2
  82. package/ee/server/services/review-workflows/entity-service-decorator.js +20 -11
  83. package/package.json +14 -15
  84. package/server/content-types/User.js +10 -0
  85. package/server/strategies/api-token.js +9 -5
  86. package/server/strategies/data-transfer.js +9 -5
  87. package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +0 -2
  88. package/admin/src/content-manager/components/RelationInput/components/Relation.js +0 -53
  89. package/admin/src/content-manager/pages/ListView/utils/buildQueryString.js +0 -36
  90. package/admin/src/content-manager/pages/ListView/utils/createPluginsFilter.js +0 -4
  91. package/admin/src/pages/App/utils/index.js +0 -3
  92. package/admin/src/pages/App/utils/unique-identifier.js +0 -12
  93. package/build/1799.84268ad3.chunk.js +0 -33
  94. package/build/5932.6a23b88c.chunk.js +0 -1
  95. package/build/7259.fb69d4bf.chunk.js +0 -1
  96. package/build/Admin-authenticatedApp.69855f1b.chunk.js +0 -79
  97. package/build/admin-app.fea867af.chunk.js +0 -61
  98. package/build/admin-edit-users.53e4290a.chunk.js +0 -10
  99. package/build/admin-users.3b12dca2.chunk.js +0 -11
  100. package/build/api-tokens-list-page.201fb67a.chunk.js +0 -16
  101. package/build/audit-logs-settings-page.b07ad202.chunk.js +0 -1
  102. package/build/ca-json.43e14418.chunk.js +0 -1
  103. package/build/content-manager.66cec770.chunk.js +0 -1094
  104. package/build/content-type-builder.e1b6d13b.chunk.js +0 -166
  105. package/build/en-json.f5fa476a.chunk.js +0 -1
  106. package/build/es-json.715b6fd8.chunk.js +0 -1
  107. package/build/fr-json.73494bf5.chunk.js +0 -1
  108. package/build/main.83edb3fc.js +0 -2926
  109. package/build/runtime~main.20c3cac6.js +0 -2
  110. package/build/sso-settings-page.35b67909.chunk.js +0 -1
  111. package/build/transfer-tokens-list-page.217573c3.chunk.js +0 -16
  112. package/build/users-advanced-settings-page.1911adf5.chunk.js +0 -9
  113. package/build/webhook-edit-page.1ee02c4b.chunk.js +0 -33
  114. package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +0 -58
  115. package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/index.js +0 -3
@@ -0,0 +1,61 @@
1
+ (self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5538],{33335:function(B,v,t){"use strict";t.r(v),t.d(v,{default:function(){return Ds}});var e=t(32735),p=t(12301),y=t(65810),E=t(56784),c=t.n(E),m=t(93839),A=t.n(m),M=t(86349),L=t.n(M),x=t(88423),O=t.n(x),b=t(74758),S=t(14911),R=t(47750),T="strapi-admin-language",r=t(19565),F=t(60216),a=t.n(F),G=t(20108),se=t(15062),D=t(66694),I=t(97889);const ne={menuLogo:null,authLogo:null};var Re=(o=ne,s)=>(0,I.ZP)(o,n=>{switch(s.type){case"UPDATE_PROJECT_SETTINGS":{Object.assign(n,s.values);break}default:return n}});const pe=({children:o,authLogo:s,menuLogo:n,showReleaseNotification:i,showTutorials:l})=>{const[{menuLogo:h,authLogo:f},P]=(0,e.useReducer)(Re,ne),k=(0,e.useCallback)(({menuLogo:X,authLogo:C})=>P({type:"UPDATE_PROJECT_SETTINGS",values:{menuLogo:X||n,authLogo:C||s}}),[s,n]),w=(0,e.useMemo)(()=>({logos:{menu:{custom:h,default:n},auth:{custom:f,default:s}},updateProjectSettings:k,showReleaseNotification:i,showTutorials:l}),[h,n,f,s,k,i,l]);return e.createElement(D._5.Provider,{value:w},o)};pe.propTypes={authLogo:a().string.isRequired,children:a().element.isRequired,menuLogo:a().string.isRequired,showReleaseNotification:a().bool.isRequired,showTutorials:a().bool.isRequired};var Ze=pe,Ue=t(33795),De=t.n(Ue),$e=t(3040),je=t.n($e);const qe="GUIDED_TOUR_CURRENT_STEP",Ve="GUIDED_TOUR_COMPLETED_STEPS",mt="GUIDED_TOUR_SKIPPED",et=JSON.parse,_e=JSON.stringify;var Ie={clear(){localStorage.removeItem(qe),localStorage.removeItem(Ve)},addCompletedStep(o){const s=et(localStorage.getItem(Ve))?.slice()||[];s.includes(o)||(s.push(o),localStorage.setItem(Ve,_e(s)))},addCurrentStep(o){localStorage.setItem(qe,_e(o))},setSkipped(o){localStorage.setItem(mt,_e(o))},get(o){return et(localStorage.getItem(o))}},gt=o=>{const s={...o},n=Ie.get(Ve),i=Ie.get(qe),l=Ie.get(mt);if(n&&n.forEach(h=>{const[f,P]=h.split(".");je()(s,["guidedTourState",f,P],!0)}),i){const[h,f]=i.split(".");je()(s,["guidedTourState",h,f],!0),Ie.addCompletedStep(i),Ie.addCurrentStep(null)}return l!==null&&je()(s,"isSkipped",l),s};const pt={currentStep:null,guidedTourState:{contentTypeBuilder:{create:!1,success:!1},contentManager:{create:!1,success:!1},apiTokens:{create:!1,success:!1}},isGuidedTourVisible:!1,isSkipped:!0};var tt=(o=pt,s)=>(0,I.ZP)(o,n=>{switch(s.type){case"SET_CURRENT_STEP":{n.currentStep=s.step;break}case"SET_STEP_STATE":{const[i,l]=s.currentStep.split(".");n.guidedTourState[i][l]=s.value;break}case"SET_SKIPPED":{n.isSkipped=s.value;break}case"SET_GUIDED_TOUR_VISIBILITY":{n.isGuidedTourVisible=s.value;break}default:return n}}),ft=(o,s)=>{const n=Object.entries(s),i=n.findIndex(([h])=>h===o);return n.slice(0,i).every(([,h])=>Object.values(h).every(Boolean))},ht=(o,s)=>{const n=o.split("."),i=n[1],l=Object.entries(s[n[0]]),h=l.findIndex(([P])=>P===i);return l.slice(0,h).every(([,P])=>P)};const st=({children:o})=>{const[{currentStep:s,guidedTourState:n,isGuidedTourVisible:i,isSkipped:l},h]=(0,e.useReducer)(tt,pt,gt),f=C=>{if(C!==null){const re=De()(n,C),_=ht(C,n);if(re||l||!_)return null}return Ie.addCurrentStep(C),h({type:"SET_CURRENT_STEP",step:C})},P=C=>{h({type:"SET_GUIDED_TOUR_VISIBILITY",value:C})},k=(C,re)=>{Ie.addCompletedStep(C),h({type:"SET_STEP_STATE",currentStep:C,value:re})},w=C=>{const re=n[C];if(re){const _=ft(C,n),de=Object.keys(re)[0],te=re[de];if(_&&!s&&!te)return f(`${C}.${de}`)}return null},X=C=>{Ie.setSkipped(C),h({type:"SET_SKIPPED",value:C})};return e.createElement(r.Zc,{guidedTourState:n,currentStep:s,setCurrentStep:f,setGuidedTourVisibility:P,setSkipped:X,setStepState:k,startSection:w,isGuidedTourVisible:i,isSkipped:l},o)};st.propTypes={children:a().element.isRequired};var Et=st,nt=t(58732),Ht=t.n(nt),Pt=t(78023),vt=t(5985);const Be=({changeLocale:o,children:s,localeNames:n})=>e.createElement(vt.Z.Provider,{value:{changeLocale:o,localeNames:n}},s);Be.propTypes={changeLocale:a().func.isRequired,children:a().element.isRequired,localeNames:a().object.isRequired};var yt=Be,Rt=o=>{const s=window.localStorage.getItem(T);return{locale:o[s]?s:"en",localeNames:o}};const at={localeNames:{en:"English"},locale:"en"};var Ct=(o=at,s)=>{switch(s.type){case"CHANGE_LOCALE":{const{locale:n}=s;return o.localeNames[n]?{...o,locale:n}:o}default:return o}};const Mt=({children:o,localeNames:s,messages:n})=>{const[{locale:i},l]=(0,e.useReducer)(Ct,at,()=>Rt(s));(0,e.useEffect)(()=>{window.localStorage.setItem(T,i),document.documentElement.setAttribute("lang",i)},[i]);const h=P=>{l({type:"CHANGE_LOCALE",locale:P})},f=Ht()(n[i],n.en);return e.createElement(Pt.Z,{locale:i,defaultLocale:"en",messages:f,textComponent:"span"},e.createElement(yt,{changeLocale:h,localeNames:s},o))};Mt.propTypes={children:a().element.isRequired,localeNames:a().objectOf(a().string).isRequired,messages:a().object.isRequired};var Lt=Mt,St=t(24854),Oe=t(67879),Dt=t(10328),xe=t(8471),It=(0,xe.vJ)`
2
+ body {
3
+ background: ${({theme:o})=>o.colors.neutral100};
4
+ }
5
+ `;const Ot=({children:o})=>{const{currentTheme:s,themes:n}=(0,Dt.M1)(),{locale:i}=(0,Oe.Z)();return e.createElement(St.h,{locale:i,theme:n[s]||n.light},o,e.createElement(It,null))};Ot.propTypes={children:a().element.isRequired};var bt=Ot;const ot="STRAPI_THEME",Ut=()=>{const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",s=localStorage.getItem(ot);return s||localStorage.setItem(ot,o),s||o},kt=({children:o,themes:s})=>{const[n,i]=(0,e.useState)(Ut()),l=(0,e.useCallback)(f=>{i(f),localStorage.setItem(ot,f)},[i]),h=(0,e.useMemo)(()=>({currentTheme:n,onChangeTheme:l,themes:s}),[n,l,s]);return e.createElement(D.Rj.Provider,{value:h},o)};kt.propTypes={children:a().node.isRequired,themes:a().shape({light:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,dark:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,custom:a().object}).isRequired};var jt=kt;const g=new G.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),d=({authLogo:o,children:s,components:n,customFields:i,fields:l,getAdminInjectedComponents:h,getPlugin:f,localeNames:P,menu:k,menuLogo:w,messages:X,plugins:C,runHookParallel:re,runHookSeries:_,runHookWaterfall:de,settings:te,showReleaseNotification:K,showTutorials:Ge,store:ze,themes:ae})=>e.createElement(Lt,{messages:X,localeNames:P},e.createElement(jt,{themes:ae},e.createElement(bt,null,e.createElement(G.QueryClientProvider,{client:g},e.createElement(se.zt,{store:ze},e.createElement(D.ux.Provider,{value:{getAdminInjectedComponents:h}},e.createElement(Ze,{authLogo:o,menuLogo:w,showReleaseNotification:K,showTutorials:Ge},e.createElement(r._Y,{getPlugin:f,menu:k,plugins:C,runHookParallel:re,runHookWaterfall:de,runHookSeries:_,settings:te},e.createElement(r.rt,{components:n,fields:l},e.createElement(r.MG,{customFields:i},e.createElement(r.m$,null,e.createElement(r.w7,null,e.createElement(Et,null,e.createElement(r.N$,null,s))))))))))))));d.propTypes={authLogo:a().oneOfType([a().string,a().any]).isRequired,children:a().element.isRequired,components:a().object.isRequired,customFields:a().object.isRequired,fields:a().object.isRequired,getAdminInjectedComponents:a().func.isRequired,getPlugin:a().func.isRequired,localeNames:a().objectOf(a().string).isRequired,menu:a().arrayOf(a().shape({to:a().string.isRequired,icon:a().func.isRequired,intlLabel:a().shape({id:a().string.isRequired,defaultMessage:a().string.isRequired}).isRequired,permissions:a().array,Component:a().func})).isRequired,menuLogo:a().oneOfType([a().string,a().any]).isRequired,messages:a().object.isRequired,plugins:a().object.isRequired,runHookParallel:a().func.isRequired,runHookWaterfall:a().func.isRequired,runHookSeries:a().func.isRequired,settings:a().object.isRequired,showReleaseNotification:a().bool.isRequired,showTutorials:a().bool.isRequired,store:a().object.isRequired,themes:a().shape({light:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,dark:a().shape({colors:a().object.isRequired,shadows:a().object.isRequired,sizes:a().object.isRequired,zIndices:a().array.isRequired,spaces:a().array.isRequired,borderRadius:a().string.isRequired,mediaQueries:a().object.isRequired,fontSizes:a().array.isRequired,lineHeights:a().array.isRequired,fontWeights:a().object.isRequired}).isRequired,custom:a().object}).isRequired};var u=d,U=t(20284),j=t(6680);const N=(o,s)=>{let n=j.compose;const i=[];o.forEach(h=>{i.push(h())});const l=(0,j.createStore)($(s,{}),{},n((0,j.applyMiddleware)(...i)));return l.asyncReducers={},l.injectReducer=(h,f)=>{l.asyncReducers[h]=f,l.replaceReducer($(s,l.asyncReducers))},l},$=(o,s)=>(0,j.combineReducers)({...o,...s});var H=N,ee=t(78246),V=()=>{const o=[];return{register(s){o.push(s)},delete(s){o.splice(o.indexOf(s),1)},runWaterfall(s,n){return o.reduce((i,l)=>l(i,n),s)},async runWaterfallAsync(s,n){let i=s;for(const l of o)i=await l(i,n);return i},runSeries(...s){return o.map(n=>n(...s))},async runSeriesAsync(...s){const n=[];for(const i of o)n.push(await i(...s));return n},runParallel(...s){return Promise.all(o.map(n=>n(...s)))}}},J=t(46339),ke="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAXVBMVEUAAABIRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9IRP9JRf9IRf9IRP5IRP5JRP9JRf////+Vk/+zsv++vf9mY/9taf9/fP+Jh//c3P9RTf/Ibar2AAAAFHRSTlMA/MJX+fPt48cahaff1dMaGqcahSpTPmAAAAEvSURBVFjD7dfNTsMwEATgXcf5cdKEtixtcYH3f0xEibIguba1g8Slc+58iqUedmhNaMbJzX3Xema5G2bfdv3iprE50s80g7Yqw0Oz1Z+cmOL2a38nxuy+BSfmuNv7BUhDRAMCDESBEYCDvsD6hmcMGGnCgIkcBjhaMGCmHgN66jCgoxYDWvIY4IkxgHFAkrmeU7kmfpkG4uUllXMtEE82QPs2QPs2QPs2QPs2QPsAoH0DoH0LoH0QeN3ydtnyXg38ok76MQ/gAfwf8JH8V18LQOljomBAFAyIkga4CGT7XAtEuQf4IpDri6e2BoiZA6OrAGLuxOnLQMweWXMRyPVlwQ/NAwZMNGLACJ/76ODYo5MHHl3o7EOHZ6BbjtbpG/5kfOv8P7ilbv7PX/M/rMVPqrI3XI3nd3sAAAAASUVORK5CYII=",Ye={admin:{tutorials:{links:[]}},contentManager:{editView:{informations:[],"right-links":[]},listView:{actions:[],deleteModalAdditionalInfos:[],publishModalAdditionalInfos:[],unpublishModalAdditionalInfos:[]}}},We=t(10728),fe=t(53038);const Ne=({component:o,path:s,...n})=>{const{pathname:i,search:l}=(0,fe.TH)();return e.createElement(fe.AW,{path:s,render:h=>r.I8.getToken()!==null?e.createElement(o,{...n,...h}):e.createElement(fe.l_,{to:{pathname:"/auth/login",search:i!=="/"&&`?redirectTo=${encodeURIComponent(`${i}${l}`)}`}})})};Ne.propTypes={component:a().any.isRequired,path:a().string.isRequired};var we=(0,e.memo)(Ne);const Ke={contentManager:{main:[],collectionTypesConfigurations:[{action:"plugin::content-manager.collection-types.configure-view",subject:null}],componentsConfigurations:[{action:"plugin::content-manager.components.configure-layout",subject:null}],singleTypesConfigurations:[{action:"plugin::content-manager.single-types.configure-view",subject:null}]},marketplace:{main:[{action:"admin::marketplace.read",subject:null}],read:[{action:"admin::marketplace.read",subject:null}]},settings:{roles:{main:[{action:"admin::roles.create",subject:null},{action:"admin::roles.update",subject:null},{action:"admin::roles.read",subject:null},{action:"admin::roles.delete",subject:null}],create:[{action:"admin::roles.create",subject:null}],delete:[{action:"admin::roles.delete",subject:null}],read:[{action:"admin::roles.read",subject:null}],update:[{action:"admin::roles.update",subject:null}]},users:{main:[{action:"admin::users.create",subject:null},{action:"admin::users.read",subject:null},{action:"admin::users.update",subject:null},{action:"admin::users.delete",subject:null}],create:[{action:"admin::users.create",subject:null}],delete:[{action:"admin::users.delete",subject:null}],read:[{action:"admin::users.read",subject:null}],update:[{action:"admin::users.update",subject:null}]},webhooks:{main:[{action:"admin::webhooks.create",subject:null},{action:"admin::webhooks.read",subject:null},{action:"admin::webhooks.update",subject:null},{action:"admin::webhooks.delete",subject:null}],create:[{action:"admin::webhooks.create",subject:null}],delete:[{action:"admin::webhooks.delete",subject:null}],read:[{action:"admin::webhooks.read",subject:null},{action:"admin::webhooks.update",subject:null},{action:"admin::webhooks.delete",subject:null}],update:[{action:"admin::webhooks.update",subject:null}]},"api-tokens":{main:[{action:"admin::api-tokens.access",subject:null}],create:[{action:"admin::api-tokens.create",subject:null}],delete:[{action:"admin::api-tokens.delete",subject:null}],read:[{action:"admin::api-tokens.read",subject:null}],update:[{action:"admin::api-tokens.update",subject:null}],regenerate:[{action:"admin::api-tokens.regenerate",subject:null}]},"transfer-tokens":{main:[{action:"admin::transfer.tokens.access",subject:null}],create:[{action:"admin::transfer.tokens.create",subject:null}],delete:[{action:"admin::transfer.tokens.delete",subject:null}],read:[{action:"admin::transfer.tokens.read",subject:null}],update:[{action:"admin::transfer.tokens.update",subject:null}],regenerate:[{action:"admin::transfer.tokens.regenerate",subject:null}]},"project-settings":{read:[{action:"admin::project-settings.read",subject:null}],update:[{action:"admin::project-settings.update",subject:null}]}}};var Pe=t(18782),ue=t(8997),ce=t(84306),he=t(39935),He=t.n(he),ss=t(9086),it=t.n(ss),ns=t(20139),as=t(41832),z=t(24346),Qe=t(27649),ye=t(72850),Te=t(49372),Ae=t(87933),Fe=t(10369),lt=t(41415),wt=t(92802),Je=t(10190),me=t(954);const Zt=({onSubmit:o,schema:s})=>{const{formatMessage:n}=(0,Oe.Z)();return e.createElement(me.ZP,null,e.createElement(Qe.o,null,e.createElement(me.bU,null,e.createElement(wt.J9,{enableReinitialize:!0,initialValues:{email:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:i,errors:l,handleChange:h})=>e.createElement(r.l0,{noValidate:!0},e.createElement(me.sg,null,e.createElement(Je.Z,null),e.createElement(ye.x,{paddingTop:6,paddingBottom:7},e.createElement(Te.Z,{as:"h1",variant:"alpha"},n({id:"Auth.form.button.password-recovery",defaultMessage:"Password Recovery"}))),l.errorMessage&&e.createElement(Te.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},n({id:l.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(Ae.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Fe.o,{error:l.email?n({id:l.email,defaultMessage:"This email is invalid."}):"",value:i.email,onChange:h,label:n({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:n({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),e.createElement(lt.z,{type:"submit",fullWidth:!0},n({id:"Auth.form.button.forgot-password",defaultMessage:"Send Email"})))))),e.createElement(Ae.k,{justifyContent:"center"},e.createElement(ye.x,{paddingTop:4},e.createElement(r.rU,{to:"/auth/login"},n({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};Zt.defaultProps={onSubmit:o=>o.preventDefault()},Zt.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var os=Zt,rs=()=>{const{formatMessage:o}=(0,Oe.Z)();return e.createElement(me.ZP,null,e.createElement(Qe.o,null,e.createElement(me.bU,null,e.createElement(me.sg,null,e.createElement(Je.Z,null),e.createElement(ye.x,{paddingTop:6,paddingBottom:7},e.createElement(Te.Z,{as:"h1",variant:"alpha"},o({id:"app.containers.AuthPage.ForgotPasswordSuccess.title",defaultMessage:"Email sent"}))),e.createElement(Te.Z,null,o({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.email",defaultMessage:"It can take a few minutes to receive your password recovery link."})),e.createElement(ye.x,{paddingTop:4},e.createElement(Te.Z,null,o({id:"app.containers.AuthPage.ForgotPasswordSuccess.text.contact-admin",defaultMessage:"If you do not receive this link, please contact your administrator."}))))),e.createElement(Ae.k,{justifyContent:"center"},e.createElement(ye.x,{paddingTop:4},e.createElement(r.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},is=()=>{const{formatMessage:o}=(0,Oe.Z)(),n=(0,r.aM)().get("info")||o({id:"Auth.components.Oops.text",defaultMessage:"Your account has been suspended."});return e.createElement(me.ZP,null,e.createElement(Qe.o,null,e.createElement(me.bU,null,e.createElement(me.sg,null,e.createElement(Je.Z,null),e.createElement(ye.x,{paddingTop:6,paddingBottom:7},e.createElement(Te.Z,{as:"h1",variant:"alpha"},o({id:"Auth.components.Oops.title",defaultMessage:"Oops..."}))),e.createElement(Te.Z,null,n),e.createElement(ye.x,{paddingTop:4},e.createElement(Te.Z,null,o({id:"Auth.components.Oops.text.admin",defaultMessage:"If this is a mistake, please contact your administrator."}))))),e.createElement(Ae.k,{justifyContent:"center"},e.createElement(ye.x,{paddingTop:4},e.createElement(r.rU,{to:"/auth/login"},o({id:"Auth.link.signin",defaultMessage:"Sign in"}))))))},ls=t(15335),Gt=t(5803),us=t(8284),ut=t(54894),ct=t(60492),dt=t(72218);const zt=xe.ZP.a`
6
+ color: ${({theme:o})=>o.colors.primary600};
7
+ `,$t=(0,xe.ZP)(Fe.o)`
8
+ ::-ms-reveal {
9
+ display: none;
10
+ }
11
+ `,Bt=({authType:o,fieldsToDisable:s,noSignin:n,onSubmit:i,schema:l})=>{const h=(0,r.lm)(),{push:f}=(0,fe.k6)(),[P,k]=(0,e.useState)(!1),[w,X]=(0,e.useState)(!1),[C,re]=(0,e.useState)(0),[_,de]=(0,e.useState)({}),{trackUsage:te}=(0,r.rS)(),{formatMessage:K}=(0,Oe.Z)(),Ge=(0,r.aM)(),{formatAPIError:ze}=(0,r.So)(),{get:ae}=(0,r.kY)(),ie=Ge.get("registrationToken");(0,e.useEffect)(()=>{ie&&(async()=>{try{const{data:{data:Z}}=await ae("/admin/registration-info",{params:{registrationToken:ie}});Z&&de(Z)}catch(Z){const q=ze(Z);h({type:"warning",message:q}),f(`/auth/oops?info=${encodeURIComponent(q)}`)}})()},[ie]);function Ce(Ee){return Object.entries(Ee).reduce((Z,[q,le])=>{let Le=le;return!["password","confirmPassword"].includes(q)&&typeof le=="string"&&(Le=Le.trim()),Z[q]=Le,Z},{})}return e.createElement(me.ZP,null,e.createElement(me.bU,null,e.createElement(wt.J9,{enableReinitialize:!0,initialValues:{firstname:_.firstname||"",lastname:_.lastname||"",email:_.email||"",password:"",confirmPassword:"",registrationToken:ie||void 0,news:!1},onSubmit:async(Ee,Z)=>{const q=Ce(Ee);try{await l.validate(q,{abortEarly:!1}),C>0&&o==="register-admin"&&te("didSubmitWithErrorsFirstAdmin",{count:C.toString()}),i(ie?{userInfo:it()(q,["registrationToken"]),registrationToken:ie}:q,Z)}catch(le){const Le=(0,r.CJ)(le);re(C+1),Z.setErrors(Le)}},validateOnChange:!1},({values:Ee,errors:Z,handleChange:q})=>e.createElement(r.l0,{noValidate:!0},e.createElement(Qe.o,null,e.createElement(Ae.k,{direction:"column",alignItems:"center",gap:3},e.createElement(Je.Z,null),e.createElement(Te.Z,{as:"h1",variant:"alpha",textAlign:"center"},K({id:"Auth.form.welcome.title",defaultMessage:"Welcome to Strapi!"})),e.createElement(Te.Z,{variant:"epsilon",textColor:"neutral600",textAlign:"center"},K({id:"Auth.form.register.subtitle",defaultMessage:"Credentials are only used to authenticate in Strapi. All saved data will be stored in your database."}))),e.createElement(Ae.k,{direction:"column",alignItems:"stretch",gap:6,marginTop:7},e.createElement(ls.r,{gap:4},e.createElement(Gt.P,{col:6},e.createElement(Fe.o,{name:"firstname",required:!0,value:Ee.firstname,error:Z.firstname?K(Z.firstname):void 0,onChange:q,label:K({id:"Auth.form.firstname.label",defaultMessage:"Firstname"})})),e.createElement(Gt.P,{col:6},e.createElement(Fe.o,{name:"lastname",value:Ee.lastname,onChange:q,label:K({id:"Auth.form.lastname.label",defaultMessage:"Lastname"})}))),e.createElement(Fe.o,{name:"email",disabled:s.includes("email"),value:Ee.email,onChange:q,error:Z.email?K(Z.email):void 0,required:!0,label:K({id:"Auth.form.email.label",defaultMessage:"Email"}),type:"email"}),e.createElement($t,{name:"password",onChange:q,value:Ee.password,error:Z.password?K(Z.password):void 0,endAction:e.createElement(dt.Z,{onClick:le=>{le.preventDefault(),k(Le=>!Le)},label:K(P?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},P?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),hint:K({id:"Auth.form.password.hint",defaultMessage:"Must be at least 8 characters, 1 uppercase, 1 lowercase & 1 number"}),required:!0,label:K({id:"global.password",defaultMessage:"Password"}),type:P?"text":"password"}),e.createElement($t,{name:"confirmPassword",onChange:q,value:Ee.confirmPassword,error:Z.confirmPassword?K(Z.confirmPassword):void 0,endAction:e.createElement(dt.Z,{onClick:le=>{le.preventDefault(),X(Le=>!Le)},label:K(w?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},w?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),required:!0,label:K({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirm Password"}),type:w?"text":"password"}),e.createElement(us.X,{onValueChange:le=>{q({target:{value:le,name:"news"}})},value:Ee.news,name:"news","aria-label":"news"},K({id:"Auth.form.register.news.label",defaultMessage:"Keep me updated about new features & upcoming improvements (by doing this you accept the {terms} and the {policy})."},{terms:e.createElement(zt,{target:"_blank",href:"https://strapi.io/terms",rel:"noreferrer"},K({id:"Auth.privacy-policy-agreement.terms",defaultMessage:"terms"})),policy:e.createElement(zt,{target:"_blank",href:"https://strapi.io/privacy",rel:"noreferrer"},K({id:"Auth.privacy-policy-agreement.policy",defaultMessage:"policy"}))})),e.createElement(lt.z,{fullWidth:!0,size:"L",type:"submit"},K({id:"Auth.form.button.register",defaultMessage:"Let's start"})))))),!n&&e.createElement(ye.x,{paddingTop:4},e.createElement(Ae.k,{justifyContent:"center"},e.createElement(r.rU,{label:"Auth.link.signin",to:"/auth/login"},K({id:"Auth.link.signin.account",defaultMessage:"Already have an account?"}))))))};Bt.defaultProps={fieldsToDisable:[],noSignin:!1,onSubmit:o=>o.preventDefault()},Bt.propTypes={authType:a().string.isRequired,fieldsToDisable:a().array,noSignin:a().bool,onSubmit:a().func,schema:a().shape({validate:a().func.isRequired,type:a().string.isRequired}).isRequired};var Vt=Bt;const Yt=(0,xe.ZP)(Fe.o)`
12
+ ::-ms-reveal {
13
+ display: none;
14
+ }
15
+ `,xt=({onSubmit:o,schema:s})=>{const[n,i]=(0,e.useState)(!1),[l,h]=(0,e.useState)(!1),{formatMessage:f}=(0,Oe.Z)();return e.createElement(me.ZP,null,e.createElement(Qe.o,null,e.createElement(me.bU,null,e.createElement(wt.J9,{enableReinitialize:!0,initialValues:{password:"",confirmPassword:""},onSubmit:o,validationSchema:s,validateOnChange:!1},({values:P,errors:k,handleChange:w})=>e.createElement(r.l0,{noValidate:!0},e.createElement(me.sg,null,e.createElement(Je.Z,null),e.createElement(ye.x,{paddingTop:6,paddingBottom:7},e.createElement(Te.Z,{as:"h1",variant:"alpha"},f({id:"global.reset-password",defaultMessage:"Reset password"}))),k.errorMessage&&e.createElement(Te.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},f({id:k.errorMessage,defaultMessage:"An error occurred"}))),e.createElement(Ae.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(Yt,{name:"password",onChange:w,value:P.password,error:k.password?f({id:k.password,defaultMessage:"This field is required."}):void 0,endAction:e.createElement(dt.Z,{onClick:X=>{X.preventDefault(),i(C=>!C)},label:f(n?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},n?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),hint:f({id:"Auth.form.password.hint",defaultMessage:"Password must contain at least 8 characters, 1 uppercase, 1 lowercase and 1 number"}),required:!0,label:f({id:"global.password",defaultMessage:"Password"}),type:n?"text":"password"}),e.createElement(Yt,{name:"confirmPassword",onChange:w,value:P.confirmPassword,error:k.confirmPassword?f({id:k.confirmPassword,defaultMessage:"This value is required."}):void 0,endAction:e.createElement(dt.Z,{onClick:X=>{X.preventDefault(),h(C=>!C)},label:f(n?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},l?e.createElement(ut.Z,null):e.createElement(ct.Z,null)),required:!0,label:f({id:"Auth.form.confirmPassword.label",defaultMessage:"Confirm Password"}),type:l?"text":"password"}),e.createElement(lt.z,{fullwidth:!0,type:"submit"},f({id:"global.change-password",defaultMessage:"Change password"})))))),e.createElement(Ae.k,{justifyContent:"center"},e.createElement(ye.x,{paddingTop:4},e.createElement(r.rU,{to:"/auth/login"},f({id:"Auth.link.ready",defaultMessage:"Ready to sign in?"}))))))};xt.defaultProps={onSubmit:o=>o.preventDefault()},xt.propTypes={onSubmit:a().func,schema:a().shape({type:a().string.isRequired}).isRequired};var cs=xt;const ds=(()=>window&&window.strapi&&window.strapi.isEE?t(98768).Z:t(5365).Z)(),Qt={"forgot-password":{Component:os,endPoint:"forgot-password",fieldsToDisable:[],fieldsToOmit:[],schema:z.Ry().shape({email:z.Z_().email(r.I0.email).required(r.I0.required)}),inputsPrefix:""},"forgot-password-success":{Component:rs,endPoint:"",fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},login:{Component:ds,endPoint:"login",fieldsToDisable:[],fieldsToOmit:["rememberMe"],schema:z.Ry().shape({email:z.Z_().email(r.I0.email).required(r.I0.required),password:z.Z_().required(r.I0.required),rememberMe:z.Xg().nullable()}),inputsPrefix:""},oops:{Component:is,endPoint:null,fieldsToDisable:[],fieldsToOmit:[],schema:null,inputsPrefix:""},register:{Component:Vt,endPoint:"register",fieldsToDisable:["email"],fieldsToOmit:["userInfo.confirmPassword","userInfo.news","userInfo.email"],schema:z.Ry().shape({firstname:z.Z_().trim().required(r.I0.required),lastname:z.Z_(),password:z.Z_().min(8,r.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(r.I0.required),confirmPassword:z.Z_().oneOf([z.iH("password"),null],"components.Input.error.password.noMatch").required(r.I0.required),registrationToken:z.Z_().required(r.I0.required)}),inputsPrefix:"userInfo."},"register-admin":{Component:Vt,endPoint:"register-admin",noSignin:!0,fieldsToDisable:[],fieldsToOmit:["confirmPassword","news"],schema:z.Ry().shape({firstname:z.Z_().trim().required(r.I0.required),lastname:z.Z_(),password:z.Z_().min(8,r.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(r.I0.required),email:z.Z_().email(r.I0.email).strict().lowercase(r.I0.lowercase).required(r.I0.required),confirmPassword:z.Z_().oneOf([z.iH("password"),null],"components.Input.error.password.noMatch").required(r.I0.required)}),inputsPrefix:""},"reset-password":{Component:cs,endPoint:"reset-password",fieldsToDisable:[],fieldsToOmit:["confirmPassword"],schema:z.Ry().shape({password:z.Z_().min(8,r.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number").required(r.I0.required),confirmPassword:z.Z_().oneOf([z.iH("password"),null],"components.Input.error.password.noMatch").required(r.I0.required)})}};var ms=o=>o;const Jt={formErrors:{},modifiedData:{},requestError:null},gs=(o,s)=>(0,I.ZP)(o,n=>{switch(s.type){case"ON_CHANGE":{je()(n.modifiedData,s.keys.split("."),s.value);break}case"RESET_PROPS":return Jt;case"SET_DATA":{n.modifiedData=s.data;break}case"SET_ERRORS":{n.formErrors=s.errors;break}case"SET_REQUEST_ERROR":{n.requestError={errorMessage:s.errorMessage,errorStatus:s.errorStatus};break}default:return n}}),Wt=({hasAdmin:o,setHasAdmin:s})=>{const{push:n,location:{search:i}}=(0,fe.k6)(),{changeLocale:l}=(0,ns.Z)(),{setSkipped:h}=(0,r.c1)(),{trackUsage:f}=(0,r.rS)(),{params:{authType:P}}=(0,fe.$B)("/auth/:authType"),k=(0,r.aM)(),w=(0,Pe.c)(Qt,async()=>(await t.e(1386).then(t.bind(t,91386))).FORMS,{combine(Y,oe){return{...Y,...oe}},defaultValue:Qt}),[{formErrors:X,modifiedData:C,requestError:re},_]=(0,e.useReducer)(gs,Jt,ms),te=ce.default.CancelToken.source(),{Component:K,endPoint:Ge,fieldsToDisable:ze,fieldsToOmit:ae,inputsPrefix:ie,schema:Ce,...Ee}=w?.[P]??{};(0,e.useEffect)(()=>()=>{te.cancel("Component unmounted")},[]);const{post:Z}=(0,r.kY)();(0,e.useEffect)(()=>{_({type:"RESET_PROPS"})},[P]);const q=({target:{name:Y,value:oe}})=>{_({type:"ON_CHANGE",keys:Y,value:oe})},le=async(Y,{setSubmitting:oe,setErrors:Me})=>{oe(!0);const be=it()(Y,ae),Q=`/admin/${Ge}`;P==="login"&&await Is(Y,Q,{setSubmitting:oe,setErrors:Me}),(P==="register"||P==="register-admin")&&await Os(Y,Q,{setSubmitting:oe,setErrors:Me}),P==="forgot-password"&&await Le(be,Q,{setSubmitting:oe,setErrors:Me}),P==="reset-password"&&await bs(be,Q,{setSubmitting:oe,setErrors:Me})},Le=async(Y,oe,{setSubmitting:Me,setErrors:be})=>{try{await Z(oe,Y,{cancelToken:te.token}),n("/auth/forgot-password-success")}catch(Q){console.error(Q),be({errorMessage:"notification.error"})}finally{Me(!1)}},Is=async(Y,oe,{setSubmitting:Me,setErrors:be})=>{try{const{data:{data:{token:Q,user:ge}}}=await Z(oe,it()(Y,ae),{cancelToken:te.token});ge.preferedLanguage&&l(ge.preferedLanguage),r.I8.setToken(Q,Y.rememberMe),r.I8.setUserInfo(ge,Y.rememberMe),_t()}catch(Q){if(Q.response){const ge=De()(Q,["response","data","error","message"],"Something went wrong");if(He()(ge).toLowerCase()==="usernotactive"){n("/auth/oops"),_({type:"RESET_PROPS"});return}be({errorMessage:ge})}}finally{Me(!1)}},Os=async(Y,oe,{setSubmitting:Me,setErrors:be})=>{try{f("willCreateFirstAdmin");const{data:{data:{token:Q,user:ge}}}=await Z(oe,it()(Y,ae),{cancelToken:te.token});r.I8.setToken(Q,!1),r.I8.setUserInfo(ge,!1),Me(!1),s(!0);const{roles:Xe}=ge;if(Xe&&Xe.find(({code:Us})=>Us==="strapi-super-admin")&&(Ie.setSkipped(!1),h(!1),f("didLaunchGuidedtour")),P==="register"&&Y.userInfo.news===!0||P==="register-admin"&&Y.news===!0){n({pathname:"/usecase",search:`?hasAdmin=${o}`});return}_t()}catch(Q){if(f("didNotCreateFirstAdmin"),Q.response){const{data:ge}=Q.response,Xe=(0,as.Z)(ge);be({apiErrors:Xe})}}},bs=async(Y,oe,{setErrors:Me,setSubmitting:be})=>{try{const{data:{data:{token:Q,user:ge}}}=await Z(oe,{...Y,resetPasswordToken:k.get("code")},{cancelToken:te.token});r.I8.setToken(Q,!1),r.I8.setUserInfo(ge,!1),n("/")}catch(Q){if(Q.response){const ge=De()(Q,["response","data","message"],"Something went wrong"),Xe=De()(Q,["response","data","statusCode"],400);_({type:"SET_REQUEST_ERROR",errorMessage:ge,errorStatus:Xe}),Me({errorMessage:ge})}}finally{be(!1)}},_t=()=>{if(P==="login"){const Y=k.get("redirectTo"),oe=Y?decodeURIComponent(Y):"/";n(oe)}else n("/")};return!w[P]||o&&P==="register-admin"||r.I8.getToken()?e.createElement(fe.l_,{to:"/"}):!o&&P!=="register-admin"?e.createElement(fe.l_,{to:{pathname:"/auth/register-admin",search:i}}):e.createElement(K,{...Ee,authType:P,fieldsToDisable:ze,formErrors:X,inputsPrefix:ie,modifiedData:C,onChange:q,onSubmit:le,requestError:re,schema:Ce})};Wt.defaultProps={hasAdmin:!1},Wt.propTypes={hasAdmin:a().bool,setHasAdmin:a().func.isRequired};var ps=Wt,fs=t(53951),hs=t(68465),Es=t(84967),Ps=t(7563),vs=t(33348);const ys=[{intlLabel:{id:"Usecase.front-end",defaultMessage:"Front-end developer"},value:"front_end_developer"},{intlLabel:{id:"Usecase.back-end",defaultMessage:"Back-end developer"},value:"back_end_developer"},{intlLabel:{id:"Usecase.full-stack",defaultMessage:"Full-stack developer"},value:"full_stack_developer"},{intlLabel:{id:"global.content-manager",defaultMessage:"Content Manager"},value:"content_manager"},{intlLabel:{id:"Usecase.content-creator",defaultMessage:"Content Creator"},value:"content_creator"},{intlLabel:{id:"Usecase.other",defaultMessage:"Other"},value:"other"}],Ts=(0,xe.ZP)(Te.Z)`
16
+ text-align: center;
17
+ `;var Rs=()=>{const o=(0,r.lm)(),{push:s,location:n}=(0,fe.k6)(),{formatMessage:i}=(0,Oe.Z)(),[l,h]=(0,e.useState)(),[f,P]=(0,e.useState)(""),{post:k}=(0,r.kY)(),{firstname:w,email:X}=r.I8.getUserInfo(),{hasAdmin:C}=(0,vs.parse)(n?.search,{ignoreQueryPrefix:!0}),re=l==="other",_=async(de,te)=>{de.preventDefault();try{await k("https://analytics.strapi.io/register",{email:X,username:w,firstAdmin:Boolean(!C),persona:{role:te?void 0:l,otherRole:te?void 0:f}}),o({type:"success",message:{id:"Usecase.notification.success.project-created",defaultMessage:"Project has been successfully created"}}),s("/")}catch{}};return e.createElement(me.ZP,null,e.createElement(Qe.o,{labelledBy:"usecase-title"},e.createElement(me.bU,null,e.createElement("form",{onSubmit:de=>_(de,!1)},e.createElement(Ae.k,{direction:"column",paddingBottom:7},e.createElement(Je.Z,null),e.createElement(ye.x,{paddingTop:6,paddingBottom:1,width:(0,r.Q1)(250)},e.createElement(Ts,{variant:"alpha",as:"h1",id:"usecase-title"},i({id:"Usecase.title",defaultMessage:"Tell us a bit more about yourself"})))),e.createElement(Ae.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(hs.P,{id:"usecase","data-testid":"usecase",label:i({id:"Usecase.input.work-type",defaultMessage:"What type of work do you do?"}),onChange:h,value:l},ys.map(({intlLabel:de,value:te})=>e.createElement(Es.W,{key:te,value:te},i(de)))),re&&e.createElement(Fe.o,{name:"other",label:i({id:"Usecase.other",defaultMessage:"Other"}),value:f,onChange:de=>P(de.target.value),"data-testid":"other"}),e.createElement(lt.z,{type:"submit",size:"L",fullWidth:!0,disabled:!l},i({id:"global.finish",defaultMessage:"Finish"}))))),e.createElement(Ae.k,{justifyContent:"center"},e.createElement(ye.x,{paddingTop:4},e.createElement(Ps.A,{onClick:()=>_(!0)},i({id:"Usecase.button.skip",defaultMessage:"Skip this question"}))))))},Xt=t(26648);const As=(0,e.lazy)(()=>Promise.all([t.e(6691),t.e(801)]).then(t.bind(t,29761)));function Cs(){const o=(0,Pe.c)(Ke,async()=>(await t.e(7394).then(t.bind(t,17394))).ADMIN_PERMISSIONS_EE,{combine(ae,ie){return L()({},ae,ie)},defaultValue:Ke}),s=(0,Pe.c)(Xt.y3,async()=>(await t.e(3528).then(t.bind(t,53528))).ROUTES_EE,{defaultValue:[]}),n=(0,r.lm)(),{updateProjectSettings:i}=(0,Dt.um)(),{formatMessage:l}=(0,Oe.Z)(),[{isLoading:h,hasAdmin:f,uuid:P,deviceId:k},w]=(0,e.useState)({isLoading:!0,hasAdmin:!1}),X=(0,se.I0)(),C=(0,r.L7)(),{get:re,post:_}=(0,r.kY)(),de=(0,e.useMemo)(()=>(0,ue.WW)(s.map(({to:ae,Component:ie,exact:Ce})=>(0,ue.ot)(ie,ae,Ce))),[s]),[te,K]=(0,e.useState)(null);(0,e.useEffect)(()=>{X({type:Xt.XS,payload:o})},[o,X]),(0,e.useEffect)(()=>{const ae=r.I8.getToken();ae&&(async()=>{try{const{data:{data:{token:Ce}}}=await _("/admin/renew-token",{token:ae});r.I8.updateToken(Ce)}catch{r.I8.clearAppStorage(),window.location.reload()}})()},[_]),(0,e.useEffect)(()=>{(async()=>{try{const{data:{data:{hasAdmin:ie,uuid:Ce,menuLogo:Ee,authLogo:Z}}}=await re("/admin/init");if(i({menuLogo:(0,r.CR)(Ee),authLogo:(0,r.CR)(Z)}),Ce){const{data:{data:q}}=await re("/admin/telemetry-properties",{validateStatus:le=>le<500});K(q);try{const le="didInitializeAdministration";await _("https://analytics.strapi.io/api/v2/track",{event:le,userId:"",deviceId:k,eventPropeties:{},userProperties:{environment:C.currentEnvironment},groupProperties:{...q,projectId:Ce}},{headers:{"X-Strapi-Event":le}})}catch{}}w({isLoading:!1,hasAdmin:ie,uuid:Ce,deviceId:k})}catch{n({type:"warning",message:{id:"app.containers.App.notification.error.init"}})}})()},[n,i]);const Ge=ae=>w(ie=>({...ie,hasAdmin:ae})),ze=(0,e.useMemo)(()=>({uuid:P,telemetryProperties:te,deviceId:k}),[P,te,k]);return h?e.createElement(r.dO,null):e.createElement(e.Suspense,{fallback:e.createElement(r.dO,null)},e.createElement(We.z,null,l({id:"skipToContent"})),e.createElement(r.L8,{value:ze},e.createElement(fe.rs,null,de,e.createElement(fe.AW,{path:"/auth/:authType",render:ae=>e.createElement(ps,{...ae,setHasAdmin:Ge,hasAdmin:f}),exact:!0}),e.createElement(we,{path:"/usecase",component:Rs}),e.createElement(we,{path:"/",component:As}),e.createElement(fe.AW,{path:"",component:fs.default}))))}var Ms=Cs,Ls={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",de:"Deutsch",dk:"Dansk",en:"English",es:"Espa\xF1ol",eu:"Euskara",fr:"Fran\xE7ais",gu:"Gujarati",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",hu:"Magyar",id:"Indonesian",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4",ml:"Malayalam",ms:"Melayu",nl:"Nederlands",no:"Norwegian",pl:"Polski","pt-BR":"Portugu\xEAs (Brasil)",pt:"Portugu\xEAs (Portugal)",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",sk:"Sloven\u010Dina",sv:"Swedish",th:"\u0E44\u0E17\u0E22",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",vi:"Ti\u1EBFng Vi\u1EC7t","zh-Hans":"\u4E2D\u6587 (\u7B80\u4F53)",zh:"\u4E2D\u6587 (\u7E41\u9AD4)",sa:"\u0938\u0902\u0938\u094D\u0915\u0943\u0924",hi:"\u0939\u093F\u0928\u094D\u0926\u0940"};class Ss{constructor({adminConfig:s,appPlugins:n,library:i,middlewares:l,reducers:h}){this.customConfigurations=s.config,this.customBootstrapConfiguration=s.bootstrap,this.configurations={authLogo:R,head:{favicon:ke},locales:["en"],menuLogo:R,notifications:{releases:!0},themes:{light:p.W,dark:y.$},translations:{},tutorials:!0},this.appPlugins=n||{},this.library=i,this.middlewares=l,this.plugins={},this.reducers=h,this.translations={},this.hooksDict={},this.admin={injectionZones:Ye},this.customFields=U.rh,this.menu=[],this.settings={global:{id:"global",intlLabel:{id:"Settings.global",defaultMessage:"Global Settings"},links:[]}}}addComponents=s=>{Array.isArray(s)?s.map(n=>this.library.components.add(n)):this.library.components.add(s)};addCorePluginMenuLink=s=>{const n=JSON.stringify(s);c()(s.to,`link.to should be defined for ${n}`),c()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),c()(["/plugins/content-type-builder","/plugins/upload"].includes(s.to),"This method is not available for your plugin"),c()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),this.menu.push(s)};addFields=s=>{Array.isArray(s)?s.map(n=>this.library.fields.add(n)):this.library.fields.add(s)};addMenuLink=s=>{const n=JSON.stringify(s);c()(s.to,`link.to should be defined for ${n}`),c()(typeof s.to=="string",`Expected link.to to be a string instead received ${typeof s.to}`),c()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${n}`),c()(s.Component&&typeof s.Component=="function","link.Component should be a valid React Component"),c()(s.icon&&typeof s.icon=="function","link.Icon should be a valid React Component"),this.menu.push(s)};addMiddlewares=s=>{s.forEach(n=>{this.middlewares.add(n)})};addReducers=s=>{Object.keys(s).forEach(n=>{this.reducers.add(n,s[n])})};addSettingsLink=(s,n)=>{c()(this.settings[s],"The section does not exist");const i=JSON.stringify(n);c()(n.id,`link.id should be defined for ${i}`),c()(n.intlLabel?.id&&n.intlLabel?.defaultMessage,`link.intlLabel.id & link.intlLabel.defaultMessage for ${i}`),c()(n.to,`link.to should be defined for ${i}`),c()(n.Component&&typeof n.Component=="function","link.Component should be a valid React Component"),this.settings[s].links.push(n)};addSettingsLinks=(s,n)=>{c()(this.settings[s],"The section does not exist"),c()(Array.isArray(n),"TypeError expected links to be an array"),n.forEach(i=>{this.addSettingsLink(s,i)})};async bootstrap(){Object.keys(this.appPlugins).forEach(s=>{const n=this.appPlugins[s].bootstrap;n&&n({addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}),A()(this.customBootstrapConfiguration)&&this.customBootstrapConfiguration({addComponents:this.addComponents,addFields:this.addFields,addMenuLink:this.addMenuLink,addReducers:this.addReducers,addSettingsLink:this.addSettingsLink,addSettingsLinks:this.addSettingsLinks,getPlugin:this.getPlugin,injectContentManagerComponent:this.injectContentManagerComponent,injectAdminComponent:this.injectAdminComponent,registerHook:this.registerHook})}bootstrapAdmin=async()=>(await this.createCustomConfigurations(),this.createHook(J.No),this.createHook(J.LK),this.createHook(J.dV),this.createHook(J.Eo),Promise.resolve());createCustomConfigurations=async()=>{if(this.customConfigurations?.locales&&(this.configurations.locales=["en",...this.customConfigurations.locales?.filter(s=>s!=="en")||[]]),this.customConfigurations?.auth?.logo&&(this.configurations.authLogo=this.customConfigurations.auth.logo),this.customConfigurations?.menu?.logo&&(this.configurations.menuLogo=this.customConfigurations.menu.logo),this.customConfigurations?.head?.favicon&&(this.configurations.head.favicon=this.customConfigurations.head.favicon),this.customConfigurations?.theme){const s=this.customConfigurations.theme.dark,n=this.customConfigurations.theme.light;!s&&!n&&(console.warn("[deprecated] In future versions, Strapi will stop supporting this theme customization syntax. The theme configuration accepts a light and a dark key to customize each theme separately. See https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#theme-extension."),L()(this.configurations.themes.light,this.customConfigurations.theme)),n&&L()(this.configurations.themes.light,n),s&&L()(this.configurations.themes.dark,s)}this.customConfigurations?.notifications?.releases!==void 0&&(this.configurations.notifications.releases=this.customConfigurations.notifications.releases),this.customConfigurations?.tutorials!==void 0&&(this.configurations.tutorials=this.customConfigurations.tutorials)};createHook=s=>{this.hooksDict[s]=V()};createSettingSection=(s,n)=>{c()(s.id,"section.id should be defined"),c()(s.intlLabel?.id&&s.intlLabel?.defaultMessage,"section.intlLabel should be defined"),c()(Array.isArray(n),"TypeError expected links to be an array"),c()(this.settings[s.id]===void 0,"A similar section already exists"),this.settings[s.id]={...s,links:[]},n.forEach(i=>{this.addSettingsLink(s.id,i)})};createStore=()=>H(this.middlewares.middlewares,this.reducers.reducers);getAdminInjectedComponents=(s,n,i)=>{try{return this.admin.injectionZones[s][n][i]||[]}catch(l){return console.error("Cannot get injected component",l),l}};getPlugin=s=>this.plugins[s];async initialize(){Object.keys(this.appPlugins).forEach(s=>{this.appPlugins[s].register(this)})}injectContentManagerComponent=(s,n,i)=>{c()(this.admin.injectionZones.contentManager[s]?.[n],`The ${s} ${n} zone is not defined in the content manager`),c()(i,"A Component must be provided"),this.admin.injectionZones.contentManager[s][n].push(i)};injectAdminComponent=(s,n,i)=>{c()(this.admin.injectionZones.admin[s]?.[n],`The ${s} ${n} zone is not defined in the admin`),c()(i,"A Component must be provided"),this.admin.injectionZones.admin[s][n].push(i)};async loadAdminTrads(){const s=this.configurations.locales.map(l=>t(48224)(`./${l}.json`).then(({default:h})=>({data:h,locale:l})).catch(()=>({data:null,locale:l})));return(await Promise.all(s)).reduce((l,h)=>(h.data&&(l[h.locale]=h.data),l),{})}async loadTrads(){const s=await this.loadAdminTrads(),n=Object.keys(this.appPlugins).map(f=>{const P=this.appPlugins[f].registerTrads;return P?P({locales:this.configurations.locales}):null}).filter(f=>f),l=(await Promise.all(n)).reduce((f,P)=>{const k=P.reduce((w,X)=>(w[X.locale]=X.data,w),{});return Object.keys(k).forEach(w=>{f[w]={...f[w],...k[w]}}),f},{}),h=this.configurations.locales.reduce((f,P)=>(f[P]={...s[P],...l[P]||{},...this.customConfigurations?.translations?.[P]},f),{});return this.configurations.translations=h,Promise.resolve()}registerHook=(s,n)=>{c()(this.hooksDict[s],`The hook ${s} is not defined. You are trying to register a hook that does not exist in the application.`),this.hooksDict[s].register(n)};registerPlugin=s=>{const n=(0,U.Sy)(s);this.plugins[n.pluginId]=n};runHookSeries=(s,n=!1)=>n?this.hooksDict[s].runSeriesAsync():this.hooksDict[s].runSeries();runHookWaterfall=(s,n,i=!1,l)=>i?this.hooksDict[s].runWaterfallAsync(n,l):this.hooksDict[s].runWaterfall(n,l);runHookParallel=s=>this.hooksDict[s].runParallel();render(){const s=this.createStore(),n=O()(Ls,this.configurations.locales||[]),{components:{components:i},fields:{fields:l}}=this.library;return e.createElement(u,{authLogo:this.configurations.authLogo,components:i,fields:l,customFields:this.customFields,localeNames:n,getAdminInjectedComponents:this.getAdminInjectedComponents,getPlugin:this.getPlugin,messages:this.configurations.translations,menu:this.menu,menuLogo:this.configurations.menuLogo,plugins:this.plugins,runHookParallel:this.runHookParallel,runHookWaterfall:(h,f,P=!1)=>this.runHookWaterfall(h,f,P,s),runHookSeries:this.runHookSeries,themes:this.configurations.themes,settings:this.settings,showTutorials:this.configurations.tutorials,showReleaseNotification:this.configurations.notifications.releases,store:s},e.createElement(e.Fragment,null,e.createElement(b.q,{link:[{rel:"icon",type:"image/png",href:this.configurations.head.favicon}],htmlAttributes:{lang:localStorage.getItem(T)||"en"}}),e.createElement(S.VK,{basename:ee.Z},e.createElement(Ms,{store:s}))))}}var Ds=({adminConfig:o={},appPlugins:s,library:n,middlewares:i,reducers:l})=>new Ss({adminConfig:o,appPlugins:s,library:n,middlewares:i,reducers:l})},5985:function(B,v,t){"use strict";var e=t(32735);const p=(0,e.createContext)();v.Z=p},20139:function(B,v,t){"use strict";var e=t(32735),p=t(5985);const y=()=>{const{changeLocale:E,localeNames:c,messages:m}=(0,e.useContext)(p.Z);return{changeLocale:E,localeNames:c,messages:m}};v.Z=y},10190:function(B,v,t){"use strict";var e=t(32735),p=t(8471),y=t(10328);const E=p.ZP.img`
18
+ height: ${72/16}rem;
19
+ `,c=()=>{const{logos:{auth:m}}=(0,y.um)();return e.createElement(E,{src:m?.custom??m.default,"aria-hidden":!0,alt:""})};v.Z=c},66694:function(B,v,t){"use strict";t.d(v,{ux:function(){return y},_5:function(){return c},$l:function(){return A},Rj:function(){return L}});var e=t(32735),y=(0,e.createContext)({}),c=(0,e.createContext)({}),A=(0,e.createContext)({}),L=(0,e.createContext)({})},78246:function(B,v){"use strict";const t="/admin/".replace(window.location.origin,"");v.Z=t},46339:function(B,v,t){"use strict";t.d(v,{Eo:function(){return y},LK:function(){return p},No:function(){return e},dV:function(){return E}});const e="Admin/CM/pages/ListView/inject-column-in-table",p="Admin/CM/pages/App/mutate-collection-types-links",y="Admin/CM/pages/EditView/mutate-edit-view-layout",E="Admin/CM/pages/App/mutate-single-types-links"},10328:function(B,v,t){"use strict";t.d(v,{um:function(){return E},U_:function(){return b},Dq:function(){return r},H9:function(){return je},$_:function(){return Ve},rW:function(){return et},bF:function(){return ht},G4:function(){return Lt},Te:function(){return Ut},M1:function(){return jt}});var e=t(32735),p=t(66694),E=()=>(0,e.useContext)(p._5),c=t(70166),m=t(19565),A=t(97889);const M={data:{},error:null,isLoading:!0};var x=(g,d)=>(0,A.ZP)(g,u=>{switch(d.type){case"GET_DATA":{u.isLoading=!0,u.data={},u.error=null;break}case"GET_DATA_SUCCEEDED":{u.data=d.data,u.isLoading=!1,u.error=null;break}case"GET_DATA_ERROR":{u.isLoading=!1,u.error=d.error;break}default:return u}}),b=g=>{const[{data:d,error:u,isLoading:U},j]=(0,e.useReducer)(x,M),{get:N}=(0,m.kY)();return(0,e.useEffect)(()=>{(async()=>{try{j({type:"GET_DATA"});const{data:{data:H}}=await N("/admin/permissions",{params:{role:g}});j({type:"GET_DATA_SUCCEEDED",data:H})}catch{}})()},[g,N]),{data:d,error:u,isLoading:U}};const S={role:{},permissions:{},isLoading:!0};var W=(g,d)=>(0,A.ZP)(g,u=>{switch(d.type){case"GET_DATA_SUCCEEDED":{u.role=d.role,u.permissions=d.permissions,u.isLoading=!1;break}case"GET_DATA_ERROR":{u.isLoading=!1;break}case"ON_SUBMIT_SUCCEEDED":{u.role.name=d.name,u.role.description=d.description;break}default:return u}}),r=g=>{const d=(0,m.lm)(),[u,U]=(0,e.useReducer)(W,S),{get:j}=(0,m.kY)();(0,e.useEffect)(()=>{g?(async H=>{try{const[{data:{data:ee}},{data:{data:ve}}]=await Promise.all([`roles/${H}`,`roles/${H}/permissions`].map(V=>j(`/admin/${V}`)));U({type:"GET_DATA_SUCCEEDED",role:ee,permissions:ve})}catch(ee){console.error(ee),U({type:"GET_DATA_ERROR"}),d({type:"warning",message:{id:"notification.error"}})}})(g):U({type:"GET_DATA_SUCCEEDED",role:{},permissions:[]})},[j,g,d]);const N=(0,e.useCallback)($=>{U({type:"ON_SUBMIT_SUCCEEDED",...$})},[]);return{...u,onSubmitSucceeded:N}},F=t(2287),a=t(36919),G=t(45112),se=t(15062),D=t(78125),I=t(99381),ne=t.n(I),Re=(g,d)=>d.map(({permissions:u})=>(0,m.qX)(g,u)),Ze=async(g,d,u)=>{const U=Re(g,d),j=await Promise.all(U),N=d.filter((ee,ve)=>j[ve]),$=N.findIndex(ee=>ee.to==="/settings");if($===-1)return[];const H=ne()(N);return H[$].notificationsCount=u?1:0,H},De=async(g,d)=>{const u=Re(g,d),U=await Promise.all(u);return d.filter((N,$)=>U[$])},je=()=>{const{allPermissions:g}=(0,m.vn)(),{shouldUpdateStrapi:d}=(0,m.L7)(),{menu:u}=(0,m.j1)(),U=(0,se.v9)(D._),[j,N]=e.useState({generalSectionLinks:[{icon:F.Z,intlLabel:{id:"global.plugins",defaultMessage:"Plugins"},to:"/list-plugins",permissions:U.marketplace.main},{icon:a.Z,intlLabel:{id:"global.marketplace",defaultMessage:"Marketplace"},to:"/marketplace",permissions:U.marketplace.main},{icon:G.Z,intlLabel:{id:"global.settings",defaultMessage:"Settings"},to:"/settings",permissions:[],notificationsCount:0}],pluginsSectionLinks:[],isLoading:!0}),$=e.useRef(j.generalSectionLinks);return e.useEffect(()=>{async function H(){const ee=await De(g,u),ve=await Ze(g,$.current,d);N(V=>({...V,generalSectionLinks:ve,pluginsSectionLinks:ee,isLoading:!1}))}H()},[N,$,g,u,U,d]),j},Ve=()=>(0,e.useContext)(p.$l),et=(g,d,u,U)=>{const[j,N]=(0,e.useState)(!1),$=(0,m.lm)(),{post:H}=(0,m.kY)(),{formatAPIError:ee}=(0,m.So)();return{regenerateData:async()=>{try{const{data:{data:{accessKey:V}}}=await H(`${g}${d}/regenerate`);N(!1),u(V)}catch(V){N(!1),U?U(V):$({type:"warning",message:ee(V)})}},isLoadingConfirmation:j}};const _e=!JSON.parse(localStorage.getItem("STRAPI_UPDATE_NOTIF")),qt=()=>{const{latestStrapiReleaseTag:g,shouldUpdateStrapi:d}=useAppInfo(),u=useNotification();return useEffect(()=>{d&&_e&&u({type:"info",message:{id:"notification.version.update.message"},link:{url:`https://github.com/strapi/strapi/releases/tag/${g}`,label:{id:"global.see-more"}},blockTransition:!0,onClose:()=>localStorage.setItem("STRAPI_UPDATE_NOTIF",!0)})},[g,d,u]),null};var Ie=null,Nt=t(33795),gt=t.n(Nt),Kt=(g,d)=>({...g,isLoading:d});const tt={roles:[],isLoading:!0};var ft=(g,d)=>(0,A.ZP)(g,u=>{switch(d.type){case"GET_DATA":{u.isLoading=!0,u.roles=[];break}case"GET_DATA_SUCCEEDED":{u.roles=d.data,u.isLoading=!1;break}case"GET_DATA_ERROR":{u.isLoading=!1;break}default:return u}}),ht=(g=!0)=>{const d=(0,m.lm)(),[{roles:u,isLoading:U},j]=(0,e.useReducer)(ft,tt,()=>Kt(tt,g));(0,e.useEffect)(()=>{g&&N()},[g]);const N=(0,e.useCallback)(async()=>{const $=(0,m.tg)();try{j({type:"GET_DATA"});const{data:{data:H}}=await $.get("/admin/roles");j({type:"GET_DATA_SUCCEEDED",data:H})}catch(H){const ee=gt()(H,["response","payload","message"],"An error occured");j({type:"GET_DATA_ERROR"}),ee!=="Forbidden"&&d({type:"warning",message:ee})}},[d]);return{roles:u,isLoading:U,getData:N}},st=t(9086),Et=t.n(st),nt=t(8997),Pt=(g,d)=>({...g,fieldsToPick:d}),vt=t(88423),Be=t.n(vt),yt=t(3040),Tt=t.n(yt),Rt=t(56236),at=t.n(Rt);const At={fieldsToPick:[],formErrors:{},initialData:{},isLoading:!0,modifiedData:{},showHeaderButtonLoader:!1,showHeaderLoader:!0},Ct=(g,d)=>(0,A.ZP)(g,u=>{switch(d.type){case"GET_DATA_SUCCEEDED":{u.isLoading=!1,u.showHeaderLoader=!1,u.initialData=Be()(d.data,g.fieldsToPick),u.modifiedData=Be()(d.data,g.fieldsToPick);break}case"ON_CANCEL":{u.modifiedData=g.initialData,u.formErrors={};break}case"ON_CHANGE":{d.inputType==="password"&&!d.value?at()(u.modifiedData,d.keys.split(".")):d.keys.includes("username")&&!d.value?Tt()(u.modifiedData,d.keys.split("."),null):Tt()(u.modifiedData,d.keys.split("."),d.value);break}case"ON_SUBMIT":{u.showHeaderButtonLoader=!0;break}case"ON_SUBMIT_SUCCEEDED":{u.initialData=Be()(d.data,g.fieldsToPick),u.modifiedData=Be()(d.data,g.fieldsToPick),u.showHeaderButtonLoader=!1;break}case"SET_ERRORS":{u.formErrors=d.errors,u.showHeaderButtonLoader=!1;break}default:return u}});var Lt=(g,d,u,U)=>{const[{formErrors:j,initialData:N,isLoading:$,modifiedData:H,showHeaderButtonLoader:ee,showHeaderLoader:ve},V]=(0,e.useReducer)(Ct,At,()=>Pt(At,U)),J=(0,m.lm)(),{lockApp:ke,unlockApp:rt}=(0,m.o1)(),{get:Ye,put:We}=(0,m.kY)();return(0,e.useEffect)(()=>{g&&(async()=>{try{const{data:{data:ue}}=await Ye(g);V({type:"GET_DATA_SUCCEEDED",data:ue,fieldsToPick:U})}catch(ue){console.error(ue.response),J({type:"warning",message:{id:"notification.error"}})}})()},[g]),[{formErrors:j,initialData:N,isLoading:$,modifiedData:H,showHeaderButtonLoader:ee,showHeaderLoader:ve},V,{handleCancel:()=>{V({type:"ON_CANCEL"})},handleChange:({target:{name:Pe,value:ue,type:ce}})=>{V({type:"ON_CHANGE",inputType:ce,keys:Pe,value:ue})},handleSubmit:async Pe=>{Pe.preventDefault();const ue=await(0,nt.R6)(H,d);if(V({type:"SET_ERRORS",errors:ue||{}}),!ue)try{ke(),V({type:"ON_SUBMIT"});const ce=Et()(H,["confirmPassword","registrationToken"]);ce.roles&&(ce.roles=ce.roles.map(He=>He.id)),ce.ssoLockedRoles&&(ce.ssoLockedRoles=[...new Set(ce.ssoLockedRoles)]);const{data:{data:he}}=await We(g,ce);u(he),V({type:"ON_SUBMIT_SUCCEEDED",data:he}),J({type:"success",message:{id:"notification.success.saved"}})}catch(ce){const he=ce?.response?.payload??{data:{}};he?.data&&typeof he.data=="string"?J({type:"warning",message:he.data}):J({type:"warning",message:he.message});const He=(0,nt.Iz)(he);V({type:"SET_ERRORS",errors:He})}finally{rt()}},setField:(Pe,ue)=>{V({type:"ON_CHANGE",keys:Pe,value:ue})}}]},St=t(18782);const Oe={global:[{intlLabel:{id:"Settings.application.title",defaultMessage:"Overview"},to:"/settings/application-infos",id:"000-application-infos",permissions:[]},{intlLabel:{id:"Settings.webhooks.title",defaultMessage:"Webhooks"},to:"/settings/webhooks",id:"webhooks"},{intlLabel:{id:"Settings.apiTokens.title",defaultMessage:"API Tokens"},to:"/settings/api-tokens?sort=name:ASC",id:"api-tokens"},{intlLabel:{id:"Settings.transferTokens.title",defaultMessage:"Transfer Tokens"},to:"/settings/transfer-tokens?sort=name:ASC",id:"transfer-tokens"}],admin:[{intlLabel:{id:"global.roles",defaultMessage:"Roles"},to:"/settings/roles",id:"roles"},{intlLabel:{id:"global.users"},to:"/settings/users?pageSize=10&page=1&sort=firstname",id:"users"}]};var xe=g=>g.map(d=>{const u=d.links.map(U=>({...U,isDisplayed:!1}));return{...d,links:u}}),Ft=t(98978),It=t.n(Ft),bt=g=>It()(g,d=>d.id),Ut=()=>{const[{isLoading:g,menu:d},u]=(0,e.useState)({isLoading:!0,menu:[]}),{allPermissions:U}=(0,m.vn)(),{shouldUpdateStrapi:j}=(0,m.L7)(),{settings:N}=(0,m.j1)(),$=(0,se.v9)(D._),{global:H,admin:ee}=(0,St.c)(Oe,async()=>(await t.e(1970).then(t.bind(t,43278))).LINKS_EE,{combine(J,ke){return{admin:[...ke.admin,...J.admin],global:[...J.global,...ke.global]}},defaultValue:{admin:[],global:[]}}),ve=(0,e.useCallback)(J=>{if(!J.id)throw new Error("The settings menu item must have an id attribute.");return{...J,permissions:$.settings?.[J.id]?.main}},[$.settings]);(0,e.useEffect)(()=>{const J=async()=>{const fe=await(Ne=>Promise.all(Ne.reduce((we,Ke,Pe)=>{const ue=ce=>ce.map(async(he,He)=>({hasPermission:await(0,m.qX)(U,he.permissions),sectionIndex:Pe,linkIndex:He}));return[...we,...ue(Ke.links)]},[])))(Ye);u(Ne=>({...Ne,isLoading:!1,menu:Ye.map((we,Ke)=>({...we,links:we.links.map((Pe,ue)=>{const ce=fe.find(he=>he.sectionIndex===Ke&&he.linkIndex===ue);return{...Pe,isDisplayed:Boolean(ce.hasPermission)}})}))}))},{global:ke,...rt}=N,Ye=xe([{...N.global,links:bt([...N.global.links,...H.map(ve)]).map(We=>({...We,hasNotification:We.id==="000-application-infos"&&j}))},{id:"permissions",intlLabel:{id:"Settings.permissions",defaultMessage:"Administration Panel"},links:ee.map(ve)},...Object.values(rt)]);J()},[ee,H,U,N,j,ve]);const V=J=>({...J,links:J.links.filter(ke=>ke.isDisplayed)});return{isLoading:g,menu:d.map(V)}},jt=()=>(0,e.useContext)(p.Rj)},70166:function(B,v,t){"use strict";t.d(v,{G:function(){return y}});var e=t(19565),p=t(20108);function y(){const{get:E}=(0,e.kY)(),{formatAPIError:c}=(0,e.So)(),m=(0,e.lm)(),A=(0,p.useQueries)(["components","content-types"].map(S=>({queryKey:["content-manager",S],async queryFn(){const{data:{data:R}}=await E(`/content-manager/${S}`);return R},onError(R){m({type:"warning",message:c(R)})}}))),[M,L]=A,x=M.isLoading||L.isLoading,O=(L?.data??[]).filter(S=>S.kind==="collectionType"&&S.isDisplayed),b=(L?.data??[]).filter(S=>S.kind!=="collectionType"&&S.isDisplayed);return{isLoading:x,components:M?.data??[],collectionTypes:O,singleTypes:b}}},18782:function(B,v,t){"use strict";t.d(v,{c:function(){return E}});var e=t(32735),p=t(19565);function y(){return window.strapi.isEE}function E(c,m,{defaultValue:A=null,combine:M=(x,O)=>O,enabled:L=!0}={}){const x=(0,p.W6)(m),O=(0,p.W6)(M),[{data:b},S]=e.useState({data:y()&&L?A:c});return e.useEffect(()=>{async function R(){const W=await x();S({data:O(c,W)})}y()&&L&&R()},[c,x,O,L]),b}},954:function(B,v,t){"use strict";t.d(v,{sg:function(){return S},bU:function(){return R},ZP:function(){return T}});var e=t(32735),p=t(72850),y=t(87933),E=t(60216),c=t.n(E),m=t(8471),A=t(34853),M=t(67879),L=t(20139),O=()=>{const{changeLocale:r,localeNames:F}=(0,L.Z)(),{locale:a}=(0,M.Z)();return e.createElement(A.O,{label:F[a]},Object.keys(F).map(G=>e.createElement(A.s,{onClick:()=>r(G),key:G},F[G])))};const b=(0,m.ZP)(p.x)`
20
+ margin: 0 auto;
21
+ width: 552px;
22
+ `,S=(0,m.ZP)(y.k)`
23
+ flex-direction: column;
24
+ `,R=({children:r})=>e.createElement(b,{shadow:"tableShadow",hasRadius:!0,paddingTop:9,paddingBottom:9,paddingLeft:10,paddingRight:10,background:"neutral0",justifyContent:"center"},r);R.propTypes={children:c().node.isRequired};const W=({children:r})=>e.createElement("div",null,e.createElement(y.k,{as:"header",justifyContent:"flex-end"},e.createElement(p.x,{paddingTop:6,paddingRight:8},e.createElement(O,null))),e.createElement(p.x,{paddingTop:2,paddingBottom:11},r));W.propTypes={children:c().node.isRequired};var T=W},78125:function(B,v,t){"use strict";t.d(v,{_:function(){return E}});var e=t(98178),p=t(49358);const y=()=>c=>c.admin_app||p.E,E=(0,e.P1)(y(),c=>c.permissions)},72218:function(B,v,t){"use strict";var e=t(63642),p=t(8471);const y=(0,p.ZP)(e.E)`
25
+ svg {
26
+ height: 1rem;
27
+ width: 1rem;
28
+ path {
29
+ fill: ${({theme:E})=>E.colors.neutral600};
30
+ }
31
+ }
32
+ `;v.Z=y},1115:function(B,v,t){"use strict";var e=t(32735),p=t(10369),y=t(27649),E=t(72850),c=t(49372),m=t(87933),A=t(8284),M=t(41415),L=t(19565),x=t(54894),O=t(60492),b=t(92802),S=t(60216),R=t.n(S),W=t(67879),T=t(8471),r=t(10190),F=t(954),a=t(72218);const G=(0,T.ZP)(p.o)`
33
+ ::-ms-reveal {
34
+ display: none;
35
+ }
36
+ `,se=({onSubmit:D,schema:I,children:ne})=>{const[Se,Re]=(0,e.useState)(!1),{formatMessage:pe}=(0,W.Z)();return e.createElement(y.o,null,e.createElement(F.bU,null,e.createElement(b.J9,{enableReinitialize:!0,initialValues:{email:"",password:"",rememberMe:!1},onSubmit:D,validationSchema:I,validateOnChange:!1},({values:Ze,errors:Ue,handleChange:De})=>e.createElement(L.l0,{noValidate:!0},e.createElement(F.sg,null,e.createElement(r.Z,null),e.createElement(E.x,{paddingTop:6,paddingBottom:1},e.createElement(c.Z,{variant:"alpha",as:"h1"},pe({id:"Auth.form.welcome.title",defaultMessage:"Welcome!"}))),e.createElement(E.x,{paddingBottom:7},e.createElement(c.Z,{variant:"epsilon",textColor:"neutral600"},pe({id:"Auth.form.welcome.subtitle",defaultMessage:"Log in to your Strapi account"}))),Ue.errorMessage&&e.createElement(c.Z,{id:"global-form-error",role:"alert",tabIndex:-1,textColor:"danger600"},Ue.errorMessage)),e.createElement(m.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(p.o,{error:Ue.email?pe({id:Ue.email,defaultMessage:"This value is required."}):"",value:Ze.email,onChange:De,label:pe({id:"Auth.form.email.label",defaultMessage:"Email"}),placeholder:pe({id:"Auth.form.email.placeholder",defaultMessage:"kai@doe.com"}),name:"email",required:!0}),e.createElement(G,{error:Ue.password?pe({id:Ue.password,defaultMessage:"This value is required."}):"",onChange:De,value:Ze.password,label:pe({id:"global.password",defaultMessage:"Password"}),name:"password",type:Se?"text":"password",endAction:e.createElement(a.Z,{onClick:$e=>{$e.stopPropagation(),Re(je=>!je)},label:pe(Se?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},Se?e.createElement(x.Z,null):e.createElement(O.Z,null)),required:!0}),e.createElement(A.X,{onValueChange:$e=>{De({target:{value:$e,name:"rememberMe"}})},value:Ze.rememberMe,"aria-label":"rememberMe",name:"rememberMe"},pe({id:"Auth.form.rememberMe.label",defaultMessage:"Remember me"})),e.createElement(M.z,{fullWidth:!0,type:"submit"},pe({id:"Auth.form.button.login",defaultMessage:"Login"}))))),ne),e.createElement(m.k,{justifyContent:"center"},e.createElement(E.x,{paddingTop:4},e.createElement(L.rU,{to:"/auth/forgot-password"},pe({id:"Auth.link.forgot-password",defaultMessage:"Forgot your password?"})))))};se.defaultProps={children:null,onSubmit(){}},se.propTypes={children:R().node,onSubmit:R().func,schema:R().shape({type:R().string.isRequired}).isRequired},v.Z=se},5365:function(B,v,t){"use strict";var e=t(32735),p=t(60216),y=t.n(p),E=t(954),c=t(1115);const m=A=>e.createElement(E.ZP,null,e.createElement(c.Z,{...A}));m.defaultProps={onSubmit:A=>A.preventDefault()},m.propTypes={onSubmit:y().func},v.Z=m},53951:function(B,v,t){"use strict";t.r(v);var e=t(32735),p=t(27649),y=t(82055),E=t(17e3),c=t(9695),m=t(19565),A=t(8482),M=t(25386),L=t(67879);const x=()=>{const{formatMessage:O}=(0,L.Z)();return(0,m.go)(),e.createElement(p.o,{labelledBy:"title"},e.createElement(y.T,{id:"title",title:O({id:"content-manager.pageNotFound",defaultMessage:"Page not found"})}),e.createElement(E.D,null,e.createElement(c.x,{action:e.createElement(m.Qj,{variant:"secondary",endIcon:e.createElement(A.Z,null),to:"/"},O({id:"app.components.NotFoundPage.back",defaultMessage:"Back to homepage"})),content:O({id:"app.page.not.found",defaultMessage:"Oops! We can't seem to find the page you're looging for..."}),hasRadius:!0,icon:e.createElement(M.Z,{width:"10rem"}),shadow:"tableShadow"})))};v.default=x},41832:function(B,v){"use strict";const t=({data:e})=>{try{return Object.keys(e).reduce((p,y)=>{const E=e[y][0];return p[y]={id:E,defaultMessage:E},p},{})}catch{return{}}};v.Z=t},8997:function(B,v,t){"use strict";t.d(v,{R6:function(){return y},ot:function(){return x},Iz:function(){return O.Z},Pp:function(){return b},IF:function(){return R},Qy:function(){return se},WW:function(){return T}});var e=t(19565),y=async(D,I)=>{let ne=null;try{await I.validate(D,{abortEarly:!1})}catch(Se){ne=(0,e.CJ)(Se)}return ne},E=t(32735),c=t(60216),m=t.n(c),A=t(53038);const M=({loadComponent:D})=>{const[I,ne]=(0,E.useState)(null);return(0,E.useEffect)(()=>{(async()=>{try{const Re=await D();ne(()=>Re.default)}catch(Re){console.log(Re)}})()},[D]),I?E.createElement(I,null):E.createElement(e.dO,null)},L=(D,I,ne)=>E.createElement(A.AW,{render:()=>E.createElement(M,{loadComponent:D}),key:I,path:I,exact:ne||!1});M.propTypes={loadComponent:m().func.isRequired};var x=L,O=t(41832),b=(D,I="")=>[D,I].filter(ne=>ne).join(" "),R=D=>`/admin/${D}`,T=D=>D.filter((I,ne,Se)=>Se.findIndex(Re=>Re.key===I.key)===ne),r=t(98978);const F=D=>sortBy(D,I=>I.name);var a=null;const G={bufferToHex(D){return[...new Uint8Array(D)].map(I=>I.toString(16).padStart(2,"0")).join("")},async digestMessage(D){const I=new TextEncoder().encode(D),ne=await crypto.subtle.digest("SHA-256",I);return this.bufferToHex(ne)}};async function se(D){if(!D)return null;try{return await G.digestMessage(D.email)}catch{return null}}},58414:function(B,v,t){"use strict";t.d(v,{pl:function(){return L},q5:function(){return O.Z}});var e=t(32735),p=t(19565),y=t(8997),E=t(97889);const c={data:[],isLoading:!0};var A=(b,S)=>(0,E.ZP)(b,R=>{switch(S.type){case"GET_DATA_SUCCEEDED":{R.data=S.data,R.isLoading=!1;break}case"GET_DATA_ERROR":{R.isLoading=!1;break}default:return R}}),L=({ssoEnabled:b})=>{const[S,R]=(0,e.useReducer)(A,c),W=(0,p.lm)(),{get:T}=(0,p.kY)();return(0,e.useEffect)(()=>{(async()=>{try{if(!b){R({type:"GET_DATA_SUCCEEDED",data:[]});return}const{data:F}=await T((0,y.IF)("providers"));R({type:"GET_DATA_SUCCEEDED",data:F})}catch(F){console.error(F),R({type:"GET_DATA_ERROR"}),W({type:"warning",message:{id:"notification.error"}})}})()},[T,b,W]),S},x=t(21306),O=t(35153)},21306:function(B,v,t){"use strict";var e=t(32735),p=t(19565),y=t(36866),E=t.n(y),c=t(67879),m=t(53038),A=t(35153);const M="strapi-notification-seat-limit",L="https://cloud.strapi.io/profile/billing",x="https://strapi.io/billing/request-seats",O=()=>{const{formatMessage:b}=(0,c.Z)();let{license:S,isError:R,isLoading:W}=(0,A.Z)();const T=(0,p.lm)(),{pathname:r}=(0,m.TH)(),{enforcementUserCount:F,permittedSeats:a,licenseLimitStatus:G,isHostedOnStrapiCloud:se}=S;(0,e.useEffect)(()=>{if(R||W)return;const D=!E()(a)&&!window.sessionStorage.getItem(`${M}-${r}`)&&(G==="AT_LIMIT"||G==="OVER_LIMIT");let I;G==="OVER_LIMIT"?I="warning":G==="AT_LIMIT"&&(I="softWarning"),D&&T({type:I,message:b({id:"notification.ee.warning.over-.message",defaultMessage:"Add seats to {licenseLimitStatus, select, OVER_LIMIT {invite} other {re-enable}} Users. If you already did it but it's not reflected in Strapi yet, make sure to restart your app."},{licenseLimitStatus:G}),title:b({id:"notification.ee.warning.at-seat-limit.title",defaultMessage:"{licenseLimitStatus, select, OVER_LIMIT {Over} other {At}} seat limit ({enforcementUserCount}/{permittedSeats})"},{licenseLimitStatus:G,enforcementUserCount:F,permittedSeats:a}),link:{url:se?L:x,label:b({id:"notification.ee.warning.seat-limit.link",defaultMessage:"{isHostedOnStrapiCloud, select, true {ADD SEATS} other {CONTACT SALES}}"},{isHostedOnStrapiCloud:se})},blockTransition:!0,onClose(){window.sessionStorage.setItem(`${M}-${r}`,!0)}})},[T,S,r,b,W,a,G,F,se,R])};v.Z=O},35153:function(B,v,t){"use strict";t.d(v,{Z:function(){return A}});var e=t(32735),p=t(19565),y=t(20108),E=t(15062),c=t(78125);function m(){const M=(0,E.v9)(c._),{get:L}=(0,p.kY)(),{isLoading:x,allowedActions:{canRead:O,canCreate:b,canUpdate:S,canDelete:R}}=(0,p.ss)(M.settings.users),W=O&&b&&S&&R,{data:T,isError:r,isLoading:F}=(0,y.useQuery)(["ee","license-limit-info"],async()=>{const{data:{data:se}}=await L("/admin/license-limit-information");return se},{enabled:!x&&W}),a=T??{},G=e.useCallback(se=>(a?.features??[]).find(I=>I.name===se)?.options??{},[a?.features]);return{license:a,getFeature:G,isError:r,isLoading:F}}var A=m},98768:function(B,v,t){"use strict";var e=t(32735),p=t(9026),y=t(72850),E=t(87933),c=t(49372),m=t(60216),A=t.n(m),M=t(67879),L=t(8471),x=t(954),O=t(1115),b=t(58414),S=t(33205);const R=(0,L.ZP)(p.i)`
37
+ flex: 1;
38
+ `,W=T=>{const r=window.strapi.features.isEnabled(window.strapi.features.SSO),{isLoading:F,data:a}=(0,b.pl)({ssoEnabled:r}),{formatMessage:G}=(0,M.Z)();return!r||!F&&a.length===0?e.createElement(x.ZP,null,e.createElement(O.Z,{...T})):e.createElement(x.ZP,null,e.createElement(O.Z,{...T},e.createElement(y.x,{paddingTop:7},e.createElement(E.k,{direction:"column",alignItems:"stretch",gap:7},e.createElement(E.k,null,e.createElement(R,null),e.createElement(y.x,{paddingLeft:3,paddingRight:3},e.createElement(c.Z,{variant:"sigma",textColor:"neutral600"},G({id:"Auth.login.sso.divider"}))),e.createElement(R,null)),e.createElement(S.Z,{providers:a,displayAllProviders:!1})))))};W.defaultProps={onSubmit:T=>T.preventDefault(),requestError:null},W.propTypes={formErrors:A().object.isRequired,modifiedData:A().object.isRequired,onChange:A().func.isRequired,onSubmit:A().func,requestError:A().object},v.Z=W},33205:function(B,v,t){"use strict";var e=t(32735),p=t(87933),y=t(63919),E=t(49372),c=t(15335),m=t(5803),A=t(60216),M=t.n(A),L=t(67879),x=t(14911),O=t(8471);const b=O.ZP.a`
39
+ width: ${136/16}rem;
40
+ display: flex;
41
+ justify-content: center;
42
+ align-items: center;
43
+ height: ${48/16}rem;
44
+ border: 1px solid ${({theme:T})=>T.colors.neutral150};
45
+ border-radius: ${({theme:T})=>T.borderRadius};
46
+ text-decoration: inherit;
47
+ &:link {
48
+ text-decoration: none;
49
+ }
50
+ color: ${({theme:T})=>T.colors.neutral600};
51
+ `,S=(0,O.ZP)(p.k)`
52
+ & a:not(:first-child):not(:last-child) {
53
+ margin: 0 ${({theme:T})=>T.spaces[2]};
54
+ }
55
+ & a:first-child {
56
+ margin-right: ${({theme:T})=>T.spaces[2]};
57
+ }
58
+ & a:last-child {
59
+ margin-left: ${({theme:T})=>T.spaces[2]};
60
+ }
61
+ `,R=({provider:T})=>e.createElement(y.u,{label:T.displayName},e.createElement(b,{href:`${window.strapi.backendURL}/admin/connect/${T.uid}`},T.icon?e.createElement("img",{src:T.icon,"aria-hidden":!0,alt:"",height:"32px"}):e.createElement(E.Z,null,T.displayName)));R.propTypes={provider:M().shape({icon:M().string,displayName:M().string.isRequired,uid:M().string.isRequired}).isRequired};const W=({providers:T,displayAllProviders:r})=>{const{formatMessage:F}=(0,L.Z)();return r?e.createElement(c.r,{gap:4},T.map(a=>e.createElement(m.P,{key:a.uid,col:4},e.createElement(R,{provider:a})))):T.length>2&&!r?e.createElement(c.r,{gap:4},T.slice(0,2).map(a=>e.createElement(m.P,{key:a.uid,col:4},e.createElement(R,{provider:a}))),e.createElement(m.P,{col:4},e.createElement(y.u,{label:F({id:"global.see-more"})},e.createElement(b,{as:x.rU,to:"/auth/providers"},e.createElement("span",{"aria-hidden":!0},"\u2022\u2022\u2022"))))):e.createElement(S,{justifyContent:"center"},T.map(a=>e.createElement(R,{key:a.uid,provider:a})))};W.defaultProps={displayAllProviders:!0},W.propTypes={providers:M().arrayOf(M().object).isRequired,displayAllProviders:M().bool},v.Z=W},48224:function(B,v,t){var e={"./ar.json":[38677,7958],"./ca.json":[90169,3516],"./cs.json":[43186,7519],"./de.json":[8343,6901],"./dk.json":[65668,7898],"./en.json":[10329,320],"./es.json":[45445,8367],"./eu.json":[69511,8360],"./fr.json":[8399,8006],"./gu.json":[10182,2248],"./he.json":[21757,830],"./hi.json":[43206,6332],"./hu.json":[72320,5894],"./id.json":[74221,8897],"./it.json":[90685,6817],"./ja.json":[21727,1312],"./ko.json":[30986,1377],"./ml.json":[11309,9903],"./ms.json":[75973,3025],"./nl.json":[80381,2671],"./no.json":[82446,562],"./pl.json":[84008,7846],"./pt-BR.json":[91417,9647],"./pt.json":[41830,3340],"./ru.json":[57098,123],"./sa.json":[92900,9726],"./sk.json":[52204,606],"./sv.json":[43211,9303],"./th.json":[49582,749],"./tr.json":[99154,395],"./uk.json":[2987,7403],"./vi.json":[50576,3278],"./zh-Hans.json":[35964,2553],"./zh.json":[91999,1011]};function p(y){if(!t.o(e,y))return Promise.resolve().then(function(){var m=new Error("Cannot find module '"+y+"'");throw m.code="MODULE_NOT_FOUND",m});var E=e[y],c=E[0];return t.e(E[1]).then(function(){return t.t(c,19)})}p.keys=function(){return Object.keys(e)},p.id=48224,B.exports=p},47750:function(B,v,t){"use strict";B.exports=t.p+"70674f63fc3904c20de0.svg"}}]);
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[2544],{92034:function(X,B,r){"use strict";r.r(B),r.d(B,{CreatePage:function(){return Ee},default:function(){return $e}});var e=r(32735),b=r(27649),P=r(82055),R=r(87933),Z=r(41415),O=r(17e3),S=r(72850),x=r(49372),D=r(15335),_=r(5803),a=r(10369),H=r(33475),p=r(19565),A=r(29439),F=r(14723),f=r(92802),C=r(33795),w=r.n(C),me=r(86834),ie=r.n(me),le=r(67879),y=r(15062),de=r(53038),Y=r(8471),G=r(10328),ee=r(78125),xe=r(7247),pe=r(24346),oe=pe.Ry().shape({name:pe.Z_().required(p.I0.required),description:pe.Z_().required(p.I0.required)});const Pe=Y.ZP.div`
1
+ (self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[2544],{92034:function(X,B,r){"use strict";r.r(B),r.d(B,{CreatePage:function(){return Ee},default:function(){return $e}});var e=r(32735),b=r(27649),P=r(82055),R=r(87933),Z=r(41415),O=r(17e3),S=r(72850),x=r(49372),D=r(15335),q=r(5803),a=r(10369),H=r(33475),p=r(19565),A=r(29439),F=r(14723),f=r(92802),C=r(33795),w=r.n(C),ue=r(86834),ae=r.n(ue),ie=r(67879),y=r(15062),le=r(53038),Y=r(8471),G=r(10328),_=r(78125),xe=r(7247),me=r(24346),oe=me.Ry().shape({name:me.Z_().required(p.I0.required),description:me.Z_().required(p.I0.required)});const Pe=Y.ZP.div`
2
2
  border: 1px solid ${({theme:T})=>T.colors.primary200};
3
3
  background: ${({theme:T})=>T.colors.primary100};
4
4
  padding: ${({theme:T})=>`${T.spaces[2]} ${T.spaces[4]}`};
@@ -6,7 +6,7 @@
6
6
  border-radius: ${({theme:T})=>T.borderRadius};
7
7
  font-size: ${12/16}rem;
8
8
  font-weight: bold;
9
- `,Ee=()=>{const T=(0,p.lm)(),{lockApp:Q,unlockApp:z}=(0,p.o1)(),{formatMessage:k}=(0,le.Z)(),[q,re]=(0,e.useState)(!1),{replace:ce}=(0,de.k6)(),te=(0,e.useRef)(),{trackUsage:ue}=(0,p.rS)(),Ze=(0,de.$B)("/settings/roles/duplicate/:id"),Ae=w()(Ze,"params.id",null),{isLoading:Be,data:he}=(0,G.U_)(),{permissions:Oe,isLoading:De}=(0,G.Dq)(Ae),{post:Fe,put:je}=(0,p.kY)(),He=ae=>{Q(),re(!0),ue(Ae?"willDuplicateRole":"willCreateNewRole"),Promise.resolve(Fe("/admin/roles",ae)).then(async({data:W})=>{const{permissionsToSend:U}=te.current.getPermissions();return ue(Ae?"didDuplicateRole":"didCreateNewRole"),W.data.id&&!ie()(U)&&await je(`/admin/roles/${W.data.id}/permissions`,{permissions:U}),W}).then(W=>{re(!1),T({type:"success",message:{id:"Settings.roles.created",defaultMessage:"created"}}),ce(`/settings/roles/${W.data.id}`)}).catch(W=>{console.error(W),re(!1),T({type:"warning",message:{id:"notification.error"}})}).finally(()=>{z()})},Le=`${k({id:"Settings.roles.form.created",defaultMessage:"Created"})} ${(0,F.Z)(new Date,"PPP")}`;return e.createElement(b.o,null,e.createElement(p.SL,{name:"Roles"}),e.createElement(f.J9,{initialValues:{name:"",description:Le},onSubmit:He,validationSchema:oe,validateOnChange:!1},({handleSubmit:ae,values:W,errors:U,handleReset:ye,handleChange:Ce})=>e.createElement(p.l0,{noValidate:!0},e.createElement(e.Fragment,null,e.createElement(P.T,{primaryAction:e.createElement(R.k,{gap:2},e.createElement(Z.z,{variant:"secondary",onClick:()=>{ye(),te.current.resetForm()},size:"L"},k({id:"app.components.Button.reset",defaultMessage:"Reset"})),e.createElement(Z.z,{onClick:ae,loading:q,size:"L"},k({id:"global.save",defaultMessage:"Save"}))),title:k({id:"Settings.roles.create.title",defaultMessage:"Create a role"}),subtitle:k({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(p.rU,{startIcon:e.createElement(A.Z,null),to:"/settings/roles"},k({id:"global.back",defaultMessage:"Back"}))}),e.createElement(O.D,null,e.createElement(R.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(S.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(R.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(R.k,{justifyContent:"space-between"},e.createElement(S.x,null,e.createElement(S.x,null,e.createElement(x.Z,{fontWeight:"bold"},k({id:"global.details",defaultMessage:"Details"}))),e.createElement(S.x,null,e.createElement(x.Z,{variant:"pi",textColor:"neutral600"},k({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(Pe,null,k({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:0}))),e.createElement(D.r,{gap:4},e.createElement(_.P,{col:6},e.createElement(a.o,{name:"name",error:U.name&&k({id:U.name}),label:k({id:"global.name",defaultMessage:"Name"}),onChange:Ce,value:W.name})),e.createElement(_.P,{col:6},e.createElement(H.g,{label:k({id:"global.description",defaultMessage:"Description"}),id:"description",error:U.description&&k({id:U.description}),onChange:Ce},W.description))))),!Be&&!De?e.createElement(S.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(xe.Z,{isFormDisabled:!1,ref:te,permissions:Oe,layout:he})):e.createElement(S.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(p.dO,null))))))))};function $e(){const T=(0,y.v9)(ee._);return e.createElement(p.O4,{permissions:T.settings.roles.create},e.createElement(Ee,null))}},7247:function(X,B,r){"use strict";r.d(B,{Z:function(){return es}});var e=r(32735),b=r(91215),P=r(90980),R=r(3653),Z=r(19565),O=r(23973),S=r.n(O),x=r(86834),D=r.n(x),_=r(60216),a=r.n(_),H=r(67879),p=r(72850),A=r(98978),F=r.n(A),f=r(8471),C=r(87933),w=r(82884),me=r(15974),ie=r(96441),le=r(33795),y=r.n(le),de=r(9086),Y=r.n(de),G=r(10328),ee=r(41415),xe=r(45112);const pe=f.ZP.div`
9
+ `,Ee=()=>{const T=(0,p.lm)(),{lockApp:ne,unlockApp:z}=(0,p.o1)(),{formatMessage:k}=(0,ie.Z)(),[Q,pe]=(0,e.useState)(!1),{replace:de}=(0,le.k6)(),ee=(0,e.useRef)(),{trackUsage:ce}=(0,p.rS)(),Ze=(0,le.$B)("/settings/roles/duplicate/:id"),Ae=w()(Ze,"params.id",null),{isLoading:Be,data:he}=(0,G.U_)(),{permissions:Oe,isLoading:De}=(0,G.Dq)(Ae),{post:Fe,put:je}=(0,p.kY)(),He=re=>{ne(),pe(!0),ce(Ae?"willDuplicateRole":"willCreateNewRole"),Promise.resolve(Fe("/admin/roles",re)).then(async({data:W})=>{const{permissionsToSend:U}=ee.current.getPermissions();return ce(Ae?"didDuplicateRole":"didCreateNewRole"),W.data.id&&!ae()(U)&&await je(`/admin/roles/${W.data.id}/permissions`,{permissions:U}),W}).then(W=>{pe(!1),T({type:"success",message:{id:"Settings.roles.created",defaultMessage:"created"}}),de(`/settings/roles/${W.data.id}`)}).catch(W=>{console.error(W),pe(!1),T({type:"warning",message:{id:"notification.error"}})}).finally(()=>{z()})},Le=`${k({id:"Settings.roles.form.created",defaultMessage:"Created"})} ${(0,F.Z)(new Date,"PPP")}`;return e.createElement(b.o,null,e.createElement(p.SL,{name:"Roles"}),e.createElement(f.J9,{initialValues:{name:"",description:Le},onSubmit:He,validationSchema:oe,validateOnChange:!1},({handleSubmit:re,values:W,errors:U,handleReset:ye,handleChange:Ce})=>e.createElement(p.l0,{noValidate:!0},e.createElement(e.Fragment,null,e.createElement(P.T,{primaryAction:e.createElement(R.k,{gap:2},e.createElement(Z.z,{variant:"secondary",onClick:()=>{ye(),ee.current.resetForm()},size:"L"},k({id:"app.components.Button.reset",defaultMessage:"Reset"})),e.createElement(Z.z,{onClick:re,loading:Q,size:"L"},k({id:"global.save",defaultMessage:"Save"}))),title:k({id:"Settings.roles.create.title",defaultMessage:"Create a role"}),subtitle:k({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(p.rU,{startIcon:e.createElement(A.Z,null),to:"/settings/roles"},k({id:"global.back",defaultMessage:"Back"}))}),e.createElement(O.D,null,e.createElement(R.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(S.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(R.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(R.k,{justifyContent:"space-between"},e.createElement(S.x,null,e.createElement(S.x,null,e.createElement(x.Z,{fontWeight:"bold"},k({id:"global.details",defaultMessage:"Details"}))),e.createElement(S.x,null,e.createElement(x.Z,{variant:"pi",textColor:"neutral600"},k({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(Pe,null,k({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:0}))),e.createElement(D.r,{gap:4},e.createElement(q.P,{col:6},e.createElement(a.o,{name:"name",error:U.name&&k({id:U.name}),label:k({id:"global.name",defaultMessage:"Name"}),onChange:Ce,value:W.name})),e.createElement(q.P,{col:6},e.createElement(H.g,{label:k({id:"global.description",defaultMessage:"Description"}),id:"description",error:U.description&&k({id:U.description}),onChange:Ce},W.description))))),!Be&&!De?e.createElement(S.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(xe.Z,{isFormDisabled:!1,ref:ee,permissions:Oe,layout:he})):e.createElement(S.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(p.dO,null))))))))};function $e(){const T=(0,y.v9)(_._);return e.createElement(p.O4,{permissions:T.settings.roles.create},e.createElement(Ee,null))}},7247:function(X,B,r){"use strict";r.d(B,{Z:function(){return es}});var e=r(32735),b=r(91215),P=r(90980),R=r(3653),Z=r(19565),O=r(23973),S=r.n(O),x=r(86834),D=r.n(x),q=r(60216),a=r.n(q),H=r(67879),p=r(72850),A=r(98978),F=r.n(A),f=r(8471),C=r(87933),w=r(82884),ue=r(15974),ae=r(96441),ie=r(33795),y=r.n(ie),le=r(9086),Y=r.n(le),G=r(10328),_=r(41415),xe=r(45112);const me=f.ZP.div`
10
10
  position: relative;
11
11
 
12
12
  ${({hasConditions:t,disabled:n,theme:o})=>t&&`
@@ -21,14 +21,14 @@
21
21
  background: ${n?o.colors.neutral100:o.colors.primary600};
22
22
  }
23
23
  `}
24
- `,Re=({onClick:t,className:n,hasConditions:o,variant:s})=>{const{formatMessage:i}=(0,H.Z)();return e.createElement(pe,{hasConditions:o,className:n},e.createElement(ee.z,{variant:s,startIcon:e.createElement(xe.Z,null),onClick:t},i({id:"global.settings",defaultMessage:"Settings"})))};Re.defaultProps={className:null,hasConditions:!1,variant:"tertiary"},Re.propTypes={onClick:a().func.isRequired,className:a().string,hasConditions:a().bool,variant:a().string};var oe=(0,f.ZP)(Re)``,Pe=r(85025),Ee=r(55225),$e=r(31600),T=r(49372),Q=r(11406),z=r(26858),k=r(51654),q=r(97889),re=r(81346),ce=r.n(re),te=r(23940),ue=r.n(te),Ze=r(27799);const Ae=t=>Object.values(t).map(n=>Object.entries(n).filter(([,o])=>o).map(([o])=>o)).flat(),Be=t=>t.reduce((n,[o,s])=>(n.push({label:ue()(o),children:s.map(i=>({label:i.displayName,value:i.id}))}),n),[]),he=(t,n)=>t.map(([,o])=>o).flat().reduce((o,s)=>({[s.id]:n.includes(s.id),...o}),{}),Oe=({arrayOfOptionsGroupedByCategory:t,isFormDisabled:n,isGrey:o,label:s,name:i,onChange:l,value:d})=>{const{formatMessage:c}=(0,H.Z)(),m=u=>{l(i,he(t,u))};return e.createElement(C.k,{as:"li",background:o?"neutral100":"neutral0",paddingBottom:3,paddingTop:3},e.createElement(C.k,{paddingLeft:6,style:{width:180}},e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},c({id:"Settings.permissions.conditions.can",defaultMessage:"Can"}),"\xA0"),e.createElement(T.Z,{variant:"sigma",title:s,textColor:"primary600",ellipsis:!0},c({id:`Settings.roles.form.permissions.${s.toLowerCase()}`,defaultMessage:s})),e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},"\xA0",c({id:"Settings.permissions.conditions.when",defaultMessage:"When"}))),e.createElement(p.x,{style:{maxWidth:430,width:"100%"}},e.createElement(Ze.Q,{id:i,customizeContent:u=>`${u.length} currently selected`,onChange:m,value:Ae(d),options:Be(t),disabled:n})))};Oe.propTypes={arrayOfOptionsGroupedByCategory:a().array.isRequired,isFormDisabled:a().bool.isRequired,isGrey:a().bool.isRequired,label:a().string.isRequired,name:a().string.isRequired,value:a().object.isRequired,onChange:a().func.isRequired};var De=Oe;const Fe=(t,n)=>t.reduce((o,s)=>(o[s.id]=y()(n,s.id,!1),o),{}),je=(t,n)=>t.reduce((o,s)=>{const[i,l]=s,d=Fe(l,n);return o[i]=d,o},{});var Le=(t,n,o)=>t.reduce((s,i)=>{const l=y()(n,[...i.pathToConditionsObject,"conditions"],{}),d=je(o,l);return s[i.pathToConditionsObject.join("..")]=d,s},{});const ae=({actions:t,headerBreadCrumbs:n,isFormDisabled:o,onClosed:s,onToggle:i})=>{const{formatMessage:l}=(0,H.Z)(),{availableConditions:d,modifiedData:c,onChangeConditions:m}=(0,G.$_)(),u=(0,e.useMemo)(()=>Object.entries(ce()(d,"category")),[d]),g=t.filter(({isDisplayed:h,hasSomeActionsSelected:L,hasAllActionsSelected:$})=>h&&(L||$)),v=(0,e.useMemo)(()=>Le(g,c,u),[g,c,u]),[M,N]=(0,e.useState)(v),j=(h,L)=>{N((0,q.ZP)($=>{$[h]||($[h]={}),$[h].default||($[h].default={}),$[h].default=L}))},E=()=>{const h=Object.entries(M).reduce((L,$)=>{const[I,ne]=$,K=Object.values(ne).reduce((J,V)=>({...J,...V}),{});return L[I]=K,L},{});m(h),i()};return e.createElement(Pe.P,{labelledBy:"condition-modal-breadcrumbs",onClose:s},e.createElement(Ee.x,null,e.createElement(z.O,{id:"condition-modal-breadcrumbs",label:n.join(", ")},n.map((h,L,$)=>e.createElement(k.$,{isCurrent:L===$.length-1,key:h},ue()(l({id:h,defaultMessage:h})))))),e.createElement($e.f,null,g.length===0&&e.createElement(T.Z,null,l({id:"Settings.permissions.conditions.no-actions",defaultMessage:"You first need to select actions (create, read, update, ...) before defining conditions on them."})),e.createElement("ul",null,g.map(({actionId:h,label:L,pathToConditionsObject:$},I)=>{const ne=$.join("..");return e.createElement(De,{key:h,arrayOfOptionsGroupedByCategory:u,label:L,isFormDisabled:o,isGrey:I%2===0,name:ne,onChange:j,value:y()(M,ne,{})})}))),e.createElement(Q.m,{startActions:e.createElement(ee.z,{variant:"tertiary",onClick:i},l({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(ee.z,{onClick:E},l({id:"Settings.permissions.conditions.apply",defaultMessage:"Apply"}))}))};ae.propTypes={actions:a().arrayOf(a().shape({actionId:a().string.isRequired,checkboxName:a().string,hasSomeActionsSelected:a().bool.isRequired,hasAllActionsSelected:a().bool,isDisplayed:a().bool.isRequired,label:a().string})).isRequired,headerBreadCrumbs:a().arrayOf(a().string).isRequired,isFormDisabled:a().bool.isRequired,onClosed:a().func.isRequired,onToggle:a().func.isRequired};var W=ae;const U=`${120/16}rem`,ye=`${200/16}rem`,Ce=`${53/16}rem`;var Ue=f.ZP.div`
24
+ `,Re=({onClick:t,className:n,hasConditions:o,variant:s})=>{const{formatMessage:i}=(0,H.Z)();return e.createElement(me,{hasConditions:o,className:n},e.createElement(_.z,{variant:s,startIcon:e.createElement(xe.Z,null),onClick:t},i({id:"global.settings",defaultMessage:"Settings"})))};Re.defaultProps={className:null,hasConditions:!1,variant:"tertiary"},Re.propTypes={onClick:a().func.isRequired,className:a().string,hasConditions:a().bool,variant:a().string};var oe=(0,f.ZP)(Re)``,Pe=r(85025),Ee=r(55225),$e=r(31600),T=r(49372),ne=r(11406),z=r(26858),k=r(51654),Q=r(97889),pe=r(81346),de=r.n(pe),ee=r(23940),ce=r.n(ee),Ze=r(27799);const Ae=t=>Object.values(t).map(n=>Object.entries(n).filter(([,o])=>o).map(([o])=>o)).flat(),Be=t=>t.reduce((n,[o,s])=>(n.push({label:ce()(o),children:s.map(i=>({label:i.displayName,value:i.id}))}),n),[]),he=(t,n)=>t.map(([,o])=>o).flat().reduce((o,s)=>({[s.id]:n.includes(s.id),...o}),{}),Oe=({arrayOfOptionsGroupedByCategory:t,isFormDisabled:n,isGrey:o,label:s,name:i,onChange:l,value:d})=>{const{formatMessage:c}=(0,H.Z)(),m=u=>{l(i,he(t,u))};return e.createElement(C.k,{as:"li",background:o?"neutral100":"neutral0",paddingBottom:3,paddingTop:3},e.createElement(C.k,{paddingLeft:6,style:{width:180}},e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},c({id:"Settings.permissions.conditions.can",defaultMessage:"Can"}),"\xA0"),e.createElement(T.Z,{variant:"sigma",title:s,textColor:"primary600",ellipsis:!0},c({id:`Settings.roles.form.permissions.${s.toLowerCase()}`,defaultMessage:s})),e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},"\xA0",c({id:"Settings.permissions.conditions.when",defaultMessage:"When"}))),e.createElement(p.x,{style:{maxWidth:430,width:"100%"}},e.createElement(Ze.Q,{id:i,customizeContent:u=>`${u.length} currently selected`,onChange:m,value:Ae(d),options:Be(t),disabled:n})))};Oe.propTypes={arrayOfOptionsGroupedByCategory:a().array.isRequired,isFormDisabled:a().bool.isRequired,isGrey:a().bool.isRequired,label:a().string.isRequired,name:a().string.isRequired,value:a().object.isRequired,onChange:a().func.isRequired};var De=Oe;const Fe=(t,n)=>t.reduce((o,s)=>(o[s.id]=y()(n,s.id,!1),o),{}),je=(t,n)=>t.reduce((o,s)=>{const[i,l]=s,d=Fe(l,n);return o[i]=d,o},{});var Le=(t,n,o)=>t.reduce((s,i)=>{const l=y()(n,[...i.pathToConditionsObject,"conditions"],{}),d=je(o,l);return s[i.pathToConditionsObject.join("..")]=d,s},{});const re=({actions:t,headerBreadCrumbs:n,isFormDisabled:o,onClosed:s,onToggle:i})=>{const{formatMessage:l}=(0,H.Z)(),{availableConditions:d,modifiedData:c,onChangeConditions:m}=(0,G.$_)(),u=(0,e.useMemo)(()=>Object.entries(de()(d,"category")),[d]),g=t.filter(({isDisplayed:h,hasSomeActionsSelected:L,hasAllActionsSelected:$})=>h&&(L||$)),v=(0,e.useMemo)(()=>Le(g,c,u),[g,c,u]),[M,N]=(0,e.useState)(v),j=(h,L)=>{N((0,Q.ZP)($=>{$[h]||($[h]={}),$[h].default||($[h].default={}),$[h].default=L}))},E=()=>{const h=Object.entries(M).reduce((L,$)=>{const[I,te]=$,K=Object.values(te).reduce((J,V)=>({...J,...V}),{});return L[I]=K,L},{});m(h),i()};return e.createElement(Pe.P,{labelledBy:"condition-modal-breadcrumbs",onClose:s},e.createElement(Ee.x,null,e.createElement(z.O,{id:"condition-modal-breadcrumbs",label:n.join(", ")},n.map((h,L,$)=>e.createElement(k.$,{isCurrent:L===$.length-1,key:h},ce()(l({id:h,defaultMessage:h})))))),e.createElement($e.f,null,g.length===0&&e.createElement(T.Z,null,l({id:"Settings.permissions.conditions.no-actions",defaultMessage:"You first need to select actions (create, read, update, ...) before defining conditions on them."})),e.createElement("ul",null,g.map(({actionId:h,label:L,pathToConditionsObject:$},I)=>{const te=$.join("..");return e.createElement(De,{key:h,arrayOfOptionsGroupedByCategory:u,label:L,isFormDisabled:o,isGrey:I%2===0,name:te,onChange:j,value:y()(M,te,{})})}))),e.createElement(ne.m,{startActions:e.createElement(_.z,{variant:"tertiary",onClick:i},l({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(_.z,{onClick:E},l({id:"Settings.permissions.conditions.apply",defaultMessage:"Apply"}))}))};re.propTypes={actions:a().arrayOf(a().shape({actionId:a().string.isRequired,checkboxName:a().string,hasSomeActionsSelected:a().bool.isRequired,hasAllActionsSelected:a().bool,isDisplayed:a().bool.isRequired,label:a().string})).isRequired,headerBreadCrumbs:a().arrayOf(a().string).isRequired,isFormDisabled:a().bool.isRequired,onClosed:a().func.isRequired,onToggle:a().func.isRequired};var W=re;const U=`${120/16}rem`,ye=`${200/16}rem`,Ce=`${53/16}rem`;var Ue=f.ZP.div`
25
25
  width: ${U};
26
26
  `,ot=(0,f.ZP)(C.k)`
27
27
  padding-right: ${({theme:t})=>t.spaces[2]};
28
28
  overflow: hidden;
29
29
  flex: 1;
30
30
  ${({isCollapsable:t})=>t&&"cursor: pointer;"}
31
- `;const Ke=({children:t,isCollapsable:n,isActive:o,isFormDisabled:s,label:i,onChange:l,onClick:d,checkboxName:c,someChecked:m,value:u})=>{const{formatMessage:g}=(0,H.Z)();return e.createElement(C.k,{alignItems:"center",paddingLeft:6,style:{width:ye,flexShrink:0}},e.createElement(p.x,{paddingRight:2},e.createElement(w.C,{name:c,"aria-label":g({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:i}),disabled:s,onValueChange:v=>l({target:{name:c,value:v}}),indeterminate:m,value:u})),e.createElement(ot,{title:i,alignItems:"center",isCollapsable:n,...n&&{onClick:d,"aria-expanded":o,onKeyDown:({key:v})=>(v==="Enter"||v===" ")&&d(),tabIndex:0,role:"button"}},e.createElement(T.Z,{fontWeight:o?"bold":"",textColor:o?"primary600":"neutral800",ellipsis:!0},ue()(i)),t))};Ke.defaultProps={children:null,checkboxName:"",onChange(){},value:!1,someChecked:!1,isCollapsable:!1},Ke.propTypes={checkboxName:a().string,children:a().node,label:a().string.isRequired,isCollapsable:a().bool,isFormDisabled:a().bool.isRequired,onChange:a().func,onClick:a().func.isRequired,someChecked:a().bool,value:a().bool,isActive:a().bool.isRequired};var rt=(0,e.memo)(Ke),Ft=r(72091),Nt=r.n(Ft),Wt=r(85973),be=r.n(Wt);const at=t=>be()(t)?Nt()(Object.values(t).map(n=>be()(n)?at(n):n)):[];var ke=at,ze=t=>t?Object.keys(t).reduce((n,o)=>(o!=="conditions"&&(n[o]=t[o]),n),{}):null,Te=t=>{const n=ze(t),o=ke(n);if(!o.length)return{hasAllActionsSelected:!1,hasSomeActionsSelected:!1};const s=o.every(l=>l),i=o.some(l=>l)&&!s;return{hasAllActionsSelected:s,hasSomeActionsSelected:i}},Vt=r(16899),Ne=(0,f.ZP)(Vt.Z)`
31
+ `;const Ke=({children:t,isCollapsable:n,isActive:o,isFormDisabled:s,label:i,onChange:l,onClick:d,checkboxName:c,someChecked:m,value:u})=>{const{formatMessage:g}=(0,H.Z)();return e.createElement(C.k,{alignItems:"center",paddingLeft:6,style:{width:ye,flexShrink:0}},e.createElement(p.x,{paddingRight:2},e.createElement(w.C,{name:c,"aria-label":g({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:i}),disabled:s,onValueChange:v=>l({target:{name:c,value:v}}),indeterminate:m,value:u})),e.createElement(ot,{title:i,alignItems:"center",isCollapsable:n,...n&&{onClick:d,"aria-expanded":o,onKeyDown:({key:v})=>(v==="Enter"||v===" ")&&d(),tabIndex:0,role:"button"}},e.createElement(T.Z,{fontWeight:o?"bold":"",textColor:o?"primary600":"neutral800",ellipsis:!0},ce()(i)),t))};Ke.defaultProps={children:null,checkboxName:"",onChange(){},value:!1,someChecked:!1,isCollapsable:!1},Ke.propTypes={checkboxName:a().string,children:a().node,label:a().string.isRequired,isCollapsable:a().bool,isFormDisabled:a().bool.isRequired,onChange:a().func,onClick:a().func.isRequired,someChecked:a().bool,value:a().bool,isActive:a().bool.isRequired};var rt=(0,e.memo)(Ke),Ft=r(72091),Nt=r.n(Ft),Wt=r(85973),be=r.n(Wt);const at=t=>be()(t)?Nt()(Object.values(t).map(n=>be()(n)?at(n):n)):[];var ke=at,ze=t=>t?Object.keys(t).reduce((n,o)=>(o!=="conditions"&&(n[o]=t[o]),n),{}):null,Te=t=>{const n=ze(t),o=ke(n);if(!o.length)return{hasAllActionsSelected:!1,hasSomeActionsSelected:!1};const s=o.every(l=>l),i=o.some(l=>l)&&!s;return{hasAllActionsSelected:s,hasSomeActionsSelected:i}},Vt=r(16899),Ne=(0,f.ZP)(Vt.Z)`
32
32
  display: none;
33
33
  width: ${10/16}rem;
34
34
  transform: rotate(${({$isActive:t})=>t?"180":"0"}deg);
@@ -105,7 +105,7 @@
105
105
  position: absolute;
106
106
  right: 9px;
107
107
  transform: translateY(10px);
108
- `,ut=({availableActions:t,isActive:n,isGrey:o,isFormDisabled:s,label:i,onClickToggle:l,pathToData:d})=>{const[c,m]=(0,e.useState)(!1),{formatMessage:u}=(0,H.Z)(),{modifiedData:g,onChangeParentCheckbox:v,onChangeSimpleCheckbox:M}=(0,G.$_)(),N=()=>{m(K=>!K)},j=()=>{m(!1)},E=y()(g,d.split(".."),{}),h=(0,e.useMemo)(()=>Object.keys(E).reduce((K,J)=>(K[J]=Y()(E[J],"conditions"),K),{}),[E]),{hasAllActionsSelected:L,hasSomeActionsSelected:$}=Te(h),I=(0,e.useMemo)(()=>Ht(t,g,d),[t,g,d]),ne=I.some(({hasConditions:K})=>K);return e.createElement(Gt,{isActive:n},e.createElement(it,{isGrey:o},e.createElement(rt,{isCollapsable:!0,isFormDisabled:s,label:i,checkboxName:d,onChange:v,onClick:l,someChecked:$,value:L,isActive:n},e.createElement(dt,{paddingLeft:2},n?e.createElement(me.Z,null):e.createElement(ie.Z,null))),e.createElement(C.k,{style:{flex:1}},I.map(({actionId:K,hasConditions:J,hasAllActionsSelected:V,hasSomeActionsSelected:fe,isDisplayed:Ie,isParentCheckbox:se,checkboxName:ve,label:Ve})=>Ie?se?e.createElement(lt,{key:K,justifyContent:"center",alignItems:"center"},J&&e.createElement(ct,null),e.createElement(w.C,{disabled:s,name:ve,"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${Ve} ${i}`}),onValueChange:Se=>{v({target:{name:ve,value:Se}})},indeterminate:fe,value:V})):e.createElement(lt,{key:K,justifyContent:"center",alignItems:"center"},J&&e.createElement(ct,null),e.createElement(w.C,{disabled:s,indeterminate:J,name:ve,onValueChange:Se=>{M({target:{name:ve,value:Se}})},value:V})):e.createElement(Ue,{key:K}))),c&&e.createElement(W,{headerBreadCrumbs:[i,"Settings.permissions.conditions.conditions"],actions:I,isFormDisabled:s,onClosed:j,onToggle:N})),e.createElement(Ut,null,e.createElement(oe,{onClick:N,hasConditions:ne})))};ut.propTypes={availableActions:a().array.isRequired,isActive:a().bool.isRequired,isGrey:a().bool.isRequired,isFormDisabled:a().bool.isRequired,label:a().string.isRequired,onClickToggle:a().func.isRequired,pathToData:a().string.isRequired};var Kt=ut;const zt=f.ZP.span`
108
+ `,ut=({availableActions:t,isActive:n,isGrey:o,isFormDisabled:s,label:i,onClickToggle:l,pathToData:d})=>{const[c,m]=(0,e.useState)(!1),{formatMessage:u}=(0,H.Z)(),{modifiedData:g,onChangeParentCheckbox:v,onChangeSimpleCheckbox:M}=(0,G.$_)(),N=()=>{m(K=>!K)},j=()=>{m(!1)},E=y()(g,d.split(".."),{}),h=(0,e.useMemo)(()=>Object.keys(E).reduce((K,J)=>(K[J]=Y()(E[J],"conditions"),K),{}),[E]),{hasAllActionsSelected:L,hasSomeActionsSelected:$}=Te(h),I=(0,e.useMemo)(()=>Ht(t,g,d),[t,g,d]),te=I.some(({hasConditions:K})=>K);return e.createElement(Gt,{isActive:n},e.createElement(it,{isGrey:o},e.createElement(rt,{isCollapsable:!0,isFormDisabled:s,label:i,checkboxName:d,onChange:v,onClick:l,someChecked:$,value:L,isActive:n},e.createElement(dt,{paddingLeft:2},n?e.createElement(ue.Z,null):e.createElement(ae.Z,null))),e.createElement(C.k,{style:{flex:1}},I.map(({actionId:K,hasConditions:J,hasAllActionsSelected:V,hasSomeActionsSelected:fe,isDisplayed:Ie,isParentCheckbox:se,checkboxName:ve,label:Ve})=>Ie?se?e.createElement(lt,{key:K,justifyContent:"center",alignItems:"center"},J&&e.createElement(ct,null),e.createElement(w.C,{disabled:s,name:ve,"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${Ve} ${i}`}),onValueChange:Se=>{v({target:{name:ve,value:Se}})},indeterminate:fe,value:V})):e.createElement(lt,{key:K,justifyContent:"center",alignItems:"center"},J&&e.createElement(ct,null),e.createElement(w.C,{disabled:s,indeterminate:J,name:ve,onValueChange:Se=>{M({target:{name:ve,value:Se}})},value:V})):e.createElement(Ue,{key:K}))),c&&e.createElement(W,{headerBreadCrumbs:[i,"Settings.permissions.conditions.conditions"],actions:I,isFormDisabled:s,onClosed:j,onToggle:N})),e.createElement(Ut,null,e.createElement(oe,{onClick:N,hasConditions:te})))};ut.propTypes={availableActions:a().array.isRequired,isActive:a().bool.isRequired,isGrey:a().bool.isRequired,isFormDisabled:a().bool.isRequired,label:a().string.isRequired,onClickToggle:a().func.isRequired,pathToData:a().string.isRequired};var Kt=ut;const zt=f.ZP.span`
109
109
  color: ${({theme:t})=>t.colors.danger700};
110
110
  padding-left: ${({theme:t})=>t.spaces[1]}px;
111
111
  `;var mt=()=>e.createElement(zt,null,"*"),Xt=(t,n)=>t.map(o=>{const s=Array.isArray(o.subjects)&&o.subjects.indexOf(n)!==-1;return{...o,isDisplayed:s}});const wt=(0,f.ZP)(p.x)`
@@ -156,7 +156,7 @@
156
156
  background-color: ${({theme:t})=>t.colors.primary200};
157
157
  border-top-left-radius: 2px;
158
158
  border-top-right-radius: 2px;
159
- `,Ye=({childrenForm:t,isFormDisabled:n,recursiveLevel:o,pathToDataFromActionRow:s,propertyActions:i,parentName:l,propertyName:d})=>{const{formatMessage:c}=(0,H.Z)(),{modifiedData:m,onChangeParentCheckbox:u,onChangeSimpleCheckbox:g}=(0,G.$_)(),[v,M]=(0,e.useState)(null),N=E=>{M(h=>h===E?null:E)},j=(0,e.useMemo)(()=>v?t.find(({value:E})=>E===v):null,[v,t]);return e.createElement(qt,null,e.createElement(tn,null),t.map(({label:E,value:h,required:L,children:$},I)=>{const ne=I+1<t.length,K=Array.isArray($),J=v===h;return e.createElement(_t,{key:h,isVisible:ne},e.createElement(Qt,null,e.createElement(Jt,{color:"primary200"}),e.createElement(C.k,{style:{flex:1}},e.createElement(en,{level:o,isActive:J,isCollapsable:K},e.createElement(ot,{alignItems:"center",isCollapsable:K,...K&&{onClick:()=>N(h),"aria-expanded":J,onKeyDown:({key:V})=>(V==="Enter"||V===" ")&&N(h),tabIndex:0,role:"button"},title:E},e.createElement(T.Z,{ellipsis:!0},ue()(E)),L&&e.createElement(mt,null),e.createElement(Ne,{$isActive:J}))),e.createElement(C.k,{style:{flex:1}},i.map(({actionId:V,label:fe,isActionRelatedToCurrentProperty:Ie})=>{if(!Ie)return e.createElement(Ue,{key:V});const se=[...s.split(".."),V,"properties",d,...l.split(".."),h],ve=y()(m,se,!1);if(!$)return e.createElement(pt,{key:fe,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{disabled:n,name:se.join(".."),"aria-label":c({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${l} ${E} ${fe}`}),onValueChange:Me=>{g({target:{name:se.join(".."),value:Me}})},value:ve}));const{hasAllActionsSelected:Ve,hasSomeActionsSelected:Se}=Te(ve);return e.createElement(pt,{key:fe,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{key:fe,disabled:n,name:se.join(".."),"aria-label":c({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${l} ${E} ${fe}`}),onValueChange:Me=>{u({target:{name:se.join(".."),value:Me}})},value:Ve,indeterminate:Se}))})))),j&&J&&e.createElement(p.x,{paddingBottom:2},e.createElement(Ye,{isFormDisabled:n,parentName:`${l}..${h}`,pathToDataFromActionRow:s,propertyActions:i,propertyName:d,recursiveLevel:o+1,childrenForm:j.children})))}))};Ye.propTypes={childrenForm:a().array.isRequired,isFormDisabled:a().bool.isRequired,parentName:a().string.isRequired,pathToDataFromActionRow:a().string.isRequired,propertyActions:a().array.isRequired,propertyName:a().string.isRequired,recursiveLevel:a().number.isRequired};var nn=(0,e.memo)(Ye);const sn=t=>t.reduce((o,s)=>(s.isActionRelatedToCurrentProperty&&o.push(s.actionId),o),[]);var on=(t,n,o,s,i)=>{const d=sn(t).reduce((c,m)=>{const u=[...o.split(".."),m,"properties",s,i],g=y()(n,u,!1);return c[m]=g,c},{});return Te(d)};const gt=(0,f.ZP)(C.k)`
159
+ `,Ye=({childrenForm:t,isFormDisabled:n,recursiveLevel:o,pathToDataFromActionRow:s,propertyActions:i,parentName:l,propertyName:d})=>{const{formatMessage:c}=(0,H.Z)(),{modifiedData:m,onChangeParentCheckbox:u,onChangeSimpleCheckbox:g}=(0,G.$_)(),[v,M]=(0,e.useState)(null),N=E=>{M(h=>h===E?null:E)},j=(0,e.useMemo)(()=>v?t.find(({value:E})=>E===v):null,[v,t]);return e.createElement(qt,null,e.createElement(tn,null),t.map(({label:E,value:h,required:L,children:$},I)=>{const te=I+1<t.length,K=Array.isArray($),J=v===h;return e.createElement(_t,{key:h,isVisible:te},e.createElement(Qt,null,e.createElement(Jt,{color:"primary200"}),e.createElement(C.k,{style:{flex:1}},e.createElement(en,{level:o,isActive:J,isCollapsable:K},e.createElement(ot,{alignItems:"center",isCollapsable:K,...K&&{onClick:()=>N(h),"aria-expanded":J,onKeyDown:({key:V})=>(V==="Enter"||V===" ")&&N(h),tabIndex:0,role:"button"},title:E},e.createElement(T.Z,{ellipsis:!0},ce()(E)),L&&e.createElement(mt,null),e.createElement(Ne,{$isActive:J}))),e.createElement(C.k,{style:{flex:1}},i.map(({actionId:V,label:fe,isActionRelatedToCurrentProperty:Ie})=>{if(!Ie)return e.createElement(Ue,{key:V});const se=[...s.split(".."),V,"properties",d,...l.split(".."),h],ve=y()(m,se,!1);if(!$)return e.createElement(pt,{key:fe,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{disabled:n,name:se.join(".."),"aria-label":c({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${l} ${E} ${fe}`}),onValueChange:Me=>{g({target:{name:se.join(".."),value:Me}})},value:ve}));const{hasAllActionsSelected:Ve,hasSomeActionsSelected:Se}=Te(ve);return e.createElement(pt,{key:fe,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{key:fe,disabled:n,name:se.join(".."),"aria-label":c({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${l} ${E} ${fe}`}),onValueChange:Me=>{u({target:{name:se.join(".."),value:Me}})},value:Ve,indeterminate:Se}))})))),j&&J&&e.createElement(p.x,{paddingBottom:2},e.createElement(Ye,{isFormDisabled:n,parentName:`${l}..${h}`,pathToDataFromActionRow:s,propertyActions:i,propertyName:d,recursiveLevel:o+1,childrenForm:j.children})))}))};Ye.propTypes={childrenForm:a().array.isRequired,isFormDisabled:a().bool.isRequired,parentName:a().string.isRequired,pathToDataFromActionRow:a().string.isRequired,propertyActions:a().array.isRequired,propertyName:a().string.isRequired,recursiveLevel:a().number.isRequired};var nn=(0,e.memo)(Ye);const sn=t=>t.reduce((o,s)=>(s.isActionRelatedToCurrentProperty&&o.push(s.actionId),o),[]);var on=(t,n,o,s,i)=>{const d=sn(t).reduce((c,m)=>{const u=[...o.split(".."),m,"properties",s,i],g=y()(n,u,!1);return c[m]=g,c},{});return Te(d)};const gt=(0,f.ZP)(C.k)`
160
160
  width: ${U};
161
161
  position: relative;
162
162
  `,rn=(0,f.ZP)(C.k)`
@@ -173,7 +173,7 @@
173
173
  }
174
174
  `}
175
175
  ${({isActive:t,theme:n})=>t&&We(n)};
176
- `,Je=({childrenForm:t,label:n,isFormDisabled:o,name:s,required:i,pathToData:l,propertyActions:d,propertyName:c,isOdd:m})=>{const{formatMessage:u}=(0,H.Z)(),[g,v]=(0,e.useState)(null),{modifiedData:M,onChangeCollectionTypeLeftActionRowCheckbox:N,onChangeParentCheckbox:j,onChangeSimpleCheckbox:E}=(0,G.$_)(),h=g===s,L=(0,e.useMemo)(()=>Array.isArray(t)?t:[],[t]),$=L.length>0,I=(0,e.useCallback)(()=>{$&&v(V=>V===s?null:s)},[$,s]),ne=({target:{value:V}})=>{N(l,c,s,V)},{hasAllActionsSelected:K,hasSomeActionsSelected:J}=(0,e.useMemo)(()=>on(d,M,l,c,s),[d,M,l,c,s]);return e.createElement(e.Fragment,null,e.createElement(rn,{alignItems:"center",isCollapsable:$,isActive:h,background:m?"neutral100":"neutral0"},e.createElement(C.k,null,e.createElement(rt,{onChange:ne,onClick:I,isCollapsable:$,isFormDisabled:o,label:n,someChecked:J,value:K,isActive:h},i&&e.createElement(mt,null),e.createElement(Ne,{$isActive:h})),e.createElement(C.k,null,d.map(({label:V,isActionRelatedToCurrentProperty:fe,actionId:Ie})=>{if(!fe)return e.createElement(Ue,{key:V});const se=[...l.split(".."),Ie,"properties",c,s];if(!$){const Me=y()(M,se,!1);return e.createElement(gt,{key:Ie,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{disabled:o,name:se.join(".."),"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${s} ${V}`}),onValueChange:ts=>{E({target:{name:se.join(".."),value:ts}})},value:Me}))}const ve=y()(M,se,{}),{hasAllActionsSelected:Ve,hasSomeActionsSelected:Se}=Te(ve);return e.createElement(gt,{key:V,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{disabled:o,name:se.join(".."),onValueChange:Me=>{j({target:{name:se.join(".."),value:Me}})},"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${s} ${V}`}),value:Ve,indeterminate:Se}))})))),h&&e.createElement(nn,{childrenForm:L,isFormDisabled:o,parentName:s,pathToDataFromActionRow:l,propertyName:c,propertyActions:d,recursiveLevel:0}))};Je.defaultProps={childrenForm:[],required:!1},Je.propTypes={childrenForm:a().array,label:a().string.isRequired,isFormDisabled:a().bool.isRequired,name:a().string.isRequired,pathToData:a().string.isRequired,propertyActions:a().array.isRequired,propertyName:a().string.isRequired,required:a().bool,isOdd:a().bool.isRequired};var an=(0,e.memo)(Je);const ft=(0,f.ZP)(C.k)`
176
+ `,Je=({childrenForm:t,label:n,isFormDisabled:o,name:s,required:i,pathToData:l,propertyActions:d,propertyName:c,isOdd:m})=>{const{formatMessage:u}=(0,H.Z)(),[g,v]=(0,e.useState)(null),{modifiedData:M,onChangeCollectionTypeLeftActionRowCheckbox:N,onChangeParentCheckbox:j,onChangeSimpleCheckbox:E}=(0,G.$_)(),h=g===s,L=(0,e.useMemo)(()=>Array.isArray(t)?t:[],[t]),$=L.length>0,I=(0,e.useCallback)(()=>{$&&v(V=>V===s?null:s)},[$,s]),te=({target:{value:V}})=>{N(l,c,s,V)},{hasAllActionsSelected:K,hasSomeActionsSelected:J}=(0,e.useMemo)(()=>on(d,M,l,c,s),[d,M,l,c,s]);return e.createElement(e.Fragment,null,e.createElement(rn,{alignItems:"center",isCollapsable:$,isActive:h,background:m?"neutral100":"neutral0"},e.createElement(C.k,null,e.createElement(rt,{onChange:te,onClick:I,isCollapsable:$,isFormDisabled:o,label:n,someChecked:J,value:K,isActive:h},i&&e.createElement(mt,null),e.createElement(Ne,{$isActive:h})),e.createElement(C.k,null,d.map(({label:V,isActionRelatedToCurrentProperty:fe,actionId:Ie})=>{if(!fe)return e.createElement(Ue,{key:V});const se=[...l.split(".."),Ie,"properties",c,s];if(!$){const Me=y()(M,se,!1);return e.createElement(gt,{key:Ie,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{disabled:o,name:se.join(".."),"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${s} ${V}`}),onValueChange:ts=>{E({target:{name:se.join(".."),value:ts}})},value:Me}))}const ve=y()(M,se,{}),{hasAllActionsSelected:Ve,hasSomeActionsSelected:Se}=Te(ve);return e.createElement(gt,{key:V,justifyContent:"center",alignItems:"center"},e.createElement(w.C,{disabled:o,name:se.join(".."),onValueChange:Me=>{j({target:{name:se.join(".."),value:Me}})},"aria-label":u({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:`${s} ${V}`}),value:Ve,indeterminate:Se}))})))),h&&e.createElement(nn,{childrenForm:L,isFormDisabled:o,parentName:s,pathToDataFromActionRow:l,propertyName:c,propertyActions:d,recursiveLevel:0}))};Je.defaultProps={childrenForm:[],required:!1},Je.propTypes={childrenForm:a().array,label:a().string.isRequired,isFormDisabled:a().bool.isRequired,name:a().string.isRequired,pathToData:a().string.isRequired,propertyActions:a().array.isRequired,propertyName:a().string.isRequired,required:a().bool,isOdd:a().bool.isRequired};var an=(0,e.memo)(Je);const ft=(0,f.ZP)(C.k)`
177
177
  width: ${U};
178
178
  flex-shrink: 0;
179
179
  `,ln=(0,f.ZP)(C.k)`
@@ -213,13 +213,13 @@
213
213
  background: ${n?o.colors.neutral100:o.colors.primary600};
214
214
  }
215
215
  `}
216
- `,Rt=({categoryName:t,isFormDisabled:n,subCategoryName:o,actions:s,pathToData:i})=>{const[l,d]=(0,e.useState)(!1),{modifiedData:c,onChangeParentCheckbox:m,onChangeSimpleCheckbox:u}=(0,G.$_)(),{formatMessage:g}=(0,H.Z)(),v=y()(c,i,{}),M=(0,e.useMemo)(()=>Object.keys(v).reduce((I,ne)=>(I[ne]=ze(v[ne]),I),{}),[v]),{hasAllActionsSelected:N,hasSomeActionsSelected:j}=Te(M),E=()=>{d(I=>!I)},h=()=>{d(!1)},L=On(s,c,i),$=Dn(y()(c,[...i],{}));return e.createElement(e.Fragment,null,e.createElement(p.x,null,e.createElement(C.k,{justifyContent:"space-between",alignItems:"center"},e.createElement(p.x,{paddingRight:4},e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},o)),e.createElement(jn,null),e.createElement(p.x,{paddingLeft:4},e.createElement(xt.X,{name:i.join(".."),disabled:n,onValueChange:I=>{m({target:{name:i.join(".."),value:I}})},indeterminate:j,value:N},g({id:"app.utils.select-all",defaultMessage:"Select all"})))),e.createElement(C.k,{paddingTop:6,paddingBottom:6},e.createElement(Mn.r,{gap:2,style:{flex:1}},L.map(({checkboxName:I,value:ne,action:K,displayName:J,hasConditions:V})=>e.createElement($n.P,{col:3,key:K},e.createElement(Ln,{disabled:n,hasConditions:V},e.createElement(xt.X,{name:I,disabled:n,onValueChange:fe=>{u({target:{name:I,value:fe}})},value:ne},J))))),e.createElement(oe,{hasConditions:$,onClick:E}))),l&&e.createElement(W,{headerBreadCrumbs:[t,o],actions:L,isFormDisabled:n,onClosed:h,onToggle:E}))};Rt.propTypes={actions:a().array.isRequired,categoryName:a().string.isRequired,isFormDisabled:a().bool.isRequired,subCategoryName:a().string.isRequired,pathToData:a().array.isRequired};var kn=Rt;const _e=({childrenForm:t,kind:n,name:o,isOpen:s,isFormDisabled:i,isWhite:l,onOpenCategory:d,pathToData:c})=>{const{formatMessage:m}=(0,H.Z)(),u=()=>{d(o)},g=(0,e.useMemo)(()=>o.split("::").pop(),[o]);return e.createElement(An.U,{expanded:s,onToggle:u,id:`accordion-${o}`,variant:l?"primary":"secondary"},e.createElement(Tn.B,{title:ue()(g),description:`${m({id:"Settings.permissions.category"},{category:g})} ${n==="plugins"?"plugin":n}`}),e.createElement(Sn.v,null,e.createElement(p.x,{padding:6},t.map(({actions:v,subCategoryName:M,subCategoryId:N})=>e.createElement(kn,{key:M,actions:v,categoryName:g,isFormDisabled:i,subCategoryName:M,pathToData:[...c,N]})))))};_e.defaultProps={},_e.propTypes={childrenForm:a().array.isRequired,isOpen:a().bool.isRequired,isFormDisabled:a().bool.isRequired,isWhite:a().bool.isRequired,kind:a().string.isRequired,name:a().string.isRequired,onOpenCategory:a().func.isRequired,pathToData:a().array.isRequired};var In=_e;const Pt=({isFormDisabled:t,kind:n,layout:o})=>{const[s,i]=(0,e.useState)(null),l=d=>{i(d===s?null:d)};return e.createElement(p.x,{padding:6,background:"neutral0"},o.map(({category:d,categoryId:c,childrenForm:m},u)=>e.createElement(In,{key:d,childrenForm:m,kind:n,isFormDisabled:t,isOpen:s===d,isWhite:u%2===1,name:d,onOpenCategory:l,pathToData:[n,c]})))};Pt.propTypes={isFormDisabled:a().bool.isRequired,kind:a().string.isRequired,layout:a().arrayOf(a().shape({category:a().string.isRequired,categoryId:a().string.isRequired,childrenForm:a().arrayOf(a().shape({actions:a().array.isRequired})).isRequired}).isRequired).isRequired};var At=Pt,Zn=r(86349),Bn=r.n(Zn),Fn=r(3040),ge=r.n(Fn),Tt=(t,n,o)=>t.find(s=>s.action===n&&s.subject===o);const St=(t,n=[])=>t.reduce((o,s)=>(o[s.id]=n.indexOf(s.id)!==-1,o),{}),Mt=({children:t},n,o="")=>t.reduce((s,i)=>{if(i.children)return{...s,[i.value]:Mt(i,n,`${o}${i.value}.`)};const l=n.indexOf(`${o}${i.value}`)!==-1;return s[i.value]=l,s},{}),Nn=(t,n,o)=>t.reduce((s,i)=>{const l=n.properties.find(({value:d})=>d===i);if(l){const d=y()(o,["properties",l.value],[]),c=Mt(l,d);s.properties[i]=c}return s},{properties:{}}),Wn=(t,n)=>n.reduce((o,s)=>{const i=t.find(({uid:l})=>l===s)||null;return i&&(o[s]=i),o},{});var $t=({subjects:t},n,o,s=[])=>n.reduce((i,l)=>{const d=l.subjects,c=Wn(t,d);if(D()(c))return i;const m=Object.keys(c).reduce((u,g)=>{const{actionId:v,applyToProperties:M}=l,E=c[g].properties.map(({value:I})=>I).every(I=>(M||[]).indexOf(I)===-1),h=Tt(s,v,g),L=St(o,y()(h,"conditions",[]));if(D()(M)||E)return ge()(u,[g,v],{properties:{enabled:h!==void 0},conditions:L}),u;const $=Nn(M,c[g],h);return ge()(u,[g,v],{...$,conditions:L}),u},{});return Bn()(i,m)},{});const Vn=(t,n,o)=>t.reduce((s,i)=>{const l=Tt(o,i.action,null);return s[i.action]={properties:{enabled:l!==void 0},conditions:St(n,l?.conditions??[])},s},{}),Hn=(t,n,o)=>t.reduce((s,i)=>(s[i.subCategoryId]=Vn(i.actions,n,o),s),{});var Ot=(t,n,o=[])=>t.reduce((s,{categoryId:i,childrenForm:l})=>{const d=Hn(l,n,o);return s[i]=d,s},{});const Dt=t=>t.split(" ").join("-");var jt=(t,n)=>Object.entries(ce()(t,n)).map(([o,s])=>({category:o,categoryId:Dt(o),childrenForm:Object.entries(ce()(s,"subCategory")).map(([i,l])=>({subCategoryName:i,subCategoryId:Dt(i),actions:l}))})),Gn=(t,n)=>{const{conditions:o,sections:{collectionTypes:s,singleTypes:i,plugins:l,settings:d}}=t,c={collectionTypes:s,singleTypes:i,plugins:jt(l,"plugin"),settings:jt(d,"category")},m={collectionTypes:$t(s,s.actions||[],o,n),singleTypes:$t(i,i.actions||[],o,n),plugins:Ot(c.plugins,o,n),settings:Ot(c.settings,o,n)};return{initialData:m,modifiedData:m,layouts:c}},Un=r(99381),et=r.n(Un);const Lt=t=>Object.keys(t).reduce((n,o)=>{const s=t[o];if(be()(s)&&!S()(s,"conditions"))return{...n,[o]:Lt(s)};if(be()(s)&&S()(s,"conditions")&&!ke(Y()(s,"conditions")).some(l=>l)){const l=Object.keys(s.conditions).reduce((d,c)=>(d[c]=!1,d),{});return{...n,[o]:{...s,conditions:l}}}return n[o]=s,n},{});var tt=Lt;const kt=(t,n,o=!1)=>Object.keys(t).reduce((s,i)=>{const l=t[i];return i==="conditions"&&!o?(s[i]=l,s):be()(l)?{...s,[i]:kt(l,n,i==="fields")}:(s[i]=n,s)},{});var Ge=kt;const Kn={initialData:{},modifiedData:{},layouts:{}};var zn=(t,n)=>(0,q.ZP)(t,o=>{switch(n.type){case"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX":{const{collectionTypeKind:s,actionId:i,value:l}=n,d=["modifiedData",s];Object.keys(y()(t,d)).forEach(c=>{const m=y()(t,[...d,c,i],void 0);if(m){let u=Ge(m,l);if(!l&&u.conditions){const g=Ge(u.conditions,!1);u={...u,conditions:g}}ge()(o,[...d,c,i],u)}});break}case"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX":{const{pathToCollectionType:s,propertyName:i,rowName:l,value:d}=n;let c=et()(t.modifiedData);const m=s.split(".."),u=y()(c,m,{});Object.keys(u).forEach(g=>{if(S()(u[g],`properties.${i}`)){const v=y()(u,[g,"properties",i,l]),M=[...m,g,"properties",i,l];if(!be()(v))ge()(c,M,d);else{const N=Ge(v,d);ge()(c,M,N)}}}),d||(c=tt(c)),ge()(o,"modifiedData",c);break}case"ON_CHANGE_CONDITIONS":{Object.entries(n.conditions).forEach(s=>{const[i,l]=s;ge()(o,["modifiedData",...i.split(".."),"conditions"],l)});break}case"ON_CHANGE_SIMPLE_CHECKBOX":{let s=et()(t.modifiedData);ge()(s,[...n.keys.split("..")],n.value),n.value||(s=tt(s)),ge()(o,"modifiedData",s);break}case"ON_CHANGE_TOGGLE_PARENT_CHECKBOX":{const{keys:s,value:i}=n,l=[...s.split("..")];let d=et()(t.modifiedData);const c=y()(d,l,{}),m=Ge(c,i);ge()(d,l,m),i||(d=tt(d)),ge()(o,["modifiedData"],d);break}case"RESET_FORM":{o.modifiedData=t.initialData;break}case"SET_FORM_AFTER_SUBMIT":{o.initialData=t.modifiedData;break}default:return o}});const nt=t=>Object.entries(t).filter(([,n])=>n).map(([n])=>n),Xn=t=>{const[n,{conditions:o}]=t;return{action:n,subject:null,conditions:nt(o),properties:{}}},wn=t=>Object.values(t).reduce((n,o)=>{const s=Object.entries(o).reduce((i,l)=>{const[,{properties:{enabled:d}}]=l;if(!d)return i;const c=Xn(l);return i.push(c),i},[]);return[...n,...s]},[]);var It=t=>Object.values(t).reduce((n,o)=>{const s=wn(o);return[...n,...s]},[]);const Zt=(t,n="")=>Object.entries(t).reduce((o,s)=>{const[i,l]=s;return be()(l)?[...o,...Zt(l,`${n}${i}.`)]:(l&&!be()(l)&&o.push(`${n}${i}`),o)},[]),Yn=(t,n,{conditions:o,properties:s})=>Object.entries(s).reduce((i,l)=>{const[d,c]=l;return i.properties[d]=Zt(c),i},{action:t,subject:n,conditions:nt(o),properties:{}}),Jn=(t,n,{conditions:o})=>({action:t,subject:n,properties:{},conditions:nt(o)}),Qn=(t,n)=>Object.entries(n).reduce((s,i)=>{const[l,d]=i;if(!ke(d).some(u=>u))return s;if(!d?.properties?.enabled){const u=Yn(l,t,d);return[...s,u]}if(!d.properties.enabled)return s;const m=Jn(l,t,d);return s.push(m),s},[]);var Bt=t=>Object.entries(t).reduce((o,s)=>{const[i,l]=s,d=Qn(i,l);return[...o,...d]},[]),qn=t=>{const n=It(t.plugins),o=It(t.settings),s=Bt(t.collectionTypes),i=Bt(t.singleTypes);return[...n,...o,...s,...i]},_n=[{labelId:"app.components.LeftMenuLinkContainer.collectionTypes",defaultMessage:"Collection Types",id:"collectionTypes"},{labelId:"app.components.LeftMenuLinkContainer.singleTypes",id:"singleTypes",defaultMessage:"Single Types"},{labelId:"app.components.LeftMenuLinkContainer.plugins",defaultMessage:"Plugins",id:"plugins"},{labelId:"app.components.LeftMenuLinkContainer.settings",defaultMessage:"Settings",id:"settings"}];const st=(0,e.forwardRef)(({layout:t,isFormDisabled:n,permissions:o},s)=>{const[{initialData:i,layouts:l,modifiedData:d},c]=(0,e.useReducer)(zn,Kn,()=>Gn(t,o)),{formatMessage:m}=(0,H.Z)();(0,e.useImperativeHandle)(s,()=>({getPermissions(){const j=(0,Z.e5)(i.collectionTypes,d.collectionTypes),E=(0,Z.e5)(i.singleTypes,d.singleTypes),h={...j,...E};let L;return D()(h)?L=!1:L=Object.values(h).some($=>Object.values($).some(I=>S()(I,"conditions"))),{permissionsToSend:qn(d),didUpdateConditions:L}},resetForm(){c({type:"RESET_FORM"})},setFormAfterSubmit(){c({type:"SET_FORM_AFTER_SUBMIT"})}}));const u=(j,E,h,L)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX",pathToCollectionType:j,propertyName:E,rowName:h,value:L})},g=(j,E,h)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX",collectionTypeKind:j,actionId:E,value:h})},v=j=>{c({type:"ON_CHANGE_CONDITIONS",conditions:j})},M=(0,e.useCallback)(({target:{name:j,value:E}})=>{c({type:"ON_CHANGE_SIMPLE_CHECKBOX",keys:j,value:E})},[]),N=(0,e.useCallback)(({target:{name:j,value:E}})=>{c({type:"ON_CHANGE_TOGGLE_PARENT_CHECKBOX",keys:j,value:E})},[]);return e.createElement(Pn,{value:{availableConditions:t.conditions,modifiedData:d,onChangeConditions:v,onChangeSimpleCheckbox:M,onChangeParentCheckbox:N,onChangeCollectionTypeLeftActionRowCheckbox:u,onChangeCollectionTypeGlobalActionCheckbox:g}},e.createElement(b.v,{id:"tabs",label:m({id:"Settings.permissions.users.tabs.label",defaultMessage:"Tabs Permissions"})},e.createElement(P.m,null,_n.map(j=>e.createElement(P.O,{key:j.id},m({id:j.labelId,defaultMessage:j.defaultMessage})))),e.createElement(R.n,{style:{position:"relative"}},e.createElement(R.x,null,e.createElement(Et,{layout:l.collectionTypes,kind:"collectionTypes",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(Et,{layout:l.singleTypes,kind:"singleTypes",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(At,{layout:l.plugins,kind:"plugins",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(At,{layout:l.settings,kind:"settings",isFormDisabled:n})))))});st.defaultProps={permissions:[],layout:{conditions:[],sections:{collectionTypes:{},singleTypes:{actions:[]},settings:[],plugins:[]}}},st.propTypes={layout:a().object,isFormDisabled:a().bool.isRequired,permissions:a().array};var es=(0,e.memo)(st)},33778:function(X,B,r){"use strict";r.r(B),r.d(B,{default:function(){return T}});var e=r(32735),b=r(19565),P=r(15062),R=r(53038),Z=r(78125),O=r(27649),S=r(82055),x=r(87933),D=r(41415),_=r(17e3),a=r(72850),H=r(29439),p=r(92802),A=r(33795),F=r.n(A),f=r(67879),C=r(10328),w=r(7247),me=r(49372),ie=r(15335),le=r(5803),y=r(10369),de=r(33475),Y=r(60216),G=r.n(Y);const ee=({disabled:Q,role:z,values:k,errors:q,onChange:re,onBlur:ce})=>{const{formatMessage:te}=(0,f.Z)();return e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(x.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(x.k,{justifyContent:"space-between"},e.createElement(a.x,null,e.createElement(a.x,null,e.createElement(me.Z,{fontWeight:"bold"},z?z.name:te({id:"global.details",defaultMessage:"Details"}))),e.createElement(a.x,null,e.createElement(me.Z,{textColor:"neutral500",variant:"pi"},z?z.description:te({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(D.z,{disabled:!0,variant:"secondary"},te({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:z.usersCount}))),e.createElement(ie.r,{gap:4},e.createElement(le.P,{col:6},e.createElement(y.o,{disabled:Q,name:"name",error:q.name&&te({id:q.name}),label:te({id:"global.name",defaultMessage:"Name"}),onChange:re,onBlur:ce,value:k.name||""})),e.createElement(le.P,{col:6},e.createElement(de.g,{disabled:Q,label:te({id:"global.description",defaultMessage:"Description"}),id:"description",error:q.name&&te({id:q.name}),onChange:re,onBlur:ce},k.description||"")))))};ee.defaultProps={disabled:!1,role:null,values:{name:"",description:""}},ee.propTypes={disabled:G().bool,errors:G().object.isRequired,onBlur:G().func.isRequired,onChange:G().func.isRequired,role:G().object,values:G().object};var xe=ee,pe=r(24346),oe=pe.Ry().shape({name:pe.Z_().required(b.I0.required)}),Ee=()=>{const Q=(0,b.lm)(),{formatMessage:z}=(0,f.Z)(),{params:{id:k}}=(0,R.$B)("/settings/roles/:id"),[q,re]=(0,e.useState)(!1),ce=(0,e.useRef)(),{lockApp:te,unlockApp:ue}=(0,b.o1)(),{trackUsage:Ze}=(0,b.rS)(),{isLoading:Ae,data:Be}=(0,C.U_)(k),{role:he,permissions:Oe,isLoading:De,onSubmitSucceeded:Fe}=(0,C.Dq)(k),{put:je}=(0,b.kY)(),He=async ae=>{try{te(),re(!0);const{permissionsToSend:W,didUpdateConditions:U}=ce.current.getPermissions();await je(`/admin/roles/${k}`,ae),he.code!=="strapi-super-admin"&&(await je(`/admin/roles/${k}/permissions`,{permissions:W}),U&&Ze("didUpdateConditions")),ce.current.setFormAfterSubmit(),Fe({name:ae.name,description:ae.description}),Q({type:"success",message:{id:"notification.success.saved"}})}catch(W){console.error(W.response);const U=F()(W,"response.payload.message","An error occured"),ye=F()(W,"response.payload.data.permissions[0]",U);Q({type:"warning",message:ye})}finally{re(!1),ue()}},Le=he.code==="strapi-super-admin";return e.createElement(O.o,null,e.createElement(b.SL,{name:"Roles"}),e.createElement(p.J9,{enableReinitialize:!0,initialValues:{name:he.name,description:he.description},onSubmit:He,validationSchema:oe,validateOnChange:!1},({handleSubmit:ae,values:W,errors:U,handleChange:ye,handleBlur:Ce})=>e.createElement("form",{onSubmit:ae},e.createElement(S.T,{primaryAction:e.createElement(x.k,{gap:2},e.createElement(D.z,{disabled:he.code==="strapi-super-admin",onClick:ae,loading:q,size:"L"},z({id:"global.save",defaultMessage:"Save"}))),title:z({id:"Settings.roles.edit.title",defaultMessage:"Edit a role"}),subtitle:z({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(b.rU,{startIcon:e.createElement(H.Z,null),to:"/settings/roles"},z({id:"global.back",defaultMessage:"Back"}))}),e.createElement(_.D,null,e.createElement(x.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(xe,{isLoading:De,disabled:Le,errors:U,values:W,onChange:ye,onBlur:Ce,role:he}),!Ae&&!De?e.createElement(a.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(w.Z,{isFormDisabled:Le,permissions:Oe,ref:ce,layout:Be})):e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(b.dO,null)))))))},T=()=>{const Q=(0,P.v9)(Z._),z=e.useMemo(()=>({read:Q.settings.roles.read,update:Q.settings.roles.update}),[Q.settings.roles.read,Q.settings.roles.update]),{isLoading:k,allowedActions:{canRead:q,canUpdate:re}}=(0,b.ss)(z);return k?e.createElement(b.dO,null):!q&&!re?e.createElement(R.l_,{to:"/"}):e.createElement(Ee,null)}},84802:function(X){function B(r,e,b,P){for(var R=-1,Z=r==null?0:r.length;++R<Z;){var O=r[R];e(P,O,b(O),r)}return P}X.exports=B},62435:function(X,B,r){var e=r(56671);function b(P,R,Z,O){return e(P,function(S,x,D){R(O,S,Z(S),D)}),O}X.exports=b},85580:function(X,B,r){var e=r(84802),b=r(62435),P=r(88904),R=r(77236);function Z(O,S){return function(x,D){var _=R(x)?e:b,a=S?S():{};return _(x,O,P(D,2),a)}}X.exports=Z},72091:function(X,B,r){var e=r(40314),b=1/0;function P(R){var Z=R==null?0:R.length;return Z?e(R,b):[]}X.exports=P},81346:function(X,B,r){var e=r(40999),b=r(85580),P=Object.prototype,R=P.hasOwnProperty,Z=b(function(O,S,x){R.call(O,x)?O[x].push(S):e(O,x,[S])});X.exports=Z},83828:function(X,B,r){"use strict";r.d(B,{U:function(){return H},y:function(){return _}});var e=r(74512),b=r(32735),P=r(8471),R=r(91045),Z=r(74971),O=r(49372),S=r(87933),x=r(72850);const D=({theme:p,expanded:A,variant:F,disabled:f,error:C})=>C?`1px solid ${p.colors.danger600} !important`:f?`1px solid ${p.colors.neutral150}`:A?`1px solid ${p.colors.primary600}`:F==="primary"?`1px solid ${p.colors.neutral0}`:`1px solid ${p.colors.neutral100}`,_=(0,P.ZP)(O.Z)``,a=(0,P.ZP)(x.x)`
216
+ `,Rt=({categoryName:t,isFormDisabled:n,subCategoryName:o,actions:s,pathToData:i})=>{const[l,d]=(0,e.useState)(!1),{modifiedData:c,onChangeParentCheckbox:m,onChangeSimpleCheckbox:u}=(0,G.$_)(),{formatMessage:g}=(0,H.Z)(),v=y()(c,i,{}),M=(0,e.useMemo)(()=>Object.keys(v).reduce((I,te)=>(I[te]=ze(v[te]),I),{}),[v]),{hasAllActionsSelected:N,hasSomeActionsSelected:j}=Te(M),E=()=>{d(I=>!I)},h=()=>{d(!1)},L=On(s,c,i),$=Dn(y()(c,[...i],{}));return e.createElement(e.Fragment,null,e.createElement(p.x,null,e.createElement(C.k,{justifyContent:"space-between",alignItems:"center"},e.createElement(p.x,{paddingRight:4},e.createElement(T.Z,{variant:"sigma",textColor:"neutral600"},o)),e.createElement(jn,null),e.createElement(p.x,{paddingLeft:4},e.createElement(xt.X,{name:i.join(".."),disabled:n,onValueChange:I=>{m({target:{name:i.join(".."),value:I}})},indeterminate:j,value:N},g({id:"app.utils.select-all",defaultMessage:"Select all"})))),e.createElement(C.k,{paddingTop:6,paddingBottom:6},e.createElement(Mn.r,{gap:2,style:{flex:1}},L.map(({checkboxName:I,value:te,action:K,displayName:J,hasConditions:V})=>e.createElement($n.P,{col:3,key:K},e.createElement(Ln,{disabled:n,hasConditions:V},e.createElement(xt.X,{name:I,disabled:n,onValueChange:fe=>{u({target:{name:I,value:fe}})},value:te},J))))),e.createElement(oe,{hasConditions:$,onClick:E}))),l&&e.createElement(W,{headerBreadCrumbs:[t,o],actions:L,isFormDisabled:n,onClosed:h,onToggle:E}))};Rt.propTypes={actions:a().array.isRequired,categoryName:a().string.isRequired,isFormDisabled:a().bool.isRequired,subCategoryName:a().string.isRequired,pathToData:a().array.isRequired};var kn=Rt;const _e=({childrenForm:t,kind:n,name:o,isOpen:s,isFormDisabled:i,isWhite:l,onOpenCategory:d,pathToData:c})=>{const{formatMessage:m}=(0,H.Z)(),u=()=>{d(o)},g=(0,e.useMemo)(()=>o.split("::").pop(),[o]);return e.createElement(An.U,{expanded:s,onToggle:u,id:`accordion-${o}`,variant:l?"primary":"secondary"},e.createElement(Tn.B,{title:ce()(g),description:`${m({id:"Settings.permissions.category"},{category:g})} ${n==="plugins"?"plugin":n}`}),e.createElement(Sn.v,null,e.createElement(p.x,{padding:6},t.map(({actions:v,subCategoryName:M,subCategoryId:N})=>e.createElement(kn,{key:M,actions:v,categoryName:g,isFormDisabled:i,subCategoryName:M,pathToData:[...c,N]})))))};_e.defaultProps={},_e.propTypes={childrenForm:a().array.isRequired,isOpen:a().bool.isRequired,isFormDisabled:a().bool.isRequired,isWhite:a().bool.isRequired,kind:a().string.isRequired,name:a().string.isRequired,onOpenCategory:a().func.isRequired,pathToData:a().array.isRequired};var In=_e;const Pt=({isFormDisabled:t,kind:n,layout:o})=>{const[s,i]=(0,e.useState)(null),l=d=>{i(d===s?null:d)};return e.createElement(p.x,{padding:6,background:"neutral0"},o.map(({category:d,categoryId:c,childrenForm:m},u)=>e.createElement(In,{key:d,childrenForm:m,kind:n,isFormDisabled:t,isOpen:s===d,isWhite:u%2===1,name:d,onOpenCategory:l,pathToData:[n,c]})))};Pt.propTypes={isFormDisabled:a().bool.isRequired,kind:a().string.isRequired,layout:a().arrayOf(a().shape({category:a().string.isRequired,categoryId:a().string.isRequired,childrenForm:a().arrayOf(a().shape({actions:a().array.isRequired})).isRequired}).isRequired).isRequired};var At=Pt,Zn=r(86349),Bn=r.n(Zn),Fn=r(3040),ge=r.n(Fn),Tt=(t,n,o)=>t.find(s=>s.action===n&&s.subject===o);const St=(t,n=[])=>t.reduce((o,s)=>(o[s.id]=n.indexOf(s.id)!==-1,o),{}),Mt=({children:t},n,o="")=>t.reduce((s,i)=>{if(i.children)return{...s,[i.value]:Mt(i,n,`${o}${i.value}.`)};const l=n.indexOf(`${o}${i.value}`)!==-1;return s[i.value]=l,s},{}),Nn=(t,n,o)=>t.reduce((s,i)=>{const l=n.properties.find(({value:d})=>d===i);if(l){const d=y()(o,["properties",l.value],[]),c=Mt(l,d);s.properties[i]=c}return s},{properties:{}}),Wn=(t,n)=>n.reduce((o,s)=>{const i=t.find(({uid:l})=>l===s)||null;return i&&(o[s]=i),o},{});var $t=({subjects:t},n,o,s=[])=>n.reduce((i,l)=>{const d=l.subjects,c=Wn(t,d);if(D()(c))return i;const m=Object.keys(c).reduce((u,g)=>{const{actionId:v,applyToProperties:M}=l,E=c[g].properties.map(({value:I})=>I).every(I=>(M||[]).indexOf(I)===-1),h=Tt(s,v,g),L=St(o,y()(h,"conditions",[]));if(D()(M)||E)return ge()(u,[g,v],{properties:{enabled:h!==void 0},conditions:L}),u;const $=Nn(M,c[g],h);return ge()(u,[g,v],{...$,conditions:L}),u},{});return Bn()(i,m)},{});const Vn=(t,n,o)=>t.reduce((s,i)=>{const l=Tt(o,i.action,null);return s[i.action]={properties:{enabled:l!==void 0},conditions:St(n,l?.conditions??[])},s},{}),Hn=(t,n,o)=>t.reduce((s,i)=>(s[i.subCategoryId]=Vn(i.actions,n,o),s),{});var Ot=(t,n,o=[])=>t.reduce((s,{categoryId:i,childrenForm:l})=>{const d=Hn(l,n,o);return s[i]=d,s},{});const Dt=t=>t.split(" ").join("-");var jt=(t,n)=>Object.entries(de()(t,n)).map(([o,s])=>({category:o,categoryId:Dt(o),childrenForm:Object.entries(de()(s,"subCategory")).map(([i,l])=>({subCategoryName:i,subCategoryId:Dt(i),actions:l}))})),Gn=(t,n)=>{const{conditions:o,sections:{collectionTypes:s,singleTypes:i,plugins:l,settings:d}}=t,c={collectionTypes:s,singleTypes:i,plugins:jt(l,"plugin"),settings:jt(d,"category")},m={collectionTypes:$t(s,s.actions||[],o,n),singleTypes:$t(i,i.actions||[],o,n),plugins:Ot(c.plugins,o,n),settings:Ot(c.settings,o,n)};return{initialData:m,modifiedData:m,layouts:c}},Un=r(99381),et=r.n(Un);const Lt=t=>Object.keys(t).reduce((n,o)=>{const s=t[o];if(be()(s)&&!S()(s,"conditions"))return{...n,[o]:Lt(s)};if(be()(s)&&S()(s,"conditions")&&!ke(Y()(s,"conditions")).some(l=>l)){const l=Object.keys(s.conditions).reduce((d,c)=>(d[c]=!1,d),{});return{...n,[o]:{...s,conditions:l}}}return n[o]=s,n},{});var tt=Lt;const kt=(t,n,o=!1)=>Object.keys(t).reduce((s,i)=>{const l=t[i];return i==="conditions"&&!o?(s[i]=l,s):be()(l)?{...s,[i]:kt(l,n,i==="fields")}:(s[i]=n,s)},{});var Ge=kt;const Kn={initialData:{},modifiedData:{},layouts:{}};var zn=(t,n)=>(0,Q.ZP)(t,o=>{switch(n.type){case"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX":{const{collectionTypeKind:s,actionId:i,value:l}=n,d=["modifiedData",s];Object.keys(y()(t,d)).forEach(c=>{const m=y()(t,[...d,c,i],void 0);if(m){let u=Ge(m,l);if(!l&&u.conditions){const g=Ge(u.conditions,!1);u={...u,conditions:g}}ge()(o,[...d,c,i],u)}});break}case"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX":{const{pathToCollectionType:s,propertyName:i,rowName:l,value:d}=n;let c=et()(t.modifiedData);const m=s.split(".."),u=y()(c,m,{});Object.keys(u).forEach(g=>{if(S()(u[g],`properties.${i}`)){const v=y()(u,[g,"properties",i,l]),M=[...m,g,"properties",i,l];if(!be()(v))ge()(c,M,d);else{const N=Ge(v,d);ge()(c,M,N)}}}),d||(c=tt(c)),ge()(o,"modifiedData",c);break}case"ON_CHANGE_CONDITIONS":{Object.entries(n.conditions).forEach(s=>{const[i,l]=s;ge()(o,["modifiedData",...i.split(".."),"conditions"],l)});break}case"ON_CHANGE_SIMPLE_CHECKBOX":{let s=et()(t.modifiedData);ge()(s,[...n.keys.split("..")],n.value),n.value||(s=tt(s)),ge()(o,"modifiedData",s);break}case"ON_CHANGE_TOGGLE_PARENT_CHECKBOX":{const{keys:s,value:i}=n,l=[...s.split("..")];let d=et()(t.modifiedData);const c=y()(d,l,{}),m=Ge(c,i);ge()(d,l,m),i||(d=tt(d)),ge()(o,["modifiedData"],d);break}case"RESET_FORM":{o.modifiedData=t.initialData;break}case"SET_FORM_AFTER_SUBMIT":{o.initialData=t.modifiedData;break}default:return o}});const nt=t=>Object.entries(t).filter(([,n])=>n).map(([n])=>n),Xn=t=>{const[n,{conditions:o}]=t;return{action:n,subject:null,conditions:nt(o),properties:{}}},wn=t=>Object.values(t).reduce((n,o)=>{const s=Object.entries(o).reduce((i,l)=>{const[,{properties:{enabled:d}}]=l;if(!d)return i;const c=Xn(l);return i.push(c),i},[]);return[...n,...s]},[]);var It=t=>Object.values(t).reduce((n,o)=>{const s=wn(o);return[...n,...s]},[]);const Zt=(t,n="")=>Object.entries(t).reduce((o,s)=>{const[i,l]=s;return be()(l)?[...o,...Zt(l,`${n}${i}.`)]:(l&&!be()(l)&&o.push(`${n}${i}`),o)},[]),Yn=(t,n,{conditions:o,properties:s})=>Object.entries(s).reduce((i,l)=>{const[d,c]=l;return i.properties[d]=Zt(c),i},{action:t,subject:n,conditions:nt(o),properties:{}}),Jn=(t,n,{conditions:o})=>({action:t,subject:n,properties:{},conditions:nt(o)}),Qn=(t,n)=>Object.entries(n).reduce((s,i)=>{const[l,d]=i;if(!ke(d).some(u=>u))return s;if(!d?.properties?.enabled){const u=Yn(l,t,d);return[...s,u]}if(!d.properties.enabled)return s;const m=Jn(l,t,d);return s.push(m),s},[]);var Bt=t=>Object.entries(t).reduce((o,s)=>{const[i,l]=s,d=Qn(i,l);return[...o,...d]},[]),qn=t=>{const n=It(t.plugins),o=It(t.settings),s=Bt(t.collectionTypes),i=Bt(t.singleTypes);return[...n,...o,...s,...i]},_n=[{labelId:"app.components.LeftMenuLinkContainer.collectionTypes",defaultMessage:"Collection Types",id:"collectionTypes"},{labelId:"app.components.LeftMenuLinkContainer.singleTypes",id:"singleTypes",defaultMessage:"Single Types"},{labelId:"app.components.LeftMenuLinkContainer.plugins",defaultMessage:"Plugins",id:"plugins"},{labelId:"app.components.LeftMenuLinkContainer.settings",defaultMessage:"Settings",id:"settings"}];const st=(0,e.forwardRef)(({layout:t,isFormDisabled:n,permissions:o},s)=>{const[{initialData:i,layouts:l,modifiedData:d},c]=(0,e.useReducer)(zn,Kn,()=>Gn(t,o)),{formatMessage:m}=(0,H.Z)();(0,e.useImperativeHandle)(s,()=>({getPermissions(){const j=(0,Z.e5)(i.collectionTypes,d.collectionTypes),E=(0,Z.e5)(i.singleTypes,d.singleTypes),h={...j,...E};let L;return D()(h)?L=!1:L=Object.values(h).some($=>Object.values($).some(I=>S()(I,"conditions"))),{permissionsToSend:qn(d),didUpdateConditions:L}},resetForm(){c({type:"RESET_FORM"})},setFormAfterSubmit(){c({type:"SET_FORM_AFTER_SUBMIT"})}}));const u=(j,E,h,L)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX",pathToCollectionType:j,propertyName:E,rowName:h,value:L})},g=(j,E,h)=>{c({type:"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX",collectionTypeKind:j,actionId:E,value:h})},v=j=>{c({type:"ON_CHANGE_CONDITIONS",conditions:j})},M=(0,e.useCallback)(({target:{name:j,value:E}})=>{c({type:"ON_CHANGE_SIMPLE_CHECKBOX",keys:j,value:E})},[]),N=(0,e.useCallback)(({target:{name:j,value:E}})=>{c({type:"ON_CHANGE_TOGGLE_PARENT_CHECKBOX",keys:j,value:E})},[]);return e.createElement(Pn,{value:{availableConditions:t.conditions,modifiedData:d,onChangeConditions:v,onChangeSimpleCheckbox:M,onChangeParentCheckbox:N,onChangeCollectionTypeLeftActionRowCheckbox:u,onChangeCollectionTypeGlobalActionCheckbox:g}},e.createElement(b.v,{id:"tabs",label:m({id:"Settings.permissions.users.tabs.label",defaultMessage:"Tabs Permissions"})},e.createElement(P.m,null,_n.map(j=>e.createElement(P.O,{key:j.id},m({id:j.labelId,defaultMessage:j.defaultMessage})))),e.createElement(R.n,{style:{position:"relative"}},e.createElement(R.x,null,e.createElement(Et,{layout:l.collectionTypes,kind:"collectionTypes",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(Et,{layout:l.singleTypes,kind:"singleTypes",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(At,{layout:l.plugins,kind:"plugins",isFormDisabled:n})),e.createElement(R.x,null,e.createElement(At,{layout:l.settings,kind:"settings",isFormDisabled:n})))))});st.defaultProps={permissions:[],layout:{conditions:[],sections:{collectionTypes:{},singleTypes:{actions:[]},settings:[],plugins:[]}}},st.propTypes={layout:a().object,isFormDisabled:a().bool.isRequired,permissions:a().array};var es=(0,e.memo)(st)},33778:function(X,B,r){"use strict";r.r(B),r.d(B,{default:function(){return T}});var e=r(32735),b=r(19565),P=r(15062),R=r(53038),Z=r(78125),O=r(27649),S=r(82055),x=r(87933),D=r(41415),q=r(17e3),a=r(72850),H=r(29439),p=r(92802),A=r(33795),F=r.n(A),f=r(67879),C=r(10328),w=r(7247),ue=r(49372),ae=r(15335),ie=r(5803),y=r(10369),le=r(33475),Y=r(60216),G=r.n(Y);const _=({disabled:ne,role:z,values:k,errors:Q,onChange:pe,onBlur:de})=>{const{formatMessage:ee}=(0,f.Z)();return e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(x.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(x.k,{justifyContent:"space-between"},e.createElement(a.x,null,e.createElement(a.x,null,e.createElement(ue.Z,{fontWeight:"bold"},z?z.name:ee({id:"global.details",defaultMessage:"Details"}))),e.createElement(a.x,null,e.createElement(ue.Z,{textColor:"neutral500",variant:"pi"},z?z.description:ee({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(D.z,{disabled:!0,variant:"secondary"},ee({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:z.usersCount}))),e.createElement(ae.r,{gap:4},e.createElement(ie.P,{col:6},e.createElement(y.o,{disabled:ne,name:"name",error:Q.name&&ee({id:Q.name}),label:ee({id:"global.name",defaultMessage:"Name"}),onChange:pe,onBlur:de,value:k.name||""})),e.createElement(ie.P,{col:6},e.createElement(le.g,{disabled:ne,label:ee({id:"global.description",defaultMessage:"Description"}),id:"description",error:Q.name&&ee({id:Q.name}),onChange:pe,onBlur:de},k.description||"")))))};_.defaultProps={disabled:!1,role:null,values:{name:"",description:""}},_.propTypes={disabled:G().bool,errors:G().object.isRequired,onBlur:G().func.isRequired,onChange:G().func.isRequired,role:G().object,values:G().object};var xe=_,me=r(24346),oe=me.Ry().shape({name:me.Z_().required(b.I0.required)}),Ee=()=>{const ne=(0,b.lm)(),{formatMessage:z}=(0,f.Z)(),{params:{id:k}}=(0,R.$B)("/settings/roles/:id"),[Q,pe]=(0,e.useState)(!1),de=(0,e.useRef)(),{lockApp:ee,unlockApp:ce}=(0,b.o1)(),{trackUsage:Ze}=(0,b.rS)(),{isLoading:Ae,data:Be}=(0,C.U_)(k),{role:he,permissions:Oe,isLoading:De,onSubmitSucceeded:Fe}=(0,C.Dq)(k),{put:je}=(0,b.kY)(),He=async re=>{try{ee(),pe(!0);const{permissionsToSend:W,didUpdateConditions:U}=de.current.getPermissions();await je(`/admin/roles/${k}`,re),he.code!=="strapi-super-admin"&&(await je(`/admin/roles/${k}/permissions`,{permissions:W}),U&&Ze("didUpdateConditions")),de.current.setFormAfterSubmit(),Fe({name:re.name,description:re.description}),ne({type:"success",message:{id:"notification.success.saved"}})}catch(W){console.error(W.response);const U=F()(W,"response.payload.message","An error occured"),ye=F()(W,"response.payload.data.permissions[0]",U);ne({type:"warning",message:ye})}finally{pe(!1),ce()}},Le=he.code==="strapi-super-admin";return e.createElement(O.o,null,e.createElement(b.SL,{name:"Roles"}),e.createElement(p.J9,{enableReinitialize:!0,initialValues:{name:he.name,description:he.description},onSubmit:He,validationSchema:oe,validateOnChange:!1},({handleSubmit:re,values:W,errors:U,handleChange:ye,handleBlur:Ce})=>e.createElement("form",{onSubmit:re},e.createElement(S.T,{primaryAction:e.createElement(x.k,{gap:2},e.createElement(D.z,{disabled:he.code==="strapi-super-admin",onClick:re,loading:Q,size:"L"},z({id:"global.save",defaultMessage:"Save"}))),title:z({id:"Settings.roles.edit.title",defaultMessage:"Edit a role"}),subtitle:z({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(b.rU,{startIcon:e.createElement(H.Z,null),to:"/settings/roles"},z({id:"global.back",defaultMessage:"Back"}))}),e.createElement(q.D,null,e.createElement(x.k,{direction:"column",alignItems:"stretch",gap:6},e.createElement(xe,{isLoading:De,disabled:Le,errors:U,values:W,onChange:ye,onBlur:Ce,role:he}),!Ae&&!De?e.createElement(a.x,{shadow:"filterShadow",hasRadius:!0},e.createElement(w.Z,{isFormDisabled:Le,permissions:Oe,ref:de,layout:Be})):e.createElement(a.x,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(b.dO,null)))))))},T=()=>{const ne=(0,P.v9)(Z._),{isLoading:z,allowedActions:{canRead:k,canUpdate:Q}}=(0,b.ss)({read:ne.settings.roles.read,update:ne.settings.roles.update});return z?e.createElement(b.dO,null):!k&&!Q?e.createElement(R.l_,{to:"/"}):e.createElement(Ee,null)}},84802:function(X){function B(r,e,b,P){for(var R=-1,Z=r==null?0:r.length;++R<Z;){var O=r[R];e(P,O,b(O),r)}return P}X.exports=B},62435:function(X,B,r){var e=r(56671);function b(P,R,Z,O){return e(P,function(S,x,D){R(O,S,Z(S),D)}),O}X.exports=b},85580:function(X,B,r){var e=r(84802),b=r(62435),P=r(88904),R=r(77236);function Z(O,S){return function(x,D){var q=R(x)?e:b,a=S?S():{};return q(x,O,P(D,2),a)}}X.exports=Z},72091:function(X,B,r){var e=r(40314),b=1/0;function P(R){var Z=R==null?0:R.length;return Z?e(R,b):[]}X.exports=P},81346:function(X,B,r){var e=r(40999),b=r(85580),P=Object.prototype,R=P.hasOwnProperty,Z=b(function(O,S,x){R.call(O,x)?O[x].push(S):e(O,x,[S])});X.exports=Z},83828:function(X,B,r){"use strict";r.d(B,{U:function(){return H},y:function(){return q}});var e=r(74512),b=r(32735),P=r(8471),R=r(91045),Z=r(74971),O=r(49372),S=r(87933),x=r(72850);const D=({theme:p,expanded:A,variant:F,disabled:f,error:C})=>C?`1px solid ${p.colors.danger600} !important`:f?`1px solid ${p.colors.neutral150}`:A?`1px solid ${p.colors.primary600}`:F==="primary"?`1px solid ${p.colors.neutral0}`:`1px solid ${p.colors.neutral100}`,q=(0,P.ZP)(O.Z)``,a=(0,P.ZP)(x.x)`
217
217
  border: ${D};
218
218
 
219
219
  &:hover:not([aria-disabled='true']) {
220
220
  border: 1px solid ${({theme:p})=>p.colors.primary600};
221
221
 
222
- ${_} {
222
+ ${q} {
223
223
  color: ${({theme:p,expanded:A})=>A?void 0:p.colors.primary700};
224
224
  }
225
225
 
@@ -235,7 +235,7 @@
235
235
  background: ${({theme:p})=>p.colors.primary200};
236
236
  }
237
237
  }
238
- `,H=({children:p,disabled:A=!1,error:F,expanded:f=!1,hasErrorMessage:C=!0,id:w,onToggle:me,toggle:ie,size:le="M",variant:y="primary",shadow:de})=>{const Y=(0,Z.M)(w),G=b.useMemo(()=>({expanded:f,onToggle:me,toggle:ie,id:Y,size:le,variant:y,disabled:A}),[A,f,Y,me,le,ie,y]);return(0,e.jsxs)(R.S.Provider,{value:G,children:[(0,e.jsx)(a,{"data-strapi-expanded":f,disabled:A,"aria-disabled":A,expanded:f,hasRadius:!0,variant:y,error:F,shadow:de,children:p}),F&&C&&(0,e.jsx)(x.x,{paddingTop:1,children:(0,e.jsx)(O.Z,{variant:"pi",textColor:"danger600",children:F})})]})}},89966:function(X,B,r){"use strict";r.d(B,{v:function(){return R}});var e=r(74512),b=r(91045),P=r(72850);const R=({children:Z,...O})=>{const{expanded:S,id:x}=(0,b.A)();if(!S)return null;const D=`accordion-content-${x}`,_=`accordion-label-${x}`,a=`accordion-desc-${x}`;return(0,e.jsx)(P.x,{role:"region",id:D,"aria-labelledby":_,"aria-describedby":a,...O,children:Z})}},91045:function(X,B,r){"use strict";r.d(B,{A:function(){return P},S:function(){return b}});var e=r(32735);const b=(0,e.createContext)({disabled:!1,expanded:!1,id:"",size:"M",variant:"primary"}),P=()=>(0,e.useContext)(b)},61762:function(X,B,r){"use strict";r.d(B,{B:function(){return p}});var e=r(74512),b=r(16899),P=r(8471),R=r(83828),Z=r(91045);const O=({expanded:A,disabled:F,variant:f})=>{let C="neutral100";return A?C="primary100":F?C="neutral150":f==="primary"&&(C="neutral0"),C};var S=r(7563),x=r(99140),D=r(87933),_=r(49372);const a=(0,P.ZP)(S.A)`
238
+ `,H=({children:p,disabled:A=!1,error:F,expanded:f=!1,hasErrorMessage:C=!0,id:w,onToggle:ue,toggle:ae,size:ie="M",variant:y="primary",shadow:le})=>{const Y=(0,Z.M)(w),G=b.useMemo(()=>({expanded:f,onToggle:ue,toggle:ae,id:Y,size:ie,variant:y,disabled:A}),[A,f,Y,ue,ie,ae,y]);return(0,e.jsxs)(R.S.Provider,{value:G,children:[(0,e.jsx)(a,{"data-strapi-expanded":f,disabled:A,"aria-disabled":A,expanded:f,hasRadius:!0,variant:y,error:F,shadow:le,children:p}),F&&C&&(0,e.jsx)(x.x,{paddingTop:1,children:(0,e.jsx)(O.Z,{variant:"pi",textColor:"danger600",children:F})})]})}},89966:function(X,B,r){"use strict";r.d(B,{v:function(){return R}});var e=r(74512),b=r(91045),P=r(72850);const R=({children:Z,...O})=>{const{expanded:S,id:x}=(0,b.A)();if(!S)return null;const D=`accordion-content-${x}`,q=`accordion-label-${x}`,a=`accordion-desc-${x}`;return(0,e.jsx)(P.x,{role:"region",id:D,"aria-labelledby":q,"aria-describedby":a,...O,children:Z})}},91045:function(X,B,r){"use strict";r.d(B,{A:function(){return P},S:function(){return b}});var e=r(32735);const b=(0,e.createContext)({disabled:!1,expanded:!1,id:"",size:"M",variant:"primary"}),P=()=>(0,e.useContext)(b)},61762:function(X,B,r){"use strict";r.d(B,{B:function(){return p}});var e=r(74512),b=r(16899),P=r(8471),R=r(83828),Z=r(91045);const O=({expanded:A,disabled:F,variant:f})=>{let C="neutral100";return A?C="primary100":F?C="neutral150":f==="primary"&&(C="neutral0"),C};var S=r(7563),x=r(99140),D=r(87933),q=r(49372);const a=(0,P.ZP)(S.A)`
239
239
  text-align: left;
240
240
 
241
241
  // necessary to make the ellipsis prop work on the title
@@ -262,6 +262,6 @@
262
262
  }
263
263
  }
264
264
  }
265
- `,p=({title:A,description:F,as:f="span",togglePosition:C="right",action:w,...me})=>{const{onToggle:ie,toggle:le,expanded:y,id:de,size:Y,variant:G,disabled:ee}=(0,Z.A)(),xe=`accordion-content-${de}`,pe=`accordion-label-${de}`,Re=`accordion-desc-${de}`,oe=Y==="M"?6:4,Pe=Y==="M"?oe:oe-2,Ee=O({expanded:y,disabled:ee,variant:G}),$e={as:f,fontWeight:Y==="S"?"bold":void 0,id:pe,textColor:y?"primary600":"neutral700",ellipsis:!0,variant:Y==="M"?"delta":void 0},T=y?"primary600":"neutral600",Q=y?"primary200":"neutral200",z=Y==="M"?`${32/16}rem`:`${24/16}rem`,k=()=>{ee||(le&&!ie?(console.warn('Deprecation warning: Usage of "toggle" prop in Accordion component is deprecated. This is discouraged and will be removed in the next major release. Please use "onToggle" instead'),le()):ie&&ie())},q=(0,e.jsx)(D.k,{justifyContent:"center",borderRadius:"50%",height:z,width:z,transform:y?"rotate(180deg)":void 0,"data-strapi-dropdown":!0,"aria-hidden":!0,as:"span",background:Q,cursor:ee?"not-allowed":"pointer",onClick:k,shrink:0,children:(0,e.jsx)(x.J,{as:b.Z,width:Y==="M"?`${11/16}rem`:`${8/16}rem`,color:y?"primary600":"neutral600"})});return(0,e.jsx)(H,{paddingBottom:Pe,paddingLeft:oe,paddingRight:oe,paddingTop:Pe,background:Ee,expanded:y,size:Y,justifyContent:"space-between",cursor:ee?"not-allowed":"",children:(0,e.jsxs)(D.k,{gap:3,flex:1,maxWidth:"100%",children:[C==="left"&&q,(0,e.jsx)(a,{onClick:k,"aria-disabled":ee,"aria-expanded":y,"aria-controls":xe,"aria-labelledby":pe,"data-strapi-accordion-toggle":!0,expanded:y,type:"button",flex:1,minWidth:0,...me,children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(R.y,{...$e,children:A}),F&&(0,e.jsx)(_.Z,{as:"p",id:Re,textColor:T,children:F})]})}),C==="right"&&(0,e.jsxs)(D.k,{gap:3,children:[q,w]}),C==="left"&&w]})})}},27799:function(X,B,r){"use strict";r.d(B,{Q:function(){return R}});var e=r(74512),b=r(8471),P=r(6407);const R=({options:O,...S})=>(0,e.jsx)(P.NU,{...S,children:O.map(x=>"children"in x?(0,e.jsx)(P.Ab,{label:x.label,values:x.children.map(D=>D.value.toString()),children:x.children.map(D=>(0,e.jsx)(Z,{value:D.value,children:D.label},D.value))},x.label):(0,e.jsx)(P.ML,{value:x.value,children:x.label},x.value))}),Z=(0,b.ZP)(P.ML)`
265
+ `,p=({title:A,description:F,as:f="span",togglePosition:C="right",action:w,...ue})=>{const{onToggle:ae,toggle:ie,expanded:y,id:le,size:Y,variant:G,disabled:_}=(0,Z.A)(),xe=`accordion-content-${le}`,me=`accordion-label-${le}`,Re=`accordion-desc-${le}`,oe=Y==="M"?6:4,Pe=Y==="M"?oe:oe-2,Ee=O({expanded:y,disabled:_,variant:G}),$e={as:f,fontWeight:Y==="S"?"bold":void 0,id:me,textColor:y?"primary600":"neutral700",ellipsis:!0,variant:Y==="M"?"delta":void 0},T=y?"primary600":"neutral600",ne=y?"primary200":"neutral200",z=Y==="M"?`${32/16}rem`:`${24/16}rem`,k=()=>{_||(ie&&!ae?(console.warn('Deprecation warning: Usage of "toggle" prop in Accordion component is deprecated. This is discouraged and will be removed in the next major release. Please use "onToggle" instead'),ie()):ae&&ae())},Q=(0,e.jsx)(D.k,{justifyContent:"center",borderRadius:"50%",height:z,width:z,transform:y?"rotate(180deg)":void 0,"data-strapi-dropdown":!0,"aria-hidden":!0,as:"span",background:ne,cursor:_?"not-allowed":"pointer",onClick:k,shrink:0,children:(0,e.jsx)(x.J,{as:b.Z,width:Y==="M"?`${11/16}rem`:`${8/16}rem`,color:y?"primary600":"neutral600"})});return(0,e.jsx)(H,{paddingBottom:Pe,paddingLeft:oe,paddingRight:oe,paddingTop:Pe,background:Ee,expanded:y,size:Y,justifyContent:"space-between",cursor:_?"not-allowed":"",children:(0,e.jsxs)(D.k,{gap:3,flex:1,maxWidth:"100%",children:[C==="left"&&Q,(0,e.jsx)(a,{onClick:k,"aria-disabled":_,"aria-expanded":y,"aria-controls":xe,"aria-labelledby":me,"data-strapi-accordion-toggle":!0,expanded:y,type:"button",flex:1,minWidth:0,...ue,children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(R.y,{...$e,children:A}),F&&(0,e.jsx)(q.Z,{as:"p",id:Re,textColor:T,children:F})]})}),C==="right"&&(0,e.jsxs)(D.k,{gap:3,children:[Q,w]}),C==="left"&&w]})})}},27799:function(X,B,r){"use strict";r.d(B,{Q:function(){return R}});var e=r(74512),b=r(8471),P=r(6407);const R=({options:O,...S})=>(0,e.jsx)(P.NU,{...S,children:O.map(x=>"children"in x?(0,e.jsx)(P.Ab,{label:x.label,values:x.children.map(D=>D.value.toString()),children:x.children.map(D=>(0,e.jsx)(Z,{value:D.value,children:D.label},D.value))},x.label):(0,e.jsx)(P.ML,{value:x.value,children:x.label},x.value))}),Z=(0,b.ZP)(P.ML)`
266
266
  padding-left: ${({theme:O})=>O.spaces[7]};
267
267
  `}}]);
@@ -0,0 +1,10 @@
1
+ "use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[4263],{19150:function(I,l,e){e.d(l,{R:function(){return o}});var t=e(19565),a=e(20108);function o(i={},m={}){const{id:n="",...s}=i,{get:c}=(0,t.kY)(),{data:r,isError:d,isLoading:u,refetch:p}=(0,a.useQuery)(["users",n,s],async()=>{const{data:{data:D}}=await c(`/admin/users/${n}`,{params:s});return D},m);let M=[];return n&&r?M=[r]:Array.isArray(r?.results)&&(M=r.results),{users:M,pagination:r?.pagination??null,isLoading:u,isError:d,refetch:p}}},40874:function(I,l,e){e.r(l),e.d(l,{default:function(){return oe}});var t=e(32735),a=e(19565),o=e(15062),i=e(53038),m=e(78125),n=e(20011),s=e(27649),c=e(82055),r=e(41415),d=e(17e3),u=e(72850),p=e(87933),M=e(49372),D=e(15335),O=e(5803),U=e(66456),A=e(29439),j=e(92802),N=e(33795),x=e.n(N),Y=e(9086),C=e.n(Y),F=e(88423),z=e.n(F),H=e(60216),b=e.n(H),V=e(67879),v=e(19150),G=e(8997),ee=e(4397),te=e(1057);const ae=async(T,h)=>{const{put:E}=(0,a.tg)(),{data:P}=await E(`/admin/users/${T}`,h);return P.data};var se=[[{intlLabel:{id:"Auth.form.firstname.label",defaultMessage:"First name"},name:"firstname",placeholder:{id:"Auth.form.firstname.placeholder",defaultMessage:"e.g. Kai"},type:"text",size:{col:6,xs:12},required:!0},{intlLabel:{id:"Auth.form.lastname.label",defaultMessage:"Last name"},name:"lastname",placeholder:{id:"Auth.form.lastname.placeholder",defaultMessage:"e.g. Doe"},type:"text",size:{col:6,xs:12}}],[{intlLabel:{id:"Auth.form.email.label",defaultMessage:"Email"},name:"email",placeholder:{id:"Auth.form.email.placeholder",defaultMessage:"e.g. kai.doe@strapi.io"},type:"email",size:{col:6,xs:12},required:!0},{intlLabel:{id:"Auth.form.username.label",defaultMessage:"Username"},name:"username",placeholder:{id:"Auth.form.username.placeholder",defaultMessage:"e.g. Kai_Doe"},type:"text",size:{col:6,xs:12}}],[{intlLabel:{id:"global.password",defaultMessage:"Password"},name:"password",type:"password",size:{col:6,xs:12},autoComplete:"new-password"},{intlLabel:{id:"Auth.form.confirmPassword.label",defaultMessage:"Password confirmation"},name:"confirmPassword",type:"password",size:{col:6,xs:12},autoComplete:"new-password"}],[{intlLabel:{id:"Auth.form.active.label",defaultMessage:"Active"},name:"isActive",type:"bool",size:{col:6,xs:12}}]];const ne=(()=>window&&window.strapi&&window.strapi.isEE?e(28890).Z:e(16325).Z)(),X=["email","firstname","lastname","username","isActive","roles"],J=T=>{let{canUpdate:h}=T;const{formatMessage:E}=(0,V.Z)(),{params:{id:P}}=(0,i.$B)("/settings/users/:id"),{push:W}=(0,i.k6)(),{setUserDisplayName:R}=(0,a.L7)(),B=(0,a.lm)(),{lockApp:Q,unlockApp:ie}=(0,a.o1)();(0,a.go)();const{users:[K],isLoading:k}=(0,v.R)({id:P},{onError(g){const{status:f}=g.response;f===403?(B({type:"info",message:{id:"notification.permission.not-allowed-read",defaultMessage:"You are not allowed to see this document"}}),W("/")):B({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}}),le=async(g,f)=>{Q();try{const y=await ae(P,C()(g,"confirmPassword"));B({type:"success",message:E({id:"notification.success.saved",defaultMessage:"Saved"})});const L=a.I8.getUserInfo();if(P.toString()===L.id.toString()){a.I8.setUserInfo(y);const Z=x()(g,"username")||(0,G.Pp)(g.firstname,g.lastname);R(Z)}f.setValues(z()(g,X))}catch(y){const L=(0,G.Iz)(y.response.data),Z=Object.keys(L).reduce(($,w)=>($[w]=L[w].id,$),{});f.setErrors(Z),B({type:"warning",message:x()(y,"response.data.error.message","notification.error")})}ie()},de=k?{id:"app.containers.Users.EditPage.header.label-loading",defaultMessage:"Edit user"}:{id:"app.containers.Users.EditPage.header.label",defaultMessage:"Edit {name}"},_=Object.keys(z()(K,X)).reduce((g,f)=>f==="roles"?(g[f]=(K?.roles||[]).map(y=>{let{id:L}=y;return L}),g):(g[f]=K?.[f],g),{}),ce=_.username||(0,G.Pp)(_.firstname,_.lastname),q=E(de,{name:ce});return k?t.createElement(s.o,{"aria-busy":"true"},t.createElement(a.SL,{name:"Users"}),t.createElement(c.T,{primaryAction:t.createElement(r.z,{disabled:!0,startIcon:t.createElement(U.Z,null),type:"button",size:"L"},E({id:"global.save",defaultMessage:"Save"})),title:q,navigationAction:t.createElement(a.rU,{startIcon:t.createElement(A.Z,null),to:"/settings/users?pageSize=10&page=1&sort=firstname"},E({id:"global.back",defaultMessage:"Back"}))}),t.createElement(d.D,null,t.createElement(a.dO,null))):t.createElement(s.o,null,t.createElement(a.SL,{name:"Users"}),t.createElement(j.J9,{onSubmit:le,initialValues:_,validateOnChange:!1,validationSchema:te.YM},g=>{let{errors:f,values:y,handleChange:L,isSubmitting:Z,dirty:$}=g;return t.createElement(a.l0,null,t.createElement(c.T,{primaryAction:t.createElement(r.z,{disabled:Z||!h?!0:!$,startIcon:t.createElement(U.Z,null),loading:Z,type:"submit",size:"L"},E({id:"global.save",defaultMessage:"Save"})),title:q,navigationAction:t.createElement(a.rU,{startIcon:t.createElement(A.Z,null),to:"/settings/users?pageSize=10&page=1&sort=firstname"},E({id:"global.back",defaultMessage:"Back"}))}),t.createElement(d.D,null,K?.registrationToken&&t.createElement(u.x,{paddingBottom:6},t.createElement(ne,{registrationToken:K.registrationToken})),t.createElement(p.k,{direction:"column",alignItems:"stretch",gap:7},t.createElement(u.x,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},t.createElement(p.k,{direction:"column",alignItems:"stretch",gap:4},t.createElement(M.Z,{variant:"delta",as:"h2"},E({id:"app.components.Users.ModalCreateBody.block-title.details",defaultMessage:"Details"})),t.createElement(D.r,{gap:5},se.map(w=>w.map(S=>t.createElement(O.P,(0,n.Z)({key:S.name},S.size),t.createElement(a.jm,(0,n.Z)({},S,{disabled:!h,error:f[S.name],onChange:L,value:y[S.name]||""})))))))),t.createElement(u.x,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},t.createElement(p.k,{direction:"column",alignItems:"stretch",gap:4},t.createElement(M.Z,{variant:"delta",as:"h2"},E({id:"global.roles",defaultMessage:"User's role"})),t.createElement(D.r,{gap:5},t.createElement(O.P,{col:6,xs:12},t.createElement(ee.Z,{disabled:!h,error:f.roles,onChange:L,value:y.roles}))))))))}))};J.propTypes={canUpdate:b().bool.isRequired};var re=J,oe=()=>{const T=(0,a.lm)(),h=(0,o.v9)(m._),E=t.useMemo(()=>({read:h.settings.users.read,update:h.settings.users.update}),[h.settings.users]),{isLoading:P,allowedActions:{canRead:W,canUpdate:R}}=(0,a.ss)(E),{state:B}=(0,i.TH)(),Q=B?.from??"/";return(0,t.useEffect)(()=>{P||!W&&!R&&T({type:"info",message:{id:"notification.permission.not-allowed-read",defaultMessage:"You are not allowed to see this document"}})},[P,W,R,T]),P?t.createElement(a.dO,null):!W&&!R?t.createElement(i.l_,{to:Q}):t.createElement(re,{canUpdate:R})}},76779:function(I,l,e){var t=e(32735),a=e(50563),o=e(19565),i=e(47765),m=e(60216),n=e.n(m),s=e(67879);const c=({children:r,target:d})=>{const u=(0,o.lm)(),{formatMessage:p}=(0,s.Z)(),{copy:M}=(0,o.VP)(),D=p({id:"app.component.CopyToClipboard.label",defaultMessage:"Copy to clipboard"}),O=async()=>{await M(d)&&u({type:"info",message:{id:"notification.link-copied"}})};return t.createElement(o.Y_,{endAction:t.createElement(a.h,{label:D,noBorder:!0,icon:t.createElement(i.Z,null),onClick:O}),title:d,titleEllipsis:!0,subtitle:r,icon:t.createElement("span",{style:{fontSize:32}},"\u2709\uFE0F"),iconBackground:"neutral100"})};c.propTypes={children:n().oneOfType([n().element,n().string]).isRequired,target:n().string.isRequired},l.Z=c},16325:function(I,l,e){var t=e(32735),a=e(60216),o=e.n(a),i=e(67879),m=e(78246),n=e(76779);const s=({registrationToken:c})=>{const{formatMessage:r}=(0,i.Z)(),d=`${window.location.origin}${m.Z}auth/register?registrationToken=${c}`;return t.createElement(n.Z,{target:d},r({id:"app.components.Users.MagicLink.connect",defaultMessage:"Copy and share this link to give access to this user"}))};s.defaultProps={registrationToken:""},s.propTypes={registrationToken:o().string},l.Z=s},4397:function(I,l,e){var t=e(32735),a=e(68465),o=e(84967),i=e(19565),m=e(27169),n=e(60216),s=e.n(n),c=e(67879),r=e(20108),d=e(8471);const u=(0,d.F4)`
2
+ from {
3
+ transform: rotate(0deg);
4
+ }
5
+ to {
6
+ transform: rotate(359deg);
7
+ }
8
+ `,p=d.ZP.div`
9
+ animation: ${u} 2s infinite linear;
10
+ `,M=()=>t.createElement(p,null,t.createElement(m.Z,null)),D=async()=>{const{get:U}=(0,i.tg)(),{data:A}=await U("/admin/roles");return A.data},O=({disabled:U,error:A,onChange:j,value:N})=>{const{status:x,data:Y}=(0,r.useQuery)(["roles"],D,{staleTime:5e4}),{formatMessage:C}=(0,c.Z)(),F=A?C({id:A,defaultMessage:A}):"",z=C({id:"app.components.Users.ModalCreateBody.block-title.roles",defaultMessage:"User's roles"}),H=C({id:"app.components.Users.ModalCreateBody.block-title.roles.description",defaultMessage:"A user can have one or several roles"}),b=C({id:"app.components.Select.placeholder",defaultMessage:"Select"}),V=x==="loading"?t.createElement(M,null):void 0;return t.createElement(a.P,{id:"roles",disabled:U,error:F,hint:H,label:z,name:"roles",onChange:v=>{j({target:{name:"roles",value:v}})},placeholder:b,multi:!0,startIcon:V,value:N.map(v=>v.toString()),withTags:!0,required:!0},(Y||[]).map(v=>t.createElement(o.W,{key:v.id,value:v.id.toString()},C({id:`global.${v.code}`,defaultMessage:v.name}))))};O.defaultProps={disabled:!1,error:void 0},O.propTypes={disabled:s().bool,error:s().string,onChange:s().func.isRequired,value:s().array.isRequired},l.Z=O},1057:function(I,l,e){e.d(l,{YM:function(){return r},Rw:function(){return m}});var t=e(24346),a=e(19565);const o={firstname:t.Z_().trim().required(a.I0.required),lastname:t.Z_(),email:t.Z_().email(a.I0.email).lowercase().required(a.I0.required),username:t.Z_().nullable(),password:t.Z_().min(8,a.I0.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number"),confirmPassword:t.Z_().min(8,a.I0.minLength).oneOf([t.iH("password"),null],"components.Input.error.password.noMatch").when("password",(d,u)=>d?u.required(a.I0.required):u)};var m={...o,currentPassword:t.Z_().when(["password","confirmPassword"],(d,u,p)=>d||u?p.required(a.I0.required):p),preferedLanguage:t.Z_().nullable()},s={roles:t.IX().min(1,a.I0.required).required(a.I0.required)},r=t.Ry().shape({...o,isActive:t.Xg(),...s})},28890:function(I,l,e){var t=e(32735),a=e(60216),o=e.n(a),i=e(67879),m=e(78246),n=e(76779);const s=({registrationToken:c})=>{const{formatMessage:r}=(0,i.Z)();return c?t.createElement(n.Z,{target:`${window.location.origin}${m.Z}auth/register?registrationToken=${c}`},r({id:"app.components.Users.MagicLink.connect",defaultMessage:"Copy and share this link to give access to this user"})):t.createElement(n.Z,{target:`${window.location.origin}${m.Z}auth/login`},r({id:"app.components.Users.MagicLink.connect.sso",defaultMessage:"Send this link to the user, the first login can be made via a SSO provider."}))};s.defaultProps={registrationToken:""},s.propTypes={registrationToken:o().string},l.Z=s},29439:function(I,l,e){e.d(l,{Z:function(){return o}});var t=e(74512);const a=i=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"none",viewBox:"0 0 24 24",...i,children:(0,t.jsx)("path",{fill:"#212134",d:"M24 13.3a.2.2 0 0 1-.2.2H5.74l8.239 8.239a.2.2 0 0 1 0 .282L12.14 23.86a.2.2 0 0 1-.282 0L.14 12.14a.2.2 0 0 1 0-.282L11.86.14a.2.2 0 0 1 .282 0L13.98 1.98a.2.2 0 0 1 0 .282L5.74 10.5H23.8c.11 0 .2.09.2.2v2.6Z"})}),o=a}}]);