Your IP : 216.73.217.77


Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/
Upload File :
Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Index-79332639.js

import Q from"./App-6e8cb8a8.js";import{r as i,T as A,O as X,o as r,c as a,a as e,w as Y,v as ee,u as n,b as g,d as te,F as S,e as E,t as l,n as v,f as h,g as M,h as $,i as T,j as se}from"./app-f1493ab2.js";import{d as oe}from"./debounce-7f7c0d78.js";import{_ as le}from"./AlertModal-2bf70f0d.js";import{u as ne}from"./useAlertModal-3aa166da.js";import{_ as I}from"./Modal-a0814fa2.js";import{_ as D}from"./FormInput-b3450213.js";import{_ as re}from"./FormToggleSwitch-9b3ff72b.js";import{P as ae}from"./Pagination-6973c28d.js";import{t as F}from"./index-764662c4.js";import"./Sidebar-b962a0c1.js";import"./Menu-45912eaa.js";import"./ProfileModal-09ae28bb.js";import"./tabs-80627b62.js";import"./hidden-f79cef22.js";import"./micro-task-89dcd6af.js";import"./transition-f32a8133.js";import"./use-outside-click-92c6377f.js";import"./LangToggle-d2b58a25.js";import"./MobileSidebar-5b51f786.js";import"./index-114bea05.js";/* empty css              */import"./_baseGetTag-f7f93ac1.js";import"./_plugin-vue_export-helper-c27b6911.js";const ie={class:"md:bg-white flex items-center border border-primary md:border-none md:shadow-sm h-12 md:h-10 w-full md:w-80 rounded-[0.5rem] mb-6 text-xl md:text-sm"},de=["placeholder"],ue={key:1,class:"pr-2"},ce={class:"grid md:grid-cols-3 gap-x-5 gap-y-4"},me={class:"flex items-center gap-x-3 pb-2 bg-slate-50 px-4 pt-4 rounded-tr-[0.5rem] rounded-tl-[0.5rem]"},pe=["src"],fe={class:"text-[16px]"},ge={class:"text-slate-500 border-b px-4 text-xs pt-2 pb-4"},ve={class:"flex justify-between items-center px-4 pb-4 text-xs"},he=["onClick"],be=["onClick"],xe={class:"grid grid-cols-1 gap-x-6 gap-y-4"},we={class:"bg-slate-50 mx-[-30px] px-6 mt-[-25px] py-4 border-b"},ye={class:"flex items-center gap-x-3"},_e=["src"],ke={class:"text-[16px]"},$e={class:"text-slate-500 font-light text-xs pt-4"},Ce={class:"grid gap-x-6 gap-y-4 sm:grid-cols-2"},Ve={key:1},Ae={class:"text-sm mb-2"},Se={key:0,class:"bg-orange-100 p-2 rounded-md shadow-sm mb-1 col-span-2"},Me={class:"flex items-center gap-x-1 border-b border-slate-500 pb-2 mb-2"},Te={class:"text-sm"},je={class:"text-sm leading-6 break-all"},Ne={class:"text-sm leading-6 break-all"},Oe={class:"mt-5 border-t pt-5 flex"},Be=["disabled"],Ze={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},Le={key:1},Ue={class:"grid grid-cols-1 gap-x-6 gap-y-4"},Ee={class:"bg-slate-50 mx-[-30px] px-6 mt-[-25px] py-4 border-b"},Ie={class:"flex items-center gap-x-3"},De=["src"],Fe={class:"text-[16px]"},We={class:"text-slate-500 font-light text-xs pt-4"},ze={class:"grid gap-x-6 sm:grid-cols-2"},Re={class:"text-sm"},qe={class:"col-span-2 text-xs text-slate-600 mb-2"},Pe={class:"mt-5 border-t pt-5 flex"},Je=["disabled"],Ke={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},Ge={key:1},He={__name:"AddonTable",props:{rows:{type:Object,required:!0},filters:{type:Object},config:{type:Array}},emits:["edit","delete"],setup(m,{emit:C}){const b=m,{isOpenAlert:p,openAlert:st,confirmAlert:W}=ne(),w=i(!1),y=i(!1);i(!1);const z=i(window.location.origin),R=A({test:null}),d=A({settings:{}}),u=A({uuid:null,purchase_code:null,addon:null}),q=o=>{R.delete("/admin/faqs/"+o)},x=i({search:b.filters.search}),V=i(!1),P=()=>{x.value.search=null,N()},j=oe(()=>{V.value=!0,N()},1e3),N=()=>{const o=window.location.pathname;X.visit(o,{method:"get",data:x.value})},O=i(null),_=i(null),f=i(null),k=i(null),B=i(null),Z=i([]),J=o=>{var c;_.value=o.logo,f.value=o.name,k.value=o.description;const s=((c=JSON.parse(o.metadata))==null?void 0:c.input_fields)||[];Z.value=s,d.settings={};let t=f.value.toLowerCase().replace(/ /g,"-");O.value="/admin/addons/setup/"+t,s.forEach(U=>{d.settings[U.name]=L(U.name)}),w.value=!0},K=(o,s)=>{_.value=o.logo,f.value=o.name,k.value=o.description,B.value=s=="extended"?F("Enter your extended license to install"):F("Enter the addon license to install"),u.uuid=o.uuid,u.addon=o.name,y.value=!0},L=o=>{const s=b.config.find(t=>t.key===o);return s?s.value:""},G=()=>{d.post(O.value,{preserveScroll:!0,onSuccess:()=>{w.value=!1}})},H=()=>{u.post("/admin/addons/install",{preserveScroll:!0,onSuccess:()=>{y.value=!1}})};return(o,s)=>(r(),a(S,null,[e("div",ie,[s[11]||(s[11]=e("span",{class:"pl-3"},[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)),Y(e("input",{onInput:s[0]||(s[0]=(...t)=>n(j)&&n(j)(...t)),"onUpdate:modelValue":s[1]||(s[1]=t=>x.value.search=t),type:"text",class:"outline-none px-4 w-full",placeholder:o.$t("Search")},null,40,de),[[ee,x.value.search]]),V.value===!1&&x.value.search?(r(),a("button",{key:0,onClick:P,type:"button",class:"pr-2"},s[9]||(s[9]=[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)]))):g("",!0),V.value?(r(),a("span",ue,s[10]||(s[10]=[te('<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)]))):g("",!0)]),e("div",ce,[(r(!0),a(S,null,E(m.rows.data,t=>(r(),a("div",{key:t.id,class:"bg-white rounded-[0.5rem] shadow-md text-sm space-y-3"},[e("div",me,[e("div",null,[e("img",{class:"h-8 w-8",src:"/images/"+t.logo,alt:"Whatsapp Logo"},null,8,pe)]),e("div",fe,l(o.$t(t.name)),1)]),e("div",ge,l(t.description),1),e("div",ve,[e("div",null,[e("span",{class:v(["py-1 px-3 rounded-md text-slate-600",t.status==0?"bg-red-600 text-white":"bg-slate-50"])},l(t.status==1?o.$t("Installed"):o.$t("Not installed")),3)]),e("div",null,[t.status==0?(r(),a("button",{key:0,onClick:c=>K(t,t.license),class:"rounded-full border-2 w-full px-10 py-2 hover:border-secondary hover:bg-secondary hover:text-white text-secondary"},l(o.$t("Install")),9,he)):(r(),a("button",{key:1,onClick:c=>J(t),class:"rounded-full border-2 w-full px-10 py-2 hover:border-secondary hover:bg-secondary hover:text-white text-secondary"},l(o.$t("Setup")),9,be))])])]))),128))]),h(ae,{class:"mt-3",pagination:m.rows.meta},null,8,["pagination"]),h(I,{isOpen:w.value},{default:M(()=>[e("div",xe,[e("div",we,[e("div",ye,[e("div",null,[e("img",{class:"h-8 w-8",src:"/images/"+_.value,alt:"Whatsapp Logo"},null,8,_e)]),e("div",ke,l(o.$t(f.value)),1)]),e("div",$e,l(k.value),1)]),e("form",{onSubmit:s[3]||(s[3]=$(t=>G(),["prevent"]))},[e("div",Ce,[(r(!0),a(S,null,E(Z.value,t=>(r(),a("div",{class:v(t.class)},[t.element=="input"?(r(),T(D,{key:0,modelValue:n(d).settings[t.name],"onUpdate:modelValue":c=>n(d).settings[t.name]=c,error:n(d).errors[`settings.${t.name}`],name:o.$t(t.label),type:t.type,class:v(t.class)},null,8,["modelValue","onUpdate:modelValue","error","name","type","class"])):g("",!0),t.element=="toggle"?(r(),a("div",Ve,[e("div",Ae,l(o.$t(t.label)),1),t.element=="toggle"?(r(),T(re,{key:0,modelValue:n(d).settings[t.name],"onUpdate:modelValue":c=>n(d).settings[t.name]=c},null,8,["modelValue","onUpdate:modelValue"])):g("",!0)])):g("",!0)],2))),256)),f.value=="Embedded Signup"?(r(),a("div",Se,[e("div",Me,[s[12]||(s[12]=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 11v5m0 5a9 9 0 1 1 0-18a9 9 0 0 1 0 18Zm.05-13v.1h-.1V8h.1Z"})],-1)),e("p",Te,l(o.$t("Webhook setup")),1)]),e("span",null,[e("p",je,l(o.$t("Callback URL"))+": "+l(z.value+"/webhook/waba"),1),e("p",Ne,l(o.$t("Verify token"))+": "+l(L("whatsapp_callback_token")),1)])])):g("",!0)]),e("div",Oe,[e("button",{type:"button",onClick:s[2]||(s[2]=$(t=>w.value=!1,["self"])),class:"inline-flex justify-center rounded-md border border-transparent bg-slate-50 px-4 py-2 text-sm text-slate-500 hover:bg-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 mr-4"},l(o.$t("Cancel")),1),e("button",{class:v(["inline-flex justify-center rounded-md border border-transparent bg-primary px-4 py-2 text-sm text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",{"opacity-50":n(d).processing}]),disabled:n(d).processing},[n(d).processing?(r(),a("svg",Ze,s[13]||(s[13]=[e("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"},null,-1),e("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[e("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1)]))):(r(),a("span",Le,l(o.$t("Save")),1))],10,Be)])],32)])]),_:1},8,["isOpen"]),h(I,{isOpen:y.value},{default:M(()=>[e("div",Ue,[e("div",Ee,[e("div",Ie,[e("div",null,[e("img",{class:"h-8 w-8",src:"/images/"+_.value,alt:"Whatsapp Logo"},null,8,De)]),e("div",Fe,l(o.$t(f.value)),1)]),e("div",We,l(k.value),1)]),e("form",{onSubmit:s[6]||(s[6]=$(t=>H(),["prevent"]))},[e("div",ze,[e("h4",Re,l(o.$t("Envato purchase code")),1),e("span",qe,l(B.value),1),h(D,{modelValue:n(u).purchase_code,"onUpdate:modelValue":s[4]||(s[4]=t=>n(u).purchase_code=t),error:n(u).errors.purchase_code,name:"",type:"text",class:v("col-span-2")},null,8,["modelValue","error"])]),e("div",Pe,[e("button",{type:"button",onClick:s[5]||(s[5]=$(t=>y.value=!1,["self"])),class:"inline-flex justify-center rounded-md border border-transparent bg-slate-50 px-4 py-2 text-sm text-slate-500 hover:bg-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 mr-4"},l(o.$t("Cancel")),1),e("button",{class:v(["inline-flex justify-center rounded-md border border-transparent bg-primary px-4 py-2 text-sm text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",{"opacity-50":n(u).processing}]),disabled:n(u).processing},[n(u).processing?(r(),a("svg",Ke,s[14]||(s[14]=[e("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"},null,-1),e("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[e("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1)]))):(r(),a("span",Ge,l(o.$t("Save")),1))],10,Je)])],32)])]),_:1},8,["isOpen"]),h(le,{modelValue:n(p),"onUpdate:modelValue":s[7]||(s[7]=t=>se(p)?p.value=t:null),onConfirm:s[8]||(s[8]=()=>n(W)(q)),label:o.$t("Delete row"),description:o.$t("Are you sure you want to delete this row? This action can not be undone")},null,8,["modelValue","label","description"])],64))}},Qe={class:"bg-white md:bg-inherit pt-10 px-4 md:pt-8 md:p-8 rounded-[5px] text-[#000] h-full md:overflow-y-auto"},Xe={class:"flex justify-between"},Ye={class:"text-xl mb-1"},et={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},tt={class:"ml-1 mt-1"},At={__name:"Index",props:{title:String,rows:Object,filters:Object,config:Array},setup(m){const C=m;return(b,p)=>(r(),T(Q,null,{default:M(()=>[e("div",Qe,[e("div",Xe,[e("div",null,[e("h1",Ye,l(b.$t("Explore Add-ons Marketplace")),1),e("p",et,[p[0]||(p[0]=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 11v5m0 5a9 9 0 1 1 0-18a9 9 0 0 1 0 18Zm.05-13v.1h-.1V8h.1Z"})],-1)),e("span",tt,l(b.$t("Select an addon that you want to install on your platform")),1)])])]),h(He,{rows:C.rows,filters:C.filters,config:m.config},null,8,["rows","filters","config"])])]),_:1}))}};export{At as default};