%PDF- %PDF-
Direktori : /home/opti/www/startup-life/assets/ |
Current File : /home/opti/www/startup-life/assets/CompanyDocs-378df1ac.js |
import{r as d,F as J,j as a,C as R,P as l,e as v,A as w,Q as F}from"./index-5492fbe1.js";import{I as N}from"./index-fbb310b5.js";import{F as T}from"./index-f8259600.js";import{s as G}from"./styled-components.browser.esm-ee37ee23.js";import{B as C}from"./Box-263f925f.js";import{G as s}from"./Grid-edacc4c9.js";const U=G.div` position: relative; min-height: 100vh; .pageContain { padding-left: 1.94rem; padding-top: 1rem; padding-right: 3.25rem; padding-bottom: 15rem; } .PageHero { color: var(--Secondary, #537473); font-size: 1.125rem; font-style: normal; font-weight: 700; line-height: normal; } .backBtn { width: 19.8125rem; height: 3.0625rem; border-radius: 0.5rem; background: #EFF0F6; color: var(--dark-icon, #121212); font-size: 1rem; font-style: normal; font-weight: 600; line-height: normal; } .proceedBtn { width: 19.8125rem; height: 3.0625rem; border-radius: 0.5rem; background: var(--Primary, #A8CF45); color: #FFF; font-size: 1rem; font-style: normal; font-weight: 600; line-height: normal; } .docTitle { color: var(--Gray-3, #828282); font-size: 0.75rem; font-style: normal; font-weight: 400; line-height: normal; margin-bottom: 1rem; } .uploadHeader { color: var(--dark-icon, #121212); font-size: 1rem; font-style: normal; font-weight: 500; line-height: 1.6875rem; /* 168.75% */ margin-bottom: 2rem; } .dragdroptext01 { color: var(--dark-icon, #121212); font-size: 1.125rem; font-style: normal; font-weight: 500; line-height: 1.3125rem; text-align: center; } .dragdroptext01 span { color: var(--Primary, #A8CF45); } .dragdroptext02 { color: var(--dark-icon, #121212); text-align: center; font-size: 0.875rem; font-style: normal; font-weight: 500; line-height: 0.9375rem; /* 107.143% */ } .director { color: var(--sub, #242424); font-size: 1.125rem; font-style: normal; font-weight: 500; line-height: 1.25rem; /* 111.111% */ } .countryListing { list-style: none; height: 100%; padding: 0 1.25rem 8rem 1.25rem; } .countryListing li { padding: 1rem 0; display: flex; justify-content: space-between; align-items: center; } .countriesLabel { color: var(--Gray-3, #828282); font-size: 0.75rem; font-style: normal; font-weight: 400; line-height: normal; margin: .8rem; padding-left: .7rem; } .countryListing img { width: 1.25rem; height: 1.25rem; } .logoImage { width: 6rem; height: 6rem; } .btn { border-radius: 0.5rem; white-space: nowrap; font-size: 1rem; font-style: normal; font-weight: 600; line-height: normal; width: 100%; height: 2.8125rem; } .saveDocBtn { background: var(--Primary, #A8CF45); color: #FFF; } `,V={boxShadow:"none"},W={width:"fit-content"},z=()=>{var p;const[o,g]=d.useState({}),[S,h]=d.useState(null),{country:u,id:I}=J(),k=async()=>{await v.get(w+`/startup/${I}`).then(t=>{var n,r;console.log("startjrd",t);let e=(r=(n=t==null?void 0:t.data)==null?void 0:n.data)==null?void 0:r.find(i=>(i==null?void 0:i.country)===u);g(e??{})}).catch(t=>{var e,n;F.error((n=(e=t.response)==null?void 0:e.data)==null?void 0:n.message)})};d.useEffect(()=>{k()},[]);const P=async(t,e)=>{var r;t.preventDefault();const n={juridictionId:e==null?void 0:e.jurisdictionId,name:e==null?void 0:e.name,document:e==null?void 0:e.url};h(e==null?void 0:e.id),await((r=v)==null?void 0:r.put(w+`/update-juridiction/${e==null?void 0:e.jurisdictionId}`,n).then(i=>{var m;console.log("rr",i),F.success((m=i.data)==null?void 0:m.message),h(null)}).catch(i=>{h(null),console.log("poa",i)}))},A=(t,e)=>{var i,m,f,x;const{files:n}=t.target,r=y=>{let c=new FileReader;y&&(c.readAsDataURL(y),c.onload=()=>{const b=o==null?void 0:o.documents,B={...o==null?void 0:o.documents[e],document:c.result.split("base64,")[1],url:c.result.split("base64,")[1]};b[e]=B,g({...o,documents:b})})};((i=n[0])==null?void 0:i.size)<=2e6&&(((m=n[0])==null?void 0:m.type)==="image/jpeg"||((f=n[0])==null?void 0:f.type)==="image/png"||((x=n[0])==null?void 0:x.type)==="application/pdf")&&r(n[0]),t.target.value=null},E=(t,e)=>{const n=o==null?void 0:o.documents,r={...o==null?void 0:o.documents[e],name:t.target.value};n[e]=r,g({...o,documents:n})},L=d.useRef();return a.jsx(U,{children:a.jsx(C,{sx:{pt:"2.31rem",position:"relative"},children:a.jsx("div",{className:"pageContain",children:a.jsx(s,{container:!0,spacing:8,children:a.jsx(s,{item:!0,md:10,children:a.jsxs(C,{sx:{mb:"3rem"},children:[u&&a.jsxs("p",{className:"docTitle",children:["Upload registered documents (",u,")"," "]}),a.jsx(s,{container:!0,children:(p=o==null?void 0:o.documents)==null?void 0:p.map((t,e)=>a.jsxs(s,{container:!0,spacing:4,children:[a.jsx(s,{item:!0,md:5,sx:{mb:"1.5rem"},children:a.jsx(N,{name:"juridoc",label:"Enter Document Name",value:t==null?void 0:t.name,onChange:n=>E(n,e),rules:{}})}),a.jsx(s,{item:!0,xs:12,md:7,sx:{mb:"1.31rem"},children:a.jsxs(s,{container:!0,spacing:2,alignItems:"center",children:[a.jsx(s,{item:!0,xs:9,children:a.jsx(T,{label:"Upload Document",name:"doc",handleFileChange:n=>A(n,e),inputRef:L,doc:t==null?void 0:t.url})}),a.jsx(s,{item:!0,xs:3,children:a.jsx("button",{onClick:n=>P(n,t),className:"saveDocBtn btn",children:S===(t==null?void 0:t.id)?a.jsx(R,{color:"inherit",size:20}):"Save"})})]})})]},e))})]})})})})})})};z.propTypes={documents:l.any,setDocuments:l.func,country:l.string,setCountry:l.func,watch:l.any,setValue:l.any,control:l.any};const q=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));export{V as A,q as C,z as E,U as M,W as a};