AdsPLRProductSetUpdateModal.react",["fbt","AdsPLRProductSetUpdateModalQuery.graphql","AdsPLRUtils","AsyncRequest","GeoBaseText.react","GeoButton.react","GeoCancelButton.react","GeoColorSelectors","GeoFlexbox.react","GeoHStack.react","GeoModal.react","GeoModalFooter.react","GeoModalHeader.react","GeoRadioList.react","GeoRadioListItem.react","GeoSection.react","GeoTable.react","GeoTableWidth","GeoTextInput.react","GeoVStack.react","Image.react","RelayHooks","XAdsPLRUpdateOrDuplicateProductSetWithMissingConvertedProductsControllerRouteBuilder","createGeoTableDataSource","geoMargin","react","useGeoTableRowHeader"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u,c=u||(u=o("react")),d=u,m=d.useCallback,p=d.useMemo,_=d.useState,f={dialogContainer:{width:"x1oowbnt",display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"xl56j7k",$$css:!0},productContainer:{width:"xpmw3k",height:"x17ol07n",$$css:!0},ctaContainer:{height:"x17ol07n",$$css:!0}};function g(t){var a,i=t.adAccountID,l=t.currency,u=t.productSetMutationOption,d=t.selectedProductSet,g=t.setMutatedProductSetID,h=t.setProductSetMutationOption,y=t.setShowProductSetUpdateModal,C=t.setShowSuccessToast,b=e!==void 0?e:e=n("AdsPLRProductSetUpdateModalQuery.graphql"),v=o("RelayHooks").useLazyLoadQuery(b,{adAccountID:i,productSetID:(a=d.productSetID)!=null?a:""}),S=v.xfb_product_level_reporting_top_missing_products,R=p(function(){var e,t;return(e=S==null?void 0:S.top_missing_products)!=null?e:(t=[])==null?void 0:t.filter(function(e){return e.pcv!=null&&e.pcv>0}).sort(function(e,t){return Number(t.pcv)-Number(e.pcv)})},[S==null?void 0:S.top_missing_products]),L=p(function(){var e,t,n=o("AdsPLRUtils").getDescArrowIcon();return[{key:"variant",cell:function(t){var e=t.item;return c.jsxs(r("GeoFlexbox.react"),{direction:"row",children:[c.jsx(r("Image.react"),{src:e==null?void 0:e.image_url,width:48},e.product_id),c.jsxs(r("GeoFlexbox.react"),{alignContent:"start",direction:"column",justifyContent:"center",xstyle:r("geoMargin").start8,children:[c.jsx(r("GeoBaseText.react"),{color:"value",display:"block",maxLines:1,overflowWrap:"break-word",size:"valueDescription",xstyle:r("geoMargin").bottom0,children:e.product_name}),c.jsx(r("GeoBaseText.react"),{color:"valueDescription",display:"block",maxLines:1,overflowWrap:"break-word",size:"accent",xstyle:r("geoMargin").top0,children:s._(/*BTDS*/"Content ID: {content id}",[s._param("content id",e.content_id)])})]})]})},width:(t=o("GeoTableWidth")).proportional(1),header:s._(/*BTDS*/"{Name for variant}",[s._param("Name for variant",c.jsx(e=r("GeoBaseText.react"),{color:"valueDescription",size:"valueDescription",weight:"bold",children:s._(/*BTDS*/"Variant")}))])},{key:"category",cell:function(t){var e=t.item;return c.jsx(r("GeoBaseText.react"),{color:"value",overflowWrap:"break-word",size:"valueDescription",children:e.category})},width:t.proportional(1),header:s._(/*BTDS*/"{category name}",[s._param("category name",c.jsx(e,{color:"value",size:"valueDescription",weight:"bold",children:s._(/*BTDS*/"Category")}))])},{key:"product_purchases_conversion_value",cell:function(t){var e,n=t.item;return c.jsx(r("GeoBaseText.react"),{color:"value",size:"valueDescription",children:o("AdsPLRUtils").getPrettyMetricValueWithCurrency(l,(e=n.pcv)!=null?e:0)})},width:t.proportional(1),header:s._(/*BTDS*/"{header for product purchase conversion value}",[s._param("header for product purchase conversion value",c.jsx(e,{color:"value",size:"valueDescription",textAlign:"start",weight:"bold",children:s._(/*BTDS*/"Product purchase conversion value")}))])},{key:"product_purchases_conversion_value_percentage",cell:function(t){var e=t.item;return c.jsxs(r("GeoBaseText.react"),{color:"value",size:"valueDescription",children:[e.pcv_perc,"%"]})},width:t.proportional(1),header:s._(/*BTDS*/"{header for product purchase conversion value}",[s._param("header for product purchase conversion value",c.jsxs(e,{color:"value",size:"valueDescription",textAlign:"start",weight:"bold",children:[s._(/*BTDS*/"Product purchase conversion value percentage"),n]}))])}]},[l]),E=m(function(e){return e.product_id},[]),k=p(function(){return r("createGeoTableDataSource")(R,{getStableUniqueID:E})},[E,R]),I=_(""),T=I[0],D=I[1],x=r("useGeoTableRowHeader")({key:"variant"}),$=m(function(){var e=r("XAdsPLRUpdateOrDuplicateProductSetWithMissingConvertedProductsControllerRouteBuilder").buildURL({product_set_id:d.productSetID,product_set_name:T,ad_account_id:i});new(r("AsyncRequest"))().setURI(e).setMethod("POST").setHandler(function(e){e.payload.success&&(C(!0),g(e.payload.product_set_id))})},[i,T,d.productSetID,g,C]);return c.jsx(r("GeoModal.react"),{footer:c.jsx(r("GeoModalFooter.react"),{primaryButton:c.jsx(r("GeoButton.react"),{isDisabled:u==="create"?T.trim()==="":!1,label:u==="create"?s._(/*BTDS*/"Create set"):s._(/*BTDS*/"Update set"),variant:"primary",onClick:$}),secondaryButton:c.jsx(r("GeoCancelButton.react"),{})}),header:c.jsx(r("GeoModalHeader.react"),{description:s._(/*BTDS*/"Products outside of your product set have high product purchases conversion values. Create and promote a new set or add them to your current set."),heading:s._(/*BTDS*/"Add {Missing product count} products to {Product set name}",[s._param("Missing product count",R.length),s._param("Product set name",d.productSetName)])}),label:s._(/*BTDS*/"Product set update modal"),width:900,xstyle:f.dialogContainer,onHide:function(){return y(!1)},children:c.jsx(r("GeoSection.react"),{variant:"secondary",children:c.jsxs(r("GeoHStack.react"),{children:[c.jsx(r("GeoTable.react"),{columns:L,dataSource:k,label:s._(/*BTDS*/"Missing products"),plugins:{rowHeader:x},xstyle:[r("geoMargin").vert16,f.productContainer]}),c.jsxs(r("GeoVStack.react"),{xstyle:[r("geoMargin").vert16,r("geoMargin").start8,o("GeoColorSelectors").selectStaticBackgroundColor({surface:"content"}),f.ctaContainer],children:[c.jsx(r("GeoBaseText.react"),{color:"heading",size:"value",weight:"bold",xstyle:[r("geoMargin").top12,r("geoMargin").start12],children:s._(/*BTDS*/"Choose how to update your product set")}),c.jsxs(r("GeoVStack.react"),{alignSelf:"start",xstyle:[r("geoMargin").start24,r("geoMargin").top16],children:[c.jsx(r("GeoFlexbox.react"),{children:c.jsxs(r("GeoRadioList.react"),{isLabelHidden:!0,label:s._(/*BTDS*/"Product set update radio list"),value:u,onChange:h,children:[c.jsx(r("GeoRadioListItem.react"),{description:s._(/*BTDS*/"Make edits here to update set across all channels."),label:s._(/*BTDS*/"Add to current product set"),value:"update"}),c.jsx(r("GeoRadioListItem.react"),{description:s._(/*BTDS*/"Name and promote as a new product set."),label:s._(/*BTDS*/"Create new product set"),value:"create"})]})}),u==="create"&&c.jsx(r("GeoFlexbox.react"),{xstyle:r("geoMargin").start8,children:c.jsx(r("GeoTextInput.react"),{label:s._(/*BTDS*/"New product set name"),value:T,xstyle:r("geoMargin").start24,onChange:D})})]})]})]})})})}g.displayName=g.name+" [from "+i.id+"]",l.default=g}),226);
-----
AdsPLRProductSetUpdateModalQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"adAccountID"},{defaultValue:null,kind:"LocalArgument",name:"productSetID"}],t=[{alias:null,args:[{kind:"Variable",name:"ad_account_id",variableName:"adAccountID"},{kind:"Variable",name:"product_set_id",variableName:"productSetID"}],concreteType:"XFBPLRTopMissingProductData",kind:"LinkedField",name:"xfb_product_level_reporting_top_missing_products",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBPLRProductInsight",kind:"LinkedField",name:"top_missing_products",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"category",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"content_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"image_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"pcv",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"pcv_perc",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"AdsPLRProductSetUpdateModalQuery",selections:t,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"AdsPLRProductSetUpdateModalQuery",selections:t},params:{id:"32532793136334106",metadata:{},name:"AdsPLRProductSetUpdateModalQuery",operationKind:"query",text:null}}})();a.exports=e}),null);
-----
-----
AdsPLRProductSetUpdateModalQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"adAccountID"},{defaultValue:null,kind:"LocalArgument",name:"productSetID"}],t=[{alias:null,args:[{kind:"Variable",name:"ad_account_id",variableName:"adAccountID"},{kind:"Variable",name:"product_set_id",variableName:"productSetID"}],concreteType:"XFBPLRTopMissingProductData",kind:"LinkedField",name:"xfb_product_level_reporting_top_missing_products",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBPLRProductInsight",kind:"LinkedField",name:"top_missing_products",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"category",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"content_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"image_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"pcv",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"pcv_perc",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"AdsPLRProductSetUpdateModalQuery",selections:t,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"AdsPLRProductSetUpdateModalQuery",selections:t},params:{id:"32532793136334106",metadata:{},name:"AdsPLRProductSetUpdateModalQuery",operationKind:"query",text:null}}})();a.exports=e}),null);
-----