(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7364],{3497:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/messaging/add-template",function(){return n(81322)}])},81322:function(e,t,n){"use strict";n.r(t);var s=n(24246),i=n(60136),r=n(11032),a=n(69746),u=n(86677),l=n(43124),d=n(16781),o=n(44444),c=n(12623),p=n(97193),f=n(43073);t.default=()=>{let e=(0,a.pmc)(),t=(0,u.useRouter)(),{templateType:n}=t.query,[h]=(0,c.Vw)(),{data:m,isLoading:x}=(0,o.KC)(n),g=async s=>{var a;let u={is_enabled:s.is_enabled,content:{subject:s.content.subject,body:s.content.body},properties:[]};null===(a=s.properties)||void 0===a||a.forEach(e=>{var t;return null===(t=u.properties)||void 0===t?void 0:t.push(e.id)});let l=await h({templateType:n,template:u});if((0,f.D4)(l)){e((0,d.Vo)((0,i.e$)(l.error)));return}e((0,d.t5)("Messaging template created successfully")),t.push(r.q)};return m?x?(0,s.jsx)(a.$jN,{}):(0,s.jsx)(l.Z,{title:"Configure Message",children:(0,s.jsxs)(a.xuv,{"data-testid":"add-messaging-template",children:[(0,s.jsx)(a.X6q,{marginBottom:2,fontSize:"2xl",children:"Configure message"}),(0,s.jsxs)(a.xuv,{maxWidth:"720px",children:[(0,s.jsx)(a.xvT,{fontSize:"sm",children:"Configure this message"}),(0,s.jsx)(a.xuv,{padding:2,children:(0,s.jsx)(p.Z,{template:m,handleSubmit:g})})]})]})}):null}}},function(e){e.O(0,[3528,9414,2888,9774,179],function(){return e(e.s=3497)}),_N_E=e.O()}]);