| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/OrganizationTable-92cabe70.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,e,f as t,k as o,t as l,F as T,d as L,h as D,n as R,i as H,j as U}from"./app-43851608.js";import{d as Z}from"./debounce-729b203d.js";import{_ as q}from"./AlertModal-1a288ce3.js";import{u as E}from"./useAlertModal-27d09708.js";/* empty css */import{_ as I}from"./Table-69702a89.js";import{T as P,a as G,_ as r}from"./TableHeaderRowItem-459897e8.js";import{T as J,a as K,_ as d}from"./TableBodyRowItem-110be769.js";import{_ as Q}from"./Dropdown-6e7c10b4.js";import{_ as W,a as k}from"./DropdownItem-48d91d39.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=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),ee=["placeholder"],te=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),ae=[te],se={key:1,class:"pr-2"},le=U('<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),ne=[le],oe={class:"float-right"},ie={class:"py-1 rounded-[5px] text-xs px-3 bg-[#ddebf7] text-slate-700"},re={class:"py-1 rounded-[5px] text-xs px-3 bg-[#ddebf7] text-slate-700"},de={class:"float-right"},ce=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),xe={__name:"OrganizationTable",props:{rows:{type:Object,required:!0},filters:{type:Object}},emits:["delete"],setup(h,{emit:ue}){const w=h,{isOpenAlert:b,openAlert:N,confirmAlert:B}=E(),V=M({test:null}),z=a=>{V.delete("/admin/organizations/"+a)},S=a=>a===w.rows.data.length-1,u=$({search:w.filters.search}),_=$(!1),O=()=>{u.value.search=null,v()},g=Z(()=>{_.value=!0,v()},1e3),v=()=>{const a=window.location.pathname;A.visit(a,{method:"get",data:u.value})};return(a,i)=>(m(),p(T,null,[s("div",X,[Y,j(s("input",{onInput:i[0]||(i[0]=(...n)=>f(g)&&f(g)(...n)),"onUpdate:modelValue":i[1]||(i[1]=n=>u.value.search=n),type:"text",class:"outline-none px-4 w-full bg-inherit",placeholder:a.$t("Search organizations")},null,40,ee),[[F,u.value.search]]),_.value===!1&&u.value.search?(m(),p("button",{key:0,onClick:O,type:"button",class:"pr-2"},ae)):C("",!0),_.value?(m(),p("span",se,ne)):C("",!0)]),e(I,{rows:h.rows},{default:t(()=>[e(P,null,{default:t(()=>[e(G,null,{default:t(()=>[e(r,{position:"first"},{default:t(()=>[o(l(a.$t("Name")),1)]),_:1}),e(r,{class:"hidden sm:table-cell"},{default:t(()=>[o(l(a.$t("Owner")),1)]),_:1}),e(r,{class:"hidden sm:table-cell"},{default:t(()=>[o(l(a.$t("Owner email")),1)]),_:1}),e(r,{class:"hidden sm:table-cell"},{default:t(()=>[s("span",null,l(a.$t("Seats")),1)]),_:1}),e(r,{class:"hidden sm:table-cell"},{default:t(()=>[o(l(a.$t("Plan")),1)]),_:1}),e(r,{class:"hidden sm:table-cell"},{default:t(()=>[o(l(a.$t("Next billing date")),1)]),_:1}),e(r,{class:"hidden sm:table-cell"},{default:t(()=>[s("span",oe,l(a.$t("Last updated")),1)]),_:1}),e(r,{position:"last"})]),_:1})]),_:1}),e(J,null,{default:t(()=>[(m(!0),p(T,null,L(h.rows.data,(n,y)=>(m(),D(K,{key:y,class:R(S(y)?"":"border-b")},{default:t(()=>[e(d,{position:"first",class:"capitalize"},{default:t(()=>[o(l(n.name),1)]),_:2},1024),e(d,{class:"hidden sm:table-cell"},{default:t(()=>[o(l(n.owner.user.full_name),1)]),_:2},1024),e(d,{class:"hidden sm:table-cell"},{default:t(()=>[o(l(n.owner.user.email),1)]),_:2},1024),e(d,{class:"hidden sm:table-cell"},{default:t(()=>[s("span",null,l(n.teams_count),1)]),_:2},1024),e(d,{class:"hidden sm:table-cell"},{default:t(()=>{var c,x;return[s("span",ie,l(((x=(c=n.subscription)==null?void 0:c.plan)==null?void 0:x.name)??a.$t("Not set")),1)]}),_:2},1024),e(d,{class:"capitalize"},{default:t(()=>{var c;return[s("span",re,l(((c=n.subscription)==null?void 0:c.next_billing_date)??"Not Set"),1)]}),_:2},1024),e(d,{class:"hidden sm:table-cell"},{default:t(()=>[s("span",de,l(n.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/"+n.uuid},{default:t(()=>[o(l(a.$t("View/edit")),1)]),_:2},1032,["href"]),e(k,{as:"button",onClick:c=>f(N)(n.uuid)},{default:t(()=>[o(l(a.$t("Delete")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),default:t(()=>[ce]),_:2},1024)]),_:2},1024)]),_:2},1032,["class"]))),128))]),_:1})]),_:1},8,["rows"]),e(q,{modelValue:f(b),"onUpdate:modelValue":i[2]||(i[2]=n=>H(b)?b.value=n:null),onConfirm:i[3]||(i[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{xe as _};