export default class FSActionFormResponse {
    constructor(rawResponse, form) {
        this.rawResponse = null;
        this.parentForm = null;
        this.canceled = false;
        this.data = {};
        this.rawResponse = rawResponse;
        this.parentForm = form;
        this.canceled = this.rawResponse.canceled;
        if (!this.canceled) {
            this.data = {};
            const selectedIndex = rawResponse.selection;
            const fieldName = Object.keys(this.parentForm.fieldMap).find((key) => this.parentForm.fieldMap[key] === selectedIndex);
            for (const key of Object.keys(this.parentForm.fieldMap)) {
                const value = this.parentForm.fieldMap[key];
                this.data[key] = value === selectedIndex;
            }
        }
        else {
        }
    }
    finish(keyedByFormId = false) {
        if (this.parentForm._navController) {
            return this.parentForm._navController.finish(keyedByFormId);
        }
        else {
            console.error("Can not finish this form because no associated nav controller.");
            return {};
        }
    }
    getResponseData(keyedByFormId = false) {
        if (this.parentForm._navController) {
            return this.parentForm._navController.getResponseData(keyedByFormId);
        }
        else {
            console.error("Can not finish this form because no associated nav controller.");
            return {};
        }
    }
}

//# sourceMappingURL=../../../../../../_SBUNK_BPDebug/fs_sbunk/fs/forms/resps/FSActionFormResp.js.map
