devextreme-dist
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
897 lines (895 loc) • 101 kB
JavaScript
/*!
* DevExtreme (dx.ai-integration.debug.js)
* Version: 26.1.3
* Build date: Wed Jun 10 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
"use strict";
(() => {
var __webpack_modules__ = {
55390(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BaseCommand = void 0;
exports.BaseCommand = class {
constructor(promptManager, requestManager) {
this.promptManager = promptManager;
this.requestManager = requestManager
}
execute(params, callbacks) {
const templateName = this.getTemplateName();
const data = this.buildPromptData(params);
const options = this.getBuildPromptOptions();
const prompt = this.promptManager.buildPrompt(templateName, data, options);
const requestManagerCallbacks = {
onChunk: chunk => {
var _callbacks$onChunk;
null === callbacks || void 0 === callbacks || null === (_callbacks$onChunk = callbacks.onChunk) || void 0 === _callbacks$onChunk || _callbacks$onChunk.call(callbacks, chunk)
},
onComplete: result => {
var _callbacks$onComplete;
const finalResponse = this.parseResult(result, params);
null === callbacks || void 0 === callbacks || null === (_callbacks$onComplete = callbacks.onComplete) || void 0 === _callbacks$onComplete || _callbacks$onComplete.call(callbacks, finalResponse)
},
onError: error => {
var _callbacks$onError;
null === callbacks || void 0 === callbacks || null === (_callbacks$onError = callbacks.onError) || void 0 === _callbacks$onError || _callbacks$onError.call(callbacks, error)
}
};
const abort = this.requestManager.sendRequest(prompt, requestManagerCallbacks, params);
return abort
}
getBuildPromptOptions() {
return {
applyMetaTemplates: true
}
}
}
},
5654(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ChangeStyleCommand = void 0;
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
class ChangeStyleCommand extends _base.BaseCommand {
getTemplateName() {
return "changeStyle"
}
buildPromptData(params) {
return {
system: {
writingStyle: params.writingStyle
},
user: {
text: params.text
}
}
}
parseResult(response) {
return response
}
}
exports.ChangeStyleCommand = ChangeStyleCommand
},
16927(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ChangeToneCommand = void 0;
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
class ChangeToneCommand extends _base.BaseCommand {
getTemplateName() {
return "changeTone"
}
buildPromptData(params) {
return {
system: {
tone: params.tone
},
user: {
text: params.text
}
}
}
parseResult(response) {
return response
}
}
exports.ChangeToneCommand = ChangeToneCommand
},
15436(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ExecuteCommand = void 0;
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
class ExecuteCommand extends _base.BaseCommand {
getTemplateName() {
return "execute"
}
buildPromptData(params) {
return {
user: {
text: params.text
}
}
}
parseResult(response) {
return response
}
}
exports.ExecuteCommand = ExecuteCommand
},
714(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ExecuteGridAssistantCommand = void 0;
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
class ExecuteGridAssistantCommand extends _base.BaseCommand {
getTemplateName() {
return "executeGridAssistant"
}
buildPromptData(params) {
return {
user: {
text: params.text,
context: JSON.stringify(params.context)
}
}
}
parseResult(response) {
if ("string" === typeof response) {
if ("" === response) {
return {
actions: []
}
}
return JSON.parse(response)
}
const actions = "string" === typeof response.actions ? JSON.parse(response.actions) : response.actions;
return {
actions: actions
}
}
}
exports.ExecuteGridAssistantCommand = ExecuteGridAssistantCommand
},
37887(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ExpandCommand = void 0;
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
class ExpandCommand extends _base.BaseCommand {
getTemplateName() {
return "expand"
}
buildPromptData(params) {
return {
user: {
text: params.text
}
}
}
parseResult(response) {
return response
}
}
exports.ExpandCommand = ExpandCommand
},
88890(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GenerateGridColumnCommand = void 0;
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
class GenerateGridColumnCommand extends _base.BaseCommand {
getTemplateName() {
return "generateGridColumn"
}
buildPromptData(params) {
const dataDescription = this.generateDataDescription(params.data);
return {
user: {
text: params.text,
data: dataDescription
}
}
}
parseResult(response) {
if ("string" === typeof response) {
if ("" === response) {
return {
data: {}
}
}
return {
data: JSON.parse(response)
}
}
const data = "string" === typeof response.data ? JSON.parse(response.data) : response.data;
return {
data: data
}
}
generateDataDescription(data) {
const result = JSON.stringify(data);
return result
}
}
exports.GenerateGridColumnCommand = GenerateGridColumnCommand
},
39171(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "BaseCommand", {
enumerable: true,
get: function() {
return _base.BaseCommand
}
});
Object.defineProperty(exports, "ChangeStyleCommand", {
enumerable: true,
get: function() {
return _changeStyle.ChangeStyleCommand
}
});
Object.defineProperty(exports, "ChangeToneCommand", {
enumerable: true,
get: function() {
return _changeTone.ChangeToneCommand
}
});
Object.defineProperty(exports, "ExecuteCommand", {
enumerable: true,
get: function() {
return _execute.ExecuteCommand
}
});
Object.defineProperty(exports, "ExecuteGridAssistantCommand", {
enumerable: true,
get: function() {
return _executeGridAssistant.ExecuteGridAssistantCommand
}
});
Object.defineProperty(exports, "ExpandCommand", {
enumerable: true,
get: function() {
return _expand.ExpandCommand
}
});
Object.defineProperty(exports, "ProofreadCommand", {
enumerable: true,
get: function() {
return _proofread.ProofreadCommand
}
});
Object.defineProperty(exports, "ShortenCommand", {
enumerable: true,
get: function() {
return _shorten.ShortenCommand
}
});
Object.defineProperty(exports, "SmartPasteCommand", {
enumerable: true,
get: function() {
return _smartPaste.SmartPasteCommand
}
});
Object.defineProperty(exports, "SummarizeCommand", {
enumerable: true,
get: function() {
return _summarize.SummarizeCommand
}
});
Object.defineProperty(exports, "TranslateCommand", {
enumerable: true,
get: function() {
return _translate.TranslateCommand
}
});
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
var _changeStyle = __webpack_require__( /*! ../../../core/ai_integration/commands/changeStyle */ 5654);
var _changeTone = __webpack_require__( /*! ../../../core/ai_integration/commands/changeTone */ 16927);
var _execute = __webpack_require__( /*! ../../../core/ai_integration/commands/execute */ 15436);
var _expand = __webpack_require__( /*! ../../../core/ai_integration/commands/expand */ 37887);
var _proofread = __webpack_require__( /*! ../../../core/ai_integration/commands/proofread */ 11121);
var _shorten = __webpack_require__( /*! ../../../core/ai_integration/commands/shorten */ 36050);
var _smartPaste = __webpack_require__( /*! ../../../core/ai_integration/commands/smartPaste */ 32067);
var _summarize = __webpack_require__( /*! ../../../core/ai_integration/commands/summarize */ 15162);
var _translate = __webpack_require__( /*! ../../../core/ai_integration/commands/translate */ 37025);
var _executeGridAssistant = __webpack_require__( /*! ./executeGridAssistant */ 714)
},
11121(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ProofreadCommand = void 0;
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
class ProofreadCommand extends _base.BaseCommand {
getTemplateName() {
return "proofread"
}
buildPromptData(params) {
return {
user: {
text: params.text
}
}
}
parseResult(response) {
return response
}
}
exports.ProofreadCommand = ProofreadCommand
},
36050(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ShortenCommand = void 0;
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
class ShortenCommand extends _base.BaseCommand {
getTemplateName() {
return "shorten"
}
buildPromptData(params) {
return {
user: {
text: params.text
}
}
}
parseResult(response) {
return response
}
}
exports.ShortenCommand = ShortenCommand
},
32067(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SmartPasteCommand = void 0;
var _color = _interopRequireDefault(__webpack_require__( /*! ../../../../color */ 43101));
var _ui = _interopRequireDefault(__webpack_require__( /*! ../../../../ui/widget/ui.errors */ 35185));
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
var _date = __webpack_require__( /*! ../../../core/utils/date */ 55594);
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
class SmartPasteCommand extends _base.BaseCommand {
static toTyped(values, desiredType, fieldName) {
const errorValue = JSON.stringify(values);
const single = values.length <= 1 ? values[0] : void 0;
const arr = values.length > 1 ? values : void 0;
if (!single && !arr) {
return
}
switch (desiredType) {
case "color":
if (new _color.default(single).colorIsInvalid) {
throw _ui.default.Error("E1064", fieldName, errorValue, "color")
}
return single;
case "boolean":
if ("true" === single) {
return true
}
if ("false" === single) {
return false
}
throw _ui.default.Error("E1064", fieldName, errorValue, "boolean");
case "string":
if (!single) {
throw _ui.default.Error("E1064", fieldName, errorValue, "string")
}
return single;
case "stringArray":
if (!arr) {
throw _ui.default.Error("E1064", fieldName, errorValue, "string array")
}
return arr;
case "number":
if (void 0 === single || !Number.isFinite(parseFloat(single))) {
throw _ui.default.Error("E1064", fieldName, errorValue, "number")
}
return parseFloat(single);
case "numberRange": {
if (!arr || arr.length > 2) {
throw _ui.default.Error("E1064", fieldName, errorValue, "number range")
}
const numbers = arr.map(v => parseFloat(v));
if (!numbers.every(Number.isFinite)) {
throw _ui.default.Error("E1064", fieldName, errorValue, "number range")
}
return [numbers[0], numbers[1]]
}
case "date":
if (!_date.dateUtilsTs.isValidDate(single)) {
throw _ui.default.Error("E1064", fieldName, errorValue, "date")
}
return new Date(single);
case "dateRange":
if (!arr || arr.length > 2 || !arr.every(_date.dateUtilsTs.isValidDate)) {
throw _ui.default.Error("E1064", fieldName, errorValue, "date range")
}
return arr.map(v => new Date(v));
default:
return arr ?? single
}
}
getTemplateName() {
return "smartPaste"
}
buildPromptData(params) {
const fieldsInstructions = this.generateFieldsInstructions(params.fields);
return {
user: {
text: params.text,
fields: fieldsInstructions
}
}
}
parseResult(response, params) {
const result = [];
response.split(";;;").forEach(data => {
if (!data) {
return
}
const [name, ...rawValues] = data.split(":::");
const values = rawValues.map(value => value.trim());
const fieldParams = params.fields.find(v => v.name === name);
const value = SmartPasteCommand.toTyped(values, null === fieldParams || void 0 === fieldParams ? void 0 : fieldParams.type, null === fieldParams || void 0 === fieldParams ? void 0 : fieldParams.name);
if (value) {
result.push({
name: name,
value: value
})
}
});
return result
}
generateFieldsInstructions(fields) {
const fieldData = fields.map(field => {
const instruction = field.instruction ?? "";
return `fieldName: ${field.name}, format: ${field.format}${instruction?`, instruction: ${instruction}`:""}`
});
return fieldData.join(";;;")
}
}
exports.SmartPasteCommand = SmartPasteCommand
},
15162(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SummarizeCommand = void 0;
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
class SummarizeCommand extends _base.BaseCommand {
getTemplateName() {
return "summarize"
}
buildPromptData(params) {
return {
user: {
text: params.text
}
}
}
parseResult(response) {
return response
}
}
exports.SummarizeCommand = SummarizeCommand
},
37025(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TranslateCommand = void 0;
var _base = __webpack_require__( /*! ../../../core/ai_integration/commands/base */ 55390);
class TranslateCommand extends _base.BaseCommand {
getTemplateName() {
return "translate"
}
getBuildPromptOptions() {
return {
applyMetaTemplates: false
}
}
buildPromptData(params) {
return {
system: {
lang: params.lang
},
user: {
text: params.text
}
}
}
parseResult(response) {
return response
}
}
exports.TranslateCommand = TranslateCommand
},
49691(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CommandNames = exports.COMMANDS = exports.AIIntegration = void 0;
var _index = __webpack_require__( /*! ../../../core/ai_integration/commands/index */ 39171);
var _prompt_manager = __webpack_require__( /*! ../../../core/ai_integration/core/prompt_manager */ 76542);
var _request_manager = __webpack_require__( /*! ../../../core/ai_integration/core/request_manager */ 17083);
var _executeGridAssistant = __webpack_require__( /*! ../commands/executeGridAssistant */ 714);
var _generateGridColumn = __webpack_require__( /*! ../commands/generateGridColumn */ 88890);
var CommandNames;
! function(CommandNames) {
CommandNames.ChangeStyle = "changeStyle";
CommandNames.ChangeTone = "changeTone";
CommandNames.Execute = "execute";
CommandNames.Expand = "expand";
CommandNames.Proofread = "proofread";
CommandNames.Shorten = "shorten";
CommandNames.Summarize = "summarize";
CommandNames.Translate = "translate";
CommandNames.SmartPaste = "smartPaste";
CommandNames.GenerateGridColumn = "generateGridColumn";
CommandNames.ExecuteGridAssistant = "executeGridAssistant"
}(CommandNames || (exports.CommandNames = CommandNames = {}));
const COMMANDS = exports.COMMANDS = {
[CommandNames.ChangeStyle]: _index.ChangeStyleCommand,
[CommandNames.ChangeTone]: _index.ChangeToneCommand,
[CommandNames.Execute]: _index.ExecuteCommand,
[CommandNames.Expand]: _index.ExpandCommand,
[CommandNames.Proofread]: _index.ProofreadCommand,
[CommandNames.Shorten]: _index.ShortenCommand,
[CommandNames.Summarize]: _index.SummarizeCommand,
[CommandNames.Translate]: _index.TranslateCommand,
[CommandNames.SmartPaste]: _index.SmartPasteCommand,
[CommandNames.GenerateGridColumn]: _generateGridColumn.GenerateGridColumnCommand,
[CommandNames.ExecuteGridAssistant]: _executeGridAssistant.ExecuteGridAssistantCommand
};
exports.AIIntegration = class {
constructor(provider, options) {
this.promptManager = new _prompt_manager.PromptManager({
lang: null === options || void 0 === options ? void 0 : options.lang
});
this.requestManager = new _request_manager.RequestManager(provider);
this.commands = new Map
}
executeCommand(commandName, params, callbacks) {
let command = this.commands.get(commandName);
if (!command) {
const Command = COMMANDS[commandName];
command = new Command(this.promptManager, this.requestManager);
this.commands.set(commandName, command)
}
return command.execute(params, callbacks)
}
changeStyle(params, callbacks) {
return this.executeCommand(CommandNames.ChangeStyle, params, callbacks)
}
changeTone(params, callbacks) {
return this.executeCommand(CommandNames.ChangeTone, params, callbacks)
}
execute(params, callbacks) {
return this.executeCommand(CommandNames.Execute, params, callbacks)
}
expand(params, callbacks) {
return this.executeCommand(CommandNames.Expand, params, callbacks)
}
proofread(params, callbacks) {
return this.executeCommand(CommandNames.Proofread, params, callbacks)
}
shorten(params, callbacks) {
return this.executeCommand(CommandNames.Shorten, params, callbacks)
}
summarize(params, callbacks) {
return this.executeCommand(CommandNames.Summarize, params, callbacks)
}
translate(params, callbacks) {
return this.executeCommand(CommandNames.Translate, params, callbacks)
}
smartPaste(params, callbacks) {
return this.executeCommand(CommandNames.SmartPaste, params, callbacks)
}
generateGridColumn(params, callbacks) {
return this.executeCommand(CommandNames.GenerateGridColumn, params, callbacks)
}
executeGridAssistant(params, callbacks) {
return this.executeCommand(CommandNames.ExecuteGridAssistant, params, callbacks)
}
}
},
76542(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PromptManager = exports.LANG_TEMPLATE_NAME = exports.ERROR_MESSAGES = void 0;
var _index = __webpack_require__( /*! ../../../core/ai_integration/templates/index */ 31764);
const ERROR_MESSAGES = exports.ERROR_MESSAGES = {
TEMPLATE_NOT_FOUND: "Template not found"
};
const LANG_TEMPLATE_NAME = exports.LANG_TEMPLATE_NAME = "addLanguage";
exports.PromptManager = class {
constructor(options) {
this.templates = new Map(Object.entries(_index.templates));
this.metaTemplates = new Map(Object.entries(_index.metaTemplates));
this.lang = null === options || void 0 === options ? void 0 : options.lang
}
buildPrompt(templateName, data, options) {
const template = this.templates.get(templateName);
const langTemplate = this.metaTemplates.get(LANG_TEMPLATE_NAME);
if (!template) {
throw new Error(ERROR_MESSAGES.TEMPLATE_NOT_FOUND)
}
const baseSystem = this.generateMessage(template.system, data.system);
const system = options.applyMetaTemplates && this.lang && langTemplate ? this.generateMessage(langTemplate.system, {
message: baseSystem ?? "",
lang: this.lang
}) : baseSystem;
const user = this.generateMessage(template.user, data.user);
const prompt = {
system: system,
user: user
};
return prompt
}
generateMessage(promptTemplate, placeholders) {
if (!placeholders && !promptTemplate) {
return
}
if (!promptTemplate && placeholders) {
return Object.keys(placeholders).reduce((acc, key) => `${acc} ${placeholders[key]}`, "").trim()
}
if (!placeholders && promptTemplate) {
return promptTemplate
}
const result = this.replacePlaceholders(promptTemplate, placeholders);
return result
}
replacePlaceholders(promptTemplate, placeholders) {
const result = Object.entries(placeholders).reduce((acc, _ref) => {
let [key, value] = _ref;
return acc.replaceAll(`{{${key}}}`, value)
}, promptTemplate);
return result
}
}
},
17083(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.RequestManager = void 0;
var _errors = (e = __webpack_require__( /*! ../../../../core/errors */ 87129), e && e.__esModule ? e : {
default: e
});
var e;
exports.RequestManager = class {
constructor(provider) {
this.provider = provider;
this.validateProvider()
}
validateProvider() {
if ("function" !== typeof this.provider.sendRequest) {
throw _errors.default.Error("E0122")
}
}
sendRequest(prompt, callbacks, data) {
let aborted = false;
const params = {
prompt: prompt,
data: data,
onChunk: chunk => {
if (!aborted) {
var _callbacks$onChunk;
null === callbacks || void 0 === callbacks || null === (_callbacks$onChunk = callbacks.onChunk) || void 0 === _callbacks$onChunk || _callbacks$onChunk.call(callbacks, chunk)
}
}
};
const {
promise: promise,
abort: abortRequest
} = this.provider.sendRequest(params);
promise.then(response => {
if (!aborted) {
var _callbacks$onComplete;
null === callbacks || void 0 === callbacks || null === (_callbacks$onComplete = callbacks.onComplete) || void 0 === _callbacks$onComplete || _callbacks$onComplete.call(callbacks, response)
}
}).catch(e => {
if (!aborted) {
var _callbacks$onError;
null === callbacks || void 0 === callbacks || null === (_callbacks$onError = callbacks.onError) || void 0 === _callbacks$onError || _callbacks$onError.call(callbacks, e)
}
});
return () => {
aborted = true;
null === abortRequest || void 0 === abortRequest || abortRequest()
}
}
}
},
31764(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.templates = exports.metaTemplates = void 0;
exports.metaTemplates = {
addLanguage: {
system: "{{message}} Provide an answer in {{lang}} language."
}
};
exports.templates = {
changeStyle: {
system: "Rewrite the text provided to match the {{writingStyle}} writing style. Ensure the rewritten text follows the grammatical rules and stylistic conventions of the specified style. Preserve the original meaning and context. Use complete sentences and a professional tone. Return answer with no markdown formatting."
},
changeTone: {
system: "Rewrite the following text to keep its original meaning but change its tone to {{tone}}. Provide only the rewritten text as plain text without any comments or formatting."
},
execute: {
system: "Return answer with no markdown formatting."
},
expand: {
system: "Expand the following text by adding relevant details, examples, and context while keeping the main point intact. Ensure the expanded text is coherent and logically structured. Return answer with no markdown formatting."
},
proofread: {
system: "Proofread the following text for grammar, punctuation, and style errors. Make corrections to ensure clarity and conciseness while preserving the original meaning. Use a formal writing style unless otherwise specified. Return only the revised text without any formatting or explanations."
},
shorten: {
system: "Please shorten the text provided by summarizing its content while retaining the main point and essential details. Aim to reduce the text to approximately 50% of its original length. Ensure that the key message remains clear and intact. Return answer with no markdown formatting."
},
summarize: {
system: "First, identify the key points of the provided text. Then, generate an abstractive summary by paraphrasing these points, ensuring the summary captures the core ideas and is approximately 20% of the text's length. Return answer with no markdown formatting."
},
translate: {
system: "Translate the text provided into {{lang}}. Ensure the translation retains the original meaning and tone. Provide only the translated text in your response, without any additional formatting or commentary."
},
smartPaste: {
system: "You are a helpful assistant that helps to fill fields based on the text provided. You will get a text and a list of fields that should be filled using info from the text. It can include the name of field, suitable format, optionally some additional instruction about what it should include. You need to return data for all the fields in the following format without any preamble, introduction, or explanatory text: {fieldName}:::{fieldValue};;;{fieldName}:::{fieldValue} and so on, where {fieldName} - is a variable for a field name and {fieldValue} - is a variable for a string to fill. If there is no info to fill, field value should be empty (like Name:::;;;)- do not use placeholders like (empty), N/A, null, or similar. Only fill in date fields if a complete date is explicitly present. If the date is missing or incomplete, leave the field empty.",
user: "Text: {{text}}. Fields: {{fields}}."
},
generateGridColumn: {
system: 'You are a helpful AI assistant that generates values for a new column in a dataset, based on a given user instruction and existing row data. Input: A user prompt that describes what should be generated. A dataset in the format: { "rowKey1": {column1: value1, column2: value2, ...}, "rowKey2": {...}, ... }. Task: Generate a single value for each row that satisfies the user\'s prompt, using the provided row data as context. Instructions: Output your result strictly in this format: { "rowKey1": "generatedValue1", "rowKey2": "generatedValue2", ... }. The output must be a valid JSON string, directly parsable by JSON.parse. Do not include any explanation, markdown, or formatting \u2014 only the raw JSON object. If a value cannot be generated for a specific row, assign an empty string ("") for that row. Example Output: { "rowKey1": "valueA", "rowKey2": "" }. You must follow this output format exactly. Any deviation will result in a parsing error.',
user: "User prompt text: {{text}}. Dataset: {{data}}."
},
executeGridAssistant: {
system: 'You are a helpful AI assistant for a data grid component. The user sends a natural language request describing an operation on the grid (e.g., sorting, filtering, grouping). You receive the user\'s message, a context object describing the current grid state, and a JSON schema describing the available commands and their arguments. Your task is to interpret the user\'s request and return a JSON object with one field: "actions" \u2014 an array of command objects, each with "name" (the command name) and "args" (an object of arguments matching the schema). Output must be a valid JSON string, directly parsable by JSON.parse. Do not include any markdown, formatting, or extra text \u2014 only the raw JSON object.\n\nCRITICAL RULE FOR OPTIONAL ARGUMENTS: If an optional argument is not used, the field MUST be ENTIRELY ABSENT from the JSON object \u2014 the key must not appear at all. NEVER emit an optional field with value null, empty string "", empty array [], or any placeholder. This rule overrides any instinct to "complete" the object \u2014 omitted IS the value.\n\nCRITICAL RULE FOR UNRECOGNIZED REQUESTS: If the user\'s request text is unclear, meaningless, or not related to any grid operation, you MUST return {"actions": []}. Do NOT guess, infer, or invent actions. Numbers, random characters, greetings, or off-topic text are NOT grid commands. Only produce actions when the request explicitly and clearly maps to one or more supported grid commands.\n\nExamples of meaningless user requests that MUST return {"actions": []}:\n- "User request: 1." \u2192 {"actions": []}\n- "User request: 123." \u2192 {"actions": []}\n- "User request: hello." \u2192 {"actions": []}',
user: "User request: {{text}}. Grid context: {{context}}."
}
}
},
5583(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _error = (e = __webpack_require__( /*! ../../core/utils/error */ 67264), e && e.__esModule ? e : {
default: e
});
var e;
exports.default = (0, _error.default)({
E0001: "Method is not implemented",
E0002: "Member name collision: {0}",
E0003: "A class must be instantiated using the 'new' keyword",
E0004: "The NAME property of the component is not specified",
E0005: "Unknown device",
E0006: "Unknown endpoint key is requested",
E0007: "'Invalidate' method is called outside the update transaction",
E0008: "Type of the option name is not appropriate to create an action",
E0009: "Component '{0}' has not been initialized for an element",
E0010: "Animation configuration with the '{0}' type requires '{1}' configuration as {2}",
E0011: "Unknown animation type '{0}'",
E0012: "jQuery version is too old. Please upgrade jQuery to 1.10.0 or later",
E0013: "KnockoutJS version is too old. Please upgrade KnockoutJS to 2.3.0 or later",
E0014: "The 'release' method shouldn't be called for an unlocked Lock object",
E0015: "Queued task returned an unexpected result",
E0017: "Event namespace is not defined",
E0018: "DevExpress.ui.DevExpressPopup widget is required",
E0020: "Template engine '{0}' is not supported",
E0021: "Unknown theme is set: {0}",
E0022: "LINK[rel=DevExpress-theme] tags must go before DevExpress included scripts",
E0023: "Template name is not specified",
E0024: "DevExtreme bundle already included",
E0025: "Unexpected argument type",
E0100: "Unknown validation type is detected",
E0101: "Misconfigured range validation rule is detected",
E0102: "Misconfigured comparison validation rule is detected",
E0103: "validationCallback of an asynchronous rule should return a jQuery or a native promise",
E0110: "Unknown validation group is detected",
E0120: "Adapter for a DevExpressValidator component cannot be configured",
E0121: "The 'customItem' parameter of the 'onCustomItemCreating' function is empty or contains invalid data. Assign a custom object or a Promise that is resolved after the item is created.",
E0122: "AIIntegration: The sendRequest method is missing.",
W0000: "'{0}' is deprecated in {1}. {2}",
W0001: "{0} - '{1}' option is deprecated in {2}. {3}",
W0002: "{0} - '{1}' method is deprecated in {2}. {3}",
W0003: "{0} - '{1}' property is deprecated in {2}. {3}",
W0004: "Timeout for theme loading is over: {0}",
W0005: "'{0}' event is deprecated in {1}. {2}",
W0006: "Invalid recurrence rule: '{0}'",
W0007: "'{0}' Globalize culture is not defined",
W0008: "Invalid view type: {0}",
W0009: "Invalid time zone name: '{0}'",
W0010: "{0} is deprecated in {1}. {2}",
W0011: "Number parsing is invoked while the parser is not defined",
W0012: "Date parsing is invoked while the parser is not defined",
W0013: "'{0}' file is deprecated in {1}. {2}",
W0014: "{0} - '{1}' type is deprecated in {2}. {3}",
W0015: "Instead of returning a value from the '{0}' function, write it into the '{1}' field of the function's parameter.",
W0016: 'The "{0}" option does not accept the "{1}" value since v{2}. {3}.',
W0017: 'Setting the "{0}" property with a function is deprecated since v21.2',
W0018: 'Setting the "position" property with a function is deprecated since v21.2',
W0019: "DevExtreme: Unable to Locate a Valid License Key.\n\nDetailed license/registration related information and instructions: https://js.devexpress.com/Documentation/Licensing/.\n\nIf you are using a 30-day trial version of DevExtreme, you must uninstall all copies of DevExtreme once your 30-day trial period expires. For terms and conditions that govern use of DevExtreme UI components/libraries, please refer to the DevExtreme End User License Agreement: https://js.devexpress.com/EULAs/DevExtremeComplete.\n\nTo use DevExtreme in a commercial project, you must purchase a license. For pricing/licensing options, please visit: https://js.devexpress.com/Buy.\n\nIf you have licensing-related questions or need help with a purchase, please email clientservices@devexpress.com.\n\n",
W0020: "DevExtreme: License Key Has Expired.\n\nDetailed license/registration related information and instructions: https://js.devexpress.com/Documentation/Licensing/.\n\nA mismatch exists between the license key used and the DevExtreme version referenced in this project.\n\nTo proceed, you can:\n\u2022 use a version of DevExtreme linked to your license key: https://www.devexpress.com/ClientCenter/DownloadManager\n\u2022 renew your DevExpress Subscription: https://www.devexpress.com/buy/renew (once you renew your subscription, you will be entitled to product updates and support service as defined in the DevExtreme End User License Agreement)\n\nIf you have licensing-related questions or need help with a renewal, please email clientservices@devexpress.com.\n\n",
W0021: "DevExtreme: License Key Verification Has Failed.\n\nDetailed license/registration related information and instructions: https://js.devexpress.com/Documentation/Licensing/.\n\nTo verify your DevExtreme license, make certain to specify a correct key in the GlobalConfig. If you continue to encounter this error, please visit https://www.devexpress.com/ClientCenter/DownloadManager to obtain a valid license key.\n\nIf you have a valid license and this problem persists, please submit a support ticket via the DevExpress Support Center. We will be happy to follow-up: https://supportcenter.devexpress.com/ticket/create.\n\n",
W0023: "DevExtreme: the following 'devextreme' package version does not match versions of other DevExpress products used in this application:\n\n{0}\n\nInteroperability between different versions of the products listed herein cannot be guaranteed.\n\n"
})
},
55594(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.dateUtilsTs = void 0;
exports.dateUtilsTs = {
addOffsets: function(date) {
for (var _len = arguments.length, offsets = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
offsets[_key - 1] = arguments[_key]
}
const newDateMs = offsets.reduce((result, offset) => result + offset, date.getTime());
return new Date(newDateMs)
},
isValidDate: date => Boolean(date && !isNaN(new Date(date).valueOf()))
}
},
35005(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.logger = exports.default = exports.debug = void 0;
var _type = __webpack_require__( /*! ../../../core/utils/type */ 11528);
const noop = function() {};
const getConsoleMethod = function(method) {
if ("undefined" === typeof console || !(0, _type.isFunction)(console[method])) {
return noop
}
return console[method].bind(console)
};
const logger = exports.logger = {
log: getConsoleMethod("log"),
info: getConsoleMethod("info"),
warn: getConsoleMethod("warn"),
error: getConsoleMethod("error")
};
const debug = exports.debug = function() {
function assert(condition, message) {
if (!condition) {
throw new Error(message)
}
}
return {
assert: assert,
assertParam: function(parameter, message) {
assert(null !== parameter && void 0 !== parameter, message)
}
}
}();
exports.default = {
logger: logger,
debug: debug
}
},
40818(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;