"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9963],{275:(e,t,a)=>{a.d(t,{$Q:()=>H,$S:()=>U,CQ:()=>M,CT:()=>C,CU:()=>W,DT:()=>eb,E5:()=>ep,GE:()=>et,Gi:()=>y,Lu:()=>ei,OE:()=>eo,PW:()=>ef,Q3:()=>D,QZ:()=>k,Qx:()=>K,R3:()=>N,RQ:()=>ee,Rs:()=>R,TB:()=>I,TZ:()=>ec,Uo:()=>q,VS:()=>eh,Wf:()=>en,XH:()=>Q,XI:()=>er,Y9:()=>L,Ys:()=>ed,_h:()=>S,_y:()=>es,a0:()=>ex,a3:()=>z,bZ:()=>E,cr:()=>F,dC:()=>Y,dt:()=>A,eC:()=>V,f4:()=>em,hv:()=>_,iP:()=>eu,in:()=>eg,jm:()=>f,kc:()=>ea,lC:()=>J,m0:()=>h,m3:()=>T,mx:()=>B,o:()=>w,oc:()=>P,rF:()=>b,sC:()=>$,sM:()=>el,sc:()=>X,sm:()=>e_,tZ:()=>x,u9:()=>j,wO:()=>g,wx:()=>O,z4:()=>ew});var n=a(3643),s=a(6693),i=a(2983),r=a(4280),l=a(7203),o=a(2442);let d=e=>{let t=["image/png","image/jpeg"];return new Promise((a,n)=>{if(!(e instanceof File))return void n(Error("Invalid file type."));if(!t.includes(e.type))return void n(Error("Image must be '.png' or '.jpeg' file."));let s=new Image;s.src=URL.createObjectURL(e),s.onload=()=>{URL.revokeObjectURL(s.src),s.width<=256&&s.height<=256?a(!0):n(Error("Image resolution must be less than 256x256 pixels."))},s.onerror=()=>{n(Error("Invalid image file."))}})},u=e=>/^\+?[\d]{8,12}$/.test(e),c=e=>""!==e.facebook||""!==e.instagram||""!==e.linkedin||""!==e.twitter||""!==e.youtube||""!==e.github,m={message:"At least one social media link (Facebook, Instagram, Linkedin, Twitter, Youtube, or Github) is required.",path:["facebook"]},h=["red","rose","orange","green","blue","yellow","violet","zinc","slate","stone","gray","neutral"],b=["agriculture","automotive","beauty_and_wellness","construction","education","electrical","entertainment","finance","food_and_beverage","healthcare","it_services","manufacturing","professional_services","real_estate","retail","textile","tourism","transportation","others"],p=o.Ik({business_name:o.Yj().min(3,"Business Name must be between 3 and 25 characters.").max(25,"Business Name must be between 3 and 25 characters."),description:o.Yj().min(3,"Description must be between 3 and 150 characters.").max(250,"Description must be between 3 and 250 characters."),slogan:o.Yj().min(3,"Slogan must be between 3 and 100 characters.").max(100,"Slogan must be between 3 and 100 characters."),theme:o.k5(h,{errorMap:()=>({message:"Select a Theme"})}),category:o.k5(b,{errorMap:()=>({message:"Select a Category"})}),primary_phone_number:o.Yj().refine(u,"Primary Phone Number is not a valid phone number."),whatsapp_phone_number:o.Yj().refine(u,"Whatsapp Phone Number is not a valid phone number."),primary_email:o.Yj().email("Primary Email must be a valid email address."),primary_address:o.Yj().min(3,"Primary Address must be between 3 and 250 characters.").max(250,"Primary Address must be between 3 and 250 characters."),primary_address_map_location:o.Yj().refine(e=>/^(https?:\/\/)?(maps\.app\.goo\.gl|goo\.gl\/maps|maps\.google\.[a-z]+|(www\.)?google\.[a-z]+\/maps)\/.+/.test(e),"Primary Address Map Location must be a valid Google Maps link."),secondary_phone_number:o.Yj().optional().refine(e=>!e||u(e),"Secondary Phone Number is not a valid phone number."),secondary_email:o.Yj().optional().refine(e=>!e||/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e),"Secondary Email must be a valid email address."),facebook:o.Yj().optional().refine(e=>!e||/^(https?:\/\/)?(www\.)?facebook.com\/.+/.test(e),"Facebook link is not valid."),instagram:o.Yj().optional().refine(e=>!e||/^(https?:\/\/)?(www\.)?instagram.com\/.+/.test(e),"Instagram link is not valid."),linkedin:o.Yj().optional().refine(e=>!e||/^(https?:\/\/)?(www\.)?linkedin.com\/.+/.test(e),"Linkedin link is not valid."),twitter:o.Yj().optional().refine(e=>!e||/^(https?:\/\/)?(www\.)?(twitter|x).com\/.+/.test(e),"Twitter link is not valid."),youtube:o.Yj().optional().refine(e=>!e||/^(https?:\/\/)?(www\.)?youtube.com\/.+/.test(e),"Youtube link is not valid."),github:o.Yj().optional().refine(e=>!e||/^(https?:\/\/)?(www\.)?github.com\/.+/.test(e),"Github link is not valid.")}),g=p.extend({logo:o.bz().refine(e=>d(e).then(()=>!0).catch(()=>!1),"Logo must be '.png' or '.jpeg' file and resolution must be less than 256x256 pixels.")}).refine(c,m),f=p.extend({logo:o.bz().optional().refine(e=>!e||"string"==typeof e||d(e).then(()=>!0).catch(()=>!1),"Logo must be '.png' or '.jpeg' file and resolution must be less than 256x256 pixels.")}).refine(c,m),w={business_name:"",logo:"",description:"",slogan:"",primary_email:"",secondary_email:"",primary_phone_number:"",whatsapp_phone_number:"",secondary_phone_number:"",primary_address:"",primary_address_map_location:"",facebook:"",instagram:"",linkedin:"",twitter:"",youtube:"",github:""},x=o.Ik({visibility:o.k5(["public","private"],{errorMap:()=>({message:"Visibility must be one of public or private."})}),folder:o.k5(["","content-sections","services","clients","projects","others-public","others-private"],{errorMap:()=>({message:"Folder must be one of content-sections, services, clients, projects or others."})})}).refine(e=>{let t=[];return"public"===e.visibility?t=["content-sections","services","clients","projects","others-public"]:"private"===e.visibility&&(t=["others-private"]),t.includes(e.folder)},{message:"Select Folder",path:["folder"]}),_={visibility:"public",folder:""},v=o.Ik({asset_id:o.Yj().min(5,"Media is Required"),asset_url:o.Yj().min(5,"Media is Required"),asset_type:o.Yj().min(3,"Media is Required")}),y=o.Ik({title:o.Yj().min(3,"Title must be between 3 and 25 characters.").max(25,"Title must be between 3 and 25 characters."),subtitle:o.Yj().min(3,"Sub Title must be between 3 and 75 characters.").max(75,"Sub Title must be between 3 and 75 characters."),media:v,cta_list:o.YO(o.Ik({label:o.Yj().min(3,"Label must be between 3 and 25 characters.").max(25,"Label must be between 3 and 25 characters."),go_to:o.k5(["contact-us","services"],{errorMap:()=>({message:"Go To must be one of: Contact Us, Services."})})})).min(1,"Minimum One CTA is Needed").max(2,"Maximum Two CTA is Needed")}),j={title:"",subtitle:"",media:{asset_id:"",asset_type:"",asset_url:""},cta_list:[{label:"",go_to:""}]},k=o.Ik({title:o.Yj().min(3,"Title must be between 3 and 25 characters.").max(25,"Title must be between 3 and 25 characters."),subtitle:o.Yj().min(3,"Sub Title must be between 3 and 75 characters.").max(75,"Sub Title must be between 3 and 75 characters."),media:v}),S={title:"",subtitle:"",media:{asset_id:"",asset_type:"",asset_url:""}},N=o.Ik({hero:o.Ik({content_alignment:o.k5(["center","left","right"],{errorMap:()=>({message:"Content Alignment must be one of: center, left, right."})}),content_list:o.YO(y).min(1,"Minimum One Content is Needed").max(5,"Maximum Five Content is Needed")}),who_we_are:o.Ik({subtitle:o.Yj().min(3,"Sub Title must be between 3 and 75 characters.").max(75,"Sub Title must be between 3 and 75 characters."),description:o.Yj().min(3,"Description must be between 3 and 250 characters.").max(250,"Description must be between 3 and 250 characters."),bullet_point_list:o.YO(o.Ik({content:o.Yj().min(3,"Bullet Point must be between 3 and 150 characters.").max(150,"Bullet Point must be between 3 and 150 characters.")})).min(3,"Minimum Three Bullet Point is Needed").max(5,"Maximum Five Bullet Point is Needed"),media:v}),why_choose_us:o.Ik({subtitle:o.Yj().min(3,"Sub Title must be between 3 and 75 characters.").max(75,"Sub Title must be between 3 and 75 characters."),description:o.Yj().min(3,"Description must be between 3 and 250 characters.").max(250,"Description must be between 3 and 250 characters."),bullet_point_list:o.YO(o.Ik({content:o.Yj().min(3,"Bullet Point must be between 3 and 150 characters.").max(150,"Bullet Point must be between 3 and 150 characters.")})).min(3,"Minimum Three Bullet Point is Needed").max(5,"Maximum Five Bullet Point is Needed"),media:v}),how_we_work:o.Ik({subtitle:o.Yj().min(3,"Sub Title must be between 3 and 75 characters.").max(75,"Sub Title must be between 3 and 75 characters."),description:o.Yj().min(3,"Description must be between 3 and 250 characters.").max(250,"Description must be between 3 and 250 characters."),content_list:o.YO(k).min(3,"Minimum Three Content is Needed").max(10,"Maximum Ten Content is Needed")})}),A={hero:{content_alignment:"left",content_list:[]},who_we_are:{subtitle:"",description:"",bullet_point_list:[{content:""},{content:""},{content:""}],media:{asset_id:"",asset_type:"",asset_url:""}},why_choose_us:{subtitle:"",description:"",bullet_point_list:[{content:""},{content:""},{content:""}],media:{asset_id:"",asset_type:"",asset_url:""}},how_we_work:{subtitle:"",description:"",content_list:[]}},M=o.Ik({title:o.Yj().min(3,"Title must be between 3 and 25 characters.").max(25,"Title must be between 3 and 25 characters."),subtitle:o.Yj().min(3,"Sub Title must be between 3 and 75 characters.").max(75,"Sub Title must be between 3 and 75 characters."),description:o.Yj().min(3,"Description must be between 3 and 250 characters.").max(250,"Description must be between 3 and 250 characters."),tag_id:o.Yj().min(5,"Tag is Required"),bullet_point_list:o.YO(o.Ik({content:o.Yj().min(3,"Bullet Point must be between 3 and 150 characters.").max(150,"Bullet Point must be between 3 and 150 characters.")})).min(3,"Minimum Three Bullet Point is Needed").max(5,"Maximum Five Bullet Point is Needed"),pricing_starting_currency:o.k5(["INR","USD","EUR"],{errorMap:()=>({message:"Starting Price Currency must be one of: INR, USD, EUR."})}),pricing_starting_mode:o.k5(["perHour","perDay","perWeek","perMonth","perYear","perQuotation","perPackage"],{errorMap:()=>({message:"Starting Price Currency must be one of: perHour, perDay, perWeek, perMonth, perYear, perQuotation, perPackage."})}),pricing_starting_value:o.Yj().min(1,"Starting Price value must be between 1 and 10000000 value.").max(7,"Starting Price value must be between 1 and 10000000 value."),primary_media:v,media_list:o.YO(v).min(1,"Media List must be between 1 and 10.").max(10,"Media List must be between 1 and 10."),faq_list:o.YO(o.Yj().min(5,"FAQ is Required").max(75,"FAQ is Required")).min(1,"FAQ List must be between 1 and 10.").max(10,"FAQ List must be between 1 and 10.")}),C={title:"",subtitle:"",description:"",tag_id:"",bullet_point_list:[{content:""},{content:""},{content:""}],pricing_starting_currency:"",pricing_starting_mode:"",pricing_starting_value:"",primary_media:{asset_id:"",asset_type:"",asset_url:""},media_list:[],faq_list:[]},E=o.Ik({tag_name:o.Yj().min(3,"Tag Name must be between 3 and 25 characters.").max(25,"Tag Name must be between 3 and 25 characters.")}),R={tag_name:""},Y=o.Ik({question:o.Yj().min(3,"Question must be between 3 and 150 characters.").max(150,"Question must be between 3 and 150 characters."),answer:o.Yj().min(3,"Answer must be between 3 and 250 characters.").max(250,"Answer must be between 3 and 250 characters."),tag_id:o.Yj().min(5,"Tag is Required").max(75,"Tag is Required")}),I={question:"",answer:"",tag_id:""},P=o.Ik({client_name:o.Yj().min(3,"Name must be between 3 and 25 characters.").max(25,"Name must be between 3 and 25 characters."),email:o.Yj().email("Email must be a valid email address."),phone_number:o.Yj().refine(u,"Phone Number is not a valid phone number."),client_location:o.Yj().min(3,"Location must be between 3 and 50 characters.").max(50,"Location must be between 3 and 50 characters."),dp_media:v.nullable(),tag_id:o.Yj().min(5,"Tag is Required").max(75,"Tag is Required"),is_public:o.zM(),is_business:o.zM(),client_role:o.Yj().optional().refine(e=>!e||e.length>=3&&e.length<=25,"Client Role Name must be between 3 and 25 characters."),company_name:o.Yj().optional().refine(e=>!e||e.length>=3&&e.length<=50,"Company Name must be between 3 and 50 characters."),company_address:o.Yj().optional().refine(e=>!e||e.length>=3&&e.length<=250,"Company Address must be between 3 and 250 characters."),company_logo_media:v.nullable()}).superRefine((e,t)=>{e.is_business&&(e.client_role||t.addIssue({code:"custom",path:["client_role"],message:"Client Role is required when 'is_business' is true."}),e.company_name||t.addIssue({code:"custom",path:["company_name"],message:"Company Name is required when 'is_business' is true."}),e.company_address||t.addIssue({code:"custom",path:["company_address"],message:"Company Address is required when 'is_business' is true."}))}),L={client_name:"",email:"",phone_number:"",client_location:"",dp_media:null,tag_id:"",is_public:!1,is_business:!1,client_role:"",company_name:"",company_address:"",company_logo_media:null},D=o.Ik({client_id:o.Yj().min(5,"Client is Required").max(75,"Client is Required"),description:o.Yj().min(3,"Description must be between 3 and 250 characters.").max(250,"Description must be between 3 and 250 characters."),ratings:o.ai().min(1,"Ratings must be between 1 and 5.").max(5,"Ratings must be between 1 and 5.")}),T={client_id:"",description:"",ratings:0},z=o.Ik({title:o.Yj().min(3,"Title must be between 3 and 25 characters.").max(25,"Title must be between 3 and 25 characters."),subtitle:o.Yj().min(3,"Sub Title must be between 3 and 75 characters.").max(75,"Sub Title must be between 3 and 75 characters."),description:o.Yj().min(3,"Description must be between 3 and 250 characters.").max(250,"Description must be between 3 and 250 characters."),tag_id:o.Yj().min(5,"Tag is Required").max(75,"Tag is Required"),client_id:o.Yj().min(5,"Client is Required").max(75,"Client is Required"),project_status:o.k5(["ongoing","completed","paused","cancelled"],{errorMap:()=>({message:"Project Status must be one of: ongoing, completed, paused, cancelled."})}),start_date:o.ai().gt(0,"Start Date is required"),end_date:o.ai().gt(0,"End Date is required"),links:o.YO(o.Ik({content:o.Yj().min(3,"Link must be between 3 and 150 characters.").max(150,"Link must be between 3 and 150 characters.")})).min(0,"Minimum Zero Links is Needed").max(5,"Maximum Five Links is Needed"),primary_media:v,media_list:o.YO(v).min(1,"Media List must be between 1 and 10.").max(10,"Media List must be between 1 and 10."),is_public:o.zM()}).refine(e=>!e.end_date||!e.start_date||e.end_date>=e.start_date,{message:"End date cannot be before start date",path:["end_date"]}),O={title:"",subtitle:"",description:"",tag_id:"",client_id:"",project_status:"",start_date:0,end_date:0,links:[],primary_media:{asset_id:"",asset_type:"",asset_url:""},media_list:[],is_public:!1},B=Array.from({length:10},(e,t)=>"".concat(t," hour").concat(1!==t&&0!==t?"s":"")),F=Array.from({length:12},(e,t)=>"".concat(5*t," minute").concat(5*t!=0?"s":"")),V=["Online Meeting","Phone Call","Office"],q=["OFF","15 minutes","30 minutes","1 hour","2 hours"],U=["Now","1 hour","2 hours","4 hours","12 hours","1 day","2 days","1 week"],W=["1 week","2 weeks","3 weeks","4 weeks"],Q=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],G=Array.from({length:12},(e,t)=>["".concat(0===t?12:t,":00 AM"),"".concat(0===t?12:t,":30 AM")]).flat(),Z=Array.from({length:12},(e,t)=>["".concat(0===t?12:t,":00 PM"),"".concat(0===t?12:t,":30 PM")]).flat(),H=G.concat(Z),$=[{day:"Monday",start_time:"9:00 AM",end_time:"6:00 PM"},{day:"Tuesday",start_time:"9:00 AM",end_time:"6:00 PM"},{day:"Wednesday",start_time:"9:00 AM",end_time:"6:00 PM"},{day:"Thursday",start_time:"9:00 AM",end_time:"6:00 PM"},{day:"Friday",start_time:"9:00 AM",end_time:"6:00 PM"},{day:"Saturday",start_time:"9:00 AM",end_time:"6:00 PM"},{day:"Sunday",start_time:"9:00 AM",end_time:"6:00 PM"}],X=o.Ik({title:o.Yj().min(3,"Title must be between 3 and 50 characters.").max(50,"Title must be between 3 and 50 characters."),description:o.Yj().min(3,"Description must be between 3 and 250 characters.").max(250,"Description must be between 3 and 250 characters."),duration_hours:o.k5(B,{errorMap:()=>({message:"Duration Hours must be between 0 and 24 hours."})}),duration_minutes:o.k5(F,{errorMap:()=>({message:"Duration Minutes must be between 0 and 55 minutes in increments of 5."})}),appointment_type:o.k5(V,{errorMap:()=>({message:"Type must be one of: Online Meeting, Phone Call, Office."})}),reminder_before:o.k5(q,{errorMap:()=>({message:"Reminder Before must be a one ofthe 'OFF', '15 minutes', '30 minutes', '1 hour' or '2 hours'."})}),start_date:o.k5(U),end_date:o.k5(W),weekly_availability:o.YO(o.Ik({day:o.k5(Q),start_time:o.k5(H),end_time:o.k5(H)})).min(1,{message:"At least one weekly availability is required."}),questions:o.YO(o.Ik({question:o.Yj().min(3,"Question must be between 3 and 150 characters.").max(150,"Question must be between 3 and 150 characters."),required:o.zM()})).min(1,"Questions must be between 1 and 5").max(5,"Questions must be between 1 and 5")}),K={title:"",description:"",duration_hours:"0 hour",duration_minutes:"30 minutes",appointment_type:"Phone Call",reminder_before:"OFF",start_date:"Now",end_date:"4 weeks",weekly_availability:[{day:"Monday",start_time:"9:00 AM",end_time:"6:00 PM"},{day:"Tuesday",start_time:"9:00 AM",end_time:"6:00 PM"},{day:"Wednesday",start_time:"9:00 AM",end_time:"6:00 PM"},{day:"Thursday",start_time:"9:00 AM",end_time:"6:00 PM"},{day:"Friday",start_time:"9:00 AM",end_time:"6:00 PM"}],questions:[{question:"",required:!1}]},J=o.Ik({appointment_id:o.Yj().min(5,"Appointment is Required").max(75,"Appointment is Required"),client_id:o.Yj().min(5,"Client is Required").max(75,"Client is Required"),date:o.ai().gt(0,"Appointment Date is required"),time:o.ai().gt(0,"Appointment Time is required").lte(86400,"Appointment Time is required"),reason:o.Yj().min(3,"Appointment Reason must be between 3 and 250 characters.").max(250,"Appointment Reason must be between 3 and 250 characters."),organiser_name:o.Yj().min(3,"Organiser Name must be between 3 and 25 characters.").max(25,"Organiser Name must be between 3 and 25 characters."),organiser_email:o.Yj().email("Organiser Email must be a valid email address."),organiser_phone_number:o.Yj().refine(u,"Organiser Phone Number is not a valid phone number."),confirmed_by_client:o.zM(),send_email:o.zM()}),ee={appointment_id:"",client_id:"",date:0,time:0,reason:"",organiser_name:"",organiser_email:"",organiser_phone_number:"",confirmed_by_client:!1,send_email:!1},et=o.Ik({client_appointment_id:o.Yj().min(5,"Appointment is Required").max(75,"Appointment is Required"),type:o.k5(["confirmed_by_client","confirmed_by_organiser","cancelled_by_client","cancelled_by_organiser"]),organiser_name:o.Yj().min(3,"Organiser Name must be between 3 and 25 characters.").max(25,"Organiser Name must be between 3 and 25 characters."),organiser_email:o.Yj().email("Organiser Email must be a valid email address."),organiser_phone_number:o.Yj().refine(u,"Organiser Phone Number is not a valid phone number."),cancel_reason:o.Yj().optional().refine(e=>!e||e.length>=3&&e.length<=250,"Cancel Reason must be between 3 and 250 characters."),send_email:o.zM()}).refine(e=>!(e.type.startsWith("cancelled")&&""===e.cancel_reason),{message:"Cancel Reason is required",path:["cancel_reason"]}),ea={client_appointment_id:"",type:"confirmed_by_client",organiser_name:"",organiser_email:"",organiser_phone_number:"",cancel_reason:"",send_email:!1},en=o.Ik({subdomain:o.Yj().min(2,"Subdomain must be between 2 and 30 characters.").max(30,"Subdomain must be between 2 and 30 characters."),domain_name:o.Yj().min(2,"Domain Name must be between 2 and 30 characters.").max(30,"Domain Name must be between 2 and 30 characters."),root_domain:o.Yj().min(2,"Root Domain must be between 2 and 30 characters.").max(30,"Root Domain must be between 2 and 30 characters."),email_name:o.Yj().min(2,"Email Name must be between 2 and 30 characters.").max(30,"Email Name must be between 2 and 30 characters.")}),es={subdomain:"",domain_name:"",root_domain:"",email_name:""},ei=o.Ik({type:o.k5(["verify_email","resend_otp","verify_dns"]),otp_code:o.Yj().min(6,"OTP code must be a 6-digit number")}),er={type:"verify_email",otp_code:""},el=o.Ik({date:o.ai().gt(0,"Launch Date is required"),time:o.ai().gte(0,"Launch Time is required").lte(86400,"Launch Time is required")}),eo={date:0,time:-1},ed=o.Ik({plan_id:o.k5(["3_months","6_months","12_months"],{errorMap:()=>({message:"Plan Name must be one of 3_months, 6_months, or 12_months."})}),referral_code:o.Yj().optional().refine(e=>!e||e.length<=20,"Referral Code must be between 0 and 20 characters.")}),eu={plan_id:"6_months",referral_code:""},ec=o.Ik({full_name:o.Yj().min(3,"Full Name must be between 3 and 25 characters.").max(25,"Full Name must be between 3 and 25 characters."),email_address:o.Yj().email("Email Address is not a valid email address."),phone_number:o.Yj().refine(u,"Phone Number is not a valid phone number."),address_line_1:o.Yj().min(3,"Address Line 1 must be between 3 and 75 characters.").max(75,"Address Line 1 must be between 3 and 75 characters."),address_line_2:o.Yj().max(75,"Address Line 1 must be between 0 and 75 characters."),city:o.Yj().min(3,"City must be between 3 and 35 characters.").max(35,"City must be between 3 and 35 characters."),state:o.Yj().min(3,"State must be between 3 and 35 characters.").max(35,"State must be between 3 and 35 characters."),country:o.Yj().min(3,"Country must be between 3 and 35 characters.").max(35,"Country must be between 3 and 35 characters."),pincode:o.Yj().min(3,"Pincode must be between 3 and 10 characters.").max(10,"Pincode must be between 3 and 10 characters.")}),em={full_name:"",email_address:"",phone_number:"",address_line_1:"",address_line_2:"",city:"",state:"",country:"",pincode:""},eh=o.Ik({email:o.Yj().email("Email must be a valid email address."),admin:o.zM(),rw_all_apps:o.zM(),rw_billing:o.zM(),rw_user:o.zM(),r_all_apps:o.zM(),r_billing:o.zM(),r_user:o.zM()}),eb={email:"",admin:!1,rw_all_apps:!1,rw_billing:!1,rw_user:!1,r_all_apps:!1,r_billing:!1,r_user:!1},ep=o.Ik({enabled:o.zM(),admin:o.zM(),rw_all_apps:o.zM(),rw_billing:o.zM(),rw_user:o.zM(),r_all_apps:o.zM(),r_billing:o.zM(),r_user:o.zM()}),eg={enabled:!1,admin:!1,rw_all_apps:!1,rw_billing:!1,rw_user:!1,r_all_apps:!1,r_billing:!1,r_user:!1},ef=o.Ik({full_name:o.Yj().min(3,"Full Name must be between 3 and 75 characters.").max(75,"Full Name must be between 3 and 75 characters."),email_address:o.Yj().email("Email Address is not a valid email address."),phone_number:o.Yj().refine(u,"Phone Number is not a valid phone number."),address_line_1:o.Yj().min(3,"Address Line 1 must be between 3 and 75 characters.").max(75,"Address Line 1 must be between 3 and 75 characters."),address_line_2:o.Yj().max(75,"Address Line 1 must be between 0 and 75 characters."),address_city:o.Yj().min(3,"City must be between 3 and 35 characters.").max(35,"City must be between 3 and 35 characters."),address_state:o.Yj().min(3,"State must be between 3 and 35 characters.").max(35,"State must be between 3 and 35 characters."),address_country:o.Yj().min(3,"Country must be between 3 and 35 characters.").max(35,"Country must be between 3 and 35 characters."),address_pincode:o.Yj().min(3,"Pincode must be between 3 and 10 characters.").max(10,"Pincode must be between 3 and 10 characters."),pan:o.Yj().regex(/^[A-Z]{3}[PCFTGHLABJ][A-Z][0-9]{4}[A-Z]$/,{message:"PAN must be valid (e.g., ABCDE1234F)"}),name_as_per_pan:o.Yj().min(3,"Name as per PAN must be between 3 and 75 characters.").max(75,"Name as per PAN must be between 3 and 75 characters.").regex(/^[A-Za-z ]+$/,"Name as per PAN must be only letters and spaces"),date_of_birth:o.Yj().regex(/^\d{4}-\d{2}-\d{2}$/,{message:"Date of birth as per PAN is required."}).refine(e=>{let t=(0,n.H)(e),a=(0,s.R)(),o=(0,i.d)(a,18),d=(0,i.d)(a,70);return(0,r.Y)(t,o)&&(0,l.d)(t,d)},{message:"Age must be between 18 and 70 years."}),name_as_per_bank:o.Yj().min(3,"Name as per Bank Account must be between 3 and 75 characters.").max(75,"Name as per Bank Account must be between 3 and 75 characters.").regex(/^[A-Za-z ]+$/,"Name as per Bank Account must be only letters and spaces"),bank_account:o.Yj().regex(/^[0-9]{9,18}$/,"Bank Account Number must be between 9 and 18 digits."),ifsc:o.Yj().regex(/^[A-Z]{4}0[A-Z0-9]{6}$/,"IFSC Code must be like SBIN0123456"),upi_vpa:o.Yj().regex(/^[a-zA-Z0-9.-]{2,256}@[a-zA-Z]{2,64}$/,"UPI VPA must be valid (e.g., name@oksbi)"),questions:o.YO(o.Ik({question:o.Yj().min(3,"Question must be between 3 and 150 characters.").max(150,"Question must be between 3 and 150 characters."),required:o.zM(),answer:o.Yj().max(250,"Answer must be between 3 and 250 characters.")})).superRefine((e,t)=>{e.forEach((e,a)=>{e.required&&e.answer.length<3&&t.addIssue({path:[a,"answer"],code:"custom",message:"Answer must be at least 3 characters when required is true."})})}),terms_accepted:o.zM().refine(e=>!0===e,{message:"You must accept the Partner Program Terms & Conditions to submit kyc for review."})}),ew={full_name:"",email_address:"",phone_number:"",address_line_1:"",address_line_2:"",address_city:"",address_state:"",address_country:"",address_pincode:"",pan:"",name_as_per_pan:"",date_of_birth:"",name_as_per_bank:"",bank_account:"",ifsc:"",upi_vpa:"",questions:[],terms_accepted:!1},ex=o.Ik({referral_code:o.Yj().regex(/^[a-zA-Z0-9]{5,20}$/,{message:"Referral code must be 5-20 alphanumeric characters"})}),e_={referral_code:""}},1085:(e,t,a)=>{a.d(t,{BK:()=>o,eu:()=>l,q5:()=>d});var n=a(7876),s=a(4232),i=a(1497);let r=s.createContext(null),l=s.forwardRef((e,t)=>{let{className:a,...l}=e,[o,d]=s.useState("idle");return(0,n.jsx)(r.Provider,{value:{imageLoadingStatus:o,onImageLoadingStatusChange:d},children:(0,n.jsx)("div",{ref:t,className:(0,i.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden bg-muted rounded-full border-2 border-input shadow-sm custom-shadow-secondary",a),...l})})});l.displayName="Avatar";let o=s.forwardRef((e,t)=>{let{className:a,src:l,referrerPolicy:o,onLoadingStatusChange:d=()=>{},...u}=e,c=s.useContext(r);if(!c)throw Error("AvatarImage must be used within a Avatar");let{imageLoadingStatus:m,onImageLoadingStatusChange:h}=c;return(s.useEffect(()=>{let e=e=>{d(e),h(e)};if(!l)return void e("error");let t=!0,a=new window.Image,n=a=>()=>{t&&e(a)};return e("loading"),a.onload=n("loaded"),a.onerror=n("error"),a.src="string"==typeof l?l:URL.createObjectURL(l),o&&(a.referrerPolicy=o),()=>{t=!1}},[l,o]),"loaded"===m)?(0,n.jsx)("img",{ref:t,className:(0,i.cn)("aspect-square h-full w-full",a),src:l,...u}):null});o.displayName="AvatarImage";let d=s.forwardRef((e,t)=>{let{className:a,delayMs:l,...o}=e,d=s.useContext(r);if(!d)throw Error("AvatarImage must be used within a Avatar");let{imageLoadingStatus:u}=d,[c,m]=s.useState(void 0===l);return(s.useEffect(()=>{if(void 0!==l){let e=setTimeout(()=>m(!0),l);return()=>clearTimeout(e)}},[l]),c&&"loaded"!==u)?(0,n.jsx)("span",{ref:t,className:(0,i.cn)("w-full h-full flex items-center justify-center rounded-full text-secondary-foreground font-medium",a),...o}):null});d.displayName="AvatarFallback"},1161:(e,t,a)=>{a.d(t,{$:()=>M,F:()=>A});var n=a(7876),s=a(1085),i=a(9917),r=a(5734),l=a(4787),o=a(7385),d=a(7747),u=a(121),c=a(5657),m=a(1497),h=a(9065),b=a(6780),p=a(9099),g=a(4232),f=a(7388),w=a(9038),x=a(6332),_=a(3986),v=a(9761),y=a(1174);let j=e=>{let{className:t,id:a}=e,s=(0,p.useRouter)();return(0,n.jsxs)(i.$n,{type:"button",className:t,onClick:()=>{s.replace("".concat(h.BU,"?pid=").concat(h.US,"&redirect=/dashboard"))},"data-testid":"".concat(a,"-login-btn"),children:[(0,n.jsx)(_.w77,{}),"Login"]})},k=e=>{let{id:t}=e;return(0,n.jsxs)(i.vx,{type:"button",variant:"outline",className:"w-full",href:"/dashboard/create-business","data-testid":"".concat(t,"-create-business-btn"),children:[(0,n.jsx)(_.jgn,{}),"Create New Business"]})},S=e=>{var t,a,l,u,h;let{authSession:b}=e;return(0,n.jsxs)(r.lG,{id:"switch-business",children:[(0,n.jsxs)(r.Pn,{id:"open",variant:"default",className:"w-full justify-between gap-4",children:[(0,n.jsxs)(s.eu,{className:"w-6 h-6",children:[(0,n.jsx)(s.BK,{src:null==(t=b.recentlyUsedBusiness)?void 0:t.logo,alt:"logo"}),(0,n.jsx)(s.q5,{children:null==(a=b.recentlyUsedBusiness)?void 0:a.business_name[0]})]}),null==(l=b.recentlyUsedBusiness)?void 0:l.business_name,(0,n.jsx)(_.Cpb,{className:"size-6!"})]}),(0,n.jsxs)(r.Cf,{align:"right",className:"p-6 gap-6",children:[(0,n.jsxs)("div",{className:"flex items-center gap-4",children:[(0,n.jsx)(r.Pn,{id:"back",variant:"outline",size:"icon",children:(0,n.jsx)(_.VR3,{})}),(0,n.jsx)(c.o.p,{size:"xl",variant:"gradient",className:"mx-auto",children:"Switch Business"}),(0,n.jsx)(i.$n,{className:"invisible",variant:"outline",size:"icon",children:(0,n.jsx)(_.VR3,{})})]}),(0,n.jsx)(d.w,{}),(0,n.jsx)(i.vx,{type:"button",variant:"default",className:"w-full",href:"/dashboard","data-testid":"switch-business-nav-btn",children:"Go To Manage All Business"}),(0,n.jsxs)(o.F,{className:"px-1 space-y-5",children:[null==(u=b.allBusiness.data)?void 0:u.business.map((e,t)=>{var a,r;return(0,n.jsxs)(i.$n,{type:"button",variant:"outline",className:(0,m.cn)("w-full items-center justify-start gap-4",{"border-2 border-primary":e.business_id===(null==(a=b.recentlyUsedBusiness)?void 0:a.business_id)}),onClick:()=>b.setRecentlyUsedBusinessId(e.business_id),"data-testid":"switch-business-select-btn",children:[(0,n.jsxs)(s.eu,{className:"w-6 h-6",children:[(0,n.jsx)(s.BK,{src:e.logo,alt:"logo"}),(0,n.jsx)(s.q5,{children:e.business_name[0]})]}),e.business_name,e.business_id===(null==(r=b.recentlyUsedBusiness)?void 0:r.business_id)&&(0,n.jsx)(_.g9_,{className:"ml-auto text-primary size-5!"})]},t)}),(null==(h=b.allBusiness.data)?void 0:h.business.length)!==5&&(0,n.jsx)(k,{id:"switch-business"})]})]})]})},N=e=>{let{id:t,title:a,navHref:s,navButtonText:l,noResultsText:u,showFavButton:m=!0,authSession:h}=e,p=(0,b.Wv)({data:h.allApps,searchKey:"title"});return(0,n.jsxs)(r.lG,{id:t,onOpenChange:p.clear,children:[(0,n.jsxs)(r.Pn,{id:"open",variant:"outline",className:"w-full",children:[(0,n.jsx)(_.vV8,{}),a]}),(0,n.jsxs)(r.Cf,{align:"right",className:"p-6 gap-6",children:[(0,n.jsxs)("div",{className:"flex items-center gap-4",children:[(0,n.jsx)(r.Pn,{id:"back",variant:"outline",size:"icon",children:(0,n.jsx)(_.VR3,{})}),(0,n.jsx)(c.o.p,{size:"xl",variant:"gradient",className:"mx-auto",children:a}),(0,n.jsx)(i.$n,{className:"invisible",variant:"outline",size:"icon",children:(0,n.jsx)(_.VR3,{})})]}),(0,n.jsx)(d.w,{}),(0,n.jsx)(i.vx,{type:"button",variant:"default",href:s,"data-testid":"".concat(t,"-nav-btn"),children:l}),(0,n.jsx)(v.D,{name:"".concat(t,"-search"),searchQuery:p.searchQuery,onSearchQueryChange:p.onSearchQueryChange}),p.searchQuery&&0===p.results.length&&(0,n.jsx)("div",{"data-testid":"".concat(t,"-no-results"),children:(0,n.jsx)(c.o.p,{variant:"muted",className:"text-center",children:u})}),(0,n.jsx)(o.F,{className:"px-1 space-y-5",children:p.results.map((e,a)=>(0,n.jsxs)("div",{className:"relative","data-testid":"".concat(t,"-").concat(e.title),children:[(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full justify-start",href:"".concat(s,"/").concat(e.slug),"data-testid":"".concat(t,"-").concat(e.slug,"-btn"),children:[(0,n.jsx)(e.icon,{}),e.title]}),m&&(0,n.jsx)(i.$n,{type:"button",variant:"ghost",size:"icon",className:"absolute top-0.5 right-0.5 z-50",onClick:()=>h.onFavAppClick(e.slug),"data-testid":"".concat(t,"-").concat(e.slug,"-fav-btn"),children:e.isFavourite?(0,n.jsx)(_.wgd,{"data-testid":"".concat(t,"-").concat(e.slug,"-favourite-icon")}):(0,n.jsx)(_._pB,{"data-testid":"".concat(t,"-").concat(e.slug,"-not-favourite-icon")})})]},a))})]})]})},A=e=>{var t,a;let{authSession:s}=e,[m,b]=(0,g.useState)(!1);return(0,n.jsxs)("header",{className:"sticky top-0 z-40 flex h-16 items-center justify-between gap-4 px-4 md:px-6 border-b",children:[(0,n.jsx)("div",{className:"absolute -z-1 inset-0 bg-background/75 backdrop-blur-3xl"}),(0,n.jsx)(y.g,{}),(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)(u.Np,{}),(0,n.jsxs)(r.lG,{id:"app-menu",className:"top-16",onOpenChange:b,children:[(0,n.jsxs)(r.Pn,{id:"toggle",variant:"ghost",size:"icon",children:[m?(0,n.jsx)(_.m6K,{className:"size-6!"}):(0,n.jsx)(f.HEG,{}),(0,n.jsx)("span",{className:"sr-only",children:"Toggle app menu"})]}),(0,n.jsxs)(r.Cf,{align:"right",className:"w-full h-[calc(100%-64px)] top-16 p-6",children:["INVALID"===s.status&&(0,n.jsxs)("div",{className:"block md:hidden",children:[(0,n.jsx)(j,{id:"app-menu",className:"w-full"}),(0,n.jsx)(d.w,{className:"my-5"})]}),(0,n.jsxs)(o.F,{className:"px-1 space-y-5",children:["VALID"===s.status&&(0,n.jsxs)(n.Fragment,{children:[s.recentlyUsedBusiness?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(S,{authSession:s}),(0,n.jsx)(N,{id:"manage-apps",title:"Manage Apps",navHref:"/dashboard/manage-apps",navButtonText:"Go To Manage Apps",noResultsText:"No apps found",showFavButton:!0,authSession:s}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/dashboard/manage-users",children:[(0,n.jsx)(_.Itr,{}),"Manage Users"]}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/dashboard/manage-billing",children:[(0,n.jsx)(f.u6m,{}),"Manage Billing"]}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/dashboard/business-settings",children:[(0,n.jsx)(_.hgV,{}),"Business Settings"]})]}):(0,n.jsx)(k,{id:"app-menu"}),(0,n.jsx)(d.w,{})]}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/",children:[(0,n.jsx)(f.cVj,{}),"Home"]}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/help",children:[(0,n.jsx)(_.t2w,{}),"Help"]}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/help/tutorials",children:[(0,n.jsx)(w.$hd,{}),"Tutorials"]}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/pricing",children:[(0,n.jsx)(_.YHz,{}),"Pricing"]}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/affiliates",children:[(0,n.jsx)(x.DDN,{}),"Partner Program"]}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/contact-us",children:[(0,n.jsx)(_.HtZ,{}),"Contact Us"]})]})]})]}),"VALID"===s.status&&(0,n.jsxs)(l.rI,{id:"user-menu",children:[(0,n.jsxs)(l.F1,{className:"rounded-full",variant:"outline",size:"icon",children:[(0,n.jsx)(_.LTk,{}),(0,n.jsx)("span",{className:"sr-only",children:"Toggle user menu"})]}),(0,n.jsxs)(l.SQ,{className:"w-52",sideOffset:14,align:"end",children:[(0,n.jsxs)(l.lp,{children:[null==(t=s.allBusiness.data)?void 0:t.user.full_name,(0,n.jsx)(c.o.span,{variant:"muted",size:"xs",className:"block",children:null==(a=s.allBusiness.data)?void 0:a.user.email})]}),(0,n.jsx)(l.mB,{}),(0,n.jsxs)(l._2,{id:"profile",onSelect:()=>{s.router.replace("".concat(h.e8,"?pid=").concat(h.US,"&redirect=").concat(s.router.asPath))},children:[(0,n.jsx)(_.p5e,{}),"Profile"]}),(0,n.jsx)(l.mB,{}),(0,n.jsxs)(l._2,{id:"signout",onSelect:s.onSignOutClick,children:[(0,n.jsx)(_.EyH,{}),"Signout"]})]})]}),"INVALID"===s.status&&(0,n.jsx)(j,{id:"nav",className:"hidden md:inline-flex"})]})]})},M=e=>{var t,a,s;let{authSession:d}=e,[m,b]=(0,g.useState)(!1),w=(0,p.useRouter)(),v=null==(t=d.affiliates.data)?void 0:t.kyc_status;return(0,n.jsxs)("header",{className:"sticky top-0 z-40 flex h-16 items-center justify-between gap-4 px-4 md:px-6 border-b",children:[(0,n.jsx)("div",{className:"absolute -z-1 inset-0 bg-background/75 backdrop-blur-3xl"}),(0,n.jsx)(y.g,{}),(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)(u.Np,{}),(0,n.jsxs)(r.lG,{id:"affiliate-menu",className:"top-16",onOpenChange:b,children:[(0,n.jsxs)(r.Pn,{id:"toggle",variant:"ghost",size:"icon",children:[m?(0,n.jsx)(_.m6K,{className:"size-6!"}):(0,n.jsx)(f.HEG,{}),(0,n.jsx)("span",{className:"sr-only",children:"Toggle affiliate menu"})]}),(0,n.jsx)(r.Cf,{align:"right",className:"w-full h-[calc(100%-64px)] top-16 p-6",children:(0,n.jsxs)(o.F,{className:"px-1 space-y-5",children:[(0,n.jsx)(i.vx,{variant:"default",className:"w-full",href:"/affiliates/dashboard/kyc",children:"fully_approved"===v?"View KYC Info":"partially_approved"===v?"Check KYC Info":"rejected"===v?"Fix KYC Onboarding Now":"Complete KYC Onboarding Now"}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/affiliates/dashboard",children:[(0,n.jsx)(_.Uhn,{}),"Dashboard"]}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/affiliates/dashboard/referrals",children:[(0,n.jsx)(x.rC$,{}),"Referrals"]}),(0,n.jsxs)(i.vx,{variant:"outline",className:"w-full",href:"/affiliates/dashboard/earnings",children:[(0,n.jsx)(f.lHS,{}),"Earnings Payout"]})]})})]}),(0,n.jsxs)(l.rI,{id:"user-menu",children:[(0,n.jsxs)(l.F1,{className:"rounded-full",variant:"outline",size:"icon",children:[(0,n.jsx)(_.LTk,{}),(0,n.jsx)("span",{className:"sr-only",children:"Toggle user menu"})]}),(0,n.jsxs)(l.SQ,{className:"w-52",sideOffset:14,align:"end",children:[(0,n.jsxs)(l.lp,{children:[null==(a=d.affiliates.data)?void 0:a.user.full_name,(0,n.jsx)(c.o.span,{variant:"muted",size:"xs",className:"block",children:null==(s=d.affiliates.data)?void 0:s.user.email})]}),(0,n.jsx)(l.mB,{}),(0,n.jsxs)(l._2,{id:"profile",onSelect:()=>{w.replace("".concat(h.e8,"?pid=").concat(h.US,"&redirect=").concat(w.asPath))},children:[(0,n.jsx)(_.p5e,{}),"Profile"]}),(0,n.jsx)(l.mB,{}),(0,n.jsxs)(l._2,{id:"signout",onSelect:d.onSignOutClick,children:[(0,n.jsx)(_.EyH,{}),"Signout"]})]})]})]})]})}},1174:(e,t,a)=>{a.d(t,{g:()=>l});var n=a(7876),s=a(1497),i=a(8230),r=a.n(i);let l=e=>{let{className:t}=e;return(0,n.jsxs)(r(),{href:"/",className:(0,s.cn)("text-xl font-bold",t),children:[(0,n.jsx)("span",{className:"custom-text-gradient-black",children:"Solo"}),(0,n.jsx)("span",{className:"bg-clip-text text-transparent bg-linear-to-r from-pink-600 to-primary dark:from-orange-400 dark:to-fuchsia-500",children:"doer"})]})}},5734:(e,t,a)=>{a.d(t,{CU:()=>g,Cf:()=>c,Es:()=>h,L3:()=>b,Pn:()=>u,c7:()=>m,lG:()=>d,rr:()=>p});var n=a(7876),s=a(4232),i=a(3986),r=a(9917),l=a(1497);let o=s.createContext(null),d=e=>{let{className:t,children:a,id:i,open:r,onOpenChange:d,defaultOpen:u=!1,closeOnOutsideClick:c=!0,closeOnEsc:m=!0}=e,h=s.useRef(null),[b,p]=s.useState(u),g=void 0!==r,f=g?r:b,w=e=>{g||p(e),null==d||d(e)},x=e=>{c&&h.current&&!h.current.contains(e.target)&&w(!1)},_=e=>{"Escape"===e.key&&m&&w(!1)};return s.useEffect(()=>(f?(document.addEventListener("mousedown",x),document.addEventListener("keydown",_)):(document.removeEventListener("mousedown",x),document.removeEventListener("keydown",_)),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",_)}),[f]),s.useEffect(()=>{let e=document.body;if(f){let t=window.innerWidth-e.clientWidth,a=getComputedStyle(document.body).getPropertyValue("--body-scroll-bar-size"),n=t>0?t:a;n&&(e.style.overflow="hidden",e.style.paddingRight="".concat(n,"px"),e.style.setProperty("--body-scroll-bar-size","".concat(n)))}else e.style.overflow="",e.style.paddingRight="";return()=>{e.style.overflow="",e.style.paddingRight=""}},[f]),(0,n.jsx)(o.Provider,{value:{id:i,internalOpen:f,setInternalOpen:w},children:(0,n.jsxs)("div",{role:"dialog",id:i,children:[(0,n.jsx)("div",{className:(0,l.cn)("fixed inset-0 z-50 bg-primary/5 backdrop-blur-xs transition-all duration-200 fill-mode-forwards",{"visible animate-in fade-in-0":f,"invisible animate-out fade-out-0":!f},t)}),(0,n.jsx)("div",{ref:h,children:a})]})})};d.displayName="Dialog";let u=e=>{let{onClick:t,...a}=e,i=s.useContext(o);if(!i)throw Error("DialogButton must be used within a Dialog");let{id:l,internalOpen:d,setInternalOpen:u}=i;return(0,n.jsx)(r.$n,{type:"button","aria-haspopup":"dialog","aria-expanded":d,onClick:e=>{null==t||t(e),u(!d)},"data-testid":a.id?"".concat(l,"-dialog-").concat(a.id,"-btn"):void 0,...a})};u.displayName="DialogButton";let c=s.forwardRef((e,t)=>{let{className:a,children:i,align:r="center",...d}=e,u=s.useContext(o);if(!u)throw Error("DialogContent must be used within a Dialog");let{id:c,internalOpen:m}=u;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("fixed z-50 flex flex-col transition-all fill-mode-forwards","bg-card/70 backdrop-blur-2xl text-card-foreground border-border shadow-xl custom-shadow-outline",{"visible animate-in duration-200":m,"invisible animate-out duration-100":!m,"left-1/2 top-1/2 translate-x-[-50%] translate-y-[-50%] w-full max-w-sm border-2 rounded-lg max-h-[calc(100vh-96px)]":"center"===r,"fade-in-0 zoom-in-90":m&&"center"===r,"fade-out-0 zoom-out-90":!m&&"center"===r,"inset-y-0 right-0 w-full max-w-sm h-full border-l-2":"right"===r,"slide-in-from-right":m&&"right"===r,"slide-out-to-right":!m&&"right"===r,"inset-y-0 left-0 w-full max-w-sm h-full border-r-2":"left"===r,"slide-in-from-left":m&&"left"===r,"slide-out-to-left":!m&&"left"===r,"inset-x-0 top-0 w-full h-4/5 sm:h-1/2 border-b-2 rounded-b-2xl":"top"===r,"slide-in-from-top":m&&"top"===r,"slide-out-to-top":!m&&"top"===r,"inset-x-0 bottom-0 w-full h-4/5 sm:h-1/2 border-t-2 rounded-t-2xl":"bottom"===r,"slide-in-from-bottom":m&&"bottom"===r,"slide-out-to-bottom":!m&&"bottom"===r},a),"data-testid":"".concat(c,"-dialog-content"),"data-state":m?"open":"closed",...d,children:i})});c.displayName="DialogContent";let m=e=>{let{className:t,children:a,showCloseButton:s=!0,...r}=e;return(0,n.jsxs)("div",{className:"p-6 flex items-center justify-between gap-3",children:[(0,n.jsx)("div",{className:(0,l.cn)("flex flex-col gap-1.5",t),...r,children:a}),s&&(0,n.jsxs)(u,{variant:"outline",size:"icon",id:"header-close",className:"shrink-0",children:[(0,n.jsx)(i.m6K,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})};m.displayName="DialogHeader";let h=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,l.cn)("p-6 flex flex-col-reverse sm:flex-row sm:justify-end gap-5 [&>button]:w-full",t),...a})};h.displayName="DialogFooter";let b=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("h2",{ref:t,className:(0,l.cn)("text-lg sm:text-xl font-medium leading-none",a),...s})});b.displayName="DialogTitle";let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("p",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",a),...s})});p.displayName="DialogDescription";let g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("my-px h-[1.5px] bg-border",a),...s})});g.displayName="DialogSeparator"},6780:(e,t,a)=>{a.d(t,{Bz:()=>C,GT:()=>f,Lb:()=>M,Q8:()=>g,WQ:()=>k,WR:()=>A,Wv:()=>x,X:()=>_,_:()=>R,ee:()=>S,iD:()=>y,rK:()=>v,t4:()=>E,yB:()=>N,z6:()=>j});var n=a(8508),s=a(9099),i=a(4232),r=a(8992),l=a(9688),o=a(5656),d=a(6840),u=a(1016),c=a(4333),m=a(7141),h=a(9065),b=a(275),p=a(7025);let g=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],[t,a]=(0,i.useState)("VALIDATING"),[n,r]=(0,i.useState)(void 0),[u,b]=(0,i.useState)(h.Xp.sort(p.LP)),g=(0,s.useRouter)(),f=w(h.Jz,void 0),x=(t,n,s)=>{(null==t?void 0:t.status)===401&&((null==t?void 0:t.detail)==="Invalid Business Id"||(null==t?void 0:t.detail)==="Business-Id header missing")?(_.mutate(),g.push("/dashboard"),l.oR.error("Invalid Business Id, Please Select Business from Business Dashboard")):(null==t?void 0:t.status)===401?(a("INVALID"),e&&g.replace("".concat(h.BU,"?pid=").concat(h.US,"&redirect=").concat(g.asPath))):l.oR.error(null==t?void 0:t.detail)},_=(0,o.Ay)(h.Bp,m.cz,{errorRetryCount:0,revalidateIfStale:!0,revalidateOnReconnect:!0});(0,i.useEffect)(()=>{_.data?a("VALID"):_.error?(a("INVALID"),e&&401===_.error.status&&g.replace("".concat(h.BU,"?pid=").concat(h.US,"&redirect=").concat(g.asPath))):a("VALIDATING")},[_.data,_.error]);let v=(0,c.A)(h.Lk,m.DT),y=async e=>{let t=_.data;if(n&&t){let a=t.business.map(e=>({...e})),s=t.business.findIndex(e=>e.business_id===n.business_id);v.trigger({favourite_app:e},{onSuccess:(e,n,i)=>{e&&(a[s].favourite_apps=e,_.mutate({...t,business:a},{revalidate:!1}))},onError:x}).catch(()=>{})}},j=(0,c.A)(h.ME,m.kL),{cache:k,mutate:S}=(0,d.iX)(),[N,A]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=_.data;if(f.firstLoadDone&&e&&e.business.length>0){e.business.sort((e,t)=>t.created_at-e.created_at);let t=e.business.find(e=>e.business_id===f.value);void 0===t?(t=e.business[0],f.setValue(t.business_id)):(N&&Array.from(k.keys()).forEach(e=>{e!==h.Bp&&S(e)}),A(!0)),r(t);let a=h.Xp.map(e=>(null==t?void 0:t.favourite_apps.includes(e.slug))?{...e,isFavourite:!0}:e);a.sort(p.LP),b(a)}else r(void 0)},[f.firstLoadDone,f.value,_.data]),{status:t,router:g,allApps:u,allBusiness:_,recentlyUsedBusiness:n,setRecentlyUsedBusinessId:e=>{f.setValue(e)},onFavAppClick:y,onSignOutClick:()=>{j.trigger({},{onSuccess:(e,t,n)=>{l.oR.success(e),a("INVALID"),g.push("/")},onError:x}).catch(()=>{})},onSwrError:(t,n,s)=>{(null==t?void 0:t.status)===401&&((null==t?void 0:t.detail)==="Invalid Business Id"||(null==t?void 0:t.detail)==="Business-Id header missing")?(_.mutate(),g.push("/dashboard"),l.oR.error("Invalid Business Id, Please Select Business from Business Dashboard")):(null==t?void 0:t.status)===401?(a("INVALID"),e&&g.replace("".concat(h.BU,"?pid=").concat(h.US,"&redirect=").concat(g.asPath))):l.oR.error(null==t?void 0:t.detail)},onSwrMutationError:x}},f=()=>{let[e,t]=(0,i.useState)("VALIDATING"),a=(0,s.useRouter)(),n=(e,n,s)=>{(null==e?void 0:e.status)===401?(t("INVALID"),a.replace("".concat(h.BU,"?pid=").concat(h.US,"&redirect=").concat(a.asPath))):l.oR.error(null==e?void 0:e.detail)},r=(e,n,s)=>{(null==e?void 0:e.status)===401?(t("INVALID"),a.replace("".concat(h.BU,"?pid=").concat(h.US,"&redirect=").concat(a.asPath))):l.oR.error(null==e?void 0:e.detail)},d=(0,o.Ay)(h.p8,m.cz,{revalidateIfStale:!0,revalidateOnReconnect:!0,onSuccess:(e,a,n)=>{t("VALID")},onError:n}),u=(0,c.A)(h.ME,m.kL);return{status:e,router:a,affiliates:d,onSignOutClick:()=>{u.trigger({},{onSuccess:(e,n,s)=>{l.oR.success(e),t("INVALID"),a.push("/")},onError:r}).catch(()=>{})},onSwrError:n,onSwrMutationError:r}},w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,[a,n]=(0,i.useState)(t),[s,r]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{n((0,p._S)(e,t)),r(!0)},[t,e]),(0,i.useEffect)(()=>{s&&(0,p.AP)(e,a)},[a,s,e]),(0,i.useEffect)(()=>{let a=a=>{try{a.key===e&&n(a.newValue?JSON.parse(a.newValue):t)}catch(e){return}};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}},[e,t]),{value:a,setValue:n,firstLoadDone:s}},x=e=>{let{data:t,searchKey:a,appName:n,initialFilterList:s=[],initialFilterItem:r={id:"all",key:"",name:"All",type:"equal"}}=e,[l,d]=(0,i.useState)(""),[u,c]=(0,i.useState)(t),[b,p]=(0,i.useState)(r),g=(0,o.Ay)(n?"".concat(h.TS,"?app_name=").concat(n):null,m.cz);return(0,i.useEffect)(()=>{l?a&&c(t.filter(e=>e[a].toLowerCase().startsWith(l.toLowerCase()))):b.id!==r.id?"starts_with"==b.type?c(t.filter(e=>e[b.key].startsWith(b.id))):c(t.filter(e=>e[b.key]===b.id)):c(t)},[t,l,b]),{searchQuery:l,filterItem:b,results:u,filterList:g.data?[r,...s,...g.data]:[r,...s],isInitLoading:0===u.length&&!l&&"all"===b.id,onSearchQueryChange:e=>{d(e.target.value),p(r)},onFilterByClick:e=>{d(""),p(e)},clear:()=>{d(""),c(t),p(r)}}},_=e=>{let[t,a]=(0,i.useState)(void 0);return(0,i.useEffect)(()=>{if(e instanceof File){let t=new FileReader;t.onloadend=()=>{a(t.result)},t.readAsDataURL(e)}else"string"==typeof e?a(e):a(void 0)},[e]),{url:t}},v=e=>{let[t,a]=(0,i.useState)(64),[s,o]=(0,i.useState)(64),[d,p]=(0,i.useState)(!1),[g,f]=(0,i.useState)("PNG, JPG or JPEG Image Files"),[w,x]=(0,i.useState)(".png, .jpeg, .jpg"),[_,v]=(0,i.useState)("DROPZONE"),[y,j]=(0,i.useState)(void 0),[k,S]=(0,i.useState)(void 0),[N,A]=(0,i.useState)({x:0,y:0,width:t,height:s}),[M,C]=(0,i.useState)([]),[E,R]=(0,i.useState)(-1),[Y,I]=(0,i.useState)("1:1"),[P,L]=(0,i.useState)(),[D,T]=(0,i.useState)(),z=(0,i.useRef)(null),O=(0,r.mN)({resolver:(0,n.u)(b.tZ),defaultValues:b.hv}),[B,F]=(0,i.useState)(!1),[V,q]=(0,i.useState)("asset-manager"),[U,W]=(0,i.useState)("public"),[Q,G]=(0,i.useState)(""),Z=(0,u.Ay)((e,t)=>(0,m.Dy)(e,t,U,Q),m.cz,{initialSize:1,revalidateFirstPage:!0,onError:e.onSwrError}),H=(0,c.A)(h.nF,(e,t)=>(0,m.X6)(e,t,ea),{onSuccess:(e,t,a)=>{l.oR.success("File Uploaded Successfully"),B||Z.mutate(),ed(e)},onError:e.onSwrMutationError}),$=(0,i.useMemo)(()=>{let e=Z.data;return e?e.flatMap(e=>e.items):[]},[Z.data]),X=(0,i.useMemo)(()=>0===$.length||void 0!==Z.error,[$.length,Z.error]),K=(0,i.useMemo)(()=>{let e=Z.data;if(!e)return!1;{let t=e[e.length-1];return 0===t.items.length||null===t.last_evaluated_key}},[Z.data]),J=(0,i.useCallback)(()=>{Z.isValidating||K||Z.setSize(Z.size+1)},[Z.isValidating,K,Z.size]),ee=e=>{p(e),setTimeout(()=>et(),250)},et=()=>{p(!1),f(""),x(""),v("DROPZONE"),j(void 0),S(void 0),A({x:0,y:0,width:t,height:s}),C([]),R(-1),I("1:1"),O.reset(b.hv),B&&(F(!1),q("asset-manager"),W("public"),G(""))};(0,i.useEffect)(()=>{let e=z.current;if(!e)return;let t=()=>{let t=es(),a=e.width,n=Math.round(a/t);(a>e.width||n>e.height)&&(a=Math.round((n=e.height)*t)),A({x:0,y:0,width:a,height:n})},a=new ResizeObserver(()=>{t()});return e.complete?t():e.addEventListener("load",t),a.observe(e),()=>{e.removeEventListener("load",t),a.disconnect()}},[k,Y]);let ea=e=>{L(e)},en=e=>{if(e){let t=e[0];if(t.type.startsWith("image")){j(t);let e=new FileReader;e.onloadend=()=>{S(e.result),er(e.result),v("IMAGE_EDITOR")},e.readAsDataURL(t)}}},es=()=>{if("16:9"===Y)return 16/9;if("9:16"===Y)return 9/16;if("4:3"===Y)return 4/3;if("3:4"===Y)return 3/4;if("5:4"===Y)return 5/4;else if("4:5"===Y)return .8;else if("3:2"===Y)return 1.5;else if("2:3"===Y)return 2/3;else if("2:1"===Y)return 2;else if("1:2"===Y)return .5;else return 1},ei=e=>{let t=0,a=0;return"clientX"in e?(t=e.clientX,a=e.clientY):e.touches&&e.touches.length>0&&(t=e.touches[0].clientX,a=e.touches[0].clientY),{clientX:t,clientY:a}},er=e=>{let t=M.slice(0,E+1);t.push(e),C(t),R(t.length-1)},el=e=>{S(M[e]),R(e)},eo=()=>{v("DROPZONE"),j(void 0),S(void 0),A({x:0,y:0,width:t,height:s}),C([]),R(-1),I("1:1"),B||O.reset(b.hv)},ed=e=>{D&&D(e),ee(!1)},eu=e=>{if(0===e||void 0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B","kB","MB"][t]};return{open:d,mediaTab:V,visibility:U,folderSlug:Q,isLoading:Z.isLoading,isValidating:Z.isValidating,isEmpty:X,isNoMore:K,assetFiles:$,onMediaTabValueChange:e=>{q(e),eo()},onVisibilityValueChange:e=>{W(e)},setFolderSlug:G,onOpenBtnClick:e=>{if(f((null==e?void 0:e.dzDescription)||"PNG, JPG or JPEG Image Files"),x((null==e?void 0:e.dzInputFileAccept)||".png, .jpeg, .jpg"),O.reset({visibility:(null==e?void 0:e.visibility)||"public",folder:(null==e?void 0:e.folder)||""}),F((null==e?void 0:e.isMedia)||!1),null==e?void 0:e.isMedia)if((null==e?void 0:e.visibility)!==void 0&&(null==e?void 0:e.folder)!==void 0&&(null==e?void 0:e.callback)!==void 0)W(e.visibility),G(e.folder),T(()=>e.callback);else throw Error("All visibility, folder, and callback options needed to be passed for onOpenBtnClick({isMedia = true})");p(!0)},onOpenChange:ee,onLoadMoreClick:J,refreshAssetFiles:()=>{Z.mutate()},getVisibilityTitle:()=>"public"===U?"Public Folder":"Private Folder",getFolderTitle:()=>{let e=[...h.yT,...h.Y8].find(e=>e.slug===Q);return e?e.title:void 0},onMediaSelectClick:ed,fileUpload:{isTab:e=>"DROPZONE"===e?"DROPZONE"===_:"IMAGE_EDITOR"===e?"IMAGE_EDITOR"===_&&void 0!==k:"REVIEW_UPLOAD"===e?"REVIEW_UPLOAD"===_&&void 0!==k&&void 0!==y:void 0,isMedia:B,dropzone:{id:"upload-file",description:g,inputFileAccept:w,onDrop:e=>{e.preventDefault(),en(e.dataTransfer.files)},onDragOver:e=>{e.preventDefault()},onInputChange:e=>{en(e.target.files)}},imageEditor:{ref:z,src:k,getCropStyle:()=>({width:"".concat(N.width,"px"),height:"".concat(N.height,"px"),top:N.y,left:N.x}),onCropAreaMouseDown:(e,a)=>{let{clientX:n,clientY:i}=ei(e),r=e=>{let r=z.current;if(null===r)return;let{clientX:l,clientY:o}=ei(e),d=l-n,u=o-i,c=es(),m={...N};"top"===a?m={...m,x:N.x+u/2,y:N.y+u/c,width:N.width-u}:"bottom"===a?m={...m,x:N.x-u/2,width:N.width+u}:"left"===a?m={...m,x:N.x+d,y:N.y+d/2/c,width:N.width-d}:"right"===a?m={...m,y:N.y-d/2/c,width:N.width+d}:"top-left"===a?m={...m,x:N.x+u,y:N.y+u/c,width:N.width-u}:"top-right"===a?m={...m,y:N.y+u/c,width:N.width-u}:"bottom-left"===a?m={...m,x:N.x+d,width:N.width-d}:"bottom-right"===a?m={...m,width:N.width+d}:"move"===a&&(m={...m,x:N.x+d,y:N.y+u}),m.width=m.width,m.height=m.width/c,m.x<0?m.x=0:m.x+m.width>r.width&&(m.x=r.width-m.width),m.y<0?m.y=0:m.y+m.height>r.height&&(m.y=r.height-m.height),m.width>=t&&m.height>=s&&m.width<=r.width&&m.height<=r.height&&A(m)},l=()=>{window.removeEventListener("mousemove",r),window.removeEventListener("touchmove",r),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l)};window.addEventListener("mousemove",r),window.addEventListener("touchmove",r),window.addEventListener("mouseup",l),window.addEventListener("touchend",l)},onRotateImageClick:e=>{let t=z.current;if(null===t)return;let a=document.createElement("canvas"),n=a.getContext("2d");a.width=t.naturalHeight,a.height=t.naturalWidth,null==n||n.translate(a.width/2,a.height/2),"anti-clockwise"===e?null==n||n.rotate(-Math.PI/2):null==n||n.rotate(Math.PI/2),null==n||n.drawImage(t,-t.naturalWidth/2,-t.naturalHeight/2);let s=a.toDataURL("image/png");S(s),er(s)},onFlipImageClick:e=>{let t=z.current;if(null===t)return;let a=document.createElement("canvas"),n=a.getContext("2d");a.width=t.naturalWidth,a.height=t.naturalHeight,"horizontal"===e?(null==n||n.translate(t.naturalWidth,0),null==n||n.scale(-1,1)):"vertical"===e&&(null==n||n.translate(0,t.naturalHeight),null==n||n.scale(1,-1)),null==n||n.drawImage(t,0,0);let s=a.toDataURL("image/png");S(s),er(s)},onSaveCropClick:()=>{let e=z.current;if(null===e)return;let t=document.createElement("canvas"),a=e.naturalWidth/e.width,n=e.naturalHeight/e.height,s=N.width*a,i=N.height*n;t.width=s,t.height=i;let r=t.getContext("2d");null==r||r.drawImage(e,N.x*a,N.y*n,N.width*a,N.height*n,0,0,s,i);let l=t.toDataURL("image/png");S(l),er(l)},onUndoClick:()=>{E>0&&el(E-1)},onRedoClick:()=>{E{let e=z.current;if(null===e||void 0===y)return;let t=document.createElement("canvas"),a=t.getContext("2d");t.width=e.naturalWidth,t.height=e.naturalHeight,null==a||a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight),t.toBlob(e=>{e&&(j(new File([e],"".concat(null==y?void 0:y.name.split(".")[0],".png"),{type:"image/png"})),v("REVIEW_UPLOAD"))},"image/png")},aspectRatio:{value:Y,onValueChange:e=>{I(e)}}},reviewUpload:{imageSrc:k,isUploading:H.isMutating,form:O,onBackClick:eo,onUploadClick:()=>{y&&H.trigger({file:y,visibility:O.getValues("visibility"),folder:O.getValues("folder")}).catch(()=>{})},isFile:e=>null==y?void 0:y.type.startsWith(e),getFileName:()=>null==y?void 0:y.name,getFileSize:()=>H.isMutating?"".concat(eu(null==P?void 0:P.loaded)," / ").concat(eu(null==P?void 0:P.total)," (").concat(eu(null==P?void 0:P.rate),"/s)"):eu(null==y?void 0:y.size),getUploadingProgress:()=>{if(H.isMutating){let e=null==P?void 0:P.progress;if(void 0===e)return"0 %";let t=Math.round(100*e);return"".concat(t," %")}},getSelectItems:()=>"public"===O.getValues("visibility")?h.yT:h.Y8}}}},y=()=>{let[e,t]=(0,i.useState)(!1);return{status:e,onClick:e=>{"undefined"!=typeof navigator&&navigator.clipboard?navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),2500)}):console.warn("Clipboard API not supported")}}},j=e=>{let{mainForm:t,name:a,fieldArrayForm:n,fieldArrayDefault:s}=e,[l,o]=(0,i.useState)({open:!1,index:0}),d=(0,r.jz)({control:t.control,name:a});return{dialog:l,fieldArrayForm:n,onDialogOpenChange:e=>{o(t=>({...t,open:e}))},onFormSubmit:e=>{d.update(l.index,e),o({open:!1,index:0})},onAddClick:()=>{n.reset(s),o({open:!0,index:d.fields.length})},onEditClick:e=>{n.reset(d.fields[e]),o({open:!0,index:e})},onDeleteClick:e=>{d.remove(e)}}},k=e=>{let{url:t,authSession:a}=e,n=(0,u.Ay)((e,a)=>(0,m.WO)(e,a,t),m.cz,{initialSize:1,revalidateFirstPage:!0,onError:a.onSwrError}),s=(0,i.useMemo)(()=>{let e=n.data;return e?e.flatMap(e=>e.items):[]},[n.data]),r=(0,i.useMemo)(()=>0===s.length||void 0!==n.error,[s.length,n.error]),l=(0,i.useMemo)(()=>{let e=n.data;if(!e)return!1;{let t=e[e.length-1];return 0===t.items.length||null===t.last_evaluated_key}},[n.data]),o=(0,i.useCallback)(()=>{n.isValidating||l||n.setSize(n.size+1)},[n.isValidating,l,n.size]);return{data:s,isLoading:n.isLoading,isValidating:n.isValidating,isEmpty:r,isNoMore:l,onLoadMoreClick:o,onRefreshClick:()=>{n.mutate()}}},S=e=>{let{url:t,id_key:a,authSession:n}=e,[r,o]=(0,i.useState)({open:!1,index:0}),d=(0,s.useRouter)(),u=k({url:t,authSession:n}),h=(0,c.A)(t,m.x8,{onSuccess:(e,t,a)=>{l.oR.success(e),u.onRefreshClick()},onError:n.onSwrMutationError});return{...u,onEditClick:e=>{d.push({pathname:"".concat(d.pathname,"/manage"),query:{[a]:e}})},onDeleteClick:e=>{let t=u.data.findIndex(t=>t[a]===e);-1!==t&&o({open:!0,index:t})},deleteDialogProps:{open:r.open,onOpenChange:e=>{o(t=>({...t,open:e}))},data:u.data[r.index],onClick:()=>{h.trigger({[a]:u.data[r.index][a]}).catch(()=>{})}}}},N=e=>{let{url:t,resolver:a,defaultValues:n,id_key:d,authSession:u}=e,[h,b]=(0,i.useState)({}),p=(0,s.useRouter)(),g=(0,i.useMemo)(()=>{if(!p.isReady)return;let e=p.query[d];return Array.isArray(e)?e[0]:e},[p.isReady,p.query]),f=(0,o.Ay)(g?"".concat(t,"?").concat(d,"=").concat(g):null,m.cz,{onSuccess:(e,t,a)=>{Object.keys(e).length<1&&p.push(p.pathname.replace(RegExp("/manage$"),""))},onError:u.onSwrError}),w=(0,c.A)(t,m.kL,{onSuccess:(e,t,a)=>{l.oR.success(e),p.push(p.pathname.replace(RegExp("/manage$"),""))},onError:u.onSwrMutationError}),x=(0,c.A)(t,m.DT,{onSuccess:(e,t,a)=>{l.oR.success(e),p.push(p.pathname.replace(RegExp("/manage$"),""))},onError:u.onSwrMutationError});(0,i.useEffect)(()=>{f.data&&f.data.form&&f.data.display_names&&(_.reset(f.data.form),b(f.data.display_names))},[f.data]);let _=(0,r.mN)({resolver:a,defaultValues:n});return{form:_,displayNames:h,id:g,isLoading:f.isLoading,isEmpty:void 0!==f.error||f.data&&Object.keys(f.data).length<1,onFormSubmit:e=>{g?x.trigger({...e,[d]:g}).catch(()=>{}):w.trigger(e).catch(()=>{})},refreshFormData:()=>!!g&&(f.mutate(),!0)}},A=e=>{let{url:t,resolver:a,defaultValues:n,id_key:s,mainForm:o,mainFormFieldName:d,refreshMainFormData:h,initialDisplayNames:b,app_slug:g,authSession:f,isMultiple:w=!1}=e,[x,_]=(0,i.useState)(!1),[v,y]=(0,i.useState)(!1),[j,k]=(0,i.useState)("show"),[S,N]=(0,i.useState)(),[A,M]=(0,i.useState)(w?[]:"");(0,i.useEffect)(()=>{b[d]&&M(b[d])},[b]);let C=(0,u.Ay)((e,a)=>v?(0,m.WO)(e,a,t):null,m.cz,{initialSize:1,revalidateFirstPage:!1,onError:f.onSwrError}),E=(0,c.A)(t,m.kL,{onSuccess:(e,t,a)=>{l.oR.success(e),C.mutate(),z("show")},onError:f.onSwrMutationError}),R=(0,c.A)(t,m.DT,{onSuccess:(e,t,a)=>{l.oR.success(e),C.mutate(),h()||B(S?S[s]:""),z("show")},onError:f.onSwrMutationError}),Y=(0,c.A)(t,m.x8,{onError:f.onSwrMutationError}),I=(0,i.useMemo)(()=>{let e=C.data;return e?e.flatMap(e=>e.items):[]},[C.data]),P=(0,i.useMemo)(()=>0===I.length||void 0!==C.error,[I.length,C.error]),L=(0,i.useMemo)(()=>{let e=C.data;if(!e)return!1;{let t=e[e.length-1];return 0===t.items.length||null===t.last_evaluated_key}},[C.data]),D=(0,i.useCallback)(()=>{C.isValidating||L||C.setSize(C.size+1)},[C.isValidating,L,C.size]),T=e=>{_(e),k("show"),N(void 0),O.reset(n),e?y(!0):setTimeout(()=>y(!1),500)},z=e=>{k(e),N(void 0),O.reset(n)},O=(0,r.mN)({resolver:a,defaultValues:n}),B=e=>{if(w){let t=(o.getValues(d)||[]).indexOf(e);-1!==t&&F(t)}else(o.getValues(d)||"")===e&&F()},F=e=>{if(w)if(void 0!==e){let t=o.getValues(d)||[];t.splice(e,1),o.setValue(d,t);let a=[...A];a.splice(e,1),M(a)}else throw Error("index is required when isMultiple is true");else M(""),o.setValue(d,"")};return{open:x,tab:j,onOpenChange:T,onTabValueChange:z,onOpenBtnClick:()=>{T(!0)},onDeleteClick:F,show:{data:I,isLoading:C.isLoading,isValidating:C.isValidating,isEmpty:P,isNoMore:L,onLoadMoreClick:D,onRefreshClick:()=>{C.mutate(),h()||(w?(o.setValue(d,[]),M([])):(o.setValue(d,""),M("")))},onSelectClick:e=>{if(w){let t=o.getValues(d)||[];o.setValue(d,[...t,e.id]),M(t=>[...t,e.name])}else o.setValue(d,e.id),M(e.name);T(!1)},onAddClick:()=>{g&&window.open("/dashboard/manage-apps/".concat(g,"/manage/"),"_blank","noopener,noreferrer")},onEditClick:e=>{if(g)window.open("/dashboard/manage-apps/".concat(g,"/manage/?").concat(s,"=").concat(e[s]),"_blank","noopener,noreferrer");else{let t=(0,p.Bd)(e,["business_id",s,"created_at","modified_at"]);O.reset(t),N(e),k("manage")}},onDeleteClick:e=>{g?window.open("/dashboard/manage-apps/".concat(g,"/"),"_blank","noopener,noreferrer"):Y.trigger({[s]:e},{onSuccess:(t,a,n)=>{l.oR.success(t),C.mutate(),B(e)}}).catch(()=>{})}},manage:{isEdit:void 0!==S,getDisplayName:e=>{if(!w)return A;if(void 0!==e)return A&&0!==A.length?A[e]:"";throw Error("index is required when isMultiple is true")},form:O,onFormSubmit:e=>{S?R.trigger({...e,[s]:S[s]}).catch(()=>{}):E.trigger(e).catch(()=>{})}}}},M=e=>{let t=(0,s.useRouter)(),[a,o]=(0,i.useState)(!1),d=(0,r.mN)({resolver:(0,n.u)(b.Lu),defaultValues:b.XI}),u=(0,c.A)(h.Z5,m.DT,{onError:e.onSwrMutationError});return{otpDialogOpen:a,setOtpDialogOpen:o,form:d,onFormSubmit:e=>{u.trigger({type:"verify_email",otp_code:e.otp_code},{onSuccess:(e,a,n)=>{o(!1),l.oR.success(e),t.push("/dashboard/manage-apps/domain")}}).catch(()=>{})},onResendClick:()=>{u.trigger({type:"resend_otp",otp_code:""},{onSuccess:(e,t,a)=>{l.oR.success(e)}}).catch(()=>{})},onVerifyDnsClick:()=>{u.trigger({type:"verify_dns"},{onSuccess:(e,t,a)=>{l.oR.success(e)}}).catch(()=>{})}}},C=()=>{let[e,t]=(0,i.useState)(!1),[a,n]=(0,i.useState)(),[s,r]=(0,i.useState)(1),[l,o]=(0,i.useState)({x:0,y:0}),[d,u]=(0,i.useState)(!1);return(0,i.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),{show:e,imageSrc:a,isGrabbing:d,zoom:s,position:l,handleWheel:e=>{e.preventDefault(),r(Math.min(1.5,Math.max(1,s+-.001*e.deltaY)))},handleMouseDown:e=>{e.preventDefault(),u(!0);let t=e.clientX-l.x,a=e.clientY-l.y,n=e=>{e.preventDefault();let n=e.clientX-t,i=e.clientY-a,r=window.screen.width/5,l=window.screen.height/5;-r{u(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",s)};window.addEventListener("mousemove",n),window.addEventListener("mouseup",s)},handleZoomIn:()=>{s<1.5&&r(s+.1)},handleZoomOut:()=>{s>1&&r(s-.1)},onOpenClick:e=>{e&&(r(1),o({x:0,y:0}),u(!1),n(e),t(!0))},onCloseClick:()=>{t(!1)}}},E=()=>{let[e,t]=(0,i.useState)(),[a,n]=(0,i.useState)(),[s,r]=(0,i.useState)(),[l,o]=(0,i.useState)({width:0,height:0,isReady:!1}),[d,u]=(0,i.useState)(null),c=(0,i.useRef)(null),m=(0,i.useRef)(null),h=async e=>{let{srcPath:t,fftSize:a=512,rate:n=1.025,loop:s=!1,timedCallbacks:i=[]}=e;return new Promise(async(e,r)=>{if(c.current&&(c.current.pause(),c.current.currentTime=0),m.current)try{await m.current.close()}catch(e){console.error("Error closing AudioContext:",e)}let l=new Audio(t);l.crossOrigin="anonymous",l.loop=s,l.playbackRate=n;let o=new Set;l.ontimeupdate=()=>{let e=l.currentTime;i.forEach(t=>{let{time:a,callback:n}=t;e>=a&&!o.has(a)&&(o.add(a),n())})},l.onended=()=>{e()},l.onerror=e=>{r(e)};let d=new AudioContext,h=d.createMediaElementSource(l),b=d.createAnalyser();b.fftSize=a,h.connect(b),b.connect(d.destination),c.current=l,m.current=d;try{await l.play(),u(b)}catch(e){r(e)}})};return{viewport:l,position:e,rotation:a,scale:s,setPosition:t,setRotation:n,setScale:r,onViewportChange:o,audioRef:c,audioAnalyser:d,speak:h}},R=e=>{let{tourSteps:t,nelaVoiceOrb:a,smoothScroll:n}=e,[s,r]=(0,i.useState)(!1),[l,o]=(0,i.useState)(!1),[d,u]=(0,i.useState)(0);return{status:(0,i.useMemo)(()=>s?l?"RESUME AI":"PAUSE AI":"START AI TOUR",[s,l]),onTourClick:async()=>{if(s)o(e=>(a.audioRef.current&&(e?a.audioRef.current.play():a.audioRef.current.pause()),!e));else{r(!0),o(!1);for(let s=d;s{let{time:t,targetSelector:a}=e;return{time:t,callback:()=>{let e=document.querySelector(a);e&&n.scrollIntoView(e,{offset:-64,center:!0})}}}))?i:[];await a.speak({srcPath:r.audio,timedCallbacks:l})}r(!1),u(0)}},currentStep:d,totalSteps:t.length}}},6963:(e,t,a)=>{a.d(t,{O:()=>i});var n=a(7876),s=a(1497);let i=e=>{let{fixed:t=!1}=e;return(0,n.jsx)("div",{"data-testid":"aurora-child",className:(0,s.cn)("absolute inset-0 -z-10 will-change-transform pointer-events-none opacity-25 blur-[10px] custom-aurora bg-size-[300%,200%]",{fixed:t}),children:(0,n.jsx)("div",{className:(0,s.cn)("absolute inset-0 -z-10 custom-aurora bg-size-[200%,100%] animate-aurora bg-fixed",{fixed:t})})})}},7385:(e,t,a)=>{a.d(t,{F:()=>o});var n=a(7876),s=a(7137),i=a(4232),r=a(1497);let l=(0,s.F)("relative w-full h-full overflow-hidden scrollbar-sm",{variants:{type:{auto:"overflow-auto","auto-x":"overflow-x-auto","auto-y":"overflow-y-auto",scroll:"overflow-scroll","scroll-x":"overflow-x-scroll","scroll-y":"overflow-y-scroll",hover:"pr-2"},isHovered:{true:"pr-0 overflow-auto"}},defaultVariants:{type:void 0,isHovered:!1}}),o=i.forwardRef((e,t)=>{let{className:a,children:s,type:o="auto",scrollHideDelay:d=600,...u}=e,[c,m]=i.useState(!1),h=i.useRef(null);return(0,n.jsx)("div",{ref:t,className:(0,r.cn)(l({type:o,isHovered:c,className:a})),onMouseEnter:"hover"===o?()=>{h.current&&(clearTimeout(h.current),h.current=null),m(!0)}:void 0,onMouseLeave:"hover"===o?()=>{h.current=window.setTimeout(()=>{m(!1)},d)}:void 0,...u,children:s})});o.displayName="ScrollArea"},7514:(e,t,a)=>{a.d(t,{p:()=>r});var n=a(7876),s=a(4232),i=a(1497);let r=s.forwardRef((e,t)=>{let{className:a,type:s,...r}=e;return(0,n.jsx)("input",{"data-form-type":"file"===s?"file":"input",type:s,className:(0,i.cn)("relative w-full h-10 flex rounded-md border-2 border-input text-foreground px-5 py-2.5 text-sm shadow-xs custom-shadow-outline","bg-background/55 dark:bg-foreground/10 backdrop-blur-xs","file:text-sm file:font-medium file:bg-transparent file:text-foreground file:border-0 file:cursor-pointer","hover:border-primary/75 focus-visible:border-primary/75 focus-visible:outline-hidden","placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 file:disabled:cursor-not-allowed",{"cursor-pointer":"file"===s},a),ref:t,...r})});r.displayName="Input"},7747:(e,t,a)=>{a.d(t,{w:()=>o});var n=a(7876),s=a(7137),i=a(4232),r=a(1497);let l=(0,s.F)("shrink-0",{variants:{variant:{default:"bg-border",gradient:"custom-bg-gradient opacity-50"},orientation:{horizontal:"h-0.5! w-full",vertical:"h-full w-0.5! bg-linear-to-b!"}},defaultVariants:{variant:"default",orientation:"horizontal"}}),o=i.forwardRef((e,t)=>{let{className:a,variant:s,orientation:i,...o}=e;return(0,n.jsx)("div",{ref:t,"data-orientation":i,className:(0,r.cn)(l({variant:s,orientation:i,className:a})),...o})});o.displayName="Separator"},9761:(e,t,a)=>{a.d(t,{D:()=>l});var n=a(7876),s=a(7514),i=a(1497),r=a(3986);let l=e=>{let{searchQuery:t,onSearchQueryChange:a,name:l,className:o}=e;return(0,n.jsxs)("div",{className:(0,i.cn)("relative",o),children:[(0,n.jsx)(r.gZ7,{className:"absolute z-1 left-2.5 top-2 size-6 text-muted-foreground"}),(0,n.jsx)(s.p,{"data-testid":l,type:"search",placeholder:"Search...",className:"w-full pl-10",value:t,onChange:a})]})}}}]);