1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[11165],{11165:function(e,t,n){n.r(t),n.d(t,{SignaturePanel:function(){return g}});var o=n(57437),i=n(2265);let a=(0,n(30166).default)(()=>n.e(31114).then(n.bind(n,31114)).then(e=>e.SignaturePad),{loadableGenerated:{webpack:()=>[31114]},ssr:!1}),r="#15181D",l="#565A62",s="#9A7526",d="#2E5B4E",c="#7A3B34",u="#E3DED2",p="Optima, Candara, 'Gill Sans', 'Segoe UI', sans-serif",f="Didot, 'Bodoni MT', 'Playfair Display', Georgia, serif";function g(e){let{applicationId:t}=e,[n,g]=(0,i.useState)(!1),[h,y]=(0,i.useState)(!1),[x,b]=(0,i.useState)([]),[m,S]=(0,i.useState)(null),[w,j]=(0,i.useState)(null),[v,k]=(0,i.useState)(null),[C,E]=(0,i.useState)(!1),[z,F]=(0,i.useState)("drawn"),[A,D]=(0,i.useState)(null),[W,T]=(0,i.useState)(""),[R,I]=(0,i.useState)(!1),[N,B]=(0,i.useState)(""),[O,P]=(0,i.useState)(!1),H=(0,i.useCallback)(async()=>{S(null);try{var e;let n=await fetch("/api/lucaria/portal/signatures",{cache:"no-store"}),o=await n.json();if(!o.ok)throw Error(null!==(e=o.error)&&void 0!==e?e:"Could not load signature requests");let i=o.data.envelopes;b(i.filter(e=>e.envelope.subjectId===t)),y(!0)}catch(e){S(e instanceof Error?e.message:"Could not load signature requests")}},[t]);function U(){j(null),k(null),E(!1),F("drawn"),D(null),T(""),P(!1),B("")}let _=(0,i.useCallback)(async e=>{U(),j(e),S(null);try{var t;let n=await fetch("/api/lucaria/portal/signatures/".concat(e),{cache:"no-store"}),o=await n.json();if(!o.ok)throw Error(null!==(t=o.error)&&void 0!==t?t:"Could not open document");k(o.data),fetch("/api/lucaria/portal/signatures/".concat(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({action:"view"})})}catch(e){S(e instanceof Error?e.message:"Could not open document"),j(null)}},[]),q="drawn"===z?!!A:W.trim().length>=2,G=C&&q&&!R;async function J(){if(w&&G){I(!0),S(null);try{var e;await fetch("/api/lucaria/portal/signatures/".concat(w),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({action:"consent"})});let t=await fetch("/api/lucaria/portal/signatures/".concat(w),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({action:"sign",signatureKind:z,signatureData:"drawn"===z?A:W.trim()})}),n=await t.json();if(!n.ok)throw Error(null!==(e=n.error)&&void 0!==e?e:"Could not submit signature");U(),await H()}catch(e){S(e instanceof Error?e.message:"Could not submit signature")}finally{I(!1)}}}async function L(){if(w&&!R){I(!0),S(null);try{var e;let t=await fetch("/api/lucaria/portal/signatures/".concat(w),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({action:"decline",reason:N.trim()||void 0})}),n=await t.json();if(!n.ok)throw Error(null!==(e=n.error)&&void 0!==e?e:"Could not decline");U(),await H()}catch(e){S(e instanceof Error?e.message:"Could not decline")}finally{I(!1)}}}let M=x.filter(e=>"sent"===e.myStatus||"viewed"===e.myStatus).length;return(0,o.jsxs)("section",{style:{marginTop:20,background:"#FBFAF5",border:"1px solid ".concat(u),borderRadius:6,overflow:"hidden"},children:[(0,o.jsxs)("button",{type:"button",onClick:function(){let e=!n;g(e),e&&!h&&H()},style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,background:"none",border:"none",cursor:"pointer",fontFamily:p,padding:"14px 18px",textAlign:"left"},children:[(0,o.jsxs)("span",{style:{fontFamily:f,fontSize:18,color:r},children:["Documents to sign",M>0?(0,o.jsx)("span",{style:{marginLeft:10,fontFamily:p,fontSize:12,fontWeight:700,color:"#fff",background:c,borderRadius:10,padding:"2px 9px",verticalAlign:"middle"},children:M}):null]}),(0,o.jsx)("span",{style:{fontSize:13,color:s,fontWeight:700},children:n?"Hide â¾":"Open â¸"})]}),n?(0,o.jsxs)("div",{style:{padding:"0 18px 18px"},children:[m?(0,o.jsx)("div",{style:{fontSize:12,color:c,marginBottom:10},children:m}):null,h?0===x.length?(0,o.jsx)("div",{style:{fontSize:13,color:l},children:"No documents are waiting for your signature on this deal."}):(0,o.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:10},children:x.map(e=>{let{envelope:t,myStatus:n}=e,i=function(e){switch(e){case"completed":return{label:"Signed",bg
1:"#E7EFEA",fg:d};case"declined":return{label:"Declined",bg:"#F2E6E4",fg:c};case"viewed":return{label:"Awaiting your signature",bg:"#F3ECD9",fg:s};default:return{label:"Signature requested",bg:"#F3ECD9",fg:s}}}(n),g="sent"===n||"viewed"===n,h=w===t.id;return(0,o.jsxs)("li",{style:{border:"1px solid ".concat(h?s:u),borderRadius:6,background:"#fff",overflow:"hidden"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 14px",flexWrap:"wrap"},children:[(0,o.jsxs)("div",{style:{flex:1,minWidth:180},children:[(0,o.jsx)("div",{style:{fontSize:14,fontWeight:700,color:r},children:t.documentName}),(0,o.jsxs)("div",{style:{fontSize:12,color:l,marginTop:2},children:["Sent ",function(e){if(!e)return"â";try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch(t){return e}}(t.createdAt)]})]}),(0,o.jsx)("span",{style:{fontSize:11,fontWeight:700,color:i.fg,background:i.bg,borderRadius:10,padding:"3px 10px",whiteSpace:"nowrap"},children:i.label}),g?(0,o.jsx)("button",{type:"button",onClick:()=>h?U():void _(t.id),style:{background:h?"none":s,color:h?s:"#fff",border:h?"1px solid ".concat(s):"none",borderRadius:3,padding:"7px 16px",fontSize:13,fontWeight:700,cursor:"pointer",fontFamily:p},children:h?"Close":"Review & sign"}):null]}),h&&v?(0,o.jsxs)("div",{style:{borderTop:"1px solid ".concat(u),padding:"14px",background:"#F6F3EC"},children:[v.documentUrl?(0,o.jsx)("a",{href:v.documentUrl,target:"_blank",rel:"noreferrer",style:{fontSize:13,color:d,fontWeight:700,textDecoration:"underline"},children:"Open the document to review â"}):(0,o.jsx)("span",{style:{fontSize:13,color:l},children:"Document preview unavailable."}),(0,o.jsxs)("label",{style:{display:"flex",gap:10,alignItems:"flex-start",margin:"14px 0",fontSize:12.5,color:r,lineHeight:1.5,cursor:"pointer"},children:[(0,o.jsx)("input",{type:"checkbox",checked:C,onChange:e=>E(e.target.checked),style:{marginTop:2}}),(0,o.jsx)("span",{children:"I agree to sign this document electronically. My electronic signature is the legal equivalent of my handwritten signature under the U.S. ESIGN Act and UETA, and I consent to conduct this transaction electronically."})]}),(0,o.jsx)("div",{style:{display:"flex",gap:8,marginBottom:10},children:["drawn","typed"].map(e=>(0,o.jsx)("button",{type:"button",onClick:()=>F(e),style:{background:z===e?r:"transparent",color:z===e?"#fff":l,border:"1px solid ".concat(z===e?r:u),borderRadius:3,padding:"5px 14px",fontSize:12,fontWeight:700,cursor:"pointer",fontFamily:p},children:"drawn"===e?"Draw":"Type"},e))}),"drawn"===z?(0,o.jsx)(a,{onChange:D}):(0,o.jsx)("div",{children:(0,o.jsx)("input",{value:W,onChange:e=>T(e.target.value),placeholder:"Type your full legal name",style:{width:"100%",border:"1px solid ".concat(u),borderRadius:4,padding:"10px 12px",fontFamily:f,fontStyle:"italic",fontSize:24,color:r,background:"#fff"}})}),(0,o.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:14,flexWrap:"wrap"},children:[(0,o.jsx)("button",{type:"button",onClick:J,disabled:!G,style:{background:G?d:"#A9BCB2",color:"#fff",border:"none",borderRadius:3,padding:"10px 22px",fontSize:13,fontWeight:700,cursor:G?"pointer":"default",fontFamily:p},children:R?"Submittingâ¦":"Adopt & sign"}),(0,o.jsx)("button",{type:"button",onClick:()=>P(e=>!e),style:{background:"none",border:"none",color:c,cursor:"pointer",fontFamily:p,fontSize:12.5,fontWeight:700},children:"Decline to sign"}),C?null:(0,o.jsx)("span",{style:{fontSize:11.5,color:l},children:"Check the consent box to enable signing."})]}),O?(0,o.jsxs)("div",{style:{marginTop:12,display:"flex",gap:8,alignItems:"flex-end",flexWrap:"wrap"},children:[(0,o.jsx)("input",{value:N,onChange:e=>B(e.target.value),placeholder:"Reason (optional)",style:{flex:1,minWidth:180,border:"1px solid ".concat(u),borderRadius:4,padding:"8px 10px",fontFamily:p,fontSize:13,color:r,background:"#fff"}}),(0,o.jsx)("button",{type:"button",onClick:L,disabled:R,style:{background:c,color:"#fff",border:"none",borderRadius:3,padding:"8px 18px",fontSize:13,fontWeight:700,cursor:R?"default":"pointer",fontFamily:p},children:"Confirm decline"})]}):null]}):null]},t.id)})}):(0,o.jsx)("div",{style:{fontSize:13,color:l},children:"Loadingâ¦"})]}):null]})}t.default=g}}]);
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.