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/Show-af7d08ce.js
import{T,r as N,f as D,g as M,o as c,a as e,c as u,t as n,j as r,h as E,u as a,i as J,k as R,n as m,e as z,F as Y,b as q}from"./app-884e4ce3.js";import G from"./App-b545302c.js";import{_ as p}from"./FormInput-ab713954.js";import{_ as Z}from"./FormSelect-1f27a419.js";import{_ as j}from"./FormToggleSwitch-5613ae6f.js";import{t as g}from"./index-d349a931.js";import"./Sidebar-98023fef.js";import"./Menu-53693ad4.js";import"./ProfileModal-268f6e59.js";import"./FormPhoneInput-8c055c19.js";/* empty css                      */import"./transition-15fedc5d.js";import"./hidden-733404a0.js";import"./use-outside-click-1c7dcbeb.js";import"./micro-task-89dcd6af.js";import"./tabs-3ad99d3f.js";import"./use-resolve-button-type-261165f4.js";import"./LangToggle-54d6b98e.js";import"./use-text-value-48384026.js";import"./MobileSidebar-2775c42f.js";import"./index-ff0eb693.js";/* empty css              */import"./useRtl-295d8c04.js";const H={class:"p-8 rounded-[5px] text-[#000] overflow-y-scroll"},K={class:"flex justify-between"},Q={key:0,class:"text-xl mb-1"},W={key:1,class:"text-xl mb-1"},X={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},ee={key:0,class:"ml-1 mt-1"},se={key:1,class:"ml-1 mt-1"},te={class:"sm:flex border-b py-5"},ae={class:"hidden sm:block sm:w-[40%] mb-1"},oe={class:"text-sm text-gray-500 tracking-[0px]"},le={class:"sm:w-[60%] sm:flex space-x-6"},ie={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},ne={class:"sm:flex border-b py-5"},re={class:"hidden sm:block sm:w-[40%] mb-1"},me={class:"text-sm text-gray-500 tracking-[0px]"},de={class:"sm:w-[60%] sm:flex space-x-6"},pe={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},ce={class:"sm:flex border-b py-5"},ue={class:"hidden sm:block w-[40%] mb-1"},_e={class:"text-sm text-gray-500 tracking-[0px]"},ge={class:"sm:w-[60%] sm:flex space-x-6"},he={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},ve={class:"sm:flex py-5 border-b"},be={class:"hidden sm:block w-[40%] mb-1"},fe={class:"text-sm text-gray-500 tracking-[0px]"},xe={class:"sm:w-[60%]"},we={class:"bg-orange-100 p-2 rounded-md shadow-sm sm:w-[80%] mb-4 flex items-center gap-x-1"},ye={class:"text-sm leading-6"},Ve={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},ke={class:"sm:flex py-5 border-b"},$e={class:"hidden sm:block w-[40%] mb-1"},Ue={class:"text-sm text-gray-500 tracking-[0px]"},Se={class:"text-xs text-slate-700"},Ce={class:"sm:w-[60%]"},Ae={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},Be={class:"sm:col-span-3"},Ne={class:"text-sm mb-2"},Me={key:0,class:"sm:flex py-5 border-b"},Ze={class:"hidden sm:block w-[40%] mb-1"},je={class:"text-sm text-gray-500 tracking-[0px]"},Fe={class:"sm:w-[60%]"},Ie={class:"bg-orange-100 p-2 rounded-md shadow-sm sm:w-[80%] mb-4 flex items-center gap-x-1"},Le={class:"text-sm leading-6"},Oe={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},Pe={class:"py-5 sm:flex"},Te={class:"w-[40%]"},De={class:"text-sm text-gray-500 tracking-[0px]"},Ee={class:"text-xs text-slate-700 flex items-center"},Je={class:"sm:w-[20%]"},Re={class:"py-6"},ze={type:"submit",class:"float-right flex items-center space-x-4 rounded-md bg-black px-3 py-2 text-sm text-white shadow-sm hover:bg-slate-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},gs={__name:"Show",props:["title","plan","addons","enable_ai_billing"],setup(h){var v,b,f,x,w,y,V,k,$,U,S,C,A,B;const i=h,d=(o,l)=>{if(o){const s=JSON.parse(o);return(s==null?void 0:s[l])??null}else return null},F=(o,l)=>{if(o){const s=JSON.parse(o);return s!=null&&s[l]?s[l]:i.addons.reduce((_,P)=>(_[P]=!1,_),{})}return i.addons.reduce((s,_)=>(s[_]=!1,s),{})},t=T({name:(v=i.plan)==null?void 0:v.name,price:(b=i.plan)==null?void 0:b.price,period:(f=i.plan)==null?void 0:f.period,status:(x=i.plan)==null?void 0:x.status,campaign_limit:d((w=i.plan)==null?void 0:w.metadata,"campaign_limit")??"-1",message_limit:d((y=i.plan)==null?void 0:y.metadata,"message_limit")??"-1",contacts_limit:d((V=i.plan)==null?void 0:V.metadata,"contacts_limit")??"-1",canned_replies_limit:d((k=i.plan)==null?void 0:k.metadata,"canned_replies_limit")??"-1",team_limit:d(($=i.plan)==null?void 0:$.metadata,"team_limit")??"-1",ai_text_response_limit:d((U=i.plan)==null?void 0:U.metadata,"ai_text_response_limit")??"-1",ai_audio_response_limit:d((S=i.plan)==null?void 0:S.metadata,"ai_audio_response_limit")??"-1",receive_messages_after_expiration:d((C=i.plan)==null?void 0:C.metadata,"receive_messages_after_expiration")==1||d((A=i.plan)==null?void 0:A.metadata,"receive_messages_after_expiration")==null,addons:F((B=i.plan)==null?void 0:B.metadata,"addons")}),I=N([{value:"active",label:g("active")},{value:"inactive",label:g("inactive")}]),L=N([{value:"monthly",label:g("Monthly")},{value:"yearly",label:g("Yearly")}]),O=async()=>{const o=i.plan?window.location.pathname:"/admin/plans";t[i.plan?"put":"post"](o,{preserveScroll:!0})};return(o,l)=>(c(),D(G,null,{default:M(()=>[e("div",H,[e("div",K,[e("div",null,[i.plan===null?(c(),u("h1",Q,n(o.$t("Create plan")),1)):(c(),u("h1",W,n(o.$t("Update plan")),1)),e("p",X,[l[13]||(l[13]=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)),i.plan===null?(c(),u("span",ee,n(o.$t("Create plan")),1)):(c(),u("span",se,n(o.$t("Update plan")),1))])]),e("div",null,[r(a(J),{href:"/admin/plans",class:"rounded-md bg-indigo-600 px-3 py-2 text-sm text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},{default:M(()=>[E(n(o.$t("Back")),1)]),_:1})])]),e("form",{onSubmit:l[12]||(l[12]=R(s=>O(),["prevent"])),class:"bg-white border py-5 px-5 rounded-[0.5rem]"},[e("div",te,[e("div",ae,[e("h1",oe,n(o.$t("Name")),1)]),e("div",le,[e("div",ie,[r(p,{modelValue:a(t).name,"onUpdate:modelValue":l[0]||(l[0]=s=>a(t).name=s),name:o.$t("Name"),error:a(t).errors.name,type:"text",class:m("sm:col-span-6")},null,8,["modelValue","name","error"])])])]),e("div",ne,[e("div",re,[e("h1",me,n(o.$t("Status")),1)]),e("div",de,[e("div",pe,[r(Z,{modelValue:a(t).status,"onUpdate:modelValue":l[1]||(l[1]=s=>a(t).status=s),options:I.value,error:a(t).errors.status,name:o.$t("Status"),class:m("sm:col-span-6"),placeholder:o.$t("Select status")},null,8,["modelValue","options","error","name","placeholder"])])])]),e("div",ce,[e("div",ue,[e("h1",_e,n(o.$t("Pricing details")),1)]),e("div",ge,[e("div",he,[r(p,{modelValue:a(t).price,"onUpdate:modelValue":l[2]||(l[2]=s=>a(t).price=s),name:o.$t("Price"),error:a(t).errors.price,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(Z,{modelValue:a(t).period,"onUpdate:modelValue":l[3]||(l[3]=s=>a(t).period=s),options:L.value,error:a(t).errors.period,name:o.$t("Period"),class:m("sm:col-span-3"),placeholder:o.$t("Select period")},null,8,["modelValue","options","error","name","placeholder"])])])]),e("div",ve,[e("div",be,[e("h1",fe,n(o.$t("Plan limit")),1)]),e("div",xe,[e("div",we,[l[14]||(l[14]=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",ye,n(o.$t("For unlimited usage, set -1 as the value")),1)]),e("div",Ve,[r(p,{modelValue:a(t).campaign_limit,"onUpdate:modelValue":l[4]||(l[4]=s=>a(t).campaign_limit=s),name:o.$t("Campaign limit"),error:a(t).errors.campaign_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(p,{modelValue:a(t).message_limit,"onUpdate:modelValue":l[5]||(l[5]=s=>a(t).message_limit=s),name:o.$t("Message limit"),error:a(t).errors.message_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(p,{modelValue:a(t).contacts_limit,"onUpdate:modelValue":l[6]||(l[6]=s=>a(t).contacts_limit=s),name:o.$t("Contacts limit"),error:a(t).errors.contacts_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(p,{modelValue:a(t).canned_replies_limit,"onUpdate:modelValue":l[7]||(l[7]=s=>a(t).canned_replies_limit=s),name:o.$t("Canned replies limit"),error:a(t).errors.canned_replies_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(p,{modelValue:a(t).team_limit,"onUpdate:modelValue":l[8]||(l[8]=s=>a(t).team_limit=s),name:o.$t("User limit"),error:a(t).errors.team_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"])])])]),e("div",ke,[e("div",$e,[e("h1",Ue,n(o.$t("Addons access")),1),e("p",Se,n(o.$t("Select addons that are available in this plan")),1)]),e("div",Ce,[e("div",Ae,[(c(!0),u(Y,null,z(h.addons,s=>(c(),u("div",Be,[e("div",Ne,n(s),1),r(j,{modelValue:a(t).addons[s],"onUpdate:modelValue":_=>a(t).addons[s]=_},null,8,["modelValue","onUpdate:modelValue"])]))),256))])])]),i.enable_ai_billing==1&&a(t).addons["AI Assistant"]?(c(),u("div",Me,[e("div",Ze,[e("h1",je,n(o.$t("AI Assistant Usage Limit")),1)]),e("div",Fe,[e("div",Ie,[l[15]||(l[15]=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",Le,n(o.$t("For unlimited usage, set -1 as the value")),1)]),e("div",Oe,[r(p,{modelValue:a(t).ai_text_response_limit,"onUpdate:modelValue":l[9]||(l[9]=s=>a(t).ai_text_response_limit=s),name:o.$t("AI Text Response Limit"),error:a(t).errors.ai_text_response_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"]),r(p,{modelValue:a(t).ai_audio_response_limit,"onUpdate:modelValue":l[10]||(l[10]=s=>a(t).ai_audio_response_limit=s),name:o.$t("AI Audio Response Limit"),error:a(t).errors.ai_audio_response_limit,type:"number",class:m("sm:col-span-3")},null,8,["modelValue","name","error"])])])])):q("",!0),e("div",Pe,[e("div",Te,[e("h1",De,n(o.$t("Enable message reception after plan expiration")),1),e("div",Ee,[e("span",null,n(o.$t("Toggle this setting to allow or block inbound messages when a user's subscription plan has ended.")),1)])]),e("div",Je,[r(j,{modelValue:a(t).receive_messages_after_expiration,"onUpdate:modelValue":l[11]||(l[11]=s=>a(t).receive_messages_after_expiration=s),class:"float-left"},null,8,["modelValue"])])]),e("div",Re,[e("button",ze,n(o.$t("Save")),1)])],32)])]),_:1}))}};export{gs as default};