Files
gustavoo-me/wp-content/plugins/fluent-crm/assets/admin/Modules/Documentation/Docs.js
T
2026-07-23 22:56:30 -03:00

2 lines
6.6 KiB
JavaScript

import{e,k as t,ay as s}from"../../../vendor-element-plus.js?ver=3.1.8";import{aQ as c,W as a,X as i,Z as d,ab as o,a5 as n,a6 as r,Y as l,aa as h,a9 as _,ax as u,J as m,az as g,c7 as f}from"../../../vendor.js?ver=3.1.8";import{_ as p,I as x}from"../../../fc-bits-ui.js?ver=3.1.8";import{B as k}from"../../../BaseCard.js?ver=3.1.8";const I={class:"fcrm_docs_wrapper"},b={class:"fcrm_max_w_800"},v={class:"fcrm_docs_section_header_input"},y={class:"icon"},w={class:"fcrm_docs_section_content"},D={href:"https://fluentcrm.com/docs"},$={href:"https://wpmanageninja.com/support-tickets/"},T={class:"fcrm_docs_hint"},L={target:"_blank",rel:"noopener",href:"https://www.facebook.com/groups/fluentcrm"},C={key:0},H=["href"],M=["innerHTML"],S={class:"simple_dic"},j=["href"],B=["innerHTML"],E={key:1,class:"fcrm_docs_lists"},N={key:0},P=["href"],V=["onClick","innerHTML"],A={key:1},R=["innerHTML"],W=["href"],Y=["onClick","innerHTML"];const z=p({name:"Documentations",components:{Icons:x,BaseCard:k},data:()=>({search:"",fetching:!1,docs:[],utl_param:"?utm_source=wp&utm_medium=doc&utm_campaign=doc",reading_doc_status:!1,reading_doc:{},fuseDocs:null}),computed:{doc_cats(){if(!this.docs.length)return[];const e={item_3:{label:this.$t("Getting Started With Audience"),docs:[]},item_7:{label:this.$t("Grow Your Audience"),docs:[]},item_4:{label:this.$t("Email Campaign"),docs:[]},item_5:{label:this.$t("Automation Funnels"),docs:[]}};return this.each(this.docs,t=>{const s="item_"+t.category.value;e[s]||(e[s]={label:t.category.label,cat_id:t.category.value,docs:[]}),e[s].docs.push(t)}),Object.values(e)},search_items(){if(!this.search||!this.docs.length||!this.fuseDocs)return[];return this.fuseDocs.search(this.search).map(e=>e.item)}},methods:{openSearch(){},fetchDocs(){this.fetching=!0,this.$get("docs").then(e=>{this.docs=e.docs,this.fuseDocs=new f(this.docs,{keys:["title","content"]})}).catch(e=>{this.handleError(e)}).finally(()=>{this.fetching=!1})},readDoc(e,t,s,c=!1){const a=document.getElementById("doc_search_end");a&&a.scrollIntoView(),this.reading_doc={doc:e,docIndex:t,catIndex:s,isSearch:c},this.reading_doc_status=!0},goToNext(){if(this.reading_doc.isSearch)return this.search_items[this.reading_doc.docIndex+1]?this.readDoc(this.search_items[this.reading_doc.docIndex+1],this.reading_doc.docIndex+1,0,!0):(this.reading_doc_status=!1,this.search=""),!1;this.doc_cats[this.reading_doc.catIndex].docs[this.reading_doc.docIndex+1]?this.readDoc(this.doc_cats[this.reading_doc.catIndex].docs[this.reading_doc.docIndex+1],this.reading_doc.docIndex+1,this.reading_doc.catIndex):this.doc_cats[this.reading_doc.catIndex+1]&&this.doc_cats[this.reading_doc.catIndex+1].docs[0]?this.readDoc(this.doc_cats[this.reading_doc.catIndex+1].docs[0],0,this.reading_doc.catIndex+1):this.reading_doc_status=!1},goToPrev(){if(this.reading_doc.isSearch)return this.search_items[this.reading_doc.docIndex-1]?this.readDoc(this.search_items[this.reading_doc.docIndex-1],this.reading_doc.docIndex-1,0,!0):(this.reading_doc_status=!1,this.search=""),!1;if(this.doc_cats[this.reading_doc.catIndex].docs[this.reading_doc.docIndex-1])this.readDoc(this.doc_cats[this.reading_doc.catIndex].docs[this.reading_doc.docIndex-1],this.reading_doc.docIndex-1,this.reading_doc.catIndex);else if(this.doc_cats[this.reading_doc.catIndex-1]&&this.doc_cats[this.reading_doc.catIndex-1].docs.length){const e=this.reading_doc.catIndex-1,t=this.doc_cats[e].docs.length-1;this.readDoc(this.doc_cats[e].docs[t],t,e)}else this.reading_doc_status=!1}},mounted(){this.fetchDocs()}},[["render",function(f,p,x,k,z,G){const J=c("Icons"),q=t,F=e,O=c("base-card"),Q=s;return a(),i("div",I,[d("div",b,[o(O,null,{body:n(()=>[d("div",v,[r((a(),l(F,{clearable:"",disabled:z.fetching,size:"large",modelValue:z.search,"onUpdate:modelValue":p[1]||(p[1]=e=>z.search=e),placeholder:f.$t("Search Type and Enter...")},{prefix:n(()=>[o(q,{onClick:p[0]||(p[0]=e=>z.reading_doc_status=!1)},{default:n(()=>[d("span",y,[o(J,{"icon-name":"search"})])],void 0,!0),_:1})]),_:1},8,["disabled","modelValue","placeholder"])),[[Q,z.fetching]])]),d("div",w,[d("h1",null,h(f.$t("How can we help you?")),1),d("p",null,[_(h(f.$t("Please view the"))+" ",1),d("a",D,h(f.$t("documentation")),1),_(" "+h(f.$t("still_cant_find_the_answer"))+" ",1),d("a",$,h(f.$t("open a support ticket")),1),_(" "+h(f.$t("and we will be happy to answer your questions and assist you with any problems."))+". ",1)]),d("p",T,[_(h(f.$t("Want to discuss something with users like you?"))+" ",1),d("a",L,h(f.$t("Join our facebook community")),1)])])]),_:1}),z.reading_doc_status?(a(),i("div",C,[o(O,{class:"fcrm_reading_doc_card"},{title:n(()=>[d("h4",null,[d("a",{class:"external-link d-flex items-center gap-4",rel:"noopener",target:"_blank",href:z.reading_doc.doc.link+z.utl_param},[d("span",{innerHTML:z.reading_doc.doc.title},null,8,M),o(J,{"icon-name":"externalLink"})],8,H)])]),body:n(()=>[d("div",S,[p[6]||(p[6]=_(" You are reading the simple version of this document. ",-1)),d("a",{target:"_blank",rel:"noopener",href:z.reading_doc.doc.link+z.utl_param},"To read the doc on our site click here",8,j),p[7]||(p[7]=_(". To view all doc index ",-1)),d("a",{onClick:p[2]||(p[2]=u(e=>z.reading_doc_status=!1,["prevent"])),href:"#"},[...p[5]||(p[5]=[d("b",null,"click here",-1)])])]),d("div",{innerHTML:z.reading_doc.doc.content,class:"reading_doc_body"},null,8,B)]),footer:n(()=>[o(q,{onClick:p[3]||(p[3]=e=>G.goToPrev())},{default:n(()=>[_(h(f.$t("Read Previous Documentation")),1)],void 0,!0),_:1}),o(q,{onClick:p[4]||(p[4]=e=>G.goToNext())},{default:n(()=>[_(h(f.$t("Read Next Documentation")),1)],void 0,!0),_:1})]),_:1})])):(a(),i("div",E,[p[8]||(p[8]=d("div",{id:"doc_search_end"},null,-1)),z.search?(a(),l(O,{key:0,class:"fcrm_docs_list_card"},{title:n(()=>[d("h4",null,h(f.$t("Search Results")),1)]),body:n(()=>[G.search_items.length?(a(),i("ul",N,[(a(!0),i(m,null,g(G.search_items,(e,t)=>(a(),i("li",{key:e.id},[d("a",{class:"external-link",rel:"noopener",target:"_blank",href:e.link+z.utl_param},[o(J,{"icon-name":"externalLink"})],8,P),d("span",{class:"doc-title cursor_pointer",onClick:s=>G.readDoc(e,t,0,!0),innerHTML:e.title},null,8,V)]))),128))])):(a(),i("div",A,h(f.$t("No results found")),1))]),_:1})):(a(!0),i(m,{key:1},g(G.doc_cats,(e,t)=>(a(),l(O,{class:"fcrm_docs_list_card",key:t},{title:n(()=>[d("h4",null,[d("span",{innerHTML:e.label},null,8,R)])]),body:n(()=>[d("ul",null,[(a(!0),i(m,null,g(e.docs,(e,s)=>(a(),i("li",{key:e.id},[d("a",{class:"external-link",rel:"noopener",target:"_blank",href:e.link+z.utl_param},[o(J,{"icon-name":"externalLink"})],8,W),d("span",{class:"doc-title cursor_pointer",onClick:c=>G.readDoc(e,s,t),innerHTML:e.title},null,8,Y)]))),128))])]),_:2},1024))),128))]))])])}]]);export{z as default};