PageSourceSearch

https://www.elevolt.co.ke/_next/static/chunks/pages/download-document/[id]-6390acfc27e612ca.js

js elevolt.co.ke collected 2026-10-04 21:46:56 UTC 11,074 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="05db6a5f-4857-43f4-8c22-9f9d7591bfb3",e._sentryDebugIdIdentifier="sentry-dbid-05db6a5f-4857-43f4-8c22-9f9d7591bfb3")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9272],{22929:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/download-document/[id]",function(){return t(21170)}])},21170:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return L}});var o=t(52322),s=t(47023),r=t(1973),l=t(59820),i=t(60418),a=t(47477),d=t(82036),c=t(84475);let u=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"".concat(d.JW,"signing/ext/").concat(e).concat(n?"/".concat(n):"")},m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"".concat(d.JW,"tenant/").concat((0,a.d_)(),"/").concat(e)},g={EXPIRED:"expired",INVALID:"invalid",NOT_FOUND:"not_found",NOT_COMPLETED:"not_completed",UNAUTHORIZED:"unauthorized",SERVER_ERROR:"server_error"},x=e=>{var n,t,o,s,r;let l=null==e?void 0:null===(n=e.response)||void 0===n?void 0:n.status,i=((null==e?void 0:null===(o=e.response)||void 0===o?void 0:null===(t=o.data)||void 0===t?void 0:t.error)||(null==e?void 0:null===(r=e.response)||void 0===r?void 0:null===(s=r.data)||void 0===s?void 0:s.message)||"").toLowerCase();return(null==e?void 0:e.response)?401===l||403===l?i.includes("expired")?g.EXPIRED:i.includes("invalid")?g.INVALID:g.UNAUTHORIZED:404===l?g.NOT_FOUND:410===l?g.EXPIRED:400===l?i.includes("not")&&i.includes("completed")?g.NOT_COMPLETED:(i.includes("token"),g.INVALID):g.SERVER_ERROR:g.SERVER_ERROR},f=e=>{let n={[g.EXPIRED]:{title:"Link Expired",message:"This download link has expired. Please request a new one from the sender."},[g.INVALID]:{title:"Invalid Link",message:"This download link is invalid. Please check the link or contact the sender."},[g.NOT_FOUND]:{title:"Document Not Found",message:"This document could not be found. It may have been deleted."},[g.NOT_COMPLETED]:{title:"Signing Not Complete",message:"This document cannot be downloaded yet. All signers must complete signing first."},[g.UNAUTHORIZED]:{title:"Access Denied",message:"You are not authorized to download this document."},[g.SERVER_ERROR]:{title:"Something Went Wrong",message:"An error occurred while preparing your download. Please try again."}};return n[e]||n[g.SERVER_ERROR]},b=e=>{let{requestId:n,enabled:t=!0}=e,o=(0,a.d_)();return(0,l.a)({queryKey:["documentDownload","authenticated",n],queryFn:async()=>{var e;return null===(e=(await i.Z.get(m("signature-requests/".concat(n,"/download")),{headers:(0,c.g0)({realm:"hr"})})).data)||void 0===e?void 0:e.data},enabled:!!n&&!!o&&t&&(0,a.Xu)(),staleTime:3e5,retry:!1,refetchOnWindowFocus:!1,meta:{expected404:!0}})},h=e=>{let{requestId:n,token:t,enabled:o=!0}=e;return(0,l.a)({queryKey:["documentDownload","external",n,t],queryFn:async()=>{var e;return null===(e=(await i.Z.get(u(n,"download"),{params:{token:t}})).data)||void 0===e?void 0:e.data},enabled:!!n&&!!t&&o&&(0,a.Xu)(),staleTime:3e5,retry:!1,refetchOnWindowFocus:!1,meta:{expected404:!0}})};var w=t(20270),N=t(59417),p=t(99603),y=t(97729),E=t.n(y),R=t(5632),j=t(13980),v=t.n(j),D=t(2784);let O={LOADING:"loading",READY:"ready",DOWNLOADING:"downloading",SUCCESS:"success",ERROR:"error"},I={[g.EXPIRED]:{icon:N.nYk,iconColor:"text-red-500",bgColor:"bg-red-100"},[g.INVALID]:{icon:N.nYk,iconColor:"text-red-500",bgColor:"bg-red-100"},[g.NOT_FOUND]:{icon:N.cwv,iconColor:"text-gray-500",bgColor:"bg-gray-100"},[g.NOT_COMPLETED]:{icon:N.eHv,iconColor:"text-amber-500",bgColor:"bg-amber-100"},[g.UNAUTHORIZED]:{icon:N.nYk,iconColor:"text-red-500",bgColor:"bg-red-100"},[g.SERVER_ERROR]:{icon:N.eHv,iconColor:"text-red-500",bgColor:"bg-red-100"}},_=e=>{let{icon:n,iconColor:t,bgColor:s,title:r,message:l,action:i}=e;return(0,o.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,o.jsxs)("div",{className:"max-w-md w-full bg-white rounded-xl shadow-lg p-8 text-center",children:[(0,o.jsx)("div",{className:"w-16 h-16 ".concat(s," rounded-full flex items-center justify-center mx-auto mb-4"),children:(0,o.jsx)(p.G,{className:"".concat(t," text-2xl"),icon:n})}),(0,o.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:r}),(0,o.jsx)("p",{className:"text-gray-600 mb-6",children:l}),!!i&&i]})})};_.propTypes={icon:v().object.isRequired,iconColor:v().string.isRequired,bgColor:v().string.isRequired,title:v().string.isRequired,message:v().string.isRequired,action:v().node};let C=e=>{let{filename:n,onDownload:t,isDownloading:r}=e;return(0,o.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,o.jsxs)("div",{className:"max-w-md w-full bg-white rounded-xl shadow-lg p-8 text-center",children:[(0,o.jsx)("div",{className:"w-20 h-20 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-6",children:(0,o.jsx)(p.G,{className:"text-blue-500 text-3xl",icon:N.cwv})}),(0,o.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Your Document is Ready"}),(0,o.jsx)("p",{className:"text-gray-600 mb-2",children:n||"Signed Document"}),(0,o.jsx)("p",{className:"text-sm text-gray-500 mb-6",children:"Click the button below to download your signed document."}),(0,o.jsxs)(s.Z,{className:"w-full",design:"primary",disabled:r,onClick:t,size:"lg",children:[(0,o.jsx)(p.G,{className:"mr-2",icon:N.q7m}),r?"Starting Download...":"Download Document"]})]})})};C.propTypes={filename:v().string,onDownload:v().func.isRequired,isDownloading:v().bool};let T=e=>{let{filename:n}=e;return(0,o.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,o.jsxs)("div",{className:"max-w-md w-full bg-white rounded-xl shadow-lg p-8 text-center",children:[(0,o.jsx)("div",{className:"w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6",children:(0,o.jsx)(p.G,{className:"text-green-500 text-3xl",icon:N.f8k})}),(0,o.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Download Started"}),(0,o.jsxs)("p",{className:"text-gray-600 mb-6",children:[n||"Your document"," should begin downloading automatically."]}),(0,o.jsx)("p",{className:"text-sm text-gray-500",children:"You can close this page."})]})})};T.propTypes={filename:v().string};var L=()=>{let e=(0,R.useRouter)(),{id:n,token:t}=e.query,[l,i]=(0,D.useState)(O.LOADING),[a,d]=(0,D.useState)(null),{data:c,isLoading:u}=(0,w.uS)({enabled:!0}),m=!!(null==c?void 0:c.uid),N=!!t||!m&&!u,{data:p,isLoading:y,error:j}=b({requestId:n,enabled:!!n&&m&&!u}),{data:v,isLoading:L,error:A}=h({requestId:n,token:t,enabled:!!n&&!!t&&N}),S=N?v:p,k=u||y||L,P=N?A:j;(0,D.useEffect)(()=>
1{if(!u){if(k){i(O.LOADING);return}if(P){i(O.ERROR),d(x(P));return}(null==S?void 0:S.download_url)&&i(O.READY)}},[u,k,P,S]);let U=(0,D.useCallback)(()=>{if(!(null==S?void 0:S.download_url))return;i(O.DOWNLOADING);let e=document.createElement("a");e.href=S.download_url,e.download=S.filename||"signed-document.pdf",e.target="_blank",e.rel="noopener noreferrer",document.body.appendChild(e),e.click(),document.body.removeChild(e),setTimeout(()=>{i(O.SUCCESS)},500)},[S]),q=(0,D.useCallback)(()=>{e.reload()},[e]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(E(),{children:[(0,o.jsx)("title",{children:"Download Document - Elevolt"}),(0,o.jsx)("meta",{content:"Download your signed document securely",name:"description"}),(0,o.jsx)("meta",{content:"noindex,nofollow",name:"robots"})]}),(()=>{switch(l){case O.LOADING:return(0,o.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,o.jsx)(r.Z,{isLoading:!0,message:"Preparing your download..."})});case O.READY:case O.DOWNLOADING:return(0,o.jsx)(C,{filename:null==S?void 0:S.filename,isDownloading:l===O.DOWNLOADING,onDownload:U});case O.SUCCESS:return(0,o.jsx)(T,{filename:null==S?void 0:S.filename});case O.ERROR:{let e=I[a]||I[g.SERVER_ERROR],n=f(a);return(0,o.jsx)(_,{action:a===g.SERVER_ERROR&&(0,o.jsx)(s.Z,{design:"secondary",onClick:q,children:"Try Again"}),bgColor:e.bgColor,icon:e.icon,iconColor:e.iconColor,message:n.message,title:n.title})}default:return null}})()]})}},1973:function(e,n,t){"use strict";var o=t(52322),s=t(2369),r=t(92942),l=t(13980),i=t.n(l);t(2784);var a=t(42369);let d=e=>{let{items:n,message:t,description:l,icon:i,showIcon:a,action:d}=e;return(0,o.jsxs)("div",{className:"w-full h-full flex justify-center items-center flex-col p-8",children:[!!a&&(0,o.jsx)(r.FontAwesomeIcon,{className:"text-gray-400 mb-2 text-3xl",icon:i||s.wK3,size:"xl"}),!!n&&(0,o.jsxs)("p",{className:"text-gray-500 text-center font-medium",children:["We couldn't load any ",n,"."]}),!!t&&(0,o.jsx)("p",{className:"text-gray-500 text-center font-medium",children:t}),!!l&&(0,o.jsx)("p",{className:"text-gray-400 text-center text-sm mt-1",children:l}),!!d&&(0,o.jsx)("div",{className:"mt-4",children:d})]})};d.propTypes={showIcon:i().bool,items:i().string,message:i().string,description:i().string,icon:i().object,action:i().node};let c=e=>{let{className:n,isLoading:t,action:l,items:i,message:c,description:u,icon:m,showIcon:g,isError:x}=e;return(0,o.jsxs)("div",{className:"w-full bg-transparent text-center flex flex-col items-center ".concat(n),children:[!t&&!x&&(0,o.jsx)(d,{action:l,description:u,icon:m,items:i,message:c,showIcon:g}),!t&&!!x&&(0,o.jsxs)("div",{className:"w-full flex flex-col justify-center items-center text-red-500",children:[(0,o.jsx)(r.FontAwesomeIcon,{className:"mb-2",icon:s.eHv,size:"xl"}),(0,o.jsx)("p",{className:"text-center font-medium",children:c||"An error occurred loading ".concat(null!=i?i:"data","...")}),!!u&&(0,o.jsx)("p",{className:"text-red-400 text-center text-sm mt-1",children:u}),!!l&&(0,o.jsx)("div",{className:"mt-4",children:l})]}),!!t&&(0,o.jsx)("div",{className:"w-full flex justify-center items-center",children:(0,o.jsx)(a.Z,{size:"sm"})})]})};c.propTypes={items:i().string,message:i().string,description:i().string,icon:i().object,action:i().node,className:i().string,showIcon:i().bool,isLoading:i().bool,isError:i().bool};let u=e=>{let{items:n,message:t,description:s,icon:r,action:l,className:i,showIcon:a=!0,design:d,isLoading:u=!1,isError:m=!1}=e;return"wrapped"===d?(0,o.jsx)("div",{className:"w-full bg-blue-50 p-4 rounded border border-dashed",children:(0,o.jsx)(c,{action:l,className:i,description:s,icon:r,isError:m,isLoading:u,items:n,message:t,showIcon:a})}):(0,o.jsx)(c,{action:l,className:i,description:s,icon:r,isError:m,isLoading:u,items:n,message:t,showIcon:a})};u.propTypes={items:i().string,message:i().string,description:i().string,icon:i().object,action:i().node,className:i().string,showIcon:i().bool,design:i().oneOf(["wrapped","default"]),isLoading:i().bool,isError:i().bool},n.Z=u}},function(e){e.O(0,[4976,9603,270,2888,9774,179],function(){return e(e.s=22929)}),_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.