1/*! For license information please see 7073.342654a8.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[7073],{503(e,t,s){s.d(t,{N:()=>n});var a=s(5043),n=null!==globalThis&&void 0!==globalThis&&globalThis.document?a.useLayoutEffect:()=>{}},516(e,t,s){s.d(t,{A:()=>a});const a=(0,s(7784).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},858(e,t,s){s.d(t,{mK:()=>a});"undefined"===typeof window||!window.document||window.document.createElement;function a(e,t){let{checkForDefaultPrevented:s=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(a){if(null===e||void 0===e||e(a),!1===s||!a.defaultPrevented)return null===t||void 0===t?void 0:t(a)}}},1360(e,t,s){s.d(t,{A:()=>a});const a=(0,s(7784).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])}
2,1654(e,t,s){s.d(t,{d:()=>d});var a=s(9379),n=s(3986),c=s(5043),l=s(7943),r=s(9766),i=s(579);const o=["className"],d=c.forwardRef((e,t)=>{let{className:s}=e,c=(0,n.A)(e,o);return(0,i.jsx)(l.bL,(0,a.A)((0,a.A)({className:(0,r.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s)},c),{},{ref:t,children:(0,i.jsx)(l.zi,{className:(0,r.cn)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}))});d.displayName=l.bL.displayName},1862(e,t,s){s.d(t,{A:()=>d,q:()=>o});var a=s(9379),n=s(3986),c=s(5043),l=s(579);const r=["children"],i=["scope","children"];function o(e,t){const s=c.createContext(t),a=e=>{const{children:t}=e,a=(0,n.A)(e,r),i=c.useMemo(()=>a,Object.values(a));return(0,l.jsx)(s.Provider,{value:i,children:t})};return a.displayName=e+"Provider",[a,function(a){const n=c.useContext(s);if(n)return n;if(void 0!==t)return t;throw new Error("`".concat(a,"` must be used within `").concat(e,"`"))}]}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=[];const r=()=>{const t=s.map(e=>c.createContext(e));return function(s){const n=(null===s||void 0===s?void 0:s[e])||t;return c.useMemo(()=>({["__scope".concat(e)]:(0,a.A)((0,a.A)({},s),{},{[e]:n})}),[s,n])}};return r.scopeName=e,[function(t,a){const r=c.createContext(a),o=s.length;s=[...s,a];const d=t=>{var s;const{scope:a,children:d}=t,u=(0,n.A)(t,i),h=(null===a||void 0===a||null===(s=a[e])||void 0===s?void 0:s[o])||r,m=c.useMemo(()=>u,Object.values(u));return(0,l.jsx)(h.Provider,{value:m,children:d})};return d.displayName=t+"Provider",[d,function(s,n){var l;const i=(null===n||void 0===n||null===(l=n[e])||void 0===l?void 0:l[o])||r,d=c.useContext(i);if(d)return d;if(void 0!==a)return a;throw new Error("`".concat(s,"` must be used within `").concat(t,"`"))}]},u(r,...t)]}function u(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];const n=t[0];if(1===t.length)return n;const l=()=>{const e=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const s=e.reduce((e,s)=>{let{useScope:n,scopeName:c}=s;const l=n(t)["__scope".concat(c)];return(0,a.A)((0,a.A)({},e),l)},{});return c.useMemo(()=>({["__scope".concat(n.scopeName)]:s}),[s])}};return l.scopeName=n.scopeName,l}},3124(e,t,s){s.d(t,{X:()=>c});var a=s(5043),n=s(503);function c(e){const[t,s]=a.useState(void 0);return(0,n.N)(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const a=t[0];let n,c;if("borderBoxSize"in a){const e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,c=t.blockSize}else n=e.offsetWidth,c=e.offsetHeight;s({width:n,height:c})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}s(void 0)},[e]),t}},3168(e,t,s){s.d(t,{Z:()=>n});var a=s(5043);function n(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}},3642(e,t,s){var a;s.d(t,{i:()=>r});var n=s(5043),c=s(503),l=(a||(a=s.t(n,2)))[" useInsertionEffect ".trim().toString()]||c.N;function r(e){let{prop:t,defaultProp:s,onChange:a=()=>{},caller:c}=e;const[r,i,o]=function(e){let{defaultProp:t,onChange:s}=e;const[a,c]=n.useState(t),r=n.useRef(a),i=n.useRef(s);return l(()=>{i.current=s},[s]),n.useEffect(()=>{var e;r.current!==a&&(null===(e=i.current)||void 0===e||e.call(i,a),r.current=a)},[a,r]),[a,c,i]}({defaultProp:s,onChange:a}),d=void 0!==t,u=d?t:r;{const e=n.useRef(void 0!==t);n.useEffect(()=>{const t=e.current;if(t!==d){const e=t?"controlled":"uncontrolled",s=d?"controlled":"uncontrolled";console.warn("".concat(c," is changing from ").concat(e," to ").concat(s,". Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component."))}e.current=d},[d,c])}const h=n.useCallback(e=>{if(d){const a=function(e){return"function"===typeof e}(e)?e(t):e;var s;if(a!==t)null===(s=o.current)||void 0===s||s.call(o,a)}else i(e)},[d,t,i,o]);return[u,h]}Symbol("RADIX:SYNC_STATE")},4259(e,t,s){s.d(t,{A:()=>a});const a=(0,s(7784).A)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]])},5087(e,t,s){s.d(t,{A:()=>a});const a=(0,s(7784).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},5088(e,t,s){s.d(t,{A:()=>a});const a=(0,s(7784).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},5131(e,t,s){s.d(t,{b:()=>u});var a=s(9379),n=s(5043),c=s(3986),l=(s(7950),s(6851)),r=s(579);const i=["asChild"];var o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>
2{const s=(0,l.TL)("Primitive.".concat(t)),o=n.forwardRef((e,n)=>{const{asChild:l}=e,o=(0,c.A)(e,i),d=l?s:t;return"undefined"!==typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,r.jsx)(d,(0,a.A)((0,a.A)({},o),{},{ref:n}))});return o.displayName="Primitive.".concat(t),(0,a.A)((0,a.A)({},e),{},{[t]:o})},{});var d=n.forwardRef((e,t)=>(0,r.jsx)(o.label,(0,a.A)((0,a.A)({},e),{},{ref:t,onMouseDown:t=>{var s;t.target.closest("button, input, select, textarea")||(null===(s=e.onMouseDown)||void 0===s||s.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));d.displayName="Label";var u=d},5711(e,t,s){s.d(t,{A:()=>a});const a=(0,s(7784).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},7073(e,t,s){s.r(t),s.d(t,{default:()=>E});var a=s(9379),n=s(5043),c=s(7089),l=s(3390),r=s(1140),i=s(2264),o=s(3416),d=s(9938),u=s(1654),h=s(6328),m=s(516),p=s(1360),x=s(5746),v=s(5087),f=s(7784);const y=(0,f.A)("mouse-pointer",[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]]),j=(0,f.A)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);var g=s(5327),b=s(5711),N=s(2382),A=s(4259),w=s(5088),k=s(9855),_=s(8693),C=s(579);const S="https://plant4growthuk-production-a1cd.up.railway.app",E=()=>{var e,t,s,f,E;const[q,R]=(0,n.useState)(!0),[M,P]=(0,n.useState)([]),[D,W]=(0,n.useState)(null),[z,T]=(0,n.useState)(null),[B,O]=(0,n.useState)(!1);(0,n.useEffect)(()=>{I()},[]);const I=async()=>{try{const e=localStorage.getItem("elevate360_token"),t=await fetch("".concat(S,"/api/email-sequences/sequences"),{headers:{Authorization:"Bearer ".concat(e)}}),s=await t.json();P(s.sequences||[]);const a=await fetch("".concat(S,"/api/email-sequences/analytics"),{headers:{Authorization:"Bearer ".concat(e)}}),n=await a.json();W(n)}catch(e){console.error("Error fetching data:",e),h.oR.error("Failed to load email sequences")}finally{R(!1)}},L=()=>{P([...M,{isNew:!0,name:"New Email Sequence",trigger:"lead_capture",is_active:!1,emails:[{email_id:"email_1",name:"Welcome Email",subject:"Welcome to Plan 4 Growth!",delay_days:0,body_html:"<h2>Welcome!</h2><p>Thank you for your interest.</p>"}]}]),T(M.length)},Z=(e,t,s)=>{const n=[...M];n[e]=(0,a.A)((0,a.A)({},n[e]),{},{[t]:s}),P(n)},F=(e,t,s,n)=>{const c=[...M];c[e].emails[t]=(0,a.A)((0,a.A)({},c[e].emails[t]),{},{[s]:n}),P(c)};return q?(0,C.jsx)(c.A,{children:(0,C.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,C.jsx)(m.A,{className:"w-8 h-8 animate-spin text-slate-400"})})}):(0,C.jsx)(c.A,{children:(0,C.jsxs)("div",{className:"space-y-6",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("h1",{className:"text-2xl font-bold text-[#0D1B2A]",children:"Email Sequences"}),(0,C.jsx)("p",{className:"text-slate-500",children:"Automate email campaigns for leads and members"})]}),(0,C.jsxs)(l.$,{onClick:L,children:[(0,C.jsx)(p.A,{className:"w-4 h-4 mr-2"}),"New Sequence"]})]}),D&&(0,C.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[(0,C.jsx)(r.Zp,{children:(0,C.jsx)(r.Wu,{className:"pt-4",children:(0,C.jsxs)("div",{className:"flex items-center gap-3",children:[(0,C.jsx)("div",{className:"p-2 bg-blue-100 rounded-lg",children:(0,C.jsx)(x.A,{className:"w-5 h-5 text-blue-600"})}),(0,C.jsxs)("div",{children:[(0,C.jsx)("p",{className:"text-2xl font-bold text-[#0D1B2A]",children:(null===(e=D.summary)||void 0===e?void 0:e.total_sent)||0}),(0,C.jsx)("p",{className:"text-xs text-slate-500",children:"Emails Sent"})]})]})})}),(0,C.jsx)(r.Zp,{children:(0,C.jsx)(r.Wu,{className:"pt-4",children:(0,C.jsxs)("div",{className:"flex items-center gap-3",children:[(0,C.jsx)("div",{className:"p-2 bg-green-100 rounded-lg",children:(0,C.jsx)(v.A,{className:"w-5 h-5 text-green-600"})}),(0,C.jsxs)("div",{children:[(0,C.jsx)("p",{className:"text-2xl font-bold text-[#0D1B2A]",children:(null===(t=D.summary)||void 0===t?void 0:t.total_opened)||0}),(0,C.jsx)("p",{className:"text-xs text-slate-500",children:"Opened"})]})]})})}),(0,C.jsx)(r.Zp,{children:(0,C.jsx)(r.Wu,{className:"pt-4",children:(0,C.jsxs)("div",{className:"flex items-center gap-3",children:[(0,C.jsx)("div",{className:"p-2 bg-purple-100 rounded-lg",children:(0,C.jsx)(y,{className:"w-5 h-5 text-purple-600"})}),(0,C.jsxs)("div",{children:[(0,C.jsx)("p",{className:"text-2xl font-bold text-[#0D1B2A]",children:(null===(s=D.summary)||void 0===s?void 0:s.total_clicked)||0}),(0,C.jsx)("p",{className:"text-xs text-slate-500",children:"Clicked"})]})]})})}),(0,C.jsx)(r.Zp,{children:(0,C.jsx)(r.Wu,{className:"pt-4",children:(0,C.jsxs)("div",{className:"flex items-center gap-3",children:[(0,C.jsx)("div",{className:"p-2 bg-[#41EAD4]/20 rounded-lg",children:(0,C.jsx)(j,{className:"w-5 h-5 text-[#41EAD4]"})}),(0,C.jsxs)("div",{children:[(0,C.jsxs)("p",{className:"text-2xl font-bold text-[#0D1B2A]",children:[(null===(f=D.summary)||void 0===f?void 0:f.open_rate)||0,"%"]}),(0,C.jsx)("p",{className:"text-xs text-slate-500",children:"Open Rate"})]})]})})}),(0,C.jsx)(r.Zp,{children:(0,C.jsx)(r.Wu,{className:"pt-4",children:(0,C.jsxs)("div",{className:"flex items-center gap-3",children:[(0,C.jsx)("div",{className:"p-2 bg-[#D4AF37]/20 rounded-lg",children:(0,C.jsx)(j,{className:"w-5 h-5 text-[#D4AF37]"})}),(0,C.jsxs)("div",{children:[(0,C.jsxs)("p",{className:"text-2xl font-bold text-[#0D1B2A]",children:[(null===(E=D.summary)||void 0===E?void 0:E.
2click_rate)||0,"%"]}),(0,C.jsx)("p",{className:"text-xs text-slate-500",children:"Click Rate"})]})]})})})]}),(0,C.jsx)("div",{className:"space-y-4",children:0===M.length?(0,C.jsx)(r.Zp,{children:(0,C.jsxs)(r.Wu,{className:"py-12 text-center",children:[(0,C.jsx)(g.A,{className:"w-12 h-12 mx-auto mb-4 text-slate-300"}),(0,C.jsx)("h3",{className:"text-lg font-medium text-slate-600 mb-2",children:"No Email Sequences"}),(0,C.jsx)("p",{className:"text-slate-500 mb-4",children:"Create automated email campaigns to engage your leads"}),(0,C.jsxs)(l.$,{onClick:L,children:[(0,C.jsx)(p.A,{className:"w-4 h-4 mr-2"}),"Create First Sequence"]})]})}):M.map((e,t)=>{var s,a;return(0,C.jsxs)(r.Zp,{className:"overflow-hidden",children:[(0,C.jsx)(r.aR,{className:"cursor-pointer hover:bg-slate-50 transition-colors",onClick:()=>T(z===t?null:t),children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-4",children:[(0,C.jsx)("div",{className:"p-2 rounded-lg ".concat(e.is_active?"bg-green-100":"bg-slate-100"),children:(0,C.jsx)(g.A,{className:"w-5 h-5 ".concat(e.is_active?"text-green-600":"text-slate-400")})}),(0,C.jsxs)("div",{children:[(0,C.jsx)(r.ZB,{className:"text-lg",children:e.name}),(0,C.jsxs)(r.BT,{children:["Trigger: ",null===(s=e.trigger)||void 0===s?void 0:s.replace("_"," ")," \u2022 ",(null===(a=e.emails)||void 0===a?void 0:a.length)||0," emails"]})]})]}),(0,C.jsxs)("div",{className:"flex items-center gap-3",children:[(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("span",{className:"text-sm text-slate-500",children:e.is_active?"Active":"Paused"}),(0,C.jsx)(u.d,{checked:e.is_active,onCheckedChange:()=>e.sequence_id&&(async e=>{try{const t=localStorage.getItem("elevate360_token"),s=await fetch("".concat(S,"/api/email-sequences/sequences/").concat(e,"/toggle"),{method:"POST",headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();h.oR.success(e.message),I()}}catch(t){h.oR.error("Failed to toggle sequence")}})(e.sequence_id),onClick:e=>e.stopPropagation()})]}),z===t?(0,C.jsx)(b.A,{className:"w-5 h-5 text-slate-400"}):(0,C.jsx)(N.A,{className:"w-5 h-5 text-slate-400"})]})]})}),z===t&&(0,C.jsxs)(r.Wu,{className:"border-t bg-slate-50 space-y-6 pt-6",children:[(0,C.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)(d.J,{children:"Sequence Name"}),(0,C.jsx)(i.p,{value:e.name,onChange:e=>Z(t,"name",e.target.value),placeholder:"Lead Welcome Sequence"})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)(d.J,{children:"Trigger"}),(0,C.jsxs)("select",{className:"w-full h-10 px-3 rounded-md border border-slate-200 bg-white",value:e.trigger,onChange:e=>Z(t,"trigger",e.target.value),children:[(0,C.jsx)("option",{value:"lead_capture",children:"Lead Capture (Exit Intent)"}),(0,C.jsx)("option",{value:"registration",children:"User Registration"}),(0,C.jsx)("option",{value:"enrollment",children:"Course Enrollment"}),(0,C.jsx)("option",{value:"course_completion",children:"Course Completion"})]})]})]}),(0,C.jsxs)("div",{className:"space-y-4",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsx)(d.J,{className:"text-base font-semibold",children:"Emails in Sequence"}),(0,C.jsxs)(l.$,{variant:"outline",size:"sm",onClick:()=>(e=>{var t;const s=[...M],a=s[e],n=((null===(t=a.emails)||void 0===t?void 0:t.length)||0)+1;a.emails=[...a.emails||[],{email_id:"email_".concat(n),name:"Email ".concat(n),subject:"",delay_days:n-1,body_html:""}],P(s)})(t),children:[(0,C.jsx)(p.A,{className:"w-4 h-4 mr-1"})," Add Email"]})]}),(e.emails||[]).map((s,a)=>{var n;return(0,C.jsx)(r.Zp,{className:"bg-white",children:(0,C.jsxs)(r.Wu,{className:"pt-4 space-y-4",children:[(0,C.jsxs)("div",{className:"flex items-start justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)(A.A,{className:"w-4 h-4 text-slate-400"}),(0,C.jsx)("div",{className:"w-8 h-8 bg-[#41EAD4] rounded-full flex items-center justify-center text-white font-bold text-sm",children:a+1}),(0,C.jsxs)("div",{children:[(0,C.jsx)("p",{className:"font-medium text-sm",children:s.name||"Email ".concat(a+1)}),(0,C.jsxs)("p",{className:"text-xs text-slate-500 flex items-center gap-1",children:[(0,C.jsx)(w.A,{className:"w-3 h-3"}),0===s.delay_days?"Immediately":"After ".concat(s.delay_days," day").concat(s.delay_days>1?"s":"")]})]})]}),(0,C.jsx)(l.$,{variant:"ghost",size:"icon",onClick:()=>((e,t)=>{const s=[...M];s[e].emails=s[e].emails.filter((e,s)=>s!==t),P(s)})(t,a),disabled:(null===(n=e.emails)||void 0===n?void 0:n.length)<=1,children:(0,C.jsx)(k.A,{className:"w-4 h-4 text-red-500"})})]}),(0,C.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,C.jsxs)("div",{className:"space-y-1",children:[(0,C.jsx)(d.J,{children:"Email Name"}),(0,C.jsx)(i.p,{value:s.name||"",onChange:e=>F(t,a,"name",e.target.value),placeholder:"Welcome Email"})]}),(0,C.jsxs)("div",{className:"space-y-1",children:[(0,C.jsx)(d.J,{children:"Subject Line"}),(0,C.jsx)(i.p,{value:s.subject||"",onChange:e=>F(t,a,"subject",e.target.value),placeholder:"Welcome to Plan 4 Growth!"})]}),(0,C.jsxs)("div",{className:"space-y-1",children:[(0,C.jsx)(d.J,{children:"Send After (days)"}),(0,C.jsx)(i.p,{type:"number",min:"0",value:s.delay_days||0,onChange:e=>F(t,a,"delay_days",parseInt(e.target.value))})]})]}),(0,C.jsxs)("div",{className:"space-y-1",children:[(0,C.jsx)(d.J,{children:"Email Body (HTML)"}),(0,C.jsx)(o.T,{value:s.body_html||"",onChange:e=>F(t,a,"body_html",e.target.value),placeholder:"<h2>Welcome!</h2><p>Thank you for joining...</p>",rows:4,className:"font-mono text-sm"}),(0,C.jsxs)("p",{className:"text-xs text-slate-500",children:["Use ","{{name}}",", ","{{email}}",", ","{{site_url}}"," as placeholders"]})]})]})},s.email_id||a)})]}),(0,C.jsxs)("div",{className:"flex items-center gap-3 pt-4 border-t",children:[(0,C.jsxs)(l.$,{onClick:()=>(async e=>{O(!0);try{const t=localStorage.getItem("elevate360_token"),s=!e.sequence_id||e.isNew,a=s?"".concat(S,"/api/email-sequences/sequences"):"".concat(S,"/api/email-sequences/sequences/").concat(e.sequence_id);if(!(await fetch(a,{method:s?"POST":"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(e)})).ok)throw new Error("Failed to save");h.oR.success("Sequence saved!"),I()}catch(t){h.oR.error("Failed to save sequence")}finally{O(!1)}})(e),disabled:B,children:[(0,C.jsx)(_.A,{className:"w-4 h-4 mr-2"}),B?"Saving...":"Save Sequence"]}),e.sequence_id&&(0,C.jsxs)(l.$,{variant:"outline",className:"text-red-600 hover:bg-red-50",onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete this sequence?"))try{const t=localStorage.getItem("elevate360_token");(await fetch("".concat(S,"/api/email-sequences/sequences/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}})).ok&&(h.oR.success("Sequence deleted"),I())}catch(t){h.oR.error("Failed to delete sequence")}})(e.sequence_id),children:[(0,C.jsx)(k.A,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]},e.sequence_id||t)})})]})})}}
2,7914(e,t,s){s.d(t,{sG:()=>v,hO:()=>f});var a=s(9379),n=s(3986),c=s(5043),l=s(7950),r=s(2814),i=s(579);const o=["children"],d=["children"];function u(e){const t=h(e),s=c.forwardRef((e,s)=>{const{children:l}=e,r=(0,n.A)(e,o),d=c.Children.toArray(l),u=d.find(p);if(u){const e=u.props.children,n=d.map(t=>t===u?c.Children.count(e)>1?c.Children.only(null):c.isValidElement(e)?e.props.children:null:t);return(0,i.jsx)(t,(0,a.A)((0,a.A)({},r),{},{ref:s,children:c.isValidElement(e)?c.cloneElement(e,void 0,n):null}))}return(0,i.jsx)(t,(0,a.A)((0,a.A)({},r),{},{ref:s,children:l}))});return s.displayName="".concat(e,".Slot"),s}function h(e){const t=c.forwardRef((e,t)=>{const{children:s}=e,l=(0,n.A)(e,d);if(c.isValidElement(s)){const e=function(e){var t,s;let a=null===(t=Object.getOwnPropertyDescriptor(e.props,"ref"))||void 0===t?void 0:t.get,n=a&&"isReactWarning"in a&&a.isReactWarning;if(n)return e.ref;if(a=null===(s=Object.getOwnPropertyDescriptor(e,"ref"))||void 0===s?void 0:s.get,n=a&&"isReactWarning"in a&&a.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(s),n=function(e,t){const s=(0,a.A)({},t);for(const n in t){const c=e[n],l=t[n];/^on[A-Z]/.test(n)?c&&l?s[n]=function(){const e=l(...arguments);return c(...arguments),e}:c&&(s[n]=c):"style"===n?s[n]=(0,a.A)((0,a.A)({},c),l):"className"===n&&(s[n]=[c,l].filter(Boolean).join(" "))}return(0,a.A)((0,a.A)({},e),s)}(l,s.props);return s.type!==c.Fragment&&(n.ref=t?(0,r.t)(t,e):e),c.cloneElement(s,n)}return c.Children.count(s)>1?c.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}var m=Symbol("radix.slottable");function p(e){return c.isValidElement(e)&&"function"===typeof e.type&&"__radixId"in e.type&&e.type.__radixId===m}const x=["asChild"];var v=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const s=u("Primitive.".concat(t)),l=c.forwardRef((e,c)=>{const{asChild:l}=e,r=(0,n.A)(e,x),o=l?s:t;return"undefined"!==typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(o,(0,a.A)((0,a.A)({},r),{},{ref:c}))});return l.displayName="Primitive.".concat(t),(0,a.A)((0,a.A)({},e),{},{[t]:l})},{});function f(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))}},7943(e,t,s){s.d(t,{bL:()=>C,zi:()=>S});var a=s(9379),n=s(3986),c=s(5043),l=s(858),r=s(2814),i=s(1862),o=s(3642),d=s(3168),u=s(3124),h=s(7914),m=s(579);const p=["__scopeSwitch","name","checked","defaultChecked","required","disabled","value","onCheckedChange","form"],x=["__scopeSwitch"],v=["__scopeSwitch","control","checked","bubbles"];var f="Switch",[y,j]=(0,i.A)(f),[g,b]=y(f),N=c.forwardRef((e,t)=>{const{__scopeSwitch:s,name:i,checked:d,defaultChecked:u,required:x,disabled:v,value:y="on",onCheckedChange:j,form:b}=e,N=(0,n.A)(e,p),[A,w]=c.useState(null),C=(0,r.s)(t,e=>w(e)),S=c.useRef(!1),E=!A||(b||!!A.closest("form")),[q,R]=(0,o.i)({prop:d,defaultProp:null!==u&&void 0!==u&&u,onChange:j,caller:f});return(0,m.jsxs)(g,{scope:s,checked:q,disabled:v,children:[(0,m.jsx)(h.sG.button,(0,a.A)((0,a.A)({type:"button",role:"switch","aria-checked":q,"aria-required":x,"data-state":_(q),"data-disabled":v?"":void 0,disabled:v,value:y},N),{},{ref:C,onClick:(0,l.mK)(e.onClick,e=>{R(e=>!e),E&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})})),E&&(0,m.jsx)(k,{control:A,bubbles:!S.current,name:i,value:y,checked:q,required:x,disabled:v,form:b,style:{transform:"translateX(-100%)"}})]})});N.displayName=f;var A="SwitchThumb",w=c.forwardRef((e,t)=>{const{__scopeSwitch:s}=e,c=(0,n.A)(e,x),l=b(A,s);return(0,m.jsx)(h.sG.span,(0,a.A)((0,a.A)({"data-state":_(l.checked),"data-disabled":l.disabled?"":void 0},c),{},{ref:t}))});w.displayName=A;var k=c.forwardRef((e,t)=>{let{__scopeSwitch:s,control:l,checked:i,bubbles:o=!0}=e,h=(0,n.A)(e,v);const p=c.useRef(null),x=(0,r.s)(p,t),f=(0,d.Z)(i),y=(0,u.X)(l);return c.useEffect(()=>{const e=p.current;if(!e)return;const t=window.HTMLInputElement.prototype,s=Object.getOwnPropertyDescriptor(t,"checked").set;if(f!==i&&s){const t=new Event("click",{bubbles:o});s.call(e,i),e.dispatchEvent(t)}},[f,i,o]),(0,m.jsx)("input",(0,a.A)((0,a.A)({type:"checkbox","aria-hidden":!0,defaultChecked:i},h),{},{tabIndex:-1,ref:x,style:(0,a.A)((0,a.A)((0,a.A)({},h.style),y),{},{position:"absolute",pointerEvents:"none",opacity:0,margin:0})}
2))});function _(e){return e?"checked":"unchecked"}k.displayName="SwitchBubbleInput";var C=N,S=w},8693(e,t,s){s.d(t,{A:()=>a});const a=(0,s(7784).A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},9855(e,t,s){s.d(t,{A:()=>a});const a=(0,s(7784).A)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},9938(e,t,s){s.d(t,{J:()=>h});var a=s(9379),n=s(3986),c=s(5043),l=s(5131),r=s(917),i=s(9766),o=s(579);const d=["className"],u=(0,r.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),h=c.forwardRef((e,t)=>{let{className:s}=e,c=(0,n.A)(e,d);return(0,o.jsx)(l.b,(0,a.A)({ref:t,className:(0,i.cn)(u(),s)},c))});h.displayName=l.b.displayName}}]); 3//# sourceMappingURL=7073.342654a8.chunk.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.