AvatarCreatorsItemListingSaveButton.react",["fbt","AvatarCreatorsCreationFlowGates","AvatarCreatorsItemDetailsUtils.react","AvatarCreatorsItemListingSaveButtonPublishMutation.graphql","AvatarCreatorsItemListingSaveButtonUpdateMutation.graphql","CometRelay","EconomyDigiGoodsLogger","EconomyDigiGoodsSessionStorageUtil","GeoButton.react","GeoToast.react","react","useGeoToaster"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k,l=k||(k=d("react"));e=k;var m=e.useCallback,n=e.useMemo,o=i!==void 0?i:i=b("AvatarCreatorsItemListingSaveButtonPublishMutation.graphql"),p=j!==void 0?j:j=b("AvatarCreatorsItemListingSaveButtonUpdateMutation.graphql"),q=function(a){var b=a.checkEmptyWorlds,c=a.description,e=a.name,f=a.price;a=a.worldLists;return e.length>0&&c.length>0&&f!=null&&f>=25&&f<=2e4&&(d("AvatarCreatorsCreationFlowGates").isIWPV2()||a.length>0||!b)};function a(a){var b=a.isUpdate;a=babelHelpers.objectWithoutPropertiesLoose(a,["isUpdate"]);return b?l.jsx(r,babelHelpers["extends"]({},a)):l.jsx(s,babelHelpers["extends"]({},a))}a.displayName=a.name+" [from "+f.id+"]";function r(a){var b=a.description,e=a.gameStats,f=a.gameStatsDescription,g=a.gameStatsWorlds,i=a.itemKey,j=a.name,k=a.onSaved,o=a.price,r=a.worldIdList;a=d("CometRelay").useMutation(p);var s=a[0];a=a[1];var t=c("useGeoToaster")(),u=n(function(){var a;return(a=r)!=null?a:[]},[r]),v=m(function(){var a=function(){k(!0)},c=function(a){d("AvatarCreatorsItemDetailsUtils.react").notifyMutationAPIError(a,t),k(!1)};s({onCompleted:a,onError:c,uploadables:{},variables:{input:{creatable_id:i,entry_point:"HORIZON_CREATOR_PORTAL",payload:{acquisition_payload:{acquisition_type:"META_CREDITS",meta_credits_acquisition_payload:{price:(a=o)!=null?a:0}},description:b,distribution_payload:d("AvatarCreatorsCreationFlowGates").isIWPV2()?null:{distribution_type:"WORLD_LOCKED",world_locked_distribution_config:{world_ids:u}},game_stats_payload:e===""?void 0:{allowlisted_worlds:g,description:f,stats:e},name:j}}}})},[s,i,o,b,u,e,f,g,j,k,t]);return l.jsx(c("GeoButton.react"),{"data-testid":void 0,isDisabled:a||!q({checkEmptyWorlds:!0,description:b,name:j,price:o,worldLists:u})||!d("AvatarCreatorsItemDetailsUtils.react").isGameStatsValid(e)||!d("AvatarCreatorsItemDetailsUtils.react").isGameStatsDescriptionValid(f,e),isLoading:a,label:h._(/*BTDS*/"Save"),onClick:function(){var a;d("EconomyDigiGoodsLogger").logClothingItemEditSaveButtonClick(i,j,b,(a=o)!=null?a:0);d("EconomyDigiGoodsSessionStorageUtil").economyDigiGoodsClearWaterfallSessionId();v()},variant:"primary"})}r.displayName=r.name+" [from "+f.id+"]";function s(a){var b=a.description,e=a.gameStats,f=a.gameStatsDescription,g=a.gameStatsWorlds,i=a.itemKey,j=a.name,k=a.onSaved,p=a.price,r=a.worldIdList;a=d("CometRelay").useMutation(o);var s=a[0];a=a[1];var t=c("useGeoToaster")(),u=n(function(){var a;return(a=r)!=null?a:[]},[r]),v=m(function(){var a=function(a){a=(a=a.xfb_digigoods_creatable_publish)==null?void 0:a.creatable;t.add(l.jsx(c("GeoToast.react"),{description:"Item successfully published. Creatable ID: "+((a=a==null?void 0:a.id)!=null?a:""),heading:h._(/*BTDS*/"Item listing published successfully."),status:"success"}));k(!0)},m=function(a){d("AvatarCreatorsItemDetailsUtils.react").notifyMutationAPIError(a,t),k(!1)};s({onCompleted:a,onError:m,uploadables:{},variables:{input:{creatable_id:i,entry_point:"HORIZON_CREATOR_PORTAL",payload:{acquisition_payload:{acquisition_type:"META_CREDITS",meta_credits_acquisition_payload:{price:(a=p)!=null?a:0}},description:b,distribution_payload:{distribution_type:"WORLD_LOCKED",world_locked_distribution_config:d("AvatarCreatorsCreationFlowGates").isIWPV2()?void 0:{world_ids:u}},game_stats_payload:e===""?void 0:{allowlisted_worlds:g,description:f,stats:e},name:j}}}})},[s,i,p,b,u,e,f,g,j,t,k]);return l.jsx(c("GeoButton.react"),{"data-testid":void 0,isDisabled:a||!q({checkEmptyWorlds:!0,description:b,name:j,price:p,worldLists:u})||!d("AvatarCreatorsItemDetailsUtils.react").isGameStatsValid(e)||!d("AvatarCreatorsItemDetailsUtils.react").isGameStatsDescriptionValid(f,e),isLoading:a,label:h._(/*BTDS*/"Save"),onClick:function(){var a;d("EconomyDigiGoodsLogger").logClothingItemEditSaveButtonClick(i,j,b,(a=p)!=null?a:0);d("EconomyDigiGoodsSessionStorageUtil").economyDigiGoodsClearWaterfallSessionId();v()},variant:"primary"})}s.displayName=s.name+" [from "+f.id+"]";g["default"]=a}),226);
-----
AvatarCreatorsItemListingSaveButtonUpdateMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="29800632982884751"}),null);
-----
AvatarCreatorsItemListingSaveButtonUpdateMutation.graphql",["AvatarCreatorsItemListingSaveButtonUpdateMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{kind:"Variable",name:"data",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"digigoods_name",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"digigoods_sku",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"digigoods_description",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"digigoods_status_localized",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"last_updated_time",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"digigoods_status",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"price_meta_credits",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"allowlisted_worlds",storageKey:null},n={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"stats",storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"AvatarCreatorsItemListingSaveButtonUpdateMutation",selections:[{alias:null,args:c,concreteType:"XFBDigiGoodsCreatableUpdateResponse",kind:"LinkedField",name:"xfb_digigoods_creatable_update",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBDigiGoodsCreatableResponseObject",kind:"LinkedField",name:"creatable",plural:!1,selections:[d,e,f,g,h,i,j,k,l,{alias:null,args:null,concreteType:"XFBMVMGameStats",kind:"LinkedField",name:"game_stats",plural:!1,selections:[m,n,o],storageKey:null}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"AvatarCreatorsItemListingSaveButtonUpdateMutation",selections:[{alias:null,args:c,concreteType:"XFBDigiGoodsCreatableUpdateResponse",kind:"LinkedField",name:"xfb_digigoods_creatable_update",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBDigiGoodsCreatableResponseObject",kind:"LinkedField",name:"creatable",plural:!1,selections:[d,e,f,g,h,i,j,k,l,{alias:null,args:null,concreteType:"XFBMVMGameStats",kind:"LinkedField",name:"game_stats",plural:!1,selections:[m,n,o,d],storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:b("AvatarCreatorsItemListingSaveButtonUpdateMutation_facebookRelayOperation"),metadata:{},name:"AvatarCreatorsItemListingSaveButtonUpdateMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----
-----
AvatarCreatorsItemListingSaveButtonUpdateMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="29800632982884751"}),null);
-----
AvatarCreatorsItemListingSaveButtonUpdateMutation.graphql",["AvatarCreatorsItemListingSaveButtonUpdateMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{kind:"Variable",name:"data",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"digigoods_name",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"digigoods_sku",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"digigoods_description",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"digigoods_status_localized",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"last_updated_time",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"digigoods_status",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"price_meta_credits",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"allowlisted_worlds",storageKey:null},n={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"stats",storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"AvatarCreatorsItemListingSaveButtonUpdateMutation",selections:[{alias:null,args:c,concreteType:"XFBDigiGoodsCreatableUpdateResponse",kind:"LinkedField",name:"xfb_digigoods_creatable_update",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBDigiGoodsCreatableResponseObject",kind:"LinkedField",name:"creatable",plural:!1,selections:[d,e,f,g,h,i,j,k,l,{alias:null,args:null,concreteType:"XFBMVMGameStats",kind:"LinkedField",name:"game_stats",plural:!1,selections:[m,n,o],storageKey:null}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"AvatarCreatorsItemListingSaveButtonUpdateMutation",selections:[{alias:null,args:c,concreteType:"XFBDigiGoodsCreatableUpdateResponse",kind:"LinkedField",name:"xfb_digigoods_creatable_update",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBDigiGoodsCreatableResponseObject",kind:"LinkedField",name:"creatable",plural:!1,selections:[d,e,f,g,h,i,j,k,l,{alias:null,args:null,concreteType:"XFBMVMGameStats",kind:"LinkedField",name:"game_stats",plural:!1,selections:[m,n,o,d],storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:b("AvatarCreatorsItemListingSaveButtonUpdateMutation_facebookRelayOperation"),metadata:{},name:"AvatarCreatorsItemListingSaveButtonUpdateMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----