1import{u as j,j as a,q as E,T as J,U as y}from"./vendor-BJ3uik3T.js";import{b0 as $,bj as Y,bK as Z,a6 as g,am as F,aX as T,bf as w,a_ as V,bg as I,bh as v,ad as L,bp as f,a2 as P,bo as h,be as ee}from"./index-BdHWJevn.js";import{M as ae}from"./shared_molecule_ModalContentContainer-g38S1XFh.js";import{b as K,c as Q,d as U,p as ie}from"./admin_util_paymentMechanisms-D9ch4bM_.js";import{U as ne}from"./admin_graphql_cities_mutationHooks-D4THARDz.js";import{c as te}from"./admin_atom_DetailContent-uErtev3T.js";import{D as se}from"./admin_organism_DetailsHeader-aembUJ2W.js";import{Checkbox as oe}from"./shared_atom_CheckboxManualCSS-DKZLlaii.js";import A from"./shared_atom_FormattedIntlMessage-CkhsIM0d.js";import{FormSectionTitle as b,FormGroupContainer as x,FormHelpText as H,FormBelowFieldHelpText as M}from"./shared_atom_FormContent-De-QUBRC.js";import R from"./shared_molecule_CheckboxGroup-xtP_gWsI.js";import{j as me}from"./admin_util_events-CDx9Qx0Y.js";import{b as G}from"./admin_util_optionLists-DzKBkYAO.js";import{B as S}from"./admin_molecule_TextfieldContent-DDn9z5jQ.js";import{A as re}from"./admin_organism_ArtistCompensationTierFormFields-DSKDq0dI.js";import X from"./shared_molecule_RadioGroupManualCSS-DjUTR0OS.js";import{g as _}from"./admin_util_artistPayments-ob-JfCxW.js";import{b as O,i as de}from"./admin_util_validations-oevat9LV.js";import"./shared_util_socialLinks-BUK1mzxs.js";import"./shared_util_useModal-C6VgIZRP.js";import"./shared_molecule_ConfirmationModal-S_zbfig9.js";import"./shared_molecule_RoutableModal-CSxrs0tv.js";import"./shared_atom_ImageManualCSS-DFms6Rab.js";import"./admin_molecule_EventPlannerUtils-BYmGdmpO.js";import"./shared_atom_TruncatedByCharText-B-GpcpQN.js";import"./shared_atom_ToolTipManualCSS-cpCWt9VR.js";import"./shared_atom_LoadingBlocksManualCSS-CC3tM7yU.js";import"./admin_molecule_DetailsTitle-ChDGppgH.js";import"./shared_atom_ModalTitle-CnIbEa0R.js";import"./shared_util_optionDependencies-CSAdqNuC.js";import"./shared_util_events-DUuYv7l4.js";import"./admin_util_users-BVPaQwFX.js";import"./shared_atom_RadioManualCSS-DN2tB80V.js";const le=E.div` 2 padding-bottom: 40px; 3`,ce=E.div` 4 font-weight: 600; 5 padding-bottom: 10px; 6`,ue=e=>G(K(e)),pe=e=>e=="automated_payments_or_none"?"automated_payments":(e=="manual_payments_or_none","manual_payments"),ye={artistAllowedPaymentMechanisms:"artistPaymentMechanism",audioAllowedPaymentMechanisms:"audioPaymentMechanism",supportAllowedPaymentMechanisms:"supportPaymentMechanism",nonAudioProductionAllowedPaymentMechanisms:"nonAudioProductionPaymentMechanism"},W=({payableGroup:e,labelIntlId:n,fieldName:i,values:o,setValues:l,country:p})=>{const t=j(),d=K(t).manual_payments_or_none,s=c=>{const u=ye[i],C=c!=o[i]?{[i]:c,[u]:pe(c)}:{[i]:c};l({...o,...C})};return a.jsxs(le,{children:[a.jsx(ce,{children:t.formatMessage({id:n})}),Q(p)?a.jsx(X,{name:i,options:ue(t),selectedValue:o[i],onChange:s}):U(e,p)?a.jsx(a.Fragment,{children:d}):a.jsx(a.Fragment,{children:t.formatMessage({id:"admin.notApplicable"})})]})},fe=({values:e,setValues:n,country:i})=>{const o=j();return a.jsxs(a.Fragment,{children:[a.jsx(b,{children:o.formatMessage({id:"admin.cityFinancialsInfo.form.paymentTypesAllowed"})}),a.jsxs(x,{children:[a.jsx(H,{children:a.jsx(A,{id:"admin.cityFinancialsInfo.form.paymentTypesAllowedHelpText"})}),a.jsx(W,{payableGroup:"artist",labelIntlId:"admin.cityFinancialsInfo.form.artists",fieldName:"artistAllowedPaymentMechanisms",values:e,setValues:n,country:i}),a.jsx(W,{payableGroup:"audio",labelIntlId:"admin.cityFinancialsInfo.form.audio",fieldName:"audioAllowedPaymentMechanisms",values:e,setValues:n,country:i}),a.jsx(W,{payableGroup:"support",labelIntlId:"admin.cityFinancialsInfo.form.support",fieldName:"supportAllowedPaymentMechanisms",values:e,setValues:n,country:i}),a.jsx(W,{payableGroup:"non_audio_production",labelIntlId:"admin.cityFinancialsInfo.form.nonAudioProduction",fieldName:"nonAudioProductionAllowedPaymentMechanisms",values:e,setValues:n,country:i})]})]})},he=E.div` 7 padding-bottom: 40px; 8`,Ce=E.div` 9 font-weight: 600; 10 padding-bottom: 10px; 11`,ge=(e,n)=>Q(n)?e:"manual_payments_or_none",Me=(e,n)=>{let i="";return n=="automated_payments_or_none"?i="manual_payments":n=="manual_payments_or_none"&&(i="automated_payments"),G($(ie(e),[i]))},z=({payableGroup:e,fieldName:n,labelIntlId:i,values:o,setFieldValue:l,allowedPaymentMechanisms:p,country:t})=>{const d=j(),s=ge(p,t),c=Me(d,s);return a.jsxs(he,{children:[a.jsx(Ce,{children:d.formatMessage({id:i}
11)}),U(e,t)?a.jsx(X,{name:n,options:c,selectedValue:o[n],onChange:u=>l(n,u)}):a.jsx(a.Fragment,{children:d.formatMessage({id:"admin.notApplicable"})})]})},Ae=({values:e,setFieldValue:n,country:i})=>{const o=j();return a.jsxs(a.Fragment,{children:[a.jsx(b,{children:o.formatMessage({id:"admin.cityFinancialsInfo.form.defaultPaymentType"})}),a.jsxs(x,{children:[a.jsx(H,{children:a.jsx(A,{id:"admin.cityFinancialsInfo.form.defaultPaymentTypeHelpText"})}),a.jsx(z,{payableGroup:"artist",fieldName:"artistPaymentMechanism",labelIntlId:"admin.cityFinancialsInfo.form.artists",values:e,setFieldValue:n,allowedPaymentMechanisms:e.artistAllowedPaymentMechanisms,country:i}),a.jsx(z,{payableGroup:"audio",fieldName:"audioPaymentMechanism",labelIntlId:"admin.cityFinancialsInfo.form.audio",values:e,setFieldValue:n,allowedPaymentMechanisms:e.audioAllowedPaymentMechanisms,country:i}),a.jsx(z,{payableGroup:"support",fieldName:"supportPaymentMechanism",labelIntlId:"admin.cityFinancialsInfo.form.support",values:e,setFieldValue:n,allowedPaymentMechanisms:e.supportAllowedPaymentMechanisms,country:i}),a.jsx(z,{payableGroup:"non_audio_production",fieldName:"nonAudioProductionPaymentMechanism",labelIntlId:"admin.cityFinancialsInfo.form.nonAudioProduction",values:e,setFieldValue:n,allowedPaymentMechanisms:e.nonAudioProductionAllowedPaymentMechanisms,country:i})]})]})},be=E.div` 12 font-weight: 600; 13`,xe=({formikProps:e,currencyCode:n,country:i})=>{const o=j(),{setFieldValue:l,setValues:p,touched:t,errors:d,values:s}=e,c=s.isTieredArtistCompensationEnabled||s.countryIsTieredArtistCompensationEnabled,u=Y(n),C=G($(me(o),["curator_owner_noncommercial_event"]));return a.jsxs(Z,{dataQaId:"city-financials-info-section-edit-form",children:[a.jsx(b,{children:o.formatMessage({id:"admin.cityFinancialsInfo.form.eventOrganizedAsesForArtist"})}),a.jsxs(x,{children:[a.jsx(H,{children:a.jsx(A,{id:"admin.cityFinancialsInfo.form.eventOrganizedAsesForArtistHelpText"})}),a.jsx(R,{name:"event-organized-ases-for-artist",options:C,selectedValues:s.eventOrganizedAsesWithArtistPayments,onChange:r=>l("eventOrganizedAsesWithArtistPayments",r)})]}),a.jsx(b,{children:o.formatMessage({id:"admin.cityFinancialsInfo.form.eventOrganizedAsesForCrew"})}),a.jsxs(x,{children:[a.jsx(H,{children:a.jsx(A,{id:"admin.cityFinancialsInfo.form.eventOrganizedAsesForCrewHelpText"})}),a.jsx(R,{name:"event-organized-ases-for-crew",options:C,selectedValues:s.eventOrganizedAsesWithCrewPayments,onChange:r=>l("eventOrganizedAsesWithCrewPayments",r)})]}),a.jsx(fe,{values:s,setValues:p,country:i}),a.jsx(Ae,{values:s,setFieldValue:l,country:i}),a.jsx(b,{children:o.formatMessage({id:"admin.citySettings.form.artistCompensation"})}),a.jsxs(x,{children:[a.jsx(oe,{id:"city-settings-form-is-tiered-artist-compensation-enabled-field","data-qaid":"city-settings-form-is-tiered-artist-compensation-enabled-field",checked:s.isTieredArtistCompensationEnabled,name:"isTieredArtistCompensationEnabled",onChange:r=>l("isTieredArtistCompensationEnabled",r.target.checked),children:o.formatMessage({id:"admin.citySettings.form.useTieredArtistCompensation"})}),a.jsx(g,{mb:4}),a.jsxs(M,{children:["(",a.jsx(A,{id:s.countryIsTieredArtistCompensationEnabled?"admin.citySettings.form.useTieredArtistCompensationEnabledHelpText":"admin.citySettings.form.useTieredArtistCompensationDisabledHelpText",values:{countryTitle:(i==null?void 0:i.title)||""}}),")"]}),a.jsx(g,{mb:9}),a.jsx(be,{children:o.formatMessage({id:"admin.shared.nonTieredArtistCompensationWithCurrencySymbol"},{currencySymbol:u})}),a.jsx(g,{mb:6}),a.jsx(F,{"data-qaid":"city-settings-form-artist-compensation-formgroup",label:"",errorMsg:w("artistCompensation",t,d),children:a.jsxs(a.Fragment,{children:[a.jsx(S,{"data-qaid":"city-settings-form-artist-compensation",id:"artistCompensation",name:"artistCompensation",value:s.artistCompensation,onChange:r=>{l("artistCompensation",r.target.value)},maxLength:10,disabled:c}),a.jsxs(M,{children:["(",a.jsx(A,{id:"admin.citySettings.form.nonTieredArtistCompensationFormHelpText",values:{countryValue:T({value:s.countryDefaultArtistCompensation,currencyCode:s.currencyCode})}}),")"]})]})}),a.jsx(g,{mb:9}),a.jsx(re,{formikProps:e,currencyCode:n,isTieredArtistCompensationEnabled:c})]}),a.jsx(b,{children:o.formatMessage({id:"admin.citySettings.form.teamCompensation"})}),a.jsxs(x,{children:[a.jsx(F,{"data-qaid":"city-settings-form-audio-compensation-formgroup",label:o.formatMessage({id:"admin.citySettings.form.audioCompensationWithCurrencySymbol"},{currencySymbol:u}),errorMsg:w("audioCompensation",t,d),children:a.jsxs(a.Fragment,{children:[a.jsx(S,{"data-qaid":"city-settings-form-audio-compensation",id:"audioCompensation",name:"audioCompensation",value:s.audioCompensation,onChange:r=>{l("audioCompensation",r.target.value)},maxLength:10}),a.jsxs(M,{children:["(",V(s.countryAudioCompensation)?o.formatMessage({id:"admin.shared.fallbacks.cityUsesCountryValueWithTeamMember"},{countryValue:T({value:s.countryAudioCompensation,currencyCode:s.currencyCode})}):o.formatMessage({id:"admin.shared.fallbacks.eventUsesNoValueBecauseNoCountryValue"}),")"]})]})}),a.jsx(g,{mb:6}),a.jsx(F,{"data-qaid":"city-settings-form-lead-compensation-formgroup",label:o.formatMessage({id:"admin.citySettings.form.leadCompensationWithCurrencySymbol"},{currencySymbol:u}),errorMsg:w("leadCompensation",t,d),children:a.jsxs(a.Fragment,{children:[a.jsx(S,{"data-qaid":"city-settings-form-lead-compensation",id:"leadCompensation",name:"leadCompensation",value:s.leadCompensation,onChange:r=>{l("leadCompensation",r.target.value)},maxLength:10}),a.jsxs(M,{children:["(",V(s.countryLeadCompensation)?o.formatMessage({id:"admin.shared.fallbacks.cityUsesCountryValueWithTeamMember"},{countryValue:T({value:s.countryLeadCompensation,currencyCode:s.currencyCode})}):o.formatMessage({id:"admin.shared.fallbacks.eventUsesNoValueBecauseNoCountryValue"}),")"]})]})}),a.jsx(g,{mb:6}),a.jsx(F,{"data-qaid":"city-settings-form-mc-compensation-formgroup",label:o.formatMessage({id:"admin.citySettings.form.mcCompensationWithCurrencySymbol"},{currencySymbol:u}),errorMsg:w("mcCompensation",t,d),children:a.jsxs(a.Fragment,{children:[a.jsx(S,{"data-qaid":"city-settings-form-mc-compensation",id:"mcCompensation",name:"mcCompensation",value:s.mcCompensation,onChange:r=>{l("mcCompensation",r.target.value)},maxLength:10}),a.jsxs(M,{children:["(",V(s.countryMcCompensation)?o.formatMessage({id:"admin.shared.fallbacks.cityUsesCountryValueWithTeamMember"},{countryValue:T({value:s.countryMcCompensation,currencyCode:s.currencyCode})}):o.formatMessage({id:"admin.shared.fallbacks.eventUsesNoValueBecauseNoCountryValue"}),")"]})]})}),a.jsx(g,{mb:6}),a.jsx(F,{"data-qaid":"city-settings-form-support-compensation-formgroup",label:o.formatMessage({id:"admin.citySettings.form.supportCompensationWithCurrencySymbol"},{currencySymbol:u}),errorMsg:w("supportCompensation",t,d),children:a.jsxs(a.Fragment,{children:[a.jsx(S,{"data-qaid":"city-settings-form-support-compensation",id:"supportCompensation",name:"supportCompensation",value:s.supportCompensation,onChange:r=>{l("supportCompensation",r.target.value)},maxLength:10}),a.jsxs(M,{children:["(",V(s.countrySupportCompensation)?o.formatMessage({id:"admin.shared.fallbacks.cityUsesCountryValueWithTeamMember"},{countryValue:T({value:s.countrySupportCompensation,currencyCode:s.currencyCode})}):o.formatMessage({id:"admin.shared.fallbacks.eventUsesNoValueBecauseNoCountryValue"}),")"]})]})})]})]})},je=(e,n)=>J().shape({artistCompensation:y().nullable().trim().test("invalid-artist-compensation",I({fieldDisplayName:e.formatMessage({id:"admin.citySettings.form.artistCompensationForError"}),intl:e,currencyCode:n}),function(i){return i?v({value:i||"",currencyCode:n}):!0}).test("max-artist-compensation",e.formatMessage({id:"admin.eventTicketingInfo.artistCompensationTooHighError"}),i=>de(i,n)),artistCompensationTier1:_(y().nullable(),e,n),artistCompensationTier2:_(y().nullable(),e,n),artistCompensationTier3:_(y().nullable(),e,n),artistCompensationTier4:_(y().nullable(),e,n),artistCompensationTier5:_(y().nullable(),e,n),audioCompensation:y().nullable().trim().test("invalid-audio-compensation",I({fieldDisplayName:e.formatMessage({id:"admin.citySettings.form.audioEngineerFeeForError"}),intl:e,currencyCode:n}),function(i){return i?v({value:i||"",currencyCode:n}):!0}).test("max-audio-compensation",e.formatMessage({id:"admin.eventTicketingInfo.audioCompensationTooHighError"}),i=>O(i,n)),leadCompensation:y().nullable().trim().test("invalid-lead-compensation",I({fieldDisplayName:e.formatMessage({id:"admin.citySettings.form.leadFeeForError"}),intl:e,currencyCode:n}),function(i){return i?v({value:i||"",currencyCode:n}):!0}).test("max-lead-compensation",e.formatMessage({id:"admin.eventTicketingInfo.leadCompensationTooHighError"}),i=>O(i,n)),mcCompensation:y().nullable().trim().test("invalid-mc-compensation",I({fieldDisplayName:e.formatMessage({id:"admin.citySettings.form.mcFeeForError"}),intl:e,currencyCode:n}),function(i){return i?v({value:i||"",currencyCode:n}):!0}).test("max-mc-compensation",e.formatMessage({id:"admin.eventTicketingInfo.mcCompensationTooHighError"}),i=>O(i,n)),supportCompensation:y().nullable().trim().test("invalid-support-compensation",I({fieldDisplayName:e.formatMessage({id:"admin.citySettings.form.supportFeeForError"}),intl:e,currencyCode:n}),function(i){return i?v({value:i||"",currencyCode:n}):!0}).test("max-support-compensation",e.formatMessage({id:"admin.eventTicketingInfo.supportCompensationTooHighError"}),i=>O(i,n))}),k=(e,n,i)=>U(e,i)?n:null,N=e=>e,na=({contentProps:e,setFormSubmitAction:n,setDisplayConfirmation:i,setIsSubmitting:o,navigateTo:l})=>{var C,r,q,B,D;const p=j(),t=e==null?void 0:e.currencyCode,d=e==null?void 0:e.country,s={currencyCode:t,eventOrganizedAsesWithArtistPayments:(e==null?void 0:e.eventOrganizedAsesWithArtistPayments)||[],eventOrganizedAsesWithCrewPayments:(e==null?void 0:e.eventOrganizedAsesWithCrewPayments)||[],artistAllowedPaymentMechanisms:(e==null?void 0:e.artistAllowedPaymentMechanisms)||"",audioAllowedPaymentMechanisms:(e==null?void 0:e.audioAllowedPaymentMechanisms)||"",supportAllowedPaymentMechanisms:(e==null?void 0:e.supportAllowedPaymentMechanisms)||"",nonAudioProductionAllowedPaymentMechanisms:(e==null?void 0:e.nonAudioProductionAllowedPaymentMechanisms)||"",artistPaymentMechanism:(e==null?void 0:e.artistPaymentMechanism)||"",audioPaymentMechanism:(e==null?void 0:e.audioPaymentMechanism)||"",supportPaymentMechanism:(e==null?void 0:e.supportPaymentMechanism)||"",nonAudioProductionPaymentMechanism:(e==null?void 0:e.nonAudioProductionPaymentMechanism)||"",artistCompensation:f(e,"artistCompensation",t),artistCompensationTier1:f(e,"artistCompensationTier1",t),artistCompensationTier2:f(e,"artistCompensationTier2",t),artistCompensationTier3:f(e,"artistCompensationTier3",t),artistCompensationTier4:f(e,"artistCompensationTier4",t),artistCompensationTier5:f(e,"artistCompensationTier5",t),audioCompensation:f(e,"audioCompensation",t),leadCompensation:f(e,"leadCompensation",t),mcCompensation:f(e,"mcCompensation",t),supportCompensation:f(e,"supportCompensation",t),countryTieredArtistCompensation:e==null?void 0:e.countryTieredArtistCompensation,countryDefaultArtistCompensation:e==null?void 0:e.countryDefaultArtistCompensation,countryAudioCompensation:(C=e==null?void 0:e.country)==null?void 0:C.audioCompensation,countryLeadCompensation:(r=e==null?void 0:e.country)==null?void 0:r.leadCompensation,countryMcCompensation:(q=e==null?void 0:e.country)==null?void 0:q.mcCompensation,countrySupportCompensation:(B=e==null?void 0:e.country)==null?void 0:B.supportCompensation,isTieredArtistCompensationEnabled:L(e,"isTieredArtistCompensationEnabled",!1),countryIsTieredArtistCompensationEnabled:(D=e==null?void 0:e.country)==null?void 0:D.isTieredArtistCompensationEnabled},c=ne(),u=P({submitAction:c,submitVariables:m=>({cityId:L(e,"id",void 0),eventOrganizedAsesWithArtistPayments:m.eventOrganizedAsesWithArtistPayments,eventOrganizedAsesWithCrewPayments:m.eventOrganizedAsesWithCrewPayments,artistAllowedPaymentMechanisms:k("artist",m.artistAllowedPaymentMechanisms,d),audioAllowedPaymentMechanisms:k("audio",m.audioAllowedPaymentMechanisms,d),supportAllowedPaymentMechanisms:k("support",m.supportAllowedPaymentMechanisms,d),nonAudioProductionAllowedPaymentMechanisms:k("non_audio_production",m.nonAudioProductionAllowedPaymentMechanisms,d),artistPaymentMechanism:N(m.artistPaymentMechanism),audioPaymentMechanism:N(m.audioPaymentMechanism),supportPaymentMechanism:N(m.supportPaymentMechanism),nonAudioProductionPaymentMechanism:N(m.nonAudioProductionPaymentMechanism),artistCompensation:h(m.artistCompensation,void 0,t),artistCompensationTier1:h(m.artistCompensationTier1,void 0,t),artistCompensationTier2:h(m.artistCompensationTier2,void 0,t),artistCompensationTier3:h(m.artistCompensationTier3,void 0,t),artistCompensationTier4:h(m.artistCompensationTier4,void 0,t),artistCompensationTier5:h(m.artistCompensationTier5,void 0,t),audioCompensation:h(m.audioCompensation,void 0,t),leadCompensation:h(m.leadCompensation,void 0,t),mcCompensation:h(m.mcCompensation,void 0,t),supportCompensation:h(m.supportCompensation,void 0,t),isTieredArtistCompensationEnabled:m.isTieredArtistCompensationEnabled}),successMsg:p.formatMessage({id:"admin.cityBasicInfo.form.successMessage"}),failureMsg:p.formatMessage({id:"admin.cityBasicInfo.form.failureMessage"}),onSuccess:m=>{l({routeName:"city-details",routeProps:{defaultOpenSection:"financialsInfo",...m.data.updateCity.city}})}});return a.jsx(ae,{children:a.jsxs(te,{children:[a.jsx(se,{title:L(e,"title","")}),a.jsx(ee,{formInitialValues:s,renderFormComponent:m=>a.jsx(xe,{formikProps:m.formikProps,currencyCode:t,country:d}),onSubmit:u,formSchema:je(p,t),setFormSubmitAction:n,setDisplayConfirmation:i,setIsSubmitting:o,dataQaId:"city-financials-info-section-edit-form"})]})})};export{na as default}; 14//# sourceMappingURL=admin_organism_CityFinancialsEdit-D4OKUNtB.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.