PageSourceSearch

https://assets.kick.com/main/_next/static/chunks/3-vsgnhqonj7y.js

js kick.com collected 2026-10-01 08:57:39 UTC 52,897 bytes, 3 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,640848,e=>{"use strict";var t=e.i(342545),n=e.i(86848),r=e.i(945473),o=e.i(958119),a=e.i(623373);let s={subscription:"subs",gift:"gifts"};var i=e.i(612832);e.s(["PaymentMutations",0,{useInitiateSubscription:(e,t)=>{let o=(0,n.useMutation)({mutationFn:async e=>{let n,o;return n=t,o=e,(0,r.customFetch)(`/api/v1/channels/${n}/subscriptions`,null,{method:"POST",signal:null,body:JSON.stringify(o)},a.API_DOMAIN.Web)}});return e?o:null},useCancelSubscription:(e,t)=>{let o=(0,n.useMutation)({mutationKey:["Payment","cancelSubscription",t],mutationFn:async()=>{let e;return e=t,(0,r.customFetch)(`/api/v1/channels/${e}/subscriptions`,null,{method:"DELETE",signal:null},a.API_DOMAIN.Web)}});return e?o:null},useInitiateGift:(e,t)=>{let o=(0,n.useMutation)({mutationFn:async e=>{let n,o;return n=t,o=e,(0,r.customFetch)(`/api/v2/channels/${n}/gift`,null,{method:"POST",signal:null,body:JSON.stringify(o)})}});return e?o:null},useSendOtpCode:e=>{let t=(0,n.useMutation)({mutationFn:async()=>(0,r.customFetch)("/api/v2/stripe-purchase/otp/email/send",null,{method:"POST",signal:null})});return e?t:null},useSetBillingInfo:e=>{let t=(0,n.useMutation)({mutationKey:["Payment","setBillingInfo"],mutationFn:async e=>{let t;return t=e,(0,r.customFetch)("/api/v1/billing/info",null,{method:"PUT",signal:null,body:JSON.stringify(t)},a.API_DOMAIN.Web)}});return e?t:null},useFinalizeCustomProviderPayment:e=>{let t=(0,n.useMutation)({mutationFn:async({provider:e,productType:t,payload:n})=>{let o,i,l;return o=e,i=t,l=n,(0,r.customFetch)(`/api/v1/callbacks/${s[i]}/${o}`,l,{method:"GET",signal:null},a.API_DOMAIN.Web)}});return e?t:null}},"PaymentQueries",0,{listPlans:(e,n)=>(0,t.queryOptions)({queryKey:["Payment","listPlans",n],queryFn:({signal:e})=>{let t,o;return t=e,o=n,(0,r.customFetch)(`/api/v1/channels/${o}/plans`,null,{method:"GET",signal:t},a.API_DOMAIN.Web)},enabled:e}),getTaxes:(e,t,n,r)=>(0,i.safeQueryOptions)({queryKey:["Payment","getTaxes",t,n,r],queryFn:({signal:e})=>{let a,s,i,l;return a=e,s=t,i=n,l=r,(0,o.webFetch)("/tax/calculate",{method:"post",signal:a,body:{price:s,currency:i,payment_method:l}})},enabled:e}),getTaxesByLocation:(e,t,n,r,a)=>(0,i.safeQueryOptions)({queryKey:["Payment","getTaxesByLocation",t,n,r,a],queryFn:({signal:e})=>{let s,i,l,u,c;return s=e,i=t,l=n,u=r,c=a,(0,o.webFetch)("/tax/calculate/location",{method:"post",signal:s,body:{price:i,currency:l,country:u,postal_code:c}})},enabled:e}),getBillingInfo:e=>(0,t.queryOptions)({queryKey:["Payment","getBillingInfo"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/api/v1/billing/info",null,{method:"GET",signal:t},a.API_DOMAIN.Web)},enabled:e}),getSupportedBillingCountries:e=>(0,t.queryOptions)({queryKey:["Payment","getSupportedBillingCountries"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/api/v1/billing/supported-countries",null,{method:"GET",signal:t},a.API_DOMAIN.Web)},enabled:e})}],640848)},970915,e=>{"use strict";var t=e.i(342545),n=e.i(86848),r=e.i(945473),o=e.i(623373);e.s(["UserMutations",0,{useUpdateFilteredCategories:e=>{let t=(0,n.useMutation)({mutationFn:async e=>{let t;return t=e,(0,r.customFetch)("/api/v2/user/filtered-categories",null,{method:"PUT",signal:null,body:JSON.stringify(t)})}});return e?t:null},useAddPaymentMethod:e=>{let t=(0,n.useMutation)({mutationKey:["User","AddPaymentMethod"],mutationFn:async e=>{let t;return t=e,(0,r.customFetch)("/api/v2/user/payment-methods",null,{method:"POST",signal:null,body:JSON.stringify(t)})}});return e?t:null},useDeletePaymentMethod:e=>{let t=(0,n.useMutation)({mutationFn:async e=>{let t;return t=e,(0,r.customFetch)("/api/v1/user/payment-methods/delete",null,{method:"POST",signal:null,body:JSON.stringify(t)},o.API_DOMAIN.Web)}});return e?t:null},useChangeDefaultPaymentMethod:e=>{let t=(0,n.useMutation)({mutationFn:async e=>{let t;return t=e,(0,r.customFetch)("/api/v2/user/payment-methods/default",null,{method:"POST",signal:null,body:JSON.stringify(t)})}});return e?t:null},useVerify2fa:e=>{let t=(0,n.useMutation)({mutationFn:async e=>{let t;return t=e,(0,r.customFetch)("/verify-2fa",null,{method:"POST",signal:null,body:JSON.stringify(t)})}});return e?t:null},useRemove2fa:e=>{let t=(0,n.useMutation)({mutationFn:async e=>{let t;return t=e,(0,r.customFetch)("/remove-2fa",null,{method:"PUT",signal:null,body:JSON.stringify(t)})}});return e?t:null},useSatisfyUserRequirement:e=>{let t=(0,n.useMutation)({mutationFn:async e=>{let t,n;return t=e.requirement,n=e.body,(0,r.customFetch)(`/api/v2/requirements/${t}`,null,{method:"POST",signal:null,body:JSON.stringify(n)})}});return e?t:null}
1,useUpdateInfo:e=>{let t=(0,n.useMutation)({mutationFn:async e=>{let t;return t=e,(0,r.customFetch)("/api/v1/user/info",null,{method:"PATCH",signal:null,body:JSON.stringify(t)},o.API_DOMAIN.Web)}});return e?t:null}},"UserQueries",0,{get:()=>(0,t.queryOptions)({queryKey:["User","get"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/api/v1/user",null,{method:"GET",signal:t})}}),show:e=>(0,t.queryOptions)({queryKey:["User","show",e],queryFn:({signal:t})=>{let n,o;return n=t,o=e,(0,r.customFetch)(`/api/v1/users/${o}`,null,{method:"GET",signal:n})}}),top:e=>(0,t.queryOptions)({queryKey:["User","top"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/api/v1/user/categories/top",null,{method:"GET",signal:t})},enabled:e}),livestreams:e=>(0,t.queryOptions)({queryKey:["User","livestreams"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/api/v1/user/livestreams",null,{method:"GET",signal:t})},enabled:e}),getFilteredCategories:e=>(0,t.queryOptions)({queryKey:["User","getFilteredCategories"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/api/v2/user/filtered-categories",null,{method:"GET",signal:t})},enabled:e}),getPaymentProfile:e=>(0,t.queryOptions)({queryKey:["User","getPaymentProfile"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/api/v2/user/payment-profile",null,{method:"GET",signal:t})},enabled:e}),getSubscriptions:e=>(0,t.queryOptions)({queryKey:["User","getSubscriptions"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/api/v2/user/subscriptions",null,{method:"GET",signal:t})},enabled:e}),getVerifiedStatus:e=>(0,t.queryOptions)({queryKey:["User","getVerifiedStatus"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/api/v2/user/verified-status",null,{method:"GET",signal:t})},enabled:e}),setup2fa:e=>(0,t.queryOptions)({queryKey:["User","setup2fa"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/setup-2fa",null,{method:"GET",signal:t})},enabled:e}),getUserRequirements:e=>(0,t.queryOptions)({queryKey:["User","getUserRequirements"],queryFn:({signal:e})=>{let t;return t=e,(0,r.customFetch)("/api/v2/requirements",null,{method:"GET",signal:t})},enabled:e})}],970915)},89885,479698,956162,821537,850113,e=>{"use strict";var t=e.i(100054),n=e.i(673781),r=e.i(619345),o=e.i(127284),a=e.i(316608),s=e.i(164336),i=e.i(620577),l=e.i(853674),u=e.i(970915),c=e.i(921890),d=e.i(723753),p=e.i(675898);let m=()=>window.grecaptcha?.enterprise??null,f=e=>new Promise(t=>setTimeout(t,e)),h=async()=>{let e=Date.now()+1e4,t=m();for(;!t;){if(Date.now()>=e)throw Error("recaptcha_enterprise_unavailable");await f(100),t=m()}let n=t;return new Promise((t,r)=>{let o=setTimeout(()=>{r(Error("recaptcha_enterprise_ready_timeout"))},Math.max(e-Date.now(),0));n.ready(()=>{clearTimeout(o),t(n)})})},y=({badge:e="bottomright",onVerify:r,onError:o,ref:a})=>{let s=(0,n.useRef)(null),i=(0,n.useRef)(null),l=(0,n.useRef)(null),u=(0,n.useRef)(null),c=(0,n.useRef)(0),d=(0,n.useRef)(null),m=(0,n.useRef)(r),f=(0,n.useRef)(o);(0,n.useEffect)(()=>{m.current=r,f.current=o},[o,r]);let y=(0,n.useCallback)(()=>{let e=i.current,t=l.current;e&&null!==t&&e.reset(t)},[]),g=(0,n.useCallback)((e,t)=>{if(d.current!==t){if(!e)return void m.current(null);d.current=t,m.current(e)}},[]),v=(0,n.useCallback)(()=>{f.current?.("captcha_iframe_or_network_error")},[]),b=(0,n.useCallback)(()=>{y(),f.current?.("captcha_expired")},[y]),P=(0,n.useCallback)(async()=>{i.current&&null!==l.current||await u.current;let e=i.current,t=l.current;if(!e||null===t)return void v();try{let n=c.current+1;c.current=n;let r=await e.execute(t);g(r,n)}catch{v()}},[v,g]);return(0,n.useImperativeHandle)(a,()=>({execute:P,reset:y}),[P,y]),(0,n.useEffect)(()=>{let t=!0,n=s.current;return u.current=(async()=>{try{let r=await h();if(!t||!n||(i.current=r,null!==l.current))return;l.current=r.render(n,{sitekey:p.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY,size:"invisible",badge:e,callback:e=>g(e,c.current),"expired-callback":b,"error-callback":v,action:"default"})}catch{t&&v()}})(),()=>{t=!1,y()}},[e,v,b,g,y]),(0,t.jsx)("div",{ref:s})};e.s(["ReCaptcha",0,y],479698);var g=e.i(76117),v=e.i(53275),b=e.i(161881),P=e.i(629999),x=e.i(369837),S=e.i(430497),C=e.i(952862);e.i(850);var _=e.i(572099);e.i(891668);var E=e.i(770375),j=e.i(82660),w=e.i(820476);let M=({children:e})=>(0,t.jsx)("div",{className:"flex w-full flex-row flex-nowrap",children:e});M.displayName="PaymentDialog.ProductTable";let T=({children:e,contentShouldGrow:n=!1})=>(0,t.jsx)("div",{className:(0,w.cn)("group flex w-full flex-col lg:w-auto lg:shrink-0 lg:grow-0",n&&"lg:grow lg:last:grow"),children:e});T.displayName="PaymentDialog.ProductTableItem";let N=({children:e,className:n})=>(0,t.jsx)("div",{className:(0,w.cn)("flex flex-row items-center border-b-2 border-b-surface-fg-decorative py-2 text-sm leading-[17px] font-medium whitespace-nowrap text-surface-fg-subtle lg:px-4",n),children:e});N.displayName="PaymentDialog.ProductTableTitle";let k=({children:e,className:n})=>(0,t.jsx)("div",{className:(0,w.cn)("flex grow flex-row items-center py-2 lg:p-4",n),children:e});k.displayName="PaymentDialog.ProductTableContent";let O=({children:e})=>{let n=(0,l.useTranslations)("Payments");return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"text-base font-bold",children:n("choose_payment_method")}),(0,t.jsxs)("div",{className:"text-surface- flex items-center gap-2 text-xs font-semibold",children:[(0,t.jsx)(C.LockIcon,{className:"size-4"}),(0,t.jsx)("span",{children:n("icon_secure_label")})]})]}),e]})};O.displayName="PaymentDialog.PaymentMethod";let I=({children:e})=>(0,t.jsx)("div",{className:"pt-2 text-xs font-medium text-surface-fg-subtle",children:e});I.displayName="PaymentDialog.Disclaimer";let A=({children:e,className:n})=>(0,t.jsx)("div",{className:(0,w.cn)("flex flex-col gap-4",n),children:e});A.displayName="PaymentDialog.Footer";let F=({children:e})=>{let n=(0,l.useTranslations)("Payments");return(0,t.jsxs)("div",{className:"flex flex-row items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-surface-fg-subtle",children:n("total")}),(0,t.jsx)("span",{className:"justify-self-end text-base font-bold text-white",children:e})]})};F.displayName="PaymentDialog.FooterPrice";let D=({children:e})=>0===n.Children.count(e)?null:(0,t.jsx)("div",{className:"flex flex-col gap-2 lg:flex-row lg:items-center",children:e});D.displayName="PaymentDialog.FooterButtons";let U=()=>{let e=(0,l.useTranslations)("Payments"),n="gift-anonymously",r=(0,S.usePaymentDialogStore)(e=>e.isAnonymousGift),o=(0,S.usePaymentDialogStore)(e=>e.setIsAnonymousGift);return(0,t.jsxs)("div",{className:"ml-auto flex flex-row items-center gap-2",children:[(0,t.jsx)(_.CheckboxRoot,{checked:r,onCheckedChange:e=>o(!!e),id:n}),(0,t.jsx)("label",{htmlFor:n,className:"cursor-pointer text-sm text-white",children:e("gift_anonymously")})]})};U.displayName="PaymentDialog.FooterGiftAnonymously";let R=({className:e})=>(0,t.jsx)("hr",{className:(0,w.cn)("border border-surface-fg-decorative",e)});R.displayName="PaymentDialog.Separator";let B=({children:e})=>(0,t.jsx)("div",{className:"flex items-center gap-2",children:e});B.displayName="PaymentDialog.Error";let q=()=>
1(0,t.jsxs)("div",{className:"flex flex-col gap-4 rounded",children:[(0,t.jsx)(E.BaseSkeleton,{className:"h-[328px] w-full bg-surface-bg-highest sm:h-[382px] md:h-[305px]"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(E.BaseSkeleton,{className:"size-5 bg-surface-bg-highest"}),(0,t.jsx)(j.TextSkeleton,{className:"w-[211px] text-sm",skeletonClass:"bg-surface-bg-highest"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(E.BaseSkeleton,{className:"h-10 w-1/2 bg-surface-bg-highest"}),(0,t.jsx)(E.BaseSkeleton,{className:"h-10 w-1/2 bg-surface-bg-highest"})]})]});q.displayName="PaymentDialog.FormSkeleton",e.s(["Disclaimer",0,I,"Error",0,B,"Footer",0,A,"FooterButtons",0,D,"FooterGiftAnonymously",0,U,"FooterPrice",0,F,"FooterTaxes",0,({children:e})=>{let n=(0,l.useTranslations)("Payments");return(0,t.jsxs)("div",{className:"flex flex-row items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-surface-fg-subtle",children:n("tax")}),(0,t.jsx)("span",{className:"justify-self-end text-base font-medium text-white",children:e})]})},"FormSkeleton",0,q,"PaymentMethod",0,O,"ProductTable",0,M,"ProductTableContent",0,k,"ProductTableItem",0,T,"ProductTableTitle",0,N,"Separator",0,R],956162);var L=e.i(643892);e.i(293316);var G=e.i(188376);e.i(789772);var K=e.i(739015),Y=e.i(572360),W=e.i(389015);e.i(913957);
1var Q=e.i(901767),V=e.i(588197),z=e.i(255208),H=e.i(640848),J=e.i(31023),Z=e.i(382576),$=e.i(918313),X=e.i(911420),ee=e.i(79729),et=e.i(19269),en=e.i(334532),er=e.i(533435),eo=e.i(425269),ea=e.i(832356);let es=new Map([["US",{type:"zip",regex:/^\d{5}(-\d{4})?$/,validExamples:["12345","12345-6789"]}],["CA",{type:"postal",regex:/^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$/,validExamples:["A1A 1A1","A1A-1A1"]}],["IN",{type:"postal",regex:/^[1-9]\d{2}[ ]?\d{3}$/,validExamples:["110001","400 001"]}]]),ei={zip:"billing_info_zip_code_required",postal:"billing_info_postal_code_required"},el={zip:"billing_info_zip_code_too_long",postal:"billing_info_postal_code_too_long"},eu={zip:"billing_info_zip_code_invalid",postal:"billing_info_postal_code_invalid"},ec=e=>ea.z.object({country:ea.z.string().min(1,e("billing_info_country_required")),postalCode:ea.z.string()}).superRefine((t,n)=>{let r=es.get(t.country),o=t.postalCode.trim(),a="custom",s=["postalCode"];if(o.length>32)return void n.addIssue({code:a,message:e(r?el[r.type]:el.postal,{max:32}),path:s});if(r){if(!o.length)return void n.addIssue({code:a,message:e(ei[r.type]),path:s});if(!r.regex.test(o))return void n.addIssue({code:a,message:e(eu[r.type],{allowedFormatExamples:r.validExamples.join(", ")}),path:s})}}),ed=e=>{let t,r=(t=(0,l.useTranslations)("Payments"),(0,n.useMemo)(()=>ec(t),[t]));return(0,z.useForm)({resolver:(0,eo.zodResolver)(r),defaultValues:{country:e?.country||"",postalCode:e?.postalCode||""},mode:"onChange"})};e.s(["ZIP_OR_POSTAL_CODE_VALIDATION",0,es,"getBillingInfoSchema",0,ec,"useBillingInfoForm",0,ed],821537);let ep=()=>{let e=(0,i.useLocale)(),r="authenticated"===(0,c.useSession)().status,o=(0,z.useFormContext)(),s=(0,S.usePaymentDialogStore)(e=>e.selectedPaymentMethod),{data:l,status:u}=(0,a.useQuery)({...H.PaymentQueries.getSupportedBillingCountries(r),select:t=>{let n=t?.data.map(t=>({value:t,label:(0,J.getCountryFromCode)(e,t)||t}))||[];return n.sort((e,t)=>e.label.localeCompare(t.label)),n}}),{data:d,status:p}=(0,a.useQuery)({...H.PaymentQueries.getBillingInfo(r),select:e=>e?.data}),m=(0,n.useRef)(!1);return((0,n.useEffect)(()=>{if(m.current)return;let e=s&&(0,S.isCustomPaymentMethod)(s)?s:null,t=!!(e&&S.CUSTOM_PAYMENT_METHODS[e.provider].requirements.has("billing_info")),n=!!(e&&t&&(e.details.country.trim().length||e.details.postalCode.trim().length)),r=({country:e,postalCode:t})=>{requestAnimationFrame(()=>{o.reset({country:e,postalCode:t})}),m.current=!0};if(n&&e)return void r({country:e.details.country,postalCode:e.details.postalCode});if((d?.country.trim().length||d?.postal_code.trim().length)&&l?.length){let t=l.find(e=>e.value===d?.country)?.value,n=e?.details.country||"";r({country:t||n,postalCode:d?.postal_code||""})}},[o,s,d,l]),"pending"===p||"pending"===u)?(0,t.jsx)(ev,{}):l?(0,t.jsx)(em,{countries:l}):null},em=({countries:e})=>(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:grid md:grid-cols-2",children:[(0,t.jsx)(ef,{countries:e}),(0,t.jsx)(eg,{})]}),ef=(0,n.memo)(({countries:e})=>{let n=(0,l.useTranslations)("Payments"),r=(0,z.useFormContext)();return(0,t.jsx)(W.Field,{control:r.control,name:"country",render:({field:{onChange:o,...a}})=>(0,t.jsxs)(W.Item,{children:[(0,t.jsx)(W.Label,{"aria-required":!0,children:n("billing_info_country_label")}),(0,t.jsx)(W.Control,{children:(0,t.jsxs)($.Root,{...a,onValueChange:e=>{r.setValue("country",e),r.trigger("postalCode")},children:[(0,t.jsx)(X.Trigger,{asChild:!0,"aria-label":n("billing_info_country_placeholder"),className:"w-full",children:(0,t.jsxs)(G.Button,{id:a.name,className:"h-9 justify-between",children:[(0,t.jsx)(Z.Value,{placeholder:n("billing_info_country_placeholder")}),(0,t.jsx)(ee.TriggerArrow,{})]})}),(0,t.jsx)(et.Content,{align:"start",className:"max-h-40",children:e.map(e=>(0,t.jsx)(en.Item,{value:e.value,asChild:!0,children:(0,t.jsxs)(G.Button,{children:[(0,t.jsx)(Z.ItemText,{children:e.label}),(0,t.jsx)(er.ItemIndicator,{})]})},e.value))})]})}),(0,t.jsx)(W.Message,{})]})})}),eh={zip:"billing_info_zip_code_label",postal:"billing_info_postal_code_label"},ey={zip:"billing_info_zip_code_placeholder",postal:"billing_info_postal_code_placeholder"},eg=()=>{let e=(0,l.useTranslations)("Payments"),r=(0,z.useFormContext)(),o=(0,z.useWatch)({control:r.control,name:"country"})||"",a=(0,n.useMemo)(()=>{let t=es.get(o)??null;return t?e(eh[t.type]):e("billing_info_postal_code_label")},[o,e]),s=(0,n.useMemo)(()=>{let t=es.get(o)??null;
1return t?e(ey[t.type],{allowedFormatExamples:t.validExamples.join(", ")}):e("billing_info_postal_code_placeholder")},[o,e]);return(0,n.useMemo)(()=>es.has(o),[o])?(0,t.jsx)(W.Field,{control:r.control,name:"postalCode",render:({field:e})=>(0,t.jsxs)(W.Item,{children:[(0,t.jsx)(W.Label,{"aria-required":!0,children:a}),(0,t.jsx)(W.Control,{children:(0,t.jsx)(Q.Root,{type:"text",placeholder:s,autoComplete:"billing zip-code postal-code",...e})}),(0,t.jsx)(W.Message,{})]})}):null},ev=()=>{let e=(0,l.useTranslations)("Payments"),r=(0,c.useSession)(),o=(0,n.useMemo)(()=>es.has(r.country),[r.country]);return(0,t.jsxs)("div",{className:"flex flex-col gap-3 md:grid md:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(Y.Label,{children:[e("billing_info_country_label")," *"]}),(0,t.jsx)(E.BaseSkeleton,{className:"h-9 w-full rounded"})]}),o&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(Y.Label,{children:[e("billing_info_zip_code_label")," *"]}),(0,t.jsx)(E.BaseSkeleton,{className:"h-9 w-full rounded"})]})]})};e.s(["BillingInfoFormWrapper",0,ep],850113);let eb=({selfUserHasCards:e,isPaymentMethodPage:o=!1})=>{let i=(0,l.useTranslations)("Payments"),m=(0,s.useQueryClient)(),f="authenticated"===(0,c.useSession)().status,h=(0,r.useStripe)(),y=(0,r.useElements)(),{refetch:P}=(0,a.useQuery)({...u.UserQueries.getPaymentProfile(f),select:e=>e?.payment_profile}),[x,C]=(0,n.useState)(!1),[j,M]=(0,n.useState)(!1),[T,N]=(0,n.useState)(!1),k=(0,S.usePaymentDialogStore)(e=>e.paymentPayload),O=(0,S.usePaymentDialogStore)(e=>e.setPaymentMethodCaptcha),I=(0,S.usePaymentDialogStore)(e=>e.setCurrentView),A=(0,S.usePaymentDialogStore)(e=>e.closeDialog),F=(0,S.usePaymentDialogStore)(e=>e.selectedPaymentMethod),D=(0,S.usePaymentDialogStore)(e=>e.setSelectedPaymentMethod),[U,R]=(0,n.useState)(!e),[B,q]=(0,n.useState)(null),[z,H]=(0,n.useState)(!0),[J,Z]=(0,n.useState)(null),[$,X]=(0,n.useState)(""),ee=(0,g.useFlag)(v.FlagKey.FSP),et=(0,g.useFlag)(v.FlagKey.PaymentsDisabled),en=u.UserMutations.useChangeDefaultPaymentMethod(f),er=(0,n.useMemo)(()=>F&&(0,S.isCustomPaymentMethod)(F)?S.CUSTOM_PAYMENT_METHODS[F.provider].requirements:new Set,[F]),eo=ed(),ea=es.get("IN"),ei=F?.provider==="card"&&"IN"===J,el=!!ea?.regex.test($.trim()),eu=async()=>{if(q(null),M(!0),er.has(S.CUSTOM_PAYMENT_REQUIREMENTS.billingInfo)&&F&&(0,S.isCustomPaymentMethod)(F)&&"paypal"===F.provider){let e=eo.getValues();await m.ensureQueryData(u.UserQueries.getPaymentProfile(f)),m.setQueryData(u.UserQueries.getPaymentProfile(f).queryKey,e=>!e||e.payment_profile.cards.some(e=>e.id===F?.id)?e:{payment_profile:{...e.payment_profile,cards:[...e.payment_profile.cards,{id:F.id,brand:F.provider,last4:null,exp_month:null,exp_year:null,is_default:U}]}}),D({id:F.id,provider:F.provider,details:{country:e.country,postalCode:e.postalCode}})}I("PAYMENT")},ec=async()=>{let e,t,n,r;if(!y||!h)return;q(null),M(!0);let a=await h.confirmSetup({elements:y,redirect:"if_required",confirmParams:{return_url:(e=new URLSearchParams(window.location.search),U&&e.set("set_default_payment_method","true"),(t=k?.type!=="kicks"?k?.channelSlug:void 0)&&e.set("channel_slug",t),(n=k?.type!=="kicks"?k?.channelId:void 0)&&e.set("channel_id",n.toString()),k?.type&&e.set("payment_dialog_type",k.type),(r=new URL(window.location.href)).search=`${e}`,(0,d.logger)().info("After action redirect URI",{redirectUri:r.toString(),setDefaultPaymentMethod:U,paymentPayload:k}),`${r}`),...ei?{payment_method_data:{billing_details:{address:{postal_code:$.trim()}}}}:{}}});if(a.error)(0,d.logger)().warn("Error when adding new payment method",{error:a.error,errorType:"stripeError"}),q(i("error_add_payment_method")),M(!1);else{let e=await P(),t=e?.data?.cards.find(e=>a.setupIntent.payment_method===e.id);U&&t&&!(0,L.paymentMethodProviderIsCustom)(t.brand)?(o||D({provider:t.brand,id:t.id}),en?en.mutate({payment_method_id:t.id},{onSettled:()=>{M(!1),o?A():I("PAYMENT")},onSuccess:e=>{e&&(b.toast.success(i("success_update_default_payment_method")),m.setQueryData(u.UserQueries.getPaymentProfile(f).queryKey,t=>t?{payment_profile:{...t.payment_profile,cards:e.cards}}:t))},onError:e=>{(0,d.logger)().warn("Error when updating default payment method",{error:e,payment_method_id:t.id}),b.toast.error(i("error_update_default_payment_method"))}}):(M(!1),o||I("PAYMENT"))):(M(!1),b.toast.success(i("success_add_payment_method")),o?A():I("PAYMENT"))}},em=e&&!(0,S.selectedPaymentMethodIsStripeCustom)(F?.id||"");return(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded lg:gap-4",children:[(0,t.jsxs)("div",{className:(0,w.cn)("flex min-h-[367px] w-full flex-col gap-2 rounded bg-surface-bg-highest p-4 sm:min-h-[350px] md:min-
1h-[272px]",!o&&"bg-surface-bg-default px-0 py-2 lg:p-4"),children:[z&&(0,t.jsx)(E.BaseSkeleton,{className:"h-[367px] w-full bg-kick-asphaltBlack-900 sm:h-[350px] md:h-[272px]"}),(0,t.jsx)(r.PaymentElement,{className:(0,w.cn)(z&&"hidden"),onChange:e=>{if(!z){if(Z(e.value.billingDetails?.address?.country??null),er.has(S.CUSTOM_PAYMENT_REQUIREMENTS.billingInfo)||eo.reset(),(0,S.selectedPaymentMethodIsStripeCustom)(e.value.type)){R(!1);var t=e.value.type;let n=Object.values(S.CUSTOM_PAYMENT_METHODS).find(e=>e.id===t);if(n?.provider==="paypal"){let e=eo.getValues();D({provider:"paypal",id:t,details:{country:e.country,postalCode:e.postalCode}})}}else D({provider:e.value.type,id:""});e.complete?C(!0):C(!1)}},onReady:()=>H(!1),options:{paymentMethodOrder:ee&&k?.type!=="kicks"?["card","amazon_pay",p.env.NEXT_PUBLIC_STRIPE_PAYPAL_CUSTOM_PAYMENT_METHOD_ID,"cashapp_pay"]:void 0}}),ei&&!z&&(0,t.jsxs)("div",{className:(0,w.cn)("flex flex-col gap-2",!o&&"rounded bg-surface-bg-highest p-4"),children:[(0,t.jsx)("span",{className:"text-base font-bold",children:i("billing_info_section_label")}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)(Y.Label,{"aria-required":!0,children:i("billing_info_postal_code_label")}),(0,t.jsx)(Q.Root,{type:"text",inputMode:"numeric",autoComplete:"billing postal-code",placeholder:i("billing_info_postal_code_placeholder",{allowedFormatExamples:ea?.validExamples.join(", ")??""}),value:$,onChange:e=>X(e.target.value)}),$.trim().length>0&&!el&&(0,t.jsx)("p",{className:"text-sm text-surface-feedback-fg-critical",children:i("billing_info_postal_code_invalid",{allowedFormatExamples:ea?.validExamples.join(", ")??""})})]})]}),B&&(0,t.jsx)("p",{className:"text-sm text-surface-feedback-fg-critical",children:B}),F&&(0,S.selectedPaymentMethodIsStripeCustom)(F.id)&&er.has("billing_info")&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 pt-2",children:[(0,t.jsx)("span",{className:"text-base font-bold",children:i("billing_info_section_label")}),(0,t.jsx)(W.Root,{...eo,children:(0,t.jsx)(ep,{})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(_.CheckboxRoot,{onCheckedChange:e=>"boolean"==typeof e&&R(e),id:"default-method",checked:U,disabled:!em}),(0,t.jsx)("label",{"aria-disabled":!em,className:(0,w.cn)("cursor-pointer text-sm font-semibold transition-opacity aria-disabled:cursor-not-allowed aria-disabled:opacity-50"),htmlFor:"default-method",children:i("set_as_default_method")})]}),(0,t.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,t.jsx)(G.Button,{className:"flex-1",type:"button",variant:"highlight",disabled:j,onClick:()=>{e&&!o?(O(null),I("PAYMENT")):A()},children:i("button_label_cancel")}),(0,t.jsx)(V.Tooltip,{text:i("payments_temporarily_disabled"),rootProps:{open:et&&T,onOpenChange:N},children:(0,t.jsx)("span",{className:"block min-w-0 flex-1",children:(0,t.jsx)(G.Button,{className:"w-full items-center gap-2",disabled:et||!x||j||er.has("billing_info")&&!eo.formState.isValid||ei&&!el,onClick:()=>{F&&((0,S.selectedPaymentMethodIsStripeCustom)(F?.id)?eu():ec())},children:(0,t.jsx)(K.ContentOrLoader,{loading:j,children:i("button_label_save_payment_method")})})})})]})]})};e.i(147969);var eP=e.i(334377);let ex=({onContinue:e,onSetup:n})=>{let r=(0,l.useTranslations)("Payments");return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 p-4 text-center","data-testid":"two-factor-warning",children:[(0,t.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-surface-bg-highest",children:(0,t.jsx)(C.LockIcon,{className:"size-6 text-brand-bg-default"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-lg font-semibold text-white",children:r("two_factor_warning_title")}),(0,t.jsx)("span",{className:"text-sm text-surface-fg-subtle",children:r("two_factor_warning_description")})]}),(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,t.jsx)(eP.InternalLink,{href:"/settings/security",variant:"primary",size:"md",onClick:n,"data-testid":"two-factor-warning-setup",children:r("two_factor_warning_setup")}),(0,t.jsx)(G.Button,{variant:"transparent",size:"md",onClick:e,"data-testid":"two-factor-warning-continue",children:r("two_factor_warning_continue")})]})]})};e.s(["AddPaymentMethodWrapper",0,({selfUserHasCards:e,isPaymentMethodPage:m=!1})=>{let f=(0,l.useTranslations)("Payments"),h=(0,c.useSession)(),C="authenticated"===h.status,[_,E]=(0,n.use
1State)(!1),j="authenticated"===h.status&&!h.user.has2faEnabled&&!_,w=(0,i.useLocale)(),M=(0,s.useQueryClient)(),T=(0,n.useRef)(null),N=(0,n.useRef)(!1),k=(0,g.useFlag)(v.FlagKey.FSP),O=(0,S.usePaymentDialogStore)(e=>e.clientSecret),I=(0,S.usePaymentDialogStore)(e=>e.paymentMethodCaptcha),A=(0,S.usePaymentDialogStore)(e=>e.paymentPayload),F=(0,S.usePaymentDialogStore)(e=>e.setClientSecret),D=(0,S.usePaymentDialogStore)(e=>e.setPaymentMethodCaptcha),U=(0,S.usePaymentDialogStore)(e=>e.setCurrentView),R=(0,S.usePaymentDialogStore)(e=>e.setPaymentError),B=(0,S.usePaymentDialogStore)(e=>e.closeDialog),{data:L}=(0,a.useQuery)({...u.UserQueries.getPaymentProfile(C),select:e=>e?.payment_profile}),G=u.UserMutations.useAddPaymentMethod(C),K=(0,o.useMutationState)({filters:{mutationKey:["User","AddPaymentMethod"],status:"pending"}},M).length>0,Y=(0,n.useCallback)(()=>{m||!e?(b.toast.error(f("error_loading_payment_form")),B()):(R(f("error_loading_payment_form")),U("PAYMENT"))},[m,e,B,R,U,f]),W=(0,n.useCallback)(async()=>{let e=T.current;if(!e){(0,d.logger)().warn("[recaptcha] captcha not ready"),Y();return}await e.execute()},[Y]);if((0,n.useEffect)(()=>{!I||O||K||G?.mutate({reCaptcha:I,redirectUri:window.location.href},{onSuccess:e=>{e&&F(e.client_secret)},onError:e=>{(0,d.logger)().warn("Error when adding payment method",{error:e}),D(null),Y()}})},[O,I,K,F,D,G,Y]),(0,n.useEffect)(()=>{j||N.current||(N.current=!0,W())},[j,W]),j)return(0,t.jsx)(ex,{onContinue:()=>E(!0),onSetup:B});if(!I)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pointer-events-none absolute top-0 left-0 size-px overflow-hidden opacity-0",children:(0,t.jsx)(y,{ref:T,onVerify:t=>{t?D(t):m||!e?(b.toast.error(f("error_loading_payment_form")),B()):(R(f("error_loading_payment_form")),U("PAYMENT"))},onError:Y})}),(0,t.jsx)(q,{})]});if(K&&I)return(0,t.jsx)(q,{});if(O&&I&&!K&&L){let n=!!L.cards.find(e=>"paypal"===e.brand),o=A&&!n&&(0,P.providerSupportsProductType)("paypal",A.type)&&k;return(0,t.jsx)(r.Elements,{stripe:(0,x.getStripe)(w),options:{appearance:{theme:"night"},clientSecret:O,customPaymentMethods:o?[{id:p.env.NEXT_PUBLIC_STRIPE_PAYPAL_CUSTOM_PAYMENT_METHOD_ID,options:{type:"static"}}]:void 0},children:(0,t.jsx)(eb,{selfUserHasCards:e,isPaymentMethodPage:m})})}return(0,t.jsx)(q,{})}],89885)},430497,629999,e=>{"use strict";var t=e.i(341648),n=e.i(606092),r=e.i(675898),o=e.i(643892);let a={paypal:["subscription","gift"],upi:["gift","kicks"],pix:["gift","kicks"]};function s(e,t){return!(e in a)||a[e].includes(t)}e.s(["productTypesByProvider",0,a,"providerSupportsProductType",0,s],629999);let i={billingInfo:"billing_info"},l={paypal:{provider:"paypal",id:r.env.NEXT_PUBLIC_STRIPE_PAYPAL_CUSTOM_PAYMENT_METHOD_ID,requirements:new Set([i.billingInfo]),supported_products:new Set(a.paypal)}},u={isDialogOpen:!1,isAnonymousGift:!1,currentView:null,viewHistory:[],clientSecret:null,paymentMethodCaptcha:null,promptPaymentCaptcha:!1,paymentCaptcha:null,paymentPayload:null,paymentError:null,selectedPaymentMethod:null,kicksQuantity:1},c=(0,n.createZustandContext)(e=>(0,t.createStore)((t,n)=>({...e,setIsAnonymousGift:e=>t({isAnonymousGift:e}),setSelectedPaymentMethod:e=>{let r=n().paymentPayload?.type;r&&!s(e.provider,r)?t({selectedPaymentMethod:null}):t({selectedPaymentMethod:e})},setCurrentView:e=>t({currentView:e,viewHistory:e?[e,...n().viewHistory]:[]}),setPaymentPayload:e=>{let r=n().selectedPaymentMethod;r&&!s(r.provider,e.type)&&t({selectedPaymentMethod:null}),t({paymentPayload:e})},setClientSecret:e=>t({clientSecret:e}),setPaymentMethodCaptcha:e=>t({paymentMethodCaptcha:e}),setPromptPaymentCaptcha:e=>t({promptPaymentCaptcha:e}),setPaymentCaptcha:e=>t({paymentCaptcha:e}),setPaymentError:e=>t({paymentError:e}),setKicksQuantity:e=>t({kicksQuantity:e}),openDialog:()=>t({isDialogOpen:!0}),closeDialog:()=>t(u)}))),d=c.Provider,p=c.useStore;e.s(["CUSTOM_PAYMENT_METHODS",0,l,"CUSTOM_PAYMENT_REQUIREMENTS",0,i,"PaymentDialogProvider",0,d,"initialPaymentDialogState",0,u,"isCustomPaymentMethod",0,e=>o.customPaymentMethodProviders.includes(e.provider),"selectedPaymentMethodIsStripeCustom",0,e=>e.startsWith("cpmt_"),"usePaymentDialogStore",0,p],430497)},100352,e=>{"use strict";var t=e.i(100054),n=e.i(620577);function r({locale:e,...o}){if(!e)throw Error(void 0);return(0,t.jsx)(n.IntlProvider,{locale:e,...o})}var o=e.i(378734),o=o;function a(e){e.code,o.a.MISSING_MESSAGE}e.s(["IntlProvider",0,({locale:e,messages:n,now:o,children:s})=>(0,t.jsx)(r,{locale:e,timeZone:"UTC",messages:n,onError:a,now:o,children:s})],100352)},31023,e=>{"use strict";e.s(["countryCodes",0,["AD","TT","RS","GB","RU","HK","EH","UY","BB","PS","MX","MW","AQ","NC","SJ","NF","CX","MN","LV","BN","UA","KP","FI","AI","AZ","KY","UZ","IE","JE","RW","BA","PL","PT","HT","IR","TF","ET","KZ","ML","NI","DE","EE","TN","MF","CM","FM","SX","CY","MA","PN","CW","AW","ES","GA","A
1X","DK","MQ","AG","SZ","TW","VU","CK","CC","CV","BY","CZ","PE","TL","NA","TK","CD","LC","SR","BI","GE","GH","IO","EG","GF","MH","GW","FJ","ZM","IS","BM","BR","PW","SD","AU","KH","NZ","PH","BF","FO","SL","GD","BO","CH","VC","EC","SC","ZA","IN","LR","KR","LT","SG","PR","BZ","NL","ER","MS","RE","GS","BD","YE","NO","SI","OM","MZ","LY","TD","GY","KG","DJ","MP","US","TG","LK","KM","CU","GU","AR","WF","BT","LB","HM","LS","SO","DM","HU","LU","SM","AF","MR","DZ","GP","HR","BG","NU","ID","BE","NR","PF","IQ","MG","VN","MU","AS","CI","BQ","LI","IT","KN","QA","TR","VI","AO","KE","SA","SS","TC","CA","NE","GI","KW","VE","GM","PY","CL","MK","MO","AM","BW","NP","ST","BJ","SB","GN","YT","GL","MC","PK","MY","XK","MD","TV","PM","SN","PA","MT","UG","AL","AE","CR","BL","SH","IL","AT","LA","FR","PG","DO","TO","JM","BV","SK","KI","JO","MV","ME","JP","SV","CO","ZW","GQ","CN","HN","IM","CG","MM","GR","WS","FK","TZ","CF","RO","UM","TJ","BS","NG","VA","BH","TH","SE","VG","GG","GT","SY","TM"],"getCountryFromCode",0,(e,t)=>new Intl.DisplayNames([e],{type:"region"}).of(t)])},643892,e=>{"use strict";let t=["paypal"];e.s(["customPaymentMethodProviders",0,t,"paymentMethodProviderIsCustom",0,e=>t.includes(e)])},369837,e=>{"use strict";let t;var n,r="basil",o="https://js.stripe.com",a="".concat(o,"/").concat(r,"/stripe.js"),s=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,l=function(){for(var e=document.querySelectorAll('script[src^="'.concat(o,'"]')),t=0;t<e.length;t++){var n,r=e[t];if(n=r.src,s.test(n)||i.test(n))return r}return null},u=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(a).concat(t);var r=document.head||document.body;if(!r)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(n),n},c=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"7.9.0",startTime:t})},d=null,p=null,m=null,f=function(e,t,n){if(null===e)return null;var o,a=t[0].match(/^pk_test/),s=3===(o=e.version)?"v3":o;a&&s!==r&&console.warn("Stripe.js@".concat(s," was loaded on the page, but @stripe/stripe-js@").concat("7.9.0"," expected Stripe.js@").concat(r,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var i=e.apply(void 0,t);return c(i,n),i},h=!1,y=function(){return n||(n=(null!==d?d:(d=new Promise(function(e,t){if("u"<typeof window||"u"<typeof document)return void e(null);if(window.Stripe,window.Stripe)return void e(window.Stripe);try{var n,r=l();r?r&&null!==m&&null!==p&&(r.removeEventListener("load",m),r.removeEventListener("error",p),null==(n=r.parentNode)||n.removeChild(r),r=u(null)):r=u(null),m=function(){window.Stripe?e(window.Stripe):t(Error("Stripe.js not available"))},p=function(e){t(Error("Failed to load Stripe.js",{cause:e}))},r.addEventListener("load",m),r.addEventListener("error",p)}catch(e){t(e);return}})).catch(function(e){return d=null,Promise.reject(e)})).catch(function(e){return n=null,Promise.reject(e)}))};Promise.resolve().then(function(){return y()}).catch(function(e){h||console.warn(e)});var g=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];h=!0;var r=Date.now();return y().then(function(e){return f(e,t,r)})},v=e.i(675898);let b=async e=>{let t=e.path??"",n=t?.replace(/^\/+/,"");if("string"!=typeof n||0===n.length)throw Error("Invalid path");let r=e.clientSecret;if("string"!=typeof r||0===r.length)throw Error("Invalid client secret");let o=e.query||{},a=e.body||{},s=e.method||"GET",i=new URLSearchParams({...o,key:v.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY,client_secret:r}).toString(),l="POST"===s?JSON.stringify(a):void 0,u=await fetch(`https://api.stripe.com/v1/${n}?${i}`,{headers:{"Content-Type":"application/json"},method:s,body:l});if(!1===u.ok)try{return u.json()}catch(e){return null}return u.json()};e.s(["executePublicStripeV1APICall",0,b,"getStripe",0,e=>(t||(t=g(v.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY,{locale:e})),t)],369837)},619345,(e,t,n)=>{e.e,function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?n(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=e&&("u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=o){var a=[],s=!0,i=!1;try{for(o=o.call(e);!(s=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);s=!0);}catch(e){i=!0,r=e}finally{try{s||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var u,c,d,p,m,f={exports:{}};f.exports=(function(){if(m)return p;m=1;var e=d?c:(d=1,c="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,p=function(){function r(t,n,r,o,a,s){if(s!==e){var i=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function o(){return r}r.isRequired=r;var a={array:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a}})()();var h=(u=f.exports)&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u,y=function(e,n,r){var o=!!r,a=t.useRef(r);t.useEffect(function(){a.current=r},[r]),t.useEffect(function(){if(!o||!e)return function(){};var t=function(){a.current&&a.current.apply(a,arguments)};return e.on(n,t),function(){e.off(n,t)}},[o,n,e,a])},g=function(e){var n=t.useRef(e);return t.useEffect(function(){n.current=e},[e]),n.current},v=function(e){return null!==e&&"object"===o(e)},b="[object Object]",P=function e(t,n){if(!v(t)||!v(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var o=Object.prototype.toString.call(t)===b;if(o!==(Object.prototype.toString.call(n)===b))return!1;if(!o&&!r)return t===n;var a=Object.keys(t),s=Object.keys(n);if(a.length!==s.length)return!1;for(var i={},l=0;l<a.length;l+=1)i[a[l]]=!0;for(var u=0;u<s.length;u+=1)i[s[u]]=!0;var c=Object.keys(i);return c.length===a.length&&c.every(function(r){return e(t[r],n[r])})},x=function(e,t,n){return v(e)?Object.keys(e).reduce(function(o,s){var i=!v(t)||!P(e[s],t[s]);return n.includes(s)?(i&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),o):i?r(r({},o||{}),{},a({},s,e[s])):o},null):null},S="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S;if(null===e||v(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment)return e;throw Error(t)},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S;if(v(e)&&"function"==typeof e.then)return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return C(e,t)})};var n=C(e,t);return null===n?{tag:"empty"}:{tag:"sync",stripe:n}},E=function(e){e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"3.10.0"}),e.registerAppInfo({name:"react-stripe-js",version:"3.10.0",url:"https://stripe.com/docs/stripe-js/react"}))},j=t.createContext(null);j.displayName="ElementsContext";var w=function(e,t){if(!e)throw Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},M=function(e){var n=e.stripe,r=e.options,o=e.children,a=t.useMemo(function(){return _(n)},[n]),s=i(t.useState(function(){return{stripe:"sync"===a.tag?a.stripe:null,elements:"sync"===a.tag?a.stripe.elements(r):null}}),2),l=s[0],u=s[1];t.useEffect(function(){var e=!0,t=function(e){u(function(t){return t.stripe?t:{stripe:e,elements:e.elements(r)}})};return"async"!==a.tag||l.stripe?"sync"!==a.tag||l.stripe||t(a.stripe):a.stripePromise.then(function(n){n&&e&&t(n)}),function(){e=!1}},[a,l,r]);var c=g(n);t.useEffect(function(){null!==c&&c!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[c,n]);var d=g(r);return t.useEffect(function(){if(l.elements){var e=x(r,d,["clientSecret","fonts"]);e&&l.elements.update(e)}},[r,d,l.elements]),t.useEffect(function(){E(l.stripe)},[l.stripe]),t.createElement(j.Provider,{value:l},o)};M.propTypes={stripe:h.any,options:h.object};var T=function(e){return w(t.useContext(j),e)},N=function(e){return(0,e.children)(T("mounts <ElementsConsumer>"))};N.propTypes={children:h.func.isRequired};var k=["on","session"],O=t.createContext(null);
1O.displayName="CheckoutSdkContext";var I=function(e,t){if(!e)throw Error("Could not find CheckoutProvider context; You need to wrap the part of your app that ".concat(t," in an <CheckoutProvider> provider."));return e},A=t.createContext(null);A.displayName="CheckoutContext";var F=function(e,t){if(!e)return null;e.on,e.session;var n=s(e,k);return t?Object.assign(t,n):Object.assign(e.session(),n)},D=function(e){var n=e.stripe,r=e.options,o=e.children,a=t.useMemo(function(){return _(n,"Invalid prop `stripe` supplied to `CheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},[n]),s=i(t.useState(null),2),l=s[0],u=s[1],c=i(t.useState(function(){return{stripe:"sync"===a.tag?a.stripe:null,checkoutSdk:null}}),2),d=c[0],p=c[1],m=function(e,t){p(function(n){return n.stripe&&n.checkoutSdk?n:{stripe:e,checkoutSdk:t}})},f=t.useRef(!1);t.useEffect(function(){var e=!0;return"async"!==a.tag||d.stripe?"sync"===a.tag&&a.stripe&&!f.current&&(f.current=!0,a.stripe.initCheckout(r).then(function(e){e&&(m(a.stripe,e),e.on("change",u))})):a.stripePromise.then(function(t){t&&e&&!f.current&&(f.current=!0,t.initCheckout(r).then(function(e){e&&(m(t,e),e.on("change",u))}))}),function(){e=!1}},[a,d,r,u]);var h=g(n);t.useEffect(function(){null!==h&&h!==n&&console.warn("Unsupported prop change on CheckoutProvider: You cannot change the `stripe` prop after setting it.")},[h,n]);var y=g(r),v=g(d.checkoutSdk);t.useEffect(function(){if(d.checkoutSdk){var e,t,n,o,a=!!(!v&&d.checkoutSdk),s=null==y||null==(e=y.elementsOptions)?void 0:e.appearance,i=null==r||null==(t=r.elementsOptions)?void 0:t.appearance,l=!P(i,s);i&&(l||a)&&d.checkoutSdk.changeAppearance(i);var u=null==y||null==(n=y.elementsOptions)?void 0:n.fonts,c=null==r||null==(o=r.elementsOptions)?void 0:o.fonts,p=!P(u,c);c&&(p||a)&&d.checkoutSdk.loadFonts(c)}},[r,y,d.checkoutSdk,v]),t.useEffect(function(){E(d.stripe)},[d.stripe]);var b=t.useMemo(function(){return F(d.checkoutSdk,l)},[d.checkoutSdk,l]);return d.checkoutSdk?t.createElement(O.Provider,{value:d},t.createElement(A.Provider,{value:b},o)):null};D.propTypes={stripe:h.any,options:h.shape({fetchClientSecret:h.func.isRequired,elementsOptions:h.object}).isRequired};var U=function(e){var n=t.useContext(O),r=t.useContext(j);if(n&&r)throw Error("You cannot wrap the part of your app that ".concat(e," in both <CheckoutProvider> and <Elements> providers."));return n?I(n,e):w(r,e)},R=["mode"],B=function(e,n){var r="".concat(e.charAt(0).toUpperCase()+e.slice(1),"Element"),o=n?function(e){U("mounts <".concat(r,">"));var n=e.id,o=e.className;return t.createElement("div",{id:n,className:o})}:function(n){var o,a=n.id,l=n.className,u=n.options,c=void 0===u?{}:u,d=n.onBlur,p=n.onFocus,m=n.onReady,f=n.onChange,h=n.onEscape,v=n.onClick,b=n.onLoadError,P=n.onLoaderStart,S=n.onNetworksChange,C=n.onConfirm,_=n.onCancel,E=n.onShippingAddressChange,j=n.onShippingRateChange,w=n.onSavedPaymentMethodRemove,M=n.onSavedPaymentMethodUpdate,T=U("mounts <".concat(r,">")),N="elements"in T?T.elements:null,k="checkoutSdk"in T?T.checkoutSdk:null,O=i(t.useState(null),2),I=O[0],A=O[1],F=t.useRef(null),D=t.useRef(null);y(I,"blur",d),y(I,"focus",p),y(I,"escape",h),y(I,"click",v),y(I,"loaderror",b),y(I,"loaderstart",P),y(I,"networkschange",S),y(I,"confirm",C),y(I,"cancel",_),y(I,"shippingaddresschange",E),y(I,"shippingratechange",j),y(I,"savedpaymentmethodremove",w),y(I,"savedpaymentmethodupdate",M),y(I,"change",f),m&&(o="expressCheckout"===e?m:function(){m(I)}),y(I,"ready",o),t.useLayoutEffect(function(){if(null===F.current&&null!==D.current&&(N||k)){var t=null;if(k)switch(e){case"payment":t=k.createPaymentElement(c);break;case"address":if("mode"in c){var n=c.mode,o=s(c,R);if("shipping"===n)t=k.createShippingAddressElement(o);else if("billing"===n)t=k.createBillingAddressElement(o);else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":t=k.createExpressCheckoutElement(c);break;case"currencySelector":t=k.createCurrencySelectorElement();break;case"taxId":t=k.createTaxIdElement(c);break;default:throw Error("Invalid Element type ".concat(r,". You must use either the <PaymentElement />
1, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else N&&(t=N.create(e,c));F.current=t,A(t),t&&t.mount(D.current)}},[N,k,c]);var B=g(c);return t.useEffect(function(){if(F.current){var e=x(c,B,["paymentRequest"]);e&&"update"in F.current&&F.current.update(e)}},[c,B]),t.useLayoutEffect(function(){return function(){if(F.current&&"function"==typeof F.current.destroy)try{F.current.destroy(),F.current=null}catch(e){}}},[]),t.createElement("div",{id:a,className:l,ref:D})};return o.propTypes={id:h.string,className:h.string,onChange:h.func,onBlur:h.func,onFocus:h.func,onReady:h.func,onEscape:h.func,onClick:h.func,onLoadError:h.func,onLoaderStart:h.func,onNetworksChange:h.func,onConfirm:h.func,onCancel:h.func,onShippingAddressChange:h.func,onShippingRateChange:h.func,onSavedPaymentMethodRemove:h.func,onSavedPaymentMethodUpdate:h.func,options:h.object},o.displayName=r,o.__elementType=e,o},q="u"<typeof window,L=t.createContext(null);L.displayName="EmbeddedCheckoutProviderContext";var G=function(){var e=t.useContext(L);if(!e)throw Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");return e},K=q?function(e){var n=e.id,r=e.className;return G(),t.createElement("div",{id:n,className:r})}:function(e){var n=e.id,r=e.className,o=G().embeddedCheckout,a=t.useRef(!1),s=t.useRef(null);return t.useLayoutEffect(function(){return!a.current&&o&&null!==s.current&&(o.mount(s.current),a.current=!0),function(){if(a.current&&o)try{o.unmount(),a.current=!1}catch(e){}}},[o]),t.createElement("div",{ref:s,id:n,className:r})},Y=B("auBankAccount",q),W=B("card",q),Q=B("cardNumber",q),V=B("cardExpiry",q),z=B("cardCvc",q),H=B("fpxBank",q),J=B("iban",q),Z=B("idealBank",q),$=B("p24Bank",q),X=B("epsBank",q),ee=B("payment",q),et=B("expressCheckout",q),en=B("currencySelector",q),er=B("paymentRequestButton",q),eo=B("linkAuthentication",q),ea=B("address",q),es=B("shippingAddress",q),ei=B("paymentMethodMessaging",q),el=B("affirmMessage",q),eu=B("afterpayClearpayMessage",q),ec=B("taxId",q);e.AddressElement=ea,e.AffirmMessageElement=el,e.AfterpayClearpayMessageElement=eu,e.AuBankAccountElement=Y,e.CardCvcElement=z,e.CardElement=W,e.CardExpiryElement=V,e.CardNumberElement=Q,e.CheckoutProvider=D,e.CurrencySelectorElement=en,e.Elements=M,e.ElementsConsumer=N,e.EmbeddedCheckout=K,e.EmbeddedCheckoutProvider=function(e){var n=e.stripe,r=e.options,o=e.children,a=t.useMemo(function(){return _(n,"Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},[n]),s=t.useRef(null),l=t.useRef(null),u=i(t.useState({embeddedCheckout:null}),2),c=u[0],d=u[1];t.useEffect(function(){if(!l.current&&!s.current){var e=function(e){l.current||s.current||(l.current=e,s.current=l.current.initEmbeddedCheckout(r).then(function(e){d({embeddedCheckout:e})}))};"async"===a.tag&&!l.current&&(r.clientSecret||r.fetchClientSecret)?a.stripePromise.then(function(t){t&&e(t)}):"sync"===a.tag&&!l.current&&(r.clientSecret||r.fetchClientSecret)&&e(a.stripe)}},[a,r,c,l]),t.useEffect(function(){return function(){c.embeddedCheckout?(s.current=null,c.embeddedCheckout.destroy()):s.current&&s.current.then(function(){s.current=null,c.embeddedCheckout&&c.embeddedCheckout.destroy()})}},[c.embeddedCheckout]),t.useEffect(function(){E(l)},[l]);var p=g(n);t.useEffect(function(){null!==p&&p!==n&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.")},[p,n]);var m=g(r);return t.useEffect(function(){if(null!=m){if(null==r)return void console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.");void 0===r.clientSecret&&void 0===r.fetchClientSecret&&console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."),null!=m.clientSecret&&r.clientSecret!==m.clientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=m.fetchClientSecret&&r.fetchClientSecret!==m.fetchClientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=m.onComplete&&r.onComplete!==m.onComplete&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it."),null!=m.onShippingDetailsChange&&r.onShippingDetailsChange!==m.onShippingDetailsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it."),null!=m.onLineItemsChange&&r.onLineItemsChange!==m.onLineItemsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.")}},[m,r]),t.createElement(L.Provider,{value:c},o)},e.EpsBankElement=X,e.ExpressCheckoutElement=et,e.FpxBankElement=H,e.IbanElement=J,e.IdealBankElement=Z,e.LinkAuthenticationElement=eo,e.P24BankElement=$,e.PaymentElement=ee,e.PaymentMethodMessagingElement=ei,e.PaymentRequestButtonElement=er,e.ShippingAddressElement=es,e.TaxIdElement=ec,e.useCheckout=function(){I(t.useContext(O),"calls useCheckout()");var e=t.useContext(A);if(!e)throw Error("Could not find Checkout Context; You need to wrap the part of your app that calls useCheckout() in an <CheckoutProvider> provider.");return e},e.useElements=function(){return T("calls useElements()").elements},e.useStripe=function(){return U("calls useStripe()").stripe}}(n,e.r(673781))}]);
2
3//# sourceMappingURL=2_2t1hloyaqu7.js.map

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.