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/Show-300bbf66.js

import{r as O,T as A,h as y,f as S,o as u,a as l,c as f,t as d,e as m,k as P,u as s,l as Z,g as D,n,b as z}from"./app-43851608.js";import E from"./App-ad5f7ecb.js";import{_ as F}from"./FormImage-5b2df4ab.js";import{_ as i}from"./FormInput-4a309017.js";import{_ as M}from"./FormPhoneInput-c64878db.js";import{_ as T}from"./FormSelect-2d73589a.js";import"./Sidebar-7bb6d772.js";import"./Menu-4221d61f.js";import"./ProfileModal-628e5b7c.js";import"./LangToggle-8d05b0dc.js";import"./MobileSidebar-b73cd192.js";import"./index-99011d5f.js";/* empty css              */import"./index-17cd980e.js";import"./use-text-value-242aa4d7.js";import"./ChevronUpDownIcon-8859f144.js";const J={class:"bg-white md:bg-inherit pt-0 px-4 md:pt-8 md:p-8 rounded-[5px] text-[#000] overflow-y-scroll"},L={class:"md:flex justify-between hidden"},R={key:0,class:"text-xl mb-1"},q={key:1,class:"text-xl mb-1"},G={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},H=l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[l("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={key:0,class:"ml-1 mt-1"},K={key:1,class:"ml-1 mt-1"},Q={class:"sm:flex border-b py-5"},W={class:"hidden sm:block sm:w-[40%] mb-1"},X={class:"text-sm text-gray-500 tracking-[0px]"},Y={class:"sm:w-[60%] sm:flex space-x-6"},ee={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},se={class:"sm:flex py-5"},oe={class:"hidden sm:block w-[40%] mb-1"},re={class:"text-sm text-gray-500 tracking-[0px]"},te={class:"sm:w-[60%] sm:flex space-x-6"},le={class:"sm:w-[80%] grid gap-x-6 gap-y-4 sm:grid-cols-6"},ae={class:"py-6"},ne={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"},$e={__name:"Show",props:{title:String,user:Object,roles:Object},setup(B){var V,v,g,b,w,h,x,_,$,k,U;const a=B;O(null);const c=(r,o)=>{if(r){const p=JSON.parse(r);return(p==null?void 0:p[o])??null}else return null},e=A({first_name:(V=a.user)==null?void 0:V.first_name,last_name:(v=a.user)==null?void 0:v.last_name,email:(g=a.user)==null?void 0:g.email,phone:(b=a.user)==null?void 0:b.phone,role:(h=(w=a.user)==null?void 0:w.role)==null?void 0:h.uuid,password:null,password_confirmation:null,avatar:null,street:c((x=a.user)==null?void 0:x.address,"street"),city:c((_=a.user)==null?void 0:_.address,"city"),state:c(($=a.user)==null?void 0:$.address,"state"),zip:c((k=a.user)==null?void 0:k.address,"zip"),country:c((U=a.user)==null?void 0:U.address,"country")}),N=()=>a.roles.map(r=>({value:r.uuid,label:r.name})),j=async()=>{const r=a.user?window.location.pathname:"/admin/team/users";e[a.user?"put":"post"](r,{preserveScroll:!0})};return(r,o)=>(u(),y(E,null,{default:S(()=>{var p,C;return[l("div",J,[l("div",L,[l("div",null,[a.user===null?(u(),f("h1",R,d(r.$t("Create user")),1)):(u(),f("h1",q,d(r.$t("Update user")),1)),l("p",G,[H,a.user===null?(u(),f("span",I,d(r.$t("Create administrative user and assign role")),1)):(u(),f("span",K,d(r.$t("Update administrative user and assign role")),1))])]),l("div",null,[m(s(Z),{href:"/admin/team/users",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:S(()=>[P(d(r.$t("Back")),1)]),_:1})])]),l("form",{onSubmit:o[13]||(o[13]=D(t=>j(),["prevent"])),class:"bg-white md:border py-5 px-5 rounded-[0.5rem]"},[l("div",Q,[l("div",W,[l("h1",X,d(r.$t("Personally identifiable information")),1)]),l("div",Y,[l("div",ee,[m(F,{modelValue:s(e).avatar,"onUpdate:modelValue":o[0]||(o[0]=t=>s(e).avatar=t),name:"Avatar",error:s(e).errors.avatar,label:r.$t("Upload image"),imageUrl:(p=a.user)!=null&&p.avatar?"/media/"+((C=a.user)==null?void 0:C.avatar):null,class:n("sm:col-span-6")},null,8,["modelValue","error","label","imageUrl"]),m(i,{modelValue:s(e).first_name,"onUpdate:modelValue":o[1]||(o[1]=t=>s(e).first_name=t),name:r.$t("First name"),error:s(e).errors.first_name,type:"text",class:n("sm:col-span-3")},null,8,["modelValue","name","error"]),m(i,{modelValue:s(e).last_name,"onUpdate:modelValue":o[2]||(o[2]=t=>s(e).last_name=t),name:r.$t("Last name"),error:s(e).errors.last_name,type:"text",class:n("sm:col-span-3")},null,8,["modelValue","name","error"]),m(i,{modelValue:s(e).email,"onUpdate:modelValue":o[3]||(o[3]=t=>s(e).email=t),name:r.$t("Email"),error:s(e).errors.email,type:"text",class:n("sm:col-span-3")},null,8,["modelValue","name","error"]),m(M,{modelValue:s(e).phone,"onUpdate:modelValue":o[4]||(o[4]=t=>s(e).phone=t),name:r.$t("Phone"),error:s(e).errors.phone,type:"text",class:n("sm:col-span-3")},null,8,["modelValue","name","error"]),m(T,{modelValue:s(e).role,"onUpdate:modelValue":o[5]||(o[5]=t=>s(e).role=t),name:r.$t("Role"),error:s(e).errors.role,options:N(),type:"text",class:n("sm:col-span-6")},null,8,["modelValue","name","error","options"]),a.user?z("",!0):(u(),y(i,{key:0,modelValue:s(e).password,"onUpdate:modelValue":o[6]||(o[6]=t=>s(e).password=t),name:r.$t("Password"),error:s(e).errors.password,type:"password",class:n("sm:col-span-3")},null,8,["modelValue","name","error"])),a.user?z("",!0):(u(),y(i,{key:1,modelValue:s(e).password_confirmation,"onUpdate:modelValue":o[7]||(o[7]=t=>s(e).password_confirmation=t),name:r.$t("Confirm password"),error:s(e).errors.password_confirmation,type:"password",class:n("sm:col-span-3")},null,8,["modelValue","name","error"]))])])]),l("div",se,[l("div",oe,[l("h1",re,d(r.$t("Address details")),1)]),l("div",te,[l("div",le,[m(i,{modelValue:s(e).street,"onUpdate:modelValue":o[8]||(o[8]=t=>s(e).street=t),name:r.$t("Street"),error:s(e).errors.street,type:"text",class:n("sm:col-span-6")},null,8,["modelValue","name","error"]),m(i,{modelValue:s(e).city,"onUpdate:modelValue":o[9]||(o[9]=t=>s(e).city=t),name:r.$t("City"),error:s(e).errors.city,type:"text",class:n("sm:col-span-3")},null,8,["modelValue","name","error"]),m(i,{modelValue:s(e).state,"onUpdate:modelValue":o[10]||(o[10]=t=>s(e).state=t),name:r.$t("State"),error:s(e).errors.state,type:"text",class:n("sm:col-span-3")},null,8,["modelValue","name","error"]),m(i,{modelValue:s(e).zip,"onUpdate:modelValue":o[11]||(o[11]=t=>s(e).zip=t),name:r.$t("Zip code"),error:s(e).errors.zip,type:"text",class:n("sm:col-span-3")},null,8,["modelValue","name","error"]),m(i,{modelValue:s(e).country,"onUpdate:modelValue":o[12]||(o[12]=t=>s(e).country=t),name:r.$t("Country"),error:s(e).errors.country,type:"text",class:n("sm:col-span-3")},null,8,["modelValue","name","error"])])])]),l("div",ae,[l("button",ne,d(r.$t("Save")),1)])],32)])]}),_:1}))}};export{$e as default};