(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4046],{10234:function(e,i,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/messaging-providers/[key]",function(){return n(55066)}])},55066:function(e,i,n){"use strict";n.r(i),n.d(i,{default:function(){return h}});var t=n(24246),r=n(86677),s=n(77213),c=n(90980),o=n(77830),d=n(96306),u=n(27378),l=n(17245),a=n(90710),f=n(42478),x=n(10792);let g=e=>{let{configKey:i}=e,{handleError:n}=(0,l.HK)(),{data:r,isLoading:s,error:c}=(0,f.FU)({key:i});if((0,u.useEffect)(()=>{c&&n(c)},[c,n]),s)return(0,t.jsx)(d.xuv,{display:"flex",justifyContent:"center",alignItems:"center",height:"200px",children:(0,t.jsx)(d.$jN,{})});if(!r)return(0,t.jsx)(d.V4A,{children:(0,t.jsxs)(d.xvT,{color:"red.500",children:["Messaging configuration not found for key: ",i]})});let o=r.service_type;return(0,t.jsxs)(d.xuv,{children:[(0,t.jsx)(d.X6q,{fontSize:"2xl",fontWeight:"semibold",mb:6,children:"Edit messaging provider"}),Object.values(a.q).includes(o)?(0,t.jsx)(x.Z,{configKey:i,initialProviderType:o}):(0,t.jsxs)(d.xvT,{color:"red.500",children:["Unsupported service type: ",o]})]})};var h=()=>{let{key:e}=(0,r.useRouter)().query;return e&&"string"==typeof e?(0,t.jsxs)(s.Z,{title:"Edit Messaging Provider - ".concat(e),children:[(0,t.jsx)(c.Z,{backPath:o.AD}),(0,t.jsx)(g,{configKey:e})]}):(0,t.jsxs)(s.Z,{title:"Edit Messaging Provider",children:[(0,t.jsx)(c.Z,{backPath:o.AD}),(0,t.jsx)("div",{children:"Invalid messaging provider key"})]})}}},function(e){e.O(0,[431,8765,9278,3662,9037,502,7158,2888,9774,179],function(){return e(e.s=10234)}),_N_E=e.O()}]);