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/General-b51937ba.js

import{r as y,o as u,c as g,a as t,t as i,d as _,b as w,n as m,T as V,i as k,g as x,f as c,u as s,h as $}from"./app-f1493ab2.js";import S from"./App-bc062293.js";import{_ as h}from"./FormInput-b3450213.js";import"./index-764662c4.js";import{_ as U}from"./FormTextArea-95511fff.js";import{_ as z}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 C={for:"name",class:"block text-sm leading-6 text-gray-900 mb-2"},L={class:"flex items-center gap-x-3"},A={key:0,class:"h-16 w-16 rounded-lg border-2 border-dashed overflow-hidden"},F=["src"],j={key:1,class:"border-2 border-dashed h-16 w-16 flex rounded-lg items-center justify-center"},B=["disabled"],M={key:0,class:"form-error text-[#b91c1c] text-xs"},Z={__name:"FormImageFavicon",props:{modelValue:File,name:String,label:String,className:String,error:String,disabled:Boolean,imageUrl:String},emits:["update:modelValue"],setup(d,{emit:b}){const p=y(d.imageUrl),n=b,v=o=>{const l=o.target.files[0];if(l&&l.size>5242880)alert("File size exceeds the limit. Max allowed size: 5242880 bytes"),o.target.value=null;else{const e=new FileReader;e.onload=a=>{p.value=a.target.result},n("update:modelValue",l),e.readAsDataURL(l)}};return(o,f)=>(u(),g("div",{class:m(d.className)},[t("label",C,i(d.name),1),t("div",L,[p.value?(u(),g("div",A,[t("img",{src:p.value,alt:"",class:"object-contain w-full h-full"},null,8,F)])):(u(),g("div",j,f[0]||(f[0]=[_('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6Z"></path><circle cx="8.5" cy="8.5" r="2.5"></circle><path d="M14.526 12.621L6 22h12.133A3.867 3.867 0 0 0 22 18.133V18c0-.466-.175-.645-.49-.99l-4.03-4.395a2 2 0 0 0-2.954.006Z"></path></g></svg>',1)]))),t("input",{type:"file",class:"",accept:".png, .jpg",id:"file-upload",onChange:v,disabled:d.disabled},null,40,B)]),d.error?(u(),g("div",M,i(d.error),1)):w("",!0)],2))}},N={for:"name",class:"block text-sm leading-6 text-gray-900 mb-2"},I={class:"flex items-center gap-x-3"},R={key:0,class:"h-20 w-48 rounded-lg border-2 border-dashed overflow-hidden"},T=["src"],D={key:1,class:"border-2 border-dashed h-20 w-48 flex rounded-lg items-center justify-center"},E=["disabled"],G={key:0,class:"form-error text-[#b91c1c] text-xs"},H={__name:"FormImageLogo",props:{modelValue:File,name:String,label:String,className:String,error:String,disabled:Boolean,imageUrl:String},emits:["update:modelValue"],setup(d,{emit:b}){const p=y(d.imageUrl),n=b,v=o=>{const l=o.target.files[0];if(l&&l.size>5242880)alert("File size exceeds the limit. Max allowed size: 5242880 bytes"),o.target.value=null;else{const e=new FileReader;e.onload=a=>{p.value=a.target.result},n("update:modelValue",l),e.readAsDataURL(l)}};return(o,f)=>(u(),g("div",{class:m(d.className)},[t("label",N,i(d.name),1),t("div",I,[p.value?(u(),g("div",R,[t("img",{src:p.value,alt:"",class:"object-contain w-full h-full"},null,8,T)])):(u(),g("div",D,f[0]||(f[0]=[_('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6Z"></path><circle cx="8.5" cy="8.5" r="2.5"></circle><path d="M14.526 12.621L6 22h12.133A3.867 3.867 0 0 0 22 18.133V18c0-.466-.175-.645-.49-.99l-4.03-4.395a2 2 0 0 0-2.954.006Z"></path></g></svg>',1)]))),t("input",{type:"file",class:"",accept:".png, .jpg",id:"file-upload",onChange:v,disabled:d.disabled},null,40,E)]),d.error?(u(),g("div",G,i(d.error),1)):w("",!0)],2))}},O={class:"text-xl mb-1"},q={class:"mb-6 flex items-center text-sm leading-6"},J={class:"ml-1 mt-1"},K={class:"space-y-12"},P={class:"pb-12"},Q={class:"grid gap-6 grid-cols-2 pb-10 border-b md:w-2/3"},W={class:"pt-5"},X={class:"text-base text-gray-900"},Y={class:"text-sm leading-6 mb-5"},ee={class:"grid gap-6 grid-cols-2 pb-10 border-b md:w-2/3"},te={class:"pt-5"},oe={class:"text-base text-gray-900"},le={class:"text-sm leading-6 mb-5"},ae={class:"flex gap-x-10 md:w-2/3 pb-10 border-b"},se={class:"w-[80%]"},ne={class:"text-xs text-slate-700 flex items-center"},re={class:"w-[20%]"},ie={class:"pt-5"},de={class:"text-base text-gray-900"},me={class:"text-sm leading-6 mb-5"},ce={class:"grid gap-6 grid-cols-2 pb-10 border-b md:w-2/3"},ue={class:"mt-6 flex items-center justify-end gap-x-6 md:w-2/3"},pe={type:"button",class:"text-sm leading-6 text-gray-900"},ge=["disabled"],fe={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},he={key:1},Ne={__name:"General",props:{config:{type:Array,required:!0}},setup(d){const b=d,r=l=>{const e=b.config.find(a=>a.key===l);return e?e.value:""},p=l=>{const e=r(l);return e!=""&&e!=null?"/media/"+e:null},n=JSON.parse(r("socials")),v=y(!1),o=V({_method:"put",company_name:r("company_name"),phone:r("phone"),email:r("email"),address:r("address"),recaptcha_active:r("recaptcha_active")==="1",recaptcha_site_key:r("recaptcha_site_key"),recaptcha_secret_key:r("recaptcha_secret_key"),google_analytics_tracking_id:r("google_analytics_tracking_id"),google_maps_api_key:r("google_maps_api_key"),app_environment:r("app_environment"),display_frontend:r("display_frontend")==1||r("display_frontend")=="",logo:null,favicon:null,socials:{facebook:n==null?void 0:n.facebook,twitter:n==null?void 0:n.twitter,instagram:n==null?void 0:n.instagram,slack:n==null?void 0:n.slack,linkedin:n==null?void 0:n.linkedin}}),f=async()=>{o.post("/admin/settings?type=general",{preserveScroll:!0})};return(l,e)=>(u(),k(S,null,{default:x(()=>[t("div",null,[t("h2",O,i(l.$t("General settings")),1),t("p",q,[e[13]||(e[13]=t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[t("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)),t("span",J,i(l.$t("Configure general account information")),1)])]),t("form",{onSubmit:e[12]||(e[12]=$(a=>f(),["prevent"])),enctype:"multipart/form-data"},[t("div",K,[t("div",P,[t("div",Q,[c(h,{modelValue:s(o).company_name,"onUpdate:modelValue":e[0]||(e[0]=a=>s(o).company_name=a),name:l.$t("Organization/company name"),error:s(o).errors.company_name,type:"text",class:m("col-span-2")},null,8,["modelValue","name","error"]),c(h,{modelValue:s(o).phone,"onUpdate:modelValue":e[1]||(e[1]=a=>s(o).phone=a),name:l.$t("Phone"),error:s(o).errors.phone,type:"text",class:m("col-span-1")},null,8,["modelValue","name","error"]),c(h,{modelValue:s(o).email,"onUpdate:modelValue":e[2]||(e[2]=a=>s(o).email=a),name:l.$t("Email"),error:s(o).errors.email,type:"text",class:m("col-span-1")},null,8,["modelValue","name","error"]),c(U,{modelValue:s(o).address,"onUpdate:modelValue":e[3]||(e[3]=a=>s(o).address=a),name:l.$t("Address"),showLabel:!0,error:s(o).errors.address,class:m("col-span-2")},null,8,["modelValue","name","error"])]),t("div",W,[t("h2",X,i(l.$t("Social media accounts")),1),t("p",Y,i(l.$t("Add your social media account links")),1),t("div",ee,[c(h,{modelValue:s(o).socials.facebook,"onUpdate:modelValue":e[4]||(e[4]=a=>s(o).socials.facebook=a),name:"Facebook",type:"text",class:m("col-span-1")},null,8,["modelValue"]),c(h,{modelValue:s(o).socials.twitter,"onUpdate:modelValue":e[5]||(e[5]=a=>s(o).socials.twitter=a),name:"Twitter",type:"text",class:m("col-span-1")},null,8,["modelValue"]),c(h,{modelValue:s(o).socials.instagram,"onUpdate:modelValue":e[6]||(e[6]=a=>s(o).socials.instagram=a),name:"Instagram",type:"text",class:m("col-span-1")},null,8,["modelValue"]),c(h,{modelValue:s(o).socials.slack,"onUpdate:modelValue":e[7]||(e[7]=a=>s(o).socials.slack=a),name:"Slack",type:"text",class:m("col-span-1")},null,8,["modelValue"]),c(h,{modelValue:s(o).socials.linkedin,"onUpdate:modelValue":e[8]||(e[8]=a=>s(o).socials.linkedin=a),name:"LinkedIn",type:"text",class:m("col-span-1")},null,8,["modelValue"])])]),t("div",te,[t("h2",oe,i(l.$t("Frontend Settings")),1),t("p",le,i(l.$t("Show/hide the main frontend page")),1),t("div",ae,[t("div",se,[t("span",null,i(l.$t("Use the current default frontend")),1),t("div",ne,[e[14]||(e[14]=t("svg",{class:"mr-1",xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 24 24"},[t("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)),t("span",null,i(l.$t("Toggle on/off to show/hide the main frontend page")),1)])]),t("div",re,[c(z,{modelValue:s(o).display_frontend,"onUpdate:modelValue":e[9]||(e[9]=a=>s(o).display_frontend=a),class:"float-right"},null,8,["modelValue"])])])]),t("div",ie,[t("h2",de,i(l.$t("Site logo and favicon")),1),t("p",me,i(l.$t("Add your logo and favicon")),1),t("div",ce,[c(H,{modelValue:s(o).logo,"onUpdate:modelValue":e[10]||(e[10]=a=>s(o).logo=a),name:l.$t("Site logo"),error:s(o).errors.logo,label:l.$t("Upload logo"),imageUrl:p("logo"),class:m("col-span-2")},null,8,["modelValue","name","error","label","imageUrl"]),c(Z,{modelValue:s(o).favicon,"onUpdate:modelValue":e[11]||(e[11]=a=>s(o).favicon=a),name:l.$t("Favicon"),error:s(o).errors.favicon,label:l.$t("Upload logo"),imageUrl:p("favicon"),class:m("col-span-2")},null,8,["modelValue","name","error","label","imageUrl"])])]),t("div",ue,[t("button",pe,i(l.$t("Cancel")),1),t("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":v.value}]),disabled:v.value},[v.value?(u(),g("svg",fe,e[15]||(e[15]=[t("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),t("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[t("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1)]))):(u(),g("span",he,i(l.$t("Save")),1))],10,ge)])])])],32)]),_:1}))}};export{Ne as default};