PageSourceSearch

https://careers.helmetstohardhats.org/_next/static/chunks/pages/admin/email-templates-034553321febe173.js

js helmetstohardhats.org collected 2026-09-24 10:25:21 UTC 4,578 bytes, 2 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="262c7005-a842-4c9a-9e40-e35561e052a2",e._sentryDebugIdIdentifier="sentry-dbid-262c7005-a842-4c9a-9e40-e35561e052a2")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[70],{43075:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/email-templates",function(){return s(44433)}])},44433:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>j});var n=s(37876),l=s(14232),a=s(45300),r=s(42556),i=s(5298),d=s(64392),m=s(58667),c=s(34349),o=s(12124),u=s(54550),h=s(29693),p=s(19264);let j=e=>{let{templateVars:t,user:s}=e,[j,x]=(0,l.useState)(t.templates);(0,l.useEffect)(()=>{x(t.templates)},[t.templates]);let[f,g]=(0,l.useState)(!1),[b,v]=(0,l.useState)(!1),y=(0,h.o)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.mc,{style:{marginTop:2*m.gutterWidth},children:(0,n.jsx)(r.fI,{children:(0,n.jsx)(r.VP,{xs:"100%",lg:"66%",children:(0,n.jsxs)("h2",{children:["Email Templates",(0,n.jsx)("h6",{children:(0,n.jsxs)(c.A,{small:!0,onClick:()=>g({}),children:[(0,n.jsx)("i",{className:"fas fa-plus"}),"\xa0 Add Template"]})})]})})})}),(0,n.jsx)(r.mc,{style:{marginTop:m.gutterWidth},children:(0,n.jsx)(a.A,{children:(0,n.jsx)(i.A,{noResults:"No results",noQuery:"No results",templateVars:t,items:j,itemComponent:e=>{let[t,s]=(0,l.useState)(!1),[a,r]=(0,l.useState)(!1),i=(0,p.z2)("/admin/email-templates/".concat(e.id));return((0,l.useEffect)(()=>{i.response&&r(!0),i.error&&y("error",i.error)},[i.response,i.error]),a)?(0,n.jsx)(d.A,{id:e.id,title:"Deleted",subtitle:e.name}):(0,n.jsx)(d.A,{id:e.id,title:e.name,subtitle:e.subject,extra:[(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(c.A,{small:!0,onClick:()=>v(e),children:"Edit"},"editbutton")}),(0,n.jsx)(n.Fragment,{children:"\xa0"}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.A,{small:!0,onClick:e=>{e.preventDefault(),t||s(!0),t&&i.send({body:{}})},children:t?"Really Delete?":"Delete"}),","]})]})}})})}),f&&(0,n.jsx)(o.A,{onClickOutside:()=>g(!1),children:(0,n.jsx)(u.A,{themeFetcher:t.themeFetcher,isAdmin:s.isAdmin,template:f,onCancel:()=>g(!1),onSave:e=>{y("success","Saved new template: ".concat(e.name)),g(!1)}})}),b&&(0,n.jsx)(o.A,{onClickOutside:()=>v(!1),children:(0,n.jsx)(u.A,{themeFetcher:t.themeFetcher,isAdmin:s.isAdmin,template:b,onCancel:()=>v(!1),onSave:e=>{y("success","Edited template: ".concat(e.name)),v(!1);let t=j.find(t=>{let{id:s}=t;return s===e.id});t&&(t.name=e.name,t.subject=e.subject,t.html=e.html,x([...j]))}})})]})}},54550:(e,t,s)=>{"use strict";s.d(t,{A:()=>u});var n=s(37876),l=s(14232),a=s(34349),r=s(22127),i=s(58667),d=s(42556),m=s(19264),c=s(29693),o=s(54067);let u=e=>{var t;let s=!(null==(t=e.template)?void 0:t.id),[u,h]=(0,l.useState)(e.template||{}),p=(0,c.o)(),j=(s?m.YK:m.do)(s?"/admin/email-templates":"/admin/email-templates/".concat(u.id)),x=(0,l.useMemo)(()=>(0,o.rM)(e.themeFetcher,"label"),[]);(0,l.useEffect)(()=>{j.response&&h(j.response.template)},[j.response]);let f=e=>{let t=e.target.value,s=e.target.name;h({...u,[s]:t})};return(0,l.useEffect)(()=>{j.response&&e.onSave(j.response.template),j.error&&p("error",j.error)},[j.response,j.error]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(d.mc,{children:(0,n.jsx)(d.fI,{children:(0,n.jsxs)(d.VP,{children:[(0,n.jsx)("h4",{children:s?"New Template":"Edit Template"}),(0,n.jsxs)(r.lV,{onSubmit:e=>{e.preventDefault(),j.send({body:{template:u}})},children:[(0,n.jsx)(r.JU,{children:"Template Name"}),(0,n.jsx)(r.pd,{name:"name",value:u.name||"",onChange:f}),(0,n.jsx)(r.JU,{children:"Email Subject"}),(0,n.jsx)(r.pd,{name:"subject",value:u.subject||"",onChange:f}),(0,n.jsx)(r.JU,{children:"Email Body"}),(0,n.jsx)(r.dS,{setContent:e=>{f({target:{name:"html",value:e}})},content:u.html}),e.isAdmin&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.JU,{children:"Theme"}),(0,n.jsx)(r.l6,{name:"theme",onChange:e=>{var t;f({target:{name:"theme",value:null==(t=e[0])?void 0:t.value}})},default:{value:u.theme||""},fetch:x})]}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginTop:i.gutterWidth},children:[(0,n.jsx)(a.A,{small:!0,disabled:j.isLoading,type:"submit",children:"Save"}),(0,n.jsx)(a.A,{small:!0,neutral:!0,onClick:t=>{t.preventDefault(),e.onCancel()},children:"Cancel"})]})]})]})})})})}}},e=>{e.O(0,[5838,2127,636,6593,8792],()=>e(e.s=43075)),_N_E=e.O()}]);
2//# sourceMappingURL=email-templates-034553321febe173.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.