1"use strict";(self.webpackChunkpechakucha_dot_com_v3=self.webpackChunkpechakucha_dot_com_v3||[]).push([[8294],{18294:function(e,n,t){t.r(n),t.d(n,{default:function(){return O}});var r=t(74165),a=t(1413),l=t(15861),u=t(29439),o=t(7276),i=t(444),c=t(3498),s=t(8992),f=t(44925),d=t(93433),m=t(96699),v=t(11486),p=t(3142),h=t(92165),g=t(48894),E=t(2548),y=t(17981),k=["index"],x=["children"],Z=["descendants"],C=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return n.filter(Boolean).join(" ")},b=function(e){return!!e||void 0};function _(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(e){n.some((function(n){return null==n||n(e),null==e?void 0:e.defaultPrevented}))}}var A=(0,h.n)(),w=(0,u.Z)(A,4),I=w[0],S=(w[1],w[2]),P=w[3],V=(0,E.k)({name:"PinInputContext",errorMessage:"usePinInputContext: `context` is undefined. Seems you forgot to all pin input fields within `<PinInput />`"}),F=(0,u.Z)(V,2),z=F[0],D=F[1],j=function(e){return null==e?void 0:e.split("")};function N(e,n){return("alphanumeric"===n?/^[a-zA-Z0-9]+$/i:/^[0-9]+$/).test(e)}function B(e){var n=(0,m.mq)("PinInput",e),t=(0,v.Lr)(e),r=t.children,l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.autoFocus,t=e.value,r=e.defaultValue,l=e.onChange,i=e.onComplete,c=e.placeholder,s=void 0===c?"\u25cb":c,m=e.manageFocus,v=void 0===m||m,p=e.otp,h=void 0!==p&&p,E=e.id,y=e.isDisabled,x=e.isInvalid,Z=e.type,C=void 0===Z?"number":Z,A=e.mask,w=(0,o.useId)(),I=null!==E&&void 0!==E?E:"pin-input-".concat(w),P=S(),V=(0,o.useState)(!0),F=(0,u.Z)(V,2),z=F[0],D=F[1],B=(0,o.useState)(-1),q=(0,u.Z)(B,2),$=q[0],K=q[1],M=(0,g.T)({defaultValue:j(r)||[],value:j(t),onChange:function(e){return null==l?void 0:l(e.join(""))}}),U=(0,u.Z)(M,2),O=U[0],T=U[1];(0,o.useEffect)((function(){if(n){var e=P.first();e&&requestAnimationFrame((function(){e.node.focus()}))}}),[P]);var W=(0,o.useCallback)((function(e){if(z&&v){var n=P.next(e,!1);n&&requestAnimationFrame((function(){n.node.focus()}))}}),[P,z,v]),G=(0,o.useCallback)((function(e,n){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=(0,d.Z)(O);r[n]=e,T(r),""!==e&&r.length===P.count()&&r.every((function(e){return null!=e&&""!==e}))?null==i||i(r.join("")):t&&W(n)}),[O,T,W,i,P]),L=(0,o.useCallback)((function(){var e,n=Array(P.count()).fill("");T(n);var t=P.first();null==(e=null==t?void 0:t.node)||e.focus()}),[P,T]),R=(0,o.useCallback)((function(e,n){var t=n;return(null==e?void 0:e.length)>0&&(e[0]===n.charAt(0)?t=n.charAt(1):e[0]===n.charAt(1)&&(t=n.charAt(0))),t}),[]),H=(0,o.useCallback)((function(e){var n=e.index,t=(0,f.Z)(e,k),r=$===n,l="number"===C?"tel":"text";return(0,a.Z)((0,a.Z)({"aria-label":"Please enter your pin code",inputMode:"number"===C?"numeric":"text",type:A?"password":l},t),{},{id:"".concat(I,"-").concat(n),disabled:y,"aria-invalid":b(x),onChange:_(t.onChange,(function(e){var t=e.target.value,r=O[n],a=R(r,t);if(""!==a)if(t.length>2){if(N(t,C)){var l=t.split("").filter((function(e,n){return n<P.count()}));T(l),l.length===P.count()&&(null==i||i(l.join("")))}}else N(a,C)&&G(a,n),D(!0);else G("",n)})),onKeyDown:_(t.onKeyDown,(function(e){var t;if("Backspace"===e.key&&v)if(""===e.target.value){var r=P.prev(n,!1);r&&(G("",n-1,!1),null==(t=r.node)||t.focus(),D(!0))}else D(!1)})),onFocus:_(t.onFocus,(function(){K(n)})),onBlur:_(t.onBlur,(function(){K(-1)})),value:O[n]||"",autoComplete:h?"one-time-code":"off",placeholder:r?"":s})}),[P,$,R,I,y,A,x,v,i,h,s,G,T,C,O]);return{getInputProps:H,id:I,descendants:P,values:O,setValue:G,setValues:T,clear:L}}((0,f.Z)(t,x)),i=l.descendants,c=(0,f.Z)(l,Z),s=(0,p.W)(r).map((function(e){return(0,o.cloneElement)(e,{__css:n})}));return o.createElement(I,{value:i},o.createElement(z,{value:c},s))}B.displayName="PinInput";var q=(0,m.Gp)((function(e,n){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=D().getInputProps,r=P(),l=r.index,u=r.register;return t((0,a.Z)((0,a.Z)({},e),{},{ref:(0,y.lq)(u,n),index:l}))}
1(e,n);return o.createElement(m.m$.input,(0,a.Z)((0,a.Z)({},t),{},{className:C("chakra-pin-input",e.className)}))}));q.displayName="PinInputField";var $=t(52486),K=t(43127),M=t(33697),U=t(57406),O=function(e){var n=e.onClose,t=e.isOpen,f=(0,o.useState)(""),d=(0,u.Z)(f,2),m=d[0],v=d[1],p=(0,o.useState)(!1),h=(0,u.Z)(p,2),g=h[0],E=h[1],y=(0,o.useState)(o.createElement("span",null,"\xa0")),k=(0,u.Z)(y,2),x=k[0],Z=k[1],C=(0,o.useContext)(U.St),b=(0,i.pm)(),_=function(){var e=(0,l.Z)((0,r.Z)().mark((function e(){var t,l,u;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return E(!0),Z(o.createElement("span",null,"\xa0")),e.prev=2,t={verification_token:m},l={method:"post",url:"rest/users/".concat(C.user_info.entity_uuid,"/verifyEmail"),data:t},e.next=7,(0,M.Nv)(l,{use_error:!1});case 7:return(u=e.sent).access_token&&window.localStorage.setItem("pk_access_token",u.access_token),E(!1),n(),b({title:"Successfully verified, thank you!",status:"success",variant:"pkSuccessToast",duration:5e3,isClosable:!0}),C.setUserInfo((0,a.Z)((0,a.Z)({},C.user_info),{},{status_code:1})),e.abrupt("return");case 16:return e.prev=16,e.t0=e.catch(2),console.log("Verification failed for some reason",e.t0),Z(o.createElement(c.xv,{my:"0",color:"red",textAlign:"center"},"Invalid Verification Code! Please double check the code and try again")),E(!1),e.abrupt("return");case 22:case"end":return e.stop()}}),e,null,[[2,16]])})));return function(){return e.apply(this,arguments)}}(),A=function(){var e=(0,l.Z)((0,r.Z)().mark((function e(){var n,t,a,l;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return E(!0),Z(o.createElement("span",null,"\xa0")),e.prev=2,n={method:"post",url:"rest/users/".concat(C.user_info.entity_uuid,"/resendVerificationEmail")},e.next=6,(0,M.Nv)(n,{use_error:!1});case 6:Z(o.createElement(c.xv,{textAlign:"center"},"Verification code successfully sent")),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),l=e.t0,Z(o.createElement(c.xv,{my:"0",textAlign:"center",color:"red"},"Unable to resend: ",null===(t=l.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message));case 13:E(!1);case 14:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}();return o.createElement(s.u_,{isOpen:t,onClose:n},o.createElement(s.ZA,null),o.createElement(s.hz,null,o.createElement(s.ol,null),o.createElement(s.xB,{textAlign:"center"},"Confirm your email"),o.createElement(s.fe,null,o.createElement(c.xv,{textAlign:"center"},"Enter the 6-digit code we sent to your email and you're done!"),o.createElement(c.kC,{justify:"center",my:"2rem"},o.createElement(c.Ug,null,o.createElement(B,{onChange:function(e){return v(e)},placeholder:"",isDisabled:g,autoFocus:!0,otp:!0},o.createElement(q,null),o.createElement(q,null),o.createElement(q,null),o.createElement(q,null),o.createElement(q,null),o.createElement(q,{onKeyDown:function(e){"Enter"===e.key&&_()}})))),o.createElement(c.xv,{textAlign:"center",fontSize:"sm",pb:"5px"},"Verifying email address ",o.createElement(c.xv,{as:"span",fontWeight:"semibold"},C.user_info.email)),o.createElement(c.xv,{textAlign:"center",fontSize:"xs",fontStyle:"italic"},"If you are having trouble finding your verification email, please check your junk or spam folder"),g&&o.createElement(c.M5,null,o.createElement($.$,null)),x),o.createElement(s.mz,null,o.createElement(c.kC,{w:"100%",direction:"column",alignItems:"center"},o.createElement(K.zx,{mb:3,isDisabled:g,onClick:_,variant:"pkprimary"},"Confirm Email"),o.createElement(K.zx,{onClick:A,variant:"ghost",isDisabled:g},"Resend Verfication Email")))))}}}]);
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.