File: /var/www/html/public/static/js/hookBoInfo-legacy-4656e710.js
System.register(["./po-legacy-128c6bec.js","./vue-router-legacy-a12307c3.js","./fabric-legacy-3d322433.js","./message-legacy-10af7c73.js","./index-legacy-42c17c53.js","./upload-legacy-da990a47.js","./runtime-core.esm-bundler-legacy-c5df00b7.js","./index-legacy-2897d8c7.js","./preload-helper-legacy-f8638e03.js","./vue-i18n.runtime.esm-bundler-legacy-720876b1.js","./index-legacy-c9e20962.js","./_commonjsHelpers-legacy-5498c249.js","./utils-legacy-c0023c33.js","./focus-trap-legacy-631b7396.js","./error-legacy-e98f9e58.js"],(function(e,i){"use strict";var t,a,n,s,o,c,l,r,d,_,u,m,g,v,p,h,f,y,b,k,S,w,C,D,x,T,O,A,I,N,j,E,P,B,W,L,M,F,J,q,V,R,H,Y,U,z,K,G,X,Z;return{setters:[e=>{t=e.addCompanyWeb,a=e.getdaysClander,n=e.bookingSchduleListWeb,s=e.bookingOrderWeb,o=e.sendBookingEmailWeb,c=e.getHealthFormDataWeb,l=e.submitHealthFormModelWeb,r=e.bookingCheckIn,d=e.getCustomerLogsWeb,_=e.bookingAmountCalculteWeb,u=e.submitNoteFormWeb,m=e.getInvoiceNumberWeb,g=e.newInvoiceWeb,v=e.getServiceListWeb,p=e.getManagerClinicsListWeb,h=e.getLicenceServiceWeb,f=e.invoicePaymentWeb,y=e.prePaidWeb,b=e.checkTherapistServiceWeb,k=e.getTherapistListByClinic,S=e.invoiceDetailArrWeb,w=e.updateShowNumber,C=e.sendEmailBatchWeb,D=e.getUsedFormByCustomerWeb,x=e.bookingDetailWeb,T=e.SendEvaluationEmailWeb,O=e.BookingSubmitWeb,A=e.bookingDetailClientWeb,I=e.yuyueFDF,N=e.getNoteFormWeb,j=e.invoicePdfWeb,E=e.getMuitiBookingDateWeb,P=e.getBookingsByDateWeb,B=e.getNoteSensiveWeb,W=e.sendBookingSensitiveEmailWeb,L=e.setInvoicePaidWeb,M=e.deleteCompanyWeb,F=e.bookingPaymentWeb,J=e.getCheckMembersWeb,q=e.bookingDelete,V=e.BookingCompleteWeb},e=>{R=e.d,H=e.u},e=>{Y=e.f},e=>{U=e.b7},e=>{z=e.o},e=>{K=e.g},e=>{G=e.r,X=e.A,Z=e.o},null,null,null,null,null,null,null,null],execute:function(){e("useEqu",(function(){const{query:e,params:i}=R(),Q=H();R();const $=G([]),ee=G([]),ie=G(!1),te=G(!1),ae=G(!1),ne=G([]),se=G([]),oe=G([]),ce=G(!1),le=G(!1),re=G(!1),de=G(!1),_e=G(!1),ue=G(!1),me=G(!1),ge=G(!1),ve=G(!1),pe=G(!1),he=G(null),fe=G(""),ye=G(""),be=G(""),ke=G(""),Se=G(""),we=G(""),Ce=G(""),De=G(""),xe=G(""),Te=G(""),Oe=G(""),Ae=G(""),Ie=G(""),Ne=G([]),je=G([]),Ee=G([]),Pe=G([]),Be=G([]),We=G([]),Le=G([]),Me=G([]),Fe=G([]),Je=G([]),qe=G(!1),Ve=G(!1),Re=G(!1),He=G(!1),Ye=G(!1),Ue=G(!1),ze=G(!1),Ke=G(!1),Ge=G(!1),Xe=G(!1),Ze=G(!1),Qe=G(!1),$e=G(!1),ei=G(!1),ii=G(!1),ti=G(""),ai=G(""),ni=G(""),si=G([]),oi=G([]),ci=G([]),li=G([]),ri=G([]),di=G([]),_i=G([]),ui=G([]),mi=G([]),gi=G([]),vi=G([]),pi=G([]),hi=G([]),fi=X({});X({});const yi=X({}),bi=X({}),ki=X({}),Si=X({}),wi=X({}),Ci=X({}),Di=X({}),xi=X({}),Ti=X({}),Oi=X({}),Ai=X({}),Ii=X({}),Ni=X({}),ji=X({}),Ei=X({}),Pi=X({}),Bi=X({}),Wi=X({}),Li=X({}),Mi=X({});X({});const Fi=X({});X({});const Ji=X({}),qi=X({}),Vi=X({}),Ri=X({}),Hi=X({}),Yi=X({}),Ui=X({}),zi=X({}),Ki=X({}),Gi=X({}),Xi=X({}),Zi=X({}),Qi=X({}),$i=X({}),et=X({}),it=X({}),tt=X({}),at=X({});X({});const nt=G(1),st=G(!1),ot=X({Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",customer_id:"",customer_name:""}),ct=G([{name:"Basic Info",id:1},{name:"Invoices",id:2}]),lt=G([{id:1,text:"Mobile SMS",value:"message",is_selected:0},{id:2,text:"Email",value:"email",is_selected:0}]),rt=G([{id:1,text:"Free",value:"free",is_selected:1},{id:2,text:"New",value:"new",is_selected:1},{id:3,text:"Check In",value:"check_in",is_selected:1},{id:4,text:"Invoice",value:"invoice",is_selected:1},{id:5,text:"Email",value:"email",is_selected:1}]),dt=G([{value:"Massage Therapy Treatment",text:"Massage Therapy Treatment"},{value:"Acupuncture Treatment",text:"Acupuncture Treatment"}]),_t=G([{value:"Y",text:"Y"},{value:"N",text:"N"}]),ut=G([{id:1,price:0,spend_time:"",treatment_date:""}]),mt=G([{value:"normal",text:"Normal"},{value:"third_Pay",text:"Third Pay"},{value:"gift",text:"Gift"}]),gt=X({note_id:"",form_type:"",str:""}),vt=X({name:"",today_date:"",hear_about:"",chief_complaint:"",rashes_bruise:!1,address:"",Birth:"",Code_ZIP:"",Occupation:"",Phone:"",Work_Phone:"",Physician:"",Phone1:"",City:""}),pt=X({tableIndex:0,is_invoice:!1,SignatureValue:"Please sign in the mini program",time:"",note_id:"",signal_url1:"",signal_url2:"",signal_desc1:"",signal_desc2:"",form_type:"",sensitived_url:"",sensitived_desc:"",ougoing_url1:"",ougoing_url2:"",ougoing_url3:"",ougoing_url4:"",ougoing_url5:"",ougoing_desc1:"",ougoing_desc2:"",ougoing_desc3:"",ougoing_desc4:"",ougoing_desc5:"",userId1:"",formInfo1:"",formInfo2:"",formInfo3:"",formInfo4:"",formInfo5:"",imgView:"",service_name:"",Therapist_name:"",date:0,month:"",action:"",click_date:"",checked1:!0,therapist_name:"",userId:"",last_day:"",next_day:"",Clinic_id:"",type:"",LicenceServeValue:"",next_page:"",prev_page:"",page:1,therapists_name:"",is_invoiceShow:1,is_tax:!0,include_tax:"Y",service_id:"",is_form_edit:1,is_form_history:2,is_historyAll:2,is_leftShow:1,is_additional:"",is_health:"",treatment_description:""}),ht=X({plan:"",date:"",daily_living:"",treatment_goal:"",focus_treatment:"",frequency:"",duration:"",performed:"",assessments:"",schedule:"",responses:"",recommended:"",hydrotherapy:"",contraindications:"",referrals:"",discussed_with:"",treatment_plan:"",checkedCities:""}),ft=X({notes:"",date:"",time:"",duration:"",fee:"",assessment:"",therapist:"",findings:"",feedback:"",self_care:"",timeType:"",durationType:"",receivedType:"",client_goal:""}),yt=X({name:"",name1:"",indication:"",client_name:"",date:"",checkedCities:""}),bt=X({date1:"",date2:"",date3:"",date4:"",date5:""}),kt=G([{id:1,text:"Yes",value:"yes",is_selected:0},{id:2,text:"No",value:"no",is_selected:0}]),St=G([{id:1,text:"Yes",value:"yes",is_selected:0},{id:2,text:"No",value:"no",is_selected:0}]),wt=G([{id:1,text:"AM",value:"am",is_selected:0},{id:2,text:"PM",value:"pm",is_selected:0}]),Ct=G([{id:1,text:"min.",value:"min",is_selected:1},{id:2,text:"hr.",value:"hr",is_selected:0}]),Dt=G([{id:1,text:"Paypal",value:"Paypal"},{id:2,text:"VISA",value:"VISA"},{id:3,text:"MasterCard",value:"MasterCard"},{id:4,text:"AMERICAN_EXPRESS",value:"AMERICAN_EXPRESS"},{id:5,text:"Cheque",value:"Cheque"},{id:6,text:"BankTransfer",value:"BankTransfer"},{id:7,text:"Cash",value:"Cash"},{id:8,text:"Other",value:"Other"}]),xt=G([{id:1,name:"Chest Wall Muscles (not including breasts)",is_selected:0,signal_url1:""},{id:2,name:"Breast (s)",is_selected:0,signal_url1:""},{id:3,name:"Buttocks (gluteal muscles)",is_selected:0,signal_url1:""},{id:4,name:"Upper Inner Thigh(s)",is_selected:0,signal_url1:""}]),Tt=G([{id:1,name:"back",is_selected:0},{id:2,name:"neck",is_selected:0},{id:3,name:"shoulders",is_selected:0},{id:4,name:"face",is_selected:0},{id:5,name:"arm L",is_selected:0},{id:6,name:"arm R",is_selected:0},{id:7,name:"leg L",is_selected:0},{id:8,name:"leg R",is_selected:0},{id:9,name:"hip area",is_selected:0},{id:10,name:"abdominals",is_selected:0},{id:11,name:"chest",is_selected:0},{id:12,name:"breast",is_selected:0},{id:13,name:"other (list)",is_selected:0,input:""}]),Ot=G([{id:1,name:"Swedish",is_selected:0},{id:2,name:"Frictions",is_selected:0},{id:3,name:"deep facial",is_selected:0},{id:4,name:"trigger points",is_selected:0},{id:5,name:"stretch",is_selected:0},{id:6,name:"intra-oral",is_selected:0},{id:7,name:"Breast",is_selected:0},{id:8,name:"Hydrotherapy",is_selected:0},{id:9,name:"joint mobilization grade: ",is_selected:0,input:""},{id:10,name:"other (list) ",is_selected:0,input:""}]),At=G([{id:1,text:"Yes",value:"yes",is_selected:0},{id:2,text:"No",value:"no",is_selected:0}]),It=G([{id:1,name:"back",is_selected:0},{id:2,name:"neck",is_selected:0},{id:3,name:"shoulders",is_selected:0},{id:4,name:"face",is_selected:0},{id:5,name:"arm L",is_selected:0},{id:6,name:"arm R",is_selected:0},{id:7,name:"leg L",is_selected:0},{id:8,name:"leg R",is_selected:0},{id:9,name:"gluteus",is_selected:0},{id:10,name:"abdominals",is_selected:0},{id:11,name:"chest",is_selected:0},{id:12,name:"breast",is_selected:0},{id:13,name:"other (list)",is_selected:0,input:""}]),Nt=G([]);G([{id:1,date:"",time:"",amount:0,duration:60}]);const jt=X({tableIndex:0,note:""}),Et=X({name:"",email_to:"",email_content:"",phone_to:"",booking_notice_type:"",booking_id:"",is_booking:1,booking_arr:[],sentive_include:!1,is_health_form:0,is_informed:"",is_sensitived:"",bookingServers:"",bookingorder_id:"",health_form_url:"",informed_content_url:"",informed_content_first_url:"",sentitive_content_url:"",email_type:"",email_health:!1,email_informed:!1}),Pt=X({signal_desc:"",loacation_id:"",loacation_name:"",Client_name:"",Client_id:"",date:"",time:"",service_name:"Massage",service_name1:"Massage",service_id1:"",service_disabled:!0,Therapist_name:"",Therapist_id:"",comment:"",During:"",gender:-1,description:"",service_times:"",config_id:"",dateInfo:"",Terapist:"",is_items:!1,Invoice_Number:"",hstValue:0,total:0,include_tax:"N",is_tax:"Y",is_tax1:!0,r_ac_name:"",r_ac_register:"",name1:"",rmt_register:"",signal_image5:"",receive:"",invoice_due_date:"",invoice_type:"normal",note_id:"",loacation_id1:"",loacation_name1:"",Client_name1:"",Client_id1:"",date1:"",description_type:"Massage Therapy Treatment",description_type1:"",booking_id:"",amount:"",amount1:"",booking_order_no:"",bookingorder_id:"",loacation_id_add:"",loacation_name_add:"",is_loacation:"",customArr:"",email_content:"",file_path:[],used_form_id:"",Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",chapter_image:"",is_use_chapter:"",is_Auto:0,interval_days:7,invoiceTherapist_name:"",invoiceTherapist_id:"",has_therapistlicence:"",files:[],files1:[],fileView:[]}),Bt=X({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",account_id:"",time:"",other:""}),Wt=X({company_name:"",first_name:"",last_name:"",phone:"",email:"",address:"",state:"Ontraio",city:"",hst:"",r_ac:"",rmt_register:"",country:"Canada",postal:"L3S 0E2",company_id:"",number_companyname:""});X({destination_comp:"",state:"",city:"",address:"",phone:"",contact:"",customer_id:""});const Lt=X({name:"",id:"",clinic_id:""}),Mt=X({signal_url:"",form_type:"",note_id:"",service:"",service_id:""}),Ft=X({name:"",id:""}),Jt=X({qo_item_str:"",name:"",address:"",way:"",shipping:[],itemsDetail:[],trackingNo:"",courier:"",comment:""}),qt=X({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),Vt=G([{id:1,name:"Massage",value:"Massage",is_Selected:1},{id:2,name:"Acupuncture",value:"Acupuncture",is_Selected:0}]),Rt=X({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",searchKey1:"",bookingorder_id:"",room:"",show_number:"",type:"",role:"",tableIndex:0}),Ht=e=>{z.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{!async function(e){const{data:i}=await M(Object.assign(Si,{company_id:e.id}));1==i.code?(ca(),U({type:"success",message:i.msg})):U({type:"error",message:i.msg})}(e)})).catch((()=>{U({type:"info",message:"Canceled"})}))};async function Yt(e,i){let t="";2==localStorage.getItem("type")&&(t="one")," "!==e&&(pt.action=e);const{data:n}=await a(Object.assign(yi,{month:pt.month,action:pt.action,click_date:pt.click_date,many_one:t}));1==n.code&&(pt.month=n.month,mi.value=n.data,vi.value=n.higher_days,pt.last_day=n.pre_next_day.last_day,pt.next_day=n.pre_next_day.next_day,localStorage.getItem("type"),pt.click_date=vi.value[0],(1==pt.type||pt.Clinic_id||6==pt.type)&&Ut())}async function Ut(e){let i="";1==e&&(i=1);const t=localStorage.getItem("type"),{data:a}=await n(Object.assign(wi,{date:vi.value,type:t,clinics_id:pt.Clinic_id,services_array:Pt.service_name,page:pt.page,stulesShow:rt.value}));1==a.code?(1==_e.value&&""==i&&ka(),1==e&&(_e.value=!1),hi.value=a.data.content,ri.value=a.data.title,pt.therapist_name=a.data.therapist_name,Pt.loacation_id=a.data.location.id,Pt.loacation_name=a.data.location.company_name,pt.next_page=a.page_data.next_page,pt.prev_page=a.page_data.prev_page,ee.value=a.data.visual_data):U({type:"error",message:a.msg})}async function zt(e,i){pt.is_health=i,pt.userId1=e.clients.customer_id;const{data:t}=await c(Object.assign(Di,{customer_id:e.clients.customer_id}));1==t.code&&(Ne.value=t.model.health_info,Object.keys(t.model.information).map((e=>{vt[e]=t.model.information[e]})),Ye.value=!0)}async function Kt(){const{data:e}=await r(Object.assign(Ti,{bookingorder_id:Rt.bookingorder_id}));1==e.code?(Ut(),ei.value=!1,U({type:"success",message:e.msg})):U({type:"error",message:e.msg})}async function Gt(e){const{data:i}=await F(Object.assign(Oi,{bookingorder_id:e.clients.id}));1==i.code?(Ut(),U({type:"success",message:i.msg})):U({type:"error",message:i.msg})}function Xt(){const e=[],i=[];Je.value=[],Vt.value.forEach(((t,a)=>{1==t.is_Selected&&(e.push(t.name),i.push(t))})),Je.value=i,Pt.service_name=e.toString(),e.length>1?Pt.service_disabled=!1:Pt.service_disabled=!0,0==e.length&&(Pt.service_name1=""),e.length>0&&(Pt.service_name1=e[0]),Je.value.length>0&&(Je.value[0].additional_Service?se.value=JSON.parse(JSON.stringify(Je.value[0].additional_Service)):se.value=[],Je.value.forEach(((e,i)=>{i>0&&(e.is_Selected1=0)}))),la()}function Zt(e){Qt(e)}async function Qt(e){Je.value.forEach(((e,i)=>{e.name==Pt.service_name1&&(Pt.service_id1=e.id)}));const{data:i}=await _(Object.assign(Mi,{descrption:Pt.service_name1,Therapist_id:Pt.Therapist_id,during:e.duration,customer_id:Pt.Client_id,role:Rt.role,clinic_id:xe,service_id:Pt.service_id1,additional_Service:se.value}));1==i.code?e.amount=i.total_amount:U({type:"error",message:i.msg})}function $t(e){const i=Nt.value.findIndex((i=>i.id===e.id));-1!==i&&Nt.value.splice(i,1),Nt.value.forEach(((e,i)=>{e.id=i+1}))}async function ea(e){if("sensitived"==pt.form_type)return;ie.value=!0;const i={detail:"",imageurl:""},t={detail:""};if("informed"==pt.form_type){const e={information:pt.time,signal_desc1:pt.signal_desc1,signal_desc2:pt.signal_desc2},t={signal_url1:pt.signal_url1,signal_url2:pt.signal_url2};i.detail=e,i.imageurl=t}if("treatment_plan"==pt.form_type){const e={pendingProcessing:It,information:ht};t.detail=e}if("treatment_note"==pt.form_type){const e={information:ft,usedData:Ot,areasData:Tt};t.detail=e}if("sensitived"==pt.form_type){const e={information:yt,initialData:xt,sensitived_desc:pt.sensitived_desc},t={signal_url1:pt.sensitived_url};i.detail=e,i.imageurl=t}if("ougoing"==pt.form_type){const e={ougoingArr:bt,ougoing_desc1:pt.ougoing_desc1,ougoing_desc2:pt.ougoing_desc2,ougoing_desc3:pt.ougoing_desc3,ougoing_desc4:pt.ougoing_desc4,ougoing_desc5:pt.ougoing_desc5},t={signal_url2:pt.ougoing_url1,signal_url3:pt.ougoing_url2,signal_url4:pt.ougoing_url3,signal_url5:pt.ougoing_url4,signal_url6:pt.ougoing_url5};i.detail=e,i.imageurl=t}let a="";"treatment_plan"==pt.form_type||"treatment_note"==pt.form_type?a=t:"informed"==pt.form_type||"sensitived"==pt.form_type||"ougoing"==pt.form_type?a=i:"treatment"==pt.form_type&&(a={detail:{treatment_desc1:pt.treatment_description}});const{data:n}=await u(Object.assign(ji,{note_id:pt.note_id,form_type:pt.form_type,data_row:a}));1==n.code?(1==e&&(ei.value&&ya(ni.value),Ut(),Ke.value=!1,U({type:"success",message:n.msg})),ie.value=!1):(ie.value=!1,U({type:"error",message:n.msg}))}async function ia(e){Pt.include_tax="N",pt.LicenceServeValue="",ke.value=e,Pt.files=[],Pt.files1=[],ut.value=[],ie.value=!0,ut.value=JSON.parse(JSON.stringify(e.need_invoice)),Pt.During=e.clients.spend_time,Pt.loacation_name1=e.clients.company_name,Pt.Client_name1=e.clients.customer_name,Pt.Client_id1=e.clients.customer_id,Pt.loacation_id1=e.clients.company_id,Pt.date1=e.clients.service_date.substr(0,10),Pt.note_id=e.clients.note_id,Pt.description_type=e.clients.description_type,Pt.amount=e.clients.amount,6==pt.type&&(data.signal_image.length>0&&(Pt.signal_image5=data.signal_image[0]),data.signal_desc.length>0&&(Pt.signal_desc=data.signal_desc[0])),ra(e.clients.therapist_list,e.clients.note_id),Xe.value=!0}async function ta(e){const{data:i}=await m(Object.assign(Pi,{note_id:Ce.value.clients.note_id,clinic_id:xe,service_id:e.service_id}));1==i.code&&(e.invoice_number=i.invoice_number),ie.value=!1}function aa(e,i){const t=e.service_detail.findIndex((e=>e.id===i.id));-1!==t&&e.service_detail.splice(t,1),e.service_detail.forEach(((e,i)=>{e.id=i+1})),na(e)}function na(e){let i=0;e.service_detail.forEach(((e,t)=>{""!=e.price&&(i=parseFloat(i)+parseFloat(e.price))})),e.is_tax?"N"==e.include_tax?(e.hstValue=Math.round(.13*parseFloat(i)*100)/100,e.total=Math.round(1.13*parseFloat(i)*100)/100):"Y"==e.include_tax&&(e.hstValue=Math.round(parseFloat(i)/1.13*.13*100)/100,e.total=Math.round(100*parseFloat(i))/100):(e.hstValue=0,e.total=Math.round(100*parseFloat(i))/100)}let sa=null;async function oa(){const{data:e}=await v(Object.assign(Ri,{used:"Y",Therapists_id:Pt.Therapist_id,clinic_id:pt.Clinic_id,type:pt.type}));if(1==e.code){Vt.value=e.data,Je.value=[];const i=[],t=[];e.data.forEach(((e,a)=>{1==e.is_Selected&&(i.push(e),t.push(e.name))})),Je.value=i,Pt.service_name1=t.toString(),se.value=JSON.parse(JSON.stringify(Je.value[0].additional_Service)),Pt.service_name=t.toString(),2==pt.type&&Ut()}else U({type:"error",message:e.msg})}async function ca(){const{data:i}=await p(Object.assign(Wi,{cliniic_name:"",pageSize:1e3,page:1}));1==i.code&&(oi.value=i.data,e.clinics_id?pt.Clinic_id=Number(e.clinics_id):pt.Clinic_id=Number(localStorage.getItem("clinicIdOverall")),oa())}function la(){Ut()}async function ra(e,i,t){const{data:a}=await h(Object.assign(Li,{Therapists_id:e,note_id:i,role:Rt.role,clinic_id:xe,booking_id:Ce.value.clients.id,is_licence:!1}));if(1==a.code){a.data.length>0&&(Pt.signal_image5=a.data[0].sinal_image_arr,Pt.signal_desc=a.data[0].sinal_desc_arr),pi.value=a.data;let e=0;pt.LicenceServeValue="",pt.service_id="",a.data.length>0&&(pt.LicenceServeValue=a.data[0].service_name,pt.service_id=a.data[0].id,a.data[0]),a.data.length>0&&""==ci.value&&(ci.value=a.data[0].during_price_json),pi.value.forEach(((e,i)=>{e.is_Selected})),e=0,ci.value.forEach(((i,t)=>{i.duration==Pt.During&&(e=1,ut.value[0].price=i.price)})),0==e&&(ut.value[0].price=ci.value[0].price)}else U({type:"error",message:a.msg})}async function da(e){Je.value.forEach(((e,i)=>{e.name==Pt.service_name1&&(Pt.service_id1=e.id)}));let i="";i=1==e?"Y":"";const{data:t}=await _(Object.assign(Mi,{descrption:Pt.service_name1,Therapist_id:Pt.Therapist_id,during:Pt.During,is_during:i,customer_id:Pt.Client_id,role:Rt.role,clinic_id:xe,additional_Service:se.value,service_id:Pt.service_id1}));1==t.code?(Pt.amount=t.total_amount,Pt.During=t.during,Nt.value.forEach(((e,t)=>{e.amount=Pt.amount,""==i&&Zt(e)}))):U({type:"error",message:t.msg})}async function _a(){const{data:e}=await J(Object.assign(Ii,{customer_id:Bt.customer_id}));if(1==e.code){Me.value=e.data;let i=Pt.Need_Charge_Amount;Me.value.forEach(((e,t)=>{const a=Math.min(e.remain_amount,i);a>0&&(e.paid_amount=a,i=parseFloat((i-a).toFixed(2)))})),Re.value=!0}else U({type:"error",message:e.msg})}async function ua(e){ie.value=!0;const{data:i}=await q(Object.assign(Ji,{booking_id:e.clients.id}));1==i.code?(Ut(1),U({type:"success",message:i.msg})):U({type:"error",message:i.msg}),ie.value=!1}async function ma(){const{data:e}=await v(Object.assign(Vi,{used:"Y",Therapists_id:Pt.Therapist_id,clinic_id:pt.Clinic_id,type:pt.type}));1==e.code?(Je.value=e.data,Pt.service_name1=Ce.value.clients.description_type,Je.value.forEach(((e,i)=>{e.is_Selected1=0,Pt.service_name1==e.value&&(e.is_Selected1=1)}))):U({type:"error",message:e.msg})}async function ga(){let e="";2==Rt.type&&(e=xe);const{data:i}=await b(Object.assign(fi,{therapist_id:Pt.Therapist_id,service_name:Pt.service_name1,clinic_id:e,role:Rt.role}));1==i.code?Pt.is_Auto=i.result:U({type:"error",message:i.msg})}function va(e){pt.is_form_history=2,Ce.value=e,ka()}async function pa(e){ie.value=!0;const{data:i}=await k(Object.assign(qi,{clinics_id:e}));1==i.code?(gi.value=i.data,pt.is_invoice=!1,$e.value=!0):U({type:"error",message:i.msg}),ie.value=!1}async function ha(e){if(1==pt.is_invoice||1==e||2==e){5==e||1==e?le.value=!0:ge.value=!0;const{data:i}=await S(Object.assign(Hi,{invoice_id_arr:We.value}));1==i.code?(Rt.show_number=i.data[0].config.show_number,di.value=i.data,we.value=i.data[0].company_info,Ie.value=i.data[0].info,Pt.fileView=i.data[0].info.file,Ae.value=i.licence,Pt.customArr=i.data[0].customer_info,Pt.file_path=i.data[0].invoice_pdf.file_path,Pt.email_content=i.data[0].config.emailconfig.email_content):U({type:"error",message:i.msg})}}async function fa(){const{data:e}=await D(Object.assign(ki,{customer_id:Pt.Client_id,service_name:Pt.service_name1,service_date:Pt.date}));1==e.code?(Ut(),Re.value=!1,Fe.value=e.data,Pt.used_form_id=e.data.length>0?e.data[0].id:"",Pt.is_invoiceShow=e.data.length>0?2:1):U({type:"error",message:e.msg})}const ya=e=>{Rt.bookingorder_id=e.clients.id,z.confirm("Are you sure you want to check in ?",{confirmButtonText:"Confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{Kt()})).catch((()=>{U({type:"info",message:"Canceled"})}))};async function ba(e){ie.value=!0;const{data:i}=await V(Object.assign(Zi,{booking_id:e.clients.id}));1==i.code?(Ut(),U({type:"success",message:i.notice})):U({type:"error",message:i.notice}),ie.value=!1}async function ka(){const{data:e}=await A(Object.assign(Xi,{bookingorder_id:Ce.value.clients.id}));1==e.code?(Ce.value=e.data,0==_e.value&&(_e.value=!0),Rt.show_number=e.config.show_number,Et.is_health_form=e.data.clients.is_health_form,Et.is_informed=e.data.clients.is_informed,Et.is_sensitived=e.data.clients.is_sensitived,Et.health_form_url=e.data.clients.health_form_url,Et.informed_content_url=e.data.clients.informed_content_url,Et.informed_content_first_url=e.data.clients.first_informed_content_url,Et.sentitive_content_url=e.data.clients.sentitive_content_url,Pt.invoiceTherapist_name=e.data.therapists_name,Pt.invoiceTherapist_id=e.data.therapists_id,Et.sentive_include=!1,je.value=JSON.parse(JSON.stringify(e.data.clients.combina_service_arr)),je.value.forEach(((i,t)=>{i.service_detail.forEach(((e,i)=>{e.spend_time=Number(e.spend_time)})),pt.is_additional="",e.data.clients.additional_Service&&e.data.clients.additional_Service.forEach(((e,i)=>{e.is_Selected&&(pt.is_additional=1)})),ta(i),na(i)}))):U({type:"error",message:e.msg})}const Sa=()=>{ye.value.submit()};function wa(e,i){Ca(e,i,1)}async function Ca(e,i,t){pt.is_form_edit=t,1!=t||"sensitived"!=i&&"informed"!=i||(pt.is_form_edit=2),Se.value=e,1==t?pt.note_id=e.clients.note_id:2==t&&(pt.note_id=e.id),pt.form_type=i;const{data:a}=await N(Object.assign(Ni,{note_id:pt.note_id,form_type:i}));1==a.code?(Ke.value=!0,"informed"==pt.form_type?(a.data.content?(pt.time=a.data.content.information,pt.signal_desc1=a.data.content.signal_desc1,pt.signal_desc2=a.data.content.signal_desc2):pt.time="",pt.signal_url1=a.data.signal_url1,pt.signal_url2=a.data.signal_url2):"treatment_plan"==pt.form_type?a.data.content?(Object.keys(a.data.content.information).map((e=>{ht[e]=a.data.content.information[e]})),It.value=a.data.content.pendingProcessing):(Object.keys(ht).map((e=>{ht[e]=""})),It.value.forEach(((e,i)=>{e.is_selected=0}))):"treatment_note"==pt.form_type?(a.data.content?(Tt.value=a.data.content.areasData,Ot.value=a.data.content.usedData,Object.keys(a.data.content.information).map((e=>{ft[e]=a.data.content.information[e]}))):(Object.keys(ft).map((e=>{ft[e]=""})),Tt.value.forEach(((e,i)=>{e.is_selected=0})),Ot.value.forEach(((e,i)=>{e.is_selected=0}))),a.is_first&&(ft.fee=e.clients.amount,ft.duration=e.clients.session,ft.time=e.clients.begin_time,ft.date=e.date,ft.notes=e.clients.customer_name,ft.client_goal=e.clients.description,wt.value.forEach(((i,t)=>{i.is_selected=0,i.text==e.clients.am_pm&&(i.is_selected=1,ft.timeType=i.value)})))):"sensitived"==pt.form_type?(a.data.content?(xt.value=a.data.content.initialData,pt.sensitived_desc=a.data.content.sensitived_desc,Object.keys(a.data.content.information).map((e=>{yt[e]=a.data.content.information[e]}))):(Object.keys(yt).map((e=>{yt[e]=""})),xt.value.forEach(((e,i)=>{e.is_selected=0}))),pt.sensitived_url=a.data.signal_url1):"ougoing"==pt.form_type?(a.data.content?(pt.ougoing_desc1=a.data.content.ougoing_desc1,pt.ougoing_desc2=a.data.content.ougoing_desc2,pt.ougoing_desc3=a.data.content.ougoing_desc3,pt.ougoing_desc4=a.data.content.ougoing_desc4,pt.ougoing_desc5=a.data.content.ougoing_desc5,Object.keys(a.data.content.ougoingArr).map((e=>{bt[e]=a.data.content.ougoingArr[e]}))):(Object.keys(bt).map((e=>{bt[e]=""})),pt.ougoing_desc1="",pt.ougoing_desc2="",pt.ougoing_desc3="",pt.ougoing_desc4="",pt.ougoing_desc5=""),pt.ougoing_url1=a.data.signal_url2,pt.ougoing_url2=a.data.signal_url3,pt.ougoing_url3=a.data.signal_url4,pt.ougoing_url4=a.data.signal_url5,pt.ougoing_url5=a.data.signal_url6):"treatment"==pt.form_type&&a.data.content&&(pt.treatment_description=a.data.content.treatment_desc1),ft.therapist=e.therapists_name):U({type:"error",message:a.msg})}function Da(){1==pt.type?Q.push({path:"/crm/yuyue/licence",query:{invoceService:1}}):2==pt.type&&Q.push({path:"/crm/yuyue/clinic/employee",query:{invoceService:1}})}async function xa(e){const{data:i}=await E(Object.assign(et,{date_arr:Nt.value,interval_days:Pt.interval_days,date:Pt.date,duration:Pt.During,time:Pt.service_times,amount:Pt.amount,action:e,therapist_id:Pt.Therapist_id}));1==i.code?Nt.value=i.date_arr:U({type:"error",message:i.msg})}function Ta(e){const i=je.value.findIndex((i=>i.service_name===e.service_name));-1!==i&&je.value.splice(i,1)}return Z((()=>{const e=parseInt(localStorage.getItem("type"));pt.type=e,sa=new Y.fabric.Canvas(he.value,{isDrawingMode:!0}),function(){const e=new Date,i=e.getFullYear(),t=("0"+(e.getMonth()+1)).slice(-2),a=("0"+e.getDate()).slice(-2);ai.value=i+"-"+t+"-"+a}(),Yt(" "),2==e&&ca(),1!=e&&6!=e||oa(),Rt.type=localStorage.getItem("type"),2==Rt.type&&(Rt.role="clinic"),1!=Rt.type&&6!=Rt.type||(Rt.role="therapists"),xe.value=localStorage.getItem("clinicIdOverall")})),{searchDetail:Rt,btnSearchPart:function(){""!=Rt.searchKey1?Q.push({path:"/crm/yuyue/booking",query:{searchKey:Rt.searchKey1}}):U({type:"error",message:"Please fill in the query value"})},loading:ie,small:ii,selectList:["勾选列","Company","HST#","Name","Postal","Phone","Email","Address","Provice","City","Action"],columns:[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"序号列",type:"index",width:70,hide:({checkList:e})=>!e.includes("序号列")},{label:"Company",prop:"company_name",minWidth:100,hide:({checkList:e})=>!e.includes("Company")},{label:"HST#",prop:"hst",minWidth:100,hide:({checkList:e})=>!e.includes("HST#")},{label:"Name",prop:"first_name",minWidth:100,hide:({checkList:e})=>!e.includes("Name")},{label:"Postal",prop:"postal",minWidth:100,hide:({checkList:e})=>!e.includes("Postal")},{label:"Phone",prop:"phone",minWidth:150,slot:"slotAction",hide:({checkList:e})=>!e.includes("Phone")},{label:"Email",prop:"email",minWidth:120,hide:({checkList:e})=>!e.includes("Email")},{label:"Address",prop:"address",minWidth:120,hide:({checkList:e})=>!e.includes("Address")},{label:"Provice",prop:"state",minWidth:120,hide:({checkList:e})=>!e.includes("Provice")},{label:"City",prop:"city",minWidth:120,hide:({checkList:e})=>!e.includes("City")},{label:"Action",fixed:"right",width:120,slot:"operation",hide:({checkList:e})=>!e.includes("Action")}],pagination:qt,handleSizeChange:function(e){qt.pageSize=e,ca()},handleCurrentChange:function(e){qt.currentPage=e,ca()},PartList:si,deliverDialog:qe,selectClick:(i,t)=>{if(i.length>1){const e=i.shift();singleTableRef.value.toggleRowSelection(e,!1)}e.note&&Q.push({path:"/crm/yuyue/note",query:{location_id:t.id,location:encodeURIComponent(JSON.stringify(t))}})},deliverDataArr:Jt,btnDeliverConfirm:async function(){const{data:e}=await t(Object.assign(Ei,{data_row:Wt}));1==e.code?(ca(),Qe.value=!1,U({type:"success",message:e.msg})):U({type:"error",message:e.msg})},itemArr:jt,addLocationDialog:Qe,btnAdd:function(){Object.keys(Wt).map((e=>{Wt[e]=""})),Qe.value=!0},locationArr:Wt,EditLocation:function(e){Object.keys(e).map((i=>{Wt[i]=e[i]})),Qe.value=!0},btnDellocation:Ht,BookingInfoData:hi,Terapist:ri,get_table_box:ti,bookingDate:ai,serverDate:function(){},formArr:pt,calendarData:mi,loadDaysClander:Yt,onDay:function(e){pt.action="click",pt.click_date=e.date,Yt(pt.action)},addBookingDialog:$e,onAddBooking:function(e){if(Rt.tableIndex=0,ie.value=!1,"time_inline"!=e.status&&"hide"!=e.status)if("free"==e.status){pt.include_tax="Y",pt.is_tax=!0,Pt.is_items=!1,Nt.value=[],Pt.interval_days=7,Pe.value=[],Pt.Therapist_name=e.therapists_name,Pt.Therapist_id=e.therapists_id,Pt.service_times=e.time,Pt.date=e.date,Qt(Nt.value[0]),Pt.booking_id="",Pt.loacation_id_add=Pt.loacation_id,Pt.loacation_name_add=Pt.loacation_name,Pt.Client_name="",Pt.Client_id="",Pt.During="",Pt.description="";const i=[],t=[];if(Je.value=[],Vt.value.forEach(((e,a)=>{1==e.is_Selected&&(i.push(e.name),t.push(e))})),Je.value=t,0==Je.value.length)return void U({type:"error",message:"Please select a service"});Pt.service_name=i.toString(),i.length>1?Pt.service_disabled=!1:Pt.service_disabled=!0,0==i.length&&(Pt.service_name1=""),i.length>0&&(Pt.service_name1=i[0]),Je.value.length>0&&(Je.value[0].additional_Service?se.value=JSON.parse(JSON.stringify(Je.value[0].additional_Service)):se.value=[],Je.value.forEach(((e,i)=>{0==i&&(e.is_Selected1=1,e.during_price_json.forEach(((e,i)=>{e.default&&(Pt.During=e.duration)})),""==Pt.During&&(e.during_price_json.length>0?Pt.During=e.during_price_json[0].duration:Pt.During=60)),i>0&&(e.is_Selected1=0)}))),Fe.value=[],pt.is_invoice=!1,$e.value=!0,ga()}else"virtual"==e.status?e.visual_date.count>0?(Ee.value=e.visual_date.detail,de.value=!0):U({type:"info",message:"No virtual booking"}):va(e)},addForm:Pt,goPrivacy:function(){Ue.value=!0},PrivacyDialog:Ue,ClientDialog:ze,eventIsNum:function(){Pt.Client_id=Lt.id,Pt.Client_name=Lt.name,fa(),da()},ClientData:Lt,locationDialog:Ze,eventIsNumlocation:function(){1==Pt.is_loacation?(Pt.loacation_name=Ft.name,Pt.loacation_id=Ft.id):2==Pt.is_loacation&&(Pt.loacation_name_add=Ft.name,Pt.loacation_id_add=Ft.id)},locationData:Ft,onSelectLocation:function(e){Pt.is_loacation=e,Ze.value=!0},onSelClient:function(){Lt.clinic_id=pt.Clinic_id,ze.value=!0},btnAddConfirm:async function(){ie.value=!0,Pt.is_items||(Nt.value=[]);const{data:e}=await s(Object.assign(Ci,{clinics_id:pt.Clinic_id,therapist_list:Pt.Therapist_id,description:Pt.description,service_date:Pt.date,service_times:Pt.service_times,first_name:"",last_name:"",phone:"",email:"",config_id:Pt.config_id,add_session:"",during:Pt.During,sex:Pt.gender,customer_id:Pt.Client_id,company_id:Pt.loacation_id_add,Description_type:Pt.service_name1,mul_service:Nt,amount:Pt.amount,booking_id:Pt.booking_id,type:pt.type,counter:"",higher_days:vi.value,is_invoice:pt.is_invoice,is_tax:pt.is_tax,include_tax:pt.include_tax,additional_Service:se.value}));1==e.code?(ie.value=!1,""==Pt.booking_id&&pt.is_invoice&&(ce.value=!0,Ce.value=e.bookingdetail,Pt.invoiceTherapist_name=e.bookingdetail.therapists_name,Pt.invoiceTherapist_id=e.bookingdetail.therapists_id,je.value=JSON.parse(JSON.stringify(e.bookingdetail.clients.combina_service_arr)),je.value.forEach(((e,i)=>{e.service_detail.forEach(((e,i)=>{e.spend_time=Number(e.spend_time)})),ta(e),na(e)}))),We.value=e.invoiceIdArr,Be.value=e.email_values.booking_detail,Et.email_content=e.email_values.booking_message,Et.email_to=e.email_values.email_to,Et.phone_to=e.email_values.phone_to,e.email_values.booking_notice_type&&(Et.booking_notice_type=e.email_values.booking_notice_type,lt.value.forEach(((e,i)=>{Et.booking_notice_type.includes(e.value)&&(e.is_selected=1)}))),Et.name=e.email_values.name,Et.booking_id=e.email_values.booking_id,Et.is_booking=1,Et.booking_arr=e.email_values.booking_arr,Et.is_health_form=e.email_values.booking_detail[0].is_health_form,Et.is_informed=e.email_values.booking_detail[0].is_informed,Et.is_sensitived=e.email_values.booking_detail[0].is_sensitived,Et.health_form_url=e.email_values.booking_detail[0].health_form_url,Et.informed_content_url=e.email_values.booking_detail[0].informed_content_url,Et.sentitive_content_url=e.email_values.booking_detail[0].sentitive_content_url,Et.bookingServers=Pt.service_name1,Et.sentive_include=!1,1==e.result_key.is_data_change&&(pt.click_date=e.result_key.data),pt.action="click",pt.page=e.result_key.page,Yt(pt.action),$e.value=!1,Et.email_health=!1,Et.email_informed=!1,Et.email_type="",Ge.value=!0):(ie.value=!1,e.index?-1==e.index?U({type:"error",message:"Article 1: Appointment Time Conflict"}):1==e.index&&U({type:"error",message:"Multiple appointment times conflict, please click on the date to view"}):U({type:"error",message:e.msg})),ie.value=!1},serviceData:Vt,onHealthForm:zt,health_info:Ne,infoData:_i,healthDialog:Ye,btnHealthConfirm:async function(e){ie.value=!0;const i={information:vt,health_info:Ne.value},{data:t}=await l(Object.assign(xi,{customer_id:pt.userId1,data_row:i}));1==t.code?(ei.value&&ya(ni.value),U({type:"success",message:t.msg}),Ut(),Ye.value=!1,ie.value=!1):(U({type:"error",message:t.msg}),ie.value=!1)},onCheckIn:ya,addDuringDialog:ei,addDuringConfirm:Kt,onPaymant:e=>{z.confirm("Are you sure to payment?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{Gt(e)})).catch((()=>{U({type:"info",message:"Canceled"})}))},onHealth:function(e,i){1==i.is_selected?i.is_selected=0:0==i.is_selected&&(i.is_selected=1)},sandEmailDialog:Ge,EmailArr:Et,onSend:async function(){ie.value=!0;let e="";const i=[];""==Et.email_type?(Et.email_health&&i.push("health"),Et.email_informed&&i.push("informed"),e=i.toString()):e=Et.email_type;const{data:t}=await o(Object.assign(bi,{booking_id:Et.booking_id,email_content:Et.email_content,booking_arr:Et.booking_arr,phone_to:Et.phone_to,booking_notice_type:Et.booking_notice_type,sentive_include:Et.sentive_include,form_type:e}));1==t.code?(U({type:"success",message:t.msg}),Ut(),ce.value&&""==Pt.booking_id&&ia(Ce.value),Ge.value=!1):U({type:"error",message:t.msg}),ie.value=!1},onService:function(e){1==e.is_Selected?(e.is_Selected=0,e.is_Selected1=0):(e.is_Selected=1,e.is_Selected1=1),pt.page=1,Xt()},onCancel:function(){Ge.value=!1,ce.value&&""==Pt.booking_id&&ia(Ce.value)},ClientDetail:async function(e){const{data:i}=await d(Object.assign(Ai,{customer_id:Pt.Client_id}));1==i.code?(ui.value=i.data.booking_arr,li.value=i.data.note_arr,qe.value=!0):U({type:"error",message:i.msg})},BookingList:ui,NoteList:li,onMore:function(e){e.clients.is_more=2},onRetract:function(e){e.clients.is_more=1},onEmail:function(e,i,t){1==i&&(Et.booking_arr=[]),Et.email_health=!1,Et.email_informed=!1,Et.email_type=t,lt.value.forEach(((e,i)=>{e.is_selected=0})),Be.value=e.booking_detail,Be.value.length>0&&(Et.bookingServers=Be.value[0].description_type),Et.email_content=e.clients.email_values.booking_message,Et.email_to=e.clients.email_values.email_to,Et.name=e.clients.email_values.name,Et.booking_id=e.clients.email_values.booking_id,Et.is_booking=2,Et.bookingorder_id=e.clients.id,Et.phone_to=e.clients.email_values.phone_to,e.clients.email_values&&(Et.booking_notice_type=e.clients.email_values.booking_notice_type,lt.value.forEach(((e,i)=>{Et.booking_notice_type&&Et.booking_notice_type.includes(e.value)&&(e.is_selected=1)}))),ka(),ce.value=!1,Ge.value=!0},items:Nt,onDelete:e=>{z.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{$t(e)})).catch((()=>{U({type:"info",message:"Canceled"})}))},onAddItem:function(){xa("add")},formDialog:Ke,Form1Edit:wa,planArr:ht,noteArr:ft,sensitivedArr:yt,ougoingArr:bt,isData:kt,isData1:St,TimeData:wt,DurationData:Ct,initialData:xt,areasData1:Tt,usedData1:Ot,receivedData1:At,treatedData:It,submitNoteForm:ea,selectedTr:function(e,i){2!=pt.is_form_edit&&(kt.value.forEach(((e,i)=>{e.is_selected=0})),e.is_selected=1,ht.discussed_with=e.value)},selectedTr1:function(e,i){2!=pt.is_form_edit&&(St.value.forEach(((e,i)=>{e.is_selected=0})),e.is_selected=1,ht.treatment_plan=e.value)},btnInitia:function(e,i){2!=pt.is_form_edit&&(i.is_selected=e?1:0)},coatingRequire:function(e){2!=pt.is_form_edit&&(1==e.is_selected?e.is_selected=0:0==e.is_selected&&(e.is_selected=1))},coatingRequire1:function(e){2!=pt.is_form_edit&&(1==e.is_selected?e.is_selected=0:e.is_selected=1)},coatingRequire2:function(e){2!=pt.is_form_edit&&(1==e.is_selected?e.is_selected=0:e.is_selected=1)},onTime:function(e,i){2!=pt.is_form_edit&&(wt.value.forEach(((e,i)=>{e.is_selected=0})),e.is_selected=1,ft.timeType=e.value)},onDuration:function(e,i){2!=pt.is_form_edit&&(Ct.value.forEach(((e,i)=>{e.is_selected=0})),e.is_selected=1,ft.durationType=e.value)},onReceived:function(e,i){2!=pt.is_form_edit&&(At.value.forEach(((e,i)=>{e.is_selected=0})),e.is_selected=1,ft.receivedType=e.value)},btnAddInvoice:ia,items1:ut,InvoiceType:mt,during_price_array:ci,disabledBeforeToday:function(e){const i=new Date;return i.setHours(0,0,0,0),e.getTime()>i.getTime()},onIs_tax:function(e,i){Pt.is_tax=e?"Y":"N",na(i)},AddItem:function(){const e={id:ut.value.length+1,price:0,spend_time:"",treatment_date:ut.value[0].treatment_date};ut.value.push(e)},onDeleteI:(e,i)=>{z.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{aa(e,i)})).catch((()=>{U({type:"info",message:"Canceled"})}))},IncludeTax:function(e,i){na(i)},onPrice:na,taxData:_t,invoiceConfirm:async function(){te.value=!0,"outside"==Pt.invoice_type?Pt.description_type1:Pt.description_type;const{data:e}=await g(Object.assign(Bi,{customer_id:Pt.Client_id1,company_id:Pt.loacation_id1,invoice_type:Pt.invoice_type,invoice_due_date:Pt.invoice_due_date,is_tax:Pt.is_tax,description_type:pt.LicenceServeValue,signal_image:Pt.signal_image5,signal_desc:Pt.signal_desc,include_tax:Pt.include_tax,invoice_number:Pt.Invoice_Number,receive_message:Pt.receive,note_id:Pt.note_id,origin:"booking",combina_service_arr:je.value,therapist_id:Pt.invoiceTherapist_id,switch_therapist_id:Pt.has_therapistlicence,files:Pt.files}));1==e.code?(te.value=!1,1==pt.is_invoice?(Pt.include_tax="N",We.value=e.invoice_id_arr,ha(5),Ut(),Xe.value=!1):(Ut(),Xe.value=!1),U({type:"success",message:e.msg})):(te.value=!1,U({type:"error",message:e.msg}))},duringPrice:function(e,i,t){t.spend_time=e,t.during_price_json.forEach(((i,a)=>{i.value==e&&(t.price=i.price)})),na(i)},changeService:function(e,i){pi.value.forEach(((t,a)=>{e==t.service_name&&(pt.service_id=t.id,ta(i),ci.value=t.during_price_json,i.licence_name=t.licence_name,i.licence_description=t.description,i.licence_title=t.licence_title,i.licence_number=t.licence_number,2==pt.type&&(Pt.signal_image5=t.sinal_image_arr,Pt.signal_desc=t.sinal_desc_arr),1==pt.type&&(Pt.signal_image5=t.sinal_image_arr,Pt.signal_desc=t.sinal_desc_arr))})),name=0,ci.value.forEach(((e,i)=>{e.duration==Pt.During&&(ut.value[0].spend_time=e.duration,name=1,ut.value[0].price=e.price)})),0==name&&(ut.value[0].price=ci.value[0].price)},invoiceDialog:Xe,descriptionData:dt,signatureCanvas:he,signatureDataUrl:fe,saveSignature:()=>{sa.deactivateAll().renderAll(),fe.value=sa.toDataURL({format:"png"})},clearSignature:function(){fe.value=""},autographDialog:He,openAutograph:function(e,i){2!=pt.is_form_edit&&(Mt.signal_url=i,Mt.form_type=e,Mt.note_id=pt.note_id,Mt.service="",Mt.service_id="",ea(2),He.value=!0)},signalData:Mt,eventSignal:function(){"invoice"==Mt.form_type?ra(ke.value.clients.therapist_list,ke.value.clients.note_id):wa(Se.value,pt.form_type)},addServiceData:Je,onServiceAdd:function(e){if(e.additional_Service?se.value=JSON.parse(JSON.stringify(e.additional_Service)):se.value=[],e.value==Ce.value.clients.description_type&&(se.value=oe.value),Je.value.forEach(((e,i)=>{e.is_Selected1=0})),e.is_Selected1=1,Pt.service_name1=e.service_name,""==Pt.booking_id){let i="";e.during_price_json.forEach(((e,t)=>{e.default&&(i=e.duration)})),""==i&&(i=e.during_price_json.length>0?e.during_price_json[0].duration:60),Pt.During=i}da(),ga()},onArrowLeft:function(){-2==pt.prev_page&&(pt.click_date=pt.last_day,pt.action="click",Yt(pt.action)),pt.prev_page>0&&(pt.page=pt.prev_page,Ut())},onArrowRight:function(){-2==pt.next_page&&(pt.click_date=pt.next_day,pt.action="click",Yt(pt.action)),pt.next_page>0&&(pt.page=pt.next_page,Ut())},ClinicsList:oi,btnClinic:function(){oa()},btnSearchService:la,LicenceServeData:pi,btnAmount:function(e){da(e)},CollectionDialog:Re,btnCollection:function(e){const i={Invoice_Charge_Number:e.invoice_number,Customer_Name:e.username,Invoice_Total_Charge:e.total_amount,Has_Paid_Amount:e.pay_amount,Need_Charge_Amount:e.need_charge_amount,Total_Paid_Amount:"",customer_id:e.customer_id,customer_name:e.username,invoice_id:e.id};return nt.value=1,ot.value=i,void(st.value=!0)},CollectionData:Me,bookingPaymentConfirm:async function(){const{data:e}=await f(Object.assign(Fi,{invoice_id:Bt.invoice_id,pay_amount_details:Me.value}));1==e.code?(Ut(),Re.value=!1):U({type:"error",message:e.msg})},addCollectionDialog:Ve,AddCollect:function(){Ve.value=!0},collectionArr:Bt,btncollectionConfirm:async function(){if(ie.value=!0,"Cheque"!=Bt.pay_method&&(Bt.cheque_number=""),"Cheque"==Bt.pay_method&&""==Bt.cheque_number)return U({type:"error",message:"Please enter cheque number"}),void(ie.value=!1);let e="";if("Other"==Bt.pay_method){if(""==Bt.other)return U({type:"error",message:"Please enter pay method"}),void(ie.value=!1);e=Bt.other}else e=Bt.pay_method;const{data:i}=await y(Object.assign(Qi,{customer_id:Bt.customer_id,pay_amount:Bt.pay_amount,pay_method:e,cheque_number:Bt.cheque_number,content:Bt.content,collection_time:Bt.time,account_id:Bt.account_id}));1==i.code?(_a(),U({type:"success",message:i.msg}),Ve.value=!1,ie.value=!1):(U({type:"error",message:i.msg}),ie.value=!1)},btnDellocation:Ht,btnDelBooking:e=>{z.confirm("Are you sure you want to delete this booking ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{ua(e)})).catch((()=>{U({type:"info",message:"Canceled"})}))},btnEdit:function(e){e.clients.additional_Service?(se.value=JSON.parse(JSON.stringify(e.clients.additional_Service)),oe.value=JSON.parse(JSON.stringify(e.clients.additional_Service))):(se.value=[],oe.value=[]),Pt.booking_id=e.clients.id,Pt.Client_name=e.clients.customer_name,Pt.Client_id=e.clients.customer_id,Je.value=Vt.value,Pt.date=e.clients.service_date.substr(0,10),Pt.service_times=e.clients.begin_time,Pt.During=e.clients.session,Pt.amount=e.clients.amount,Pt.description=e.clients.description,Pt.Therapist_name=e.therapists_name,Pt.Therapist_id=e.therapists_id,Pt.loacation_id_add=e.clients.company_id,Pt.loacation_name_add=e.clients.company_name,Pt.used_form_id="",Fe.value=[];const i=e.clients.description_type;Pt.service_name1=e.clients.description_type,Je.value.forEach(((e,t)=>{e.is_Selected1=0,i.includes(e.value)&&(e.is_Selected1=1)})),(1==pt.type||6==pt.type)&&(pt.is_invoice=!1,$e.value=!0),2==pt.type&&(e.clients.clinics_id?pa(e.clients.clinics_id):U({type:"error",message:"This appointment was not added by the current clinic and cannot be modified"}),ma())},TherapistList1:gi,btnAmount1:Zt,emailData:Be,InvoiceDetailDialog:le,company_info:we,customer_info:Oe,info:Ie,licenceDetail:Ae,detailInfo:Le,invoiceData:di,onCancelEmail:function(){le.value=!1},sendEmail:function(){le.value=!1,ge.value=!0},sandEmailInvoiceDialog:ge,noSend:function(){ge.value=!1},btnShowNumber:async function(){const{data:e}=await w(Object.assign(Yi,{show_number:Rt.show_number}));1==e.code&&U({type:"success",message:e.msg})},InvoiceEmailSend:async function(){ie.value=!0;const{data:e}=await C(Object.assign(Ui,{invoice_id_arr:We.value,email_content:Pt.email_content,show_number:Rt.show_number}));1==e.code?(Ut(),U({type:"success",message:e.msg}),ge.value=!1):U({type:"error",message:e.msg}),ie.value=!1},DeducationData:Fe,selectedDeducation:function(e){Pt.used_form_id==e.id?(Pt.used_form_id="",Pt.is_invoiceShow=1):(Pt.used_form_id=e.id,pt.is_invoice=!1,Pt.is_invoiceShow=2)},customerSubmit:function(e){Se.value=e,ve.value=!0},customerConfirmDialog:ve,sigArr:Se,onShare1:async function(){try{await navigator.clipboard.writeText(Se.value.clients.customer_submit_href),U({type:"success",message:"The text has been copied to the clipboard!"})}catch(e){console.error("复制失败:",e),U({type:"error",message:"Copy failed, please manually copy"})}},btnEvaluation:async function(e){const{data:i}=await x(Object.assign(zi,{bookingorder_id:e.clients.id}));1==i.code?(be.value=i.data.evaluationinfo,ue.value=!0):U({type:"error",message:i.msg})},EvaluationDialog:ue,evaluationinfo:be,evaluationImg:function(e){window.open(e)},SendEvaluationEmail:async function(){const{data:e}=await T(Object.assign(Ki,{booking_id:Se.value.clients.id}));1==e.code?(ve.value=!1,U({type:"success",message:e.msg})):U({type:"error",message:e.msg})},openInvoAutograph:function(){Mt.signal_url="signal_url1",Mt.form_type="invoice",Mt.note_id="",Mt.service=pt.LicenceServeValue,Mt.service_id=pt.service_id,He.value=!0},signalUrl:De,btnFinish:function(e){Te.value=e.clients.id,Pt.Customer_Name=e.clients.customer_name,Bt.customer_id=e.clients.customer_id,pe.value=!0},onEmailSensitive:function(e){},addMessageData:lt,onMessageData:function(e){1==e.is_selected?e.is_selected=0:0==e.is_selected&&(e.is_selected=1);const i=[];lt.value.forEach(((e,t)=>{1==e.is_selected&&i.push(e.value)})),Et.booking_notice_type=i.toString()},btnIsSensitived:function(){wa(ni.value,"sensitived")},btnIsInformed:function(){wa(ni.value,"informed")},btnIsHealthForm:function(){zt(ni.value)},onAppointComplete:e=>{z.confirm(" this booking is Appoint Complete ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{ba(e)})).catch((()=>{U({type:"info",message:"Canceled"})}))},btnBookingDetail:va,bookingDetailDialog:_e,bookedArr:Ce,handleExceed:e=>{ye.value.clearFiles();const i=e[0];i.uid=K(),ye.value.handleStart(i),Sa()},handleChangePic:function(e,i,t){i.length>1&&i.splice(0,1)},bookingImg:ye,uploadSlotFile1:function(e,i,t){1==e.code&&(Ut(),U({type:"success",message:"Upload successful"}))},btnFormImgView:function(e){window.open(I+e.replace("/var/www/html/public",""))},onNotesForm:function(e,i){Ca(e,i,2)},btnFormImgView8:function(e){window.open(I+e.replace("/var/www/html/public",""))},getbookingDetalInvoiceDetail:function(e){We.value=[],We.value.push(e.id),ha(1)},bookingInvoiceEmailSend:function(e){We.value=[],We.value.push(e.id),ha(2)},payMethodData:Dt,AccountData:$,btnPrintPDF:async function(e){e.loading=!0;const{data:i}=await j(Object.assign($i,{invoice_id:e.id,show_number:Rt.show_number}));1==i.code?(e.loading=!1,window.open(I+i.file_path.replace("var/www/html/public",""))):(e.loading=!1,U({type:"error",message:i.msg}))},btnHistory:function(){1==pt.is_form_history?pt.is_form_history=2:pt.is_form_history=1},btnService:()=>{z.confirm("Invoicing requires the therapist to provide licence services",{confirmButtonText:"Go add",cancelButtonText:"cancel",type:"warning"}).then((()=>{Da()})).catch((()=>{U({type:"info",message:"Canceled"})}))},btnFinish1:async function(e){const{data:i}=await O(Object.assign(Gi,{booking_id:Te}));1==i.code?(pe.value=!1,Ut(),1==i.is_use?U({type:"success",message:i.use_msg}):U({type:"success",message:i.msg})):U({type:"error",message:i.msg})},FinishDialog:pe,btnAddmultiple:function(e){Nt.value=[],e&&xa("add")},changeNumber:function(){xa("update")},intervalDays:function(e){},BookingsByDate:async function(){if(Pe.value.length>0)return void(Pe.value=[]);const{data:e}=await P(Object.assign(it,{therapist_id:Pt.Therapist_id,date:Pt.date}));1==e.code?e.data.length>0?Pe.value=e.data:U({type:"success",message:"No booking conflicts"}):U({type:"error",message:e.msg})},bookingByDate:Pe,changeTime:function(e){xa("check")},btnViewtime:function(e){0==e.is_show?e.is_show=1:e.is_show=0},onSituationArr:function(e){pt.tableIndex=e},onBackInvoice:function(){},handleDblClick:function(e){},visual_data:ee,virtualDialog:de,virtualArr:Ee,HealthArr:vt,rashesBruise:function(e){},SensitiveDialog:re,SensitiveEmail:async function(){ie.value=!0;const{data:e}=await B(Object.assign(tt,{booking_id:Ce.value.clients.id}));1==e.code?(xt.value=e.data.sensitive_values,yt.indication=e.data.Clinical_lndication,ie.value=!1,re.value=!0):(ie.value=!1,U({type:"error",message:e.msg}))},SendEmailSensitive:async function(){ie.value=!0;const{data:e}=await W(Object.assign(at,{booking_id:Ce.value.clients.id,sensitive_values:xt.value,Clinical_lndication:yt.indication}));1==e.code?(re.value=!1,ie.value=!1,U({type:"success",message:e.msg})):(ie.value=!1,U({type:"error",message:e.msg}))},GoaddTherapist:function(){Q.push({path:"/crm/yuyue/clinic/employee",query:{}})},GoaddService:function(){2==pt.type?Q.push({path:"/crm/yuyue/clinic/service",query:{}}):1==pt.type&&Q.push({path:"/crm/yuyue/licence",query:{booking:1}})},btnFillout:function(e){pt.is_historyAll=e,Ce.value.clients.other_note_detail.forEach(((i,t)=>{1==e?(i.is_informed=!0,i.is_ongoning=!0,i.is_sensitive=!0,i.is_treatment_note=!0,i.is_treatment_plan=!0,i.is_TCM=!0,i.is_record=!0):2==e&&(i.is_informed=JSON.parse(JSON.stringify(i.is_informed_show)),i.is_ongoning=JSON.parse(JSON.stringify(i.is_ongoning_show)),i.is_sensitive=JSON.parse(JSON.stringify(i.is_sensitive_show)),i.is_treatment_note=JSON.parse(JSON.stringify(i.is_treatment_note_show)),i.is_treatment_plan=JSON.parse(JSON.stringify(i.is_treatment_plan_show)),i.is_TCM=JSON.parse(JSON.stringify(i.is_TCM_show)),i.is_record=JSON.parse(JSON.stringify(i.is_record_show)))}))},detaiilMenu:ct,onDetaiilMenu:function(e){Rt.tableIndex=e},ServiceInvoice:je,stulesShow:rt,btnStulesShow:function(e){1==e.is_selected?e.is_selected=0:e.is_selected=1,Ut()},onDeleteService:e=>{z.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{Ta(e)})).catch((()=>{U({type:"info",message:"Canceled"})}))},isleftShow:function(e){pt.is_leftShow=e},canLicenceTherapist:function(){},canLicenceTherapistConfirm:async function(){ra(Pt.has_therapistlicence,Ce.value.clients.note_id)},ChargeDialog:st,eventCharge:function(){Ut()},str1:nt,ChargeArr:ot,btnIsPaid:async function(e,i){const{data:t}=await L(Object.assign(Li,{invoice_id:i.id,is_paid:e}));1==t.code&&Ut(),U({type:"success",message:t.msg})},loading5:te,uploadSlotFile11:function(e,i,t){1==e.code?(Pt.files.push(I+e.data.file_path.replace("var/www/html/public/","")),Pt.files1.push(e.data.file_name)):U({type:"error",message:e.data.msg})},btnFile:function(e){e.length&&(ne.value=e,ae.value=!0)},fileArr:ne,onFile:function(e){window.open(e)},fileDialog:ae,additionalService:se,changeAdditional:function(){da()},onChineseMedical:function(e,i){1==e&&(gt.note_id=Ce.value.clients.note_id,gt.str=e),2==e&&(gt.note_id=i.id),gt.form_type="TCM",gt.str=e,me.value=!0},chineseMedicalDialog:me,chineseArr:gt,eventChinese:function(){Ut()}}}))}}}));