@strapi/admin 4.3.2-alpha.0 → 4.3.4
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.
- package/admin/src/content-manager/components/AttributeFilter/index.js +3 -1
- package/admin/src/content-manager/components/DynamicTable/CellContent/CellValue.js +3 -5
- package/build/{1669.341e10d8.chunk.js → 1669.0551026a.chunk.js} +1 -1
- package/build/{1856.6a94980b.chunk.js → 1856.d3da2fcd.chunk.js} +18 -17
- package/build/{2077.5456ccd1.chunk.js → 2077.b25a0b57.chunk.js} +6 -5
- package/build/2912.da8a70aa.chunk.js +258 -0
- package/build/{4715.a6e62860.chunk.js → 4715.3787be19.chunk.js} +20 -19
- package/build/4982.a4e36c9a.chunk.js +314 -0
- package/build/611.aa894d27.chunk.js +158 -0
- package/build/6925.fb35248e.chunk.js +761 -0
- package/build/7841.922b96eb.chunk.js +258 -0
- package/build/7866.29d1f169.chunk.js +504 -0
- package/build/8380.ab3939f3.chunk.js +284 -0
- package/build/8469.41c8d25f.chunk.js +1 -0
- package/build/8549.0e30f86d.chunk.js +158 -0
- package/build/{8773.83d4a28b.chunk.js → 8773.c190837d.chunk.js} +95 -92
- package/build/{8655.9073e17e.chunk.js → 9166.280c7521.chunk.js} +62 -60
- package/build/9420.ee1ccff7.chunk.js +504 -0
- package/build/Admin-authenticatedApp.380e5e99.chunk.js +80 -0
- package/build/{Admin_marketplace.8efd3fd0.chunk.js → Admin_marketplace.0b758aac.chunk.js} +1 -1
- package/build/Admin_settingsPage.76ee4c17.chunk.js +178 -0
- package/build/{admin-app.1bd5f67e.chunk.js → admin-app.93ff2e38.chunk.js} +5 -5
- package/build/{admin-edit-users.714863af.chunk.js → admin-edit-users.7d9cf406.chunk.js} +1 -1
- package/build/{admin-users.2bd6fb37.chunk.js → admin-users.bb3a8eb6.chunk.js} +1 -1
- package/build/{content-manager.57c1cfe3.chunk.js → content-manager.55791f82.chunk.js} +60 -60
- package/build/content-type-builder-list-view.4a704844.chunk.js +194 -0
- package/build/{content-type-builder.b2cbf2e9.chunk.js → content-type-builder.f48a28f9.chunk.js} +2 -2
- package/build/index.html +1 -1
- package/build/main.66ef8611.js +9317 -0
- package/build/{runtime~main.70365303.js → runtime~main.3dfda620.js} +1 -1
- package/build/{upload-settings.4bad0bdd.chunk.js → upload-settings.5dfe0fe2.chunk.js} +1 -1
- package/build/upload-translation-ca-json.00dc1f33.chunk.js +1 -0
- package/build/upload-translation-de-json.00cbbc08.chunk.js +1 -0
- package/build/upload-translation-dk-json.c787a6be.chunk.js +1 -0
- package/build/upload-translation-en-json.004a86c1.chunk.js +1 -0
- package/build/upload-translation-es-json.6b1813b6.chunk.js +1 -0
- package/build/upload-translation-ko-json.392002fb.chunk.js +1 -0
- package/build/upload-translation-pl-json.136eedb6.chunk.js +1 -0
- package/build/upload.0af4feca.chunk.js +7 -0
- package/build/users-email-settings-page.899e7fbd.chunk.js +1 -0
- package/build/{users-roles-settings-page.3db986a4.chunk.js → users-roles-settings-page.1206751f.chunk.js} +1 -1
- package/build/{webhook-list-page.2ab4bbf0.chunk.js → webhook-list-page.912becb8.chunk.js} +7 -6
- package/package.json +12 -12
- package/server/routes/webhooks.js +4 -1
- package/server/services/project-settings.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/CellContent/utils/getNumberOfDecimals.js +0 -8
- package/build/109.1464fd6e.chunk.js +0 -2
- package/build/20.9e5a98b6.chunk.js +0 -308
- package/build/3332.1e443103.chunk.js +0 -102
- package/build/413.d5986568.chunk.js +0 -284
- package/build/5520.3c6bf86a.chunk.js +0 -503
- package/build/8469.3af1823d.chunk.js +0 -1
- package/build/9420.ba035f29.chunk.js +0 -508
- package/build/9799.ce46400f.chunk.js +0 -760
- package/build/Admin-authenticatedApp.dd060dfe.chunk.js +0 -80
- package/build/Admin_settingsPage.5fc517d7.chunk.js +0 -178
- package/build/content-type-builder-list-view.b12687b2.chunk.js +0 -194
- package/build/main.407d75cc.js +0 -8675
- package/build/upload-translation-ca-json.79159984.chunk.js +0 -1
- package/build/upload-translation-de-json.745613c0.chunk.js +0 -1
- package/build/upload-translation-dk-json.cb25dcf0.chunk.js +0 -1
- package/build/upload-translation-en-json.bc79c867.chunk.js +0 -1
- package/build/upload-translation-es-json.1f344b53.chunk.js +0 -1
- package/build/upload-translation-ko-json.9a2c21cb.chunk.js +0 -1
- package/build/upload-translation-pl-json.c1f86b50.chunk.js +0 -1
- package/build/upload.b2cb62bd.chunk.js +0 -7
- package/build/users-email-settings-page.824a3cdb.chunk.js +0 -101
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[801],{19782:(k,C,n)=>{n.r(C),n.d(C,{default:()=>en});var e=n(32735),i=n(88425),b=n(84968),P=n(33795),X=n.n(P);const M=JSON.parse('{"i8":"4.3.2-alpha.0"}');var $=n(73869),p=n(5141),N=n(4409),L=n(74506),K=n(51968),F=n(88311),G=n.n(F),O=n(58107),T=n(19615),U=n(60216),r=n.n(U),l=n(5636),v=n(64410),E=n(54742),g=n(19192),R=n(9808),J=n(90662),be=n(20763),oe=n(44526),Ne=n(94009),Ge=n.n(Ne);const Ue=(0,T.default)(g.Flex)`
|
|
2
|
-
position: fixed;
|
|
3
|
-
z-index: 4;
|
|
4
|
-
inset: 0;
|
|
5
|
-
/* this is theme.colors.neutral800 with opacity */
|
|
6
|
-
background: ${({theme:t})=>`${t.colors.neutral800}1F`};
|
|
7
|
-
`,se=({onClose:t,onSkip:a,children:o,hideSkip:s})=>{const{formatMessage:u}=(0,l.useIntl)();return e.createElement(v.Portal,null,e.createElement(Ue,{onClick:t,padding:8,justifyContent:"center"},e.createElement(E.FocusTrap,{onEscape:t},e.createElement(J.Stack,{background:"neutral0",width:(0,i.pxToRem)(660),shadow:"popupShadow",hasRadius:!0,padding:4,spacing:8,role:"dialog","aria-modal":!0,onClick:d=>d.stopPropagation()},e.createElement(g.Flex,{justifyContent:"flex-end"},e.createElement(be.IconButton,{onClick:t,"aria-label":u({id:"app.utils.close-label",defaultMessage:"Close"}),icon:e.createElement(Ge(),null)})),e.createElement(R.Box,{paddingLeft:7,paddingRight:7,paddingBottom:s?8:0},o),!s&&e.createElement(g.Flex,{justifyContent:"flex-end"},e.createElement(oe.Button,{variant:"tertiary",onClick:a},u({id:"app.components.GuidedTour.skip",defaultMessage:"Skip the tour"})))))))};se.propTypes={children:r().node.isRequired,onClose:r().func.isRequired,onSkip:r().func.isRequired,hideSkip:r().bool.isRequired};const Fe=se;var re=n(22909);const ie={stepContent:null,sectionIndex:null,stepIndex:null,hasSectionAfter:!1,hasStepAfter:!1},We=(t=ie,a)=>(0,re.default)(t,o=>{switch(a.type){case"UPDATE_MODAL":{o.stepContent=a.content,o.sectionIndex=a.newSectionIndex,o.stepIndex=a.newStepIndex,o.hasSectionAfter=a.newHasSectionAfter,o.hasStepAfter=a.newHasStepAfter;break}default:return o}});var S=n(95602),je=n(30345),le=n.n(je);const $e=T.default.li`
|
|
8
|
-
list-style: disc;
|
|
9
|
-
`,de=({id:t,defaultMessage:a})=>{const{formatMessage:o}=(0,l.useIntl)();return e.createElement(J.Stack,{spacing:4,paddingBottom:6},o({id:t,defaultMessage:a},{documentationLink:s=>e.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest-api.html#api-parameters"},s),b:s=>e.createElement(S.Typography,{fontWeight:"semiBold"},s),p:s=>e.createElement(S.Typography,null,s),light:s=>e.createElement(S.Typography,{textColor:"neutral600"},s),ul:s=>e.createElement(R.Box,{paddingLeft:6},e.createElement("ul",null,s)),li:s=>e.createElement($e,null,s)}))};de.propTypes={id:r().string.isRequired,defaultMessage:r().string.isRequired};const Ke=de;var w=n(78024),Ve=n(14317);const q=({number:t,last:a,type:o})=>e.createElement(R.Box,{paddingTop:3,paddingBottom:a?0:3},e.createElement(Ve.Z,{number:t,type:o}));q.defaultProps={number:void 0,last:!1,type:""},q.propTypes={number:r().number,last:r().bool,type:r().string};const ce=q;var W=n(23678),ze=Object.defineProperty,pe=Object.getOwnPropertySymbols,ke=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,ue=(t,a,o)=>a in t?ze(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,Ze=(t,a)=>{for(var o in a||(a={}))ke.call(a,o)&&ue(t,o,a[o]);if(pe)for(var o of pe(a))He.call(a,o)&&ue(t,o,a[o]);return t};const _=({title:t,content:a,cta:o,onCtaClick:s,sectionIndex:u,stepIndex:d,hasSectionAfter:f})=>{const{formatMessage:y}=(0,l.useIntl)(),h=u>0,c=d>0,D=u+1;return e.createElement(e.Fragment,null,e.createElement(g.Flex,{alignItems:"stretch"},e.createElement(g.Flex,{marginRight:8,justifyContent:"center",minWidth:(0,i.pxToRem)(30)},h&&e.createElement(w.Z,{type:W.hx,minHeight:(0,i.pxToRem)(24)})),e.createElement(S.Typography,{variant:"sigma",textColor:"primary600"},y({id:"app.components.GuidedTour.title",defaultMessage:"3 steps to get started"}))),e.createElement(g.Flex,null,e.createElement(g.Flex,{marginRight:8,minWidth:(0,i.pxToRem)(30)},e.createElement(ce,{number:u+1,type:c?W.hx:W.lW})),e.createElement(S.Typography,{variant:"alpha",fontWeight:"bold",textColor:"neutral800",as:"h3",id:"title"},y(t))),e.createElement(g.Flex,{alignItems:"stretch"},e.createElement(g.Flex,{marginRight:8,direction:"column",justifyContent:"center",minWidth:(0,i.pxToRem)(30)},f&&e.createElement(e.Fragment,null,e.createElement(w.Z,{type:W.hx}),c&&e.createElement(ce,{number:D+1,type:W.lW,last:!0}))),e.createElement(R.Box,null,e.createElement(Ke,Ze({},a)),o&&(o.target?e.createElement(i.LinkButton,{endIcon:e.createElement(le(),null),onClick:s,to:o.target},y(o.title)):e.createElement(oe.Button,{endIcon:e.createElement(le(),null),onClick:s},y(o.title))))),c&&f&&e.createElement(R.Box,{paddingTop:3},e.createElement(g.Flex,{marginRight:8,justifyContent:"center",width:(0,i.pxToRem)(30)},e.createElement(w.Z,{type:W.hx,minHeight:(0,i.pxToRem)(24)}))))};_.defaultProps={currentStep:null,cta:void 0},_.propTypes={sectionIndex:r().number.isRequired,stepIndex:r().number.isRequired,hasSectionAfter:r().bool.isRequired,content:r().shape({id:r().string.isRequired,defaultMessage:r().string.isRequired}).isRequired,cta:r().shape({target:r().string,title:r().shape({id:r().string.isRequired,defaultMessage:r().string.isRequired})}),currentStep:r().string,onCtaClick:r().func.isRequired,title:r().shape({id:r().string.isRequired,defaultMessage:r().string.isRequired}).isRequired};const Qe=_;var Ye=Object.defineProperty,Xe=Object.defineProperties,Je=Object.getOwnPropertyDescriptors,me=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,ge=(t,a,o)=>a in t?Ye(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,_e=(t,a)=>{for(var o in a||(a={}))we.call(a,o)&&ge(t,o,a[o]);if(me)for(var o of me(a))qe.call(a,o)&&ge(t,o,a[o]);return t},et=(t,a)=>Xe(t,Je(a));const tt=()=>{const{currentStep:t,guidedTourState:a,setCurrentStep:o,setStepState:s,isGuidedTourVisible:u,setSkipped:d}=(0,i.useGuidedTour)(),[f,y]=(0,e.useState)(t),[{stepContent:h,sectionIndex:c,stepIndex:D,hasSectionAfter:B,hasStepAfter:V},z]=(0,e.useReducer)(We,ie),{trackUsage:j}=(0,i.useTracking)();(0,e.useEffect)(()=>{if(!t){y(!1);return}const[I]=G()(a,t);y(!I&&u)},[t,a,u]),(0,e.useEffect)(()=>{if(t){const[I]=G()(O.Z,t),Z=Object.keys(a),[Q,Be]=t.split("."),ae=Z.indexOf(Q),Y=Object.keys(a[Q]).indexOf(Be),tn=ae<Z.length-1,nn=Y<Object.keys(a[Q]).length-1;z({type:"UPDATE_MODAL",content:I,newSectionIndex:ae,newStepIndex:Y,newHasSectionAfter:tn,newHasStepAfter:nn})}},[t,a]);const m=()=>{s(t,!0),j(h.trackingEvent),o(null)},x=()=>{d(!0),o(null),j("didSkipGuidedtour")};return f&&h?e.createElement(Fe,{hideSkip:!V&&!B,onSkip:x,onClose:m},e.createElement(Qe,et(_e({},h),{onCtaClick:m,currentStep:t,sectionIndex:c,stepIndex:D,hasSectionAfter:B}))):null};var nt=n(27635),A=n(34499),at=n(82926),ot=n.n(at),st=n(70258),rt=n.n(st),it=n(19799);const lt=(0,T.default)(R.Box)`
|
|
10
|
-
width: ${150/16}rem;
|
|
11
|
-
position: absolute;
|
|
12
|
-
bottom: ${({theme:t})=>t.spaces[9]};
|
|
13
|
-
left: ${({theme:t})=>t.spaces[5]};
|
|
14
|
-
`,fe=(0,T.default)(p.NavLink)`
|
|
15
|
-
display: flex;
|
|
16
|
-
justify-content: space-between;
|
|
17
|
-
align-items: center;
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
padding: ${({theme:t})=>`${t.spaces[2]} ${t.spaces[4]}`};
|
|
20
|
-
border-radius: ${({theme:t})=>t.spaces[1]};
|
|
21
|
-
|
|
22
|
-
&:hover {
|
|
23
|
-
background: ${({theme:t,logout:a})=>a?t.colors.danger100:t.colors.primary100};
|
|
24
|
-
text-decoration: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
svg {
|
|
28
|
-
path {
|
|
29
|
-
fill: ${({theme:t})=>t.colors.danger600};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`,he=({generalSectionLinks:t,pluginsSectionLinks:a})=>{const o=(0,e.useRef)(),[s,u]=(0,e.useState)(!1),{logos:{menu:d}}=(0,it.Z)(),[f,y]=(0,i.usePersistentState)("navbar-condensed",!1),{userDisplayName:h}=(0,i.useAppInfos)(),{formatMessage:c}=(0,l.useIntl)(),D=h.split(" ").map(m=>m.substring(0,1)).join("").substring(0,2),B=()=>u(m=>!m),V=()=>{i.auth.clearAppStorage(),B()},z=m=>{var x,I;!m.currentTarget.contains(m.relatedTarget)&&((I=(x=m.relatedTarget)==null?void 0:x.parentElement)==null?void 0:I.id)!=="main-nav-user-button"&&u(!1)},j=c({id:"app.components.LeftMenu.navbrand.title",defaultMessage:"Strapi Dashboard"});return e.createElement(A.MainNav,{condensed:f},e.createElement(A.NavBrand,{as:p.NavLink,workplace:c({id:"app.components.LeftMenu.navbrand.workplace",defaultMessage:"Workplace"}),title:j,icon:e.createElement("img",{src:d.custom||d.default,alt:c({id:"app.components.LeftMenu.logo.alt",defaultMessage:"Application logo"})})}),e.createElement(nt.Divider,null),e.createElement(A.NavSections,null,e.createElement(A.NavLink,{as:p.NavLink,to:"/content-manager",icon:e.createElement(ot(),null)},c({id:"global.content-manager",defaultMessage:"Content manager"})),a.length>0?e.createElement(A.NavSection,{label:c({id:"app.components.LeftMenu.plugins",defaultMessage:"Plugins"})},a.map(m=>{const x=m.icon;return e.createElement(A.NavLink,{as:p.NavLink,to:m.to,key:m.to,icon:e.createElement(x,null)},c(m.intlLabel))})):null,t.length>0?e.createElement(A.NavSection,{label:c({id:"app.components.LeftMenu.general",defaultMessage:"General"})},t.map(m=>{const x=m.icon;return e.createElement(A.NavLink,{as:p.NavLink,badgeContent:m.notificationsCount>0&&m.notificationsCount.toString()||void 0,to:m.to,key:m.to,icon:e.createElement(x,null)},c(m.intlLabel))})):null),e.createElement(A.NavUser,{id:"main-nav-user-button",ref:o,onClick:B,initials:D},h),s&&e.createElement(lt,{onBlur:z,padding:1,shadow:"tableShadow",background:"neutral0",hasRadius:!0},e.createElement(E.FocusTrap,{onEscape:B},e.createElement(J.Stack,{spacing:0},e.createElement(fe,{tabIndex:0,onClick:B,to:"/me"},e.createElement(S.Typography,null,c({id:"global.profile",defaultMessage:"Profile"}))),e.createElement(fe,{tabIndex:0,onClick:V,logout:"logout",to:"/auth/login"},e.createElement(S.Typography,{textColor:"danger600"},c({id:"app.components.LeftMenu.logout",defaultMessage:"Logout"})),e.createElement(rt(),null))))),e.createElement(A.NavCondense,{onClick:()=>y(m=>!m)},c(f?{id:"app.components.LeftMenu.expand",defaultMessage:"Expand the navbar"}:{id:"app.components.LeftMenu.collapse",defaultMessage:"Collapse the navbar"})))};he.propTypes={generalSectionLinks:r().array.isRequired,pluginsSectionLinks:r().array.isRequired};const dt=he;var ct=n(16540);const pt=(0,T.default)(R.Box)`
|
|
33
|
-
flex: 1;
|
|
34
|
-
`,Ee=({children:t,sideNav:a})=>{const{formatMessage:o}=(0,l.useIntl)();return e.createElement(R.Box,{background:"neutral100"},e.createElement(ct.SkipToContent,null,o({id:"skipToContent",defaultMessage:"Skip to content"})),e.createElement(g.Flex,{alignItems:"flex-start"},a,e.createElement(pt,null,t)))};Ee.propTypes={children:r().node.isRequired,sideNav:r().node.isRequired};const ut=Ee;var ye=n(7602),mt=n(26648),ee=n(58144),ve=n(28257);const gt=(0,T.default)(R.Box)`
|
|
35
|
-
position: fixed;
|
|
36
|
-
bottom: ${({theme:t})=>t.spaces[2]};
|
|
37
|
-
right: ${({theme:t})=>t.spaces[2]};
|
|
38
|
-
`,ft=T.default.button`
|
|
39
|
-
width: ${({theme:t})=>t.spaces[8]};
|
|
40
|
-
height: ${({theme:t})=>t.spaces[8]};
|
|
41
|
-
background: ${({theme:t})=>t.colors.primary600};
|
|
42
|
-
box-shadow: ${({theme:t})=>t.shadows.tableShadow};
|
|
43
|
-
border-radius: 50%;
|
|
44
|
-
svg {
|
|
45
|
-
color: ${({theme:t})=>t.colors.buttonNeutral0};
|
|
46
|
-
}
|
|
47
|
-
`,ht=(0,T.default)(R.Box)`
|
|
48
|
-
position: absolute;
|
|
49
|
-
bottom: ${({theme:t})=>`${t.spaces[9]}`};
|
|
50
|
-
right: 0;
|
|
51
|
-
width: ${200/16}rem;
|
|
52
|
-
`,Et=T.default.a`
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
text-decoration: none;
|
|
56
|
-
padding: ${({theme:t})=>t.spaces[2]};
|
|
57
|
-
padding-left: ${({theme:t})=>t.spaces[5]};
|
|
58
|
-
|
|
59
|
-
svg {
|
|
60
|
-
color: ${({theme:t})=>t.colors.neutral600};
|
|
61
|
-
margin-right: ${({theme:t})=>t.spaces[2]};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&:hover {
|
|
65
|
-
background: ${({theme:t})=>t.colors.neutral100};
|
|
66
|
-
color: ${({theme:t})=>t.colors.neutral500};
|
|
67
|
-
|
|
68
|
-
svg {
|
|
69
|
-
color: ${({theme:t})=>t.colors.neutral700};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
${[S.Typography]} {
|
|
73
|
-
color: ${({theme:t})=>t.colors.neutral700};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
${[S.Typography]} {
|
|
78
|
-
color: ${({theme:t})=>t.colors.neutral600};
|
|
79
|
-
}
|
|
80
|
-
`,yt=()=>{const[t,a]=(0,e.useState)(!1),{formatMessage:o}=(0,l.useIntl)(),{showTutorials:s}=(0,$.um)();if(!s)return null;const u=[{icon:"book",label:o({id:"global.documentation",defaultMessage:"Documentation"}),destination:"https://docs.strapi.io"},{icon:"file",label:o({id:"app.static.links.cheatsheet",defaultMessage:"CheatSheet"}),destination:"https://strapi-showcase.s3-us-west-2.amazonaws.com/CheatSheet.pdf"}],d=()=>{a(f=>!f)};return e.createElement(gt,{as:"aside"},e.createElement(ft,{id:"onboarding","aria-label":o({id:"app.components.Onboarding.help.button",defaultMessage:"Help button"}),onClick:d},!t&&e.createElement(ee.G,{icon:ve.faQuestion}),t&&e.createElement(ee.G,{icon:ve.faTimes})),t&&e.createElement(E.FocusTrap,{onEscape:d},e.createElement(ht,{background:"neutral0",hasRadius:!0,shadow:"tableShadow",paddingBottom:2,paddingTop:2},u.map(f=>e.createElement(Et,{key:f.label,rel:"nofollow noreferrer noopener",target:"_blank",href:f.destination},e.createElement(ee.G,{icon:f.icon}),e.createElement(S.Typography,null,f.label))))))},vt=(0,e.lazy)(()=>Promise.all([n.e(8469),n.e(9420),n.e(20),n.e(1669),n.e(8773),n.e(994)]).then(n.bind(n,92494))),Tt=(0,e.lazy)(()=>Promise.all([n.e(4800),n.e(3981)]).then(n.bind(n,44762))),Pt=(0,e.lazy)(()=>n.e(3677).then(n.bind(n,15415))),Ct=(0,e.lazy)(()=>Promise.all([n.e(8469),n.e(5516)]).then(n.bind(n,71561))),Te=(0,e.lazy)(()=>Promise.resolve().then(n.bind(n,53951))),Mt=(0,e.lazy)(()=>n.e(9501).then(n.bind(n,92336))),Ot=(0,e.lazy)(()=>n.e(9497).then(n.bind(n,9972))),Pe=(0,e.lazy)(()=>Promise.all([n.e(8469),n.e(9420),n.e(20),n.e(5895)]).then(n.bind(n,50020))),Rt=()=>{const{trackUsage:t}=(0,i.useTracking)(),a=(0,N.useDispatch)(),o=(0,N.useSelector)(s=>s.admin_app.status);(0,e.useEffect)(()=>{o==="init"&&(t("didAccessAuthenticatedAdministration"),a({type:mt.e}))},[o])},St=()=>{Rt();const{isLoading:t,generalSectionLinks:a,pluginsSectionLinks:o}=(0,$.H9)(),{menu:s}=(0,i.useStrapiApp)(),u=(0,e.useMemo)(()=>s.filter(d=>d.Component).map(({to:d,Component:f,exact:y})=>(0,ye.ot)(f,d,y)),[s]);return t?e.createElement(i.LoadingIndicatorPage,null):e.createElement(L.DndProvider,{backend:K.PD},e.createElement(ut,{sideNav:e.createElement(dt,{generalSectionLinks:a,pluginsSectionLinks:o})},e.createElement(e.Suspense,{fallback:e.createElement(i.LoadingIndicatorPage,null)},e.createElement(p.Switch,null,e.createElement(p.Route,{path:"/",component:Tt,exact:!0}),e.createElement(p.Route,{path:"/me",component:Ot,exact:!0}),e.createElement(p.Route,{path:"/content-manager",component:vt}),u,e.createElement(p.Route,{path:"/settings/:settingId",component:Pe}),e.createElement(p.Route,{path:"/settings",component:Pe,exact:!0}),e.createElement(p.Route,{path:"/marketplace"},e.createElement(Ct,null)),e.createElement(p.Route,{path:"/list-plugins",exact:!0},e.createElement(Pt,null)),e.createElement(p.Route,{path:"/404",component:Te}),e.createElement(p.Route,{path:"/500",component:Mt}),e.createElement(p.Route,{path:"",component:Te}))),e.createElement(tt,null),e.createElement(yt,null)))};var At=Object.defineProperty,Ce=Object.getOwnPropertySymbols,xt=Object.prototype.hasOwnProperty,It=Object.prototype.propertyIsEnumerable,Me=(t,a,o)=>a in t?At(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,Lt=(t,a)=>{for(var o in a||(a={}))xt.call(a,o)&&Me(t,o,a[o]);if(Ce)for(var o of Ce(a))It.call(a,o)&&Me(t,o,a[o]);return t};const Dt=t=>({plugins:Object.keys(t).reduce((a,o)=>(a[o]=Lt({},t[o]),a),{})});var Bt=n(3040),bt=n.n(Bt);const Oe={plugins:null},Nt=(t=Oe,a)=>(0,re.default)(t,o=>{switch(a.type){case"SET_PLUGIN_READY":{bt()(o,["plugins",a.pluginId,"isReady"],!0);break}default:return o}}),Gt=()=>{const{plugins:t}=(0,i.useStrapiApp)(),[{plugins:a},o]=(0,e.useReducer)(Nt,Oe,()=>Dt(t)),s=(0,e.useRef)(d=>{o({type:"SET_PLUGIN_READY",pluginId:d})});if(Object.keys(a).some(d=>a[d].isReady===!1)){const d=Object.keys(a).reduce((f,y)=>{const h=a[y].initializer;if(h){const c=a[y].pluginId;f.push(e.createElement(h,{key:c,setPlugin:s.current}))}return f},[]);return e.createElement(e.Fragment,null,d,e.createElement(i.LoadingIndicatorPage,null))}return e.createElement(St,null)};var Re=n(17367);const Ut=()=>({type:Re.l}),Ft=t=>({type:Re.m,permissions:t}),Se=({children:t,permissions:a,refetchPermissions:o})=>{const{allPermissions:s}=(0,N.useSelector)(d=>d.rbacProvider),u=(0,N.useDispatch)();return(0,e.useEffect)(()=>(u(Ft(a)),()=>{u(Ut())}),[a,u]),s?e.createElement(i.RBACProviderContext.Provider,{value:{allPermissions:s,refetchPermissions:o}},t):e.createElement(i.LoadingIndicatorPage,null)};Se.propTypes={children:r().element.isRequired,permissions:r().array.isRequired,refetchPermissions:r().func.isRequired};const Wt=Se;var jt=n(2739),$t=n.n(jt),Kt=n(54770),te=n.n(Kt);const Ae=(t,a)=>!te().valid(t)||!te().valid(a)?!1:te().lt(t,a);var ne=n(17247),H=(t,a,o)=>new Promise((s,u)=>{var d=h=>{try{y(o.next(h))}catch(c){u(c)}},f=h=>{try{y(o.throw(h))}catch(c){u(c)}},y=h=>h.done?s(h.value):Promise.resolve(h.value).then(d,f);y((o=o.apply(t,a)).next())});const xe=M.i8,Vt=!JSON.parse(localStorage.getItem("STRAPI_UPDATE_NOTIF")),zt=t=>H(void 0,null,function*(){try{const{data:{tag_name:a}}=yield $t().get("https://api.github.com/repos/strapi/strapi/releases/latest");return Ae(xe,a)&&Vt&&t({type:"info",message:{id:"notification.version.update.message"},link:{url:`https://github.com/strapi/strapi/releases/tag/${a}`,label:{id:"global.see-more"}},blockTransition:!0,onClose:()=>localStorage.setItem("STRAPI_UPDATE_NOTIF",!0)}),a}catch(a){return xe}}),kt=()=>H(void 0,null,function*(){try{const{data:t,headers:a}=yield ne.be.get("/admin/information");if(!a["content-type"].includes("application/json"))throw new Error("Not found");return t.data}catch(t){throw new Error(t)}}),Ht=()=>H(void 0,null,function*(){try{const{data:t,headers:a}=yield ne.be.get("/admin/users/me/permissions");if(!a["content-type"].includes("application/json"))throw new Error("Not found");return t.data}catch(t){throw new Error(t)}}),Zt=()=>H(void 0,null,function*(){try{const{data:{data:{roles:t}}}=yield ne.be.get("/admin/users/me");return t}catch(t){throw new Error(t)}});var Qt=Object.defineProperty,Yt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,wt=Object.prototype.propertyIsEnumerable,Le=(t,a,o)=>a in t?Qt(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o,qt=(t,a)=>{for(var o in a||(a={}))Jt.call(a,o)&&Le(t,o,a[o]);if(Ie)for(var o of Ie(a))wt.call(a,o)&&Le(t,o,a[o]);return t},_t=(t,a)=>Yt(t,Xt(a));const De=M.i8,en=()=>{const{setGuidedTourVisibility:t}=(0,i.useGuidedTour)(),a=(0,i.useNotification)(),o=(0,e.useRef)(t),s=i.auth.getUserInfo(),u=X()(s,"username")||(0,ye.Pp)(s.firstname,s.lastname),[d,f]=(0,e.useState)(u),{showReleaseNotification:y}=(0,$.um)(),[{data:h,status:c},{data:D,isLoading:B},{data:V,status:z,refetch:j,isFetched:m,isFetching:x},{data:I}]=(0,b.useQueries)([{queryKey:"app-infos",queryFn:kt},{queryKey:"strapi-release",queryFn:()=>zt(a),enabled:y,initialData:De},{queryKey:"admin-users-permission",queryFn:Ht,initialData:[]},{queryKey:"user-roles",queryFn:Zt}]),Z=(0,e.useMemo)(()=>Ae(De,D),[D]);return(0,e.useEffect)(()=>{I&&I.find(({code:Y})=>Y==="strapi-super-admin")&&o.current(!0)},[I]),B||(x&&m||c==="loading"||z==="loading")?e.createElement(i.LoadingIndicatorPage,null):c==="error"?e.createElement("div",null,"error..."):e.createElement(i.AppInfosContext.Provider,{value:_t(qt({},h),{latestStrapiReleaseTag:D,setUserDisplayName:f,shouldUpdateStrapi:Z,userDisplayName:d})},e.createElement(Wt,{permissions:V,refetchPermissions:j},e.createElement(Gt,null)))}},78024:(k,C,n)=>{n.d(C,{Z:()=>r});var e=n(32735),i=n(60216),b=n.n(i),P=n(88425),X=n.n(P),M=n(9808),$=n.n(M),p=n(23678),N=Object.defineProperty,L=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,G=(l,v,E)=>v in l?N(l,v,{enumerable:!0,configurable:!0,writable:!0,value:E}):l[v]=E,O=(l,v)=>{for(var E in v||(v={}))K.call(v,E)&&G(l,E,v[E]);if(L)for(var E of L(v))F.call(v,E)&&G(l,E,v[E]);return l},T=(l,v)=>{var E={};for(var g in l)K.call(l,g)&&v.indexOf(g)<0&&(E[g]=l[g]);if(l!=null&&L)for(var g of L(l))v.indexOf(g)<0&&F.call(l,g)&&(E[g]=l[g]);return E};const U=l=>{var v=l,{type:E}=v,g=T(v,["type"]);return e.createElement(M.Box,O({width:(0,P.pxToRem)(2),height:"100%",background:E===p.VM?"neutral300":"primary500",hasRadius:!0},g))};U.defaultProps={type:p.VM},U.propTypes={type:b().oneOf([p.lW,p.hx,p.VM])};const r=U},14317:(k,C,n)=>{n.d(C,{Z:()=>U});var e=n(32735),i=n(60216),b=n.n(i),P=n(88425),X=n.n(P),M=n(19192),$=n.n(M),p=n(95602),N=n.n(p),L=n(78752),K=n.n(L),F=n(88677),G=n.n(F),O=n(23678);const T=({type:r,number:l})=>r===O.hx?e.createElement(M.Flex,{background:"primary600",padding:2,borderRadius:"50%",width:(0,P.pxToRem)(30),height:(0,P.pxToRem)(30),justifyContent:"center"},e.createElement(L.Icon,{as:G(),"aria-hidden":!0,width:(0,P.pxToRem)(16),color:"neutral0"})):r===O.lW?e.createElement(M.Flex,{background:"primary600",padding:2,borderRadius:"50%",width:(0,P.pxToRem)(30),height:(0,P.pxToRem)(30),justifyContent:"center"},e.createElement(p.Typography,{fontWeight:"semiBold",textColor:"neutral0"},l)):e.createElement(M.Flex,{borderColor:"neutral500",borderWidth:"1px",borderStyle:"solid",padding:2,borderRadius:"50%",width:(0,P.pxToRem)(30),height:(0,P.pxToRem)(30),justifyContent:"center"},e.createElement(p.Typography,{fontWeight:"semiBold",textColor:"neutral600"},l));T.defaultProps={number:void 0,type:O.VM},T.propTypes={number:b().number,type:b().oneOf([O.lW,O.hx,O.VM])};const U=T},23678:(k,C,n)=>{n.d(C,{VM:()=>b,hx:()=>i,lW:()=>e});const e="isActive",i="isDone",b="isNotDone"},58107:(k,C,n)=>{n.d(C,{Z:()=>i});const i={contentTypeBuilder:{home:{title:{id:"app.components.GuidedTour.home.CTB.title",defaultMessage:"\u{1F9E0} Build the content structure"},cta:{title:{id:"app.components.GuidedTour.home.CTB.cta.title",defaultMessage:"Go to the Content type Builder"},type:"REDIRECT",target:"/plugins/content-type-builder"},trackingEvent:"didClickGuidedTourHomepageContentTypeBuilder"},create:{title:{id:"app.components.GuidedTour.CTB.create.title",defaultMessage:"\u{1F9E0} Create a first Collection type"},content:{id:"app.components.GuidedTour.CTB.create.content",defaultMessage:"<p>Collection types help you manage several entries, Single types are suitable to manage only one entry.</p> <p>Ex: For a Blog website, Articles would be a Collection type whereas a Homepage would be a Single type.</p>"},cta:{title:{id:"app.components.GuidedTour.CTB.create.cta.title",defaultMessage:"Build a Collection type"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep1CollectionType"},success:{title:{id:"app.components.GuidedTour.CTB.success.title",defaultMessage:"Step 1: Completed \u2705"},content:{id:"app.components.GuidedTour.CTB.success.content",defaultMessage:"<p>Good going!</p><b>\u26A1\uFE0F What would you like to share with the world?</b>"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"REDIRECT",target:"/content-manager"},trackingEvent:"didCreateGuidedTourCollectionType"}},contentManager:{home:{title:{id:"app.components.GuidedTour.home.CM.title",defaultMessage:"\u26A1\uFE0F What would you like to share with the world?"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"REDIRECT",target:"/content-manager"},trackingEvent:"didClickGuidedTourHomepageContentManager"},create:{title:{id:"app.components.GuidedTour.CM.create.title",defaultMessage:"\u26A1\uFE0F Create content"},content:{id:"app.components.GuidedTour.CM.create.content",defaultMessage:"<p>Create and manage all the content here in the Content Manager.</p><p>Ex: Taking the Blog website example further, one can write an Article, save and publish it as they like.</p><p>\u{1F4A1} Quick tip - Don't forget to hit publish on the content you create.</p>"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep2ContentManager"},success:{title:{id:"app.components.GuidedTour.CM.success.title",defaultMessage:"Step 2: Completed \u2705"},content:{id:"app.components.GuidedTour.CM.success.content",defaultMessage:"<p>Awesome, one last step to go!</p><b>\u{1F680} See content in action</b>"},cta:{title:{id:"app.components.GuidedTour.CM.success.cta.title",defaultMessage:"Test the API"},type:"REDIRECT",target:"/settings/api-tokens"},trackingEvent:"didCreateGuidedTourEntry"}},apiTokens:{home:{title:{id:"app.components.GuidedTour.apiTokens.create.title",defaultMessage:"\u{1F680} See content in action"},cta:{title:{id:"app.components.GuidedTour.home.apiTokens.cta.title",defaultMessage:"Test the API"},type:"REDIRECT",target:"/settings/api-tokens"},trackingEvent:"didClickGuidedTourHomepageApiTokens"},create:{title:{id:"app.components.GuidedTour.apiTokens.create.title",defaultMessage:"\u{1F680} See content in action"},content:{id:"app.components.GuidedTour.apiTokens.create.content",defaultMessage:"<p>Generate an authentication token here and retrieve the content you just created.</p>"},cta:{title:{id:"app.components.GuidedTour.apiTokens.create.cta.title",defaultMessage:"Generate an API Token"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep3ApiTokens"},success:{title:{id:"app.components.GuidedTour.apiTokens.success.title",defaultMessage:"Step 3: Completed \u2705"},content:{id:"app.components.GuidedTour.apiTokens.success.content",defaultMessage:"<p>See content in action by making an HTTP request:</p><ul><li><p>To this URL: <light>https://'<'YOUR_DOMAIN'>'/api/'<'YOUR_CT'>'</light></p></li><li><p>With the header: <light>Authorization: bearer '<'YOUR_API_TOKEN'>'</light></p></li></ul><p>For more ways to interact with content, see the <documentationLink>documentation</documentationLink>.</p>"},trackingEvent:"didGenerateGuidedTourApiTokens"}}}}}]);
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5895],{50020:(K,A,n)=>{"use strict";n.r(A),n.d(A,{SettingsPage:()=>_t,default:()=>Rn});var e=n(32735),y=n(88425),r=n(5141),$=n(11856),L=n(5636),_=n(99357),ee=n(73869),te=n(7602),Pe=n(84968),H=n(16540),M=n(9808),T=n(78330),G=n(95602),me=n(90662),V=n(44526),oe=n(14983),Qe=n(82372),He=n.n(Qe),ke=n(88677),Se=n.n(ke),Y=n(60216),v=n.n(Y),ge=n(69898),Ve=n(20763),Ne=n(59290),le=n.n(Ne),re=n(23101),ye=n.n(re),We=n(22909);const Xe={currentStep:void 0},$e=(u=Xe,l)=>(0,We.default)(u,d=>{switch(l.type){case"GO_TO":{d.currentStep=l.to;break}default:return d}});var Re=n(4122);const Ze={localImage:void 0},qe=(u=Ze,l)=>(0,We.default)(u,d=>{switch(l.type){case"SET_LOCAL_IMAGE":{d.localImage=l.value;break}default:return d}}),D=({onChangeLogo:u,customLogo:l,goTo:d,Component:f,modalTitle:b,next:p,prev:I,currentStep:R})=>{const[{localImage:C},x]=(0,e.useReducer)(qe,Ze),{formatMessage:Ae}=(0,L.useIntl)(),he=yt=>{x({type:"SET_LOCAL_IMAGE",value:yt})},nt=()=>{d(null)};return R?e.createElement(Re.ModalLayout,{labelledBy:"modal",onClose:nt},e.createElement(Re.ModalHeader,null,e.createElement(G.Typography,{fontWeight:"bold",as:"h2",id:"modal"},Ae(b))),e.createElement(f,{setLocalImage:he,goTo:d,next:p,prev:I,onClose:nt,asset:C||l,onChangeLogo:u})):null};D.defaultProps={Component:void 0,currentStep:void 0,customLogo:void 0,modalTitle:void 0,next:null,prev:null},D.propTypes={Component:v().elementType,currentStep:v().string,customLogo:v().shape({name:v().string,url:v().string,width:v().number,height:v().number,ext:v().string}),goTo:v().func.isRequired,modalTitle:v().shape({id:v().string,defaultMessage:v().string}),next:v().string,onChangeLogo:v().func.isRequired,prev:v().string};const Z=D,W=750,ae=100,fe=["image/jpeg","image/png","image/svg+xml"];var U=n(81700),q=n(27635),ie=n(19615),z=n(19192),ue=n(78752),Le=n(20001),Ge=n(22795),ze=n.n(Ge),it=(u,l,d)=>new Promise((f,b)=>{var p=C=>{try{R(d.next(C))}catch(x){b(x)}},I=C=>{try{R(d.throw(C))}catch(x){b(x)}},R=C=>C.done?f(C.value):Promise.resolve(C.value).then(p,I);R((d=d.apply(u,l)).next())});const _e={id:"Settings.application.customization.modal.upload.error-format",defaultMessage:"Wrong format uploaded (accepted formats only: jpeg, jpg, png, svg)."},w={id:"Settings.application.customization.modal.upload.error-size",defaultMessage:"The file uploaded is too large (max dimension: {dimension}x{dimension}, max file size: {size}KB)"},X=u=>new Promise(l=>{const d=new FileReader;d.onload=()=>{const f=new Image;f.onload=function(){l({width:f.width,height:f.height})},f.src=d.result},d.readAsDataURL(u)}),Q=(u,l)=>({ext:u.name.split(".").pop(),size:u.size/1e3,name:u.name,url:URL.createObjectURL(u),rawFile:u,width:l.width,height:l.height}),h=u=>it(void 0,null,function*(){let l;if(!fe.includes(u.type))throw l=new Error("File format"),l.displayMessage=_e,l;const f=yield X(u);if(!(f.width<=W&&f.height<=W))throw l=new Error("File sizing"),l.displayMessage=w,l;const p=Q(u,f);if(!(p.size<=ae))throw l=new Error("File sizing"),l.displayMessage=w,l;return p});var Fe=(u,l,d)=>new Promise((f,b)=>{var p=C=>{try{R(d.next(C))}catch(x){b(x)}},I=C=>{try{R(d.throw(C))}catch(x){b(x)}},R=C=>C.done?f(C.value):Promise.resolve(C.value).then(p,I);R((d=d.apply(u,l)).next())});const et=(0,ie.default)(Le.FieldInput)`
|
|
2
|
-
opacity: 0;
|
|
3
|
-
position: absolute;
|
|
4
|
-
top: 0;
|
|
5
|
-
bottom: 0;
|
|
6
|
-
left: 0;
|
|
7
|
-
right: 0;
|
|
8
|
-
z-index: 1;
|
|
9
|
-
`,Ye=({setLocalImage:u,goTo:l,next:d,onClose:f})=>{const{formatMessage:b}=(0,L.useIntl)(),[p,I]=(0,e.useState)(!1),[R,C]=(0,e.useState)(void 0),x=(0,e.useRef)(null),Ae=()=>I(!0),he=()=>I(!1),nt=st=>{st.preventDefault(),x.current.click()},yt=()=>Fe(void 0,null,function*(){he();const st=x.current.files[0];if(!!st)try{const rt=yield h(st);u(rt),l(d)}catch(rt){if(rt.displayMessage)C(b(rt.displayMessage,{size:ae,dimension:W})),x.current.focus();else throw rt}}),at=()=>p?"primary500":R?"danger600":"neutral300";return e.createElement(e.Fragment,null,e.createElement("form",null,e.createElement(M.Box,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(Le.Field,{name:"logo-upload",error:R},e.createElement("label",{htmlFor:"logo-upload"},e.createElement(me.Stack,{spacing:2},e.createElement(z.Flex,{paddingTop:9,paddingBottom:7,hasRadius:!0,justifyContent:"center",direction:"column",background:p?"primary100":"neutral100",borderColor:at(),borderStyle:"dashed",borderWidth:"1px",position:"relative",onDragEnter:Ae,onDragLeave:he},e.createElement(ue.Icon,{color:"primary600",width:`${60/16}rem`,height:`${60/16}rem`,as:ze(),"aria-hidden":!0}),e.createElement(M.Box,{paddingTop:3,paddingBottom:5},e.createElement(G.Typography,{variant:"delta",as:"span"},b({id:"Settings.application.customization.modal.upload.drag-drop",defaultMessage:"Drag and Drop here or"}))),e.createElement(et,{accept:fe,cursor:"pointer",as:"input",type:"file",name:"files",tabIndex:-1,zIndex:1,onChange:yt,ref:x,id:"logo-upload"}),e.createElement(V.Button,{type:"button",onClick:nt},b({id:"Settings.application.customization.modal.upload.cta.browse",defaultMessage:"Browse files"})),e.createElement(M.Box,{paddingTop:6},e.createElement(G.Typography,{variant:"pi",textColor:"neutral600"},b({id:"Settings.application.customization.modal.upload.file-validation",defaultMessage:"Max dimension: {dimension}x{dimension}, Max size: {size}KB"},{size:ae,dimension:W})))),e.createElement(Le.FieldError,null)))))),e.createElement(Re.ModalFooter,{startActions:e.createElement(V.Button,{onClick:f,variant:"tertiary"},b({id:"Settings.application.customization.modal.cancel",defaultMessage:"Cancel"}))}))};Ye.defaultProps={next:null},Ye.propTypes={goTo:v().func.isRequired,next:v().string,onClose:v().func.isRequired,setLocalImage:v().func.isRequired};const ne=Ye;var ve=n(37178),Te=n(2739),tn=n.n(Te),nn=(u,l,d)=>new Promise((f,b)=>{var p=C=>{try{R(d.next(C))}catch(x){b(x)}},I=C=>{try{R(d.throw(C))}catch(x){b(x)}},R=C=>C.done?f(C.value):Promise.resolve(C.value).then(p,I);R((d=d.apply(u,l)).next())});const Bt=u=>nn(void 0,null,function*(){try{const l=yield tn().get(u,{responseType:"blob",timeout:8e3});return new File([l.data],l.config.url,{type:l.headers["content-type"]})}catch(l){throw l.displayMessage={id:"Settings.application.customization.modal.upload.error-network",defaultMessage:"Network error"},l}});var wt=(u,l,d)=>new Promise((f,b)=>{var p=C=>{try{R(d.next(C))}catch(x){b(x)}},I=C=>{try{R(d.throw(C))}catch(x){b(x)}},R=C=>C.done?f(C.value):Promise.resolve(C.value).then(p,I);R((d=d.apply(u,l)).next())});const Et=({goTo:u,next:l,onClose:d,setLocalImage:f})=>{const{formatMessage:b}=(0,L.useIntl)(),[p,I]=(0,e.useState)(""),[R,C]=(0,e.useState)(null),x=he=>{I(he.target.value)},Ae=()=>wt(void 0,null,function*(){try{const he=yield Bt(p),nt=yield h(he);f(nt),u(l)}catch(he){if(he.displayMessage)C(b(he.displayMessage,{size:ae,dimension:W}));else throw he}});return e.createElement("form",{onSubmit:he=>{he.preventDefault(),Ae()}},e.createElement(M.Box,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(ve.TextInput,{label:b({id:"Settings.application.customization.modal.upload.from-url.input-label",defaultMessage:"URL"}),error:R,onChange:x,value:p,name:"logo-url"})),e.createElement(Re.ModalFooter,{startActions:e.createElement(V.Button,{onClick:d,variant:"tertiary"},b({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(V.Button,{type:"submit"},b({id:"Settings.application.customization.modal.upload.next",defaultMessage:"Next"}))}))};Et.defaultProps={next:null},Et.propTypes={goTo:v().func.isRequired,next:v().string,onClose:v().func.isRequired,setLocalImage:v().func.isRequired};const $n=Et,ut=({setLocalImage:u,goTo:l,next:d,onClose:f})=>{const{formatMessage:b}=(0,L.useIntl)();return e.createElement(U.TabGroup,{label:b({id:"Settings.application.customization.modal.tab.label",defaultMessage:"How do you want to upload your assets?"}),variant:"simple"},e.createElement(M.Box,{paddingLeft:8,paddingRight:8},e.createElement(U.Tabs,null,e.createElement(U.Tab,null,b({id:"Settings.application.customization.modal.upload.from-computer",defaultMessage:"From computer"})),e.createElement(U.Tab,null,b({id:"Settings.application.customization.modal.upload.from-url",defaultMessage:"From url"}))),e.createElement(q.Divider,null)),e.createElement(U.TabPanels,null,e.createElement(U.TabPanel,null,e.createElement(ne,{onClose:f,setLocalImage:u,goTo:l,next:d})),e.createElement(U.TabPanel,null,e.createElement($n,{onClose:f,setLocalImage:u,goTo:l,next:d}))))};ut.defaultProps={next:null},ut.propTypes={goTo:v().func.isRequired,next:v().string,onClose:v().func.isRequired,setLocalImage:v().func.isRequired};const Un=ut;var ot=n(31998);const jt=({asset:u})=>{const{formatMessage:l}=(0,L.useIntl)();return e.createElement(ot.Card,null,e.createElement(ot.CardHeader,null,e.createElement(ot.CardAsset,{size:"S",src:u.url})),e.createElement(ot.CardBody,null,e.createElement(ot.CardContent,null,e.createElement(ot.CardTitle,null,u.name),e.createElement(ot.CardSubtitle,null,`${u.ext.toUpperCase()} - ${u.width}\u2715${u.height}`)),e.createElement(ot.CardBadge,null,l({id:"Settings.application.customization.modal.pending.card-badge",defaultMessage:"image"}))))};jt.propTypes={asset:v().shape({name:v().string,url:v().string,width:v().number,height:v().number,ext:v().string}).isRequired};const Nt=jt,Tt=({onClose:u,asset:l,prev:d,next:f,goTo:b,setLocalImage:p,onChangeLogo:I})=>{const{formatMessage:R}=(0,L.useIntl)(),C=()=>{p(void 0),b(d)},x=()=>{I(l),b(f)};return e.createElement(e.Fragment,null,e.createElement(M.Box,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(z.Flex,{justifyContent:"space-between",paddingBottom:6},e.createElement(z.Flex,{direction:"column",alignItems:"flex-start"},e.createElement(G.Typography,{variant:"pi",fontWeight:"bold"},R({id:"Settings.application.customization.modal.pending.title",defaultMessage:"Logo ready to upload"})),e.createElement(G.Typography,{variant:"pi",textColor:"neutral500"},R({id:"Settings.application.customization.modal.pending.subtitle",defaultMessage:"Manage the chosen logo before uploading it"}))),e.createElement(V.Button,{onClick:C,variant:"secondary"},R({id:"Settings.application.customization.modal.pending.choose-another",defaultMessage:"Choose another logo"}))),e.createElement(M.Box,{maxWidth:(0,y.pxToRem)(180)},e.createElement(Nt,{asset:l}))),e.createElement(Re.ModalFooter,{startActions:e.createElement(V.Button,{onClick:u,variant:"tertiary"},R({id:"Settings.application.customization.modal.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(V.Button,{onClick:x},R({id:"Settings.application.customization.modal.pending.upload",defaultMessage:"Upload logo"}))}))};Tt.defaultProps={next:null,prev:null},Tt.propTypes={goTo:v().func.isRequired,asset:v().shape({name:v().string,url:v().string,width:v().number,height:v().number,ext:v().string}).isRequired,next:v().string,onClose:v().func.isRequired,onChangeLogo:v().func.isRequired,prev:v().string,setLocalImage:v().func.isRequired};const sn={upload:{Component:Un,modalTitle:{id:"Settings.application.customization.modal.upload",defaultMessage:"Upload logo"},next:"pending",prev:null},pending:{Component:Tt,modalTitle:{id:"Settings.application.customization.modal.pending",defaultMessage:"Pending logo"},next:null,prev:"upload"}},pt=({customLogo:u,defaultLogo:l,onChangeLogo:d,onResetMenuLogo:f})=>{const[{currentStep:b},p]=(0,e.useReducer)($e,Xe),{Component:I,next:R,prev:C,modalTitle:x}=sn[b]||{},{formatMessage:Ae}=(0,L.useIntl)(),he=nt=>{p({type:"GO_TO",to:nt})};return e.createElement(e.Fragment,null,e.createElement(ge.CarouselInput,{label:Ae({id:"Settings.application.customization.carousel.title",defaultMessage:"Logo"}),selectedSlide:0,hint:Ae({id:"Settings.application.customization.carousel-hint",defaultMessage:"Change the admin panel logo (Max dimension: {dimension}x{dimension}, Max file size: {size}KB)"},{size:ae,dimension:W}),previousLabel:"",nextLabel:"",onNext:()=>{},onPrevious:()=>{},secondaryLabel:(u==null?void 0:u.name)||"logo.png",actions:e.createElement(ge.CarouselActions,null,e.createElement(Ve.IconButton,{onClick:()=>he(u?"pending":"upload"),label:Ae({id:"Settings.application.customization.carousel.change-action",defaultMessage:"Change logo"}),icon:e.createElement(le(),null)}),u&&e.createElement(Ve.IconButton,{onClick:f,label:Ae({id:"Settings.application.customization.carousel.reset-action",defaultMessage:"Reset logo"}),icon:e.createElement(ye(),null)}))},e.createElement(ge.CarouselSlide,{label:Ae({id:"Settings.application.customization.carousel-slide.label",defaultMessage:"Logo slide"})},e.createElement(M.Box,{maxHeight:"40%",maxWidth:"40%",as:"img",src:(u==null?void 0:u.url)||l,alt:Ae({id:"Settings.application.customization.carousel.title",defaultMessage:"Logo"})}))),e.createElement(Z,{Component:I,currentStep:b,onChangeLogo:d,customLogo:u,goTo:he,next:R,prev:C,modalTitle:x}))};pt.defaultProps={customLogo:null},pt.propTypes={customLogo:v().shape({url:v().string,name:v().string}),defaultLogo:v().string.isRequired,onChangeLogo:v().func.isRequired,onResetMenuLogo:v().func.isRequired};const Wt=pt,bt={menuLogo:{display:null,submit:{rawFile:null,isReset:!1}}},Vn=(u=bt,l)=>(0,We.default)(u,d=>{switch(l.type){case"SET_CUSTOM_MENU_LOGO":{d.menuLogo.display=l.value,d.menuLogo.submit.rawFile=l.value.rawFile;break}case"RESET_CUSTOM_MENU_LOGO":{d.menuLogo.display=null,d.menuLogo.submit={rawFile:null,isReset:!0};break}default:return d}});var At=n(86349),Zn=n.n(At);const Gn=(u,l)=>Zn()(u,{menuLogo:{display:l.menuLogo}}),Ot=(0,e.forwardRef)(({projectSettingsStored:u},l)=>{const{formatMessage:d}=(0,L.useIntl)(),{trackUsage:f}=(0,y.useTracking)(),{logos:{menu:b}}=(0,ee.um)(),[{menuLogo:p},I]=(0,e.useReducer)(Vn,bt,()=>Gn(bt,u)),R=x=>{I({type:"SET_CUSTOM_MENU_LOGO",value:x})},C=()=>{f("didClickResetLogo"),I({type:"RESET_CUSTOM_MENU_LOGO"})};return(0,e.useImperativeHandle)(l,()=>({getValues:()=>({menuLogo:p.submit})})),e.createElement(M.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",paddingTop:6,paddingBottom:6,paddingRight:7,paddingLeft:7},e.createElement(G.Typography,{variant:"delta",as:"h3"},d({id:"Settings.application.customization",defaultMessage:"Customization"})),e.createElement(T.Grid,{paddingTop:4},e.createElement(T.GridItem,{col:6,s:12},e.createElement(Wt,{onChangeLogo:R,customLogo:p.display,defaultLogo:b.default,onResetMenuLogo:C}))))});Ot.defaultProps={projectSettingsStored:null},Ot.propTypes={projectSettingsStored:v().shape({menuLogo:v().shape({url:v().string,name:v().string})})};const rn=Ot;var $t=n(17247),zn=n(48344),gt=n.n(zn),Kn=Object.defineProperty,ft=Object.defineProperties,Ut=Object.getOwnPropertyDescriptors,Rt=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable,Dt=(u,l,d)=>l in u?Kn(u,l,{enumerable:!0,configurable:!0,writable:!0,value:d}):u[l]=d,Vt=(u,l)=>{for(var d in l||(l={}))kt.call(l,d)&&Dt(u,d,l[d]);if(Rt)for(var d of Rt(l))ln.call(l,d)&&Dt(u,d,l[d]);return u},Zt=(u,l)=>ft(u,Ut(l));const xt=u=>gt()(u,(l,d,f)=>{d&&d.url?l[f]=Zt(Vt({},d),{url:(0,y.prefixFileUrlWithBackendUrl)(d.url)}):l[f]=d},{});var Gt=(u,l,d)=>new Promise((f,b)=>{var p=C=>{try{R(d.next(C))}catch(x){b(x)}},I=C=>{try{R(d.throw(C))}catch(x){b(x)}},R=C=>C.done?f(C.value):Promise.resolve(C.value).then(p,I);R((d=d.apply(u,l)).next())});const Xn=()=>Gt(void 0,null,function*(){const{data:u}=yield $t.be.get("/admin/project-settings");return xt(u)}),cn=u=>Gt(void 0,null,function*(){const{data:l}=yield $t.be.post("/admin/project-settings",u);return xt(l)}),un=u=>{const l=new FormData;return Object.entries(u).forEach(([d,f])=>{f&&f.rawFile instanceof File&&l.append(d,f.rawFile),f&&f.isReset&&l.append(d,null)}),l};var zt=(u,l,d)=>new Promise((f,b)=>{var p=C=>{try{R(d.next(C))}catch(x){b(x)}},I=C=>{try{R(d.throw(C))}catch(x){b(x)}},R=C=>C.done?f(C.value):Promise.resolve(C.value).then(p,I);R((d=d.apply(u,l)).next())});const pn=[{action:"admin::project-settings.update",subject:null}],Qn=()=>{const u=(0,e.useRef)(),l=(0,y.useNotification)(),{trackUsage:d}=(0,y.useTracking)(),{formatMessage:f}=(0,L.useIntl)(),b=(0,Pe.useQueryClient)();(0,y.useFocusWhenNavigate)();const p=(0,y.useAppInfos)(),{shouldUpdateStrapi:I,latestStrapiReleaseTag:R,strapiVersion:C}=p,{updateProjectSettings:x}=(0,ee.um)(),{data:Ae}=(0,Pe.useQuery)("project-settings",Xn),he=p.communityEdition?"app.components.UpgradePlanModal.text-ce":"app.components.UpgradePlanModal.text-ee",nt=(0,Pe.useMutation)(at=>cn(at),{onSuccess:at=>zt(void 0,[at],function*({menuLogo:st}){yield b.invalidateQueries("project-settings",{refetchActive:!0}),x({menuLogo:st==null?void 0:st.url})})}),yt=()=>{const at=u.current.getValues(),st=un(at);nt.mutate(st,{onSuccess:()=>{const{menuLogo:rt}=at;rt.rawFile&&d("didChangeLogo")},onError:()=>{l({type:"warning",message:{id:"notification.error",defaultMessage:"An error occurred"}})}})};return e.createElement($.Layout,null,e.createElement(y.SettingsPageTitle,{name:"Application"}),e.createElement(H.Main,null,e.createElement($.HeaderLayout,{title:f({id:"Settings.application.title",defaultMessage:"Overview"}),subtitle:f({id:"Settings.application.description",defaultMessage:"Administration panel\u2019s global information"}),primaryAction:e.createElement(V.Button,{onClick:yt,startIcon:e.createElement(Se(),null)},f({id:"global.save",defaultMessage:"Save"}))}),e.createElement($.ContentLayout,null,e.createElement(me.Stack,{spacing:6},e.createElement(M.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",paddingTop:6,paddingBottom:6,paddingRight:7,paddingLeft:7},e.createElement(me.Stack,{spacing:5},e.createElement(G.Typography,{variant:"delta",as:"h3"},f({id:"global.details",defaultMessage:"Details"})),e.createElement(T.Grid,{paddingTop:1},e.createElement(T.GridItem,{col:6,s:12},e.createElement(G.Typography,{variant:"sigma",textColor:"neutral600"},f({id:"Settings.application.strapiVersion",defaultMessage:"strapi version"})),e.createElement(G.Typography,{as:"p"},"v",C),e.createElement(oe.Link,{href:p.communityEdition?"https://discord.strapi.io":"https://support.strapi.io/support/home",isExternal:!0,endIcon:e.createElement(He(),null)},f({id:"Settings.application.get-help",defaultMessage:"Get help"}))),e.createElement(T.GridItem,{col:6,s:12},e.createElement(G.Typography,{variant:"sigma",textColor:"neutral600"},f({id:"Settings.application.edition-title",defaultMessage:"current plan"})),e.createElement(G.Typography,{as:"p"},f({id:he,defaultMessage:`${p.communityEdition?"Community Edition":"Enterprise Edition"}`})))),e.createElement(T.Grid,{paddingTop:1},e.createElement(T.GridItem,{col:6,s:12},I&&e.createElement(oe.Link,{href:`https://github.com/strapi/strapi/releases/tag/${R}`,isExternal:!0,endIcon:e.createElement(He(),null)},f({id:"Settings.application.link-upgrade",defaultMessage:"Upgrade your admin panel"}))),e.createElement(T.GridItem,{col:6,s:12},e.createElement(oe.Link,{href:"https://strapi.io/pricing-self-hosted",isExternal:!0,endIcon:e.createElement(He(),null)},f({id:"Settings.application.link-pricing",defaultMessage:"See all pricing plans"})))),e.createElement(M.Box,{paddingTop:1},e.createElement(G.Typography,{variant:"sigma",textColor:"neutral600"},f({id:"Settings.application.node-version",defaultMessage:"node version"})),e.createElement(G.Typography,{as:"p"},p.nodeVersion)))),Ae&&e.createElement(y.CheckPermissions,{permissions:pn},e.createElement(rn,{ref:u,projectSettingsStored:Ae}))))))};var Kt=n(3704),mn=n.n(Kt);const gn=u=>mn()(u,d=>d.links).map(d=>(0,te.ot)(d.Component,d.to,d.exact||!1)),hn=u=>u.filter(l=>!l.links.every(d=>d.isDisplayed===!1));var Ht=n(15685),tt=n(52136),yn=n(72142),Ce=n.n(yn),vn=function(){return window&&window.strapi&&window.strapi.isEE?n(20178).Z:n(16329).Z}(),Cn=function(){return window&&window.strapi&&window.strapi.isEE?n(51899).Z:n(45677).Z}(),En=[{Component:function(){return{default:Cn}},to:"/settings/roles",exact:!0},{Component:function(){return{default:vn}},to:"/settings/roles/duplicate/:id",exact:!0},{Component:function(){return{default:vn}},to:"/settings/roles/new",exact:!0},{Component:function(){var u=(0,tt.Z)(Ce().mark(function d(){var f;return Ce().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.e(2544).then(n.bind(n,33778));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/roles/:id",exact:!0},{Component:function(){var u=(0,tt.Z)(Ce().mark(function d(){var f;return Ce().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.e(5199).then(n.bind(n,31904));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/users",exact:!0},{Component:function(){var u=(0,tt.Z)(Ce().mark(function d(){var f;return Ce().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.e(4263).then(n.bind(n,40874));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/users/:id",exact:!0},{Component:function(){var u=(0,tt.Z)(Ce().mark(function d(){var f;return Ce().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,Promise.all([n.e(4715),n.e(5162)]).then(n.bind(n,33238));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/webhooks/create",exact:!0},{Component:function(){var u=(0,tt.Z)(Ce().mark(function d(){var f;return Ce().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,Promise.all([n.e(4715),n.e(5162)]).then(n.bind(n,59021));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/webhooks/:id",exact:!0},{Component:function(){var u=(0,tt.Z)(Ce().mark(function d(){var f;return Ce().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.e(4121).then(n.bind(n,70791));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/webhooks",exact:!0},{Component:function(){var u=(0,tt.Z)(Ce().mark(function d(){var f;return Ce().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.e(8056).then(n.bind(n,23923));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/api-tokens",exact:!0},{Component:function(){var u=(0,tt.Z)(Ce().mark(function d(){var f;return Ce().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.e(4299).then(n.bind(n,3330));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/api-tokens/create",exact:!0},{Component:function(){var u=(0,tt.Z)(Ce().mark(function d(){var f;return Ce().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,n.e(92).then(n.bind(n,97841));case 2:return f=p.sent,p.abrupt("return",f);case 4:case"end":return p.stop()}},d)}));function l(){return u.apply(this,arguments)}return l}(),to:"/settings/api-tokens/:id",exact:!0}];const bn=En;var Xt=function(){return window&&window.strapi&&window.strapi.isEE?n(63775).Z:n(75936).Z}();const Pn=[].concat((0,Ht.Z)(Xt),(0,Ht.Z)(bn));var ht=n(89420),Yt=Object.defineProperty,Sn=Object.defineProperties,Tn=Object.getOwnPropertyDescriptors,Qt=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable,Lt=(u,l,d)=>l in u?Yt(u,l,{enumerable:!0,configurable:!0,writable:!0,value:d}):u[l]=d,It=(u,l)=>{for(var d in l||(l={}))Mt.call(l,d)&&Lt(u,d,l[d]);if(Qt)for(var d of Qt(l))An.call(l,d)&&Lt(u,d,l[d]);return u},Jt=(u,l)=>Sn(u,Tn(l));const qt=({menu:u})=>{const{formatMessage:l}=(0,L.useIntl)(),f=hn(u).map(p=>Jt(It({},p),{title:p.intlLabel,links:p.links.map(I=>Jt(It({},I),{title:I.intlLabel,name:I.id}))})),b=l({id:"global.settings",defaultMessage:"Settings"});return e.createElement(ht.SubNav,{ariaLabel:b},e.createElement(ht.SubNavHeader,{label:b}),e.createElement(ht.SubNavSections,null,f.map(p=>e.createElement(ht.SubNavSection,{key:p.id,label:l(p.intlLabel)},p.links.map(I=>e.createElement(ht.SubNavLink,{as:r.NavLink,withBullet:I.hasNotification,to:I.to,key:I.id},l(I.intlLabel)))))))};qt.propTypes={menu:v().array.isRequired};const On=qt;function _t(){const{settingId:u}=(0,r.useParams)(),{settings:l}=(0,y.useStrapiApp)(),{formatMessage:d}=(0,L.useIntl)(),{isLoading:f,menu:b}=(0,ee.Te)(),p=(0,e.useMemo)(()=>(0,te.WW)(Pn.map(({to:C,Component:x,exact:Ae})=>(0,te.ot)(x,C,Ae))),[]),I=gn(l);if(f)return e.createElement(y.LoadingIndicatorPage,null);if(!u)return e.createElement(r.Redirect,{to:"/settings/application-infos"});const R=d({id:"global.settings",defaultMessage:"Settings"});return e.createElement($.Layout,{sideNav:e.createElement(On,{menu:b})},e.createElement(_.Helmet,{title:R}),e.createElement(r.Switch,null,e.createElement(r.Route,{path:"/settings/application-infos",component:Qn,exact:!0}),p,I))}const Rn=(0,e.memo)(_t)},16329:(K,A,n)=>{"use strict";n.d(A,{Z:()=>$});var e=n(32735),y=n(5141);const $=()=>e.createElement(y.Redirect,{to:"/404"})},49466:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!0},35123:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!0},18318:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!0},52124:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!0},61526:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!0},25793:(K,A,n)=>{"use strict";n.d(A,{Z:()=>Ja});var e=n(32735),y=n(60216),r=n.n(y),$=n(88425),L=n(81700),_=n(23973),ee=n.n(_),te=n(86834),Pe=n.n(te),H=n(5636),M=n(9808),T=n(19615),G=n(98978),me=n.n(G),V=n(39515),oe=n(67793),Qe=n.n(oe),He=n(31476),ke=n.n(He),Se=n(35980),Y=n(19192),v=n(33795),ge=n.n(v),Ve=n(9086),Ne=n.n(Ve),le=n(73869),re=n(42258),ye=n.n(re),We=n(44526);const Xe=T.default.div`
|
|
10
|
-
position: relative;
|
|
11
|
-
|
|
12
|
-
${({hasConditions:a,disabled:t,theme:o})=>a&&`
|
|
13
|
-
&:before {
|
|
14
|
-
content: '';
|
|
15
|
-
position: absolute;
|
|
16
|
-
top: -3px;
|
|
17
|
-
left: -10px;
|
|
18
|
-
width: 6px;
|
|
19
|
-
height: 6px;
|
|
20
|
-
border-radius: ${20/16}rem;;
|
|
21
|
-
background: ${t?o.colors.neutral100:o.colors.primary600};
|
|
22
|
-
}
|
|
23
|
-
`}
|
|
24
|
-
`,Je=({onClick:a,className:t,hasConditions:o,variant:s})=>{const{formatMessage:i}=(0,H.useIntl)();return e.createElement(Xe,{hasConditions:o,className:t},e.createElement(We.Button,{variant:s,startIcon:e.createElement(ye(),null),onClick:a},i({id:"global.settings",defaultMessage:"Settings"})))};Je.defaultProps={className:null,hasConditions:!1,variant:"tertiary"},Je.propTypes={onClick:r().func.isRequired,className:r().string,hasConditions:r().bool,variant:r().string};const $e=(0,T.default)(Je)``;var Re=n(27635),Ze=n(90662),de=n(4122),qe=n(71657),D=n(95602),Z=n(22909),W=n(81346),ae=n.n(W),fe=n(23940),U=n.n(fe),q=n(16584),ie=n(15685),z=n(25716);const ue=`${120/16}rem`,Le=`${200/16}rem`,Ge=`${53/16}rem`;function ze(a,t){var o=Object.keys(a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),o.push.apply(o,s)}return o}function it(a){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?ze(Object(o),!0).forEach(function(s){(0,q.Z)(a,s,o[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(o)):ze(Object(o)).forEach(function(s){Object.defineProperty(a,s,Object.getOwnPropertyDescriptor(o,s))})}return a}var _e=function(){return window&&window.strapi&&window.strapi.isEE?n(56899).Z:n(49466).Z}(),w=(0,T.default)(Y.Flex).withConfig({displayName:"ActionRow__FlexWrapper",componentId:"sc-1bqpgdl-0"})(["height:",";"],Ge),X=function(t){var o=t.arrayOfOptionsGroupedByCategory,s=t.isFormDisabled,i=t.isGrey,c=t.label,m=t.name,g=t.onChange,E=t.value,P=(0,H.useIntl)(),S=P.formatMessage,F=o.reduce(function(j,N){var O=(0,V.Z)(N,2),B=O[0],J=O[1],ce={label:U()(B),children:J.map(function(De){return{label:De.displayName,value:De.id}})};return[].concat((0,ie.Z)(j),[ce])},[]),k=Object.values(E).map(function(j){return Object.entries(j).filter(function(N){var O=(0,V.Z)(N,2),B=O[1];return B}).map(function(N){var O=(0,V.Z)(N,1),B=O[0];return B})}).flat(),se=function(N){var O=(0,V.Z)(o,1),B=(0,V.Z)(O[0],2),J=B[1],ce=J.reduce(function(De,Ee){return it((0,q.Z)({},Ee.id,N.includes(Ee.id)),De)},{});g(m,ce)};return e.createElement(w,{as:"li",background:i?"neutral100":"neutral0"},e.createElement(Y.Flex,{paddingLeft:6,style:{width:180}},e.createElement(D.Typography,{variant:"sigma",textColor:"neutral600"},S({id:"Settings.permissions.conditions.can",defaultMessage:"Can"}),"\xA0"),e.createElement(D.Typography,{variant:"sigma",title:c,textColor:"primary600",ellipsis:!0},S({id:"Settings.roles.form.permissions.".concat(c.toLowerCase()),defaultMessage:c})),e.createElement(D.Typography,{variant:"sigma",textColor:"neutral600"},"\xA0",S({id:"Settings.permissions.conditions.when",defaultMessage:"When"}))),e.createElement(M.Box,{style:{maxWidth:430,width:"100%"}},e.createElement(z.MultiSelectNested,{id:m,customizeContent:function(N){return"".concat(N.length," currently selected")},onChange:se,value:k,options:F,disabled:s||_e})))};X.propTypes={arrayOfOptionsGroupedByCategory:r().array.isRequired,isFormDisabled:r().bool.isRequired,isGrey:r().bool.isRequired,label:r().string.isRequired,name:r().string.isRequired,value:r().object.isRequired,onChange:r().func.isRequired};const Q=X;var h=n(92891);const Fe=(a,t)=>a.reduce((o,s)=>(o[s.id]=(0,h.get)(t,s.id,!1),o),{}),et=(a,t)=>a.reduce((o,s)=>{const[i,c]=s,m=Fe(c,t);return o[i]=m,o},{}),ne=(a,t,o)=>a.reduce((s,i)=>{const c=(0,h.get)(t,[...i.pathToConditionsObject,"conditions"],{}),m=et(o,c);return s[i.pathToConditionsObject.join("..")]=m,s},{});var ve=Object.defineProperty,Te=Object.getOwnPropertySymbols,tn=Object.prototype.hasOwnProperty,nn=Object.prototype.propertyIsEnumerable,on=(a,t,o)=>t in a?ve(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,Bt=(a,t)=>{for(var o in t||(t={}))tn.call(t,o)&&on(a,o,t[o]);if(Te)for(var o of Te(t))nn.call(t,o)&&on(a,o,t[o]);return a};const wt=({actions:a,headerBreadCrumbs:t,isFormDisabled:o,onClosed:s,onToggle:i})=>{const{formatMessage:c}=(0,H.useIntl)(),{availableConditions:m,modifiedData:g,onChangeConditions:E}=(0,le.$_)(),P=(0,e.useMemo)(()=>Object.entries(ae()(m,"category")),[m]),S=a.filter(({isDisplayed:O,hasSomeActionsSelected:B,hasAllActionsSelected:J})=>O&&(B||J)),F=(0,e.useMemo)(()=>ne(S,g,P),[S,g,P]),[k,se]=(0,e.useState)(F),j=(O,B)=>{se((0,Z.default)(J=>{J[O]||(J[O]={}),J[O].default||(J[O].default={}),J[O].default=B}))},N=()=>{const O=Object.entries(k).reduce((B,J)=>{const[ce,De]=J,Ee=Object.values(De).reduce((xe,Be)=>Bt(Bt({},xe),Be),{});return B[ce]=Ee,B},{});E(O),i()};return e.createElement(de.ModalLayout,{labelledBy:"condition-modal-breadcrumbs",onClose:s},e.createElement(de.ModalHeader,null,e.createElement(qe.Breadcrumbs,{id:"condition-modal-breadcrumbs",label:t.join(", ")},t.map(O=>e.createElement(qe.Crumb,{key:O},U()(c({id:O,defaultMessage:O})))))),e.createElement(M.Box,{padding:8},e.createElement(Ze.Stack,{spacing:6},e.createElement(D.Typography,{variant:"beta",as:"h2"},c({id:"Settings.permissions.conditions.define-conditions",defaultMessage:"Define conditions"})),e.createElement(M.Box,null,e.createElement(Re.Divider,null)),e.createElement(M.Box,null,S.length===0&&e.createElement(D.Typography,null,c({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,S.map(({actionId:O,label:B,pathToConditionsObject:J},ce)=>{const De=J.join("..");return e.createElement(Q,{key:O,arrayOfOptionsGroupedByCategory:P,label:B,isFormDisabled:o,isGrey:ce%2===0,name:De,onChange:j,value:ge()(k,De,{})})}))))),e.createElement(de.ModalFooter,{startActions:e.createElement(We.Button,{variant:"tertiary",onClick:i},c({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(We.Button,{onClick:N},c({id:"Settings.permissions.conditions.apply",defaultMessage:"Apply"}))}))};wt.propTypes={actions:r().arrayOf(r().shape({actionId:r().string.isRequired,checkboxName:r().string,hasSomeActionsSelected:r().bool.isRequired,hasAllActionsSelected:r().bool,isDisplayed:r().bool.isRequired,label:r().string})).isRequired,headerBreadCrumbs:r().arrayOf(r().string).isRequired,isFormDisabled:r().bool.isRequired,onClosed:r().func.isRequired,onToggle:r().func.isRequired};const Et=wt,ut=T.default.div`
|
|
25
|
-
width: ${ue};
|
|
26
|
-
`,ot=(0,T.default)(Y.Flex)`
|
|
27
|
-
padding-right: ${({theme:a})=>a.spaces[2]};
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
flex: 1;
|
|
30
|
-
${({isCollapsable:a})=>a&&"cursor: pointer;"}
|
|
31
|
-
`;var jt=Object.defineProperty,Nt=Object.getOwnPropertySymbols,Tt=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable,an=(a,t,o)=>t in a?jt(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,sn=(a,t)=>{for(var o in t||(t={}))Tt.call(t,o)&&an(a,o,t[o]);if(Nt)for(var o of Nt(t))kn.call(t,o)&&an(a,o,t[o]);return a};const pt=({children:a,isCollapsable:t,isActive:o,isFormDisabled:s,label:i,onChange:c,onClick:m,checkboxName:g,someChecked:E,value:P})=>{const{formatMessage:S}=(0,H.useIntl)();return e.createElement(Y.Flex,{alignItems:"center",paddingLeft:6,style:{width:Le,flexShrink:0}},e.createElement(M.Box,{paddingRight:2},e.createElement(Se.BaseCheckbox,{name:g,"aria-label":S({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:i}),disabled:s,onValueChange:F=>c({target:{name:g,value:F}}),indeterminate:E,value:P})),e.createElement(ot,sn({title:i,alignItems:"center",isCollapsable:t},t&&{onClick:m,"aria-expanded":o,onKeyDown:({key:F})=>(F==="Enter"||F===" ")&&m(),tabIndex:0,role:"button"}),e.createElement(D.Typography,{fontWeight:o?"bold":"",textColor:o?"primary600":"neutral800",ellipsis:!0},U()(i)),a))};pt.defaultProps={children:null,checkboxName:"",onChange:()=>{},value:!1,someChecked:!1,isCollapsable:!1},pt.propTypes={checkboxName:r().string,children:r().node,label:r().string.isRequired,isCollapsable:r().bool,isFormDisabled:r().bool.isRequired,onChange:r().func,onClick:r().func.isRequired,someChecked:r().bool,value:r().bool,isActive:r().bool.isRequired};const Wt=(0,e.memo)(pt),bt=a=>(0,h.isObject)(a)?(0,h.flattenDeep)(Object.values(a).map(t=>(0,h.isObject)(t)?bt(t):t)):[],mt=bt,At=a=>a?Object.keys(a).reduce((t,o)=>(o!=="conditions"&&(t[o]=a[o]),t),{}):null,ct=a=>{const t=At(a),o=mt(t);if(!o.length)return{hasAllActionsSelected:!1,hasSomeActionsSelected:!1};const s=o.every(c=>c),i=o.some(c=>c)&&!s;return{hasAllActionsSelected:s,hasSomeActionsSelected:i}},Ot=(a,t,o)=>a.map(({actionId:s,isDisplayed:i,applyToProperties:c,label:m})=>{if(!i)return{actionId:s,hasSomeActionsSelected:!1,isDisplayed:i};const g=[...o.split(".."),s],E=(0,h.isEmpty)(c)?[...g,"properties","enabled"]:g,P=E.join(".."),S=(0,h.get)(t,[...g,"conditions"],null),F=mt(S).some(N=>N);if((0,h.isEmpty)(c)){const N=(0,h.get)(t,E,!1);return{actionId:s,checkboxName:P,hasAllActionsSelected:N,hasConditions:F,hasSomeActionsSelected:N,isDisplayed:i,isParentCheckbox:!1,label:m,pathToConditionsObject:g}}const k=(0,h.get)(t,E,null),{hasAllActionsSelected:se,hasSomeActionsSelected:j}=ct(k);return{actionId:s,checkboxName:P,hasAllActionsSelected:se,hasConditions:F,hasSomeActionsSelected:j,isDisplayed:i,isParentCheckbox:!0,label:m,pathToConditionsObject:g}});var rn=n(60672),$t=n.n(rn);const gt=(0,T.default)($t())`
|
|
32
|
-
display: none;
|
|
33
|
-
width: ${10/16}rem;
|
|
34
|
-
transform: rotate(${({$isActive:a})=>a?"180":"0"}deg);
|
|
35
|
-
margin-left: ${({theme:a})=>a.spaces[2]};
|
|
36
|
-
`,ft=a=>`
|
|
37
|
-
${D.Typography} {
|
|
38
|
-
color: ${a.colors.primary600};
|
|
39
|
-
font-weight: ${a.fontWeights.bold}
|
|
40
|
-
}
|
|
41
|
-
${gt} {
|
|
42
|
-
display: block;
|
|
43
|
-
path {
|
|
44
|
-
fill: ${a.colors.primary600}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
`;var Ut=function(){return window&&window.strapi&&window.strapi.isEE?n(68464).Z:n(35123).Z}(),Rt=function a(t,o){return`
|
|
48
|
-
`.concat(kt,` {
|
|
49
|
-
background-color: `).concat(t.colors.primary100,`;
|
|
50
|
-
color: `).concat(t.colors.primary600,`;
|
|
51
|
-
border-radius: `).concat(o?"2px 2px 0 0":"2px",`;
|
|
52
|
-
}
|
|
53
|
-
`).concat(Vt,` {
|
|
54
|
-
display: flex;
|
|
55
|
-
}
|
|
56
|
-
`).concat($e,` {
|
|
57
|
-
display: block;
|
|
58
|
-
}
|
|
59
|
-
&:hover {
|
|
60
|
-
`).concat(ft(t),`
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&:focus-within {
|
|
64
|
-
`).concat(function(s){var i=s.theme,c=s.isActive;return a(i,c)},`
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
`)},kt=T.default.div.withConfig({displayName:"Collapse__Wrapper",componentId:"sc-132fji1-0"})(["flex:1;display:flex;align-items:center;height:",";background-color:",";border:1px solid transparent;"],Ge,function(a){var t=a.isGrey,o=a.theme;return t?o.colors.neutral100:o.colors.neutral0}),ln=T.default.div.withConfig({displayName:"Collapse__BoxWrapper",componentId:"sc-132fji1-1"})(["display:inline-flex;min-width:100%;","{display:none;}"," &:hover{","}"],$e,function(a){var t=a.isActive,o=a.theme;return t&&Rt(o,t)},function(a){var t=a.theme,o=a.isActive;return Rt(t,o)}),Dt=(0,T.default)(Y.Flex).withConfig({displayName:"Collapse__Cell",componentId:"sc-132fji1-2"})(["width:",";position:relative;"],ue),Vt=(0,T.default)(M.Box).withConfig({displayName:"Collapse__Chevron",componentId:"sc-132fji1-3"})(["display:none;svg{width:11px;}*{fill:",";}"],function(a){var t=a.theme;return t.colors.primary600}),Zt=T.default.span.withConfig({displayName:"Collapse__TinyDot",componentId:"sc-132fji1-4"})(["position:absolute;top:-6px;left:37px;width:6px;height:6px;border-radius:20px;background:",";"],function(a){var t=a.theme;return t.colors.primary600}),Hn=(0,T.default)(M.Box).withConfig({displayName:"Collapse__AbsoluteBox",componentId:"sc-132fji1-5"})(["position:absolute;right:9px;transform:translateY(10px);"]),xt=function(t){var o=t.availableActions,s=t.isActive,i=t.isGrey,c=t.isFormDisabled,m=t.label,g=t.onClickToggle,E=t.pathToData,P=(0,e.useState)(!1),S=(0,V.Z)(P,2),F=S[0],k=S[1],se=(0,H.useIntl)(),j=se.formatMessage,N=(0,le.$_)(),O=N.modifiedData,B=N.onChangeParentCheckbox,J=N.onChangeSimpleCheckbox,ce=function(){k(function(Oe){return!Oe})},De=function(){k(!1)},Ee=ge()(O,E.split(".."),{}),xe=(0,e.useMemo)(function(){return Object.keys(Ee).reduce(function(pe,Oe){return pe[Oe]=Ne()(Ee[Oe],"conditions"),pe},{})},[Ee]),Be=ct(xe),Ie=Be.hasAllActionsSelected,vt=Be.hasSomeActionsSelected,be=(0,e.useMemo)(function(){return Ot(o,O,E)},[o,O,E]),we=be.some(function(pe){var Oe=pe.hasConditions;return Oe});return e.createElement(ln,{isActive:s},e.createElement(kt,{isGrey:i},e.createElement(Wt,{isCollapsable:!0,isFormDisabled:c,label:m,checkboxName:E,onChange:B,onClick:g,someChecked:vt,value:Ie,isActive:s},e.createElement(Vt,{paddingLeft:2},s?e.createElement(ke(),null):e.createElement(Qe(),null))),e.createElement(Y.Flex,{style:{flex:1}},be.map(function(pe){var Oe=pe.actionId,Me=pe.hasConditions,je=pe.hasAllActionsSelected,Ue=pe.hasSomeActionsSelected,dt=pe.isDisplayed,Ke=pe.isParentCheckbox,lt=pe.checkboxName,Pt=pe.label;return dt?Ke?e.createElement(Dt,{key:Oe,justifyContent:"center",alignItems:"center"},Me&&e.createElement(Zt,null),e.createElement(Se.BaseCheckbox,{disabled:c||Ut,name:lt,"aria-label":j({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(Pt," ").concat(m)}),onValueChange:function(Ct){B({target:{name:lt,value:Ct}})},indeterminate:Ue,value:je})):e.createElement(Dt,{key:Oe,justifyContent:"center",alignItems:"center"},Me&&e.createElement(Zt,null),e.createElement(Se.BaseCheckbox,{disabled:c||Ut,indeterminate:Me,name:lt,onValueChange:function(Ct){J({target:{name:lt,value:Ct}})},value:je})):e.createElement(ut,{key:Oe})})),F&&e.createElement(Et,{headerBreadCrumbs:[m,"app.components.LeftMenuLinkContainer.settings"],actions:be,isFormDisabled:c,onClosed:De,onToggle:ce})),e.createElement(Hn,null,e.createElement($e,{onClick:ce,hasConditions:we})))};xt.propTypes={availableActions:r().array.isRequired,isActive:r().bool.isRequired,isGrey:r().bool.isRequired,isFormDisabled:r().bool.isRequired,label:r().string.isRequired,onClickToggle:r().func.isRequired,pathToData:r().string.isRequired};const Gt=xt,cn=(a,t)=>a.map(o=>{const s=Array.isArray(o.applyToProperties)&&o.applyToProperties.indexOf(t)!==-1&&o.isDisplayed;return{label:o.label,actionId:o.actionId,isActionRelatedToCurrentProperty:s}}),dn=(0,T.default)(Y.Flex)`
|
|
68
|
-
width: ${ue};
|
|
69
|
-
flex-shrink: 0;
|
|
70
|
-
`,un=(0,T.default)(Y.Flex)`
|
|
71
|
-
width: ${Le};
|
|
72
|
-
height: ${Ge};
|
|
73
|
-
flex-shrink: 0;
|
|
74
|
-
`,zt=({headers:a,label:t})=>{const{formatMessage:o}=(0,H.useIntl)(),s=o({id:"Settings.roles.form.permission.property-label",defaultMessage:"{label} permissions"},{label:t});return e.createElement(Y.Flex,null,e.createElement(un,{alignItems:"center",paddingLeft:6},e.createElement(D.Typography,{variant:"sigma",textColor:"neutral500"},s)),a.map(i=>i.isActionRelatedToCurrentProperty?e.createElement(dn,{justifyContent:"center",key:i.label},e.createElement(D.Typography,{variant:"sigma",textColor:"neutral500"},o({id:`Settings.roles.form.permissions.${i.label.toLowerCase()}`,defaultMessage:i.label}))):e.createElement(dn,{key:i.label})))};zt.propTypes={headers:r().arrayOf(r().shape({label:r().string.isRequired,isActionRelatedToCurrentProperty:r().bool.isRequired})).isRequired,label:r().string.isRequired};const pn=zt,Yn=T.default.span`
|
|
75
|
-
color: ${({theme:a})=>a.colors.danger700};
|
|
76
|
-
padding-left: ${({theme:a})=>a.spaces[1]}px;
|
|
77
|
-
`,Kt=()=>e.createElement(Yn,null,"*");var mn=Object.defineProperty,Jn=Object.defineProperties,gn=Object.getOwnPropertyDescriptors,fn=Object.getOwnPropertySymbols,hn=Object.prototype.hasOwnProperty,Ht=Object.prototype.propertyIsEnumerable,tt=(a,t,o)=>t in a?mn(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,yn=(a,t)=>{for(var o in t||(t={}))hn.call(t,o)&&tt(a,o,t[o]);if(fn)for(var o of fn(t))Ht.call(t,o)&&tt(a,o,t[o]);return a},Ce=(a,t)=>Jn(a,gn(t));const Cn=(a,t)=>a.map(o=>{const s=Array.isArray(o.subjects)&&o.subjects.indexOf(t)!==-1;return Ce(yn({},o),{isDisplayed:s})});var En=n(41925),bn=Object.defineProperty,Xt=Object.getOwnPropertySymbols,Pn=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable,Yt=(a,t,o)=>t in a?bn(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,Sn=(a,t)=>{for(var o in t||(t={}))Pn.call(t,o)&&Yt(a,o,t[o]);if(Xt)for(var o of Xt(t))ht.call(t,o)&&Yt(a,o,t[o]);return a};const Tn=(0,T.default)(M.Box)`
|
|
78
|
-
transform: translate(-4px, -12px);
|
|
79
|
-
|
|
80
|
-
&:before {
|
|
81
|
-
content: '';
|
|
82
|
-
width: ${4/16}rem;
|
|
83
|
-
height: ${12/16}rem;
|
|
84
|
-
background: ${({theme:a})=>a.colors.primary200};
|
|
85
|
-
display: block;
|
|
86
|
-
}
|
|
87
|
-
`,Qt=T.default.svg`
|
|
88
|
-
position: relative;
|
|
89
|
-
flex-shrink: 0;
|
|
90
|
-
transform: translate(-0.5px, -1px);
|
|
91
|
-
|
|
92
|
-
* {
|
|
93
|
-
fill: ${({theme:a,color:t})=>a.colors[t]};
|
|
94
|
-
}
|
|
95
|
-
`,Mt=a=>e.createElement(Tn,null,e.createElement(Qt,Sn({width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.02477 14.7513C8.65865 17.0594 11.6046 18.6059 17.5596 18.8856C18.6836 18.9384 19.5976 19.8435 19.5976 20.9688V20.9688C19.5976 22.0941 18.6841 23.0125 17.5599 22.9643C10.9409 22.6805 6.454 20.9387 3.75496 17.1258C0.937988 13.1464 0.486328 7.39309 0.486328 0.593262H4.50974C4.50974 7.54693 5.06394 11.9813 7.02477 14.7513Z",fill:"#D9D8FF"})));Mt.defaultProps={fill:"primary200"},Mt.propTypes={fill:r().string};const An=(0,e.memo)(Mt);var Lt=function(){return window&&window.strapi&&window.strapi.isEE?n(19665).Z:n(52124).Z}(),It=(0,T.default)(Y.Flex).withConfig({displayName:"SubActionRow__Cell",componentId:"sc-7y8yzq-0"})(["width:",";position:relative;"],ue),Jt=(0,T.default)(Y.Flex).withConfig({displayName:"SubActionRow__RowWrapper",componentId:"sc-7y8yzq-1"})(["height:",";"],Ge),qt=(0,T.default)(M.Box).withConfig({displayName:"SubActionRow__Wrapper",componentId:"sc-7y8yzq-2"})(["padding-left:","rem;"],31/16),On=(0,T.default)(M.Box).withConfig({displayName:"SubActionRow__LeftBorderTimeline",componentId:"sc-7y8yzq-3"})(["border-left:",";"],function(a){var t=a.isVisible,o=a.theme;return t?"4px solid ".concat(o.colors.primary200):"4px solid transparent"}),_t=(0,T.default)(Y.Flex).withConfig({displayName:"SubActionRow__RowStyle",componentId:"sc-7y8yzq-4"})(["padding-left:",";width:","px;"," ",";"],function(a){var t=a.theme;return t.spaces[4]},function(a){var t=a.level;return 145-t*36},function(a){var t=a.isCollapsable,o=a.theme;return t&&`
|
|
96
|
-
`.concat(gt,` {
|
|
97
|
-
display: block;
|
|
98
|
-
color: `).concat(o.colors.neutral100,`;
|
|
99
|
-
}
|
|
100
|
-
&:hover {
|
|
101
|
-
`).concat(ft(o),`
|
|
102
|
-
}
|
|
103
|
-
`)},function(a){var t=a.isActive,o=a.theme;return t&&ft(o)}),Rn=T.default.div.withConfig({displayName:"SubActionRow__TopTimeline",componentId:"sc-7y8yzq-5"})(["padding-top:",";margin-top:",";width:","rem;background-color:",";border-top-left-radius:2px;border-top-right-radius:2px;"],function(a){var t=a.theme;return t.spaces[2]},function(a){var t=a.theme;return t.spaces[2]},4/16,function(a){var t=a.theme;return t.colors.primary200}),u=function a(t){var o=t.childrenForm,s=t.isFormDisabled,i=t.recursiveLevel,c=t.pathToDataFromActionRow,m=t.propertyActions,g=t.parentName,E=t.propertyName,P=(0,H.useIntl)(),S=P.formatMessage,F=(0,le.$_)(),k=F.modifiedData,se=F.onChangeParentCheckbox,j=F.onChangeSimpleCheckbox,N=(0,e.useState)(null),O=(0,V.Z)(N,2),B=O[0],J=O[1],ce=function(xe){J(function(Be){return Be===xe?null:xe})},De=(0,e.useMemo)(function(){return B?o.find(function(Ee){var xe=Ee.value;return xe===B}):null},[B,o]);return e.createElement(qt,null,e.createElement(Rn,null),o.map(function(Ee,xe){var Be=Ee.label,Ie=Ee.value,vt=Ee.required,be=Ee.children,we=xe+1<o.length,pe=Array.isArray(be),Oe=B===Ie;return e.createElement(On,{key:Ie,isVisible:we},e.createElement(Jt,null,e.createElement(An,{color:"primary200"}),e.createElement(Y.Flex,{style:{flex:1}},e.createElement(_t,{level:i,isActive:Oe,isCollapsable:pe},e.createElement(ot,(0,En.Z)({alignItems:"center",isCollapsable:pe},pe&&{onClick:function(){return ce(Ie)},"aria-expanded":Oe,onKeyDown:function(je){var Ue=je.key;return(Ue==="Enter"||Ue===" ")&&ce(Ie)},tabIndex:0,role:"button"},{title:Be}),e.createElement(D.Typography,{ellipsis:!0},U()(Be)),vt&&e.createElement(Kt,null),e.createElement(gt,{$isActive:Oe}))),e.createElement(Y.Flex,{style:{flex:1}},m.map(function(Me){var je=Me.actionId,Ue=Me.label,dt=Me.isActionRelatedToCurrentProperty;if(!dt)return e.createElement(ut,{key:je});var Ke=[].concat((0,ie.Z)(c.split("..")),[je,"properties",E],(0,ie.Z)(g.split("..")),[Ie]),lt=ge()(k,Ke,!1);if(!be)return e.createElement(It,{key:Ue,justifyContent:"center",alignItems:"center"},e.createElement(Se.BaseCheckbox,{disabled:s||Lt,name:Ke.join(".."),"aria-label":S({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(g," ").concat(Be," ").concat(Ue)}),onValueChange:function(Ft){j({target:{name:Ke.join(".."),value:Ft}})},value:lt}));var Pt=ct(lt),St=Pt.hasAllActionsSelected,Ct=Pt.hasSomeActionsSelected;return e.createElement(It,{key:Ue,justifyContent:"center",alignItems:"center"},e.createElement(Se.BaseCheckbox,{key:Ue,disabled:s||Lt,name:Ke.join(".."),"aria-label":S({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(g," ").concat(Be," ").concat(Ue)}),onValueChange:function(Ft){se({target:{name:Ke.join(".."),value:Ft}})},value:St,indeterminate:Ct}))})))),De&&Oe&&e.createElement(M.Box,{paddingBottom:2},e.createElement(a,{isFormDisabled:s,parentName:"".concat(g,"..").concat(Ie),pathToDataFromActionRow:c,propertyActions:m,propertyName:E,recursiveLevel:i+1,childrenForm:De.children})))}))};u.propTypes={childrenForm:r().array.isRequired,isFormDisabled:r().bool.isRequired,parentName:r().string.isRequired,pathToDataFromActionRow:r().string.isRequired,propertyActions:r().array.isRequired,propertyName:r().string.isRequired,recursiveLevel:r().number.isRequired};const l=(0,e.memo)(u),d=a=>a.reduce((o,s)=>(s.isActionRelatedToCurrentProperty&&o.push(s.actionId),o),[]),b=(a,t,o,s,i)=>{const m=d(a).reduce((g,E)=>{const P=[...o.split(".."),E,"properties",s,i],S=(0,h.get)(t,P,!1);return g[E]=S,g},{});return ct(m)};var p=function(){return window&&window.strapi&&window.strapi.isEE?n(32741).Z:n(18318).Z}(),I=(0,T.default)(Y.Flex).withConfig({displayName:"ActionRow__Cell",componentId:"sc-4agenc-0"})(["width:",";position:relative;"],ue),R=(0,T.default)(Y.Flex).withConfig({displayName:"ActionRow__Wrapper",componentId:"sc-4agenc-1"})(["height:",";flex:1;"," ",";"],Ge,function(a){var t=a.isCollapsable,o=a.theme;return t&&`
|
|
104
|
-
`.concat(gt,` {
|
|
105
|
-
display: block;
|
|
106
|
-
color: `).concat(o.colors.neutral100,`;
|
|
107
|
-
}
|
|
108
|
-
&:hover {
|
|
109
|
-
`).concat(ft(o),`
|
|
110
|
-
}
|
|
111
|
-
`)},function(a){var t=a.isActive,o=a.theme;return t&&ft(o)}),C=function(t){var o=t.childrenForm,s=t.label,i=t.isFormDisabled,c=t.name,m=t.required,g=t.pathToData,E=t.propertyActions,P=t.propertyName,S=t.isOdd,F=(0,H.useIntl)(),k=F.formatMessage,se=(0,e.useState)(null),j=(0,V.Z)(se,2),N=j[0],O=j[1],B=(0,le.$_)(),J=B.modifiedData,ce=B.onChangeCollectionTypeLeftActionRowCheckbox,De=B.onChangeParentCheckbox,Ee=B.onChangeSimpleCheckbox,xe=N===c,Be=(0,e.useMemo)(function(){return Array.isArray(o)?o:[]},[o]),Ie=Be.length>0,vt=(0,e.useCallback)(function(){Ie&&O(function(Me){return Me===c?null:c})},[Ie,c]),be=function(je){var Ue=je.target.value;ce(g,P,c,Ue)},we=(0,e.useMemo)(function(){return b(E,J,g,P,c)},[E,J,g,P,c]),pe=we.hasAllActionsSelected,Oe=we.hasSomeActionsSelected;return e.createElement(e.Fragment,null,e.createElement(R,{alignItems:"center",isCollapsable:Ie,isActive:xe,background:S?"neutral100":"neutral0"},e.createElement(Y.Flex,null,e.createElement(Wt,{onChange:be,onClick:vt,isCollapsable:Ie,isFormDisabled:i,label:s,someChecked:Oe,value:pe,isActive:xe},m&&e.createElement(Kt,null),e.createElement(gt,{$isActive:xe})),e.createElement(Y.Flex,null,E.map(function(Me){var je=Me.label,Ue=Me.isActionRelatedToCurrentProperty,dt=Me.actionId;if(!Ue)return e.createElement(ut,{key:je});var Ke=[].concat((0,ie.Z)(g.split("..")),[dt,"properties",P,c]);if(!Ie){var lt=ge()(J,Ke,!1);return e.createElement(I,{key:dt,justifyContent:"center",alignItems:"center"},e.createElement(Se.BaseCheckbox,{disabled:i||p,name:Ke.join(".."),"aria-label":k({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(c," ").concat(je)}),onValueChange:function(Wn){Ee({target:{name:Ke.join(".."),value:Wn}})},value:lt}))}var Pt=ge()(J,Ke,{}),St=ct(Pt),Ct=St.hasAllActionsSelected,Nn=St.hasSomeActionsSelected;return e.createElement(I,{key:je,justifyContent:"center",alignItems:"center"},e.createElement(Se.BaseCheckbox,{disabled:i||p,name:Ke.join(".."),onValueChange:function(Wn){De({target:{name:Ke.join(".."),value:Wn}})},"aria-label":k({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(c," ").concat(je)}),value:Ct,indeterminate:Nn}))})))),xe&&e.createElement(l,{childrenForm:Be,isFormDisabled:i,parentName:c,pathToDataFromActionRow:g,propertyName:P,propertyActions:E,recursiveLevel:0}))};C.defaultProps={childrenForm:[],required:!1},C.propTypes={childrenForm:r().array,label:r().string.isRequired,isFormDisabled:r().bool.isRequired,name:r().string.isRequired,pathToData:r().string.isRequired,propertyActions:r().array.isRequired,propertyName:r().string.isRequired,required:r().bool,isOdd:r().bool.isRequired};const x=(0,e.memo)(C),Ae=T.default.div`
|
|
112
|
-
display: inline-flex;
|
|
113
|
-
flex-direction: column;
|
|
114
|
-
min-width: 0;
|
|
115
|
-
`,he=({availableActions:a,childrenForm:t,isFormDisabled:o,label:s,pathToData:i,propertyName:c})=>{const m=(0,e.useMemo)(()=>cn(a,c),[a,c]);return e.createElement(Ae,null,e.createElement(pn,{label:s,headers:m}),e.createElement(M.Box,null,t.map(({children:g,label:E,value:P,required:S},F)=>e.createElement(x,{childrenForm:g,key:P,label:E,isFormDisabled:o,name:P,required:S,propertyActions:m,pathToData:i,propertyName:c,isOdd:F%2===0}))))};he.propTypes={childrenForm:r().array.isRequired,availableActions:r().array.isRequired,isFormDisabled:r().bool.isRequired,label:r().string.isRequired,pathToData:r().string.isRequired,propertyName:r().string.isRequired};const nt=he,yt=T.default.div`
|
|
116
|
-
flex-direction: column;
|
|
117
|
-
display: inline-flex;
|
|
118
|
-
min-width: 100%;
|
|
119
|
-
${({theme:a,isActive:t})=>t&&`border: 1px solid ${a.colors.primary600};`}
|
|
120
|
-
`,at=({allActions:a,contentTypeName:t,label:o,index:s,isActive:i,isFormDisabled:c,onClickToggleCollapse:m,pathToData:g,properties:E})=>{const P=(0,e.useCallback)(()=>{m(t)},[t,m]),S=(0,e.useMemo)(()=>Cn(a,t),[a,t]);return e.createElement(yt,{isActive:i},e.createElement(Gt,{availableActions:S,isActive:i,isGrey:s%2===0,isFormDisabled:c,label:o,onClickToggle:P,pathToData:g}),i&&E.map(({label:F,value:k,children:se})=>e.createElement(nt,{availableActions:S,childrenForm:se,isFormDisabled:c,label:F,pathToData:g,propertyName:k,key:k})))};at.propTypes={allActions:r().array.isRequired,contentTypeName:r().string.isRequired,index:r().number.isRequired,isActive:r().bool.isRequired,isFormDisabled:r().bool.isRequired,label:r().string.isRequired,onClickToggleCollapse:r().func.isRequired,pathToData:r().string.isRequired,properties:r().array.isRequired};const st=at,rt=({actions:a,isFormDisabled:t,pathToData:o,subjects:s})=>{const[i,c]=(0,e.useState)(null),m=g=>{c(i===g?null:g)};return s.map(({uid:g,label:E,properties:P},S)=>e.createElement(st,{allActions:a,key:g,contentTypeName:g,label:E,isActive:i===g,isFormDisabled:t,index:S,onClickToggleCollapse:m,pathToData:`${o}..${g}`,properties:P}))};rt.defaultProps={actions:[],subjects:[]},rt.propTypes={actions:r().array.isRequired,isFormDisabled:r().bool.isRequired,pathToData:r().string.isRequired,subjects:r().arrayOf(r().shape({uid:r().string.isRequired,label:r().string.isRequired,properties:r().array.isRequired}))};const No=(0,e.memo)(rt),Wo=a=>a.filter(({subjects:t})=>t&&t.length);var $o=Object.defineProperty,qn=Object.getOwnPropertySymbols,Uo=Object.prototype.hasOwnProperty,ko=Object.prototype.propertyIsEnumerable,_n=(a,t,o)=>t in a?$o(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,eo=(a,t)=>{for(var o in t||(t={}))Uo.call(t,o)&&_n(a,o,t[o]);if(qn)for(var o of qn(t))ko.call(t,o)&&_n(a,o,t[o]);return a};const Vo=a=>a.map(({actionId:t})=>t),Zo=(a,t)=>a.reduce((o,s)=>(Object.keys(t).forEach(i=>{const c=(0,h.get)(t,[i,s],{}),m={[i]:At(c)};o[s]?o[s]=eo(eo({},o[s]),m):o[s]=m}),o),{}),Go=(a,t)=>{const o=Vo(a),s=Zo(o,t);return Object.keys(s).reduce((c,m)=>(c[m]=ct(s[m]),c),{})};var zo=function(){return window&&window.strapi&&window.strapi.isEE?n(36950).Z:n(61526).Z}(),Ko=(0,T.default)(Ze.Stack).withConfig({displayName:"GlobalActions__CenteredStack",componentId:"sc-1vxwsjr-0"})(["align-items:center;justify-content:center;width:",";flex-shrink:0;"],ue),Dn=function(t){var o=t.actions,s=t.isFormDisabled,i=t.kind,c=(0,H.useIntl)(),m=c.formatMessage,g=(0,le.$_)(),E=g.modifiedData,P=g.onChangeCollectionTypeGlobalActionCheckbox,S=(0,e.useMemo)(function(){return Wo(o)},[o]),F=(0,e.useMemo)(function(){return Go(S,E[i])},[E,S,i]);return e.createElement(M.Box,{paddingBottom:4,paddingTop:6,style:{paddingLeft:Le}},e.createElement(Ze.Stack,{horizontal:!0,spacing:0},S.map(function(k){var se=k.label,j=k.actionId;return e.createElement(Ko,{key:j,spacing:3},e.createElement(D.Typography,{variant:"sigma",textColor:"neutral500"},m({id:"Settings.roles.form.permissions.".concat(se.toLowerCase()),defaultMessage:se})),e.createElement(Se.BaseCheckbox,{disabled:s||zo,onValueChange:function(O){P(i,j,O)},name:j,"aria-label":m({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:m({id:"Settings.roles.form.permissions.".concat(se.toLowerCase()),defaultMessage:se})}),value:ge()(F,[j,"hasAllActionsSelected"],!1),indeterminate:ge()(F,[j,"hasSomeActionsSelected"],!1)}))})))};Dn.defaultProps={actions:[]},Dn.propTypes={actions:r().arrayOf(r().shape({label:r().string.isRequired,actionId:r().string.isRequired,subjects:r().array.isRequired})),isFormDisabled:r().bool.isRequired,kind:r().string.isRequired};const Ho=(0,e.memo)(Dn),Xo=(0,T.default)(M.Box)`
|
|
121
|
-
overflow-x: auto;
|
|
122
|
-
`,to=({isFormDisabled:a,kind:t,layout:{actions:o,subjects:s}})=>{const i=me()([...s],"label");return e.createElement(Xo,{background:"neutral0"},e.createElement(Ho,{actions:o,kind:t,isFormDisabled:a}),e.createElement(No,{actions:o,isFormDisabled:a,pathToData:t,subjects:i}))};to.propTypes={isFormDisabled:r().bool.isRequired,kind:r().string.isRequired,layout:r().shape({actions:r().array,subjects:r().arrayOf(r().shape({uid:r().string.isRequired,label:r().string.isRequired,properties:r().array.isRequired}))}).isRequired};const no=(0,e.memo)(to);var Yo=n(66694);const oo=({children:a,value:t})=>e.createElement(Yo.$l.Provider,{value:t},a);oo.propTypes={children:r().node.isRequired,value:r().exact({availableConditions:r().array.isRequired,modifiedData:r().object.isRequired,onChangeCollectionTypeLeftActionRowCheckbox:r().func.isRequired,onChangeConditions:r().func.isRequired,onChangeSimpleCheckbox:r().func.isRequired,onChangeParentCheckbox:r().func.isRequired,onChangeCollectionTypeGlobalActionCheckbox:r().func.isRequired}).isRequired};const Qo=oo;var xn=n(12001),ao=n(78330),so=n(52111),Jo=Object.defineProperty,qo=Object.defineProperties,_o=Object.getOwnPropertyDescriptors,ro=Object.getOwnPropertySymbols,ea=Object.prototype.hasOwnProperty,ta=Object.prototype.propertyIsEnumerable,io=(a,t,o)=>t in a?Jo(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,na=(a,t)=>{for(var o in t||(t={}))ea.call(t,o)&&io(a,o,t[o]);if(ro)for(var o of ro(t))ta.call(t,o)&&io(a,o,t[o]);return a},oa=(a,t)=>qo(a,_o(t));const aa=(a,t,o)=>a.map(s=>{const i=[...o,s.action,"properties","enabled"],c=(0,h.get)(t,i,!1),m=(0,h.get)(t,[...o,s.action,"conditions"],{}),g=mt(m).some(E=>E);return oa(na({},s),{isDisplayed:c,checkboxName:i.join(".."),hasSomeActionsSelected:c,value:c,hasConditions:g,label:s.displayName,actionId:s.action,pathToConditionsObject:[...o,s.action]})}),sa=a=>{const t=Object.entries(a).reduce((s,i)=>{const[c,{conditions:m}]=i;return s[c]=m,s},{});return mt(t).some(s=>s)};var Mn=function(){return window&&window.strapi&&window.strapi.isEE?n(96556).Z:n(16437).Z}(),ra=T.default.div.withConfig({displayName:"SubCategory__Border",componentId:"sc-akgczm-0"})(["flex:1;align-self:center;border-top:1px solid ",";"],function(a){var t=a.theme;return t.colors.neutral150}),ia=T.default.div.withConfig({displayName:"SubCategory__CheckboxWrapper",componentId:"sc-akgczm-1"})(["position:relative;word-break:keep-all;",""],function(a){var t=a.hasConditions,o=a.disabled,s=a.theme;return t&&`
|
|
123
|
-
&:before {
|
|
124
|
-
content: '';
|
|
125
|
-
position: absolute;
|
|
126
|
-
top: `.concat(-4/16,`rem;
|
|
127
|
-
left: `).concat(-8/16,`rem;
|
|
128
|
-
width: `).concat(6/16,`rem;
|
|
129
|
-
height: `).concat(6/16,`rem;
|
|
130
|
-
border-radius: `).concat(20/16,`rem;
|
|
131
|
-
background: `).concat(o?s.colors.neutral100:s.colors.primary600,`;
|
|
132
|
-
}
|
|
133
|
-
`)}),lo=function(t){var o=t.categoryName,s=t.isFormDisabled,i=t.subCategoryName,c=t.actions,m=t.pathToData,g=(0,e.useState)(!1),E=(0,V.Z)(g,2),P=E[0],S=E[1],F=(0,le.$_)(),k=F.modifiedData,se=F.onChangeParentCheckbox,j=F.onChangeSimpleCheckbox,N=(0,H.useIntl)(),O=N.formatMessage,B=ge()(k,m,{}),J=(0,e.useMemo)(function(){return Object.keys(B).reduce(function(be,we){return be[we]=At(B[we]),be},{})},[B]),ce=ct(J),De=ce.hasAllActionsSelected,Ee=ce.hasSomeActionsSelected,xe=function(){S(function(we){return!we})},Be=function(){S(!1)},Ie=aa(c,k,m),vt=sa(ge()(k,(0,ie.Z)(m),{}));return e.createElement(e.Fragment,null,e.createElement(M.Box,null,e.createElement(Y.Flex,{justifyContent:"space-between",alignItems:"center"},e.createElement(M.Box,{paddingRight:4},e.createElement(D.Typography,{variant:"sigma",textColor:"neutral600"},i)),e.createElement(ra,null),e.createElement(M.Box,{paddingLeft:4},e.createElement(so.Checkbox,{name:m.join(".."),disabled:s||Mn,onValueChange:function(we){se({target:{name:m.join(".."),value:we}})},indeterminate:Ee,value:De},O({id:"app.utils.select-all",defaultMessage:"Select all"})))),e.createElement(Y.Flex,{paddingTop:6,paddingBottom:6},e.createElement(ao.Grid,{gap:2,style:{flex:1}},Ie.map(function(be){var we=be.checkboxName,pe=be.value,Oe=be.action,Me=be.displayName,je=be.hasConditions;return e.createElement(ao.GridItem,{col:3,key:Oe},e.createElement(ia,{disabled:s||Mn,hasConditions:je},e.createElement(so.Checkbox,{name:we,disabled:s||Mn,onValueChange:function(dt){j({target:{name:we,value:dt}})},value:pe},Me)))})),e.createElement($e,{hasConditions:vt,onClick:xe}))),P&&e.createElement(Et,{headerBreadCrumbs:[o,i],actions:Ie,isFormDisabled:s,onClosed:Be,onToggle:xe}))};lo.propTypes={actions:r().array.isRequired,categoryName:r().string.isRequired,isFormDisabled:r().bool.isRequired,subCategoryName:r().string.isRequired,pathToData:r().array.isRequired};const la=lo,Ln=({childrenForm:a,kind:t,name:o,isOpen:s,isFormDisabled:i,isWhite:c,onOpenCategory:m,pathToData:g})=>{const{formatMessage:E}=(0,H.useIntl)(),P=()=>{m(o)},S=(0,e.useMemo)(()=>o.split("::").pop(),[o]);return e.createElement(xn.Accordion,{expanded:s,onToggle:P,id:`accordion-${o}`,variant:c?"primary":"secondary"},e.createElement(xn.AccordionToggle,{title:U()(S),description:`${E({id:"Settings.permissions.category"},{category:S})} ${t==="plugins"?"plugin":t}`}),e.createElement(xn.AccordionContent,null,e.createElement(M.Box,{padding:6},a.map(({actions:F,subCategoryName:k,subCategoryId:se})=>e.createElement(la,{key:k,actions:F,categoryName:S,isFormDisabled:i,subCategoryName:k,pathToData:[...g,se]})))))};Ln.defaultProps={},Ln.propTypes={childrenForm:r().array.isRequired,isOpen:r().bool.isRequired,isFormDisabled:r().bool.isRequired,isWhite:r().bool.isRequired,kind:r().string.isRequired,name:r().string.isRequired,onOpenCategory:r().func.isRequired,pathToData:r().array.isRequired};const ca=Ln,co=({isFormDisabled:a,kind:t,layout:o})=>{const[s,i]=(0,e.useState)(null),c=m=>{i(m===s?null:m)};return e.createElement(M.Box,{padding:6,background:"neutral0"},o.map(({category:m,categoryId:g,childrenForm:E},P)=>e.createElement(ca,{key:m,childrenForm:E,kind:t,isFormDisabled:a,isOpen:s===m,isWhite:P%2===1,name:m,onOpenCategory:c,pathToData:[t,g]})))};co.propTypes={isFormDisabled:r().bool.isRequired,kind:r().string.isRequired,layout:r().arrayOf(r().shape({category:r().string.isRequired,categoryId:r().string.isRequired,childrenForm:r().arrayOf(r().shape({actions:r().array.isRequired})).isRequired}).isRequired).isRequired};const uo=co,po=(a,t,o)=>a.find(s=>s.action===t&&s.subject===o);var da=Object.defineProperty,ua=Object.defineProperties,pa=Object.getOwnPropertyDescriptors,mo=Object.getOwnPropertySymbols,ma=Object.prototype.hasOwnProperty,ga=Object.prototype.propertyIsEnumerable,go=(a,t,o)=>t in a?da(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,fo=(a,t)=>{for(var o in t||(t={}))ma.call(t,o)&&go(a,o,t[o]);if(mo)for(var o of mo(t))ga.call(t,o)&&go(a,o,t[o]);return a},ho=(a,t)=>ua(a,pa(t));const yo=(a,t=[])=>a.reduce((o,s)=>(o[s.id]=t.indexOf(s.id)!==-1,o),{}),vo=({children:a},t,o="")=>a.reduce((s,i)=>{if(i.children)return ho(fo({},s),{[i.value]:vo(i,t,`${o}${i.value}.`)});const c=t.indexOf(`${o}${i.value}`)!==-1;return s[i.value]=c,s},{}),fa=(a,t,o)=>a.reduce((s,i)=>{const c=t.properties.find(({value:m})=>m===i);if(c){const m=(0,h.get)(o,["properties",c.value],[]),g=vo(c,m);s.properties[i]=g}return s},{properties:{}}),ha=(a,t)=>t.reduce((o,s)=>{const i=a.find(({uid:c})=>c===s)||null;return i&&(o[s]=i),o},{}),Co=({subjects:a},t,o,s=[])=>t.reduce((i,c)=>{const m=c.subjects,g=ha(a,m);if((0,h.isEmpty)(g))return i;const E=Object.keys(g).reduce((P,S)=>{const{actionId:F,applyToProperties:k}=c,N=g[S].properties.map(({value:ce})=>ce).every(ce=>(k||[]).indexOf(ce)===-1),O=po(s,F,S),B=yo(o,(0,h.get)(O,"conditions",[]));if((0,h.isEmpty)(k)||N)return(0,h.set)(P,[S,F],{properties:{enabled:O!==void 0},conditions:B}),P;const J=fa(k,g[S],O);return(0,h.set)(P,[S,F],ho(fo({},J),{conditions:B})),P},{});return(0,h.merge)(i,E)},{}),ya=(a,t,o)=>a.reduce((s,i)=>{const c=po(o,i.action,null);return s[i.action]={properties:{enabled:c!==void 0},conditions:yo(t,(0,h.get)(c,"conditions",[]))},s},{}),va=(a,t,o)=>a.reduce((s,i)=>(s[i.subCategoryId]=ya(i.actions,t,o),s),{}),Eo=(a,t,o=[])=>a.reduce((s,{categoryId:i,childrenForm:c})=>{const m=va(c,t,o);return s[i]=m,s},{}),bo=a=>a.split(" ").join("-"),Po=(a,t)=>(0,h.chain)(a).groupBy(t).map((o,s)=>({category:s,categoryId:bo(s),childrenForm:(0,h.chain)(o).groupBy("subCategory").map((i,c)=>({subCategoryName:c,subCategoryId:bo(c),actions:i})).value()})).value(),Ca=(a,t)=>{const{conditions:o,sections:{collectionTypes:s,singleTypes:i,plugins:c,settings:m}}=a,g={collectionTypes:s,singleTypes:i,plugins:Po(c,"plugin"),settings:Po(m,"category")},E={collectionTypes:Co(s,s.actions||[],o,t),singleTypes:Co(i,i.actions||[],o,t),plugins:Eo(g.plugins,o,t),settings:Eo(g.settings,o,t)};return{initialData:E,modifiedData:E,layouts:g}};var Ea=Object.defineProperty,ba=Object.defineProperties,Pa=Object.getOwnPropertyDescriptors,So=Object.getOwnPropertySymbols,Sa=Object.prototype.hasOwnProperty,Ta=Object.prototype.propertyIsEnumerable,To=(a,t,o)=>t in a?Ea(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,In=(a,t)=>{for(var o in t||(t={}))Sa.call(t,o)&&To(a,o,t[o]);if(So)for(var o of So(t))Ta.call(t,o)&&To(a,o,t[o]);return a},Fn=(a,t)=>ba(a,Pa(t));const Ao=a=>Object.keys(a).reduce((t,o)=>{const s=a[o];if((0,h.isObject)(s)&&!(0,h.has)(s,"conditions"))return Fn(In({},t),{[o]:Ao(s)});if((0,h.isObject)(s)&&(0,h.has)(s,"conditions")&&!mt((0,h.omit)(s,"conditions")).some(c=>c)){const c=Object.keys(s.conditions).reduce((m,g)=>(m[g]=!1,m),{});return Fn(In({},t),{[o]:Fn(In({},s),{conditions:c})})}return t[o]=s,t},{}),Bn=Ao;var Aa=Object.defineProperty,Oa=Object.defineProperties,Ra=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Da=Object.prototype.hasOwnProperty,xa=Object.prototype.propertyIsEnumerable,Ro=(a,t,o)=>t in a?Aa(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,Ma=(a,t)=>{for(var o in t||(t={}))Da.call(t,o)&&Ro(a,o,t[o]);if(Oo)for(var o of Oo(t))xa.call(t,o)&&Ro(a,o,t[o]);return a},La=(a,t)=>Oa(a,Ra(t));const Do=(a,t)=>Object.keys(a).reduce((o,s)=>{const i=a[s];return s==="conditions"?(o[s]=i,o):(0,h.isObject)(i)?La(Ma({},o),{[s]:Do(i,t)}):(o[s]=t,o)},{}),en=Do;var Ia=Object.defineProperty,Fa=Object.defineProperties,Ba=Object.getOwnPropertyDescriptors,xo=Object.getOwnPropertySymbols,wa=Object.prototype.hasOwnProperty,ja=Object.prototype.propertyIsEnumerable,Mo=(a,t,o)=>t in a?Ia(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,Na=(a,t)=>{for(var o in t||(t={}))wa.call(t,o)&&Mo(a,o,t[o]);if(xo)for(var o of xo(t))ja.call(t,o)&&Mo(a,o,t[o]);return a},Wa=(a,t)=>Fa(a,Ba(t));const $a={initialData:{},modifiedData:{},layouts:{}},Ua=(a,t)=>(0,Z.default)(a,o=>{switch(t.type){case"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX":{const{collectionTypeKind:s,actionId:i,value:c}=t,m=["modifiedData",s];Object.keys((0,h.get)(a,m)).forEach(g=>{const E=(0,h.get)(a,[...m,g,i],void 0);if(E){let P=en(E,c);if(!c&&P.conditions){const S=en(P.conditions,!1);P=Wa(Na({},P),{conditions:S})}(0,h.set)(o,[...m,g,i],P)}});break}case"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX":{const{pathToCollectionType:s,propertyName:i,rowName:c,value:m}=t;let g=(0,h.cloneDeep)(a.modifiedData);const E=s.split(".."),P=(0,h.get)(g,E,{});Object.keys(P).forEach(S=>{if((0,h.has)(P[S],`properties.${i}`)){const F=(0,h.get)(P,[S,"properties",i,c]),k=[...E,S,"properties",i,c];if(!(0,h.isObject)(F))(0,h.set)(g,k,m);else{const se=en(F,m);(0,h.set)(g,k,se)}}}),m||(g=Bn(g)),(0,h.set)(o,"modifiedData",g);break}case"ON_CHANGE_CONDITIONS":{Object.entries(t.conditions).forEach(s=>{const[i,c]=s;(0,h.set)(o,["modifiedData",...i.split(".."),"conditions"],c)});break}case"ON_CHANGE_SIMPLE_CHECKBOX":{let s=(0,h.cloneDeep)(a.modifiedData);(0,h.set)(s,[...t.keys.split("..")],t.value),t.value||(s=Bn(s)),(0,h.set)(o,"modifiedData",s);break}case"ON_CHANGE_TOGGLE_PARENT_CHECKBOX":{const{keys:s,value:i}=t,c=[...s.split("..")];let m=(0,h.cloneDeep)(a.modifiedData);const g=(0,h.get)(m,c,{}),E=en(g,i);(0,h.set)(m,c,E),i||(m=Bn(m)),(0,h.set)(o,["modifiedData"],m);break}case"RESET_FORM":{o.modifiedData=a.initialData;break}case"SET_FORM_AFTER_SUBMIT":{o.initialData=a.modifiedData;break}default:return o}}),wn=a=>Object.entries(a).filter(([,t])=>t).map(([t])=>t),ka=a=>{const[t,{conditions:o}]=a;return{action:t,subject:null,conditions:wn(o),properties:{}}},Va=a=>Object.values(a).reduce((t,o)=>{const s=Object.entries(o).reduce((i,c)=>{const[,{properties:{enabled:m}}]=c;if(!m)return i;const g=ka(c);return i.push(g),i},[]);return[...t,...s]},[]),Lo=a=>Object.values(a).reduce((t,o)=>{const s=Va(o);return[...t,...s]},[]),Io=(a,t="")=>Object.entries(a).reduce((o,s)=>{const[i,c]=s;return(0,h.isObject)(c)?[...o,...Io(c,`${t}${i}.`)]:(c&&!(0,h.isObject)(c)&&o.push(`${t}${i}`),o)},[]),Za=(a,t,{conditions:o,properties:s})=>Object.entries(s).reduce((i,c)=>{const[m,g]=c;return i.properties[m]=Io(g),i},{action:a,subject:t,conditions:wn(o),properties:{}}),Ga=(a,t,{conditions:o})=>({action:a,subject:t,properties:{},conditions:wn(o)}),za=(a,t)=>Object.entries(t).reduce((s,i)=>{const[c,m]=i;if(!mt(m).some(P=>P))return s;if(!(0,h.has)(m,"properties.enabled")){const P=Za(c,a,m);return[...s,P]}if(!m.properties.enabled)return s;const E=Ga(c,a,m);return s.push(E),s},[]),Fo=a=>Object.entries(a).reduce((o,s)=>{const[i,c]=s,m=za(i,c);return[...o,...m]},[]),Ka=a=>{const t=Lo(a.plugins),o=Lo(a.settings),s=Fo(a.collectionTypes),i=Fo(a.singleTypes);return[...t,...o,...s,...i]},Ha=[{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"}];var Xa=Object.defineProperty,Bo=Object.getOwnPropertySymbols,Ya=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,wo=(a,t,o)=>t in a?Xa(a,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):a[t]=o,jo=(a,t)=>{for(var o in t||(t={}))Ya.call(t,o)&&wo(a,o,t[o]);if(Bo)for(var o of Bo(t))Qa.call(t,o)&&wo(a,o,t[o]);return a};const jn=(0,e.forwardRef)(({layout:a,isFormDisabled:t,permissions:o},s)=>{const[{initialData:i,layouts:c,modifiedData:m},g]=(0,e.useReducer)(Ua,$a,()=>Ca(a,o)),{formatMessage:E}=(0,H.useIntl)();(0,e.useImperativeHandle)(s,()=>({getPermissions:()=>{const j=(0,$.difference)(i.collectionTypes,m.collectionTypes),N=(0,$.difference)(i.singleTypes,m.singleTypes),O=jo(jo({},j),N);let B;return Pe()(O)?B=!1:B=Object.values(O).some(J=>Object.values(J).some(ce=>ee()(ce,"conditions"))),{permissionsToSend:Ka(m),didUpdateConditions:B}},resetForm:()=>{g({type:"RESET_FORM"})},setFormAfterSubmit:()=>{g({type:"SET_FORM_AFTER_SUBMIT"})}}));const P=(j,N,O,B)=>{g({type:"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX",pathToCollectionType:j,propertyName:N,rowName:O,value:B})},S=(j,N,O)=>{g({type:"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX",collectionTypeKind:j,actionId:N,value:O})},F=j=>{g({type:"ON_CHANGE_CONDITIONS",conditions:j})},k=(0,e.useCallback)(({target:{name:j,value:N}})=>{g({type:"ON_CHANGE_SIMPLE_CHECKBOX",keys:j,value:N})},[]),se=(0,e.useCallback)(({target:{name:j,value:N}})=>{g({type:"ON_CHANGE_TOGGLE_PARENT_CHECKBOX",keys:j,value:N})},[]);return e.createElement(Qo,{value:{availableConditions:a.conditions,modifiedData:m,onChangeConditions:F,onChangeSimpleCheckbox:k,onChangeParentCheckbox:se,onChangeCollectionTypeLeftActionRowCheckbox:P,onChangeCollectionTypeGlobalActionCheckbox:S}},e.createElement(L.TabGroup,{id:"tabs",label:E({id:"Settings.permissions.users.tabs.label",defaultMessage:"Tabs Permissions"})},e.createElement(L.Tabs,null,Ha.map(j=>e.createElement(L.Tab,{key:j.id},E({id:j.labelId,defaultMessage:j.defaultMessage})))),e.createElement(L.TabPanels,{style:{position:"relative"}},e.createElement(L.TabPanel,null,e.createElement(no,{layout:c.collectionTypes,kind:"collectionTypes",isFormDisabled:t})),e.createElement(L.TabPanel,null,e.createElement(no,{layout:c.singleTypes,kind:"singleTypes",isFormDisabled:t})),e.createElement(L.TabPanel,null,e.createElement(uo,{layout:c.plugins,kind:"plugins",isFormDisabled:t})),e.createElement(L.TabPanel,null,e.createElement(uo,{layout:c.settings,kind:"settings",isFormDisabled:t})))))});jn.defaultProps={permissions:[],layout:{conditions:[],sections:{collectionTypes:{},singleTypes:{actions:[]},settings:[],plugins:[]}}},jn.propTypes={layout:r().object,isFormDisabled:r().bool.isRequired,permissions:r().array};const Ja=(0,e.memo)(jn)},16437:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!0},78522:(K,A,n)=>{"use strict";n.d(A,{Z:()=>e});const e=()=>"todo empty role"},80779:(K,A,n)=>{"use strict";n.d(A,{Z:()=>Ne});var e=n(32735),y=n(60216),r=n.n(y),$=n(9808),L=n.n($),_=n(19192),ee=n.n(_),te=n(53214),Pe=n.n(te),H=n(95602),M=n.n(H),T=n(20763),G=n.n(T),me=n(88425),V=n.n(me),oe=n(5636),Qe=n.n(oe),He=Object.defineProperty,ke=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,v=(le,re,ye)=>re in le?He(le,re,{enumerable:!0,configurable:!0,writable:!0,value:ye}):le[re]=ye,ge=(le,re)=>{for(var ye in re||(re={}))Se.call(re,ye)&&v(le,ye,re[ye]);if(ke)for(var ye of ke(re))Y.call(re,ye)&&v(le,ye,re[ye]);return le};const Ve=({id:le,name:re,description:ye,usersCount:We,icons:Xe})=>{const{formatMessage:Je}=(0,oe.useIntl)(),$e=Je({id:"Roles.RoleRow.user-count",defaultMessage:"{number, plural, =0 {# user} one {# user} other {# users}}"},{number:We});return e.createElement(te.Tr,ge({key:le},(0,me.onRowClick)({fn:Xe[1].onClick})),e.createElement(te.Td,{maxWidth:(0,me.pxToRem)(130)},e.createElement(H.Typography,{ellipsis:!0,textColor:"neutral800"},re)),e.createElement(te.Td,{maxWidth:(0,me.pxToRem)(250)},e.createElement(H.Typography,{ellipsis:!0,textColor:"neutral800"},ye)),e.createElement(te.Td,null,e.createElement(H.Typography,{textColor:"neutral800"},$e)),e.createElement(te.Td,null,e.createElement(_.Flex,ge({justifyContent:"flex-end"},me.stopPropagation),Xe.map((Re,Ze)=>Re?e.createElement($.Box,{key:Re.label,paddingLeft:Ze===0?0:1},e.createElement(T.IconButton,{onClick:Re.onClick,label:Re.label,noBorder:!0,icon:Re.icon})):null))))};Ve.propTypes={id:r().number.isRequired,name:r().string.isRequired,description:r().string.isRequired,usersCount:r().number.isRequired,icons:r().array.isRequired};const Ne=Ve},45677:(K,A,n)=>{"use strict";n.d(A,{Z:()=>_e});var e=n(32735),y=n(88425),r=n(83983),$=n(58469),L=n(59290),_=n.n(L),ee=n(76470),te=n.n(ee),Pe=n(95717),H=n.n(Pe),M=n(68192),T=n.n(M),G=n(44526),me=n(11856),V=n(53214),oe=n(95602),Qe=n(16540),He=n(28004),ke=n(5636),Se=n(5141),Y=n(80779),v=n(78522),ge=n(60216),Ve=n.n(ge),Ne=n(19615),le=n(64410),re=n(54742),ye=n(20763),We=n(61541),Xe=n(9808),Je=n(19192),$e=n(90662),Re=n(82372),Ze=n.n(Re),de=n(94009),qe=n.n(de);const D=n.p+"c3de6118ef47086ad05c.png",Z=n.p+"bd81ba6c07827282255d.png",W=Ne.default.div`
|
|
134
|
-
position: absolute;
|
|
135
|
-
z-index: 3;
|
|
136
|
-
inset: 0;
|
|
137
|
-
background: ${({theme:w})=>(0,y.setHexOpacity)(w.colors.neutral800,.2)};
|
|
138
|
-
padding: 0 ${({theme:w})=>w.spaces[8]};
|
|
139
|
-
`,ae=(0,Ne.default)(Je.Flex)`
|
|
140
|
-
position: relative;
|
|
141
|
-
max-width: ${830/16}rem;
|
|
142
|
-
height: ${415/16}rem;
|
|
143
|
-
margin: 0 auto;
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
margin-top: 10%;
|
|
146
|
-
padding-left: ${64/16}rem;
|
|
147
|
-
|
|
148
|
-
img:first-of-type {
|
|
149
|
-
position: absolute;
|
|
150
|
-
right: 0;
|
|
151
|
-
top: 0;
|
|
152
|
-
max-width: ${360/16}rem;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
img:not(:first-of-type) {
|
|
156
|
-
width: ${130/16}rem;
|
|
157
|
-
margin-left: 12%;
|
|
158
|
-
margin-right: ${20/16}rem;
|
|
159
|
-
z-index: 0;
|
|
160
|
-
}
|
|
161
|
-
`,fe=(0,Ne.default)($e.Stack)`
|
|
162
|
-
align-items: flex-start;
|
|
163
|
-
max-width: ${400/16}rem;
|
|
164
|
-
z-index: 0;
|
|
165
|
-
`,U=(0,Ne.default)(Xe.Box)`
|
|
166
|
-
position: absolute;
|
|
167
|
-
right: ${({theme:w})=>w.spaces[4]};
|
|
168
|
-
top: ${({theme:w})=>w.spaces[4]};
|
|
169
|
-
`,q=({onClose:w,isOpen:X})=>{(0,y.useLockScroll)(X);const{formatMessage:Q}=(0,ke.useIntl)();return X?e.createElement(le.Portal,null,e.createElement(W,{onClick:w},e.createElement(re.FocusTrap,{onEscape:w},e.createElement(ae,{onClick:h=>h.stopPropagation(),"aria-labelledby":"upgrade-plan",background:"neutral0",hasRadius:!0},e.createElement("img",{src:D,alt:"air-balloon"}),e.createElement(U,null,e.createElement(ye.IconButton,{onClick:w,"aria-label":"Close",icon:e.createElement(qe(),null)})),e.createElement(fe,{spacing:6},e.createElement(oe.Typography,{fontWeight:"bold",textColor:"primary600"},Q({id:"app.components.UpgradePlanModal.text-ce",defaultMessage:"COMMUNITY EDITION"})),e.createElement($e.Stack,{spacing:2},e.createElement(oe.Typography,{variant:"alpha",as:"h2",id:"upgrade-plan"},Q({id:"app.components.UpgradePlanModal.limit-reached",defaultMessage:"You have reached the limit"})),e.createElement(oe.Typography,null,Q({id:"app.components.UpgradePlanModal.text-power",defaultMessage:"Unlock the full power of Strapi by upgrading your plan to the Enterprise Edition"}))),e.createElement(We.LinkButton,{href:"https://strapi.io/pricing-self-hosted",isExternal:!0,endIcon:e.createElement(Ze(),null)},Q({id:"app.components.UpgradePlanModal.button",defaultMessage:"Learn more"}))),e.createElement("img",{src:Z,alt:"upgrade-arrow"}))))):null};q.propTypes={onClose:Ve().func.isRequired,isOpen:Ve().bool.isRequired};const ie=q;var z=n(73869);const ue=()=>{const{roles:w,isLoading:X}=(0,z.bF)(),Q=(0,y.useQuery)(),h=decodeURIComponent(Q.get("_q")||""),Fe=(0,$.ZP)(w,h,{keys:["name","description"]});return{isLoading:X,sortedRoles:Fe}},Le=()=>{const{formatMessage:w}=(0,ke.useIntl)(),[X,Q]=(0,e.useState)(!1),{trackUsage:h}=(0,y.useTracking)(),{push:Fe}=(0,Se.useHistory)(),et=(0,e.useCallback)(Te=>{Fe(`/settings/roles/${Te}`)},[Fe]),Ye=(0,e.useCallback)(()=>{Q(Te=>!Te)},[]),ne=(0,e.useCallback)(()=>{h("didShowRBACUpgradeModal"),Q(!0)},[h]),ve=(0,e.useCallback)(Te=>[{onClick:Ye,label:w({id:"app.utils.duplicate",defaultMessage:"Duplicate"}),icon:e.createElement(T(),null)},{onClick:()=>et(Te.id),label:w({id:"app.utils.edit",defaultMessage:"Edit"}),icon:e.createElement(H(),null)},{onClick:Ye,label:w({id:"global.delete",defaultMessage:"Delete"}),icon:e.createElement(te(),null)}],[w,Ye,et]);return{isModalOpen:X,handleToggleModalForCreatingRole:ne,handleToggle:Ye,getIcons:ve}},ze=()=>{const{formatMessage:w}=(0,ke.useIntl)();(0,y.useFocusWhenNavigate)();const{sortedRoles:X,isLoading:Q}=ue(),{isModalOpen:h,handleToggle:Fe,handleToggleModalForCreatingRole:et,getIcons:Ye}=Le(),ne=X.length+1,ve=5;return e.createElement(Qe.Main,null,e.createElement(y.SettingsPageTitle,{name:"Roles"}),e.createElement(me.HeaderLayout,{primaryAction:e.createElement(G.Button,{onClick:et,startIcon:e.createElement(_(),null),size:"L"},w({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})),title:w({id:"global.roles",defaultMessage:"roles"}),subtitle:w({id:"Settings.roles.list.description",defaultMessage:"List of roles"})}),e.createElement(me.ContentLayout,null,e.createElement(V.Table,{colCount:ve,rowCount:ne,footer:e.createElement(V.TFooter,{onClick:et,icon:e.createElement(_(),null)},w({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"}))},e.createElement(V.Thead,null,e.createElement(V.Tr,null,e.createElement(V.Th,null,e.createElement(oe.Typography,{variant:"sigma",textColor:"neutral600"},w({id:"global.name",defaultMessage:"Name"}))),e.createElement(V.Th,null,e.createElement(oe.Typography,{variant:"sigma",textColor:"neutral600"},w({id:"global.description",defaultMessage:"Description"}))),e.createElement(V.Th,null,e.createElement(oe.Typography,{variant:"sigma",textColor:"neutral600"},w({id:"global.users",defaultMessage:"Users"}))),e.createElement(V.Th,null,e.createElement(He.VisuallyHidden,null,w({id:"global.actions",defaultMessage:"Actions"}))))),e.createElement(V.Tbody,null,X==null?void 0:X.map(Te=>e.createElement(Y.Z,{key:Te.id,id:Te.id,name:Te.name,description:Te.description,usersCount:Te.usersCount,icons:Ye(Te)})))),!ne&&!Q&&e.createElement(v.Z,null)),e.createElement(ie,{isOpen:h,onClose:Fe}))},_e=()=>e.createElement(y.CheckPagePermissions,{permissions:r.Z.settings.roles.main},e.createElement(ze,null))},75936:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=[]},20178:(K,A,n)=>{"use strict";n.d(A,{Z:()=>Ze});var e=n(32735),y=n(64213),r=n(88425),$=n(9808),L=n(44526),_=n(11856),ee=n(78330),te=n(16540),Pe=n(19192),H=n(90662),M=n(95602),T=n(37178),G=n(90353),me=n(98599),V=n.n(me),oe=n(83281),Qe=n(33795),He=n.n(Qe),ke=n(86834),Se=n.n(ke),Y=n(5636),v=n(5141),ge=n(19615),Ve=n(25793),Ne=n(73869),le=n(83983),re=n(5173);const We=re.Ry().shape({name:re.Z_().required(r.translatedErrors.required),description:re.Z_().required(r.translatedErrors.required)});var Xe=n(98399),Je=(de,qe,D)=>new Promise((Z,W)=>{var ae=q=>{try{U(D.next(q))}catch(ie){W(ie)}},fe=q=>{try{U(D.throw(q))}catch(ie){W(ie)}},U=q=>q.done?Z(q.value):Promise.resolve(q.value).then(ae,fe);U((D=D.apply(de,qe)).next())});const $e=ge.default.div`
|
|
170
|
-
border: 1px solid ${({theme:de})=>de.colors.primary200};
|
|
171
|
-
background: ${({theme:de})=>de.colors.primary100};
|
|
172
|
-
padding: ${({theme:de})=>`${de.spaces[2]} ${de.spaces[4]}`};
|
|
173
|
-
color: ${({theme:de})=>de.colors.primary600};
|
|
174
|
-
border-radius: ${({theme:de})=>de.borderRadius};
|
|
175
|
-
font-size: ${12/16}rem;
|
|
176
|
-
font-weight: bold;
|
|
177
|
-
`,Re=()=>{const de=(0,r.useNotification)(),{lockApp:qe,unlockApp:D}=(0,r.useOverlayBlocker)(),{formatMessage:Z}=(0,Y.useIntl)(),[W,ae]=(0,e.useState)(!1),{replace:fe}=(0,v.useHistory)(),U=(0,e.useRef)(),{trackUsage:q}=(0,r.useTracking)(),ie=(0,v.useRouteMatch)("/settings/roles/duplicate/:id"),z=He()(ie,"params.id",null),{isLoading:ue,data:Le}=(0,Ne.U_)(),{permissions:Ge,isLoading:ze}=(0,Ne.Dq)(z),it=w=>{qe(),ae(!0),q(z?"willDuplicateRole":"willCreateNewRole"),Promise.resolve((0,r.request)("/admin/roles",{method:"POST",body:w})).then(X=>Je(void 0,null,function*(){const{permissionsToSend:Q}=U.current.getPermissions();return q(z?"didDuplicateRole":"didCreateNewRole"),X.data.id&&!Se()(Q)&&(yield(0,r.request)(`/admin/roles/${X.data.id}/permissions`,{method:"PUT",body:{permissions:Q}})),X})).then(X=>{ae(!1),de({type:"success",message:{id:"Settings.roles.created",defaultMessage:"created"}}),fe(`/settings/roles/${X.data.id}`)}).catch(X=>{Xe.error(X),ae(!1),de({type:"warning",message:{id:"notification.error"}})}).finally(()=>{D()})},_e=`${Z({id:"Settings.roles.form.created",defaultMessage:"Created"})} ${(0,y.format)(new Date,"PPP")}`;return e.createElement(te.Main,null,e.createElement(r.SettingsPageTitle,{name:"Roles"}),e.createElement(oe.Formik,{initialValues:{name:"",description:_e},onSubmit:it,validationSchema:We,validateOnChange:!1},({handleSubmit:w,values:X,errors:Q,handleReset:h,handleChange:Fe})=>e.createElement(r.Form,{noValidate:!0},e.createElement(e.Fragment,null,e.createElement(_.HeaderLayout,{primaryAction:e.createElement(H.Stack,{horizontal:!0,spacing:2},e.createElement(L.Button,{variant:"secondary",onClick:()=>{h(),U.current.resetForm()},size:"L"},Z({id:"app.components.Button.reset",defaultMessage:"Reset"})),e.createElement(L.Button,{onClick:w,loading:W,size:"L"},Z({id:"global.save",defaultMessage:"Save"}))),title:Z({id:"Settings.roles.create.title",defaultMessage:"Create a role"}),subtitle:Z({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(r.Link,{startIcon:e.createElement(V(),null),to:"/settings/roles"},Z({id:"global.back",defaultMessage:"Back"}))}),e.createElement(_.ContentLayout,null,e.createElement(H.Stack,{spacing:6},e.createElement($.Box,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(H.Stack,{spacing:4},e.createElement(Pe.Flex,{justifyContent:"space-between"},e.createElement($.Box,null,e.createElement($.Box,null,e.createElement(M.Typography,{fontWeight:"bold"},Z({id:"global.details",defaultMessage:"Details"}))),e.createElement($.Box,null,e.createElement(M.Typography,{variant:"pi",textColor:"neutral600"},Z({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement($e,null,Z({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:0}))),e.createElement(ee.Grid,{gap:4},e.createElement(ee.GridItem,{col:6},e.createElement(T.TextInput,{name:"name",error:Q.name&&Z({id:Q.name}),label:Z({id:"global.name",defaultMessage:"Name"}),onChange:Fe,value:X.name})),e.createElement(ee.GridItem,{col:6},e.createElement(G.Textarea,{label:Z({id:"global.description",defaultMessage:"Description"}),name:"description",error:Q.description&&Z({id:Q.description}),onChange:Fe},X.description))))),!ue&&!ze?e.createElement($.Box,{shadow:"filterShadow",hasRadius:!0},e.createElement(Ve.Z,{isFormDisabled:!1,ref:U,permissions:Ge,layout:Le})):e.createElement($.Box,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(r.LoadingIndicatorPage,null))))))))},Ze=()=>e.createElement(r.CheckPagePermissions,{permissions:le.Z.settings.roles.create},e.createElement(Re,null))},56899:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!1},68464:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!1},32741:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!1},19665:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!1},36950:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!1},96556:(K,A,n)=>{"use strict";n.d(A,{Z:()=>y});const y=!1},51899:(K,A,n)=>{"use strict";n.d(A,{Z:()=>qe});var e=n(32735),y=n(88425),r=n(83983),$=n(59290),L=n.n($),_=n(76470),ee=n.n(_),te=n(68192),Pe=n.n(te),H=n(95717),M=n.n(H),T=n(44526),G=n(11856),me=n(28004),V=n(16540),oe=n(53214),Qe=n(95602),He=n(92891),ke=n(58469),Se=n(5636),Y=n(5141),v=n(17247),ge=n(73869),Ve=n(78522),Ne=n(80779),le=n(22909);const re={roleToDelete:null,showModalConfirmButtonLoading:!1,shouldRefetchData:!1},We=(D,Z)=>(0,le.default)(D,W=>{switch(Z.type){case"ON_REMOVE_ROLES":{W.showModalConfirmButtonLoading=!0;break}case"ON_REMOVE_ROLES_SUCCEEDED":{W.shouldRefetchData=!0,W.roleToDelete=null;break}case"RESET_DATA_TO_DELETE":{W.shouldRefetchData=!1,W.roleToDelete=null,W.showModalConfirmButtonLoading=!1;break}case"SET_ROLE_TO_DELETE":{W.roleToDelete=Z.id;break}default:return W}});var Xe=(D,Z,W)=>new Promise((ae,fe)=>{var U=z=>{try{ie(W.next(z))}catch(ue){fe(ue)}},q=z=>{try{ie(W.throw(z))}catch(ue){fe(ue)}},ie=z=>z.done?ae(z.value):Promise.resolve(z.value).then(U,q);ie((W=W.apply(D,Z)).next())});const Je=()=>{(0,y.useFocusWhenNavigate)();const{isLoading:D,allowedActions:{canCreate:Z,canDelete:W,canRead:ae,canUpdate:fe}}=(0,y.useRBAC)(r.Z.settings.roles),{getData:U,roles:q,isLoading:ie}=(0,ge.bF)(!1),[{query:z}]=(0,y.useQueryParams)(),ue=(z==null?void 0:z._q)||"",Le=(0,ke.ZP)(q,ue,{keys:["name","description"]});return(0,e.useEffect)(()=>{!D&&ae&&U()},[D,ae,U]),{isLoadingForPermissions:D,canCreate:Z,canDelete:W,canRead:ae,canUpdate:fe,isLoading:ie,getData:U,sortedRoles:Le,roles:q}},$e=({getData:D,canCreate:Z,canDelete:W,canUpdate:ae})=>{const{formatMessage:fe}=(0,Se.useIntl)(),U=(0,y.useNotification)(),[q,ie]=(0,e.useState)(!1),{push:z}=(0,Y.useHistory)(),[{selectedRoles:ue,showModalConfirmButtonLoading:Le,roleToDelete:Ge},ze]=(0,e.useReducer)(We,re),it=()=>Xe(void 0,null,function*(){try{ze({type:"ON_REMOVE_ROLES"}),yield v.be.post("/admin/roles/batch-delete",{ids:[Ge]}),yield D(),ze({type:"RESET_DATA_TO_DELETE"})}catch(ne){const ve=(0,He.get)(ne,["response","payload","data","ids"],null);if(ve&&Array.isArray(ve)){const Te=ve.join(`
|
|
178
|
-
`);U({type:"warning",message:Te})}else U({type:"warning",message:{id:"notification.error"}})}Q()}),_e=(0,e.useCallback)(ne=>{z(`/settings/roles/duplicate/${ne}`)},[z]),w=()=>z("/settings/roles/new"),X=(0,e.useCallback)(ne=>{ze({type:"SET_ROLE_TO_DELETE",id:ne}),Q()},[]),Q=()=>ie(ne=>!ne),h=(0,e.useCallback)(ne=>{z(`/settings/roles/${ne}`)},[z]),Fe=(0,e.useCallback)((ne,ve)=>{ne.preventDefault(),ne.stopPropagation(),ve.usersCount?U({type:"info",message:{id:"Roles.ListPage.notification.delete-not-allowed"}}):X(ve.id)},[U,X]),et=(0,e.useCallback)((ne,ve)=>{ne.preventDefault(),ne.stopPropagation(),_e(ve.id)},[_e]),Ye=(0,e.useCallback)(ne=>[...Z?[{onClick:ve=>et(ve,ne),label:fe({id:"app.utils.duplicate",defaultMessage:"Duplicate"}),icon:e.createElement(Pe(),null)}]:[],...ae?[{onClick:()=>h(ne.id),label:fe({id:"app.utils.edit",defaultMessage:"Edit"}),icon:e.createElement(M(),null)}]:[],...W?[{onClick:ve=>Fe(ve,ne),label:fe({id:"global.delete",defaultMessage:"Delete"}),icon:e.createElement(ee(),null)}]:[]],[fe,Fe,et,h,Z,ae,W]);return{handleNewRoleClick:w,getIcons:Ye,selectedRoles:ue,isWarningDeleteAllOpened:q,showModalConfirmButtonLoading:Le,handleToggleModal:Q,handleDeleteData:it}},Ze=()=>{const{formatMessage:D}=(0,Se.useIntl)(),{isLoadingForPermissions:Z,canCreate:W,canRead:ae,canDelete:fe,canUpdate:U,isLoading:q,getData:ie,sortedRoles:z}=Je(),{handleNewRoleClick:ue,getIcons:Le,isWarningDeleteAllOpened:Ge,showModalConfirmButtonLoading:ze,handleToggleModal:it,handleDeleteData:_e}=$e({getData:ie,canCreate:W,canDelete:fe,canUpdate:U}),w=z.length+1,X=6;if(Z)return e.createElement(V.Main,null,e.createElement(y.LoadingIndicatorPage,null));const Q=D({id:"global.roles",defaultMessage:"roles"});return e.createElement(V.Main,null,e.createElement(y.SettingsPageTitle,{name:"Roles"}),e.createElement(G.HeaderLayout,{primaryAction:W?e.createElement(T.Button,{onClick:ue,startIcon:e.createElement(L(),null),size:"L"},D({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null,title:Q,subtitle:D({id:"Settings.roles.list.description",defaultMessage:"List of roles"}),as:"h2"}),ae&&e.createElement(G.ActionLayout,{startActions:e.createElement(y.SearchURLQuery,{label:D({id:"app.component.search.label",defaultMessage:"Search for {target}"},{target:Q})})}),ae&&e.createElement(G.ContentLayout,null,e.createElement(oe.Table,{colCount:X,rowCount:w,footer:W?e.createElement(oe.TFooter,{onClick:ue,icon:e.createElement(L(),null)},D({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null},e.createElement(oe.Thead,null,e.createElement(oe.Tr,null,e.createElement(oe.Th,null,e.createElement(Qe.Typography,{variant:"sigma",textColor:"neutral600"},D({id:"global.name",defaultMessage:"Name"}))),e.createElement(oe.Th,null,e.createElement(Qe.Typography,{variant:"sigma",textColor:"neutral600"},D({id:"global.description",defaultMessage:"Description"}))),e.createElement(oe.Th,null,e.createElement(Qe.Typography,{variant:"sigma",textColor:"neutral600"},D({id:"global.users",defaultMessage:"Users"}))),e.createElement(oe.Th,null,e.createElement(me.VisuallyHidden,null,D({id:"global.actions",defaultMessage:"Actions"}))))),e.createElement(oe.Tbody,null,z==null?void 0:z.map(h=>e.createElement(Ne.Z,{key:h.id,id:h.id,name:h.name,description:h.description,usersCount:h.usersCount,icons:Le(h)})))),!w&&!q&&e.createElement(Ve.Z,null)),e.createElement(y.ConfirmDialog,{isOpen:Ge,onConfirm:_e,isConfirmButtonLoading:ze,onToggleDialog:it}))},qe=()=>e.createElement(y.CheckPagePermissions,{permissions:r.Z.settings.roles.main},e.createElement(Ze,null))},63775:(K,A,n)=>{"use strict";n.d(A,{Z:()=>$});var e=(L,_,ee)=>new Promise((te,Pe)=>{var H=G=>{try{T(ee.next(G))}catch(me){Pe(me)}},M=G=>{try{T(ee.throw(G))}catch(me){Pe(me)}},T=G=>G.done?te(G.value):Promise.resolve(G.value).then(H,M);T((ee=ee.apply(L,_)).next())});const $=[...strapi.features.isEnabled(strapi.features.SSO)?[{Component:()=>e(void 0,null,function*(){return yield n.e(302).then(n.bind(n,49851))}),to:"/settings/single-sign-on",exact:!0}]:[]]},84802:K=>{function A(n,e,y,r){for(var $=-1,L=n==null?0:n.length;++$<L;){var _=n[$];e(r,_,y(_),n)}return r}K.exports=A},62435:(K,A,n)=>{var e=n(56671);function y(r,$,L,_){return e(r,function(ee,te,Pe){$(_,ee,L(ee),Pe)}),_}K.exports=y},85580:(K,A,n)=>{var e=n(84802),y=n(62435),r=n(88904),$=n(77236);function L(_,ee){return function(te,Pe){var H=$(te)?e:y,M=ee?ee():{};return H(te,_,r(Pe,2),M)}}K.exports=L},3704:(K,A,n)=>{var e=n(40314),y=n(37213);function r($,L){return e(y($,L),1)}K.exports=r},81346:(K,A,n)=>{var e=n(40999),y=n(85580),r=Object.prototype,$=r.hasOwnProperty,L=y(function(_,ee,te){$.call(_,te)?_[te].push(ee):e(_,te,[ee])});K.exports=L}}]);
|