1var F=Object.defineProperty;var T=(p,m,t)=>m in p?F(p,m,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[m]=t;var i=(p,m,t)=>T(p,typeof m!="symbol"?m+"":m,t);import{r as N,j as e,F as E,T as U,x,Y as W,v as l,y as g,U as c,w as v,S as w,$ as V}from"./index-DP1EdfVr.js";import{T as M}from"./Table-sAXoFruL.js";import{L as C}from"./LogisticButton-BbcQDlnF.js";import{M as b}from"./createClass-kVuj6DsW.js";import{T as R,a as B,b as j,c as S}from"./googlePlaces-CWBhVTko.js";import"./CustomerKycForm-BVOwPjWC.js";import{l as $,a as u}from"./Utils-DDhFVWMN.js";import{C as z,e as P}from"./Validation-D7y-_ckL.js";import{C as H,s as O,u as _,d as A,e as K,f as Q,P as q,N as I}from"./CustomerContactDetail-3IaVK7uo.js";import{v as L}from"./react-select.browser.esm-Kz-Y4OXD.js";/* empty css */import{L as y}from"./ReactMultiEmail-I0gguaAl.js";import{p as G,c as J,a as Y,D as Z,N as X}from"./Dashboard-BUbooKx9.js";import D from"./InsertAgreementForm-DWGyUvfZ.js";import{H as ee}from"./HtmlParser-Bbw_paQX.js";import{P as k}from"./Pagination-rYuQoB4V.js";/* empty css *//* empty css */import"./moment-zH0z38ay.js";import"./sea-tBcLZDPv.js";import"./enquiry-7aRAWRvx.js";import"./BookingForm-C55p4zvW.js";import"./react-datepicker-BZLysaCR.js";import"./CustomFileViewer-B6KLT5vU.js";import"./temperature-Bhclty3g.js";import"./MarginInput-C-UcGK4P.js";import"./index-oZVluTNB.js";import"./FileModal-BoaEYUJW.js";import"./ckeditor-Dhu7FPgn.js";import"./ChangePassword-CvXofl_g.js";import"./CustomerDashboard-BeCPr4d4.js";class te extends N.Component{render(){var m,t,a,s,r;return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"card-body",children:[e.jsxs("div",{className:"form-row",children:[e.jsxs("div",{className:"form-group col-md-6",children:[e.jsx(y,{label:"Company Name",forName:"companyName"}),e.jsx("input",{type:"text",className:this.props.tab1Error&&this.props.companyName===""?"ex-work-texts-warn":"ex-work-texts",name:"companyName",id:"companyName",value:this.props.companyName,onChange:this.props.handleChange,placeholder:"Name of Company",required:!0,ref:"companyName",disabled:!!((m=this.props)!=null&&m.readMode)})]}),e.jsxs("div",{className:"form-group col-md-2",children:[e.jsx(y,{label:"Short Name",forName:"companyShortName"}),e.jsx("input",{type:"text",className:!this.props.tab1Error&&this.props.companyShortName.length===0||this.props.companyShortName.length>=3&&this.props.companyShortName.length<=6?"ex-work-texts":"ex-work-texts-warn",name:"companyShortName",value:this.props.companyShortName,onChange:this.props.handleChange,placeholder:"Company Short Name",disabled:!!((t=this.props)!=null&&t.readMode)}),this.props.companyShortName.length===0||this.props.companyShortName.length>=3&&this.props.companyShortName.length<=6?null:e.jsx("div",{class:"error-warning-shortname",children:"Must be minimum of 3 characters and maximum of 6 characters"}),this.props.shortNameAvailability?null:e.jsxs("div",{class:"error-warning-shortname",children:["Short name already existsa",this.props.suggestions.length>0?e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx("strong",{children:"Suggestion: "}),this.props.suggestions.map((n,o)=>e.jsxs("span",{children:[n,o!==this.props.suggestions.length-1?", ":""]}))]}):null]})]}),e.jsxs("div",{className:"form-group col",children:[e.jsx(y,{label:"Website",forName:"companyWebsite"}),e.jsx("input",{type:"text",className:this.props.tab1Error&&this.props.companyWebsite===""||this.props.tab1Error?"ex-work-texts-warn":"ex-work-texts",name:"companyWebsite",value:this.props.companyWebsite,onChange:this.props.handleChange,placeholder:"Company Website",disabled:!!((a=this.props)!=null&&a.readMode)})]})]}),e.jsx(H,{cities:this.props.cities,citiesList:this.props.citiesList,city:this.props.city,cityId:this.props.cityId,countries:this.props.countries,countriesList:this.props.countriesList,country:this.props.country,countryCode:this.props.countryCode,editMode:this.props.editMode,getCities:this.props.getCities,handleChange:this.props.handleChange,handleCityChange:this.props.handleCityChange,handleCountryChange:this.props.handleCountryChange,readMode:this.props.readMode,tab1Error:this.props.tab1Error}),e.jsx("div",{className:"form-row",children:e.jsxs("div",{className:"form-group col-md-6",children:[e.jsx(y,{label:"Address",forName:"addressLine"}),e.jsx("input",{type:"text",className:this.props.tab1Error&&this.props.addressLine===""?"ex-work-texts-warn":"ex-work-texts",name:"addressLine",id:"addressLine",value:this.props.addressLine,onChange:this.props.handleChange,placeholder:"Address Line",required:!0,ref:"addressLine",disabled:!!((s=this.props)!=null&&s.readMode)})]})}),e.jsx("hr",{className:"kychr"}),e.jsxs("div",{className:"row",children:[e.jsxs("div",{className:"col-md-6",children:[e.jsx(y,{label:"Company Logo"}),e.jsxs("div",{className:this.props.tab1Error&&this.props.companyLogo==null?"input-group warn":"input-group",children:[e.jsx("input",{type:"file",id:"companyLogo","aria-describedby":"inputGroupFileAddon01",name:"companyLogo",className:"inputfile",accept:"image/x-png,image/jpeg,image/jpg,image/png",onCh
1ange:n=>this.props.handleCompanyDocuments(n,this.props.state),disabled:!!((r=this.props)!=null&&r.readMode)}),e.jsxs("label",{htmlFor:"companyLogo",className:"label-file-kyc-css",children:[e.jsx("span",{id:"file-name",className:"file-box-kyc",children:this.props.companyLogo?this.props.companyLogo.name:"Choose File"}),e.jsx("span",{className:"file-button-kyc",children:e.jsx(E,{icon:U,className:"uploadBtn mr-2"})})]})]})]}),e.jsx("div",{className:"col-md-6",children:e.jsxs("div",{style:{padding:"20px"},children:[e.jsx("input",{type:"checkbox",onChange:this.props.handleChange,name:"isTest",value:this.props.isTest}),e.jsx("label",{for:"checkbox",className:"ml-2",children:"Test company"})]})})]})]})})}}class se extends N.Component{constructor(){super(...arguments);i(this,"state",{hideShowConPass:!1,hideShowPass:!1,hide:`${x}${_}`,show:`${x}${O}`});i(this,"handleHideShowConfirmPassword",()=>{this.setState(t=>({hideShowConPass:!t.hideShowConPass}),function(){var t=document.getElementById("cpassword");t.type==="password"?t.type="text":t.type="password"})});i(this,"handleHideShowPassword",()=>{this.setState(t=>({hideShowPass:!t.hideShowPass}),function(){var t=document.getElementById("password");t.type==="password"?t.type="text":t.type="password"})});i(this,"companyShortName",()=>this.props.companyShortName.toString().split(" ").join("")+" - "+this.props.username)}render(){return e.jsxs("div",{className:"card-body",children:[e.jsx("div",{className:"detailsOne",children:e.jsx("div",{className:"row",children:e.jsx("div",{className:"col-md-10",children:"USER CREDENTIALS"})})}),e.jsx("div",{className:"card-body",children:e.jsx("div",{className:"row",style:{paddingLeft:"15px",paddingRight:"15px"},children:e.jsx("div",{className:"col",children:e.jsxs("div",{className:"form-row ",children:[e.jsxs("div",{className:"form-group col-sm",children:[e.jsx("label",{htmlFor:"fullUserName",children:"Full User Name"}),e.jsxs("div",{className:"userTextField",children:[e.jsx("div",{className:"customIconDivUser",children:e.jsx("img",{src:x+A,width:"29px",height:"auto",alt:"img"})}),e.jsx("span",{className:"companyShortNameDisplay",children:this.companyShortName()})]})]}),e.jsxs("div",{className:"form-group col-sm",children:[e.jsx("label",{htmlFor:"userName",children:"User Name"}),e.jsxs("div",{className:this.props.tab3Error&&this.props.username===""?"userTextField warn":"userTextField",children:[e.jsx("div",{className:"customIconDivUser",children:e.jsx("img",{src:x+A,width:"29px",height:"auto",alt:"img"})}),e.jsxs("div",{style:{flex:"1",marginRight:"5px"},children:[e.jsx("input",{type:"text",className:"departmentStaffLoginUserField",name:"username",value:this.props.username,onChange:this.props.handleChange,required:!0}),this.props.usernameAvailability?null:e.jsxs("div",{class:"error-warning-username-exist-kyc",children:["Username Already Exist",this.props.nameSuggestions.length>0?e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx("strong",{children:"Suggestion: "}),this.props.nameSuggestions.map((t,a)=>e.jsxs("span",{children:[t,a!==this.props.nameSuggestions.length-1?", ":""]}))]}):null]})]})]})]}),e.jsxs("div",{className:"form-group col-sm",children:[e.jsx("label",{htmlFor:"email",children:"Email"}),e.jsxs("div",{className:this.props.tab3Error&&this.props.email===""?"userTextField warn":"userTextField",children:[e.jsx("div",{className:"customIconDivUser",children:e.jsx("img",{src:x+K,width:"29px",height:"auto",alt:"img"})}),e.jsx("div",{style:{flex:"1",marginRight:"5px",marginLeft:"3px"},children:e.jsx("input",{type:"email",className:"departmentStaffLoginUserField",name:"email",value:this.props.email,onChange:this.props.handleChange,onBlur:t=>this.props.emailValidation(t)})})]})]}),e.jsxs("div",{className:"form-row",children:[e.jsxs("div",{className:"form-group col",children:[e.jsx("label",{htmlFor:"password",children:"Password"}),e.jsxs("div",{className:this.props.validationMessage&&this.props.validationMessage===1||this.props.tab1Error&&this.props.password===""?"pass_warning":"userTextField",children:[e.jsx("div",{className:"customIconDivUser",children:e.jsx("img",{src:x+G,width:"29px",height:"auto",alt:"img"})}),e.jsx("div",{style:{flex:"1",marginRight:"5px",marginLeft:"3px"},children:e.jsx("input",{type:"password",id:"password",className:"departmentStaffLoginUserField",name:"password",value:this.props.password,onChange:this.props.handlePassword})}),e.jsx("div",{onClick:this.handleHideShowPassword,children:e.jsx("img",{src:this.state.hideShowPass===!1?this.state.hide:this.state.show,width:"24px",heigh:"auto",alt:"img",className:"password-image"})})]}),this.props.validationMessage&&this.props.validationMessage===1?e.jsxs("div",{className:"pass-error-warning",children:[e.jsx("strong",{children:"Password must contain:"}),e.jsx("br",{}),"- at least 1 lowercase alphabetical character",e.jsx("br",{}),"- at least 1 uppercase alphabetical character",e.jsx("br",{}),"- must contain at least 1 numeric character",e.jsx("br",{}),"- eight characters or longer"]}):null]}),e.jsxs("div",{className:"form-group col",children:[e.jsx("label",{htmlFor:"confirmPassword",children:"Confirm Password"}),e.jsxs("div",{className:this.props.password!==null&&this.props.cpassword!==null&&this.props.password!==this.props.cpassword||this.props.tab1Error&&this.props.cpassword===""?"pass_warning":"userTextField",children:[e.jsx("div",{className:"customIconDivUser",children:e.jsx("img",{src:x+J,width:"29px",height:"auto",alt:"img"})}),e.jsx("div",{style:{flex:"1",marginRight:"5px",marginLeft:"3px"},children:e.jsx("input",{type:"password",className:"departmentStaffLoginUserField",id:"cpassword",name:"cpassword",value:this.props.cpassword,onChange:this.props.handleChange})}),e.jsx("div",{onClick:this.handleHideShowConfirmPassword,children:e.jsx("img",{src:this.state.hideShowConPass===!1?this.state.hide:this.state.show,width:"24px",heigh:"auto",alt:"img",className:"password-image"})})]}),this.props.password!==null&&this.props.cpassword!==null&&this.props.password!==this.props.cpassword?e.jsx("div",{className:"pass-error-warning",children:e.jsx("strong",{children:"Password is not same"})}):null]})]})]})})})})]})}}class ae extends N.Component{constructor(){super(...arguments);i(this,"toggleModal",()=>{this.setState({modal:!this.state.modal})})}render(){var t,a;return e.jsx("div",{children:e.jsxs("div",{className:"row",children:[e.jsx("div",{className:"col-md-2",children:e.jsx("div",{className:(this.props.tab2Error||this.props.tab1Error)&&(this.props.contactProfileImg===null||this.props.contactProfileImg==="")||this.props.tab1Error&&this.props.staffImage===""?"personProfileImgBox warn":"personProfileImgBox",children:this.props.profileImgPreview?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:this.props.profileImgPreview,alt:"No Preview",onError:s=>$(s)}),e.jsx(E,{className:"deleteImg",icon:W,onClick:s=>this.props.removeImage(s)})]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{accept:"image/png,image/jpg,image/jpeg",id:"fileImage",name:"personProfileImage",onCh
1ange:s=>this.props.handleImageChange(s),ref:s=>{this.upload=s},style:{display:"none"},type:"file"}),e.jsx("button",{className:"uploadButton",onClick:()=>{this.upload.click()},children:"Upload Photo"})]})})}),e.jsxs("div",{className:"col",children:[e.jsxs("div",{className:"form-row add-padding",children:[e.jsxs("div",{className:"form-group col",children:[e.jsx(y,{label:"First Name",forName:"firstName"}),e.jsx("input",{className:(this.props.tab2Error||this.props.tab1Error)&&this.props.firstName===""?"ex-work-texts-warn":"ex-work-texts",disabled:!!((t=this.props)!=null&&t.readMode),name:"firstName",onChange:s=>this.props.handleChangeContactDetail(s),placeholder:"First Name",type:"text",value:this.props.firstName})]}),e.jsxs("div",{className:"form-group col",children:[e.jsx("label",{htmlFor:"middleName",children:"Middle Name"}),e.jsx("input",{className:"ex-work-texts",disabled:!!((a=this.props)!=null&&a.readMode),name:"middleName",onChange:s=>this.props.handleChangeContactDetail(s),placeholder:"Middle Name",type:"text",value:this.props.middleName})]}),e.jsxs("div",{className:"form-group col",children:[e.jsx(y,{label:"Last Name",forName:"lastName"}),e.jsx("input",{className:(this.props.tab2Error||this.props.tab1Error)&&this.props.lastName===""?"ex-work-texts-warn":"ex-work-texts",name:"lastName",onChange:s=>this.props.handleChangeContactDetail(s),placeholder:"Last Name",type:"text",value:this.props.lastName})]})]}),e.jsx("div",{className:"form-row add-padding",children:e.jsx("div",{className:"form-group col",children:e.jsx(Q,{id:0,cities:this.props.cities,citiesList:this.props.citiesList,city:this.props.city,cityId:this.props.cityId,countries:this.props.countries,countriesList:this.props.countriesList,country:this.props.country,countryCode:this.props.countryCode,editMode:this.props.editMode,handleChange:this.props.handleChangePersonProfileCountryCityChange,handleChangePersonProfileCityChange:this.props.handleChangePersonProfileCityChange,handleChangePersonProfileCountryChange:this.props.handleChangePersonProfileCountryChange,readMode:this.props.readMode,tab1Error:this.props.tab1Error,tab2Error:this.props.tab2Error})})})]})]})})}}class ie extends N.Component{constructor(){super(...arguments);i(this,"state",{addressLine:"",cities:[],citiesList:[],city:"",cityId:"",companyLogo:null,companyName:"",companyShortName:"",companyWebsite:"",contactCityId:"",contactCountryCode:"",contactCountry:"",contactCity:"",contactProfileImg:"",profileImgPreview:"",contactEmail:"",contactNumber:"",countries:[],countriesList:[],country:"",countryCode:"",cpassword:null,customerContactDetails:"",customerKycFiles:[],customerKycID:"",email:"",files:[],firstName:"",id:"",invalidWebsite:!1,lastName:"",loaded:0,middleName:"",modalMessage:"",modalTitle:"",nameSuggestions:[],password:"",regionId:1,role:localStorage.userRoleCode,selectedIndex:0,shortNameAvailability:!0,submitSpinner:!1,suggestions:[],tab1Error:!1,tab2Error:!1,tab3Error:!1,userDesignationId:2,username:"",usernameAvailability:!0,validationMessage:0,isTest:!1,changedWebsite:"",websiteChanged:"false"});i(this,"emailValidation",(t,a,s)=>{let r="",n=[...this.state.customerContactDetails];n.forEach((o,d)=>{if(parseInt(d)===parseInt(a)){r=o.personProfile.personProfileEmails[s].emailId;let h=P(r);o.personProfile.personProfileEmails[s].invalidEmailError=!h,!h&&l("Please enter valid email address.","Email not valid.","error")}}),this.setState({customerContactDetails:n})});i(this,"getCities",(t,a)=>{g(this.props.outerLink?`${c.getCityByCountryCodeUnauth}
1/${t}`:`${c.getCityByCountryCode}/${t}`,s=>{s.data.success&&this.setState({cities:s.data.data.items});let r=[];r=s.data.data.items;let n=[];r.forEach(o=>{let d={label:o.name+" - "+o.zipcode,value:o.id};n.push(d)}),this.setState({citiesList:n})},s=>{u(s)})});i(this,"getCitiesAsync",(t,a)=>new Promise((s,r)=>{g(this.props.outerLink?`${c.getCityByCountryCodeUnauth}/${t}`:`${c.getCityByCountryCode}/${t}`,n=>{n.data.success&&this.setState({cities:n.data.data.items});let o=[];o=n.data.data.items;let d=[];o.forEach(h=>{let f={label:h.name+" - "+h.zipcode,value:h.id};d.push(f)}),s(d)},n=>{r(),u(n)})}));i(this,"getCitiesForUpdate",()=>{this.props.editMode&&this.getCities(this.state.countryCode)});i(this,"getCountries",()=>{g(this.props.outerLink?c.countryUrlUnauth:c.countryUrl,t=>{if(t.data.success){let a=t.data.data.items;this.setState({countries:a});let s=[];a.forEach(r=>{let n={label:r.name,value:r.code};s.push(n)}),this.setState({countriesList:s})}else l("Error",t.data.message,"Error")})});i(this,"getPersonProfileCities",()=>{let t=[...this.state.customerContactDetails];t.length>0&&t.forEach(a=>{if(a.personProfile.countryCode){let s={countryCode:a.personProfile.countryCode};g(`${c.getCityByCountryCode}/${s.countryCode}`,r=>{r.data.success&&(a.personProfile.cities=r.data.data.items)})}}),this.setState({customerContactDetails:t})});i(this,"handleChange",t=>{if(t.target.name==="countryCode"){const{name:a,value:s}=t.target;this.setState({[a]:s},()=>{this.getCities(this.state.countryCode)})}else if(t.target.name==="isTest"){const{name:a,checked:s}=t.target;this.setState({[a]:s})}else{const{name:a,value:s}=t.target;this.setState({[a]:s})}});i(this,"handleChangePersonProfileCityChange",(t,a)=>{const s=t;this.setState({contactCityId:s,contactCity:t})});i(this,"handleChangePersonProfileCountryChange",(t,a)=>{const s=t==null?void 0:t.value;this.setState({contactCountryCode:t==null?void 0:t.value,contactCountry:t}),this.setState({contactCountryCode:t==null?void 0:t.value,contactCountry:t},()=>{g(this.props.outerLink?`${c.getCityByCountryCodeUnauth}
1/${s}`:`${c.getCityByCountryCode}/${s}`,r=>{if(r.data.success){this.setState({contactCities:r.data.data.items});let n=r.data.data.items;this.setState({cities:n});let o=[];n.forEach(d=>{let h={label:d.name+" - "+d.zipcode,value:d.id};o.push(h)}),this.setState({citiesList:o})}},r=>{u(r)})})});i(this,"handleCityChange",t=>{t!=null?this.setState({cityId:t,city:t}):this.setState({cityId:"",city:""})});i(this,"handleCompanyDocuments",t=>{const{name:a}=t.target;let s=t.target.files,r=[...this.state.files];const n=L(s,{allowedCategories:a==="companyLogo"?"images":"all"});if(!n.isValid){l({title:"Warning",text:n==null?void 0:n.text,content:{element:"span",attributes:{innerHTML:n.errorMessage}},icon:"warning"});return}if(s&&s[0]){let o="";if(a==="companyLogo"?o="CL":a==="companyRegistrationDocument"?o="CRD":a==="bankDetailDocument"?o="BDD":o="TD",r.length>0){let d=0,h=0;r.forEach((f,oe)=>{f.documentTypeCode&&f.documentTypeCode===o&&d++}),d===0?r.push({file:s[0],documentTypeCode:o}):r[h].file=s[0]}else r.push({file:s[0],documentTypeCode:o});this.setState({files:r,[a]:t.target.files[0]},()=>{})}});i(this,"handleContactPersonChange",t=>{const a=t.target,s=a.value,r=a.name;this.setState({[r]:s})});i(this,"handleCountryChange",t=>{t!=null?(this.setState({countryCode:t.value,country:t,city:"",cityId:""}),this.getCities(t.value,t)):this.setState({countryCode:"",cities:[],citiesList:[],country:"",city:"",cityId:""})});i(this,"handleImageChange",(t,a)=>{const s=t.target.files[0];if(!s)return;const r=L(s,{allowedCategories:"images"});if(!r.isValid){l({title:"Warning",text:r==null?void 0:r.text,content:{element:"span",attributes:{innerHTML:r.errorMessage}},icon:"warning"});return}if(s){let h=URL.createObjectURL(t.target.files[0]);this.setState({contactProfileImg:t.target.files[0],profileImgPreview:h});var n=t.target.files[0].name;let f=n.split(".").pop();var o=["png","jpg","jpeg"],d=o.includes(f);if(!d){this.setState({profileImgPreview:null,contactProfileImg:null});return}}});i(this,"handlePassword",t=>{if(!this.props.isVendor){const{name:a,value:s}=t.target;this.setState({[a]:s},()=>{new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})").test(this.state.password)?this.setState({validationMessage:0}):this.setState({validationMessage:1})})}});i(this,"handlePreviousClick",()=>{this.setState({selectedIndex:this.state.selectedIndex-1})});i(this,"handleNextClick",()=>{if(this.state.selectedIndex===0)if(this.state.companyName!==""&&this.state.companyWebsite!==""&&this.state.companyShortName!==""&&this.state.countryCode!==""&&this.state.cityId!==""&&this.state.companyLogo!==null&&this.state.addressLine!==""){let t=this.state.companyWebsite;t.indexOf("http")===-1&&(t="http://"+t,this.setState({websiteChanged:!0})),t.charAt(t.length-1)!=="/"&&(t+="/",this.setState({websiteChanged:!0})),this.setState({changedWebsite:t},()=>{z(this.state.websiteChanged?this.state.changedWebsite:this.state.companyWebsite)?this.state.companyShortName.length>=3&&this.state.companyShortName.length<=6&&this.state.shortNameAvailability?(this.setState({tab1Error:!1}),this.setState({selectedIndex:this.state.selectedIndex+1})):l("Please enter valid company short name","Company short name must be minimum of 3 characters and maximum of 6 characters","error"):this.setState({tab1Error:!0,invalidWebsite:!0},()=>{l({title:"Error",text:"",icon:"error",buttons:!0,content:{element:"span",attributes:{innerHTML:"Invalid domain name,<br>Enter link in the format: https://www.google.com/"}}})})})}else this.setState({selectedIndex:this.state.selectedIndex,tab1Error:!0}),l("Error","Please fill all the fields","error");else this.state.selectedIndex===1?this.checkContactDetailValidation()?(this.setState({tab2Error:!1}),this.setState({selectedIndex:this.state.selectedIndex+1})):(this.setState({selectedIndex:this.state.selectedIndex,tab2Error:!0}),l("Error","Please fill all the fields in executives","error")):this.setState({selectedIndex:this.state.selectedIndex+1})});i(this,"handleSelect",t=>{if(this.state.selectedIndex===0){if(t>1)if(this.checkContactDetailValidation())this.setState({tab2Error:!1}),this.setState({selectedIndex:t});else{this.setState({tab2Error:!0}),l("Error","Cannot skip the form without filling.","error");return}if(this.state.companyName!==""&&this.state.companyWebsite!==""&&this.state.companyShortName!==""&&this.state.countryCode!==""&&this.state.cityId!==""&&this.state.companyLogo!==null&&this.state.addressLine!=="")this.state.companyShortName.length>=3&&this.state.companyShortName.length<=6?(this.setState({tab1Error:!1}),this.setState({selectedIndex:t})):l("Please enter valid company short name","Company short name must be minimum of 3 characters and maximum of 6 characters","error");else{this.setState({tab1Error:!0}),l("Error","Please fill all the fields","error");return}}else this.state.selectedIndex===1?t!==0?this.checkContactDetailValidation()?(this.setState({tab2Error:!1}),this.setState({selectedIndex:t})):(this.setState({tab2Error:!0}),l("Error","Please fill all the fields in executives","error")):this.setState({selectedIndex:t}):this.setState({selectedIndex:t})});i(this,"checkContactDetailValidation",()=>this.state.firstName!==""&&this.state.lastName!==""&&this.state.contactProfileImg!==""&&this.state.contactCityId!==""&&this.state.contactCountryCode!=="");i(this,"handleSubmit",()=>{var t=this.state.companyShortName.toString().split(" ").join("")+"-"+this.state.username;if(this.state.username===""||this.state.email===""||this.state.password===""||this.state.cpassword===""?this.setState({tab3Error:!0}):this.setState({tab3Error:!1}),this.state.password!==this.state.cpassword){l("Error","Passwords do not match","error");return}let a=new FormData;
1const s={company_name:this.state.companyName,company_short_name:this.state.companyShortName,country_code:this.state.countryCode,cityId:this.state.cityId,address_line:this.state.addressLine,company_website:this.state.websiteChanged?this.state.changedWebsite:this.state.companyWebsite,isTest:this.state.isTest},r={username:t,password:this.state.password,email:this.state.email},n={firstName:this.state.firstName,middleName:this.state.middleName,lastName:this.state.lastName,countryCode:this.state.contactCountryCode,cityId:this.state.contactCityId},o=this.state.companyLogo,d=this.state.contactProfileImg;a.append("companyDetail",JSON.stringify(s)),a.append("user",JSON.stringify(r)),a.append("personProfile",JSON.stringify(n)),a.append("companyLogo",o),a.append("personProfileFile",d),this.setState({submitSpinner:!0},function(){v(c.superAdmin,a,h=>{h.data.success?(this.setState({submitSpinner:!1}),l("Success","Successfully inserted","success"),this.resetState(),this.props.toggleModal(),this.props.getAllSuperAdmin()):(this.setState({submitSpinner:!1}),u(h))},h=>{this.setState({submitSpinner:!1}),u(h)})})});i(this,"handleUserLoginEmailValidation",t=>{if(!this.props.isVendor){let a=this.state.email;P(a)||l("Please enter valid email address","Email not valid","error")}});i(this,"openModal",t=>{t.stopPropagation(),this.setState({modal:!0})});i(this,"removeDocuments",t=>{let a=[...this.state.additionalDocuments];a.splice(t,1),this.setState({additionalDocuments:a})});i(this,"removeImage",t=>{this.setState({contactProfileImg:null,profileImgPreview:null})});i(this,"resetState",()=>{this.setState({role:localStorage.userRoleCode,selectedIndex:0,username:"",password:"",cpassword:"",email:"",isTest:!1,companyName:"",companyShortName:"",addressLine:"",companyWebsite:"",countryCode:"",regionId:1,cityId:"",companyLogo:"",loaded:0,contactCity:"",contactCityId:"",contactCountry:"",contactCountryCode:"",firstName:"",middleName:"",lastName:"",contactProfileImg:"",profileImgPreview:""})});i(this,"setUpdateConfig",()=>{let t=this.props.formData;this.setState({customerKycID:t.id,id:t.id,companyName:t.companyName,companyShortName:t.companyShortName,countryCode:t.countryCode,country:{label:t.country.name,value:t.country.code},cityId:t.cityId,city:{label:t.city.name+" - "+t.city.zipcode,value:t.cityId},companyWebsite:t.companyWebsite,enabled:t.enabled,companyDirectors:t.companyDirectors},async function(){this.addCompanyDocument();const a=await this.getCitiesAsync(this.state.countryCode);this.setState({citiesList:a},()=>{this.updateConfigForCustomerContactDetails()})})});i(this,"handleChangeContactDetail",t=>{const{name:a,value:s}=t.target;this.setState({[a]:s})})}componentDidMount(){this.getCountries()}render(){return e.jsx(e.Fragment,{children:e.jsxs("div",{children:[this.state.submitSpinner?e.jsxs("div",{className:"fullWindow-Spinner",children:[e.jsx("div",{children:e.jsx(w,{color:"white",children:""})}),e.jsx("div",{style:{fontSize:"16px",marginTop:"15px"},children:"Please Wait. Submitting the Form ..."})]}):null,e.jsxs("div",{className:"row companyProfileAddBody",style:this.props.outerLink?{height:"79.8vh"}:{},children:[e.jsx("div",{className:"col-md-1"}),e.jsx("div",{className:"col-md-10 ",children:e.jsxs(R,{onSelect:this.handleSelect,selectedIndex:this.state.selectedIndex,children:[e.jsxs(B,{className:"nav nav-tabs ",children:[e.jsx(j,{className:"nav-link ",children:"COMPANY DETAILS"}),e.jsx(j,{className:"nav-link ",children:"CONTACT DETAILS"}),e.jsx(j,{className:"nav-link ",children:"COMPANY LOGIN"})]}),e.jsx(S,{children:e.jsx(te,{addressLine:this.state.addressLine,addDocuments:this.addDocuments,cities:this.state.cities,citiesList:this.state.citiesList,city:this.state.city,cityId:this.state.cityId,companyLogo:this.state.companyLogo,companyName:this.state.companyName,companyShortName:this.state.companyShortName,companyWebsite:this.state.companyWebsite,countries:this.state.countries,countriesList:this.state.countriesList,country:this.state.country,countryCode:this.state.countryCode,editMode:this.props.editMode,getCities:this.getCities,handleChange:this.handleChange,handleCityChange:this.handleCityChange,handleCompanyDocuments:this.handleCompanyDocuments,handleCountryChange:this.handleCountryChange,invali
1dWebsite:this.state.invalidWebsite,removeDocuments:this.removeDocuments,shortNameAvailability:this.state.shortNameAvailability,suggestions:this.state.suggestions,tab1Error:this.state.tab1Error,taxDocument:this.state.taxDocument,isTest:this.state.isTest})}),e.jsx(S,{children:e.jsx(ae,{contactProfileImg:this.state.contactProfileImg,profileImgPreview:this.state.profileImgPreview,handleChangeContactDetail:this.handleChangeContactDetail,city:this.state.contactCity,country:this.state.contactCountry,cityId:this.state.contactCityId,countryCode:this.state.contactCountryCode,cities:this.state.cities,citiesList:this.state.citiesList,firstName:this.state.firstName,lastName:this.state.lastName,middleName:this.state.middleName,countries:this.state.countries,countriesList:this.state.countriesList,customerContactDetails:this.state.customerContactDetails,customerKycID:this.state.customerKycID,editMode:this.props.editMode,emailValidation:this.emailValidation,getCities:this.getCities,handleChangePersonProfileCityChange:this.handleChangePersonProfileCityChange,handleChangePersonProfileCountryCityChange:this.handleChangePersonProfileCountryCityChange,handleChangePersonProfileCountryChange:this.handleChangePersonProfileCountryChange,handleImageChange:this.handleImageChange,outerLink:this.props.outerLink,personProfileHandleChange:this.addPersonProfile,removeImage:this.removeImage,tab2Error:this.state.tab2Error,toggleDetails:this.toggleDetails})}),e.jsx(S,{children:e.jsx(se,{checkUsernameAvailabity:this.props.checkUsernameAvailabity,companyShortName:this.state.companyShortName,cpassword:this.state.cpassword,customerContactDetails:this.state.customerContactDetails,email:this.state.email,emailValidation:this.handleUserLoginEmailValidation,fullUsername:this.state.fullUsername,handleChange:this.handleChange,handlePassword:this.handlePassword,handleUserDesignationChange:this.handleUserDesignationChange,nameSuggestions:this.state.nameSuggestions,password:this.state.password,tab3Error:this.state.tab3Error,userDesignationId:this.state.userDesignationId,username:this.state.username,usernameAvailability:this.state.usernameAvailability,validationMessage:this.state.validationMessage})})]})}),e.jsx("div",{className:"col-md-1"})]}),e.jsx("div",{className:"row nextbutton",children:this.state.selectedIndex===1||this.state.selectedIndex===2?e.jsxs("div",{children:[e.jsx("span",{className:"mr-2",children:e.jsx(q,{handlePrevious:this.handlePreviousClick})}),this.state.selectedIndex===1?this.props.noUser===!0?e.jsx(C,{className:"button-search ml-2",id:"submit",onClick:t=>this.handleSubmit(t,this),text:this.props.editMode?"Update":"Verify"}):e.jsx(I,{handleNext:this.handleNextClick}):e.jsx(C,{className:"button-search",id:"submit",onClick:t=>this.handleSubmit(t,this),text:this.props.editMode?"Update":"Verify"})]}):e.jsxs("div",{className:"formButtons",children:[e.jsx(I,{handleNext:this.handleNextClick}),this.state.username?e.jsx(C,{className:"button-search",id:"submit",onClick:t=>this.handleSubmit(t,this),text:this.props.editMode?"Update":"Verify"}):null]})})]})})}}class re extends N.Component{constructor(){super(...arguments);i(this,"state",{insertAggrementModal:!1,aggrementList:[],currentPage:1,listSize:7,agreementExisting:"",isActiveExisting:!1,agreementId:null,updateForm:!1});i(this,"handlePageChange",t=>{this.setState({currentPage:t})});i(this,"handlePreviousPage",()=>{this.state.currentPage!==1&&this.setState(t=>({currentPage:t.currentPage-1}))});i(this,"handleNextPage",()=>{let t=this.state.currentPage+1;t>Math.ceil(this.state.aggrementList.length/this.state.pageSize)||this.setState({currentPage:t})});i(this,"handleInsertAggrementForm",()=>{this.setState({insertAggrementModal:!0,updateForm:!1})});i(this,"handleUpdateAgreementForm",(t,a)=>{this.setState({insertAggrementModal:!0,updateForm:!0},()=>{g(c.getSingleLicenseAgreement+`${a}`,s=>{s.data.success&&this.setState({agreementExisting:s.data.data.item.agreement,isActiveExisting:s.data.data.item.isActive,agreementId:a})},s=>{u(s)})})});i(this,"toggleAggrementModal",()=>{this.setState(t=>({insertAggrementModal:!t.insertAggrementModal,agreementExisting:"",isActiveExisting:!1,agreementId:null,updateForm:!1}))});i(this,"handleMakeActive",(t,a)=>{l({title:"Warning",text:"Are you sure you want to make this agreement as active ?",icon:"info",dangerMode:!1,closeOnClickOutside:!1,outsideClick:!1,buttons:{cancel:!0,
1confirm:!0}}).then(s=>{s&&v(c.agreementMakeActive,{id:a},r=>{r.data.success&&this.getAllAggrementsList()})})});i(this,"tableRow",()=>Y(this.state.aggrementList,this.state.currentPage,this.state.listSize).map((a,s)=>e.jsxs("tr",{children:[e.jsx("td",{children:ee(a.agreement)}),e.jsx("td",{children:a.isActive?e.jsx("strong",{children:"Active"}):"Inactive"}),e.jsxs("td",{children:[a.isActive?null:e.jsx(C,{id:"detail",text:"Make Active",onClick:r=>this.handleMakeActive(r,a.id)}),e.jsx(C,{id:"update",text:"Update",onClick:r=>this.handleUpdateAgreementForm(r,a.id)})]})]},s)));i(this,"getAllAggrementsList",()=>{g(c.getAllLicenseAgreement,t=>{var a,s,r;t.data.success&&this.setState({aggrementList:(r=(s=(a=t==null?void 0:t.data)==null?void 0:a.data)==null?void 0:s.items)==null?void 0:r.reverse()})},t=>{u(t)})})}componentDidMount(){this.getAllAggrementsList()}render(){let t=[...this.state.aggrementList];return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-3 ml-4",children:e.jsx(C,{id:"add",className:"add-activity marginNew",onClick:this.handleInsertAggrementForm,text:"Insert Agreement"})}),e.jsxs("div",{className:"countryTable mt-2",style:{width:"100%",overflow:"auto",height:"78.5vh"},children:[e.jsxs(M,{striped:!0,bordered:!0,children:[e.jsx("thead",{children:e.jsxs("tr",{className:"table-head",children:[e.jsx("th",{scope:"col",children:"Agreement"}),e.jsx("th",{scope:"col",children:"Status"}),e.jsx("th",{scope:"col",children:"Action"})]})}),e.jsx("tbody",{children:t.length>0?this.tableRow():e.jsx("tr",{children:e.jsx("td",{colSpan:this.state.statusForTabTow?9:8,className:"text-center",children:this.state.spinner?e.jsxs(e.Fragment,{children:[e.jsx(w,{color:"primary",children:""}),e.jsx("br",{}),"Loading Data..."]}):"No Records to show..."})})})]}),t.length>0?e.jsx(k,{itemsCount:t.length,pageSize:this.state.listSize,currentPage:this.state.currentPage,onPageChange:this.handlePageChange,previousPage:this.handlePreviousPage,nextPage:this.handleNextPage}):null]}),e.jsx(b,{modal:this.state.insertAggrementModal,className:"xl-modal",contentClassName:"xl-modal-content",toggleModal:this.toggleAggrementModal,modalHeader:this.state.agreementExisting!=""?"Update the Agreement":"Insert an Agreement",size:"lg",modalBody:e.jsx(D,{agreementExisting:this.state.agreementExisting,isActiveExisting:this.state.isActiveExisting,toggleModal:this.toggleAggrementModal,getAllAggrementsList:this.getAllAggrementsList,agreementId:this.state.agreementId,updateForm:this.state.updateForm})})]})}}class ne extends N.Component{constructor(){super(...arguments);i(this,"state",{modal:!1,insertAggrementModal:!1,allSuperAdmin:[],currentPage:1,listSize:7,superAdminView:!0,totalQueries:0,paginatedValue:10});i(this,"handlePageChange",t=>{this.setState({currentPage:t})});i(this,"handlePreviousPage",()=>{this.state.currentPage!==1&&this.setState(t=>({currentPage:t.currentPage-1}))});i(this,"handleNextPage",()=>{let t=this.state.currentPage+1;t>Math.ceil(this.state.allSuperAdmin.length/this.state.pageSize)||this.setState({currentPage:t})});i(this,"tableRow",()=>this.state.allSuperAdmin.map((t,a)=>e.jsxs("tr",{children:[e.jsx("td",{children:t.companyName}),e.jsx("td",{children:t.companyWebsite}),e.jsx("td",{children:t.enabled?"Enabled":"Disabled"}),e.jsx("td",{children:e.jsxs("div",{className:"superAdmin_toggle",children:[e.jsx("div",{className:"mr-3",children:t.enabled?"Disable":e.jsx("strong",{children:"Disable"})}),e.jsxs("label",{className:"switch mb-2",children:[e.jsx("input",{type:"checkbox",onChange:()=>this.handleEnableDisable(t.id),defaultChecked:t.enabled}),e.jsx("span",{className:"slider round"})]}),e.jsx("div",{className:"ml-2",children:t.enabled?e.jsx("strong",{children:"Enable"}):"Enable"})]})})]},a)));i(this,"closeModal",()=>{this.setState({modal:!1})});i(this,"handleAddBtnClick",()=>{this.setState({modal:!0})});i(this,"handleInsertAggrementForm",()=>{this.setState({insertAggrementModal:!0})});i(this,"toggleModal",()=>{this.setState(t=>({modal:!t.modal}))});i(this,"toggleAggrementModal",()=>{this.setState(t=>({insertAggrementModal:!t.insertAggrementModal}))});i(this,"handleEnableDisable",t=>{let s=[...this.state.allSuperAdmin].filter(r=>r.id===t);s[0].enabled?g(c.disableSuperAdmin+`/${t}`,r=>{r.data.success&&(l("Success",`${s[0].companyName} is disabled.`,"success"),this.getAllSuperAdmin())}):g(c.enableSuperAdmin+`/${t}`,r=>{r.data.success&&(l("Success",`${s[0].companyName} is enabled.`,"success"),this.getAllSuperAdmin())})});i(this,"getAllSuperAdmin",(t,a)=>{let s={page:t||this.state.currentPage,paginatedValue:a||this.state.paginatedValue};this.setState({spinner:!0}),v(c.superAdminPost,s,r=>{r.data.success&&this.setState({allSuperAdmin:r.data.data.items,totalQuer
1ies:r.data.data.total,spinner:!1})},r=>{u(r),this.setState({spinner:!1})})});i(this,"handleSuperAdminToggle",()=>{this.setState({superAdminView:!0})});i(this,"handleAgreementToggle",()=>{this.setState({superAdminView:!1})});i(this,"handleNextPage",()=>{let t=this.state.currentPage+1;t>Math.ceil(this.state.totalQueries/this.state.pageSize)||t===0||this.setState({currentPage:t},()=>{this.getAllSuperAdmin()})});i(this,"handlePreviousPage",()=>{let t=this.state.currentPage-1;t<1||this.setState({currentPage:t},()=>{this.getAllSuperAdmin()})});i(this,"handlePaginationChange",t=>{const a=t.target.value;this.setState({paginatedValue:a,pageSize:a,currentPage:1},()=>{this.getAllSuperAdmin()})});i(this,"handlePageChange",t=>{this.state.currentPage,this.setState({currentPage:t},()=>{this.getAllSuperAdmin()})})}componentDidMount(){this.getAllSuperAdmin()}render(){let t=[...this.state.allSuperAdmin];return e.jsxs(e.Fragment,{children:[e.jsx(Z,{from:"super-super-admin"}),e.jsx(X,{modules:[]}),e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"row m-0 superAdminContainer",children:[e.jsx("div",{className:"col",onClick:this.handleSuperAdminToggle,children:"SuperAdmins"}),e.jsx("div",{className:"col",onClick:this.handleAgreementToggle,children:"Agreements"})]}),e.jsx("div",{className:"border mt-2",children:this.state.superAdminView?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-3 ml-4",children:e.jsx(C,{id:"add",className:"add-activity marginNew",onClick:this.handleAddBtnClick,text:"Add"})}),e.jsxs("div",{className:"countryTable mt-2",style:{width:"100%",overflow:"auto",height:"78.5vh"},children:[e.jsxs(M,{striped:!0,bordered:!0,children:[e.jsx("thead",{children:e.jsxs("tr",{className:"table-head",children:[e.jsx("th",{scope:"col",children:"Company Name"}),e.jsx("th",{scope:"col",children:"Website"}),e.jsx("th",{scope:"col",children:"Status"}),e.jsx("th",{scope:"col",children:"Action"})]})}),e.jsx("tbody",{children:t.length>0&&this.state.spinner?e.jsx("tr",{children:e.jsxs("td",{colSpan:this.state.statusForTabTow?9:8,className:"text-center",children:[e.jsx(w,{color:"primary",children:""}),e.jsx("br",{}),"Loading Data..."]})}):t.length<=0&&!this.state.spinner?e.jsx("tr",{children:e.jsx("td",{colSpan:this.state.statusForTabTow?9:8,className:"text-center",children:"'No Records to show...'"})}):this.tableRow()})]}),t.length>0?e.jsx(k,{itemsCount:this.state.totalQueries,pageSize:this.state.paginatedValue,currentPage:this.state.currentPage,onPageChange:this.handlePageChange,previousPage:this.handlePreviousPage,nextPage:this.handleNextPage,handlePaginationChange:this.handlePaginationChange,moduleName:"pageRange"}):null]})]}):e.jsx(re,{})}),e.jsx(b,{modal:this.state.modal,className:"xl-modal",contentClassName:"xl-modal-content",toggleModal:this.toggleModal,modalHeader:"Registration Form",size:"lg",modalBody:e.jsx(ie,{getAllSuperAdmin:this.getAllSuperAdmin,toggleModal:this.toggleModal})}),e.jsx(b,{modal:this.state.insertAggrementModal,className:"xl-modal",contentClassName:"xl-modal-content",toggleModal:this.toggleAggrementModal,modalHeader:"Insert an aggrement",size:"lg",modalBody:e.jsx(D,{toggleModal:this.toggleAggrementModal})})]})]})}}const Be=V(ne);export{Be 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.