'use strict';
import { onValidation, getRequiredFields } from '../edit-resource-validation.js';
import { submitEditResource } from './edit-resource-components.js';
import { emptyUuid } from '../../../../fd-toolbox/constants/constants.js';

var __defProp=Object['defineProperty'],__name=(_0x3d6d12,_0x5d2761)=>__defProp(_0x3d6d12,'name',{'value':_0x5d2761,'configurable':!![]});function onEditResourceValidation(_0x478ff9,_0x5c7f7e,_0x23e40d,_0x17fc98,_0x43574c){return onValidation(_0x478ff9['resourceMeta'],_0x5c7f7e,getRequiredFieldsCallback,_0x23e40d,_0x17fc98,_0x43574c);}__name(onEditResourceValidation,'onEditResourceValidation');function getRequiredFieldsCallback(_0x418f79,_0x15fe8e){if(!_0x418f79)return [];return Object['values'](_0x418f79)['filter'](_0x1c7a51=>getRequiredFields(_0x1c7a51,_0x15fe8e));}__name(getRequiredFieldsCallback,'getRequiredFieldsCallback');async function onResourceSave(_0x1a9358,_0x142d21,_0x75e863,_0x435dae,_0x6f758d,_0x3b25c3,_0x382e94,_0x58399b,_0x2c02ad,_0x276668,_0x3852b7,_0x39e165,_0x34cc5e,_0x17a56c,_0x1e16c6){_0x382e94(_0x5f24e7=>_0x5f24e7+(0x19a6*0x1+-0x1*0x2593+-0x1*-0xbee)),_0x17a56c?.();if(!_0x58399b)_0x2c02ad(!![]);await onSave(_0x142d21,_0x75e863,_0x435dae,_0x6f758d,_0x3b25c3,_0x1a9358,_0x3852b7,_0x39e165,_0x34cc5e);if(_0x6f758d)_0x276668(![]);_0x382e94(_0x2bf082=>_0x2bf082-(0x1169*0x2+0xb57*0x2+-0x29*0x167)),_0x1e16c6?.();}__name(onResourceSave,'onResourceSave');async function onSave(_0x2453e5,_0x186b15,_0x5c2d16,_0x575f1e,_0x1275d6,_0x5f5686,_0x38f748,_0x1428e0,_0x13e219){if(!_0x2453e5())return;_0x1428e0&&await submitEditResource(_0x186b15,_0x5c2d16,_0x575f1e,_0x1275d6,_0x5f5686,_0x1428e0,void(0x1e0d+0xc34+-0x1*0x2a41),_0x13e219),_0x38f748?.({..._0x186b15['getValues'](),'id':emptyUuid});}__name(onSave,'onSave');

export { onEditResourceValidation, onResourceSave };
