import{g as k,c as s,e as r,a as t,b as n,m as B,n as N,t as l,x as b,u as o,F as f,r as E,d as $}from"./runtime-dom.esm-bundler-Dxy_DEvW.js";const j={class:"h-full bg-white shadow-sm rounded-lg overflow-hidden justify-between flex flex-col border border-purple-200 transition-all duration-300"},U={class:"font-medium px-4 py-2 text-sm border-b border-gray-200"},q={class:"h-full px-4 py-2 text-sm"},C={key:0},F={key:1},O={key:1,class:"flex flex-row items-center justify-between divide-x divide-gray-200 border-t border-gray-200"},T=["href"],A={__name:"Template",props:{template:{type:Object,required:!0},labels:{type:Object,required:!0},isExpanded:{type:Boolean,default:!1}},setup(e){let{premium:c,upgrade_url:m,integrations:i}=window.FAB_PLUGIN,{plugin:p}=i,u=100;const g=k(()=>e.template.license==="premium"&&!c),y=()=>{const{rest_url:x,path:a}=window.FAB_PLUGIN;fetch(x+"fab/v1/add_new_fab",{method:"POST",body:JSON.stringify(e.template)}).then(d=>d.json()).then(d=>{const w=d.post_id,v=`${a.home_url}/wp-admin/post.php?post=${w}&action=edit`;window.location.href=v})},h=()=>{window.location.href=m};return(x,a)=>(r(),s("div",j,[t("h3",U,[t("i",{class:N(["pr-2",e.template.design.icon.class]),style:B({color:e.template.design.color})},null,6),n(" "+l(e.template.name),1)]),t("div",q,[e.isExpanded?(r(),s("span",F,l(e.template.description),1)):(r(),s("span",C,l(e.template.description.substring(0,o(u)))+l(e.template.description.length>o(u)?"...":""),1)),e.template.description.length>o(u)&&!e.isExpanded?(r(),s("span",{key:2,onClick:a[0]||(a[0]=d=>e.isExpanded=!e.isExpanded),class:"text-gray-500 hover:text-gray-700 ml-1 cursor-pointer"},l(e.labels.read_more),1)):b("",!0)]),g.value?(r(),s("div",{key:0,class:"px-4 py-2 text-center cursor-pointer border-t border-gray-200 transition-all duration-300 text-white bg-purple-600 hover:bg-green-600",onClick:h},[a[1]||(a[1]=t("i",{class:"fas fa-star"},null,-1)),n(" "+l(e.labels.upgrade),1)])):(r(),s("div",O,[e.template.docs?(r(),s("a",{key:0,class:"grow px-4 py-2 text-center cursor-pointer transition-all duration-300 bg-sky-600 text-white",href:e.template.docs,target:"_blank"},[a[2]||(a[2]=t("i",{class:"fas fa-book pr-1"},null,-1)),n(" "+l(e.labels.learn_more),1)],8,T)):b("",!0),t("div",{class:"grow px-4 py-2 text-center cursor-pointer transition-all duration-300 bg-primary-600 text-white",onClick:y},[a[3]||(a[3]=t("i",{class:"fas fa-plus pr-1"},null,-1)),n(" "+l(e.labels.add_new),1)])]))]))}},I={class:"flex justify-between items-center pb-2"},L={class:"text-lg font-bold"},P=["href"],S={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},G={__name:"Templates",props:{labels:{type:Object,required:!0},templates:{type:Array,required:!0},isExpanded:{type:Boolean,required:!1}},setup(e){const{templates_url:c}=window.FAB_PLUGIN;return(m,i)=>(r(),s(f,null,[t("div",I,[t("div",L,l(e.labels.templates),1),t("a",{href:o(c),class:"py-2 text-sm text-primary-500 hover:bg-primary-500 hover:text-white transition-all duration-300 px-2 py-1 rounded-md"},[n(l(e.labels.explore_more_templates)+" ",1),i[0]||(i[0]=t("i",{class:"fas fa-external-link-alt pl-1"},null,-1))],8,P)]),t("div",S,[(r(!0),s(f,null,E(e.templates,p=>(r(),s("div",null,[$(A,{template:p,labels:e.labels,"is-expanded":e.isExpanded},null,8,["template","labels","is-expanded"])]))),256))])],64))}};export{G as _};
//# sourceMappingURL=Templates-Bw4KNC2s.js.map
