1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2919],{21536:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(37876),l=s(14232),r=s(89099),n=s(91040),i=s(83202),o=s(42005),d=s(29056),u=s(51671),c=s(35944);function p(){let e=(0,r.useRouter)(),t="string"==typeof e.query.application_id?e.query.application_id:"",[s,p]=(0,l.useState)(""),[m,h]=(0,l.useState)(null),[x,_]=(0,l.useState)(!0),[f,v]=(0,l.useState)(""),[b,E]=(0,l.useState)({});(0,l.useEffect)(()=>p((0,c.AF)()),[]);let{uploadSlotEager:N,docUploadStatus:j,docUploadError:y}=(0,o.L)({INSURANCE_API_URL:s,applicationId:t});(0,l.useEffect)(()=>{if(!e.isReady||!s)return;if(!t){v("Missing application_id in the URL."),_(!1);return}let a=!1;return _(!0),n.A.post("".concat(s,"/v1/applications/pending"),{application_id:t}).then(e=>{var t,s;a||((null==(t=e.data)?void 0:t.success)?(h(e.data),v("")):v((null==(s=e.data)?void 0:s.message)||"Application not found."))}).catch(e=>{var t,s;return!a&&v((null==e||null==(s=e.response)||null==(t=s.data)?void 0:t.detail)||"Could not load this application.")}).finally(()=>!a&&_(!1)),()=>{a=!0}},[e.isReady,t,s]);let g=(0,l.useMemo)(()=>m?(0,u.Sv)(m,{}):{},[m]),S=(0,l.useMemo)(()=>(0,d.Z)(g),[g]),w=(0,l.useMemo)(()=>{let e=e=>"success"===e?"uploaded":"failed"===e?"failed":void 0,t={},s={},a={};return Object.entries((null==m?void 0:m.document_status)||{}).forEach(l=>{let[r,n]=l,i=e(null==n?void 0:n.status);i&&(t[r]=i),(null==n?void 0:n.status)==="failed"&&(null==n?void 0:n.error)&&(s[r]=n.error);let o={};Object.entries((null==n?void 0:n.pages)||{}).forEach(t=>{let[s,a]=t,l=e(null==a?void 0:a.status);l&&(o[s]=l)}),Object.keys(o).length&&(a[r]=o)}),{status:t,errors:s,sideStatus:a}},[m]);return(0,a.jsx)("div",{className:"min-h-screen bg-[#F8F7FC] py-8 px-4",children:(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"bg-white border border-[#DFE1E6] rounded-2xl p-5 sm:p-6",children:[(0,a.jsxs)("div",{className:"border-b border-[#ECECF2] pb-4 mb-5",children:[(0,a.jsx)("h1",{className:"text-lg font-bold text-[#1E1E1E]",children:"Submit Documents"}),m&&(0,a.jsxs)("p",{className:"mt-1 text-sm text-[#636E72]",children:[m.plan_name||"Term plan",m.provider_name?" \xb7 ".concat(m.provider_name):"",m.policy_number?" \xb7 Proposal ".concat(m.policy_number):""]}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[#94A3B8]",children:"Files upload as you pick them. If the insurer rejects a document (OCR check), the error shows below that slot â re-pick a clearer file to retry."})]}),x?(0,a.jsx)("p",{className:"text-sm text-[#636E72] py-8 text-center",children:"Loading applicationâ¦"}):f?(0,a.jsx)("p",{className:"text-sm text-red-600 bg-red-50 rounded-lg px-3 py-3",children:f}):(0,a.jsx)(i.A,{documentFiles:b,onDocumentFilesChange:e=>{E(e),Object.keys(e).forEach(t=>{e[t]!==b[t]&&N(t,e[t])})},uploadStatus:{...w.status,...j},uploadErrors:{...w.errors,...y},sideStatus:w.sideStatus,derivedRequirements:S})]})})})}},92164:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/term-documents",function(){return s(21536)}])}},e=>{var t=t=>e(e.s=t);e.O(0,[8659,4718,1531,636,8792],()=>t(92164)),_N_E=e.O()}]);
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.