1var C=Object.defineProperty,M=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var f=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var v=(e,a,t)=>a in e?C(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,l=(e,a)=>{for(var t in a||(a={}))w.call(a,t)&&v(e,t,a[t]);if(f)for(var t of f(a))D.call(a,t)&&v(e,t,a[t]);return e},c=(e,a)=>M(e,O(a));var h=(e,a,t)=>new Promise((d,u)=>{var y=o=>{try{s(t.next(o))}catch(m){u(m)}},p=o=>{try{s(t.throw(o))}catch(m){u(m)}},s=o=>o.done?d(o.value):Promise.resolve(o.value).then(y,p);s((t=t.apply(e,a)).next())});import{j as i,P as N,i as _,B as q}from"./npm.sellpy-design-system.DdsWMDHW.bundle.js";import{c as $,F as B}from"./npm.react-hook-form.HNw-giVQ.bundle.js";import{b as E,N as z}from"./npm.react-router.BDfxye5A.bundle.js";import{an as F,S as U,aI as R,y as K,aJ as L,aK as G,ag as Q}from"./index.DWkcZ-_z.bundle.js";import{u as W}from"./useUserTotalBalance.DWvVnMXx.bundle.js";import{B as J,P as Y,O as H}from"./OptInAutomaticPayouts.QBoknNmT.bundle.js";import{P as X,a as Z,b as ee}from"./PayoutBreadcrumbs.CWpOIKHo.bundle.js";import{n as ae,c as te}from"./utils.DGZXBK23.bundle.js";import{u as ie}from"./useDac7BlocksForUser.CRK7cdXQ.bundle.js";import{g as P}from"./getPayouts.CXzG0GUC.bundle.js";import{s as I}from"./utils.CspTTAAr.bundle.js";import{e as ne}from"./tools.DUKVunGT.bundle.js";import{C as oe}from"./CharityOptions.BQNY8iax.bundle.js";import{i as re}from"./npm.apollo-client.CXJpJPbe.bundle.js";import{u as ue}from"./npm.react-i18next.BwOa93YU.bundle.js";import{aI as A,ad as S}from"./npm.sellpy-commons.B413ARrd.bundle.js";import"./npm.react-dom.DlIYrMBD.bundle.js";import"./npm.styled-components.CzYR6Qdp.bundle.js";import"./npm.luxon.3NOFZn7k.bundle.js";import"./npm.zod.DEnjmUYT.bundle.js";import"./npm.lodash.DxN61Y-S.bundle.js";import"./npm.parse.BcWrqAIh.bundle.js";import"./npm.sentry-react.Z7tY98T1.bundle.js";import"./npm.swr.CiJqMJM6.bundle.js";import"./npm.algolia.BDObKZ-5.bundle.js";import"./npm.i18next.B74d65Th.bundle.js";import"./translations.B5c9TvV-.bundle.js";import"./npm.graphql.ClDiDpi3.bundle.js";import"./npm.immutable.DTQZtUT4.bundle.js";import"./errors.dMazk1gb.bundle.js";import"./itemStatus.BI0rbHvu.bundle.js";import"./DonationSvg.pEh3kTSx.bundle.js";try{let e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="78559a4c-f2fd-458a-90fe-c2187a15a7eb",e._sentryDebugIdIdentifier="sentry-dbid-78559a4c-f2fd-458a-90fe-c2187a15a7eb")}catch(e){}{let e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=Object.assign({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:sellpy-market":!0})}const se=`mutation requestCharityPayout( 2 $amount: Int! 3 $currency: String! 4 $region: String! 5 $origin: String 6 $charityOrganizationId: ID 7 $updateAutomaticPayoutMethod: Boolean 8) { 9 payOut: requestCharityPayout( 10 amount: $amount 11 currency: $currency 12 region: $region 13 origin: $origin 14 charityOrganizationId: $charityOrganizationId 15 updateAutomaticPayoutMethod: $updateAutomaticPayoutMethod 16 ) 17} 18`,me={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"requestCharityPayout"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"amount"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"currency"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"region"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}
18,{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"origin"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"charityOrganizationId"}},type:{kind:"NamedType",name:{kind:"Name",value:"ID"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"updateAutomaticPayoutMethod"}},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"payOut"},name:{kind:"Name",value:"requestCharityPayout"},arguments:[{kind:"Argument",name:{kind:"Name",value:"amount"},value:{kind:"Variable",name:{kind:"Name",value:"amount"}}},{kind:"Argument",name:{kind:"Name",value:"currency"},value:{kind:"Variable",name:{kind:"Name",value:"currency"}}},{kind:"Argument",name:{kind:"Name",value:"region"},value:{kind:"Variable",name:{kind:"Name",value:"region"}}},{kind:"Argument",name:{kind:"Name",value:"origin"},value:{kind:"Variable",name:{kind:"Name",value:"origin"}}},{kind:"Argument",name:{kind:"Name",value:"charityOrganizationId"},value:{kind:"Variable",name:{kind:"Name",value:"charityOrganizationId"}}},{kind:"Argument",name:{kind:"Name",value:"updateAutomaticPayoutMethod"},value:{kind:"Variable",name:{kind:"Name",value:"updateAutomaticPayoutMethod"}}}],directives:[]}]}}],loc:{start:0,end:450,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:se}}},de=me,Ke=()=>{const e=E(),{t:a}=ue(["balance","common"]),[t]=W(),d=F(),u=$({mode:"onChange"}),[y]=re(de,{onCompleted:n=>
18{var r;e(`/charityPayoutComplete/${(r=n==null?void 0:n.payOut)==null?void 0:r.objectId}`)},refetchQueries:[{query:P,variables:{userId:d.objectId,regions:I(),statuses:[A.ORDERED]}},{query:P,variables:{userId:d.id,regions:I(),statuses:[A.COMPLETED]}}],onError:n=>{Q(te(n,a))}}),{handleSubmit:p,register:s,setValue:o,formState:{errors:m,isValid:T,isSubmitting:g}}=u,{dac7PayoutBlock:j}=ie(),x=n=>h(null,null,function*(){const r=n.updateAutomaticPayouts==="true";yield y({variables:c(l({},S({amount:n.amount,currency:t.currency})),{region:K(),origin:window.location.origin,charityOrganizationId:n.charityOrganizationId,updateAutomaticPayoutMethod:r})}),r&&(ne(),L({payoutType:"bank",clickSource:window.location.pathname,settingAction:"signup"})),G({payoutType:"charity",updateAutomaticPayouts:n.updateAutomaticPayouts,amount:S({amount:n.amount,currency:t.currency}),clickSource:window.location.pathname})}),V=n=>{const r=ae({amount:n});o("amount",r,{shouldValidate:!0})};if(!t)return i.jsx(U,{});const{amount:k,currency:b}=t;return j?i.jsx(z,{to:"/balance",replace:!0}):i.jsxs(i.Fragment,{children:[i.jsx(X,{type:"charity"}),i.jsx(B,c(l({},u),{children:i.jsx("form",{onSubmit:p(x),children:i.jsx(Z,{children:i.jsxs(ee,{children:[i.jsx(N,{design:"h4",children:a("charity.payout.header")}),i.jsx(J,{balance:t}),i.jsxs(R,{as:"div",children:[i.jsx(_,c(l({},s("amount",{valueAsNumber:!0,required:a("common:genericErrors.required"),max:{value:k,message:a("charity.input.max",{amount:k,currency:b})},validate:{onlyNumbers:n=>Number(n)?null:a("payout.only.number")}})),{rightAddon:i.jsx(N,{noMargin:!0,design:"body1",children:b}),onChange:n=>V(n.target.value),errors:m,label:a("payout.input.amount")})),i.jsx(Y,{balance:t})]}),i.jsx(oe,{}),i.jsx(H,{labelKey:"optIn.charity.title"}),i.jsx(q,{type:"submit",variant:"filled",label:a("charity.donation.button"),disabled:!T||g,loading:g})]})})})}))]})};export{Ke as default}; 19//# sourceMappingURL=CharityPayout.CNz1_7Fm.bundle.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.