"use strict";
/**
 * AI 字段配置面板适配器
 *
 * 将 field-system 定义的 FieldPanelProps 桥接到已有的 AiFieldConfigPanel 组件。
 * 适配器负责：
 * - 从 FieldPanelProps.context 中提取 AiColumnService 的 loading 状态
 * - 将 AiFieldConfigPanel 的 onSave(config, mode) 转换为 FieldPanelProps.onSave({ ...config, saveMode })
 *
 * 创建和编辑场景共用同一个适配器（通过 isEditStatus 区分）。
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AiFieldPanelAdapter = void 0;
const react_1 = __importDefault(require("react"));
const ai_field_config_panel_1 = require("../../../../../cn-ai-table/view/components/toolbar/components/add-field/ai-field/ai-field-config-panel");
const AiFieldPanelAdapter = ({ fieldType, fieldLabel, columnCode, initialValue, isEditStatus, context, onSave, onCancel, }) => {
    var _a, _b;
    const aiColumnService = context.services.aiColumn;
    return (react_1.default.createElement(ai_field_config_panel_1.AiFieldConfigPanel, { fieldType: fieldType, fieldLabel: fieldLabel, tableId: context.dataModel.tableId, rawData: context.dataModel.rawData, columnCode: columnCode, initialPromptTemplate: initialValue, isEditStatus: isEditStatus, saving: (_a = aiColumnService === null || aiColumnService === void 0 ? void 0 : aiColumnService.savingAiColumn) !== null && _a !== void 0 ? _a : false, executing: (_b = aiColumnService === null || aiColumnService === void 0 ? void 0 : aiColumnService.executingColumnTask) !== null && _b !== void 0 ? _b : false, onSave: (config, mode) => {
            onSave({ ...config, saveMode: mode });
        }, onCancel: onCancel }));
};
exports.AiFieldPanelAdapter = AiFieldPanelAdapter;
