@progress/kendo-react-conversational-ui 17.0.0-develop.3 → 17.0.0-develop.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";const i=require("./utils.js");function l(f,p){const e=p.jscodeshift,s=e(f.source),m=i.findImportedName(e,s,"Chat","@progress/kendo-react-conversational-ui")||"Chat",c=new Set;s.find(e.Identifier).forEach(t=>c.add(t.node.name));const b=t=>e.JSXIdentifier.check(t.name)&&t.name.name===m,h=(t,o)=>{const r=e(t).closest(e.Statement);if(r.size()>0){r.insertBefore(o);return}s.get().node.program.body.unshift(o)};return s.find(e.JSXOpeningElement).forEach(t=>{const o=t.node;if(!b(o))return;const r=o.attributes||[],a=i.findAttribute(r,"user");if(!a)return;if(i.doesAttributeExist(r,"authorId")){i.removeAttribute(r,"user");return}if(a.type!=="JSXAttribute"||!a.value||a.value.type!=="JSXExpressionContainer")return;const n=a.value.expression,d=u=>{r.push(e.jsxAttribute(e.jsxIdentifier("authorId"),e.jsxExpressionContainer(e.memberExpression(u,e.identifier("id")))))};if(n.type==="ObjectExpression"){const u=i.generateUniqueName("kendoUserDataObject",c);c.add(u);const x=e.variableDeclaration("const",[e.variableDeclarator(e.identifier(u),n)]);h(t,x),d(e.identifier(u)),i.removeAttribute(r,"user");return}(n.type==="Identifier"||n.type==="MemberExpression"||n.type==="CallExpression"||n.type==="ThisExpression")&&(d(n),i.removeAttribute(r,"user"))}),s.toSource()}module.exports=l;
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yLWlkLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb252ZXJzYXRpb25hbC11aS9jb2RlbW9kcy92MTIvYXV0aG9yLWlkLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQVBJLCBGaWxlSW5mbywg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SSxFQUNoRUEsRUFBSyxJQUFJaUIsQ0FBUyxFQUVsQixNQUFNRSxFQUFVdkIsRUFBRSxvQkFBb0IsUUFBUyxDQUM3Q0EsRUFBRSxtQkFBbUJBLEVBQUUsV0FBV3FCLENBQVMsRUFBR0gsQ0FBSSxDQUFBLENBQ25ELEVBRURWLEVBQWdCSSxFQUFNVyxDQUFPLEVBRTdCSixFQUFnQm5CLEVBQUUsV0FBV3FCLENBQVMsQ0FBQyxFQUN2Q0osRUFBQUEsZ0JBQWdCSixFQUFnQixNQUFNLEVBQ3RDLE1BQ0YsRUFHRUssRUFBSyxPQUFTLGNBQ2RBLEVBQUssT0FBUyxvQkFDZEEsRUFBSyxPQUFTLGtCQUNkQSxFQUFLLE9BQVMsb0JBRWRDLEVBQWdCRCxDQUFJLEVBQ3BCRCxFQUFBQSxnQkFBZ0JKLEVBQWdCLE1BQU0sRUFFMUMsQ0FBQyxFQUVNWixFQUFLLFNBQUEsQ0FDZCJ9
1
+ "use strict";const l=require("@progress/kendo-react-common/codemods"),s=require("./utils.js");function E(c,p){if(l.isStylesheetFile(c.path))return c.source;const e=p.jscodeshift,i=e(c.source),m=s.findImportedName(e,i,"Chat","@progress/kendo-react-conversational-ui")||"Chat",d=new Set;i.find(e.Identifier).forEach(t=>d.add(t.node.name));const h=t=>e.JSXIdentifier.check(t.name)&&t.name.name===m,b=(t,o)=>{const r=e(t).closest(e.Statement);if(r.size()>0){r.insertBefore(o);return}i.get().node.program.body.unshift(o)};return i.find(e.JSXOpeningElement).forEach(t=>{const o=t.node;if(!h(o))return;const r=o.attributes||[],a=s.findAttribute(r,"user");if(!a)return;if(s.doesAttributeExist(r,"authorId")){s.removeAttribute(r,"user");return}if(a.type!=="JSXAttribute"||!a.value||a.value.type!=="JSXExpressionContainer")return;const n=a.value.expression,f=u=>{r.push(e.jsxAttribute(e.jsxIdentifier("authorId"),e.jsxExpressionContainer(e.memberExpression(u,e.identifier("id")))))};if(n.type==="ObjectExpression"){const u=s.generateUniqueName("kendoUserDataObject",d);d.add(u);const x=e.variableDeclaration("const",[e.variableDeclarator(e.identifier(u),n)]);b(t,x),f(e.identifier(u)),s.removeAttribute(r,"user");return}(n.type==="Identifier"||n.type==="MemberExpression"||n.type==="CallExpression"||n.type==="ThisExpression")&&(f(n),s.removeAttribute(r,"user"))}),i.toSource()}module.exports=E;
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yLWlkLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb252ZXJzYXRpb25hbC11aS9jb2RlbW9kcy92MTIvYXV0aG9yLWlkLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQVBJLCBGaWxlSW5mbywgSlNDb2Rlc2hpZnQgfSBmcm9tICdqc2NvZGVzaGlmdCc7XG5pbXBvcnQgeyBpc1N0eWxlc2hlZXRGaWxlIH0gZnJvbSAnQHByb2dyZXNzL2tlbmRvLXJlYWN0LWNvbW1vbi9jb2RlbW9kcyc7XG5pbXBvcnQgeyBmaW5kSW1wb3J0ZWROYW1lLCBnZW5lcmF0ZVVuaXF1ZU5hbWUsIGZpbmRBdHRyaWJ1dGUsIGRvZXNBdHRyaWJ1dGVFeGlzdCwgcmVtb3ZlQXR0cmlidXRlIH0gZnJvbSAnLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHRyYW5zZm9ybWVyKGZpbGU6IEZpbGVJbmZvLCBhcGk6IEFQSSkge1xuICAgIGlmIChpc1N0eWxlc2hlZXRGaWxlKGZpbGUucGF0aCkpIHtcbiAgICAgICAgcmV0dXJuIGZpbGUuc291cmNlO1xuICAgIH1cbiAgICBjb25zdCBqOiBKU0NvZGVzaGlmdCA9IGFwaS5qc2NvZGVzaGlmdDtcbiAgICBjb25zdCByb290ID0gaihmaWxlLnNvdXJjZSk7XG5cbiAgICBjb25zdCBjaGF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V0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgYXR0cnMgPSBub2RlLmF0dHJpYnV0ZXMgfHwgW107XG5cbiAgICAgICAgY29uc3QgdXNlckF0dHIgPSBmaW5kQXR0cmlidXRlKGF0dHJzIGFzIGFueVtdLCAndXNlcicpO1xuICAgICAgICBpZiAoIXVzZXJBdHRyKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZG9lc0F0dHJpYnV0ZUV4aXN0KGF0dHJzIGFzIGFueVtdLCAnYXV0aG9ySWQnKSkge1xuICAgICAgICAgICAgcmVtb3ZlQXR0cmlidXRlKGF0dHJzIGFzIGFueVtdLCAndXNlcicpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHVzZXJBdHRyLnR5cGUgIT09ICdKU1hBdHRyaWJ1dGUnKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCF1c2VyQXR0ci52YWx1ZSB8fCB1c2VyQXR0ci52YWx1ZS50eXBlICE9PSAnSlNYRXhwcmVzc2lvbkNvbnRhaW5lcicpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IGV4cHIgPSB1c2VyQXR0ci52YWx1ZS5leHByZXNzaW9uO1xuXG4gICAgICAgIGNvbnN0IGFkZEF1dGhvcklkQXR0ciA9IChiYXNlRXhwcmVzc2lvbjogYW55KSA9PiB7XG4gICAgICAgICAgICBhdHRycy5wdXNoKFxuICAgICAgICAgICAgICAgIGouanN4QXR0cmlidXRlKFxuICAgICAgICAgICAgICAgICAgICBqLmpzeElkZW50aWZpZXIoJ2F1dGhvcklkJyksXG4gICAgICAgICAgICAgICAgICAgIGouanN4RXhwcmVzc2lvbkNvbnRhaW5lcihqLm1lbWJlckV4cHJlc3Npb24oYmFzZUV4cHJlc3Npb24sIGouaWRlbnRpZmllcignaWQnKSkpXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAoZXhwci50eXBlID09PSAnT2JqZWN0RXhwcmVzc2lvbicpIHtcbiAgICAgICAgICAgIC8vIExpZnQgaW5saW5lIG9iamVjdCB0byBjb25zdCBiZWZvcmUgdGhlIGVsZW1lbnQncyBzdGF0ZW1lbnRcbiAgICAgICAgICAgIGNvbnN0IHVuaXF1ZVZhciA9IGdlbmVyYXRlVW5pcXVlTmFtZSgna2VuZG9Vc2VyRGF0YU9iamVjdCcsIHVzZWQpO1xuICAgICAgICAgICAgdXNlZC5hZGQodW5pcXVlVmFyKTtcblxuICAgICAgICAgICAgY29uc3QgdmFyRGVjbCA9IGoudmFyaWFibGVEZWNsYXJhdGlvbignY29uc3QnLCBbai52YXJpYWJsZURlY2xhcmF0b3Ioai5pZGVudGlmaWVyKHVuaXF1ZVZhciksIGV4cHIpXSk7XG5cbiAgICAgICAgICAgIGluc2VydFZhckJlZm9yZShwYXRoLCB2YXJEZWNsKTtcblxuICAgICAgICAgICAgYWRkQXV0aG9ySWRBdHRyKGouaWRlbnRpZmllcih1bmlxdWVWYXIpKTtcbiAgICAgICAgICAgIHJlbW92ZUF0dHJpYnV0ZShhdHRycyBhcyBhbnlbXSwgJ3VzZXInKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIGV4cHIudHlwZSA9PT0gJ0lkZW50aWZpZXInIHx8XG4gICAgICAgICAgICBleHByLnR5cGUgPT09ICdNZW1iZXJFeHByZXNzaW9uJyB8fFxuICAgICAgICAgICAgZXhwci50eXBlID09PSAnQ2FsbEV4cHJlc3Npb24nIHx8XG4gICAgICAgICAgICBleHByLnR5cGUgPT09ICdUaGlzRXhwcmVzc2lvbidcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBhZGRBdXRob3JJZEF0dHIoZXhwcik7XG4gICAgICAg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FBbUIsc0JBQXVCbEIsQ0FBSSxFQUNoRUEsRUFBSyxJQUFJaUIsQ0FBUyxFQUVsQixNQUFNRSxFQUFVdkIsRUFBRSxvQkFBb0IsUUFBUyxDQUFDQSxFQUFFLG1CQUFtQkEsRUFBRSxXQUFXcUIsQ0FBUyxFQUFHSCxDQUFJLENBQUMsQ0FBQyxFQUVwR1YsRUFBZ0JJLEVBQU1XLENBQU8sRUFFN0JKLEVBQWdCbkIsRUFBRSxXQUFXcUIsQ0FBUyxDQUFDLEVBQ3ZDSixFQUFBQSxnQkFBZ0JKLEVBQWdCLE1BQU0sRUFDdEMsTUFDSixFQUdJSyxFQUFLLE9BQVMsY0FDZEEsRUFBSyxPQUFTLG9CQUNkQSxFQUFLLE9BQVMsa0JBQ2RBLEVBQUssT0FBUyxvQkFFZEMsRUFBZ0JELENBQUksRUFDcEJELEVBQUFBLGdCQUFnQkosRUFBZ0IsTUFBTSxFQUU5QyxDQUFDLEVBRU1aLEVBQUssU0FBQSxDQUNoQiJ9
@@ -1,2 +1,2 @@
1
- "use strict";const a=require("./utils.js");function m(p,d){const e=d.jscodeshift,t=e(p.source),s="@progress/kendo-react-conversational-ui",c=a.findImportedName(e,t,"ChatMessageSendEvent",s);if(!c)return t.toSource();const f=(o=>a.ensureTypeImport(e,t,o,s))("ChatSendMessageEvent");return t.find(e.TSTypeReference,{typeName:{type:"Identifier",name:c}}).forEach(o=>{o.node.typeName.name=f}),t.find(e.ImportDeclaration,{source:{value:s}}).forEach(o=>{const n=o.node.specifiers||[];for(let r=n.length-1;r>=0;r--){const i=n[r];i.type==="ImportSpecifier"&&i.imported?.name==="ChatMessageSendEvent"&&n.splice(r,1)}n.length===0&&e(o).remove()}),t.toSource()}module.exports=m;
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhdC1zZW5kLW1lc3NhZ2UuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2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sR0FDbkJWLEVBQUVTLENBQU8sRUFBRSxPQUFBLENBRWYsQ0FBQyxFQUVNUixFQUFLLFNBQUEsQ0FDZCJ9
1
+ "use strict";const f=require("@progress/kendo-react-common/codemods"),p=require("./utils.js");function m(s,d){if(f.isStylesheetFile(s.path))return s.source;const e=d.jscodeshift,t=e(s.source),c="@progress/kendo-react-conversational-ui",i=p.findImportedName(e,t,"ChatMessageSendEvent",c);if(!i)return t.toSource();const u=(o=>p.ensureTypeImport(e,t,o,c))("ChatSendMessageEvent");return t.find(e.TSTypeReference,{typeName:{type:"Identifier",name:i}}).forEach(o=>{o.node.typeName.name=u}),t.find(e.ImportDeclaration,{source:{value:c}}).forEach(o=>{const n=o.node.specifiers||[];for(let r=n.length-1;r>=0;r--){const a=n[r];a.type==="ImportSpecifier"&&a.imported?.name==="ChatMessageSendEvent"&&n.splice(r,1)}n.length===0&&e(o).remove()}),t.toSource()}module.exports=m;
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhdC1zZW5kLW1lc3NhZ2UuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbnZlcnNhdGlvbmFsLXVpL2NvZGVtb2RzL3YxMi9jaGF0LXNlbmQtbWVzc2FnZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBUEksIEZpbGVJbmZvLCBKU0NvZGVzaGlmdCB9IGZyb20gJ2pzY29kZXNoaWZ0JztcbmltcG9ydCB7IGlzU3R5bGVzaGVldEZpbGUgfSBmcm9tICdAcHJvZ3Jlc3Mva2VuZG8tcmVhY3QtY29tbW9uL2NvZGVtb2RzJztcbmltcG9ydCB7IGVuc3VyZVR5cGVJbXBvcnQsIGZpbmRJbXBvcnRlZE5hbWUgfSBmcm9tICcuL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gdHJhbnNmb3JtZXIoZmlsZTog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BQVcsR0FDakJWLEVBQUVTLENBQU8sRUFBRSxPQUFBLENBRW5CLENBQUMsRUFFTVIsRUFBSyxTQUFBLENBQ2hCIn0=
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("./utils.js");function u(a,o){const t=o.jscodeshift,s=t(a.source),i=e.findImportedName(t,s,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return s.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:i}}).forEach(m=>{const r=m.node.attributes||[],c=e.doesAttributeExist(r,"messageTemplate"),n=e.findAttribute(r,"message");if(n){if(c){e.removeAttribute(r,"message");return}n.name.name="messageTemplate"}}),s.toSource()}module.exports=u;
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZS10ZW1wbGF0ZS5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29udmVyc2F0aW9uYWwtdWkvY29kZW1vZHMvdjEyL21lc3NhZ2UtdGVtcGxhdGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQVBJLCBGaWxlSW5mbywgSlNDb2Rlc2hpZnQgfSBmcm9tICdqc2NvZGVzaGlmdCc7XG5pbXBvcnQgeyBmaW5kSW1wb3J0ZWROYW1lLCBmaW5kQXR0cmlidXRlLCBkb2VzQXR0cmlidXRlRXhpc3QsIHJlbW92ZUF0dHJpYnV0ZSB9IGZyb20gJy4vdXRpbHMnO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiB0cmFuc2Zvcm1lcihmaWxlOiBGaWxlSW5mbywgYXBpOiBBUEkpIHtcbiAgY29uc3QgajogSlNDb2Rlc2hpZnQgPSBhcGkuanNjb2Rlc2hpZnQ7XG4gIGNvbnN0IHJvb3QgPSBqKGZpbGUuc291cmNlKTtcblxuICBjb25zdCBjaGF0TmFtZSA9XG4gICAgZmluZEltcG9ydGVkTmFtZShqLCByb290LCAnQ2hhdC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dGUiXSwibWFwcGluZ3MiOiIyQ0FHQSxTQUF3QkEsRUFBWUMsRUFBZ0JDLEVBQVUsQ0FDNUQsTUFBTUMsRUFBaUJELEVBQUksWUFDckJFLEVBQU9ELEVBQUVGLEVBQUssTUFBTSxFQUVwQkksRUFDSkMsRUFBQUEsaUJBQWlCSCxFQUFHQyxFQUFNLE9BQVEseUNBQXlDLEdBQUssT0FFbEYsT0FBQUEsRUFBSyxLQUFLRCxFQUFFLGtCQUFtQixDQUM3QixLQUFNLENBQUUsS0FBTSxnQkFBaUIsS0FBTUUsQ0FBQSxDQUFTLENBQy9DLEVBQUUsUUFBU0UsR0FBUyxDQUNuQixNQUFNQyxFQUFRRCxFQUFLLEtBQUssWUFBYyxDQUFBLEVBRWhDRSxFQUFxQkMsRUFBQUEsbUJBQW1CRixFQUFnQixpQkFBaUIsRUFDekVHLEVBQWNDLEVBQUFBLGNBQWNKLEVBQWdCLFNBQVMsRUFFM0QsR0FBS0csRUFFTCxJQUFJRixFQUFvQixDQUN0QkksRUFBQUEsZ0JBQWdCTCxFQUFnQixTQUFTLEVBQ3pDLE1BQ0YsQ0FFQ0csRUFBWSxLQUFhLEtBQU8sa0JBQ25DLENBQUMsRUFFTVAsRUFBSyxTQUFBLENBQ2QifQ==
1
+ "use strict";const u=require("@progress/kendo-react-common/codemods"),e=require("./utils.js");function d(t,a){if(u.isStylesheetFile(t.path))return t.source;const s=a.jscodeshift,r=s(t.source),i=e.findImportedName(s,r,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return r.find(s.JSXOpeningElement,{name:{type:"JSXIdentifier",name:i}}).forEach(c=>{const n=c.node.attributes||[],m=e.doesAttributeExist(n,"messageTemplate"),o=e.findAttribute(n,"message");if(o){if(m){e.removeAttribute(n,"message");return}o.name.name="messageTemplate"}}),r.toSource()}module.exports=d;
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZS10ZW1wbGF0ZS5q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BRWhCLE1BQU1HLEVBQWlCRixFQUFJLFlBQ3JCRyxFQUFPRCxFQUFFSCxFQUFLLE1BQU0sRUFFcEJLLEVBQVdDLEVBQUFBLGlCQUFpQkgsRUFBR0MsRUFBTSxPQUFRLHlDQUF5QyxHQUFLLE9BRWpHLE9BQUFBLEVBQUssS0FBS0QsRUFBRSxrQkFBbUIsQ0FDM0IsS0FBTSxDQUFFLEtBQU0sZ0JBQWlCLEtBQU1FLENBQUEsQ0FBUyxDQUNqRCxFQUFFLFFBQVNFLEdBQVMsQ0FDakIsTUFBTUMsRUFBUUQsRUFBSyxLQUFLLFlBQWMsQ0FBQSxFQUVoQ0UsRUFBcUJDLEVBQUFBLG1CQUFtQkYsRUFBZ0IsaUJBQWlCLEVBQ3pFRyxFQUFjQyxFQUFBQSxjQUFjSixFQUFnQixTQUFTLEVBRTNELEdBQUtHLEVBSUwsSUFBSUYsRUFBb0IsQ0FDcEJJLEVBQUFBLGdCQUFnQkwsRUFBZ0IsU0FBUyxFQUN6QyxNQUNKLENBRUNHLEVBQVksS0FBYSxLQUFPLGtCQUNyQyxDQUFDLEVBRU1QLEVBQUssU0FBQSxDQUNoQiJ9
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("./utils.js");function u(r,a){const t=a.jscodeshift,n=t(r.source),i=e.findImportedName(t,n,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return n.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:i}}).forEach(c=>{const s=c.node.attributes||[],d=e.doesAttributeExist(s,"onSendMessage"),o=e.findAttribute(s,"onMessageSend");if(o){if(d){e.removeAttribute(s,"onMessageSend");return}o.name.name="onSendMessage"}}),n.toSource()}module.exports=u;
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZC1tZXNzYWdlLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb252ZXJzYXRpb25hbC11aS9jb2R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UFTRSxHQUFTLENBQ25CLE1BQU1DLEVBQVFELEVBQUssS0FBSyxZQUFjLENBQUEsRUFFaENFLEVBQW1CQyxFQUFBQSxtQkFBbUJGLEVBQWdCLGVBQWUsRUFDckVHLEVBQW9CQyxFQUFBQSxjQUFjSixFQUFnQixlQUFlLEVBRXZFLEdBQUtHLEVBRUwsSUFBSUYsRUFBa0IsQ0FFcEJJLEVBQUFBLGdCQUFnQkwsRUFBZ0IsZUFBZSxFQUMvQyxNQUNGLENBR0NHLEVBQWtCLEtBQWEsS0FBTyxnQkFDekMsQ0FBQyxFQUVNUCxFQUFLLFNBQUEsQ0FDZCJ9
1
+ "use strict";const u=require("@progress/kendo-react-common/codemods"),e=require("./utils.js");function m(t,a){if(u.isStylesheetFile(t.path))return t.source;const n=a.jscodeshift,s=n(t.source),i=e.findImportedName(n,s,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return s.find(n.JSXOpeningElement,{name:{type:"JSXIdentifier",name:i}}).forEach(c=>{const r=c.node.attributes||[],d=e.doesAttributeExist(r,"onSendMessage"),o=e.findAttribute(r,"onMessageSend");if(o){if(d){e.removeAttribute(r,"onMessageSend");return}o.name.name="onSendMessage"}}),s.toSource()}module.exports=m;
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZC1tZXNzYWdlLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb252ZXJzYXRpb25hbC11aS9jb2RlbW9kcy92MTIvc2VuZC1tZXNzYWdlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEFQSSwgRmlsZUluZm8sIEpTQ29kZXNoaWZ0IH0gZnJvbSAnanNjb2Rlc2hpZnQnO1xuaW1wb3J0IHsgaXNTdHlsZXNoZWV0RmlsZSB9IGZyb20gJ0Bwcm9ncmVzcy9rZW5kby1yZWFjdC1jb21tb24vY29kZW1vZHMnO1xuaW1wb3J0IHsg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WpHLE9BQUFBLEVBQUssS0FBS0QsRUFBRSxrQkFBbUIsQ0FDM0IsS0FBTSxDQUFFLEtBQU0sZ0JBQWlCLEtBQU1FLENBQUEsQ0FBUyxDQUNqRCxFQUFFLFFBQVNFLEdBQVMsQ0FDakIsTUFBTUMsRUFBUUQsRUFBSyxLQUFLLFlBQWMsQ0FBQSxFQUVoQ0UsRUFBbUJDLEVBQUFBLG1CQUFtQkYsRUFBZ0IsZUFBZSxFQUNyRUcsRUFBb0JDLEVBQUFBLGNBQWNKLEVBQWdCLGVBQWUsRUFFdkUsR0FBS0csRUFJTCxJQUFJRixFQUFrQixDQUVsQkksRUFBQUEsZ0JBQWdCTCxFQUFnQixlQUFlLEVBQy9DLE1BQ0osQ0FHQ0csRUFBa0IsS0FBYSxLQUFPLGdCQUMzQyxDQUFDLEVBRU1QLEVBQUssU0FBQSxDQUNoQiJ9
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("./utils.js");function i(r,n){const t=n.jscodeshift,e=t(r.source),s=o.findImportedName(t,e,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return e.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:s}}).forEach(a=>{const c=a.node.attributes||[];o.removeAttribute(c,"showToolbar")}),e.toSource()}module.exports=i;
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hvdy10b29sYmFyLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb252ZXJzYXRpb25hbC11aS9jb2RlbW9kcy92MTIvc2hvdy10b29sYmFyLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEFQSSwgRmlsZUluZm8sIEpTQ29kZXNoaWZ0IH0gZnJvbSAnanNjb2Rlc2hpZnQnO1xuaW1wb3J0IHsgZmluZEltcG9ydGVkTmFtZSwgcmVtb3ZlQXR0cmlidXRlIH0gZnJvbSAnLi91dGlscyc7XG5cbmV4c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FtQixDQUM3QixLQUFNLENBQUUsS0FBTSxnQkFBaUIsS0FBTUUsQ0FBQSxDQUFTLENBQy9DLEVBQUUsUUFBU0UsR0FBUyxDQUNuQixNQUFNQyxFQUFRRCxFQUFLLEtBQUssWUFBYyxDQUFBLEVBQ3RDRSxFQUFBQSxnQkFBZ0JELEVBQWdCLGFBQWEsQ0FDL0MsQ0FBQyxFQUVNSixFQUFLLFNBQUEsQ0FDZCJ9
1
+ "use strict";const i=require("@progress/kendo-react-common/codemods"),r=require("./utils.js");function u(t,s){if(i.isStylesheetFile(t.path))return t.source;const e=s.jscodeshift,o=e(t.source),n=r.findImportedName(e,o,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return o.find(e.JSXOpeningElement,{name:{type:"JSXIdentifier",name:n}}).forEach(c=>{const a=c.node.attributes||[];r.removeAttribute(a,"showToolbar")}),o.toSource()}module.exports=u;
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hvdy10b29sYmFyLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb252ZXJzYXRpb25hbC11aS9jb2RlbW9kcy92MTIvc2hvdy10b29sYmFyLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEFQSSwgRmlsZUluZm8sIEpTQ29kZXNoaWZ0IH0gZnJvbSAnanNjb2Rlc2hpZnQnO1xuaW1wb3J0IHsgaXNTdHlsZXNoZWV0RmlsZSB9IGZyb20gJ0Bwcm9ncmVzcy9rZW5kby1yZWFjdC1jb21tb24vY29kZW1vZHMnO1xuaW1wb3J0IHsgZmluZEltcG9ydGVkTmFtZSwgcmVtb3ZlQXR0cmlidXRlIH0gZnJvbSAnLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHRyYW5zZm9ybWVyKGZpbGU6IEZpbGVJbmZvLCBhcGk6IEFQSSkge1xuICAgIGlmIChpc1N0eWxl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QU0sRUFFcEJLLEVBQVdDLEVBQUFBLGlCQUFpQkgsRUFBR0MsRUFBTSxPQUFRLHlDQUF5QyxHQUFLLE9BRWpHLE9BQUFBLEVBQUssS0FBS0QsRUFBRSxrQkFBbUIsQ0FDM0IsS0FBTSxDQUFFLEtBQU0sZ0JBQWlCLEtBQU1FLENBQUEsQ0FBUyxDQUNqRCxFQUFFLFFBQVNFLEdBQVMsQ0FDakIsTUFBTUMsRUFBUUQsRUFBSyxLQUFLLFlBQWMsQ0FBQSxFQUN0Q0UsRUFBQUEsZ0JBQWdCRCxFQUFnQixhQUFhLENBQ2pELENBQUMsRUFFTUosRUFBSyxTQUFBLENBQ2hCIn0=
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("./utils.js");function i(r,n){const t=n.jscodeshift,e=t(r.source),s=o.findImportedName(t,e,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return e.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:s}}).forEach(c=>{const a=c.node.attributes||[];o.removeAttribute(a,"onToolbarActionExecute")}),e.toSource()}module.exports=i;
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci1hY3Rpb24tZXhlY3V0ZS5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29udmVyc2F0aW9uYWwtdWkvY29kZW1vZHMvdjEyL3Rvb2xiYXItYWN0aW9uLWV4ZWN1dGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQVBJLCBGaWxlSW5mbywgSlNDb2Rlc2hpZnQgfSBmcm9tICdqc2NvZGVzaGlmdCc7XG5pbXBvcnQgeyBmaW5kSW1wb3J0ZWROYW1lLCByZW1vdmVBdHRyaWJ1dGUgfSBmcm9tICcuL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gdHJhbnNmb3JtZXIoZmlsZTogRmlsZUluZm8sIG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CLEtBQU1FLENBQUEsQ0FBUyxDQUMvQyxFQUFFLFFBQVNFLEdBQVMsQ0FDbkIsTUFBTUMsRUFBUUQsRUFBSyxLQUFLLFlBQWMsQ0FBQSxFQUN0Q0UsRUFBQUEsZ0JBQWdCRCxFQUFnQix3QkFBd0IsQ0FDMUQsQ0FBQyxFQUVNSixFQUFLLFNBQUEsQ0FDZCJ9
1
+ "use strict";const a=require("@progress/kendo-react-common/codemods"),r=require("./utils.js");function u(t,n){if(a.isStylesheetFile(t.path))return t.source;const e=n.jscodeshift,o=e(t.source),s=r.findImportedName(e,o,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return o.find(e.JSXOpeningElement,{name:{type:"JSXIdentifier",name:s}}).forEach(c=>{const i=c.node.attributes||[];r.removeAttribute(i,"onToolbarActionExecute")}),o.toSource()}module.exports=u;
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci1hY3Rpb24tZXhlY3V0ZS5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29udmVyc2F0aW9uYWwtdWkvY29kZW1vZHMvdjEyL3Rvb2xiYXItYWN0aW9uLWV4ZWN1dGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQVBJLCBGaWxlSW5mbywgSlNDb2Rlc2hpZnQgfSBmcm9tICdqc2NvZGVzaGlmdCc7XG5pbXBvcnQgeyBpc1N0eWxlc2hlZXRGaWxlIH0gZnJvbSAnQHByb2dyZXNzL2tlbmRvLXJlYWN0LWNvbW1vbi9jb2RlbW9kcyc7XG5pbXBvcnQgeyBmaW5kSW1wb3J0ZWROYW1lLCByZW1vdmVBdHRyaWJ1dGUgfSBmcm9tICcuL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gdHJhbnNmb3JtZXIoZmlsZTogRmlsZUluZm8sIGFwaTogQVBJKSB7XG4gICAgaWYgK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RUFBT0QsRUFBRUgsRUFBSyxNQUFNLEVBRXBCSyxFQUFXQyxFQUFBQSxpQkFBaUJILEVBQUdDLEVBQU0sT0FBUSx5Q0FBeUMsR0FBSyxPQUVqRyxPQUFBQSxFQUFLLEtBQUtELEVBQUUsa0JBQW1CLENBQzNCLEtBQU0sQ0FBRSxLQUFNLGdCQUFpQixLQUFNRSxDQUFBLENBQVMsQ0FDakQsRUFBRSxRQUFTRSxHQUFTLENBQ2pCLE1BQU1DLEVBQVFELEVBQUssS0FBSyxZQUFjLENBQUEsRUFDdENFLEVBQUFBLGdCQUFnQkQsRUFBZ0Isd0JBQXdCLENBQzVELENBQUMsRUFFTUosRUFBSyxTQUFBLENBQ2hCIn0=
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("./utils.js");function i(r,n){const t=n.jscodeshift,e=t(r.source),s=o.findImportedName(t,e,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return e.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:s}}).forEach(a=>{const c=a.node.attributes||[];o.removeAttribute(c,"toolbar")}),e.toSource()}module.exports=i;
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29udmVyc2F0aW9uYWwtdWkvY29kZW1vZHMvdjEyL3Rvb2xiYXIudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQVBJLCBGaWxlSW5mbywgSlNDb2Rlc2hpZnQgfSBmcm9tICdqc2NvZGVzaGlmdCc7XG5pbXBvcnQgeyBmaW5kSW1wb3J0ZWROYW1lLCByZW1vdmVBdHRyaWJ1dGUgfSBmcm9tICcuL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gdHJhbnNmb3JtZXIoZmlsZTogRmlsZUluZm8sIGFwaTogQVBJKSB7XG4gIGNvbnN0IGo6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VMsQ0FDbkIsTUFBTUMsRUFBUUQsRUFBSyxLQUFLLFlBQWMsQ0FBQSxFQUN0Q0UsRUFBQUEsZ0JBQWdCRCxFQUFnQixTQUFTLENBQzNDLENBQUMsRUFFTUosRUFBSyxTQUFBLENBQ2QifQ==
1
+ "use strict";const i=require("@progress/kendo-react-common/codemods"),o=require("./utils.js");function u(t,n){if(i.isStylesheetFile(t.path))return t.source;const e=n.jscodeshift,r=e(t.source),s=o.findImportedName(e,r,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return r.find(e.JSXOpeningElement,{name:{type:"JSXIdentifier",name:s}}).forEach(c=>{const a=c.node.attributes||[];o.removeAttribute(a,"toolbar")}),r.toSource()}module.exports=u;
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29udmVyc2F0aW9uYWwtdWkvY29kZW1vZHMvdjEyL3Rvb2xiYXIudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQVBJLCBGaWxlSW5mbywgSlNDb2Rlc2hpZnQgfSBmcm9tICdqc2NvZGVzaGlmdCc7XG5pbXBvcnQgeyBpc1N0eWxlc2hlZXRGaWxlIH0gZnJvbSAnQHByb2dyZXNzL2tlbmRvLXJlYWN0LWNvbW1vbi9jb2RlbW9kcyc7XG5pbXBvcnQgeyBmaW5kSW1wb3J0ZWROYW1lLCByZW1vdmVBdHRyaWJ1dGUgfSBmcm9tICcuL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gdHJhbnNmb3JtZXIoZmlsZTogRmlsZUluZm8sIGFwaTogQVBJKSB7XG4gICAgaWYgKGlzU3R5bGVzaGVldEZpbGUoZmlsZS5wYXRoKSkge1xuICAgICAgICByZXR1cm4gZmlsZS5zb3VyY2U7XG4gICAgfVxuICAgIGNvbnN0IGo6IEpTQ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EtBQUtELEVBQUUsa0JBQW1CLENBQzNCLEtBQU0sQ0FBRSxLQUFNLGdCQUFpQixLQUFNRSxDQUFBLENBQVMsQ0FDakQsRUFBRSxRQUFTRSxHQUFTLENBQ2pCLE1BQU1DLEVBQVFELEVBQUssS0FBSyxZQUFjLENBQUEsRUFDdENFLEVBQUFBLGdCQUFnQkQsRUFBZ0IsU0FBUyxDQUM3QyxDQUFDLEVBRU1KLEVBQUssU0FBQSxDQUNoQiJ9
@@ -1,2 +1,2 @@
1
- "use strict";const m=require("./utils.js");function y(t,o){const e=o.jscodeshift,n=e(t.source),r=m.findImportedName(e,n,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return n.find(e.JSXOpeningElement,{name:{type:"JSXIdentifier",name:r}}).forEach(p=>{const u=p.node.attributes||[],c=m.findAttribute(u,"messageBoxTemplate");if(!c)return;const s=c.value;if(!s||s.type!=="JSXExpressionContainer")return;const i=s.expression;if((i.type==="ArrowFunctionExpression"||i.type==="FunctionExpression")&&a(e,n,i),i.type==="Identifier"){const d=i.name;l(e,n,d)}}),n.toSource()}function a(t,o,e){if(e.params&&e.params.length>0){const r=e.params[0];r.type==="ObjectPattern"&&f(r)}const n=e.body;n&&n.type==="BlockStatement"&&E(t,n),x(t,o,e)}function l(t,o,e){o.find(t.VariableDeclarator,{id:{name:e}}).forEach(n=>{const r=n.node.init;r&&(r.type==="ArrowFunctionExpression"||r.type==="FunctionExpression")&&a(t,o,r)}),o.find(t.FunctionDeclaration,{id:{name:e}}).forEach(n=>{a(t,o,n.node)})}function f(t){if(t.properties){const o=t.properties.findIndex(e=>e.type==="ObjectProperty"||e.type==="Property"?(e.key?.name||e.key?.value)==="sendButton":!1);o!==-1&&t.properties.splice(o,1)}}function E(t,o){o.body.forEach(e=>{e.type==="VariableDeclaration"&&e.declarations.forEach(n=>{n.id&&n.id.type==="ObjectPattern"&&f(n.id)})})}function x(t,o,e){t(e).find(t.JSXExpressionContainer,{expression:{type:"Identifier",name:"sendButton"}}).remove(),t(e).find(t.JSXElement).forEach(n=>{const r=n.node.openingElement;r.name&&r.name.name==="sendButton"&&t(n).remove()})}module.exports=y;
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZC1idXR0b24uanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbnZlcnNhdGlvbmFsLXVpL2NvZGVtb2RzL3YxNC9zZW5kLWJ1dHRvbi50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBUEksIEZpbGVJbmZvLCBKU0NvZGVzaGlmdCB9IGZyb20gJ2pzY29kZXNoaWZ0JztcbmltcG9ydCB7IGZpbmRJbXBvcnRlZE5hbWUsIGZpbmRBdHRyaWJ1dGUgfSBmcm9tICcuL3V0aWxzJztcblxuLyoqXG4gKiBUaGlzIGNvZGVtb2QgcmVtb3ZlcyB0aGUgYHNlbmRCdXR0b25gIHByb3BlcnR5IGZyb20gdGhlIGBtZXNzYWdlQm94VGVtcGxhdGVgIHJlbmRlciBmdW5jdGlvbi5cbiAqIFRoZSBzZW5kIGJ1dHRvbiBpcyBub3cgYXV0b21hdGljYWxseSByZW5kZXJlZCBhcyBwYXJ0IG9mIHRoZSBQcm9tcHRCb3ggY29tcG9uZW50LlxuICpcbiAqIEJlZm9yZTpcbiAqIG1lc3NhZ2VCb3hUZW1wbGF0ZT17KHByb3BzKSA9PiB7XG4gKiAgIGNvbnN0IHsgc2VuZEJ1dHRvbiwgbWVzc2FnZUlucHV0IH0gPSBwcm9wcztcbiAqICAgcmV0dXJuIDxkaXY+e21lc3NhZ2VJbnB1dH17c2VuZEJ1dHRvbn08L2Rpdj47XG4gKiB9fVxuICpcbiAqIEFmdGVyOlxuICogbWVzc2FnZUJveFRlbXBsYXRlPXsocHJvcHMpID0+IHtcbiAqICAgY29uc3QgeyBtZXNzYWdlSW5wdXQgfSA9IHByb3BzO1xuICogICByZXR1cm4gPGRp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"),m=require("./utils.js");function l(n,o){if(y.isStylesheetFile(n.path))return n.source;const e=o.jscodeshift,t=e(n.source),r=m.findImportedName(e,t,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return t.find(e.JSXOpeningElement,{name:{type:"JSXIdentifier",name:r}}).forEach(f=>{const u=f.node.attributes||[],c=m.findAttribute(u,"messageBoxTemplate");if(!c)return;const s=c.value;if(!s||s.type!=="JSXExpressionContainer")return;const i=s.expression;if((i.type==="ArrowFunctionExpression"||i.type==="FunctionExpression")&&a(e,t,i),i.type==="Identifier"){const d=i.name;E(e,t,d)}}),t.toSource()}function a(n,o,e){if(e.params&&e.params.length>0){const r=e.params[0];r.type==="ObjectPattern"&&p(r)}const t=e.body;t&&t.type==="BlockStatement"&&S(n,t),x(n,o,e)}function E(n,o,e){o.find(n.VariableDeclarator,{id:{name:e}}).forEach(t=>{const r=t.node.init;r&&(r.type==="ArrowFunctionExpression"||r.type==="FunctionExpression")&&a(n,o,r)}),o.find(n.FunctionDeclaration,{id:{name:e}}).forEach(t=>{a(n,o,t.node)})}function p(n){if(n.properties){const o=n.properties.findIndex(e=>e.type==="ObjectProperty"||e.type==="Property"?(e.key?.name||e.key?.value)==="sendButton":!1);o!==-1&&n.properties.splice(o,1)}}function S(n,o){o.body.forEach(e=>{e.type==="VariableDeclaration"&&e.declarations.forEach(t=>{t.id&&t.id.type==="ObjectPattern"&&p(t.id)})})}function x(n,o,e){n(e).find(n.JSXExpressionContainer,{expression:{type:"Identifier",name:"sendButton"}}).remove(),n(e).find(n.JSXElement).forEach(t=>{const r=t.node.openingElement;r.name&&r.name.name==="sendButton"&&n(t).remove()})}module.exports=l;
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZC1idXR0b24uanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbnZlcnNhdGlvbmFsLXVpL2NvZGVtb2RzL3YxNC9zZW5kL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
- "use strict";const c=require("./utils.js"),d=["multiple","accept","restrictions"];function m(r,e){const t=e.jscodeshift,n=t(r.source),i=c.findImportedName(t,n,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return n.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:i}}).forEach(u=>{const p=u.node.attributes||[],a=c.findAttribute(p,"uploadConfig");if(!a)return;const s=a.value;if(!s||s.type!=="JSXExpressionContainer")return;const o=s.expression;if(o.type==="ObjectExpression"&&f(o),o.type==="Identifier"){const l=o.name;y(t,n,l)}}),n.toSource()}function f(r){r.properties&&(r.properties=r.properties.filter(e=>{if(e.type==="Property"||e.type==="ObjectProperty"){const t=e.key?.name||e.key?.value;return d.includes(t)}return e.type==="SpreadElement"}))}function y(r,e,t){e.find(r.VariableDeclarator,{id:{name:t}}).forEach(n=>{const i=n.node.init;i&&i.type==="ObjectExpression"&&f(i)})}module.exports=m;
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXBsb2FkLWNvbmZpZy5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29udmVyc2F0aW9uYWwtdWkvY29kZW1vZHMvdjE0L3VwbG9hZC1jb25maWcudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQVBJLCBGaWxlSW5mbywgSlNDb2Rlc2hpZnQgfSBmcm9tICdqc2NvZGVzaGlmdCc7XG5pbXBvcnQgeyBmaW5kSW1wb3J0ZWROYW1lLCBmaW5kQXR0cmlidXRlIH0gZnJvbSAnLi91dGlscyc7XG5cbi8qKlxuICogVGhpcyBjb2RlbW9kIHVwZGF0ZXMgdGhlIGB1cGxvYWRDb25maWdgIHByb3AgZnJvbSBgVXBsb2FkUHJvcHNgIHRvIGBVcGxvYWRCdXR0b25Qcm9wc2AuXG4gKiBPbmx5IHRoZSBmb2xsb3dpbmcgcHJvcGVydGllcyBhcmUgbm93IHN1cHBvcnRlZ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VyZW5jZWRPYmplY3Qoaiwgcm9vdCwgdmFyTmFtZSk7XG4gICAgICAgIH1cbiAgICB9KTtcblxuICAgIHJldHVybiByb290LnRvU291cmNlKCk7XG59XG5cbmZ1bmN0aW9uIGZpbHRlck9iamVjdFByb3BlcnRpZXMob2JqZWN0RXhwcmVzc2lvbjogYW55KSB7XG4gICAgaWYgKG9iamVjdEV4cHJlc3Npb24ucHJvcGVydGllcykge1xuICAgICAgICBvYmplY3RFeHByZXNzaW9uLnByb3BlcnRpZXMgPSBvYmplY3RFeHByZXNzaW9uLnByb3BlcnRpZXMuZmlsdGVyKChwcm9wOiBhbnkpID0+IHtcbiAgICAgICAgICAgIGlmIChwcm9wLnR5cGUgPT09ICdQcm9wZXJ0eScgfHwgcHJvcC50eXBlID09PSAnT2JqZWN0UHJvcGVydHknKSB7XG4gICAgICAgICAgICAgICAgY29uc3Qga2V5TmFtZSA9IHByb3Aua2V5Py5uYW1lIHx8IHByb3Aua2V5Py52YWx1ZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gQUxMT1dFRF9QUk9QRVJUSUVTLmluY2x1ZGVzKGtleU5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gS2VlcCBzcHJlYWQgZWxlbWVudHMgYXMgdGhleSBtaWdodCBjb250YWluIGFsbG93ZWQgcHJvcGVydGllc1xuICAgICAgICAgICAgaWYgKHByb3AudHlwZSA9PT0gJ1NwcmVhZEVsZW1lbnQnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH0pO1xuICAgIH1cbn1cblxuZnVuY3Rpb24gZmlsdGVyUmVmZXJlbmNlZE9iamVjdChqOiBKU0NvZGVzaGlmdCwgcm9vdDogYW55LCB2YXJOYW1lOiBzdHJpbmcpIHtcbiAgICAvLyBGaW5kIHZhcmlhYmxlIGRlY2xhcmF0aW9ucyB3aXRoIG9i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FBUyxvQkFDdEJOLEVBQXVCTSxDQUFJLENBRW5DLENBQUMsQ0FDTCJ9
1
+ "use strict";const l=require("@progress/kendo-react-common/codemods"),c=require("./utils.js"),m=["multiple","accept","restrictions"];function y(e,t){if(l.isStylesheetFile(e.path))return e.source;const r=t.jscodeshift,n=r(e.source),i=c.findImportedName(r,n,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return n.find(r.JSXOpeningElement,{name:{type:"JSXIdentifier",name:i}}).forEach(f=>{const p=f.node.attributes||[],a=c.findAttribute(p,"uploadConfig");if(!a)return;const s=a.value;if(!s||s.type!=="JSXExpressionContainer")return;const o=s.expression;if(o.type==="ObjectExpression"&&u(o),o.type==="Identifier"){const d=o.name;h(r,n,d)}}),n.toSource()}function u(e){e.properties&&(e.properties=e.properties.filter(t=>{if(t.type==="Property"||t.type==="ObjectProperty"){const r=t.key?.name||t.key?.value;return m.includes(r)}return t.type==="SpreadElement"}))}function h(e,t,r){t.find(e.VariableDeclarator,{id:{name:r}}).forEach(n=>{const i=n.node.init;i&&i.type==="ObjectExpression"&&u(i)})}module.exports=y;
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXBsb2FkLWNvbmZpZy5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29udmVyc2F0aW9uYWwtdWkvY29kZW1vZHMvdjE0L3VwbG9hZC1jb25maWcudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQVBJLCBGaWxlSW5mbywgSlNDb2Rlc2hpZnQgfSBmcm9tICdqc2NvZGVzaGlmdCc7XG5pbXBvcnQgeyBpc1N0eWxlc2hlZXRGaWxlIH0gZnJvbSAnQHByb2dyZXNzL2tlbmRvLXJlYWN0LWNvbW1vbi9jb2RlbW9kcyc7XG5pbXBvcnQgeyBmaW5kSW1wb3J0ZWROYW1lLCBmaW5kQXR0cmlidXRlIH0gZnJvbSAnLi91d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QSxFQUFLLE9BQVMsWUFBY0EsRUFBSyxPQUFTLGlCQUFrQixDQUM1RCxNQUFNQyxFQUFVRCxFQUFLLEtBQUssTUFBUUEsRUFBSyxLQUFLLE1BQzVDLE9BQU9uQixFQUFtQixTQUFTb0IsQ0FBTyxDQUM5QyxDQUVBLE9BQUlELEVBQUssT0FBUyxlQUl0QixDQUFDLEVBRVQsQ0FFQSxTQUFTRixFQUF1QlosRUFBZ0JDLEVBQVdVLEVBQWlCLENBRXhFVixFQUFLLEtBQUtELEVBQUUsbUJBQW9CLENBQzVCLEdBQUksQ0FBRSxLQUFNVyxDQUFBLENBQVEsQ0FDdkIsRUFBRSxRQUFTUCxHQUFjLENBQ3RCLE1BQU1ZLEVBQU9aLEVBQUssS0FBSyxLQUNuQlksR0FBUUEsRUFBSyxPQUFTLG9CQUN0Qk4sRUFBdUJNLENBQUksQ0FFbkMsQ0FBQyxDQUNMIn0=
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-intl"),require("prop-types"),require("@progress/kendo-react-upload"),require("@progress/kendo-react-animation"),require("@progress/kendo-react-notification"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-indicators"),require("@progress/kendo-react-tooltip")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-layout","@progress/kendo-react-intl","prop-types","@progress/kendo-react-upload","@progress/kendo-react-animation","@progress/kendo-react-notification","@progress/kendo-react-inputs","@progress/kendo-react-popup","@progress/kendo-react-indicators","@progress/kendo-react-tooltip"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactConversationalUi={},e.React,e.KendoReactCommon,e.KendoReactButtons,e.KendoSvgIcons,e.KendoReactLayout,e.KendoReactIntl,e.PropTypes,e.KendoReactUpload,e.KendoReactAnimation,e.KendoReactNotification,e.KendoReactInputs,e.KendoReactPopup,e.KendoReactIndicators,e.KendoReactTooltip)}(this,function(e,t,n,a,l,o,s,r,i,c,u,m,d,p,g){"use strict";function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var h=f(t);const v="newMessage.sendButton",k="newMessage.optionsButton",b="newMessage.messageInput",E="avatar.alt",y="messageList.ariaLabel",C="aIPrompt.noOutputs",x="aIPrompt.cancel",I="aIPrompt.inputPlaceholder",T="chat.senderDeletedMessage",N="chat.receiverDeletedMessage",w="chat.copyNotification",F="chat.downloadAllFiles",S="chat.closeReply",R="chat.collapseMessage",A="chat.expandMessage",M="chat.removeFile",L="chat.fileActions",B="chat.attachFile",D="chat.downloadAll",P="chat.scrollLeft",z="chat.scrollRight",O="chat.scrollToBottom",q="chat.messageFailed",K="chat.retryMessage",H="chat.stopGenerating",U="promptBox.input",$="promptBox.sendButton",V="promptBox.sendButtonText",j="promptBox.attachFile",W="promptBox.removeFile",G="promptBox.stopGenerating",_="promptBox.ariaLabel",Y="promptBox.attachedFiles",J="chat.messageToolbar",X="chat.unpinMessage",Q="chat.messageAttachedFiles",Z="toolCall.state.active",ee="toolCall.state.completed",te="toolCall.state.awaitingApproval",ne="toolCall.state.error",ae="checkpoint.startOver",le="checkpoint.restore",oe="checkpoint.restored",se="checkpoint.redo",re="toolCall.approve",ie="toolCall.reject",ce="citation.previous",ue="citation.next",me={[v]:"Send",[k]:"Options",[b]:"Message",[E]:"Avatar",[y]:"Message list",[x]:"Cancel",[C]:"No output from AI available",[I]:"Ask or generate content with AI ...",[T]:"You removed this message",[N]:"The message was removed by its sender",[w]:"Text copied to clipboard",[F]:"Download all files",[S]:"Close reply",[R]:"Collapse message",[A]:"Expand message",[M]:"Remove file",[L]:"File actions for",[q]:"Failed to send",[K]:"Retry",[H]:"Stop generating",[B]:"Attach file",[D]:"Download all",[P]:"Scroll left",[z]:"Scroll right",[O]:"Scroll to bottom",[U]:"Prompt",[$]:"Send",[V]:"",[j]:"Attach file",[W]:"Remove file",[G]:"Stop generating",[_]:"Prompt box",[Y]:"Attached files",[J]:"Toolbar",[X]:"Unpin message",[Q]:"Attached files",[Z]:"Active",[ee]:"Completed",[te]:"Awaiting Approval",[ne]:"Error",[ae]:"Start Over",[le]:"Restore Checkpoint",[oe]:"Checkpoint Restored",[se]:"Redo",[re]:"Approve",[ie]:"Reject",[ce]:"Previous",[ue]:"Next"},de=(e,t)=>e&&t.author&&e.id===t.author.id,pe=(e,t)=>{const n=t.toLanguageString("chatSender.deletedMessage",me[T]),a=t.toLanguageString("chatReceiver.deletedMessage",me[N]);return e?n:a},ge=(e,t)=>e.find(e=>e.id===t),fe=/(https?:\/\/[^\s]+)/g,he=e=>{if(!e)return[""];const t=e.split(fe),n=[];return t.forEach(e=>{e&&fe.test(e)?(fe.lastIndex=0,n.push(h.createElement("a",{key:e,href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"}},e))):e&&n.push(e)}),n},ve=h.createContext(void 0),ke=()=>{const e=t.useContext(ve);if(void 0===e)throw new Error("useChatContext must be used within a ChatContext.Provider");return e},be=e=>{const{files:t,onFileAction:o,onDownload:r,fileActions:i}=e,{messageFilesLayout:c="vertical"}=ke(),u=s.useLocalization(),m=i||[{id:"download",label:"Download",svgIcon:l.downloadIcon}],d=e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`},p=e=>"."+e.split(".").pop()||"",g=e=>m.length>0&&h.createElement(a.DropDownButton,{fillMode:"flat",size:"xs",svgIcon:l.moreVerticalIcon,onClick:e=>{e.syntheticEvent.stopPropagation()},onItemClick:t=>((e,t)=>{var n,a;null==(a=null==(n=e.syntheticEvent)?void 0:n.stopPropagation)||a.call(n),"download"===e.item.id&&(null==r||r([t])),null==o||o(e.item,e,t)})(t,e),items:m.map(e=>({id:e.id,icon:e.icon,text:e.label,svgIcon:e.svgIcon})),"aria-label":`${u.toLanguageString(L,me[L])} ${e.name}`,title:`${u.toLanguageString(L,me[L])} ${e.name}`}),f=h.useCallback(()=>n.classNames({"k-files-wrap":"wrap"===c,"k-files-vertical":"vertical"===c},"k-file-box-wrapper"),[c]);return h.createElement("ul",{role:"list","aria-label":u.toLanguageString(Q,me[Q]),className:f()},"horizontal"===c?h.createElement("div",{className:"k-files-scroll",role:"presentation"},t.map(e=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem","aria-label":[e.name,d(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(p(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},d(e.size))),g(e)))):t.map(e=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem","aria-label":[e.name,d(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(p(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},d(e.size))),g(e))))},Ee=h.forwardRef((e,t)=>{const{item:r,template:i,contentTemplate:c,onRequestSelection:u,tabIndex:m=-1,dateFormat:d="g",selected:p,allowMessageCollapse:g,messageToolbarActions:f,messageContextMenuActions:v,fileActions:k,isSender:b}=e,{setReplyToMessage:E,messages:y,repliedToMessages:C,user:x,onToolbarAction:I,onContextMenuAction:T,onFileAction:N,onDownload:w,onResendMessage:S,setShowCopyNotification:M,statusTemplate:L,timestampVisibility:B="onFocus",onReferencedMessageClick:P}=ke(),[z,O]=h.useState(!1),[H,U]=h.useState(!1),[$,V]=h.useState(!0),[j,W]=h.useState(!1),G=s.useLocalization(),_=s.useInternationalization(),Y=h.useRef({left:0,top:0}),X=h.useCallback(()=>{null!=r&&r.text&&(e=>{navigator.clipboard.writeText(e)})(r.text),M&&(M(!0),setTimeout(()=>{M(!1)},3e3))},[r,M]),Q=h.useCallback(e=>{e.stopPropagation(),V(e=>!e)},[]),Z=h.useCallback(()=>{W(!1)},[]),ee=h.useCallback(e=>{("Tab"===e.key||"Enter"===e.key||" "===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key)&&W(!0)},[]),te=h.useRef(null);h.useEffect(()=>{p&&te.current&&te.current.focus()},[p]);const ne=h.useCallback(e=>{Y.current={left:e.pageX,top:e.pageY},e.preventDefault(),U(!0),O(!0)},[]),ae=h.useCallback(()=>{U(!1),O(!1)},[]),le=h.useCallback((e,t)=>e.isDeleted?pe(t,G):e.text?e.text:"",[G]),oe=h.useCallback(e=>{var t;null!=(t=e.item)&&t.text&&("copy"!==e.item.data.id||r.isDeleted?"reply"===e.item.data.id&&E(r):X(),T&&T(e.item.data,e,r)),U(!1),O(!1)},[r,T,E,X]),se=h.useCallback(()=>{if(r.replyToId){const e=ge(y,r.replyToId)||(C?ge(C,r.replyToId):void 0);if(e){const t=t=>{t.preventDefault(),t.stopPropagation(),null==P||P(e.id)};return h.createElement("div",{className:n.classNames("k-message-reference",de(x,e)?"k-message-reference-sender":"k-message-reference-receiver"),onClick:t},h.createElement("div",{className:"k-message-reference-content"},he(le(e,de(x,e)))))}}return null},[r.replyToId,y,C,x,le,P]),re=h.useCallback(()=>{const e=[{id:"reply",label:"Reply",svgIcon:l.undoIcon},{id:"copy",label:"Copy",svgIcon:l.copyIcon}],t=v?[...e.map(e=>v.find(t=>t.id===e.id)||e),...v.filter(t=>!e.some(e=>e.id===t.id))]:e;return h.createElement(o.ContextMenu,{onSelect:oe,onClose:ae,vertical:!0,show:z,offset:Y.current},t.map(e=>"delete"!==e.id||b?h.createElement(o.MenuItem,{key:e.id,text:e.label,icon:e.icon,svgIcon:e.svgIcon,data:e}):null))},[v,oe,ae,z,b]),ie=h.useCallback(()=>r.files&&r.files.length>1?h.createElement("div",{className:"k-chat-download-button-wrapper"},h.createElement(a.Button,{className:"k-chat-download-button",fillMode:"flat",svgIcon:l.downloadIcon,size:"small",onClick:e=>{e.stopPropagation(),w&&w(r.files,r)},"aria-label":G.toLanguageString(F,me[F])},h.createElement("span",{className:"k-button-text"},G.toLanguageString(D,me[D])))):null,[r,w,G]),ce=h.useCallback(()=>{if(r.typing)return h.createElement("div",{className:"k-chat-bubble k-bubble"},h.createElement("div",{className:"k-bubble-content"},h.createElement("div",{className:"k-typing-indicator"},h.createElement("span",null),h.createElement("span",null),h.createElement("span",null))));if(i){const e=i;return h.createElement(h.Fragment,null,h.createElement(e,{item:r}),re())}return r.text||r.files&&r.files.length>0?h.createElement(h.Fragment,null,h.createElement("div",{className:n.classNames("k-chat-bubble","k-bubble",{"k-bubble-expandable":g,"k-expanded":g&&$,"k-selected":p,"k-active":H}),onClick:()=>u(p?void 0:r.selectionIndex),onContextMenu:ne},h.createElement("div",{className:"k-bubble-content"},c?h.createElement(c,{item:r}):h.createElement(h.Fragment,null,(r.text||r.isDeleted||r.replyToId)&&h.createElement("span",{className:"k-chat-bubble-text"},!r.isDeleted&&se(),he(le(r,de(x,r)))),r.files&&r.files.length>0&&h.createElement(be,{files:r.files,message:r,onFileAction:N,onDownload:e=>null==w?void 0:w(e,r),renderInTextarea:!1,fileActions:k}),ie())),g&&h.createElement("span",{className:"k-bubble-expandable-indicator",onClick:Q,role:"button","aria-label":$?G.toLanguageString(R,me[R]):G.toLanguageString(A,me[A]),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),Q(e))}},h.createElement(n.IconWrap,{icon:$?l.chevronUpIcon:l.chevronDownIcon}))),re()):null},[r,i,c,g,$,p,H,u,ne,se,le,x,N,k,ie,Q,G,re,w]),ue=h.useCallback(()=>{let e=null;return r.timestamp&&("hidden"===B||(e=h.createElement("time",{className:"k-message-time"},_.formatDate(r.timestamp,d)))),e},[r.timestamp,d,B,_]),fe=h.useCallback(()=>{if(!r.status)return null;let e;if(L)e=h.createElement(L,{item:r});else{let t,a,l;if("object"==typeof r.status&&null!==r.status){const e=r.status;t=e.text,a=e.icon,l=e.svgIcon}else t=r.status;let o=null;a?o=h.createElement(n.Icon,{name:a,size:"xsmall"}):l&&(o=h.createElement(n.IconWrap,{icon:l,size:"xsmall"})),e=h.createElement(h.Fragment,null,o,t)}return h.createElement("span",{className:"k-message-status"},e)},[r,L]),ve=h.useCallback(()=>{let e=null;if(r.isFailed){const t=G.toLanguageString(q,me[q]);e=h.createElement("span",{className:"k-message-failed-content"},h.createElement(n.IconWrap,{icon:l.warningTriangleIcon,size:"xsmall"}),h.createElement("span",{className:"k-message-failed-text"},t))}return e},[r,G]),Ee=h.useCallback(()=>{let e=null;if(r.isFailed){const t=G.toLanguageString(K,me[K]);e=h.createElement(a.Button,{fillMode:"clear",size:"xs",className:"k-resend-button",svgIcon:l.arrowRotateCwIcon,"aria-label":t,title:t,onClick:e=>{e.stopPropagation(),S&&S({message:r,syntheticEvent:e,nativeEvent:e.nativeEvent,target:e.target})}})}return e},[r,G,S]),ye=h.useCallback(()=>n.classNames({"k-focus":p,"k-message-removed":r.isDeleted,"k-message-failed":r.isFailed},"k-message"),[p,r.isDeleted,r.isFailed]),Ce=h.useCallback(()=>f&&f.length>0&&h.createElement(a.Toolbar,{className:"k-chat-message-toolbar",fillMode:"flat",ariaLabel:G.toLanguageString(J,me[J])},f.map(e=>"delete"!==e.id||b?h.createElement(a.Button,{key:e.id,fillMode:"flat",className:"k-toolbar-button",icon:e.icon,svgIcon:e.svgIcon,"aria-label":e.label,onClick:t=>{t.stopPropagation(),"copy"!==e.id||r.isDeleted?"reply"===e.id&&E(r):X(),I&&I(e,t,r)},onMouseDown:e=>e.preventDefault()}):null)),[X,b,r,G,f,I,E]);return h.createElement("div",{key:r.id,"data-message-id":r.id,className:ye(),tabIndex:m,onMouseDown:Z,onKeyDown:ee,onFocus:e=>{j&&u(r.selectionIndex)},ref:e=>{te.current=e,"function"==typeof t?t(e):t&&(t.current=e)},onContextMenu:i?ne:void 0},Ee(),ce(),(r.status||r.timestamp&&"hidden"!==B||r.isFailed)&&h.createElement("div",{className:"k-message-info"},fe(),ue(),ve()),Ce())});Ee.displayName="ChatMessage";const ye=e=>e[e.length-1],Ce=e=>(t,n,a)=>{const l=a===e-1;return((e,t)=>{const n=t.timestamp,a=ye(e);if(n&&(!a||((e,t)=>e&&t&&(t.getDate()!==e.getDate()||t.getMonth()!==e.getMonth()||t.getFullYear()!==e.getFullYear()))(n,a.timestamp))){const t={type:"date-marker",timestamp:n,trackBy:n.getTime()};e.push(t)}})(t,n),((e,t,n)=>{const a=ye(e);let l;t.typing&&!n||(a&&"message-group"===a.type&&(l=a.messages),l&&de(t.author,ye(l))?l.push(t):e.push({type:"message-group",messages:[t],author:t.author,timestamp:t.timestamp,trackBy:t}))})(t,n,l),n.attachments&&n.attachments.length>1&&t.push({type:"attachment-group",attachments:n.attachments,attachmentLayout:n.attachmentLayout,timestamp:n.timestamp,trackBy:n}),n.suggestedActions&&l&&t.push({type:"action-group",actions:n.suggestedActions,timestamp:n.timestamp,trackBy:n}),t};const xe=e=>{const{item:t,onActionExecute:a,selected:l}=e,o=h.useRef(null);h.useEffect(()=>{l&&o.current&&o.current.focus()},[l]);const s=h.useCallback(e=>{(e.keyCode===n.Keys.enter||" "===e.key)&&(e.preventDefault(),a(t,e))},[a,t]),r=h.useCallback(()=>n.classNames("k-suggestion k-suggestion-primary",{"k-selected":l},{"k-focus":l}),[l]);return h.createElement("span",{role:"button",className:r(),onClick:e=>a(t,e),ref:o,onKeyDown:s,tabIndex:0,"aria-label":t.title||t.value},t.title||t.value)},Ie=({visible:e,dir:t,canScrollLeft:n,canScrollRight:o,onScrollLeft:r,onScrollRight:i,children:c})=>{const u=s.useLocalization();if(!e)return c;const m=u.toLanguageString(P,me[P]),d=u.toLanguageString(z,me[z]),p="rtl"!==t?m:d,g="rtl"!==t?d:m;return h.createElement("div",{className:"k-suggestion-scrollwrap"},h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:"rtl"===t?l.chevronRightIcon:l.chevronLeftIcon,onClick:r,disabled:!n,"aria-label":p,title:p}),c,h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:"rtl"===t?l.chevronLeftIcon:l.chevronRightIcon,onClick:i,disabled:!o,"aria-label":g,title:g}))},Te=100,Ne=(e,t)=>{const{enabled:n,dir:a,mode:l,itemsDependency:o=[],scrollSpeed:s=Te}=t,[r,i]=h.useState(!1),[c,u]=h.useState(!1),m=h.useCallback(()=>{if(e.current&&n){const{scrollLeft:t,scrollWidth:n,clientWidth:l}=e.current,o="rtl"!==a?t+l>=n-1:l-t>=n-1;i(!(0===t)),u(!o)}},[n,a]),d=h.useCallback(()=>{e.current&&n&&e.current.scrollBy({left:"rtl"!==a?-s:s,behavior:"smooth"})},[n,a,s]),p=h.useCallback(()=>{e.current&&n&&e.current.scrollBy({left:"rtl"!==a?s:-s,behavior:"smooth"})},[n,a,s]);return h.useEffect(()=>{const t=e.current;if(!t||!n)return;m();const a=()=>m();t.addEventListener("scroll",a,{passive:!0});const l=new ResizeObserver(m);return l.observe(t),()=>{t.removeEventListener("scroll",a),l.disconnect()}},[n,m,o.length,l]),h.useLayoutEffect(()=>{n&&m()},[n,a,o]),{canScrollLeft:r,canScrollRight:c,scrollLeft:d,scrollRight:p}},we=e=>{var t,a;const{group:l,onActionExecute:o,selected:s,onRequestSelection:r,quickActionsLayout:i="scroll",dir:c}=e,[u,m]=h.useState(null),d=h.useRef(null),{canScrollLeft:p,canScrollRight:g,scrollLeft:f,scrollRight:v}=Ne(d,{enabled:"scrollbuttons"===i||"scroll"===i,dir:c,mode:i,itemsDependency:l.actions});h.useEffect(()=>{s||null===u?s&&null===u&&m(0):m(null)},[s,u]);const k=h.useCallback(()=>l.actions?l.actions.length-1:-1,[l.actions]),b=h.useCallback((e,t=0)=>{let n=null;return e?null===u?n=t:u<k()&&(n=u+1):null===u?n=0:u>0&&(n=u-1),null!==n&&m(n),n},[u,k]),E=h.useCallback(()=>{r(l.selectionIndex)},[r,l.selectionIndex]),y=h.useCallback(e=>{let t=null;const a=n.Keys.left,l=n.Keys.right;e.keyCode===a?t=b(!1):e.keyCode===l&&(t=b(!0)),null!==t&&(e.preventDefault(),e.stopPropagation())},[b]),C=h.useCallback(()=>n.classNames("k-suggestion-group",{"k-suggestion-group-scrollable":"scroll"===i,"k-suggestion-group-scrollable-start":g&&("scroll"===i||"scrollbuttons"===i),"k-suggestion-group-scrollable-end":p&&("scroll"===i||"scrollbuttons"===i)}),[i,g,p]),x="scroll"===i||"scrollbuttons"===i,I=h.createElement("div",{className:C(),onClick:E,onKeyDown:y,role:"toolbar",tabIndex:0,"aria-label":"Action group"},x?h.createElement("div",{className:"k-suggestions-scroll",ref:d},null==(t=l.actions)?void 0:t.map((e,t)=>h.createElement(xe,{item:e,onActionExecute:o,selected:t===u,key:e.value}))):null==(a=l.actions)?void 0:a.map((e,t)=>h.createElement(xe,{item:e,onActionExecute:o,selected:t===u,key:e.value})));return h.createElement(Ie,{visible:"scrollbuttons"===i,dir:c,canScrollLeft:p,canScrollRight:g,onScrollLeft:f,onScrollRight:v},I)},Fe=e=>{const{item:t,template:a,tabbable:l,onClick:o,selected:s}=e,r=h.useRef(null);h.useEffect(()=>{s&&r.current&&r.current.focus()},[s]);const i=h.useCallback(()=>{if(void 0!==l)return l?0:-1},[l]),c=h.useCallback(()=>n.classNames({"k-selected":s},{"k-focus":s}),[s]),u=h.useCallback(()=>t.title?h.createElement("h5",{className:"k-card-title"},t.title):null,[t.title]),m=h.useCallback(()=>t.subtitle?h.createElement("h6",{className:"k-card-subtitle"},t.subtitle):null,[t.subtitle]),d=h.useCallback(()=>0===t.contentType.indexOf("image/")?h.createElement("img",{src:t.content,alt:t.title||"Attachment",style:{maxHeight:"200px",height:"auto",maxWidth:"200px",width:"auto"}}):t.content,[t.contentType,t.content,t.title]),p=a;return h.createElement("div",{className:c(),tabIndex:i(),onClick:o,ref:r},a?h.createElement(p,{item:t}):h.createElement("div",{className:"k-card"},h.createElement("div",{className:"k-card-body"},u(),m(),d())))},Se=e=>{const{group:t,itemTemplate:o,selected:s,isLastGroup:r,onRequestSelection:i,dir:c}=e,[u,m]=h.useState(null),d=h.useRef(null);h.useEffect(()=>{s||null===u?s&&null===u&&m(0):m(null)},[s,u]);const p=h.useCallback(e=>"list"!==e.attachmentLayout,[]),{canScrollLeft:g,canScrollRight:f,scrollLeft:v,scrollRight:k}=Ne(d,{enabled:p(t),dir:c,itemsDependency:t.attachments}),b=h.useCallback(()=>t.attachments?t.attachments.length-1:-1,[t.attachments]),E=h.useCallback((e,t=0)=>{let n=null;return e?null===u?n=t:u<b()&&(n=u+1):null===u?n=0:u>0&&(n=u-1),null!==n&&m(n),n},[u,b]),y=h.useCallback(()=>{i(t.selectionIndex)},[i,t.selectionIndex]),C=h.useCallback(e=>{let a,l,o=null;p(t)?(a=n.Keys.left,l=n.Keys.right):(a=n.Keys.up,l=n.Keys.down),e.keyCode===a?o=E(!1):e.keyCode===l&&(o=E(!0)),null!==o&&(e.preventDefault(),e.stopPropagation())},[E,p,t]),x=h.useCallback(e=>{y(),m(e)},[y]),I=h.useCallback(()=>{let e=null;return p(t)&&g&&(e=h.createElement(a.Button,{icon:"chevron-left",tabIndex:-1,onClick:v,svgIcon:l.chevronLeftIcon})),e},[p,t,g,v]),T=h.useCallback(()=>{let e=null;return p(t)&&f&&(e=h.createElement(a.Button,{icon:"chevron-right",tabIndex:-1,onClick:k,svgIcon:l.chevronRightIcon})),e},[p,t,f,k]),N=h.useCallback(()=>n.classNames({"k-card-list":t.attachmentLayout,"k-card-deck":p(t)}),[t.attachmentLayout,t,p]),w=p(t),F=h.createElement("div",{ref:d,className:N(),onKeyDown:w?void 0:C},t.attachments.map((e,t)=>h.createElement(Fe,{item:e,template:o,selected:t===u,tabbable:r&&t===u,onClick:()=>x(t),key:e.content})));return w?h.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:C},I(),F,T()):F},Re=({item:e,timestampTemplate:t})=>{const n=s.useInternationalization(),a=t;return h.createElement("div",{className:"k-timestamp"},a?h.createElement(a,{item:e}):n.formatDate(e.timestamp,"D"))},Ae=e=>{const{group:t,user:a,itemTemplate:l,contentTemplate:r,attachmentTemplate:i,onRequestSelection:c,selectedItemIndex:u,isLastGroup:m,message:d,allowMessageCollapse:p,messageToolbarActions:g,messageContextMenuActions:f,fileActions:v,messageWidthMode:k="standard",showAvatar:b=!0,showUsername:y=!0}=e,{userStatusTemplate:C}=ke(),x=s.useLocalization(),I=t.messages.length>0&&de(a,t.messages[0]),{avatarUrl:T,avatarAltText:N,name:w}=t.author,F=h.useMemo(()=>n.classNames("k-message-group",{"k-message-group-sender":I,"k-message-group-receiver":!I,"k-message-group-full-width":"full"===k,"k-no-avatar":!b||!T}),[I,k,b,T]),S=h.useMemo(()=>{const e=t.messages.length-1;return t.messages.map((t,n)=>{const o=[h.createElement(d,{item:t,template:l,contentTemplate:r,selected:t.selectionIndex===u,onRequestSelection:c,tabIndex:n===e&&m?0:-1,key:t.id,allowMessageCollapse:p,messageToolbarActions:g,messageContextMenuActions:f,fileActions:v,isSender:de(a,t)})];return t.attachments&&1===t.attachments.length&&o.push(h.createElement(Fe,{item:t.attachments[0],template:i,selected:!1,key:`att-${t.attachments[0].content}`})),o})},[t.messages,d,l,r,u,c,m,p,g,f,v,a,i]),R=void 0!==N?N:x.toLanguageString(E,me[E]);return h.createElement("div",{className:F},(()=>{if(!b||!T)return;const e=h.createElement(o.Avatar,{type:"image"},h.createElement("img",{src:T,alt:R}));if(C){const n=t.messages[t.messages.length-1];return h.createElement("div",{className:"k-chat-user-status-wrapper"},e,h.createElement("div",{className:"k-chat-user-status"},h.createElement(C,{message:"dataItem"in n?n.dataItem:n})))}return e})(),h.createElement("div",{className:"k-message-group-content"},y&&h.createElement("span",{className:"k-message-author"},w),S))},Me=e=>{const{suggestions:t,onSuggestionClick:a,suggestionsView:l,suggestionTemplate:o,suggestionsLayout:s,dir:r}=e,i=h.useRef(null),{canScrollLeft:c,canScrollRight:u,scrollLeft:m,scrollRight:d}=Ne(i,{enabled:"scrollbuttons"===s||"scroll"===s,dir:r,mode:s,itemsDependency:t}),p=h.useCallback((e,t)=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==a||a(t))},[a]),g=h.useCallback(()=>t.map(e=>o?h.createElement(o,{key:e.id,suggestion:e,onClick:()=>{null==a||a(e)}}):h.createElement("span",{role:"button",tabIndex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:()=>!e.disabled&&(null==a?void 0:a(e)),onKeyDown:t=>!e.disabled&&p(t,e),key:e.id,title:e.description,className:n.classNames("classic"===l?"k-prompt-suggestion":"k-suggestion",{"k-disabled":e.disabled})},e.text)),[t,o,a,l,p]);if(!t||0===t.length)return null;if("classic"===l)return g();const f="scroll"===s||"scrollbuttons"===s,v=h.createElement("div",{role:"group",className:n.classNames("k-suggestion-group",{"k-suggestion-group-scrollable":"scroll"===s,"k-suggestion-group-scrollable-start":u&&("scroll"===s||"scrollbuttons"===s),"k-suggestion-group-scrollable-end":c&&("scroll"===s||"scrollbuttons"===s)})},f?h.createElement("div",{className:"k-suggestions-scroll",ref:i},g()):g());return h.createElement(Ie,{visible:"scrollbuttons"===s,dir:r,canScrollLeft:c,canScrollRight:u,onScrollLeft:m,onScrollRight:d},v)},Le=h.forwardRef(({onFilesAdd:e,files:t=[],restrictions:n,multiple:l=!0,accept:o,uploadRef:s,onSelectAttachments:r,onRemoveAttachment:c,_registerRemoveCallback:u,...m},d)=>{h.useEffect(()=>(u&&c&&u(c),()=>{u&&c&&u(void 0)}),[c,u]);const p=h.useCallback(t=>{e&&e(t),r&&r({selectedFiles:t.affectedFiles,allFiles:t.newState})},[e,r]);return h.createElement(h.Fragment,null,h.createElement(a.Button,{ref:d,...m}),h.createElement(i.Upload,{ref:s,files:t,onAdd:p,autoUpload:!1,restrictions:n,multiple:l,accept:o,className:"k-hidden"}))});Le.displayName="PromptBoxUploadButton";const Be=h.forwardRef((e,t)=>{const{text:n,children:l,...o}=e,s=void 0!==n?n:l,r=""===s||null===s||"boolean"==typeof s?void 0:s;return h.createElement(a.Button,{ref:t,...o},r)});Be.displayName="PromptBoxActionButton";const De=h.forwardRef((e,t)=>h.createElement(a.SpeechToTextButton,{ref:t,...e}));De.displayName="PromptBoxSpeechToTextButton";const Pe=e=>"."+e.split(".").pop()||"",ze=e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`},Oe=({files:e,onRemoveFile:t,header:o})=>{const r=s.useLocalization(),i=h.useRef(null),[c,u]=h.useState(!1),[m,d]=h.useState(!1),p=h.useCallback(()=>{const e=i.current;if(!e)return;const{scrollLeft:t,scrollWidth:n,clientWidth:a}=e,l=t+a>=n-1;d(!(0===t)),u(!l)},[]);if(h.useLayoutEffect(()=>{p()},[e,p]),h.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>p(),n=new ResizeObserver(p);return n.observe(e),e.addEventListener("scroll",t,{passive:!0}),()=>{e.removeEventListener("scroll",t),n.disconnect()}},[p,e.length]),0===e.length&&!o)return null;const g=(e=>e?"function"==typeof e?e():e:null)(o),f=e.length>0&&h.createElement("ul",{role:"list","aria-label":r.toLanguageString(Y,me[Y]),className:n.classNames("k-file-box-wrapper",{"k-file-box-wrapper-scrollable-start":c,"k-file-box-wrapper-scrollable-end":m})},h.createElement("div",{className:"k-files-scroll",role:"presentation",ref:i},e.map((e,o)=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem",tabIndex:0===o?0:-1,"aria-label":[e.name,ze(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(Pe(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},ze(e.size))),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:n=>{n.stopPropagation(),t(e.name)},"aria-label":`${r.toLanguageString(W,me[W])} ${e.name}`,title:`${r.toLanguageString(W,me[W])} ${e.name}`})))));return h.createElement("div",{className:"k-prompt-box-header"},g,f)},qe=(e,t,n,a)=>{var l;const{text:o,"aria-label":s}=null!=e?e:{text:void 0,"aria-label":void 0},r=t||null!=o?o:a.toLanguageString(V,me[V]),i=""!==r?r:void 0;return{text:i,"aria-label":null!=(l=null!=s?s:t?void 0:i)?l:n}},Ke=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"17.0.0-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"}),He="k-prompt-box",Ue={mode:"auto",rows:1,defaultValue:"",disabled:!1,readOnly:!1,loading:!1,uploadButtonConfig:!1,speechToTextButtonConfig:!0,actionButtonConfig:!0},$e=h.forwardRef((e,t)=>{const a=!n.validatePackage(Ke,{component:"PromptBox"}),o=n.getLicenseMessage(Ke),r=s.useLocalization(),i={...Ue,...e},{mode:c=Ue.mode,fillMode:u,rows:m=Ue.rows,maxTextAreaHeight:d,value:p,defaultValue:g=Ue.defaultValue,disabled:f=Ue.disabled,readOnly:v=Ue.readOnly,placeholder:k,title:b,maxLength:E,inputAttributes:y,topAffix:C,startAffix:x,endAffix:I,header:T,onChange:N,onFocus:w,onBlur:F,onPromptAction:S,attachments:R,loading:A=Ue.loading,uploadButtonConfig:M=Ue.uploadButtonConfig,speechToTextButtonConfig:L=Ue.speechToTextButtonConfig,actionButtonConfig:B=Ue.actionButtonConfig,className:D,style:P,...z}=i,O=h.useRef(null),[q,K]=h.useState(g),[H,V]=h.useState([]),[W,_]=h.useState(!1),Y=h.useRef(null),J=h.useRef(null),X=h.useRef(0),Q=h.useRef(0),Z=h.useRef(!1),ee=h.useRef(0),te=h.useRef(0),ne=h.useCallback((e,t)=>e?"function"==typeof e?e(t):e:null,[]),ae=void 0!==p,le=ae?p:q,oe=void 0!==R,se=oe?R:H,re=h.useMemo(()=>!!(null!=le&&le.trim()||se.length>0),[le,se.length]),ie=h.useCallback(()=>{if(!O.current||"single"===c)return;const e=O.current,t=globalThis.getComputedStyle(e),n=Number.parseFloat(t.lineHeight)||20,a=Number.parseFloat(t.paddingTop)||0,l=Number.parseFloat(t.paddingBottom)||0;X.current=e.offsetHeight||n+a+l,Q.current=n*m+a+l,"auto"===c&&!W&&(te.current=e.offsetWidth)},[c,m,W]),ce=h.useCallback(()=>"auto"===c?1:m,[c,m]),ue=h.useCallback(e=>{if(d){const t=Number.parseInt(d,10);if(e>t)return t}return Math.max(Q.current,e)},[d]),de=h.useCallback(e=>{e.style.overflow="hidden",e.style.height=`${X.current}px`;const t=e.scrollHeight,n=ue(t);e.style.height=`${n}px`,d&&t>Number.parseInt(d,10)&&(e.style.overflow="")},[ue,d]),pe=h.useCallback(e=>{e.style.overflow="hidden",e.style.height=`${X.current}px`;const t=e.scrollHeight,n=d?Math.min(t,Number.parseInt(d,10)):t;e.style.height=`${n}px`,d&&t>Number.parseInt(d,10)&&(e.style.overflow="")},[d]),ge=h.useCallback(e=>{if(te.current<=0)return!1;const t=e.style.height,n=e.style.width;e.style.overflow="hidden",e.style.width=`${te.current}px`,e.style.height=`${X.current}px`;const a=e.scrollWidth<=te.current&&e.scrollHeight<=X.current;return e.style.overflow="",e.style.width=n||"",e.style.height=t||"",a},[]),fe=h.useCallback((e,t)=>{if(!Z.current){if((e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&!W)return Z.current=!0,void _(!0);if(W){pe(e);t<ee.current&&ge(e)&&(e.style.height="",Z.current=!0,_(!1))}}},[W,pe,ge]),he=h.useCallback(()=>{var e;if("single"===c||!O.current)return;const t=O.current,n=(null==(e=t.value)?void 0:e.length)||0;"multi"===c?de(t):"auto"===c&&fe(t,n)},[c,de,fe]);h.useEffect(()=>{"single"!==c&&O.current&&ie()},[c,ie]),h.useEffect(()=>{"single"!==c&&O.current&&(ie(),he())},[m,c,ie,he]),h.useEffect(()=>{if("single"!==c&&O.current){const e=(null==le?void 0:le.length)||0;requestAnimationFrame(()=>{if(O.current){const t=O.current;"multi"===c?de(t):"auto"===c&&fe(t,e),ee.current=e}})}},[le,c,de,fe]),h.useEffect(()=>{"auto"===c&&W&&O.current&&requestAnimationFrame(()=>{if(O.current){const e=O.current;pe(e),Z.current=!1}})},[W,c,pe]),h.useEffect(()=>{if("auto"===c&&O.current){const e=O.current;W||(e.style.height="",e.style.overflow="",Z.current=!1)}},[c,W]),h.useEffect(()=>{if("single"===c||!O.current)return;const e=O.current;let t;const n=new ResizeObserver(()=>{clearTimeout(t),t=setTimeout(()=>{O.current&&("auto"===c&&!W&&ie(),he())},50)});return n.observe(e),()=>{n.disconnect(),clearTimeout(t)}},[c,W,ie,he]);const ve=h.useCallback(()=>({focus:()=>{var e;return null==(e=O.current)?void 0:e.focus()},blur:()=>{var e;return null==(e=O.current)?void 0:e.blur()},element:O.current,get value(){return le}}),[le]);h.useImperativeHandle(t,ve);const ke=h.useCallback(e=>{const t=e.target.value;!ae&&!f&&K(t),N&&!f&&n.dispatchEvent(N,e,{...ve(),value:t},{value:t}),"single"!==c&&he()},[K,N,f,ae,ve,c,he]),be=h.useCallback(e=>{w&&!f&&n.dispatchEvent(w,e,ve(),void 0)},[w,f,ve]),Ee=h.useCallback(e=>{F&&!f&&n.dispatchEvent(F,e,ve(),void 0)},[F,f,ve]),ye=h.useCallback(e=>{e.preventDefault()},[]),Ce=h.useCallback(e=>{S&&n.dispatchEvent(S,e,ve(),{value:le,attachments:se}),ae||K(""),oe||V([])},[S,ve,le,se,ae,oe]),xe=h.useCallback(e=>{if("Enter"!==e.key||!e.shiftKey){if("ArrowUp"===e.key||"ArrowDown"===e.key)return void e.stopPropagation();if("Enter"===e.key){if(e.preventDefault(),A)return;re&&Ce(e)}}},[Ce,A,re]),Ie={disabled:f,readOnly:v,placeholder:k,title:b,maxLength:E,"aria-label":r.toLanguageString(U,me[U]),value:le,onKeyDown:xe,...y,onChange:ke,onFocus:be,onBlur:Ee,ref:O},Te=h.useCallback(e=>{var t,a;const{isFinal:l,alternatives:o}=e;if(o.length>0){const e=o[0];if(l){const a=(null==(t=O.current)?void 0:t.value)||"",l=(a?`${a} `:"")+e.transcript;if(ae||K(l),N&&!f){const e={target:O.current,currentTarget:O.current};n.dispatchEvent(N,e,{...ve(),value:l},{value:l})}}}null==(a=O.current)||a.focus()},[ae,N,f,ve]),Ne=h.useCallback(()=>{var e,t;null==(t=null==(e=Y.current)?void 0:e.actionElement)||t.click()},[]),we=h.useCallback(e=>{var t;const n=Array.from(e.affectedFiles),a="object"==typeof M&&M.onSelectAttachments;oe||V(e=>[...e,...n]),a&&a({selectedFiles:e.affectedFiles,allFiles:e.newState}),null==(t=O.current)||t.focus()},[M,oe]),Fe=h.useMemo(()=>({uploadButtonProps:{fillMode:"flat",svgIcon:l.paperclipIcon,size:"small",rounded:"full",onClick:Ne,onFilesAdd:we,files:se,uploadRef:Y,"aria-label":r.toLanguageString(j,me[j]),title:r.toLanguageString(j,me[j]),_registerRemoveCallback:e=>{J.current=e}},speechToTextButtonProps:{fillMode:"flat",size:"small",rounded:"full",onResult:Te},actionButtonProps:{rounded:"full",size:"small",svgIcon:A?l.stopIcon:l.arrowUpIcon,className:A?"k-generating k-active":"",onClick:Ce,onMouseDown:ye,disabled:!A&&!re,"aria-label":A?r.toLanguageString(G,me[G]):r.toLanguageString($,me[$]),title:A?r.toLanguageString(G,me[G]):r.toLanguageString($,me[$]),"aria-live":"polite"}}),[Te,we,se,Ce,ye,A,Ne,r,re]),Se=h.useCallback(e=>{oe||V(t=>t.filter(t=>t.name!==e));const t="object"==typeof M&&M.onRemoveAttachment;t&&(J.current=t),J.current&&J.current(e)},[M,oe]),Re=()=>{const e=!1!==L,t=!1!==B,n=!1!==M,a="object"==typeof L?L:void 0,l="object"==typeof M?M:{},{restrictions:o,multiple:s=!0,accept:i,onSelectAttachments:c,onRemoveAttachment:u,...m}=l,d={restrictions:o,multiple:s,accept:i},p="object"==typeof B?B:void 0,g=qe(p,A,Fe.actionButtonProps["aria-label"],r),f={...p,...g};return h.createElement(h.Fragment,null,n&&h.createElement(Le,{...Fe.uploadButtonProps,restrictions:d.restrictions,multiple:d.multiple,accept:d.accept,...m}),e&&h.createElement(De,{...Fe.speechToTextButtonProps,...a}),t&&h.createElement(Be,{...Fe.actionButtonProps,...f}))},Ae="multi"===c||"auto"===c&&W,Me=!1!==M||!1!==L||!1!==B,Pe=I||Me,ze=x||I||Me;return h.createElement("div",{...z,className:n.classNames(D,"k-input",He,{[`k-input-${u}`]:u,"k-disabled":f,"k-prompt-box-singleline":"single"===c,"k-prompt-box-multiline":Ae}),style:P},h.createElement(Oe,{files:se,onRemoveFile:Se,header:T}),"single"===c?h.createElement("div",{className:`${He}-content`},x&&h.createElement("div",{className:`${He}-affix`},ne(x,Fe)),h.createElement("input",{...Ie,className:n.classNames("k-input-inner",`${He}-input`)}),Pe?h.createElement("div",{className:`${He}-affix`},I&&ne(I,Fe),Re()):null):h.createElement("div",{className:`${He}-content`},"multi"===c&&C&&h.createElement("div",{className:`${He}-affix`},ne(C,Fe)),"auto"===c&&!W&&x&&h.createElement("div",{className:`${He}-affix`},ne(x,Fe)),h.createElement("textarea",{...Ie,className:n.classNames("k-input-inner",`${He}-textarea`),rows:ce(),style:d?{maxHeight:d}:{},"aria-multiline":"true"}),"auto"===c&&!W&&Pe?h.createElement("div",{className:`${He}-affix`},I&&ne(I,Fe),Re()):null,Ae&&ze?h.createElement("div",{className:`${He}-affix`},x&&ne(x,Fe),(x||I)&&h.createElement("div",{className:"k-spacer"}),I&&ne(I,Fe),Re()):null),a&&h.createElement(n.WatermarkOverlay,{message:o}))});$e.propTypes={value:r.string,defaultValue:r.string,mode:r.oneOf(["single","multi","auto"]),rows:r.number,maxTextAreaHeight:r.string,title:r.string,disabled:r.bool,readOnly:r.bool,placeholder:r.string,maxLength:r.number,inputAttributes:r.object,fillMode:r.oneOf(["solid","flat","outline"]),topAffix:r.oneOfType([r.func,r.element,r.string]),startAffix:r.oneOfType([r.func,r.element,r.string]),endAffix:r.oneOfType([r.func,r.element,r.string]),header:r.oneOfType([r.func,r.element,r.string]),onChange:r.func,onFocus:r.func,onBlur:r.func,loading:r.bool,uploadButtonConfig:r.oneOfType([r.bool,r.object]),speechToTextButtonConfig:r.oneOfType([r.bool,r.object]),actionButtonConfig:r.oneOfType([r.bool,r.object]),attachments:r.array,onPromptAction:r.func,className:r.string,style:r.object},$e.displayName="KendoPromptBox";const Ve=h.memo(({affixProps:e,uploadConfig:t,localizationService:n,onFilesSelect:a,onFileRemove:l})=>{const o="object"==typeof t?t:{};return!1!==t?h.createElement(Le,{...e.uploadButtonProps,fillMode:"clear","aria-label":n.toLanguageString(B,me[B]),title:n.toLanguageString(B,me[B]),...o,onSelectAttachments:a,onRemoveAttachment:l}):null});Ve.displayName="UploadButtonAffix";const je=h.forwardRef((e,t)=>{const{onSendMessage:o,isDirectionRightToLeft:r,placeholder:i,MessageBox:c,suggestions:u,onSuggestionClick:m,inputValue:d,onInputValueChange:p,suggestionTemplate:g,sendButtonConfig:f,onInputClick:k,suggestionsLayout:E,dir:y,messageBoxSettings:C,loading:x}=e,{replyToMessage:I,setReplyToMessage:T,user:N,speechToTextConfig:w,uploadConfig:F}=ke(),[R,A]=h.useState(""),[M,L]=h.useState([]),B=h.useRef(null),D=s.useLocalization(),P=void 0!==d,z=P?d:R,O=h.useCallback(()=>{null!==B.current&&B.current.focus()},[]);h.useEffect(()=>{I&&O()},[I,O]);const q=h.useCallback(e=>{if(e.preventDefault(),o){const t={id:"",author:N,text:z||"",timestamp:new Date,replyToId:I?I.id:void 0,files:M.map(e=>({name:e.name,size:e.size,type:e.extension,rawFile:e.getRawFile?e.getRawFile():e}))};T(null),o(t,e),L([]),P||A(""),p&&p(""),O()}},[o,z,N,I,M,T,p,O,P]);h.useImperativeHandle(t,()=>({focusInput:O}),[O]);const K=h.useCallback(e=>{L(t=>t.filter(t=>t.name!==e))},[]),U=h.useCallback((e,t)=>e.isDeleted?pe(t,D):e.text,[D]),$=h.useCallback(()=>{if(I){const e=de(N,I);return h.createElement("div",{className:n.classNames("k-message-reference",e?"k-message-reference-sender":"k-message-reference-receiver")},h.createElement("div",{className:"k-message-reference-content"},U(I,e)),h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:()=>T(null),"aria-label":D.toLanguageString(S,me[S]),title:D.toLanguageString(S,me[S])}))}return null},[I,N,U,T,D]),V=h.useCallback(e=>{try{const t=Array.from(e.allFiles);L(t)}catch{}},[]),j=h.useCallback(e=>{const t=e.value;P||A(t),p&&p(t||"")},[P,p]),W=h.useCallback(e=>{q(e.syntheticEvent)},[q]),G=h.useCallback(e=>e?"function"==typeof e?e():e:null,[]),_=h.useCallback(e=>h.createElement(h.Fragment,null,h.createElement(Ve,{affixProps:e,uploadConfig:F,localizationService:D,onFilesSelect:V,onFileRemove:K}),G(null==C?void 0:C.startAffix)),[F,D,V,K,null==C?void 0:C.startAffix,G]),Y=h.useCallback(()=>G(null==C?void 0:C.endAffix),[null==C?void 0:C.endAffix,G]),J=h.useCallback(()=>G(null==C?void 0:C.topAffix),[null==C?void 0:C.topAffix,G]),X=h.useMemo(()=>{const e="object"==typeof f?f:{},t=!1!==f&&{"aria-label":x?D.toLanguageString(H,me[H]):D.toLanguageString(v,me[v]),title:x?D.toLanguageString(H,me[H]):D.toLanguageString(v,me[v]),dir:r?"rtl":void 0,...e};return h.createElement($e,{header:$(),ref:B,placeholder:i,value:z,onChange:j,onPromptAction:W,mode:(null==C?void 0:C.mode)||"multi",rows:(null==C?void 0:C.rows)||2,maxTextAreaHeight:(null==C?void 0:C.maxTextAreaHeight)||"110",loading:x,speechToTextButtonConfig:w,actionButtonConfig:t,attachments:M,startAffix:_,endAffix:null!=C&&C.endAffix?Y:void 0,topAffix:null!=C&&C.topAffix?J:void 0,inputAttributes:{onClick:k,"aria-label":D.toLanguageString(b,me[b])}})},[i,z,j,W,C,x,w,f,M,$,_,Y,J,D,r,k]);return h.createElement("div",{className:"k-message-box-wrapper"},u&&u.length>0&&h.createElement(Me,{onSuggestionClick:m,suggestions:u,suggestionTemplate:g,suggestionsLayout:E,dir:y}),c?h.createElement(c,{messageInput:X}):X)});je.displayName="NewMessage";const We=e=>h.createElement(a.Toolbar,{className:"k-chat-header",size:"small"},e.children),Ge=e=>{const{message:t,onUnpin:o,user:r,onReferencedMessageClick:i}=e,c=s.useLocalization(),u=h.useRef(null),m=r&&de(r,t),d=h.useCallback(e=>{e.preventDefault(),e.stopPropagation(),null==i||i(t.id)},[t.id,i]);return h.createElement("div",{ref:u,className:`k-message-reference ${m?"k-message-reference-sender":"k-message-reference-receiver"} k-message-pinned`,onClick:d},h.createElement(n.IconWrap,{icon:l.pinIcon}),h.createElement("div",{className:"k-message-reference-content"},t.isDeleted?r&&pe(de(r,t),c):t.text),h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:e=>{e.stopPropagation(),null==o||o(t)},"aria-label":c.toLanguageString("chat.unpinMessage",me["chat.unpinMessage"])}))},_e=e=>{const{show:t,text:n}=e;return h.createElement("div",{style:{position:"absolute",top:"90%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,pointerEvents:t?"auto":"none"}},h.createElement(c.Fade,null,t&&h.createElement(u.Notification,{type:{style:"inverse"},closable:!1},h.createElement("span",null,n))))},Ye={textField:"text",statusField:"status",authorIdField:"authorId",authorNameField:"authorName",authorImageUrlField:"authorImageUrl",authorImageAltTextField:"authorImageAltText",idField:"id",timestampField:"timestamp",filesField:"files",attachmentsField:"attachments",replyToIdField:"replyToId",isDeletedField:"isDeleted",isPinnedField:"isPinned",typingField:"typing",suggestedActionsField:"suggestedActions",isFailedField:"isFailed"},Je=(e,t={})=>{const n={...Ye,...t};let a,l;a=e.author&&"object"==typeof e.author?{id:e.author.id||e.author[n.authorIdField]||e[n.authorIdField]||"",name:e.author.name||e.author[n.authorNameField]||e[n.authorNameField],avatarUrl:e.author.avatarUrl||e.author[n.authorImageUrlField]||e[n.authorImageUrlField],avatarAltText:e.author.avatarAltText||e.author[n.authorImageAltTextField]||e[n.authorImageAltTextField]}:{id:e[n.authorIdField]||e.authorId||"",name:e[n.authorNameField]||e.authorName,avatarUrl:e[n.authorImageUrlField]||e.authorImageUrl,avatarAltText:e[n.authorImageAltTextField]||e.authorImageAltText},l=e.timestamp?new Date(e.timestamp):e[n.timestampField]?new Date(e[n.timestampField]):new Date;const o={id:void 0!==e.id?e.id:e[n.idField],text:void 0!==e.text?e.text:e[n.textField]||"",author:a,timestamp:l,status:void 0!==e.status?e.status:e[n.statusField],attachments:void 0!==e.attachments?e.attachments:e[n.attachmentsField],attachmentLayout:e.attachmentLayout||"list",suggestedActions:void 0!==e.suggestedActions?e.suggestedActions:e[n.suggestedActionsField],isPinned:void 0!==e.isPinned?e.isPinned:e[n.isPinnedField]||!1,typing:void 0!==e.typing?e.typing:e[n.typingField],files:void 0!==e.files?e.files:e[n.filesField]||[],isFailed:void 0!==e.isFailed?e.isFailed:e[n.isFailedField]||!1};return e.pinnedAt&&(o.pinnedAt=new Date(e.pinnedAt)),e.pinnedBy&&(o.pinnedBy=e.pinnedBy),void 0!==e.replyToId?o.replyToId=e.replyToId:void 0!==e[n.replyToIdField]&&(o.replyToId=e[n.replyToIdField]),void 0!==e.isDeleted?o.isDeleted=e.isDeleted:void 0!==e[n.isDeletedField]&&(o.isDeleted=e[n.isDeletedField]),{...o,dataItem:e}},Xe=(e,t={})=>Array.isArray(e)?e.map(e=>Je(e,t)):[],Qe=e=>e&&void 0!==e.id&&"string"==typeof e.text&&e.author&&"object"==typeof e.author&&void 0!==e.author.id&&(e.timestamp instanceof Date||"string"==typeof e.timestamp||"number"==typeof e.timestamp),Ze=e=>{e.scrollTop=e.scrollHeight-e.clientHeight},et=({viewItemsWrapperRef:e,isKeyboardNavigationActiveRef:t,processedMessages:n,authorId:a,autoScrollThreshold:l,isEndless:o=!1,isOnLastBatch:s=!0,skipAutoScrollRef:r})=>{var i;const c=h.useRef(a),u=h.useRef(l),m=h.useRef(o),d=h.useRef(s);h.useEffect(()=>{c.current=a,u.current=l,m.current=o,d.current=s});const p=h.useRef(!1);h.useEffect(()=>{o||!e.current||0===n.length||p.current||(Ze(e.current),p.current=!0)},[e,o,n.length]);const g=h.useRef(void 0),f=h.useRef(0),v=h.useRef(!0),k=h.useRef(!0),b=h.useRef(!1),E=h.useRef(null),y=(n.length>0?null==(i=n.at(-1))?void 0:i.id:void 0)!==g.current,C=n.length>f.current;if(y||C){const t=e.current;k.current=!t||(e=>{const{scrollHeight:t,scrollTop:n,clientHeight:a}=e;return!(t>a)||t-n-a<=100})(t)}h.useEffect(()=>{var a,l;const o=n.length,s=o>0?null==(a=n[o-1])?void 0:a.id:void 0,i=g.current,p=f.current,h=v.current;if(g.current=s,f.current=o,v.current=!1,0===o)return;const y=e.current;if(!y||t.current)return;if(h||s===i)return void(!m.current&&(h||o>p)&&(Ze(y),b.current=!1,E.current=null));if(m.current&&!d.current)return;if(null!=r&&r.current)return void(r.current=!1);const C=n[o-1];if(void 0!==c.current&&void 0!==(null==(l=null==C?void 0:C.author)?void 0:l.id)&&String(C.author.id)===String(c.current))return y.scrollTo({top:y.scrollHeight-y.clientHeight,behavior:"smooth"}),b.current=!1,void(E.current=null);if(!k.current)return b.current=!1,void(E.current=null);const x=(e=>{const t=e.querySelectorAll(".k-message");return t.length>0?t[t.length-1]:null})(y);if(!x)return;const I=(e=>{const t=e.querySelector(".k-message-pinned");return t?t.offsetHeight:0})(y),T=Math.max(0,y.clientHeight-I),N=((e,t)=>{const n=null!=e?e:"20%";let a;if("number"==typeof n)a=n;else{const e=/^(-?\d+(?:\.\d+)?)%$/.exec(String(n));if(e)a=Number.parseFloat(e[1])/100*t;else{const e=Number.parseFloat(String(n));a=Number.isNaN(e)?.2*t:e}}return Math.min(a,t)})(u.current,T),w=x.getBoundingClientRect().top-y.getBoundingClientRect().top+y.scrollTop,F=Math.max(0,w-N-I),S=Math.max(0,y.scrollHeight-y.clientHeight),R=Math.min(F,S);R>y.scrollTop&&y.scrollTo({top:R,behavior:"smooth"}),E.current=F,b.current=!0},[n,e,t]),h.useEffect(()=>{const n=e.current;if(!n)return;let a=n.querySelectorAll(".k-message").length,l=n.scrollHeight,o=n.scrollTop;const s=()=>{const e=n.scrollTop;b.current&&e<o&&(b.current=!1,E.current=null),o=e},r=new MutationObserver(()=>{if(t.current)return;const e=n.querySelectorAll(".k-message").length,s=n.scrollHeight;if(e===a&&s>l&&b.current){const e=s-n.clientHeight,t=E.current,a=null===t?e:Math.min(e,t);a>n.scrollTop&&(n.scrollTop=a),o=n.scrollTop}a=e,l=s});return r.observe(n,{childList:!0,subtree:!0,characterData:!0}),n.addEventListener("scroll",s,{passive:!0}),()=>{r.disconnect(),n.removeEventListener("scroll",s)}},[e,t])},tt=["allowMessageCollapse","messageWidthMode","showAvatar","showUsername","messageTemplate","messageContentTemplate","messageToolbarActions","messageContextMenuActions","fileActions"];function nt(e,t,n,a,l){const o=((e,t)=>{var n,a;return(null==(n=null==e?void 0:e.author)?void 0:n.id)===t||(null==(a=null==e?void 0:e.author)?void 0:a.id)===String(t)})(e,t)?a:l,s={};return tt.forEach(e=>{var t;s[e]=null!=(t=null==o?void 0:o[e])?t:null==n?void 0:n[e]}),s}const at=({scrollMode:e,processedMessages:t,total:n,pageSize:a=50,startIndex:l,endIndex:o,onLoadMoreMessages:s,onReferencedMessageClick:r,viewItemsWrapperRef:i,authorId:c})=>{const u=h.useRef(!1),m="endless"===e,d=null!=n?n:t.length,p=m&&t.length===d&&!u.current,g=m&&(t.length<d||u.current);g&&(u.current=!0);const[f,v]=h.useState(-1),[k,b]=h.useState(-1),E=h.useRef(f),y=h.useRef(k);E.current=f,y.current=k;const C=h.useRef(!1),x=h.useRef(0),I=h.useRef(0),T=h.useRef(0),N=h.useRef(!1),w=h.useRef(d),F=h.useRef(c);F.current=c;const S=h.useRef(!1),R=h.useRef(null),A=h.useRef(!1),M=h.useRef(!1),L=h.useRef(!0),B=h.useRef(d);h.useEffect(()=>{if(p){if(u.current)return void((-1===f||-1===k)&&(v(0),b(t.length)));if(-1===f||-1===k){const e=Math.max(0,t.length-a),n=t.length;v(e),b(n)}else if(k<t.length){const e=w.current;if(y.current>=e)b(t.length);else if(t.length>e&&t.slice(e).some(e=>{var t;return void 0!==(null==(t=e.author)?void 0:t.id)&&String(e.author.id)===String(F.current)})){const e=Math.max(0,t.length-a);v(e),b(t.length),A.current=!0}}w.current=d}},[p,t.length,a,f,k,d]);const D=null!=l?l:0,P=null!=o?o:t.length,z=h.useCallback(()=>{const e=i.current;e&&(x.current=e.scrollHeight,I.current=e.scrollTop,T.current=e.querySelectorAll("[data-message-id]").length)},[i]),O=h.useCallback(e=>{var t,n,a;((e,t,n=0)=>{if(!t)return;const a=t.querySelector(`[data-message-id="${e}"]`);if(!a)return;const l=t.querySelector(".k-message-list");if(l){const e=l.getBoundingClientRect().top,t=a.getBoundingClientRect().top,o=l.scrollTop+(t-e)-n;l.scrollTo({top:o,behavior:"smooth"})}else a.scrollIntoView({behavior:"smooth",block:"start"})})(e,null==(t=i.current)?void 0:t.closest(".k-chat"),(null==(a=null==(n=i.current)?void 0:n.querySelector(".k-message-pinned"))?void 0:a.offsetHeight)||0)},[i]);h.useLayoutEffect(()=>{if(!N.current)return;const e=i.current;if(!e)return void(N.current=!1);if(e.querySelectorAll("[data-message-id]").length<=T.current)return;const t=e.scrollHeight-x.current;t>0&&(e.scrollTop=I.current+t),N.current=!1,C.current=!1}),h.useLayoutEffect(()=>{if(!A.current)return;const e=i.current;e?k>=t.length&&k>0&&(A.current=!1,e.scrollTop=e.scrollHeight-e.clientHeight):A.current=!1});const q=h.useRef(!1);h.useLayoutEffect(()=>{if(!m||q.current)return;const e=i.current;e&&e.querySelector("[data-message-id]")&&(e.scrollTop=e.scrollHeight-e.clientHeight,q.current=!0)}),h.useEffect(()=>{if(!m)return;const e=i.current;if(!e)return;let n=e.scrollTop;const l=()=>{const{scrollTop:l,scrollHeight:o,clientHeight:r}=e,i=l<n,c=l>n;if(n=l,!C.current){if(i&&l<=100)if(p){const e=E.current;if(e>0){const t=Math.max(0,e-a);N.current=!0,z(),v(t),null==s||s({startIndex:t,endIndex:y.current})}}else if(g&&D>0){C.current=!0;const e=Math.max(0,D-a);N.current=!0,z(),null==s||s({startIndex:e,endIndex:P})}if(c&&o-l-r<=100)if(p){const e=y.current;if(e<t.length){const n=Math.min(t.length,e+a);M.current=!0,b(n),null==s||s({startIndex:E.current,endIndex:n})}}else if(g&&P<d){C.current=!0,M.current=!0;const e=Math.min(d,P+a);null==s||s({startIndex:D,endIndex:e})}}};return e.addEventListener("scroll",l,{passive:!0}),()=>e.removeEventListener("scroll",l)},[m,p,g,i,a,t.length,D,P,d,s]),h.useEffect(()=>{var e;const n=P>=d;if(!g)return B.current=d,void(L.current=n);const a=B.current,l=L.current;if(B.current=d,L.current=n,d>a&&!l&&n){const n=t[t.length-1];void 0!==F.current&&void 0!==(null==(e=null==n?void 0:n.author)?void 0:e.id)&&String(n.author.id)===String(F.current)&&(S.current=!0,M.current=!0)}},[g,d,P,t]),h.useEffect(()=>{!g||!S.current||(S.current=!1,C.current=!1,requestAnimationFrame(()=>{const e=i.current;e&&(e.scrollTop=e.scrollHeight-e.clientHeight)}))},[g,t,i]),h.useEffect(()=>{if(!g||null===R.current)return;const e=R.current,t=i.current;t&&t.querySelector(`[data-message-id="${e}"]`)&&(R.current=null,C.current=!1,requestAnimationFrame(()=>{O(e)}))},[g,t,i,O]),h.useEffect(()=>{g&&C.current&&!N.current&&(C.current=!1)},[g,D,P]);const K=h.useMemo(()=>{if(p){const e=Math.max(0,f),n=Math.min(t.length,k);if(e>=n){const e=Math.max(0,t.length-a);return t.slice(e)}return t.slice(e,n)}return t},[p,t,f,k,a]),H=h.useMemo(()=>!m||(p?k>=t.length:P>=d),[m,p,k,t.length,P,d]),U=h.useCallback(()=>{if(!m||H){const e=i.current;return void(e&&e.scrollTo({top:e.scrollHeight-e.clientHeight,behavior:"smooth"}))}if(!C.current)if(p){const e=Math.max(0,t.length-a);v(e),b(t.length),null==s||s({startIndex:e,endIndex:t.length}),requestAnimationFrame(()=>{const e=i.current;e&&(e.scrollTop=e.scrollHeight-e.clientHeight)})}else if(g){S.current=!0,N.current=!1,C.current=!0;const e=Math.max(0,d-a);null==s||s({startIndex:e,endIndex:d})}},[m,p,g,H,t.length,a,d,s,i]),$=h.useCallback(e=>{if(m){if(p){const n=i.current;if(null==n?void 0:n.querySelector(`[data-message-id="${e}"]`))O(e);else{if(C.current)return;const n=t.findIndex(t=>t.id===e||String(t.id)===String(e));if(n>=0){const l=Math.floor(a/2),o=Math.max(0,n-l),s=Math.min(t.length,o+a);C.current=!0,v(o),b(s),requestAnimationFrame(()=>{requestAnimationFrame(()=>{O(e),C.current=!1})})}}}else if(g){const t=i.current;if(null==t?void 0:t.querySelector(`[data-message-id="${e}"]`))O(e);else{if(C.current)return;R.current=e,N.current=!1,C.current=!0}}}else O(e);null==r||r({id:e})},[m,p,g,i,t,a,r,O]);return{renderedMessages:K,handleScrollToBottom:U,handleReferencedMessageClick:$,isEndless:m,isOnLastBatch:H,skipAutoScrollRef:M}},lt=h.forwardRef((e,t)=>{const{messages:o=[],messageTemplate:r,messageContentTemplate:i,attachmentTemplate:c,width:u,height:m,onSendMessage:d,onSuggestionClick:p,onInputValueChange:g,onActionExecute:f,dir:v,messageBox:k,placeholder:b,className:E,style:C,message:x=Ee,authorId:I,suggestions:T,suggestionTemplate:N,suggestionsLayout:F="scroll",quickActionsLayout:S="scroll",inputValue:R,headerTemplate:A,noDataTemplate:M,timestampTemplate:L,statusTemplate:B,userStatusTemplate:D,allowMessageCollapse:P,messageToolbarActions:z,messageContextMenuActions:q,fileActions:K,onUnpin:H,messageWidthMode:U,showAvatar:$,showUsername:V,timestampVisibility:j,authorMessageSettings:W,receiverMessageSettings:G,onToolbarAction:_,onContextMenuAction:Y,onFileAction:J,onDownload:X,speechToTextConfig:Q,uploadConfig:Z,sendButtonConfig:ee,messageFilesLayout:te,scrollToBottomButton:ne=!0,autoScrollThreshold:ae,textField:le,statusField:oe,authorIdField:se,authorNameField:re,authorImageUrlField:ie,authorImageAltTextField:ce,idField:ue,timestampField:de,filesField:pe,attachmentsField:ge,replyToIdField:fe,isDeletedField:he,isPinnedField:ke,typingField:be,suggestedActionsField:ye,isFailedField:xe,onResendMessage:Ie,messageBoxSettings:Te,loading:Ne,scrollMode:Fe,total:Me,pageSize:Le,startIndex:Be,endIndex:De,onLoadMoreMessages:Pe,pinnedMessages:ze,repliedToMessages:Oe,onReferencedMessageClick:qe,...He}=e,Ue=h.useRef(null);n.useWebMcpRegister("chat",Ue,e,e.webMcp);const[$e,Ve]=h.useState(null),[Ye,Je]=h.useState(!1),[Ze,tt]=h.useState(!1),[lt,ot]=h.useState(null),[st,rt]=h.useState(null),[it,ct]=h.useState(!1),ut=h.useRef(null),mt=h.useRef(null),dt=h.useRef(null),pt=h.useRef(null),gt=h.useRef(void 0),ft=h.useRef(!1),ht=h.useRef(null),vt=h.useRef(""),kt=h.useMemo(()=>{if(!o||0===o.length)return[];const e={textField:le,statusField:oe,authorIdField:se,authorNameField:re,authorImageUrlField:ie,authorImageAltTextField:ce,idField:ue,timestampField:de,filesField:pe,attachmentsField:ge,replyToIdField:fe,isDeletedField:he,isPinnedField:ke,typingField:be,suggestedActionsField:ye,isFailedField:xe};return!Object.values(e).some(e=>void 0!==e)&&Qe(o[0])?o.map(e=>({...e,timestamp:e.timestamp?new Date(e.timestamp):e.timestamp})):Xe(o,e)},[o,le,oe,se,re,ie,ce,ue,de,pe,ge,fe,he,ke,be,ye,xe]);h.useEffect(()=>{if(I===vt.current&&ht.current)rt(ht.current);else if(I&&kt.length>0){const e=kt.find(e=>e.author&&(e.author.id===I||e.author.id===String(I))),t=(null==e?void 0:e.author)||{id:I};ht.current=t,vt.current=I,rt(t)}},[I,kt]);const{renderedMessages:bt,handleScrollToBottom:Et,handleReferencedMessageClick:yt,isEndless:Ct,isOnLastBatch:xt,skipAutoScrollRef:It}=at({scrollMode:Fe,processedMessages:kt,total:Me,pageSize:Le,startIndex:Be,endIndex:De,onLoadMoreMessages:Pe,onReferencedMessageClick:qe,viewItemsWrapperRef:dt,authorId:I}),Tt=h.useMemo(()=>bt.length>0?(e=>{const t=e.slice().reduce(Ce(e.length),[]);return function(e){let t=0;e.forEach(e=>{"message-group"===e.type?e.messages.forEach(e=>{e.selectionIndex=t++}):("attachment-group"===e.type||"action-group"===e.type)&&(e.selectionIndex=t++)}),e.lastSelectionIndex=t-1}(t),t})(bt):[],[bt]),Nt=h.useMemo(()=>!n.validatePackage(Ke,{component:"Chat"}),[]),wt=n.getLicenseMessage(Ke),Ft=h.useMemo(()=>{if(ze)return ze.find(e=>e.isPinned);const e=kt.find(e=>e.isPinned);return e||void 0},[kt,ze]),St=s.useLocalization();et({viewItemsWrapperRef:dt,isKeyboardNavigationActiveRef:ft,processedMessages:bt,authorId:I,autoScrollThreshold:ae,isEndless:Ct,isOnLastBatch:xt,skipAutoScrollRef:It});const Rt=(({elementRef:e})=>{const[t,n]=h.useState(!1);return h.useEffect(()=>{const t=e.current;if(!t)return;const a=()=>{n(t.scrollHeight>t.clientHeight)};a();const l=new ResizeObserver(a);l.observe(t);const o=new MutationObserver(()=>{requestAnimationFrame(a)});return o.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),o.disconnect()}},[e]),t})({elementRef:dt}),At=h.useCallback(()=>{clearTimeout(gt.current)},[]),Mt=h.useCallback(()=>{gt.current=window.setTimeout(()=>{Ve(null)},0)},[]),Lt=h.useCallback(e=>{Ve(e)},[]),Bt=h.useCallback(e=>{let t=null;const a=null!==$e?$e:Tt.lastSelectionIndex;e.keyCode===n.Keys.up?null===a?t=0:a>0&&(t=a-1):e.keyCode===n.Keys.down?null===a?t=0:a<Tt.lastSelectionIndex&&(t=a+1):e.keyCode===n.Keys.home?t=0:e.keyCode===n.Keys.end&&(t=Tt.lastSelectionIndex),null!==t&&(Ve(t),ft.current=!0,e.preventDefault())},[$e,Tt]),Dt=h.useCallback((e,t,a)=>{var l;if(f&&f({action:{value:e.value,title:e.title,type:e.type},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget}),!t.isDefaultPrevented()){switch(e.type){case"reply":d&&d({message:{id:"",author:st,text:e.value,timestamp:new Date},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget});break;case"call":window.open("tel:"+e.value);break;case"openUrl":{const t=n.sanitizeUrl(e.value);t&&window.open(t,"_blank","noopener,noreferrer");break}}null==(l=pt.current)||l.focusInput()}},[f,d,st]),Pt=h.useCallback(()=>n.classNames("k-chat",E,{"k-rtl":Ye}),[E,Ye]),zt=h.useCallback(()=>{const e=Tt.length-1;return Tt.map((t,n)=>{var a,l,o,s,u,m;if("date-marker"===t.type)return h.createElement(Re,{item:t,key:t.trackBy,timestampTemplate:L});if("message-group"===t.type){const o={allowMessageCollapse:P,messageWidthMode:U,showAvatar:$,showUsername:V,messageTemplate:r,messageContentTemplate:i,messageToolbarActions:z,messageContextMenuActions:q,fileActions:K},s=nt(null==(a=t.messages)?void 0:a[0],I,o,W,G);return h.createElement(Ae,{group:t,itemTemplate:s.messageTemplate,contentTemplate:s.messageContentTemplate,attachmentTemplate:c,user:st,selectedItemIndex:$e,onRequestSelection:Lt,isLastGroup:n===e,key:null!=(l=t.messages[0].id)?l:t.messages[0].selectionIndex,message:x,allowMessageCollapse:s.allowMessageCollapse,messageToolbarActions:s.messageToolbarActions,messageContextMenuActions:s.messageContextMenuActions,fileActions:s.fileActions,messageWidthMode:s.messageWidthMode,showAvatar:s.showAvatar,showUsername:s.showUsername})}return"attachment-group"===t.type?h.createElement(Se,{group:t,itemTemplate:c,onRequestSelection:Lt,selected:t.selectionIndex===$e,isLastGroup:n===e,dir:Ye?"rtl":"ltr",key:`att-${null!=(s=null==(o=t.trackBy)?void 0:o.id)?s:t.selectionIndex}`}):"action-group"===t.type?h.createElement(we,{group:t,onActionExecute:Dt,onRequestSelection:Lt,selected:t.selectionIndex===$e,key:`act-${null!=(m=null==(u=t.trackBy)?void 0:u.id)?m:t.selectionIndex}`,quickActionsLayout:S,dir:v}):null})},[Tt,L,r,i,c,st,$e,Lt,x,P,z,q,K,U,$,V,I,W,G,Dt,S,v,Ye]),Ot=h.useCallback(()=>A?"function"==typeof A?A():A:null,[A]),qt=h.useCallback(()=>M?"function"==typeof M?M():M:null,[M]);h.useEffect(()=>{const e=void 0!==v?"rtl"===v:ut.current&&"rtl"===getComputedStyle(ut.current).direction;Je(!!e)},[v]),h.useEffect(()=>()=>{clearTimeout(gt.current)},[]),h.useEffect(()=>{if(!ne||!dt.current)return;let e,t;const n=()=>{e=void 0;const n=dt.current;if(!n)return;const{scrollHeight:a,scrollTop:l,clientHeight:o}=n;!(a>o)||a-l-o<=100?(void 0!==t&&(clearTimeout(t),t=void 0),ct(!1)):null!=t||(t=setTimeout(()=>{t=void 0,ct(!0)},300))},a=()=>{void 0===e&&(e=requestAnimationFrame(n))},l=dt.current;l.addEventListener("scroll",a,{passive:!0});const o=new MutationObserver(a);return o.observe(l,{childList:!0,subtree:!0,characterData:!0}),()=>{l.removeEventListener("scroll",a),o.disconnect(),void 0!==e&&cancelAnimationFrame(e),void 0!==t&&clearTimeout(t)}},[ne]);const Kt=h.useMemo(()=>({replyToMessage:lt,setReplyToMessage:ot,messages:kt,repliedToMessages:Oe,user:st,internalScrollContainerRef:mt,messageListScrollContainerRef:dt,onToolbarAction:_,onContextMenuAction:Y,onFileAction:J,setShowCopyNotification:tt,onDownload:X,onResendMessage:Ie,fileActions:K,speechToTextConfig:Q,uploadConfig:Z,statusTemplate:B,userStatusTemplate:D,messageFilesLayout:te,timestampVisibility:j,onReferencedMessageClick:yt}),[lt,ot,kt,Oe,st,_,Y,J,tt,X,Ie,K,Q,Z,B,D,te,j,yt]);return h.createElement(ve.Provider,{value:Kt},h.createElement("div",{style:{width:u,height:m,position:"relative",overflow:"hidden",...C},onKeyDown:Bt,className:Pt(),ref:e=>{ut.current=e,mt.current=e,"function"==typeof t?t(e):t&&(t.current=e)},...He},void 0!==A&&h.createElement(We,null,Ot()),h.createElement("div",{className:"k-message-list",onBlur:Mt,onFocus:At,role:"log","aria-label":St.toLanguageString(y,me[y]),"aria-live":"polite",ref:dt,style:{scrollBehavior:"auto"}},Ft&&h.createElement(Ge,{message:Ft,onUnpin:H,user:st,onReferencedMessageClick:yt}),h.createElement("div",{className:n.classNames("k-message-list-content",{"k-message-list-content-empty":0===bt.length})},0===bt.length&&void 0!==M&&qt(),bt.length>0&&zt()),ne&&(it||!xt)&&h.createElement("div",{className:"k-chat-scroll-to-bottom-container"},h.createElement(a.FloatingActionButton,{svgIcon:l.arrowDownIcon,size:"small",themeColor:"base",rounded:"full",onClick:Et,"aria-label":St.toLanguageString(O,me[O]),title:St.toLanguageString(O,me[O])}))),Rt&&h.createElement("div",{className:"k-separator"}),h.createElement(je,{onSendMessage:(e,t)=>{d&&d({message:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},onSuggestionClick:e=>{p&&p(e)},isDirectionRightToLeft:Ye,ref:pt,placeholder:b,MessageBox:k,suggestions:T,suggestionTemplate:N,inputValue:R,onInputValueChange:e=>{g&&g(e)},onInputClick:()=>{ft.current=!1},sendButtonConfig:ee,suggestionsLayout:F,dir:v,messageBoxSettings:Te,loading:Ne}),h.createElement(_e,{show:Ze,text:St.toLanguageString(w,me[w])}),Nt&&h.createElement(n.WatermarkOverlay,{message:wt})))});lt.displayName="Chat",lt.propTypes={messages:r.arrayOf(r.object),user:r.object,messageTemplate:r.any,messageContentTemplate:r.any,attachmentTemplate:r.any,width:r.oneOfType([r.string,r.number]),style:r.object,onSendMessage:r.func,onActionExecute:r.func,dir:r.string,messageBox:r.any,noDataTemplate:r.oneOfType([r.element,r.func]),suggestionsLayout:r.oneOf(["scroll","wrap","scrollbuttons"]),quickActionsLayout:r.oneOf(["scroll","wrap","scrollbuttons"]),userStatusTemplate:r.elementType,messageFilesLayout:r.oneOf(["vertical","wrap","horizontal"]),showAvatar:r.bool,showUsername:r.bool,authorMessageSettings:r.object,receiverMessageSettings:r.object,scrollMode:r.oneOf(["scrollable","endless"]),total:r.number,pageSize:r.number,startIndex:r.number,endIndex:r.number,onLoadMoreMessages:r.func,pinnedMessages:r.arrayOf(r.object),repliedToMessages:r.arrayOf(r.object),onReferencedMessageClick:r.func};const ot=e=>{const{activeView:t,toolbarItems:n,activeViewChange:l}=e;return h.createElement("div",{className:"k-prompt-header"},h.createElement(a.Toolbar,{keyboardNavigation:!1,role:"toolbar",className:"k-toolbar-flat"},n.map(e=>h.isValidElement(e)?e:h.createElement(a.Button,{key:e.name,className:t===e.name?"k-selected":"",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>(e=>{null==l||l.call(null,e)})(e.name)},e.buttonText))))},st={name:"Output view",buttonText:"Output",buttonIcon:l.commentIcon},rt={name:"Commands view",buttonIcon:l.moreHorizontalIcon},it={name:"Prompt view",buttonText:"Ask AI",buttonIcon:l.sparklesIcon},ct=h.createContext([{},()=>{}]),ut=()=>h.useContext(ct),mt=e=>{const{children:t}=e;return h.createElement("div",{className:"k-prompt-footer"},h.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},t))},dt=h.forwardRef((e,t)=>{const{children:n,streaming:o,onCancel:r}=e,i=s.useLocalization().toLanguageString(x,me[x]),[c]=ut(),u=c.activeView===st.name,m=o&&!u,d=h.useCallback(e=>{"Escape"===e.key&&o&&r&&(e.preventDefault(),r())},[o,r]);return h.createElement("div",{className:"k-prompt-content",ref:t,onKeyDown:d},m&&h.createElement(a.FloatingActionButton,{onClick:r,svgIcon:l.stopIcon,icon:"stop",size:"medium",positionMode:"absolute",className:"k-prompt-stop-fab k-generating","aria-label":i,title:i}),h.createElement("div",{className:"k-prompt-view"},n))});dt.displayName="KendoReactAIPromptContent";const pt=e=>{const[t]=ut();return t.activeView===e.name?e.children:null},gt=e=>{const[t,n]=h.useState(!0),{children:o,title:s}=e;return h.createElement("div",{className:"k-prompt-expander"},h.createElement(a.Button,{"aria-controls":e.id,fillMode:"flat",svgIcon:t?l.chevronUpIcon:l.chevronDownIcon,title:s,onClick:()=>n(!t),"aria-expanded":t},s),t&&h.createElement("div",{id:e.id,className:"k-prompt-expander-content"},o))},ft=e=>null==e?void 0:e.map(e=>h.createElement(o.PanelBarItem,{title:e.text,key:e.id,svgIcon:e.svgIcon,data:e},e.children&&ft(e.children))),ht=({show:e=!1,anchor:t,onOpen:n,onClose:a,animate:l=!0,appendTo:o,popupOptions:s={},children:r,style:i})=>h.createElement(d.Popup,{show:e,anchor:t,style:i,animate:l,appendTo:o,onOpen:n,onClose:a,...s},r),vt=({placeholder:e="Ask or generate content with AI...",promptValue:t,onMenuClick:o,promptInput:s=m.TextArea,generateButton:r,enableSpeechToText:i=!1,streaming:c=!1,commands:u,onPromptRequest:d,onPromptCancel:p})=>{const[g,f]=h.useState(t||""),[v,k]=n.useCustomComponent(r),[b,E]=n.useCustomComponent(s),y=s===m.TextArea||b===m.TextArea,C={svgIcon:c?l.stopIcon:l.paperPlaneIcon,active:(!!c).toString(),title:"Send Button","aria-label":"Send Button",disabled:!g.trim()&&!c,"aria-disabled":!g.trim()&&!c},x={placeholder:e,className:"!k-flex-row",...y?{autoSize:!0}:{},rows:1},I=u&&u.length>0,T=Object.keys(k).length>0?k:C,N=Object.keys(E).length>0?E:x,w=e=>{const{isFinal:t,alternatives:n}=e;if(t&&n.length>0){const e=n[0].transcript,t=(()=>{const t=g,n=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(n?" ":"")+e})();f(t)}},F=()=>{g.trim()&&d&&d(g.trim())};return h.createElement(b,{value:g,onChange:e=>{const t=e.target.value;f(t)},onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),F())},prefix:I||i?h.createElement(h.Fragment,null,h.createElement(m.InputPrefix,{className:"!k-align-items-start"},I&&h.createElement(a.Button,{"aria-label":"Commands Button",title:"Commands Button",fillMode:"flat",svgIcon:l.menuIcon,onClick:o}),i&&h.createElement(a.SpeechToTextButton,{fillMode:"flat",..."object"==typeof i?{...i,onResult:i.onResult||w}:{onResult:w}})),h.createElement(m.InputSeparator,null)):void 0,suffix:h.createElement(m.InputSuffix,{className:"!k-align-items-start"},h.createElement(v,{className:n.classNames("k-prompt-send",{"k-generating":c,"k-active":c}),fillMode:"flat",onClick:c?p:F,...T})),...N})},kt=h.forwardRef((e,t)=>{const{svgIcon:a,label:o,labelClassName:s,secondaryLabel:r,linesAdded:i,linesRemoved:c,expandable:u,expanded:m,defaultExpanded:d,completed:p,onExpandedChange:g,headerTemplate:f,bodyTemplate:v,headerExtra:k,className:b,children:E,...y}=e,C=void 0!==m,[x,I]=h.useState(null!=d&&d),T=null!=m?m:x,N=h.useRef(null),w=h.useCallback(e=>{var t;if(!u)return;const n=!T;if(C||I(n),g){const a={expanded:n,syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(t=N.current)?t:e.currentTarget};g(a)}},[u,T,C,g]),F=h.createElement(h.Fragment,null,a&&h.createElement(n.SvgIcon,{icon:a,size:"small",className:"k-agent-step-icon"}),h.createElement("span",{className:"k-agent-step-content"},o&&h.createElement("span",{className:n.classNames("k-agent-step-label",!1===p&&"k-text-shimmer",s)},o),r&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-agent-step-sep"},"·"),h.createElement("span",{className:"k-agent-step-secondary"},r)),null!=i&&i>0&&h.createElement("span",{className:"k-agent-step-added k-text-success"},"+",i),null!=c&&c>0&&h.createElement("span",{className:"k-agent-step-removed k-text-error"},"-",c),k,u&&h.createElement(n.SvgIcon,{icon:T?l.chevronUpIcon:l.chevronRightIcon,size:"small",className:"k-agent-step-expand"})));let S;return S=f?h.createElement(f,{svgIcon:a,label:o,secondaryLabel:r,headerExtra:k,linesAdded:i,linesRemoved:c,completed:p,expanded:T,expandable:u}):u?h.createElement("button",{ref:N,type:"button",className:"k-agent-step-head","aria-expanded":T,onClick:w},F):h.createElement("div",{className:"k-agent-step-head"},F),h.createElement("div",{ref:t,className:n.classNames("k-agent-step",{"k-agent-completed":p},b),...y},S,T&&E&&(v?h.createElement(v,{expanded:T,completed:p},E):h.createElement("div",{className:"k-agent-step-body"},E)))});kt.displayName="KendoReactAgentStep";const bt=h.forwardRef((e,t)=>{const{svgIcon:a,label:l,labelClassName:o,secondaryLabel:s,linesAdded:r,linesRemoved:i,status:c,statusThemeColor:u,statusSvgIcon:m,completed:d,description:g,contentNode:f,className:v,children:k,...b}=e,E=!0===d,y=!E;return h.createElement("div",{className:n.classNames("k-thought",{"k-thought-completed":E},{"k-thought-active":y},v),ref:t,...b},h.createElement("span",{className:"k-agent-step-icon-col"},a&&h.createElement(n.SvgIcon,{icon:a,size:"small",className:"k-agent-step-icon"})),h.createElement("span",{className:"k-agent-step-content"},null!=f?f:h.createElement(h.Fragment,null,l&&h.createElement("span",{className:n.classNames("k-agent-step-label",y&&"k-text-shimmer",o)},l),g&&h.createElement("span",{className:"k-agent-step-description"},g),s&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-agent-step-sep"},"·"),h.createElement("span",{className:"k-agent-step-secondary"},s)),null!=r&&r>0&&h.createElement("span",{className:"k-agent-step-added k-text-success"},"+",r),null!=i&&i>0&&h.createElement("span",{className:"k-agent-step-removed k-text-error"},"-",i),c&&h.createElement(p.Badge,{size:"small",themeColor:null!=u?u:"success",rounded:"full"},m&&h.createElement(n.SvgIcon,{icon:m,size:"small"}),c),k&&h.createElement("div",{className:"k-agent-step-body"},k))))});bt.displayName="KendoReactThought";const Et=h.forwardRef((e,t)=>{const{label:a,secondaryLabel:o,svgIcon:s=l.sparklesIcon,completed:r,expanded:i,defaultExpanded:c,expandable:u,thoughts:m=[],linesAdded:d,linesRemoved:p,thoughtTemplate:g,onExpandedChange:f,className:v,...k}=e,b=m.map((e,t)=>h.createElement(bt,{key:t,label:e.label,secondaryLabel:e.secondaryLabel,svgIcon:e.svgIcon,completed:e.completed,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,contentNode:g?h.createElement(g,{thought:e,index:t}):void 0},e.content));return h.createElement(kt,{ref:t,svgIcon:s,label:a,secondaryLabel:o,completed:r,expanded:i,defaultExpanded:c,expandable:u&&m.length>0,linesAdded:d,linesRemoved:p,onExpandedChange:f,className:n.classNames("k-chain-of-thought",v),...k},b)});Et.displayName="KendoReactChainOfThought";const yt=h.forwardRef((e,t)=>{const{visible:l,state:o,template:r,onAction:i,className:c,...u}=e,m=s.useLocalization(),d=h.useRef(null),p=h.useCallback(e=>{var t,n;if(i&&o){const a={action:o,syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=d.current)?void 0:t.element)?n:e.currentTarget};i(a)}},[i,o]),g=m.toLanguageString(ae,me[ae]),f=m.toLanguageString(le,me[le]),v=m.toLanguageString(oe,me[oe]),k=m.toLanguageString(se,me[se]);let b=null;return"startOver"===o||"restore"===o?b=h.createElement(a.Button,{ref:d,size:"small",fillMode:"flat",onClick:p},"startOver"===o?g:f):"redo"===o&&(b=h.createElement(h.Fragment,null,h.createElement("span",{className:"k-checkpoint-stamp"},v),h.createElement("span",null,"·"),h.createElement(a.Button,{ref:d,size:"small",fillMode:"flat",onClick:p},k))),h.createElement("div",{ref:t,className:n.classNames("k-checkpoint",{"k-checkpoint-visible":!0===l},c),...u},h.createElement("span",{className:"k-checkpoint-line","aria-hidden":"true"}),r?h.createElement(r,{state:o}):b,h.createElement("span",{className:"k-checkpoint-line","aria-hidden":"true"}))});yt.displayName="KendoReactCheckpoint";const Ct=e=>{const{sources:t}=e;return h.createElement(h.Fragment,null,t.map((e,t)=>{const a=n.sanitizeUrl(null==e?void 0:e.url);return h.createElement("div",{className:"k-citation-popover-view",key:t},(null==e?void 0:e.title)&&h.createElement("div",{className:"k-citation-popover-view-title"},e.title),e&&a&&h.createElement("a",{className:"k-citation-popover-view-source",href:a,target:"_blank",rel:"noopener noreferrer"},h.createElement(n.IconWrap,{name:l.globeIcon.name,icon:l.globeIcon}),e.url),(null==e?void 0:e.description)&&h.createElement("span",{className:"k-citation-popover-view-body"},e.description))}))},xt={horizontal:"fit",vertical:"flip"},It=[],Tt=(e,t)=>{if(void 0!==e)return e;const n=t[0];return(e=>{if(!e)return"";try{return new URL(e).hostname}catch{return""}})(null==n?void 0:n.url)||(null==n?void 0:n.title)||""},Nt=h.forwardRef((e,t)=>{const{sources:o=It,label:r,svgIcon:i=l.globeIcon,additionalCount:c,bodyTemplate:u,onOpen:m,showOn:d="hover",className:p,...f}=e,v=s.useLocalization(),[k,b]=h.useState(null),[E,y]=h.useState(!1),[C,x]=h.useState(0),I=h.useRef(o),T=h.useRef(null);o!==I.current&&(I.current=o,x(0));const N=h.useCallback(e=>{var n;const a=null!=(n=null==e?void 0:e.element)?n:null;b(a),"function"==typeof t?t(a):t&&(t.current=a)},[t]),w=h.useCallback(()=>{null!==T.current&&(clearTimeout(T.current),T.current=null)},[]),F=h.useCallback(()=>{w(),T.current=setTimeout(()=>y(!1),150)},[w]);h.useEffect(()=>w,[w]),h.useEffect(()=>{if(!k||0===o.length||"hover"!==d)return;const e=()=>{w(),y(!0)},t=()=>F();return k.addEventListener("mouseenter",e),k.addEventListener("mouseleave",t),()=>{k.removeEventListener("mouseenter",e),k.removeEventListener("mouseleave",t)}},[k,o.length,w,F,d]);const S=h.useCallback((e,t)=>{if(0!==o.length&&(w(),y(!0),m)){const n={sources:o,syntheticEvent:e,nativeEvent:e.nativeEvent,target:t};m(n)}},[o,m,w]),R=h.useCallback(e=>{var t;S(e.syntheticEvent,null!=(t=e.target.element)?t:e.syntheticEvent.currentTarget)},[S]),A=h.useCallback(e=>{var t;"Enter"!==e.syntheticEvent.key&&" "!==e.syntheticEvent.key||(e.syntheticEvent.preventDefault(),S(e.syntheticEvent,null!=(t=e.target.element)?t:e.syntheticEvent.currentTarget))},[S]),M=`k-citation-popover-${n.useId()}`;h.useEffect(()=>{if(!E||"hover"!==d)return;const e=document.getElementById(M);return e?(e.addEventListener("mouseenter",w),e.addEventListener("mouseleave",F),()=>{e.removeEventListener("mouseenter",w),e.removeEventListener("mouseleave",F)}):void 0},[E,M,w,F,d]),h.useEffect(()=>{if(!E||"click"!==d)return;const e=e=>{const t=document.getElementById(M);k&&!k.contains(e.target)&&(!t||!t.contains(e.target))&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[E,d,k,M]);const L=o.length,B=h.useCallback(()=>x(e=>Math.min(e+1,L-1)),[L]),D=h.useCallback(()=>x(e=>Math.max(e-1,0)),[]),P=[Tt(r,o),c&&o.length>1?"+"+(o.length-1):void 0].filter(Boolean).join(" "),z=null!=u?u:Ct,O=h.createElement(h.Fragment,null,h.createElement("span",{className:"k-citation-pages"},C+1,"/",L),h.createElement(a.ButtonGroup,null,h.createElement(a.Button,{svgIcon:l.arrowLeftIcon,fillMode:"flat",size:"small","aria-label":v.toLanguageString(ce,me[ce]),disabled:C<=0,onClick:D}),h.createElement(a.Button,{svgIcon:l.arrowRightIcon,fillMode:"flat",size:"small","aria-label":v.toLanguageString(ue,me[ue]),disabled:C>=L-1,onClick:B})));return h.createElement(h.Fragment,null,h.createElement(a.Chip,{ref:N,text:P,svgIcon:i,size:"small",fillMode:"outline",rounded:"full",selected:E,onClick:R,onKeyDown:A,className:n.classNames("k-citation",p),...f}),L>0&&h.createElement(g.Popover,{show:E,anchor:k,title:O,collision:xt,callout:!1,margin:{vertical:8,horizontal:0},position:"top",id:M,popoverClass:"k-citation-popover",style:{width:"320px","--kendo-citation-popover-view-current":C+1}},h.createElement(z,{sources:o})))});Nt.displayName="KendoReactCitation";const wt=h.forwardRef((e,t)=>{const{label:a="Reasoning",secondaryLabel:o,svgIcon:s=l.sparklesIcon,completed:r,expanded:i,defaultExpanded:c,expandable:u,contentTemplate:m,onExpandedChange:d,className:p,children:g,...f}=e,v=m?h.createElement(m,null,g):g;return h.createElement(kt,{ref:t,svgIcon:s,label:a,secondaryLabel:o,completed:r,expanded:i,defaultExpanded:c,expandable:u,onExpandedChange:d,className:n.classNames("k-reasoning",p),...f},v)});wt.displayName="KendoReactReasoning";const Ft=e=>"string"==typeof e?e:JSON.stringify(e,null,2),St=e=>h.createElement(h.Fragment,null,h.createElement("div",{className:"k-tool-call-label"},"Parameters"),h.createElement("pre",{className:"k-pre"},h.createElement("code",{className:"k-code"},Ft(e.parameters)))),Rt=e=>h.createElement(h.Fragment,null,h.createElement("div",{className:"k-tool-call-label"},"Result"),h.createElement("pre",{className:"k-pre"},h.createElement("code",{className:"k-code"},Ft(e.result)))),At=e=>e.errorText?h.createElement("div",{className:"k-messagebox k-messagebox-error"},e.errorText):null,Mt={active:"base",completed:"success",awaitingApproval:"warning",error:"error"},Lt={completed:l.checkCircleIcon,awaitingApproval:l.clockIcon,error:l.xCircleIcon},Bt={active:Z,completed:ee,awaitingApproval:te,error:ne},Dt=h.forwardRef((e,t)=>{const{svgIcon:r=l.wrenchIcon,state:i,parameters:c,result:u,errorText:m,approvalText:d,paramsTemplate:g,resultTemplate:f,errorTemplate:v,approvalTemplate:k,onExpandedChange:b,onAction:E,className:y,children:C,...x}=e,I=s.useLocalization(),T=h.useRef(null),N=h.useRef(null),w=null!=i&&"active"!==i,F=null!=i&&"active"!==i&&"awaitingApproval"!==i,S=w?I.toLanguageString(Bt[i],me[Bt[i]]):void 0,R=w?Mt[i]:void 0,A=w?Lt[i]:void 0,M=w&&h.createElement(p.Badge,{size:"small",themeColor:R,rounded:"full",position:null},A&&h.createElement(n.SvgIcon,{icon:A,size:"small"}),h.createElement("span",{className:"k-badge-text"},S)),L="awaitingApproval"===i,B=h.useCallback(e=>{var t,n;if(E){const a={action:"approve",syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=T.current)?void 0:t.element)?n:e.currentTarget};E(a)}},[E]),D=h.useCallback(e=>{var t,n;if(E){const a={action:"reject",syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=N.current)?void 0:t.element)?n:e.currentTarget};E(a)}},[E]),P=L&&(k?h.createElement(k,{state:i,approvalText:d}):h.createElement(o.Card,null,d&&h.createElement(o.CardBody,null,d),h.createElement(o.CardActions,{layout:"end"},h.createElement(a.Button,{ref:N,fillMode:"outline",onClick:D},I.toLanguageString(ie,me[ie])),h.createElement(a.Button,{ref:T,themeColor:"primary",onClick:B},I.toLanguageString(re,me[re]))))),z=null!=g?g:St,O=null!=f?f:Rt,q=null!=v?v:At,K=h.createElement(h.Fragment,null,null!=c&&h.createElement(z,{parameters:c}),null!=u&&h.createElement(O,{result:u}),null!=m&&h.createElement(q,{errorText:m}),L?P:C);return h.createElement(kt,{ref:t,svgIcon:r,headerExtra:M,completed:F,onExpandedChange:b,className:n.classNames("k-tool-call",y),...x},K)});Dt.displayName="KendoReactToolCall",e.AIPrompt=e=>{const t=h.useRef(null);n.useWebMcpRegister("aiprompt",t,e,e.webMcp);const a=!n.validatePackage(Ke,{component:"AIPrompt"}),l=n.getLicenseMessage(Ke),{activeView:o,toolbarItems:s,children:r,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u,style:m,dir:d,className:p,streaming:g,loading:f,onCancel:v,promptPlaceholder:k,suggestionsView:b,...E}=e,y=s||[it,st],[C,x]=h.useState({activeView:o}),I={...C,activeView:o,streaming:g,loading:f,suggestionsView:null!=b?b:"classic",promptPlaceholder:k,onCancel:v,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u};return h.createElement(ct.Provider,{value:[I,e=>{x(e)}]},h.createElement("div",{className:n.classNames("k-prompt",p),style:m,dir:d,...E},h.createElement(ot,{activeView:I.activeView,toolbarItems:y,activeViewChange:i}),r,a&&h.createElement(n.WatermarkOverlay,{message:l})))},e.AIPromptCommandsView=e=>{const{commands:t}=e,[n]=ut();return h.createElement(pt,{name:rt.name},h.createElement(dt,{streaming:n.streaming,onCancel:n.onCancel},h.createElement("div",{className:"k-prompt-view"},h.createElement(o.PanelBar,{onSelect:e=>{var t,a,l;const o=null==(a=null==(t=e.target)?void 0:t.props)?void 0:a.data;null!=(l=null==o?void 0:o.children)&&l.length||n.onCommandExecute&&n.onCommandExecute.call(null,o)},selected:""},ft(null!=t?t:[])))))},e.AIPromptContent=dt,e.AIPromptFooter=mt,e.AIPromptOutputView=e=>{const[t,n]=h.useState(""),r=h.useRef(null),[i]=ut(),{outputs:c,showOutputRating:u,outputCard:m}=e,{header:d,body:p,actions:g}=m||{},f=s.useLocalization(),v=f.toLanguageString(x,me[x]),k=(e,t)=>{i.onPromptRequest&&i.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),b()},b=()=>{r&&r.current&&r.current.scrollTo({top:0,behavior:"smooth"})},E=h.createElement(o.Card,null,h.createElement(o.CardHeader,null,h.createElement(o.CardTitle,null,h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}})),h.createElement(o.CardSubtitle,null,h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),h.createElement(o.CardBody,null,h.createElement("span",{className:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}})),h.createElement(o.CardActions,null,i.streaming&&i.onCancel?h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",svgIcon:l.stopIcon,title:v,onClick:i.onCancel},v):h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),y=(e,o)=>g?g(e):o&&i.onCancel?h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",svgIcon:l.stopIcon,title:v,onClick:i.onCancel},v):h.createElement(h.Fragment,null,h.createElement(a.Button,{size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:t===e.id?l.checkIcon:l.copyIcon,onClick:()=>(e=>{e.responseContent&&navigator.clipboard.writeText(e.responseContent),n(e.id),setTimeout(()=>{n("")},1e3)})(e)},"Copy"),h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:l.arrowRotateCwIcon,onClick:()=>(e=>{i.onPromptRequest&&i.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),b()})(e)},"Retry"),u&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:l.thumbUpIcon,onClick:()=>k(e,"positive")}),h.createElement(a.Button,{size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:l.thumbDownIcon,onClick:()=>k(e,"negative")}))),I=null==c?void 0:c.map((e,t)=>{const n=!(!i.streaming||i.loading||0!==t);return h.createElement(o.Card,{key:`${e.id}_${t}`},h.createElement(o.CardHeader,null,d?d(e):h.createElement(h.Fragment,null,e.title&&h.createElement(o.CardTitle,null,e.title),e.subTitle&&h.createElement(o.CardSubtitle,null,e.subTitle))),h.createElement(o.CardBody,null,p?p(e):e.responseContent),h.createElement(o.CardActions,null,y(e,n)))}),T=h.createElement(o.Card,null,h.createElement(o.CardBody,null,f.toLanguageString(C,me[C])));return h.createElement(pt,{name:st.name},h.createElement(dt,{ref:r,streaming:i.streaming,onCancel:i.onCancel},h.createElement("div",{className:"k-card-list"},i.loading&&E,I,(!I||0===I.length)&&!i.loading&&T)))},e.AIPromptView=e=>{var t;const{promptInput:o=m.TextArea,generateButton:r=a.Button,enableSpeechToText:i=!1,promptValue:c,promptSuggestions:u}=e,[d,p]=h.useState(c||""),[g]=ut(),f=s.useLocalization(),[v,k]=n.useCustomComponent(r),[b,E]=n.useCustomComponent(o),y=h.useRef(null);h.useEffect(()=>{var e,t;null!=(t=null==(e=y.current)?void 0:e.element)&&t.current&&requestAnimationFrame(()=>{var e,t;if(null!=(t=null==(e=y.current)?void 0:e.element)&&t.current){const e=y.current.element.current;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}})},[d]);const C={title:"Generate",children:"Generate",svgIcon:l.sparklesIcon},x={placeholder:null!=(t=g.promptPlaceholder)?t:f.toLanguageString(I,me[I]),rows:2},T=Object.keys(k).length>0?k:C,N=Object.keys(E).length>0?E:x,w=e=>{const{isFinal:t,alternatives:n}=e;if(t&&n.length>0){const e=n[0].transcript,t=(()=>{const t=d,n=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(n?" ":"")+e})();p(t)}};let F;return i&&(F="object"==typeof i?{...i,onResult:i.onResult||w}:{onResult:w}),h.createElement(pt,{name:it.name},h.createElement(dt,{streaming:g.streaming,onCancel:g.onCancel},h.createElement(b,{ref:y,value:d,flow:"vertical",textareaStyle:{maxHeight:"110px"},autoSize:!0,suffix:i?h.createElement(h.Fragment,null,h.createElement(m.InputSeparator,{orientation:"horizontal"}),h.createElement(m.InputSuffix,{orientation:"horizontal"},h.createElement(a.SpeechToTextButton,{fillMode:"flat",...F}))):void 0,onChange:e=>{p(e.target.value)},...N}),u&&u.length>0&&h.createElement(gt,{title:"Prompt Suggestions"},h.createElement(Me,{suggestionsView:g.suggestionsView,suggestions:u.map((e,t)=>({id:t,text:e,description:e})),onSuggestionClick:e=>{(e=>{p(e)})(e.text)}}))),h.createElement(mt,null,h.createElement(v,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:()=>{g.onPromptRequest&&g.onPromptRequest.call(null,d),p("")},disabled:!d.trim(),...T},T.children)))},e.AIPromptViewRender=pt,e.ChainOfThought=Et,e.Chat=lt,e.ChatMessage=Ee,e.Checkpoint=yt,e.Citation=Nt,e.DEFAULT_FIELD_MAPPING=Ye,e.HeroCard=e=>{const{imageUrl:t,imageMaxWidth:n,title:l,subtitle:o,actions:s,onActionExecute:r,altText:i}=e,c=h.useCallback((e,t)=>{null==r||r({action:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},[r]),u=i||l||"";return h.createElement("div",{className:"k-card"},h.createElement("img",{className:"k-card-image",src:t,style:{maxWidth:n},alt:u}),h.createElement("div",{className:"k-card-body"},l&&h.createElement("h5",{className:"k-card-title"},l),o&&h.createElement("h6",{className:"k-card-subtitle"},o)),h.createElement("div",{className:"k-card-actions k-card-actions-vertical"},s.map((e,t)=>h.createElement("span",{className:"k-card-action",key:`action-${t}-${e.title||e.value||t}`},h.createElement(a.Button,{fillMode:"flat",onClick:t=>c(e,t)},e.title)))))},e.InlineAIPrompt=e=>{const t=!n.validatePackage(Ke,{component:"InlineAIPrompt"}),s=n.getLicenseMessage(Ke),{outputs:r=[],outputCard:i,promptInput:c=m.TextArea,generateButton:u=a.Button,promptPlaceholder:d="Ask or generate content with AI...",promptValue:p,onPromptRequest:g,onCopy:f,onDiscard:v,outputActions:k,onOutputAction:b,enableSpeechToText:E=!1,streaming:y,onPromptCancel:C,show:x=!1,anchor:I,width:T,height:N,onOpen:w,onClose:F,animate:S=!0,appendTo:R,commands:A,onCommandExecute:M,style:L,className:B,popupOptions:D={},...P}=e,[z,O]=h.useState(""),[q,K]=h.useState(!1),[H,U]=h.useState({left:0,top:0}),$=h.useRef(null),{body:V,actions:j}=i||{},W=k||[{id:"copy",text:"Copy",svgIcon:l.copyIcon,themeColor:"primary",title:"Copy"},{id:"discard",text:"Discard",svgIcon:l.cancelIcon,themeColor:"base",title:"Discard"}],G=(e,t)=>{switch(e.id){case"copy":(e=>{e.responseContent&&(navigator.clipboard.writeText(e.responseContent),O(e.id),setTimeout(()=>O(""),1e3)),null==f||f(e)})(t);break;case"discard":(e=>{null==v||v(e)})(t);break;default:null==b||b(e,t)}},_=h.useCallback(e=>{"Escape"===e.key&&(y&&C?C():!y&&F&&F({target:null}))},[y,C,F]),Y={...L,...T&&{width:T},...N&&{height:N}},J={...T&&{width:T},...N&&{height:N}},X=h.createElement(h.Fragment,null,h.createElement("div",{className:n.classNames("k-prompt",B),style:Y,onKeyDown:_,...P},h.createElement(dt,{ref:$},r&&r.length>0&&h.createElement("div",{className:"k-card-list"},r.map((e,t)=>h.createElement(o.Card,{key:`${e.id}_${t}`},h.createElement(o.CardBody,null,V?V(e):e.responseContent),h.createElement(o.CardActions,null,j?j(e):h.createElement(h.Fragment,null,W.map(t=>{var n;return t.spacer?h.createElement("span",{key:t.id,className:"k-spacer"}):h.createElement(a.Button,{key:t.id,size:"medium",themeColor:t.themeColor||"primary",fillMode:"flat",rounded:"medium",title:null!=(n=t.title)?n:t.text,svgIcon:"copy"===t.id&&z===e.id?l.checkIcon:t.svgIcon,onClick:()=>G(t,e)},t.text)})))))),h.createElement(vt,{promptValue:p,placeholder:d,onPromptRequest:g,onMenuClick:e=>{if(!$.current)return;const t=$.current.getBoundingClientRect();U({left:t.left,top:t.bottom}),K(!0)},onPromptCancel:C,promptInput:c,generateButton:u,enableSpeechToText:E,streaming:y,commands:A}))),t&&h.createElement(n.WatermarkOverlay,{message:s}));return h.createElement(h.Fragment,null,h.createElement(ht,{show:x,anchor:I,onOpen:w,onClose:F,animate:S,appendTo:R,popupOptions:D,style:J},X),h.createElement(o.ContextMenu,{show:q,offset:H,onClose:()=>{K(!1)},items:(e=>null==e?void 0:e.map(e=>({text:e.text,svgIcon:e.svgIcon,data:e,items:e.children?e.children.map(e=>({text:e.text,data:e})):void 0})))(A),onSelect:e=>{var t,n;const a=null==(t=e.item)?void 0:t.data;a&&(null==(n=a.children)||!n.length)&&(e=>{K(!1),M&&M(e)})(a)}}))},e.PromptBox=$e,e.PromptBoxActionButton=Be,e.PromptBoxSpeechToTextButton=De,e.PromptBoxUploadButton=Le,e.PromptHeader=ot,e.Reasoning=wt,e.SuggestionGroup=Me,e.ToolCall=Dt,e.commandsViewDefaults=rt,e.extractFieldMappingFromProps=e=>({textField:e.textField,statusField:e.statusField,authorIdField:e.authorIdField,authorNameField:e.authorNameField,authorImageUrlField:e.authorImageUrlField,authorImageAltTextField:e.authorImageAltTextField,idField:e.idField,timestampField:e.timestampField,filesField:e.filesField,attachmentsField:e.attachmentsField,replyToIdField:e.replyToIdField,isDeletedField:e.isDeletedField,isPinnedField:e.isPinnedField,typingField:e.typingField,suggestedActionsField:e.suggestedActionsField,isFailedField:e.isFailedField}),e.isStandardMessageFormat=Qe,e.mapDataArrayToMessages=Xe,e.mapDataToMessage=Je,e.mapMessageToCustomFormat=(e,t={})=>{const n={...Ye,...t},a={};return void 0!==e.id&&(a[n.idField]=e.id),void 0!==e.text&&(a[n.textField]=e.text),void 0!==e.status&&(a[n.statusField]=e.status),void 0!==e.isFailed&&(a[n.isFailedField]=e.isFailed),void 0!==e.timestamp&&(a[n.timestampField]=e.timestamp),void 0!==e.attachments&&(a[n.attachmentsField]=e.attachments),void 0!==e.files&&(a[n.filesField]=e.files),void 0!==e.suggestedActions&&(a[n.suggestedActionsField]=e.suggestedActions),void 0!==e.replyToId&&(a[n.replyToIdField]=e.replyToId),void 0!==e.isDeleted&&(a[n.isDeletedField]=e.isDeleted),void 0!==e.isPinned&&(a[n.isPinnedField]=e.isPinned),void 0!==e.typing&&(a[n.typingField]=e.typing),e.author&&(void 0!==e.author.id&&(a[n.authorIdField]=e.author.id),void 0!==e.author.name&&(a[n.authorNameField]=e.author.name),void 0!==e.author.avatarUrl&&(a[n.authorImageUrlField]=e.author.avatarUrl),void 0!==e.author.avatarAltText&&(a[n.authorImageAltTextField]=e.author.avatarAltText)),void 0!==e.pinnedAt&&(a.pinnedAt=e.pinnedAt),void 0!==e.pinnedBy&&(a.pinnedBy=e.pinnedBy),void 0!==e.attachmentLayout&&(a.attachmentLayout=e.attachmentLayout),a},e.outputViewDefaults=st,e.promptViewDefaults=it});
15
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-intl"),require("prop-types"),require("@progress/kendo-react-upload"),require("@progress/kendo-react-animation"),require("@progress/kendo-react-notification"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-indicators"),require("@progress/kendo-react-tooltip")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-layout","@progress/kendo-react-intl","prop-types","@progress/kendo-react-upload","@progress/kendo-react-animation","@progress/kendo-react-notification","@progress/kendo-react-inputs","@progress/kendo-react-popup","@progress/kendo-react-indicators","@progress/kendo-react-tooltip"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactConversationalUi={},e.React,e.KendoReactCommon,e.KendoReactButtons,e.KendoSvgIcons,e.KendoReactLayout,e.KendoReactIntl,e.PropTypes,e.KendoReactUpload,e.KendoReactAnimation,e.KendoReactNotification,e.KendoReactInputs,e.KendoReactPopup,e.KendoReactIndicators,e.KendoReactTooltip)}(this,function(e,t,n,a,l,o,s,r,i,c,u,m,d,p,g){"use strict";function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var h=f(t);const v="newMessage.sendButton",k="newMessage.optionsButton",b="newMessage.messageInput",E="avatar.alt",y="messageList.ariaLabel",C="aIPrompt.noOutputs",x="aIPrompt.cancel",I="aIPrompt.inputPlaceholder",T="chat.senderDeletedMessage",N="chat.receiverDeletedMessage",w="chat.copyNotification",F="chat.downloadAllFiles",S="chat.closeReply",R="chat.collapseMessage",A="chat.expandMessage",M="chat.removeFile",L="chat.fileActions",B="chat.attachFile",D="chat.downloadAll",P="chat.scrollLeft",z="chat.scrollRight",O="chat.scrollToBottom",q="chat.messageFailed",K="chat.retryMessage",H="chat.stopGenerating",U="promptBox.input",$="promptBox.sendButton",V="promptBox.sendButtonText",j="promptBox.attachFile",W="promptBox.removeFile",G="promptBox.stopGenerating",_="promptBox.ariaLabel",Y="promptBox.attachedFiles",J="chat.messageToolbar",X="chat.unpinMessage",Q="chat.messageAttachedFiles",Z="toolCall.state.active",ee="toolCall.state.completed",te="toolCall.state.awaitingApproval",ne="toolCall.state.error",ae="checkpoint.startOver",le="checkpoint.restore",oe="checkpoint.restored",se="checkpoint.redo",re="toolCall.approve",ie="toolCall.reject",ce="citation.previous",ue="citation.next",me={[v]:"Send",[k]:"Options",[b]:"Message",[E]:"Avatar",[y]:"Message list",[x]:"Cancel",[C]:"No output from AI available",[I]:"Ask or generate content with AI ...",[T]:"You removed this message",[N]:"The message was removed by its sender",[w]:"Text copied to clipboard",[F]:"Download all files",[S]:"Close reply",[R]:"Collapse message",[A]:"Expand message",[M]:"Remove file",[L]:"File actions for",[q]:"Failed to send",[K]:"Retry",[H]:"Stop generating",[B]:"Attach file",[D]:"Download all",[P]:"Scroll left",[z]:"Scroll right",[O]:"Scroll to bottom",[U]:"Prompt",[$]:"Send",[V]:"",[j]:"Attach file",[W]:"Remove file",[G]:"Stop generating",[_]:"Prompt box",[Y]:"Attached files",[J]:"Toolbar",[X]:"Unpin message",[Q]:"Attached files",[Z]:"Active",[ee]:"Completed",[te]:"Awaiting Approval",[ne]:"Error",[ae]:"Start Over",[le]:"Restore Checkpoint",[oe]:"Checkpoint Restored",[se]:"Redo",[re]:"Approve",[ie]:"Reject",[ce]:"Previous",[ue]:"Next"},de=(e,t)=>e&&t.author&&e.id===t.author.id,pe=(e,t)=>{const n=t.toLanguageString("chatSender.deletedMessage",me[T]),a=t.toLanguageString("chatReceiver.deletedMessage",me[N]);return e?n:a},ge=(e,t)=>e.find(e=>e.id===t),fe=/(https?:\/\/[^\s]+)/g,he=e=>{if(!e)return[""];const t=e.split(fe),n=[];return t.forEach(e=>{e&&fe.test(e)?(fe.lastIndex=0,n.push(h.createElement("a",{key:e,href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"}},e))):e&&n.push(e)}),n},ve=h.createContext(void 0),ke=()=>{const e=t.useContext(ve);if(void 0===e)throw new Error("useChatContext must be used within a ChatContext.Provider");return e},be=e=>{const{files:t,onFileAction:o,onDownload:r,fileActions:i}=e,{messageFilesLayout:c="vertical"}=ke(),u=s.useLocalization(),m=i||[{id:"download",label:"Download",svgIcon:l.downloadIcon}],d=e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`},p=e=>"."+e.split(".").pop()||"",g=e=>m.length>0&&h.createElement(a.DropDownButton,{fillMode:"flat",size:"xs",svgIcon:l.moreVerticalIcon,onClick:e=>{e.syntheticEvent.stopPropagation()},onItemClick:t=>((e,t)=>{var n,a;null==(a=null==(n=e.syntheticEvent)?void 0:n.stopPropagation)||a.call(n),"download"===e.item.id&&(null==r||r([t])),null==o||o(e.item,e,t)})(t,e),items:m.map(e=>({id:e.id,icon:e.icon,text:e.label,svgIcon:e.svgIcon})),"aria-label":`${u.toLanguageString(L,me[L])} ${e.name}`,title:`${u.toLanguageString(L,me[L])} ${e.name}`}),f=h.useCallback(()=>n.classNames({"k-files-wrap":"wrap"===c,"k-files-vertical":"vertical"===c},"k-file-box-wrapper"),[c]);return h.createElement("ul",{role:"list","aria-label":u.toLanguageString(Q,me[Q]),className:f()},"horizontal"===c?h.createElement("div",{className:"k-files-scroll",role:"presentation"},t.map(e=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem","aria-label":[e.name,d(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(p(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},d(e.size))),g(e)))):t.map(e=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem","aria-label":[e.name,d(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(p(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},d(e.size))),g(e))))},Ee=h.forwardRef((e,t)=>{const{item:r,template:i,contentTemplate:c,onRequestSelection:u,tabIndex:m=-1,dateFormat:d="g",selected:p,allowMessageCollapse:g,messageToolbarActions:f,messageContextMenuActions:v,fileActions:k,isSender:b}=e,{setReplyToMessage:E,messages:y,repliedToMessages:C,user:x,onToolbarAction:I,onContextMenuAction:T,onFileAction:N,onDownload:w,onResendMessage:S,setShowCopyNotification:M,statusTemplate:L,timestampVisibility:B="onFocus",onReferencedMessageClick:P}=ke(),[z,O]=h.useState(!1),[H,U]=h.useState(!1),[$,V]=h.useState(!0),[j,W]=h.useState(!1),G=s.useLocalization(),_=s.useInternationalization(),Y=h.useRef({left:0,top:0}),X=h.useCallback(()=>{null!=r&&r.text&&(e=>{navigator.clipboard.writeText(e)})(r.text),M&&(M(!0),setTimeout(()=>{M(!1)},3e3))},[r,M]),Q=h.useCallback(e=>{e.stopPropagation(),V(e=>!e)},[]),Z=h.useCallback(()=>{W(!1)},[]),ee=h.useCallback(e=>{("Tab"===e.key||"Enter"===e.key||" "===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key)&&W(!0)},[]),te=h.useRef(null);h.useEffect(()=>{p&&te.current&&te.current.focus()},[p]);const ne=h.useCallback(e=>{Y.current={left:e.pageX,top:e.pageY},e.preventDefault(),U(!0),O(!0)},[]),ae=h.useCallback(()=>{U(!1),O(!1)},[]),le=h.useCallback((e,t)=>e.isDeleted?pe(t,G):e.text?e.text:"",[G]),oe=h.useCallback(e=>{var t;null!=(t=e.item)&&t.text&&("copy"!==e.item.data.id||r.isDeleted?"reply"===e.item.data.id&&E(r):X(),T&&T(e.item.data,e,r)),U(!1),O(!1)},[r,T,E,X]),se=h.useCallback(()=>{if(r.replyToId){const e=ge(y,r.replyToId)||(C?ge(C,r.replyToId):void 0);if(e){const t=t=>{t.preventDefault(),t.stopPropagation(),null==P||P(e.id)};return h.createElement("div",{className:n.classNames("k-message-reference",de(x,e)?"k-message-reference-sender":"k-message-reference-receiver"),onClick:t},h.createElement("div",{className:"k-message-reference-content"},he(le(e,de(x,e)))))}}return null},[r.replyToId,y,C,x,le,P]),re=h.useCallback(()=>{const e=[{id:"reply",label:"Reply",svgIcon:l.undoIcon},{id:"copy",label:"Copy",svgIcon:l.copyIcon}],t=v?[...e.map(e=>v.find(t=>t.id===e.id)||e),...v.filter(t=>!e.some(e=>e.id===t.id))]:e;return h.createElement(o.ContextMenu,{onSelect:oe,onClose:ae,vertical:!0,show:z,offset:Y.current},t.map(e=>"delete"!==e.id||b?h.createElement(o.MenuItem,{key:e.id,text:e.label,icon:e.icon,svgIcon:e.svgIcon,data:e}):null))},[v,oe,ae,z,b]),ie=h.useCallback(()=>r.files&&r.files.length>1?h.createElement("div",{className:"k-chat-download-button-wrapper"},h.createElement(a.Button,{className:"k-chat-download-button",fillMode:"flat",svgIcon:l.downloadIcon,size:"small",onClick:e=>{e.stopPropagation(),w&&w(r.files,r)},"aria-label":G.toLanguageString(F,me[F])},h.createElement("span",{className:"k-button-text"},G.toLanguageString(D,me[D])))):null,[r,w,G]),ce=h.useCallback(()=>{if(r.typing)return h.createElement("div",{className:"k-chat-bubble k-bubble"},h.createElement("div",{className:"k-bubble-content"},h.createElement("div",{className:"k-typing-indicator"},h.createElement("span",null),h.createElement("span",null),h.createElement("span",null))));if(i){const e=i;return h.createElement(h.Fragment,null,h.createElement(e,{item:r}),re())}return r.text||r.files&&r.files.length>0?h.createElement(h.Fragment,null,h.createElement("div",{className:n.classNames("k-chat-bubble","k-bubble",{"k-bubble-expandable":g,"k-expanded":g&&$,"k-selected":p,"k-active":H}),onClick:()=>u(p?void 0:r.selectionIndex),onContextMenu:ne},h.createElement("div",{className:"k-bubble-content"},c?h.createElement(c,{item:r}):h.createElement(h.Fragment,null,(r.text||r.isDeleted||r.replyToId)&&h.createElement("span",{className:"k-chat-bubble-text"},!r.isDeleted&&se(),he(le(r,de(x,r)))),r.files&&r.files.length>0&&h.createElement(be,{files:r.files,message:r,onFileAction:N,onDownload:e=>null==w?void 0:w(e,r),renderInTextarea:!1,fileActions:k}),ie())),g&&h.createElement("span",{className:"k-bubble-expandable-indicator",onClick:Q,role:"button","aria-label":$?G.toLanguageString(R,me[R]):G.toLanguageString(A,me[A]),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),Q(e))}},h.createElement(n.IconWrap,{icon:$?l.chevronUpIcon:l.chevronDownIcon}))),re()):null},[r,i,c,g,$,p,H,u,ne,se,le,x,N,k,ie,Q,G,re,w]),ue=h.useCallback(()=>{let e=null;return r.timestamp&&("hidden"===B||(e=h.createElement("time",{className:"k-message-time"},_.formatDate(r.timestamp,d)))),e},[r.timestamp,d,B,_]),fe=h.useCallback(()=>{if(!r.status)return null;let e;if(L)e=h.createElement(L,{item:r});else{let t,a,l;if("object"==typeof r.status&&null!==r.status){const e=r.status;t=e.text,a=e.icon,l=e.svgIcon}else t=r.status;let o=null;a?o=h.createElement(n.Icon,{name:a,size:"xsmall"}):l&&(o=h.createElement(n.IconWrap,{icon:l,size:"xsmall"})),e=h.createElement(h.Fragment,null,o,t)}return h.createElement("span",{className:"k-message-status"},e)},[r,L]),ve=h.useCallback(()=>{let e=null;if(r.isFailed){const t=G.toLanguageString(q,me[q]);e=h.createElement("span",{className:"k-message-failed-content"},h.createElement(n.IconWrap,{icon:l.warningTriangleIcon,size:"xsmall"}),h.createElement("span",{className:"k-message-failed-text"},t))}return e},[r,G]),Ee=h.useCallback(()=>{let e=null;if(r.isFailed){const t=G.toLanguageString(K,me[K]);e=h.createElement(a.Button,{fillMode:"clear",size:"xs",className:"k-resend-button",svgIcon:l.arrowRotateCwIcon,"aria-label":t,title:t,onClick:e=>{e.stopPropagation(),S&&S({message:r,syntheticEvent:e,nativeEvent:e.nativeEvent,target:e.target})}})}return e},[r,G,S]),ye=h.useCallback(()=>n.classNames({"k-focus":p,"k-message-removed":r.isDeleted,"k-message-failed":r.isFailed},"k-message"),[p,r.isDeleted,r.isFailed]),Ce=h.useCallback(()=>f&&f.length>0&&h.createElement(a.Toolbar,{className:"k-chat-message-toolbar",fillMode:"flat",ariaLabel:G.toLanguageString(J,me[J])},f.map(e=>"delete"!==e.id||b?h.createElement(a.Button,{key:e.id,fillMode:"flat",className:"k-toolbar-button",icon:e.icon,svgIcon:e.svgIcon,"aria-label":e.label,onClick:t=>{t.stopPropagation(),"copy"!==e.id||r.isDeleted?"reply"===e.id&&E(r):X(),I&&I(e,t,r)},onMouseDown:e=>e.preventDefault()}):null)),[X,b,r,G,f,I,E]);return h.createElement("div",{key:r.id,"data-message-id":r.id,className:ye(),tabIndex:m,onMouseDown:Z,onKeyDown:ee,onFocus:e=>{j&&u(r.selectionIndex)},ref:e=>{te.current=e,"function"==typeof t?t(e):t&&(t.current=e)},onContextMenu:i?ne:void 0},Ee(),ce(),(r.status||r.timestamp&&"hidden"!==B||r.isFailed)&&h.createElement("div",{className:"k-message-info"},fe(),ue(),ve()),Ce())});Ee.displayName="ChatMessage";const ye=e=>e[e.length-1],Ce=e=>(t,n,a)=>{const l=a===e-1;return((e,t)=>{const n=t.timestamp,a=ye(e);if(n&&(!a||((e,t)=>e&&t&&(t.getDate()!==e.getDate()||t.getMonth()!==e.getMonth()||t.getFullYear()!==e.getFullYear()))(n,a.timestamp))){const t={type:"date-marker",timestamp:n,trackBy:n.getTime()};e.push(t)}})(t,n),((e,t,n)=>{const a=ye(e);let l;t.typing&&!n||(a&&"message-group"===a.type&&(l=a.messages),l&&de(t.author,ye(l))?l.push(t):e.push({type:"message-group",messages:[t],author:t.author,timestamp:t.timestamp,trackBy:t}))})(t,n,l),n.attachments&&n.attachments.length>1&&t.push({type:"attachment-group",attachments:n.attachments,attachmentLayout:n.attachmentLayout,timestamp:n.timestamp,trackBy:n}),n.suggestedActions&&l&&t.push({type:"action-group",actions:n.suggestedActions,timestamp:n.timestamp,trackBy:n}),t};const xe=e=>{const{item:t,onActionExecute:a,selected:l}=e,o=h.useRef(null);h.useEffect(()=>{l&&o.current&&o.current.focus()},[l]);const s=h.useCallback(e=>{(e.keyCode===n.Keys.enter||" "===e.key)&&(e.preventDefault(),a(t,e))},[a,t]),r=h.useCallback(()=>n.classNames("k-suggestion k-suggestion-primary",{"k-selected":l},{"k-focus":l}),[l]);return h.createElement("span",{role:"button",className:r(),onClick:e=>a(t,e),ref:o,onKeyDown:s,tabIndex:0,"aria-label":t.title||t.value},t.title||t.value)},Ie=({visible:e,dir:t,canScrollLeft:n,canScrollRight:o,onScrollLeft:r,onScrollRight:i,children:c})=>{const u=s.useLocalization();if(!e)return c;const m=u.toLanguageString(P,me[P]),d=u.toLanguageString(z,me[z]),p="rtl"!==t?m:d,g="rtl"!==t?d:m;return h.createElement("div",{className:"k-suggestion-scrollwrap"},h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:"rtl"===t?l.chevronRightIcon:l.chevronLeftIcon,onClick:r,disabled:!n,"aria-label":p,title:p}),c,h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:"rtl"===t?l.chevronLeftIcon:l.chevronRightIcon,onClick:i,disabled:!o,"aria-label":g,title:g}))},Te=100,Ne=(e,t)=>{const{enabled:n,dir:a,mode:l,itemsDependency:o=[],scrollSpeed:s=Te}=t,[r,i]=h.useState(!1),[c,u]=h.useState(!1),m=h.useCallback(()=>{if(e.current&&n){const{scrollLeft:t,scrollWidth:n,clientWidth:l}=e.current,o="rtl"!==a?t+l>=n-1:l-t>=n-1;i(!(0===t)),u(!o)}},[n,a]),d=h.useCallback(()=>{e.current&&n&&e.current.scrollBy({left:"rtl"!==a?-s:s,behavior:"smooth"})},[n,a,s]),p=h.useCallback(()=>{e.current&&n&&e.current.scrollBy({left:"rtl"!==a?s:-s,behavior:"smooth"})},[n,a,s]);return h.useEffect(()=>{const t=e.current;if(!t||!n)return;m();const a=()=>m();t.addEventListener("scroll",a,{passive:!0});const l=new ResizeObserver(m);return l.observe(t),()=>{t.removeEventListener("scroll",a),l.disconnect()}},[n,m,o.length,l]),h.useLayoutEffect(()=>{n&&m()},[n,a,o]),{canScrollLeft:r,canScrollRight:c,scrollLeft:d,scrollRight:p}},we=e=>{var t,a;const{group:l,onActionExecute:o,selected:s,onRequestSelection:r,quickActionsLayout:i="scroll",dir:c}=e,[u,m]=h.useState(null),d=h.useRef(null),{canScrollLeft:p,canScrollRight:g,scrollLeft:f,scrollRight:v}=Ne(d,{enabled:"scrollbuttons"===i||"scroll"===i,dir:c,mode:i,itemsDependency:l.actions});h.useEffect(()=>{s||null===u?s&&null===u&&m(0):m(null)},[s,u]);const k=h.useCallback(()=>l.actions?l.actions.length-1:-1,[l.actions]),b=h.useCallback((e,t=0)=>{let n=null;return e?null===u?n=t:u<k()&&(n=u+1):null===u?n=0:u>0&&(n=u-1),null!==n&&m(n),n},[u,k]),E=h.useCallback(()=>{r(l.selectionIndex)},[r,l.selectionIndex]),y=h.useCallback(e=>{let t=null;const a=n.Keys.left,l=n.Keys.right;e.keyCode===a?t=b(!1):e.keyCode===l&&(t=b(!0)),null!==t&&(e.preventDefault(),e.stopPropagation())},[b]),C=h.useCallback(()=>n.classNames("k-suggestion-group",{"k-suggestion-group-scrollable":"scroll"===i,"k-suggestion-group-scrollable-start":g&&("scroll"===i||"scrollbuttons"===i),"k-suggestion-group-scrollable-end":p&&("scroll"===i||"scrollbuttons"===i)}),[i,g,p]),x="scroll"===i||"scrollbuttons"===i,I=h.createElement("div",{className:C(),onClick:E,onKeyDown:y,role:"toolbar",tabIndex:0,"aria-label":"Action group"},x?h.createElement("div",{className:"k-suggestions-scroll",ref:d},null==(t=l.actions)?void 0:t.map((e,t)=>h.createElement(xe,{item:e,onActionExecute:o,selected:t===u,key:e.value}))):null==(a=l.actions)?void 0:a.map((e,t)=>h.createElement(xe,{item:e,onActionExecute:o,selected:t===u,key:e.value})));return h.createElement(Ie,{visible:"scrollbuttons"===i,dir:c,canScrollLeft:p,canScrollRight:g,onScrollLeft:f,onScrollRight:v},I)},Fe=e=>{const{item:t,template:a,tabbable:l,onClick:o,selected:s}=e,r=h.useRef(null);h.useEffect(()=>{s&&r.current&&r.current.focus()},[s]);const i=h.useCallback(()=>{if(void 0!==l)return l?0:-1},[l]),c=h.useCallback(()=>n.classNames({"k-selected":s},{"k-focus":s}),[s]),u=h.useCallback(()=>t.title?h.createElement("h5",{className:"k-card-title"},t.title):null,[t.title]),m=h.useCallback(()=>t.subtitle?h.createElement("h6",{className:"k-card-subtitle"},t.subtitle):null,[t.subtitle]),d=h.useCallback(()=>0===t.contentType.indexOf("image/")?h.createElement("img",{src:t.content,alt:t.title||"Attachment",style:{maxHeight:"200px",height:"auto",maxWidth:"200px",width:"auto"}}):t.content,[t.contentType,t.content,t.title]),p=a;return h.createElement("div",{className:c(),tabIndex:i(),onClick:o,ref:r},a?h.createElement(p,{item:t}):h.createElement("div",{className:"k-card"},h.createElement("div",{className:"k-card-body"},u(),m(),d())))},Se=e=>{const{group:t,itemTemplate:o,selected:s,isLastGroup:r,onRequestSelection:i,dir:c}=e,[u,m]=h.useState(null),d=h.useRef(null);h.useEffect(()=>{s||null===u?s&&null===u&&m(0):m(null)},[s,u]);const p=h.useCallback(e=>"list"!==e.attachmentLayout,[]),{canScrollLeft:g,canScrollRight:f,scrollLeft:v,scrollRight:k}=Ne(d,{enabled:p(t),dir:c,itemsDependency:t.attachments}),b=h.useCallback(()=>t.attachments?t.attachments.length-1:-1,[t.attachments]),E=h.useCallback((e,t=0)=>{let n=null;return e?null===u?n=t:u<b()&&(n=u+1):null===u?n=0:u>0&&(n=u-1),null!==n&&m(n),n},[u,b]),y=h.useCallback(()=>{i(t.selectionIndex)},[i,t.selectionIndex]),C=h.useCallback(e=>{let a,l,o=null;p(t)?(a=n.Keys.left,l=n.Keys.right):(a=n.Keys.up,l=n.Keys.down),e.keyCode===a?o=E(!1):e.keyCode===l&&(o=E(!0)),null!==o&&(e.preventDefault(),e.stopPropagation())},[E,p,t]),x=h.useCallback(e=>{y(),m(e)},[y]),I=h.useCallback(()=>{let e=null;return p(t)&&g&&(e=h.createElement(a.Button,{icon:"chevron-left",tabIndex:-1,onClick:v,svgIcon:l.chevronLeftIcon})),e},[p,t,g,v]),T=h.useCallback(()=>{let e=null;return p(t)&&f&&(e=h.createElement(a.Button,{icon:"chevron-right",tabIndex:-1,onClick:k,svgIcon:l.chevronRightIcon})),e},[p,t,f,k]),N=h.useCallback(()=>n.classNames({"k-card-list":t.attachmentLayout,"k-card-deck":p(t)}),[t.attachmentLayout,t,p]),w=p(t),F=h.createElement("div",{ref:d,className:N(),onKeyDown:w?void 0:C},t.attachments.map((e,t)=>h.createElement(Fe,{item:e,template:o,selected:t===u,tabbable:r&&t===u,onClick:()=>x(t),key:e.content})));return w?h.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:C},I(),F,T()):F},Re=({item:e,timestampTemplate:t})=>{const n=s.useInternationalization(),a=t;return h.createElement("div",{className:"k-timestamp"},a?h.createElement(a,{item:e}):n.formatDate(e.timestamp,"D"))},Ae=e=>{const{group:t,user:a,itemTemplate:l,contentTemplate:r,attachmentTemplate:i,onRequestSelection:c,selectedItemIndex:u,isLastGroup:m,message:d,allowMessageCollapse:p,messageToolbarActions:g,messageContextMenuActions:f,fileActions:v,messageWidthMode:k="standard",showAvatar:b=!0,showUsername:y=!0}=e,{userStatusTemplate:C}=ke(),x=s.useLocalization(),I=t.messages.length>0&&de(a,t.messages[0]),{avatarUrl:T,avatarAltText:N,name:w}=t.author,F=h.useMemo(()=>n.classNames("k-message-group",{"k-message-group-sender":I,"k-message-group-receiver":!I,"k-message-group-full-width":"full"===k,"k-no-avatar":!b||!T}),[I,k,b,T]),S=h.useMemo(()=>{const e=t.messages.length-1;return t.messages.map((t,n)=>{const o=[h.createElement(d,{item:t,template:l,contentTemplate:r,selected:t.selectionIndex===u,onRequestSelection:c,tabIndex:n===e&&m?0:-1,key:t.id,allowMessageCollapse:p,messageToolbarActions:g,messageContextMenuActions:f,fileActions:v,isSender:de(a,t)})];return t.attachments&&1===t.attachments.length&&o.push(h.createElement(Fe,{item:t.attachments[0],template:i,selected:!1,key:`att-${t.attachments[0].content}`})),o})},[t.messages,d,l,r,u,c,m,p,g,f,v,a,i]),R=void 0!==N?N:x.toLanguageString(E,me[E]);return h.createElement("div",{className:F},(()=>{if(!b||!T)return;const e=h.createElement(o.Avatar,{type:"image"},h.createElement("img",{src:T,alt:R}));if(C){const n=t.messages[t.messages.length-1];return h.createElement("div",{className:"k-chat-user-status-wrapper"},e,h.createElement("div",{className:"k-chat-user-status"},h.createElement(C,{message:"dataItem"in n?n.dataItem:n})))}return e})(),h.createElement("div",{className:"k-message-group-content"},y&&h.createElement("span",{className:"k-message-author"},w),S))},Me=e=>{const{suggestions:t,onSuggestionClick:a,suggestionsView:l,suggestionTemplate:o,suggestionsLayout:s,dir:r}=e,i=h.useRef(null),{canScrollLeft:c,canScrollRight:u,scrollLeft:m,scrollRight:d}=Ne(i,{enabled:"scrollbuttons"===s||"scroll"===s,dir:r,mode:s,itemsDependency:t}),p=h.useCallback((e,t)=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==a||a(t))},[a]),g=h.useCallback(()=>t.map(e=>o?h.createElement(o,{key:e.id,suggestion:e,onClick:()=>{null==a||a(e)}}):h.createElement("span",{role:"button",tabIndex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:()=>!e.disabled&&(null==a?void 0:a(e)),onKeyDown:t=>!e.disabled&&p(t,e),key:e.id,title:e.description,className:n.classNames("classic"===l?"k-prompt-suggestion":"k-suggestion",{"k-disabled":e.disabled})},e.text)),[t,o,a,l,p]);if(!t||0===t.length)return null;if("classic"===l)return g();const f="scroll"===s||"scrollbuttons"===s,v=h.createElement("div",{role:"group",className:n.classNames("k-suggestion-group",{"k-suggestion-group-scrollable":"scroll"===s,"k-suggestion-group-scrollable-start":u&&("scroll"===s||"scrollbuttons"===s),"k-suggestion-group-scrollable-end":c&&("scroll"===s||"scrollbuttons"===s)})},f?h.createElement("div",{className:"k-suggestions-scroll",ref:i},g()):g());return h.createElement(Ie,{visible:"scrollbuttons"===s,dir:r,canScrollLeft:c,canScrollRight:u,onScrollLeft:m,onScrollRight:d},v)},Le=h.forwardRef(({onFilesAdd:e,files:t=[],restrictions:n,multiple:l=!0,accept:o,uploadRef:s,onSelectAttachments:r,onRemoveAttachment:c,_registerRemoveCallback:u,...m},d)=>{h.useEffect(()=>(u&&c&&u(c),()=>{u&&c&&u(void 0)}),[c,u]);const p=h.useCallback(t=>{e&&e(t),r&&r({selectedFiles:t.affectedFiles,allFiles:t.newState})},[e,r]);return h.createElement(h.Fragment,null,h.createElement(a.Button,{ref:d,...m}),h.createElement(i.Upload,{ref:s,files:t,onAdd:p,autoUpload:!1,restrictions:n,multiple:l,accept:o,className:"k-hidden"}))});Le.displayName="PromptBoxUploadButton";const Be=h.forwardRef((e,t)=>{const{text:n,children:l,...o}=e,s=void 0!==n?n:l,r=""===s||null===s||"boolean"==typeof s?void 0:s;return h.createElement(a.Button,{ref:t,...o},r)});Be.displayName="PromptBoxActionButton";const De=h.forwardRef((e,t)=>h.createElement(a.SpeechToTextButton,{ref:t,...e}));De.displayName="PromptBoxSpeechToTextButton";const Pe=e=>"."+e.split(".").pop()||"",ze=e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`},Oe=({files:e,onRemoveFile:t,header:o})=>{const r=s.useLocalization(),i=h.useRef(null),[c,u]=h.useState(!1),[m,d]=h.useState(!1),p=h.useCallback(()=>{const e=i.current;if(!e)return;const{scrollLeft:t,scrollWidth:n,clientWidth:a}=e,l=t+a>=n-1;d(!(0===t)),u(!l)},[]);if(h.useLayoutEffect(()=>{p()},[e,p]),h.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>p(),n=new ResizeObserver(p);return n.observe(e),e.addEventListener("scroll",t,{passive:!0}),()=>{e.removeEventListener("scroll",t),n.disconnect()}},[p,e.length]),0===e.length&&!o)return null;const g=(e=>e?"function"==typeof e?e():e:null)(o),f=e.length>0&&h.createElement("ul",{role:"list","aria-label":r.toLanguageString(Y,me[Y]),className:n.classNames("k-file-box-wrapper",{"k-file-box-wrapper-scrollable-start":c,"k-file-box-wrapper-scrollable-end":m})},h.createElement("div",{className:"k-files-scroll",role:"presentation",ref:i},e.map((e,o)=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem",tabIndex:0===o?0:-1,"aria-label":[e.name,ze(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(Pe(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},ze(e.size))),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:n=>{n.stopPropagation(),t(e.name)},"aria-label":`${r.toLanguageString(W,me[W])} ${e.name}`,title:`${r.toLanguageString(W,me[W])} ${e.name}`})))));return h.createElement("div",{className:"k-prompt-box-header"},g,f)},qe=(e,t,n,a)=>{var l;const{text:o,"aria-label":s}=null!=e?e:{text:void 0,"aria-label":void 0},r=t||null!=o?o:a.toLanguageString(V,me[V]),i=""!==r?r:void 0;return{text:i,"aria-label":null!=(l=null!=s?s:t?void 0:i)?l:n}},Ke=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"17.0.0-develop.5",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"}),He="k-prompt-box",Ue={mode:"auto",rows:1,defaultValue:"",disabled:!1,readOnly:!1,loading:!1,uploadButtonConfig:!1,speechToTextButtonConfig:!0,actionButtonConfig:!0},$e=h.forwardRef((e,t)=>{const a=!n.validatePackage(Ke,{component:"PromptBox"}),o=n.getLicenseMessage(Ke),r=s.useLocalization(),i={...Ue,...e},{mode:c=Ue.mode,fillMode:u,rows:m=Ue.rows,maxTextAreaHeight:d,value:p,defaultValue:g=Ue.defaultValue,disabled:f=Ue.disabled,readOnly:v=Ue.readOnly,placeholder:k,title:b,maxLength:E,inputAttributes:y,topAffix:C,startAffix:x,endAffix:I,header:T,onChange:N,onFocus:w,onBlur:F,onPromptAction:S,attachments:R,loading:A=Ue.loading,uploadButtonConfig:M=Ue.uploadButtonConfig,speechToTextButtonConfig:L=Ue.speechToTextButtonConfig,actionButtonConfig:B=Ue.actionButtonConfig,className:D,style:P,...z}=i,O=h.useRef(null),[q,K]=h.useState(g),[H,V]=h.useState([]),[W,_]=h.useState(!1),Y=h.useRef(null),J=h.useRef(null),X=h.useRef(0),Q=h.useRef(0),Z=h.useRef(!1),ee=h.useRef(0),te=h.useRef(0),ne=h.useCallback((e,t)=>e?"function"==typeof e?e(t):e:null,[]),ae=void 0!==p,le=ae?p:q,oe=void 0!==R,se=oe?R:H,re=h.useMemo(()=>!!(null!=le&&le.trim()||se.length>0),[le,se.length]),ie=h.useCallback(()=>{if(!O.current||"single"===c)return;const e=O.current,t=globalThis.getComputedStyle(e),n=Number.parseFloat(t.lineHeight)||20,a=Number.parseFloat(t.paddingTop)||0,l=Number.parseFloat(t.paddingBottom)||0;X.current=e.offsetHeight||n+a+l,Q.current=n*m+a+l,"auto"===c&&!W&&(te.current=e.offsetWidth)},[c,m,W]),ce=h.useCallback(()=>"auto"===c?1:m,[c,m]),ue=h.useCallback(e=>{if(d){const t=Number.parseInt(d,10);if(e>t)return t}return Math.max(Q.current,e)},[d]),de=h.useCallback(e=>{e.style.overflow="hidden",e.style.height=`${X.current}px`;const t=e.scrollHeight,n=ue(t);e.style.height=`${n}px`,d&&t>Number.parseInt(d,10)&&(e.style.overflow="")},[ue,d]),pe=h.useCallback(e=>{e.style.overflow="hidden",e.style.height=`${X.current}px`;const t=e.scrollHeight,n=d?Math.min(t,Number.parseInt(d,10)):t;e.style.height=`${n}px`,d&&t>Number.parseInt(d,10)&&(e.style.overflow="")},[d]),ge=h.useCallback(e=>{if(te.current<=0)return!1;const t=e.style.height,n=e.style.width;e.style.overflow="hidden",e.style.width=`${te.current}px`,e.style.height=`${X.current}px`;const a=e.scrollWidth<=te.current&&e.scrollHeight<=X.current;return e.style.overflow="",e.style.width=n||"",e.style.height=t||"",a},[]),fe=h.useCallback((e,t)=>{if(!Z.current){if((e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&!W)return Z.current=!0,void _(!0);if(W){pe(e);t<ee.current&&ge(e)&&(e.style.height="",Z.current=!0,_(!1))}}},[W,pe,ge]),he=h.useCallback(()=>{var e;if("single"===c||!O.current)return;const t=O.current,n=(null==(e=t.value)?void 0:e.length)||0;"multi"===c?de(t):"auto"===c&&fe(t,n)},[c,de,fe]);h.useEffect(()=>{"single"!==c&&O.current&&ie()},[c,ie]),h.useEffect(()=>{"single"!==c&&O.current&&(ie(),he())},[m,c,ie,he]),h.useEffect(()=>{if("single"!==c&&O.current){const e=(null==le?void 0:le.length)||0;requestAnimationFrame(()=>{if(O.current){const t=O.current;"multi"===c?de(t):"auto"===c&&fe(t,e),ee.current=e}})}},[le,c,de,fe]),h.useEffect(()=>{"auto"===c&&W&&O.current&&requestAnimationFrame(()=>{if(O.current){const e=O.current;pe(e),Z.current=!1}})},[W,c,pe]),h.useEffect(()=>{if("auto"===c&&O.current){const e=O.current;W||(e.style.height="",e.style.overflow="",Z.current=!1)}},[c,W]),h.useEffect(()=>{if("single"===c||!O.current)return;const e=O.current;let t;const n=new ResizeObserver(()=>{clearTimeout(t),t=setTimeout(()=>{O.current&&("auto"===c&&!W&&ie(),he())},50)});return n.observe(e),()=>{n.disconnect(),clearTimeout(t)}},[c,W,ie,he]);const ve=h.useCallback(()=>({focus:()=>{var e;return null==(e=O.current)?void 0:e.focus()},blur:()=>{var e;return null==(e=O.current)?void 0:e.blur()},element:O.current,get value(){return le}}),[le]);h.useImperativeHandle(t,ve);const ke=h.useCallback(e=>{const t=e.target.value;!ae&&!f&&K(t),N&&!f&&n.dispatchEvent(N,e,{...ve(),value:t},{value:t}),"single"!==c&&he()},[K,N,f,ae,ve,c,he]),be=h.useCallback(e=>{w&&!f&&n.dispatchEvent(w,e,ve(),void 0)},[w,f,ve]),Ee=h.useCallback(e=>{F&&!f&&n.dispatchEvent(F,e,ve(),void 0)},[F,f,ve]),ye=h.useCallback(e=>{e.preventDefault()},[]),Ce=h.useCallback(e=>{S&&n.dispatchEvent(S,e,ve(),{value:le,attachments:se}),ae||K(""),oe||V([])},[S,ve,le,se,ae,oe]),xe=h.useCallback(e=>{if("Enter"!==e.key||!e.shiftKey){if("ArrowUp"===e.key||"ArrowDown"===e.key)return void e.stopPropagation();if("Enter"===e.key){if(e.preventDefault(),A)return;re&&Ce(e)}}},[Ce,A,re]),Ie={disabled:f,readOnly:v,placeholder:k,title:b,maxLength:E,"aria-label":r.toLanguageString(U,me[U]),value:le,onKeyDown:xe,...y,onChange:ke,onFocus:be,onBlur:Ee,ref:O},Te=h.useCallback(e=>{var t,a;const{isFinal:l,alternatives:o}=e;if(o.length>0){const e=o[0];if(l){const a=(null==(t=O.current)?void 0:t.value)||"",l=(a?`${a} `:"")+e.transcript;if(ae||K(l),N&&!f){const e={target:O.current,currentTarget:O.current};n.dispatchEvent(N,e,{...ve(),value:l},{value:l})}}}null==(a=O.current)||a.focus()},[ae,N,f,ve]),Ne=h.useCallback(()=>{var e,t;null==(t=null==(e=Y.current)?void 0:e.actionElement)||t.click()},[]),we=h.useCallback(e=>{var t;const n=Array.from(e.affectedFiles),a="object"==typeof M&&M.onSelectAttachments;oe||V(e=>[...e,...n]),a&&a({selectedFiles:e.affectedFiles,allFiles:e.newState}),null==(t=O.current)||t.focus()},[M,oe]),Fe=h.useMemo(()=>({uploadButtonProps:{fillMode:"flat",svgIcon:l.paperclipIcon,size:"small",rounded:"full",onClick:Ne,onFilesAdd:we,files:se,uploadRef:Y,"aria-label":r.toLanguageString(j,me[j]),title:r.toLanguageString(j,me[j]),_registerRemoveCallback:e=>{J.current=e}},speechToTextButtonProps:{fillMode:"flat",size:"small",rounded:"full",onResult:Te},actionButtonProps:{rounded:"full",size:"small",svgIcon:A?l.stopIcon:l.arrowUpIcon,className:A?"k-generating k-active":"",onClick:Ce,onMouseDown:ye,disabled:!A&&!re,"aria-label":A?r.toLanguageString(G,me[G]):r.toLanguageString($,me[$]),title:A?r.toLanguageString(G,me[G]):r.toLanguageString($,me[$]),"aria-live":"polite"}}),[Te,we,se,Ce,ye,A,Ne,r,re]),Se=h.useCallback(e=>{oe||V(t=>t.filter(t=>t.name!==e));const t="object"==typeof M&&M.onRemoveAttachment;t&&(J.current=t),J.current&&J.current(e)},[M,oe]),Re=()=>{const e=!1!==L,t=!1!==B,n=!1!==M,a="object"==typeof L?L:void 0,l="object"==typeof M?M:{},{restrictions:o,multiple:s=!0,accept:i,onSelectAttachments:c,onRemoveAttachment:u,...m}=l,d={restrictions:o,multiple:s,accept:i},p="object"==typeof B?B:void 0,g=qe(p,A,Fe.actionButtonProps["aria-label"],r),f={...p,...g};return h.createElement(h.Fragment,null,n&&h.createElement(Le,{...Fe.uploadButtonProps,restrictions:d.restrictions,multiple:d.multiple,accept:d.accept,...m}),e&&h.createElement(De,{...Fe.speechToTextButtonProps,...a}),t&&h.createElement(Be,{...Fe.actionButtonProps,...f}))},Ae="multi"===c||"auto"===c&&W,Me=!1!==M||!1!==L||!1!==B,Pe=I||Me,ze=x||I||Me;return h.createElement("div",{...z,className:n.classNames(D,"k-input",He,{[`k-input-${u}`]:u,"k-disabled":f,"k-prompt-box-singleline":"single"===c,"k-prompt-box-multiline":Ae}),style:P},h.createElement(Oe,{files:se,onRemoveFile:Se,header:T}),"single"===c?h.createElement("div",{className:`${He}-content`},x&&h.createElement("div",{className:`${He}-affix`},ne(x,Fe)),h.createElement("input",{...Ie,className:n.classNames("k-input-inner",`${He}-input`)}),Pe?h.createElement("div",{className:`${He}-affix`},I&&ne(I,Fe),Re()):null):h.createElement("div",{className:`${He}-content`},"multi"===c&&C&&h.createElement("div",{className:`${He}-affix`},ne(C,Fe)),"auto"===c&&!W&&x&&h.createElement("div",{className:`${He}-affix`},ne(x,Fe)),h.createElement("textarea",{...Ie,className:n.classNames("k-input-inner",`${He}-textarea`),rows:ce(),style:d?{maxHeight:d}:{},"aria-multiline":"true"}),"auto"===c&&!W&&Pe?h.createElement("div",{className:`${He}-affix`},I&&ne(I,Fe),Re()):null,Ae&&ze?h.createElement("div",{className:`${He}-affix`},x&&ne(x,Fe),(x||I)&&h.createElement("div",{className:"k-spacer"}),I&&ne(I,Fe),Re()):null),a&&h.createElement(n.WatermarkOverlay,{message:o}))});$e.propTypes={value:r.string,defaultValue:r.string,mode:r.oneOf(["single","multi","auto"]),rows:r.number,maxTextAreaHeight:r.string,title:r.string,disabled:r.bool,readOnly:r.bool,placeholder:r.string,maxLength:r.number,inputAttributes:r.object,fillMode:r.oneOf(["solid","flat","outline"]),topAffix:r.oneOfType([r.func,r.element,r.string]),startAffix:r.oneOfType([r.func,r.element,r.string]),endAffix:r.oneOfType([r.func,r.element,r.string]),header:r.oneOfType([r.func,r.element,r.string]),onChange:r.func,onFocus:r.func,onBlur:r.func,loading:r.bool,uploadButtonConfig:r.oneOfType([r.bool,r.object]),speechToTextButtonConfig:r.oneOfType([r.bool,r.object]),actionButtonConfig:r.oneOfType([r.bool,r.object]),attachments:r.array,onPromptAction:r.func,className:r.string,style:r.object},$e.displayName="KendoPromptBox";const Ve=h.memo(({affixProps:e,uploadConfig:t,localizationService:n,onFilesSelect:a,onFileRemove:l})=>{const o="object"==typeof t?t:{};return!1!==t?h.createElement(Le,{...e.uploadButtonProps,fillMode:"clear","aria-label":n.toLanguageString(B,me[B]),title:n.toLanguageString(B,me[B]),...o,onSelectAttachments:a,onRemoveAttachment:l}):null});Ve.displayName="UploadButtonAffix";const je=h.forwardRef((e,t)=>{const{onSendMessage:o,isDirectionRightToLeft:r,placeholder:i,MessageBox:c,suggestions:u,onSuggestionClick:m,inputValue:d,onInputValueChange:p,suggestionTemplate:g,sendButtonConfig:f,onInputClick:k,suggestionsLayout:E,dir:y,messageBoxSettings:C,loading:x}=e,{replyToMessage:I,setReplyToMessage:T,user:N,speechToTextConfig:w,uploadConfig:F}=ke(),[R,A]=h.useState(""),[M,L]=h.useState([]),B=h.useRef(null),D=s.useLocalization(),P=void 0!==d,z=P?d:R,O=h.useCallback(()=>{null!==B.current&&B.current.focus()},[]);h.useEffect(()=>{I&&O()},[I,O]);const q=h.useCallback(e=>{if(e.preventDefault(),o){const t={id:"",author:N,text:z||"",timestamp:new Date,replyToId:I?I.id:void 0,files:M.map(e=>({name:e.name,size:e.size,type:e.extension,rawFile:e.getRawFile?e.getRawFile():e}))};T(null),o(t,e),L([]),P||A(""),p&&p(""),O()}},[o,z,N,I,M,T,p,O,P]);h.useImperativeHandle(t,()=>({focusInput:O}),[O]);const K=h.useCallback(e=>{L(t=>t.filter(t=>t.name!==e))},[]),U=h.useCallback((e,t)=>e.isDeleted?pe(t,D):e.text,[D]),$=h.useCallback(()=>{if(I){const e=de(N,I);return h.createElement("div",{className:n.classNames("k-message-reference",e?"k-message-reference-sender":"k-message-reference-receiver")},h.createElement("div",{className:"k-message-reference-content"},U(I,e)),h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:()=>T(null),"aria-label":D.toLanguageString(S,me[S]),title:D.toLanguageString(S,me[S])}))}return null},[I,N,U,T,D]),V=h.useCallback(e=>{try{const t=Array.from(e.allFiles);L(t)}catch{}},[]),j=h.useCallback(e=>{const t=e.value;P||A(t),p&&p(t||"")},[P,p]),W=h.useCallback(e=>{q(e.syntheticEvent)},[q]),G=h.useCallback(e=>e?"function"==typeof e?e():e:null,[]),_=h.useCallback(e=>h.createElement(h.Fragment,null,h.createElement(Ve,{affixProps:e,uploadConfig:F,localizationService:D,onFilesSelect:V,onFileRemove:K}),G(null==C?void 0:C.startAffix)),[F,D,V,K,null==C?void 0:C.startAffix,G]),Y=h.useCallback(()=>G(null==C?void 0:C.endAffix),[null==C?void 0:C.endAffix,G]),J=h.useCallback(()=>G(null==C?void 0:C.topAffix),[null==C?void 0:C.topAffix,G]),X=h.useMemo(()=>{const e="object"==typeof f?f:{},t=!1!==f&&{"aria-label":x?D.toLanguageString(H,me[H]):D.toLanguageString(v,me[v]),title:x?D.toLanguageString(H,me[H]):D.toLanguageString(v,me[v]),dir:r?"rtl":void 0,...e};return h.createElement($e,{header:$(),ref:B,placeholder:i,value:z,onChange:j,onPromptAction:W,mode:(null==C?void 0:C.mode)||"multi",rows:(null==C?void 0:C.rows)||2,maxTextAreaHeight:(null==C?void 0:C.maxTextAreaHeight)||"110",loading:x,speechToTextButtonConfig:w,actionButtonConfig:t,attachments:M,startAffix:_,endAffix:null!=C&&C.endAffix?Y:void 0,topAffix:null!=C&&C.topAffix?J:void 0,inputAttributes:{onClick:k,"aria-label":D.toLanguageString(b,me[b])}})},[i,z,j,W,C,x,w,f,M,$,_,Y,J,D,r,k]);return h.createElement("div",{className:"k-message-box-wrapper"},u&&u.length>0&&h.createElement(Me,{onSuggestionClick:m,suggestions:u,suggestionTemplate:g,suggestionsLayout:E,dir:y}),c?h.createElement(c,{messageInput:X}):X)});je.displayName="NewMessage";const We=e=>h.createElement(a.Toolbar,{className:"k-chat-header",size:"small"},e.children),Ge=e=>{const{message:t,onUnpin:o,user:r,onReferencedMessageClick:i}=e,c=s.useLocalization(),u=h.useRef(null),m=r&&de(r,t),d=h.useCallback(e=>{e.preventDefault(),e.stopPropagation(),null==i||i(t.id)},[t.id,i]);return h.createElement("div",{ref:u,className:`k-message-reference ${m?"k-message-reference-sender":"k-message-reference-receiver"} k-message-pinned`,onClick:d},h.createElement(n.IconWrap,{icon:l.pinIcon}),h.createElement("div",{className:"k-message-reference-content"},t.isDeleted?r&&pe(de(r,t),c):t.text),h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:e=>{e.stopPropagation(),null==o||o(t)},"aria-label":c.toLanguageString("chat.unpinMessage",me["chat.unpinMessage"])}))},_e=e=>{const{show:t,text:n}=e;return h.createElement("div",{style:{position:"absolute",top:"90%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,pointerEvents:t?"auto":"none"}},h.createElement(c.Fade,null,t&&h.createElement(u.Notification,{type:{style:"inverse"},closable:!1},h.createElement("span",null,n))))},Ye={textField:"text",statusField:"status",authorIdField:"authorId",authorNameField:"authorName",authorImageUrlField:"authorImageUrl",authorImageAltTextField:"authorImageAltText",idField:"id",timestampField:"timestamp",filesField:"files",attachmentsField:"attachments",replyToIdField:"replyToId",isDeletedField:"isDeleted",isPinnedField:"isPinned",typingField:"typing",suggestedActionsField:"suggestedActions",isFailedField:"isFailed"},Je=(e,t={})=>{const n={...Ye,...t};let a,l;a=e.author&&"object"==typeof e.author?{id:e.author.id||e.author[n.authorIdField]||e[n.authorIdField]||"",name:e.author.name||e.author[n.authorNameField]||e[n.authorNameField],avatarUrl:e.author.avatarUrl||e.author[n.authorImageUrlField]||e[n.authorImageUrlField],avatarAltText:e.author.avatarAltText||e.author[n.authorImageAltTextField]||e[n.authorImageAltTextField]}:{id:e[n.authorIdField]||e.authorId||"",name:e[n.authorNameField]||e.authorName,avatarUrl:e[n.authorImageUrlField]||e.authorImageUrl,avatarAltText:e[n.authorImageAltTextField]||e.authorImageAltText},l=e.timestamp?new Date(e.timestamp):e[n.timestampField]?new Date(e[n.timestampField]):new Date;const o={id:void 0!==e.id?e.id:e[n.idField],text:void 0!==e.text?e.text:e[n.textField]||"",author:a,timestamp:l,status:void 0!==e.status?e.status:e[n.statusField],attachments:void 0!==e.attachments?e.attachments:e[n.attachmentsField],attachmentLayout:e.attachmentLayout||"list",suggestedActions:void 0!==e.suggestedActions?e.suggestedActions:e[n.suggestedActionsField],isPinned:void 0!==e.isPinned?e.isPinned:e[n.isPinnedField]||!1,typing:void 0!==e.typing?e.typing:e[n.typingField],files:void 0!==e.files?e.files:e[n.filesField]||[],isFailed:void 0!==e.isFailed?e.isFailed:e[n.isFailedField]||!1};return e.pinnedAt&&(o.pinnedAt=new Date(e.pinnedAt)),e.pinnedBy&&(o.pinnedBy=e.pinnedBy),void 0!==e.replyToId?o.replyToId=e.replyToId:void 0!==e[n.replyToIdField]&&(o.replyToId=e[n.replyToIdField]),void 0!==e.isDeleted?o.isDeleted=e.isDeleted:void 0!==e[n.isDeletedField]&&(o.isDeleted=e[n.isDeletedField]),{...o,dataItem:e}},Xe=(e,t={})=>Array.isArray(e)?e.map(e=>Je(e,t)):[],Qe=e=>e&&void 0!==e.id&&"string"==typeof e.text&&e.author&&"object"==typeof e.author&&void 0!==e.author.id&&(e.timestamp instanceof Date||"string"==typeof e.timestamp||"number"==typeof e.timestamp),Ze=e=>{e.scrollTop=e.scrollHeight-e.clientHeight},et=({viewItemsWrapperRef:e,isKeyboardNavigationActiveRef:t,processedMessages:n,authorId:a,autoScrollThreshold:l,isEndless:o=!1,isOnLastBatch:s=!0,skipAutoScrollRef:r})=>{var i;const c=h.useRef(a),u=h.useRef(l),m=h.useRef(o),d=h.useRef(s);h.useEffect(()=>{c.current=a,u.current=l,m.current=o,d.current=s});const p=h.useRef(!1);h.useEffect(()=>{o||!e.current||0===n.length||p.current||(Ze(e.current),p.current=!0)},[e,o,n.length]);const g=h.useRef(void 0),f=h.useRef(0),v=h.useRef(!0),k=h.useRef(!0),b=h.useRef(!1),E=h.useRef(null),y=(n.length>0?null==(i=n.at(-1))?void 0:i.id:void 0)!==g.current,C=n.length>f.current;if(y||C){const t=e.current;k.current=!t||(e=>{const{scrollHeight:t,scrollTop:n,clientHeight:a}=e;return!(t>a)||t-n-a<=100})(t)}h.useEffect(()=>{var a,l;const o=n.length,s=o>0?null==(a=n[o-1])?void 0:a.id:void 0,i=g.current,p=f.current,h=v.current;if(g.current=s,f.current=o,v.current=!1,0===o)return;const y=e.current;if(!y||t.current)return;if(h||s===i)return void(!m.current&&(h||o>p)&&(Ze(y),b.current=!1,E.current=null));if(m.current&&!d.current)return;if(null!=r&&r.current)return void(r.current=!1);const C=n[o-1];if(void 0!==c.current&&void 0!==(null==(l=null==C?void 0:C.author)?void 0:l.id)&&String(C.author.id)===String(c.current))return y.scrollTo({top:y.scrollHeight-y.clientHeight,behavior:"smooth"}),b.current=!1,void(E.current=null);if(!k.current)return b.current=!1,void(E.current=null);const x=(e=>{const t=e.querySelectorAll(".k-message");return t.length>0?t[t.length-1]:null})(y);if(!x)return;const I=(e=>{const t=e.querySelector(".k-message-pinned");return t?t.offsetHeight:0})(y),T=Math.max(0,y.clientHeight-I),N=((e,t)=>{const n=null!=e?e:"20%";let a;if("number"==typeof n)a=n;else{const e=/^(-?\d+(?:\.\d+)?)%$/.exec(String(n));if(e)a=Number.parseFloat(e[1])/100*t;else{const e=Number.parseFloat(String(n));a=Number.isNaN(e)?.2*t:e}}return Math.min(a,t)})(u.current,T),w=x.getBoundingClientRect().top-y.getBoundingClientRect().top+y.scrollTop,F=Math.max(0,w-N-I),S=Math.max(0,y.scrollHeight-y.clientHeight),R=Math.min(F,S);R>y.scrollTop&&y.scrollTo({top:R,behavior:"smooth"}),E.current=F,b.current=!0},[n,e,t]),h.useEffect(()=>{const n=e.current;if(!n)return;let a=n.querySelectorAll(".k-message").length,l=n.scrollHeight,o=n.scrollTop;const s=()=>{const e=n.scrollTop;b.current&&e<o&&(b.current=!1,E.current=null),o=e},r=new MutationObserver(()=>{if(t.current)return;const e=n.querySelectorAll(".k-message").length,s=n.scrollHeight;if(e===a&&s>l&&b.current){const e=s-n.clientHeight,t=E.current,a=null===t?e:Math.min(e,t);a>n.scrollTop&&(n.scrollTop=a),o=n.scrollTop}a=e,l=s});return r.observe(n,{childList:!0,subtree:!0,characterData:!0}),n.addEventListener("scroll",s,{passive:!0}),()=>{r.disconnect(),n.removeEventListener("scroll",s)}},[e,t])},tt=["allowMessageCollapse","messageWidthMode","showAvatar","showUsername","messageTemplate","messageContentTemplate","messageToolbarActions","messageContextMenuActions","fileActions"];function nt(e,t,n,a,l){const o=((e,t)=>{var n,a;return(null==(n=null==e?void 0:e.author)?void 0:n.id)===t||(null==(a=null==e?void 0:e.author)?void 0:a.id)===String(t)})(e,t)?a:l,s={};return tt.forEach(e=>{var t;s[e]=null!=(t=null==o?void 0:o[e])?t:null==n?void 0:n[e]}),s}const at=({scrollMode:e,processedMessages:t,total:n,pageSize:a=50,startIndex:l,endIndex:o,onLoadMoreMessages:s,onReferencedMessageClick:r,viewItemsWrapperRef:i,authorId:c})=>{const u=h.useRef(!1),m="endless"===e,d=null!=n?n:t.length,p=m&&t.length===d&&!u.current,g=m&&(t.length<d||u.current);g&&(u.current=!0);const[f,v]=h.useState(-1),[k,b]=h.useState(-1),E=h.useRef(f),y=h.useRef(k);E.current=f,y.current=k;const C=h.useRef(!1),x=h.useRef(0),I=h.useRef(0),T=h.useRef(0),N=h.useRef(!1),w=h.useRef(d),F=h.useRef(c);F.current=c;const S=h.useRef(!1),R=h.useRef(null),A=h.useRef(!1),M=h.useRef(!1),L=h.useRef(!0),B=h.useRef(d);h.useEffect(()=>{if(p){if(u.current)return void((-1===f||-1===k)&&(v(0),b(t.length)));if(-1===f||-1===k){const e=Math.max(0,t.length-a),n=t.length;v(e),b(n)}else if(k<t.length){const e=w.current;if(y.current>=e)b(t.length);else if(t.length>e&&t.slice(e).some(e=>{var t;return void 0!==(null==(t=e.author)?void 0:t.id)&&String(e.author.id)===String(F.current)})){const e=Math.max(0,t.length-a);v(e),b(t.length),A.current=!0}}w.current=d}},[p,t.length,a,f,k,d]);const D=null!=l?l:0,P=null!=o?o:t.length,z=h.useCallback(()=>{const e=i.current;e&&(x.current=e.scrollHeight,I.current=e.scrollTop,T.current=e.querySelectorAll("[data-message-id]").length)},[i]),O=h.useCallback(e=>{var t,n,a;((e,t,n=0)=>{if(!t)return;const a=t.querySelector(`[data-message-id="${e}"]`);if(!a)return;const l=t.querySelector(".k-message-list");if(l){const e=l.getBoundingClientRect().top,t=a.getBoundingClientRect().top,o=l.scrollTop+(t-e)-n;l.scrollTo({top:o,behavior:"smooth"})}else a.scrollIntoView({behavior:"smooth",block:"start"})})(e,null==(t=i.current)?void 0:t.closest(".k-chat"),(null==(a=null==(n=i.current)?void 0:n.querySelector(".k-message-pinned"))?void 0:a.offsetHeight)||0)},[i]);h.useLayoutEffect(()=>{if(!N.current)return;const e=i.current;if(!e)return void(N.current=!1);if(e.querySelectorAll("[data-message-id]").length<=T.current)return;const t=e.scrollHeight-x.current;t>0&&(e.scrollTop=I.current+t),N.current=!1,C.current=!1}),h.useLayoutEffect(()=>{if(!A.current)return;const e=i.current;e?k>=t.length&&k>0&&(A.current=!1,e.scrollTop=e.scrollHeight-e.clientHeight):A.current=!1});const q=h.useRef(!1);h.useLayoutEffect(()=>{if(!m||q.current)return;const e=i.current;e&&e.querySelector("[data-message-id]")&&(e.scrollTop=e.scrollHeight-e.clientHeight,q.current=!0)}),h.useEffect(()=>{if(!m)return;const e=i.current;if(!e)return;let n=e.scrollTop;const l=()=>{const{scrollTop:l,scrollHeight:o,clientHeight:r}=e,i=l<n,c=l>n;if(n=l,!C.current){if(i&&l<=100)if(p){const e=E.current;if(e>0){const t=Math.max(0,e-a);N.current=!0,z(),v(t),null==s||s({startIndex:t,endIndex:y.current})}}else if(g&&D>0){C.current=!0;const e=Math.max(0,D-a);N.current=!0,z(),null==s||s({startIndex:e,endIndex:P})}if(c&&o-l-r<=100)if(p){const e=y.current;if(e<t.length){const n=Math.min(t.length,e+a);M.current=!0,b(n),null==s||s({startIndex:E.current,endIndex:n})}}else if(g&&P<d){C.current=!0,M.current=!0;const e=Math.min(d,P+a);null==s||s({startIndex:D,endIndex:e})}}};return e.addEventListener("scroll",l,{passive:!0}),()=>e.removeEventListener("scroll",l)},[m,p,g,i,a,t.length,D,P,d,s]),h.useEffect(()=>{var e;const n=P>=d;if(!g)return B.current=d,void(L.current=n);const a=B.current,l=L.current;if(B.current=d,L.current=n,d>a&&!l&&n){const n=t[t.length-1];void 0!==F.current&&void 0!==(null==(e=null==n?void 0:n.author)?void 0:e.id)&&String(n.author.id)===String(F.current)&&(S.current=!0,M.current=!0)}},[g,d,P,t]),h.useEffect(()=>{!g||!S.current||(S.current=!1,C.current=!1,requestAnimationFrame(()=>{const e=i.current;e&&(e.scrollTop=e.scrollHeight-e.clientHeight)}))},[g,t,i]),h.useEffect(()=>{if(!g||null===R.current)return;const e=R.current,t=i.current;t&&t.querySelector(`[data-message-id="${e}"]`)&&(R.current=null,C.current=!1,requestAnimationFrame(()=>{O(e)}))},[g,t,i,O]),h.useEffect(()=>{g&&C.current&&!N.current&&(C.current=!1)},[g,D,P]);const K=h.useMemo(()=>{if(p){const e=Math.max(0,f),n=Math.min(t.length,k);if(e>=n){const e=Math.max(0,t.length-a);return t.slice(e)}return t.slice(e,n)}return t},[p,t,f,k,a]),H=h.useMemo(()=>!m||(p?k>=t.length:P>=d),[m,p,k,t.length,P,d]),U=h.useCallback(()=>{if(!m||H){const e=i.current;return void(e&&e.scrollTo({top:e.scrollHeight-e.clientHeight,behavior:"smooth"}))}if(!C.current)if(p){const e=Math.max(0,t.length-a);v(e),b(t.length),null==s||s({startIndex:e,endIndex:t.length}),requestAnimationFrame(()=>{const e=i.current;e&&(e.scrollTop=e.scrollHeight-e.clientHeight)})}else if(g){S.current=!0,N.current=!1,C.current=!0;const e=Math.max(0,d-a);null==s||s({startIndex:e,endIndex:d})}},[m,p,g,H,t.length,a,d,s,i]),$=h.useCallback(e=>{if(m){if(p){const n=i.current;if(null==n?void 0:n.querySelector(`[data-message-id="${e}"]`))O(e);else{if(C.current)return;const n=t.findIndex(t=>t.id===e||String(t.id)===String(e));if(n>=0){const l=Math.floor(a/2),o=Math.max(0,n-l),s=Math.min(t.length,o+a);C.current=!0,v(o),b(s),requestAnimationFrame(()=>{requestAnimationFrame(()=>{O(e),C.current=!1})})}}}else if(g){const t=i.current;if(null==t?void 0:t.querySelector(`[data-message-id="${e}"]`))O(e);else{if(C.current)return;R.current=e,N.current=!1,C.current=!0}}}else O(e);null==r||r({id:e})},[m,p,g,i,t,a,r,O]);return{renderedMessages:K,handleScrollToBottom:U,handleReferencedMessageClick:$,isEndless:m,isOnLastBatch:H,skipAutoScrollRef:M}},lt=h.forwardRef((e,t)=>{const{messages:o=[],messageTemplate:r,messageContentTemplate:i,attachmentTemplate:c,width:u,height:m,onSendMessage:d,onSuggestionClick:p,onInputValueChange:g,onActionExecute:f,dir:v,messageBox:k,placeholder:b,className:E,style:C,message:x=Ee,authorId:I,suggestions:T,suggestionTemplate:N,suggestionsLayout:F="scroll",quickActionsLayout:S="scroll",inputValue:R,headerTemplate:A,noDataTemplate:M,timestampTemplate:L,statusTemplate:B,userStatusTemplate:D,allowMessageCollapse:P,messageToolbarActions:z,messageContextMenuActions:q,fileActions:K,onUnpin:H,messageWidthMode:U,showAvatar:$,showUsername:V,timestampVisibility:j,authorMessageSettings:W,receiverMessageSettings:G,onToolbarAction:_,onContextMenuAction:Y,onFileAction:J,onDownload:X,speechToTextConfig:Q,uploadConfig:Z,sendButtonConfig:ee,messageFilesLayout:te,scrollToBottomButton:ne=!0,autoScrollThreshold:ae,textField:le,statusField:oe,authorIdField:se,authorNameField:re,authorImageUrlField:ie,authorImageAltTextField:ce,idField:ue,timestampField:de,filesField:pe,attachmentsField:ge,replyToIdField:fe,isDeletedField:he,isPinnedField:ke,typingField:be,suggestedActionsField:ye,isFailedField:xe,onResendMessage:Ie,messageBoxSettings:Te,loading:Ne,scrollMode:Fe,total:Me,pageSize:Le,startIndex:Be,endIndex:De,onLoadMoreMessages:Pe,pinnedMessages:ze,repliedToMessages:Oe,onReferencedMessageClick:qe,...He}=e,Ue=h.useRef(null);n.useWebMcpRegister("chat",Ue,e,e.webMcp);const[$e,Ve]=h.useState(null),[Ye,Je]=h.useState(!1),[Ze,tt]=h.useState(!1),[lt,ot]=h.useState(null),[st,rt]=h.useState(null),[it,ct]=h.useState(!1),ut=h.useRef(null),mt=h.useRef(null),dt=h.useRef(null),pt=h.useRef(null),gt=h.useRef(void 0),ft=h.useRef(!1),ht=h.useRef(null),vt=h.useRef(""),kt=h.useMemo(()=>{if(!o||0===o.length)return[];const e={textField:le,statusField:oe,authorIdField:se,authorNameField:re,authorImageUrlField:ie,authorImageAltTextField:ce,idField:ue,timestampField:de,filesField:pe,attachmentsField:ge,replyToIdField:fe,isDeletedField:he,isPinnedField:ke,typingField:be,suggestedActionsField:ye,isFailedField:xe};return!Object.values(e).some(e=>void 0!==e)&&Qe(o[0])?o.map(e=>({...e,timestamp:e.timestamp?new Date(e.timestamp):e.timestamp})):Xe(o,e)},[o,le,oe,se,re,ie,ce,ue,de,pe,ge,fe,he,ke,be,ye,xe]);h.useEffect(()=>{if(I===vt.current&&ht.current)rt(ht.current);else if(I&&kt.length>0){const e=kt.find(e=>e.author&&(e.author.id===I||e.author.id===String(I))),t=(null==e?void 0:e.author)||{id:I};ht.current=t,vt.current=I,rt(t)}},[I,kt]);const{renderedMessages:bt,handleScrollToBottom:Et,handleReferencedMessageClick:yt,isEndless:Ct,isOnLastBatch:xt,skipAutoScrollRef:It}=at({scrollMode:Fe,processedMessages:kt,total:Me,pageSize:Le,startIndex:Be,endIndex:De,onLoadMoreMessages:Pe,onReferencedMessageClick:qe,viewItemsWrapperRef:dt,authorId:I}),Tt=h.useMemo(()=>bt.length>0?(e=>{const t=e.slice().reduce(Ce(e.length),[]);return function(e){let t=0;e.forEach(e=>{"message-group"===e.type?e.messages.forEach(e=>{e.selectionIndex=t++}):("attachment-group"===e.type||"action-group"===e.type)&&(e.selectionIndex=t++)}),e.lastSelectionIndex=t-1}(t),t})(bt):[],[bt]),Nt=h.useMemo(()=>!n.validatePackage(Ke,{component:"Chat"}),[]),wt=n.getLicenseMessage(Ke),Ft=h.useMemo(()=>{if(ze)return ze.find(e=>e.isPinned);const e=kt.find(e=>e.isPinned);return e||void 0},[kt,ze]),St=s.useLocalization();et({viewItemsWrapperRef:dt,isKeyboardNavigationActiveRef:ft,processedMessages:bt,authorId:I,autoScrollThreshold:ae,isEndless:Ct,isOnLastBatch:xt,skipAutoScrollRef:It});const Rt=(({elementRef:e})=>{const[t,n]=h.useState(!1);return h.useEffect(()=>{const t=e.current;if(!t)return;const a=()=>{n(t.scrollHeight>t.clientHeight)};a();const l=new ResizeObserver(a);l.observe(t);const o=new MutationObserver(()=>{requestAnimationFrame(a)});return o.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),o.disconnect()}},[e]),t})({elementRef:dt}),At=h.useCallback(()=>{clearTimeout(gt.current)},[]),Mt=h.useCallback(()=>{gt.current=window.setTimeout(()=>{Ve(null)},0)},[]),Lt=h.useCallback(e=>{Ve(e)},[]),Bt=h.useCallback(e=>{let t=null;const a=null!==$e?$e:Tt.lastSelectionIndex;e.keyCode===n.Keys.up?null===a?t=0:a>0&&(t=a-1):e.keyCode===n.Keys.down?null===a?t=0:a<Tt.lastSelectionIndex&&(t=a+1):e.keyCode===n.Keys.home?t=0:e.keyCode===n.Keys.end&&(t=Tt.lastSelectionIndex),null!==t&&(Ve(t),ft.current=!0,e.preventDefault())},[$e,Tt]),Dt=h.useCallback((e,t,a)=>{var l;if(f&&f({action:{value:e.value,title:e.title,type:e.type},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget}),!t.isDefaultPrevented()){switch(e.type){case"reply":d&&d({message:{id:"",author:st,text:e.value,timestamp:new Date},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget});break;case"call":window.open("tel:"+e.value);break;case"openUrl":{const t=n.sanitizeUrl(e.value);t&&window.open(t,"_blank","noopener,noreferrer");break}}null==(l=pt.current)||l.focusInput()}},[f,d,st]),Pt=h.useCallback(()=>n.classNames("k-chat",E,{"k-rtl":Ye}),[E,Ye]),zt=h.useCallback(()=>{const e=Tt.length-1;return Tt.map((t,n)=>{var a,l,o,s,u,m;if("date-marker"===t.type)return h.createElement(Re,{item:t,key:t.trackBy,timestampTemplate:L});if("message-group"===t.type){const o={allowMessageCollapse:P,messageWidthMode:U,showAvatar:$,showUsername:V,messageTemplate:r,messageContentTemplate:i,messageToolbarActions:z,messageContextMenuActions:q,fileActions:K},s=nt(null==(a=t.messages)?void 0:a[0],I,o,W,G);return h.createElement(Ae,{group:t,itemTemplate:s.messageTemplate,contentTemplate:s.messageContentTemplate,attachmentTemplate:c,user:st,selectedItemIndex:$e,onRequestSelection:Lt,isLastGroup:n===e,key:null!=(l=t.messages[0].id)?l:t.messages[0].selectionIndex,message:x,allowMessageCollapse:s.allowMessageCollapse,messageToolbarActions:s.messageToolbarActions,messageContextMenuActions:s.messageContextMenuActions,fileActions:s.fileActions,messageWidthMode:s.messageWidthMode,showAvatar:s.showAvatar,showUsername:s.showUsername})}return"attachment-group"===t.type?h.createElement(Se,{group:t,itemTemplate:c,onRequestSelection:Lt,selected:t.selectionIndex===$e,isLastGroup:n===e,dir:Ye?"rtl":"ltr",key:`att-${null!=(s=null==(o=t.trackBy)?void 0:o.id)?s:t.selectionIndex}`}):"action-group"===t.type?h.createElement(we,{group:t,onActionExecute:Dt,onRequestSelection:Lt,selected:t.selectionIndex===$e,key:`act-${null!=(m=null==(u=t.trackBy)?void 0:u.id)?m:t.selectionIndex}`,quickActionsLayout:S,dir:v}):null})},[Tt,L,r,i,c,st,$e,Lt,x,P,z,q,K,U,$,V,I,W,G,Dt,S,v,Ye]),Ot=h.useCallback(()=>A?"function"==typeof A?A():A:null,[A]),qt=h.useCallback(()=>M?"function"==typeof M?M():M:null,[M]);h.useEffect(()=>{const e=void 0!==v?"rtl"===v:ut.current&&"rtl"===getComputedStyle(ut.current).direction;Je(!!e)},[v]),h.useEffect(()=>()=>{clearTimeout(gt.current)},[]),h.useEffect(()=>{if(!ne||!dt.current)return;let e,t;const n=()=>{e=void 0;const n=dt.current;if(!n)return;const{scrollHeight:a,scrollTop:l,clientHeight:o}=n;!(a>o)||a-l-o<=100?(void 0!==t&&(clearTimeout(t),t=void 0),ct(!1)):null!=t||(t=setTimeout(()=>{t=void 0,ct(!0)},300))},a=()=>{void 0===e&&(e=requestAnimationFrame(n))},l=dt.current;l.addEventListener("scroll",a,{passive:!0});const o=new MutationObserver(a);return o.observe(l,{childList:!0,subtree:!0,characterData:!0}),()=>{l.removeEventListener("scroll",a),o.disconnect(),void 0!==e&&cancelAnimationFrame(e),void 0!==t&&clearTimeout(t)}},[ne]);const Kt=h.useMemo(()=>({replyToMessage:lt,setReplyToMessage:ot,messages:kt,repliedToMessages:Oe,user:st,internalScrollContainerRef:mt,messageListScrollContainerRef:dt,onToolbarAction:_,onContextMenuAction:Y,onFileAction:J,setShowCopyNotification:tt,onDownload:X,onResendMessage:Ie,fileActions:K,speechToTextConfig:Q,uploadConfig:Z,statusTemplate:B,userStatusTemplate:D,messageFilesLayout:te,timestampVisibility:j,onReferencedMessageClick:yt}),[lt,ot,kt,Oe,st,_,Y,J,tt,X,Ie,K,Q,Z,B,D,te,j,yt]);return h.createElement(ve.Provider,{value:Kt},h.createElement("div",{style:{width:u,height:m,position:"relative",overflow:"hidden",...C},onKeyDown:Bt,className:Pt(),ref:e=>{ut.current=e,mt.current=e,"function"==typeof t?t(e):t&&(t.current=e)},...He},void 0!==A&&h.createElement(We,null,Ot()),h.createElement("div",{className:"k-message-list",onBlur:Mt,onFocus:At,role:"log","aria-label":St.toLanguageString(y,me[y]),"aria-live":"polite",ref:dt,style:{scrollBehavior:"auto"}},Ft&&h.createElement(Ge,{message:Ft,onUnpin:H,user:st,onReferencedMessageClick:yt}),h.createElement("div",{className:n.classNames("k-message-list-content",{"k-message-list-content-empty":0===bt.length})},0===bt.length&&void 0!==M&&qt(),bt.length>0&&zt()),ne&&(it||!xt)&&h.createElement("div",{className:"k-chat-scroll-to-bottom-container"},h.createElement(a.FloatingActionButton,{svgIcon:l.arrowDownIcon,size:"small",themeColor:"base",rounded:"full",onClick:Et,"aria-label":St.toLanguageString(O,me[O]),title:St.toLanguageString(O,me[O])}))),Rt&&h.createElement("div",{className:"k-separator"}),h.createElement(je,{onSendMessage:(e,t)=>{d&&d({message:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},onSuggestionClick:e=>{p&&p(e)},isDirectionRightToLeft:Ye,ref:pt,placeholder:b,MessageBox:k,suggestions:T,suggestionTemplate:N,inputValue:R,onInputValueChange:e=>{g&&g(e)},onInputClick:()=>{ft.current=!1},sendButtonConfig:ee,suggestionsLayout:F,dir:v,messageBoxSettings:Te,loading:Ne}),h.createElement(_e,{show:Ze,text:St.toLanguageString(w,me[w])}),Nt&&h.createElement(n.WatermarkOverlay,{message:wt})))});lt.displayName="Chat",lt.propTypes={messages:r.arrayOf(r.object),user:r.object,messageTemplate:r.any,messageContentTemplate:r.any,attachmentTemplate:r.any,width:r.oneOfType([r.string,r.number]),style:r.object,onSendMessage:r.func,onActionExecute:r.func,dir:r.string,messageBox:r.any,noDataTemplate:r.oneOfType([r.element,r.func]),suggestionsLayout:r.oneOf(["scroll","wrap","scrollbuttons"]),quickActionsLayout:r.oneOf(["scroll","wrap","scrollbuttons"]),userStatusTemplate:r.elementType,messageFilesLayout:r.oneOf(["vertical","wrap","horizontal"]),showAvatar:r.bool,showUsername:r.bool,authorMessageSettings:r.object,receiverMessageSettings:r.object,scrollMode:r.oneOf(["scrollable","endless"]),total:r.number,pageSize:r.number,startIndex:r.number,endIndex:r.number,onLoadMoreMessages:r.func,pinnedMessages:r.arrayOf(r.object),repliedToMessages:r.arrayOf(r.object),onReferencedMessageClick:r.func};const ot=e=>{const{activeView:t,toolbarItems:n,activeViewChange:l}=e;return h.createElement("div",{className:"k-prompt-header"},h.createElement(a.Toolbar,{keyboardNavigation:!1,role:"toolbar",className:"k-toolbar-flat"},n.map(e=>h.isValidElement(e)?e:h.createElement(a.Button,{key:e.name,className:t===e.name?"k-selected":"",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>(e=>{null==l||l.call(null,e)})(e.name)},e.buttonText))))},st={name:"Output view",buttonText:"Output",buttonIcon:l.commentIcon},rt={name:"Commands view",buttonIcon:l.moreHorizontalIcon},it={name:"Prompt view",buttonText:"Ask AI",buttonIcon:l.sparklesIcon},ct=h.createContext([{},()=>{}]),ut=()=>h.useContext(ct),mt=e=>{const{children:t}=e;return h.createElement("div",{className:"k-prompt-footer"},h.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},t))},dt=h.forwardRef((e,t)=>{const{children:n,streaming:o,onCancel:r}=e,i=s.useLocalization().toLanguageString(x,me[x]),[c]=ut(),u=c.activeView===st.name,m=o&&!u,d=h.useCallback(e=>{"Escape"===e.key&&o&&r&&(e.preventDefault(),r())},[o,r]);return h.createElement("div",{className:"k-prompt-content",ref:t,onKeyDown:d},m&&h.createElement(a.FloatingActionButton,{onClick:r,svgIcon:l.stopIcon,icon:"stop",size:"medium",positionMode:"absolute",className:"k-prompt-stop-fab k-generating","aria-label":i,title:i}),h.createElement("div",{className:"k-prompt-view"},n))});dt.displayName="KendoReactAIPromptContent";const pt=e=>{const[t]=ut();return t.activeView===e.name?e.children:null},gt=e=>{const[t,n]=h.useState(!0),{children:o,title:s}=e;return h.createElement("div",{className:"k-prompt-expander"},h.createElement(a.Button,{"aria-controls":e.id,fillMode:"flat",svgIcon:t?l.chevronUpIcon:l.chevronDownIcon,title:s,onClick:()=>n(!t),"aria-expanded":t},s),t&&h.createElement("div",{id:e.id,className:"k-prompt-expander-content"},o))},ft=e=>null==e?void 0:e.map(e=>h.createElement(o.PanelBarItem,{title:e.text,key:e.id,svgIcon:e.svgIcon,data:e},e.children&&ft(e.children))),ht=({show:e=!1,anchor:t,onOpen:n,onClose:a,animate:l=!0,appendTo:o,popupOptions:s={},children:r,style:i})=>h.createElement(d.Popup,{show:e,anchor:t,style:i,animate:l,appendTo:o,onOpen:n,onClose:a,...s},r),vt=({placeholder:e="Ask or generate content with AI...",promptValue:t,onMenuClick:o,promptInput:s=m.TextArea,generateButton:r,enableSpeechToText:i=!1,streaming:c=!1,commands:u,onPromptRequest:d,onPromptCancel:p})=>{const[g,f]=h.useState(t||""),[v,k]=n.useCustomComponent(r),[b,E]=n.useCustomComponent(s),y=s===m.TextArea||b===m.TextArea,C={svgIcon:c?l.stopIcon:l.paperPlaneIcon,active:(!!c).toString(),title:"Send Button","aria-label":"Send Button",disabled:!g.trim()&&!c,"aria-disabled":!g.trim()&&!c},x={placeholder:e,className:"!k-flex-row",...y?{autoSize:!0}:{},rows:1},I=u&&u.length>0,T=Object.keys(k).length>0?k:C,N=Object.keys(E).length>0?E:x,w=e=>{const{isFinal:t,alternatives:n}=e;if(t&&n.length>0){const e=n[0].transcript,t=(()=>{const t=g,n=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(n?" ":"")+e})();f(t)}},F=()=>{g.trim()&&d&&d(g.trim())};return h.createElement(b,{value:g,onChange:e=>{const t=e.target.value;f(t)},onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),F())},prefix:I||i?h.createElement(h.Fragment,null,h.createElement(m.InputPrefix,{className:"!k-align-items-start"},I&&h.createElement(a.Button,{"aria-label":"Commands Button",title:"Commands Button",fillMode:"flat",svgIcon:l.menuIcon,onClick:o}),i&&h.createElement(a.SpeechToTextButton,{fillMode:"flat",..."object"==typeof i?{...i,onResult:i.onResult||w}:{onResult:w}})),h.createElement(m.InputSeparator,null)):void 0,suffix:h.createElement(m.InputSuffix,{className:"!k-align-items-start"},h.createElement(v,{className:n.classNames("k-prompt-send",{"k-generating":c,"k-active":c}),fillMode:"flat",onClick:c?p:F,...T})),...N})},kt=h.forwardRef((e,t)=>{const{svgIcon:a,label:o,labelClassName:s,secondaryLabel:r,linesAdded:i,linesRemoved:c,expandable:u,expanded:m,defaultExpanded:d,completed:p,onExpandedChange:g,headerTemplate:f,bodyTemplate:v,headerExtra:k,className:b,children:E,...y}=e,C=void 0!==m,[x,I]=h.useState(null!=d&&d),T=null!=m?m:x,N=h.useRef(null),w=h.useCallback(e=>{var t;if(!u)return;const n=!T;if(C||I(n),g){const a={expanded:n,syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(t=N.current)?t:e.currentTarget};g(a)}},[u,T,C,g]),F=h.createElement(h.Fragment,null,a&&h.createElement(n.SvgIcon,{icon:a,size:"small",className:"k-agent-step-icon"}),h.createElement("span",{className:"k-agent-step-content"},o&&h.createElement("span",{className:n.classNames("k-agent-step-label",!1===p&&"k-text-shimmer",s)},o),r&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-agent-step-sep"},"·"),h.createElement("span",{className:"k-agent-step-secondary"},r)),null!=i&&i>0&&h.createElement("span",{className:"k-agent-step-added k-text-success"},"+",i),null!=c&&c>0&&h.createElement("span",{className:"k-agent-step-removed k-text-error"},"-",c),k,u&&h.createElement(n.SvgIcon,{icon:T?l.chevronUpIcon:l.chevronRightIcon,size:"small",className:"k-agent-step-expand"})));let S;return S=f?h.createElement(f,{svgIcon:a,label:o,secondaryLabel:r,headerExtra:k,linesAdded:i,linesRemoved:c,completed:p,expanded:T,expandable:u}):u?h.createElement("button",{ref:N,type:"button",className:"k-agent-step-head","aria-expanded":T,onClick:w},F):h.createElement("div",{className:"k-agent-step-head"},F),h.createElement("div",{ref:t,className:n.classNames("k-agent-step",{"k-agent-completed":p},b),...y},S,T&&E&&(v?h.createElement(v,{expanded:T,completed:p},E):h.createElement("div",{className:"k-agent-step-body"},E)))});kt.displayName="KendoReactAgentStep";const bt=h.forwardRef((e,t)=>{const{svgIcon:a,label:l,labelClassName:o,secondaryLabel:s,linesAdded:r,linesRemoved:i,status:c,statusThemeColor:u,statusSvgIcon:m,completed:d,description:g,contentNode:f,className:v,children:k,...b}=e,E=!0===d,y=!E;return h.createElement("div",{className:n.classNames("k-thought",{"k-thought-completed":E},{"k-thought-active":y},v),ref:t,...b},h.createElement("span",{className:"k-agent-step-icon-col"},a&&h.createElement(n.SvgIcon,{icon:a,size:"small",className:"k-agent-step-icon"})),h.createElement("span",{className:"k-agent-step-content"},null!=f?f:h.createElement(h.Fragment,null,l&&h.createElement("span",{className:n.classNames("k-agent-step-label",y&&"k-text-shimmer",o)},l),g&&h.createElement("span",{className:"k-agent-step-description"},g),s&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-agent-step-sep"},"·"),h.createElement("span",{className:"k-agent-step-secondary"},s)),null!=r&&r>0&&h.createElement("span",{className:"k-agent-step-added k-text-success"},"+",r),null!=i&&i>0&&h.createElement("span",{className:"k-agent-step-removed k-text-error"},"-",i),c&&h.createElement(p.Badge,{size:"small",themeColor:null!=u?u:"success",rounded:"full"},m&&h.createElement(n.SvgIcon,{icon:m,size:"small"}),c),k&&h.createElement("div",{className:"k-agent-step-body"},k))))});bt.displayName="KendoReactThought";const Et=h.forwardRef((e,t)=>{const{label:a,secondaryLabel:o,svgIcon:s=l.sparklesIcon,completed:r,expanded:i,defaultExpanded:c,expandable:u,thoughts:m=[],linesAdded:d,linesRemoved:p,thoughtTemplate:g,onExpandedChange:f,className:v,...k}=e,b=m.map((e,t)=>h.createElement(bt,{key:t,label:e.label,secondaryLabel:e.secondaryLabel,svgIcon:e.svgIcon,completed:e.completed,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,contentNode:g?h.createElement(g,{thought:e,index:t}):void 0},e.content));return h.createElement(kt,{ref:t,svgIcon:s,label:a,secondaryLabel:o,completed:r,expanded:i,defaultExpanded:c,expandable:u&&m.length>0,linesAdded:d,linesRemoved:p,onExpandedChange:f,className:n.classNames("k-chain-of-thought",v),...k},b)});Et.displayName="KendoReactChainOfThought";const yt=h.forwardRef((e,t)=>{const{visible:l,state:o,template:r,onAction:i,className:c,...u}=e,m=s.useLocalization(),d=h.useRef(null),p=h.useCallback(e=>{var t,n;if(i&&o){const a={action:o,syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=d.current)?void 0:t.element)?n:e.currentTarget};i(a)}},[i,o]),g=m.toLanguageString(ae,me[ae]),f=m.toLanguageString(le,me[le]),v=m.toLanguageString(oe,me[oe]),k=m.toLanguageString(se,me[se]);let b=null;return"startOver"===o||"restore"===o?b=h.createElement(a.Button,{ref:d,size:"small",fillMode:"flat",onClick:p},"startOver"===o?g:f):"redo"===o&&(b=h.createElement(h.Fragment,null,h.createElement("span",{className:"k-checkpoint-stamp"},v),h.createElement("span",null,"·"),h.createElement(a.Button,{ref:d,size:"small",fillMode:"flat",onClick:p},k))),h.createElement("div",{ref:t,className:n.classNames("k-checkpoint",{"k-checkpoint-visible":!0===l},c),...u},h.createElement("span",{className:"k-checkpoint-line","aria-hidden":"true"}),r?h.createElement(r,{state:o}):b,h.createElement("span",{className:"k-checkpoint-line","aria-hidden":"true"}))});yt.displayName="KendoReactCheckpoint";const Ct=e=>{const{sources:t}=e;return h.createElement(h.Fragment,null,t.map((e,t)=>{const a=n.sanitizeUrl(null==e?void 0:e.url);return h.createElement("div",{className:"k-citation-popover-view",key:t},(null==e?void 0:e.title)&&h.createElement("div",{className:"k-citation-popover-view-title"},e.title),e&&a&&h.createElement("a",{className:"k-citation-popover-view-source",href:a,target:"_blank",rel:"noopener noreferrer"},h.createElement(n.IconWrap,{name:l.globeIcon.name,icon:l.globeIcon}),e.url),(null==e?void 0:e.description)&&h.createElement("span",{className:"k-citation-popover-view-body"},e.description))}))},xt={horizontal:"fit",vertical:"flip"},It=[],Tt=(e,t)=>{if(void 0!==e)return e;const n=t[0];return(e=>{if(!e)return"";try{return new URL(e).hostname}catch{return""}})(null==n?void 0:n.url)||(null==n?void 0:n.title)||""},Nt=h.forwardRef((e,t)=>{const{sources:o=It,label:r,svgIcon:i=l.globeIcon,additionalCount:c,bodyTemplate:u,onOpen:m,showOn:d="hover",className:p,...f}=e,v=s.useLocalization(),[k,b]=h.useState(null),[E,y]=h.useState(!1),[C,x]=h.useState(0),I=h.useRef(o),T=h.useRef(null);o!==I.current&&(I.current=o,x(0));const N=h.useCallback(e=>{var n;const a=null!=(n=null==e?void 0:e.element)?n:null;b(a),"function"==typeof t?t(a):t&&(t.current=a)},[t]),w=h.useCallback(()=>{null!==T.current&&(clearTimeout(T.current),T.current=null)},[]),F=h.useCallback(()=>{w(),T.current=setTimeout(()=>y(!1),150)},[w]);h.useEffect(()=>w,[w]),h.useEffect(()=>{if(!k||0===o.length||"hover"!==d)return;const e=()=>{w(),y(!0)},t=()=>F();return k.addEventListener("mouseenter",e),k.addEventListener("mouseleave",t),()=>{k.removeEventListener("mouseenter",e),k.removeEventListener("mouseleave",t)}},[k,o.length,w,F,d]);const S=h.useCallback((e,t)=>{if(0!==o.length&&(w(),y(!0),m)){const n={sources:o,syntheticEvent:e,nativeEvent:e.nativeEvent,target:t};m(n)}},[o,m,w]),R=h.useCallback(e=>{var t;S(e.syntheticEvent,null!=(t=e.target.element)?t:e.syntheticEvent.currentTarget)},[S]),A=h.useCallback(e=>{var t;"Enter"!==e.syntheticEvent.key&&" "!==e.syntheticEvent.key||(e.syntheticEvent.preventDefault(),S(e.syntheticEvent,null!=(t=e.target.element)?t:e.syntheticEvent.currentTarget))},[S]),M=`k-citation-popover-${n.useId()}`;h.useEffect(()=>{if(!E||"hover"!==d)return;const e=document.getElementById(M);return e?(e.addEventListener("mouseenter",w),e.addEventListener("mouseleave",F),()=>{e.removeEventListener("mouseenter",w),e.removeEventListener("mouseleave",F)}):void 0},[E,M,w,F,d]),h.useEffect(()=>{if(!E||"click"!==d)return;const e=e=>{const t=document.getElementById(M);k&&!k.contains(e.target)&&(!t||!t.contains(e.target))&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[E,d,k,M]);const L=o.length,B=h.useCallback(()=>x(e=>Math.min(e+1,L-1)),[L]),D=h.useCallback(()=>x(e=>Math.max(e-1,0)),[]),P=[Tt(r,o),c&&o.length>1?"+"+(o.length-1):void 0].filter(Boolean).join(" "),z=null!=u?u:Ct,O=h.createElement(h.Fragment,null,h.createElement("span",{className:"k-citation-pages"},C+1,"/",L),h.createElement(a.ButtonGroup,null,h.createElement(a.Button,{svgIcon:l.arrowLeftIcon,fillMode:"flat",size:"small","aria-label":v.toLanguageString(ce,me[ce]),disabled:C<=0,onClick:D}),h.createElement(a.Button,{svgIcon:l.arrowRightIcon,fillMode:"flat",size:"small","aria-label":v.toLanguageString(ue,me[ue]),disabled:C>=L-1,onClick:B})));return h.createElement(h.Fragment,null,h.createElement(a.Chip,{ref:N,text:P,svgIcon:i,size:"small",fillMode:"outline",rounded:"full",selected:E,onClick:R,onKeyDown:A,className:n.classNames("k-citation",p),...f}),L>0&&h.createElement(g.Popover,{show:E,anchor:k,title:O,collision:xt,callout:!1,margin:{vertical:8,horizontal:0},position:"top",id:M,popoverClass:"k-citation-popover",style:{width:"320px","--kendo-citation-popover-view-current":C+1}},h.createElement(z,{sources:o})))});Nt.displayName="KendoReactCitation";const wt=h.forwardRef((e,t)=>{const{label:a="Reasoning",secondaryLabel:o,svgIcon:s=l.sparklesIcon,completed:r,expanded:i,defaultExpanded:c,expandable:u,contentTemplate:m,onExpandedChange:d,className:p,children:g,...f}=e,v=m?h.createElement(m,null,g):g;return h.createElement(kt,{ref:t,svgIcon:s,label:a,secondaryLabel:o,completed:r,expanded:i,defaultExpanded:c,expandable:u,onExpandedChange:d,className:n.classNames("k-reasoning",p),...f},v)});wt.displayName="KendoReactReasoning";const Ft=e=>"string"==typeof e?e:JSON.stringify(e,null,2),St=e=>h.createElement(h.Fragment,null,h.createElement("div",{className:"k-tool-call-label"},"Parameters"),h.createElement("pre",{className:"k-pre"},h.createElement("code",{className:"k-code"},Ft(e.parameters)))),Rt=e=>h.createElement(h.Fragment,null,h.createElement("div",{className:"k-tool-call-label"},"Result"),h.createElement("pre",{className:"k-pre"},h.createElement("code",{className:"k-code"},Ft(e.result)))),At=e=>e.errorText?h.createElement("div",{className:"k-messagebox k-messagebox-error"},e.errorText):null,Mt={active:"base",completed:"success",awaitingApproval:"warning",error:"error"},Lt={completed:l.checkCircleIcon,awaitingApproval:l.clockIcon,error:l.xCircleIcon},Bt={active:Z,completed:ee,awaitingApproval:te,error:ne},Dt=h.forwardRef((e,t)=>{const{svgIcon:r=l.wrenchIcon,state:i,parameters:c,result:u,errorText:m,approvalText:d,paramsTemplate:g,resultTemplate:f,errorTemplate:v,approvalTemplate:k,onExpandedChange:b,onAction:E,className:y,children:C,...x}=e,I=s.useLocalization(),T=h.useRef(null),N=h.useRef(null),w=null!=i&&"active"!==i,F=null!=i&&"active"!==i&&"awaitingApproval"!==i,S=w?I.toLanguageString(Bt[i],me[Bt[i]]):void 0,R=w?Mt[i]:void 0,A=w?Lt[i]:void 0,M=w&&h.createElement(p.Badge,{size:"small",themeColor:R,rounded:"full",position:null},A&&h.createElement(n.SvgIcon,{icon:A,size:"small"}),h.createElement("span",{className:"k-badge-text"},S)),L="awaitingApproval"===i,B=h.useCallback(e=>{var t,n;if(E){const a={action:"approve",syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=T.current)?void 0:t.element)?n:e.currentTarget};E(a)}},[E]),D=h.useCallback(e=>{var t,n;if(E){const a={action:"reject",syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=N.current)?void 0:t.element)?n:e.currentTarget};E(a)}},[E]),P=L&&(k?h.createElement(k,{state:i,approvalText:d}):h.createElement(o.Card,null,d&&h.createElement(o.CardBody,null,d),h.createElement(o.CardActions,{layout:"end"},h.createElement(a.Button,{ref:N,fillMode:"outline",onClick:D},I.toLanguageString(ie,me[ie])),h.createElement(a.Button,{ref:T,themeColor:"primary",onClick:B},I.toLanguageString(re,me[re]))))),z=null!=g?g:St,O=null!=f?f:Rt,q=null!=v?v:At,K=h.createElement(h.Fragment,null,null!=c&&h.createElement(z,{parameters:c}),null!=u&&h.createElement(O,{result:u}),null!=m&&h.createElement(q,{errorText:m}),L?P:C);return h.createElement(kt,{ref:t,svgIcon:r,headerExtra:M,completed:F,onExpandedChange:b,className:n.classNames("k-tool-call",y),...x},K)});Dt.displayName="KendoReactToolCall",e.AIPrompt=e=>{const t=h.useRef(null);n.useWebMcpRegister("aiprompt",t,e,e.webMcp);const a=!n.validatePackage(Ke,{component:"AIPrompt"}),l=n.getLicenseMessage(Ke),{activeView:o,toolbarItems:s,children:r,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u,style:m,dir:d,className:p,streaming:g,loading:f,onCancel:v,promptPlaceholder:k,suggestionsView:b,...E}=e,y=s||[it,st],[C,x]=h.useState({activeView:o}),I={...C,activeView:o,streaming:g,loading:f,suggestionsView:null!=b?b:"classic",promptPlaceholder:k,onCancel:v,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u};return h.createElement(ct.Provider,{value:[I,e=>{x(e)}]},h.createElement("div",{className:n.classNames("k-prompt",p),style:m,dir:d,...E},h.createElement(ot,{activeView:I.activeView,toolbarItems:y,activeViewChange:i}),r,a&&h.createElement(n.WatermarkOverlay,{message:l})))},e.AIPromptCommandsView=e=>{const{commands:t}=e,[n]=ut();return h.createElement(pt,{name:rt.name},h.createElement(dt,{streaming:n.streaming,onCancel:n.onCancel},h.createElement("div",{className:"k-prompt-view"},h.createElement(o.PanelBar,{onSelect:e=>{var t,a,l;const o=null==(a=null==(t=e.target)?void 0:t.props)?void 0:a.data;null!=(l=null==o?void 0:o.children)&&l.length||n.onCommandExecute&&n.onCommandExecute.call(null,o)},selected:""},ft(null!=t?t:[])))))},e.AIPromptContent=dt,e.AIPromptFooter=mt,e.AIPromptOutputView=e=>{const[t,n]=h.useState(""),r=h.useRef(null),[i]=ut(),{outputs:c,showOutputRating:u,outputCard:m}=e,{header:d,body:p,actions:g}=m||{},f=s.useLocalization(),v=f.toLanguageString(x,me[x]),k=(e,t)=>{i.onPromptRequest&&i.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),b()},b=()=>{r&&r.current&&r.current.scrollTo({top:0,behavior:"smooth"})},E=h.createElement(o.Card,null,h.createElement(o.CardHeader,null,h.createElement(o.CardTitle,null,h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}})),h.createElement(o.CardSubtitle,null,h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),h.createElement(o.CardBody,null,h.createElement("span",{className:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}})),h.createElement(o.CardActions,null,i.streaming&&i.onCancel?h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",svgIcon:l.stopIcon,title:v,onClick:i.onCancel},v):h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),y=(e,o)=>g?g(e):o&&i.onCancel?h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",svgIcon:l.stopIcon,title:v,onClick:i.onCancel},v):h.createElement(h.Fragment,null,h.createElement(a.Button,{size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:t===e.id?l.checkIcon:l.copyIcon,onClick:()=>(e=>{e.responseContent&&navigator.clipboard.writeText(e.responseContent),n(e.id),setTimeout(()=>{n("")},1e3)})(e)},"Copy"),h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:l.arrowRotateCwIcon,onClick:()=>(e=>{i.onPromptRequest&&i.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),b()})(e)},"Retry"),u&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:l.thumbUpIcon,onClick:()=>k(e,"positive")}),h.createElement(a.Button,{size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:l.thumbDownIcon,onClick:()=>k(e,"negative")}))),I=null==c?void 0:c.map((e,t)=>{const n=!(!i.streaming||i.loading||0!==t);return h.createElement(o.Card,{key:`${e.id}_${t}`},h.createElement(o.CardHeader,null,d?d(e):h.createElement(h.Fragment,null,e.title&&h.createElement(o.CardTitle,null,e.title),e.subTitle&&h.createElement(o.CardSubtitle,null,e.subTitle))),h.createElement(o.CardBody,null,p?p(e):e.responseContent),h.createElement(o.CardActions,null,y(e,n)))}),T=h.createElement(o.Card,null,h.createElement(o.CardBody,null,f.toLanguageString(C,me[C])));return h.createElement(pt,{name:st.name},h.createElement(dt,{ref:r,streaming:i.streaming,onCancel:i.onCancel},h.createElement("div",{className:"k-card-list"},i.loading&&E,I,(!I||0===I.length)&&!i.loading&&T)))},e.AIPromptView=e=>{var t;const{promptInput:o=m.TextArea,generateButton:r=a.Button,enableSpeechToText:i=!1,promptValue:c,promptSuggestions:u}=e,[d,p]=h.useState(c||""),[g]=ut(),f=s.useLocalization(),[v,k]=n.useCustomComponent(r),[b,E]=n.useCustomComponent(o),y=h.useRef(null);h.useEffect(()=>{var e,t;null!=(t=null==(e=y.current)?void 0:e.element)&&t.current&&requestAnimationFrame(()=>{var e,t;if(null!=(t=null==(e=y.current)?void 0:e.element)&&t.current){const e=y.current.element.current;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}})},[d]);const C={title:"Generate",children:"Generate",svgIcon:l.sparklesIcon},x={placeholder:null!=(t=g.promptPlaceholder)?t:f.toLanguageString(I,me[I]),rows:2},T=Object.keys(k).length>0?k:C,N=Object.keys(E).length>0?E:x,w=e=>{const{isFinal:t,alternatives:n}=e;if(t&&n.length>0){const e=n[0].transcript,t=(()=>{const t=d,n=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(n?" ":"")+e})();p(t)}};let F;return i&&(F="object"==typeof i?{...i,onResult:i.onResult||w}:{onResult:w}),h.createElement(pt,{name:it.name},h.createElement(dt,{streaming:g.streaming,onCancel:g.onCancel},h.createElement(b,{ref:y,value:d,flow:"vertical",textareaStyle:{maxHeight:"110px"},autoSize:!0,suffix:i?h.createElement(h.Fragment,null,h.createElement(m.InputSeparator,{orientation:"horizontal"}),h.createElement(m.InputSuffix,{orientation:"horizontal"},h.createElement(a.SpeechToTextButton,{fillMode:"flat",...F}))):void 0,onChange:e=>{p(e.target.value)},...N}),u&&u.length>0&&h.createElement(gt,{title:"Prompt Suggestions"},h.createElement(Me,{suggestionsView:g.suggestionsView,suggestions:u.map((e,t)=>({id:t,text:e,description:e})),onSuggestionClick:e=>{(e=>{p(e)})(e.text)}}))),h.createElement(mt,null,h.createElement(v,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:()=>{g.onPromptRequest&&g.onPromptRequest.call(null,d),p("")},disabled:!d.trim(),...T},T.children)))},e.AIPromptViewRender=pt,e.ChainOfThought=Et,e.Chat=lt,e.ChatMessage=Ee,e.Checkpoint=yt,e.Citation=Nt,e.DEFAULT_FIELD_MAPPING=Ye,e.HeroCard=e=>{const{imageUrl:t,imageMaxWidth:n,title:l,subtitle:o,actions:s,onActionExecute:r,altText:i}=e,c=h.useCallback((e,t)=>{null==r||r({action:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},[r]),u=i||l||"";return h.createElement("div",{className:"k-card"},h.createElement("img",{className:"k-card-image",src:t,style:{maxWidth:n},alt:u}),h.createElement("div",{className:"k-card-body"},l&&h.createElement("h5",{className:"k-card-title"},l),o&&h.createElement("h6",{className:"k-card-subtitle"},o)),h.createElement("div",{className:"k-card-actions k-card-actions-vertical"},s.map((e,t)=>h.createElement("span",{className:"k-card-action",key:`action-${t}-${e.title||e.value||t}`},h.createElement(a.Button,{fillMode:"flat",onClick:t=>c(e,t)},e.title)))))},e.InlineAIPrompt=e=>{const t=!n.validatePackage(Ke,{component:"InlineAIPrompt"}),s=n.getLicenseMessage(Ke),{outputs:r=[],outputCard:i,promptInput:c=m.TextArea,generateButton:u=a.Button,promptPlaceholder:d="Ask or generate content with AI...",promptValue:p,onPromptRequest:g,onCopy:f,onDiscard:v,outputActions:k,onOutputAction:b,enableSpeechToText:E=!1,streaming:y,onPromptCancel:C,show:x=!1,anchor:I,width:T,height:N,onOpen:w,onClose:F,animate:S=!0,appendTo:R,commands:A,onCommandExecute:M,style:L,className:B,popupOptions:D={},...P}=e,[z,O]=h.useState(""),[q,K]=h.useState(!1),[H,U]=h.useState({left:0,top:0}),$=h.useRef(null),{body:V,actions:j}=i||{},W=k||[{id:"copy",text:"Copy",svgIcon:l.copyIcon,themeColor:"primary",title:"Copy"},{id:"discard",text:"Discard",svgIcon:l.cancelIcon,themeColor:"base",title:"Discard"}],G=(e,t)=>{switch(e.id){case"copy":(e=>{e.responseContent&&(navigator.clipboard.writeText(e.responseContent),O(e.id),setTimeout(()=>O(""),1e3)),null==f||f(e)})(t);break;case"discard":(e=>{null==v||v(e)})(t);break;default:null==b||b(e,t)}},_=h.useCallback(e=>{"Escape"===e.key&&(y&&C?C():!y&&F&&F({target:null}))},[y,C,F]),Y={...L,...T&&{width:T},...N&&{height:N}},J={...T&&{width:T},...N&&{height:N}},X=h.createElement(h.Fragment,null,h.createElement("div",{className:n.classNames("k-prompt",B),style:Y,onKeyDown:_,...P},h.createElement(dt,{ref:$},r&&r.length>0&&h.createElement("div",{className:"k-card-list"},r.map((e,t)=>h.createElement(o.Card,{key:`${e.id}_${t}`},h.createElement(o.CardBody,null,V?V(e):e.responseContent),h.createElement(o.CardActions,null,j?j(e):h.createElement(h.Fragment,null,W.map(t=>{var n;return t.spacer?h.createElement("span",{key:t.id,className:"k-spacer"}):h.createElement(a.Button,{key:t.id,size:"medium",themeColor:t.themeColor||"primary",fillMode:"flat",rounded:"medium",title:null!=(n=t.title)?n:t.text,svgIcon:"copy"===t.id&&z===e.id?l.checkIcon:t.svgIcon,onClick:()=>G(t,e)},t.text)})))))),h.createElement(vt,{promptValue:p,placeholder:d,onPromptRequest:g,onMenuClick:e=>{if(!$.current)return;const t=$.current.getBoundingClientRect();U({left:t.left,top:t.bottom}),K(!0)},onPromptCancel:C,promptInput:c,generateButton:u,enableSpeechToText:E,streaming:y,commands:A}))),t&&h.createElement(n.WatermarkOverlay,{message:s}));return h.createElement(h.Fragment,null,h.createElement(ht,{show:x,anchor:I,onOpen:w,onClose:F,animate:S,appendTo:R,popupOptions:D,style:J},X),h.createElement(o.ContextMenu,{show:q,offset:H,onClose:()=>{K(!1)},items:(e=>null==e?void 0:e.map(e=>({text:e.text,svgIcon:e.svgIcon,data:e,items:e.children?e.children.map(e=>({text:e.text,data:e})):void 0})))(A),onSelect:e=>{var t,n;const a=null==(t=e.item)?void 0:t.data;a&&(null==(n=a.children)||!n.length)&&(e=>{K(!1),M&&M(e)})(a)}}))},e.PromptBox=$e,e.PromptBoxActionButton=Be,e.PromptBoxSpeechToTextButton=De,e.PromptBoxUploadButton=Le,e.PromptHeader=ot,e.Reasoning=wt,e.SuggestionGroup=Me,e.ToolCall=Dt,e.commandsViewDefaults=rt,e.extractFieldMappingFromProps=e=>({textField:e.textField,statusField:e.statusField,authorIdField:e.authorIdField,authorNameField:e.authorNameField,authorImageUrlField:e.authorImageUrlField,authorImageAltTextField:e.authorImageAltTextField,idField:e.idField,timestampField:e.timestampField,filesField:e.filesField,attachmentsField:e.attachmentsField,replyToIdField:e.replyToIdField,isDeletedField:e.isDeletedField,isPinnedField:e.isPinnedField,typingField:e.typingField,suggestedActionsField:e.suggestedActionsField,isFailedField:e.isFailedField}),e.isStandardMessageFormat=Qe,e.mapDataArrayToMessages=Xe,e.mapDataToMessage=Je,e.mapMessageToCustomFormat=(e,t={})=>{const n={...Ye,...t},a={};return void 0!==e.id&&(a[n.idField]=e.id),void 0!==e.text&&(a[n.textField]=e.text),void 0!==e.status&&(a[n.statusField]=e.status),void 0!==e.isFailed&&(a[n.isFailedField]=e.isFailed),void 0!==e.timestamp&&(a[n.timestampField]=e.timestamp),void 0!==e.attachments&&(a[n.attachmentsField]=e.attachments),void 0!==e.files&&(a[n.filesField]=e.files),void 0!==e.suggestedActions&&(a[n.suggestedActionsField]=e.suggestedActions),void 0!==e.replyToId&&(a[n.replyToIdField]=e.replyToId),void 0!==e.isDeleted&&(a[n.isDeletedField]=e.isDeleted),void 0!==e.isPinned&&(a[n.isPinnedField]=e.isPinned),void 0!==e.typing&&(a[n.typingField]=e.typing),e.author&&(void 0!==e.author.id&&(a[n.authorIdField]=e.author.id),void 0!==e.author.name&&(a[n.authorNameField]=e.author.name),void 0!==e.author.avatarUrl&&(a[n.authorImageUrlField]=e.author.avatarUrl),void 0!==e.author.avatarAltText&&(a[n.authorImageAltTextField]=e.author.avatarAltText)),void 0!==e.pinnedAt&&(a.pinnedAt=e.pinnedAt),void 0!==e.pinnedBy&&(a.pinnedBy=e.pinnedBy),void 0!==e.attachmentLayout&&(a.attachmentLayout=e.attachmentLayout),a},e.outputViewDefaults=st,e.promptViewDefaults=it});
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1794126362,version:"17.0.0-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"});exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1794321678,version:"17.0.0-develop.5",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"});exports.packageMetadata=e;
@@ -7,8 +7,8 @@ export const packageMetadata = Object.freeze({
7
7
  productName: 'KendoReact',
8
8
  productCode: 'KENDOUIREACT',
9
9
  productCodes: ['KENDOUIREACT'],
10
- publishDate: 1794126362,
11
- version: '17.0.0-develop.3',
10
+ publishDate: 1794321678,
11
+ version: '17.0.0-develop.5',
12
12
  licensingDocsUrl:
13
13
  'https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
14
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-conversational-ui",
3
- "version": "17.0.0-develop.3",
3
+ "version": "17.0.0-develop.5",
4
4
  "description": "React Chat component allows the user to participate in chat sessions with users or chat bots. KendoReact Conversational UI components",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,17 +26,17 @@
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-licensing": "^1.13.0",
29
- "@progress/kendo-react-animation": "17.0.0-develop.3",
30
- "@progress/kendo-react-buttons": "17.0.0-develop.3",
31
- "@progress/kendo-react-common": "17.0.0-develop.3",
32
- "@progress/kendo-react-intl": "17.0.0-develop.3",
33
- "@progress/kendo-react-indicators": "17.0.0-develop.3",
34
- "@progress/kendo-react-inputs": "17.0.0-develop.3",
35
- "@progress/kendo-react-layout": "17.0.0-develop.3",
36
- "@progress/kendo-react-notification": "17.0.0-develop.3",
37
- "@progress/kendo-react-tooltip": "17.0.0-develop.3",
38
- "@progress/kendo-react-popup": "17.0.0-develop.3",
39
- "@progress/kendo-react-upload": "17.0.0-develop.3",
29
+ "@progress/kendo-react-animation": "17.0.0-develop.5",
30
+ "@progress/kendo-react-buttons": "17.0.0-develop.5",
31
+ "@progress/kendo-react-common": "17.0.0-develop.5",
32
+ "@progress/kendo-react-intl": "17.0.0-develop.5",
33
+ "@progress/kendo-react-indicators": "17.0.0-develop.5",
34
+ "@progress/kendo-react-inputs": "17.0.0-develop.5",
35
+ "@progress/kendo-react-layout": "17.0.0-develop.5",
36
+ "@progress/kendo-react-notification": "17.0.0-develop.5",
37
+ "@progress/kendo-react-tooltip": "17.0.0-develop.5",
38
+ "@progress/kendo-react-popup": "17.0.0-develop.5",
39
+ "@progress/kendo-react-upload": "17.0.0-develop.5",
40
40
  "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
41
41
  "react": "^18.0.0 || ^19.0.0",
42
42
  "react-dom": "^18.0.0 || ^19.0.0"
@@ -65,7 +65,7 @@
65
65
  "migrations": {
66
66
  "options": {
67
67
  "parser": "tsx",
68
- "pattern": "*.{js,jsx,ts,tsx}"
68
+ "pattern": "*.{js,jsx,ts,tsx,css,scss,sass,less}"
69
69
  },
70
70
  "codemods": {
71
71
  "12": [
@@ -121,7 +121,8 @@
121
121
  {
122
122
  "description": "Flags files that reference Chat FileBox CSS classes affected by the v16 rendering change (k-files-scroll, k-file-box).",
123
123
  "file": "codemods/v16/chat-rendering-changes",
124
- "prompt": false
124
+ "prompt": false,
125
+ "instructionsOnly": true
125
126
  }
126
127
  ]
127
128
  }
@@ -129,7 +130,7 @@
129
130
  "package": {
130
131
  "productName": "KendoReact",
131
132
  "productCode": "KENDOUIREACT",
132
- "publishDate": 1794126362,
133
+ "publishDate": 1794321678,
133
134
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
134
135
  }
135
136
  },