PageSourceSearch

https://app2.sked.life/assets/html-templates.page-DukN1tpG.js

js sked.life collected 2026-09-25 00:01:51 UTC 4,066 bytes, 1 lines download raw bytes

1import{u as L,r as l,j as e,G as P,H as b,al as v,M as z,cy as u,cc as N}from"./index-4ng2XTnA.js";import{A as M}from"./Add-Dse8OIWe.js";import{E as R}from"./Edit-B0e9vEuE.js";import{T as G}from"./Delete-MiIL4XdO.js";import{T as O,H as w,B as j}from"./TableContainer.component-BPCWxmiG.js";import{C as W}from"./ConfirmationDialog.component-CTYnSik4.js";import{B as _}from"./backdropLoading.component-MJUQa-gg.js";import{I as $}from"./Input.component-CPVwgqMM.js";import q from"./EmailBuilder.component-DWnfVjQz.js";import{p as F,e as J,l as K,s as Q,d as U}from"./htmlTemplates-DoX28_OJ.js";import{a as V,o as X,l as Y,b as Z}from"./placeholders-CqXkBy5J.js";import{T as ee}from"./TableHead-MSrR7fh-.js";import{a as g,T as te}from"./TableRow-D4ufOvb2.js";import"./RadioButtonUnchecked-D8ULpBtf.js";import"./PartialChecked.icon-CnUB2hmO.js";import"./Checkbox-C2SsTmJY.js";import"./ChevronLeft-BuOEyZ_L.js";import"./ChevronRight-CWmp6BsF.js";import"./KeyboardArrowDown-CzpkpEHj.js";import"./SidebarFolders.component-CIg9FG2w.js";import"./promise.hook-wd1IaplE.js";import"./ListItem-C9hh78RL.js";import"./join-BC1qQDoa.js";import"./inputAdornmentClasses-KKEdjY5_.js";import"./emoji-DFL37z3U.js";import"./index-DVzbJhhH.js";import"./Google-rJkmPiu6.js";import"./ImageUpload.component-CU6aMqtA.js";import"./Lock-B_3B4OXl.js";import"./components.component-DzCA2l2V.js";import"./Tabs-DnD1Lhjq.js";import"./fromPairs-OpLZi5q5.js";const ae=[{title:"Contact",placeholders:V},{title:"Office",placeholders:X},{title:"Locations",placeholders:Y},{title:"Appointment",placeholders:Z}],Ne=()=>{const o=L(),[y,p]=l.useState([]),[T,C]=l.useState(!1),[S,E]=l.useState(!1),[a,h]=l.useState(null),[n,r]=l.useState(""),[f,m]=l.useState(""),[s,x]=l.useState(null),B=async()=>{C(!0);try{p(await K())}catch{o(u("Could not load templates."))}finally{C(!1)}};l.useEffect(()=>{B()},[]);const k=()=>{h({id:"",name:"",html:""}),r(""),m("")},A=t=>{h(t),r(t.name),m(t.html)},H=()=>{h(null),r(""),m("")},D=async()=>{if(n.trim()){E(!0);try{const t=await Q(n.trim(),f,(a==null?void 0:a.id)||void 0);p(i=>i.some(d=>d.id===t.id)?i.map(d=>d.id===t.id?t:d):[...i,t]),o(N("Template saved.")),H()}catch{o(u("Could not save template."))}finally{E(!1)}}},I=async()=>{if(s)try{await U(s.id),p(t=>t.filter(i=>i.id!==s.id))}catch{o(u("Could not delete template."))}finally{x(null)}},c=a?F(f):null;return e.jsxs("div",{style:{padding:16,paddingBottom:75},children:[e.jsx(_,{loading:T}),e.jsxs(P,{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:2,children:[e.jsx("h2",{style:{margin:0},children:"HTML Templates"}),e.jsx(b,{title:"New template",Icon:M,color:"primary",onClick:k})]}),e.jsxs(O,{children:[e.jsx(ee,{children:e.jsxs(g,{children:[e.jsx(w,{children:"Name"}),e.jsx(w,{minWidth:100,style:{textAlign:"right"},children:"Actions"})]})}),e.jsxs(te,{children:[y.map(t=>e.jsxs(g,{children:[e.jsx(j,{children:t.name}),e.jsxs(j,{style:{textAlign:"right",whiteSpace:"nowrap"},children:[e.jsx(v,{size:"small",onClick:()=>A(t),children:e.jsx(R,{fontSize:"small"})}),e.jsx(v,{size:"small",onClick:()=>x(t),children:e.jsx(G,{fontSize:"small"})})]})]},t.id)),!T&&!y.length&&e.jsx(g,{children:e.jsx(j,{colSpan:2,style:{textAlign:"center",color:"#919194",padding:24},children:"No templates yet. Click “New template” to build one."})})]})]}),e.jsx(z,{size:"lg",open:!!a,onClose:H,title:a!=null&&a.id?"Edit template":"New template",leftComponents:[e.jsx($,{placeholder:"Template name",value:n,onChange:t=>r(t.target.value),sx:{width:280}},"name")],buttons:[e.jsx(b,{title:S?"Saving…":"Save",color:"primary",disabled:!n.trim()||S,onClick:D},"save")],children:a&&e.jsx(l.Suspense,{fallback:e.jsx("div",{style:{padding:16,fontSize:14},children:"Loading email builder…"}),children:e.jsx(q,{initialDesign:c==null?void 0:c.design,initialHtml:c?void 0:J(f),onChange:m,placeholders:ae},a.id||"new")})}),e.jsx(W,{open:!!s,title:"Delete template",text:`Delete “${s==null?void 0:s.name}”? This cannot be undone.`,confirmText:"Delete",confirm:I,cancel:()=>x(null)})]})};export{Ne as default};

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.