1import{g as G,r as m,I as H,aj as h,D as q,t as J,ae as _,fC as V,bj as v,p as e,v as u,T as f,B as b,bk as K,ag as C,J as Q,a0 as O,a1 as F,a3 as Y,L as D}from"./index-C9IH3k-2.js";import{E as Z,G as X,I as g,ac as ee,aU as N,a2 as B,U as te,A as se}from"./TemplateUtil-D1DzmWLm.js";import{E as re}from"./EmbeddedSignupGoogle-BW6GGNAb.js";import{O as ae,Q as ne,o as ie,F as oe}from"./MainApp-BoiAvjMg.js";import{R as L}from"./GlobalOutlined-CzDL8eNz.js";import{R as U}from"./GoogleOutlined-B8vWWor8.js";import{B as le}from"./index-1obnpDkF.js";import{C as ce}from"./ColorPicker-Iu5OhKlT.js";import{R as de}from"./ReloadOutlined-0KdG7zYw.js";import"./Wrapper-ChjuDa3w.js";import"./HelperMethods-C-ewwU_x.js";var S={},z;function pe(){if(z)return S;z=1,Object.defineProperty(S,"__esModule",{value:!0});var t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M766.4 744.3c43.7 0 79.4-36.2 79.4-80.5 0-53.5-79.4-140.8-79.4-140.8S687 610.3 687 663.8c0 44.3 35.7 80.5 79.4 80.5zm-377.1-44.1c7.1 7.1 18.6 7.1 25.6 0l256.1-256c7.1-7.1 7.1-18.6 0-25.6l-256-256c-.6-.6-1.3-1.2-2-1.7l-78.2-78.2a9.11 9.11 0 00-12.8 0l-48 48a9.11 9.11 0 000 12.8l67.2 67.2-207.8 207.9c-7.1 7.1-7.1 18.6 0 25.6l255.9 256zm12.9-448.6l178.9 178.9H223.4l178.8-178.9zM904 816H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8z"}}]},name:"bg-colors",theme:"outlined"};return S.default=t,S}var xe=pe();const me=G(xe);function T(){return T=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var c=arguments[a];for(var o in c)Object.prototype.hasOwnProperty.call(c,o)&&(t[o]=c[o])}return t},T.apply(this,arguments)}const he=(t,a)=>m.createElement(H,T({},t,{ref:a,icon:me})),ue=m.forwardRef(he),{Title:je,Text:n}=f,Oe=()=>{const[t]=h.useForm(),a=q(),{setThemeColors:c,defaultColors:o}=J(),[d,I]=m.useState({}),[y,i]=m.useState(void 0),[p,s]=m.useState({}),[x,R]=m.useState(o),[k,E]=m.useState(!1),$=(r,l)=>{if(r.originFileObj){const j={...p};j[l]=r.originFileObj,s(j),v.success({title:"Upload Successful",description:`${l} updated successfully.`})}else r.file.status==="error"&&v.error({title:"Upload Failed",description:`Failed to upload ${l}. Please try again.`})};m.useEffect(()=>{P(),A()},[]),m.useEffect(()=>{!d?.id||y===void 0||a(_(ae(d,y)))},[d,y,a]);const P=async()=>{const r=await Z(!0);if(r?.status===200){I(r.data);const l=V(r.data?.themeColors||{},o);R(l),c(l);const j={...r.data};r.data.apiDoc&&(j.apiDocApplicationName=r.data.apiDoc.applicationName,j.apiDocPhoneNumber1=r.data.apiDoc.phoneNumber1),t.setFieldsValue(j)}else v.error({title:"Error",description:"Failed to load domain settings."})},A=async()=>{const r=await X(!0);r?.status===200?i(r.data?.email??""):i("")},M=async()=>{E(!0);try{const r=t.getFieldsValue(!0),l=new FormData;(r.apiDocApplicationName||r.apiDocPhoneNumber1)&&l.append("apiDoc",JSON.stringify({applicationName:r.apiDocApplicationName||"",phoneNumber1:r.apiDocPhoneNumber1||""})),l.append("applicationName",r.applicationName||""),l.append("supportEmail",r.supportEmail||""),l.append("supportPhone",r.supportPhone||"");for(const w in p)p[w]&&l.append(w,p[w]);l.append("themeColors",JSON.stringify(x)),l.append("id",d.id);const j=await K("/api/v1/reseller/domain/config",l);j?.status===200?(v.success({title:"Success",description:j.data.message}),P(),s({})):v.error({title:"Error",description:"Failed to update domain settings."})}catch{v.error({title:"Error",description:"An error occurred while saving changes."})}finally{E(!1)}},W=[{key:"1",label:e.jsxs("span",{children:[e.jsx(L,{})," Domain & Application"]}),children:e.jsx(ge,{form:t,domainSettingJson:d})},{key:"2",label:e.jsxs("span",{children:[e.jsx(ne,{})," Support Information"]}),children:e.jsx(ye,{form:t,domainSettingJson:d})},{key:"3",label:e.jsxs("span",{children:[e.jsx(N,{})," Branding Assets"]}),children:e.jsx(fe,{form:t,domainSettingJson:d,handleHeaderFileChange:$})},{key:"4",label:e.jsxs("span",{children:[e.jsx(U,{})," Google Integration"]}),children:e.jsx(be,{connectedGmail:y,fetchConnectedGmail:A})},{key:"5",label:e.jsxs("span",{children:[e.jsx(ie,{})," API Documentation"]}),children:e.jsx(ve,{form:t,domainSettingJson:d})},{key:"6",label:e.jsxs("span",{children:[e.jsx(ue,{})," Theme Settings"]}),children:e.jsx(Ce,{colors:x,setColors:R,defaultColors:o,setThemeColors:c})}];return e.jsxs("div",{style:{minHeight:"100vh"},children:[e.jsxs("div",{style:{marginBottom:"24px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(u,{orientation:"vertical",size:1,children:[e.jsx(je,{level:4,style:{margin:0},children:"Domain Settings"}),e.jsx(n,{type:"secondary",children:"Configure your domain appearance and settings"})]}),e.jsxs(u,{children:[e.jsx(b,{children:"Cancel"}),e.jsx(b,{type:"primary",onClick:M,loading:k,children:"Save Changes"})]})]}),e.jsx(g,{children:e.jsx(ee,{defaultActiveKey:"1",items:W,type:"card",style:{marginTop:"-8px"}})})]})},ge=({form:t,domainSettingJson:a})=>e.jsx(h,{form:t,layout:"vertical",children:e.jsxs(u,{size:24,style:{width:"100%"},children:[e.jsxs(g,{size:"small",title:"Domain Configuration",children:[e.jsx(h.Item,{label:e.jsx(n,{strong:!0,children:"Domain Name"}),name:"hostName",extra:e.jsx(n,{type:"secondary",children:"Your custom domain that will be used to access the application"}),style:{marginBottom:"6px"},children:e.jsx(C,{prefix:e.jsx(L,{style:{color:"#8c8c8c"}}),disabled:!0})}),e.jsx(h.Item,{label:e.jsx(n,{strong:!0,children:"Application Name"}),name:"applicationName",extra:e.jsx(n,{type:"secondary",children:"This name will be displayed throughout your application"}),style:{marginBottom:"6px"},children:e.jsx(C,{placeholder:"Enter application name"})})]}),e.jsx(g,{size:"small",title:"DNS Configuration",children:e.jsx(u,{orientation:"vertical",size:16,style:{width:"100%"},children:e.jsxs("div",{children:[e.jsx(n,{strong:!0,style:{display:"block"},children:"Option 1: CNAME Record (Recommended)"}),e.jsxs(n,{type:"secondary",style:{marginBottom:"12px",display:"block"},children:["Create a ",e.jsx(n,{code:!0,children:"CNAME"})," record and point ",e.jsx(n,{strong:!0,children:a?.hostName})," to"," ",e.jsx(n,{code:!0,copyable:!0,children:"wa.redlava.in"})]}),e.jsx(B,{children:"OR"}),e.jsx(n,{strong:!0,style:{display:"block"},children:"Option 2: A Record"}),e.jsxs(n,{type:"secondary",style:{marginBottom:"12px",display:"block"},children:["Create an ",e.jsx(n,{code:!0,children:"A"})," record and point ",e.jsx(n,{strong:!0,children:a?.hostName})," to IP address"," ",e.jsx(n,{code:!0,copyable:!0,children:"164.52.202.161"})]})]})})})]})}),ye=({form:t,domainSettingJson:a})=>e.jsx(h,{form:t,layout:"vertical",children:e.jsx(u,{orientation:"vertical",size:24,style:{width:"100%"},children:e.jsxs(g,{size:"small",title:"Contact Information",style:{maxWidth:"600px"},children:[e.jsx(h.Item,{label:"Support Phone Number",name:"supportPhone",extra:"Primary contact number for customer support",children:e.jsx(C,{placeholder:"Enter support phone number"})}
1),e.jsx(h.Item,{label:"Support Email",name:"supportEmail",extra:"Email address for customer inquiries",children:e.jsx(C,{placeholder:"Enter support email"})})]})})}),fe=({form:t,domainSettingJson:a,handleHeaderFileChange:c})=>{const[o,d]=m.useState({}),{token:I}=Q.useToken(),y={loginLogo:"Recommended size: 200x100px (Aspect Ratio: 2:1)",sidebarLogo:"Recommended size: 200x100px (Aspect Ratio: 2:1)",favIco:"Recommended size: 32x32px (Square)",sidebarLogoIcon:"Recommended size: 64x64px (Square)"};m.useEffect(()=>()=>{Object.values(o).forEach(s=>URL.revokeObjectURL(s))},[o]);const i=s=>o[s]?o[s]:a[`${s}Url`]?a[`${s}Url`]:null,p=(s,x)=>{if(s.originFileObj){const R=URL.createObjectURL(s.originFileObj);d(k=>({...k,[x]:R}))}c(s,x)};return e.jsx(h,{form:t,layout:"vertical",children:e.jsx(O,{gutter:[24,24],children:["loginLogo","sidebarLogo","favIco","sidebarLogoIcon"].map(s=>e.jsx(F,{xs:24,sm:12,md:8,lg:6,children:e.jsx(g,{size:"small",title:s.replace(/([A-Z])/g," $1").replace(/^./,x=>x.toUpperCase()),style:{borderRadius:"10px",overflow:"hidden"},children:e.jsxs("div",{style:{padding:"20px",borderRadius:"8px",textAlign:"center"},children:[e.jsx("div",{style:{marginBottom:"10px"},children:i(s)?e.jsx(Y,{src:i(s),alt:s,style:{width:"100%",maxHeight:"120px",objectFit:"contain",borderRadius:"4px"}}):e.jsx("div",{style:{width:"100%",height:"120px",background:I.colorBgLayout,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px"},children:e.jsx(N,{style:{fontSize:"36px",color:"#bfbfbf"}})})}),e.jsx("div",{children:e.jsx(n,{type:"secondary",style:{fontSize:"12px"},children:y[s]})}),e.jsx(te,{name:s,accept:".png,.jpg,.jpeg,.ico",maxCount:1,showUploadList:!1,onChange:(x,R)=>p(x.fileList[0],s),style:{marginTop:"10px"},beforeUpload:()=>!1,children:e.jsx(b,{icon:e.jsx(oe,{}),children:"Upload / Replace Image"})})]})})},s))})})},be=({connectedGmail:t,fetchConnectedGmail:a})=>e.jsx(g,{size:"small",title:"Connected Account",style:{maxWidth:"600px"},children:e.jsxs(u,{orientation:"vertical",size:16,style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[e.jsx(le,{dot:!0,status:t?"success":"default",children:e.jsx(se,{icon:e.jsx(U,{}),style:{backgroundColor:"#4285f4"}})}),e.jsxs("div",{children:[e.jsx(n,{strong:!0,children:t||"No account connected"}),e.jsx("br",{}),e.jsx(n,{type:"secondary",children:"Used for password reset emails"})]})]}),e.jsx(re,{scope:"GMAIL",onSuccess:a})]})}),ve=({form:t,domainSettingJson:a})=>e.jsx(h,{form:t,layout:"vertical",children:e.jsx(u,{orientation:"vertical",size:24,style:{width:"100%"},children:e.jsxs(g,{size:"small",title:"API Documentation Settings",style:{maxWidth:"600px"},children:[e.jsx(h.Item,{label:"Application Name",name:"apiDocApplicationName",extra:"Application name to be used in API documentation",children:e.jsx(C,{placeholder:"Enter application name for API docs"})}),e.jsx(h.Item,{label:"Phone Number",name:"apiDocPhoneNumber1",extra:"Primary phone number for API documentation examples",children:e.jsx(C,{placeholder:"Enter phone number"})})]})})}),Ce=({colors:t,setColors:a,defaultColors:c,setThemeColors:o})=>{const d=(i,p)=>{const s=typeof p=="string"?p:p.toHexString(),x={...t,[i]:s};a(x),o(x)},I=()=>{a(c),o(c)},y=[{key:"colorPrimary",label:"Primary",description:"Primary color for buttons and links"},{key:"colorSuccess",label:"Success",description:"Color for success states"},{key:"colorWarning",label:"Warning",description:"Color for warning states"},{key:"colorError",label:"Error",description:"Color for error states"},{key:"colorInfo",label:"Info",description:"Color for informational content"}];return e.jsxs(D,{vertical:!0,gap:"large",children:[e.jsx(f.Title,{level:5,style:{margin:0},children:"Theme Settings"}),e.jsx(g,{size:"small",title:"Brand Colors",extra:e.jsx(b,{icon:e.jsx(de,{}),onClick:I,children:"Reset to Default"}),children:e.jsx(O,{gutter:[24,24],children:y.map(i=>e.jsx(F,{xs:24,sm:12,md:8,children:e.jsxs(D,{vertical:!0,gap:"small",children:[e.jsx(f.Text,{strong:!0,children:i.label}),e.jsxs(D,{align:"center",gap:"middle",children:[e.jsx(ce,{value:t[i.key],onChange:p=>d(i.key,p),showText:!0,format:"hex",presets:[{label:"Recommended",colors:["#1677ff","#52c41a","#faad14","#ff4d4f","#722ed1","#eb2f96","#13c2c2","#fa8c16","#2f54eb","#a0d911"]}]}),t[i.key]!==c[i.key]&&e.jsx(b,{type:"link",size:"small",onClick:()=>d(i.key,c[i.key]),children:"Reset"})]}),e.jsx(f.Text,{type:"secondary",style:{fontSize:12},children:i.description})]})},i.key))})}),e.jsx(g,{size:"small",title:"Preview",children:e.jsxs(u,{orientation:"vertical",size:"middle",style:{width:"100%"},children:[e.jsxs(u,{wrap:!0,children:[e.jsx(b,{type:"primary",children:"Primary Button"}),e.jsx(b,{type:"primary",danger:!0,children:"Danger Button"}),e.jsx(b,{children:"Default Button"})]}),e.jsx(B,{style:{margin:"8px 0"}}),e.jsxs(u,{wrap:!0,children:[e.jsx(f.Text,{type:"success",children:"Success Text"}),e.jsx(f.Text,{type:"warning",children:"Warning Text"}),e.jsx(f.Text,{type:"danger",children:"Error Text"}),e.jsx(f.Link,{children:"Link Text"})]})]})})]})};export{Oe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.