(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),r=n(60136),i=n(87162),u=n(96013),a=n(86677),l=n(43124),c=n(37541),d=n(16781),o=n(73088),p=n(44444),h=n(12623),_=n(97193),f=n(43073);t.default=()=>{let e=(0,u.pmc)(),t=(0,a.useRouter)(),{templateType:n}=t.query,[g]=(0,h.Vw)(),{data:b,isLoading:m}=(0,p.KC)(n),x=async s=>{var u;let a={is_enabled:s.is_enabled,content:{subject:s.content.subject,body:s.content.body},properties:[]};null===(u=s.properties)||void 0===u||u.forEach(e=>{var t;return null===(t=a.properties)||void 0===t?void 0:t.push(e.id)});let l=await g({templateType:n,template:a});if((0,f.D4)(l)){e((0,d.Vo)((0,r.e$)(l.error)));return}e((0,d.t5)("Messaging template created successfully")),t.push(i.q)};return b?m?(0,s.jsx)(u.$jN,{}):(0,s.jsx)(l.Z,{title:"Configure Message",children:(0,s.jsx)(c.Z,{heading:"Messaging",breadcrumbItems:[{title:"Messaging",href:i.q},{title:"".concat(o.Z[b.type])}],children:(0,s.jsx)(u.xuv,{maxWidth:"720px",children:(0,s.jsx)(u.xuv,{padding:2,children:(0,s.jsx)(_.Z,{template:b,handleSubmit:x})})})})}):null}}},function(e){e.O(0,[3528,2973,2888,9774,179],function(){return e(e.s=3497)}),_N_E=e.O()}]);