| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/OrganizationTable-48dfaf5d.js |
import{T as M,r as $,O as A,o as m,c as p,a as s,w as j,v as F,u as f,b as C,d as L,f as e,g as t,k as i,t as n,F as T,e as D,i as R,n as H,j as U}from"./app-f1493ab2.js";import{d as Z}from"./debounce-7f7c0d78.js";import{_ as q}from"./AlertModal-2bf70f0d.js";import{u as E}from"./useAlertModal-3aa166da.js";/* empty css */import{_ as I}from"./Table-700fbce6.js";import{T as P,a as G,_ as o}from"./TableHeaderRowItem-6e9202af.js";import{T as J,a as K,_ as d}from"./TableBodyRowItem-551209f9.js";import{_ as Q}from"./Dropdown-c843374c.js";import{_ as W,a as k}from"./DropdownItem-5a13c2ff.js";const X={class:"md:bg-white flex items-center border border-primary md:border-none md:shadow-sm h-12 md:h-10 md:w-80 rounded-[0.5rem] mb-6 text-xl md:text-sm"},Y=["placeholder"],ee={key:1,class:"pr-2"},te={class:"float-right"},ae={class:"py-1 rounded-[5px] text-xs px-3 bg-[#ddebf7] text-slate-700"},se={class:"py-1 rounded-[5px] text-xs px-3 bg-[#ddebf7] text-slate-700"},le={class:"float-right"},he={__name:"OrganizationTable",props:{rows:{type:Object,required:!0},filters:{type:Object}},emits:["delete"],setup(b,{emit:ne}){const g=b,{isOpenAlert:h,openAlert:N,confirmAlert:B}=E(),V=M({test:null}),z=a=>{V.delete("/admin/organizations/"+a)},S=a=>a===g.rows.data.length-1,c=$({search:g.filters.search}),w=$(!1),O=()=>{c.value.search=null,_()},v=Z(()=>{w.value=!0,_()},1e3),_=()=>{const a=window.location.pathname;A.visit(a,{method:"get",data:c.value})};return(a,l)=>(m(),p(T,null,[s("div",X,[l[6]||(l[6]=s("span",{class:"pl-3"},[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[s("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)),j(s("input",{onInput:l[0]||(l[0]=(...r)=>f(v)&&f(v)(...r)),"onUpdate:modelValue":l[1]||(l[1]=r=>c.value.search=r),type:"text",class:"outline-none px-4 w-full bg-inherit",placeholder:a.$t("Search organizations")},null,40,Y),[[F,c.value.search]]),w.value===!1&&c.value.search?(m(),p("button",{key:0,onClick:O,type:"button",class:"pr-2"},l[4]||(l[4]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[s("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),w.value?(m(),p("span",ee,l[5]||(l[5]=[L('<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(I,{rows:b.rows},{default:t(()=>[e(P,null,{default:t(()=>[e(G,null,{default:t(()=>[e(o,{position:"first"},{default:t(()=>[i(n(a.$t("Name")),1)]),_:1}),e(o,{class:"hidden sm:table-cell"},{default:t(()=>[i(n(a.$t("Owner")),1)]),_:1}),e(o,{class:"hidden sm:table-cell"},{default:t(()=>[i(n(a.$t("Owner email")),1)]),_:1}),e(o,{class:"hidden sm:table-cell"},{default:t(()=>[s("span",null,n(a.$t("Seats")),1)]),_:1}),e(o,{class:"hidden sm:table-cell"},{default:t(()=>[i(n(a.$t("Plan")),1)]),_:1}),e(o,{class:"hidden sm:table-cell"},{default:t(()=>[i(n(a.$t("Next billing date")),1)]),_:1}),e(o,{class:"hidden sm:table-cell"},{default:t(()=>[s("span",te,n(a.$t("Last updated")),1)]),_:1}),e(o,{position:"last"})]),_:1})]),_:1}),e(J,null,{default:t(()=>[(m(!0),p(T,null,D(b.rows.data,(r,y)=>(m(),R(K,{key:y,class:H(S(y)?"":"border-b")},{default:t(()=>[e(d,{position:"first",class:"capitalize"},{default:t(()=>[i(n(r.name),1)]),_:2},1024),e(d,{class:"hidden sm:table-cell"},{default:t(()=>[i(n(r.owner.user.full_name),1)]),_:2},1024),e(d,{class:"hidden sm:table-cell"},{default:t(()=>[i(n(r.owner.user.email),1)]),_:2},1024),e(d,{class:"hidden sm:table-cell"},{default:t(()=>[s("span",null,n(r.teams_count),1)]),_:2},1024),e(d,{class:"hidden sm:table-cell"},{default:t(()=>{var u,x;return[s("span",ae,n(((x=(u=r.subscription)==null?void 0:u.plan)==null?void 0:x.name)??a.$t("Not set")),1)]}),_:2},1024),e(d,{class:"capitalize"},{default:t(()=>{var u;return[s("span",se,n(((u=r.subscription)==null?void 0:u.next_billing_date)??"Not Set"),1)]}),_:2},1024),e(d,{class:"hidden sm:table-cell"},{default:t(()=>[s("span",le,n(r.updated_at),1)]),_:2},1024),e(d,{position:"last"},{default:t(()=>[e(Q,{align:"right",class:"mt-2"},{items:t(()=>[e(W,null,{default:t(()=>[e(k,{href:"/admin/organizations/"+r.uuid},{default:t(()=>[i(n(a.$t("View/edit")),1)]),_:2},1032,["href"]),e(k,{as:"button",onClick:u=>f(N)(r.uuid)},{default:t(()=>[i(n(a.$t("Delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),default:t(()=>[l[7]||(l[7]=s("button",{class:"inline-flex w-full justify-center rounded-md text-sm font-medium text-black hover:bg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"},[s("span",{class:"hover:bg-[#F6F7F9] hover:rounded-full w-[fit-content] p-2"},[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[s("path",{fill:"currentColor",d:"M12 16a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2Z"})])])],-1))]),_:2},1024)]),_:2},1024)]),_:2},1032,["class"]))),128))]),_:1})]),_:1},8,["rows"]),e(q,{modelValue:f(h),"onUpdate:modelValue":l[2]||(l[2]=r=>U(h)?h.value=r:null),onConfirm:l[3]||(l[3]=()=>f(B)(z)),label:a.$t("Delete row"),description:a.$t("Are you sure you want to delete this row? This action can not be undone")},null,8,["modelValue","label","description"])],64))}};export{he as _};