AdsEventsManagerSingleSourceCustomConversionCreationModal.react",["fbt","AdsCustomConversionCustomEventAPICreatableType","AdsEventsManagerCustomConversionCreationCleanupErrorStatusAction","AdsEventsManagerCustomConversionCreationSuccessContentContainer.react","AdsEventsManagerCustomConversionCreationUtils","AdsEventsManagerCustomConversionRuleUtils","AdsEventsManagerLoggingScopesEnum","AdsEventsManagerMaguxLoggerHelper","AdsEventsManagerSingleSourceCustomConversionCreationDialog.react","AdsEventsManagerUpdateCustomConversionCreationStatusAction","AdsGoalServerCreatedGoalDataAction","AdsGraphAPI","AdsPixelConversionStandardEvents","CustomConversionCreationUtils","CustomConversionRuleSerializationUtil","GeoButton.react","GeoModal.react","GeoModalFooter.react","GeoModalHeader.react","GeoSection.react","OffsiteCustomEventType","SignalsCustomConversionLoggerHelper","SignalsLoggingBoundary.react","SignalsWebsiteOptimizedCustomConversionsDeleteAction","promiseDone","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||(i=d("react"));b=i;var k=b.useEffect,l=b.useState,m=h._("Create a custom conversion"),n=h._("Success"),o=1760002;function a(a){var b=a.conversionData,e=a.metaData,g=a.modalData,i=a.ruleSet,p=a.onBack,q=a.onClose,r=a.isLoading;r=r===void 0?!1:r;var s=a.logger,t=a.objective,u=a.onSuccess,v=i.selectedActionSource,w=i.selectedDataSource,x=i.selectedEvent,y=i.ruleList,z=g.adAccountID,A=g.businessID;a=g.defaultDataSourceID;var B=g.defaultDataSourceType;g=g.modalType;var C=e.conversionName,D=e.conversionCategory,E=e.conversionValue,F=e.conversionDescription,G=l(!0),H=G[0],I=G[1];G=l(!1);var J=G[0],K=G[1];G=!1;if(y)for(var L=y,M=Array.isArray(L),N=0,L=M?L:L[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var O;if(M){if(N>=L.length)break;O=L[N++]}else{N=L.next();if(N.done)break;O=N.value}O=O;O.parameterValues&&(G=d("AdsEventsManagerCustomConversionRuleUtils").isValidCustomConversionRule(O.parameterValues));if(G)break}k(function(){I(d("AdsEventsManagerCustomConversionCreationUtils").creationValidationCheck(C,D,i)!=null),d("AdsEventsManagerCustomConversionCreationUtils").creationValidationCheck(C,D,i)===null&&c("AdsEventsManagerCustomConversionCreationCleanupErrorStatusAction").dispatch({},{line:"149",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js",moduleID:f.id})},[D,C,i]);O=b.conversion;N=function(){s.logCustomActionUseSparingly("CREATE_CUSTOM_CONVERSION");I(!0);K(!0);var a={},b=d("AdsEventsManagerCustomConversionCreationUtils").buildRawRules(v,w,x,y);b=d("CustomConversionRuleSerializationUtil").serializeRules(b);if(D!=null)a.custom_event_type=c("AdsCustomConversionCustomEventAPICreatableType")[D];else if(w!=null)if(w.type==="DATA_SET")a.custom_event_type=c("OffsiteCustomEventType")[c("AdsPixelConversionStandardEvents").Purchase.custom_event_type];else if(x!=null){var e=d("CustomConversionCreationUtils").getStandardEventsDetails(w),g=x.name;e=e[g];e!=null&&(a.custom_event_type=c("OffsiteCustomEventType")[e.custom_event_type])}E!=null&&(a.default_conversion_value=E);F!=null&&(a.description=F);C!=null&&(a.name=C);z!=null?a.account_id=z:A!=null&&(a.business=A);a.advanced_rule=b;var h={adAccountID:z,businessID:A,dataSourceID:w!=null?w.id:null,dataSourceType:w!=null?w.type:null,scope:"CUSTOM_CONVERSION_CREATION_MODAL"};z!=null?c("promiseDone")(d("AdsGraphAPI").get(f.id).adaccount(z).edge("customconversions").post(a),function(a){K(!1),u&&u(a.id),c("AdsEventsManagerUpdateCustomConversionCreationStatusAction").dispatch({conversion:{id:a.id}},{line:"231",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js",moduleID:f.id}),c("SignalsWebsiteOptimizedCustomConversionsDeleteAction").dispatch({adAccountID:z},{line:"237",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js",moduleID:f.id}),c("AdsGoalServerCreatedGoalDataAction").dispatch({data:{newCustomConversionCreationFlow:!0},feedback:{customConversionID:a.id}},{line:"243",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js",moduleID:f.id}),d("SignalsCustomConversionLoggerHelper").logCreateSuccess(babelHelpers["extends"]({},h,{customConversionID:a.id})),d("AdsEventsManagerMaguxLoggerHelper").logClickSuccess({hasOptOut3PD:!1,sourceKey:"em_create_custom_conversion_task"})},function(a){K(!1),c("AdsEventsManagerUpdateCustomConversionCreationStatusAction").dispatch({conversion:{errorMessage:d("AdsEventsManagerCustomConversionCreationUtils").getCreationErrorMessage(a),id:null}},{line:"261",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js",moduleID:f.id}),a.error_subcode===o?d("SignalsCustomConversionLoggerHelper").logCreateError(babelHelpers["extends"]({},h,{action:"signals_custom_conversion_duplicate_rule_warning",error:a})):d("SignalsCustomConversionLoggerHelper").logCreateError(babelHelpers["extends"]({},h,{error:a}))}):A!=null&&c("promiseDone")(d("AdsGraphAPI").get(f.id).object("business",A).edge("customconversions").post(a),function(a){K(!1),u&&u(a.id),c("AdsEventsManagerUpdateCustomConversionCreationStatusAction").dispatch({conversion:{id:a.id}},{line:"292",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js",moduleID:f.id}),d("SignalsCustomConversionLoggerHelper").logCreateSuccess(babelHelpers["extends"]({},h,{customConversionID:a.id}))},function(a){K(!1),c("AdsEventsManagerUpdateCustomConversionCreationStatusAction").dispatch({conversion:{errorMessage:d("AdsEventsManagerCustomConversionCreationUtils").getCreationErrorMessage(a),id:null}},{line:"303",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js",moduleID:f.id}),a.error_subcode===o?d("SignalsCustomConversionLoggerHelper").logCreateError(babelHelpers["extends"]({},h,{action:"signals_custom_conversion_duplicate_rule_warning",error:a})):d("SignalsCustomConversionLoggerHelper").logCreateError(babelHelpers["extends"]({},h,{error:a}))})};M=(O==null?void 0:O.id)!=null;return j.jsx(c("GeoModal.react"),{"data-testid":void 0,footer:j.jsx(c("GeoModalFooter.react"),{primaryButton:j.jsx(c("GeoButton.react"),{autoFocus:!0,"data-testid":void 0,isDisabled:G||H&&!M||r,isLoading:J,label:M?h._("Done"):h._("Create"),variant:"primary",onClick:M?q:N}),secondaryButton:M?null:j.jsx(c("GeoButton.react"),{autoFocus:!0,isDisabled:r||J,label:p!=null?h._("Back"):h._("Cancel"),onClick:p!=null?p:q})}),header:j.jsx(c("GeoModalHeader.react"),{heading:M?n:m}),isShown:g!==null,label:M?n:m,onHide:q,children:j.jsx(c("GeoSection.react"),{children:M?j.jsx(c("AdsEventsManagerCustomConversionCreationSuccessContentContainer.react"),{adAccountID:z,businessID:A,conversionID:O==null?void 0:O.id,conversionName:C,selectedDataSource:w,selectedEvent:x}):j.jsx(c("AdsEventsManagerSingleSourceCustomConversionCreationDialog.react"),{adAccountID:z,businessID:A,defaultDataSourceID:a,defaultDataSourceType:B,errorMessage:O==null?void 0:O.errorMessage,metaData:e,objective:t})})})}a.displayName=a.name+" [from "+f.id+"]";e=c("SignalsLoggingBoundary.react").loggerConsumingComponent(a,function(a){return a.scope(c("AdsEventsManagerLoggingScopesEnum").CUSTOM_CONVERSIONS)},{disableSessionCreation:!0});g["default"]=e}),226);
-----
CollaborationHubSharingDialog.react",["AdsCustomConversionCustomEventAPICreatableType","AdsEventsManagerCustomConversionCreationUtils","AdsEventsManagerCustomConversionRuleSetProvider","AdsEventsManagerUpdateCustomConversionRuleSetAction","AdsFluxHooks","AdsInterfacesRouter","AdsProductSetConvertFilterFromUISpecToAPISpec","AdsProductSetUtils","AgencyPermissionUpdateErrorAction","AgencyPermissionUpdateSuccessAction","AsyncRequest","AsyncTypedRequest","CPASAAMSMarketplaceOwnedMIRefreshAction","CPASURLTagsLoggingClient","CatalogVertical","CollaborationCenterBusinessCapabilitiesUtils","CollaborationCenterBusinessLocationsWrapperShareSettingsStateAction","CollaborationCenterBusinessLocationsWrapperShareSettingsStateProvider","CollaborationCenterConfig","CollaborationCenterGraphAPI","CollaborationCenterLoggerHelper","CollaborationCenterRefreshAggregatedPartnersAction","CollaborationCenterRefreshBusinessLocationsWrapperShareSettingsCandidatesAction","CollaborationCenterRefreshPendingAssetsAction","CollaborationCenterSellersConfig","CollaborationCenterSellersRefreshSellersMetricsAction","CollaborationCenterShareCustomConversionAction","CollaborationCenterShareCustomConversionProvider","CollaborationCenterSharingFlowPartnerSetupStateAction","CollaborationCenterSharingFlowPartnerSetupStateProvider","CollaborationCenterSharingFlowQPLPoints","CollaborationCenterSharingFlowStrings","CollaborationCenterUpdatePartnerPagesAction","CollaborationHubMerchantBaseAction","CollaborationHubSharingCatalogSegmentConfigAction","CollaborationHubSharingModal.react","CollaborationHubSharingStep","CollaborationHubSharingStepPlugins","CollaborationHubSharingUtils","CustomConversionCreationUtils","CustomConversionRuleSerializationUtil","GeoButton.react","GeoModalFooter.react","GeoToast.react","OffsiteCustomEventType","ProductCatalogAPIClient","QPLUserFlow","QuickPerformanceLogger","SUIBusinessTheme","SUILoadingModalOverlay.react","SignalsCustomConversionCreationMetadataFormDataProvider","SignalsCustomConversionCreationUpdateMetadataFormAction","XBusinessCollaborationCenterMPAPartnerOnboardValidationControllerRouteBuilder","XCPASAssetSharingViaAgreementAsyncController","XCPASCollaborationCenterSetupDigitalCircularsBrandConnectionAsyncController","adsCreateStructuredSelector","catalogSegmentGetPredefinedUTMsString","immutable","isEmpty","nullthrows","promiseDone","qpl","react","useBoolean","useGeoToaster"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k=j||(j=d("react"));b=j;var l=b.useCallback,m=b.useState,n=c("adsCreateStructuredSelector")({ruleSetList:c("AdsEventsManagerCustomConversionRuleSetProvider").toFluxSelector(),metaData:c("SignalsCustomConversionCreationMetadataFormDataProvider").toFluxSelector(),customConversionSharingData:c("CollaborationCenterShareCustomConversionProvider").toFluxSelector(),locationWrapperShareSettings:c("CollaborationCenterBusinessLocationsWrapperShareSettingsStateProvider").toFluxSelector(),partnerSetupData:c("CollaborationCenterSharingFlowPartnerSetupStateProvider").toFluxSelector()},f.id+".selector");function a(a){var b=a.businessCapabilitiesComplianceStatus,e=a.businessCapabilitiesStatus,g=a.businessID,j=a.businessOutcomesComplianceStatus,o=a.businessOutcomesStatus,p=a.defaultUTMParamsPayload,q=a.eligibleCapabilities,r=a.filters,s=a.isBasketInsightsEligible,t=a.isExtendedAudienceRetargetingEligible,u=a.isSampleLoading,aa=a.onChangeCurrentTab,v=a.onHide,w=a.orderedStepList,ba=a.parentCatalog,x=a.premiumOptionsConfig,y=a.preSelectedCatalog,z=a.preSelectedPageStructureID,ca=a.productItemsCount,da=a.sampleProductItems,A=a.selectedCurrency,B=a.selectedDiscoverLeadInfo,ea=a.selectedParentCatalog,C=a.setOrderedStepList,D=a.shareFrom,E=a.vertical;a=d("AdsFluxHooks").useAdsSelector(n);var F=a.ruleSetList,G=a.metaData,fa=a.customConversionSharingData,H=a.locationWrapperShareSettings;a=a.partnerSetupData;F=F[0];var I=H.limitBrandPageUsage,J=H.permittedBrandPages;H=null;var K=c("useGeoToaster")(),L=K.add;if(B!=null){K=B.businessID;var M=B.businessLogo,N=B.businessName;H={id:K,logoURI:M.toString(),name:N}}K=m(B!=null?2:1);var O=K[0],P=K[1];M=m(H);var Q=M[0],ga=M[1];N=m(function(){return q.length>=1?q[0]:null});var R=N[0],ha=N[1],S=R==="managed_partner_ads_lite"?null:x;K=m(null);H=K[0];var ia=K[1];M=m(null);var T=M[0],ja=M[1];N=m(!1);var ka=N[0],U=N[1];x=m(!1);K=x[0];var la=x[1];M=m(!1);var ma=M[0];N=M[1];x=p==null?void 0:p.defaultUTMParams;p=c("CollaborationCenterConfig").gk.cpas_default_utm_param?{campaignSource:(M=x==null?void 0:x.campaignSource)!=null?M:"",campaignMedium:(p=x==null?void 0:x.campaignMedium)!=null?p:"",campaignName:(M=x==null?void 0:x.campaignName)!=null?M:""}:{campaignSource:"",campaignMedium:"",campaignName:""};M=m(p);var V=M[0],W=M[1];p=m(c("CollaborationCenterConfig").gk.cpas_default_utm_param&&x!==null&&((x==null?void 0:x.campaignSource)!==""||(x==null?void 0:x.campaignMedium)!==""||(x==null?void 0:x.campaignName)!==""));M=p[0];var na=p[1];x=c("useBoolean")(!1);var oa=x.value,pa=x.setTrue,X=x.setFalse;p=l(function(){return w[O]},[O,w]);var Y=l(function(){var a=O===w.length-1;a||P(O+1)},[O,w.length]);x=l(function(){O>(B!=null?2:1)?P(O-1):v()},[O,P,B,v]);var qa=l(function(a){var b=d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(R);a==null?d("CollaborationCenterLoggerHelper").getSharingFlowLogger({event:"partners_picker_click_add_button",merchantID:g,businessOutcome:b},D).log():d("CollaborationCenterLoggerHelper").getSharingFlowLogger({event:"partners_picker_select_existing_partner",merchantID:g,producerID:a.id,businessOutcome:b},D).log();ga(a);c("QPLUserFlow").addPoint(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").SELECT_PARTNER);c("CollaborationCenterBusinessLocationsWrapperShareSettingsStateAction").dispatch({clearFields:!0},{line:"332",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({clearFields:!0},{line:"339",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id})},[g,R,D]),ra=l(function(a,b){b===void 0&&(b=!1);c("AdsEventsManagerUpdateCustomConversionRuleSetAction").dispatch({ruleSet:{ruleList:c("immutable").List(),selectedDataSource:null,selectedActionSource:null,selectedEvent:null},ruleSetIndex:0},{line:"351",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});c("CollaborationCenterShareCustomConversionAction").dispatch({creatingNewCustomConversion:!1,selectedCustomConversionID:"",selectedCustomConversionName:"",existingCCSearchStr:""},{line:"360",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});c("SignalsCustomConversionCreationUpdateMetadataFormAction").dispatch({conversionCategory:null,conversionDescription:"",conversionName:"",conversionValue:null,showDescription:!1},{line:"366",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});ga(null);var e=w.indexOf(c("CollaborationHubSharingStep").PARTNER_SELECTION);a==="managed_partner_ads_lite"&&!c("CollaborationCenterConfig").gk.mpa_lite_co_op&&e!==-1?(w.splice(e,1),C(w)):!(a==="managed_partner_ads_lite"&&!c("CollaborationCenterConfig").gk.mpa_lite_co_op)&&e===-1&&(w.splice(2,0,c("CollaborationHubSharingStep").PARTNER_SELECTION),C(w));if(a==="ecommerce_sales"){e=w.indexOf(c("CollaborationHubSharingStep").SHARING_CONFIG);var h=w.indexOf(c("CollaborationHubSharingStep").PREMIUM_OPTIONS_CONFIG);h===-1&&(w.splice(e+1,0,c("CollaborationHubSharingStep").PREMIUM_OPTIONS_CONFIG),C(w))}else{h=w.indexOf(c("CollaborationHubSharingStep").PREMIUM_OPTIONS_CONFIG);h!==-1&&(w.splice(h,1),C(w))}if(a==="managed_ecommerce_sales"&&c("CollaborationCenterConfig").gk.cpas_mpa_retailers||a==="digital_circulars"||a==="managed_partner_ads_lite"){e=w.indexOf(c("CollaborationHubSharingStep").BUSINESS_OUTCOME_SELECTION);h=w.indexOf(c("CollaborationHubSharingStep").SETUP_PARTNER);if(h===-1){if(e!==-1)w.splice(e+1,0,c("CollaborationHubSharingStep").SETUP_PARTNER);else{h=w.indexOf(c("CollaborationHubSharingStep").PARTNER_SELECTION);w.splice(h===-1?2:h+1,0,c("CollaborationHubSharingStep").SETUP_PARTNER)}C(w)}}else{e=w.indexOf(c("CollaborationHubSharingStep").SETUP_PARTNER);e!==-1&&(w.splice(e,1),C(w))}ja(null);ia(null);na(!1);X();ha(a);W({campaignSource:"",campaignMedium:"",campaignName:""});h=d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(a);h!=null&&(d("CollaborationCenterLoggerHelper").getSharingFlowLogger({businessOutcome:h,event:b?"sharing_flow_select_business_outcome":"sharing_flow_select_business_capability",merchantID:g},D).log(),c("QPLUserFlow").addPoint(c("qpl")._(241046772,"13339"),b?c("CollaborationCenterSharingFlowQPLPoints").SELECT_BUSINESS_OUTCOME:c("CollaborationCenterSharingFlowQPLPoints").SELECT_BUSINESS_CAPABILTIY,{debugInfo:a}));c("CollaborationHubSharingCatalogSegmentConfigAction").dispatch({filters:[],isSampleLoading:!1,parentCatalog:null,productItemsCount:null,sampleProductItems:[],selectedCurrency:"USD",selectedParentCatalog:null,vertical:d("CollaborationCenterBusinessCapabilitiesUtils").getSharingFlowConfigForBusinessCapability(a).sharingCatalogSegment||c("CatalogVertical").COMMERCE,premiumOptionsConfig:null},{line:"511",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id})},[g,w,X,C,D]),sa=l(function(a){la(!0);var b=a.partnerBusinessName,e=a.currency,h=a.lineofCredit;h=c("XBusinessCollaborationCenterMPAPartnerOnboardValidationControllerRouteBuilder").buildUri({ad_account_currency:(e=e)!=null?e:"",marketplace_business_id:g,line_of_credit_id:(e=h==null?void 0:h.id)!=null?e:"",name:b}).toString();c("promiseDone")(new(c("AsyncTypedRequest"))(h).exec(),function(b){la(!1);b=b.payload.failed_validations;if(Object.keys(b).length>0){var d={};b.forEach(function(a){switch(a.validation_name){case"business_name":d.businessNameError={errorCode:a.error_code,errorMessage:a.exception};break;case"creditline_currency":d.currencyError={errorCode:a.error_code,errorMessage:a.exception};break;case"finance_editor_permission":d.financeEditorPermError={errorCode:a.error_code,errorMessage:a.exception};break}});c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({validationError:d},{line:"579",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id})}else c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({validationError:babelHelpers["extends"]({},a.validationError,{financeEditorPermError:{}})},{line:"584",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),Y()},function(a){la(!1),L(k.jsx(c("GeoToast.react"),{heading:d("AdsEventsManagerCustomConversionCreationUtils").getCreationErrorMessage(a),status:"error"}))})},[Y,L]),ta=l(function(a){a=d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessCapabilityFromBusinessOutcome(a);a!=null&&ra(a,!0)},[ra]),ua=l(function(a){ia(a),c("QPLUserFlow").addPoint(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").SELECT_PAGE_STRUCTURE)},[ia]),va=l(function(a){ja(a)},[ja]),Z=l(function(){ka||c("QPLUserFlow").endCancel(c("qpl")._(241046772,"13339"));(h||(h=c("QuickPerformanceLogger"))).markerPoint(c("qpl")._(512038633,"3245"),"Completed Sharing.");h.markerEnd(c("qpl")._(512038633,"3245"),2);U(!1);c("CollaborationHubSharingCatalogSegmentConfigAction").dispatch({filters:[],isSampleLoading:!1,parentCatalog:null,productItemsCount:null,sampleProductItems:[],selectedCurrency:"USD",selectedParentCatalog:null,vertical:c("CatalogVertical").COMMERCE,premiumOptionsConfig:null},{line:"651",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({clearFields:!0},{line:"662",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});var a=O===w.length-1;a?v():Y()},[O,ka,v,Y,w]),wa=l(function(e,a,b){function h(a){a.merchantID=g,d("CollaborationCenterLoggerHelper").getSharingFlowLogger(a,D).log()}var j=function(a,b){b=c("XCPASAssetSharingViaAgreementAsyncController").getURIBuilder().setEnum("business_outcome",d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(R)).setString("business_id",g).setString("producer_id",b).setFBID("custom_conversion_id",a);a=new(c("AsyncRequest"))(b.getURI());c("promiseDone")(a.exec(),function(a){a.payload.success&&(c("CollaborationCenterRefreshAggregatedPartnersAction").dispatch({},{line:"710",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),c("CollaborationCenterRefreshPendingAssetsAction").dispatch({},{line:"711",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id})),c("QPLUserFlow").endSuccess(c("qpl")._(741087294,"2028")),Z()},function(a){h({actionData:{error:JSON.stringify(a)},customConversionID:null,event:"sharing_flow_create_custom_conversion_error",eventSeverity:"error"}),c("QPLUserFlow").endFailure(c("qpl")._(741087294,"2028"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_CUSTOM_CONVERSION),Z()})};U(!0);var l=b.creatingNewCustomConversion;b=b.selectedCustomConversionID;if(l){l=e.selectedDataSource;var m=e.selectedEvent,n=a.conversionName,o=a.conversionCategory,p=a.conversionValue;a=a.conversionDescription;var q=e.ruleList;e=d("AdsEventsManagerCustomConversionCreationUtils").buildRawRules(e.selectedActionSource,e.selectedDataSource,e.selectedEvent,q);q=d("CustomConversionRuleSerializationUtil").serializeRules(e);e={};e.business=g;e.name=n;e.advanced_rule=q;if(o!=null)e.custom_event_type=c("AdsCustomConversionCustomEventAPICreatableType")[o];else if(l!=null&&m!=null){n=d("CustomConversionCreationUtils").getStandardEventsDetails(l);q=n[m.name];q!=null&&(e.custom_event_type=c("OffsiteCustomEventType")[q.custom_event_type])}p!=null&&(e.default_conversion_value=p);a!=null&&(e.description=a);c("promiseDone")(d("CollaborationCenterGraphAPI").get(f.id).object("business",g).edge("customconversions").post(e),function(a){a=a.id;h({customConversionID:a,event:"sharing_flow_create_custom_conversion_success"});var b=Q==null?void 0:Q.id;b!=null&&(c("CollaborationHubMerchantBaseAction").dispatch({updatedPartner:{brandID:b,catalogSegmentID:null,customConversionID:a}},{line:"798",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),j(a,b))},function(a){h({actionData:{error:JSON.stringify(a)},customConversionID:null,event:"sharing_flow_create_custom_conversion_error",eventSeverity:"error"}),c("QPLUserFlow").endFailure(c("qpl")._(741087294,"2028"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_CUSTOM_CONVERSION),L(k.jsx(c("GeoToast.react"),{heading:d("AdsEventsManagerCustomConversionCreationUtils").getCreationErrorMessage(a),status:"error"})),Z()})}else{o=Q==null?void 0:Q.id;o!=null&&!(i||(i=c("isEmpty")))(b)&&(c("CollaborationHubMerchantBaseAction").dispatch({updatedPartner:{brandID:o,catalogSegmentID:null,customConversionID:b}},{line:"832",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),j(b,o))}},[L,g,Z,R,Q==null?void 0:Q.id,D]),xa=l(function(a){var b=d("AdsProductSetUtils").getFiltersForAPI(r,E,A);b=d("AdsProductSetConvertFilterFromUISpecToAPISpec").convertFilterFromUISpecToAPISpec(b).filter;return{business_id:g,parent_catalog_id:a,name:T,catalog_segment_filter:JSON.stringify(b),vertical:E}},[g,T,r,A,E]),ya=l(function(e,a,b,h,i){U(!0);var j=d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(R),k=xa(a.id);function l(a){var b,c={};c=(b=a.actionData)!=null?b:babelHelpers["extends"]({},c,{catalogSegmentData:JSON.stringify(k)});y!=null&&(c=babelHelpers["extends"]({},c,{preSelectedCatalog:JSON.stringify(y)}));z!=null&&(c=babelHelpers["extends"]({},c,{preSelectedPageStructureID:z}));e!=null&&(c=babelHelpers["extends"]({},c,{pageStructure:e.pageStructureID}));j!=null&&(a.businessOutcome=j);a.merchantID=g;a.actionData=c;d("CollaborationCenterLoggerHelper").getSharingFlowLogger(a,D).log()}var m=function(m){var n=I?J.map(function(a){return a.id}):[],o=D==="collaboration_center"?c("AdsInterfacesRouter").get().getParams().brand_shop_flow:!1;o=c("XCPASAssetSharingViaAgreementAsyncController").getURIBuilder().setEnum("business_outcome",j).setString("catalog_segment_id",m).setString("business_id",g).setString("producer_id",b.id).setBool("brand_shop_enabled",!!o).setBool("image_bank_enabled",oa).setFBID("location_structure_id",e==null?void 0:e.pageStructureID).setBool("should_override_compliance_status",ma).setBool("limit_brand_page_usage",I).setFBIDKeyset("permitted_brand_page_ids",n);V.campaignSource!==""&&o.setString("utm_source",V.campaignSource);V.campaignMedium!==""&&o.setString("utm_medium",V.campaignMedium);V.campaignName!==""&&o.setString("utm_campaign",V.campaignName);if(S!=null&&d("CollaborationHubSharingUtils").getHasPremiumOptionsConfig(S)){n=S.extendedAudienceRetargeting;var p=S.basketInsights,q=[];n&&q.push(1);p&&q.push(2);o.setEnumKeyset("premium_options_enable",q)}h&&(o.setBool("is_mpa_lite_co_op",!0),o.setString("parent_catalog_id",a.id),o.setString("catalog_segment_name",k.name),o.setString("catalog_segment_filter",k.catalog_segment_filter),o.setString("mpa_lite_identity_page_id",i));d("CPASURLTagsLoggingClient").CPASURLTagsLoggingClient.log({advertiserBusinessID:b.id,businessID:g,catalogSegmentID:m,component:d("CPASURLTagsLoggingClient").CPASURLTagsLoggingComponent.CATALOG_MANAGER_SHARE_DIALOG_CONTAINER,event:"merchant_share",eventSeverity:"info",newURLTags:(n=c("catalogSegmentGetPredefinedUTMsString")(V.campaignSource,V.campaignMedium,V.campaignName))!=null?n:""});p=new(c("AsyncRequest"))(o.getURI());c("promiseDone")(p.exec(),function(a){if(!a.payload.success)c("QPLUserFlow").endFailure(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_CATALOG_SEGMENT),c("AgencyPermissionUpdateErrorAction").dispatch({},{line:"1012",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});else{if(S!=null&&d("CollaborationHubSharingUtils").getHasPremiumOptionsConfig(S)){a=S.extendedAudienceRetargeting;var h=S.basketInsights;d("CollaborationCenterLoggerHelper").getSharingFlowLogger({actionData:{enabledEAR:a.toString(),enabledBI:h.toString()},catalogSegmentID:m,merchantID:g,event:"sharing_flow_share_premium_options_success"},D).log()}c("AgencyPermissionUpdateSuccessAction").dispatch({},{line:"1035",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});c("CollaborationHubMerchantBaseAction").dispatch({updatedPartner:{brandID:b.id,catalogSegmentID:m,customConversionID:null}},{line:"1036",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});e!=null?(c("CollaborationCenterRefreshBusinessLocationsWrapperShareSettingsCandidatesAction").dispatch({merchantBusinessID:g,brandBusinessID:b.id,businessLocationsWrapperID:e.pageStructureID},{line:"1044",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),L(d("CollaborationHubSharingUtils").getAssetSharingSucessToast(null,2))):L(d("CollaborationHubSharingUtils").getAssetSharingSucessToast("catalog",1))}c("QPLUserFlow").endSuccess(c("qpl")._(241046772,"13339"));Z();c("CollaborationCenterRefreshAggregatedPartnersAction").dispatch({},{line:"1061",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});c("CollaborationCenterRefreshPendingAssetsAction").dispatch({},{line:"1062",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});D==="business_manager"&&window.location.reload()},function(a){l({actionData:{error:JSON.stringify(a)},event:"sharing_flow_share_catalog_segment_error",eventSeverity:"error"}),c("QPLUserFlow").endFailure(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_CATALOG_SEGMENT),c("AgencyPermissionUpdateErrorAction").dispatch({},{line:"1081",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),Z()})};if(h)return m("");if((y==null?void 0:y.isParentCatalog)===!1)return m(y.id);c("promiseDone")(c("ProductCatalogAPIClient").createCatalog(k).then(function(a){return a}),function(a){l({event:"sharing_flow_create_catalog_segment_success",eventSeverity:"info"}),m(a.id)},function(a){l({actionData:{error:JSON.stringify(a)},event:"sharing_flow_create_catalog_segment_error",eventSeverity:"error"}),Z()})},[R,xa,y,z,g,oa,I,J,D,V.campaignSource,V.campaignMedium,V.campaignName,S,Z,L]),za=l(function(b,a){U(!0);var e=I?J.map(function(a){return a.id}):[];e=c("XCPASAssetSharingViaAgreementAsyncController").getURIBuilder().setString("business_id",g).setString("producer_id",a.id).setFBID("location_structure_id",b.pageStructureID).setBool("limit_brand_page_usage",I).setFBIDKeyset("permitted_brand_page_ids",e).setEnum("business_outcome",d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(R));e=new(c("AsyncRequest"))(e.getURI());c("promiseDone")(e.exec(),function(e){!e.payload.success?(c("QPLUserFlow").endFailure(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_PAGE_STRUCTURE),c("AgencyPermissionUpdateErrorAction").dispatch({},{line:"1179",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id})):(c("AgencyPermissionUpdateSuccessAction").dispatch({},{line:"1181",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),c("CollaborationCenterRefreshBusinessLocationsWrapperShareSettingsCandidatesAction").dispatch({merchantBusinessID:g,brandBusinessID:a.id,businessLocationsWrapperID:b.pageStructureID},{line:"1182",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),L(d("CollaborationHubSharingUtils").getAssetSharingSucessToast("page_structure",1))),c("QPLUserFlow").endSuccess(c("qpl")._(241046772,"13339")),Z(),c("CollaborationCenterRefreshPendingAssetsAction").dispatch({},{line:"1198",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),z!=null&&window.location.reload()},function(a){a={error:JSON.stringify(a)};z!=null&&(a=babelHelpers["extends"]({},a,{preSelectedPageStructureID:z}));d("CollaborationCenterLoggerHelper").getSharingFlowLogger({actionData:a,event:"sharing_flow_share_page_structure_error",eventSeverity:"error",merchantID:g},D).log();c("QPLUserFlow").endFailure(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_PAGE_STRUCTURE);c("AgencyPermissionUpdateErrorAction").dispatch({},{line:"1227",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});Z()})},[I,J,g,R,Z,z,L,D]);function Aa(a){var b,e;b=(b=a.error_subcode)==null?void 0:b.toString();e=(e=a.error_user_msg)!=null?e:"";a=(a=a.error_user_title)!=null?a:"";if(d("CollaborationCenterSellersConfig").MPA_LITE_ONBOARDING_FLOW_CODED_ERRORS.includes(b))return{action:null,header:a,description:e};if(d("CollaborationCenterSellersConfig").MPA_LITE_ONBOARDING_FLOW_CODED_ERRORS_WITH_ACTION.includes(b)){b=k.jsx(c("GeoButton.react"),{href:d("CollaborationCenterSellersConfig").BUSINESS_AND_PAGE_NAME_GUIDELINES,label:d("CollaborationCenterSharingFlowStrings").LEARN_MORE,variant:"flat"});return{action:b,header:a,description:e}}return null}var Ba=l(function(e,b,a){U(!0);c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({confirmationError:null},{line:"1278",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id});var h=e.creditLimit,i=e.currency,j=e.lineofCredit,l=e.partnerBusinessName,m=e.partnerPage;e=e.timezone;var n=d("AdsProductSetUtils").getFiltersForAPI(r,E,A);n=d("AdsProductSetConvertFilterFromUISpecToAPISpec").convertFilterFromUISpecToAPISpec(n).filter;var o=d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(R),p=[];if(S!=null&&d("CollaborationHubSharingUtils").getHasPremiumOptionsConfig(S)){var q=S.extendedAudienceRetargeting,s=S.basketInsights;q&&p.push(1);s&&p.push(2)}var t={name:l,partner_business_id:b==null?void 0:b.id,partner_facebook_page_id:m==null?void 0:m.id,line_of_credit_id:j==null?void 0:j.id,credit_limit:h,catalog_id:a.id,catalog_name:T,catalog_filter:JSON.stringify(n),ad_account_currency:i,timezone_id:e==null?void 0:e.id,vertical:"ECOMMERCE",child_business_external_id:"vendor_"+window.crypto.getRandomValues(new Uint32Array(1))[0],utm_source:V.campaignSource,utm_medium:V.campaignMedium,utm_campaign:V.campaignName,premium_options_enable:p};function u(a){var b;b=(b=a.actionData)!=null?b:{};b=babelHelpers["extends"]({},b,{partnerSetupData:JSON.stringify(t)});o&&(a.businessOutcome=o);a.merchantID=g;a.producerID=t.partner_business_id;a.parentCatalogID=t.catalog_id;a.actionData=b;a.component="CollaborationHubSharingDialog";d("CollaborationCenterLoggerHelper").getSharingFlowLogger(a,D).log()}c("promiseDone")(d("CollaborationCenterGraphAPI").get(f.id).object("business",g).edge("managed_partner_lite_businesses").post(t),function(a){u({actionData:{response:JSON.stringify(a)},event:"collaboration_flow_mpa_partner_setup_success",eventSeverity:"info"}),c("CollaborationCenterSellersRefreshSellersMetricsAction").dispatch({},{line:"1373",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),(m==null?void 0:m.id)&&o&&c("CollaborationCenterUpdatePartnerPagesAction").dispatch({businessID:g,brandBusinessID:g,businessOutcome:o,pageID:m.id},{line:"1375",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),c("CPASAAMSMarketplaceOwnedMIRefreshAction").dispatch({},{line:"1383",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),Z()},function(a){var b=Aa(a);b==null?(u({actionData:{error:JSON.stringify(a)},event:"collaboration_flow_mpa_partner_setup_failure",eventSeverity:"error"}),L(k.jsx(c("GeoToast.react"),{description:d("CollaborationCenterSharingFlowStrings").PARTNER_SETUP_CONFIRMATION_ERROR,heading:d("CollaborationCenterSharingFlowStrings").LOADING_DATA_ERROR_TITLE,status:"error"})),Z()):(u({actionData:{error:JSON.stringify(a)},event:"collaboration_flow_mpa_partner_setup_user_input_failure",eventSeverity:"info"}),c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({confirmationError:b},{line:"1415",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),U(!1))})},[L,g,T,r,Z,R,A,D,E]),Ca=l(function(e,b,a){U(!0);a=xa(a.id);var h=function(a){var h=e.partnerPage,i=c("XCPASCollaborationCenterSetupDigitalCircularsBrandConnectionAsyncController").getURIBuilder().setString("catalog_segment_id",a).setString("business_id",g).setString("producer_id",b.id).setFBID("brand_page_id",c("nullthrows")(h==null?void 0:h.id));i=new(c("AsyncRequest"))(i.getURI());c("promiseDone")(i.exec(),function(e){d("CollaborationCenterLoggerHelper").getSharingFlowLogger({actionData:{brandPageID:((e=h==null?void 0:h.id)!=null?e:"").toString()},catalogSegmentID:a,merchantID:g,brandID:b.id,event:"sharing_flow_setup_digital_circulars_brand_connection",eventSeverity:"info"},D).log();L(k.jsx(c("GeoToast.react"),{heading:d("CollaborationCenterSharingFlowStrings").DC_BRAND_PARTNER_CONNECT_SUCCESS(),status:"success"}));Z()},function(e){e=d("CollaborationCenterSellersConfig").MPA_LITE_ONBOARDING_FLOW_CODED_ERRORS.includes(e.error.toString())?{action:null,header:e.errorSummary,description:e.errorDescription}:null;e==null?(L(k.jsx(c("GeoToast.react"),{description:d("CollaborationCenterSharingFlowStrings").PARTNER_SETUP_CONFIRMATION_ERROR,heading:d("CollaborationCenterSharingFlowStrings").LOADING_DATA_ERROR_TITLE,status:"error"})),Z()):(c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({confirmationError:e},{line:"1502",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id}),U(!1));d("CollaborationCenterLoggerHelper").getSharingFlowLogger({actionData:{brandPageID:((e=h==null?void 0:h.id)!=null?e:"").toString()},catalogSegmentID:a,merchantID:g,brandID:b.id,eventSeverity:"error",event:"sharing_flow_setup_digital_circulars_brand_connection"},D).log()})};c("promiseDone")(c("ProductCatalogAPIClient").createCatalog(a),function(a){d("CollaborationCenterLoggerHelper").getSharingFlowLogger({catalogSegmentID:a.id,merchantID:g,brandID:b.id,eventSeverity:"info",event:"sharing_flow_create_catalog_segment_success"},D).log(),h(a.id)},function(a){d("CollaborationCenterLoggerHelper").getSharingFlowLogger({actionData:{error:JSON.stringify(a)},merchantID:g,brandID:b.id,eventSeverity:"error",event:"sharing_flow_create_catalog_segment_error"},D).log(),U(!1)})},[xa,g,D,L,Z]),Da=l(function(a){W({campaignSource:a,campaignMedium:V.campaignMedium,campaignName:V.campaignName})},[V,W]),Ea=l(function(a){W({campaignSource:V.campaignSource,campaignMedium:a,campaignName:V.campaignName})},[V,W]),Fa=l(function(a){W({campaignSource:V.campaignSource,campaignMedium:V.campaignMedium,campaignName:a})},[V,W]),Ga=l(function(a){a?d("CollaborationCenterLoggerHelper").getSharingFlowLogger({event:"sharing_flow_config_open_utm_toggle",merchantID:g},D).log():W({campaignSource:"",campaignMedium:"",campaignName:""}),na(a)},[g,D]),Ha=l(function(a){d("CollaborationCenterLoggerHelper").getSharingFlowLogger({event:"sharing_flow_config_toggle_image_bank",merchantID:g},D).log(),a?pa():X()},[g,D,pa,X]),Ia=l(function(){var a;c("CollaborationHubSharingCatalogSegmentConfigAction").dispatch({premiumOptionsConfig:{extendedAudienceRetargeting:((a=S==null?void 0:S.extendedAudienceRetargeting)!=null?a:!1)&&t,basketInsights:((a=S==null?void 0:S.basketInsights)!=null?a:!1)&&s}},{line:"1638",module:"CollaborationHubSharingDialog.react.js",moduleID:f.id})},[s,t,S]);p=c("CollaborationHubSharingStepPlugins").withShape({step:p()}).getOne();var Ja=p.bodyComponent,$=p.getFooterConfig,Ka=p.getTitle;p=p.getHeaderDescription;$=$({businessID:g,catalogSegmentName:T,filters:r,metaData:G,ruleSet:F,customConversionSharingData:fa,partnerSetupData:a,selectedBusinessCapability:R,selectedPageStructure:H,selectedParentCatalog:ea,selectedPartnerBusiness:Q,shareFrom:D,vertical:E,onChangeCatalogSegmentName:va,onClickNext:Y,onPartnerSetupInputValidation:sa,onClickPrevious:x,onCompleteSharing:Z,onCreateAndShareCatalogSegment:ya,onCreateAndShareCustomConversion:wa,onHide:v,onSetupMPAChildBusinessAndAssets:Ba,onSetupDigitalCircularsBrandConnection:Ca,onSharePageStructureOnly:za,onUpdatePremiumOptionConfig:Ia,complianceToggleVal:ma});sa=k.jsx(c("GeoModalFooter.react"),{primaryButton:k.jsx(c("GeoButton.react"),babelHelpers["extends"]({},$.primary,{"data-testid":void 0,variant:"primary"})),secondaryButton:$.secondary!=null?k.jsx(c("GeoButton.react"),babelHelpers["extends"]({},$.secondary,{"data-testid":void 0})):null,startContent:$.leftContent});x=k.jsxs(k.Fragment,{children:[k.jsx(Ja,{businessCapabilitiesComplianceStatus:b,businessCapabilitiesStatus:e,businessID:g,businessOutcomesComplianceStatus:j,businessOutcomesStatus:o,catalogSegmentName:T,complianceToggleVal:ma,conversionName:(G==null?void 0:G.conversionName)||fa.selectedCustomConversionName,customConversionSharingData:fa,eligibleCapabilities:q,enableBrandPageAssignment:I,enableImageBank:oa,enableUTM:M,filters:r,isBasketInsightsEligible:s,isExtendedAudienceRetargetingEligible:t,isSampleLoading:u,metaData:G,parentCatalog:ba,partnerSetupData:a,preSelectedCatalog:y,preSelectedPageStructureID:z,premiumOptionsConfig:S,productItemsCount:ca,ruleSet:F,sampleProductItems:da,selectedBusinessCapability:R,selectedCurrency:A,selectedDiscoverLeadInfo:B,selectedPageStructure:H,selectedParentCatalog:ea,selectedPartnerBusiness:Q,setActiveStepIndex:P,setSelectedPartnerBusiness:ga,shareFrom:D,sharingPermittedBrandPages:J,sharingUtmParams:V,vertical:E,onChangeCatalogSegmentName:va,onChangeComplianceToggleVal:N,onChangeCurrentTab:aa,onChangeEnableImageBank:Ha,onChangeEnableUTM:Ga,onChangeUtmCampaignMedium:Ea,onChangeUtmCampaignName:Fa,onChangeUtmCampaignSource:Da,onHide:v,onSelectedBusinessCapabilityChange:ra,onSelectedBusinessOutcomeChange:ta,onSelectedPageStructureChange:ua,onSelectedPartnerBusinessChange:qa}),ka||K?k.jsx(c("SUILoadingModalOverlay.react"),{theme:c("SUIBusinessTheme")}):null]});ya=Ka({selectedBusinessCapability:R});wa=p!=null?p({selectedBusinessCapability:R}):void 0;return k.jsx(c("CollaborationHubSharingModal.react"),{body:x,footer:sa,headerDescription:wa,headerTitle:ya,onHide:v})}a.displayName=a.name+" [from "+f.id+"]";e=d("AdsFluxHooks").adsFluxContainer(a,null,{containerName:f.id});g["default"]=e}),98);
-----
AdsCustomConversionCustomEventAPICreatableType",[],(function(a,b,c,d,e,f){a=Object.freeze({ACTIVATE_APP:"ACTIVATE_APP",RATE:"RATE",TUTORIAL_COMPLETION:"TUTORIAL_COMPLETION",ADD_PAYMENT_INFO:"ADD_PAYMENT_INFO",ADD_TO_CART:"ADD_TO_CART",ADD_TO_WISHLIST:"ADD_TO_WISHLIST",COMPLETE_REGISTRATION:"COMPLETE_REGISTRATION",CONTENT_VIEW:"CONTENT_VIEW",INITIATED_CHECKOUT:"INITIATED_CHECKOUT",LEAD:"LEAD",PURCHASE:"PURCHASE",SEARCH:"SEARCH",CONTACT:"CONTACT",CUSTOMIZE_PRODUCT:"CUSTOMIZE_PRODUCT",DONATE:"DONATE",FIND_LOCATION:"FIND_LOCATION",SCHEDULE:"SCHEDULE",START_TRIAL:"START_TRIAL",SUBMIT_APPLICATION:"SUBMIT_APPLICATION",SUBSCRIBE:"SUBSCRIBE",ACHIEVEMENT_UNLOCKED:"ACHIEVEMENT_UNLOCKED",LEVEL_ACHIEVED:"LEVEL_ACHIEVED",SPENT_CREDITS:"SPENT_CREDITS",LISTING_INTERACTION:"LISTING_INTERACTION",FACEBOOK_SELECTED:"FACEBOOK_SELECTED",OTHER:"OTHER"});f["default"]=a}),66);
-----
CollaborationHubSharingDialog.react",["AdsCustomConversionCustomEventAPICreatableType","AdsEventsManagerCustomConversionCreationUtils","AdsEventsManagerCustomConversionRuleSetProvider","AdsEventsManagerUpdateCustomConversionRuleSetAction","AdsFluxHooks","AdsInterfacesRouter","AdsProductSetConvertFilterFromUISpecToAPISpec","AdsProductSetUtils","AgencyPermissionUpdateErrorAction","AgencyPermissionUpdateSuccessAction","AsyncRequest","CPASAAMSMarketplaceOwnedMIRefreshAction","CPASURLTagsLoggingClient","CatalogVertical","CollaborationCenterBusinessCapabilitiesUtils","CollaborationCenterBusinessLocationsWrapperShareSettingsStateAction","CollaborationCenterBusinessLocationsWrapperShareSettingsStateProvider","CollaborationCenterConfig","CollaborationCenterGraphAPI","CollaborationCenterLoggerHelper","CollaborationCenterRefreshAggregatedPartnersAction","CollaborationCenterRefreshBusinessLocationsWrapperShareSettingsCandidatesAction","CollaborationCenterRefreshPendingAssetsAction","CollaborationCenterSellersConfig","CollaborationCenterSellersRefreshSellersMetricsAction","CollaborationCenterShareCustomConversionAction","CollaborationCenterShareCustomConversionProvider","CollaborationCenterSharingFlowPartnerSetupStateAction","CollaborationCenterSharingFlowPartnerSetupStateProvider","CollaborationCenterSharingFlowQPLPoints","CollaborationCenterSharingFlowStrings","CollaborationCenterUpdatePartnerPagesAction","CollaborationHubMerchantBaseAction","CollaborationHubSharingCatalogSegmentConfigAction","CollaborationHubSharingModal.react","CollaborationHubSharingStep","CollaborationHubSharingStepPlugins","CollaborationHubSharingUtils","CustomConversionCreationUtils","CustomConversionRuleSerializationUtil","GeoButton.react","GeoModalFooter.react","GeoToast.react","OffsiteCustomEventType","ProductCatalogAPIClient","QPLUserFlow","QuickPerformanceLogger","SUIBusinessTheme","SUILoadingModalOverlay.react","SignalsCustomConversionCreationMetadataFormDataProvider","SignalsCustomConversionCreationUpdateMetadataFormAction","XCPASAssetSharingViaAgreementAsyncController","XCPASCollaborationCenterSetupDigitalCircularsBrandConnectionAsyncController","adsCreateStructuredSelector","catalogSegmentGetPredefinedUTMsString","immutable","isEmpty","nullthrows","promiseDone","qpl","react","useBoolean","useGeoToaster"],(function(a,b,c,d,e,f,g){"use strict";var h=d("react");b=d("react");var i=b.useCallback,j=b.useState,k=c("adsCreateStructuredSelector")({ruleSetList:c("AdsEventsManagerCustomConversionRuleSetProvider").toFluxSelector(),metaData:c("SignalsCustomConversionCreationMetadataFormDataProvider").toFluxSelector(),customConversionSharingData:c("CollaborationCenterShareCustomConversionProvider").toFluxSelector(),locationWrapperShareSettings:c("CollaborationCenterBusinessLocationsWrapperShareSettingsStateProvider").toFluxSelector(),partnerSetupData:c("CollaborationCenterSharingFlowPartnerSetupStateProvider").toFluxSelector()},f.id+".selector");function a(a){var b=a.businessID,e=a.businessCapabilitiesComplianceStatus,g=a.businessCapabilitiesStatus,l=a.businessOutcomesComplianceStatus,m=a.businessOutcomesStatus,n=a.eligibleCapabilities,o=a.filters,p=a.isSampleLoading,q=a.onChangeCurrentTab,r=a.orderedStepList,aa=a.parentCatalog,s=a.preSelectedPageStructureID,ba=a.productItemsCount,ca=a.sampleProductItems,t=a.shareFrom,u=a.selectedCurrency,da=a.selectedParentCatalog,v=a.selectedDiscoverLeadInfo,w=a.setOrderedStepList,x=a.preSelectedCatalog,y=a.isBasketInsightsEligible,z=a.isExtendedAudienceRetargetingEligible,A=a.premiumOptionsConfig,B=a.vertical,C=a.onHide;a=d("AdsFluxHooks").useAdsSelector(k);var D=a.ruleSetList,E=a.metaData,F=a.customConversionSharingData,G=a.locationWrapperShareSettings;a=a.partnerSetupData;D=D[0];var H=G.limitBrandPageUsage,I=G.permittedBrandPages;G=null;var J=c("useGeoToaster")(),K=J.add;if(v!=null){J=v.businessID;var L=v.businessLogo,M=v.businessName;G={id:J,logoURI:L.toString(),name:M}}J=j(v!=null?2:1);var N=J[0],O=J[1];L=j(G);var P=L[0],ea=L[1];M=j(function(){return n.length===1?n[0]:null});var Q=M[0],fa=M[1];J=j(null);G=J[0];var R=J[1];L=j(null);var S=L[0],T=L[1];M=j(!1);var ga=M[0],U=M[1];J=j({campaignSource:"",campaignMedium:"",campaignName:""});var V=J[0],W=J[1];L=j(!1);M=L[0];var ha=L[1];J=c("useBoolean")(!1);var ia=J.value,ja=J.setTrue,X=J.setFalse;L=i(function(){return r[N]},[N,r]);var ka=i(function(){var a=N===r.length-1;a||O(N+1)},[N,r.length]);J=i(function(){N>(v!=null?2:1)?O(N-1):C()},[N,O,v,C]);var la=i(function(a){a==null?d("CollaborationCenterLoggerHelper").getSharingFlowLogger({event:"partners_picker_click_add_button",merchantID:b},t).log():d("CollaborationCenterLoggerHelper").getSharingFlowLogger({event:"partners_picker_select_existing_partner",merchantID:b,producerID:a.id},t).log(),ea(a),c("QPLUserFlow").addPoint(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").SELECT_PARTNER),c("CollaborationCenterBusinessLocationsWrapperShareSettingsStateAction").dispatch({clearFields:!0},{line:"318",module:"CollaborationHubSharingDialog.react.js"}),c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({clearFields:!0},{line:"325",module:"CollaborationHubSharingDialog.react.js"})},[b,t]),ma=i(function(a,e){e===void 0&&(e=!1);c("AdsEventsManagerUpdateCustomConversionRuleSetAction").dispatch({ruleSet:{ruleList:c("immutable").List(),selectedDataSource:null,selectedActionSource:null,selectedEvent:null},ruleSetIndex:0},{line:"337",module:"CollaborationHubSharingDialog.react.js"});c("CollaborationCenterShareCustomConversionAction").dispatch({creatingNewCustomConversion:!1,selectedCustomConversionID:"",selectedCustomConversionName:"",existingCCSearchStr:""},{line:"346",module:"CollaborationHubSharingDialog.react.js"});c("SignalsCustomConversionCreationUpdateMetadataFormAction").dispatch({conversionCategory:null,conversionDescription:"",conversionName:"",conversionValue:null,showDescription:!1},{line:"352",module:"CollaborationHubSharingDialog.react.js"});if(a==="ecommerce_sales"){var f=r.indexOf(c("CollaborationHubSharingStep").SHARING_CONFIG),g=r.indexOf(c("CollaborationHubSharingStep").PREMIUM_OPTIONS_CONFIG);g===-1&&(r.splice(f+1,0,c("CollaborationHubSharingStep").PREMIUM_OPTIONS_CONFIG),w(r))}else{g=r.indexOf(c("CollaborationHubSharingStep").PREMIUM_OPTIONS_CONFIG);g!==-1&&(r.splice(g,1),w(r))}if(a==="managed_ecommerce_sales"&&c("CollaborationCenterConfig").gk.cpas_mpa_retailers||a==="digital_circulars"||a==="managed_partner_ads_lite"){f=r.indexOf(c("CollaborationHubSharingStep").BUSINESS_OUTCOME_SELECTION);g=r.indexOf(c("CollaborationHubSharingStep").SETUP_PARTNER);if(g===-1){if(f!==-1)r.splice(f+1,0,c("CollaborationHubSharingStep").SETUP_PARTNER);else{g=r.indexOf(c("CollaborationHubSharingStep").PARTNER_SELECTION);r.splice(g+1,0,c("CollaborationHubSharingStep").SETUP_PARTNER)}w(r)}}else{f=r.indexOf(c("CollaborationHubSharingStep").SETUP_PARTNER);f!==-1&&(r.splice(f,1),w(r))}T(null);R(null);ha(!1);X();fa(a);W({campaignSource:"",campaignMedium:"",campaignName:""});g=d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(a);g!=null&&(d("CollaborationCenterLoggerHelper").getSharingFlowLogger({businessOutcome:g,event:e?"sharing_flow_select_business_outcome":"sharing_flow_select_business_capability",merchantID:b},t).log(),c("QPLUserFlow").addPoint(c("qpl")._(241046772,"13339"),e?c("CollaborationCenterSharingFlowQPLPoints").SELECT_BUSINESS_OUTCOME:c("CollaborationCenterSharingFlowQPLPoints").SELECT_BUSINESS_CAPABILTIY,{debugInfo:a}));c("CollaborationHubSharingCatalogSegmentConfigAction").dispatch({filters:[],isSampleLoading:!1,parentCatalog:null,productItemsCount:null,sampleProductItems:[],selectedCurrency:"USD",selectedParentCatalog:null,vertical:d("CollaborationCenterBusinessCapabilitiesUtils").getSharingFlowConfigForBusinessCapability(a).sharingCatalogSegment||c("CatalogVertical").COMMERCE,premiumOptionsConfig:null},{line:"462",module:"CollaborationHubSharingDialog.react.js"})},[b,r,X,w,t]),na=i(function(a){a=d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessCapabilityFromBusinessOutcome(a);a!=null&&ma(a,!0)},[ma]),oa=i(function(a){R(a),c("QPLUserFlow").addPoint(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").SELECT_PAGE_STRUCTURE)},[R]),pa=i(function(a){T(a)},[T]),Y=i(function(){ga||c("QPLUserFlow").endCancel(c("qpl")._(241046772,"13339"));c("QuickPerformanceLogger").markerPoint(c("qpl")._(512038633,"3245"),"Completed Sharing.");c("QuickPerformanceLogger").markerEnd(c("qpl")._(512038633,"3245"),2);U(!1);c("CollaborationHubSharingCatalogSegmentConfigAction").dispatch({filters:[],isSampleLoading:!1,parentCatalog:null,productItemsCount:null,sampleProductItems:[],selectedCurrency:"USD",selectedParentCatalog:null,vertical:c("CatalogVertical").COMMERCE,premiumOptionsConfig:null},{line:"529",module:"CollaborationHubSharingDialog.react.js"});var a=N===r.length-1;a?C():ka()},[N,ga,C,ka,r]),qa=i(function(g,a,e){function i(a){a.merchantID=b,d("CollaborationCenterLoggerHelper").getSharingFlowLogger(a,t).log()}var j=function(a,e){e=c("XCPASAssetSharingViaAgreementAsyncController").getURIBuilder().setEnum("business_outcome",d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(Q)).setString("business_id",b).setString("producer_id",e).setFBID("custom_conversion_id",a);a=new(c("AsyncRequest"))(e.getURI());c("promiseDone")(a.exec(),function(a){a.payload.success&&(c("CollaborationCenterRefreshAggregatedPartnersAction").dispatch({},{line:"585",module:"CollaborationHubSharingDialog.react.js"}),c("CollaborationCenterRefreshPendingAssetsAction").dispatch({},{line:"586",module:"CollaborationHubSharingDialog.react.js"})),c("QPLUserFlow").endSuccess(c("qpl")._(241042957,"11950")),Y()},function(a){i({actionData:{error:JSON.stringify(a)},customConversionID:null,event:"sharing_flow_create_custom_conversion_error",eventSeverity:"error"}),c("QPLUserFlow").endFailure(c("qpl")._(241042957,"11950"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_CUSTOM_CONVERSION),Y()})};U(!0);var k=e.creatingNewCustomConversion;e=e.selectedCustomConversionID;if(k){k=g.selectedDataSource;var l=g.selectedEvent,m=a.conversionName,n=a.conversionCategory,o=a.conversionValue;a=a.conversionDescription;var p=g.ruleList;g=d("AdsEventsManagerCustomConversionCreationUtils").buildRawRules(g.selectedActionSource,g.selectedDataSource,g.selectedEvent,p);p=d("CustomConversionRuleSerializationUtil").serializeRules(g);g={};g.business=b;g.name=m;g.advanced_rule=p;if(n!=null)g.custom_event_type=c("AdsCustomConversionCustomEventAPICreatableType")[n];else if(k!=null&&l!=null){m=d("CustomConversionCreationUtils").getStandardEventsDetails(k);p=m[l.name];p!=null&&(g.custom_event_type=c("OffsiteCustomEventType")[p.custom_event_type])}o!=null&&(g.default_conversion_value=o);a!=null&&(g.description=a);c("promiseDone")(d("CollaborationCenterGraphAPI").get(f.id).object("business",b).edge("customconversions").post(g),function(a){a=a.id;i({customConversionID:a,event:"sharing_flow_create_custom_conversion_success"});var b=P==null?void 0:P.id;b!=null&&(c("CollaborationHubMerchantBaseAction").dispatch({updatedPartner:{brandID:b,catalogSegmentID:null,customConversionID:a}},{line:"671",module:"CollaborationHubSharingDialog.react.js"}),j(a,b))},function(a){i({actionData:{error:JSON.stringify(a)},customConversionID:null,event:"sharing_flow_create_custom_conversion_error",eventSeverity:"error"}),c("QPLUserFlow").endFailure(c("qpl")._(241042957,"11950"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_CUSTOM_CONVERSION),K(h.jsx(c("GeoToast.react"),{heading:d("AdsEventsManagerCustomConversionCreationUtils").getCreationErrorMessage(a),status:"error"})),Y()})}else{n=P==null?void 0:P.id;n!=null&&!c("isEmpty")(e)&&(c("CollaborationHubMerchantBaseAction").dispatch({updatedPartner:{brandID:n,catalogSegmentID:null,customConversionID:e}},{line:"705",module:"CollaborationHubSharingDialog.react.js"}),j(e,n))}},[K,b,Y,Q,P==null?void 0:P.id,t]),Z=i(function(a){var c=d("AdsProductSetUtils").getFiltersForAPI(o,B,u);c=d("AdsProductSetConvertFilterFromUISpecToAPISpec").convertFilterFromUISpecToAPISpec(c).filter;return{business_id:b,parent_catalog_id:a,name:S,catalog_segment_filter:JSON.stringify(c),vertical:B}},[b,S,o,u,B]),ra=i(function(f,a,e){U(!0);var g=d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(Q),h=Z(a.id);function i(a){var c,e={};e=(c=a.actionData)!=null?c:babelHelpers["extends"]({},e,{catalogSegmentData:JSON.stringify(h)});x!=null&&(e=babelHelpers["extends"]({},e,{preSelectedCatalog:JSON.stringify(x)}));s!=null&&(e=babelHelpers["extends"]({},e,{preSelectedPageStructureID:s}));f!=null&&(e=babelHelpers["extends"]({},e,{pageStructure:f.pageStructureID}));g!=null&&(a.businessOutcome=g);a.merchantID=b;a.actionData=e;d("CollaborationCenterLoggerHelper").getSharingFlowLogger(a,t).log()}var j=function(a){var h=H?I.map(function(a){return a.id}):[],j=t==="collaboration_center"?c("AdsInterfacesRouter").get().getParams().brand_shop_flow:!1;j=c("XCPASAssetSharingViaAgreementAsyncController").getURIBuilder().setEnum("business_outcome",g).setString("catalog_segment_id",a).setString("business_id",b).setString("producer_id",e.id).setBool("brand_shop_enabled",!!j).setBool("image_bank_enabled",ia).setFBID("location_structure_id",f==null?void 0:f.pageStructureID).setBool("limit_brand_page_usage",H).setFBIDKeyset("permitted_brand_page_ids",h);V.campaignSource!==""&&j.setString("utm_source",V.campaignSource);V.campaignMedium!==""&&j.setString("utm_medium",V.campaignMedium);V.campaignName!==""&&j.setString("utm_campaign",V.campaignName);if(A!=null&&d("CollaborationHubSharingUtils").getHasPremiumOptionsConfig(A)){h=A.extendedAudienceRetargeting;var k=A.basketInsights,l=[];h&&l.push(1);k&&l.push(2);j.setEnumKeyset("premium_options_enable",l)}d("CPASURLTagsLoggingClient").CPASURLTagsLoggingClient.log({advertiserBusinessID:e.id,businessID:b,catalogSegmentID:a,component:d("CPASURLTagsLoggingClient").CPASURLTagsLoggingComponent.CATALOG_MANAGER_SHARE_DIALOG_CONTAINER,event:"merchant_share",eventSeverity:"info",newURLTags:(h=c("catalogSegmentGetPredefinedUTMsString")(V.campaignSource,V.campaignMedium,V.campaignName))!=null?h:""});k=new(c("AsyncRequest"))(j.getURI());c("promiseDone")(k.exec(),function(g){if(!g.payload.success)c("QPLUserFlow").endFailure(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_CATALOG_SEGMENT),c("AgencyPermissionUpdateErrorAction").dispatch({},{line:"873",module:"CollaborationHubSharingDialog.react.js"});else{if(A!=null&&d("CollaborationHubSharingUtils").getHasPremiumOptionsConfig(A)){g=A.extendedAudienceRetargeting;var h=A.basketInsights;d("CollaborationCenterLoggerHelper").getSharingFlowLogger({actionData:{enabledEAR:g.toString(),enabledBI:h.toString()},catalogSegmentID:a,merchantID:b,event:"sharing_flow_share_premium_options_success"},t).log()}c("AgencyPermissionUpdateSuccessAction").dispatch({},{line:"896",module:"CollaborationHubSharingDialog.react.js"});c("CollaborationHubMerchantBaseAction").dispatch({updatedPartner:{brandID:e.id,catalogSegmentID:a,customConversionID:null}},{line:"897",module:"CollaborationHubSharingDialog.react.js"});f!=null?(c("CollaborationCenterRefreshBusinessLocationsWrapperShareSettingsCandidatesAction").dispatch({merchantBusinessID:b,brandBusinessID:e.id,businessLocationsWrapperID:f.pageStructureID},{line:"905",module:"CollaborationHubSharingDialog.react.js"}),K(d("CollaborationHubSharingUtils").getAssetSharingSucessToast(null,2))):K(d("CollaborationHubSharingUtils").getAssetSharingSucessToast("catalog",1))}c("QPLUserFlow").endSuccess(c("qpl")._(241046772,"13339"));Y();c("CollaborationCenterRefreshAggregatedPartnersAction").dispatch({},{line:"922",module:"CollaborationHubSharingDialog.react.js"});c("CollaborationCenterRefreshPendingAssetsAction").dispatch({},{line:"923",module:"CollaborationHubSharingDialog.react.js"});t==="business_manager"&&window.location.reload()},function(a){i({actionData:{error:JSON.stringify(a)},event:"sharing_flow_share_catalog_segment_error",eventSeverity:"error"}),c("QPLUserFlow").endFailure(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_CATALOG_SEGMENT),c("AgencyPermissionUpdateErrorAction").dispatch({},{line:"942",module:"CollaborationHubSharingDialog.react.js"}),Y()})};if((x==null?void 0:x.isParentCatalog)===!1)return j(x.id);c("promiseDone")(c("ProductCatalogAPIClient").createCatalog(h).then(function(a){return a}),function(a){i({event:"sharing_flow_create_catalog_segment_success",eventSeverity:"info"}),j(a.id)},function(a){i({actionData:{error:JSON.stringify(a)},event:"sharing_flow_create_catalog_segment_error",eventSeverity:"error"}),Y()})},[Q,Z,x,s,b,ia,H,I,t,V.campaignSource,V.campaignMedium,V.campaignName,A,Y,K]),sa=i(function(e,a){U(!0);var f=H?I.map(function(a){return a.id}):[];f=c("XCPASAssetSharingViaAgreementAsyncController").getURIBuilder().setString("business_id",b).setString("producer_id",a.id).setFBID("location_structure_id",e.pageStructureID).setBool("limit_brand_page_usage",H).setFBIDKeyset("permitted_brand_page_ids",f).setEnum("business_outcome",d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(Q));f=new(c("AsyncRequest"))(f.getURI());c("promiseDone")(f.exec(),function(f){!f.payload.success?(c("QPLUserFlow").endFailure(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_PAGE_STRUCTURE),c("AgencyPermissionUpdateErrorAction").dispatch({},{line:"1036",module:"CollaborationHubSharingDialog.react.js"})):(c("AgencyPermissionUpdateSuccessAction").dispatch({},{line:"1038",module:"CollaborationHubSharingDialog.react.js"}),c("CollaborationCenterRefreshBusinessLocationsWrapperShareSettingsCandidatesAction").dispatch({merchantBusinessID:b,brandBusinessID:a.id,businessLocationsWrapperID:e.pageStructureID},{line:"1039",module:"CollaborationHubSharingDialog.react.js"}),K(d("CollaborationHubSharingUtils").getAssetSharingSucessToast("page_structure",1))),c("QPLUserFlow").endSuccess(c("qpl")._(241046772,"13339")),Y(),c("CollaborationCenterRefreshPendingAssetsAction").dispatch({},{line:"1055",module:"CollaborationHubSharingDialog.react.js"}),s!=null&&window.location.reload()},function(a){a={error:JSON.stringify(a)};s!=null&&(a=babelHelpers["extends"]({},a,{preSelectedPageStructureID:s}));d("CollaborationCenterLoggerHelper").getSharingFlowLogger({actionData:a,event:"sharing_flow_share_page_structure_error",eventSeverity:"error",merchantID:b},t).log();c("QPLUserFlow").endFailure(c("qpl")._(241046772,"13339"),c("CollaborationCenterSharingFlowQPLPoints").FAIL_TO_SAHRE_PAGE_STRUCTURE);c("AgencyPermissionUpdateErrorAction").dispatch({},{line:"1084",module:"CollaborationHubSharingDialog.react.js"});Y()})},[H,I,b,Q,Y,s,K,t]);function ta(a){var b,e;b=(b=a.error_subcode)==null?void 0:b.toString();e=(e=a.error_user_msg)!=null?e:"";a=(a=a.error_user_title)!=null?a:"";if(d("CollaborationCenterSellersConfig").MPA_LITE_ONBOARDING_FLOW_CODED_ERRORS.includes(b))return{action:null,header:a,description:e};if(d("CollaborationCenterSellersConfig").MPA_LITE_ONBOARDING_FLOW_CODED_ERRORS_WITH_ACTION.includes(b)){b=h.jsx(c("GeoButton.react"),{href:d("CollaborationCenterSellersConfig").BUSINESS_AND_PAGE_NAME_GUIDELINES,label:d("CollaborationCenterSharingFlowStrings").LEARN_MORE,variant:"flat"});return{action:b,header:a,description:e}}return null}var ua=i(function(g,e,a){U(!0);c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({confirmationError:null},{line:"1135",module:"CollaborationHubSharingDialog.react.js"});var i=g.creditLimit,j=g.currency,k=g.lineofCredit,l=g.partnerBusinessName,m=g.partnerPage;g=g.timezone;var n=d("AdsProductSetUtils").getFiltersForAPI(o,B,u);n=d("AdsProductSetConvertFilterFromUISpecToAPISpec").convertFilterFromUISpecToAPISpec(n).filter;var p=d("CollaborationCenterBusinessCapabilitiesUtils").getBusinessOutcomeFromBusinessCapability(Q),q={name:l,partner_business_id:e.id,partner_facebook_page_id:m==null?void 0:m.id,line_of_credit_id:k==null?void 0:k.id,credit_limit:i,catalog_id:a.id,catalog_name:S,catalog_filter:JSON.stringify(n),ad_account_currency:j,timezone_id:g==null?void 0:g.id,vertical:"ECOMMERCE",child_business_external_id:"vendor_"+window.crypto.getRandomValues(new Uint32Array(1))[0]};function r(a){var c;c=(c=a.actionData)!=null?c:{};c=babelHelpers["extends"]({},c,{partnerSetupData:JSON.stringify(q)});p&&(a.businessOutcome=p);a.merchantID=b;a.producerID=q.partner_business_id;a.parentCatalogID=q.catalog_id;a.actionData=c;a.component="CollaborationHubSharingDialog";d("CollaborationCenterLoggerHelper").getSharingFlowLogger(a,t).log()}c("promiseDone")(d("CollaborationCenterGraphAPI").get(f.id).object("business",b).edge("managed_partner_lite_businesses").post(q),function(a){r({actionData:{response:JSON.stringify(a)},event:"collaboration_flow_mpa_partner_setup_success",eventSeverity:"info"}),c("CollaborationCenterSellersRefreshSellersMetricsAction").dispatch({},{line:"1210",module:"CollaborationHubSharingDialog.react.js"}),(m==null?void 0:m.id)&&p&&c("CollaborationCenterUpdatePartnerPagesAction").dispatch({businessID:b,brandBusinessID:e.id,businessOutcome:p,pageID:m.id},{line:"1212",module:"CollaborationHubSharingDialog.react.js"}),c("CPASAAMSMarketplaceOwnedMIRefreshAction").dispatch({},{line:"1219",module:"CollaborationHubSharingDialog.react.js"}),Y()},function(a){var b=ta(a);b==null?(r({actionData:{error:JSON.stringify(a)},event:"collaboration_flow_mpa_partner_setup_failure",eventSeverity:"error"}),K(h.jsx(c("GeoToast.react"),{description:d("CollaborationCenterSharingFlowStrings").PARTNER_SETUP_CONFIRMATION_ERROR,heading:d("CollaborationCenterSharingFlowStrings").LOADING_DATA_ERROR_TITLE,status:"error"})),Y()):(r({actionData:{error:JSON.stringify(a)},event:"collaboration_flow_mpa_partner_setup_user_input_failure",eventSeverity:"info"}),c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({confirmationError:b},{line:"1251",module:"CollaborationHubSharingDialog.react.js"}),U(!1))})},[K,b,S,o,Y,Q,u,t,B]),va=i(function(f,e,a){U(!0);a=Z(a.id);var g=function(a){var g=f.partnerPage,i=c("XCPASCollaborationCenterSetupDigitalCircularsBrandConnectionAsyncController").getURIBuilder().setString("catalog_segment_id",a).setString("business_id",b).setString("producer_id",e.id).setFBID("brand_page_id",c("nullthrows")(g==null?void 0:g.id));i=new(c("AsyncRequest"))(i.getURI());c("promiseDone")(i.exec(),function(f){d("CollaborationCenterLoggerHelper").getSharingFlowLogger({actionData:{brandPageID:((f=g==null?void 0:g.id)!=null?f:"").toString()},catalogSegmentID:a,merchantID:b,brandID:e.id,event:"sharing_flow_setup_digital_circulars_brand_connection",eventSeverity:"info"},t).log();K(h.jsx(c("GeoToast.react"),{heading:d("CollaborationCenterSharingFlowStrings").DC_BRAND_PARTNER_CONNECT_SUCCESS(),status:"success"}));Y()},function(f){f=d("CollaborationCenterSellersConfig").MPA_LITE_ONBOARDING_FLOW_CODED_ERRORS.includes(f.error.toString())?{action:null,header:f.errorSummary,description:f.errorDescription}:null;f==null?(K(h.jsx(c("GeoToast.react"),{description:d("CollaborationCenterSharingFlowStrings").PARTNER_SETUP_CONFIRMATION_ERROR,heading:d("CollaborationCenterSharingFlowStrings").LOADING_DATA_ERROR_TITLE,status:"error"})),Y()):(c("CollaborationCenterSharingFlowPartnerSetupStateAction").dispatch({confirmationError:f},{line:"1338",module:"CollaborationHubSharingDialog.react.js"}),U(!1));d("CollaborationCenterLoggerHelper").getSharingFlowLogger({actionData:{brandPageID:((f=g==null?void 0:g.id)!=null?f:"").toString()},catalogSegmentID:a,merchantID:b,brandID:e.id,eventSeverity:"error",event:"sharing_flow_setup_digital_circulars_brand_connection"},t).log()})};c("promiseDone")(c("ProductCatalogAPIClient").createCatalog(a),function(a){d("CollaborationCenterLoggerHelper").getSharingFlowLogger({catalogSegmentID:a.id,merchantID:b,brandID:e.id,eventSeverity:"info",event:"sharing_flow_create_catalog_segment_success"},t).log(),g(a.id)},function(a){d("CollaborationCenterLoggerHelper").getSharingFlowLogger({actionData:{error:JSON.stringify(a)},merchantID:b,brandID:e.id,eventSeverity:"error",event:"sharing_flow_create_catalog_segment_error"},t).log(),U(!1)})},[Z,b,t,K,Y]),wa=i(function(a){W({campaignSource:a,campaignMedium:V.campaignMedium,campaignName:V.campaignName})},[V,W]),xa=i(function(a){W({campaignSource:V.campaignSource,campaignMedium:a,campaignName:V.campaignName})},[V,W]),ya=i(function(a){W({campaignSource:V.campaignSource,campaignMedium:V.campaignMedium,campaignName:a})},[V,W]),za=i(function(a){a?d("CollaborationCenterLoggerHelper").getSharingFlowLogger({event:"sharing_flow_config_open_utm_toggle",merchantID:b},t).log():W({campaignSource:"",campaignMedium:"",campaignName:""}),ha(a)},[b,t]),Aa=i(function(a){d("CollaborationCenterLoggerHelper").getSharingFlowLogger({event:"sharing_flow_config_toggle_image_bank",merchantID:b},t).log(),a?ja():X()},[b,t,ja,X]),Ba=i(function(){var a;c("CollaborationHubSharingCatalogSegmentConfigAction").dispatch({premiumOptionsConfig:{extendedAudienceRetargeting:((a=A==null?void 0:A.extendedAudienceRetargeting)!=null?a:!1)&&z,basketInsights:((a=A==null?void 0:A.basketInsights)!=null?a:!1)&&y}},{line:"1474",module:"CollaborationHubSharingDialog.react.js"})},[y,z,A]);L=c("CollaborationHubSharingStepPlugins").withShape({step:L()}).getOne();var Ca=L.bodyComponent,$=L.getFooterConfig,Da=L.getTitle;L=L.getHeaderDescription;$=$({businessID:b,catalogSegmentName:S,filters:o,metaData:E,ruleSet:D,customConversionSharingData:F,partnerSetupData:a,selectedBusinessCapability:Q,selectedPageStructure:G,selectedParentCatalog:da,selectedPartnerBusiness:P,shareFrom:t,vertical:B,onChangeCatalogSegmentName:pa,onClickNext:ka,onClickPrevious:J,onCompleteSharing:Y,onCreateAndShareCatalogSegment:ra,onCreateAndShareCustomConversion:qa,onHide:C,onSetupMPAChildBusinessAndAssets:ua,onSetupDigitalCircularsBrandConnection:va,onSharePageStructureOnly:sa,onUpdatePremiumOptionConfig:Ba});J=h.jsx(c("GeoModalFooter.react"),{primaryButton:h.jsx(c("GeoButton.react"),babelHelpers["extends"]({},$.primary,{"data-testid":void 0,variant:"primary"})),secondaryButton:$.secondary!=null?h.jsx(c("GeoButton.react"),babelHelpers["extends"]({},$.secondary,{"data-testid":void 0})):null,startContent:$.leftContent});ra=h.jsxs(h.Fragment,{children:[h.jsx(Ca,{businessCapabilitiesComplianceStatus:e,businessCapabilitiesStatus:g,businessID:b,businessOutcomesComplianceStatus:l,businessOutcomesStatus:m,catalogSegmentName:S,conversionName:(E==null?void 0:E.conversionName)||F.selectedCustomConversionName,customConversionSharingData:F,eligibleCapabilities:n,enableBrandPageAssignment:H,enableImageBank:ia,enableUTM:M,filters:o,isBasketInsightsEligible:y,isExtendedAudienceRetargetingEligible:z,isSampleLoading:p,metaData:E,parentCatalog:aa,partnerSetupData:a,preSelectedCatalog:x,preSelectedPageStructureID:s,premiumOptionsConfig:A,productItemsCount:ba,ruleSet:D,sampleProductItems:ca,selectedBusinessCapability:Q,selectedCurrency:u,selectedDiscoverLeadInfo:v,selectedPageStructure:G,selectedParentCatalog:da,selectedPartnerBusiness:P,setActiveStepIndex:O,shareFrom:t,sharingPermittedBrandPages:I,sharingUtmParams:V,vertical:B,onChangeCatalogSegmentName:pa,onChangeCurrentTab:q,onChangeEnableImageBank:Aa,onChangeEnableUTM:za,onChangeUtmCampaignMedium:xa,onChangeUtmCampaignName:ya,onChangeUtmCampaignSource:wa,onHide:C,onSelectedBusinessCapabilityChange:ma,onSelectedBusinessOutcomeChange:na,onSelectedPageStructureChange:oa,onSelectedPartnerBusinessChange:la}),ga?h.jsx(c("SUILoadingModalOverlay.react"),{theme:c("SUIBusinessTheme")}):null]});qa=Da({selectedBusinessCapability:Q});ua=L!=null?L({selectedBusinessCapability:Q}):void 0;return h.jsx(c("CollaborationHubSharingModal.react"),{body:ra,footer:J,headerDescription:ua,headerTitle:qa,onHide:C})}a.displayName=a.name+" [from "+f.id+"]";e=d("AdsFluxHooks").adsFluxContainer(a,null,{containerName:f.id});g["default"]=e}),98);
-----
AdsCustomConversionCustomEventAPICreatableType",[],(function(a,b,c,d,e,f){a=Object.freeze({ACTIVATE_APP:"ACTIVATE_APP",RATE:"RATE",TUTORIAL_COMPLETION:"TUTORIAL_COMPLETION",ADD_PAYMENT_INFO:"ADD_PAYMENT_INFO",ADD_TO_CART:"ADD_TO_CART",ADD_TO_WISHLIST:"ADD_TO_WISHLIST",COMPLETE_REGISTRATION:"COMPLETE_REGISTRATION",CONTENT_VIEW:"CONTENT_VIEW",INITIATED_CHECKOUT:"INITIATED_CHECKOUT",LEAD:"LEAD",PURCHASE:"PURCHASE",SEARCH:"SEARCH",CONTACT:"CONTACT",CUSTOMIZE_PRODUCT:"CUSTOMIZE_PRODUCT",DONATE:"DONATE",FIND_LOCATION:"FIND_LOCATION",SCHEDULE:"SCHEDULE",START_TRIAL:"START_TRIAL",SUBMIT_APPLICATION:"SUBMIT_APPLICATION",SUBSCRIBE:"SUBSCRIBE",ACHIEVEMENT_UNLOCKED:"ACHIEVEMENT_UNLOCKED",LEVEL_ACHIEVED:"LEVEL_ACHIEVED",SPENT_CREDITS:"SPENT_CREDITS",LISTING_INTERACTION:"LISTING_INTERACTION",FACEBOOK_SELECTED:"FACEBOOK_SELECTED",OTHER:"OTHER"});f["default"]=a}),66);
-----
AdsEventsManagerSingleSourceCustomConversionCreationModal.react",["fbt","AdsCustomConversionCustomEventAPICreatableType","AdsEventsManagerCustomConversionCreationCleanupErrorStatusAction","AdsEventsManagerCustomConversionCreationSuccessContentContainer.react","AdsEventsManagerCustomConversionCreationUtils","AdsEventsManagerCustomConversionRuleUtils","AdsEventsManagerLoggingScopesEnum","AdsEventsManagerMaguxLoggerHelper","AdsEventsManagerSingleSourceCustomConversionCreationDialog.react","AdsEventsManagerUpdateCustomConversionCreationStatusAction","AdsGoalServerCreatedGoalDataAction","AdsGraphAPI","AdsPixelConversionStandardEvents","CustomConversionCreationUtils","CustomConversionRuleSerializationUtil","GeoButton.react","GeoModal.react","GeoModalFooter.react","GeoModalHeader.react","GeoSection.react","OffsiteCustomEventType","SignalsCustomConversionLoggerHelper","SignalsLoggingBoundary.react","SignalsWebsiteOptimizedCustomConversionsDeleteAction","promiseDone","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i=d("react");b=d("react");var j=b.useEffect,k=b.useState,l=h._("u521bu5efau81eau5b9au4e49u8f6cu5316u4e8bu4ef6"),m=h._("u6210u529f"),n=1760002;function a(a){var b=a.conversionData,e=a.metaData,g=a.modalData,o=a.ruleSet,p=a.onBack,q=a.onClose,r=a.isLoading;r=r===void 0?!1:r;var s=a.logger,t=a.objective,u=a.onSuccess,v=o.selectedActionSource,w=o.selectedDataSource,x=o.selectedEvent,y=o.ruleList,z=g.adAccountID,A=g.businessID;a=g.defaultDataSourceID;var B=g.defaultDataSourceType;g=g.modalType;var C=e.conversionName,D=e.conversionCategory,E=e.conversionValue,F=e.conversionDescription,G=k(!0),H=G[0],I=G[1];G=k(!1);var J=G[0],K=G[1];G=!1;if(y)for(var L=y,M=Array.isArray(L),N=0,L=M?L:L[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var O;if(M){if(N>=L.length)break;O=L[N++]}else{N=L.next();if(N.done)break;O=N.value}O=O;O.parameterValues&&(G=d("AdsEventsManagerCustomConversionRuleUtils").isValidCustomConversionRule(O.parameterValues));if(G)break}j(function(){I(d("AdsEventsManagerCustomConversionCreationUtils").creationValidationCheck(C,D,o)!=null),d("AdsEventsManagerCustomConversionCreationUtils").creationValidationCheck(C,D,o)===null&&c("AdsEventsManagerCustomConversionCreationCleanupErrorStatusAction").dispatch({},{line:"148",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js"})},[D,C,o]);O=b.conversion;N=function(){s.logCustomActionUseSparingly("CREATE_CUSTOM_CONVERSION");I(!0);K(!0);var a={},b=d("AdsEventsManagerCustomConversionCreationUtils").buildRawRules(v,w,x,y);b=d("CustomConversionRuleSerializationUtil").serializeRules(b);if(D!=null)a.custom_event_type=c("AdsCustomConversionCustomEventAPICreatableType")[D];else if(w!=null)if(w.type==="DATA_SET")a.custom_event_type=c("OffsiteCustomEventType")[c("AdsPixelConversionStandardEvents").Purchase.custom_event_type];else if(x!=null){var e=d("CustomConversionCreationUtils").getStandardEventsDetails(w),g=x.name;e=e[g];e!=null&&(a.custom_event_type=c("OffsiteCustomEventType")[e.custom_event_type])}E!=null&&(a.default_conversion_value=E);F!=null&&(a.description=F);C!=null&&(a.name=C);z!=null?a.account_id=z:A!=null&&(a.business=A);a.advanced_rule=b;var h={adAccountID:z,businessID:A,dataSourceID:w!=null?w.id:null,dataSourceType:w!=null?w.type:null,scope:"CUSTOM_CONVERSION_CREATION_MODAL"};z!=null?c("promiseDone")(d("AdsGraphAPI").get(f.id).adaccount(z).edge("customconversions").post(a),function(a){K(!1),u&&u(a.id),c("AdsEventsManagerUpdateCustomConversionCreationStatusAction").dispatch({conversion:{id:a.id}},{line:"228",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js"}),c("SignalsWebsiteOptimizedCustomConversionsDeleteAction").dispatch({adAccountID:z},{line:"234",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js"}),c("AdsGoalServerCreatedGoalDataAction").dispatch({data:{newCustomConversionCreationFlow:!0},feedback:{customConversionID:a.id}},{line:"240",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js"}),d("SignalsCustomConversionLoggerHelper").logCreateSuccess(babelHelpers["extends"]({},h,{customConversionID:a.id})),d("AdsEventsManagerMaguxLoggerHelper").logClickSuccess({hasOptOut3PD:!1,sourceKey:"em_create_custom_conversion_task"})},function(a){K(!1),c("AdsEventsManagerUpdateCustomConversionCreationStatusAction").dispatch({conversion:{errorMessage:d("AdsEventsManagerCustomConversionCreationUtils").getCreationErrorMessage(a),id:null}},{line:"258",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js"}),a.error_subcode===n?d("SignalsCustomConversionLoggerHelper").logCreateError(babelHelpers["extends"]({},h,{action:"signals_custom_conversion_duplicate_rule_warning",error:a})):d("SignalsCustomConversionLoggerHelper").logCreateError(babelHelpers["extends"]({},h,{error:a}))}):A!=null&&c("promiseDone")(d("AdsGraphAPI").get(f.id).object("business",A).edge("customconversions").post(a),function(a){K(!1),u&&u(a.id),c("AdsEventsManagerUpdateCustomConversionCreationStatusAction").dispatch({conversion:{id:a.id}},{line:"289",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js"}),d("SignalsCustomConversionLoggerHelper").logCreateSuccess(babelHelpers["extends"]({},h,{customConversionID:a.id}))},function(a){K(!1),c("AdsEventsManagerUpdateCustomConversionCreationStatusAction").dispatch({conversion:{errorMessage:d("AdsEventsManagerCustomConversionCreationUtils").getCreationErrorMessage(a),id:null}},{line:"300",module:"AdsEventsManagerSingleSourceCustomConversionCreationModal.react.js"}),a.error_subcode===n?d("SignalsCustomConversionLoggerHelper").logCreateError(babelHelpers["extends"]({},h,{action:"signals_custom_conversion_duplicate_rule_warning",error:a})):d("SignalsCustomConversionLoggerHelper").logCreateError(babelHelpers["extends"]({},h,{error:a}))})};M=(O==null?void 0:O.id)!=null;return i.jsx(c("GeoModal.react"),{"data-testid":void 0,footer:i.jsx(c("GeoModalFooter.react"),{primaryButton:i.jsx(c("GeoButton.react"),{autoFocus:!0,"data-testid":void 0,isDisabled:G||H&&!M||r,isLoading:J,label:M?h._("u5b8cu6210"):h._("u521bu5efa"),variant:"primary",onClick:M?q:N}),secondaryButton:M?null:i.jsx(c("GeoButton.react"),{autoFocus:!0,isDisabled:r||J,label:p!=null?h._("u8fd4u56de"):h._("u53d6u6d88"),onClick:p!=null?p:q})}),header:i.jsx(c("GeoModalHeader.react"),{heading:M?m:l}),isShown:g!==null,label:M?m:l,onHide:q,children:i.jsx(c("GeoSection.react"),{children:M?i.jsx(c("AdsEventsManagerCustomConversionCreationSuccessContentContainer.react"),{adAccountID:z,businessID:A,conversionID:O==null?void 0:O.id,conversionName:C,selectedDataSource:w,selectedEvent:x}):i.jsx(c("AdsEventsManagerSingleSourceCustomConversionCreationDialog.react"),{adAccountID:z,businessID:A,defaultDataSourceID:a,defaultDataSourceType:B,errorMessage:O==null?void 0:O.errorMessage,metaData:e,objective:t})})})}a.displayName=a.name+" [from "+f.id+"]";e=c("SignalsLoggingBoundary.react").loggerConsumingComponent(a,function(a){return a.scope(c("AdsEventsManagerLoggingScopesEnum").CUSTOM_CONVERSIONS)},{disableSessionCreation:!0});g["default"]=e}),98);
-----