PageSourceSearch

https://bakedbot.ai/_next/static/chunks/2883-7e629e6091799963.js

js bakedbot.ai collected 2026-10-05 11:51:11 UTC 27,500 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2883],{2665:(e,t,s)=>{s.d(t,{P:()=>a});var r=s(95155);function a({subject:e,preheader:t,body:s,senderName:l="Your brand",className:d=""}){let i=function(e,t){let s=e?.trim();if(s)return s;let r=(t??"").replace(/\s+/g," ").trim();return r?r.slice(0,110):"Add a preview line to control what inboxes show under the subject."}(t,s);return(0,r.jsxs)("div",{className:`rounded-lg border bg-muted/20 p-3 ${d}`.trim(),children:[(0,r.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Inbox Preview"}),(0,r.jsx)("div",{className:"mt-2 rounded-md border bg-background px-3 py-2",children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"truncate text-sm font-medium",children:l}),(0,r.jsx)("p",{className:"truncate text-sm font-semibold",children:e?.trim()||"Your email subject will appear here"}),(0,r.jsx)("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:i})]}),(0,r.jsx)("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:"Now"})]})})]})}},8986:(e,t,s)=>{s.d(t,{s:()=>a});var r=s(9339);let a=(0,r.createServerReference)("40fb0974bfeb0cd35e88134eea79df1a08b3e33676",r.callServer,void 0,r.findSourceMapURL,"getCampaignProductRecommendations")},9192:(e,t,s)=>{s.d(t,{S:()=>n});var r=s(95155),a=s(12115),l=s(47279),d=s(94514),i=s(40980);let n=a.forwardRef(({className:e,...t},s)=>(0,r.jsx)(l.bL,{ref:s,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:(0,r.jsx)(l.C1,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,r.jsx)(d.A,{className:"h-4 w-4"})})}));n.displayName=l.bL.displayName},9399:(e,t,s)=>{s.d(t,{z:()=>a});var r=s(9339);let a=(0,r.createServerReference)("4090d1432643e7596d907536c6a3ce368ce9245c6f",r.callServer,void 0,r.findSourceMapURL,"getCampaignSendTimeRecommendation")},18349:(e,t,s)=>{s.d(t,{T:()=>d});var r=s(95155),a=s(12115),l=s(40980);let d=a.forwardRef(({className:e,...t},s)=>(0,r.jsx)("textarea",{className:(0,l.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...t}));d.displayName="Textarea"},29991:(e,t,s)=>{s.d(t,{bq:()=>u,eb:()=>h,gC:()=>x,l6:()=>o,yv:()=>m});var r=s(95155),a=s(12115),l=s(42695),d=s(66088),i=s(9921),n=s(94514),c=s(40980);let o=l.bL;l.YJ;let m=l.WT,u=a.forwardRef(({className:e,children:t,...s},a)=>(0,r.jsxs)(l.l9,{ref:a,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...s,children:[t,(0,r.jsx)(l.In,{asChild:!0,children:(0,r.jsx)(d.A,{className:"h-4 w-4 opacity-50"})})]}));u.displayName=l.l9.displayName;let p=a.forwardRef(({className:e,...t},s)=>(0,r.jsx)(l.PP,{ref:s,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,r.jsx)(i.A,{className:"h-4 w-4"})}));p.displayName=l.PP.displayName;let f=a.forwardRef(({className:e,...t},s)=>(0,r.jsx)(l.wn,{ref:s,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,r.jsx)(d.A,{className:"h-4 w-4"})}));f.displayName=l.wn.displayName;let x=a.forwardRef(({className:e,children:t,position:s="popper",...a},d)=>(0,r.jsx)(l.ZL,{children:(0,r.jsxs)(l.UC,{ref:d,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,...a,children:[(0,r.jsx)(p,{}),(0,r.jsx)(l.LM,{className:(0,c.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),(0,r.jsx)(f,{})]})}));x.displayName=l.UC.displayName,a.forwardRef(({className:e,...t},s)=>(0,r.jsx)(l.JU,{ref:s,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t})).displayName=l.JU.displayName;let h=a.forwardRef(({className:e,children:t,...s},a)=>(0,r.jsxs)(l.q7,{ref:a,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(l.VF,{children:(0,r.jsx)(n.A,{className:"h-4 w-4"})})}),(0,r.jsx)(l.p4,{children:t})]}));h.displayName=l.q7.displayName,a.forwardRef(({className:e,...t},s)=>(0,r.jsx)(l.wv,{ref:s,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",e),...t})).displayName=l.wv.displayName},33807:(e,t,s)=>{s.d(t,{J:()=>c});var r=s(95155),a=s(12115),l=s(91760),d=s(18460),i=s(40980);let n=(0,d.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=a.forwardRef(({className:e,...t},s)=>(0,r.jsx)(l.b,{ref:s,className:(0,i.cn)(n(),e),...t}));c.displayName=l.b.displayName},48435:(e,t,s)=>{s.d(t,{s:()=>a});var r=s(9339);let a=(0,r.createServerReference)("004ce5f729f6c5a2098ab774f8bc9729bbfd4ef7b0",r.callServer,void 0,r.findSourceMapURL,"getCampaignContentModulePresets")},60529:(e,t,s)=>{s.d(t,{p:()=>d});var r=s(95155),a=s(12115),l=s(40980);let d=a.forwardRef(({className:e,type:t,...s},a)=>(0,r.jsx)("input",{type:t,className:(0,l.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...s}));d.displayName="Input"},76594:(e,t,s)=>{s.d(t,{IT:()=>w,nE:()=>k});var r=s(95155),a=s(12115),l=s(15283),d=s(45160),i=s(89239),n=s(81477),c=s(9192),o=s(42763),m=s(60529),u=s(33807),p=s(18349),f=s(92289),x=s(24642),h=s(44071),g=s(6296),j=s(14341),v=s(49387);function b(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function N(e,t){let s=e.findIndex(e=>e.id===t.id);return -1===s?[...e,t]:e.map((e,r)=>r===s?t:e)}function y(e,t){if("offer"===e.type){let t=[e.details.trim()];return e.offerCode?.trim()&&t.push(`Code: ${e.offerCode.trim()}`),e.ctaLabel?.trim()&&e.ctaUrl?.trim()&&t.push(`CTA: ${e.ctaLabel.trim()}`),t.push(`Disclaimer: ${e.disclaimer.trim()}`),t.join("\n")}let s=e.productIds?.length?e.productIds.filter(e=>t.some(t=>t.productId===e)).length:t.length,r=e.productIds?.length?`${s} selected featured product${1===s?"":"s"}`:`Uses all ${t.length} featured product${1===t.length?"":"s"}`;return[e.intro?.trim(),r].filter(Boolean).join("\n")}function w({blocks:e,featuredProducts:t,readOnly:s=!1,lockMessage:c,saving:v=!1,error:k,presets:A=[],presetsLoading:$=!1,onChange:P,onSavePreset:I}){let[R,L]=(0,a.useState)(!1),[F,M]=(0,a.useState)(!1),[U,E]=(0,a.useState)(null),[O,J]=(0,a.useState)(null),[z,q]=(0,a.useState)(!1),[_,D]=(0,a.useState)(null),[B,G]=(0,a.useState)(""),[Y,Z]=(0,a.useState)(""),[H,W]=(0,a.useState)(""),[V,K]=(0,a.useState)(!1),Q=!s&&"function"==typeof P,X=Q&&"function"==typeof I;function ee(e){E(e),L(!0)}function et(e){J(e),M(!0)}async function es(e){return!P||!1!==await P(e)}async function er(t){await es(e.filter(e=>e.id!==t))}async function ea(t){await es(N(e,t))&&(L(!1),E(null))}async function el(t){await es(N(e,t))&&(M(!1),J(null))}function ed(e){D(e),G(e.title),Z(""),W(""),q(!0)}async function ei(t){var s;let r="offer"===(s=t.block).type?{...s,id:b("offer")}:{...s,id:b("products"),...s.productIds?{productIds:[...s.productIds]}:{}};await es([...e,r])}async function en(){if(!_||!I)return;let e=B.trim();if(!e)return void W("Preset name is required.");K(!0),W("");try{let t=await I({name:e,description:Y.trim()||void 0,block:_});if(!1===t)return void W("This module could not be saved as a preset.");q(!1),D(null)}finally{K(!1)}}return(0,r.jsxs)(n.Zp,{children:[(0,r.jsx)(n.aR,{children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)(n.ZB,{className:"flex items-center gap-2",children:[(0,r.jsx)(f.A,{className:"h-4 w-4"}),"Content Modules"]}),(0,r.jsx)(n.BT,{className:"mt-1",children:"Add reusable offer and product sections inside the branded email template. These modules are saved with campaign templates."}),s&&c&&(0,r.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:c})]}),Q&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsxs)(i.$,{variant:"outline",size:"sm",onClick:function(){J({id:b("products"),type:"featured_products",title:"Featured products",intro:"Shop the highlights from this campaign.",productIds:t.map(e=>e.productId)}),M(!0)},disabled:v||0===t.length,title:0===t.length?"Add featured products first to create a product module.":void 0,children:[(0,r.jsx)(x.A,{className:"h-3.5 w-3.5 mr-2"}),"Add Product Module"]}),(0,r.jsxs)(i.$,{variant:"outline",size:"sm",onClick:function(){E({id:b("offer"),type:"offer",title:"Featured offer",details:"Highlight the deal, who it is for, and why it matters right now.",disclaimer:"For adults 21 and over. Terms apply while supplies last."}),L(!0)},disabled:v,children:[(0,r.jsx)(h.A,{className:"h-3.5 w-3.5 mr-2"}),"Add Offer Module"]})]})]})}),(0,r.jsxs)(n.Wu,{className:"space-y-3",children:[(k||H)&&(0,r.jsx)(l.Fc,{variant:"destructive",children:(0,r.jsx)(l.TN,{children:k||H})}),$&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,r.jsx)(g.A,{className:"h-4 w-4 animate-spin"}),"Loading saved module presets"]}
1),A.length>0&&(0,r.jsxs)("div",{className:"space-y-2 rounded-lg border bg-muted/20 p-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(j.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm font-medium",children:"Saved Module Presets"})]}),(0,r.jsx)("div",{className:"space-y-2",children:A.map(e=>{let s="featured_products"===e.block.type&&0===t.length;return(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3 rounded-md border bg-background px-3 py-2",children:[(0,r.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(d.E,{variant:"outline",className:"text-[11px]",children:"offer"===e.block.type?"Offer":"Products"}),(0,r.jsx)("p",{className:"text-sm font-medium",children:e.name})]}),e.description&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description}),(0,r.jsx)("p",{className:"text-xs whitespace-pre-line text-muted-foreground",children:y(e.block,t)})]}),Q&&(0,r.jsx)(i.$,{variant:"outline",size:"sm",disabled:v||s,title:s?"Add featured products first to apply a product preset.":void 0,onClick:()=>void ei(e),children:"Apply"})]},e.id)})})]}),0===t.length&&Q&&(0,r.jsx)(l.Fc,{children:(0,r.jsx)(l.TN,{children:"Add featured products first if you want to insert a product module into the email."})}),0===e.length?(0,r.jsx)("div",{className:"rounded-lg border border-dashed p-4 text-sm text-muted-foreground",children:"No structured modules yet. Use product modules for curated item callouts or offer modules for coupons, terms, and compliant CTA copy."}):(0,r.jsx)("div",{className:"space-y-3",children:e.map(e=>(0,r.jsx)(C,{block:e,featuredProducts:t,readOnly:!Q,saving:v,onEditOffer:ee,onEditProducts:et,onSavePreset:X?ed:void 0,onRemove:()=>void er(e.id)},e.id))})]}),(0,r.jsx)(S,{open:R,block:U,loading:v,onOpenChange:e=>{L(e),e||E(null)},onSave:ea},U?.id??"offer-block-dialog"),(0,r.jsx)(T,{open:F,block:O,featuredProducts:t,loading:v,onOpenChange:e=>{M(e),e||J(null)},onSave:el},O?.id??"product-block-dialog"),(0,r.jsx)(o.lG,{open:z,onOpenChange:q,children:(0,r.jsxs)(o.Cf,{className:"sm:max-w-lg",children:[(0,r.jsxs)(o.c7,{children:[(0,r.jsx)(o.L3,{children:"Save Module Preset"}),(0,r.jsx)(o.rr,{children:"Reuse this content module across future campaigns without rebuilding it from scratch."})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"module-preset-name",children:"Preset name"}),(0,r.jsx)(m.p,{id:"module-preset-name",value:B,onChange:e=>G(e.target.value),maxLength:80})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"module-preset-description",children:"Description"}),(0,r.jsx)(p.T,{id:"module-preset-description",value:Y,onChange:e=>Z(e.target.value),rows:3,placeholder:"Optional note for when this preset should be used."})]})]}),(0,r.jsxs)(o.Es,{children:[(0,r.jsx)(i.$,{variant:"outline",onClick:()=>q(!1),disabled:V,children:"Cancel"}),(0,r.jsxs)(i.$,{onClick:()=>void en(),disabled:V,children:[V&&(0,r.jsx)(g.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Save Preset"]})]})]})})]})}function k({blocks:e,featuredProducts:t,className:s,footerText:a}){let l=s?`rounded-lg border bg-muted/20 p-3 ${s}`:"rounded-lg border bg-muted/20 p-3";return(0,r.jsxs)("div",{className:l,children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(x.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm font-medium",children:"Content Modules"})]}),(0,r.jsx)("div",{className:"mt-3 space-y-2",children:e.map(e=>(0,r.jsxs)("div",{className:"rounded-md border bg-background px-3 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(d.E,{variant:"outline",className:"text-[11px]",children:"offer"===e.type?"Offer":"Products"}),(0,r.jsx)("p",{className:"text-sm font-medium",children:e.title})]}),(0,r.jsx)("p",{className:"mt-1 text-xs whitespace-pre-line text-muted-foreground",children:y(e,t)})]},e.id))}),a&&(0,r.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:a})]})}function C({block:e,featuredProducts:t,readOnly:s,saving:a,onEditOffer:l,onEditProducts:n,onSavePreset:c,onRemove:o}){let m=y(e,t);return(0,r.jsx)("div",{className:"rounded-lg border p-4 space-y-3",children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(d.E,{variant:"outline",children:"offer"===e.type?"Offer Module":"Product Module"}),(0,r.jsx)("p",{className:"font-medium",children:e.title})]}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:m})]}),!s&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,r.jsxs)(i.$,{variant:"outline",size:"sm",onClick:()=>c(e),disabled:a,children:[(0,r.jsx)(j.A,{className:"h-3.5 w-3.5 mr-2"}),"Save Preset"]}),(0,r.jsxs)(i.$,{variant:"outline",size:"sm",onClick:()=>{"offer"===e.type?l(e):n(e)},disabled:a,children:[(0,r.jsx)(v.A,{className:"h-3.5 w-3.5 mr-2"}),"Edit"]}),(0,r.jsx)(i.$,{variant:"outline",size:"sm",onClick:o,disabled:a,children:"Remove"})]})]})})}function S({open:e,block:t,loading:s,onOpenChange:a,onSave:l}){return t?(0,r.jsx)(A,{open:e,block:t,loading:s,onOpenChange:a,onSave:l}):null}function A({open:e,block:t,loading:s,onOpenChange:d,onSave:n}){let[c,f]=(0,a.useState)(t.title),[x,h]=(0,a.useState)(t.details),[j,v]=(0,a.useState)(t.offerCode??""),[b,N]=(0,a.useState)(t.ctaLabel??""),[y,w]=(0,a.useState)(t.ctaUrl??""),[k,C]=(0,a.useState)(t.disclaimer),[S,T]=(0,a.useState)(t.terms??""),[$,P]=(0,a.useState)("");
1async function I(){let e=c.trim(),s=x.trim(),r=k.trim(),a=b.trim(),l=y.trim();e&&s&&r?a&&!l||!a&&l?P("Add both CTA label and CTA URL, or leave both blank."):(P(""),await n({id:t.id,type:"offer",title:e,details:s,disclaimer:r,...j.trim()?{offerCode:j.trim()}:{},...a?{ctaLabel:a}:{},...l?{ctaUrl:l}:{},...S.trim()?{terms:S.trim()}:{}})):P("Title, offer details, and disclaimer are required.")}return(0,r.jsx)(o.lG,{open:e,onOpenChange:d,children:(0,r.jsxs)(o.Cf,{className:"sm:max-w-2xl",children:[(0,r.jsxs)(o.c7,{children:[(0,r.jsx)(o.L3,{children:"Offer Module"}),(0,r.jsx)(o.rr,{children:"Add a structured promotion with optional code, CTA, disclaimer, and terms so the email stays consistent and compliant."})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"offer-block-title",children:"Title"}),(0,r.jsx)(m.p,{id:"offer-block-title",value:c,onChange:e=>f(e.target.value),maxLength:80})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"offer-block-details",children:"Offer Details"}),(0,r.jsx)(p.T,{id:"offer-block-details",value:x,onChange:e=>h(e.target.value),rows:4,placeholder:"Explain the offer, timing, and value."})]}),(0,r.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"offer-block-code",children:"Offer Code"}),(0,r.jsx)(m.p,{id:"offer-block-code",value:j,onChange:e=>v(e.target.value),placeholder:"Optional",maxLength:40})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"offer-block-cta-label",children:"CTA Label"}),(0,r.jsx)(m.p,{id:"offer-block-cta-label",value:b,onChange:e=>N(e.target.value),placeholder:"Shop now",maxLength:40})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"offer-block-cta-url",children:"CTA URL"}),(0,r.jsx)(m.p,{id:"offer-block-cta-url",value:y,onChange:e=>w(e.target.value),placeholder:"https://..."})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"offer-block-disclaimer",children:"Disclaimer"}),(0,r.jsx)(p.T,{id:"offer-block-disclaimer",value:k,onChange:e=>C(e.target.value),rows:3})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"offer-block-terms",children:"Terms"}),(0,r.jsx)(p.T,{id:"offer-block-terms",value:S,onChange:e=>T(e.target.value),rows:3,placeholder:"Optional extra terms or exclusions."})]}),$&&(0,r.jsx)(l.Fc,{variant:"destructive",children:(0,r.jsx)(l.TN,{children:$})})]}),(0,r.jsxs)(o.Es,{children:[(0,r.jsx)(i.$,{variant:"outline",onClick:()=>d(!1),disabled:s,children:"Cancel"}),(0,r.jsxs)(i.$,{onClick:()=>void I(),disabled:s,children:[s&&(0,r.jsx)(g.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Save Module"]})]})]})})}function T({open:e,block:t,featuredProducts:s,loading:a,onOpenChange:l,onSave:d}){return t?(0,r.jsx)($,{open:e,block:t,featuredProducts:s,loading:a,onOpenChange:l,onSave:d}):null}function $({open:e,block:t,featuredProducts:s,loading:d,onOpenChange:n,onSave:f}){let x=s.map(e=>e.productId),h=t.productIds?.length?t.productIds.filter(e=>x.includes(e)):x,[j,v]=(0,a.useState)(t.title),[b,N]=(0,a.useState)(t.intro??""),[y,w]=(0,a.useState)(h),[k,C]=(0,a.useState)("");async function S(){let e=j.trim();if(!e)return void C("A title is required for the product module.");if(0===y.length)return void C("Choose at least one featured product for this module.");C("");let s=y.length===x.length;await f({id:t.id,type:"featured_products",title:e,...b.trim()?{intro:b.trim()}:{},...s?{}:{productIds:y}})}return(0,r.jsx)(o.lG,{open:e,onOpenChange:n,children:(0,r.jsxs)(o.Cf,{className:"sm:max-w-2xl",children:[(0,r.jsxs)(o.c7,{children:[(0,r.jsx)(o.L3,{children:"Product Module"}),(0,r.jsx)(o.rr,{children:"Choose which featured products should render inside this email section. These products stay linked to the campaign's canonical featured-product list."})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"product-block-title",children:"Title"}),(0,r.jsx)(m.p,{id:"product-block-title",value:j,onChange:e=>v(e.target.value),maxLength:80})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{htmlFor:"product-block-intro",children:"Intro"}),(0,r.jsx)(p.T,{id:"product-block-intro",value:b,onChange:e=>N(e.target.value),rows:3,placeholder:"Optional short intro for the product section."})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.J,{children:"Products"}),(0,r.jsx)("div",{className:"max-h-72 space-y-2 overflow-y-auto rounded-lg border p-3",children:s.map(e=>{let t=y.includes(e.productId);return(0,r.jsxs)("label",{className:"flex items-start gap-3 rounded-md border p-3 cursor-pointer",children:[(0,r.jsx)(c.S,{checked:t,onCheckedChange:t=>{var s,r;return s=e.productId,r=!!t,void w(e=>r?e.includes(s)?e:[...e,s]:e.filter(e=>e!==s))}}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"font-medium",children:e.name}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:[e.category,e.strainType,null!=e.price?`$${e.price}
1`:null].filter(Boolean).join(" • ")||"Featured product"}),e.operatorNote&&(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground whitespace-pre-line",children:e.operatorNote})]})]},e.productId)})})]}),k&&(0,r.jsx)(l.Fc,{variant:"destructive",children:(0,r.jsx)(l.TN,{children:k})})]}),(0,r.jsxs)(o.Es,{children:[(0,r.jsx)(i.$,{variant:"outline",onClick:()=>n(!1),disabled:d,children:"Cancel"}),(0,r.jsxs)(i.$,{onClick:()=>void S(),disabled:d,children:[d&&(0,r.jsx)(g.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Save Module"]})]})]})})}},86477:(e,t,s)=>{s.d(t,{J:()=>l});var r=s(95155),a=s(79319);function l({value:e,onChange:t,targetRef:s,title:d="Personalization",description:i='Click a token to insert customer data like first name, full name, segment, or loyalty points. {{firstName}} and {{name}} fall back to "there" when a name is missing.',className:n=""}){return(0,r.jsxs)("div",{className:`rounded-md border border-dashed bg-muted/30 p-3 ${n}`.trim(),children:[(0,r.jsx)("p",{className:"text-xs font-medium text-foreground",children:d}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i}),(0,r.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:a.hy.map(a=>(0,r.jsxs)("button",{type:"button",onClick:()=>(function(e,t,s,r){let a=r?.current;if(!a)return void s(`${t}${e}`);let l=a.selectionStart??t.length,d=a.selectionEnd??t.length,i=`${t.slice(0,l)}${e}${t.slice(d)}`,n=l+e.length;s(i),requestAnimationFrame(()=>{a.focus(),a.setSelectionRange(n,n)})})(a.key,e,t,s),className:"rounded-full border bg-background px-2.5 py-1 text-left text-xs transition-colors hover:border-primary/40 hover:bg-primary/5",title:`${a.label}: ${a.example}`,children:[(0,r.jsx)("span",{className:"font-medium text-foreground",children:a.label}),(0,r.jsx)("span",{className:"mx-1 text-muted-foreground",children:"-"}),(0,r.jsx)("code",{className:"font-mono text-[11px] text-muted-foreground",children:a.key})]},a.key))})]})}},92384:(e,t,s)=>{s.d(t,{y:()=>a});var r=s(9339);let a=(0,r.createServerReference)("400b42f8b82f0ab2cec1dbd859b786ac909a0fddbd",r.callServer,void 0,r.findSourceMapURL,"saveCampaignContentModulePreset")},98191:(e,t,s)=>{s.d(t,{CG:()=>u,uY:()=>p});var r=s(95155),a=s(5772),l=s(89239),d=s(45160),i=s(86901),n=s(6296),c=s(24642),o=s(27906);function m(e){return{productId:e.productId,name:e.name,price:e.price,imageUrl:e.imageUrl,category:e.category,thcPercent:e.thcPercent,strainType:e.strainType,operatorNote:e.operatorNote}}function u(e,t){let s=new Map;return e.forEach(e=>{s.set(e.productId,e)}),t.forEach(e=>{let t,r=s.get(e.productId);s.set(e.productId,r?(t=m(e),{productId:r.productId,name:r.name||t.name,price:r.price??t.price,imageUrl:r.imageUrl??t.imageUrl,category:r.category??t.category,thcPercent:r.thcPercent??t.thcPercent,strainType:r.strainType??t.strainType,operatorNote:r.operatorNote?.trim()?r.operatorNote:t.operatorNote}):m(e))}),Array.from(s.values())}function p({recommendationSet:e,loading:t,applying:s=!1,onApply:m,title:u="AI product recommendations",emptyMessage:f="Craig will suggest products once campaign goal, audience, and menu data are ready."}){return(0,r.jsxs)("div",{className:"rounded-lg border border-dashed bg-muted/20 p-3 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(i.A,{className:"h-4 w-4 text-primary"}),(0,r.jsx)("p",{className:"text-sm font-medium",children:u}),e?(0,r.jsxs)(d.E,{variant:"outline",children:[e.products.length," picks"]}):null]}),e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-sm",children:e.summary}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:e.strategy})]}):(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:t?"Reviewing menu products for this campaign...":f})]}),e?(0,r.jsxs)(l.$,{type:"button",variant:"outline",size:"sm",disabled:t||s,onClick:()=>{m(e.products)},children:[s?(0,r.jsx)(n.A,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(c.A,{className:"mr-2 h-3.5 w-3.5"}),"Add picks"]}):null]}),e?.products.length?(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:e.products.slice(0,4).map(e=>(0,r.jsxs)("div",{className:"flex gap-3 rounded-lg border bg-background p-3",children:[(0,r.jsx)("div",{className:"relative h-14 w-14 shrink-0 overflow-hidden rounded-md bg-muted",children:e.imageUrl?(0,r.jsx)(a.default,{src:e.imageUrl,alt:e.name,fill:!0,className:"object-cover",unoptimized:!0}):(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,r.jsx)(o.A,{className:"h-5 w-5 text-muted-foreground
1/40"})})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsx)("p",{className:"truncate text-sm font-medium",children:e.name}),(0,r.jsx)(d.E,{variant:"secondary",className:"shrink-0 text-[10px]",children:Math.round(e.score)})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.category?(0,r.jsx)(d.E,{variant:"outline",className:"px-1.5 py-0 text-[10px]",children:e.category}):null,e.strainType?(0,r.jsx)(d.E,{variant:"outline",className:"px-1.5 py-0 text-[10px]",children:e.strainType}):null,null!=e.thcPercent?(0,r.jsxs)(d.E,{variant:"outline",className:"border-emerald-200 px-1.5 py-0 text-[10px] text-emerald-700",children:[e.thcPercent,"% THC"]}):null,null!=e.price?(0,r.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["$",e.price]}):null]}),(0,r.jsx)("div",{className:"space-y-0.5",children:e.reasons.slice(0,2).map(e=>(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:e},e))})]})]},e.productId))}):null]})}}}]);

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.