HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dmstechonline/whatsapp.dmstech.online/public/build/assets/ContactTable-85d4de1f.js
import{m as Q,r as g,G as Y,o as a,f as H,g as x,c as i,t as l,a as e,k as E,h as k,b as c,F as O,e as z,u as S,K as ee,O as G,q as te,a7 as se,S as oe,w as le,v as ae,d as re,n as _,j as b,i as q}from"./app-884e4ce3.js";import{d as ie}from"./debounce-42603f74.js";import{_ as ne}from"./Modal-a947e544.js";import{t as F}from"./index-d349a931.js";import{_ as de}from"./Dropdown-5f5db5e5.js";import{_ as ce,a as V}from"./DropdownItem-ce580ecd.js";import{P as ue}from"./Pagination-6803fb76.js";const me={key:0,class:"text-sm text-slate-600 mt-4"},pe={key:1,class:"text-sm text-slate-600"},fe={class:"text-sm text-slate-600 underline flex mt-4 mb-6"},ve=["href"],he={class:"max-w-md w-full gap-y-8"},ge={class:"space-y-6"},ye={class:"text-center"},we={class:"flex text-sm text-gray-600"},xe={for:"file-upload",class:"relative cursor-pointer bg-white rounded-md font-medium text-indigo-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500"},be={class:"pl-1"},ke={class:"text-xs text-gray-500"},_e={key:1,class:"flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md"},Ce={class:"rounded-md p-1 bg-slate-50 text-center text-sm"},$e={class:"mt-4"},Me={key:0,class:"mt-2"},Se={key:0,class:"bg-green-50 px-2 py-2 flex rounded-md justify-between items-center mb-1"},je={class:"mt-1 text-sm"},Ze={class:"text-green-800 flex items-center gap-x-2"},Be={key:1,class:"bg-red-50 px-2 py-2 flex rounded-md justify-between items-center mb-1"},Ie={class:"mt-1 text-sm"},Ne={class:"text-red-600 flex items-center gap-x-2"},Te={key:2,class:"bg-red-50 px-2 py-2 flex rounded-md justify-between items-center mb-1"},Ve={class:"mt-1 text-sm"},Oe={class:"text-red-600 flex items-center gap-x-2"},Le={key:3,class:"bg-red-50 px-2 py-2 flex rounded-md justify-between items-center mb-1"},Ae={class:"mt-1 text-sm"},De={class:"text-red-600 flex items-center gap-x-2"},Fe={key:4},Ee={class:"mt-2"},ze={class:"bg-slate-50 text-sm grid grid-cols-2 p-1 py-2 rounded-md border-b-2 border-white"},Ge={class:"col-1 pl-2"},Pe={class:"col-1 flex justify-between items-center"},Ue={class:"col-1 pl-2"},Je={class:"col-1"},Xe={key:2,class:"mt-5"},Re={class:"flex justify-center mt-2 w-full"},We={__name:"ContactImportModal",props:["type","modelValue"],emits:["update:modelValue"],setup(f,{emit:L}){const d=f,v=L,u=Q(()=>ee().props.flash.status),C=d.type==="contact"?F("Import contacts"):F("Import contact groups"),$=g(d.modelValue),y=g(null),m=g(null),p=g(!1);Y(()=>d.modelValue,n=>{$.value=n});const h=n=>{n.preventDefault();const r=n.target.files[0];Z(r)},j=n=>{n.preventDefault();const r=n.dataTransfer.files[0];Z(r)};function Z(n){if(!["text/csv","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(n.type)){alert(F("please select a CSV or XLSX file"));return}y.value=n.name;const r=new FormData;r.append("file",n),G.post(d.type==="contact"?"/contacts/import":"/contact-groups/import",r,{forceFormData:!0,onProgress:w=>{m.value="pending"},onSuccess:()=>{m.value="complete"},onError:w=>{m.value=null}})}function B(){$.value=!1,v("update:modelValue",!1),setTimeout(()=>{m.value=null},500)}function I(){p.value=!p.value}return(n,r)=>(a(),H(ne,{label:S(C),isOpen:$.value},{default:x(()=>[f.type==="contact"?(a(),i("div",me,l(n.$t("Upload a csv/xlsx to import your contact data. For the phone field ensure that you start with the contact's country code.")),1)):(a(),i("div",pe,l(n.$t("Upload a csv/xlsx to import your contact groups data.")),1)),e("div",fe,[e("a",{href:f.type==="contact"?"/contacts.xlsx":"/contact-groups.xlsx"},l(n.$t("Click here to download sample template")),9,ve)]),e("div",he,[e("div",ge,[m.value==null||m.value=="complete"?(a(),i("div",{key:0,onDragover:r[1]||(r[1]=E(()=>{},["prevent"])),onDrop:j,class:"flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md"},[e("input",{type:"file",class:"sr-only",accept:".csv,.xlsx",ref:"fileInput",id:"file-upload",onChange:r[0]||(r[0]=w=>h(w))},null,544),e("div",ye,[e("div",null,[r[3]||(r[3]=e("svg",{class:"mx-auto h-12 w-12 text-gray-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("g",{fill:"none"},[e("path",{fill:"currentColor",d:"m15.393 4.054l-.502.557l.502-.557Zm3.959 3.563l-.502.557l.502-.557Zm2.302 2.537l-.685.305l.685-.305ZM3.172 20.828l.53-.53l-.53.53Zm17.656 0l-.53-.53l.53.53ZM14 21.25h-4v1.5h4v-1.5ZM2.75 14v-4h-1.5v4h2.5Zm18.5-.437V14h2.5v-.437h-1.5ZM14.891 4.61l3.959 3.563l1.003-1.115l-3.958-3.563l-1.004 1.115Zm7.859 8.952c0-1.689.015-2.758-.41-3.714l-1.371.61c.266.598.281 1.283.281 3.104h2.5Zm-3.9-5.389c1.353 1.218 1.853 1.688 2.119 2.285l1.37-.61c-.426-.957-1.23-1.66-2.486-2.79L18.85 8.174ZM10.03 2.75c1.582 0 2.179.012 2.71.216l.538-1.4c-.852-.328-1.78-.316-3.248-.316v1.5Zm5.865.746c-1.086-.977-1.765-1.604-2.617-1.93l-.537 1.4c.532.204.98.592 2.15 1.645l1.004-1.115ZM10 21.25c-1.907 0-3.261-.002-4.29-.14c-1.005-.135-1.585-.389-2.008-.812l-1.06 1.06c.748.75 1.697 1.081 2.869 1.239c1.15.155 2.625.153 4.489.153v-1.5ZM1.25 14c0 1.864-.002 3.338.153 4.489c.158 1.172.49 2.121 1.238 2.87l1.06-1.06c-.422-.424-.676-1.004-.811-2.01c-.138-1.027-.14-2.382-.14-4.289h-1.5ZM14 22.75c1.864 0 3.338.002 4.489-.153c1.172-.158 2.121-.49 2.87-1.238l-1.06-1.06c-.424.422-1.004.676-2.01.811c-1.027.138-2.382.14-4.289.14v1.5ZM21.25 14c0 1.907-.002 3.262-.14 4.29c-.135 1.005-.389 1.585-.812 2.008l1.06 1.06c.75-.748 1.081-1.697 1.239-2.869c.155-1.15.153-2.625.153-4.489h-1.5Zm-18.5-4c0-1.907.002-3.261.14-4.29c.135-1.005.389-1.585.812-2.008l-1.06-1.06c-.75.748-1.081 1.697-1.239 2.869C1.248 6.661 1.25 8.136 1.25 10h2.5Zm7.28-8.75c-1.875 0-3.356-.002-4.511.153c-1.177.158-2.129.49-2.878 1.238l1.06 1.06c.424-.422 1.005-.676 2.017-.811c1.033-.138 2.395-.14 4.312-.14v-1.5Z"}),e("path",{stroke:"currentColor","stroke-width":"1.5",d:"M13 2.5V5c0 2.357 0 3.536.732 4.268C14.464 10 15.643 10 18 10h4"})])],-1)),e("div",we,[e("label",xe,[e("span",null,l(n.$t("Click to upload a file")),1)]),e("p",be,l(n.$t("Or drag and drop")),1)]),e("p",ke,l(n.$t("CSV/XLSX files only")),1)])])],32)):(a(),i("div",_e,[e("div",null,[r[4]||(r[4]=e("svg",{class:"mx-auto h-12 w-12 text-gray-400",xmlns:"http://www.w3.org/2000/svg",width:"50",height:"50",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"black","stroke-dasharray":"15","stroke-dashoffset":"15","stroke-linecap":"round","stroke-width":"2",d:"M12 3C16.9706 3 21 7.02944 21 12"},[e("animate",{fill:"freeze",attributeName:"stroke-dashoffset",dur:"0.3s",values:"15;0"}),e("animateTransform",{attributeName:"transform",dur:"1.5s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})])],-1)),r[5]||(r[5]=e("div",{class:"text-center mb-2 text-sm text-gray-500"},"Upload In Progress",-1)),e("div",Ce,l(y.value),1)])])),e("div",$e,[m.value=="complete"?(a(),i("div",Me,[u.value.import_summary.successful_imports?(a(),i("div",Se,[e("div",je,[e("div",Ze,[r[6]||(r[6]=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 16 16"},[e("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[e("path",{d:"M14.25 8.75c-.5 2.5-2.385 4.854-5.03 5.38A6.25 6.25 0 0 1 3.373 3.798C5.187 1.8 8.25 1.25 10.75 2.25"}),e("path",{d:"m5.75 7.75l2.5 2.5l6-6.5"})])],-1)),k(" "+l(u.value.import_summary.successful_imports+"/"+u.value.import_summary.total_imports)+" "+l(n.$t("rows added successfully!")),1)])])])):c("",!0),u.value.import_summary.duplicate_entries?(a(),i("div",Be,[e("div",Ie,[e("div",Ne,[r[7]||(r[7]=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M15.71 8.29a1 1 0 0 0-1.42 0L12 10.59l-2.29-2.3a1 1 0 0 0-1.42 1.42l2.3 2.29l-2.3 2.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l2.29-2.3l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L13.41 12l2.3-2.29a1 1 0 0 0 0-1.42m3.36-3.36A10 10 0 1 0 4.93 19.07A10 10 0 1 0 19.07 4.93m-1.41 12.73A8 8 0 1 1 20 12a7.95 7.95 0 0 1-2.34 5.66"})],-1)),k(" "+l(u.value.import_summary.duplicate_entries)+" duplicates found ",1)])])])):c("",!0),u.value.import_summary.invalid_format_entries?(a(),i("div",Te,[e("div",Ve,[e("div",Oe,[r[8]||(r[8]=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M15.71 8.29a1 1 0 0 0-1.42 0L12 10.59l-2.29-2.3a1 1 0 0 0-1.42 1.42l2.3 2.29l-2.3 2.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l2.29-2.3l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L13.41 12l2.3-2.29a1 1 0 0 0 0-1.42m3.36-3.36A10 10 0 1 0 4.93 19.07A10 10 0 1 0 19.07 4.93m-1.41 12.73A8 8 0 1 1 20 12a7.95 7.95 0 0 1-2.34 5.66"})],-1)),k(" "+l(u.value.import_summary.invalid_format_entries)+" formatting issues found ",1)])])])):c("",!0),u.value.import_summary.failed_limit_entries?(a(),i("div",Le,[e("div",Ae,[e("div",De,[r[9]||(r[9]=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M15.71 8.29a1 1 0 0 0-1.42 0L12 10.59l-2.29-2.3a1 1 0 0 0-1.42 1.42l2.3 2.29l-2.3 2.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l2.29-2.3l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L13.41 12l2.3-2.29a1 1 0 0 0 0-1.42m3.36-3.36A10 10 0 1 0 4.93 19.07A10 10 0 1 0 19.07 4.93m-1.41 12.73A8 8 0 1 1 20 12a7.95 7.95 0 0 1-2.34 5.66"})],-1)),k(" "+l(u.value.import_summary.failed_limit_entries)+" failed due to contact limit ",1)])])])):c("",!0),u.value.import_summary.failed_rows_details&&u.value.import_summary.failed_rows_details.length>0?(a(),i("div",Fe,[e("div",Ee,[e("div",ze,[e("div",Ge,l(n.$t("Row")),1),e("div",Pe,[e("span",null,l(n.$t("Error")),1),e("button",{onClick:I,class:"bg-primary text-white text-[11px] rounded px-2"},l(p.value?n.$t("Hide"):n.$t("Show")),1)])]),p.value?(a(!0),i(O,{key:0},z(u.value.import_summary.failed_rows_details,(w,N)=>(a(),i("div",{class:"bg-red-50 text-[12px] grid grid-cols-2 border-white border-r border-l border-b p-1 rounded-md",key:N},[e("div",Ue,l(w.row),1),e("div",Je,l(w.error),1)]))),128)):c("",!0)])])):c("",!0)])):c("",!0)])])]),m.value==null||m.value=="complete"?(a(),i("div",Xe,[e("div",Re,[e("button",{type:"button",onClick:r[2]||(r[2]=w=>B()),class:"w-full inline-flex justify-center rounded-md border border-transparent bg-primary px-4 py-2 text-sm text-white hover:text-slate-500 hover:bg-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2"},l(n.$t("Close")),1)])])):c("",!0)]),_:1},8,["label","isOpen"]))}},qe={class:"px-4 pb-2"},He={class:"border border-[#f0f2f5] rounded-md mt-6 flex items-center py-[2px] md:py-[2px]"},Ke=["placeholder"],Qe={key:1,class:"pr-2"},Ye={class:"flex justify-between px-4 border-b"},et={class:"flex items-center space-x-2"},tt={key:0,class:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},st={key:0},ot={key:1},lt={class:"float-right"},at=["href"],rt={class:"h-[5vh]"},it={class:"flex justify-between text-sm border-b"},nt={class:"flex-grow overflow-y-auto h-[65vh]",ref:"scrollContainer"},dt=["onClick"],ct=["onClick"],ut={key:0,class:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},mt={class:"w-[15%]"},pt=["src"],ft={key:1,class:"rounded-full bg-secondary/10 text-secondary flex justify-center items-center h-12 w-12"},vt={class:"w-[75%]"},ht={class:"text-slate-500 text-xs truncate"},gt={class:"w-[10%]"},yt={key:0,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},wt=["onClick"],xt=["onClick"],bt={key:0,class:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},kt={class:"w-[15%]"},_t={class:"rounded-full bg-secondary/10 text-secondary flex justify-center items-center h-12 w-12 capitalize"},Ct={class:"w-[85%] flex items-center"},$t={class:"px-4 pb-4"},Tt={__name:"ContactTable",props:["rows","filters","type"],emits:["callback"],setup(f,{emit:L}){var X,R,W;const d=f,v=g({id:(X=d.filters)==null?void 0:X.id,search:(R=d.filters)==null?void 0:R.search,page:(W=d.filters)==null?void 0:W.page}),u=g(!1),C=g(!1),$=L,y=g(!1),m=g(0),p=g([]),h=g([]);function j(o){v.value.id=o;const t=Object.fromEntries(Object.entries(v.value).filter(([s,M])=>M!==null));$("callback",t)}const Z=()=>{v.value.search=null,I()},B=ie(()=>{v.value.page=null,C.value=!0,I()},1e3),I=()=>{const o=Object.fromEntries(Object.entries(v.value).filter(([t,s])=>s!==null));G.visit(d.type==="contact"?"/contacts":"/contact-groups",{method:"get",data:o})};function n(){d.type==="contact"?localStorage.setItem("checkedContacts",JSON.stringify(p.value)):localStorage.setItem("checkedGroups",JSON.stringify(h.value))}function r(){if(d.type==="contact"){const o=localStorage.getItem("checkedContacts");p.value=o?JSON.parse(o):[]}else{const o=localStorage.getItem("checkedGroups");h.value=o?JSON.parse(o):[]}}function w(o,t){if(d.type==="contact"){const s=p.value.indexOf(o);t&&s===-1?p.value.push(o):!t&&s!==-1&&p.value.splice(s,1)}else{const s=h.value.indexOf(o);t&&s===-1?h.value.push(o):!t&&s!==-1&&h.value.splice(s,1)}n()}function N(o){const t=d.rows.data.find(s=>s.uuid===o);t.isChecked=!t.isChecked,w(o,t.isChecked),U(),D()}function P(){y.value=!y.value,d.rows.data.forEach(o=>{o.isChecked=y.value,w(o.uuid,y.value)}),D()}function A(){d.rows.data.forEach(o=>{o.isChecked=d.type==="contact"?p.value.includes(o.uuid):h.value.includes(o.uuid)}),U(),D()}function U(){y.value=d.rows.data.length>0&&d.rows.data.every(o=>o.isChecked)}function D(){m.value=d.type==="contact"?p.value.length:h.value.length}function J(o){const t=d.type==="contact"?p.value:h.value;G.visit(d.type==="contact"?"/contacts":"/contact-groups",{method:"delete",data:{uuids:o==="all"?[]:t},preserveState:!0,onSuccess:()=>{localStorage.removeItem(d.type==="contact"?"checkedContacts":"checkedGroups"),d.type==="contact"?p.value=[]:h.value=[]}})}return te(()=>{r(),A()}),se(()=>{A()}),oe(()=>{var o;v.value.page=(o=d.filters)==null?void 0:o.page,A()}),(o,t)=>(a(),i(O,null,[e("div",qe,[e("div",He,[t[10]||(t[10]=e("span",{class:"pl-3 py-2"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 15l6 6m-11-4a7 7 0 1 1 0-14a7 7 0 0 1 0 14Z"})])],-1)),le(e("input",{onInput:t[0]||(t[0]=(...s)=>S(B)&&S(B)(...s)),"onUpdate:modelValue":t[1]||(t[1]=s=>v.value.search=s),type:"text",class:"w-full outline-none rounded-xl py-2 pl-2 mr-2 text-sm",placeholder:f.type==="contact"?o.$t("Search name or phone or email"):o.$t("Search name")},null,40,Ke),[[ae,v.value.search]]),C.value===!1&&v.value.search?(a(),i("button",{key:0,onClick:Z,type:"button",class:"pr-2"},t[8]||(t[8]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10s10-4.5 10-10S17.5 2 12 2zm3.7 12.3c.4.4.4 1 0 1.4c-.4.4-1 .4-1.4 0L12 13.4l-2.3 2.3c-.4.4-1 .4-1.4 0c-.4-.4-.4-1 0-1.4l2.3-2.3l-2.3-2.3c-.4-.4-.4-1 0-1.4c.4-.4 1-.4 1.4 0l2.3 2.3l2.3-2.3c.4-.4 1-.4 1.4 0c.4.4.4 1 0 1.4L13.4 12l2.3 2.3z"})],-1)]))):c("",!0),C.value?(a(),i("span",Qe,t[9]||(t[9]=[re('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="0 12 12;90 12 12;180 12 12;270 12 12"></animateTransform><animate attributeName="opacity" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" begin="0.2s" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="30 12 12;120 12 12;210 12 12;300 12 12"></animateTransform><animate attributeName="opacity" begin="0.2s" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" begin="0.4s" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="60 12 12;150 12 12;240 12 12;330 12 12"></animateTransform><animate attributeName="opacity" begin="0.4s" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle></svg>',1)]))):c("",!0)])]),e("div",Ye,[e("div",et,[e("label",{onClick:t[2]||(t[2]=s=>P()),for:"myCheckbox",class:"cursor-pointer"},[e("div",{class:_(["w-4 h-4 border border-gray-400 rounded-md flex items-center justify-center",{"bg-secondary":y.value}])},[y.value?(a(),i("svg",tt,t[11]||(t[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):c("",!0)],2)]),e("label",{onClick:t[3]||(t[3]=s=>P()),class:"cursor-pointer text-sm"},[m.value==0?(a(),i("span",st,l(o.$t("Select all"))+" ("+l(m.value)+")",1)):m.value>0?(a(),i("span",ot,l(m.value)+" "+l(o.$t("selected")),1)):c("",!0)])]),e("div",null,[e("div",lt,[b(de,{align:"right",class:"mt-2"},{items:x(()=>[b(ce,null,{default:x(()=>[b(V,{as:"button",onClick:t[4]||(t[4]=s=>u.value=!0)},{default:x(()=>[k(l(o.$t("Import rows")),1)]),_:1}),b(V,{as:"button"},{default:x(()=>[e("a",{href:f.type==="contact"?"/contacts/export":"/contact-groups/export",class:"w-full h-full"},l(o.$t("Export to xlsx")),9,at)]),_:1}),m.value>0?(a(),H(V,{key:0,as:"button",onClick:t[5]||(t[5]=s=>J())},{default:x(()=>[k(l(o.$t("Delete selected")),1)]),_:1})):c("",!0),b(V,{as:"button",onClick:t[6]||(t[6]=s=>J("all"))},{default:x(()=>[k(l(o.$t("Delete all")),1)]),_:1})]),_:1})]),default:x(()=>[t[12]||(t[12]=e("button",{class:"inline-flex w-full justify-center rounded-md text-sm font-medium text-black hbg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"},[e("span",{class:"hover:shadow-md bg-slate-50 rounded-full w-[fit-content] p-2"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},[e("path",{fill:"black",d:"M8 2.5a1.22 1.22 0 0 1 1.25 1.17A1.21 1.21 0 0 1 8 4.84a1.21 1.21 0 0 1-1.25-1.17A1.22 1.22 0 0 1 8 2.5m0 8.66a1.17 1.17 0 1 1-1.25 1.17A1.21 1.21 0 0 1 8 11.16m0-4.33a1.17 1.17 0 1 1 0 2.34a1.17 1.17 0 1 1 0-2.34"})])])],-1))]),_:1})])])]),e("div",rt,[e("div",it,[b(S(q),{href:"/contacts",class:_(["pt-3 w-1/2 text-center pb-1 hover:bg-slate-50",{"bg-gray-50 border-b-2 border-slate-700":o.$page.url.startsWith("/contacts")}])},{default:x(()=>[k(l(o.$t("All contacts")),1)]),_:1},8,["class"]),b(S(q),{href:"/contact-groups",class:_(["pt-3 w-1/2 text-center pb-1 hover:bg-slate-50",{"bg-gray-50 border-b-2 border-slate-700":o.$page.url.startsWith("/contact-groups")}])},{default:x(()=>[k(l(o.$t("Groups")),1)]),_:1},8,["class"])])]),e("div",nt,[f.type==="contact"?(a(!0),i(O,{key:0},z(f.rows.data,(s,M)=>{var T;return a(),i("div",{onClick:K=>j(s.uuid),class:_(["flex space-x-2 hover:bg-gray-50 cursor-pointer px-4 py-3 border-b",s.isChecked?"bg-gray-50":""]),key:M},[e("div",null,[e("label",{onClick:E(K=>N(s.uuid),["stop"]),for:"myCheckbox",class:"cursor-pointer"},[e("div",{class:_(["w-4 h-4 border border-gray-400 rounded-md flex items-center justify-center mt-1",{"bg-secondary":s.isChecked}])},[s.isChecked?(a(),i("svg",ut,t[13]||(t[13]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):c("",!0)],2)],8,ct)]),e("div",mt,[s.avatar?(a(),i("img",{key:0,class:"rounded-full h-12 w-12",src:s.avatar},null,8,pt)):(a(),i("div",ft,l((T=s.first_name)==null?void 0:T.substring(0,1)),1))]),e("div",vt,[e("h3",null,l(s==null?void 0:s.full_name),1),e("p",ht,l(s.formatted_phone_number),1)]),e("div",gt,[s.is_favorite?(a(),i("svg",yt,t[14]||(t[14]=[e("path",{fill:"#FFD700",d:"M9.153 5.408C10.42 3.136 11.053 2 12 2c.947 0 1.58 1.136 2.847 3.408l.328.588c.36.646.54.969.82 1.182c.28.213.63.292 1.33.45l.636.144c2.46.557 3.689.835 3.982 1.776c.292.94-.546 1.921-2.223 3.882l-.434.507c-.476.557-.715.836-.822 1.18c-.107.345-.071.717.001 1.46l.066.677c.253 2.617.38 3.925-.386 4.506c-.766.582-1.918.051-4.22-1.009l-.597-.274c-.654-.302-.981-.452-1.328-.452c-.347 0-.674.15-1.328.452l-.596.274c-2.303 1.06-3.455 1.59-4.22 1.01c-.767-.582-.64-1.89-.387-4.507l.066-.676c.072-.744.108-1.116 0-1.46c-.106-.345-.345-.624-.821-1.18l-.434-.508c-1.677-1.96-2.515-2.941-2.223-3.882c.293-.941 1.523-1.22 3.983-1.776l.636-.144c.699-.158 1.048-.237 1.329-.45c.28-.213.46-.536.82-1.182z"},null,-1)]))):c("",!0)])],10,dt)}),128)):f.type==="group"?(a(!0),i(O,{key:1},z(f.rows.data,(s,M)=>(a(),i("div",{onClick:T=>j(s.uuid),class:_(["flex space-x-2 hover:bg-gray-50 cursor-pointer px-4 py-3 border-b",s.isChecked?"bg-gray-50":""]),key:M},[e("div",null,[e("label",{onClick:E(T=>N(s.uuid),["stop"]),for:"myCheckbox",class:"cursor-pointer"},[e("div",{class:_(["w-4 h-4 border border-gray-400 rounded-md flex items-center justify-center mt-1",{"bg-secondary":s.isChecked}])},[s.isChecked?(a(),i("svg",bt,t[15]||(t[15]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):c("",!0)],2)],8,xt)]),e("div",kt,[e("div",_t,l(s.name.substring(0,1)),1)]),e("div",Ct,[e("h3",null,l(s.name),1)])],10,wt))),128)):c("",!0)],512),e("div",$t,[b(ue,{class:"mt-3",pagination:f.rows.meta},null,8,["pagination"])]),b(We,{type:f.type,modelValue:u.value,"onUpdate:modelValue":t[7]||(t[7]=s=>u.value=s)},null,8,["type","modelValue"])],64))}};export{We as _,Tt as a};