| Server IP : 52.25.153.185 / Your IP : 216.73.217.43 Web Server : Apache System : Linux ip-172-26-6-158 5.10.0-45-cloud-amd64 #1 SMP Debian 5.10.259-1 (2026-07-02) x86_64 User : daemon ( 1) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/fluent-crm/assets/ |
Upload File : |
import{b1 as e,b0 as t,aw as a,Q as i,aj as s,ad as l,jT as n,kF as o,E as r,af as m}from"./vendor-element-plus.js?ver=3.2.0";import{_ as c,I as d}from"./fc-bits-ui.js?ver=3.2.0";import{Y as p,a2 as _,a3 as h,a4 as u,a5 as g,aR as f,Z as w,ac as b,P as T,aA as y,ae as I,aa as v,ad as $,a7 as k}from"./vendor.js?ver=3.2.0";import{P as x}from"./PromoCard.js?ver=3.2.0";const B={class:"build-in-template-loader"},L={class:"fcrm_build_in_templates_item skeleton-box"},S={class:"fcrm_build_in_templates_item--image",style:{padding:"15px",height:"152px"}},j={class:"fcrm_build_in_templates_item--content"},C={class:"fcrm_build_in_templates_item--title"};const P={name:"_BuildInTemplatesList",components:{PromoCard:x,BuildInTemplateLoader:c({name:"BuildInTemplateLoader"},[["render",function(a,i,s,l,n,o){const r=e,m=t;return p(),_("div",B,[h(m,{animated:"",count:8,style:{padding:"0"},class:"fcrm_build_in_templates_list"},{template:u(()=>[g("div",L,[g("div",S,[h(r,{animated:"",variant:"image",style:{width:"100%",height:"100%"}})]),g("div",j,[g("div",C,[h(r,{animated:"",variant:"text",style:{width:"80%"}})])])])]),_:1})])}]]),Icons:d},props:{insertMode:{type:Boolean,default:!1},redirect_on_import:{type:Boolean,default:!0}},emits:["template-imported"],data:()=>({builtInTemplates:[],isLoadingTemplates:!1,importing:!1,templateIdImporting:null,oneTimeFetch:!0,showProModal:!1}),methods:{fetchBuiltInTemplates(){this.oneTimeFetch&&(this.oneTimeFetch=!1,this.isLoadingTemplates=!0,this.$get("templates/built-in-templates").then(e=>{this.builtInTemplates=e.templates}).catch(e=>{this.handleError(e)}).finally(()=>{this.isLoadingTemplates=!1}))},importTemplate(e){this.templateIdImporting=e.id,this.importing=!0,!this.insertMode&&this.redirect_on_import?window.jQuery.post(window.ajaxurl,{body:{file:e.content},_nonce:window.fcAdmin.ajax_nonce,action:"fluentcrm_import_template"}).then(e=>{this.$notify.success(e.message),this.$router.push({name:"edit_template",params:{template_id:e.template_id}})}).catch(e=>{this.handleError(e.responseJSON||e.responseText||e.statusText)}).always(()=>{this.templateIdImporting=null,this.importing=!1}):this.$post("templates/built-in-template",{file:e.content}).then(e=>{this.$emit("template-imported",e.template)}).catch(e=>{this.handleError(e)}).finally(()=>{this.templateIdImporting=null,this.importing=!1})}},mounted(){this.fetchBuiltInTemplates()}},D={key:1,class:"fcrm_build_in_templates_list"},E={class:"fcrm_build_in_templates_item--image"},F=["src","alt"],V={key:1},M={class:"fcrm_build_in_templates_item--actions"},A=["href"],N={class:"icon"},z={class:"icon"},U={class:"icon"},J={class:"fcrm_build_in_templates_item--content"},O={class:"fcrm_build_in_templates_item--title"};const Q=c(P,[["render",function(e,t,n,o,r,m){const c=f("BuildInTemplateLoader"),d=f("Icons"),k=i,x=s,B=f("PromoCard"),L=l,S=a;return p(),_("div",null,[r.isLoadingTemplates?(p(),w(c,{key:0})):b("",!0),!r.isLoadingTemplates&&r.builtInTemplates.length?(p(),_("div",D,[(p(!0),_(T,null,y(r.builtInTemplates,a=>(p(),_("div",{key:a.id,class:"fcrm_build_in_templates_item"},[g("div",E,[a.cover_image?(p(),_("img",{key:0,src:a.cover_image,alt:a.title},null,8,F)):(p(),_("p",V,I(e.$t("Empty")),1)),g("div",M,[g("a",{href:a.link,class:"el-button preview-btn el-button--small",target:"_blank",rel:"noopener noreferrer"},[g("span",N,[h(d,{"icon-name":"eye"})])],8,A),e.has_campaign_pro?v((p(),w(k,{key:0,size:"small",onClick:e=>m.importTemplate(a),disabled:r.importing},{default:u(()=>[g("span",z,[h(d,{"icon-name":"import"})]),$(" "+I(e.$t("Import")),1)],void 0),_:1},8,["onClick","disabled"])),[[S,r.importing&&r.templateIdImporting==a.id]]):(p(),w(k,{key:1,size:"small",onClick:t[0]||(t[0]=e=>r.showProModal=!0)},{default:u(()=>[g("span",U,[h(d,{"icon-name":"import"})]),$(" "+I(e.$t("Import")),1)],void 0),_:1}))])]),g("div",J,[g("div",O,I(a.title),1)])]))),128))])):b("",!0),r.isLoadingTemplates||r.builtInTemplates.length?b("",!0):(p(),w(x,{key:2,description:e.$t("No Built In Templates Found")},null,8,["description"])),h(L,{modelValue:r.showProModal,"onUpdate:modelValue":t[1]||(t[1]=e=>r.showProModal=e),title:e.$t("Importing Template"),width:"40%"},{default:u(()=>[h(B,{"show-header-upgrade-icon":!1})],void 0),_:1},8,["modelValue","title"])])}]]),Y={name:"BuiltinTemplateDrawer",components:{Icons:d,BuildInTemplatesList:Q,Plus:o,Loading:n},emits:["update:open_drawer"],props:{open_drawer:{type:Boolean,default:()=>!1},create_mode:{type:Boolean,default:()=>!1}},data:()=>({direction:"rtl",show_drawer:!1,creatingScratch:!1,builtInTemplates:[],isLoadingTemplates:!1,importing:!1,templateIdImporting:null,oneTimeFetch:!0,showTemplatePreview:!1,previewTemplateId:"",email_template:{post_title:"",post_content:"",post_excerpt:"",email_subject:"",edit_type:"html",design_template:"",settings:{template_config:{}}}}),watch:{open_drawer(e){this.show_drawer=!!e}},computed:{localDrawerVisible:{get(){return this.show_drawer},set(e){this.show_drawer=e,e||this.$emit("update:open_drawer",!1)}}},mounted(){window.fcAdmin&&window.fcAdmin.is_rtl&&(this.direction="ltr")},methods:{getDefaultTemplateTitle(){const e=new Date,t=e=>String(e).padStart(2,"0");return`Untitled - Created at ${`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())} ${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}`}`},createFromStratch(){this.creatingScratch||(this.creatingScratch=!0,this.$get("templates/0").then(e=>{const t=e&&e.template?e.template:{};return t.post_title=this.getDefaultTemplateTitle(),t.post_content=t.post_content||" ",t.post_excerpt=t.post_excerpt||"",t.email_subject=t.email_subject||"",t.edit_type=t.edit_type||"html",t.settings=t.settings||{template_config:{}},this.$post("templates",{template:JSON.stringify(t)})}).then(e=>{const t=e&&e.template_id?e.template_id:0;if(!t)throw new Error(this.$t("Could not create template"));this.$emit("update:open_drawer",!1),this.show_drawer=!1,this.$router.push({name:"edit_template",params:{template_id:t},query:{is_new:"yes"}})}).catch(e=>{this.handleError?this.handleError(e):this.$notify.error(e.message||this.$t("Could not create template"))}).finally(()=>{this.creatingScratch=!1}))}}},q={class:"fc_built_in_templates"},H={class:"icon"},R={class:"fcrm_create_from_scratch_box--content"},Z={class:"fcrm_create_from_scratch_box--title fcrm_primary_text font-medium fcrm_mb_4"},G={class:"fcrm_create_from_scratch_box--desc fcrm_secondary_text small"};const K=c(Y,[["render",function(e,t,a,i,s,l){const n=f("Icons"),o=f("Loading"),c=r,d=f("BuildInTemplatesList"),T=m;return p(),w(T,{direction:s.direction,title:a.create_mode?e.$t("Create New Email Template"):e.$t("Built In Templates"),"append-to-body":!0,"close-on-click-modal":!1,modelValue:l.localDrawerVisible,"onUpdate:modelValue":t[1]||(t[1]=e=>l.localDrawerVisible=e),size:"55%"},{default:u(()=>[g("div",q,[a.create_mode?(p(),_("div",{key:0,class:k(["fcrm_create_from_scratch_box",{"is-creating":s.creatingScratch}]),onClick:t[0]||(t[0]=e=>l.createFromStratch())},[g("span",H,[s.creatingScratch?(p(),w(c,{key:1,class:"is-loading"},{default:u(()=>[h(o)],void 0,!0),_:1})):(p(),w(n,{key:0,"icon-name":"plus"}))]),g("div",R,[g("div",Z,I(e.$t("Create from Scratch")),1),g("div",G,I(e.$t("Design your email template from a blank canvas.")),1)])],2)):b("",!0),h(d)])],void 0),_:1},8,["direction","title","modelValue"])}],["__scopeId","data-v-572cb417"]]);export{K as B,Q as a};