403Webshell
Server IP : 52.25.153.185  /  Your IP : 216.73.217.84
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /bitnami/wordpress/wp-content/plugins/fluent-crm/assets/_ContactsTable.js
import{ah as e,ar as t,$ as l,Z as s,Q as a,E as o,bg as i,l7 as n,hC as c,aU as r,aS as d,hE as m,a_ as u,aF as p,a9 as h,aw as _,aL as f,jT as b,ic as y,aR as g,ad as k,bd as v,b0 as w,b1 as C,bc as x,j4 as $,jd as S,iZ as A,iN as F,kF as V,iD as P,bm as R}from"./vendor-element-plus.js?ver=3.2.0";import{T,E as O}from"./CompanyInfoSideContact.js?ver=3.2.0";import{F as B}from"./Filterer.js?ver=3.2.0";import{aR as z,Y as j,a2 as L,a3 as M,a4 as D,ad as q,ae as W,P as U,aA as I,Z as E,a5 as N,ac as Y,a7 as H,X as Z,aa as K,du as G,az as Q,b1 as X,ay as J}from"./vendor.js?ver=3.2.0";import{_ as ee,I as te,T as le,a as se}from"./fc-bits-ui.js?ver=3.2.0";import{F as ae}from"./Filterer2.js?ver=3.2.0";import{s as oe}from"./data_config.js?ver=3.2.0";import{S as ie}from"./Searcher.js?ver=3.2.0";import{P as ne}from"./PaginationBar.js?ver=3.2.0";import{D as ce}from"./DataTable.js?ver=3.2.0";import{F as re}from"./FloatingBulkActionShell.js?ver=3.2.0";import{C as de}from"./Confirm.js?ver=3.2.0";import{O as me}from"./_OptionSelector.js?ver=3.2.0";import ue from"./v3app/src/Modules/Contacts/Filter/FilterPopover.js?ver=3.2.0";import pe from"./v3app/src/Modules/Contacts/Filter/ActiveFiltersBar.js?ver=3.2.0";import{A as he}from"./Adder.js?ver=3.2.0";import{B as _e}from"./Badge.js?ver=3.2.0";import{u as fe}from"./contacts.js?ver=3.2.0";import{g as be,a as ye}from"./relations.js?ver=3.2.0";import{c as ge}from"./clipboard.js?ver=3.2.0";const ke={name:"Filters",components:{Filterer:B},emits:["filter","search"],props:{type:{required:!0},options:{required:!0,type:Array},selected:{required:!0},count:{required:!0,type:Number},noMatch:{required:!0,type:Boolean}},data:()=>({query:null,placement:"bottom-start"}),computed:{selection:{get(){return this.selected},set(e){this.$emit("filter",e)}},parsedOptions(){let e=[];return"statuses"!=this.type?this.each(this.options,t=>{e.push({id:parseInt(t.id),title:t.title,slug:t.slug})}):e=this.options,e}},methods:{search(){this.$emit("search",this.query&&this.query.toLowerCase())},deselect(e){const t=this.selection.indexOf(e.slug);this.selection.splice(t,1),this.$emit("filter",this.selection)}},mounted(){this.appVars.is_rtl&&(this.placement="bottom-end")}},ve={class:"fcrm_fluentcrm-filterer"},we={key:0,class:"fcrm_fluentcrm-meta"};const Ce=ee(ke,[["render",function(n,c,r,d,m,u){const p=z("ArrowDown"),h=o,_=a,f=t,b=e,y=s,g=l,k=z("filterer"),v=i;return j(),L("div",ve,[M(k,{placement:m.placement,filter_type:r.type,class:H({"fcrm_fluentcrm-filtered":u.selection.length})},{header:D(()=>[M(_,{plain:"",size:"small"},{default:D(()=>[q(W(n.$t("Filtered by"))+" "+W(n.ucFirst(n.trans(r.type)))+" ",1),M(h,{class:"el-icon--right"},{default:D(()=>[M(p)],void 0,!0),_:1})],void 0,!0),_:1})]),items:D(()=>[M(b,{class:"fcrm_fluentcrm-filter-option fcrm_dropdown-search-item fcrm_no-hover"},{default:D(()=>[M(f,{size:"small",modelValue:m.query,"onUpdate:modelValue":c[0]||(c[0]=e=>m.query=e),placeholder:n.$t("Search..."),onInput:u.search,class:"fcrm_input"},null,8,["modelValue","placeholder","onInput"])],void 0,!0),_:1}),M(b,{class:"fcrm_fluentcrm-filter-option fcrm_dropdown-items-label"},{default:D(()=>[q(W(n.$t("Choose an option:")),1)],void 0,!0),_:1}),M(g,{modelValue:u.selection,"onUpdate:modelValue":c[1]||(c[1]=e=>u.selection=e),class:"fcrm_fluentcrm-filter-options fcrm_checkbox_group"},{default:D(()=>[(j(!0),L(U,null,I(u.parsedOptions,e=>(j(),E(y,{key:e.id,value:e.id,class:"el-dropdown-menu__item fcrm_checkbox"},{default:D(()=>[q(W(e.title),1)],void 0,!0),_:2},1032,["value"]))),128))],void 0,!0),_:1},8,["modelValue"]),r.noMatch?(j(),E(b,{key:0,class:"fcrm_fluentcrm-filter-option"},{default:D(()=>[N("p",null,W(n.$t("No items found")),1)],void 0,!0),_:1})):Y("",!0)]),_:1},8,["placement","filter_type","class"]),u.selection.length?(j(),L("div",we,[(j(!0),L(U,null,I(u.parsedOptions,e=>(j(),L(U,{key:e.id},[-1!=r.selected.indexOf(e.id)?(j(),E(v,{key:0,closable:"",onClose:t=>u.deselect(e)},{default:D(()=>[q(W(e.title),1)],void 0),_:2},1032,["onClose"])):Y("",!0)],64))),128))])):Y("",!0)])}]]),xe={class:"fcrm_filter-manager"},$e={style:{padding:"10px","text-align":"center"}};const Se=ee({name:"Manager",props:["type","matched","options","selected","selection","subscribers","selectionCount","total_match"],emits:["filter"],data(){return{placement:"bottom-start",new_payload:!1,filterLabel:this.$t("Filters.instruction")}},components:{Editor:O,Filters:Ce},mixins:[T],methods:{filter(e){this.$emit("filter",this.payload(e))},updatePayLoad(e){this.new_payload=e},pushPayload(){this.new_payload?(this.subscribe(this.new_payload),setTimeout(()=>{this.new_payload=!1},500)):this.$notify.error(this.$t("No changes found"))}},mounted(){this.appVars.is_rtl&&(this.placement="bottom-end")}},[["render",function(e,t,l,s,o,i){const n=a,c=z("editor"),r=z("filters");return j(),L("div",xe,[l.selection?(j(),E(c,{key:0,type:l.type,options:e.choices,noMatch:e.noMatch,matched:l.matched,selectionCount:l.selectionCount,onSearch:e.search,onSubscribe:i.updatePayLoad,placement:o.placement},{footer:D(()=>[N("div",$e,[M(n,{disabled:!o.new_payload,onClick:t[0]||(t[0]=e=>i.pushPayload()),style:{width:"100%"},type:"success",size:"small"},{default:D(()=>[q(W(e.$t("Confirm")),1)],void 0,!0),_:1},8,["disabled"])])]),_:1},8,["type","options","noMatch","matched","selectionCount","onSearch","onSubscribe","placement"])):(j(),E(r,{key:1,type:l.type,options:e.choices,noMatch:e.noMatch,selected:l.selected,count:l.total_match,onSearch:e.search,onFilter:i.filter,add_label:o.filterLabel},null,8,["type","options","noMatch","selected","count","onSearch","onFilter","add_label"]))])}]]),Ae={class:"icon"},Fe={class:"fcrm_checkbox_group_label"};const Ve=ee({name:"ColumnToggler",components:{Icons:te,Filterer:ae,Setting:n},props:{placement:{type:String,default:"bottom-start"}},emits:["input","update:modelValue","dataChanged"],data:()=>({selection:[],subscriberColumns:oe}),computed:{columnGroups(){this.has_company_module&&(window.fc_primary_company_pushed||(oe.push({label:this.$t("Primary Company"),value:"primary_company",position:4}),window.fc_primary_company_pushed=!0),window.fc_companies_pushed||(oe.push({label:this.$t("Companies"),value:"companies",position:4}),window.fc_companies_pushed=!0));const e=[{slug:"subscriber",label:this.$t("Primary Fields"),fields:oe}];this.appVars.commerce_provider&&e.push({slug:"commerce",label:this.$t("Commerce Fields"),fields:[{label:this.$t("Lifetime Value"),value:"commerce.total_order_value",position:1},{label:this.$t("Purchase Count"),value:"commerce.total_order_count",position:2},{label:this.$t("Customer Since"),value:"commerce.first_order_date",position:3},{label:this.$t("Last Purchase Date"),value:"commerce.last_order_date",position:3}]});const t=[];return this.each(this.appVars.contact_custom_fields,(e,l)=>{t.push({label:e.label,value:e.slug,position:l+10})}),t.length&&e.push({slug:"custom_fields",label:this.$t("Custom Fields"),fields:t}),e}},methods:{init(){const e=this.storage.get("columns");e?(this.selection=e,this.fire()):(this.selection=["tags","lists","status"],this.save())},save(){var e;this.storage.set("columns",this.selection),null==(e=this.$refs.filterer)||e.hide(),this.fire()},fire(){this.$emit("input",this.selection),this.$emit("update:modelValue",this.selection),setTimeout(()=>{this.$emit("dataChanged",this.selection)},400)}},mounted(){this.init()}},[["render",function(t,o,i,n,c,r){const d=z("Icons"),m=a,u=s,p=l,h=e,_=z("filterer");return j(),E(_,{ref:"filterer",placement:i.placement},{header:D(()=>[M(m,{size:"small",class:"small only-icon-btn"},{default:D(()=>[N("span",Ae,[M(d,{"icon-name":"column"})])],void 0,!0),_:1})]),items:D(()=>[M(p,{modelValue:c.selection,"onUpdate:modelValue":o[0]||(o[0]=e=>c.selection=e),class:"fcrm_filter-options fcrm_checkbox_group fcrm_column_toggler_checks"},{default:D(()=>[(j(!0),L(U,null,I(r.columnGroups,(e,t)=>(j(),L(U,{key:t},[N("div",Fe,W(e.label),1),(j(!0),L(U,null,I(e.fields,(e,l)=>(j(),L("div",{key:t+" "+l,class:"el-dropdown-menu__item"},[M(u,{value:e.value,class:"fcrm_checkbox"},{default:D(()=>[q(W(e.label),1)],void 0,!0),_:2},1032,["value"])]))),128))],64))),128))],void 0,!0),_:1},8,["modelValue"])]),footer:D(()=>[M(h,{class:"fcrm_no-hover"},{default:D(()=>[M(m,{type:"primary",size:"small",style:{width:"100%"},onClick:r.save},{default:D(()=>[Z(t.$slots,"btn-label",{},()=>[q(W(t.$t("Save")),1)])],void 0,!0),_:3},8,["onClick"])],void 0,!0),_:3})]),_:3},8,["placement"])}]]);const Pe=ee({name:"PropertyChanger",components:{Filterer:B,ArrowDown:c},props:["options","label","prop_key","selectedSubscribers"],emits:["fetch"],data:()=>({selected_item:""}),methods:{save(){this.changeSubscribersProperty({type:this.prop_key,value:this.selected_item})},changeSubscribersProperty(e){const{type:t,value:l}=e;l?(this.loading=!0,this.$put("subscribers/subscribers-property",{property:t,value:l,subscribers:this.selectedSubscribers.map(e=>e.id)}).then(e=>{this.$notify.success(e.message),this.$emit("fetch")}).catch(e=>{console.log(e)}).finally(()=>{this.loading=!1})):this.$notify.error(this.$t("Pro_Please_saof"))}}},[["render",function(t,l,s,i,n,c){const m=z("ArrowDown"),u=o,p=a,h=e,_=d,f=r,b=z("filterer");return j(),E(b,{placement:"bottom-start"},{header:D(()=>[M(p,{plain:"",size:"small"},{default:D(()=>[q(W(t.$t("Change"))+" "+W(s.label)+" ",1),Z(t.$slots,"icon",{},()=>[M(u,null,{default:D(()=>[M(m)],void 0,!0),_:1})])],void 0,!0),_:3})]),items:D(()=>[M(h,{class:"fcrm_filter-option fcrm_no-hover"},{default:D(()=>[q(W(t.$t("Choose New"))+" "+W(s.label)+": ",1)],void 0,!0),_:1}),M(f,{class:"fcrm_checkable_block",modelValue:n.selected_item,"onUpdate:modelValue":l[0]||(l[0]=e=>n.selected_item=e)},{default:D(()=>[(j(!0),L(U,null,I(s.options,e=>(j(),E(_,{key:e.id,value:e.id},{default:D(()=>[q(W(e.title),1)],void 0,!0),_:2},1032,["value"]))),128))],void 0,!0),_:1},8,["modelValue"])]),footer:D(()=>[M(h,{class:"fcrm_no-hover"},{default:D(()=>[M(p,{type:"primary",size:"small",style:{width:"100%"},onClick:c.save},{default:D(()=>[Z(t.$slots,"btn-label",{},()=>[q(W(t.$t("Change"))+" "+W(s.label),1)])],void 0,!0),_:3},8,["onClick"])],void 0,!0),_:3})]),_:3})}]]),Re={class:"fcrm_bulk_contact_custom_fields"},Te={key:0,class:"fcrm_contact_popover_header fcrm_custom_field_form"},Oe={class:"fcrm_popover_header"},Be={class:"fcrm_field_label"},ze={key:1,class:"fcrm_contact_popover_body fcrm_popover_body_flex_direction_column"},je={class:"fcrm_popover_actions"};const Le={class:"fcrm_bulk_action_inline"},Me={class:"fcrm_bulk_wrap"},De={class:"fcrm_bulk_item"},qe={class:"icon"},We={class:"icon"},Ue={key:0,style:{padding:"10px"}},Ie={class:"icon"},Ee={class:"icon"},Ne={class:"icon"},Ye={key:0,style:{padding:"10px"}},He={class:"icon"},Ze={class:"icon"},Ke={key:0,class:"fcrm_bulk_navs"},Ge={key:0},Qe={key:1},Xe={key:0,class:"fcrm_bulk_processing_wrap"},Je={class:"fcrm_bulk_processing--title"},et={class:"fcrm_secondary_text font-regular fcrm_mb_16 fcrm_bulk_processing--description"},tt={class:"fcrm_bulk_processing--bar d-flex items-center gap-4 fcrm_mb_6"},lt={class:"fcrm_secondary_text small fcrm_bulk_processing--count"};const st=ee({name:"BulkContactActions",props:["selectedSubscribers","options","pagination","theme_mode"],emits:["refetch"],components:{BulkContactCustomField:ee({name:"BulkContactCustomField",components:{ArrowLeft:m},props:["options","showPopover","theme_mode"],emits:["closePopover","openPopover","updateCustomField"],data:()=>({customFieldType:"",formattedCustomFields:{},data_operation:"",updating:!1,localShowPopover:!1}),watch:{showPopover(e){this.localShowPopover=e},localShowPopover(e){e?this.$emit("openPopover"):this.$emit("closePopover")},customFieldType(e){this.data_operation="",e&&(this.localShowPopover=!0)}},methods:{formatFields(){this.customFieldsList.forEach(e=>{"select-multi"===e.type||"checkbox"==e.type?this.formattedCustomFields[e.slug]=[]:this.formattedCustomFields[e.slug]=""})},handleCustomFieldBulk(){const e=this.selectedField,t=this.formattedCustomFields[e.slug];this.updating=!0,this.$emit("updateCustomField",{key:e.slug,type:e.type,value:t,operation:this.data_operation})},handleBack(){this.localShowPopover=!1,this.customFieldType=""}},computed:{contactPopoverClass(){return`fcrm_contact_popover ${"dark"===this.theme_mode?"fcrm-force-light":"fcrm-dark"}`},bulkSelectPopperClass(){return"dark"===this.theme_mode?"fcrm-force-light":"fcrm-dark"},bulkSelectWordbreakPopperClass(){return"dark"===this.theme_mode?"fcrm-force-light":""},customFieldsList(){return this.options.custom_fields||[]},selectedField(){return this.customFieldsList.find(e=>e.slug===this.customFieldType)}},mounted(){this.formatFields()}},[["render",function(e,i,n,c,m,b){const y=z("ArrowLeft"),g=o,k=a,v=p,w=u,C=t,x=d,$=r,S=s,A=l,F=h,V=f,P=_;return j(),L("div",Re,[M(V,{visible:m.localShowPopover,"onUpdate:visible":i[10]||(i[10]=e=>m.localShowPopover=e),placement:"bottom",width:300,trigger:"manual","popper-class":b.contactPopoverClass,effect:"dark"},{reference:D(()=>[M(w,{filterable:"",size:"small",class:"fcrm_bulk_select",placeholder:e.$t("Select Field"),effect:"dark","popper-class":b.bulkSelectPopperClass,modelValue:m.customFieldType,"onUpdate:modelValue":i[9]||(i[9]=e=>m.customFieldType=e),ref:"customFieldSelect"},{default:D(()=>[(j(!0),L(U,null,I(b.customFieldsList,(e,t)=>(j(),E(v,{key:t,value:e.slug,label:e.label},null,8,["value","label"]))),128))],void 0,!0),_:1},8,["placeholder","popper-class","modelValue"])]),default:D(()=>[b.selectedField?(j(),L("div",Te,[N("div",Oe,[M(k,{size:"small",text:"",onClick:b.handleBack,class:"fcrm_back_button"},{default:D(()=>[M(g,null,{default:D(()=>[M(y)],void 0,!0),_:1})],void 0,!0),_:1},8,["onClick"]),N("span",Be,W(b.selectedField.label),1)])])):Y("",!0),b.selectedField?(j(),L("div",ze,["select-one"===b.selectedField.type||"select-multi"==b.selectedField.type?(j(),L(U,{key:0},[M(w,{placeholder:e.$t("Select")+" "+b.selectedField.label,clearable:"",filterable:"",effect:"dark","popper-class":b.bulkSelectWordbreakPopperClass,modelValue:m.formattedCustomFields[b.selectedField.slug],"onUpdate:modelValue":i[0]||(i[0]=e=>m.formattedCustomFields[b.selectedField.slug]=e),multiple:"select-multi"==b.selectedField.type,class:"fcrm_full_width",size:"small",teleported:!1},{default:D(()=>[(j(!0),L(U,null,I(b.selectedField.options,e=>(j(),E(v,{key:e,value:e,label:e},null,8,["value","label"]))),128))],void 0,!0),_:1},8,["placeholder","popper-class","modelValue","multiple"]),"select-multi"==b.selectedField.type?(j(),E(w,{key:0,modelValue:m.data_operation,"onUpdate:modelValue":i[1]||(i[1]=e=>m.data_operation=e),size:"small",effect:"dark","popper-class":b.bulkSelectWordbreakPopperClass,class:"fcrm_full_width fcrm_mt_8",teleported:!1},{default:D(()=>[M(v,{value:"",label:e.$t("Replace Options")},null,8,["label"]),M(v,{value:"add",label:e.$t("Add Options")},null,8,["label"]),M(v,{value:"subtract",label:e.$t("Subtract Options")},null,8,["label"])],void 0,!0),_:1},8,["modelValue","popper-class"])):Y("",!0)],64)):"text"==b.selectedField.type||"number"==b.selectedField.type||"textarea"==b.selectedField.type?(j(),L(U,{key:1},[M(C,{placeholder:b.selectedField.label,size:"small",type:b.selectedField.type,modelValue:m.formattedCustomFields[b.selectedField.slug],"onUpdate:modelValue":i[2]||(i[2]=e=>m.formattedCustomFields[b.selectedField.slug]=e),class:"fcrm_full_width"},null,8,["placeholder","type","modelValue"]),"number"==b.selectedField.type?(j(),E(w,{key:0,modelValue:m.data_operation,"onUpdate:modelValue":i[3]||(i[3]=e=>m.data_operation=e),size:"small",effect:"dark","popper-class":b.bulkSelectWordbreakPopperClass,class:"fcrm_full_width fcrm_mt_8",teleported:!1},{default:D(()=>[M(v,{value:"",label:e.$t("Replace Value")},null,8,["label"]),M(v,{value:"add",label:e.$t("Add Value")},null,8,["label"]),M(v,{value:"subtract",label:e.$t("Subtract Value")},null,8,["label"])],void 0,!0),_:1},8,["modelValue","popper-class"])):Y("",!0)],64)):"radio"==b.selectedField.type?(j(),E($,{key:2,modelValue:m.formattedCustomFields[b.selectedField.slug],"onUpdate:modelValue":i[4]||(i[4]=e=>m.formattedCustomFields[b.selectedField.slug]=e),size:"small"},{default:D(()=>[(j(!0),L(U,null,I(b.selectedField.options,e=>(j(),E(x,{key:e,value:e,label:e,size:"large",class:"fcrm-radio"},null,8,["value","label"]))),128))],void 0,!0),_:1},8,["modelValue"])):"checkbox"==b.selectedField.type?(j(),L(U,{key:3},[M(A,{modelValue:m.formattedCustomFields[b.selectedField.slug],"onUpdate:modelValue":i[5]||(i[5]=e=>m.formattedCustomFields[b.selectedField.slug]=e),class:"fcrm_checkbox_group",size:"small"},{default:D(()=>[(j(!0),L(U,null,I(b.selectedField.options,e=>(j(),E(S,{key:e,size:"large",value:e,class:"fcrm_checkbox"},{default:D(()=>[q(W(e),1)],void 0,!0),_:2},1032,["value"]))),128))],void 0,!0),_:1},8,["modelValue"]),M(w,{modelValue:m.data_operation,"onUpdate:modelValue":i[6]||(i[6]=e=>m.data_operation=e),size:"small",effect:"dark","popper-class":b.bulkSelectWordbreakPopperClass,class:"fcrm_full_width fcrm_mt_8",teleported:!1},{default:D(()=>[M(v,{value:"",label:e.$t("Replace Options")},null,8,["label"]),M(v,{value:"add",label:e.$t("Add Options")},null,8,["label"]),M(v,{value:"subtract",label:e.$t("Subtract Options")},null,8,["label"])],void 0,!0),_:1},8,["modelValue","popper-class"])],64)):"date"==b.selectedField.type?(j(),E(F,{key:4,"value-format":"YYYY-MM-DD",modelValue:m.formattedCustomFields[b.selectedField.slug],"onUpdate:modelValue":i[7]||(i[7]=e=>m.formattedCustomFields[b.selectedField.slug]=e),type:"date",size:"large",class:"fcrm_full_width",teleported:!1,placeholder:e.$t("Pick a date")},null,8,["modelValue","placeholder"])):"date_time"==b.selectedField.type?(j(),E(F,{key:5,"value-format":"YYYY-MM-DD HH:mm:ss",modelValue:m.formattedCustomFields[b.selectedField.slug],"onUpdate:modelValue":i[8]||(i[8]=e=>m.formattedCustomFields[b.selectedField.slug]=e),type:"datetime",size:"large",style:{width:"100%"},teleported:!1,class:"fcrm_full_width",placeholder:e.$t("Pick a date and time")},null,8,["modelValue","placeholder"])):(j(),L(U,{key:6},[q(W(b.selectedField),1)],64)),N("div",je,[K((j(),E(k,{disabled:m.updating,type:"primary",size:"small",onClick:b.handleCustomFieldBulk},{default:D(()=>[q(W(e.$t("Update")),1)],void 0,!0),_:1},8,["disabled","onClick"])),[[P,m.updating]])])])):Y("",!0)],void 0),_:1},8,["visible","popper-class"])])}]]),Confirm:de,OptionSelector:me,Check:y,Loading:b},data(){return{delete_confirm_message:"<b>"+this.$t("Are you sure to delete?")+"</b><br />"+this.$t("delete_all_contacts_notice"),double_optin_confirm_message:"<b>"+this.$t("Are you sure to send double optin?")+"</b><br />"+this.$t("send_double_optin_contacts_notice"),actions:{},select_job:{action_name:"",selected_options:[]},doing_action:!1,select_status:"",allSelected:!1,processCount:0,processingAllBulk:!1,currentAllActionLastContactId:0,custom_field:{},showCustomFieldPopover:!1}},watch:{"select_job.action_name":{handler(){this.select_job.selected_options=[],this.select_status=""},deep:!0}},computed:{bulkSelectPopperClass(){return"dark"===this.theme_mode?"fcrm-force-light":"fcrm-dark"},bulkSelectWordbreakPopperClass(){return"dark"===this.theme_mode?"fcrm_select_options_wordbreak fcrm-force-light":"fcrm_select_options_wordbreak fcrm-dark"},currentAction(){return!!this.select_job.action_name&&this.actions[this.select_job.action_name]},canSelectAll(){return this.pagination&&this.selectedSubscribers.length<this.pagination.total&&this.selectedSubscribers.length==this.pagination.per_page&&window.fcrm_sub_params&&"subscribers"==this.$route.name}},methods:{handleBulkActionRoute(){if(!this.canSelectAll||!this.allSelected)return this.doBulkAction(),!1;this.$confirm("You are about to apply the selected action to all the contacts ("+this.formatMoney(this.pagination.total)+") of this filter. Please confirm.","Warning",{confirmButtonText:"Yes, let's do it!",cancelButtonText:"Cancel",type:"warning"}).then(()=>{this.resetAllBulkProgressState(),this.processingAllBulk=!0,this.processAllBulk()}).catch(()=>{this.allSelected=!1})},async doBulkAction(){const e=[];if(this.each(this.selectedSubscribers,t=>{e.push(t.id)}),!e.length)return this.$notify.error(this.$t("Please select subscribers first")),!1;this.doing_action=!0;const t=G(e,100),l={action_name:this.select_job.action_name,action_options:this.select_job.selected_options,new_status:this.select_status,custom_field:this.custom_field};for(let s=0;s<t.length;s++)await this.repeatBulkAction(t[s],l).then(e=>{s===t.length-1&&(this.$emit("refetch"),this.$notify.success(e.message))}).catch(e=>{this.handleError(e)});this.doing_action=!1},repeatBulkAction(e,t){return t.subscriber_ids=e,this.processCount+=e.length,this.$post("subscribers/do-bulk-action",t)},processAllBulk(e){const t={is_all:"yes",action_name:this.select_job.action_name,action_options:this.select_job.selected_options,new_status:this.select_status,custom_field:this.custom_field,last_id:this.currentAllActionLastContactId,per_page:400,contact_query:window.fcrm_sub_params};this.$post("subscribers/do-bulk-action",t).then(t=>{this.processCount+=parseInt(t.completed_contacts),t.is_completed?(this.processingAllBulk=!1,this.resetAllBulkProgressState(),this.$emit("refetch"),this.$notify.success(t.message),e&&e()):(this.currentAllActionLastContactId=t.last_contact_id,this.$nextTick(()=>{this.processAllBulk(e)}))}).catch(e=>{this.processingAllBulk=!1,this.resetAllBulkProgressState(),this.handleError(e)})},resetAllBulkProgressState(){this.processCount=0,this.currentAllActionLastContactId=0},updateCustomFieldValue(e){this.custom_field=e,this.showCustomFieldPopover=!1,this.handleBulkActionRoute()}},mounted(){this.actions={add_to_tags:{label:this.$t("Add To Tags"),options:this.options.tags},add_to_lists:{label:this.$t("Add To Lists"),options:this.options.lists},remove_from_tags:{label:this.$t("Remove From Tags"),options:this.options.tags},remove_from_lists:{label:this.$t("Remove From Lists"),options:this.options.lists},change_contact_status:{label:this.$t("Change Contact Status"),statuses:this.options.statuses},change_contact_type:{label:this.$t("Change Contact Type"),custom_options:this.appVars.contact_types,btn_text:this.$t("Change Contact Type"),is_multiple:!1},add_to_email_sequence:{label:this.$t("Add To Email Sequence")},add_to_automation:{label:this.$t("Add To Automation Funnel")}},this.appVars.custom_contact_bulk_actions&&this.appVars.custom_contact_bulk_actions.length&&this.each(this.appVars.custom_contact_bulk_actions,e=>{this.actions[e.action_name]||(this.actions[e.action_name]=e)}),this.has_company_module&&(this.actions.add_to_company={label:this.$t("Add To Company")},this.actions.remove_from_company={label:this.$t("Remove From Company")}),this.actions.send_double_optin={label:this.$t("Send Double Optin To Pending Contacts")},this.actions.update_custom_fields={label:this.$t("Update Custom Fields")},this.actions.delete_contacts={label:this.$t("Delete Contacts")}}},[["render",function(e,t,l,s,i,n){const c=p,r=u,d=z("Check"),m=o,h=a,f=z("Delete"),b=z("confirm"),y=z("option-selector"),v=z("BulkContactCustomField"),w=z("Loading"),C=g,x=k,$=_;return j(),L("div",Le,[N("div",Me,[N("div",De,[N("label",null,W(e.$t("Select Action")),1),M(r,{clearable:"",filterable:"",size:"small",class:"fcrm_bulk_select",placeholder:e.$t("Select Action"),"popper-class":n.bulkSelectPopperClass,effect:"dark",modelValue:i.select_job.action_name,"onUpdate:modelValue":t[0]||(t[0]=e=>i.select_job.action_name=e)},{default:D(()=>[(j(!0),L(U,null,I(i.actions,(e,t)=>(j(),E(c,{key:t,value:t,label:e.label},null,8,["value","label"]))),128))],void 0),_:1},8,["placeholder","popper-class","modelValue"])]),n.currentAction&&n.currentAction.options?(j(),L(U,{key:0},[M(r,{filterable:"",clearable:"",multiple:"","collapse-tags":"","max-collapse-tags":2,size:"small",class:"fcrm_bulk_select",placeholder:e.$t("Select"),"popper-class":n.bulkSelectWordbreakPopperClass,effect:"dark",modelValue:i.select_job.selected_options,"onUpdate:modelValue":t[1]||(t[1]=e=>i.select_job.selected_options=e)},{default:D(()=>[(j(!0),L(U,null,I(n.currentAction.options,e=>(j(),E(c,{key:e.id,value:e.id,label:e.title},null,8,["value","label"]))),128))],void 0),_:1},8,["placeholder","popper-class","modelValue"]),K((j(),E(h,{disabled:i.doing_action||!i.select_job.selected_options.length,onClick:t[2]||(t[2]=e=>n.handleBulkActionRoute()),type:"primary",size:"small"},{default:D(()=>[N("span",qe,[M(m,null,{default:D(()=>[M(d)],void 0,!0),_:1})]),q(" "+W(e.$t("Confirm")),1)],void 0),_:1},8,["disabled"])),[[$,i.doing_action]])],64)):"change_contact_status"==i.select_job.action_name?(j(),L(U,{key:1},[M(r,{filterable:"",clearable:"",size:"small",class:"fcrm_bulk_select",placeholder:e.$t("Select"),"popper-class":n.bulkSelectPopperClass,effect:"dark",modelValue:i.select_status,"onUpdate:modelValue":t[3]||(t[3]=e=>i.select_status=e)},{default:D(()=>[(j(!0),L(U,null,I(n.currentAction.statuses,e=>(j(),E(c,{key:e.id,value:e.id,label:e.title},null,8,["value","label"]))),128))],void 0),_:1},8,["placeholder","popper-class","modelValue"]),K((j(),E(h,{disabled:i.doing_action||!i.select_status,onClick:t[4]||(t[4]=e=>n.handleBulkActionRoute()),type:"primary",size:"small"},{default:D(()=>[N("span",We,[M(m,null,{default:D(()=>[M(d)],void 0,!0),_:1})]),q(" "+W(e.$t("Confirm")),1)],void 0),_:1},8,["disabled"])),[[$,i.doing_action]])],64)):"delete_contacts"==i.select_job.action_name?(j(),E(b,{key:2,placement:"top-start",message:i.delete_confirm_message,onYes:t[5]||(t[5]=e=>n.handleBulkActionRoute())},{reference:D(()=>[K((j(),E(h,{disabled:i.doing_action,size:"small",type:"danger",plain:""},{default:D(()=>[M(m,null,{default:D(()=>[M(f)],void 0,!0),_:1}),q(" "+W(e.$t("Delete Selected")),1)],void 0,!0),_:1},8,["disabled"])),[[$,i.doing_action]])]),_:1},8,["message"])):"send_double_optin"==i.select_job.action_name?(j(),E(b,{key:3,placement:"top-start",message:i.double_optin_confirm_message,onYes:t[6]||(t[6]=e=>n.handleBulkActionRoute())},{reference:D(()=>[K((j(),E(h,{disabled:i.doing_action,size:"small"},{default:D(()=>[M(m,{class:"fcrm_bulk_confirm_icon"},{default:D(()=>[M(d)],void 0,!0),_:1}),q(" "+W(e.$t("Send Double Opt-In")),1)],void 0,!0),_:1},8,["disabled"])),[[$,i.doing_action]])]),_:1},8,["message"])):"add_to_email_sequence"==i.select_job.action_name?(j(),L(U,{key:4},[e.has_campaign_pro?(j(),L(U,{key:1},[M(y,{modelValue:i.select_status,"onUpdate:modelValue":t[7]||(t[7]=e=>i.select_status=e),field:{option_key:"email_sequences",clearable:!0,size:"small"},effect:"dark",popper_class:n.bulkSelectPopperClass,class:"fcrm_bulk_select"},null,8,["modelValue","popper_class"]),M(b,{placement:"top-start",width:230,message:e.$t("Add_Contacts_To_Email_Sequence_Confirm_Message"),onYes:t[8]||(t[8]=e=>n.handleBulkActionRoute())},{reference:D(()=>[K((j(),E(h,{disabled:i.doing_action||!i.select_status,type:"primary",size:"small"},{default:D(()=>[N("span",Ie,[M(m,null,{default:D(()=>[M(d)],void 0,!0),_:1})]),q(" "+W(e.$t("Confirm")),1)],void 0,!0),_:1},8,["disabled"])),[[$,i.doing_action]])]),_:1},8,["message"])],64)):(j(),L("span",Ue,W(e.$t("Require FluentCRM Pro")),1))],64)):"add_to_company"==i.select_job.action_name?(j(),L(U,{key:5},[M(y,{modelValue:i.select_status,"onUpdate:modelValue":t[9]||(t[9]=e=>i.select_status=e),field:{option_key:"companies",clearable:!0,size:"small"},effect:"dark",popper_class:n.bulkSelectPopperClass,class:"fcrm_bulk_select"},null,8,["modelValue","popper_class"]),M(b,{placement:"top-start",width:230,message:e.$t("Add_Contacts_To_Company_Confirm_Message"),onYes:t[10]||(t[10]=e=>n.handleBulkActionRoute())},{reference:D(()=>[K((j(),E(h,{disabled:i.doing_action||!i.select_status,size:"small",type:"primary"},{default:D(()=>[N("span",Ee,[M(m,null,{default:D(()=>[M(d)],void 0,!0),_:1})]),q(" "+W(e.$t("Confirm")),1)],void 0,!0),_:1},8,["disabled"])),[[$,i.doing_action]])]),_:1},8,["message"])],64)):"remove_from_company"==i.select_job.action_name?(j(),L(U,{key:6},[M(y,{modelValue:i.select_status,"onUpdate:modelValue":t[11]||(t[11]=e=>i.select_status=e),field:{option_key:"companies",clearable:!0,size:"small"},effect:"dark",popper_class:n.bulkSelectPopperClass,class:"fcrm_bulk_select"},null,8,["modelValue","popper_class"]),M(b,{placement:"top-start",width:230,message:e.$t("Remove_Contacts_From_Company_Confirm_Message"),onYes:t[12]||(t[12]=e=>n.handleBulkActionRoute())},{reference:D(()=>[K((j(),E(h,{disabled:i.doing_action||!i.select_status,type:"primary",size:"small"},{default:D(()=>[N("span",Ne,[M(m,null,{default:D(()=>[M(d)],void 0,!0),_:1})]),q(" "+W(e.$t("Confirm")),1)],void 0,!0),_:1},8,["disabled"])),[[$,i.doing_action]])]),_:1},8,["message"])],64)):"add_to_automation"==i.select_job.action_name?(j(),L(U,{key:7},[e.has_campaign_pro?(j(),L(U,{key:1},[M(y,{modelValue:i.select_status,"onUpdate:modelValue":t[13]||(t[13]=e=>i.select_status=e),field:{option_key:"automation_funnels",clearable:!0,size:"small"},effect:"dark",popper_class:n.bulkSelectPopperClass,class:"fcrm_bulk_select"},null,8,["modelValue","popper_class"]),M(b,{placement:"top-start",width:230,message:e.$t("Add_Contacts_To_Automation_Confirm_Message"),onYes:t[14]||(t[14]=e=>n.handleBulkActionRoute())},{reference:D(()=>[K((j(),E(h,{disabled:i.doing_action||!i.select_status,type:"primary",size:"small"},{default:D(()=>[N("span",He,[M(m,null,{default:D(()=>[M(d)],void 0,!0),_:1})]),q(" "+W(e.$t("Confirm")),1)],void 0,!0),_:1},8,["disabled"])),[[$,i.doing_action]])]),_:1},8,["message"])],64)):(j(),L("span",Ye,W(e.$t("Require FluentCRM Pro")),1))],64)):"update_custom_fields"==i.select_job.action_name?(j(),E(v,{key:8,options:l.options,theme_mode:l.theme_mode,showPopover:i.showCustomFieldPopover,onUpdateCustomField:n.updateCustomFieldValue,onOpenPopover:t[15]||(t[15]=e=>i.showCustomFieldPopover=!0),onClosePopover:t[16]||(t[16]=e=>i.showCustomFieldPopover=!1)},null,8,["options","theme_mode","showPopover","onUpdateCustomField"])):n.currentAction&&n.currentAction.custom_options?(j(),L(U,{key:9},[M(r,{filterable:"",clearable:"",size:"small",multiple:n.currentAction.is_multiple,"collapse-tags":n.currentAction.is_multiple,"max-collapse-tags":n.currentAction.is_multiple?2:void 0,class:"fcrm_bulk_select",placeholder:e.$t("Select"),"popper-class":n.bulkSelectPopperClass,effect:"dark",modelValue:i.select_status,"onUpdate:modelValue":t[17]||(t[17]=e=>i.select_status=e)},{default:D(()=>[(j(!0),L(U,null,I(n.currentAction.custom_options,(e,t)=>(j(),E(c,{key:t,value:t,label:e},null,8,["value","label"]))),128))],void 0),_:1},8,["multiple","collapse-tags","max-collapse-tags","placeholder","popper-class","modelValue"]),K((j(),E(h,{disabled:i.doing_action||!i.select_status,onClick:t[18]||(t[18]=e=>n.handleBulkActionRoute()),type:"primary",size:"small"},{default:D(()=>[N("span",Ze,[M(m,null,{default:D(()=>[M(d)],void 0,!0),_:1})]),q(" "+W(e.$t("Confirm")),1)],void 0),_:1},8,["disabled"])),[[$,i.doing_action]])],64)):Y("",!0)]),n.canSelectAll?(j(),L("div",Ke,[i.allSelected?(j(),L("p",Ge,[q(W(e.$t("All %s contacts selected.",e.formatMoney(l.pagination.total)))+" ",1),M(h,{size:"small",text:"",onClick:t[19]||(t[19]=e=>i.allSelected=!1)},{default:D(()=>[q(W(e.$t("Select only this page")),1)],void 0),_:1})])):(j(),L("p",Qe,[q(W(e.$t("%s contacts selected.",e.formatMoney(this.selectedSubscribers.length)))+" ",1),M(h,{size:"small",text:"",onClick:t[20]||(t[20]=e=>i.allSelected=!0)},{default:D(()=>[q(W(e.$t("Select all %s contacts",e.formatMoney(l.pagination.total))),1)],void 0),_:1})]))])):Y("",!0),M(x,{modelValue:i.processingAllBulk,"onUpdate:modelValue":t[21]||(t[21]=e=>i.processingAllBulk=e),width:"450px","append-to-body":!0,"close-on-click-modal":!1,"modal-class":"fcrm_bulk_processing_dialog"},{default:D(()=>[i.processingAllBulk?(j(),L("div",Xe,[N("h3",Je,[q(W(e.$t("Action:"))+" "+W(n.currentAction.label)+" ",1),M(m,{class:"spin"},{default:D(()=>[M(w)],void 0,!0),_:1})]),N("div",et,W(e.$t("Please do not close this window while processing this bulk action")),1),N("div",tt,[M(C,{striped:"","striped-flow":"","text-inside":!1,"stroke-width":8,percentage:parseInt(i.processCount/l.pagination.total*100)},null,8,["percentage"])]),N("div",lt,W(e.$t("Processing %s of %s contacts",e.formatMoney(i.processCount),e.formatMoney(l.pagination.total))),1)])):Y("",!0)],void 0),_:1},8,["modelValue"])])}]]),at={name:"ContactsLoader",props:{columns:{type:Array,default:()=>[]},hasCompanyModule:{type:Boolean,default:!1},hasCommerceFields:{type:Boolean,default:!1},custom_fields:{type:Array,default:()=>[]},showSelection:{type:Boolean,default:!0},segmentColumnWidths:{type:Object,default:()=>({})},segmentColumnMinWidth:{type:Number,default:300},compactView:{type:Boolean,default:!1}},data:()=>({skeletonRows:[{id:1},{id:2},{id:3},{id:4},{id:5},{id:6},{id:7},{id:8},{id:9},{id:10}]})},ot={class:"fcrm_contact_cell fcrm_contact_cell--skeleton"},it={style:{flex:"1",display:"flex","flex-direction":"column",gap:"0"}},nt={class:"fcrm_pills fcrm_pills--skeleton"},ct={class:"fcrm_pills fcrm_pills--skeleton"},rt={class:"fcrm_company_cell fcrm_company_cell--skeleton"},dt={class:"fcrm_datetime_cell--skeleton"},mt={class:"fcrm_datetime_cell--skeleton"},ut={class:"fcrm_datetime_cell--skeleton"};function pt(e){if(null==e)return"";try{return(new Intl.NumberFormat).format(Number(e))}catch(t){return String(e)}}const ht={class:"fcrm_horizontal_filter_actions"},_t={class:"fcrm_empty_state"},ft={class:"fcrm_empty_state_text"},bt=["title","src","alt"],yt={class:"fcrm_contact_info"},gt={class:"fcrm_contact_name"},kt={class:"fcrm_contact_email"},vt={class:"d-flex gap-4 flex-wrap"},wt=["title"],Ct={class:"fcrm_badge fcrm_segment_more_badge"},xt={key:1},$t={class:"d-flex gap-4 flex-wrap"},St={class:"fcrm_badge fcrm_segment_more_badge"},At={key:1},Ft={key:0,class:"fcrm_company_photo"},Vt=["src"],Pt={style:{flex:"1"}},Rt={key:1},Tt={key:0},Ot={key:1},Bt={key:0},zt={key:1},jt={key:0},Lt={key:1},Mt=["title"],Dt={key:1},qt={key:0},Wt=["title"],Ut=["title"],It=["title"],Et={class:"icon"},Nt={key:0,class:"fcrm_selection_count_text"},Yt={class:"fcrm_selection_count_number"},Ht={class:"fcrm_selection_count_text"};const Zt=ee({name:"ContactsTable",components:{Badge:_e,ContactsLoader:ee(at,[["render",function(e,t,l,s,a,o){const i=C,n=w,c=v,r=x;return j(),E(r,{class:H(["fcrm_contacts_table fcrm_contacts_table--skeleton",{"fcrm_contacts_table--compact":l.compactView}]),data:a.skeletonRows,style:{width:"100%"},stripe:""},{default:D(()=>[l.showSelection?(j(),E(c,{key:0,width:"40"},{default:D(()=>[M(n,{animated:!0,style:{width:"16px"}},{template:D(()=>[M(i,{variant:"rect",style:{width:"16px",height:"16px","border-radius":"2px"}})]),_:1})]),_:1})):Y("",!0),M(c,{label:e.$t("Contact"),"min-width":"300"},{default:D(()=>[N("div",ot,[M(n,{animated:!0,style:{width:"36px",display:"flex",gap:"12px","flex-direction":"unset"}},{template:D(()=>[M(i,{variant:"circle",style:{width:"36px",height:"36px",flex:"none"}}),N("div",it,[M(i,{variant:"text",style:{flex:"1",height:"14px"}}),M(i,{variant:"text",style:{width:"50%",height:"14px"}})])]),_:1})])]),_:1},8,["label"]),-1!=l.columns.indexOf("prefix")?(j(),E(c,{key:1,label:e.$t("Prefix"),"min-width":"70"},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"40px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("first_name")?(j(),E(c,{key:2,label:e.$t("First Name"),"min-width":"140"},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"80px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("last_name")?(j(),E(c,{key:3,label:e.$t("Last Name"),"min-width":"140"},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"80px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("lists")?(j(),E(c,{key:4,label:e.$t("Lists"),width:l.segmentColumnWidths.lists,"min-width":l.segmentColumnMinWidth},{default:D(()=>[N("div",nt,[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"button",style:{width:"50px",height:"22px","border-radius":"11px"}}),M(i,{variant:"button",style:{width:"60px",height:"22px","border-radius":"11px"}})]),_:1})])]),_:1},8,["label","width","min-width"])):Y("",!0),-1!=l.columns.indexOf("tags")?(j(),E(c,{key:5,label:e.$t("Tags"),width:l.segmentColumnWidths.tags,"min-width":l.segmentColumnMinWidth},{default:D(()=>[N("div",ct,[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"button",style:{width:"55px",height:"22px","border-radius":"11px"}}),M(i,{variant:"button",style:{width:"65px",height:"22px","border-radius":"11px"}})]),_:1})])]),_:1},8,["label","width","min-width"])):Y("",!0),l.hasCompanyModule&&-1!=l.columns.indexOf("companies")?(j(),E(c,{key:6,"min-width":"230",label:e.$t("Companies")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"120px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),l.hasCompanyModule&&-1!=l.columns.indexOf("primary_company")?(j(),E(c,{key:7,"min-width":"220",label:e.$t("Primary Company")},{default:D(()=>[N("div",rt,[M(n,{animated:!0,style:{width:"28px"}},{template:D(()=>[M(i,{variant:"circle",style:{width:"28px",height:"28px"}})]),_:1}),M(n,{animated:!0,style:{"margin-left":"8px"}},{template:D(()=>[M(i,{variant:"text",style:{width:"100px",height:"14px"}})]),_:1})])]),_:1},8,["label"])):Y("",!0),l.hasCommerceFields?(j(),L(U,{key:8},[-1!=l.columns.indexOf("commerce.total_order_value")?(j(),E(c,{key:0,"min-width":"120",label:e.$t("Lifetime Value")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"60px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("commerce.total_order_count")?(j(),E(c,{key:1,"min-width":"120",label:e.$t("Order Count")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"40px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("commerce.first_order_date")?(j(),E(c,{key:2,"min-width":"180",label:e.$t("Customer Since")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"100px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("commerce.last_order_date")?(j(),E(c,{key:3,"min-width":"180",label:e.$t("Last order")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"80px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0)],64)):Y("",!0),-1!=l.columns.indexOf("phone")?(j(),E(c,{key:9,"min-width":"120",label:e.$t("Phone")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"90px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("date_of_birth")?(j(),E(c,{key:10,"min-width":"120",label:e.$t("Date of Birth")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"80px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("address_line_1")?(j(),E(c,{key:11,"min-width":"160",label:e.$t("Address Line 1")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"120px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("address_line_2")?(j(),E(c,{key:12,"min-width":"160",label:e.$t("Address Line 2")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"120px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("city")?(j(),E(c,{key:13,"min-width":"120",label:e.$t("City")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"70px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("state")?(j(),E(c,{key:14,"min-width":"120",label:e.$t("State")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"60px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("postal_code")?(j(),E(c,{key:15,"min-width":"120",label:e.$t("Zip Code")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"50px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("country")?(j(),E(c,{key:16,"min-width":"120",label:e.$t("Country")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"80px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("contact_type")?(j(),E(c,{key:17,width:"150",label:e.$t("Type")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"60px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("status")?(j(),E(c,{key:18,width:"150",label:e.$t("Status")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"button",style:{width:"70px",height:"24px","border-radius":"4px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),(j(!0),L(U,null,I(l.custom_fields,e=>(j(),E(c,{width:"200",key:e.slug,label:e.label},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"100px",height:"14px"}})]),_:1})]),_:1},8,["label"]))),128)),-1!=l.columns.indexOf("source")?(j(),E(c,{key:19,"min-width":"150",label:e.$t("Source")},{default:D(()=>[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"70px",height:"14px"}})]),_:1})]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("last_activity")?(j(),E(c,{key:20,"min-width":"190",label:e.$t("Last Activity")},{default:D(()=>[N("div",dt,[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"80px",height:"14px"}})]),_:1})])]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("created_at")?(j(),E(c,{key:21,"min-width":"190",label:e.$t("Date Added")},{default:D(()=>[N("div",mt,[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"80px",height:"14px"}})]),_:1})])]),_:1},8,["label"])):Y("",!0),-1!=l.columns.indexOf("updated_at")?(j(),E(c,{key:22,"min-width":"190",label:e.$t("Last Changed")},{default:D(()=>[N("div",ut,[M(n,{animated:!0},{template:D(()=>[M(i,{variant:"text",style:{width:"80px",height:"14px"}})]),_:1})])]),_:1},8,["label"])):Y("",!0)],void 0),_:1},8,["class","data"])}]]),Toggler:Ve,Manager:Se,Searcher:ie,PropertyChanger:Pe,PaginationBar:ne,DataTable:ce,FloatingBulkActionShell:re,BulkContactActions:st,FilterPopover:ue,ActiveFiltersBar:pe,Adder:he,CopyDocument:P,Plus:V,ArrowDown:c,Delete:F,Download:A,Fold:S,Expand:$,Icons:te},props:["subscribers","always_searchbar","show_skeleton","is_loading","query_data","pagination","options","ui_config","fire_ready_fetch","filter_type","allow_select_all"],emits:["export-selected","fetch"],data:()=>({selection:!1,selectedSubscribers:[],selectionCount:0,matched_tags:[],matched_lists:[],matched_statuses:[],columns:[],hasCustomFields:!1,hasCommerceFields:!1,countries:window.fcAdmin.countries,copiedText:{id:"",title:""},pageSizes:[10,20,50,80,100,120,150],localPerPage:10,segmentColumnMinWidth:300,segmentColumnWidths:{lists:void 0,tags:void 0},compactView:!1,compactRelationLimit:2,showSearcher:!1,showAdder:!1,selectedBulkAction:null,allSelected:!1,current_mode:"system"===se.getCurrentTheme()?se.getSystemTheme():se.getCurrentTheme()}),computed:{totalPages(){const e=Number(this.pagination&&this.pagination.per_page)||Number(this.localPerPage)||10,t=Number(this.pagination&&this.pagination.total)||0;return Math.max(1,Math.ceil(t/e))},custom_fields(){const e=this.appVars.contact_custom_fields;return e?e.filter(e=>-1!==this.columns.indexOf(e.slug)):[]},paginationPageSizes(){var e;return"subscribers"===(null==(e=this.$route)?void 0:e.name)?[10,20,50,100,150,300,600]:[]},canSelectAll(){if(!this.pagination||!this.pagination.per_page||!this.pagination.total)return!1;const e=this.selectedSubscribers.length===this.pagination.per_page,t=this.selectedSubscribers.length<this.pagination.total;if(this.allow_select_all)return e&&t;const l="subscribers"===this.$route.name,s=!!window.fcrm_sub_params;return l&&e&&t&&s},isAllSelected(){return this.allSelected}},methods:{fetch(){this.selection=!1,this.selectedSubscribers=[],this.selectedBulkAction=null,this.$refs.bulkActionsRef&&(this.$refs.bulkActionsRef.select_job.action_name="",this.$refs.bulkActionsRef.select_job.selected_options=[],this.$refs.bulkActionsRef.select_status=""),this.$emit("fetch")},getRelations:ye,getRelationsArray:be,formatCellValue:function(e,t){if(!e)return"";const l=e[t];return l&&"object"==typeof l?l.join(", "):l||""},visibleRelations(e,t){const l=this.getRelationsArray(e,t);return this.compactView?l.slice(0,this.compactRelationLimit):l},hiddenRelations(e,t){const l=this.getRelationsArray(e,t);return this.compactView?l.slice(this.compactRelationLimit):[]},hiddenRelationsTooltip(e,t){return this.hiddenRelations(e,t).join(", ")},moreRelationsLabel(e,t){const l=this.hiddenRelations(e,t).length;return this.$t("+%d more",l)},onSelection(e){this.selection=!!e.length,this.selectedSubscribers=e,e.length||(this.selectedBulkAction=null,this.allSelected=!1,this.$refs.bulkActionsRef&&(this.$refs.bulkActionsRef.select_job.action_name="",this.$refs.bulkActionsRef.select_job.selected_options=[],this.$refs.bulkActionsRef.select_status="",this.$refs.bulkActionsRef.allSelected=!1)),e.length>0&&e.length!==this.pagination.per_page&&(this.allSelected=!1,this.$refs.bulkActionsRef&&(this.$refs.bulkActionsRef.allSelected=!1));const t={},l={};e.forEach(e=>{e.tags.forEach(e=>this.match(e,t)),e.lists.forEach(e=>this.match(e,l))}),this.selectionCount=e.length,this.matched_tags=t,this.matched_lists=l},match(e,t){t[e.slug]?t[e.slug]++:t[e.slug]=1},handleSortable(e){"descending"===e.order?(this.query_data.sort_by=e.prop,this.query_data.sort_type="DESC"):(this.query_data.sort_by=e.prop,this.query_data.sort_type="ASC"),this.fetch()},statusClass(e){switch((e||"").toString().toLowerCase()){case"subscribed":return"fcrm_badge--success";case"unsubscribed":default:return"fcrm_badge--neutral";case"pending":return"fcrm_badge--away";case"transactional":return"fcrm_badge--feature";case"bounced":return"fcrm_badge--info";case"complained":return"fcrm_badge--warning";case"spammed":return"fcrm_badge--error"}},subscribe({type:e,payload:t}){const{attach:l,detach:s}=t;this.loading=!0;const a={type:e,attach:l,detach:s,subscribers:this.selectedSubscribers.map(e=>e.id)};this.$post("subscribers/sync-segments",a).then(t=>{t.subscribers.forEach(e=>{const t=this.subscribers.findIndex(t=>t.id===e.id);-1!==t&&this.subscribers.splice(t,1,e),this.$refs.subscribersTable.toggleRowSelection(this.subscribers[t])});const l=`selected_${e}`;if(this[l]&&this[l].length&&s&&s.length){const t=this[l].filter(e=>s.includes(e));t.length&&this.filter({type:e,payload:t})}this.loading=!1,this.$notify.success({title:this.$t("Great!"),message:t.message,offset:19})})},maybeReFetch(){let e=!1;if(!this.hasCommerceFields&&this.appVars.commerce_provider){this.columns.filter(e=>0===e.indexOf("commerce.")).length&&(e=!0,this.hasCommerceFields=!0,this.query_data.has_commerce=!0)}-1!==this.columns.indexOf("primary_company")&&(this.query_data.primary_company=!0,e=!0),!this.hasCustomFields&&this.custom_fields.length&&(this.query_data.custom_fields=!0,this.hasCustomFields=!0,e=!0),e&&this.fetch()},filter({type:e,payload:t}){return this.query_data[e]=t,this.pagination.current_page=1,this.fetch()},search(e,t){this.options[e]=t},listeners(){this.addAction("search-subscribers","fluentcrm",e=>{this.query_data.search=e,this.pagination.current_page=1,this.fetch()}),this.addAction("loading","fluentcrm",e=>{this.loading=e})},countryName(e){return function(e,t=[]){const l=t.find(t=>t.code===e);return l?l.title:""}(e,this.countries)},copyText(e,t){if(this.copiedText.id=t,!e)return void(this.copiedText.title=this.$t("Nothing to copy"));const l=ge(e);this.copiedText.title=l?this.$t("Copied"):this.$t("Failed to copy")},handleFilterApply(e){this.query_data.lists=e.lists||[],this.query_data.tags=e.tags||[],this.query_data.statuses=e.statuses||[],this.pagination.current_page=1,this.fetch()},handleFilterBarChange(e){this.query_data.lists=e.lists||[],this.query_data.tags=e.tags||[],this.query_data.statuses=e.statuses||[],void 0!==e.search&&(this.query_data.search=e.search),this.pagination.current_page=1,this.fetch()},handleOpenFilter(e){this.$nextTick(()=>{var t,l;null==(l=null==(t=this.$refs.filterPopoverRef)?void 0:t.openFilterCategory)||l.call(t,e)})},handleAdderFetch(){this.showAdder=!1,this.fetch()},handleDeleteSelected(){this.selectedBulkAction="delete_contacts",this.$nextTick(()=>{this.$refs.bulkActionsRef&&(this.$refs.bulkActionsRef.select_job.action_name="delete_contacts",this.$refs.bulkActionsRef.handleBulkActionRoute())})},handleExportSelected(){this.$emit("export-selected",{subscribers:this.selectedSubscribers,allSelected:this.allSelected,query_data:this.query_data})},handleSelectAll(){this.canSelectAll&&(this.$refs.subscribersTable&&this.subscribers&&this.subscribers.length>0&&this.subscribers.forEach(e=>{this.$refs.subscribersTable.toggleRowSelection(e,!0)}),this.allSelected=!0,this.$nextTick(()=>{this.$refs.bulkActionsRef&&(this.$refs.bulkActionsRef.allSelected=!0,this.$refs.bulkActionsRef.$forceUpdate())}))},handleSelectOnlyThisPage(){this.allSelected=!1,this.$refs.bulkActionsRef&&(this.$refs.bulkActionsRef.allSelected=!1,this.$refs.bulkActionsRef.$forceUpdate())},handleDeselectAll(){this.$refs.subscribersTable&&this.$refs.subscribersTable.clearSelection(),this.selection=!1,this.selectedSubscribers=[],this.selectedBulkAction=null,this.allSelected=!1,this.$refs.bulkActionsRef&&(this.$refs.bulkActionsRef.allSelected=!1,this.$refs.bulkActionsRef.select_job.action_name="",this.$refs.bulkActionsRef.select_job.selected_options=[],this.$refs.bulkActionsRef.select_status="")},handleBulkActionRefetch(){fe().invalidateCache(),this.selectedBulkAction=null,this.fetch()},formatMoney:pt,getStoredSegmentColumnWidths(){const e=this.storage.get("contact_segment_column_widths",{}),t={};return["lists","tags"].forEach(l=>{const s=parseInt(e[l],10);s&&(t[l]=Math.max(s,this.segmentColumnMinWidth))}),t},initializeSegmentColumnWidths(){const e=this.getStoredSegmentColumnWidths();this.segmentColumnWidths={lists:e.lists,tags:e.tags}},initializeCompactView(){this.compactView="yes"===this.storage.get("contact_compact_table_view","no")},setCompactView(e){this.compactView=!!e,this.storage.set("contact_compact_table_view",this.compactView?"yes":"no"),this.$nextTick(()=>{var e;null==(e=this.$refs.subscribersTable)||e.doLayout()})},toggleCompactView(){this.setCompactView(!this.compactView)},handleColumnResize(e,t,l){if(!l||-1===["lists","tags"].indexOf(l.property))return;const s=Math.max(parseInt(e,10)||this.segmentColumnMinWidth,this.segmentColumnMinWidth);this.segmentColumnWidths={...this.segmentColumnWidths,[l.property]:s},this.storage.set("contact_segment_column_widths",this.segmentColumnWidths)},resetTablePreferences(){this.storage.remove("contact_segment_column_widths"),this.storage.remove("contact_compact_table_view"),this.segmentColumnWidths={lists:void 0,tags:void 0},this.compactView=!1,this.$nextTick(()=>{var e;null==(e=this.$refs.subscribersTable)||e.doLayout()}),this.$notify.success({title:this.$t("Done"),message:this.$t("Table preferences have been reset"),offset:19})},initializePerPage(){const e=parseInt(this.storage.get("contact_perpage",10))||10;this.pagination&&this.pagination.per_page?this.localPerPage=this.pagination.per_page:(this.localPerPage=e,this.pagination&&(this.pagination.per_page=e))}},watch:{"pagination.per_page":{handler(e){e&&e!==this.localPerPage&&(this.localPerPage=e)},immediate:!0},pagination:{handler(e){e&&e.per_page&&e.per_page!==this.localPerPage&&(this.localPerPage=e.per_page)},deep:!0,immediate:!0}},created(){this.initializePerPage(),this.initializeSegmentColumnWidths(),this.initializeCompactView()},mounted(){this.initializePerPage(),this.listeners(),this.onThemeChanged=e=>{var t;this.current_mode=(null==(t=e.detail)?void 0:t.effective)||se.getCurrentTheme()},window.addEventListener(le,this.onThemeChanged),this.syncAllSelectedInterval=setInterval(()=>{this.$refs.bulkActionsRef&&this.$refs.bulkActionsRef.allSelected!==this.allSelected&&(this.allSelected=this.$refs.bulkActionsRef.allSelected)},100)},beforeUnmount(){this.syncAllSelectedInterval&&clearInterval(this.syncAllSelectedInterval),this.onThemeChanged&&window.removeEventListener(le,this.onThemeChanged)}},[["render",function(e,t,l,s,i,n){const c=z("searcher"),r=z("filter-popover"),d=z("toggler"),m=z("Expand"),u=z("Fold"),p=o,h=a,_=R,f=z("active-filters-bar"),b=z("ContactsLoader"),y=z("icons"),g=v,k=z("CopyDocument"),w=z("router-link"),C=z("Badge"),$=x,S=z("pagination-bar"),A=z("data-table"),F=z("bulk-contact-actions"),V=z("Icons"),P=z("floating-bulk-action-shell");return j(),L("div",{class:H([{fcrm_has_selections:i.selectedSubscribers.length},"fcrm_company_contacts_wrap"]),style:{position:"relative"}},[M(A,{"has-selection":!1},Q({"header-left":D(()=>[M(c,{disabled:"advanced"==l.filter_type,modelValue:l.query_data.search,"onUpdate:modelValue":t[0]||(t[0]=e=>l.query_data.search=e)},null,8,["disabled","modelValue"])]),"header-actions":D(()=>[Z(e.$slots,"before_search_box"),M(r,{ref:"filterPopoverRef",disabled:"advanced"===l.filter_type,options:{lists:l.ui_config.show_list?l.options.lists:[],tags:l.ui_config.show_tag?l.options.tags:[],statuses:l.options.statuses},"selected-filters":l.query_data,onApply:n.handleFilterApply},null,8,["disabled","options","selected-filters","onApply"]),N("div",ht,[M(d,{onDataChanged:t[1]||(t[1]=e=>n.maybeReFetch()),modelValue:i.columns,"onUpdate:modelValue":t[2]||(t[2]=e=>i.columns=e)},null,8,["modelValue"]),M(_,{placement:"bottom",content:i.compactView?e.$t("Default View"):e.$t("Compact View")},{default:D(()=>[M(h,{size:"small",class:H(["small only-icon-btn fcrm_compact_view_toggle",{"is-active":i.compactView}]),"aria-label":i.compactView?e.$t("Default View"):e.$t("Compact Compact View"),onClick:n.toggleCompactView},{default:D(()=>[M(p,null,{default:D(()=>[i.compactView?(j(),E(m,{key:0})):(j(),E(u,{key:1}))],void 0,!0),_:1})],void 0,!0),_:1},8,["class","aria-label","onClick"])],void 0,!0),_:1},8,["content"])]),Z(e.$slots,"after_search_box")]),"active-filters":D(()=>["advanced"!==l.filter_type?(j(),E(f,{key:0,"selected-filters":l.query_data,options:{lists:l.ui_config.show_list?l.options.lists:[],tags:l.ui_config.show_tag?l.options.tags:[],statuses:l.options.statuses},onFilterChange:n.handleFilterBarChange,onOpenFilter:n.handleOpenFilter,plus_filter_icon:!0},null,8,["selected-filters","options","onFilterChange","onOpenFilter"])):Y("",!0)]),table:D(()=>[Z(e.$slots,"before_contacts_table"),l.show_skeleton?(j(),E(b,{key:0,columns:i.columns,"has-company-module":e.has_company_module,hasCommerceFields:i.hasCommerceFields,custom_fields:n.custom_fields,showSelection:e.hasPermission("fcrm_manage_contacts"),segmentColumnWidths:i.segmentColumnWidths,segmentColumnMinWidth:i.segmentColumnMinWidth,compactView:i.compactView},null,8,["columns","has-company-module","hasCommerceFields","custom_fields","showSelection","segmentColumnWidths","segmentColumnMinWidth","compactView"])):(j(),E($,{key:1,class:H(["fcrm_contacts_table",{"fcrm_contacts_table--compact":i.compactView}]),"default-sort":{prop:l.query_data.sort_by,order:"DESC"==l.query_data.sort_type?"descending":"ascending"},data:l.subscribers,border:"",id:"fluentcrm-subscribers-table",onSelectionChange:n.onSelection,style:{width:"100%"},stripe:"",onSortChange:n.handleSortable,onHeaderDragend:n.handleColumnResize,ref:"subscribersTable"},{empty:D(()=>[N("div",_t,[M(y,{"icon-name":"common-empty-state"}),N("div",ft,[N("span",null,W(e.$t("Please create a contact to view")),1)])])]),default:D(()=>[e.hasPermission("fcrm_manage_contacts")?(j(),E(g,{key:0,type:"selection",width:"50"})):Y("",!0),M(g,{label:e.$t("Contact"),"min-width":"300",property:"first_name",sortable:"custom"},{default:D(t=>[M(w,{class:"fcrm_contact_cell",to:{name:"subscriber",params:{id:t.row.id}}},{default:D(()=>[N("img",{title:e.$t("Contact ID:")+" "+t.row.id,class:"fcrm_contact_photo",src:t.row.photo,alt:t.row.full_name},null,8,bt),N("div",yt,[N("div",gt,W(t.row.full_name),1),N("div",kt,[q(W(t.row.email)+" ",1),M(_,{placement:"top",content:i.copiedText.id==t.row.id?i.copiedText.title:e.$t("Copy Email")},{default:D(()=>[M(p,{class:"fcrm_copy-text",role:"button",tabindex:"0","aria-label":e.$t("Copy Email"),onClick:J(e=>n.copyText(t.row.email,t.row.id),["stop","prevent"]),onKeydown:[X(J(e=>n.copyText(t.row.email,t.row.id),["prevent","stop"]),["enter"]),X(J(e=>n.copyText(t.row.email,t.row.id),["prevent","stop"]),["space"])]},{default:D(()=>[M(k)],void 0,!0),_:1},8,["aria-label","onClick","onKeydown"])],void 0,!0),_:2},1032,["content"])])])],void 0,!0),_:2},1032,["to"])]),_:1},8,["label"]),-1!=i.columns.indexOf("prefix")?(j(),E(g,{key:1,label:e.$t("Prefix"),"min-width":"70",property:"prefix"},{default:D(e=>[q(W(e.row.prefix),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("first_name")?(j(),E(g,{key:2,label:e.$t("First Name"),"min-width":"140",property:"first_name",sortable:"custom"},{default:D(e=>[q(W(e.row.first_name),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("last_name")?(j(),E(g,{key:3,label:e.$t("Last Name"),"min-width":"140",property:"last_name",sortable:"custom"},{default:D(e=>[q(W(e.row.last_name),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("lists")?(j(),E(g,{key:4,label:e.$t("Lists"),property:"lists",width:i.segmentColumnWidths.lists,"min-width":i.segmentColumnMinWidth,sortable:!1},{default:D(e=>[N("div",vt,[n.getRelationsArray(e.row,"lists").length?(j(),L(U,{key:0},[(j(!0),L(U,null,I(n.visibleRelations(e.row,"lists"),e=>(j(),L("span",{key:e,class:"fcrm_badge"},[N("span",{title:e},W(e),9,wt)]))),128)),n.hiddenRelations(e.row,"lists").length?(j(),E(_,{key:0,placement:"top",content:n.hiddenRelationsTooltip(e.row,"lists")},{default:D(()=>[N("span",Ct,W(n.moreRelationsLabel(e.row,"lists")),1)],void 0,!0),_:2},1032,["content"])):Y("",!0)],64)):(j(),L("span",xt,"--"))])]),_:1},8,["label","width","min-width"])):Y("",!0),-1!=i.columns.indexOf("tags")?(j(),E(g,{key:5,label:e.$t("Tags"),property:"tags",width:i.segmentColumnWidths.tags,"min-width":i.segmentColumnMinWidth},{default:D(e=>[N("div",$t,[n.getRelationsArray(e.row,"tags").length?(j(),L(U,{key:0},[(j(!0),L(U,null,I(n.visibleRelations(e.row,"tags"),e=>(j(),L("span",{key:e,class:"fcrm_badge"},W(e),1))),128)),n.hiddenRelations(e.row,"tags").length?(j(),E(_,{key:0,placement:"top",content:n.hiddenRelationsTooltip(e.row,"tags")},{default:D(()=>[N("span",St,W(n.moreRelationsLabel(e.row,"tags")),1)],void 0,!0),_:2},1032,["content"])):Y("",!0)],64)):(j(),L("span",At,"--"))])]),_:1},8,["label","width","min-width"])):Y("",!0),-1!=i.columns.indexOf("status")?(j(),E(g,{key:6,label:e.$t("Status"),width:"150",property:"status",sortable:"custom"},{default:D(e=>[M(C,{type:e.row.status},null,8,["type"])]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("phone")?(j(),E(g,{key:7,"min-width":"120",label:e.$t("Phone"),property:"phone"},{default:D(t=>[q(W(t.row.phone)+" ",1),t.row.phone?(j(),E(_,{key:0,class:"fcrm_item",effect:"dark",placement:"top",content:i.copiedText.id==t.row.id?i.copiedText.title:e.$t("Copy Phone Number")},{default:D(()=>[M(p,{class:"fcrm_copy-text",role:"button",tabindex:"0","aria-label":e.$t("Copy Phone Number"),onClick:J(e=>n.copyText(t.row.phone,t.row.id),["stop"]),onKeydown:[X(J(e=>n.copyText(t.row.phone,t.row.id),["stop"]),["enter"]),X(J(e=>n.copyText(t.row.phone,t.row.id),["prevent","stop"]),["space"])]},{default:D(()=>[M(k)],void 0,!0),_:1},8,["aria-label","onClick","onKeydown"])],void 0,!0),_:2},1032,["content"])):Y("",!0)]),_:1},8,["label"])):Y("",!0),e.has_company_module&&-1!=i.columns.indexOf("companies")?(j(),E(g,{key:8,"min-width":"230",label:e.$t("Companies"),property:"companies"},{default:D(e=>[N("span",null,W(n.getRelations(e.row,"companies")),1)]),_:1},8,["label"])):Y("",!0),e.has_company_module&&-1!=i.columns.indexOf("primary_company")?(j(),E(g,{key:9,"min-width":"220",label:e.$t("Primary Company")},{default:D(e=>[e.row.company?(j(),E(w,{key:0,to:{name:"view_company",params:{company_id:e.row.company_id}},class:"fcrm_company_cell fcrm_photo_text"},{default:D(()=>[e.row.company.logo?(j(),L("span",Ft,[N("img",{src:e.row.company.logo},null,8,Vt)])):Y("",!0),N("span",Pt,W(e.row.company.name),1)],void 0,!0),_:2},1032,["to"])):(j(),L("span",Rt,"--"))]),_:1},8,["label"])):Y("",!0),i.hasCommerceFields?(j(),L(U,{key:10},[-1!=i.columns.indexOf("commerce.total_order_value")?(j(),E(g,{key:0,"min-width":"120",label:e.$t("Lifetime Value"),property:"commerce_by_provider.total_order_value"},{default:D(t=>[t.row.commerce_by_provider?(j(),L("span",Tt,W(e.appVars.commerce_currency_sign)+W(t.row.commerce_by_provider.total_order_value||"-"),1)):(j(),L("span",Ot,"-"))]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("commerce.total_order_count")?(j(),E(g,{key:1,"min-width":"120",label:e.$t("Order Count"),property:"commerce_by_provider.total_order_count"},{default:D(e=>[e.row.commerce_by_provider?(j(),L("span",Bt,W(e.row.commerce_by_provider.total_order_count||"-"),1)):(j(),L("span",zt,"-"))]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("commerce.first_order_date")?(j(),E(g,{key:2,"min-width":"180",label:e.$t("Customer Since"),property:"commerce_by_provider.first_order_date"},{default:D(t=>[t.row.commerce_by_provider&&t.row.commerce_by_provider.first_order_date?(j(),L("span",jt,W(e.nsDateFormat(t.row.commerce_by_provider.first_order_date)),1)):(j(),L("span",Lt,"-"))]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("commerce.last_order_date")?(j(),E(g,{key:3,"min-width":"180",label:e.$t("Last order"),property:"commerce_by_provider.last_order_date"},{default:D(t=>[t.row.commerce_by_provider&&t.row.commerce_by_provider.last_order_date?(j(),L("span",{key:0,title:t.row.commerce_by_provider.last_order_date},W(e.nsHumanDiffTime(t.row.commerce_by_provider.last_order_date)),9,Mt)):(j(),L("span",Dt,"-"))]),_:1},8,["label"])):Y("",!0)],64)):Y("",!0),-1!=i.columns.indexOf("date_of_birth")?(j(),E(g,{key:11,"min-width":"120",label:e.$t("Date of Birth"),property:"date_of_birth"},{default:D(e=>[q(W("0000-00-00"!==e.row.date_of_birth?e.row.date_of_birth:"-"),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("address_line_1")?(j(),E(g,{key:12,"min-width":"160",label:e.$t("Address Line 1"),property:"address_line_1",sortable:"custom"},{default:D(e=>[q(W(e.row.address_line_1),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("address_line_2")?(j(),E(g,{key:13,"min-width":"160",label:e.$t("Address Line 2"),property:"address_line_2",sortable:"custom"},{default:D(e=>[q(W(e.row.address_line_2),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("city")?(j(),E(g,{key:14,"min-width":"120",label:e.$t("City"),property:"city",sortable:"custom"},{default:D(e=>[q(W(e.row.city),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("state")?(j(),E(g,{key:15,"min-width":"120",label:e.$t("State"),property:"state",sortable:"custom"},{default:D(e=>[q(W(e.row.state),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("postal_code")?(j(),E(g,{key:16,"min-width":"120",label:e.$t("Zip Code"),property:"postal_code",sortable:"custom"},{default:D(e=>[q(W(e.row.postal_code),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("country")?(j(),E(g,{key:17,"min-width":"120",label:e.$t("Country"),property:"country",sortable:"custom"},{default:D(e=>[q(W(n.countryName(e.row.country)),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("contact_type")?(j(),E(g,{key:18,label:e.$t("Type"),width:"150",property:"contact_type",sortable:"custom"},{default:D(t=>[q(W(e.ucWords(e.trans(t.row.contact_type))),1)]),_:1},8,["label"])):Y("",!0),(j(!0),L(U,null,I(n.custom_fields,e=>(j(),E(g,{width:"200",key:e.slug,label:e.label},{default:D(t=>[q(W(n.formatCellValue(t.row.custom_fields,e.slug)),1)]),_:2},1032,["label"]))),128)),-1!=i.columns.indexOf("source")?(j(),E(g,{key:19,"min-width":"150",label:e.$t("Source"),property:"source"},{default:D(e=>[q(W(e.row.source),1)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("last_activity")?(j(),E(g,{key:20,prop:"last_activity",label:e.$t("Last Activity"),"min-width":"190",property:"last_activity",sortable:"custom"},{default:D(t=>[t.row.last_activity?(j(),L("span",qt,[N("span",{title:t.row.last_activity},W(e.nsHumanDiffTime(t.row.last_activity)),9,Wt)])):Y("",!0)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("created_at")?(j(),E(g,{key:21,label:e.$t("Date Added"),"min-width":"190",property:"created_at",sortable:"custom"},{default:D(t=>[t.row.created_at?(j(),L("span",{key:0,class:"fcrm_secondary_text",title:t.row.created_at},W(e.nsHumanDiffTime(t.row.created_at)),9,Ut)):Y("",!0)]),_:1},8,["label"])):Y("",!0),-1!=i.columns.indexOf("updated_at")?(j(),E(g,{key:22,label:e.$t("Last Changed"),"min-width":"190",property:"updated_at",sortable:"custom"},{default:D(t=>[t.row.updated_at?(j(),L("span",{key:0,class:"fcrm_secondary_text",title:t.row.updated_at},W(e.nsHumanDiffTime(t.row.updated_at)),9,It)):Y("",!0)]),_:1},8,["label"])):Y("",!0)],void 0,!0),_:1},8,["class","default-sort","data","onSelectionChange","onSortChange","onHeaderDragend"]))]),_:2},[l.show_skeleton?void 0:{name:"pagination",fn:D(()=>[M(S,{pagination:l.pagination,hide_on_single:!1,page_sizes:n.paginationPageSizes,"wrapper-class":["fcrm-contacts-pagination","fcrm-contacts-pagination-bar"],onFetch:n.fetch},null,8,["pagination","page_sizes","onFetch"])]),key:"0"}]),1024),M(P,{visible:i.selection,"theme-mode":i.current_mode,"selected-count":i.selectedSubscribers.length,"selected-label":e.$t("selected"),"show-select-all":n.canSelectAll&&!n.isAllSelected,"show-select-only-page":n.canSelectAll&&n.isAllSelected,"select-all-label":e.$t("Select All %s",n.formatMoney(l.pagination.total)),"select-only-page-label":e.$t("Select only this page"),"deselect-label":e.$t("Deselect"),onSelectAll:n.handleSelectAll,onSelectOnlyPage:n.handleSelectOnlyThisPage,onDeselect:n.handleDeselectAll},{actions:D(()=>[M(F,{ref:"bulkActionsRef",onRefetch:n.handleBulkActionRefetch,pagination:l.pagination,selectedSubscribers:i.selectedSubscribers,options:l.options,theme_mode:i.current_mode},null,8,["onRefetch","pagination","selectedSubscribers","options","theme_mode"]),M(h,{size:"small",onClick:n.handleExportSelected},{default:D(()=>[N("span",Et,[M(V,{"icon-name":"export"})]),q(" "+W(e.$t("Export")),1)],void 0,!0),_:1},8,["onClick"])]),count:D(()=>[n.isAllSelected?(j(),L("span",Nt,W(e.$t("All %s selected",n.formatMoney(l.pagination.total))),1)):(j(),L(U,{key:1},[N("span",Yt,W(i.selectedSubscribers.length),1),N("span",Ht,W(e.$t("selected")),1)],64))]),_:1},8,["visible","theme-mode","selected-count","selected-label","show-select-all","show-select-only-page","select-all-label","select-only-page-label","deselect-label","onSelectAll","onSelectOnlyPage","onDeselect"])],2)}]]);export{Zt as C,pt as f};

Youez - 2016 - github.com/yon3zu
LinuXploit