1import{d as w,e as f,H as x}from"./index.191addbe.js";import{_ as b,a0 as D,Y as k,ct as E,e3 as L,E as M,O as C}from"./index.12fd6615.js";import{f as I}from"./faPencil.1bb99c6e.js";import{P as N,N as O}from"./index.481e9100.js";import{N as s,D as m,W as c,U as u,E as p,Q as d,R as W,f as g,F as q}from"./vue.e6b86939.js";import{a as _,w as S}from"./sentry.09480738.js";import{T as A}from"./themeProvider.cd07c281.js";import{s as F}from"./startCase.127cd34e.js";import"./teemail-mailing-list.ad038638.js";import"./store.647ab566.js";import"./faPaperPlane.4d97a08a.js";import"./faSlidersH.577e42de.js";import"./faCog.82441dfc.js";import"./faGear.f880d016.js";import"./faClock.f8ce5824.js";import"./faSync.1b808c6f.js";import"./faLink.d6ac6dc2.js";import"./debounce.11f64b4a.js";import"./copyToClipboard.dd6c45c7.js";import"./faPencil.92291403.js";var h={},v;function H(){return v||(v=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t="fal",i="exclamation",n=128,a=512,r=[10069,10071,61738],o="21",l="M64 400c-17.67 0-32 14.32-32 31.99s14.33 32 32 32s32-14.33 32-32S81.67 400 64 400zM64 352c8.844 0 16-7.166 16-16.01v-288c0-8.844-7.156-15.99-16-15.99S48 39.16 48 48v288C48 344.8 55.16 352 64 352z";e.definition={prefix:t,iconName:i,icon:[n,a,r,o,l]},e.faExclamation=e.definition,e.prefix=t,e.iconName=i,e.width=n,e.height=a,e.ligatures=r,e.unicode=o,e.svgPathData=l,e.aliases=r}(h)),h}var B=H();const U={name:"TeemailDraftPreview",components:{PageRenderer:D,AppTheme:k},mixins:[w],props:{draft:{type:f,required:!0},editable:{type:Boolean,default:!1},user:{type:Object,required:!0}},data(){return{faExclamation:B.faExclamation,faPencil:I.faPencil,internalDraft:null,theme:null,loading:!0,loadingTheme:!1,errorMessage:null,mailLayoutWidth:E,mailLayoutWidthPx:L}},watch:{draft:{immediate:!0,async handler(e){if(e.divisionId&&this.getTheme(e.divisionId),!e.blocks.length)try{this.errorMessage=null,this.internalDraft=await f.get(this.campaign.division,e),this.theme||this.getTheme(this.internalDraft.divisionId)}catch(t){switch(M.Log.tag("teemail").red(`Provider - ${t.constructor.name}`).space().error(t),t.constructor){case O:S(i=>{const{id:n,name:a,url:r}=e;i.setExtras({draft:{id:n,name:a,url:r},division:this.campaign.division}),i.setUser({id:this.user.id,email:this.user.email,username:this.user.username}),_(t)}),this.errorMessage="Looks like something went wrong finding that draft, our engineers have been notified of the issue.";break;case N:snackbar.error(t.message);break;default:_(t),snackbar.error("Oops... something went wrong fetching that draft");break}}this.loading=!1}}},methods:{maxDevice:C,async getTheme(e){this.loadingTheme||(this.loadingTheme=!0,this.theme=await A.active(e),this.loadingTheme=!1)}}};function j(e,t,i,n,a,r){const o=s("tml-message"),l=s("tml-anchor"),y=s("page-renderer"),P=s("app-theme"),T=s("tml-loader");return m(),c(T,{loading:a.loading||a.loadingTheme,text:"Loading...",height:"24em"},{default:u(()=>[!a.loading&&a.errorMessage?(m(),c(o,{key:0,icon:a.faExclamation,text:a.errorMessage},null,8,["icon","text"])):!a.loading&&a.internalDraft?(m(),p(q,{key:1},[i.editable?(m(),c(l,{key:0,class:"mb-8 block",text:"Edit this mailshot",href:`/teemail/drafts/edit/${a.internalDraft.id}`,icon:a.faPencil},null,8,["href","icon"])):d("",!0),a.theme?(m(),p("div",{key:1,style:W({backgroundColor:a.theme?a.theme.get("page.background.color"):void 0,width:r.maxDevice("md")?"100vw":a.mailLayoutWidthPx})},[g(P,{class:"mail-layout",theme:a.theme},{default:u(()=>[g(y,{page:a.internalDraft,width:r.maxDevice("md")?void 0:a.mailLayoutWidth},null,8,["page","width"])]),_:1},8,["theme"])],4)):d("",!0)],64)):d("",!0)]),_:1},8,["loading"])}const z=b(U,[["render",j],["__scopeId","data-v-927b492d"]]),R={name:"TeemailCampaignShowPreviewPage",components:{TeemailDraftPreview:z},mixins:[x,w],props:{draft:{type:f,required:!0},user:{type:Object,required:!0}},computed:{breadcrumbTitle(){var e;return F((e=this.campaign)==null?void 0:e.name)}}};function Y(e,t,i,n,a,r){const o=s("teemail-draft-preview");return m(),c(o,{draft:i.draft,campaign:e.campaign,editable:e.campaign.isScheduled},null,8,["draft","campaign","editable"])}const he=b(R,[["render",Y]]);export{he as default}; 2//# sourceMappingURL=Preview.de764239.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.