-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
1186-7086bb0d3b0e600e.js.download
1 lines (1 loc) · 15.8 KB
/
1186-7086bb0d3b0e600e.js.download
1
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1186],{66360:function(e,i,r){"use strict";r.d(i,{j:function(){return d}});var a=r(85893);r(67294);var n=r(158),s=r(52937),t=r(18403),l=r.n(t);function d(e){let{children:i,buttons:r,title:t}=e;return(0,a.jsxs)("div",{className:l().body,children:[(0,a.jsx)("div",{children:(0,a.jsx)("img",{className:l().img,alt:"",src:s.Z})}),t?(0,a.jsx)("div",{className:l().errorTitle,children:(0,a.jsx)(n.xv,{as:"h2",type:"label1",children:t})}):null,(0,a.jsx)("div",{className:l().errorMessage,children:(0,a.jsx)(n.xv,{type:"body2",children:i})}),(0,a.jsx)("div",{className:l().buttons,children:r})]})}},47061:function(e,i,r){"use strict";r.d(i,{k:function(){return u}});var a=r(85893);r(67294);var n=r(1922),s=r(158),t=r(67582),l=r(55141),d=r(19002),o=r(57463),c=r.n(o);function u(e){let{children:i}=e,{t:r}=(0,n.$G)(),o=(0,d.s)();return(0,a.jsxs)("div",{className:c().linkAccounts,children:[(0,a.jsxs)("div",{className:c().videoContainer,children:[(0,a.jsx)("div",{className:c().video,style:{minHeight:"390px"},children:(0,a.jsx)("video",{playsInline:!0,poster:l.Z,src:o,muted:!0,autoPlay:!0,loop:!0,className:c().detailsVideo})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:c().gridPassClaimTitle,children:(0,a.jsx)(s.xv,{type:"heading4",children:r("nft:GridPassLink:ClaimGridPass:Subtitle")})}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:c().creator,children:(0,a.jsx)(s.xv,{type:"label3",tone:"brand",children:(0,a.jsxs)("span",{className:c().claimWilliams,children:[r("nft:GridPassLink:WilliamsCreator"),(0,a.jsx)(t.w,{size:"x-small",className:c().badge,fill:"#ffffff",stroke:"#5841D8"})]})})})})]})]}),(0,a.jsx)("div",{className:c().buttons,children:i}),(0,a.jsx)("div",{children:(0,a.jsx)(s.xv,{type:"labelMono2",children:r("nft:GridPassLink:ClaimGridPass:Disclaimer")})})]})}},13053:function(e,i,r){"use strict";r.d(i,{N:function(){return o}});var a=r(85893);r(67294);var n=r(1922),s=r(158),t=r(66360),l=r(57463),d=r.n(l);function o(e){let{children:i,errorType:r="general"}=e,{t:l}=(0,n.$G)();return(0,a.jsxs)(t.j,{buttons:i,children:["general"===r?(0,a.jsx)(s.xv,{type:"body2",children:l("nft:GridPassLink:Error:Subtitle")}):null,"verification"===r?(0,a.jsx)(s.xv,{type:"body2",children:(0,a.jsx)(n.cC,{i18nKey:"nft:GridPassLink:Error:VerificationSubtitle",children:(0,a.jsx)("div",{className:d().secondaryError})})}):null]})}},80118:function(e,i,r){"use strict";r.d(i,{T:function(){return c}});var a=r(85893);r(67294);var n=r(1922),s=r(158),t=r(67582),l=r(19002),d=r(57463),o=r.n(d);function c(e){let{children:i}=e,r=(0,l.s)(),{t:d}=(0,n.$G)();return(0,a.jsxs)("div",{className:o().gridPassWrapper,children:[(0,a.jsxs)("div",{className:o().videoContainer,children:[(0,a.jsx)("div",{className:o().video,style:{minHeight:"390px"},children:(0,a.jsx)("video",{playsInline:!0,src:r,muted:!0,autoPlay:!0,loop:!0,className:o().detailsVideo})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:o().gridPassClaimTitle,children:(0,a.jsx)(s.xv,{type:"heading4",children:d("nft:ClaimsPage:Hero:Name")})}),(0,a.jsx)("div",{className:o().videoName,children:(0,a.jsx)("div",{className:o().creator,children:(0,a.jsx)(s.xv,{type:"label3",tone:"brand",children:(0,a.jsxs)("span",{className:o().claimWilliams,children:[d("nft:GridPassLink:WilliamsCreator"),(0,a.jsx)(t.w,{className:o().badge,size:"x-small",fill:"#ffffff",stroke:"#5841D8"})]})})})})]})]}),(0,a.jsx)("div",{className:o().buttons,children:i})]})}},35162:function(e,i,r){"use strict";r.d(i,{H:function(){return T}});var a=r(85893),n=r(67294),s=r(87536),t=r(94184),l=r.n(t),d=r(1922),o=r(64894),c=r(64124),u=r(158),_=r(51371),m=r(72261),f=r(62410),v=r(98319),p=r(89866),h=r(21779),g=r(94907),x=r(54789),k=r(14709),b=r(8100),y=r(37139);let C=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],i=(0,y.p)(),r=(0,p.W)();return(0,b.ZP)(e&&i?"locale.getCountryInfo/".concat(i):null,async()=>{let e=(await r.locale.getCountryInfo(null!=i?i:"US")).data;return e})};var P=r(92973),j=r.n(P),N=r(97058);let L=Object.values(N.o).map(e=>{let{name:i,code:r,callingCodes:a}=e;return{value:r,langKey:"country:Name:".concat(i),callingCodes:a}}),G=(e,i)=>{var r,a,n;if(!e)return!0;let s=e.toLowerCase();return(null===(r=i.value)||void 0===r?void 0:r.toLowerCase().includes(s))||(null===(a=i.label)||void 0===a?void 0:a.toString().toLowerCase().includes(s))||(null===(n=i.filterByValue)||void 0===n?void 0:n.toLowerCase().includes(s))};function T(e){let{submitLabel:i,isKDS:r=!1,onClaimGridPassComplete:t,onClaimGridPassFail:b,onVerificationComplete:y}=e,P=(0,p.W)(),{isMobile:N}=(0,g.Fy)(),T=(0,g.JL)(),[V,I]=(0,n.useState)("UserInput"),{mutate:w}=(0,h.ie)(void 0,T),[E,W]=(0,n.useState)(!1),{mutate:M,data:D}=(0,h.Ff)(void 0,T),{t:S}=(0,d.$G)(),{data:q}=C(),{claimPass:A}=(0,x.Bc)(),R=n.useMemo(()=>(function(e,i){let r=e.reduce((e,r)=>{let{langKey:a,value:n,callingCodes:s}=r,t=s.map(e=>({label:"+".concat(e," ").concat(i(a)),countryCode:n,countryName:i(a),value:"".concat(n,":").concat(e),callingCode:e}));return[...e,...t]},[]);return r.sort((e,i)=>e.countryName===i.countryName?0:e.countryName<i.countryName?-1:1),r})(L,S),[S]),U=(0,n.useRef)(0),O=(0,n.useRef)(0);(0,n.useEffect)(()=>{let e;"Claiming"===V&&(e=setInterval(async()=>(A({onSuccess:()=>{clearInterval(e),null==t||t()},onError:i=>{(0,x.tl)(i)&&(clearInterval(e),null==t||t()),(0,x.cC)(i)&&(clearInterval(e),null==b||b(!1)),5===U.current&&(clearInterval(e),null==b||b(!1)),U.current+=1}}),()=>{clearInterval(e)}),1e4))},[t,A,V,b]),(0,n.useEffect)(()=>{let e;return"Verifying"===V&&(e=setInterval(()=>{(null==D?void 0:D.tier_verified)&&(null==D?void 0:D.tier_verified)>=2?(setTimeout(()=>{I("Claiming"),null==y||y()},1e3),clearInterval(e)):(O.current+=1,O.current>=4&&!E&&W(!0),O.current>=20&&(clearInterval(e),null==b||b(!0))),w(),M()},2500)),()=>{clearInterval(e)}},[null==D?void 0:D.tier_verified,A,b,y,M,w,V,E]);let z=n.useMemo(()=>R.map(e=>({label:e.label,value:e.value,selectedLabel:"+".concat(e.callingCode)})),[R]),[F,Z]=n.useState("US:1"),{register:H,handleSubmit:B,setValue:Q,watch:J,formState:{errors:K,isValid:Y}}=(0,s.cI)({mode:"all",delayError:1500}),$=(0,n.useCallback)(async e=>{try{I("SubmittingInput");let i=(0,o.Z)(new Date(e.dob),"yyyy-MM-dd"),r={dob:i,first_name:e.first_name,last_name:e.last_name,address1:e.address1,address2:e.address2,postal_code:e.postal_code,city:e.city,phone:F.split(":")[1]+e.phone_number,phone_type:"M"};(null==D?void 0:D.country)==="US"&&(r.funding="fiat"),await P.account.updateProfile(r),I("Verifying")}catch(e){I("UserInput")}},[null==D?void 0:D.country,F,P.account]),X=e=>{Z(e.target.value)},ee=(0,n.useCallback)(e=>{let i=e.target.value,r=i.replace(/[^\d]/g,"");r.length<4?i=r.replace(/(\d{2})/,"$1/"):r.length<=8&&(i=r.replace(/(\d{2})(\d{2})/,"$1/$2/")),Q("dob",i.substr(0,10))},[Q]);return(0,a.jsxs)("div",{children:[(0,a.jsxs)("form",{onSubmit:B($),children:[(0,a.jsxs)("div",{className:l()(j().form,{[j().error]:!(0,c.Z)(K)}),children:[(0,a.jsxs)("div",{className:j().firstName,children:[(0,a.jsx)("input",{...H("first_name",{required:!0}),placeholder:S("account:PersonalInfoForm:FirstName"),className:l()("label-1",j().field)}),K.first_name?(0,a.jsx)(u.xv,{type:N?"caption2":"caption1",tone:"negative",children:S("nft:ClaimsPage:Error:Required")}):null]}),(0,a.jsxs)("div",{className:j().lastName,children:[(0,a.jsx)("input",{...H("last_name",{required:!0}),placeholder:S("account:PersonalInfoForm:LastName"),className:l()("label-1",j().field)}),K.last_name?(0,a.jsx)(u.xv,{type:N?"caption2":"caption1",tone:"negative",children:S("nft:ClaimsPage:Error:Required")}):null]}),(0,a.jsxs)("div",{className:j().dob,children:[(0,a.jsx)("div",{children:(0,a.jsx)(u.xv,{type:"body2",children:S("account:PersonalInfoForm:DateOfBirth")})}),(0,a.jsx)("div",{className:j().dobDropdowns,children:(0,a.jsxs)("div",{className:j().dobWrapper,children:[(0,a.jsx)("input",{...H("dob",{required:!0,pattern:/^(0[1-9]|1[0-2])\/(0[1-9]|1[0-9]|2[0-9]|3[0-1])\/\d{4}$/,onChange:ee}),placeholder:"MM/DD/YYYY",className:l()("label-1",j().field,j().dob)}),K.dob&&(0,a.jsx)(u.xv,{type:N?"caption2":"caption1",tone:"negative",children:S("nft:ClaimsPage:Error:DateOfBirth")})]})}),(0,a.jsx)("div",{className:j().horizontalRule})]}),(0,a.jsxs)("div",{className:j().address1,children:[(0,a.jsx)("input",{...H("address1",{required:!0}),placeholder:S("account:Address:FirstLine"),className:l()("label-1",j().field)}),K.address1?(0,a.jsx)(u.xv,{type:N?"caption2":"caption1",tone:"negative",children:S("nft:ClaimsPage:Error:Required")}):null]}),(0,a.jsx)("input",{...H("address2"),placeholder:S("account:Address:SecondLineUnit"),className:l()("label-1",j().field,j().address2)}),(0,a.jsxs)("div",{className:j().postalCode,children:[(0,a.jsx)("input",{...H("postal_code",{required:!0,pattern:(null==q?void 0:q.zip_format)?RegExp("^".concat(q.zip_format,"$"),"i"):void 0}),placeholder:S("account:PostalCode"),className:l()("label-1",j().field)}),K.postal_code?(0,a.jsx)(u.xv,{type:N?"caption2":"caption1",tone:"negative",children:S("nft:ClaimsPage:Error:PostalCode")}):null]}),(0,a.jsxs)("div",{className:j().city,children:[(0,a.jsx)("input",{...H("city",{required:!0}),placeholder:S("account:Address:City"),className:l()("label-1",j().field)}),K.city?(0,a.jsx)(u.xv,{type:N?"caption2":"caption1",tone:"negative",children:S("nft:ClaimsPage:Error:Required")}):null]}),(0,a.jsx)(_.d,{requiresUtilClassPrefix:!0,isSearchable:!0,className:j().areaCode,buttonClassName:l()("label-1 pr1",j().countryCodeButton,j().field),portalClassName:l()(j().countryOptionMenu),menuClassName:l()(j().countryOptionMenu),filter:G,options:z,value:F,onChange:X,toggleOnKeypress:!0,"data-testid":"area-code-input"}),(0,a.jsxs)("div",{className:j().phoneNumber,children:[(0,a.jsx)("input",{...H("phone_number",{required:!0,validate:e=>(function(e,i){try{let r=(0,k.h)(e,i);return r.isPossible()&&r.isValid()}catch(e){return!1}})(e,F.split(":")[0])}),placeholder:"Phone number",className:l()("label-1",j().field)}),K.phone_number?(0,a.jsx)(u.xv,{type:N?"caption2":"caption1",tone:"negative",children:S("nft:ClaimsPage:Error:PhoneNumber")}):null]})]}),E?(0,a.jsx)("div",{className:j().warning,children:(0,a.jsx)(u.xv,{type:"body2",tone:"warning",children:S("nft:ClaimsPage:VerificationWarning")})}):null,(0,a.jsx)(m.zx,{type:"submit",className:l()(j().submit),innerClassName:l()({[j().kds]:r}),disabled:!Y,children:"UserInput"!==V?(0,a.jsx)("div",{style:{height:"40px",width:"40px",position:"relative"},children:(0,a.jsx)(f.T,{size:"sm",color:r?"#5841d8":void 0})}):null!=i?i:S("nft:ClaimsPage:Claim")})]}),(0,a.jsx)("div",{className:j().caption,children:(0,a.jsx)(u.xv,{type:"caption1",children:(0,a.jsx)(d.cC,{i18nKey:"nft:ClaimsPage:VerificationInput",children:(0,a.jsx)(v.d,{href:"https://support.kraken.com/hc/en-us/articles/203248063-What-does-Kraken-do-to-secure-my-personal-information-"})})})})]})}},54789:function(e,i,r){"use strict";r.d(i,{Bc:function(){return o},cC:function(){return c},tl:function(){return u}});var a=r(67294),n=r(89866),s=r(2264),t=r(91572),l=r(21779),d=r(68713);function o(){var e;let i=(0,n.W)(),r=(0,d.J)(),{fiveBeesForAQuarter:o}=(0,s.V)(),{data:c}=(0,l.Ff)(void 0,r),u=(null==c?void 0:c.tier_verified)!==void 0&&(null==c?void 0:c.tier_verified)!==null&&(null==c?void 0:c.tier_verified)>=2,_=(0,a.useCallback)(async e=>{let{onSuccess:r,onError:a}=e;try{await i.nft.placeClaim({collection_id:o},{csrf:{contextId:t.G8.Trade}}),null==r||r()}catch(e){null==a||a(e)}},[i.nft,o]);return{claimPass:_,isVerifiedToClaim:u}}function c(e){let i=e.value||e.message||e.msg||e.info;return"User account locked for trading"===i||"User country is prohibited from trading"===i}function u(e){let i=e.value||e.message||e.msg||e.info;return"user has already claimed a token from the collection"===i}},19002:function(e,i,r){"use strict";r.d(i,{s:function(){return l}});var a=r(67294),n=r(2264),s=r(21779);let t="https://assets.kraken.com/marketing/grid-pass/v1.mp4";function l(){let{fiveBeesForAQuarter:e="NCQNABO-XYCA7-JMMSDF"}=(0,n.V)(),{data:i}=(0,s.gP)({collection_id:e,page_size:1});return(0,a.useMemo)(()=>{var e,r,a;if(!i||!(null==i?void 0:i.items))return;let n=(null==i?void 0:i.items.length)>0?null==i?void 0:null===(e=i.items)||void 0===e?void 0:e[0].media.find(e=>"Video"===e.kind):void 0;if(!n)return t;let s=(null==n?void 0:n.derived.mp4_640xauto)?null===(r=null==n?void 0:n.derived.mp4_640xauto)||void 0===r?void 0:r.url:null==n?void 0:null===(a=n.main)||void 0===a?void 0:a.url;return null!=s?s:t},[i])}},36610:function(e,i,r){"use strict";r.d(i,{q:function(){return t}});var a=r(8100),n=r(89866),s=r(8402);function t(e){let i=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=(0,n.W)(),t=i?"listLinkedAccounts":null;return(0,a.ZP)(()=>t,async()=>{let e=await r.nft.listLinkedAccounts({kind:"WilliamsRacing"});return e.data.result},{...s.H,...e})}},18403:function(e){e.exports={body:"Error_body__1Khc5",img:"Error_img__g4k5d",errorMessage:"Error_errorMessage__sOk8X",buttons:"Error_buttons__nu_TA",errorTitle:"Error_errorTitle__mWM50"}},57463:function(e){e.exports={body:"GridPassLink_body__Ehdlj",rightContainer:"GridPassLink_rightContainer__TsJwc",languageSelectContainer:"GridPassLink_languageSelectContainer__yvNIH",backgroundImage:"GridPassLink_backgroundImage__wXc2W",backgroundLayer:"GridPassLink_backgroundLayer__yRJm0",background:"GridPassLink_background__RV2mZ",signInCard:"GridPassLink_signInCard__DyII7",gridPassPage:"GridPassLink_gridPassPage__if3s9",banner:"GridPassLink_banner__eUEmk",bannerTitle:"GridPassLink_bannerTitle__FUnAj",krakenLogo:"GridPassLink_krakenLogo__Kn7OU",video:"GridPassLink_video__02neo",videoName:"GridPassLink_videoName__RAos2",hidePadding:"GridPassLink_hidePadding__QuEom",videoContainer:"GridPassLink_videoContainer___G_j3",needHelp:"GridPassLink_needHelp__qDNmU",link:"GridPassLink_link__zZD9O",gridPassClaimTitle:"GridPassLink_gridPassClaimTitle__4jQYk",signIn:"GridPassLink_signIn__VTalw",footer:"GridPassLink_footer__uezXj",content:"GridPassLink_content__pre_U",linkAccounts:"GridPassLink_linkAccounts__yP7z5",gridPassWrapper:"GridPassLink_gridPassWrapper__3rqfs",loadingWrapper:"GridPassLink_loadingWrapper__IWQ_9",creator:"GridPassLink_creator__foON1",img:"GridPassLink_img__GZYSu",errorMessage:"GridPassLink_errorMessage__QS0PW",badge:"GridPassLink_badge__qNPVO",cardContent:"GridPassLink_cardContent__2h13J",card:"GridPassLink_card__PZh6c",loading:"GridPassLink_loading__yRZQh",passClaimTitle:"GridPassLink_passClaimTitle__JRc1f",headerTitle:"GridPassLink_headerTitle__DGqGR",header:"GridPassLink_header___tOHh",detailVideo:"GridPassLink_detailVideo__ZHsTf",claimWilliams:"GridPassLink_claimWilliams__kwxEx",williams:"GridPassLink_williams__f_i7E",linkTitle:"GridPassLink_linkTitle__QxfEr",linkBody:"GridPassLink_linkBody__Ag72d",user:"GridPassLink_user__gkCKF",buttons:"GridPassLink_buttons__1IELc",closeDescription:"GridPassLink_closeDescription__GV84U",secondaryError:"GridPassLink_secondaryError__YmG05"}},92973:function(e){e.exports={field:"Tier2VerificationCard_field__0a3p9",form:"Tier2VerificationCard_form__7XhX8",error:"Tier2VerificationCard_error__9PA25",dobWrapper:"Tier2VerificationCard_dobWrapper__iuspN",caption:"Tier2VerificationCard_caption__EIA62",firstName:"Tier2VerificationCard_firstName__Hx26Q",lastName:"Tier2VerificationCard_lastName__i9NUH",dob:"Tier2VerificationCard_dob__g6TW1",dobDropdowns:"Tier2VerificationCard_dobDropdowns__d2wIw",horizontalRule:"Tier2VerificationCard_horizontalRule__UuLhY",dobDropdown:"Tier2VerificationCard_dobDropdown__D0qR7",address1:"Tier2VerificationCard_address1__7wc8n",address2:"Tier2VerificationCard_address2__K_J9C",postalCode:"Tier2VerificationCard_postalCode__Mpjlf",city:"Tier2VerificationCard_city__5pM7F",areaCode:"Tier2VerificationCard_areaCode__Mz563",phoneNumber:"Tier2VerificationCard_phoneNumber__MJo_M",submit:"Tier2VerificationCard_submit__L5cN3",kds:"Tier2VerificationCard_kds__epnZx",countryOptionMenu:"Tier2VerificationCard_countryOptionMenu__H2wXT",warning:"Tier2VerificationCard_warning__sQWqI"}},55141:function(e,i){"use strict";i.Z="/nft/_next/static/chunks/images/04eda88bd5839f416a680c885ae89b8e.png"}}]);