import{aa as l}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{s as m}from"./machine.-tangy-colts-beg-869.js";import{h as o}from"./commonut-tangy-colts-beg-953.js";import{h as i,f as n}from"./machineh-tangy-colts-beg-110.js";import{w as d}from"./wpuserfi-tangy-colts-beg-384.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,a){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,a),a)}};const M=l(({helpers:e})=>({states:{components:[{componentName:e.componentName.mixInput,id:"user-id",label:t("User Id"),onChange:"HANDLE_USER_ID",path:"userId",render:!0,required:!0,value:void 0},{addItemButtonLabel:t("Add Field"),componentName:e.componentName.repeaterField,fieldsMetaData:[{componentName:e.componentName.select,label:t("Field"),name:"wordPressField",options:d,required:!0,style:{width:150},value:""},{componentName:e.componentName.mixInput,label:t("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"field-map",label:t("Field Map"),onChange:"HANDLE_FIELD_MAPPING",path:"fieldMap",render:!0,value:[]},{addItemButtonLabel:t("Add Field"),componentName:e.componentName.repeaterField,fieldsMetaData:[{componentName:e.componentName.mixInput,label:t("Meta Key"),name:"meta_key",required:!0,value:[],wrapperClassName:"w-100"},{componentName:e.componentName.mixInput,label:t("Value"),name:"value",required:!0,value:[],wrapperClassName:"w-100"}],id:"user-meta-field-map",label:t("User Meta Field Map"),nonRemovableRows:[],onChange:"HANDLE_META_FIELD_MAPPING",path:"userMetaFieldMap",render:"SHOULD_SHOW_USER_META_FIELD_MAPPING",value:[]},{componentName:e.componentName.switch,fieldType:"config",id:"show-user-meta-field",label:t("Show User Meta Field Mapping"),onChange:"SHOW_META_FIELD_ENABLE",path:"showUserMetaField",render:!0,value:!1,wrapperClassName:"my-1"},{componentName:e.componentName.select,id:"user-role",label:t("Select User Role"),onChange:"SELECT_USER_ROLE",onRefetch:"REFETCH_USER_ROLES",options:[],path:"userRole",render:!0,value:void 0}]},actions:{SHOULD_SHOW_USER_META_FIELD_MAPPING:({$:a})=>{var r;return((r=a.getComponent("show-user-meta-field"))==null?void 0:r.value)===!0},ON_MACHINE_LOAD:async({$:a})=>{m(a,[{db:"userId",id:"user-id"},{db:"fieldMap",id:"field-map"},{db:"userRole",id:"user-role"},{db:"showUserMetaField",id:"show-user-meta-field"},{db:"userMetaFieldMap",id:"user-meta-field-map"}]),await n(a)},REFETCH_USER_ROLES:async({$:a})=>{await n(a)},GENERATE_PASSWORD:async({$:a})=>{await i(a)},HANDLE_FIELD_MAPPING:o("fieldMap"),HANDLE_META_FIELD_MAPPING:o("userMetaFieldMap"),HANDLE_USER_ID:o("userId"),SELECT_USER_ROLE:o("userRole"),SHOW_META_FIELD_ENABLE:o("showUserMetaField")}}));export{M as default};
