1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5719],{3048:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/application/step6",function(){return n(95141)}])},95141:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return F}});var i,r=n(47568),a=n(14924),s=n(26042),o=n(69396),l=n(20414),c=n(85893),u=n(94184),p=n.n(u),d=(n(43234),n(82580)),h=n(21804),m=n.n(h),f=n(41664),_=n.n(f),x=n(28677),b=n(11163),g=n(67294),j=n(52205),v=n(35005),Z=n(12529),N=n(34051),C=n(31555),w=n(42016),y=n(921),S=n(9748),k=n(56722),P=n(28179),A=n(68758),D=n(51251),E=n(46246),I=n(24958),O=n(12669),R="photo",T="".concat("https://liberland.org","/assets/images/photo-sample.webp"),M={viewMode:1,aspectRatio:E.tT/E.AT,dragMode:"move",highlight:!1,center:!1,guides:!1,autoCropArea:1,background:!1,checkOrientation:!0,preview:".img-preview"};function q(e){(0,I.X5)("#".concat(m()(e)))}var z=(0,O.Iw)((function(){var e=(0,x.$G)(["application"]).t,t=(0,g.useContext)(O.i$),n=t.currentStatus,u=t.eResident,h=t.refreshData,m=(0,g.useState)(!1),f=m[0],z=m[1],F=(0,g.useState)(!1),U=F[
10],G=F[1],V=(0,g.useState)(T),W=V[0],B=V[1],H=(0,g.useState)(null),X=H[0],K=H[1],L=(0,g.useState)(null),$=L[0],J=L[1],Q=(0,g.useState)(!1),Y=Q[0],ee=Q[1],te=(0,g.useRef)(null),ne=(0,b.useRouter)();(0,g.useEffect)((function(){z(!!(null===u||void 0===u?void 0:u.photoCdnId)),G("ID_APPROVED"===n)}),[u,n]),(0,g.useMemo)((function(){(i=new FileReader).onload=function(){B(i.result)}}),[B]);var ie=(0,g.useCallback)((function(e,t){var n=e.target.files[0];t(R,""),J(function(e){if(!e)return null;var t=e.split(".");return t.length>1&&t.pop(),t[t.length-1]+="-cropped",t.push("jpg"),t.join(".")}(null===n||void 0===n?void 0:n.name)),n?i.readAsDataURL(n):B(T)}),[J]),re=(0,g.useMemo)((function(){return(0,I.Ds)((function(e){if(e.detail.width&&e.detail.height){var t=Math.round(e.detail.width),n=Math.round(e.detail.height);ee(t>=E.YG&&n>=E.r9)}}),50)}),[ee]),ae=(0,g.useCallback)((0,r.Z)((function(){var t,n,i,r,s,o;return(0,l.__generator)(this,(function(l){switch(l.label){case 0:if(n=null===(t=te.current)||void 0===t?void 0:t.cropper,r=[],!n)return[3,5];l.label=1;case 1:if(l.trys.push([1,3,,4]),!$)throw e("photo.errors.no_file");return s=n.getCroppedCanvas({fillColor:"#ffffff",imageSmoothingQuality:"high"}),[4,new Promise((function(t,n){s.toBlob((function(i){i?t(i):n(e("photo.errors.generation"))}),"image/jpeg",.95)}))];case 2:return((i=l.sent()).size<E.W7||i.size>E.p_)&&r.push(e("photo.errors.file_size_incorrect",{minSize:50,maxSize:10})),Y||r.push(e("photo.errors.resolution_too_small",{minWidth:840,minHeight:1080})),[3,4];case 3:return o=l.sent(),r.push(o),[3,4];case 4:return[3,6];case 5:r.push(e("photo.errors.cropper")),l.label=6;case 6:return K(r.length?null:i),[2,r.length?(0,a.Z)({},R,r):{}]}}))})),[$,Y,e]),se=(0,g.useCallback)((0,r.Z)((function(){var e,t;return(0,l.__generator)(this,(function(n){switch(n.label){case 0:return[4,ae()];case 1:return e=n.sent(),t=Object.keys(e),!t.length||q(t[0]),[2,e]}}))})),[ae]),oe=(0,g.useCallback)(function(){var t=(0,r.Z)((function(t,n){var i,r;return(0,l.__generator)(this,(function(t){return i=n.setFieldError,(r=new FormData).append("file",X,$),(0,D.Z)({baseApiUrl:"https://cdn.liberland.org",path:"/files/upload",method:"POST",body:r}).then((function(e){return(0,D.Z)({path:"/cdn",method:"POST",body:{fileUrl:e.url,manageUrl:e.manage,fileType:e.type}})})).then((function(e){return(0,D.Z)({path:"/e-residents/applications/"+u.id,method:"PATCH",authentication:!0,body:{photoCdnId:e.id}})})).then((function(){h(),ne.replace("./step6")})).catch((function(){i(R,e("photo.errors.upload")),q(R)})),[2]}))}));return function(e,n){return t.apply(this,arguments)}}(),[$,X,u,h,e,ne]),le=(0,g.useMemo)((function(){return{initialValues:(0,a.Z)({},R,""),enableReinitialize:!0,validateOnChange:!1,validateOnBlur:!1,validate:se,onSubmit:oe}}),[oe,se]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k.Z,{title:e("main.title"),children:(0,c.jsxs)(j.Z,{children:[(0,c.jsx)(j.Z.Prev,{disabled:U,onClick:function(){ne.push("./step5")}}),(0,c.jsxs)(j.Z.Item,{active:!0,children:[(0,c.jsx)("span",{className:"application__pagination-step",children:"".concat(e("main.steps.6.counter"),": ")}),e("main.steps.6.title")]}),(0,c.jsx)(j.Z.Next,{disabled:!0})]})}),(0,c.jsxs)("div",{className:"content-container container-secondary",children:[(0,c.jsx)(y.Z,{navigationArray:[{text:"Dashboard",link:"/dashboard/status"}],lastItem:e("main.title")}),(0,c.jsx)("p",{className:"application__supertitle",children:e("main.steps.6.counter")}),(0,c.jsx)(A.Z,{heading:1,justification:"center",underlineWidth:138,marginBottom:null,className:"application__title",children:(0,c.jsx)("span",{children:e("main.steps.6.title")})}),(0,c.jsx)("h3",{className:"application__subtitle",children:e(f?"main.steps.6.subtitle.submitted":"main.steps.6.subtitle.pending.".concat(U?"":"un","verified"))}),f?(0,c.jsx)("div",{className:"text-center",children:(0,c.jsx)(_(),{href:"/dashboard/profile",passHref:!0,children:(0,c.jsx)(v.Z,{variant:"outline-secondary",children:e("go_to_profile",{ns:"common"})})})}):(0,c.jsx)(d.J9,(0,o.Z)((0,s.Z)({},le),{children:function(t){var n=t.handleSubmit,i=t.errors,r=t.setFieldError;return(0,c.jsxs)(Z.Z,{noValidate:!0,className:"application__form",onSubmit:n,children:[(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(C.Z,{md:"5",children:(0,c.jsxs)(P.Z,{className:"application__form-section photo-selection",children:[(0,c.jsx)(w.Z,(0,o.Z)((0,s.Z)({ref:te,className:p()("photo-selection__cropper",{"photo-selection__cropper--invalid":!Y},"mb-3"),src:W},M),{crop:re})),(0,c.jsxs)(Z.Z.Group,{controlId:R,children:[(0,c.jsx)(S.nv,{name:R,type:"file",accept:"image/jpeg,image/png,image/bmp,image/tiff",className:"photo-selection__input",noWrapper:!0,required:!0,onChange:function(e){ie(e,r)}}),(0,c.jsx)(Z.Z.Control.Feedback,{type:"invalid",children:Array.isArray(i.photo)?(0,c.jsx)("ul",{className:"mb-0",children:i.photo.map((function(e,t){return(0,c.jsx)("li",{children:e},t)}))}):i.photo}),(0,c.jsx)(Z.Z.Label,{className:"photo-selection__button btn btn-outline-secondary mt-3",children:e("photo.upload.cho
1ose")}),(0,c.jsx)(Z.Z.Text,{className:"text-center mt-3 mb-0",children:(0,c.jsx)(x.cC,{t:e,i18nKey:"photo.upload.note",shouldUnescape:!0})})]})]})}),(0,c.jsx)(C.Z,{xs:{order:"first"},md:{order:0},className:"mb-4 mb-md-0",children:(0,c.jsxs)(P.Z,{title:e("photo.requirements.title"),className:"application__form-section",children:[e("photo.requirements.description"),(0,c.jsx)("ul",{className:"application__photo-requirements mb-0",children:(0,c.jsx)(x.cC,{t:e,i18nKey:"photo.requirements.rules",shouldUnescape:!0})})]})})]}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(C.Z,{md:"5"}),(0,c.jsx)(C.Z,{children:(0,c.jsx)("div",{className:"application__proceed-section",children:(0,c.jsx)("div",{className:"application__proceed-section-item",children:(0,c.jsx)(v.Z,{type:"submit",children:e("main.steps.6.continue")})})})})]})]})}}))]})]})}),{allowedStatuses:["PAID","ID_PROCESSING","ID_APPROVED"]}),F=!0;t.default=z,z.authenticationRequired=!0}},function(e){e.O(0,[1114,296,9778,9774,2888,179],(function(){return t=3048,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.