(self.webpackChunk_digicommerce_cms_admin=self.webpackChunk_digicommerce_cms_admin||[]).push([[2282],{16540:(q,k,f)=>{"use strict";q.exports=f(67468)},67468:function(q,k,f){(function(i,F){q.exports=F(f(32735),f(19615))})(this,function(i,F){return function(t){var b={};function r(a){if(b[a])return b[a].exports;var n=b[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=b,r.d=function(a,n,c){r.o(a,n)||Object.defineProperty(a,n,{enumerable:!0,get:c})},r.r=function(a){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},r.t=function(a,n){if(1&n&&(a=r(a)),8&n||4&n&&typeof a=="object"&&a&&a.__esModule)return a;var c=Object.create(null);if(r.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:a}),2&n&&typeof a!="string")for(var s in a)r.d(c,s,function(m){return a[m]}.bind(null,s));return c},r.n=function(a){var n=a&&a.__esModule?function(){return a.default}:function(){return a};return r.d(n,"a",n),n},r.o=function(a,n){return Object.prototype.hasOwnProperty.call(a,n)},r.p="",r(r.s=110)}({0:function(t,b,r){t.exports=r(19)()},1:function(t,b){t.exports=i},10:function(t,b,r){var a=r(25),n=r(26),c=r(22),s=r(27);t.exports=function(m,v){return a(m)||n(m,v)||c(m,v)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},110:function(t,b,r){"use strict";r.r(b),r.d(b,"Main",function(){return e}),r.d(b,"SkipToContent",function(){return W});var a,n=r(5),c=r.n(n),s=r(4),m=r.n(s),v=r(3),h=r.n(v),E=r(1),R=r.n(E),l=r(0),S=r.n(l),B=r(2),L=r.n(B),y=["labelledBy"],O=L.a.main(a||(a=h()([`
  // To prevent global outline on focus visible to force an outline when Main is focused
  &:focus-visible {
    outline: none;
  }
`]))),e=function(U){var N=U.labelledBy,G=m()(U,y),ie=N||"main-content-title";return R.a.createElement(O,c()({"aria-labelledby":ie,id:"main-content",tabIndex:-1},G))};e.defaultProps={labelledBy:void 0},e.propTypes={labelledBy:S.a.string};var o,g=r(6),z=L()(g.Box)(o||(o=h()([`
  text-decoration: none;
  position: absolute;
  z-index: 9999;
  left: -100%;
  top: -100%;

  &:focus {
    left: `,`;
    top: `,`;
  }
`])),function(U){return U.theme.spaces[3]},function(U){return U.theme.spaces[3]}),W=function(U){var N=U.children;return R.a.createElement(z,{as:"a",href:"#main-content",background:"primary600",color:"neutral0",padding:3,hasRadius:!0},N)};W.propTypes={children:S.a.node.isRequired}},13:function(t,b){function r(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?(t.exports=r=function(n){return typeof n},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t.exports.default=t.exports,t.exports.__esModule=!0),r(a)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},19:function(t,b,r){"use strict";var a=r(20);function n(){}function c(){}c.resetWarningCache=n,t.exports=function(){function s(h,E,R,l,S,B){if(B!==a){var L=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw L.name="Invariant Violation",L}}function m(){return s}s.isRequired=s;var v={array:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:m,element:s,elementType:s,instanceOf:m,node:s,objectOf:m,oneOf:m,oneOfType:m,shape:m,exact:m,checkPropTypes:c,resetWarningCache:n};return v.PropTypes=v,v}},2:function(t,b){t.exports=F},20:function(t,b,r){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},21:function(t,b){t.exports=function(r,a){(a==null||a>r.length)&&(a=r.length);for(var n=0,c=new Array(a);n<a;n++)c[n]=r[n];return c},t.exports.default=t.exports,t.exports.__esModule=!0},22:function(t,b,r){var a=r(21);t.exports=function(n,c){if(n){if(typeof n=="string")return a(n,c);var s=Object.prototype.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?a(n,c):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},24:function(t,b){t.exports=function(r,a){if(r==null)return{};var n,c,s={},m=Object.keys(r);for(c=0;c<m.length;c++)n=m[c],a.indexOf(n)>=0||(s[n]=r[n]);return s},t.exports.default=t.exports,t.exports.__esModule=!0},25:function(t,b){t.exports=function(r){if(Array.isArray(r))return r},t.exports.default=t.exports,t.exports.__esModule=!0},26:function(t,b){t.exports=function(r,a){var n=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var c,s,m=[],v=!0,h=!1;try{for(n=n.call(r);!(v=(c=n.next()).done)&&(m.push(c.value),!a||m.length!==a);v=!0);}catch(E){h=!0,s=E}finally{try{v||n.return==null||n.return()}finally{if(h)throw s}}return m}},t.exports.default=t.exports,t.exports.__esModule=!0},27:function(t,b){t.exports=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},t.exports.default=t.exports,t.exports.__esModule=!0},3:function(t,b){t.exports=function(r,a){return a||(a=r.slice(0)),Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(a)}}))},t.exports.default=t.exports,t.exports.__esModule=!0},4:function(t,b,r){var a=r(24);t.exports=function(n,c){if(n==null)return{};var s,m,v=a(n,c);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(n);for(m=0;m<h.length;m++)s=h[m],c.indexOf(s)>=0||Object.prototype.propertyIsEnumerable.call(n,s)&&(v[s]=n[s])}return v},t.exports.default=t.exports,t.exports.__esModule=!0},5:function(t,b){function r(){return t.exports=r=Object.assign||function(a){for(var n=1;n<arguments.length;n++){var c=arguments[n];for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(a[s]=c[s])}return a},t.exports.default=t.exports,t.exports.__esModule=!0,r.apply(this,arguments)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},6:function(t,b,r){"use strict";r.r(b),r.d(b,"Box",function(){return O});var a,n=r(3),c=r.n(n),s=r(2),m=r.n(s),v=r(7),h=r(1),E=r.n(h),R=r(0),l=r.n(R),S=function(e){return E.a.createElement("div",e)},B={background:void 0,borderColor:void 0,color:void 0,hiddenS:!1,hiddenXS:!1,padding:void 0,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0,hasRadius:!1,shadow:void 0,children:null,shrink:void 0,grow:void 0,basis:void 0,flex:void 0,_hover:function(){}},L={_hover:l.a.func,background:l.a.string,basis:l.a.oneOfType([l.a.string,l.a.string]),borderColor:l.a.string,children:l.a.oneOfType([l.a.node,l.a.string]),color:l.a.string,flex:l.a.oneOfType([l.a.string,l.a.string]),grow:l.a.oneOfType([l.a.string,l.a.string]),hasRadius:l.a.bool,hiddenS:l.a.bool,hiddenXS:l.a.bool,padding:l.a.oneOfType([l.a.number,l.a.arrayOf(l.a.number)]),paddingBottom:l.a.oneOfType([l.a.number,l.a.arrayOf(l.a.number)]),paddingLeft:l.a.oneOfType([l.a.number,l.a.arrayOf(l.a.number)]),paddingRight:l.a.oneOfType([l.a.number,l.a.arrayOf(l.a.number)]),paddingTop:l.a.oneOfType([l.a.number,l.a.arrayOf(l.a.number)]),shadow:l.a.string,shrink:l.a.oneOfType([l.a.string,l.a.string])};S.defaultProps=B,S.propTypes=L;var y={color:!0},O=m.a.div.withConfig({shouldForwardProp:function(e,o){return!y[e]&&o(e)}})(a||(a=c()([`
  // Font
  font-size: `,`;

  // Colors
  background: `,`;
  color: `,`;

  // Spaces
  `,`
  `,`
  `,`
  `,`
  `,`
  `,`
  `,`
  `,`
  `,`

  // Responsive hiding
  `,`
  `,`
  

  // Borders
  border-radius: `,`;
  border-style: `,`;
  border-width: `,`;
  border-color: `,`;
  border: `,`;

  // Shadows
  box-shadow: `,`;

  // Handlers
  pointer-events: `,`;
  &:hover {
    `,`
  }

  // Display
  display: `,`;

  // Position
  position: `,`;
  left: `,`;
  right: `,`;
  top: `,`;
  bottom: `,`;
  z-index: `,`;
  overflow: `,`;
  cursor: `,`;

  // Size
  width: `,`;
  max-width: `,`;
  min-width: `,`;
  height: `,`;
  max-height: `,`;
  min-height: `,`;

  // Animation
  transition: `,`;
  transform: `,`;
  animation: `,`;

  //Flexbox children props
  flex-shrink: `,`;
  flex-grow: `,`;
  flex-basis: `,`;
  flex: `,`;

  // Text
  text-align: `,`;
  text-transform: `,`;
  line-height: `,`;

  // Cursor
  cursor: `,`;
`])),function(e){var o=e.fontSize;return e.theme.fontSizes[o]||o},function(e){var o=e.theme,g=e.background;return o.colors[g]},function(e){var o=e.theme,g=e.color;return o.colors[g]},function(e){var o=e.theme,g=e.padding;return Object(v.a)("padding",g,o)},function(e){var o=e.theme,g=e.paddingTop;return Object(v.a)("padding-top",g,o)},function(e){var o=e.theme,g=e.paddingRight;return Object(v.a)("padding-right",g,o)},function(e){var o=e.theme,g=e.paddingBottom;return Object(v.a)("padding-bottom",g,o)},function(e){var o=e.theme,g=e.paddingLeft;return Object(v.a)("padding-left",g,o)},function(e){var o=e.theme,g=e.marginLeft;return Object(v.a)("margin-left",g,o)},function(e){var o=e.theme,g=e.marginRight;return Object(v.a)("margin-right",g,o)},function(e){var o=e.theme,g=e.marginTop;return Object(v.a)("margin-top",g,o)},function(e){var o=e.theme,g=e.marginBottom;return Object(v.a)("margin-bottom",g,o)},function(e){var o=e.theme;return e.hiddenS?"".concat(o.mediaQueries.tablet," { display: none; }"):void 0},function(e){var o=e.theme;return e.hiddenXS?"".concat(o.mediaQueries.mobile," { display: none; }"):void 0},function(e){var o=e.theme,g=e.hasRadius,z=e.borderRadius;return g?o.borderRadius:z},function(e){return e.borderStyle},function(e){return e.borderWidth},function(e){var o=e.borderColor;return e.theme.colors[o]},function(e){var o=e.theme,g=e.borderColor,z=e.borderStyle,W=e.borderWidth;if(g&&!z&&!W)return"1px solid ".concat(o.colors[g])},function(e){var o=e.theme,g=e.shadow;return o.shadows[g]},function(e){return e.pointerEvents},function(e){var o=e._hover,g=e.theme;return o?o(g):void 0},function(e){return e.display},function(e){return e.position},function(e){var o=e.left;return e.theme.spaces[o]||o},function(e){var o=e.right;return e.theme.spaces[o]||o},function(e){var o=e.top;return e.theme.spaces[o]||o},function(e){var o=e.bottom;return e.theme.spaces[o]||o},function(e){return e.zIndex},function(e){return e.overflow},function(e){return e.cursor},function(e){var o=e.width;return e.theme.spaces[o]||o},function(e){var o=e.maxWidth;return e.theme.spaces[o]||o},function(e){var o=e.minWidth;return e.theme.spaces[o]||o},function(e){var o=e.height;return e.theme.spaces[o]||o},function(e){var o=e.maxHeight;return e.theme.spaces[o]||o},function(e){var o=e.minHeight;return e.theme.spaces[o]||o},function(e){return e.transition},function(e){return e.transform},function(e){return e.animation},function(e){return e.shrink},function(e){return e.grow},function(e){return e.basis},function(e){return e.flex},function(e){return e.textAlign},function(e){return e.textTransform},function(e){return e.lineHeight},function(e){return e.cursor});O.defaultProps=B,O.propTypes=L},7:function(t,b,r){"use strict";var a=r(10),n=r.n(a),c=r(13),s=r.n(c);b.a=function(m,v,h){var E=v;if(Array.isArray(v)||s()(v)!=="object"||(E=[v==null?void 0:v.desktop,v==null?void 0:v.tablet,v==null?void 0:v.mobile]),E!==void 0){if(Array.isArray(E)){var R=E,l=n()(R,3),S=l[0],B=l[1],L=l[2],y="".concat(m,": ").concat(h.spaces[S],";");return B!==void 0&&(y+="".concat(h.mediaQueries.tablet,`{
          `).concat(m,": ").concat(h.spaces[B],`;
        }`)),L!==void 0&&(y+="".concat(h.mediaQueries.mobile,`{
          `).concat(m,": ").concat(h.spaces[L],`;
        }`)),y}var O=h.spaces[E]||E;return"".concat(m,": ").concat(O,";")}}}})})},51509:(q,k,f)=>{"use strict";f.r(k),f.d(k,{ProvidersPage:()=>ye,default:()=>$e});var i=f(32735),F=f(5636),t=f(88425),b=f(23973),r=f.n(b),a=f(23940),n=f.n(a),c=f(16925),s=f(11856),m=f(16540),v=f(29270),h=f(53214),E=f(95602),R=f(28004),l=f(20763),S=f(95717),B=f.n(S),L=f(84968),y=f(5173),O=f(59677);const e={id:(0,O.OB)("PopUpForm.Providers.redirectURL.front-end.label"),defaultMessage:"The redirect URL to your front-end app"},o={id:"http://www.client-app.com",defaultMessage:"http://www.client-app.com"},g={id:(0,O.OB)("PopUpForm.Providers.enabled.description"),defaultMessage:"If disabled, users won't be able to use this provider."},z={id:(0,O.OB)("PopUpForm.Providers.enabled.label"),defaultMessage:"Enable"},W={id:(0,O.OB)("PopUpForm.Providers.key.label"),defaultMessage:"Client ID"},U={id:(0,O.OB)("PopUpForm.Providers.redirectURL.label"),defaultMessage:"The redirect URL to add in your {provider} application configurations"},N={id:(0,O.OB)("PopUpForm.Providers.key.placeholder"),defaultMessage:"TEXT"},G={id:(0,O.OB)("PopUpForm.Providers.secret.label"),defaultMessage:"Client Secret"},Y={email:{form:[[{intlLabel:z,name:"enabled",type:"bool",description:g,size:6}]],schema:y.Ry().shape({enabled:y.Xg().required(t.translatedErrors.required)})},providers:{form:[[{intlLabel:z,name:"enabled",type:"bool",description:g,size:6,validations:{required:!0}}],[{intlLabel:W,name:"key",type:"text",placeholder:N,size:12,validations:{required:!0}}],[{intlLabel:G,name:"secret",type:"text",placeholder:N,size:12,validations:{required:!0}}],[{intlLabel:e,placeholder:o,name:"callback",type:"text",size:12,validations:{required:!0}}],[{intlLabel:U,name:"noName",type:"text",validations:{},size:12,disabled:!0}]],schema:y.Ry().shape({enabled:y.Xg().required(t.translatedErrors.required),key:y.Z_().when("enabled",{is:!0,then:y.Z_().required(t.translatedErrors.required),otherwise:y.Z_()}),secret:y.Z_().when("enabled",{is:!0,then:y.Z_().required(t.translatedErrors.required),otherwise:y.Z_()}),callback:y.Z_().when("enabled",{is:!0,then:y.Z_().required(t.translatedErrors.required),otherwise:y.Z_()})})},providersWithSubdomain:{form:[[{intlLabel:z,name:"enabled",type:"bool",description:g,size:6,validations:{required:!0}}],[{intlLabel:W,name:"key",type:"text",placeholder:N,size:12,validations:{required:!0}}],[{intlLabel:G,name:"secret",type:"text",placeholder:N,size:12,validations:{required:!0}}],[{intlLabel:{id:(0,O.OB)("PopUpForm.Providers.subdomain.label"),defaultMessage:"Host URI (Subdomain)"},name:"subdomain",type:"text",placeholder:{id:(0,O.OB)("PopUpForm.Providers.subdomain.placeholder"),defaultMessage:"my.subdomain.com"},size:12,validations:{required:!0}}],[{intlLabel:e,placeholder:o,name:"callback",type:"text",size:12,validations:{required:!0}}],[{intlLabel:U,name:"noName",type:"text",validations:{},size:12,disabled:!0}]],schema:y.Ry().shape({enabled:y.Xg().required(t.translatedErrors.required),key:y.Z_().when("enabled",{is:!0,then:y.Z_().required(t.translatedErrors.required),otherwise:y.Z_()}),secret:y.Z_().when("enabled",{is:!0,then:y.Z_().required(t.translatedErrors.required),otherwise:y.Z_()}),subdomain:y.Z_().when("enabled",{is:!0,then:y.Z_().required(t.translatedErrors.required),otherwise:y.Z_()}),callback:y.Z_().when("enabled",{is:!0,then:y.Z_().required(t.translatedErrors.required),otherwise:y.Z_()})})}};var Oe=(d,u,p)=>new Promise((C,T)=>{var A=M=>{try{I(p.next(M))}catch(x){T(x)}},w=M=>{try{I(p.throw(M))}catch(x){T(x)}},I=M=>M.done?C(M.value):Promise.resolve(M.value).then(A,w);I((p=p.apply(d,u)).next())});const xe=d=>Oe(void 0,null,function*(){try{const{data:u}=yield O.be.get((0,O.Gc)("providers"));return u}catch(u){throw d({type:"warning",message:{id:"notification.error"}}),new Error("error")}}),Ee=d=>O.be.put((0,O.Gc)("providers"),d);var Me=f(92891);const Te=d=>(0,Me.sortBy)(Object.keys(d).reduce((u,p)=>{const{icon:C,enabled:T,subdomain:A}=d[p],w=C==="envelope"?["fas","envelope"]:["fab",C];return A!==void 0?u.push({name:p,icon:w,enabled:T,subdomain:A}):u.push({name:p,icon:w,enabled:T}),u},[]),"name");var se=f(88369),le=f(44526),Se=f(90662),de=f(71657),ue=f(78330),Q=f(4122),Re=f(60216),P=f.n(Re),we=f(83281),je=f(63865),Be=f(37178),Le=Object.defineProperty,ce=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,pe=(d,u,p)=>u in d?Le(d,u,{enumerable:!0,configurable:!0,writable:!0,value:p}):d[u]=p,J=(d,u)=>{for(var p in u||(u={}))Ce.call(u,p)&&pe(d,p,u[p]);if(ce)for(var p of ce(u))Ie.call(u,p)&&pe(d,p,u[p]);return d};const _=({description:d,disabled:u,intlLabel:p,error:C,name:T,onChange:A,placeholder:w,providerToEditName:I,type:M,value:x})=>{const{formatMessage:Z}=(0,F.useIntl)(),H=T==="noName"?`${strapi.backendURL}/api/connect/${I}/callback`:x,V=Z({id:p.id,defaultMessage:p.defaultMessage},J({provider:I},p.values)),D=d?Z({id:d.id,defaultMessage:d.defaultMessage},J({provider:I},d.values)):"";if(M==="bool")return i.createElement(je.ToggleInput,{"aria-label":T,checked:x,disabled:u,hint:D,label:V,name:T,offLabel:Z({id:"app.components.ToggleCheckbox.off-label",defaultMessage:"Off"}),onLabel:Z({id:"app.components.ToggleCheckbox.on-label",defaultMessage:"On"}),onChange:X=>{A({target:{name:T,value:X.target.checked}})}});const re=w?Z({id:w.id,defaultMessage:w.defaultMessage},J({},w.values)):"",ne=C?Z({id:C,defaultMessage:C}):"";return i.createElement(Be.TextInput,{"aria-label":T,disabled:u,error:ne,label:V,name:T,onChange:A,placeholder:re,type:M,value:H})};_.defaultProps={description:null,disabled:!1,error:"",placeholder:null,value:""},_.propTypes={description:P().shape({id:P().string.isRequired,defaultMessage:P().string.isRequired,values:P().object}),disabled:P().bool,error:P().string,intlLabel:P().shape({id:P().string.isRequired,defaultMessage:P().string.isRequired,values:P().object}).isRequired,name:P().string.isRequired,onChange:P().func.isRequired,placeholder:P().shape({id:P().string.isRequired,defaultMessage:P().string.isRequired,values:P().object}),providerToEditName:P().string.isRequired,type:P().string.isRequired,value:P().oneOfType([P().bool,P().string])};const Ae=_;var Fe=Object.defineProperty,Ue=Object.defineProperties,Ze=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable,me=(d,u,p)=>u in d?Fe(d,u,{enumerable:!0,configurable:!0,writable:!0,value:p}):d[u]=p,ke=(d,u)=>{for(var p in u||(u={}))De.call(u,p)&&me(d,p,u[p]);if(fe)for(var p of fe(u))ze.call(u,p)&&me(d,p,u[p]);return d},Ne=(d,u)=>Ue(d,Ze(u));const ee=({headerBreadcrumbs:d,initialData:u,isSubmiting:p,layout:C,isOpen:T,onSubmit:A,onToggle:w,providerToEditName:I})=>{const{formatMessage:M}=(0,F.useIntl)();return T?i.createElement(Q.ModalLayout,{onClose:w,labelledBy:"title"},i.createElement(Q.ModalHeader,null,i.createElement(de.Breadcrumbs,{label:d.join(", ")},d.map(x=>i.createElement(de.Crumb,{key:x},x)))),i.createElement(we.Formik,{onSubmit:x=>A(x),initialValues:u,validationSchema:C.schema,validateOnChange:!1},({errors:x,handleChange:Z,values:H})=>i.createElement(t.Form,null,i.createElement(Q.ModalBody,null,i.createElement(Se.Stack,{spacing:1},i.createElement(ue.Grid,{gap:5},C.form.map(V=>V.map(D=>i.createElement(ue.GridItem,{key:D.name,col:D.size,xs:12},i.createElement(Ae,Ne(ke({},D),{error:x[D.name],onChange:Z,value:H[D.name],providerToEditName:I})))))))),i.createElement(Q.ModalFooter,{startActions:i.createElement(le.Button,{variant:"tertiary",onClick:w,type:"button"},M({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:i.createElement(i.Fragment,null,i.createElement(le.Button,{type:"submit",loading:p},M({id:"global.save",defaultMessage:"Save"})))})))):null};ee.defaultProps={initialData:null,providerToEditName:null},ee.propTypes={headerBreadcrumbs:P().arrayOf(P().string).isRequired,initialData:P().object,layout:P().shape({form:P().arrayOf(P().array),schema:P().object}).isRequired,isOpen:P().bool.isRequired,isSubmiting:P().bool.isRequired,onSubmit:P().func.isRequired,onToggle:P().func.isRequired,providerToEditName:P().string};const We=ee;var He=Object.defineProperty,qe=Object.defineProperties,Ve=Object.getOwnPropertyDescriptors,ve=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable,he=(d,u,p)=>u in d?He(d,u,{enumerable:!0,configurable:!0,writable:!0,value:p}):d[u]=p,te=(d,u)=>{for(var p in u||(u={}))Xe.call(u,p)&&he(d,p,u[p]);if(ve)for(var p of ve(u))Ge.call(u,p)&&he(d,p,u[p]);return d},Qe=(d,u)=>qe(d,Ve(u)),ge=(d,u,p)=>new Promise((C,T)=>{var A=M=>{try{I(p.next(M))}catch(x){T(x)}},w=M=>{try{I(p.throw(M))}catch(x){T(x)}},I=M=>M.done?C(M.value):Promise.resolve(M.value).then(A,w);I((p=p.apply(d,u)).next())});const ye=()=>{const{formatMessage:d}=(0,F.useIntl)();(0,t.useFocusWhenNavigate)();const{notifyStatus:u}=(0,v.useNotifyAT)(),p=(0,L.useQueryClient)(),{trackUsage:C}=(0,t.useTracking)(),T=(0,i.useRef)(C),[A,w]=(0,i.useState)(!1),[I,M]=(0,i.useState)(!1),[x,Z]=(0,i.useState)(null),H=(0,t.useNotification)(),{lockApp:V,unlockApp:D}=(0,t.useOverlayBlocker)(),re=(0,i.useMemo)(()=>({update:se.Z.updateProviders}),[]),{isLoading:ne,allowedActions:{canUpdate:X}}=(0,t.useRBAC)(re),{isLoading:Ke,data:$,isFetching:Ye}=(0,L.useQuery)("get-providers",()=>xe(H),{onSuccess:()=>{u(d({id:(0,O.OB)("Providers.data.loaded"),defaultMessage:"Providers have been loaded"}))},initialData:{}}),Je=Ke||Ye,_e=(0,L.useMutation)(Ee,{onSuccess:()=>ge(void 0,null,function*(){yield p.invalidateQueries("get-providers"),H({type:"info",message:{id:(0,O.OB)("notification.success.submit")}}),T.current("didEditAuthenticationProvider"),M(!1),oe(),D()}),onError:()=>{H({type:"warning",message:{id:"notification.error"}}),D(),M(!1)},refetchActive:!1}),K=(0,i.useMemo)(()=>Te($),[$]),et=K.length,be=(0,i.useMemo)(()=>{if(!x)return!1;const j=K.find(ae=>ae.name===x);return r()(j,"subdomain")},[K,x]),tt=d({id:(0,O.OB)("HeaderNav.link.providers"),defaultMessage:"Providers"}),rt=(0,i.useMemo)(()=>x==="email"?Y.email:be?Y.providersWithSubdomain:Y.providers,[x,be]),oe=()=>{w(j=>!j)},Pe=j=>{X&&(Z(j.name),oe())},nt=j=>ge(void 0,null,function*(){M(!0),V(),T.current("willEditAuthenticationProvider");const ae=Qe(te({},$),{[x]:j});_e.mutate({providers:ae})});return i.createElement(s.Layout,null,i.createElement(t.SettingsPageTitle,{name:tt}),i.createElement(m.Main,null,i.createElement(s.HeaderLayout,{title:d({id:(0,O.OB)("HeaderNav.link.providers"),defaultMessage:"Providers"})}),Je||ne?i.createElement(t.LoadingIndicatorPage,null):i.createElement(s.ContentLayout,null,i.createElement(h.Table,{colCount:4,rowCount:et+1},i.createElement(h.Thead,null,i.createElement(h.Tr,null,i.createElement(h.Th,null,i.createElement(E.Typography,{variant:"sigma",textColor:"neutral600"},i.createElement(R.VisuallyHidden,null,d({id:(0,O.OB)("Providers.image"),defaultMessage:"Image"})))),i.createElement(h.Th,null,i.createElement(E.Typography,{variant:"sigma",textColor:"neutral600"},d({id:"global.name",defaultMessage:"Name"}))),i.createElement(h.Th,null,i.createElement(E.Typography,{variant:"sigma",textColor:"neutral600"},d({id:(0,O.OB)("Providers.status"),defaultMessage:"Status"}))),i.createElement(h.Th,null,i.createElement(E.Typography,{variant:"sigma"},i.createElement(R.VisuallyHidden,null,d({id:"global.settings",defaultMessage:"Settings"})))))),i.createElement(h.Tbody,null,K.map(j=>i.createElement(h.Tr,te({key:j.name},(0,t.onRowClick)({fn:()=>Pe(j),condition:X})),i.createElement(h.Td,{width:""},i.createElement(c.G,{icon:j.icon})),i.createElement(h.Td,{width:"45%"},i.createElement(E.Typography,{fontWeight:"semiBold",textColor:"neutral800"},j.name)),i.createElement(h.Td,{width:"65%"},i.createElement(E.Typography,{textColor:j.enabled?"success600":"danger600","data-testid":`enable-${j.name}`},j.enabled?d({id:"global.enabled",defaultMessage:"Enabled"}):d({id:"global.disabled",defaultMessage:"Disabled"}))),i.createElement(h.Td,te({},t.stopPropagation),X&&i.createElement(l.IconButton,{onClick:()=>Pe(j),noBorder:!0,icon:i.createElement(B(),null),label:"Edit"})))))))),i.createElement(We,{initialData:$[x],isOpen:A,isSubmiting:I,layout:rt,headerBreadcrumbs:[d({id:(0,O.OB)("PopUpForm.header.edit.providers"),defaultMessage:"Edit Provider"}),n()(x)],onToggle:oe,onSubmit:nt,providerToEditName:x}))},$e=()=>i.createElement(t.CheckPagePermissions,{permissions:se.Z.readProviders},i.createElement(ye,null))},8917:(q,k,f)=>{"use strict";f.d(k,{Z:()=>n});var i=f(43653),F=f.n(i),t=f(88425),b=f.n(t),r=(c,s,m)=>new Promise((v,h)=>{var E=S=>{try{l(m.next(S))}catch(B){h(B)}},R=S=>{try{l(m.throw(S))}catch(B){h(B)}},l=S=>S.done?v(S.value):Promise.resolve(S.value).then(E,R);l((m=m.apply(c,s)).next())});const a=F().create({baseURL:"http://localhost:1337"});a.interceptors.request.use(c=>r(void 0,null,function*(){return c.headers={Authorization:`Bearer ${t.auth.getToken()}`,Accept:"application/json","Content-Type":"application/json"},c}),c=>{Promise.reject(c)}),a.interceptors.response.use(c=>c,c=>{var s;throw((s=c.response)==null?void 0:s.status)===401&&(t.auth.clearAppStorage(),window.location.reload()),c});const n=a},59677:(q,k,f)=>{"use strict";f.d(k,{be:()=>i.Z,YX:()=>b,Gc:()=>n,OB:()=>c.Z});var i=f(8917),F=f(92891);const b=s=>Object.keys(s).reduce((m,v)=>{const h=s[v].controllers,E=Object.keys(h).reduce((R,l)=>((0,F.isEmpty)(h[l])||(R[l]=h[l]),R),{});return(0,F.isEmpty)(E)||(m[v]={controllers:E}),m},{});var r=f(90201);const n=s=>`/${r.Z}/${s}`;var c=f(82069)}}]);
