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/Subscription-342902fb.js

import{r as x,T as $,i as k,g as C,o as _,a as e,t as l,f as n,u as o,n as m,c as v,h as B}from"./app-f1493ab2.js";import U from"./App-bc062293.js";import{_ as d}from"./FormInput-b3450213.js";import{_ as A}from"./FormToggleSwitch-9b3ff72b.js";import"./App-6e8cb8a8.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"./Sidebar-10203eb5.js";const S={class:"text-xl mb-1"},Z={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},M={class:"ml-1 mt-1"},j={class:"space-y-12"},N={class:"pb-12"},T={class:"pt-5"},z={class:"flex gap-x-10 md:w-2/3 pb-6 border-b mb-4"},D={class:"w-[80%]"},E={class:"text-xs text-slate-700 flex items-center"},F={class:"w-[20%]"},O={class:"grid gap-3 grid-cols-2 pb-6 md:w-2/3 border-b mb-4"},q={class:"col-span-2 text-xs"},J={class:"mb-4"},K={class:"text-base text-gray-900"},L={class:"text-sm leading-6 mb-5"},P={class:"bg-orange-100 p-2 rounded-md shadow-sm md:w-2/3 mb-4 flex items-center gap-x-1"},R={class:"text-sm leading-6"},G={class:"grid gap-3 grid-cols-2 pb-6 border-b md:w-2/3"},H={class:"mt-6 flex items-center justify-end gap-x-6 md:w-2/3"},I={type:"button",class:"text-sm leading-6 text-gray-900"},Q=["disabled"],W={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},X={key:1},fe={__name:"Subscription",props:{config:{type:Object,required:!0}},setup(y){const w=y,p=r=>{const t=w.config.find(u=>u.key===r);return t?t.value:""},i=p("trial_limits")?JSON.parse(p("trial_limits")):{},c=x(!1),s=$({enable_custom_payment:p("enable_custom_payment")==1||p("enable_custom_payment")=="",trial_period:p("trial_period"),trial_limits:{users:(i==null?void 0:i.users)??"-1",messages:(i==null?void 0:i.messages)??"-1",contacts:(i==null?void 0:i.contacts)??"-1",campaigns:(i==null?void 0:i.campaigns)??"-1",automated_replies:(i==null?void 0:i.automated_replies)??"-1"}}),V=async()=>{s.put("/admin/settings?type=subscription",{preserveScroll:!0})};return(r,t)=>(_(),k(U,null,{default:C(()=>{var u,g,b,f,h;return[e("div",null,[e("h2",S,l(r.$t("Subscription settings")),1),e("p",Z,[t[8]||(t[8]=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",M,l(r.$t("Configure how your subscriptions are set")),1)])]),e("form",{onSubmit:t[7]||(t[7]=B(a=>V(),["prevent"]))},[e("div",j,[e("div",N,[e("div",T,[e("div",z,[e("div",D,[e("span",null,l(r.$t("Enable custom payment amounts")),1),e("div",E,[e("span",null,l(r.$t("Allow users to make custom payments that can be applied to their subscription fees automatically.")),1)])]),e("div",F,[n(A,{modelValue:o(s).enable_custom_payment,"onUpdate:modelValue":t[0]||(t[0]=a=>o(s).enable_custom_payment=a),class:"float-right"},null,8,["modelValue"])])])]),e("div",O,[n(d,{modelValue:o(s).trial_period,"onUpdate:modelValue":t[1]||(t[1]=a=>o(s).trial_period=a),name:r.$t("Trial period (in days)"),error:o(s).errors.trial_period,type:"number",class:m("col-span-2")},null,8,["modelValue","name","error"]),e("span",q,l(r.$t("Please note that if you put zero then the user will be prompted to first subscribe before using the app")),1)]),e("div",J,[e("h2",K,l(r.$t("Trial period limits")),1),e("p",L,l(r.$t("Define the usage limits during the trial period")),1)]),e("div",P,[t[9]||(t[9]=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",R,l(r.$t("For unlimited usage, set -1 as the value")),1)]),e("div",G,[n(d,{modelValue:o(s).trial_limits.messages,"onUpdate:modelValue":t[2]||(t[2]=a=>o(s).trial_limits.messages=a),name:r.$t("Message limit"),error:(u=o(s).errors)==null?void 0:u["trial_limits.messages"],type:"number",class:m("col-span-1")},null,8,["modelValue","name","error"]),n(d,{modelValue:o(s).trial_limits.campaigns,"onUpdate:modelValue":t[3]||(t[3]=a=>o(s).trial_limits.campaigns=a),name:r.$t("Campaign limit"),error:(g=o(s).errors)==null?void 0:g["trial_limits.campaigns"],type:"number",class:m("col-span-1")},null,8,["modelValue","name","error"]),n(d,{modelValue:o(s).trial_limits.contacts,"onUpdate:modelValue":t[4]||(t[4]=a=>o(s).trial_limits.contacts=a),name:r.$t("Contacts limit"),error:(b=o(s).errors)==null?void 0:b["trial_limits.contacts"],type:"number",class:m("col-span-1")},null,8,["modelValue","name","error"]),n(d,{modelValue:o(s).trial_limits.automated_replies,"onUpdate:modelValue":t[5]||(t[5]=a=>o(s).trial_limits.automated_replies=a),name:r.$t("Automated Replies limit"),error:(f=o(s).errors)==null?void 0:f["trial_limits.automated_replies"],type:"number",class:m("col-span-1")},null,8,["modelValue","name","error"]),n(d,{modelValue:o(s).trial_limits.users,"onUpdate:modelValue":t[6]||(t[6]=a=>o(s).trial_limits.users=a),name:r.$t("User limit"),error:(h=o(s).errors)==null?void 0:h["trial_limits.users"],type:"number",class:m("col-span-1")},null,8,["modelValue","name","error"])]),e("div",H,[e("button",I,l(r.$t("Cancel")),1),e("button",{class:m(["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":c.value}]),disabled:c.value},[c.value?(_(),v("svg",W,t[10]||(t[10]=[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)]))):(_(),v("span",X,l(r.$t("Save")),1))],10,Q)])])])],32)]}),_:1}))}};export{fe as default};