OCDevManagePlayerVariablesImportVarSelector.react",["fbt","ix","GeoAccordionList.react","GeoBaseSpacingLayout.react","GeoBaseText.react","GeoButton.react","GeoCancelButton.react","GeoDivider.react","GeoFlexbox.react","GeoIcon.react","GeoModalCard.react","GeoModalFooter.react","GeoModalHeader.react","GeoSection.react","GeoText.react","GeoToast.react","Image.react","OCDevManagePlayerVariablesImportDataGroupList.react","OCDevManagePlayerVariablesImportModal.react","OCDevManagePlayerVariablesImportVarSelectorMutation.graphql","OCDevManagePlayerVariablesImportVarSelector_world.graphql","OCDevUIForm.react","RelayHooks","fbicon","geoMargin","geoWidth","react","sumOfArray","useGeoToaster","useOCDevManageRouteParams","useOCDevUICommitMutation","useOCDevUIModal"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l,m;e=m||d("react");var n=l||(l=c("react")),o=e.useCallback,p=e.useState;function a(a){var e,f,g,l,m=a.searchTerm;a=a.world;a=d("RelayHooks").useFragment(j!==void 0?j:j=b("OCDevManagePlayerVariablesImportVarSelector_world.graphql"),a);var q=c("useOCDevUICommitMutation")(k!==void 0?k:k=b("OCDevManagePlayerVariablesImportVarSelectorMutation.graphql")),r=c("useOCDevManageRouteParams")(),s=r.applicationID;r=p([]);var t=r[0],u=r[1];r=c("sumOfArray")((r=a==null||(e=a.data_groups)==null||(e=e.nodes)==null?void 0:e.map(function(a){return(a=(a=a.stats_query)==null?void 0:a.count)!=null?a:0}))!=null?r:[]);var v=c("useOCDevUIModal")(),w=v.closeModal,x=v.openModal;function y(){x(n.jsx(c("OCDevManagePlayerVariablesImportModal.react"),{initialSearchTerm:m}))}var z=o(function(a){u(function(b){return b.includes(a)?b.filter(function(b){return b!==a}):[].concat(b,[a])})},[]);function A(a,b){u(function(c){if(b){var d=a.filter(function(a){return!c.includes(a)});return[].concat(c,d)}return c.filter(function(b){return a.indexOf(b)<0})})}function B(a,b,d){a>0&&D(n.jsx(c("GeoToast.react"),{description:d,heading:b==="success"?h._(/*BTDS*/{"*":"{number} variables imported","_1":"1 variable imported"},[h._plural(a,"number")]):h._(/*BTDS*/{"*":"{number} variables not imported","_1":"1 variable not imported"},[h._plural(a,"number")]),status:b}))}function C(){return q({input:{application_id:s!=null?s:"",hur_stat_ids:t}},{refetchOnSuccess:!0,closeModalOnSuccess:!0,onCompleted:function(a){var b;B((b=(b=a.xoc_import_horizon_persistent_variable_from_hur)==null||(b=b.horizon_persistent_variables)==null?void 0:b.length)!=null?b:0,"success");B((b=(b=a.xoc_import_horizon_persistent_variable_from_hur)==null?void 0:b.failed_to_import_count)!=null?b:0,"error",h._(/*BTDS*/{"*":"Imported variables have duplicate names","_1":"Imported variable has duplicate name"},[h._plural((b=(b=a.xoc_import_horizon_persistent_variable_from_hur)==null?void 0:b.failed_to_import_count)!=null?b:0)]));B((b=(b=a.xoc_import_horizon_persistent_variable_from_hur)==null?void 0:b.already_imported_count)!=null?b:0,"error",h._(/*BTDS*/{"*":"Variables already imported","_1":"Variable already imported"},[h._plural((a=(b=a.xoc_import_horizon_persistent_variable_from_hur)==null?void 0:b.already_imported_count)!=null?a:0)]))}})}v=c("useGeoToaster")();var D=v.add;return n.jsx(c("OCDevUIForm.react"),{children:n.jsx(c("GeoModalCard.react"),{footer:n.jsx(c("GeoModalFooter.react"),{primaryButton:n.jsx(c("GeoButton.react"),{"data-testid":void 0,isDisabled:t.length===0,label:h._(/*BTDS*/"Import Variables"),variant:"primary",onClick:C}),secondaryButton:n.jsx(c("GeoCancelButton.react"),{"data-testid":void 0,onClick:w})}),header:n.jsx(c("GeoModalHeader.react"),{heading:h._(/*BTDS*/"Import Variables from {world name}",[h._param("world name",a==null?void 0:a.name)]),onBack:y}),children:n.jsxs(c("GeoSection.react"),{children:[n.jsxs(c("GeoBaseSpacingLayout.react"),{children:[(a==null||(f=a.primary_screenshot)==null?void 0:f.requested_image_uri)!=null?n.jsx(c("Image.react"),{src:a==null||(g=a.primary_screenshot)==null?void 0:g.requested_image_uri,width:76}):n.jsx(c("GeoIcon.react"),{icon:d("fbicon")._(i("492686"),24)}),n.jsxs(c("GeoBaseSpacingLayout.react"),{align:"start",context:"component",direction:"vertical",relation:"related",children:[n.jsx(c("GeoBaseText.react"),{color:"heading",size:"header3",children:h._(/*BTDS*/"{world name}",[h._param("world name",a==null?void 0:a.name)])}),n.jsx(c("GeoText.react"),{children:h._(/*BTDS*/{"*":"{number} variables","_1":"1 variable"},[h._plural(r,"number")])})]})]}),n.jsx(c("GeoFlexbox.react"),{xstyle:c("geoMargin").vert8,children:n.jsx(c("GeoText.react"),{children:h._(/*BTDS*/"{world description}",[h._param("world description",a==null?void 0:a.description)])})}),n.jsx(c("GeoDivider.react"),{xstyle:c("geoMargin").vert8}),n.jsx(c("GeoAccordionList.react"),{heading:h._(/*BTDS*/"Variable Groups"),variant:"flat",xstyle:c("geoWidth").fullWidth,children:a==null||(l=a.data_groups)==null?void 0:l.nodes.map(function(a){return a==null||a.id==null?null:n.jsx(c("OCDevManagePlayerVariablesImportDataGroupList.react"),{batchStatUpdate:A,dataGroup:a,selectedStatIDs:t,toggleSelectedStat:z},a.id)})}),n.jsx(c("GeoDivider.react"),{xstyle:c("geoMargin").vert8})]})})})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
-----
OCDevManagePlayerVariablesImportVarSelectorMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"XOCImportHorizonPersistentVariableFromHurResponsePayload",kind:"LinkedField",name:"xoc_import_horizon_persistent_variable_from_hur",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"already_imported_count",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"failed_to_import_count",storageKey:null},{alias:null,args:null,concreteType:"XOCHorizonPersistentVariable",kind:"LinkedField",name:"horizon_persistent_variables",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"OCDevManagePlayerVariablesImportVarSelectorMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"OCDevManagePlayerVariablesImportVarSelectorMutation",selections:b},params:{id:"30520000207614254",metadata:{},name:"OCDevManagePlayerVariablesImportVarSelectorMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----
-----
OCDevManagePlayerVariablesImportVarSelectorMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"XOCImportHorizonPersistentVariableFromHurResponsePayload",kind:"LinkedField",name:"xoc_import_horizon_persistent_variable_from_hur",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"already_imported_count",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"failed_to_import_count",storageKey:null},{alias:null,args:null,concreteType:"XOCHorizonPersistentVariable",kind:"LinkedField",name:"horizon_persistent_variables",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"OCDevManagePlayerVariablesImportVarSelectorMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"OCDevManagePlayerVariablesImportVarSelectorMutation",selections:b},params:{id:"30520000207614254",metadata:{},name:"OCDevManagePlayerVariablesImportVarSelectorMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----