@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
2 lines • 136 kB
JavaScript
/* @license */
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`kendo.core.min.js`),require(`kendo.licensing.min.js`),require(`kendo.data.min.js`),require(`kendo.icons.min.js`),require(`kendo.dropdownbutton.min.js`),require(`kendo.button.min.js`),require(`kendo.toolbar.min.js`),require(`kendo.avatar.min.js`),require(`kendo.html.button.min.js`),require(`kendo.promptbox.min.js`),require(`kendo.speechtotextbutton.min.js`),require(`kendo.textarea.min.js`),require(`kendo.textbox.min.js`),require(`kendo.upload.min.js`),require(`kendo.menu.min.js`)):typeof define==`function`&&define.amd?define([`exports`,`kendo.core.min`,`kendo.licensing.min`,`kendo.data.min`,`kendo.icons.min`,`kendo.dropdownbutton.min`,`kendo.button.min`,`kendo.toolbar.min`,`kendo.avatar.min`,`kendo.html.button.min`,`kendo.promptbox.min`,`kendo.speechtotextbutton.min`,`kendo.textarea.min`,`kendo.textbox.min`,`kendo.upload.min`,`kendo.menu.min`],t):(e=typeof globalThis<`u`?globalThis:e||self,t((e.kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.Chat={}),e.kendo._globals.Core,e.kendo._globals.Licensing,e.kendo._globals.Data,e.kendo._globals.Icons,e.kendo._globals.Dropdownbutton,e.kendo._globals.Button,e.kendo._globals.Toolbar,e.kendo._globals.Avatar,e.kendo._globals.HtmlButton,e.kendo._globals.Promptbox,e.kendo._globals.Speechtotextbutton,e.kendo._globals.Textarea,e.kendo._globals.Textbox,e.kendo._globals.Upload,e.kendo._globals.Menu))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var g=Object.create,_=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,b=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,S=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=y(t),a=0,o=i.length,s;a<o;a++)s=i[a],!x.call(e,s)&&s!==n&&_(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=v(t,s))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:g(b(e)),S(t||!e||!e.__esModule?_(n,`default`,{value:e,enumerable:!0}):n,e)))(n);let C=function(e){return e.Singleton=`singleton`,e.Scoped=`scoped`,e}({}),w=new class{constructor(){this.registrations=new Map}singleton(e,t){this.registrations.set(e,{ctor:e,factory:t??(()=>new e),lifetime:C.Singleton,instance:void 0})}singletonInstance(e,t){this.registrations.set(e,{ctor:e,factory:()=>t,lifetime:C.Singleton,instance:t})}scoped(e,t){this.registrations.set(e,{ctor:e,factory:t??(()=>new e),lifetime:C.Scoped,instance:void 0})}resolve(e){let t=this.registrations.get(e);if(!t)throw Error(`Service ${e.name} is not registered`);return t.lifetime===C.Singleton?(t.instance===void 0&&(t.instance=t.factory()),t.instance):t.factory()}tryResolve(e){if(this.has(e))return this.resolve(e)}has(e){return this.registrations.has(e)}getLifetime(e){return this.registrations.get(e)?.lifetime}};function T(e){return w.resolve(e)}var E=class{constructor(e,t,n,r,i,a){this.$=e,this.support=t,this.mouseEventNormalizer=n,this.eventMapService=r,this.utils=i,this.originalOn=e.fn.on,this.kendoJQuery=this.createKendoJQuery(a),this.rootjQuery=this.kendoJQuery(document)}createKendoJQuery(e){let t=this.$,n=this,r=function(e,t){return new r.fn.init(e,t)};return e(!0,r,t),r.fn=r.prototype=new t,r.fn.constructor=r,r.fn.init=function(e,i){return i&&i instanceof t&&!(i instanceof r)&&(i=r(i)),t.fn.init.call(this,e,i,n.rootjQuery)},r.fn.init.prototype=r.fn,t.extend(r.fn,{handler:function(e){return this.data(`handler`,e),this},autoApplyNS:function(e){return this.data(`kendoNS`,e||n.utils.guid()),this},on:function(...e){let t=this,r=t.data(`kendoNS`),i=n.originalOn;if(e.length===1)return i.call(t,e[0]);let a=t,o=e.slice();o[o.length-1]===void 0&&o.pop();let s=o[o.length-1],c=n.eventMapService.applyEventMap(o[0],r);if(n.support.mouseAndTouchPresent&&c.search(/mouse|click/)>-1&&this[0]!==document.documentElement){n.mouseEventNormalizer.setupMouseMute();let e=o.length===2?null:o[1],t=c.indexOf(`click`)>-1&&c.indexOf(`touchend`)>-1;i.call(this,{touchstart:e=>n.mouseEventNormalizer.muteMouse(e),touchend:()=>n.mouseEventNormalizer.unMuteMouse()},e,{bustClick:t})}if(o[0].indexOf(`keydown`)!==-1&&o[1]&&o[1].options){o[0]=c;let e=o[1],r=o[o.length-1];return o[o.length-1]=function(t){if(n.keyDownHandler(t,e))return r.apply(this,[t])},i.apply(t,o),t}if(typeof s==`string`){a=t.data(`handler`);let e=a[s];o[o.length-1]=function(t){e.call(a,t)}}return o[0]=c,i.apply(t,o),t},kendoDestroy:function(e){return e||=this.data(`kendoNS`),e&&this.off(`.`+e),this}}),r}getConstructor(){return this.kendoJQuery}create(e,t){return this.kendoJQuery(e,t)}keyDownHandler(e,t){let n=t._events.kendoKeydown;if(!n)return!0;let r=n.slice();e.sender=t,e.preventKendoKeydown=!1;for(let n=0,i=r.length;n<i;n++)r[n].call(t,e);return!e.preventKendoKeydown}},D=class{static extend(e){let t=this,n=function(){};n.prototype=t.prototype;let r=e&&e.init?e.init:function(...e){t.prototype.init&&t.prototype.init.apply(this,e)},i=r.fn=r.prototype=new n;if(e)for(let t in e)e[t]!=null&&e[t].constructor===Object?i[t]=T(E).getConstructor().extend(!0,{},n.prototype[t],e[t]):i[t]=e[t];return i.constructor=r,r.extend=t.extend,r}};D.fn=D.prototype,D.prototype.init=function(...e){},D.prototype._initOptions=function(e){this.options=T(E).getConstructor().extend(!0,{},this.options,e)};let O=`string`,k=`function`;function A(){this._defaultPrevented=!0}function j(){return this._defaultPrevented===!0}var M=class extends D{constructor(){super(),this._events={}}init(...e){this._events={}}bind(e,t,n){let r=this,i,a,o,s,c=typeof t===k,l;if(t===void 0){let t=e;for(i in t)r.bind(i,t[i]);return r}let u=typeof e===O?[e]:e;for(i=0,a=u.length;i<a;i++){let e=u[i];s=c?t:t[e],s&&(n&&(o=s,s=(function(e,t){let n=function(){r.unbind(e,n),t.apply(r,arguments)};return n.original=t,n})(e,o)),l=r._events[e]=r._events[e]||[],l.push(s))}return r}one(e,t){return this.bind(e,t,!0)}first(e,t){let n=this,r,i=typeof e===O?[e]:e,a=i.length,o,s=typeof t===k,c;for(r=0;r<a;r++){let e=i[r];o=s?t:t[e],o&&(c=n._events[e]=n._events[e]||[],c.unshift(o))}return n}trigger(e,t){let n=this,r=n._events[e],i,a=r?r.length:0;if(r){let e=t||{};for(e.sender=n,e._defaultPrevented=!1,e.preventDefault=A,e.isDefaultPrevented=j,r=r.slice(),i=0;i<a;i++)r[i].call(n,e);return e._defaultPrevented===!0}return!1}unbind(e,t){let n=this,r=e?n._events[e]:void 0,i;if(e===void 0)n._events={};else if(r)if(t)for(i=r.length-1;i>=0;i--)(r[i]===t||r[i].original===t)&&r.splice(i,1);else n._events[e]=[];return n}};let ee=M.prototype;[`init`,`bind`,`one`,`first`,`trigger`,`unbind`].forEach(e=>{let t=ee[e];Object.defineProperty(ee,e,{value:t,writable:!0,configurable:!0,enumerable:!0})}),M.fn=M.prototype;let N=/%/,te=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i;var P=class{constructor(e,t,n,r,i){this.supportService=e,this.$=t,this.namespaceService=n,this.utils=r,this.kendo=i,this.animationQueue=[];let a=window;this.animationFrameFn=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||(e=>{setTimeout(e,1e3/60)})}isElement(e){return e instanceof Element||e instanceof HTMLDocument}outerWidth(e,t,n){let r=this.$(e);return n?this.getHiddenDimensions(r,t).width:r.outerWidth(t||!1)||0}outerHeight(e,t,n){let r=this.$(e);return n?this.getHiddenDimensions(r,t).height:r.outerHeight(t||!1)||0}getComputedStyles(e,t){let n={},r;return document.defaultView&&document.defaultView.getComputedStyle?(r=document.defaultView.getComputedStyle(e,``),t&&this.$.each(t,(e,t)=>{n[t]=r.getPropertyValue(t)})):(r=e.currentStyle,t&&this.$.each(t,(e,t)=>{n[t]=r[this.utils.toCamelCase(t)]})),this.utils.size(n)?n:r}isScrollable(e){if(e.dataset[this.namespaceService.ns+`scrollable`]===`false`)return!1;if(typeof e?.className==`string`&&e.className.indexOf(`k-auto-scrollable`)>-1)return!0;let t=this.getComputedStyles(e,[`overflow`]).overflow||``;return t.indexOf(`auto`)>-1||t.indexOf(`scroll`)>-1}scrollLeft(e,t){let n=this.supportService.browser.webkit,r=this.supportService.browser.mozilla,i=this.supportService.browser.version;if(e instanceof this.$&&t!==void 0){e.each((e,n)=>{this.scrollLeft(n,t)});return}let a=e instanceof this.$?e[0]:e;if(!a)return;let o=this.supportService.isRtl(e);if(t!==void 0)o&&n&&(i<85||this.supportService.browser.safari)?a.scrollLeft=a.scrollWidth-a.clientWidth-t:o&&(r||n)&&t>0?a.scrollLeft=-t:a.scrollLeft=t;else if(o&&n&&(i<85||this.supportService.browser.safari))return a.scrollWidth-a.clientWidth-a.scrollLeft;else return Math.abs(a.scrollLeft)}getOffset(e,t=`offset`,n){let r=e[t](),i={top:r.top,right:r.right,bottom:r.bottom,left:r.left};if(this.supportService.browser.msie&&(this.supportService.pointers||this.supportService.msPointers)&&!n){let t=this.supportService.isRtl(e)?1:-1;i.top-=window.pageYOffset-document.documentElement.scrollTop,i.left-=window.pageXOffset+t*document.documentElement.scrollLeft}return i}getHiddenDimensions(e,t){let n=e.clone();n.css(`display`,``),n.css(`visibility`,`hidden`),n.appendTo(this.$(`body`));let r=n.outerWidth(t||!1),i=n.outerHeight(t||!1);return n.remove(),{width:r||0,height:i||0}}parseEffects(e){let t={},n=typeof e==`string`?e.split(` `):e;return this.$.each(n,function(e){t[e]=this}),t}stripWhitespace(e){if(document.createNodeIterator){let t=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,t=>t.parentNode===e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT);for(;t.nextNode();){let e=t.referenceNode;e&&!e.textContent?.trim()&&e.parentNode?.removeChild(e)}}}animationFrame(e){this.animationFrameFn.call(window,e)}queueAnimation(e){this.animationQueue.push(e),this.animationQueue.length===1&&this.runNextAnimation()}runNextAnimation(){this.animationFrame(()=>{this.animationQueue[0]&&(this.animationQueue.shift()(),this.animationQueue[0]&&this.runNextAnimation())})}parseQueryStringParams(e){let t=e.split(`?`)[1]||``,n={},r=t.split(/&|=/),i=r.length;for(let e=0;e<i;e+=2)r[e]!==``&&(n[decodeURIComponent(r[e])]=decodeURIComponent(r[e+1]));return n}elementUnderCursor(e){return e.x.client===void 0?null:document.elementFromPoint(e.x.client,e.y.client)}wheelDeltaY(e){let t=e.originalEvent,n=t.wheelDeltaY,r;return t.wheelDelta?(n===void 0||n)&&(r=t.wheelDelta):t.detail&&t.axis===t.VERTICAL_AXIS&&(r=-t.detail*10),r}getShadows(e){let t=e.css(`box-shadow`),n=t&&te.exec(t)||[0,0,0,0,0],r=Math.max(+n[3],+(n[4]||0));return{left:-n[1]+r,right:+n[1]+r,bottom:+n[2]+r}}wrap(e,t,n,r=!0,i){let a=e.parent(),o=this.outerWidth(window);if(a.parent().removeClass(`k-animation-container-sm`),a.hasClass(`k-child-animation-container`))this.wrapResize(e,t,r);else{let n=e[0].style.width,r=e[0].style.height,o=N.test(n),s=N.test(r),c=e.hasClass(`k-tooltip`)||e.is(`.k-menu-horizontal.k-context-menu`),l=e.hasClass(`k-tooltip`),u=o||s,d=n,f=r;!o&&(!t||t&&n||c)&&(d=t?this.outerWidth(e,!1,l)+1:this.outerWidth(e,!1,l)),(!s&&(!t||t&&r)||c)&&(f=this.outerHeight(e,!1,l)),e.wrap(this.$(`<div/>`).addClass(`k-child-animation-container`).css({width:i?`auto`:d,height:f})),a=e.parent(),a.wrap(this.$(`<div/>`).addClass(`k-animation-container`).attr(`role`,`region`)),u&&e.css({width:`100%`,height:`100%`})}return a=a.parent(),o<this.outerWidth(a)&&(a.addClass(`k-animation-container-sm`),n=!0),n&&this.wrapResize(e,t,r),a}wrapResize(e,t,n=!0){let r=e.parent(),i=e.closest(`.k-animation-container`),a=e.hasClass(`k-tooltip`),o=e.is(`:visible`),s=r[0].style,c=e[0].style.height;i.is(`:hidden`)&&i.css({display:``,position:``}),N.test(s.width)||N.test(s.height)||(o||e.add(r).show(),n&&r.css(`width`,``),r.css({width:t?this.outerWidth(e,!1,a)+1:this.outerWidth(e,!1,a)}),c===`auto`?e.css({height:this.outerHeight(r)}):r.css({height:this.outerHeight(e)}),o||e.hide())}scrollByDelta(e,t){let n=this.supportService.isRtl(e),r=(n?-this.scrollLeft(e):this.scrollLeft(e))+t,i=e[0].scrollWidth-e[0].clientWidth,a={scrollLeft:r};e.finish().animate(a,`fast`,`linear`);let o=n?-i:i,s=n?Math.max(Math.min(r,0),o):Math.min(Math.max(r,0),o);return{atStart:s===0,atEnd:s===o}}scrollVerticalByDelta(e,t,n={}){let{duration:r=`fast`,easing:i=`linear`}=n,a=(e.scrollTop()||0)+t,o={scrollTop:a};e.finish().animate(o,r,i);let s=e[0].scrollHeight-e[0].clientHeight,c=Math.min(Math.max(a,0),s);return{atTop:c===0,atBottom:c>=s}}scrollToElement(e,t,n={}){if(!e.length||!t.length)return!1;let{duration:r=0,easing:i=`linear`,position:a=`center`,offset:o=0,onComplete:s}=n,c=e.height()||0,l=e.scrollTop()||0,u=e.offset(),d=t.offset(),f=t.outerHeight()||0,p=d.top-u.top+l,m;switch(a){case`top`:m=p+o;break;case`bottom`:m=p-c+f+o;break;default:m=p-c/2+f/2+o;break}let h=e[0].scrollHeight-e[0].clientHeight;return m=Math.min(Math.max(m,0),h),e.finish().animate({scrollTop:m},r,i,s),!0}addAttribute(e,t,n){let r=e.attr(t)||``;r.indexOf(n)<0&&e.attr(t,(r+` `+n).trim())}removeAttribute(e,t){e.removeAttr(t)}toggleAttribute(e,t,n){let r=(e.attr(t)||``).indexOf(n)<0,i=[`disabled`,`readonly`].indexOf(t)>-1;r&&!i||i&&n?this.addAttribute(e,t,n):this.removeAttribute(e,t)}onResize(e){let t=e;return this.supportService.mobileOS&&this.supportService.mobileOS.android&&(t=function(){setTimeout(e,600)}),this.$(window).on(this.supportService.resize,t),t}unbindResize(e){this.$(window).off(this.supportService.resize,e)}attrValue(e,t){return e.data(this.namespaceService.ns+t)}attr(e){return`data-`+this.namespaceService.ns+e}dimensions(e,t){let n=e[0];return t&&e.css(t),{width:n.offsetWidth,height:n.offsetHeight}}triggeredByInput(e){return/^(label|input|textarea|select)$/i.test(e.target.tagName)}applyStylesFromKendoAttributes(e,t){let n=this.$,r=t.map(e=>`[${this.attr(`style-${e}`)}]`).join(`,`);e.find(r).addBack(r).each((e,r)=>{let i=n(r);t.forEach(e=>{let t=this.attr(`style-${e}`);i.attr(t)&&(i.css(e,i.attr(t)),i.removeAttr(t))})})}progress(e,t,n){let r=e.find(`.k-loading-mask`),i=this.supportService.browser,a=this.$.extend({},{width:`100%`,height:`100%`,top:e.scrollTop(),opacity:!1},n),o=a.opacity?`k-loading-mask k-opaque`:`k-loading-mask`;if(t){if(!r.length){let t=this.supportService.isRtl(e),n=t?`right`:`left`,r=this.scrollLeft(e),s=0;i.webkit&&t&&(s=e[0].scrollWidth-(e.width()||0)-2*r);let c=this.kendo.ui?.progress?.messages?.loading||`Loading...`;this.$(`<div class='${o}'><span role='alert' aria-live='polite' class='k-loading-text'>${c}</span><div class='k-loading-image'></div><div class='k-loading-color'></div></div>`).width(a.width).height(a.height).css(`top`,a.top).css(n,Math.abs(r)+s).prependTo(e)}}else r&&r.remove()}eventTarget(e){if(!this.supportService.touch)return e.target;let t=e.originalEvent?.changedTouches||e.changedTouches;return t&&t.length>0?document.elementFromPoint(t[0].clientX,t[0].clientY):e.target}createDragToScrollHandler(e,t){return new ne(this.$,e,t)}},ne=class e{static{this.DRAG_THRESHOLD=5}constructor(e,t,n){this.isDragging=!1,this.hasDragged=!1,this.dragStartX=0,this.scrollStartLeft=0,this.currentDragTarget=null,this.$=e,this.scrollContainer=t,this.namespace=n.namespace,this.captureElement=n.captureElement,this.delegateSelector=n.delegateSelector,this.onDragStart=this.onDragStart.bind(this),this.onDragMove=this.onDragMove.bind(this),this.onDragEnd=this.onDragEnd.bind(this),this.preventClickOnce=this.preventClickOnce.bind(this)}attach(){this.captureElement&&(this.delegateSelector?this.scrollContainer.on(`mousedown`+this.namespace,this.delegateSelector,this.onDragStart).on(`touchstart`+this.namespace,this.delegateSelector,this.onDragStart):this.scrollContainer.on(`mousedown`+this.namespace,this.onDragStart).on(`touchstart`+this.namespace,this.onDragStart),this.bindCaptureEvents())}destroy(){this.scrollContainer.off(this.namespace),this.captureElement&&this.unbindCaptureEvents(),this.scrollContainer[0].removeEventListener(`click`,this.preventClickOnce,!0)}getClientX(e){if(e.type.indexOf(`touch`)!==-1){let t=e.originalEvent?.touches?.[0]||e.originalEvent?.changedTouches?.[0];return t?t.clientX:0}return e.clientX||e.originalEvent?.clientX||0}preventClickOnce(e){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.scrollContainer[0].removeEventListener(`click`,this.preventClickOnce,!0)}onDragStart(e){let t=this.$(e.currentTarget);t.length&&(this.isDragging=!0,this.hasDragged=!1,this.currentDragTarget=t[0],this.dragStartX=this.getClientX(e),this.scrollStartLeft=t[0].scrollLeft,t.css(`cursor`,`grabbing`),t.css(`user-select`,`none`))}onDragMove(t){if(!this.isDragging||!this.currentDragTarget)return;let n=this.getClientX(t),r=this.dragStartX-n;!this.hasDragged&&Math.abs(r)>=e.DRAG_THRESHOLD&&(this.hasDragged=!0),this.hasDragged&&(t.preventDefault(),this.currentDragTarget.scrollLeft=this.scrollStartLeft+r)}onDragEnd(){if(this.isDragging){if(this.currentDragTarget){let e=this.$(this.currentDragTarget);e.css(`cursor`,``),e.css(`user-select`,``)}this.hasDragged&&this.scrollContainer[0].addEventListener(`click`,this.preventClickOnce,!0),this.isDragging=!1,this.hasDragged=!1,this.currentDragTarget=null}}bindCaptureEvents(){this.captureElement&&this.$(document).on(`mousemove`+this.namespace,this.onDragMove).on(`touchmove`+this.namespace,this.onDragMove).on(`mouseup`+this.namespace,this.onDragEnd).on(`touchend`+this.namespace,this.onDragEnd)}unbindCaptureEvents(){this.$(document).off(this.namespace)}};let re=`object`;var F=class{constructor(e){this.kendo=e,this.keys={INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F12:123,SHIFT:16,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110},this.days={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6}}get kendoData(){return this.kendo.data||{}}toHyphens(e){return e.replace(/([a-z][A-Z])/g,e=>e.charAt(0)+`-`+e.charAt(1).toLowerCase())}toCamelCase(e){return e.replace(/\-(\w)/g,(e,t)=>t.toUpperCase())}size(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&n!==`toJSON`&&t++;return t}deepExtend(e,...t){for(let n=0;n<t.length;n++)this.deepExtendOne(e,t[n]);return e}deepExtendOne(e,t){let n=this.kendoData.ObservableArray,r=this.kendoData.LazyObservableArray,i=this.kendoData.DataSource,a=this.kendoData.HierarchicalDataSource;for(let o in t){if(o===`__proto__`||o===`constructor`||o===`prototype`)continue;let s=t[o],c=typeof s,l=null;c===re&&s!==null&&(l=s.constructor);let u=l?.name===`RegExp`,d=l?.name===`ArrayBuffer`,f=l?.name===`Date`;if(l&&!Array.isArray(s)&&l!==n&&l!==r&&l!==i&&l!==a&&!u&&(!this.isFunction(window.ArrayBuffer)||!d)&&!(s instanceof HTMLElement))if(f)e[o]=new Date(s.getTime());else if(this.isCloneable(s))e[o]=s.clone();else{let t=e[o];typeof t===re?e[o]=t||{}:e[o]={},this.deepExtendOne(e[o],s)}else c!==`undefined`&&(e[o]=s)}return e}isCloneable(e){return typeof e.clone==`function`}throttle(e,t){if(!t||t<=0)return e;let n,r=0,i=function(...i){let a=this,o=+new Date-r;function s(){let t=e.apply(a,i);return r=+new Date,t}if(!r||(n&&clearTimeout(n),o>t))return s();n=setTimeout(s,t-o)};return i.cancel=function(){n&&=(clearTimeout(n),void 0)},i}guid(){let e=window.crypto;try{return e.randomUUID()}catch{return e.getRandomValues(new Uint8Array(16)).reduce((e,t,n)=>((n===4||n===6||n===8||n===10)&&(e+=`-`),e+=t.toString(16).padStart(2,`0`),e),``)}}trim(e){return e?e.toString().trim():``}isPresent(e){return e!=null}isBlank(e){return e==null}isEmpty(e){return e.length===0}isString(e){return typeof e==`string`}isInteger(e){return Number.isInteger(e)}isNumeric(e){return!isNaN(e-parseFloat(e))}isDate(e){return e&&e.getTime}isFunction(e){return typeof e==`function`}isObject(e){return e!==null&&typeof e===re}logToConsole(e,t){let n=window.console;!this.kendo.suppressLog&&n!==void 0&&n.log&&n[t||`log`](e)}whenAll(e){let t=window.jQuery,n=arguments.length===1&&Array.isArray(e)?e:Array.prototype.slice.call(arguments),r=n.length,i=r,a=t.Deferred(),o=0,s=0,c=Array(r),l=Array(r),u=Array(r),d,f=(e,t,r)=>function(){r!==n&&s++,a.notifyWith(t[e]=this,r[e]=Array.prototype.slice.call(arguments)),--i||a[(s?`reject`:`resolve`)+`With`](t,r)};for(;o<r;o++)d=n[o],d&&this.isFunction(d.promise)?d.promise().done(f(o,u,n)).fail(f(o,c,l)):(a.notifyWith(this,d),--i);return i||a.resolveWith(u,n),a.promise()}isLocalUrl(e){return e&&!/^([a-z]+:)?\/\//i.test(e)}getAllMethods(e){let t=Object.getOwnPropertyNames(e).filter(t=>typeof e[t]==`function`),n=Object.getOwnPropertyNames(Object.getPrototypeOf(new e({}))).filter(e=>e!==`constructor`);return t.concat(n)}getBaseClass(e){if(e instanceof Function){let t=e,n=Object.getPrototypeOf(t);if(n&&n!==Object&&n.name)return n}return null}createProxyMember(e,t){e.fn[t]=function(){let e=this._instance;if(e)return e[t].apply(e,arguments)}}convertPromiseToDeferred(e){let t=$.Deferred();return e.finally(t.always).then(t.resolve).catch(t.reject),t.promise()}};let ie=`prefix`;var ae=class{constructor(){this.themeColorValues=[`base`,`primary`,`secondary`,`tertiary`,`inherit`,`info`,`success`,`warning`,`error`,`dark`,`light`,`inverse`],this.fillModeValues=[`solid`,`outline`,`flat`],this.shapeValues=[`rectangle`,`square`],this.sizeValues=[[`small`,`sm`],[`medium`,`md`],[`large`,`lg`]],this.roundedValues=[[`small`,`sm`],[`medium`,`md`],[`large`,`lg`],[`full`,`full`],[`none`,`none`]],this.positionModeValues=[`fixed`,`static`,`sticky`,`absolute`],this.resizeValues=[[`both`,`resize`],[`horizontal`,`resize-x`],[`vertical`,`resize-y`]],this.overflowValues=[`auto`,`hidden`,`visible`,`scroll`,`clip`],this.layoutFlowValues=[[`vertical`,`!k-flex-col`],[`horizontal`,`!k-flex-row`]],this.defaultValues={},this.propertyDictionary={},this.propertyToCssClassMap={},this.registerDefaultCssClasses(`themeColor`,this.themeColorValues),this.registerDefaultCssClasses(`fillMode`,this.fillModeValues),this.registerDefaultCssClasses(`shape`,this.shapeValues),this.registerDefaultCssClasses(`size`,this.sizeValues),this.registerDefaultCssClasses(`positionMode`,this.positionModeValues),this.registerDefaultCssClasses(`rounded`,this.roundedValues),this.registerDefaultCssClasses(`resize`,this.resizeValues),this.registerDefaultCssClasses(`overflow`,this.overflowValues),this.registerDefaultCssClasses(`layoutFlow`,this.layoutFlowValues),this.registerCssClasses(`themeColor`,this.themeColorValues),this.registerCssClasses(`fill`,this.fillModeValues),this.registerCssClasses(`shape`,this.shapeValues),this.registerCssClasses(`size`,this.sizeValues),this.registerCssClasses(`positionMode`,this.positionModeValues)}registerPrefix(e,t){this.propertyDictionary[e]||(this.propertyDictionary[e]={}),this.propertyDictionary[e][ie]=t}registerValues(e,t){let n,r,i,a,o,s;for(this.propertyDictionary[e]||(this.propertyDictionary[e]={}),n=0;n<t.length;n++)for(i=t[n].prop,o=t[n].values,this.propertyDictionary[e][i]||(this.propertyDictionary[e][i]={}),a=this.propertyDictionary[e][i],r=0;r<o.length;r++)s=o[r],Array.isArray(s)?a[s[0]]=s[1]:a[s]=s}getValidClass(e){let t=e.widget,n=e.propName,r=e.value,i=e.prefix,a=this.defaultValues[n],o=this.propertyDictionary[t];if(!o)return``;let s=o[n],c=s&&s[r]||a&&a[r];if(c){let e;return e=n===`themeColor`?o[ie]:n===`positionMode`?`k-pos-`:n===`rounded`?`k-rounded-`:n===`resize`?`k-`:n===`overflow`?`k-overflow-`:n===`layoutFlow`?``:o[ie],e=i||e,e+c}else return``}registerDefaultCssClass(e,t,n){this.defaultValues[e]||(this.defaultValues[e]={}),this.defaultValues[e][t]=n||t}registerDefaultCssClasses(e,t){for(let n=0;n<t.length;n++)if(Array.isArray(t[n])){let r=t[n];this.registerDefaultCssClass(e,r[0],r[1])}else this.registerDefaultCssClass(e,t[n])}registerCssClass(e,t,n){this.propertyToCssClassMap[e]||(this.propertyToCssClassMap[e]={}),this.propertyToCssClassMap[e][t]=n||t}registerCssClasses(e,t){for(let n=0;n<t.length;n++)if(Array.isArray(t[n])){let r=t[n];this.registerCssClass(e,r[0],r[1])}else this.registerCssClass(e,t[n])}getValidCssClass(e,t,n){if(n===void 0)return``;let r=this.propertyToCssClassMap[t]?.[n];if(r)return e+r}};let oe=[`themeColor`,`fillMode`,`shape`,`size`,`rounded`,`positionMode`],se=`aria-labelledby`,ce=`aria-label`;var I=class e extends M{static call(t,n,r){e.fn.init.call(t,n,r)}static apply(t,n){e.fn.init.apply(t,n)}constructor(e,t){super(),e!==void 0&&this.init(e,t)}init(e,t){let r=this;n.validatePackage()||(r._showWatermarkOverlay=n.addWatermarkOverlayAndBanner);let i=T(E).getConstructor();r.element=i(e).handler(r),M.fn.init.call(r);let a=t?t.dataSource:null,o;t&&(o=(r.componentTypes||{})[t.componentType]),a&&(t=i.extend({},t,{dataSource:{}})),t=r.options=i.extend(!0,{},r.options,r.defaults,o||{},t),a&&(t.dataSource=a);let s=T(P).attr(`role`);r.element.attr(s)||r.element.attr(s,(t.name||``).toLowerCase()),r.element.data(`kendo`+t.prefix+t.name,r),r.bind(r.events,t)}_hasBindingTarget(){return!!this.element[0].kendoBindingTarget}_tabindex(e){e||=this.wrapper;let t=this.element,n=`tabindex`,r=e.attr(n)||t.attr(n);t.removeAttr(n),e.attr(n,isNaN(r)?0:r)}setOptions(e){this._clearCssClasses(e),this._setEvents(e),T(E).getConstructor().extend(this.options,e),this._applyCssClasses()}_setEvents(e){let t=this,n=0,r=t.events.length,i;for(;n<r;n++)i=t.events[n],t.options[i]&&e[i]&&(t.unbind(i,t.options[i]),t._events&&t._events[i]&&delete t._events[i]);t.bind(t.events,e)}resize(e){let t=this.getSize(),n=this._size;(e||(t.width>0||t.height>0)&&(!n||t.width!==n.width||t.height!==n.height))&&(this._size=t,this._resize(t,e),this.trigger(`resize`,t))}getSize(){return T(P).dimensions(this.element)}size(e){if(e)this.setSize(e);else return this.getSize()}setSize(e){}_resize(e,t){}destroy(){let e=this;e.element.removeData(`kendo`+e.options.prefix+e.options.name),e.element.removeData(`handler`),e.unbind()}_destroy(){this.destroy()}_applyCssClasses(e){let t=this.__proto__.options,n=this.options,r=e||this.wrapper||this.element,i=[],a,o,s,c,l=T(ae);if(s=this.options._altname||t.name,c=l.propertyDictionary[s],!(!l||!c)){for(a=0;a<oe.length;a++)o=oe[a],s=this.options._altname||t.name,(o in t||o in n)&&i.push(l.getValidClass({widget:s,propName:o,value:n[o]}));r.addClass(i.join(` `))}}_ariaLabel(e){let t=this,n=t.element,r=n.attr(`id`),i=T(E).getConstructor()(`label[for="`+r+`"]`),a=n.attr(ce),o=n.attr(se),s;if(e[0]!==n[0]){if(a)e.attr(ce,a);else if(o)e.attr(se,o);else if(i.length){let n=T(F).guid();s=i.attr(`id`)||t._generateLabelId(i,r||n),e.attr(se,s)}}}_clearCssClasses(e,t){let n=this.__proto__.options,r=this.options,i=t||this.wrapper||this.element,a,o,s,c,l=T(ae);if(s=this.options._altname||n.name,c=l.propertyDictionary[s],!(!l||!c))for(a=0;a<oe.length;a++)o=oe[a],(o in n||o in r)&&e.hasOwnProperty(o)&&(o===`themeColor`?i.removeClass(l.getValidClass({widget:s,propName:o,value:r[o],fill:r.fillMode})):(o===`fillMode`&&i.removeClass(l.getValidClass({widget:s,propName:`themeColor`,value:r.themeColor,fill:r.fillMode})),i.removeClass(l.getValidClass({widget:s,propName:o,value:r[o]}))))}_generateLabelId(e,t){let n=t+`_label`;return e.attr(`id`,n),n}};I.fn=I.prototype,I.prototype.options={prefix:``},I.prototype.events=[];let le=/&/g,ue=/</g,de=/"/g,fe=/'/g,pe=/>/g,me=[`http:`,`https:`];var L=class{decode(e){let t={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`};return e.replace(/&(?:amp|lt|gt|quot|#39);/g,function(e){return t[e]})}encode(e,t){return t===!0&&(e=this.decode(e)),(``+e).replace(le,`&`).replace(ue,`<`).replace(pe,`>`).replace(de,`"`).replace(fe,`'`)}sanitizeLink(e){let t=``;try{let n=new URL(e,window.location.origin);if(me.includes(n.protocol))t=e;else throw Error(`Invalid protocol`)}catch{t=`#INVALIDLINK`}return this.encode(t)}convertTextUrlToLink(e,t){return(t?e:this.encode(e)).replace(/((https?:\/\/[^\s"'<>]+)|(www\.[^\s"'<>]+))/gi,(e,t,n,r,i,a)=>{let o=a.lastIndexOf(`>`,i-1),s=a.substring(o+1,i);if(/\w+\s*=\s*["']$/.test(s))return e;let c=e.trim(),l=e.trim();/^www\./i.test(c)&&(c=`https://`+c);try{return c=new URL(c).href,`<a href="${c}" target="_blank" rel="noopener noreferrer">${l}</a>`}catch{return e}})}unescape(e){let t;try{t=window.decodeURIComponent(e)}catch{t=e.replace(/%u([\dA-F]{4})|%([\dA-F]{2})/gi,function(e,t,n){return String.fromCharCode(parseInt(`0x`+(t||n),16))})}return t}};let he={}.toString,ge=/[+|\-]\d{1,2}/,_e=/[+|\-]\d{1,2}:?\d{2}/,ve=/^\/Date\((.*?)\)\/$/,ye=/[+-]\d*/,be=[[],[`G`,`g`,`F`],[`D`,`d`,`y`,`m`,`T`,`t`]],xe=[[`yyyy-MM-ddTHH:mm:ss.fffffffzzz`,`yyyy-MM-ddTHH:mm:ss.fffffff`,`yyyy-MM-ddTHH:mm:ss.fffzzz`,`yyyy-MM-ddTHH:mm:ss.fff`,`ddd MMM dd yyyy HH:mm:ss`,`yyyy-MM-ddTHH:mm:sszzz`,`yyyy-MM-ddTHH:mmzzz`,`yyyy-MM-ddTHH:mmzz`,`yyyy-MM-ddTHH:mm:ss`,`yyyy-MM-dd HH:mm:ss`,`yyyy/MM/dd HH:mm:ss`],[`yyyy-MM-ddTHH:mm`,`yyyy-MM-dd HH:mm`,`yyyy/MM/dd HH:mm`],[`yyyy/MM/dd`,`yyyy-MM-dd`,`HH:mm:ss`,`HH:mm`]],Se={2:/^\d{1,2}/,3:/^\d{1,3}/,4:/^\d{4}/,exact3:/^\d{3}/};var Ce=class{constructor(e,t){this.cultureService=e,this.roundFn=t,this.timezoneService=null}setTimezoneService(e){this.timezoneService=e}parseDate(e,t,n,r){return this.internalParseDate(e,t,n,!1,r)}parseExactDate(e,t,n){return this.internalParseDate(e,t,n,!0)}internalParseDate(e,t,n,r,i){if(he.call(e)===`[object Date]`)return e;if(!e)return null;let a=String(e),o=null,s;if(a.indexOf(`/D`)===0){let e=ve.exec(a);if(e){let t=e[1];if(s=ye.exec(t.substring(1)),o=new Date(parseInt(t,10)),s&&this.timezoneService){let e=this.parseMicrosoftFormatOffset(s[0]);o=this.timezoneService.apply(o,0),o=this.timezoneService.convert(o,0,-1*e)}return o}}let c=this.cultureService.getCulture(n),l;l=t?Array.isArray(t)?t:[t]:this.getDefaultFormats(c);for(let e=0;e<l.length;e++)if(o=this.parseExact(a,l[e],c,r,i),o)return o;return o}parseExact(e,t,n,r,i){if(!e)return null;let a=n.calendars.standard,o=0,s=0,c=e=>{let n=0;for(;t[o]===e;)n++,o++;return n>0&&--o,n},l=t=>{let n=``;if(t===2)for(let r=0;r<=t;r++)n+=e[s+r]||``;n=i&&n.match(Se.exact3)&&Number.isInteger(Number(n))&&Number(n)>0?this.unpadZero(n):e.substr(s,t);let r=Se[t]||RegExp(`^\\d{1,`+t+`}`),a=n.match(r);if(a){let e=a[0];return s+=e.length,parseInt(e,10)}return null},u=(t,n,r)=>{let i=0,a=0;for(let o=0;o<t.length;o++){let c=t[o],l=c.length,u=e.substr(s,r||l);n&&(u=u.toLowerCase()),u===c&&l>i&&(i=l,a=o)}return i?(s+=i,a+1):null},d=()=>e.charAt(s)===t[o]?(s++,!0):!1,f=null,p=null,m=null,h=null,g=null,_=null,v=null,y=!1,b=new Date,x=a.twoDigitYearMax||2029,S=b.getFullYear(),C=null,w,T=null,E=null;t||=`d`;let D=a.patterns[t];D&&(t=D);let O=t.split(``),k=O.length;for(a._lowerDays||=this.lowerLocalInfo(a.days),a._lowerMonths||=this.lowerLocalInfo(a.months);o<k;o++){let t=O[o];if(y)t===`'`?y=!1:d();else if(t===`d`){let e=c(`d`);if(m!==null&&e>2)continue;if(m=e<3?l(2):u(a._lowerDays[e===3?`namesAbbr`:`names`],!0),m===null||this.outOfRange(m,1,31))return null}else if(t===`M`){let e=c(`M`);if(p=e<3?l(2):u(a._lowerMonths[e===3?`namesAbbr`:`names`],!0),p===null||this.outOfRange(p,1,12))return null;--p}else if(t===`y`){let e=c(`y`);if(f=l(e),f===null)return null;if(e===2){let e=x;typeof e==`string`&&(e=S+parseInt(e,10)),f=S-S%100+f,f>e&&(f-=100)}}else if(t===`h`){if(c(`h`),h=l(2),h===12&&(h=0),h===null||this.outOfRange(h,0,11))return null}else if(t===`H`){if(c(`H`),h=l(2),h===null||this.outOfRange(h,0,23))return null}else if(t===`m`){if(c(`m`),g=l(2),g===null||this.outOfRange(g,0,59))return null}else if(t===`s`){if(c(`s`),_=l(2),_===null||this.outOfRange(_,0,59))return null}else if(t===`f`){let t=c(`f`),n=e.substr(s,t).match(Se[3]);if(v=l(t),v!==null&&n){let e=parseFloat(`0.`+n[0]);e=parseFloat(this.roundFn(e,3)),v=e*1e3}if(v===null||this.outOfRange(v,0,999))return null}else if(t===`t`){let e=c(`t`),t=a.AM,n=a.PM;if(e===1&&(t=this.mapDesignators(t),n=this.mapDesignators(n)),C=u(n,!1,this.longestStringLength(n)),!C&&!u(t,!1,this.longestStringLength(t)))return null}else if(t===`z`){w=!0;let t=c(`z`);if(e.substr(s,1)===`Z`){d();continue}let n=e.substr(s,6).match(t>2?_e:ge);if(!n)return null;let r=n[0].split(`:`),i=r[0],a=r[1];if(!a&&i.length>3&&(s=i.length-2,a=i.substring(s),i=i.substring(0,s)),T=parseInt(i,10),this.outOfRange(T,-12,13)||t>2&&(a=r[0][0]+a,E=parseInt(a,10),isNaN(E)||this.outOfRange(E,-59,59)))return null}else if(t===`'`)y=!0,d();else if(!d())return null}if(r&&!/^\s*$/.test(e.substr(s)))return null;f===null&&p===null&&m===null&&(h!==null||g!==null||_!==null)?(f=S,p=b.getMonth(),m=b.getDate()):(f===null&&(f=S),m===null&&(m=1)),C&&h!==null&&h<12&&(h+=12);let A;return w?(T&&h!==null&&(h+=-T),E&&g!==null&&(g+=-E),A=new Date(Date.UTC(f,p??0,m,h??0,g??0,_??0,v??0))):(A=new Date(f,p??0,m,h??0,g??0,_??0,v??0),this.adjustDST(A,h)),f<100&&A.setFullYear(f),A.getDate()!==m&&w===void 0?null:A}parseMicrosoftFormatOffset(e){let t=e.substr(0,1)===`-`?-1:1;return e=e.substring(1),t*(parseInt(e.substr(0,2),10)*60+parseInt(e.substring(2),10))}getDefaultFormats(e){let t=Math.max(be.length,xe.length),n=(e.calendar||e.calendars.standard).patterns,r=[];for(let e=0;e<t;e++){let t=be[e]||[];for(let e=0;e<t.length;e++)r.push(n[t[e]]);r.push(...xe[e]||[])}return r}outOfRange(e,t,n){return!(e>=t&&e<=n)}adjustDST(e,t){!t&&e.getHours()===23&&e.setHours(e.getHours()+2)}lowerLocalInfo(e){return{names:e.names.map(e=>e.toLowerCase()),namesAbbr:e.namesAbbr.map(e=>e.toLowerCase())}}unpadZero(e){return e.replace(/^0*/,``)}mapDesignators(e){return e.map(e=>e.charAt(0))}longestStringLength(e){return e.reduce((e,t)=>Math.max(e,t.length),0)}},we=class e{static{this.DEFAULT_OPTIONS={autoSync:!0,schema:{model:{id:`id`,fields:{id:{type:`string`},text:{type:`string`},authorId:{type:`string`},authorName:{type:`string`},authorImageUrl:{type:`string`},authorImageAltText:{type:`string`},replyToId:{type:`string`,defaultValue:null},isDeleted:{type:`boolean`,defaultValue:!1},isPinned:{type:`boolean`,defaultValue:!1},isTyping:{type:`boolean`,defaultValue:!1},timestamp:{type:`date`},files:{parse:e=>e||[]}}}}}}static{this.FIELD_MAP={text:`textField`,authorId:`authorIdField`,authorName:`authorNameField`,authorImageUrl:`authorImageUrlField`,authorImageAltText:`authorImageAltTextField`,id:`idField`,timestamp:`timestampField`,files:`filesField`,replyToId:`replyToIdField`,isDeleted:`isDeletedField`,isPinned:`isPinnedField`,isTyping:`isTypingField`}}constructor(e){this.context=e,this.options=this.buildOptions(e.chatOptions),this.dataSource=this.createDataSource(e.chatOptions)}buildOptions(t){let n;return n=t.dataSource instanceof kendo.data.DataSource?$.extend(!0,{},e.DEFAULT_OPTIONS,t.dataSource.options):Array.isArray(t.dataSource)?$.extend(!0,{},e.DEFAULT_OPTIONS,{data:t.dataSource}):$.extend(!0,{},e.DEFAULT_OPTIONS,t.dataSource),n.autoAssignId=t.autoAssignId,this.mapFields(n.schema.model.fields,t),n}createDataSource(e){return e.dataSource instanceof kendo.data.DataSource?e.dataSource:kendo.data.DataSource.create(this.options)}mapFields(t,n){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e.FIELD_MAP[r]){let i=e.FIELD_MAP[r];t[r].from=n[i]}}getDataSource(){return this.dataSource}getView(){return this.dataSource.view()}getLastMessage(){let e=this.getView();return e.length?e[e.length-1]:null}getMessageById(e){return e?this.dataSource.get(e):null}getMessageByUid(e){return this.dataSource.getByUid(e)}getFileByUid(e,t){return!e||!t?null:e.files.find(e=>e.uid===t)||null}getPinnedMessage(){return this.dataSource.data().find(e=>e.isPinned)||null}postMessage(e,t){let n=typeof e==`string`?{text:e}:e,r={id:this.options.autoAssignId?this.context.utilsService.guid():void 0,timestamp:new Date,files:[],...n,authorId:n.authorId?.toString()||t};return this.dataSource.add(r)}updateMessage(e,t){if(!e)return null;let n=e;if(e instanceof kendo.data.ObservableObject||(n=this.getMessageById(e.id)),!n)return null;for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.set(e,t[e]);return n}removeMessage(e){return e?(e.set(`isDeleted`,!0),!0):!1}pinMessage(e){if(!e)return!1;let t=this.getPinnedMessage();return t&&t.set(`isPinned`,!1),e.set(`isPinned`,!0),e}clearPinnedMessage(){let e=this.getPinnedMessage();e&&e.set(`isPinned`,!1)}};let R=`.kendoChat`,Te={STANDARD:`standard`,FULL:`full`},Ee={SENT:`sent`,DELIVERED:`delivered`,SEEN:`seen`,FAILED:`failed`},z={HORIZONTAL:`horizontal`,VERTICAL:`vertical`,WRAP:`wrap`},B={SCROLL:`scroll`,WRAP:`wrap`,SCROLLBUTTONS:`scrollbuttons`},V={attachment:`paperclip-outline-alt-right`,attachmentMenu:`more-vertical`,checkCircle:`check-circle`,chevronDown:`chevron-down`,chevronLeft:`chevron-left`,chevronRight:`chevron-right`,chevronUp:`chevron-up`,download:`download`,fileError:`file-error`,filePdf:`file-pdf`,microphoneOutline:`microphone-outline`,pin:`pin`,undo:`undo`,copy:`copy`,trash:`trash`,send:`paper-plane`,stop:`stop-sm`,upload:`upload`,x:`x`,arrowDown:`arrow-down`,retry:`arrow-rotate-cw`},H={reply:`reply`,copy:`copy`,pin:`pin`,delete:`delete`,download:`download`},U={active:`k-active`,selected:`k-selected`,focus:`k-focus`,expanded:`k-expanded`,disabled:`k-disabled`,hidden:`k-hidden`,generating:`k-generating`,noAvatar:`k-no-avatar`,file:`k-file-box`,fileInfo:`k-file-info`,fileName:`k-file-name`,fileSize:`k-file-size`,fileWrapper:`k-file-box-wrapper`,fileWrapperScrollableStart:`k-file-box-wrapper-scrollable-start`,filesScroll:`k-files-scroll`,filesVertical:`k-files-vertical`,filesWrap:`k-files-wrap`,avatar:`k-avatar`,bubble:`k-bubble`,bubbleContent:`k-bubble-content`,bubbleExpandable:`k-bubble-expandable`,bubbleExpandableIndicator:`k-bubble-expandable-indicator`,chatBubble:`k-chat-bubble`,chatBubbleText:`k-chat-bubble-text`,button:`k-button`,buttonDefaults:`k-button-md k-rounded-md k-button-solid k-button-solid-base`,buttonIcon:`k-button-icon`,buttonPrimary:`k-button-md k-rounded-md k-button-flat k-button-flat-primary`,iconButton:`k-icon-button`,menuButton:`k-menu-button`,chatSend:`k-chat-send`,chatUpload:`k-chat-upload`,downloadButton:`k-chat-download-button`,downloadButtonWrapper:`k-chat-download-button-wrapper`,canvas:`k-chat-canvas`,card:`k-card`,cardAction:`k-card-action`,cardActions:`k-card-actions`,cardActionsVertical:`k-actions-vertical`,cardBody:`k-card-body`,cardDeck:`k-card-deck`,cardDeckScrollWrap:`k-card-deck-scrollwrap`,cardList:`k-card-list`,cardMedia:`k-card-media`,cardRich:`k-card-type-rich`,cardSubtitle:`k-card-subtitle`,cardTitle:`k-card-title`,cardWrapper:`k-card-container`,dropzoneHint:`k-dropzone-hint`,dropzoneIcon:`k-dropzone-icon`,dropzoneInner:`k-dropzone-inner`,externalDropzone:`k-external-dropzone`,header:`k-chat-header`,message:`k-message`,messageAuthor:`k-message-author`,messageGroup:`k-message-group`,messageGroupContent:`k-message-group-content`,messageGroupFullWidth:`k-message-group-full-width`,messageGroupReceiver:`k-message-group-receiver`,messageGroupSender:`k-message-group-sender`,messageListContent:`k-message-list-content`,messageRemoved:`k-message-removed`,messageStatus:`k-message-status`,messageTime:`k-message-time`,messageInfo:`k-message-info`,messageFailed:`k-message-failed`,messageToolbar:`k-chat-message-toolbar`,messageRetryButton:`k-message-retry-button`,messagePinned:`k-message-pinned`,messageReference:`k-message-reference`,messageReferenceContent:`k-message-reference-content`,messageReferenceReceiver:`k-message-reference-receiver`,messageReferenceSender:`k-message-reference-sender`,scrollButtonIconLeft:`chevron-left`,scrollButtonIconRight:`chevron-right`,suggestion:`k-suggestion`,suggestionGroup:`k-suggestion-group`,suggestionGroupScrollable:`k-suggestion-group-scrollable`,suggestionGroupWrap:`k-suggestion-group-wrap`,suggestionsScroll:`k-suggestions-scroll`,suggestionScrollWrap:`k-suggestion-scrollwrap`,suggestionScrollWrapGradient:`k-suggestion-scrollwrap-gradient`,timestamp:`k-timestamp`,typingIndicator:`k-typing-indicator`,viewWrapper:`k-message-list`,wrapper:`k-chat`,messageBox:`k-message-box`,messageBoxWrapper:`k-message-box-wrapper`,spacer:`k-spacer`,scrollFab:`k-chat-scroll-fab`,fab:`k-fab`},W={fileButton:`ref-chat-file-button`,fileMenuButton:`ref-chat-file-menu-button`,fileWrapper:`ref-chat-file-wrapper`,fileCloseButton:`ref-chat-file-close-button`,bubbleExpandableIndicator:`ref-chat-bubble-expandable-indicator`,messageReferencePinWrapper:`ref-chat-message-reference-pin-wrapper`,messageReferenceReplyWrapper:`ref-chat-message-reference-reply-wrapper`,pinnedMessageCloseButton:`ref-chat-pinned-message-close-button`,replyMessageCloseButton:`ref-chat-reply-message-close-button`,leftScrollButton:`ref-chat-left-scroll-button`,rightScrollButton:`ref-chat-right-scroll-button`,sendButton:`ref-chat-message-box-send-button`,speechToTextButton:`ref-chat-message-box-speech-to-text-button`,suggestionGroup:`ref-chat-suggestion-group`,fileUploadInput:`ref-chat-file-upload-input`,viewWrapper:`ref-chat-view-wrapper`,scrollToBottomButton:`ref-chat-scroll-to-bottom-button`,retryButton:`ref-chat-message-retry-button`},G={sendMessage:`sendMessage`,suggestionClick:`suggestionClick`,unpin:`unpin`,input:`input`,toolbarAction:`toolbarAction`,fileMenuAction:`fileMenuAction`,contextMenuAction:`contextMenuAction`,download:`download`,fileSelect:`fileSelect`,fileRemove:`fileRemove`,executeAction:`executeAction`,resendMessage:`resendMessage`,suggestedActionClick:`suggestedActionClick`,messageToolbarExecute:`messageToolbarExecute`,fileMenuExecute:`fileMenuExecute`,downloadAllFiles:`downloadAllFiles`,expandableToggle:`expandableToggle`,replyMessageCloseButtonClick:`replyMessageCloseButtonClick`},K=`click`,De=`focus`,Oe=`blur`,ke=`change`,q=`${R}navigation`,Ae=null,je=!1;var Me=class{constructor(e){this.context=e}setupAriaAttributes(){let e=this.context.getOptions().messages,t=this.context.wrapper.find(`.${U.viewWrapper}`);t.length&&t.attr(`role`,`log`).attr(`aria-live`,`polite`).attr(`aria-label`,e.messageListLabel),this.setupBubbleTabNavigation(),this.setupSuggestionAccessibility(),this.setupButtonAccessibility(e),this.setupExpandableIndicators(),this.setupScrollButtonsAria(),this.setupMessageBoxAria(e)}setupBubbleTabNavigation(){let e=this.context.wrapper.find(`.${U.bubble}`),t=e.filter(function(){return $(this).find(`.${U.typingIndicator}`).length===0}),n=e.filter(function(){return $(this).find(`.${U.typingIndicator}`).length>0});t.attr(`tabindex`,`0`),n.attr(`tabindex`,`-1`),t.off(`${De}${q} ${Oe}${q} ${K}${q}`).on(`${De}${q}`,function(){let t=$(this);Ae&&e.removeClass(U.selected),e.removeClass(U.focus),Ae&&t.addClass(U.selected),t.addClass(U.focus),Ae=!1}).on(`${Oe}${q}`,function(){Ae&&!je&&$(this).removeClass(U.selected),$(this).removeClass(U.focus)}).on(`${K}${q}`,function(e){$(e.target).closest(W.fileMenuButton)||$(this).trigger(De)})}setupSuggestionAccessibility(){this.context.wrapper.find(`.${U.suggestionGroup}`).each((e,t)=>{let n=$(t);n.attr(`role`,`group`),n.find(`.${U.suggestion}`).each((e,t)=>{$(t).attr(`role`,`button`).attr(`tabindex`,`0`)})})}setupButtonAccessibility(e){this.context.wrapper.find(`.k-input-suffix > .k-button`).each((t,n)=>{let r=$(n);!r.attr(`role`)&&n.nodeName.toLowerCase()!==`button`&&r.attr(`role`,`button`),!r.attr(`aria-label`)&&!r.attr(`title`)&&(r.hasClass(U.chatSend)?r.attr(`aria-label`,e.actionButton||e.sendButton):r.hasClass(`k-chat-upload`)&&r.attr(`aria-label`,e.fileButton)),r.hasClass(U.chatSend)&&r.hasClass(`k-disabled`)&&r.attr(`aria-disabled`,`true`)}),this.context.wrapper.find(`.${U.downloadButton}`).each((t,n)=>{let r=$(n);!r.attr(`role`)&&n.nodeName.toLowerCase()!==`button`&&r.attr(`role`,`button`),!r.attr(`aria-label`)&&!r.attr(`title`)&&r.attr(`aria-label`,e.downloadAll)}),this.setupCloseButtonAria(W.pinnedMessageCloseButton,e.pinnedMessageCloseButton),this.setupCloseButtonAria(W.replyMessageCloseButton,e.replyMessageCloseButton),this.context.wrapper.find(`[${W.fileMenuButton}]`).each((t,n)=>{let r=$(n);r.attr(`aria-label`,e.fileMenuButton),r.attr(`title`,e.fileMenuButton)})}setupCloseButtonAria(e,t){this.context.wrapper.find(`[${e}]`).each((e,n)=>{let r=$(n);!r.attr(`role`)&&n.nodeName.toLowerCase()!==`button`&&r.attr(`role`,`button`),!r.attr(`aria-label`)&&!r.attr(`title`)&&(r.attr(`aria-label`,t),r.attr(`title`,t))})}setupExpandableIndicators(){this.context.wrapper.find(`.${U.bubbleExpandableIndicator}`).each((e,t)=>{let n=$(t);n.attr(`role`,`button`).attr(`tabindex`,`0`);let r=n.closest(`.${U.bubble}`).hasClass(U.expanded)?`Collapse message`:`Expand message`;n.attr(`aria-label`,r)})}setupScrollButtonsAria(){let e=this.context.getOptions().dir,t=this.context.wrapper.find(`[${W.leftScrollButton}]`),n=this.context.wrapper.find(`[${W.rightScrollButton}]`),r=e===`rtl`?`Scroll Right`:`Scroll Left`,i=e===`rtl`?`Scroll Left`:`Scroll Right`;t.attr(`aria-label`,r),t.attr(`title`,r),n.attr(`aria-label`,i),n.attr(`title`,i)}setupMessageBoxAria(e){this.context.wrapper.find(`.${U.messageBox}`).find(`textarea`).attr(`aria-label`,e.messageBoxLabel)}setFileCloseButtonAria(e){e.find(`[${W.fileCloseButton}]`).each((e,t)=>{let n=$(t);!n.attr(`role`)&&t.nodeName.toLowerCase()!==`button`&&n.attr(`role`,`button`),!n.attr(`aria-label`)&&!n.attr(`title`)&&(n.attr(`aria-label`,`Remove selected file`),n.attr(`title`,`Remove selected file`))})}updateExpandableIndicatorAria(e,t){let n=t?`Collapse message`:`Expand message`;e.attr(`aria-label`,n)}handleKeyDown(e,t){if(!$(e.target).closest(this.context.wrapper).length)return null;let n=$(e.target),r=e.keyCode||e.which;return Ae=!0,je=e.shiftKey,n.hasClass(U.bubble)&&this.handleBubbleKeyDown(e,r),n.hasClass(U.suggestion)&&this.handleClickableElementKeyDown(e,r),n.hasClass(U.bubbleExpandableIndicator)&&this.handleExpandableIndicatorKeyDown(e,r,n),n.hasClass(`k-input-inner`)&&this.handleMessageInputKeyDown(e,r,t),n.closest(`.k-input-suffix .k-button`).length&&this.handleClickableElementKeyDown(e,r),null}handleBubbleKeyDown(e,t){let n=$(e.target);if(n.find(`.${U.typingIndicator}`).length>0)return;let r=this.context.wrapper.find(`.${U.bubble}`).filter(function(){return $(this).find(`.${U.typingIndicator}`).length===0}),i=r.index(n),a=this.context.utilsService.keys;switch(t){case a.UP:e.preventDefault(),this.focusBubbleAtIndex(r,i-1);break;case a.DOWN:e.preventDefault(),this.focusBubbleAtIndex(r,i+1);break;case a.HOME:e.preventDefault(),this.focusBubbleAtIndex(r,0);break;case a.END:e.preventDefault(),this.focusBubbleAtIndex(r,r.length-1);break}}focusBubbleAtIndex(e,t){if(e.length===0||t<0||t>=e.length)return;let n=e.eq(t);n.attr(`data-keyboard-focus`,`true`),n.focus(),n.removeAttr(`data-keyboard-focus`)}handleExpandableIndicatorKeyDown(e,t,n){let r=this.context.utilsService.keys;if(t===r.ENTER||t===r.SPACEBAR){e.preventDefault(),n.trigger(K);let t=n.closest(`.${U.bubble}`).hasClass(U.expanded);this.updateExpandableIndicatorAria(n,!t)}}handleMessageInputKeyDown(e,t,n){}handleClickableElementKeyDown(e,t){let n=this.context.utilsService.keys;(t===n.ENTER||t===n.SPACEBAR)&&(e.preventDefault(),$(e.target).trigger(K))}},Ne=class e extends I{static{this.options={name:`MessageToolbar`}}constructor(t,n){super(t,$.extend(!0,{},e.options,n)),this.extendItemsConfig(),this.create(),this.attachEvents()}create(){let e=this.element.data(`kendoToolBar`);e&&e.destroy();let t=$.extend({},this.options,{fillMode:`flat`});delete t.name,this.toolbar=new kendo.ui.ToolBar(this.element,t)}extendItemsConfig(){let e=this.options.items;e&&e.forEach(e=>{e.attributes=e.attributes||{};let t=e.attributes[`aria-label`];e.attributes[`data-command`]=e.name.toLowerCase(),e.attributes[`aria-label`]=t??e.name,e.type=`button`,e.fillMode=`flat`,e.overflow=`never`})}attachEvents(){this.toolbar.bind(K,this.onClick.bind(this))}onClick(e){let t=e.target.closest(`.`+U.message),n=e.target.data(`command`);n&&this.executeCommand(n,e.target,t)}executeCommand(e,t,n){this.trigger(`execute`,{type:e,item:t,message:n})}destroy(){this.toolbar&&=(this.toolbar.destroy(),null),this.element.empty()}},Pe=class e extends I{static{this.options={name:`ChatFileMenu`,items:[]}}constructor(t,n){super(t,$.extend(!0,{},e.options,n)),this.setCommandAttributes(),this.createDropdownButton()}createDropdownButton(){this.dropdownButton=new kendo.ui.DropDownButton(this.element,{items:this.options.items,fillMode:`flat`,icon:V.attachmentMenu}),this.dropdownButton.bind(`click`,this.onClick.bind(this)).bind(`open`,this.onOpen.bind(this)).bind(`close`,this.onClose.bind(this))}setCommandAttributes(){this.options.items.forEach(e=>{e.attributes=e.attributes||{},e.attributes[`data-command`]=e.name.toLowerCase(),e.id=e.name.toLowerCase()})}onClick(e){let t=e.id,n=$(e.sender.element).closest(`.`+U.file),r=$(e.sender.element).closest(`.`+U.message);t&&this.executeCommand(t,$(e.sender.element),n,r)}onOpen(e){let t=!0,n=$(e.sender.element);(n.closest(`.`+U.messageRemoved).length||n.find(`.`+U.typingIndicator).length)&&(e.preventDefault(),t=!1),this.setActive(n,t)}onClose(e){let t=$(e.sender.element),n=t.closest(`.`+U.message);this.setActive(t,!1),this.trigger(`close`,{message:n})}executeCommand(e,t,n,r){this.trigger(`execute`,{type:e,item:t,file:n,message:r})}setActive(e,t){let n=e.closest(`.`+U.bubble);t?n.addClass(U.active):n.removeClass(U.active)}destroy(){this.dropdownButton&&=(this.dropdownButton.destroy(),null),super.destroy()}},Fe=class{constructor(e,t,n){this.$=e,this.support=t,this.inputService=n,this._fileGroupMap=this.createFileGroupMap(),this.fileSaver=document.createElement(`a`),this.downloadAttribute=`download`in this.fileSaver&&!this.support.browser.edge}createFileGroupMap(){return{audio:[`.aif`,`.iff`,`.m3u`,`.m4a`,`.mid`,`.mp3`,`.mpa`,`.wav`,`.wma`,`.ogg`,`.wav`,`.wma`,`.wpl`],video:[`.3g2`,`.3gp`,`.avi`,`.asf`,`.flv`,`.m4u`,`.rm`,`.h264`,`.m4v`,`.mkv`,`.mov`,`.mp4`,`.mpg`,`.rm`,`.swf`,`.vob`,`.wmv`],image:[`.ai`,`.dds`,`.heic`,`.jpe`,`jfif`,`.jif`,`.jp2`,`.jps`,`.eps`,`.bmp`,`.gif`,`.jpeg`,`.jpg`,`.png`,`.ps`,`.psd`,`.svg`,`.svgz`,`.tif`,`.tiff`],txt:[`.doc`,`.docx`,`.log`,`.pages`,`.tex`,`.wpd`,`.wps`,`.odt`,`.rtf`,`.text`,`.txt`,`.wks`],presentation:[`.key`,`.odp`,`.pps`,`.ppt`,`.pptx`],data:[`.xlr`,`.xls`,`.xlsx`],programming:`.tmp,.bak,.msi,.cab,.cpl,.cur,.dll,.dmp,.drv,.icns,.ico,.link,.sys,.cfg,.ini,.asp,.aspx,.cer,.csr,.css,.dcr,.htm,.html,.js,.php,.rss,.xhtml`.split(`,`),pdf:[`.pdf`],config:[`.apk`,`.app`,`.bat`,`.cgi`,`.com`,`.exe`,`.gadget`,`.jar`,`.wsf`],zip:[`.7z`,`.cbr`,`.gz`,`.sitx`,`.arj`,`.deb`,`.pkg`,`.rar`,`.rpm`,`.tar.gz`,`.z`,`.zip`,`.zipx`],"disc-image":[`.dmg`,`.iso`,`.toast`,`.vcd`,`.bin`,`.cue`,`.mdf`]}}get fileGroup