@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
209 lines • 253 kB
JavaScript
/* @license */
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("kendo.core.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.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.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){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let h=`undefined`;function g(e,t,n){for(let n in t)if(t.hasOwnProperty(n)&&t[n].test(e))return n;return n===void 0?e:n}let _=new class{constructor(){this._scrollbar=void 0,this.scrollbar=this.scrollbar.bind(this),this.isRtl=this.isRtl.bind(this),this.detectOS=this.detectOS.bind(this),this.detectBrowser=this.detectBrowser.bind(this),this.detectClipboardAccess=this.detectClipboardAccess.bind(this),this.zoomLevel=this.zoomLevel.bind(this),this.delayedClick=this.delayedClick.bind(this),this.initialize()}initialize(){let e=window,t=document,n=navigator,r=t.createElement(`table`);try{r.innerHTML=`<tr><td></td></tr>`,this.tbodyInnerHtml=!0}catch{this.tbodyInnerHtml=!1}this.touch=`ontouchstart`in e;let i=t.documentElement.style,a=`HTMLElement`in e?HTMLElement.prototype:[];this.transforms=this.transitions={css:``,prefix:``,event:`transitionend`},this.hasHW3D=`WebKitCSSMatrix`in e&&`m11`in new e.WebKitCSSMatrix||`MozPerspective`in i||`msPerspective`in i,this.cssFlexbox=`flexWrap`in i||`WebkitFlexWrap`in i||`msFlexWrap`in i,this.devicePixelRatio=e.devicePixelRatio===void 0?1:e.devicePixelRatio;try{this.screenWidth=e.outerWidth||e.screen?e.screen.availWidth:e.innerWidth,this.screenHeight=e.outerHeight||e.screen?e.screen.availHeight:e.innerHeight}catch{this.screenWidth=e.screen.availWidth,this.screenHeight=e.screen.availHeight}let o=this.detectOS(n.userAgent);this.mobileOS=o,this.wpDevicePixelRatio=o&&o.wp?screen.width/320:0,this.hasNativeScrolling=!1,o&&(o.ios||o.android&&parseInt(o.majorVersion)>2||o.wp)&&(this.hasNativeScrolling=o),this.mouseAndTouchPresent=this.touch&&!(o&&(o.ios||o.android)),this.browser=this.detectBrowser(n.userAgent),!o&&this.touch&&this.browser.safari&&(o=this.mobileOS={ios:!0,tablet:`tablet`,device:`ipad`,majorVersion:`13`,minorVersion:`0`,flatVersion:`1300`,cordova:!1,appMode:!1,name:`ios`,browser:`mobilesafari`}),this.clipboard=this.detectClipboardAccess(),this.eventCapture=!!t.documentElement.addEventListener;let s=t.createElement(`input`);this.placeholder=`placeholder`in s,this.propertyChangeEvent=`onpropertychange`in s,this.input=this.detectInputTypes(s),s.style.cssText=`float:left;`,this.cssFloat=!!s.style.cssFloat,this.stableSort=this.detectStableSort(),this.matchesSelector=a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.matchesSelector||a.matches||function(e){let n=t.querySelectorAll?(this.parentNode||t).querySelectorAll(e)||[]:$(e),r=n.length;for(;r--;)if(n[r]===this)return!0;return!1},this.matchMedia=`matchMedia`in e,this.pushState=!!(e.history&&e.history.pushState),this.hashChange=`onhashchange`in e,this.customElements=`registerElement`in t;let c=this.browser.chrome,l=this.browser.crios,u=this.browser.mozilla,d=this.browser.safari;this.msPointers=!c&&e.MSPointerEvent,this.pointers=!c&&!l&&!u&&!d&&e.PointerEvent,this.kineticScrollNeeded=!!(o&&(o.device!==`ipad`||parseInt(o.majorVersion)<13)&&(this.touch||this.msPointers||this.pointers)),this.touch?this.mobileOS?(this.mousedown=`touchstart`,this.mouseup=`touchend`,this.mousemove=`touchmove`,this.mousecancel=`touchcancel`,this.click=`touchend`,this.resize=`orientationchange`):(this.mousedown=`mousedown touchstart`,this.mouseup=`mouseup touchend`,this.mousemove=`mousemove touchmove`,this.mousecancel=`mouseleave touchcancel`,this.click=`click`,this.resize=`resize`):this.pointers?(this.mousemove=`pointermove`,this.mousedown=`pointerdown`,this.mouseup=`pointerup`,this.mousecancel=`pointercancel`,this.click=`pointerup`,this.resize=`orientationchange resize`):this.msPointers?(this.mousemove=`MSPointerMove`,this.mousedown=`MSPointerDown`,this.mouseup=`MSPointerUp`,this.mousecancel=`MSPointerCancel`,this.click=`MSPointerUp`,this.resize=`orientationchange resize`):(this.mousemove=`mousemove`,this.mousedown=`mousedown`,this.mouseup=`mouseup`,this.mousecancel=`mouseleave`,this.click=`click`,this.resize=`resize`),this.addBrowserCssClasses($)}scrollbar(e){if(!isNaN(this._scrollbar)&&!e)return this._scrollbar;let t=document.createElement(`div`);return t.style.cssText=`overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block`,t.innerHTML=` `,document.body.appendChild(t),this._scrollbar=t.offsetWidth-t.scrollWidth,document.body.removeChild(t),this._scrollbar}isRtl(e){return $(e).closest(`.k-rtl`).length>0}detectOS(e){let t=!1,n,r=null,i=!/mobile safari/i.test(e),a={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.?(\d+(\.\d+)?)?/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},o={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},s={tablet:/playbook|ipad|fire/i},c={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,ie:/MSIE|Windows\sPhone/i,chrome:/chrome|crios/i,webkit:/webkit/i,edge:/edge|edg|edgios|edga/i};for(let l in a)if(a.hasOwnProperty(l)&&(r=e.match(a[l]),r)){if(l===`windows`&&`plugins`in navigator)return!1;t={},t.device=l,t.tablet=g(l,s,!1),t.browser=g(e,c,`default`),t.name=g(l,o),t[t.name]=!0,t.majorVersion=r[2],t.minorVersion=(r[3]||`0`).replace(`_`,`.`),n=t.minorVersion.replace(`.`,``).substr(0,2),t.flatVersion=t.majorVersion+n+Array(3-(n.length<3?n.length:2)).join(`0`),t.cordova=typeof window.PhoneGap!=h||typeof window.cordova!=h,t.appMode=!!navigator.standalone||/file|local|wmapp/.test(window.location.protocol)||t.cordova,t.android&&(this.devicePixelRatio<1.5&&parseInt(t.flatVersion)<400||i)&&(this.screenWidth>800||this.screenHeight>800)&&(t.tablet=l);break}return t}detectBrowser(e){let t=!1,n,r,i={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome|crios)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i};for(let a in i)if(i.hasOwnProperty(a)&&(n=e.match(i[a]),n)){t={},t[a]=!0,t[n[1].toLowerCase().split(` `)[0].split(`/`)[0]]=!0,t.version=parseInt(document.documentMode||n[2],10),t.chrome&&(r=e.match(/(edg)[ \/]([\w.]+)/i),r&&(t.chromiumEdge=!0));break}return t||{version:0}}detectClipboardAccess(){let e=document,t={copy:e.queryCommandSupported?e.queryCommandSupported(`copy`):!1,cut:e.queryCommandSupported?e.queryCommandSupported(`cut`):!1,paste:e.queryCommandSupported?e.queryCommandSupported(`paste`):!1};return this.browser.chrome&&(t.paste=!1,this.browser.version>=43&&(t.copy=!0,t.cut=!0)),t}zoomLevel(){try{let e=this.browser,t=0,n=document.documentElement;return e.msie&&e.version===11&&n.scrollHeight>n.clientHeight&&!this.touch&&(t=this.scrollbar()),this.touch?n.clientWidth/window.innerWidth:e.msie&&e.version>=10?((top||window).document.documentElement.offsetWidth+t)/(top||window).innerWidth:1}catch{return 1}}delayedClick(){if(this.touch){let e=this.mobileOS;if(e&&e.ios)return!0;if(e&&e.android)return this.browser.chrome?this.browser.version<32?!1:!($(`meta[name=viewport]`).attr(`content`)||``).match(/user-scalable=no/i):!0}return!1}detectInputTypes(e){let t=[`number`,`date`,`time`,`month`,`week`,`datetime`,`datetime-local`],n=`test`,r={};for(let i of t)e.setAttribute(`type`,i),e.value=n,r[i.replace(`-`,``)]=e.type!==`text`&&e.value!==n;return r}detectStableSort(){let e=[{index:0,field:`b`}];for(let t=1;t<513;t++)e.push({index:t,field:`a`});return e.sort((e,t)=>e.field>t.field?1:e.field<t.field?-1:0),e[0].index===1}addBrowserCssClasses(e){let t=this.browser,n=``,r=e(document.documentElement),i=parseInt(String(t.version),10);t.msie?n=`ie`:t.mozilla?n=`ff`:t.safari?n=`safari`:t.webkit?n=`webkit`:t.opera?n=`opera`:t.edge&&(n=`edge`),n&&=`k-`+n+` k-`+n+i,this.mobileOS&&(n+=` k-mobile`),this.cssFlexbox||(n+=` k-no-flexbox`),r.addClass(n)}bootstrapToMedia(e){return{xs:`(max-width: 576px)`,sm:`(min-width: 576px)`,md:`(min-width: 768px)`,lg:`(min-width: 992px)`,xl:`(min-width: 1200px)`}[e]}matchesMedia(e){let t=this.bootstrapToMedia(e)||e;return this.matchMedia&&window.matchMedia(t).matches}},v=new class{constructor(){this.mouseTrap=!1,this.bustClick=!1,this.captureMouse=!1,this.MOUSE_EVENTS=[`mousedown`,`mousemove`,`mouseenter`,`mouseleave`,`mouseover`,`mouseout`,`mouseup`,`click`],this.EXCLUDE_BUST_CLICK_SELECTOR=`label, input, [data-rel=external]`}setupMouseMute(){let e=0,t=this.MOUSE_EVENTS.length,n=document.documentElement;if(this.mouseTrap||!_.eventCapture)return;this.mouseTrap=!0,this.bustClick=!1,this.captureMouse=!1;let r=this,i=function(e){r.captureMouse&&(e.type===`click`?r.bustClick&&!$(e.target).is(r.EXCLUDE_BUST_CLICK_SELECTOR)&&(e.preventDefault(),e.stopPropagation()):e.stopPropagation())};for(;e<t;e++)n.addEventListener(this.MOUSE_EVENTS[e],i,!0)}muteMouse(e){this.captureMouse=!0,e.data?.bustClick&&(this.bustClick=!0),clearTimeout(this.mouseTrapTimeoutID)}unMuteMouse(){clearTimeout(this.mouseTrapTimeoutID),this.mouseTrapTimeoutID=setTimeout(()=>{this.captureMouse=!1,this.bustClick=!1},400)}},y=new class{constructor(){this.eventRegEx=/([^ ]+)/g,this.eventMap=this.buildEventMap(),this.setupMSPointerEvents()}buildEventMap(){let e={down:`touchstart mousedown`,move:`mousemove touchmove`,up:`mouseup touchend touchcancel`,cancel:`mouseleave touchcancel`};return _.touch&&_.mobileOS&&(_.mobileOS.ios||_.mobileOS.android)?e={down:`touchstart`,move:`touchmove`,up:`touchend touchcancel`,cancel:`touchcancel`}:_.pointers?e={down:`pointerdown`,move:`pointermove`,up:`pointerup`,cancel:`pointercancel pointerleave`}:_.msPointers&&(e={down:`MSPointerDown`,move:`MSPointerMove`,up:`MSPointerUp`,cancel:`MSPointerCancel MSPointerLeave`}),e}setupMSPointerEvents(){_.msPointers&&!(`onmspointerenter`in window)&&$.each({MSPointerEnter:`MSPointerOver`,MSPointerLeave:`MSPointerOut`},(e,t)=>{$.event.special[e]={delegateType:t,bindType:t,handle:function(e){let n,r=this,i=e.relatedTarget,a=e.handleObj;return(!i||i!==r&&!this.$.contains(r,i))&&(e.type=a.origType,n=a.handler.apply(this,arguments),e.type=t),n}}})}getEventMap(e){return this.eventMap[e]||e}getFullEventMap(){return{...this.eventMap}}applyEventMap(e,t){return e=e.replace(this.eventRegEx,e=>this.getEventMap(e)),t&&(e=e.replace(this.eventRegEx,`$1.`+t)),e}},b=`object`,x=new class{constructor(){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 window.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===b&&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==b?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==b}logToConsole(e,t){let n=window.console;!window.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=Object.getPrototypeOf(e);if(t&&t!==Object&&t.name)return t}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()}},S=new class{constructor(){this.originalOn=$.fn.on,this.kendoJQuery=this.createKendoJQuery(),this.rootjQuery=this.kendoJQuery(document)}noDeprecateExtend(e,t,...n){let r,i,a,o,s;typeof t!=`object`&&typeof t!=`function`&&(t={});for(let c of n)if(c!=null)for(o in c)o!==`filters`&&o!==`concat`&&o!==`:`&&o!==`cssNumber`&&(r=t[o],a=c[o],t!==a&&(e&&a&&($.isPlainObject(a)||(i=Array.isArray(a)))?(i?(i=!1,s=r&&Array.isArray(r)?r:[]):s=r&&$.isPlainObject(r)?r:{},t[o]=this.noDeprecateExtend(e,s,a)):a!==void 0&&(t[o]=a)));return t}createKendoJQuery(){let e=this,t=function(e,n){return new t.fn.init(e,n)};return this.noDeprecateExtend(!0,t,$),t.fn=t.prototype=new $,t.fn.constructor=t,t.fn.init=function(n,r){return r&&r instanceof $&&!(r instanceof t)&&(r=t(r)),$.fn.init.call(this,n,r,e.rootjQuery)},t.fn.init.prototype=t.fn,$.extend(t.fn,{handler:function(e){return this.data(`handler`,e),this},autoApplyNS:function(e){return this.data(`kendoNS`,e||x.guid()),this},on:function(...t){let n=this,r=n.data(`kendoNS`),i=e.originalOn;if(t.length===1)return i.call(n,t[0]);let a=n,o=t.slice();o[o.length-1]===void 0&&o.pop();let s=o[o.length-1],c=y.applyEventMap(o[0],r);if(_.mouseAndTouchPresent&&c.search(/mouse|click/)>-1&&this[0]!==document.documentElement){v.setupMouseMute();let e=o.length===2?null:o[1],t=c.indexOf(`click`)>-1&&c.indexOf(`touchend`)>-1;i.call(this,{touchstart:e=>v.muteMouse(e),touchend:()=>v.unMuteMouse()},e,{bustClick:t})}if(o[0].indexOf(`keydown`)!==-1&&o[1]&&o[1].options){o[0]=c;let t=o[1],r=o[o.length-1];return o[o.length-1]=function(n){if(e.keyDownHandler(n,t))return r.apply(this,[n])},i.apply(n,o),n}if(typeof s==`string`){a=n.data(`handler`);let e=a[s];o[o.length-1]=function(t){e.call(a,t)}}return o[0]=c,i.apply(n,o),n},kendoDestroy:function(e){return e||=this.data(`kendoNS`),e&&this.off(`.`+e),this}}),t}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}};var C=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]=S.getConstructor().extend(!0,{},n.prototype[t],e[t]):i[t]=e[t];return i.constructor=r,r.extend=t.extend,r}};C.fn=C.prototype,C.prototype.init=function(...e){},C.prototype._initOptions=function(e){this.options=S.getConstructor().extend(!0,{},this.options,e)};let w=`string`,T=`function`;function E(){this._defaultPrevented=!0}function D(){return this._defaultPrevented===!0}var O=class extends C{constructor(){super(),this._events={}}init(...e){this._events={}}bind(e,t,n){let r=this,i,a,o,s,c=typeof t==T,l;if(t===void 0){let t=e;for(i in t)r.bind(i,t[i]);return r}let u=typeof e==w?[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==w?[e]:e,a=i.length,o,s=typeof t==T,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=E,e.isDefaultPrevented=D,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 k=O.prototype;[`init`,`bind`,`one`,`first`,`trigger`,`unbind`].forEach(e=>{let t=k[e];Object.defineProperty(k,e,{value:t,writable:!0,configurable:!0,enumerable:!0})}),O.fn=O.prototype;let A=new class{constructor(){this._ns=``}get ns(){return this._ns}setNs(e){this._ns=e}},j=/%/,ee=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i;var te=class{constructor(){this.animationQueue=[];let e=window;this.animationFrameFn=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||(e=>{setTimeout(e,1e3/60)})}isElement(e){return e instanceof Element||e instanceof HTMLDocument}outerWidth(e,t,n){let r=$(e);return n?this.getHiddenDimensions(r,t).width:r.outerWidth(t||!1)||0}outerHeight(e,t,n){let r=$(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&&$.each(t,(e,t)=>{n[t]=r.getPropertyValue(t)})):(r=e.currentStyle,t&&$.each(t,(e,t)=>{n[t]=r[x.toCamelCase(t)]})),x.size(n)?n:r}isScrollable(e){if(e.dataset[A.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=_.browser.webkit,r=_.browser.mozilla,i=_.browser.version;if(e instanceof $&&t!==void 0){e.each((e,n)=>{this.scrollLeft(n,t)});return}let a=e instanceof $?e[0]:e;if(!a)return;let o=_.isRtl(e);if(t!==void 0)o&&n&&(i<85||_.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||_.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(_.browser.msie&&(_.pointers||_.msPointers)&&!n){let t=_.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($(`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 $.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&&ee.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=j.test(n),s=j.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($(`<div/>`).addClass(`k-child-animation-container`).css({width:i?`auto`:d,height:f})),a=e.parent(),a.wrap($(`<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:``}),j.test(s.width)||j.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=_.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 _.mobileOS&&_.mobileOS.android&&(t=function(){setTimeout(e,600)}),$(window).on(_.resize,t),t}unbindResize(e){$(window).off(_.resize,e)}attrValue(e,t){return e.data(A.ns+t)}attr(e){return`data-`+A.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=t.map(e=>`[${this.attr(`style-${e}`)}]`).join(`,`);e.find(n).addBack(n).each((e,n)=>{let r=$(n);t.forEach(e=>{let t=this.attr(`style-${e}`);r.attr(t)&&(r.css(e,r.attr(t)),r.removeAttr(t))})})}progress(e,t,n){let r=e.find(`.k-loading-mask`),i=_.browser,a=$.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=_.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=window.kendo.ui?.progress?.messages?.loading||`Loading...`;$(`<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(!_.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(e,t)}createResizeObserver(e){return new ie(e)}},ne=class e{static{this.DRAG_THRESHOLD=5}constructor(e,t){this.isDragging=!1,this.hasDragged=!1,this.dragStartX=0,this.scrollStartLeft=0,this.currentDragTarget=null,this.scrollContainer=e,this.namespace=t.namespace,this.captureElement=t.captureElement,this.delegateSelector=t.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=$(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.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&&$(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(){$(document).off(this.namespace)}};let re=typeof ResizeObserver<`u`;var ie=class{static supported(){return re}constructor(e){this.onResize=e=>{this.resizeCallback&&this.resizeCallback()};let t=e.element;this.element=t instanceof $?t[0]:t,this.resizeCallback=e.onResize,this.debounceTime=e.debounceTime??50,this.observeOptions=e.observeOptions||{},this.resizeObserver=null,this.debounceResize=null,this.initResizeObserver()}initResizeObserver(){this.debounceResize=x.throttle(this.onResize.bind(this),this.debounceTime),re&&(this.resizeObserver=new ResizeObserver(this.debounceResize),this.resizeObserver.observe(this.element,this.observeOptions))}destroy(){this.destroyResizeObserver(),this.element=null}destroyResizeObserver(){this.resizeObserver&&this.resizeObserver.disconnect(),this.debounceResize&&this.debounceResize.cancel(),this.resizeObserver=null,this.debounceResize=null,this.resizeCallback=null}};let M=new te,ae=`prefix`,oe=new class{constructor(){this.themeColorValues=[`base`,`primary`,`secondary`,`tertiary`,`inherit`,`info`,`success`,`warning`,`error`,`inverse`],this.fillModeValues=[`solid`,`outline`,`flat`],this.shapeValues=[`rectangle`,`square`],this.sizeValues=[[`xsmall`,`xs`],[`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][ae]=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[ae]:n===`positionMode`?`k-pos-`:n===`rounded`?`k-rounded-`:n===`resize`?`k-`:n===`overflow`?`k-overflow-`:n===`layoutFlow`?``:o[ae],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}},se=new class{constructor(){this.overrides={},this._hasOverrides=!1,this.registry=new WeakMap,this._tokenCounter=0,this._activeContexts=new Map,this._contextOrder=[]}setIcons(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n],i=e[r];if(typeof i==`string`||this.isSVGIcon(i))this.overrides[r]=i;else if(typeof i==`object`&&i){(!this.overrides[r]||this.isSVGIcon(this.overrides[r])||typeof this.overrides[r]==`string`)&&(this.overrides[r]={});let e=Object.keys(i);for(let t=0;t<e.length;t++)this.overrides[r][e[t]]=i[e[t]]}}this._hasOverrides=!0}beginInit(e,t){let n=++this._tokenCounter;return this._activeContexts.set(n,e),this._contextOrder.push(n),t&&this.registerElement(t,e),n}registerElement(e,t){let n=this._contextOrder.length>0?this._contextOrder[0]:null,r=n===null?t:this._activeContexts.get(n);this.registry.set(e,{root:r,self:t})}finalizeContext(e){this._activeContexts.delete(e);let t=this._contextOrder.indexOf(e);t!==-1&&this._contextOrder.splice(t,1)}resolve(e,t){if(!this._hasOverrides)return null;let n;if(this._contextOrder.length>0){n=[];for(let e=0;e<this._contextOrder.length;e++)n.push(this._activeContexts.get(this._contextOrder[e]))}else if(t){let e=this.registry.get(t)||this._findAncestorContext(t);e&&(n=e.root===e.self?[e.root]:[e.root,e.self])}if(n)for(let t=0;t<n.length;t++){let r=this.overrides[n[t]];if(r&&!this.isSVGIcon(r)&&typeof r!=`string`){let t=r[e];if(t)return t}}let r=this.overrides[e];return r&&(this.isSVGIcon(r)||typeof r==`string`)?r:null}reset(){this.overrides={},this._hasOverrides=!1,this._activeContexts.clear(),this._contextOrder=[],this._tokenCounter=0}_findAncestorContext(e){let t=e.parentElement;for(;t;){let e=this.registry.get(t);if(e)return e;t=t.parentElement}}isSVGIcon(e){return typeof e==`object`&&!!e&&`name`in e&&`viewBox`in e&&`content`in e}};var N;(function(e){e.BLAZOR=`BLAZOR`,e.DPL=`DPL`,e.JM=`JM`,e.KENDOUIANGULAR=`KENDOUIANGULAR`,e.KENDOUICOMPLETE=`KENDOUICOMPLETE`,e.KENDOUIMVC=`KENDOUIMVC`,e.KENDOUIREACT=`KENDOUIREACT`,e.KENDOUIVUE=`KENDOUIVUE`,e.MAUI=`MAUI`,e.RCAJAX=`RCAJAX`,e.RCWF=`RCWF`,e.RCWPF=`RCWPF`,e.REPORTING=`REPORTING`,e.REPORTSERVER=`REPORTSERVER`,e.UIASPCORE=`UIASPCORE`,e.UIXAM=`UIXAM`,e.WINUI=`WINUI`})(N||={}),Object.freeze({[N.BLAZOR]:`Telerik UI for Blazor`,[N.DPL]:`Telerik Document Processing`,[N.JM]:`Telerik JustMock`,[N.KENDOUIANGULAR]:`Kendo UI for Angular`,[N.KENDOUICOMPLETE]:`Kendo UI for jQuery`,[N.KENDOUIMVC]:`Telerik UI for ASP.NET MVC`,[N.KENDOUIREACT]:`KendoReact`,[N.KENDOUIVUE]:`Kendo UI for Vue`,[N.MAUI]:`Telerik UI for .NET MAUI`,[N.RCAJAX]:`Telerik UI for ASP.NET AJAX`,[N.RCWF]:`Telerik UI for WinForms`,[N.RCWPF]:`Telerik UI for WPF`,[N.REPORTING]:`Telerik Reporting`,[N.REPORTSERVER]:`Telerik Report Server`,[N.UIASPCORE]:`Telerik UI for ASP.NET Core`,[N.UIXAM]:`Telerik UI for Xamarin`,[N.WINUI]:`Telerik UI for WinUI`});function ce(e){return Math.floor(e.getTime()/1e3)}function le(e,t){let n=new Date(1e3*e);return n.setDate(n.getDate()+t),ce(n)}function ue(){return ce(new Date)}function de(e){let t=function(e){if(typeof atob==`function`)return atob(e);if(typeof Buffer==`function`)return Buffer.from(e,`base64`).toString(`utf8`);throw Error(`atob is undefined`)}(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function fe(e){return de(e.replace(/-/g,`+`).replace(/_/g,`/`))}function P(e){return new Date(1e3*e)}function F(e,t){let n=P(t);return e>new Date(n.getFullYear(),n.getMonth(),n.getDate()+1).getTime()/1e3}function pe(e,t){let n=[];return e.licenses?.length>0?n=e.licenses.map(e=>function(e){let t=e.split(`.`)[1],n=String.fromCharCode(...fe(t));return JSON.parse(n)}(e)):e.products?.length>0&&(n=e.products.map(t=>({type:t.trial?`trial`:`perpetual`,code:t.code,expiration:t.licenseExpirationDate,licenseId:null,userId:e.userId}))),function(e,t){let n=t.filter(e=>e.type!==`usage`).filter(t=>e.productCode===t.code||e.redistributedBy?.includes(t.code)||e.productCodes?.includes(t.code)).sort((e,t)=>t.expiration-e.expiration);return n.find(e=>e.type===`subscription`&&!F(ue(),e.expiration))||n.find(t=>t.type===`perpetual`&&!F(e.publishDate,t.expiration))||n.find(e=>e.type===`subscription`&&!F(le(ue(),10),e.expiration))||n.find(e=>e.type===`trial`&&!F(ue(),e.expiration))||n.find(e=>e.type===`subscription`)||n.find(e=>e.type===`perpetual`)||n.find(e=>e.type===`trial`)}(t,n)}let me=e=>e.productCode||e.productCodes[0],he=Object.freeze({name:`key`,content:`
<svg
width="32"
height="32"
viewBox="0 0 32 32"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M22.702 2.1821C24.3149 2.51082 25.8077 3.27291 27.0199 4.38645C28.2321 5.49999 29.1179 6.92286 29.582 8.5021C30.012 9.9501 30.076 11.4821 29.768 12.9621C29.3228 14.9898 28.2025 16.8063 26.5904 18.1143C24.9783 19.4223 22.9699 20.1443 20.894 20.1621C20.018 20.1621 19.146 20.0361 18.308 19.7821L16.708 21.6581L15.95 22.0081H14V25.0081L13 26.0081H10V29.0081L9 30.0081H3L2 29.0081V24.3941L2.292 23.6881L12.24 13.7401C11.9577 12.8308 11.8226 11.8821 11.84 10.9301C11.8582 9.59817 12.1701 8.28666 12.7533 7.08907C13.3365 5.89147 14.1767 4.83728 15.214 4.00164C16.2514 3.166 17.4603 2.56949 18.7546 2.25464C20.0489 1.93978 21.3967 1.91633 22.702 2.1821ZM25.338 16.5821C26.5944 15.5647 27.4681 14.1509 27.816 12.5721L27.824 12.5821C28.0718 11.4277 28.0272 10.2297 27.6943 9.09691C27.3614 7.96412 26.7507 6.93248 25.9177 6.09572C25.0847 5.25896 24.0558 4.64361 22.9246 4.30557C21.7933 3.96753 20.5955 3.91753 19.44 4.1601C17.8816 4.506 16.4837 5.36334 15.4688 6.59561C14.454 7.82789 13.8806 9.36426 13.84 10.9601C13.82 11.8721 13.98 12.7761 14.318 13.6201L14.098 14.7061L4 24.8081V28.0081H8V25.0081L9 24.0081H12V21.0081L13 20.0081H15.49L17.242 17.9761L18.364 17.6961C19.1728 18.0121 20.0337 18.1736 20.902 18.1721C22.5181 18.1597 24.082 17.5991 25.338 16.5821ZM23.662 11.1181C23.8197 10.9002 23.9318 10.6527 23.9916 10.3905C24.0515 10.1283 24.0578 9.85665 24.0103 9.59192C23.9627 9.32718 23.8622 9.07476 23.7148 8.84975C23.5675 8.62474 23.3762 8.43177 23.1526 8.28238C22.9289 8.133 22.6774 8.03026 22.4131 7.98033C22.1488 7.93039 21.8771 7.93428 21.6144 7.99176C21.3516 8.04925 21.1031 8.15914 20.8838 8.31487C20.6645 8.4706 20.4789 8.66896 20.338 8.8981C20.067 9.33887 19.9774 9.86752 20.088 10.373C20.1985 10.8784 20.5007 11.3214 20.931 11.6087C21.3613 11.8961 21.8862 12.0055 22.3954 11.914C22.9047 11.8226 23.3587 11.5373 23.662 11.1181Z"
fill="black"
/>
<path
d="M23.1299 16.0186L31.1387 31.0273L31.0068 31.25H14.9932L14.8604 31.0273L22.8955 16.0186H23.1299Z"
fill="#FFC000"
stroke="black"
strokeWidth="1.5"
/>
<rect x="22.25" y="21.2686" width="1.5" height="5" rx="0.75" fill="black" />
<path
d="M24 28.2686C24 27.7163 23.5523 27.2686 23 27.2686C22.4479 27.2687 22 27.7164 22 28.2686C22 28.8207 22.4479 29.2684 23 29.2686C23.5523 29.2686 24 28.8208 24 28.2686Z"
fill="black"
/>
</svg>
`}),ge=Object.freeze({name:`trial-tag`,content:`
<svg
width="38"
height="38"
viewBox="0 0 38 38"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0)">
<path
d="M24.9056 7.60146L34.4998 10.1722L31.9299 19.7659L13.7653 30.2532L6.7419 18.0883L24.9056 7.60146Z"
stroke="black"
strokeWidth="1.75"
/>
<path
d="M13.0913 19.7635L15.4762 23.8942L14.6279 24.384L12.2431 20.2533L13.0913 19.7635ZM14.3623 19.0297L14.7473 19.6964L11.3769 21.6423L10.992 20.9756L14.3623 19.0297ZM14.8475 18.7496L16.388 17.8602C16.7038 17.6778 17.0025 17.5684 17.2841 17.532C17.5675 17.4944 17.8242 17.5328 18.0542 17.6472C18.2841 17.7616 18.4772 17.954 18.6333 18.2244C18.7611 18.4457 18.833 18.6576 18.8491 18.8602C18.866 19.0598 18.8369 19.2518 18.7619 19.4364C18.6876 19.6179 18.5778 19.7923 18.4322 19.9596L18.2446 20.257L16.9055 21.0301L16.5166 20.3695L17.5124 19.7946C17.6618 19.7083 17.7704 19.6103 17.8381 19.5006C17.9059 19.3909 17.9371 19.2745 17.9317 19.1516C17.9281 19.0275 17.8903 18.9031 17.8183 18.7782C17.7418 18.6458 17.6512 18.5456 17.5463 18.4775C17.4415 18.4095 17.3242 18.3788 17.1944 18.3857C17.0647 18.3925 16.9242 18.4395 16.7729 18.5269L16.0835 18.9249L18.0834 22.3889L17.2323 22.8803L14.8475 18.7496ZM19.5417 21.547L17.5367 20.2496L18.4328 19.7247L20.4294 20.9815L20.4523 21.0212L19.5417 21.547ZM19.4746 16.0781L21.8595 20.2088L21.0112 20.6986L18.6264 16.5679L19.4746 16.0781ZM22.4103 15.3251L23.2638 19.398L22.3588 19.9205L21.5088 14.9037L22.0847 14.5712L22.4103 15.3251ZM25.3207 18.2105L22.2174 15.4365L21.7187 14.7825L22.3003 14.4467L26.2285 17.6864L25.3207 18.2105ZM24.3818 16.7023L24.7668 17.369L22.5851 18.6286L22.2002 17.9619L24.3818 16.7023ZM28.8837 15.2683L29.267 15.9321L27.1874 17.1327L26.8041 16.4689L28.8837 15.2683ZM25.0778 12.8432L27.4626 16.9739L26.6115 17.4652L24.2267 13.3345L25.0778 12.8432Z"
fill="black"
/>
<circle
cx="30.1049"
cy="12.7084"
r="1.12128"
transform="rotate(15 30.1049 12.7084)"
fill="black"
/>
</g>
<path
d="M27.6201 19.7998L35.6016 34.7578L35.499 34.9316H19.542L19.4385 34.7578L27.4463 19.7998H27.6201Z"
fill="#FFC000"
stroke="black"
strokeWidth="1.6"
/>
<rect x="26.7705" y="25" width="1.5" height="5" rx="0.75" fill="black" />
<path
d="M28.5205 32C28.5205 31.4477 28.0728 31 27.5205 31C26.9684 31.0002 26.5205 31.4478 26.5205 32C26.5205 32.5522 26.9684 32.9998 27.5205 33C28.0728 33 28.5205 32.5523 28.5205 32Z"
fill="black"
/>
<defs>
<clipPath id="clip0">
<rect
width="30"
height="31.1538"
fill="white"
transform="translate(8.06323) rotate(15)"
/>
</clipPath>
</defs>
</svg>
`}),_e=Object.freeze({name:`recurring-payment`,content:`
<svg
width="32"
height="32"
viewBox="0 0 32 32"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M27.8295 9.38659C28.8049 12.1653 28.7404 15.1391 27.774 17.7996C26.8014 20.4767 24.9215 22.8356 22.2691 24.367C19.7765 25.8061 16.9908 26.2908 14.3393 25.9323C11.6293 25.5682 9.06228 24.3215 7.08577 22.3155L8.23679 21.1826C9.95578 22.9294 12.1925 24.0142 14.5527 24.333C16.8583 24.6438 19.2821 24.2206 21.457 22.965C23.7719 21.6284 25.4118 19.5739 26.2565 17.2495C27.0643 15.0253 27.1474 12.5486 26.3976 10.2107L24.951 11.0459L25.5942 7.15112L29.2888 8.54145L27.8284 9.38462L27.8295 9.38659Z"
fill="black"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M16.3594 8.08301C17.1842 8.16959 17.8382 8.41741 18.3281 8.8252C18.8135 9.2331 19.1263 9.78023 19.2607 10.4639L17.2939 10.6875C17.1732 10.1497 16.8607 9.78518 16.3594 9.59375V12.2617C17.6035 12.5557 18.4514 12.9408 18.9004 13.4102C19.3516 13.8819 19.5771 14.4863 19.5771 15.2246C19.5771 16.0494 19.2949 16.7425 18.7275 17.3076C18.1601 17.8728 17.3712 18.2233 16.3594 18.3623V19.6387H15.2334V18.3779C14.3448 18.2822 13.6246 17.9934 13.0664 17.5059C12.5081 17.0182 12.155 16.3275 12 15.4365L14.0127 15.2266C14.0947 15.5912 14.2497 15.9036 14.4775 16.168C14.7053 16.4321 14.9555 16.6218 15.2334 16.7402V13.8799C14.2264 13.6247 13.4906 13.2395 13.0234 12.7246C12.554 12.2073 12.3164 11.5801 12.3164 10.8418C12.3165 10.0946 12.5834 9.46575 13.1143 8.95996C13.6452 8.45184 14.3516 8.16053 15.2334 8.08301V7C15.6731 7 15.9197 7 16.3594 7V8.08301ZM16.3574 16.8535H16.3594C16.7467 16.7783 17.0661 16.6149 17.3076 16.3643C17.5537 16.1113 17.6738 15.8147 17.6738 15.4707C17.6738 15.1677 17.5715 14.9033 17.3643 14.6846C17.1615 14.4636 16.8267 14.2943 16.3574 14.1758V16.8535ZM15.2334 9.56836C14.9304 9.66408 14.6911 9.82132 14.5156 10.04C14.3379 10.2588 14.252 10.5004 14.252 10.7646C14.252 11.0062 14.3314 11.2301 14.4932 11.4375C14.655 11.6424 14.9038 11.8113 15.2363 11.9365V9.56836H15.2334Z"
fill="black"
/>
<path
d="M2.71127 18.5075L4.18352 17.6575C3.21672 14.9028 3.27173 11.9581 4.21167 9.31563C5.17535 6.60942 7.06671 4.22018 9.74281 2.67513C12.0972 1.31581 14.709 0.807832 17.2232 1.05612C19.8041 1.3106 22.2798 2.36266 24.2693 4.10853L23.7361 4.71636L23.2029 5.32418C23.1532 5.27918 23.1016 5.23531 23.0511 5.19342C21.3484 3.75295 19.2504 2.88549 17.0678 2.66937C14.8802 2.45355 12.6065 2.89529 10.5561 4.07914C8.2194 5.42821 6.56974 7.50687 5.7328 9.85834C4.94555 12.068 4.87307 14.5175 5.61235 16.8326L6.69304 16.2087L6.98491 16.4014L6.40585 19.8979L2.71127 18.5075Z"
fill="black"
/>
<path
d="M23.0996 15.7998L31.0811 30.7578L30.9785 30.9316H15.0215L14.918 30.7578L22.9258 15.7998H23.0996Z"
fill="#FFC000"
stroke="black"
strokeWidth="1.6"
/>
<rect x="22.25" y="21" width="1.5" height="5" rx="0.75" fill="black" />
<path
d="M24 28C24 27.4477 23.5523 27 23 27C22.4479 27.0002 22 27.4478 22 28C22 28.5522 22.4479 28.9998 23 29C23.5523 29 24 28.5523 24 28Z"
fill="black"
/>
</svg>
`});var ve=class{constructor(e,t,n,r){this.productName=e,this.severity=`WARN`,this.code=`TKL201`,this.notificationIcon=he,this.message=`No Telerik and Kendo UI License found.
To download a license key file, visit https://prgress.co/3PwQMKZ`,this.notificationMessage=`License key missing for ${e} v${n}. A license key is required for both paid and trial usage. Learn <a href="${r}">how to set up a license key</a>.`,this.notificationTitle=`License key missing for ${e} v${n}.`,this.notificationBody=`A license key is required for both paid and trial usage.`,this.callToAction={link:`https://www.telerik.com/download?utm_source=no_license_watermark&utm_campaign=${t.toLowerCase()}&utm_content=no_license_key_found`,message:`Start Free Trial`}}},ye=class{constructor(e,t,n,r){this.productName=e,this.severity=`WARN`,this.code=`TKL202`,this.notificationIcon=he,this.message=`${e} is not listed in your current license file.\n Learn more about ${e} licensing at ${r}`,this.notificationMessage=`No license found for ${e} v${n}. Access to the latest updates and support requires a <a href="${r}">valid license</a>.`,this.notificationTitle=`No license found for ${e} v${n}`,this.notificationBody=`To use this product and access updates and support you need to buy and install a valid license.`,this.callToAction={link:`https://www.telerik.com/purchase.aspx?utm_source=no_license_watermark&utm_campaign=${t.toLowerCase()}&utm_content=no_license_key_current_product`,message:`Buy Now`}}},be=class{constructor(e,t,n,r){this.productName=e,this.severity=`WARN`,this.code=`TKL203`,this.notificationIcon=ge,this.message=`Your trial has expired ${r} day(s) ago.\n Thank you for trying out ${e}, we hope you enjoyed your trial period.\n To continue using our product, consider upgrading to a commercial license: https://prgress.co/3C9mr1M`,this.notificationMessage=`Your trial license for ${e} v${n} has expired ${r} ago. To continue using our product, consider upgrading to a commercial license. Learn more about <a href="https://prgress.co/3PwQMdX">${e} licensing</a>.`,this.notificationTitle=`Your trial license for ${e} has expired.`,this.notificationBody=`To continue using the product you need to buy a subscription.`,this.callToAction={link:`https://www.telerik.com/purchase.aspx?utm_source=no_license_watermark&utm_campaign=${t.toLowerCase()}&utm_content=trial_expired`,message:`Buy Now`}}},xe=class{constructor(e,t,n,r,i,a){this.productName=e,this.severity=`WARN`,this.code=`TKL204`,this.notificationIcon=he;let o=r?` version ${r}`:``;this.message=`Your current license has expired on ${n.toLocaleDateString()} and is not valid for ${e}${o}. The product was published on ${i.toLocaleDateString()}.\n Renew your license at https://prgress.co/3Px9m5F`,this.notificationMessage=`Your license is not valid for ${e} v${r}. To continue using the product, install a <a href="${a}">valid license</a>. Renew <a href="https://prgress.co/3PwQNi1">your license</a> and download a new license key.`,this.notificationTitle=`Your license doesn't cover ${e} v${r}`,this.notificationBody=`To access the latest version and updates you need to renew your license.`,this.callToAction={link:`https://www.telerik.com/account/your-licenses?utm_source=no_license_watermark&utm_campaign=${t.toLowerCase()}&utm_content=perpertual_newer_version`,message:`Renew Now`}}},Se=class{constructor(e,t,n){this.productName=e,this.severity=`WARN`,this.code=`TKL204`,this.notificationIcon=_e,this.message=`Your ${e} subscription has expired on ${n.toLocaleDateString()}. To continue using the product, please renew your subscription at https://prgress.co/3Px9m5F and download a new license key.`,this.notificationMessage=`Your ${e} subscription has expired. To continue using the product, please <a href="https://prgress.co/3PwQMut">renew your subscription</a> and download a new license key.`,this.notificationTitle=`Your ${e} subscription has expired.`,this.notificationBody=`To continue using the product you need to renew your subscription.`,this.callToAction={link:`https://www.telerik.com/account/your-licenses?utm_source=no_license_watermark&utm_campaign=${t.toLowerCase()}&utm_content=subscription_expired`,message:`Renew Now`}}},Ce=class{constructor(e,t,n,r){this.productName=e,this.severity=`INFO`,this.notificationIcon=ge,this.message=`Your Trial license will expire in ${-r} day(s).\n To acquire a commercial license, visit https://prgress.co/3PyHIoH`,this.notificationTitle=`Active trial for ${e} v${n}`,this.notificationBody=`Your trial will expire in ${-r} day(s).`,this.callToAction={link:`https://www.telerik.com/purchase.aspx?utm_source=no_license_watermark&utm_campaign=${t.toLowerCase()}&utm_content=active_trial`,message:`Buy now`}}};async function we(e,t){if(typeof crypto!=`object`||typeof crypto.subtle!=`object`||typeof TextEncoder!=`function`||typeof TextDecoder!=`function`)return;let n=crypto.subtle,[r,i,a]=e.split(`.`),o=fe(a),s=new TextEncoder,c=new TextDecoder,l=s.encode(`${r}.${i}`),u=c.decode(fe(r));if(JSON.parse(u).typ!==`Telerik License Evidence`)throw Error(`Unknown license evidence type`);let d=await function(e){let t=de(e.replace(`-----BEGIN PUBLIC KEY-----`,``).replace(`-----END PUBLIC KEY-----`,``).replace(/\n/gm,``));return crypto.subtle.importKey(`spki`,t,{name:`RSASSA-PKCS1-v1_5`,hash:`SHA-256`},!0,[`verify`])}(t);if(!await n.verify(d.algorithm,d,o,l))throw Error(`Invalid license evidence`)}let Te={data:` {} `},Ee=new Map,De=new Set,Oe=!0;function ke(e){let t=JSON.parse(Te.data),n=!t.scriptKey&&!t.timestamp,r=t.scriptKey&&typeof KendoLicensing>`u`,i=me(e),a,o,s=!1;if(n||r||!(e=>(e.licenses?.length>0&&Promise.all(e.licenses?.map(e=>we(e,`-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2mnUVMmkth2x+N/ODszG
OFIYBL6NOO1XWRj1wkmecKuLziJDhFz0WQmyOjY34Ymg9pLuBA9QSWrrZuvPw40N
m0X/GBmttFmPNvca3WmJ2oKM7PpLiUU9f7Ov5WeIXnx++ts/LC/OB7FtZ+LiRgJ7
0mZnPeTogdFrASf0zSQJv4jmX840LPa6nomWeUgIVGPLLVI14Gib8Dl+nOckqCNc
kAUUk4IBF67DufRt9zQyRxg99ysakvHX2SDbdGvIBdxWxvhhmrBoeix0uSVtG2gm
jdvSqlPJVdvMbk1Xe2+SUldJPrxH1VrTYeRUt4yqWxy16nFJUDj9exZ202X4THkU
JQIDAQAB
-----END PUBLIC KEY-----`))).then(()=>{Oe=!0}).catch(()=>{Oe=!1,Ee.clear()}),Oe))(t))a=new ve(e.productName,i,e.version,e.licensingDocsUrl);else if(o=pe(t,e),o){if(o.type===`trial`){let t=function(e){let t=ue()-ce(e);return Math.floor(t/86400)}(P(o.expiration));F(ue(),o.expiration)?a=new be(e.productName,i,e.version,t):(a=new Ce(e.productName,i,e.version,t),s=!0)}else if(o.type===`perpetual`){let t=o.expiration;F(e.publishDate,t)?a=new xe(e.productName,i,P(o.expiration),e.version,P(e.publishDate),e.licensingDocsUrl):s=!0}else if(o.type===`subscription`){let n=o.expiration;o.type===`subscription`&&(n=le(n,10)),t.timestamp&&F(t.timestamp,n)?a=new Se(e.productName,i,P(o.expiration)):s=!0}}else a=new ye(e.productName,i,e.version,e.licensingDocsUrl);let c=o,l=c?.expiration?P(c.expiration):void 0;return{isLicenseValid:s,licenseType:o?.type,licenseProductCode:c?.code,expiration:l,message:a}}function Ae(e){if(Ee.has(e.name))return Ee.get(e.name);let{isLicenseValid:t,message:n}=ke(e),r=me(e);return n&&!De.has(r)&&(function(e,t){if(typeof console==`object`){let r=`[${e.severity}][Telerik and Kendo UI Licensing]`+(n?` ${n}:`:``)+` ${t.productName}`,i=typeof console.group==`function`;i?console.group(r):console.warn(r),console.warn(e.message),i&&console.groupEnd()}var n}(n,e),De.add(r)),Ee.set(e.name,t),t}let je=null;try{je=Object.freeze(JSON.parse(`{"productName":"Kendo UI","productCode":"KENDOUICOMPLETE","redistributedBy":["KENDOUI","UIASPCORE","KENDOMVC","KENDOUIMVC"],"licensingDocsUrl":"https://www.telerik.com/kendo-jquery-ui/documentation/intro/installation/licensing/activation-errors-and-warnings","name":"@progress/kendo-ui","version":"2026.3.812","publishDate":1786524915,"productCodes":["KENDOUICOMPLETE","KENDOUI","UIASPCORE","KENDOMVC","KENDOUIMVC"]}`))}catch{je=Object.freeze({name:`@progress/kendo-ui`,productName:`Kendo UI for jQuery`,productCode:`KENDOUICOMPLETE`,productCodes:[`KENDOUICOMPLETE`,`KENDOUI`,`UIASPCORE`,`KENDOMVC`,`KENDOUIMVC`],redistributedBy:[`KENDOUI`,`UIASPCORE`,`KENDOMVC`,`KENDOUIMVC`],publishDate:0,version:`0.0.0`,licensingDocsUrl:`https://www.telerik.com/kendo-jquery-ui/documentation/intro/installation/licensing/activation-errors-and-warnings`})}let Me=[/telerik\.com/,/progress\.com/,/stackblitz\.io/,/csb\.app/,/telerik\.io/],Ne=`system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans", sans-serif`;function I(e,t){Object.keys(t).forEach(n=>e.style.setProperty(n,t[n]))}function Pe(e){return e.replace(/\bfillRule\b/g,`fill-rule`).replace(/\bclipRule\b/g,`clip-rule`).replace(/\bstrokeWidth\b/g,`stroke-width`).replace(/\bstrokeDasharray\b/g,`stroke-dasharray`).replace(/\bstrokeLinecap\b/g,`stroke-linecap`).replace(/\bstrokeLinejoin\b/g,`stroke-linejoin`)}function Fe(e){let t=document.createElement(`div`);I(t,{position:`absolute`,width:`100%`,height:`100%`,"pointer-events":`none`,top:`0`,left:`0`,right:`0`,bottom:`0`});let n=t.attachShadow({mode:`closed`}),r=document.createElement(`div`);I(r,{position:`absolute`,top:`0`,left:`0`,right:`0`,bottom:`0`,"pointer-events":`none`,"z-index":`101`,opacity:`0.12`,width:`100%`,height:`100%`,"background-image":`url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABVxSURBVHgB7Z3tVRtJE4WL9zgANgLLGRCCnAGOADmCxRGgDFAGYiOADKQMIAGO9J8ji42g37mjqlUjBgOanpn+uM85sjC2sKzbVd1dVV0tQgghhBBCCCGEEEIIKRPn3Gn1GAlJmmN1pP558J6OX9540ejh4WGlX09OTk7+EZIclXYXlY43+vVflY7PH3wd9c+AY/Wvvcb9/b0bjUYOz/hBQpICmh1oOPrEa6l/4rTR337AhIMgTSqtzg+0m8gnof7p0mD8EzmGhkFwJiR6np6e7luLL9Q/RTDTBzF+7wfWg2CxWOCHjYVET6XTdLPZrFuLL9Q/NeCkoVUQ4/d+6Ijev1yof1rAUVMvQgjJHebrSRu+CEmWo/O8hISgCjStKpgiGoDWed4AUP/hwGf++Pi4hQYyFHgDzBP3T7A8b0uo/zD4+sMBy1CwWKR/YjF+fS/Uv2di0t/eEAdBT0QnvlD/PolR/xoOgu4JUd7bFdS/e6I1foODoFuqz3M2mUziFF+of5dEb/xGwyAYCwmCVuPNYv5MqX94Yl75NWKD4PLyEm92KqQoqH9Y8Bnis0zC+A14LbxxVqiVCfUPh678plxNFYQe5pjRgAgpDAv4IOAHJyCEkDJoiPaeCyG5UA1oRIYWHNivSSbV0wLq/zbQXz+bS8kV/AeZJ35NCcYPqH8zvv4VS8kVFou8phTjB9T/NcVt+zgI9rjQDRwTgPrvKcn5v4CDYIfT/vtFiS/UHxRr/AYHwQ4t9DiVwihZ/+KN36ATKJsS9U+utr9r/EGQdQSUNFKa/geZkImQ/2rHlznnQDG7oX9b9Xwl5AUl6G9oLcSSxl8Q/p4P13YJIaQMisvzEkJ2lJjnJyQY3lnoJGfNUvP8oUhZf7c70s2eCG1wL7uhRJ0iQnCveiDIhzf7t/f9IvP8IUhJfx/b9rErUkvgRVPIE1fv6xrvbzweu7OzM3d7e4v3OhfSilT092HMJzCxF4u43eWctfFvt1uHu9nxXvF1CWmtroldfx9W+HVErINAjX+M65ngAPxnOAJ1AiMhrUjBCdD4Oya2QYBlPwx8vV47WwFg+a+XZbrz83NzANz/ByBmJ0Dj74lYBgECfrbnt6U/DB/vC7388L2rqyu8vzshwYjRCdD4e8YfBLidVgYA0X7M9jB8PGazmbu5ualnfiz9dSAsufwPTwz6+5jjp/H3CD5ofPB9343u9v3u6+U+0jyY7eEA8Hx3d4c/QjvvMyGdMZT+TeA9wBHR+DPHUn3T6bRe7uMxn89tn18v/TH7O17gQEheYM9vEX7M9hbsg/FbHED3/IPPSISQgNhyE0au+7x7PPtOQFcB3PMTMjTYf4cyRN3zL2DgMHgs/7XU99acgDIWEgUh9W/4uWMh8QKBvCh8qxSR7fmxt0eEv8kJ6MzP8/2REFL/g59bp/o0xsMAb6xAnBB5Yr+6D3X9KOpBxP/ACWA0jFnoEw+h9D/4mYd5/pGQeAlRLFK95tJy+35578PDQ+0E9LAPi3wixAUsFmKRT6I0DIIPzdJuf6R3i+UeZnsz/nqjPx47/fMpZ/54OVb/g5/BZi4pY4Pgo8s2d3CkF0Z/cXFRL/+Xy2W9BdBUH4/5JsBn9W94PZu5pI77QzMOjepiNp/j71hO//fv31sr7qmtfT73i3xWjnvAZHhH/4nquXrLwB2bueSJ27Vmvodhq4df4BmzvQb3IPxWl/zgRl/DwZA4GrhdYFUHfbHE1y0enXsJ2FLfCnggvjqBejDoTI8o38ocgJAscNq8BY4fv/Uf+J46gjkdQcbA+19fXzs7zQfR8TWcgH+kFw/u+fMDKz/o3OQETk9PLcWLPSBbeeWELd91eb+CcTc5gXr6r9J8PNKbF/7S3z+6DYcvDasBOv6M0GUduNDfv+cEYPhjIVmA+I3Vc4gaOQzfHAECvb4joAPICCzlrIJP93h/dAIYDBQ/L8wBNC37rXUblv5CB5AfGvi5h6F7Ed9GJ2CZP0b780O1vreVnnhOAFsBOoCMscg/HMBbTsCO+grJFkvvHmYCSnYA/5MMcbsiH6TykNgfr9fry58/f0oltFxcXMj379+l+h42gBcnJyfr6iXfq1nhJ56FZIeuAq+fn59Xv379Oq0CgVJNBEIydAAavLv98ePHeSX4bfX1OQSv9noQ/a7y9A8HTuAcTqB63FSPZyE5Mq3GwOW3b99kNpu9+5e/fv2Kp3+FpAW8vB3cwbLOOvZYfl9LfGdW9KOn+mZCskZXhCuL9vtLfjvshd97hWArpn8TxGn5rhZzOL/gB19DYBzzxcEeTQEtGfArB7c7xbmyVu4YExoTuNcYEL6eCkkTxHYOmna4wzQfvq8z/+o949e940hIkjTp5/ZXjm/1+VQfr856UP/EcLtqr9s/OQENDl5+wPhH3nHQZK6mJjucNvNo2w+A+icC0jaY4a2LT5MT+Mye3+l58JSupiY7XIA2XtQ/IZw2f7D9v+X6D53AZ/f8LqGrqckOF7CNF/VPAF3Or6xvv53r951Amx5+DYOAXWEjxXXQxov6R4zTSzusht8OfABE+r3U39y1iPbbIODVX3ED4/Tagk8kENQ/QiyaC1Fg7PX6frm0Mk6/wUOQ8l799+j9I0cDwcF1ov4R4Xbde2vjxi92ogsPzPrY92szD7buJiQn3K6+v17q2yxvlV1u3+TRAn4jIYTkAfbymOWx1AcwfHMEXp5/JISQ9PEDd867ohvGbvt+cwRe6+5ee7ltNpuVf7yYdA8+68fHxy0+exkY6t8RGnSxJX19yAd7fWvhjEs7NOCHb2D9/+AGqO3HQGSeuD/8PD/GggwM9e8IBPCwr7ciHnzA6NrqtW5+4QRkIByLRXrDRXhXH/XvCKRccEuPX8mHD9jr7Vc7AV32D9rJh4Oge2I0foP6d8QHnADO9kdxYw8HQXfEbPwG9e+It5yAlvdG1beNgyA8KRi/Qf07oskJIEYQw8x/SMMgGAs5CmR0UjF+g/oHwh00YzAn0OZgT1/YINBU5VTIUeCzw2eYivEb1L8l7o1mDm7X220a48x/iNtVLE4dC5OOxu2794wlMaj/kbgAzRwIIQmS4p6PEBKIp6enexo/IYWCPdNms1nnbPxat7BwvH/+P7Dt08/kUjKH+hcOxGeeeI8f86lYSuZQ/8JhsciehoBv9rMi9VdcwZcucBCkVeEXmuL1dy0vbciBkgdBycZvFKs/8/x7ShwENP49xelP8V9T0iBgncdritGfxv82/iDIORJ+EAGfCKnJXn8a//to7fgy51y45sCX1P812erPZR8hBVMZ/Ax9+2j8hBSIHumcpXikkxBCBsXtz8QnUyXndvfz8Sx8AFLUnwTEveyKE32KyAK+7IYThqT0V88/o+cPBz7TVPLEJdb2d00y+pv4elHHTEgwUigWYaq3O6LXn56/e2IeBDT+7olWf4rfHzEOAurfH9HpT/H7J6ZBQP37Jxr9Kf5w+IMAt9PKQOB6NurfP4Prjyg/jX9Y8JnDAHE/vQwE/m0MQOrfP4PqX/3jp15Dj4kQQspCK5SK7OZDCCGEEBIfbneH4kgCoT9vLCQJguqPaD8CDdXzlZDogaEuFotgKSLL9uBnYmAJiZqg+vupPlzbJSR6YKSh8sSODVyTI5j+LO9NlxDFIqzzSJfW+jPPnz4Ng+DDGRvqnz5t9GeePxNsEHx2+U798+BY/e3FzPNnwLE6Uv88oI6EEEIIIYQQQgghhBBCCCGEEEIIIYQQQkiRoHyQxz/T51gdqX8evKfjlzdeNHp4eFjp15OTk5N/hCQHjoFWOt7o139VOj5/8HXUPwOO1f+/02ApXEhJmmnTzIP6p49r28wlRFMJMgwhmnlQ/3RB854g/RwaBgF7wkVOyGYe1D9N0L4vWDMXGwTaFHIsJGpgpF5TyIm0hPqnR6XTdLPZrF2oZi7aVIDePxFgqCH1ov6EEEIIITHRtl7jixBCkuToPH8ocGMQrihmiqh/8Jnjau6hrwen/sPQOs8fAgxA5on7xxcfBigDQf2HIUSdR6g3wmKRnolGfKH+QxCT/vaGOAh6Ijrxhfr3SYz613AQdE+04gv174Ng5b1dwUHQHTEbv0H9u6X6PGeTySTu69oaBsFYSCui9/we1L87tBpzFv1naoPg8vISA2AqpBX4DPFZxm78BvUn9awF8R07yrRGPf80pdmU+hNCyJHoYa4ZHSghhWEBXwT84ASEEFIGDdmec8mJ6j+EyNAiu/9YACC+fjaXkinU/21SSPW2BuIzT/waX/yKpWQK9W+mCOMHLBZ5TfbLPg/q/5pijN/gINhTnPhC/X1cwAauScFBUKbxG9R/h9P7F0rTv6bkQVCy8Rt0Aju00OtUSqTEQZBSbX/X0AmQF4Mg5wi4cRAJn0jhlKY/aUBrx5c558ANzYUvafx7StAfqxv0UKyer4QQUg5+zAfXdgkhpAxKqvMghHgUm+cPhdufhU/Oa+qRTp6Jb0HK+oOi8/whcC+74SSTIrJlH7vitCMl/RHcqx4I8uHN/u19v9w8f1swi6aWJ+aeLxyp6F+9r2u8v/F47M7Oztzt7S3e61xIe1IqFmGFX3hi19/tLuesjX+73brFYlG/V3xdQlq7F1JwAjT+7ohVfzX+Ma5ngwPwn+EI1AmMhLQnZidA4++e2PTHsh8Gvl6vna0AsPzXy1Ld+fm5OQDu/0MRoxOg8fdHLPoj4Gd7flv6w/DxvtDLD9+7urrC+7sTEhZ/EOB2WhkYE57G3w8x6I9oP2Z7GD4es9nM3dzc1DM/lv46FpZc/ncEBgEMD7XVMjB4DxiINP7+GEp/t7/voF7uI0WJ2R4OAM93d3f4I7TzPhNCSD5Yqm86ndbLfTzm87nt8+ulP2Z/x+vQCMkL7Pktwo/Z3oJ9MH6LA+ief/AVKSEkILbdgJHr3v4ez74T0FUA9/wxgP1XF0Lozx0LiZqQ+uuefwEDh8Fj+a+lvrfmBJSxkOGBEF4UNliKyFJ9usdjgCdSQupve37s7RHhb3ICOvPzfH8swDhD54kb8vwjIVESSn+/ug91/SjqQcT/wAlgNhiz0CcyQhaLsMgnPULoX73m0nL7fnnvw8ND7QT0sA+LfGKlYRB82ks7NnNIlmP1d/sjvVtsJTDbm/HXG/3x2OmfTznzR44NgmOX7Y7NHJLms/q7gyO9MPqLi4t6+b9cLustgKb6eMw3FdwfmjFggKg3X71l4I7NHJLmHf3PVPs5/o7l9H///r214p7a2udzv8hn5RgDShsN3Czg1SE4lom6xKO4heB2rdnvYdi6QljgGbO9BvfgOLa65Ac3+hpOBinjtHkDhMdv/Qe+p45gTkeQL7bUtwIeaK5OoJ4MdKZHlG9lDkBIPsDzQ/QmJ3B6emopHqwB2corQzDDX19fOzvNh7GAr+EE/CO9eHDPnxH+0t8/ugnBpWE1QOHzwpbvurxfwbibnEA9/VdpPh7pzQjs3yyfK2rkMHxzBAj0+I6ADiAvdFsHLvT37zkBGP5YSB6YA2ha9lvrJiz9hQ4gO7CVswo+jfH80QlgMqD2GaKC35unF88JYCtAB5AnGvi9h6F7GZ9GJ2CZP0b7M8XSO4eZADqAvLHIPxzAW07AjvpKYfxPCkBngevn5+fVr1+/TqtAoFQDQUieuF2RD1J5SOyP1+v15c+fP6Vy9HJxcSHfv3+X6nsIAF2cnJysq5d8r1YAP/EshVGEA6iYVkZ/+e3bN5nNZu/+5a9fv+LpXyHJocG72x8/fpxXDv+2+vocDr+K9cDp31UrvYcDJ3AOJ1A9bqrHs5D80BlhZdF+f8lvhz3we68QZMX0T3pglWcHd6Cjdeyx/L6W+M6s6EdP9c2ElIHbneJaWStnFIRoTOBe94D4eiokSZyW72oxl/MLfvA1jB6642CPpoCXDPhljO79RwffG6kj2OrzqT5e1Xo3vZ7EC2K7B0073GGaD9/XmX/1nvFT/4Rx2syjbT+AIW+gIZ/D7ao9b//kBDQ4ePkB46f+qeICtPFy2g8gpavJSwZpW8zw1sWnyQl8Zs9P/RPFBWzj5RK6mrxkTCfb/1uu/9AJfHbPT/0Tw3XQxqthELArcETocn5lffvtXL/vBNr08KP+CQFxvLbQEwmEDQJe/RQXTi/tsBp+O/AFEOn3Un9z1yLaT/0TQgNBwb20Zg/o/SPBsjkwShh7vb5fLq2M22/wEqS8V/+9sRBChsXtuvfWxo1f7EQnHpj1se/XZh5s3U1ITrhdfX+91LdZ3io73b7JqwX8RkIIyQPs5THLY6kPYPjmCLw8/0hI3iAd8/j4uN1sNisZGLwH/3gpCYcfuHPeFd0wdtv3myPwWnf32suR+veMn+fHBy8DA0fEPHF4NOhmS/r6kA/2+tbCHZd2aMAP38D6/8ENUNtP/XvERXhXn2OxSCcggId9vRXx4LNF12avdfsLJyADQf17IkbjNzgIwoOUK27p8Sv58Nl6vf1qJ6DL/kE7+VD/jonZ+A0OgvB8wAngbH8UN/ZQ/45IwfgNDoLwvOUEtLw3qr6N1D8wiOimYvxGwyAYC2lFkxNAjCCGmf8Q6h8QRHeR7knF+A0bBJqqmgr5NO6gGYc5gTYHe/qC+gfC7bv3jCUx3K5ibepYmPJp3BvNXNyut+M0xpn/EOpPyBG4AM1cCCEJkmLMhxASiKenp3saf4Fg2Vc9FsjpSuZo3hr/115r1lMAe+bNZrPO2fip/wH+nq9iKZkD8ZknLhfq79EQ8MneK7JYpGyov5JShV9oOAjKvnSjeP1LNn6j5EHgWl7akgPF6k/j31PiIGCef09x+jPP+5qSBgGd/2uKcgIHEdCJkBp/EOSaCaHxv00J+tdoDnRJ8V+jtePLHGshaPzvk7P+pGC47SOkYCqDn6FvH42fkAJxuyPdaN01FlIGbnc/37TkFE8o3L4nAmvHCyQ5/S3gw24oYXAvuyKxbLgwktK/xNr+rsFqKpU8sa78Zlz5hSMZ/Znq6Y4UikVMf72oYyYkGNHrT+PvnpgHAVd+3ROt/jT+/ohxEFD//ohOf4rfPzENAurfP1E5AVzPRPH7xx8EuJ1WBoDGPxyH+ruhjlTjbnR9AxMhvYLPHA4YGkjPIMpP4x+WIfUnhYMZx2voMRFCSFlohVqR3XwIIaQc3O5OtrGQJFC9RkKKRCsyRxICi/YuFgvs986ERA3Eh1ahUkT4GQg0Vc9XQqInqP6ODRyTA046VJ7Y1x/XdgmJnmD6M8+bLiGKRVjemy6t9WeeN30aBsGHI/bUP33a6M88bybYIPjs9o3658Gx+tuLmefNgGN1pP55QB0JIYQQQgghhBBCCJGy+T9ftRg+rVNPfAAAAABJRU5ErkJggg==')`}),n.appendChild(r),e.appendChild(t),new MutationObserver(function(n){let r=n[0];r.removedNodes&&Array.from(r.removedNodes).indexOf(t)>-1&&setTimeout(()=>{e.appendChild(t)},100),r.type===`attributes`&&r.target===t&&setTimeout(()=>{t.removeAttribute(r.attributeName)},100)}).observe(e,{childList:!0,attributes:!0,subtree:!0})}function Ie(e){let t=document.createElement(`div`);t.setAttribute(`id`,`k-license-banner`);let n=Pe(e.notificationIcon.content||``),r=e.notificationBody||``,i=e.notificationTitle||``;i&&r.startsWith(i)&&(r=r.slice(i.length).trim());let a=e.callToAction?`<a id="k-license-cta" href="${e.callToAction.link}" target="_blank" rel="noopener noreferrer">${e.callToAction.message}</a>`:``;t.innerHTML=`
<span id="k-license-icon">${n}</span>
<div id="k-license-content">
<div id="k-license-title">${i}</div>
<div id="k-license-body">${r}</div>
</div>
<div id="k-license-actions">
${a}
<button id="k-license-close" title="Close">
<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.9309 3.1838C12.1754 2.93933 12.5712 2.93937 12.8157 3.1838C13.0601 3.4283 13.0601 3.82407 12.8157 4.06857L8.885 7.99923L12.8166 11.9309C13.0611 12.1754 13.0611 12.5721 12.8166 12.8166C12.5721 13.0611 12.1754 13.0611 11.9309 12.8166L7.99925 8.88497L4.06859 12.8166C3.8241 13.0611 3.42732 13.0611 3.18285 12.8166C2.93862 12.5721 2.93851 12.1753 3.18285 11.9309L7.11449 7.99923L3.18382 4.06857C2.93947 3.82413 2.93955 3.42829 3.18382 3.1838C3.42831 2.9393 3.82508 2.9393 4.06957 3.1838L7.99925 7.11349L11.9309 3.1838Z" fill="#212529"/>
</svg>
</button>
</div>
`,I(t,{display:`flex`,position:`fixed`,left:`50%`,transform:`translateX(-50%)`,width:`100%`,"border-left":`6px solid rgba(255, 192, 0, 1)`,"border-top":`1px solid #00000029`,"border-right":`1px solid #00000029`,"border-bottom":`1px solid #00000029`,"background-color":`#ffffff`,"box-shadow":`0px 4px 5px 0px #0000000A, 0px 2px 4px 0px #00000008`,"font-size":`14px`,"font-weight":`400`,"line-height":`20px`,color:`#1E1E1E`,"justify-content":`center`,"z-index":`2000`,"box-sizing":`border-box`});let o=t.querySelector(`#k-license-icon`);I(o,{display:`flex`,"flex-shrink":`0`});let s=t.querySelector(`#k-license-content`);I(s,{display:`flex`,"flex-direction":`column`,gap:`4px`}),I(t.querySelector(`#k-license-title`),{"font-family":Ne,"font-weight":`700`,"font-size":`14px`,"line-height":`142%`,"font-style":`Bold`,"letter-spacing":`0px`,"vertical-align":`middle`,"text-align":`left`}),I(t.querySelector(`#k-license-body`),{"font-family":Ne,"font-weight":`400`,"font-size":`14px`,"line-height":`20px`,"letter-spacing":`0px`,"vertical-align":`middle`,"text-align":`left`});let c=t.querySelector(`#k-license-cta`);c&&(I(c,{display:`inline-flex`,border:`none`,"border-radius":`4px`,"background-color":`#eb0249`,color:`#ffffff`,padding:`4px 8px`,"white-space":`nowrap`,"text-decoration":`none`,"font-family":Ne,cursor:`pointer`,position:`relative`,transition:`background-color 0.2s ease-in-out`,outline:`none`}),c.addEventListener(`mouseenter`,function(){c.style.setProperty(`background-color`,`#b90138`)}),c.addEventListener(`mouseleave`,function(){c.style.setProperty(`background-color`,`#eb0249`)}));let l=t.querySelector(`#k-license-actions`);I(l,{display:`flex`,"align-items":`center`,gap:`16px`});let u=t.querySelector(`#k-license-close`);I(u,{display:`inline-flex`,border:`none`,"border-radius":`4px`,padding:`4px`,"background-color":`transparent`,cursor:`pointer`,outline:`none`,transition:`background-color 0.2s ease-in-out`}),u.addEventListener(`mouseenter`,function(){u.style.setProperty(`background-color`,`#3d3d3d14`)}),u.addEventListener(`mouseleave`,function(){u.style.setProperty(`background-color`,`transparent`)});let d=window.matchMedia(`(max-width: 499px)`),f=window.matchMedia(`(max-width: 767px)`),p=function(){let e=d.matches,n=f.matches,r=!n;I(t,{top:e||n?`0`:`16px`,"max-width":r?`768px`:`none`,"border-radius":r?`6px`:`0`,"flex-direction":e?`column`:`row`,"align-items":e?`flex-start`:`center`,padding:e?`12px`:`0`}),I(o,{"align-self":e?`flex-start`:`center`,padding:e?`0 0 12px 0`:`9px 12px`}),I(s,{flex:e?`none`:`1`,padding:e?`0 0 12px 0`:`12px`}),I(l,{padding:e?`0`:`9px 12px`,"margin-left":e?`0`:`auto`,width:e?`100%`:`auto`}),e?I(u,{position:`absolute`,top:`12px`,right:`12px`}):(I(u,{position:`relative`}),u.style.removeProperty(`top`),u.style.removeProperty(`right`))};return p(),d.addEventListener(`change`,p),f.addEventListener(`change`,p),u.addEventListener(`click`,function(){d.removeEventListener(`change`,p),f.removeEventListener(`change`,p),t.hidden=!0}),t}function Le(e){document.querySelector(`#k-license-banner`)||document.body.appendChild(Ie(e))}function Re(){return Me.some(e=>e.test(window.location.hostname))}let ze=je;function Be(e){if(Re())return;let t=window._wrappersMetadata,{message:n}=ke(t||ze),r=Ae(t||ze);!n&&r||(n.severity!==`INFO`&&Fe(e),Le(n))}let Ve=[`themeColor`,`fillMode`,`shape`,`size`,`rounded`,`positionMode`],He=`aria-labelledby`,Ue=`aria-label`;var L=class e extends O{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(),this._features=[],this._iconContextToken=0,e!==void 0&&this.init(e,t)}init(e,t){let n=this;n._showWatermarkOverlay=Be;let r=(this.options?.name||``).toLowerCase(),i=S.getConstructor();n.element=i(e).handler(n),r&&(n._iconContextToken=se.beginInit(r,n.element[0])),O.fn.init.call(n);let a=t?t.dataSource:null,o;t&&(o=(n.componentTypes||{})[t.componentType]),a&&(t=i.extend({},t,{dataSource:{}}));let s=t?.features,c=n.options?.features,l=s??c??[];t&&delete t.features,t=n.options=i.extend(!0,{},n.options,n.defaults,o||{},t),a&&(t.dataSource=a),t.features=l,n._features=l,n._validateFeatures(l);for(let e=0;e<l.length;e++)l[e].setup(n);let u=M.attr(`role`);n.element.attr(u)||n.element.attr(u,(t.name||``).toLowerCase()),n.element.data(`kendo`+t.prefix+t.name,n),n.bind(n.events,t)}endInit(){if(this._iconContextToken){let e=this._iconContextToken;this._iconContextToken=0,se.finalizeContext(e)}}_renderWithIconContext(e){let t=(this.options?.name||``).toLowerCase();if(!t)return e();let n=se.beginInit(t,this.element?.[0]),r=e();return se.finalizeContext(n),r}_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),S.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 M.dimensions(this.element)}size(e){if(e)this.setSize(e);else return this.getSize()}setSize(e){}_resize(e,t){}_validateFeatures(e){let t=this.constructor.featureMap;if(!t)return;let n=this.constructor,r=n.options||n.prototype?.options;if(!r)return;let i={};for(let t=0;t<e.length;t++)i[e[t].name]=!0;for(let e in t){if(i[e])continue;let n=t[e];for(let t=0;t<n.length;t++){let i=n[t];if(this.options[i]!==void 0&&this.options[i]!==r[i])throw Error(`Option "${i}" requires the "${e}" feature. Import it and add it to the features array.`)}}}destroy(){let e=this;if(e._features)for(let t=e._features.length-1;t>=0;t--){let n=e._features[t];n.teardown&&n.teardown(e)}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=oe;if(s=this.options._altname||t.name,c=l.propertyDictionary[s],!(!l||!c)){for(a=0;a<Ve.length;a++)o=Ve[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=S.getConstructor()(`label[for="`+r+`"]`),a=n.attr(Ue),o=n.attr(He),s;if(e[0]!==n[0]){if(a)e.attr(Ue,a);else if(o)e.attr(He,o);else if(i.length){let n=x.guid();s=i.attr(`id`)||t._generateLabelId(i,r||n),e.attr(He,s)}}}_clearCssClasses(e,t){let n=this.__proto__.options,r=this.options,i=t||this.wrapper||this.element,a,o,s,c,l=oe;if(s=this.options._altname||n.name,c=l.propertyDictionary[s],!(!l||!c))for(a=0;a<Ve.length;a++)o=Ve[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}};L.fn=L.prototype,L.prototype.options={prefix:``},L.prototype.events=[];var We=class{constructor(e){this.resolvedReferenceMessages=[],this.pinnedMessages=e}getMessageById(e){return e?this._getPinnedMessageById(e)||this._getResolvedReferenceMessageById(e):null}getPinnedMessage(){for(let e=this.pinnedMessages.length-1;e>=0;e--)if(this.pinnedMessages[e].isPinned)return this.pinnedMessages[e];return this.pinnedMessages[this.pinnedMessages.length-1]||null}syncPinnedMessageState(e,t,n){let r=this._getPinnedMessageById(e?.id);r&&r!==e&&n(r,t)}cacheResolvedReferenceMessages(e){(e||[]).forEach(e=>{if(!e?.id)return;let t=this._getResolvedReferenceMessageById(e.id);if(t){let n=this.resolvedReferenceMessages.indexOf(t);this.resolvedReferenceMessages.splice(n,1,e);return}this.resolvedReferenceMessages.push(e)})}_getPinnedMessageById(e){return this._getMessageFromCollectionById(this.pinnedMessages,e)}_getResolvedReferenceMessageById(e){return this._getMessageFromCollectionById(this.resolvedReferenceMessages,e)}_getMessageFromCollectionById(e,t){if(!t)return null;for(let n=0;n<e.length;n++)if(String(e[n].id)===String(t))return e[n];return null}},Ge=class{constructor(){this.startIndex=0,this.initialized=!1}reset(){this.startIndex=0,this.initialized=!1}setStart(e){this.startIndex=Math.max(0,e),this.initialized=!0}sync(e,t){return this.setStart(Math.max(0,e-t)),this.getRange(t)}getRange(e){let t=this.initialized?this.startIndex:0;return{startIndex:t,endIndex:t+e}}},Ke=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||[]},suggestedActions:{parse:e=>e||[]},status:{type:`string`,defaultValue:null},failed:{type:`boolean`,defaultValue:!1},attachments:{parse:e=>e||null},attachmentLayout:{type:`string`,defaultValue:null}}}}}}static{this.FIELD_MAP={text:`textField`,authorId:`authorIdField`,authorName:`authorNameField`,authorImageUrl:`authorImageUrlField`,authorImageAltText:`authorImageAltTextField`,id:`idField`,timestamp:`timestampField`,files:`filesField`,suggestedActions:`suggestedActionsField`,replyToId:`replyToIdField`,isDeleted:`isDeletedField`,isPinned:`isPinnedField`,isTyping:`isTypingField`,status:`statusField`,failed:`failedField`,attachments:`attachmentsField`,attachmentLayout:`attachmentLayoutField`}}constructor(e){this.context=e,this.options=this.buildOptions(e.chatOptions),this.dataSource=this.createDataSource(e.chatOptions),this.auxiliaryReferences=new We(e.chatOptions.pinnedMessages||[]),this.remoteRange=new Ge}_isRemoteDataSource(){return!!this.dataSource?.options?.serverPaging}_setPinnedState(e,t){if(e){if(typeof e.set==`function`){e.set(`isPinned`,t);return}e.isPinned=t}}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.getLoadedMessageById(e)||this.getAuxiliaryMessageById(e):null}getAuxiliaryMessageById(e){return e?this.auxiliaryReferences.getMessageById(e):null}cacheResolvedReferenceMessages(e){this.auxiliaryReferences.cacheResolvedReferenceMessages(e)}getLoadedMessageById(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)||this.auxiliaryReferences.getPinnedMessage()||null}postMessage(e,t){let n=typeof e==`string`?{text:e}:e,r={id:this.options.autoAssignId?x.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.getLoadedMessageById(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&&String(t.id)!==String(e.id)&&(this._setPinnedState(t,!1),this.auxiliaryReferences.syncPinnedMessageState(t,!1,this._setPinnedState.bind(this))),this._setPinnedState(e,!0),this.auxiliaryReferences.syncPinnedMessageState(e,!0,this._setPinnedState.bind(this)),e}clearPinnedMessage(){let e=this.getPinnedMessage();this._setPinnedState(e,!1),this.auxiliaryReferences.syncPinnedMessageState(e,!1,this._setPinnedState.bind(this))}resetRemoteRange(){this.remoteRange.reset()}setRemoteRangeStart(e){this.remoteRange.setStart(e)}syncRemoteRange(e=this.getTotalCount()){return this._isRemoteDataSource()?this.remoteRange.sync(e,this.getLoadedCount()):(this.resetRemoteRange(),this.getLoadedRange())}getLoadedCount(){return this.dataSource.data().length}getLoadedRange(){let e=this.getLoadedCount();return this._isRemoteDataSource()?this.remoteRange.getRange(e):{startIndex:0,endIndex:e}}isRangeLoaded(e,t){let n=this.getLoadedRange();return e>=n.startIndex&&t<=n.endIndex}getMessagesInRange(e,t){let n=this.dataSource.data(),r=this.getLoadedRange(),i=Math.max(e,r.startIndex),a=Math.min(t,r.endIndex),o=[];if(a<=i)return o;let s=i-r.startIndex,c=a-r.startIndex;for(let e=s;e<c;e++)o.push(n[e]);return o}getMessageIndexById(e){if(!e)return-1;let t=this.dataSource.data(),n=this.getLoadedRange();for(let r=0;r<t.length;r++)if(String(t[r].id)===String(e))return n.startIndex+r;return-1}getTotalCount(){return this._isRemoteDataSource()?this.dataSource.total():this.dataSource.data().length}};let qe=`.kendoChat`,Je={STANDARD:`standard`,FULL:`full`},Ye={SENT:`sent`,DELIVERED:`delivered`,SEEN:`seen`,FAILED:`failed`},Xe={HORIZONTAL:`horizontal`,VERTICAL:`vertical`,WRAP:`wrap`},R={SCROLL:`scroll`,WRAP:`wrap`,SCROLLBUTTONS:`scrollbuttons`},z={attachment:`paperclip`,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`,pin:`pin`,undo:`undo`,copy:`copy`,trash:`trash`,send:`paper-plane`,stop:`stop`,upload:`upload`,warningTriangle:`warning-triangle`,x:`x`,arrowDown:`arrow-down`,retry:`arrow-rotate-cw`},B={reply:`reply`,copy:`copy`,pin:`pin`,delete:`delete`,download:`download`},V={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`,messageListContentEmpty:`k-message-list-content-empty`,messageRemoved:`k-message-removed`,messageStatus:`k-message-status`,messageTime:`k-message-time`,messageInfo:`k-message-info`,messageFailed:`k-message-failed`,messageFailedContent:`k-message-failed-content`,messageFailedText:`k-message-failed-text`,messageToolbar:`k-chat-message-toolbar`,messageRetryButton:`k-resend-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`,messageBoxSeparator:`k-separator`,spacer:`k-spacer`,scrollFab:`k-chat-scroll-fab`,fab:`k-fab`},H={fileButton:`ref-chat-file-button`,fileMenuButton:`ref-chat-file-menu-button`,fileWrapper:`ref-chat-file-wrapper`,fileCloseButton:`ref-chat-file-close-button`,attachmentActionButton:`ref-chat-attachment-action-button`,userStatusWrapper:`ref-chat-user-status-wrapper`,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`},U={sendMessage:`sendMessage`,suggestionClick:`suggestionClick`,unpin:`unpin`,input:`input`,toolbarAction:`toolbarAction`,fileMenuAction:`fileMenuAction`,contextMenuAction:`contextMenuAction`,download:`download`,fileSelect:`fileSelect`,fileRemove:`fileRemove`,executeAction:`executeAction`,resendMessage:`resendMessage`,referencedMessageClick:`referencedMessageClick`,suggestedActionClick:`suggestedActionClick`,messageToolbarExecute:`messageToolbarExecute`,fileMenuExecute:`fileMenuExecute`,downloadAllFiles:`downloadAllFiles`,expandableToggle:`expandableToggle`,replyMessageCloseButtonClick:`replyMessageCloseButtonClick`},Ze=`click`,Qe=`focus`,$e=`blur`,et=`change`,W=`${qe}navigation`,tt=`.${V.messageTime}[data-timestamp-visibility='onFocus']`;function nt(e,t){e.closest(`.${V.message}`).find(tt).toggleClass(V.hidden,!t)}let rt=null,it=!1;var at=class{constructor(e){this.context=e}setupAriaAttributes(){let e=this.context.getOptions().messages,t=this.context.wrapper.find(`.${V.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(`.${V.bubble}`),t=e.filter(function(){return $(this).find(`.${V.typingIndicator}`).length===0}),n=e.filter(function(){return $(this).find(`.${V.typingIndicator}`).length>0});t.attr(`tabindex`,`0`),n.attr(`tabindex`,`-1`),t.off(`${Qe}${W} ${$e}${W} ${Ze}${W}`).on(`${Qe}${W}`,function(){let t=$(this);e.each(function(){nt($(this),!1)}),rt&&e.removeClass(V.selected),e.removeClass(V.focus),rt&&t.addClass(V.selected),t.addClass(V.focus),nt(t,!0),rt=!1}).on(`${$e}${W}`,function(){rt&&!it&&$(this).removeClass(V.selected),nt($(this),!1),$(this).removeClass(V.focus)}).on(`${Ze}${W}`,function(e){$(e.target).closest(H.fileMenuButton)||$(this).trigger(Qe)})}setupSuggestionAccessibility(){this.context.wrapper.find(`.${V.suggestionGroup}`).each((e,t)=>{let n=$(t);n.attr(`role`,`group`),n.find(`.${V.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(V.chatSend)?r.attr(`aria-label`,e.actionButton||e.sendButton):r.hasClass(`k-chat-upload`)&&r.attr(`aria-label`,e.fileButton)),r.hasClass(V.chatSend)&&r.hasClass(`k-disabled`)&&r.attr(`aria-disabled`,`true`)}),this.context.wrapper.find(`.${V.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(H.pinnedMessageCloseButton,e.pinnedMessageCloseButton),this.setupCloseButtonAria(H.replyMessageCloseButton,e.replyMessageCloseButton),this.context.wrapper.find(`[${H.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(`.${V.bubbleExpandableIndicator}`).each((e,t)=>{let n=$(t);n.attr(`role`,`button`).attr(`tabindex`,`0`);let r=n.closest(`.${V.bubble}`).hasClass(V.expanded)?`Collapse message`:`Expand message`;n.attr(`aria-label`,r)})}setupScrollButtonsAria(){let e=this.context.getOptions().dir,t=this.context.wrapper.find(`[${H.leftScrollButton}]`),n=this.context.wrapper.find(`[${H.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(`.${V.messageBox}`).find(`textarea, input:not([type='hidden']):not([type='file']):not([type='button']):not([type='submit']):not([type='reset']):not([type='checkbox']):not([type='radio'])`).first().attr(`aria-label`,e.messageBoxLabel)}setFileCloseButtonAria(e){e.find(`[${H.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 rt=!0,it=e.shiftKey,n.hasClass(V.bubble)&&this.handleBubbleKeyDown(e,r),n.hasClass(V.suggestion)&&this.handleClickableElementKeyDown(e,r),n.hasClass(V.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(`.${V.typingIndicator}`).length>0)return;let r=this.context.wrapper.find(`.${V.bubble}`).filter(function(){return $(this).find(`.${V.typingIndicator}`).length===0}),i=r.index(n),a=x.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=x.keys;if(t===r.ENTER||t===r.SPACEBAR){e.preventDefault(),n.trigger(Ze);let t=n.closest(`.${V.bubble}`).hasClass(V.expanded);this.updateExpandableIndicatorAria(n,!t)}}handleMessageInputKeyDown(e,t,n){}handleClickableElementKeyDown(e,t){let n=x.keys;(t===n.ENTER||t===n.SPACEBAR)&&(e.preventDefault(),$(e.target).trigger(Ze))}};let ot=/&/g,st=/</g,ct=/"/g,lt=/'/g,ut=/>/g,dt=[`http:`,`https:`],G=new 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(ot,`&`).replace(st,`<`).replace(ut,`>`).replace(ct,`"`).replace(lt,`'`)}sanitizeLink(e){let t=``;try{let n=new URL(e,window.location.origin);if(dt.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}};var ft=class e extends L{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`,size:`small`});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(Ze,this.onClick.bind(this))}onClick(e){let t=e.target.closest(`.`+V.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()}},pt=class e extends L{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:z.attachmentMenu,size:`small`}),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(`.`+V.file),r=$(e.sender.element).closest(`.`+V.message);t&&this.executeCommand(t,$(e.sender.element),n,r)}onOpen(e){let t=!0,n=$(e.sender.element);(n.closest(`.`+V.messageRemoved).length||n.find(`.`+V.typingIndicator).length)&&(e.preventDefault(),t=!1),this.setActive(n,t)}onClose(e){let t=$(e.sender.element),n=t.closest(`.`+V.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(`.`+V.bubble);t?n.addClass(V.active):n.removeClass(V.active)}destroy(){this.dropdownButton&&=(this.dropdownButton.destroy(),null),super.destroy()}};let mt=`en-US`,ht={name:mt,numberFormat:{pattern:[`-n`],decimals:2,",":`,`,".":`.`,groupSize:[3],percent:{pattern:[`-n %`,`n %`],decimals:2,",":`,`,".":`.`,groupSize:[3],symbol:`%`},currency:{name:`US Dollar`,abbr:`USD`,pattern:[`($n)`,`$n`],decimals:2,",":`,`,".":`.`,groupSize:[3],symbol:`$`}},calendars:{standard:{days:{names:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],namesAbbr:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],namesShort:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`]},months:{names:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],namesAbbr:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]},AM:[`AM`,`am`,`AM`],PM:[`PM`,`pm`,`PM`],patterns:{d:`M/d/yyyy`,D:`dddd, MMMM dd, yyyy`,F:`dddd, MMMM dd, yyyy h:mm:ss tt`,g:`M/d/yyyy h:mm tt`,G:`M/d/yyyy h:mm:ss tt`,m:`MMMM dd`,M:`MMMM dd`,s:`yyyy'-'MM'-'ddTHH':'mm':'ss`,t:`h:mm tt`,T:`h:mm:ss tt`,u:`yyyy'-'MM'-'dd HH':'mm':'ss'Z'`,y:`MMMM, yyyy`,Y:`MMMM, yyyy`},"/":`/`,":":`:`,firstDay:0,twoDigitYearMax:2029}}},K=new class{constructor(){window.kendo||(window.kendo={}),window.kendo.cultures||(window.kendo.cultures={}),this.cultures=window.kendo.cultures,this.cultures[mt]||(this.cultures[mt]=ht)}findCulture(e){return e?typeof e==`string`?this.cultures[e]||this.cultures[e.split(`-`)[0]]||null:e.numberFormat?e:null:null}getCulture(e){return e&&=this.findCulture(e),e||this.cultures.current}appendDesignatorsToCultures(e){e.standard.AM&&e.standard.AM.length&&e.standard.PM&&e.standard.PM.length&&e.standard.AM.indexOf(`PMA0`)<0&&(e.standard.AM.indexOf(`AM`)>-1||e.standard.PM.indexOf(`PM`)>-1)&&(e.standard.AM.push(`a`,`A`,`PMa`,`PMA`,`PMa0`,`PMA0`),e.standard.PM.push(`p`,`P`,`AMp`,`AMP`,`AMp0`,`AMP0`))}culture(){return this.appendDesignatorsToCultures(this.cultures.current.calendars),this.cultures.current}setCulture(e){let t=this.findCulture(e)||this.cultures[mt];t.calendar=t.calendars.standard,this.cultures.current=t}registerCulture(e,t){this.cultures[e]=t}getCulturesRegistry(){return this.cultures}},gt=/^(n|c|p|e)(\d*)$/i,_t=/(\\.)|(googol)|(['][^']*[']?)|(["][^"]*["]?)/g,vt=/\,/g,yt=new class e{format(e,t,n){let r=n?K.getCulture(n):K.culture(),i=r.numberFormat,a=i[`.`],o=i.decimals,s=i.pattern[0],c=[],l,u,d,f,p,m=e<0,h,g,_,v=``,y,b,x,S,C,w=-1,T;if(e===void 0)return``;if(!isFinite(e))return String(e);if(!t)return r.name.length?e.toLocaleString():e.toString();if(p=gt.exec(t),p){if(t=p[1].toLowerCase(),u=t===`c`,d=t===`p`,(u||d)&&(i=u?i.currency:i.percent,a=i[`.`],o=i.decimals,l=i.symbol,s=i.pattern[+!m]),f=p[2],f&&(o=+f),t===`e`)return(f?e.toExponential(o):e.toExponential()).replace(`.`,i[`.`]);d&&(e*=100);let n=this.round(e,o);m=parseFloat(n)<0;let r=n.split(`.`);if(h=r[0],g=r[1],m&&(h=h.substring(1)),v=this.groupInteger(h,0,h.length,i),g&&(v+=a+g),t===`n`&&!m)return v;let c=``;for(let e=0,t=s.length;e<t;e++){let t=s.charAt(e);t===`n`?c+=v:t===`$`||t===`%`?c+=l:c+=t}return c}t=this.extractLiterals(t,c);let E=t.split(`;`),D=this.selectFormatSection(E,m,e);if(t=D.format,x=D.hasNegativeFormat,D.isZeroFormat)return t;let O=t.indexOf(`%`),k=t.indexOf(`$`);d=O!==-1,u=k!==-1,d&&(e*=100),u&&t[k-1]===`\\`&&(t=t.split(`\\`).join(``),u=!1),(u||d)&&(i=u?i.currency:i.percent,a=i[`.`],o=i.decimals,l=i.symbol),b=t.indexOf(`,`)>-1,b&&(t=t.replace(vt,``));let A=this.calculateDecimalPrecision(t,e,m);t=A.format,S=A.decimalIndex,y=A.length;let j=A.number,ee=this.findPlaceholderPositions(t);if(w=ee.start,T=ee.end,C=ee.zeroIndex,w===y&&(T=w),w!==-1){let e=j.toString().split(`.`);h=e[0],g=e[1]||``,_=h.length,m&&parseFloat(j)*-1>=0&&(m=!1);let n=this.applyPatternToNumber(t,w,T,y,m,x,S,h,g,a,C);return b&&(n=this.groupInteger(n,w+(m&&!x?1:0),Math.max(T,_+w),i)),T>=w&&(n+=t.substring(T+1)),(u||d)&&(n=this.replaceSymbols(n,l)),c.length&&(n=this.replaceLiterals(n,c)),n}return String(j)}replaceSymbols(e,t){let n=``;for(let r=0,i=e.length;r<i;r++){let i=e.charAt(r);n+=i===`$`||i===`%`?t:i}return n}replaceLiterals(e,t){for(let n=0;n<t.length;n++)e=e.replace(`??`,t[n]);return e}applyPatternToNumber(e,t,n,r,i,a,o,s,c,l,u){let d=e.substring(0,t),f=``,p=s.length;i&&!a&&(d+=`-`);let m=t;for(;m<r;){let t=e.charAt(m);if(o===-1){if(n-m<p){d+=s;break}}else if(u!==-1&&u<m&&(f=``),o-m<=p&&o-m>-1&&(d+=s,m=o),o===m){d+=(c?l:``)+c,m+=n-o+1;continue}t===`0`?(d+=t,f=t):t===`#`&&(d+=f),m++}return d}selectFormatSection(e,t,n){let r,i=!1,a=!1;return t&&e[1]?(r=e[1],i=!0):n===0&&e[2]?(r=e[2],r.indexOf(`#`)===-1&&r.indexOf(`0`)===-1&&(a=!0)):r=e[0],{format:r,hasNegativeFormat:i,isZeroFormat:a}}calculateDecimalPrecision(e,t,n){let r=e.indexOf(`.`),i=0,a=e.length,o,s,c,l,u,d;if(r!==-1){let f=t.toString().split(`e`);if(o=f[1]?this.round(t,Math.abs(parseInt(f[1],10))):f[0],o=o.split(`.`)[1]||``,s=e.lastIndexOf(`0`)-r,c=e.lastIndexOf(`#`)-r,l=s>-1,u=c>-1,i=o.length,!l&&!u&&(e=e.substring(0,r)+e.substring(r+1),a=e.length,r=-1,i=0),l&&s>c)i=s;else if(c>s)if(u&&i>c){for(d=this.round(t,c,n);d.charAt(d.length-1)===`0`&&c>0&&c>s;)c--,d=this.round(t,c,n);i=c}else l&&i<s&&(i=s)}let f=this.round(t,i,n);return{format:e,decimalIndex:r,length:a,number:f}}findPlaceholderPositions(e){let t=e.indexOf(`#`),n=e.indexOf(`0`),r,i,a;return r=t===-1&&n!==-1?n:t!==-1&&n===-1?t:t>n?n:t,t=e.lastIndexOf(`#`),a=e.lastIndexOf(`0`),i=t===-1&&a!==-1?a:t!==-1&&a===-1||t>a?t:a,{start:r,end:i,zeroIndex:a}}extractLiterals(e,t){return(e.indexOf(`'`)>-1||e.indexOf(`"`)>-1||e.indexOf(`\\`)>-1)&&(e=e.replace(_t,e=>{let n=e.charAt(0).replace(`\\`,``),r=e.slice(1).replace(n,``);return t.push(r),`??`})),e}groupInteger(e,t,n,r){let i=e.indexOf(r[`.`]),a=r.groupSize.slice(),o=a.shift(),s,c,l,u,d,f;if(n=i===-1?n+1:i,s=e.substring(t,n),c=s.length,c>=o){for(l=c,u=[];l>-1;)if(d=s.substring(l-o,l),d&&u.push(d),l-=o,f=a.shift(),o=f===void 0?o:f,o===0){l>0&&u.push(s.substring(0,l));break}s=u.reverse().join(r[`,`]),e=e.substring(0,t)+s+e.substring(n)}return e}round(t,n,r){return e.round(t,n,r)}static round(e,t,n){t||=0;let r=e.toString().split(`e`),i=Math.round(+(r[0]+`e`+(r[1]?+r[1]+t:t)));return n&&(i=-i),r=i.toString().split(`e`),(+(r[0]+`e`+(r[1]?+r[1]-t:-t))).toFixed(Math.min(t,20))}},bt={}.toString,xt=/[+|\-]\d{1,2}/,St=/[+|\-]\d{1,2}:?\d{2}/,Ct=/^\/Date\((.*?)\)\/$/,wt=/[+-]\d*/,Tt=[[],[`G`,`g`,`F`],[`D`,`d`,`y`,`m`,`T`,`t`]],Et=[[`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`]],Dt={2:/^\d{1,2}/,3:/^\d{1,3}/,4:/^\d{4}/,exact3:/^\d{3}/},Ot=new class{constructor(){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(bt.call(e)===`[object Date]`)return e;if(!e)return null;let a=String(e),o=null,s;if(a.indexOf(`/D`)===0){let e=Ct.exec(a);if(e){let t=e[1];if(s=wt.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=K.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(Dt.exact3)&&Number.isInteger(Number(n))&&Number(n)>0?this.unpadZero(n):e.substr(s,t);let r=Dt[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(Dt[3]);if(v=l(t),v!==null&&n){let e=parseFloat(`0.`+n[0]);e=parseFloat(yt.round(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?St:xt);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(Tt.length,Et.length),n=(e.calendar||e.calendars.standard).patterns,r=[];for(let e=0;e<t;e++){let t=Tt[e]||[];for(let e=0;e<t.length;e++)r.push(n[t[e]]);r.push(...Et[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)}},kt=new class{caret(e,t,n){let r,i=t!==void 0;n===void 0&&(n=t),e[0]&&(e=e[0]);let a=e;if(i&&a.disabled)return[];try{if(a.selectionStart!==void 0)if(i){a.focus();let e=_.mobileOS;return e&&(e.wp||e.android)?setTimeout(()=>{a.setSelectionRange(t,n)},0):a.setSelectionRange(t,n),[t,n]}else return[a.selectionStart,a.selectionEnd];else if(document.selection){if($(a).is(`:visible`)&&a.focus(),r=a.createTextRange(),i)return r.collapse(!0),r.moveStart(`character`,t),r.moveEnd(`character`,n-t),r.select(),[t,n];{let e=r.duplicate(),t,n;return r.moveToBookmark(document.selection.createRange().getBookmark()),e.setEndPoint(`EndToStart`,r),t=e.text.length,n=t+r.text.length,[t,n]}}}catch{return[]}return[]}antiForgeryTokens(){let e={},t=$(`meta[name=csrf-token],meta[name=_csrf]`).attr(`content`),n=$(`meta[name=csrf-param],meta[name=_csrf_header]`).attr(`content`);return $(`input[name^='__RequestVerificationToken']`).each(function(){e[this.name]=this.value}),n!==void 0&&t!==void 0&&(e[n]=t),e}},At=new class{constructor(){this._fileGroupMap=this.createFileGroupMap(),this.fileSaver=document.createElement(`a`),this.downloadAttribute=`download`in this.fileSaver&&!_.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 fileGroupMap(){return this._fileGroupMap}getFileGroup(e,t){let n=this._fileGroupMap,r=Object.keys(n),i=`file`;if(e===void 0||!e.length)return i;let a=e.toLowerCase();a.startsWith(`.`)||(a=`.`+a);for(let e=0;e<r.length;e+=1)if(n[r[e]].indexOf(a)>-1)return t?`file-`+r[e]:r[e];return i}getFileSizeMessage(e){let t=[`Bytes`,`KB`,`MB`,`GB`,`TB`];if(e===0)return`0 Byte`;let n=parseInt(String(Math.floor(Math.log(e)/Math.log(1024))),10);return Math.round(e/1024**n)+` `+t[n]}postToProxy(e,t,n,r){let i=$(`<form>`).attr({action:n,method:`POST`,target:r}),a=kt.antiForgeryTokens();a.fileName=t;let o=e.split(`;base64,`);a.contentType=o[0].replace(`data:`,``),a.base64=o[1];for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&$(`<input>`).attr({value:a[e],name:e,type:`hidden`}).appendTo(i);i.appendTo(`body`).submit().remove()}saveAsBlob(e,t){let n=e;if(typeof e==`string`){let t=e.split(`;base64,`),r=t[0],i=atob(t[1]),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);n=new Blob([a.buffer],{type:r})}navigator.msSaveBlob(n,t)}saveAsDataURI(e,t){let n=e;window.Blob&&e instanceof Blob&&(n=URL.createObjectURL(e)),this.fileSaver.download=t,this.fileSaver.href=n;let r=document.createEvent(`MouseEvents`);r.initMouseEvent(`click`,!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.fileSaver.dispatchEvent(r),setTimeout(function(){URL.revokeObjectURL(n)})}saveAs(e){let t=this.postToProxy.bind(this);e.forceProxy||(this.downloadAttribute?t=this.saveAsDataURI.bind(this):navigator.msSaveBlob&&(t=this.saveAsBlob.bind(this))),t(e.dataURI,e.fileName,e.proxyURL,e.proxyTarget)}},jt=(e,t)=>new kendo.ui.Avatar(`<div>`,{type:`image`,image:e,alt:G.encode(t??``)}).wrapper[0].outerHTML,Mt=()=>`<div class="${V.typingIndicator}">
<span></span>
<span></span>
<span></span>
</div>`,Nt=(e,t,n=!0)=>{let r=t?new kendo.ui.Button(`<button class="" ${H.fileCloseButton}>`,{icon:z.x,fillMode:`flat`,size:`xsmall`}).wrapper[0].outerHTML:``,i=n&&!t?new kendo.ui.Button(`<button class="${V.menuButton}" ${H.fileMenuButton}>`,{icon:z.attachmentMenu,fillMode:`flat`,size:`xsmall`}).wrapper[0].outerHTML:``;return`<li class="${V.file}" data-uid="${G.encode(e.uid)}">
${kendo.ui.icon({icon:At.getFileGroup(e.extension,!0),size:`xlarge`})}
<div class="${V.fileInfo}">
<span class="${V.fileName}">${G.encode(e.name)}</span>
<span class="${V.fileSize}">${G.encode(At.getFileSizeMessage(e.size))}</span>
</div>
${r}
${i}
</li>`},Pt=(e,t,n,r,i=Xe.VERTICAL)=>{if(!e?.length)return``;let a=``;e.forEach(e=>{a+=Nt(e,r??!1,!0)});let o=``;i===Xe.VERTICAL?o=` ${V.filesVertical}`:i===Xe.WRAP&&(o=` ${V.filesWrap}`);let s=`<ul class="${V.fileWrapper}${o}" ${H.fileWrapper}>`;return i===Xe.HORIZONTAL?s+=`<div class="${V.filesScroll}">${a}</div>`:s+=a,s+=`</ul>`,t&&e.length>1&&n?.downloadAll&&(s+=`<div class="${V.downloadButtonWrapper}">
${new kendo.ui.Button(`<button class="${V.downloadButton}">${n.downloadAll}</button>`,{icon:z.download,fillMode:`flat`,size:`small`}).wrapper[0].outerHTML}
</div>`),s},Ft=e=>{let{text:t,files:n,isOwnMessage:r,isPinMessage:i,isDeleted:a,renderCloseButton:o,renderFileMenuButton:s,messages:c}=e,l=r?V.messageReferenceSender:V.messageReferenceReceiver,u=i?V.messagePinned:``,d=i?H.pinnedMessageCloseButton:H.replyMessageCloseButton,f=i?H.messageReferencePinWrapper:H.messageReferenceReplyWrapper,p=G.convertTextUrlToLink(t||``);return p||=n?.length?Nt(n[0],!1,s??!1):``,a&&c&&(p=r?G.encode(c.selfMessageDeleted):G.encode(c.otherMessageDeleted)),`<div class="${V.messageReference} ${l} ${u}" ${f}>
${i?kendo.ui.icon({icon:z.pin}):``}
<div class="${V.messageReferenceContent}">${p}</div>
<span class="${V.spacer}"></span>
${o?new kendo.ui.Button(`<button ${d}>`,{icon:z.x,fillMode:`flat`,size:`xsmall`}).wrapper[0].outerHTML:``}
</div>`},It=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|HH|H|hh|h|mm|m|fff|ff|f|tt|aa|ss|s|zzz|zz|z|EEEE|"[^"]*"|'[^']*'/g;function q(e,t=2){let n=String(e);for(;n.length<t;)n=`0`+n;return n}let Lt=new class{format(e,t,n){let r=(n?K.getCulture(n):K.culture()).calendars.standard,i=r.days,a=r.months;return(t.pattern||r.patterns[t]||t).replace(It,t=>this.formatMatch(t,e,r,i,a))}formatMatch(e,t,n,r,i){let a,o,s;if(e===`d`)a=t.getDate();else if(e===`dd`)a=q(t.getDate());else if(e===`ddd`)a=r.namesAbbr[t.getDay()];else if(e===`dddd`||e===`EEEE`)a=r.names[t.getDay()];else if(e===`M`)a=t.getMonth()+1;else if(e===`MM`)a=q(t.getMonth()+1);else if(e===`MMM`)a=i.namesAbbr[t.getMonth()];else if(e===`MMMM`)a=i.names[t.getMonth()];else if(e===`yy`)a=q(t.getFullYear()%100);else if(e===`yyyy`)a=q(t.getFullYear(),4);else if(e===`h`)a=t.getHours()%12||12;else if(e===`hh`)a=q(t.getHours()%12||12);else if(e===`H`)a=t.getHours();else if(e===`HH`)a=q(t.getHours());else if(e===`m`)a=t.getMinutes();else if(e===`mm`)a=q(t.getMinutes());else if(e===`s`)a=t.getSeconds();else if(e===`ss`)a=q(t.getSeconds());else if(e===`f`)a=Math.floor(t.getMilliseconds()/100);else if(e===`ff`){let e=t.getMilliseconds();e>99&&(e=Math.floor(e/10)),a=q(e)}else if(e===`fff`)a=q(t.getMilliseconds(),3);else if(e===`tt`||e===`aa`)a=t.getHours()<12?n.AM[0]:n.PM[0];else if(e===`zzz`){o=t.getTimezoneOffset(),s=o<0;let e=Math.abs(o/60).toString().split(`.`)[0];o=Math.abs(o)-parseInt(e,10)*60,a=(s?`+`:`-`)+q(parseInt(e,10)),a+=`:`+q(o)}else if(e===`zz`||e===`z`){let n=t.getTimezoneOffset()/60;s=n<0;let r=Math.abs(n).toString().split(`.`)[0];a=(s?`+`:`-`)+(e===`zz`?q(parseInt(r,10)):r)}return a===void 0?e.slice(1,e.length-1):a}},Rt=/\{(\d+)(:[^\}]+)?\}/g,zt={}.toString,J=new class{toString(e,t,n){if(t){if(zt.call(e)===`[object Date]`)return Lt.format(e,t,n);if(typeof e==`number`)return yt.format(e,t,n)}return e===void 0?``:e}format(e,...t){return e.replace(Rt,(e,n,r)=>{let i=t[parseInt(n,10)],a=this.toString(i,r?r.substring(1):``);return String(a)})}extractFormat(e){return e.slice(0,3)===`{0:`&&(e=e.slice(3,e.length-1)),e}round(e,t,n){return yt.round(e,t,n)}},Bt={G:`era`,y:`year`,q:`quarter`,Q:`quarter`,M:`month`,L:`month`,d:`day`,E:`weekday`,c:`weekday`,e:`weekday`,h:`hour`,H:`hour`,k:`hour`,K:`hour`,m:`minute`,s:`second`,a:`dayperiod`,t:`dayperiod`,x:`zone`,X:`zone`,z:`zone`,Z:`zone`},Vt={month:{type:`months`,minLength:3,standAlone:`L`},quarter:{type:`quarters`,minLength:3,standAlone:`q`},weekday:{type:`days`,minLength:{E:0,c:3,e:3},standAlone:`c`},dayperiod:{type:`dayPeriods`,minLength:0},era:{type:`eras`,minLength:0}},Ht=new class{constructor(){this.MS_PER_MINUTE=6e4,this.MS_PER_HOUR=60*6e4,this.MS_PER_DAY=864e5}adjustDST(e,t){return t===0&&e.getHours()===23?(e.setHours(e.getHours()+2),!0):!1}setDayOfWeek(e,t,n=1){let r=e.getHours();t=(t-e.getDay()+7*n)%7,e.setDate(e.getDate()+t),this.adjustDST(e,r)}dayOfWeek(e,t,n){return e=new Date(e),this.setDayOfWeek(e,t,n),e}firstDayOfMonth(e){return new Date(e.getFullYear(),e.getMonth(),1)}lastDayOfMonth(e){let t=new Date(e.getFullYear(),e.getMonth()+1,0),n=this.firstDayOfMonth(e),r=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return r&&t.setHours(n.getHours()+r/60),t}firstDayOfYear(e){return new Date(e.getFullYear(),0,1)}lastDayOfYear(e){return new Date(e.getFullYear(),11,31)}moveDateToWeekStart(e,t){return t===1?this.addDays(e,4-(e.getDay()||7)):this.addDays(this.dayOfWeek(e,t,-1),4)}calcWeekInYear(e,t){let n=new Date(e.getFullYear(),0,1,-6),r=this.moveDateToWeekStart(e,t).getTime()-n.getTime(),i=Math.floor(r/this.MS_PER_DAY);return 1+Math.floor(i/7)}weekInYear(e,t){t===void 0&&(t=K.culture().calendar.firstDay);let n=this.addDays(e,-7),r=this.addDays(e,7),i=this.calcWeekInYear(e,t);return i===0?this.calcWeekInYear(n,t)+1:i===53&&this.calcWeekInYear(r,t)>1?1:i}getDate(e){return e=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),this.adjustDST(e,0),e}toUtcTime(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}getMilliseconds(e){return this.toInvariantTime(e).getTime()-this.getDate(this.toInvariantTime(e)).getTime()}isInTimeRange(e,t,n){let r=this.getMilliseconds(t),i=this.getMilliseconds(n);if(!e||r===i)return!0;t>=n&&(i+=this.MS_PER_DAY);let a=this.getMilliseconds(e);return r>a&&(a+=this.MS_PER_DAY),i<r&&(i+=this.MS_PER_DAY),a>=r&&a<=i}isInDateRange(e,t,n){let r=t.getTime(),i=n.getTime();r>=i&&(i+=this.MS_PER_DAY);let a=e.getTime();return a>=r&&a<=i}addDays(e,t){let n=e.getHours();return e=new Date(e),this.setTime(e,t*this.MS_PER_DAY),this.adjustDST(e,n),e}setTime(e,t,n){let r=e.getTimezoneOffset();if(e.setTime(e.getTime()+t),!n){let t=e.getTimezoneOffset()-r;e.setTime(e.getTime()+t*this.MS_PER_MINUTE)}}setHours(e,t){return e=new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),this.adjustDST(e,t.getHours()),e}today(){return this.getDate(new Date)}isToday(e){return this.getDate(e).getTime()===this.today().getTime()}toInvariantTime(e){let t=new Date(1980,1,1,0,0,0);return e&&t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}addYear(e,t){let n=new Date(e);return new Date(n.setFullYear(n.getFullYear()+t))}nextDay(e){return this.addDays(e,1)}previousDay(e){return this.addDays(e,-1)}nextYear(e){return this.addYear(e,1)}previousYear(e){return this.addYear(e,-1)}addLiteral(e,t){let n=e[e.length-1];n&&n.type===`LITERAL`?n.pattern+=t:e.push({type:`literal`,pattern:t})}isHour12(e){return e===`h`||e===`K`}dateNameType(e){if(e<=3)return`abbreviated`;if(e===4)return`wide`;if(e===5)return`narrow`}startsWith(e,t,n=0){return e.indexOf(t,n)===n}datePattern(e,t){let n=t.calendar,r;return typeof e==`string`&&(r=n.patterns[e]?n.patterns[e]:e),r||=n.patterns.d,r}splitDateFormat(e){let t=K.culture(),n=this.datePattern(e,t).replaceAll(`dddd`,`EEEE`).replaceAll(`ddd`,`EEE`).replace(`tt`,`aa`),r=[],i=/d{1,2}|E{1,6}|e{1,6}|c{3,6}|c{1}|M{1,5}|L{1,5}|y{1,4}|H{1,2}|h{1,2}|k{1,2}|K{1,2}|m{1,2}|a{1,5}|s{1,2}|S{1,3}|t{1,2}|z{1,4}|Z{1,5}|x{1,5}|X{1,5}|G{1,5}|q{1,5}|Q{1,5}|"[^"]*"|'[^']*'/g,a=i.lastIndex=0,o=i.exec(n);for(;o;){let e=o[0];if(a<o.index&&this.addLiteral(r,n.substring(a,o.index)),this.startsWith(e,`"`)||this.startsWith(e,`'`))this.addLiteral(r,e);else{let t=e[0],n=Bt[t],i={type:n,pattern:e};n===`hour`&&(i.hour12=this.isHour12(e));let a=Vt[n];if(a){let n=typeof a.minLength==`number`?a.minLength:a.minLength[t],r=e.length;r>=n&&e!==`aa`&&(i.names={type:a.type,nameType:this.dateNameType(r)||`abbreviated`,standAlone:a.standAlone===t})}r.push(i)}a=i.lastIndex,o=i.exec(n)}return a<n.length&&this.addLiteral(r,n.substring(a)),r}dateFormatNames(e){let{type:t,nameType:n}=e,r=K.culture();n===`wide`&&(n=`names`),n===`abbreviated`&&(n=`namesAbbr`),n===`narrow`&&(n=`namesShort`);let i=r.calendar[t]?.[n];return i||=r.calendar[t]?.name,i||[]}dateFieldName(e){return(K.culture().calendar.dateFields?.[e.type]||{})[e.nameType]}getRelativeDateString(e,t=new Date){if(!e)return``;let n=new Date(t);n.setHours(0,0,0,0);let r=new Date(e);r.setHours(0,0,0,0);let i=n.getTime()-r.getTime(),a=Math.floor(i/this.MS_PER_DAY);return a===0?`Today`:a===1?`Yesterday`:a<=6?`Last ${J.toString(r,`dddd`)}`:String(J.toString(r,`dddd, MMMM dd, yyyy`))}},Ut=(e,t)=>!e.failed||!e.isOwnMessage?``:kendo.html.renderButton(`<button class="${V.messageRetryButton}" ${H.retryButton} title="${t}" aria-label="${t}" data-uid="${e.uid||``}"></button>`,{icon:z.retry,size:`xsmall`,fillMode:`clear`}),Wt=e=>`<span class="${V.messageFailedContent}">
${kendo.ui.icon({icon:z.warningTriangle,size:`xsmall`})}
<span class="${V.messageFailedText}">${G.encode(e)}</span>
</span>`,Gt=(e,t,n,r)=>{if(!e)return``;if(n)return n({status:e,message:t});let i=r?.[e],a=`${V.messageStatus}${i?.cssClass?` `+i.cssClass:``}`,o=``;i?.icon&&(o=kendo.ui.icon({icon:i.icon}));let s=i?.text===void 0?e.charAt(0).toUpperCase()+e.slice(1):i.text;return`<span class="${a}">${o}${G.encode(s)}</span>`},Kt=(e,t,n,r)=>{if(r)return r({attachment:e,message:t});let i=e.title?`<div class="${V.cardTitle}">${G.encode(e.title)}</div>`:``,a=e.subtitle?`<div class="${V.cardSubtitle}">${G.encode(e.subtitle)}</div>`:``,o=e.thumbnailUrl?`<div class="${V.cardMedia}"><img src="${G.encode(e.thumbnailUrl)}" alt="" /></div>`:``,s=e.actions?.length?`<div class="${V.cardActions}">${e.actions.map((e,t)=>{let r=e.title||e.text;return`<button class="${V.cardAction} ${V.button}" ${H.attachmentActionButton} data-attachment-index="${n}" data-action-index="${t}">${G.encode(r)}</button>`}).join(``)}</div>`:``;return`<div class="${V.card}">
${o}
<div class="${V.cardBody}">
${i}
${a}
</div>
${s}
</div>`},qt=(e,t,n=`list`,r)=>{if(!e?.length)return``;let i=e.map((e,n)=>Kt(e,t,n,r)).join(``);return n===`carousel`?`<div class="${V.cardDeckScrollWrap}">
${new kendo.ui.Button(`<button ${H.leftScrollButton}>`,{icon:z.chevronLeft}).wrapper[0].outerHTML}
<div class="${V.cardDeck}">${i}</div>
${new kendo.ui.Button(`<button ${H.rightScrollButton}>`,{icon:z.chevronRight}).wrapper[0].outerHTML}
</div>`:`<div class="${V.cardList}">${i}</div>`},Jt=(e,t,n,r,i,a,o,s,c=Xe.VERTICAL,l,u,d,f,p=`onFocus`,m,h=!0)=>{let g=e.isDeleted,_=e.status===Ye.FAILED,v=e.isOwnMessage&&(e.failed||_),y=!e.isOwnMessage&&_?void 0:e.status,b=i&&!e.isTyping?[V.bubbleExpandable,V.expanded]:[],x=t?Ft({text:t.text,files:t.files,isOwnMessage:t.isOwnMessage,isPinMessage:!1,renderCloseButton:!1,renderFileMenuButton:!1}):``,S=``;S=e.isTyping&&!e.isOwnMessage?Mt():u&&!g?u(e):g?e.isOwnMessage?G.encode(r.selfMessageDeleted):G.encode(r.otherMessageDeleted):G.convertTextUrlToLink(e.text||``,o);let C=p===`onFocus`?` data-timestamp-visibility="${p}"`:``,w=[V.messageTime,p===`onFocus`?V.hidden:``].filter(Boolean).join(` `),T=h?`<time class="${w}"${C}>${J.toString(Ot.parseDate(e.timestamp),a)}</time>`:``,E=Gt(y,e,s,m||null),D=v?Ut(e,r.retryMessage||`Retry`):``,O=v?Wt(m?.[Ye.FAILED]?.text||`Failed to send`):``,k=`<div class="${V.messageInfo}">${E}${T}${O}</div>`,A=``;return e.files?.length&&!g&&(A=l?l(e.files,n,r,!1,c):Pt(e.files,n,r,!1,c)),`<div class="${V.message}${g?` `+V.messageRemoved:``}${v?` `+V.messageFailed:``}" data-uid="${G.encode(e.uid??``)}">
${D}
<div class="${V.chatBubble} ${V.bubble} ${b.join(` `)}">
<div class="${V.bubbleContent}">
${x}
<span class="${V.chatBubbleText}">${S}</span>
${A}
</div>
${i&&!e.isTyping?`<span class="${V.bubbleExpandableIndicator}" ${H.bubbleExpandableIndicator}>${kendo.ui.icon({icon:z.chevronUp})}</span>`:``}
</div>
${k}
${g?``:`<div class="${V.messageToolbar}"></div>`}
</div>`},Yt=e=>{let{message:t,author:n,isOwnMessage:r,replyMessage:i,downloadAll:a=!0,messages:o,expandable:s=!1,fullWidth:c=!1,messageTimeFormat:l=`ddd MMM dd yyyy`,timestampTemplate:u,statusTemplate:d,showTimestamp:f=!1,messageTemplate:p,filesTemplate:m,skipSanitization:h=!1,messageSettings:g,filesLayoutMode:_=Xe.VERTICAL,contentTemplate:v,attachmentTemplate:y,attachmentLayout:b,userStatusTemplate:S,timestampVisibility:C=`onFocus`,statusSettings:w,showMessageTime:T=!0}=e,E=g?.showAvatar===void 0?n&&n.imageUrl:g.showAvatar&&n&&n.imageUrl,D=g?.showUsername===void 0||g.showUsername,O=g?.allowMessageCollapse===void 0?s:g.allowMessageCollapse,k=g?.messageWidthMode===`full`||c,A=[V.messageGroup,r?V.messageGroupSender:V.messageGroupReceiver,E?``:V.noAvatar,k?V.messageGroupFullWidth:``].filter(Boolean).join(` `),j=``;if(f&&t.timestamp){let e=Ot.parseDate(t.timestamp);if(x.isFunction(u))j=u({date:e,message:t});else{let t=Ht.getRelativeDateString(e);j=`<div class="${V.timestamp}">${t}</div>`}}let ee=E&&S?S({message:{...t,author:n}}):``,te=t.attachmentLayout||b||`list`,ne=t.isDeleted?``:qt(t.attachments,t,te,y),re;return re=p?p({...t,isOwnMessage:r,author:n},i??null,a,o,O,l,h,d):Jt({...t,isOwnMessage:r,author:n},i??null,a,o,O,l,h,d,_,m,v,y,b,C,w,T),`${f&&j?j:``}
<div class="${A}">${ee?`<div ${H.userStatusWrapper}>${ee}</div>`:``}
${E?jt(n.imageUrl,n.imageAltText):``}
<div class="${V.messageGroupContent}">
${D?`<span class="${V.messageAuthor}">${G.encode(n.name??``)}</span>`:``}
${re}
</div>
</div>
${ne}`},Xt=e=>{if(!e?.length)return``;let t=e.map(e=>`<span class="${V.suggestion}">${G.encode(e.text)}</span>`).join(``);return`<div class="${V.suggestionGroup}" ${H.suggestionGroup}>${t}</div>`},Zt=(e,t=R.SCROLL,n=!1)=>{if(!e?.length)return``;let r=e.map(e=>`<span class="${V.suggestion}">${G.encode(e.text)}</span>`).join(``);return Qt(r,t,n)},Qt=(e,t=R.SCROLL,n=!1)=>{if(!e)return``;if(t===R.WRAP)return`<div class="${V.suggestionGroup}" ${H.suggestionGroup}>${e}</div>`;let r=t===R.SCROLL?V.suggestionGroupScrollable:``,i=r?`${V.suggestionGroup} ${r}`:V.suggestionGroup,a=`<div class="${V.suggestionsScroll}">${e}</div>`,o=`<div class="${i}" ${H.suggestionGroup}>${a}</div>`;return t===R.SCROLLBUTTONS?$t(o,n):o},$t=(e,t)=>{let n=t?z.chevronRight:z.chevronLeft,r=t?z.chevronLeft:z.chevronRight;return`<div class="${V.suggestionScrollWrap} ${V.suggestionScrollWrapGradient}">
${new kendo.ui.Button(`<button ${H.leftScrollButton}>`,{icon:n}).wrapper[0].outerHTML}
${e}
${new kendo.ui.Button(`<button ${H.rightScrollButton}>`,{icon:r}).wrapper[0].outerHTML}
</div>`},en=(e,t)=>{if(t)return`<div class="${V.header}">${t()}</div>`;if(!e||e.length===0)return``;let n=$(`<div class="${V.header}">`);return new kendo.ui.ToolBar(n,{items:e}),n[0].outerHTML};var tn=class{constructor(e){this.context=e}renderMessage(e){let t=this.context.options,n=t.messages,r={id:e.authorId,name:e.authorName,imageUrl:e.authorImageUrl,imageAltText:e.authorImageAltText},i=String(r.id)===String(t.authorId),a=this.context.getReplyMessage(e),o=t.messageTimeFormat,s=t.skipSanitization,c=t.messageStatusTemplate,l=i?t.authorMessageSettings:t.receiverMessageSettings,u=this._mergeMessageSettings(t,l),d=u.allowMessageCollapse??t.allowMessageCollapse,f=u.messageWidthMode===Je.FULL;if(this._handleExistingMessageUpdate({message:e,author:r,isOwnMessage:i,replyMessage:a,componentMessages:n,expandable:d,messageTimeFormat:o,skipSanitization:s,statusTemplate:c,messageSettings:u}))return;let p=this._findTargetMessageGroup();if(this._canGroupWithLastMessage(p,r.id)&&p.length)this._addMessageToExistingGroup({message:e,author:r,isOwnMessage:i,replyMessage:a,componentMessages:n,expandable:d,targetGroupElement:p,messageTimeFormat:o,skipSanitization:s,statusTemplate:c,messageSettings:u});else{let t=this._shouldShowTimestamp(e);this._createNewMessageGroup({message:e,author:r,isOwnMessage:i,replyMessage:a,componentMessages:n,expandable:d,fullWidth:f,messageTimeFormat:o,showTimestamp:t,skipSanitization:s,statusTemplate:c,messageSettings:u})}}_mergeMessageSettings(e,t){let n={showAvatar:e.showAvatar,showUsername:e.showUsername,allowMessageCollapse:e.allowMessageCollapse,messageWidthMode:e.messageWidthMode,messageToolbarActions:e.messageToolbarActions,messageActions:e.messageActions,messageTemplate:e.messageTemplate,messageContentTemplate:e.messageContentTemplate};return t&&(t.showAvatar!==void 0&&(n.showAvatar=t.showAvatar),t.showUsername!==void 0&&(n.showUsername=t.showUsername),t.allowMessageCollapse!==void 0&&(n.allowMessageCollapse=t.allowMessageCollapse),t.messageWidthMode!==void 0&&(n.messageWidthMode=t.messageWidthMode),t.enableFileActions!==void 0&&(n.enableFileActions=t.enableFileActions),t.enableContextMenuActions!==void 0&&(n.enableContextMenuActions=t.enableContextMenuActions),t.messageToolbarActions!==void 0&&(n.messageToolbarActions=t.messageToolbarActions),t.messageActions!==void 0&&(n.messageActions=t.messageActions),t.messageTemplate!==void 0&&(n.messageTemplate=t.messageTemplate),t.messageContentTemplate!==void 0&&(n.messageContentTemplate=t.messageContentTemplate)),n}_getMessageTimeVisibility(){return this.context.options.timestampVisibility}_shouldShowTimestamp(e){if(!e.timestamp)return!1;let t=this.context.list.find(`.`+V.message).filter(function(){return $(this).find(`.`+V.typingIndicator).length===0}).last();if(!t.length)return!0;let n=this.context.dataItem(t);if(!n||!n.timestamp)return!0;let r=Ot.parseDate(e.timestamp),i=Ot.parseDate(n.timestamp);if(!r||!i)return!1;let a=new Date(r);a.setHours(0,0,0,0);let o=new Date(i);return o.setHours(0,0,0,0),a.getTime()!==o.getTime()}_shouldRenderUserStatus(e,t){return t?.showAvatar===void 0?!!e?.imageUrl:!!(t.showAvatar&&e?.imageUrl)}_syncUserStatus(e,t,n,r){let i=e.find(`[${H.userStatusWrapper}]`),a=this.context.options.userStatusTemplate;if(!a||!this._shouldRenderUserStatus(n,r)){i.remove();return}let o=$(`<div ${H.userStatusWrapper}>${a({message:{...t,author:n}})}</div>`);i.remove(),e.prepend(o)}_isLastMessageInGroup(e){return e.closest(`.`+V.messageGroup).find(`.`+V.message).filter(function(){return $(this).find(`.`+V.typingIndicator).length===0}).last().is(e)}_handleExistingMessageUpdate(e){let{message:t,author:n,isOwnMessage:r,replyMessage:i,componentMessages:a,expandable:o,messageTimeFormat:s,skipSanitization:c,statusTemplate:l,messageSettings:u}=e,d=this.context.options,f=this.context.list.find(`.`+V.message+`[data-uid="${G.encode(t.uid??``)}"]`),p=this._getMessageTimeVisibility(),m=u?.messageTemplate||null,h=u?.messageContentTemplate||null,g=d.filesTemplate;if(f.length){let e=this._isLastMessageInGroup(f),_;_=m?m({...t,isOwnMessage:r,author:n},i,!0,a,u?.allowMessageCollapse??o,s,c,l):Jt({...t,isOwnMessage:r,author:n},i,!0,a,u?.allowMessageCollapse??o,s,c,l,d.filesLayoutMode,g,h,d.attachmentTemplate,d.attachmentLayout,p,d.messageStatusSettings,p!==`hidden`);let v=$(_);return v.data(`messageData`,t),f.replaceWith(v),this.context.initMessageToolbar(v.find(`.`+V.messageToolbar),u?.messageToolbarActions),this.context.initFileMenus(v,u?.enableFileActions),e&&this._syncUserStatus(v.closest(`.`+V.messageGroup),t,n,u),!0}return!1}_findTargetMessageGroup(){let e=this.context.list.children(`.`+V.messageGroup).last(),t=e,n=e.find(`.`+V.message);return n.length===1&&n.first().find(`.`+V.typingIndicator).length>0&&(t=e.prev(`.`+V.messageGroup)),t}_canGroupWithLastMessage(e,t){let n=e.find(`.`+V.message).filter(function(){return $(this).find(`.`+V.typingIndicator).length===0}).last(),r=this.context.dataItem(n);return String(r?.authorId)===String(t)}_addMessageToExistingGroup(e){let{message:t,author:n,isOwnMessage:r,replyMessage:i,componentMessages:a,expandable:o,targetGroupElement:s,messageTimeFormat:c,skipSanitization:l,statusTemplate:u,messageSettings:d}=e,f=this.context.options,p=s.find(`.`+V.messageGroupContent),m=this._getMessageTimeVisibility(),h=d?.messageTemplate||null,g=d?.messageContentTemplate||null,_=f.filesTemplate,v;v=h?h({...t,isOwnMessage:r,author:n},i,!0,a,d?.allowMessageCollapse??o,c,l,u):Jt({...t,isOwnMessage:r,author:n},i,!0,a,d?.allowMessageCollapse??o,c,l,u,f.filesLayoutMode,_,g,f.attachmentTemplate,f.attachmentLayout,m,f.messageStatusSettings,m!==`hidden`);let y=$(v);if(y.data(`messageData`,t),p.append(y),this.context.initMessageToolbar(y.find(`.`+V.messageToolbar),d?.messageToolbarActions),this.context.initFileMenus(y,d?.enableFileActions),!t.isDeleted){let e=t.attachmentLayout||f.attachmentLayout||`list`,n=qt(t.attachments,t,e,f.attachmentTemplate);n&&s.after($(n))}this._syncUserStatus(s,t,n,d),this._moveTypingIndicatorsToEnd()}_createNewMessageGroup(e){let{message:t,author:n,isOwnMessage:r,replyMessage:i,componentMessages:a,expandable:o,fullWidth:s,messageTimeFormat:c,showTimestamp:l,skipSanitization:u,statusTemplate:d,messageSettings:f}=e,p=this.context.options,m=p.messageGroupTemplate,h=p.timestampTemplate,g=f?.messageTemplate||null,_=f?.messageContentTemplate||null,v=$(m({message:t,author:n,isOwnMessage:r,replyMessage:i,downloadAll:!0,messages:a,expandable:o,fullWidth:s,messageTimeFormat:c,timestampTemplate:h,statusTemplate:d,showTimestamp:l,messageTemplate:g,contentTemplate:_,filesTemplate:p.filesTemplate,skipSanitization:u,messageSettings:f,filesLayoutMode:p.filesLayoutMode,attachmentTemplate:p.attachmentTemplate,attachmentLayout:p.attachmentLayout,userStatusTemplate:p.userStatusTemplate,timestampVisibility:this._getMessageTimeVisibility(),statusSettings:p.messageStatusSettings,showMessageTime:this._getMessageTimeVisibility()!==`hidden`}));return v.find(`.`+V.message).first().data(`messageData`,t),this.context.list.append(v),this.context.initMessageToolbar(v.find(`.`+V.messageToolbar),f?.messageToolbarActions),this.context.initFileMenus(v,f?.enableFileActions),this._moveTypingIndicatorsToEnd(),v}_moveTypingIndicatorsToEnd(){let e=this,t=this.context,n=t.options,r=n.messageGroupTemplate;t.list.find(`.`+V.message).filter(function(){return $(this).find(`.`+V.typingIndicator).length>0}).each(function(){let i=$(this),a=i.closest(`.`+V.messageGroup);if(a.find(`.`+V.message).length===1)a.detach().appendTo(t.list);else{i.remove();let a=t.dataItem(i);if(!a)return;let o={id:a.authorId,name:a.authorName,imageUrl:a.authorImageUrl,imageAltText:a.authorImageAltText},s=String(o.id)===String(n.authorId),c=s?n.authorMessageSettings:n.receiverMessageSettings,l=e._mergeMessageSettings(n,c),u=$(r({message:a,author:o,isOwnMessage:s,downloadAll:!0,messages:n.messages,expandable:l.allowMessageCollapse??n.allowMessageCollapse,fullWidth:l.messageWidthMode===Je.FULL,messageTimeFormat:n.messageTimeFormat,statusTemplate:n.messageStatusTemplate,showTimestamp:!1,timestampTemplate:n.timestampTemplate,messageTemplate:l.messageTemplate||null,contentTemplate:l.messageContentTemplate||null,filesTemplate:n.filesTemplate,skipSanitization:n.skipSanitization,messageSettings:l,filesLayoutMode:n.filesLayoutMode,attachmentTemplate:n.attachmentTemplate,attachmentLayout:n.attachmentLayout,userStatusTemplate:n.userStatusTemplate,timestampVisibility:e._getMessageTimeVisibility(),statusSettings:n.messageStatusSettings,showMessageTime:e._getMessageTimeVisibility()!==`hidden`}));t.list.append(u)}})}prependMessages(e){if(!e.length)return;let t=this.context.options,n=t.messages,r=t.messageGroupTemplate,i=t.timestampTemplate,a=null,o=null,s=document.createDocumentFragment(),c=$(s);for(let s=0;s<e.length;s++){let l=e[s],u={id:l.authorId,name:l.authorName,imageUrl:l.authorImageUrl,imageAltText:l.authorImageAltText},d=String(u.id)===String(t.authorId),f=this.context.getReplyMessage(l),p=d?t.authorMessageSettings:t.receiverMessageSettings,m=this._mergeMessageSettings(t,p),h=t.messageStatusTemplate;if(String(u.id)===o&&a){let e=a.find(`.`+V.messageGroupContent),r=m.messageTemplate||null,i=m.messageContentTemplate||null,o;o=r?r({...l,isOwnMessage:d,author:u},f,!0,n,m.allowMessageCollapse??t.allowMessageCollapse,t.messageTimeFormat,t.skipSanitization,h):Jt({...l,isOwnMessage:d,author:u},f,!0,n,m.allowMessageCollapse??t.allowMessageCollapse,t.messageTimeFormat,t.skipSanitization,h,t.filesLayoutMode,t.filesTemplate,i,t.attachmentTemplate,t.attachmentLayout,t.timestampVisibility,t.messageStatusSettings,t.timestampVisibility!==`hidden`);let s=$(o);e.append(s),this.context.initMessageToolbar(s.find(`.`+V.messageToolbar),m?.messageToolbarActions),this.context.initFileMenus(s,m?.enableFileActions)}else{let e=s===0&&l.timestamp,p=m.messageTemplate||null,g=m.messageContentTemplate||null;a=$(r({message:l,author:u,isOwnMessage:d,replyMessage:f,downloadAll:!0,messages:n,expandable:m.allowMessageCollapse??t.allowMessageCollapse,fullWidth:m.messageWidthMode===Je.FULL,messageTimeFormat:t.messageTimeFormat,timestampTemplate:i,statusTemplate:h,showTimestamp:!!e,messageTemplate:p,skipSanitization:t.skipSanitization,messageSettings:m,filesLayoutMode:t.filesLayoutMode,contentTemplate:g,attachmentTemplate:t.attachmentTemplate,attachmentLayout:t.attachmentLayout,userStatusTemplate:t.userStatusTemplate,timestampVisibility:t.timestampVisibility,statusSettings:t.messageStatusSettings,showMessageTime:t.timestampVisibility!==`hidden`})),c.append(a),this.context.initMessageToolbar(a.find(`.`+V.messageToolbar),m?.messageToolbarActions),this.context.initFileMenus(a,m?.enableFileActions),o=String(u.id)}}let l=this.context.list.children(`.`+V.messageGroup).first();if(a&&l.length){let e=o,t=l.find(`.`+V.message).first(),n=this.context.dataItem(t);if(n&&String(n.authorId)===e){let e=l.find(`.`+V.messageGroupContent),t=a.find(`.`+V.messageGroupContent).children();e.prepend(t),a.remove()}}this.context.list.prepend(s)}},nn=class{constructor(e){this.scrollToBottomButton=null,this.separator=null,this._scrollHandler=null,this._clickHandler=null,this._olderLoadDebounceTimeout=null,this._newerLoadDebounceTimeout=null,this._isLoadingOlder=!1,this._allOlderLoaded=!1,this._isLoadingNewer=!1,this._allNewerLoaded=!0,this._scrolledAwayFromTop=!1,this._scrolledAwayFromBottom=!1,this._lastObservedClientHeight=0,this._resizeObserverService=null,this.context=e,this._initScrollToBottomButton(),this._initSeparator(),this._attachEvents()}_initScrollToBottomButton(){if(this.context.options.scrollToBottomButton===!1){this.scrollToBottomButton=null;return}let e=kendo.html.renderButton(`<button class="${V.scrollFab} ${V.hidden}" ${H.scrollToBottomButton} aria-label="Scroll to bottom"></button>`,{icon:z.arrowDown,rounded:`full`,themeColor:`base`});this.scrollToBottomButton=$(e).appendTo(this.context.element);let t={position:`sticky`,bottom:`16px`,transform:`translateX(-50%)`,zIndex:1},n=this.context.element.css(`direction`)===`rtl`;t[n?`right`:`left`]=`50%`,this.scrollToBottomButton.css(t)}_attachEvents(){this._scrollHandler=this._onScroll.bind(this),this._clickHandler=this._scrollToBottomButtonClick.bind(this),this.context.element.on(`scroll.kendoChat.scrollManager`,this._scrollHandler).on(`click.kendoChat.scrollManager`,`[${H.scrollToBottomButton}]`,this._clickHandler);let e=this.context.element[0];e&&(this._resizeObserverService=M.createResizeObserver({element:e,onResize:()=>this._onContainerResize(),debounceTime:1}))}_onContainerResize(){let e=this.context.element[0];if(!e)return;let t=this._lastObservedClientHeight,n=e.clientHeight;this._lastObservedClientHeight=n,t!==0&&n!==t&&e.scrollHeight-e.scrollTop-n+(n-t)<=100&&this.scrollToBottom()}_initSeparator(){this.separator=$(`<div class="${V.messageBoxSeparator} ${V.hidden}"></div>`),this.context.element.after(this.separator)}updateSeparator(){if(!this.separator)return;let e=this.context.element[0];e.scrollHeight>e.clientHeight?this.separator.removeClass(V.hidden):this.separator.addClass(V.hidden)}_updateScrollToBottomButtonVisibility(){if(!this.scrollToBottomButton)return;let e=this.context.element.scrollTop()||0,t=this.context.element.prop(`scrollHeight`)||0,n=this.context.element.prop(`clientHeight`)||0,r=t-e-n;!(!this.context.hasLatestMessageRendered||this.context.hasLatestMessageRendered())||r>100?this.scrollToBottomButton.removeClass(V.hidden):this.scrollToBottomButton.addClass(V.hidden)}_onScroll(){this._updateScrollToBottomButtonVisibility(),this.updateSeparator();let e=this.context.element[0],t=e.scrollTop,n=e.scrollHeight-t-e.clientHeight;!this._scrolledAwayFromTop&&t>200&&(this._clearOlderLoadDebounce(),this._scrolledAwayFromTop=!0),!this._scrolledAwayFromBottom&&n>100&&(this._clearNewerLoadDebounce(),this._scrolledAwayFromBottom=!0),t<=200&&this._scrolledAwayFromTop&&this.context.onScrollNearTop&&(this._scrolledAwayFromTop=!1,!this._isLoadingOlder&&!this._allOlderLoaded&&this._debounceOlderLoad()),n<=100&&this._scrolledAwayFromBottom&&this.context.onScrollNearBottom&&(this._scrolledAwayFromBottom=!1,!this._isLoadingNewer&&!this._allNewerLoaded&&this._debounceNewerLoad())}_getEndlessScrollDebounceDelay(){return Math.max(0,this.context.options.endlessScrollDebounceDelay||0)}_clearOlderLoadDebounce(){this._olderLoadDebounceTimeout&&=(clearTimeout(this._olderLoadDebounceTimeout),null)}_clearNewerLoadDebounce(){this._newerLoadDebounceTimeout&&=(clearTimeout(this._newerLoadDebounceTimeout),null)}_isNearTopEdge(){return(this.context.element[0]?.scrollTop||0)<=200}_isNearBottomEdge(){let e=this.context.element[0];return e?e.scrollHeight-e.scrollTop-e.clientHeight<=100:!1}_debounceOlderLoad(){let e=this._getEndlessScrollDebounceDelay();if(this._clearOlderLoadDebounce(),!e){this.context.onScrollNearTop?.();return}this._olderLoadDebounceTimeout=setTimeout(()=>{this._olderLoadDebounceTimeout=null,this._isNearTopEdge()&&!this._isLoadingOlder&&!this._allOlderLoaded&&this.context.onScrollNearTop?.()},e)}_debounceNewerLoad(){let e=this._getEndlessScrollDebounceDelay();if(this._clearNewerLoadDebounce(),!e){this.context.onScrollNearBottom?.();return}this._newerLoadDebounceTimeout=setTimeout(()=>{this._newerLoadDebounceTimeout=null,this._isNearBottomEdge()&&!this._isLoadingNewer&&!this._allNewerLoaded&&this.context.onScrollNearBottom?.()},e)}_scrollToBottomButtonClick(e){if(e.preventDefault(),this.context.onScrollToLatest&&this.context.isLatestRangeActive&&!this.context.isLatestRangeActive()){this.context.onScrollToLatest();return}this.scrollToBottom()}_getMessageElement(e){return this.context.list.find(`.`+V.message+`[data-uid="${G.encode(e)}"]`)}_getPreviousMessageElement(e){return e.prevAll(`.`+V.message).first()}_getPinnedHeight(){let e=this.context.element.find(`.`+V.messagePinned);return e.length&&e.outerHeight()||0}_getAutoScrollThreshold(e){let t=Math.max((this.context.element.prop(`clientHeight`)||0)-e,0),n=this.context.options.autoScrollThreshold;if(typeof n==`number`)return Math.max(n,0);if(typeof n==`string`){let e=n.trim();if(e.endsWith(`%`)){let n=parseFloat(e.slice(0,-1));if(!isNaN(n))return Math.max(t*n/100,0)}let r=parseFloat(e);if(!isNaN(r))return Math.max(r,0)}return 0}preserveScrollPosition(e){let t=this.context.element[0],n=t.scrollTop,r=t.scrollHeight;e();let i=t.scrollHeight;t.scrollTo({top:n+(i-r),behavior:`instant`})}scrollToBottom(){let e=this.context.element[0];e.scrollTo({top:e.scrollHeight,behavior:`instant`})}isNearBottom(){let e=this.context.element.scrollTop()||0,t=this.context.element.prop(`scrollHeight`)||0,n=this.context.element.prop(`clientHeight`)||0;return t-e-n<=100}scrollToMessage(e){if(!e)return!1;let t=this._getMessageElement(e);if(!t.length)return!1;let n=this._getPinnedHeight();return M.scrollToElement(this.context.element,t,{position:`top`,offset:-n})}scrollIncomingMessage(e){if(!e)return!1;let t=this._getMessageElement(e);if(!t.length)return!1;let n=this.context.element,r=n[0],i=n.offset(),a=t.offset();if(!r||!i||!a)return!1;let o=n.scrollTop()||0,s=r.clientHeight||0,c=this._getPinnedHeight(),l=this._getAutoScrollThreshold(c),u=a.top-i.top+o-c-l,d=this._getPreviousMessageElement(t),f=r.scrollHeight-s,p=u;if(d.length){let e=d.offset();if(e){let t=e.top-i.top+o+(d.outerHeight()||0),n=Math.min(l,8),r=u+c;n>0&&t<r+n&&(p=t-c-n)}}return p=Math.min(Math.max(p,0),f),n.finish().animate({scrollTop:p},0,`linear`),!0}resetEndlessState(){this._clearOlderLoadDebounce(),this._clearNewerLoadDebounce(),this._isLoadingOlder=!1,this._allOlderLoaded=!1,this._isLoadingNewer=!1,this._allNewerLoaded=!0,this._scrolledAwayFromTop=!1,this._scrolledAwayFromBottom=!1}refreshState(){this._updateScrollToBottomButtonVisibility(),this.updateSeparator()}destroy(){this._clearOlderLoadDebounce(),this._clearNewerLoadDebounce(),this._resizeObserverService&&=(this._resizeObserverService.destroy(),null),this.scrollToBottomButton&&=(this.scrollToBottomButton.remove(),null),this.separator&&=(this.separator.remove(),null),this.context.element.off(`.kendoChat.scrollManager`)}},rn=class{constructor(e){this.context=e}renderSuggestedActions(){let e=this.context.options,t=this.context.dataManager.getLastMessage()?.suggestedActions||[],n=e.suggestedActionsTemplate(t),r=this._getSuggestedActionsLayoutMode(e),i=Qt(n,r,e.dir===`rtl`);this.removeSuggestedActions(),this.context.list.append(t.length?i:``),this.context.list.find(`[${H.leftScrollButton}]`).addClass(V.disabled)}removeSuggestedActions(){this.context.list.find(`.`+V.suggestionGroup).remove(),this.context.list.find(`.`+V.suggestionScrollWrap).remove()}_getSuggestedActionsLayoutMode(e){return e.suggestedActionsLayoutMode?e.suggestedActionsLayoutMode:e.suggestedActionsScrollable?R.SCROLLBUTTONS:R.SCROLL}},an=class e extends L{static{this.options={name:`ChatView`}}_hideOnFocusMessageTimes(){this.element.find(`${`.`+V.messageTime}[data-timestamp-visibility='onFocus']`).addClass(V.hidden)}_toggleOnFocusMessageTime(e,t){e.find(`${`.`+V.messageTime}[data-timestamp-visibility='onFocus']`).toggleClass(V.hidden,!t)}constructor(t,n,r){super(t,$.extend(!0,{},e.options,n)),this._dragHandler=null,this.events=[U.suggestedActionClick,U.executeAction,U.messageToolbarExecute,U.fileMenuExecute,U.downloadAllFiles,U.expandableToggle,U.resendMessage],this.context=r,this._initList(),this._initHelpers(),this._attachEvents()}_initList(){let e=this.options.messages;this.element.addClass(V.viewWrapper).attr(`role`,`log`).attr(`aria-label`,e.messageListLabel).css(`overflow-anchor`,`none`),this.list=$(`<div>`).addClass(V.messageListContent).appendTo(this.element)}_initHelpers(){let e=this.options;this._messageRenderer=new tn({list:this.list,options:e,dataManager:this.context.dataManager,dataItem:this.dataItem.bind(this),getReplyMessage:this.getReplyMessage.bind(this),initMessageToolbar:this._initMessageToolbar.bind(this),initFileMenus:this._initFileMenus.bind(this)}),this._scrollManager=new nn({element:this.element,options:e,list:this.list,onScrollNearTop:this.context.onScrollNearTop,onScrollNearBottom:this.context.onScrollNearBottom,onScrollToLatest:this.context.onScrollToLatest,isLatestRangeActive:this.context.isLatestRangeActive,hasLatestMessageRendered:this.context.hasLatestMessageRendered}),this._suggestionRenderer=new rn({list:this.list,options:e,dataManager:this.context.dataManager})}_attachEvents(){this.element.on(`click.kendoChat`,this._listClick.bind(this)).on(`click.kendoChat`,`.`+V.message,this._messageClick.bind(this)).on(`click.kendoChat`,`.`+V.suggestion,this._suggestionClick.bind(this)).on(`click.kendoChat`,`[${H.attachmentActionButton}]`,this._attachmentActionClick.bind(this)).on(`click.kendoChat`,`[${H.leftScrollButton}]`,this._leftScrollButtonClick.bind(this)).on(`click.kendoChat`,`[${H.rightScrollButton}]`,this._rightScrollButtonClick.bind(this)).on(`click.kendoChat`,`.`+V.downloadButton,this._downloadAllClick.bind(this)).on(`click.kendoChat`,`[${H.retryButton}]`,this._retryButtonClick.bind(this)),this._attachDragToScrollEvents()}_attachDragToScrollEvents(){this._dragHandler=M.createDragToScrollHandler(this.element,{namespace:`.kendoChat.chatViewDrag`,captureElement:this.element,delegateSelector:`.${V.suggestionsScroll}, .${V.cardDeck}`}),this._dragHandler.attach()}_getScrollableElementFromButton(e){let t=e.closest(`.${V.suggestionScrollWrap}, .${V.cardDeckScrollWrap}`);return t.hasClass(V.cardDeckScrollWrap)?t.children(`.`+V.cardDeck):t.find(`.`+V.suggestionsScroll)}_retryButtonClick(e){e.preventDefault(),e.stopPropagation();let t=$(e.currentTarget),n=t.attr(`data-uid`),r=t.closest(`.`+V.message),i=this._getMessageFromElement(r);this.trigger(U.resendMessage,{message:i,uid:n})}_attachmentActionClick(e){e.preventDefault(),e.stopPropagation();let t=$(e.currentTarget),n=Number(t.attr(`data-attachment-index`)),r=Number(t.attr(`data-action-index`)),i=t.closest(`.`+V.message),a=this._getMessageFromElement(i),o=a?.attachments?.[n]?.actions?.[r];o&&this.trigger(U.executeAction,{action:o,message:a})}_getMessageFromElement(e){let t=e.attr(`data-uid`);return t?this.context.dataManager.getMessageByUid(t):null}renderMessage(e){this._messageRenderer.renderMessage(e)}_initMessageToolbar(e,t){let n=this.options,r=t??n.messageToolbarActions;if(!r||!r.length||!e.length){e.remove();return}new ft(e,{items:r,dir:n.dir,messages:n.messages,resizable:!1}).bind(`execute`,e=>this.trigger(U.messageToolbarExecute,e))}_initFileMenus(e,t){let n=this.options.fileActions,r=e.find(`[${H.fileMenuButton}]`);if(t===!1||!n?.length||!e.length){r.remove();return}r.each((e,t)=>{let r=$(t);r.data(`kendoDropDownButton`)||new pt(r,{items:n}).bind(`execute`,e=>this.trigger(U.fileMenuExecute,e))})}dataItem(e){let t=e&&e.data(`uid`);return t?this.context.dataManager.getMessageByUid(t)||e.data(`messageData`)||null:e?.data(`messageData`)||null}fileDataItem(e,t){let n=t&&t.data(`uid`);return n?this.context.dataManager.getFileByUid(e,n):null}getReplyMessage(e){if(!e?.replyToId)return null;let t=this.context.dataManager.getMessageById(e.replyToId);return t&&(t.isOwnMessage=String(t.authorId)===String(this.options.authorId)),t}renderSuggestedActions(){this._suggestionRenderer.renderSuggestedActions()}clearMessages(){this.list.find(`.`+V.messageGroup).remove(),this.list.find(`.`+V.timestamp).remove(),this._suggestionRenderer.removeSuggestedActions()}removeMessage(e){let t=this.list.find(`.`+V.message+`[data-uid="${G.encode(e)}"]`);if(!t.length)return!1;let n=t.closest(`.`+V.messageGroup);return n.find(`.`+V.message).length===1?n.remove():t.remove(),!0}scrollToBottom(){this._scrollManager.scrollToBottom()}isNearBottom(){return this._scrollManager.isNearBottom()}scrollToMessage(e){return this._scrollManager.scrollToMessage(e)}scrollIncomingMessage(e){return this._scrollManager.scrollIncomingMessage(e)}hasMessage(e){return e?this.list.find(`.`+V.message+`[data-uid="${G.encode(e)}"]`).length>0:!1}updateSeparator(){this._scrollManager.updateSeparator()}refreshScrollState(){this._scrollManager.refreshState()}refreshDataManager(e){this.context.dataManager=e}showNoData(e){this.list.html(e),this.list.addClass(V.messageListContentEmpty)}hideNoData(){this.list.empty(),this.list.removeClass(V.messageListContentEmpty)}hasMessages(){return this.list.children(`.`+V.messageGroup).length>0}_listClick(e){let t=$(e.target);t.hasClass(V.message)||t.parents(`.`+V.message).length||this._clearSelection(t)}_suggestionClick(e){let t=$(e.currentTarget);t.length&&this.trigger(U.suggestedActionClick,{text:t.text()})}_messageClick(e){let t=$(e.target),n=t.closest(`[${H.bubbleExpandableIndicator}]`);if(this._allowMessageClick(t))return;if(this._clearSelection(t),n.length){let e=n.closest(`.`+V.bubble),t=e.hasClass(V.expanded);e.toggleClass(V.expanded,!t),n.html(kendo.ui.icon({icon:t?z.chevronDown:z.chevronUp})),this.trigger(U.expandableToggle,{indicator:n,isExpanded:!t});return}let r=$(e.currentTarget);r.find(`.`+V.bubble).addClass(V.selected),this._toggleOnFocusMessageTime(r,!0)}_allowMessageClick(e){let t=[`[${H.attachmentActionButton}]`,`[${H.fileMenuButton}]`,`.`+V.messageToolbar,`.`+V.typingIndicator,`.`+V.downloadButton].join(`, `);return e.closest(t).length>0||e.children(t).length>0||e.is(t)}_clearSelection(e){let t=this.element.find(`.`+V.selected);e.closest(`[${H.bubbleExpandableIndicator}]`).length||(this._hideOnFocusMessageTimes(),t.each((e,t)=>{$(t).removeClass(V.selected)}))}_leftScrollButtonClick(e){e.preventDefault();let t=$(e.currentTarget),n=this._getScrollableElementFromButton(t),r=this.options.dir===`rtl`;if(!n.length)return;let i=M.scrollByDelta(n,r?200:-200);t.siblings(`[${H.rightScrollButton}]`).removeClass(V.disabled),i.atStart&&t.addClass(V.disabled)}_rightScrollButtonClick(e){e.preventDefault();let t=$(e.currentTarget),n=this._getScrollableElementFromButton(t),r=this.options.dir===`rtl`;if(!n.length)return;let i=M.scrollByDelta(n,r?-200:200);t.siblings(`[${H.leftScrollButton}]`).removeClass(V.disabled),i.atEnd&&t.addClass(V.disabled)}_downloadAllClick(e){let t=$(e.currentTarget).closest(`.`+V.message);t.length&&this.trigger(U.downloadAllFiles,{messageElement:t})}destroy(){super.destroy(),this._scrollManager.destroy(),this._dragHandler&&this._dragHandler.destroy(),this.element.find(`[data-role='button']`).each(function(){let e=$(this).data(`kendoChatFileMenu`);e&&e.destroy()}),this.element.empty(),this.element.off(qe),this.list=null}},on=class{syncPageSize(e,t){if(!e||!t||typeof t.pageSize!=`function`)return 20;let n=Number(t.pageSize());return(!Number.isFinite(n)||n<1)&&(n=20,t.pageSize(n)),Math.max(1,n)}getLatestRange(e,t){let n=t;return{startIndex:Math.max(0,n-e),endIndex:n}}getTargetRange(e,t,n){if(n<=t)return{startIndex:0,endIndex:n};let r=Math.max(0,e-Math.floor(t/2)),i=Math.min(n,r+t);return r=Math.max(0,i-t),{startIndex:r,endIndex:i}}isLatestRenderedRange(e,t){return e===t}hasRenderedLatestMessage(e,t){return this.isLatestRenderedRange(e,t)}},sn=class{constructor(e){this.context=e}requestLatestRemoteStartupRange(){this.context.beginLatestRemoteStartup(),this._requestLatestRange(0,this.context.getPageSize(),`scroll-to-bottom`,{scrollToBottom:!0})}prepareLatestMessages(){if(!this.context.isEndlessScrollEnabled())return;let e=this.context.getTotalCount();if(!e)return;let t=this.context.getLatestRange(e);if(this.context.isRemoteEndlessScroll()&&!this.context.isRangeLoaded(t.startIndex,t.endIndex)){this._requestLatestRange(t.startIndex,t.endIndex,`scroll-to-bottom`,{scrollToBottom:!0});return}if(!this.context.isLatestRenderedRange(e)){this.context.renderRange(t.startIndex,t.endIndex,{scrollToBottom:!0});return}this.context.scrollToBottom(),this.context.refreshScrollState()}navigateToReferencedMessage(e,t,n){if(n?.uid&&this.context.scrollToMessage(n.uid)||!this.context.isEndlessScrollEnabled())return;let r=this.context.getMessageIndexById(e);if(r<0){if(!this.context.isRemoteEndlessScroll())return;this._requestLatestRange(0,this.context.getPageSize(),`reference-jump`,{targetMessageId:e});return}let i=this.context.getTargetRange(r,this.context.getTotalCount());this.context.renderRange(i.startIndex,i.endIndex,{scrollToMessageUid:n?.uid||t?.uid})}loadOlderMessages(){let e=this.context.getRenderedRange();if(this.context.isRemoteEndlessScroll()){let e=this.context.getLoadedRange();if(e.startIndex<=0){this.context.updateEndlessState();return}let t=this.context.getPageSize();this._requestAdjacentRange(Math.max(0,e.startIndex-t),e.startIndex,`older`,`prepend`,`older`);return}if(e.startIndex>0){let t=this.context.getPageSize();this.context.prependLocalRange(Math.max(0,e.startIndex-t),e.startIndex);return}this.context.updateEndlessState()}loadNewerMessages(){let e=this.context.getRenderedRange(),t=this.context.getTotalCount();if(this.context.isRemoteEndlessScroll()){let e=this.context.getLoadedRange();if(e.endIndex>=t){this.context.updateEndlessState();return}let n=this.context.getPageSize();this._requestAdjacentRange(e.endIndex,Math.min(t,e.endIndex+n),`newer`,`append`,`newer`);return}if(e.endIndex>=t){this.context.updateEndlessState();return}let n=this.context.getPageSize();this.context.appendLocalRange(e.endIndex,Math.min(t,e.endIndex+n))}_requestLatestRange(e,t,n,r={}){this.context.requestRemoteRange(this._createRequest(e,t,`latest`,n,`replace`,`all`,r))}_requestAdjacentRange(e,t,n,r,i){this.context.requestRemoteRange(this._createRequest(e,t,n,`edge-scroll`,r,i))}_createRequest(e,t,n,r,i,a,o={}){return{startIndex:e,endIndex:t,direction:n,reason:r,mode:i,loadingState:a,...o}}};let cn=`.kendoPromptBox`,Y={SINGLE:`single`,MULTI:`multi`,AUTO:`auto`},ln={send:`paper-plane`,stop:`stop`,attachment:`paperclip`},X={promptBox:`k-prompt-box`,promptBoxContent:`k-prompt-box-content`,promptBoxHeader:`k-prompt-box-header`,promptBoxAffix:`k-prompt-box-affix`,promptBoxTextarea:`k-prompt-box-textarea`,promptBoxInput:`k-prompt-box-input`,promptBoxSingleline:`k-prompt-box-singleline`,promptBoxMultiline:`k-prompt-box-multiline`,input:`k-input`,inputInner:`k-input-inner`,disabled:`k-disabled`,hidden:`k-hidden`,focus:`k-focus`,generating:`k-generating`,active:`k-active`,speechToTextButton:`k-speech-to-text-button`,fileSelectButton:`k-file-select-button`,fileBoxWrapper:`k-file-box-wrapper`,fileBoxWrapperScrollableStart:`k-file-box-wrapper-scrollable-start`,filesScroll:`k-files-scroll`,fileBox:`k-file-box`,fileInfo:`k-file-info`,fileName:`k-file-name`,fileSize:`k-file-size`,spacer:`k-spacer`},Z={sendButton:`ref-promptbox-send-button`,fileSelectButton:`ref-promptbox-file-select-button`,speechToTextButton:`ref-promptbox-speech-to-text-button`,fileInput:`ref-promptbox-file-input`,attachmentsHost:`ref-promptbox-attachments-host`,attachmentRemoveButton:`ref-promptbox-attachment-remove-button`,input:`ref-promptbox-input`,header:`ref-promptbox-header`,startAffix:`ref-promptbox-start-affix`,endAffix:`ref-promptbox-end-affix`,topAffix:`ref-promptbox-top-affix`,affixSpacer:`ref-promptbox-affix-spacer`},Q={valueChange:`valueChange`,input:`input`,promptAction:`promptAction`,fileSelect:`fileSelect`,fileRemove:`fileRemove`,speechToTextClick:`speechToTextClick`,speechToTextStart:`speechToTextStart`,speechToTextEnd:`speechToTextEnd`,speechToTextError:`speechToTextError`,speechToTextResult:`speechToTextResult`,focus:`focus`,blur:`blur`,inputFocus:`inputFocus`,inputBlur:`inputBlur`,multilineStateChange:`multilineStateChange`},un=` data-promptbox-built-in="true"`,dn=(e,t=!1)=>{let n=``;if(e&&(n=e()),!n&&!t)return``;let r=n?``:` ${X.hidden}`;return`<div class="${X.promptBoxHeader}${r}" ${Z.header}><div ${Z.attachmentsHost}></div>${n}</div>`},fn=e=>e?e():``,pn=(e,t=!0,n)=>{let r=t?``:` ${X.disabled}`,i={icon:n?.icon||`arrow-up`,size:n?.size||`small`,rounded:n?.rounded||`full`};return n?.fillMode&&(i.fillMode=n.fillMode),n?.themeColor&&(i.themeColor=n.themeColor),kendo.html.renderButton(`<button title="${e.actionButton}" aria-label="${e.actionButton}" aria-live="polite" class="${r}" ${Z.sendButton}${un} type="button"></button>`,i)},mn=(e,t,n,r,i=!0,a)=>{let o=n?` multiple`:``,s=t?` accept="${t}"`:``,c=i?``:` disabled`,l=i?``:` aria-disabled="true"`,u=i?``:` ${X.disabled}`,d=r?.text||a?.fileSelectButton||`Attach file`,f={icon:r?.icon||ln.attachment,fillMode:r?.fillMode||`clear`,size:r?.size||`small`,rounded:r?.rounded||`full`};return r?.themeColor&&(f.themeColor=r.themeColor),`${kendo.html.renderButton(`<button title="${d}" aria-label="${d}" class="${u}" ${Z.fileSelectButton}${un} type="button"${c}${l}></button>`,f)}<input type="file" id="${e}" class="${X.hidden}" ${Z.fileInput}${o}${s} />`},hn=e=>`<button class="${X.speechToTextButton}" ${Z.speechToTextButton}${un} type="button"></button>`,gn=e=>e?.settings?._renderAffixLocation===`start`?`start`:`end`,_n=(e,t)=>{if(!t)return``;let n=t.enable!==!1;return mn(t.fileInputId,t.accept,t.multiple,t.settings,n,e)},vn=(e,t=``)=>{let n=`${t}${fn(e)}`.trim();return n?`<div class="${X.promptBoxAffix}" ${Z.startAffix}>${n}</div>`:``},yn=(e,t,n=!0,r,i,a)=>{let o=fn(r),s=gn(i)===`end`?_n(e,i):``,c=n?hn(a?.speechToTextButtonSettings):``,l=t?pn(e,!0,a?.actionButtonSettings):``;return`${o}${s}${c}${l}`.trim()?`<div class="${X.promptBoxAffix}" ${Z.endAffix}>
${o}
${s}
${c}
${l}
</div>`:``},bn=(e,t,n=!0,r,i,a,o)=>{let s=fn(r),c=fn(i),l=_n(e,a),u=n?hn(o?.speechToTextButtonSettings):``,d=t?pn(e,!0,o?.actionButtonSettings):``,f=gn(a),p=f===`start`?l:``,m=f===`end`?l:``,h=`${p}${s}`.trim(),g=!!h;return`<div class="${X.promptBoxAffix}" ${Z.endAffix}>
${h}
${g?`<div class="${X.spacer}" ${Z.affixSpacer}></div>`:``}
${c}
${m}
${u}
${d}
</div>`},xn=e=>{let t=fn(e);return t?`<div class="${X.promptBoxAffix}" ${Z.topAffix}>${t}</div>`:``},Sn=(e,t,n,r,i=!0,a={})=>{let{affixConfig:o={},fileSelectButtonConfig:s,buttonSettingsConfig:c}=a,l=dn(e,!!s),u=r===Y.MULTI?xn(o.topAffixTemplate):``,d=r===Y.MULTI,f=!d&&gn(s)===`start`?_n(t,s):``,p=d?``:vn(o.startAffixTemplate,f),m=d?bn(t,n,i,o.startAffixTemplate,o.endAffixTemplate,s,c):yn(t,n,i,o.endAffixTemplate,s,c);return`${l}
<div class="${X.promptBoxContent}">
${u}
${p}
<span ${Z.input}></span>
${m}
</div>`};var Cn=class{constructor(e){this.context=e}applyInitial(){let e=this.context.getOptions();this.context.getInputElement().attr(`aria-label`,e.messages?.messageBoxTitle||`Prompt input`),e.enable||this.context.wrapper.attr(`aria-disabled`,`true`),e.readonly&&this.updateInputAccessibility()}updateInputAccessibility(){let e=this.context.getOptions(),t=this.context.getInputElement();t&&(t.attr(`aria-label`,e.messages?.messageBoxTitle||`Prompt input`),e.readonly?t.attr(`aria-readonly`,`true`):t.removeAttr(`aria-readonly`),e.enable?t.removeAttr(`aria-disabled`):t.attr(`aria-disabled`,`true`))}updateWrapper(e){e.disabled!==void 0&&(e.disabled?this.context.wrapper.attr(`aria-disabled`,`true`):this.context.wrapper.removeAttr(`aria-disabled`))}},wn=class{constructor(e){this.context=e}getSendButton(){return this.context.wrapper.find(`[${Z.sendButton}]`)}setLoading(e){let t=this.getSendButton(),n=this.context.getMessages(),r=this.context.getSettings();if(e){t.addClass(`${X.generating} ${X.active}`),t.attr(`title`,n.actionButtonLoading),t.attr(`aria-label`,n.actionButtonLoading);let e=t.find(`.k-icon, .k-svg-icon`);if(e.length){let t=r?.loadingIcon||`stop`;kendo.ui.icon(e,{icon:t})}}else{t.removeClass(`${X.generating} ${X.active}`),t.attr(`title`,n.actionButton),t.attr(`aria-label`,n.actionButton);let e=t.find(`.k-icon, .k-svg-icon`);if(e.length){let t=r?.icon||`arrow-up`;kendo.ui.icon(e,{icon:t})}}this.updateState()}updateState(){let e=this.getSendButton();if(this.context.isDisabled()){e.addClass(X.disabled);return}if(this.context.isLoading()){e.removeClass(X.disabled);return}this.context.hasContent()?e.removeClass(X.disabled):e.addClass(X.disabled)}updateMessages(){let e=this.getSendButton(),t=this.context.getMessages();this.context.isLoading()?(e.attr(`title`,t.actionButtonLoading),e.attr(`aria-label`,t.actionButtonLoading)):(e.attr(`title`,t.actionButton),e.attr(`aria-label`,t.actionButton))}},Tn=class{constructor(e){this.instance=null,this.context=e}init(){let e=this.context.getSpeechToTextButtonOption();if(e===!1)return;let t=this.context.wrapper.find(`[${Z.speechToTextButton}], .${X.speechToTextButton}`).first();if(!t.length)return;let n={fillMode:`flat`,size:`small`,rounded:`full`,enable:!0},r=typeof e==`object`&&e?e:{},i=r.enable!==!1,a={...n,...r,messages:{start:`Start listening`,stop:`Stop listening`,...r.messages},start:e=>this.context.callbacks.onStart(e),end:e=>this.context.callbacks.onEnd(e),result:e=>this.context.callbacks.onResult(e),error:e=>this.context.callbacks.onError(e)};this.instance=new kendo.ui.SpeechToTextButton(t,a),i||this.instance.enable(!1)}enable(e){this.instance&&this.instance.enable(e)}destroy(){this.instance&&=(this.instance.destroy(),null)}},En=class{constructor(e){this.files=[],this._dragHandler=null,this.context=e}initUpload(){let e=this.context.getOptions();if(!this.showFileSelectButton(e))return;let t=this.context.wrapper.find(`[${Z.fileInput}]`);if(t.length===0)return;let n=this.getFileSelectButtonSettings(e)?.multiple!==!1,r=new kendo.ui.Upload(t,{multiple:n,async:!1,uniqueFileUids:!0,select:this.onUploadSelect.bind(this)});r?.wrapper?.addClass(X.hidden),this.uploadInstance=r}getFiles(){return[...this.files]}setFiles(e){this.files=[...e],this.renderAttachments(),this.context.callbacks.onFilesChanged()}clearFiles(){this.files=[],this.renderAttachments(),this.context.callbacks.onFilesChanged()}hasFiles(){return this.files.length>0}handleFileSelectClick(){let e=this.context.getOptions(),t=this.getFileSelectButtonSettings(e);if(!e.enable||e.readonly||t?.enable===!1)return;let n=this.uploadInstance?.element?.[0]||this.context.wrapper.find(`[${Z.fileInput}]`)[0];n&&typeof n.click==`function`&&n.click()}removeAttachmentByUid(e){let t=this.files.find(t=>this.getFileUid(t)===e),n=this.files.filter(t=>this.getFileUid(t)!==e);n.length!==this.files.length&&(this.files=n,this.renderAttachments(),this.context.callbacks.onFilesChanged(),t&&this.context.callbacks.onFileRemove(t,[...this.files]))}renderAttachments(){this._destroyDragHandler();let e=this.context.getOptions(),t=this.context.wrapper.find(`[${Z.header}]`),n=this.context.wrapper.find(`[${Z.attachmentsHost}]`);if(n.length===0)return;if(!this.files.length){n.empty(),e.headerTemplate||t.addClass(X.hidden);return}if(t.removeClass(X.hidden),e._filesTemplate){n.html(e._filesTemplate(this.files)),this._attachDragToScroll();return}let r=`<ul class="${X.fileBoxWrapper} ${X.fileBoxWrapperScrollableStart}">`;r+=`<div class="${X.filesScroll}">`;for(let e=0;e<this.files.length;e++){let t=this.files[e],n=t?.rawFile||t,i=this.getFileUid(t),a=n?.name||t?.name||``,o=n?.size||t?.size||0,s=a.lastIndexOf(`.`)>-1?a.substring(a.lastIndexOf(`.`)).toLowerCase():``,c=At.getFileGroup(s,!0),l=At.getFileSizeMessage(o),u=kendo.ui.icon({icon:c,size:`xlarge`}),d=kendo.html.renderButton(`<button type="button" ${Z.attachmentRemoveButton} data-uid="${G.encode(i)}" aria-label="Remove attachment" title="Remove attachment"></button>`,{icon:`x-circle`,fillMode:`flat`});r+=`<li class="${X.fileBox}">`,r+=u,r+=`<div class="${X.fileInfo}">`,r+=`<span class="${X.fileName}">${G.encode(a)}</span>`,r+=`<span class="${X.fileSize}">${G.encode(l)}</span>`,r+=`</div>`,r+=d,r+=`</li>`}r+=`</div></ul>`,n.html(r),this._attachDragToScroll()}_attachDragToScroll(){let e=this.context.wrapper.find(`[${Z.attachmentsHost}]`).find(`.`+X.filesScroll);e.length&&(this._dragHandler=M.createDragToScrollHandler(e,{namespace:`.kendoPromptBox.promptBoxFileDrag`,captureElement:this.context.wrapper}),this._dragHandler.attach())}_destroyDragHandler(){this._dragHandler&&=(this._dragHandler.destroy(),null)}destroy(){this._destroyDragHandler(),this.uploadInstance&&=(this.uploadInstance.destroy(),null)}onUploadSelect(e){e.preventDefault();let t=e.files,n=this.context.getOptions(),r=this.getFileSelectButtonSettings(n),i=this.validateFiles(t,r);i.length>0&&(this.files=[...this.files,...i],this.renderAttachments(),this.context.callbacks.onFilesChanged(),this.context.callbacks.onFileSelect(i))}validateFiles(e,t){let n=[],r=t?.restrictions;for(let t=0;t<e.length;t++){let i=e[t],a=i.rawFile||i,o=!0;if(r){if(r.allowedExtensions&&r.allowedExtensions.length>0){let e=a.name.split(`.`).pop()?.toLowerCase()||``;r.allowedExtensions.map(e=>e.toLowerCase().replace(`.`,``)).includes(e)||(o=!1)}r.maxFileSize&&a.size>r.maxFileSize&&(o=!1),r.minFileSize&&a.size<r.minFileSize&&(o=!1)}o&&n.push(i)}return n}getFileUid(e){return e?(e.uid||=x.guid(),e.uid):``}showFileSelectButton(e){return e.fileSelectButton===!0||typeof e.fileSelectButton==`object`&&e.fileSelectButton!==null}getFileSelectButtonSettings(e){if(typeof e.fileSelectButton==`object`&&e.fileSelectButton!==null)return e.fileSelectButton}};let Dn={placeholder:``,actionButton:`Send prompt`,actionButtonLoading:`Stop generating`,messageBoxTitle:`Prompt input`};var On=class{constructor(e){this.inputInstance=null,this.singleRowHeight=0,this.singleLineWidth=0,this.initialHeight=0,this.minMultiRowHeight=0,this.multiline=!1,this.context=e}init(){let e=this.context.wrapper.find(`[${Z.input}]`),t=this.context.getMode(),n=this.createInputElement(t);e.replaceWith(n);let r=this.context.getOptions().value||``;r&&n.val(r),this.captureInitialDimensions(),this.attachInputEvents()}getElement(){return this.inputInstance?.element||null}getValue(){return this.inputInstance?this.inputInstance.value():``}setValue(e){this.inputInstance&&this.inputInstance.value(e),this.updateAutoResize(),this.updateMultiResize()}enable(e){this.inputInstance&&this.inputInstance.enable(e)}setReadonly(e){this.inputInstance?.element&&this.inputInstance.element.prop(`readonly`,e)}focus(){this.inputInstance&&this.inputInstance.focus()}blur(){this.inputInstance?.element&&this.inputInstance.element.blur()}isMultiline(){return this.multiline}updateAutoResize(){if(this.context.getMode()!==Y.AUTO||!this.inputInstance)return;let e=this.inputInstance.element;if(!e.is(`textarea`))return;let t=e[0];t.offsetHeight>0&&this.initialHeight<t.offsetHeight&&this.captureInitialDimensions(),this.multiline?(this.updateHeight(),this.shouldCollapse()&&(this.updateMultilineState(!1),e.css(`height`,``))):(t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)&&(this.updateMultilineState(!0),this.updateHeight())}updateMultiResize(){if(this.context.getMode()!==Y.MULTI||!this.inputInstance)return;let e=this.inputInstance.element;if(!e.is(`textarea`))return;let t=e[0],n=this.context.getOptions();t.offsetHeight>0&&this.initialHeight<t.offsetHeight&&this.captureInitialDimensions(),e.css(`overflow`,`hidden`),e.css(`height`,this.initialHeight+`px`);let r=t.scrollHeight,i=this.calculateMultiHeight(r,n.maxTextAreaHeight);i===n.maxTextAreaHeight&&e.css(`overflow`,``),e.css(`height`,i+`px`)}updatePlaceholder(){let e=this.context.getOptions(),t=$.extend({},Dn,e.messages),n=this.resolvePlaceholder(e,t);this.inputInstance?.element&&this.inputInstance.element.attr(`placeholder`,n)}destroy(){this.inputInstance&&=(this.inputInstance.element.off(cn),this.inputInstance.destroy(),null)}createInputElement(e){let t=this.context.getOptions(),n=$.extend({},Dn,t.messages),r=t.title?`title="${t.title}"`:``,i=t.readonly?`readonly`:``,a=this.resolvePlaceholder(t,n),o;if(e===Y.SINGLE)o=$(`<input type="text" class="${X.promptBoxInput} ${X.inputInner}" placeholder="${a}" autocomplete="off" ${r} ${i} />`),this.inputInstance={element:o,value:e=>{if(e===void 0)return o.val();o.val(e)},enable:e=>{o.prop(`disabled`,!e)},focus:()=>o.trigger(`focus`),destroy:()=>{}};else{let n=e===Y.AUTO?1:t.rows||1;o=$(`<textarea class="${X.promptBoxTextarea} ${X.inputInner}" placeholder="${a}" rows="${n}" aria-multiline="true" ${r} ${i}></textarea>`),t.maxTextAreaHeight&&(o.css(`max-height`,t.maxTextAreaHeight+`px`),o.css(`overflow-y`,`auto`)),this.inputInstance={element:o,value:e=>{if(e===void 0)return o.val();o.val(e)},enable:e=>{o.prop(`disabled`,!e)},focus:()=>o.trigger(`focus`),destroy:()=>{}}}return o}resolvePlaceholder(e,t){return(this.context.isPlaceholderExplicit?this.context.isPlaceholderExplicit():e.placeholder!==void 0)?e.placeholder??``:t.placeholder}captureInitialDimensions(){if(this.context.getMode()===Y.SINGLE||!this.inputInstance)return;let e=this.inputInstance.element;if(!e.is(`textarea`))return;let t=e[0],n=window.getComputedStyle(t),r=parseFloat(n.lineHeight)||20,i=parseFloat(n.paddingTop)||0,a=parseFloat(n.paddingBottom)||0,o=this.context.getOptions().rows||1;this.singleRowHeight=r+i+a,this.initialHeight=t.offsetHeight||this.singleRowHeight,this.singleLineWidth=t.offsetWidth,this.minMultiRowHeight=r*o+i+a}shouldCollapse(){if(!this.inputInstance||this.singleLineWidth<=0)return!1;let e=this.inputInstance.element;if(!e.is(`textarea`))return!1;let t=e[0],n=t.style.height;e.css({overflow:`hidden`,width:this.singleLineWidth+`px`,whiteSpace:`nowrap`,height:this.initialHeight+`px`});let r=t.scrollWidth<=this.singleLineWidth&&t.scrollHeight<=this.initialHeight;return e.css({overflow:``,width:``,whiteSpace:``}),n?e.css(`height`,n):e.css(`height`,``),r}updateHeight(){let e=this.context.getOptions();if(!this.inputInstance)return;let t=this.inputInstance.element;if(!t.is(`textarea`))return;let n=t[0];t.css(`overflow`,`hidden`),t.css(`height`,this.initialHeight+`px`);let r=n.scrollHeight,i=e.maxTextAreaHeight?Math.min(r,e.maxTextAreaHeight):r;i===e.maxTextAreaHeight&&t.css(`overflow`,``),t.css(`height`,i+`px`)}calculateMultiHeight(e,t){return t&&e>t?t:Math.max(this.minMultiRowHeight,e)}updateMultilineState(e){if(this.context.getMode()!==Y.AUTO||this.multiline===e)return;let t=this.multiline;this.multiline=e,e?this.context.wrapper.addClass(X.promptBoxMultiline):this.context.wrapper.removeClass(X.promptBoxMultiline),this.context.callbacks.onMultilineStateChange(e,t)}attachInputEvents(){if(!this.inputInstance)return;let e=this.inputInstance.element;e.on(`input.kendoPromptBox`,()=>{this.updateAutoResize(),this.updateMultiResize(),this.context.callbacks.onInput()}),e.on(`keydown.kendoPromptBox`,e=>{this.context.callbacks.onKeyDown(e)}),e.on(`focus.kendoPromptBox`,()=>{this.context.callbacks.onFocus()}),e.on(`blur.kendoPromptBox`,()=>{this.context.callbacks.onBlur()})}};let kn=`[data-promptbox-built-in="true"]`,An={placeholder:``,actionButton:`Send prompt`,actionButtonLoading:`Stop generating`,messageBoxTitle:`Prompt input`,fileSelectButton:`Attach file`};var jn=class e extends L{static{this.options={name:`PromptBox`,prefix:``,mode:Y.AUTO,placeholder:``,value:``,enable:!0,readonly:!1,title:``,fillMode:void 0,maxTextAreaHeight:void 0,rows:1,headerTemplate:null,loading:!1,actionButton:null,fileSelectButton:!1,speechToTextButton:!0,startAffixTemplate:null,endAffixTemplate:null,topAffixTemplate:null,messages:An}}constructor(t,n){super(t,$.extend(!0,{},e.options,n)),this.events=[Q.valueChange,Q.input,Q.promptAction,Q.fileSelect,Q.fileRemove,Q.speechToTextClick,Q.speechToTextStart,Q.speechToTextEnd,Q.speechToTextError,Q.speechToTextResult,Q.focus,Q.blur,Q.inputFocus,Q.inputBlur,Q.multilineStateChange],this._value=``,this._loading=!1,this._readonly=!1,this._hasFocus=!1,this._fileInputId=``,this._isPlaceholderExplicit=!1,this._isPlaceholderExplicit=!!n&&Object.prototype.hasOwnProperty.call(n,`placeholder`)&&n.placeholder!==void 0,this._value=this.options.value||``,this._loading=this.options.loading||!1,this._fileInputId=`promptbox_file_`+x.guid(),this._initWrapper(),this._initInputManager(),this._initSpeechHandler(),this._initFileHandler(),this._attachEvents(),this.fileHandler.renderAttachments(),this._initAccessibilityManager(),this._initActionButtonManager(),this.bind(this.events,this.options),this.options.enable||this.enable(!1),this.options.readonly&&this.readonly(!0),this._value&&this._getMode()===Y.AUTO&&this.inputManager.updateAutoResize(),this._loading?this.actionButtonManager.setLoading(!0):this.actionButtonManager.updateState()}value(e){if(e===void 0)return this._value;this._value=e,this.inputManager.setValue(e),this.actionButtonManager.updateState()}enable(e=!0){let t=this.options;t.enable=e,e?(this._readonly=!1,t.readonly=!1,this.inputManager.setReadonly(!1),this.wrapper.removeClass(X.disabled)):this.wrapper.addClass(X.disabled),this.inputManager.enable(e),this.speechHandler.enable(e),this._updateFileSelectButtonState(),this.actionButtonManager.updateState(),this.accessibilityManager.updateWrapper({disabled:!e}),this.accessibilityManager.updateInputAccessibility()}readonly(e){if(e===void 0)return this._readonly;this._readonly=e;let t=this.options;t.readonly=e,this.inputManager.setReadonly(e),this.accessibilityManager.updateInputAccessibility(),this.actionButtonManager.updateState(),this.speechHandler.enable(!e),this._updateFileSelectButtonState()}loading(e){if(e===void 0)return this._loading;this._loading=e,this.accessibilityManager.updateWrapper({loading:e}),this.actionButtonManager.setLoading(e)}focus(){this.inputManager.focus()}blur(){this.inputManager.blur()}files(e){if(e===void 0)return this.fileHandler.getFiles();this.fileHandler.setFiles(e)}clearFiles(){this.fileHandler.clearFiles()}destroy(){this._detachEvents(),this._destroyCollaborators(),super.destroy()}_destroyCollaborators(){this.fileHandler.destroy(),this.speechHandler.destroy(),this.inputManager.destroy()}setOptions(e){if(Object.prototype.hasOwnProperty.call(e,`placeholder`)&&(this._isPlaceholderExplicit=e.placeholder!==void 0),e.headerTemplate!==void 0||e.startAffixTemplate!==void 0||e.endAffixTemplate!==void 0||e.topAffixTemplate!==void 0||e.actionButton!==void 0||e.actionButtonSettings!==void 0||e.fileSelectButton!==void 0||e.speechToTextButton!==void 0||e.mode!==void 0){let t=this._value,n=this._loading,r=this.options.attachments,i=this.fileHandler.getFiles();this._detachEvents(),this._destroyCollaborators(),super.setOptions(e),this.wrapper.remove(),this._initWrapper(),this._initInputManager(),this._initSpeechHandler(),this._initFileHandler(),this._attachEvents(),i.length>0&&this.fileHandler.setFiles(i),this._initAccessibilityManager(),this._initActionButtonManager(),t&&this.value(t),n&&this.loading(!0),r&&(this.options.attachments=r,this.fileHandler.renderAttachments());return}super.setOptions(e),(e.placeholder!==void 0||e.messages?.placeholder!==void 0)&&this.inputManager.updatePlaceholder(),(e.messages?.actionButton!==void 0||e.messages?.actionButtonLoading!==void 0)&&this.actionButtonManager.updateMessages(),e.enable!==void 0&&this.enable(e.enable),e.readonly!==void 0&&this.readonly(e.readonly),e.loading!==void 0&&this.loading(e.loading)}_initInputManager(){this.inputManager=new On({wrapper:this.wrapper,getOptions:()=>this.options,isPlaceholderExplicit:()=>this._isPlaceholderExplicit,getMode:()=>this._getMode(),callbacks:{onInput:()=>this._handleInput(),onKeyDown:e=>this._handleKeyDown(e),onFocus:()=>this.trigger(Q.inputFocus),onBlur:()=>this.trigger(Q.inputBlur),onMultilineStateChange:(e,t)=>{this._handleAffixReorganization(e),this.trigger(Q.multilineStateChange,{isMultiline:e,wasMultiline:t})}}}),this.inputManager.init()}_handleAffixReorganization(e){let t=this.wrapper.find(`[${Z.startAffix}]`).first(),n=this.wrapper.find(`[${Z.endAffix}]`).first();if(!(!t.length||!n.length)){if(e){if(t.hasClass(X.hidden))return;let e=t.contents().detach();if(!e.length)return;t.addClass(X.hidden),n.prepend($(`<div class="${X.spacer}" ${Z.affixSpacer}></div>`)),n.prepend(e)}else{let e=n.children(`[${Z.affixSpacer}]`).first();if(!e.length)return;let r=e.prevAll().detach();r.length&&t.empty().append(r),t.removeClass(X.hidden),e.remove()}this._syncFileSelectSpacer()}}_initSpeechHandler(){this.speechHandler=new Tn({wrapper:this.wrapper,getSpeechToTextButtonOption:()=>this.options.speechToTextButton,callbacks:{onStart:e=>this.trigger(Q.speechToTextStart,e),onEnd:e=>this.trigger(Q.speechToTextEnd,e),onResult:e=>{let t=e.alternatives?.[0]?.transcript||``;if(t){let e=this._value||``,n=e+(e?` `:``)+t;this.value(n)}this.trigger(Q.speechToTextResult,{...e,transcript:t})},onError:e=>this.trigger(Q.speechToTextError,e)}}),this.speechHandler.init()}_initFileHandler(){this.fileHandler=new En({wrapper:this.wrapper,getOptions:()=>this.options,callbacks:{onFilesChanged:()=>this.actionButtonManager.updateState(),onFileSelect:e=>this.trigger(Q.fileSelect,{files:e}),onFileRemove:(e,t)=>this.trigger(Q.fileRemove,{file:e,files:t})}}),this.fileHandler.initUpload()}_initAccessibilityManager(){this.accessibilityManager=new Cn({wrapper:this.wrapper,getOptions:()=>this.options,getInputElement:()=>this.inputManager.getElement()}),this.accessibilityManager.applyInitial()}_initActionButtonManager(){this.actionButtonManager=new wn({wrapper:this.wrapper,getMessages:()=>this._getMessages(),getSettings:()=>this.options.actionButton,isDisabled:()=>{let e=this.options,t=!e.enable,n=e.readonly,r=e.actionButton?.enable===!1;return t||n||r},isLoading:()=>this._loading,hasContent:()=>!!this._value?.trim()||this.fileHandler.hasFiles()})}_getMode(){return this.options.mode||Y.AUTO}_getMessages(){let e=this.options,t=e.actionButton,n=typeof e.fileSelectButton==`object`?e.fileSelectButton:null,r=$.extend({},An,e.messages);return t?.text&&(r.actionButton=t.text),t?.loadingText&&(r.actionButtonLoading=t.loadingText),n?.text&&(r.fileSelectButton=n.text),r}_showActionButton(){return!0}_showSpeechToTextButton(){let e=this.options;return e.speechToTextButton===!0||e.speechToTextButton===null||e.speechToTextButton===void 0||typeof e.speechToTextButton==`object`&&e.speechToTextButton!==null}_showFileSelectButton(){let e=this.options;return e.fileSelectButton===!0||typeof e.fileSelectButton==`object`&&e.fileSelectButton!==null}_updateFileSelectButtonState(){let e=this.options,t=this.wrapper.find(`[${Z.fileSelectButton}]`);if(!t.length)return;let n=this._getFileSelectButtonSettings();!e.enable||e.readonly||n?.enable===!1?(t.addClass(X.disabled),t.attr(`aria-disabled`,`true`)):(t.removeClass(X.disabled),t.removeAttr(`aria-disabled`))}_getFileSelectButtonSettings(){let e=this.options;if(typeof e.fileSelectButton==`object`&&e.fileSelectButton!==null)return e.fileSelectButton}_initWrapper(){let e=this.options,t=this._getMessages(),n=this._getMode(),r=``;n===Y.SINGLE?r=` ${X.promptBoxSingleline}`:n===Y.MULTI&&(r=` ${X.promptBoxMultiline}`);let i=this._getAppearanceClasses(),a={affixConfig:{startAffixTemplate:e.startAffixTemplate,endAffixTemplate:e.endAffixTemplate,topAffixTemplate:e.topAffixTemplate},fileSelectButtonConfig:this._getFileSelectButtonConfig(),buttonSettingsConfig:this._getButtonSettingsConfig()},o=Sn(e.headerTemplate,t,this._showActionButton(),n,this._showSpeechToTextButton(),a);this.wrapper=this.element.wrap(`<div class="${X.input}${i} ${X.promptBox}${r}"></div>`).parent(),this.wrapper.prepend(o),this._adoptCustomAffixRefs(),this._syncFileSelectSpacer(),this.element.addClass(X.hidden),this.wrapper.after(this.element)}_adoptCustomAffixRefs(){this._removeBuiltInDuplicate(this.wrapper.find(`[${Z.startAffix}]`).first(),Z.fileSelectButton),this._removeBuiltInDuplicate(this.wrapper.find(`[${Z.startAffix}]`).first(),Z.sendButton),this._removeBuiltInDuplicate(this.wrapper.find(`[${Z.startAffix}]`).first(),Z.speechToTextButton),this._removeBuiltInDuplicate(this.wrapper.find(`[${Z.endAffix}]`).first(),Z.fileSelectButton),this._removeBuiltInDuplicate(this.wrapper.find(`[${Z.endAffix}]`).first(),Z.sendButton),this._removeBuiltInDuplicate(this.wrapper.find(`[${Z.endAffix}]`).first(),Z.speechToTextButton)}_removeBuiltInDuplicate(e,t){if(!e?.length)return;let n=e.find(`[${t}]`);n.not(kn).length&&n.filter(kn).remove()}_syncFileSelectSpacer(){let e=this._getFileSelectButtonSettings(),t=this.wrapper.find(`[${Z.endAffix}]`).first();if(!t.length||(t.children(`.k-spacer[data-promptbox-role="file-spacer"]`).remove(),!e?.showSpacer||e._renderAffixLocation===`start`))return;let n=t.find(`[${Z.fileSelectButton}]`),r=n.not(kn).first(),i=r.length?r:n.first(),a=t.find(`[${Z.speechToTextButton}], [${Z.sendButton}]`).length>0;!i.length||!i.parent().is(t)||!a||i.after(`<div class="${X.spacer}" data-promptbox-role="file-spacer"></div>`)}_getAppearanceClasses(){let e=this.options;return e.fillMode?` k-input-${e.fillMode}`:``}_getFileSelectButtonConfig(){if(!this._showFileSelectButton())return;let e=this._getFileSelectButtonSettings(),t=e?.accept;return!t&&e?.restrictions?.allowedExtensions?.length&&(t=e.restrictions.allowedExtensions.map(e=>e.startsWith(`.`)?e:`.${e}`).join(`,`)),{enable:e?.enable,fileInputId:this._fileInputId,accept:t,multiple:e?.multiple,showSpacer:e?.showSpacer,settings:e}}_getButtonSettingsConfig(){let e=this.options,t=e.speechToTextButton,n=typeof t==`object`&&t?t:void 0;return{actionButtonSettings:e.actionButton||void 0,fileSelectButtonSettings:this._getFileSelectButtonSettings(),speechToTextButtonSettings:n}}isMultiline(){return this.inputManager.isMultiline()}_attachEvents(){this.wrapper.on(`click.kendoPromptBox`,`[${Z.sendButton}]`,e=>{e.preventDefault(),this._handleSend()}),this.wrapper.on(`click.kendoPromptBox`,`[${Z.fileSelectButton}]`,e=>{e.preventDefault(),this.fileHandler.handleFileSelectClick()}),this.wrapper.on(`click.kendoPromptBox`,`[${Z.attachmentRemoveButton}]`,e=>{e.preventDefault();let t=e.currentTarget.getAttribute(`data-uid`);t&&this.fileHandler.removeAttachmentByUid(t)}),this.wrapper.on(`focusin.kendoPromptBox`,e=>{this._handleFocusIn(e)}),this.wrapper.on(`focusout.kendoPromptBox`,e=>{this._handleFocusOut(e)})}_detachEvents(){this.wrapper.off(cn)}_handleFocusIn(e){this._hasFocus||(this._hasFocus=!0,this.wrapper.addClass(X.focus),this.trigger(Q.focus))}_handleFocusOut(e){let t=e.relatedTarget;!(t&&this.wrapper[0].contains(t))&&this._hasFocus&&(this._hasFocus=!1,this.wrapper.removeClass(X.focus),this.trigger(Q.blur))}_handleSend(){let e=this.options;if(!e.enable||e.readonly||e.actionButton?.enable===!1)return;if(this._loading){this.trigger(Q.promptAction,{actionType:`stop`}),this.loading(!1);return}let t=this._value?.trim(),n=this.fileHandler.hasFiles();if(!t&&!n)return;let r={actionType:`send`,value:t||``,files:this.fileHandler.getFiles()};this.trigger(Q.promptAction,r),this.value(``),this.clearFiles(),this.focus()}_handleInput(){let e=this._value;this._value=this.inputManager.getValue(),this.actionButtonManager.updateState(),this.trigger(Q.input,{value:this._value}),e!==this._value&&this.trigger(Q.valueChange,{oldValue:e,newValue:this._value})}_handleKeyDown(e){let t=this._getMode();if(e.key===`Enter`||e.which===13||e.keyCode===13){if(e.shiftKey&&t!==Y.SINGLE)return;e.preventDefault(),this._loading||this._handleSend()}}};let Mn=oe;Mn.registerPrefix(`PromptBox`,`k-input-`),Mn.registerValues(`PromptBox`,[{prop:`fillMode`,values:Mn.fillModeValues}]);var Nn=class e extends L{static{this.options={name:`MessageBox`}}get textAreaInstance(){return this.promptBoxInstance||this.customInput}constructor(t,n,r){super(t,$.extend(!0,{},e.options,n)),this.events=[U.sendMessage,U.input,U.suggestionClick,U.replyMessageCloseButtonClick,U.fileSelect,U.fileRemove],this._generating=!1,this._typing=!1,this.customFiles=[],this._dragHandler=null,this.context=r,this.chatElement=r.chatElement,this._generating=!1,this._initWrapper(),this._initPromptBox(),this._attachEvents(),this._typing=!1}_initWrapper(){let e=this.options;if(this.wrapper=$(`<div class="${V.messageBoxWrapper}"></div>`),e.suggestions.length){let t;if(e.suggestionsTemplate)t=e.suggestionsTemplate(e.suggestions);else{let n=this._getSuggestionsLayoutMode(e);t=Zt(e.suggestions,n,e.dir===`rtl`)}this.suggestions=this.wrapper.append(t)}this.wrapper.find(`[${H.leftScrollButton}]`).addClass(V.disabled),this.chatElement.append(this.wrapper)}_getSuggestionsLayoutMode(e){return e.suggestionsLayoutMode?e.suggestionsLayoutMode:e.suggestionsScrollable?R.SCROLLBUTTONS:R.SCROLL}_initPromptBox(){let e=this.options;if(e.messageBoxTemplate){this._initCustomMessageBox(e);return}let t=e.messages||{},n=e.messageBox||{},r=e.actionButton,i=e.fileAttachment!==!1,a=n.mode||`auto`,o=n.maxTextAreaHeight,s=n.rows||1,c=n.startAffixTemplate,l=n.endAffixTemplate,u=n.topAffixTemplate,d=this._getActionButtonSettings(r),f=this._getSpeechToTextSettings(e),p=this._getFileAttachmentSettings(e,i),m=new jn(this.element,{mode:a,maxTextAreaHeight:o,rows:s,_filesTemplate:this._getInternalFilesTemplate(e),startAffixTemplate:c,endAffixTemplate:l,topAffixTemplate:u,placeholder:t.placeholder,speechToTextButton:f,actionButton:d,fileSelectButton:p,messages:{placeholder:t.placeholder,actionButton:t.sendButton||r?.text||t.actionButton,actionButtonLoading:t.sendButtonLoading||r?.loadingText||r?.stopText||t.actionButtonLoading||t.stopButton},input:this._input.bind(this),promptAction:this._promptBoxAction.bind(this),fileSelect:this._promptBoxFileSelect.bind(this),fileRemove:this._promptBoxFileRemove.bind(this)});m.wrapper.appendTo(this.wrapper),this.promptBoxInstance=m}_initCustomMessageBox(e){let t=e.messages||{},n=$(`<div class="${V.messageBox}"></div>`),r=e.messageBoxTemplate();if(n.append(r),this.wrapper.append(n),this.customMessageBox=n,this.customInput=this._findCustomInput(n),this.customSendButton=this._findCustomSendButton(n),this.customInput?.length&&(this.customInput.attr(`aria-label`,t.messageBoxLabel),!this.customInput.attr(`placeholder`)&&t.placeholder&&this.customInput.attr(`placeholder`,t.placeholder)),this.customSendButton?.length){let e=t.sendButton||`Send message`;this._customSendButtonHtml=this.customSendButton.html(),this._customSendButtonText=this.customSendButton.text(),this.customSendButton.attr(`aria-label`)||this.customSendButton.attr(`aria-label`,e),this.customSendButton.attr(`title`)||this.customSendButton.attr(`title`,e)}}_getActionButtonSettings(e){return{enable:!0,icon:e?.icon,loadingIcon:e?.loadingIcon||e?.stopIcon,fillMode:e?.fillMode,rounded:e?.rounded,size:e?.size,themeColor:e?.themeColor,text:e?.text,loadingText:e?.loadingText||e?.stopText}}_getSpeechToTextSettings(e){return e.speechToText===!1?!1:x.isObject(e.speechToText)?e.speechToText:null}_getFileAttachmentSettings(e,t){return t?x.isObject(e.fileAttachment)?{showSpacer:!0,_renderAffixLocation:`start`,...e.fileAttachment}:{showSpacer:!0,_renderAffixLocation:`start`}:!1}_getInternalFilesTemplate(e){return!e.filesTemplate||e.filesTemplate===Pt?null:t=>e.filesTemplate(t,!1,e.messages,!0)}_promptBoxAction(e){e.preventDefault();let t=e.actionType,n=e.value||``,r=e.files||[];if(t===`stop`){this.trigger(U.sendMessage,{generating:!0});return}if(!n.length&&!r.length)return;let i={message:{text:n,files:r}};this.trigger(U.sendMessage,i)}_promptBoxFileSelect(e){let t=this.promptBoxInstance?.files()||[];this.trigger(U.fileSelect,{files:t})}_promptBoxFileRemove(e){this.trigger(U.fileRemove,{file:e.file,files:e.files})}_attachEvents(){this.wrapper.on(`click.kendoChat`,`[${H.replyMessageCloseButton}]`,this._replyMessageCloseButtonClick.bind(this)).on(`click.kendoChat`,`.`+V.suggestion,this._suggestionClick.bind(this)).on(`click.kendoChat`,`[${H.leftScrollButton}]`,this._leftScrollButtonClick.bind(this)).on(`click.kendoChat`,`[${H.rightScrollButton}]`,this._rightScrollButtonClick.bind(this)).on(`click.kendoChat`,this._getCustomSendButtonSelector(),this._customSendButtonClick.bind(this)).on(`input.kendoChat`,this._getCustomInputSelector(),this._customInputChange.bind(this)).on(`keydown.kendoChat`,this._getCustomInputSelector(),this._customInputKeyDown.bind(this)).on(`change.kendoChat`,`.${V.messageBox} input[type='file']`,this._customFileInputChange.bind(this)),this._attachDragToScrollEvents()}_attachDragToScrollEvents(){let e=this.wrapper.find(`.`+V.suggestionsScroll);e.length&&(this._dragHandler=M.createDragToScrollHandler(e,{namespace:`.kendoChat.chatMessageBoxDrag`,captureElement:this.chatElement}),this._dragHandler.attach())}getFiles(){return this._usesCustomTemplate()?[...this.customFiles]:this.promptBoxInstance?.files()||[]}setFiles(e){if(this._usesCustomTemplate()){this.customFiles=[...e];return}this.promptBoxInstance?.files(e)}clearFiles(){if(this._usesCustomTemplate()){this.customFiles=[],this.customMessageBox?.find(`input[type='file']`).val(``);return}this.promptBoxInstance?.clearFiles()}_getPrefixContainer(){let e=this._getMessageBoxContainer(),t=e.find(`.k-prompt-box-header`);return t.length===0&&(t=$(`<div class="k-prompt-box-header" ref-promptbox-header><div ref-promptbox-attachments-host></div></div>`),e.prepend(t)),t}setReplyMessage(e,t){let n=this.options,r=this.getReplyMessageContainer(),i=n.messageReferenceTemplate({text:e.text,files:e.files,isOwnMessage:t,renderCloseButton:!0,renderFileMenuButton:!1}),a=this._getPrefixContainer();a.removeClass(`k-hidden`),r.length===0?a.prepend(i):r.replaceWith(i)}removeReplyMessage(){let e=this.getReplyMessageContainer();e.length>0&&(e.remove(),this._updateHeaderVisibility())}_updateHeaderVisibility(){let e=this._getPrefixContainer(),t=this.getFiles(),n=t&&t.length>0,r=this.getReplyMessageContainer().length>0;!n&&!r&&e.addClass(`k-hidden`)}getReplyMessageContainer(){return this._getPrefixContainer().find(`[${H.messageReferenceReplyWrapper}]`)}loading(e){if(e===void 0)return this._generating;if(this._generating=e,this._usesCustomTemplate()){this._setCustomLoadingState(e);return}this.promptBoxInstance.loading(e)}value(e){if(e===void 0)return this._getInputValue();this._setInputValue(e)}_input(e){let t=e?.value??this._getInputValue();this.trigger(U.input,{value:t})}_replyMessageCloseButtonClick(e){e.preventDefault(),this.trigger(U.replyMessageCloseButtonClick)}_suggestionClick(e){e.preventDefault();let t=this.options,n=$(e.target).closest(`.`+V.suggestion).text();n.length&&(this.trigger(U.suggestionClick,{text:n,behavior:t.suggestionsBehavior||`send`}),t.suggestionsBehavior===`insert`&&this._setInputValue(n))}_getInputValue(){return this._usesCustomTemplate()?this.customInput?.val()||``:this.promptBoxInstance.value()}_setInputValue(e){if(this._usesCustomTemplate()){this.customInput?.val(e);return}this.promptBoxInstance.value(e)}_usesCustomTemplate(){return!!this.customMessageBox?.length}_getMessageBoxContainer(){return this._usesCustomTemplate()?this.customMessageBox:this.promptBoxInstance.wrapper}_findCustomInput(e){return e.find(`textarea, input:not([type='hidden']):not([type='file']):not([type='button']):not([type='submit']):not([type='reset']):not([type='checkbox']):not([type='radio'])`).first()}_findCustomSendButton(e){return e.find(`[${H.sendButton}]`).first()}_getCustomInputSelector(){return`.${V.messageBox} textarea, .${V.messageBox} input:not([type='hidden']):not([type='file']):not([type='button']):not([type='submit']):not([type='reset']):not([type='checkbox']):not([type='radio'])`}_getCustomSendButtonSelector(){return`.${V.messageBox} [${H.sendButton}]`}_customSendButtonClick(e){if(!this._usesCustomTemplate())return;let t=$(e.currentTarget);this.customSendButton?.length&&!t.is(this.customSendButton)||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation?.(),this._sendCustomTemplateMessage())}_customInputChange(e){this._usesCustomTemplate()&&this._input({value:$(e.currentTarget).val()||``})}_customInputKeyDown(e){!this._usesCustomTemplate()||e.key!==`Enter`&&e.which!==13&&e.keyCode!==13||this._generating||!this.customSendButton?.length||e.shiftKey&&$(e.currentTarget).is(`textarea`)||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation?.(),this._sendCustomTemplateMessage())}_customFileInputChange(e){if(!this._usesCustomTemplate())return;let t=e.currentTarget,n=Array.from(t.files||[]).map(e=>({uid:x.guid(),name:e.name,size:e.size,extension:e.name.lastIndexOf(`.`)>-1?e.name.substring(e.name.lastIndexOf(`.`)).toLowerCase():``,rawFile:e}));n.length&&(t.multiple?this.customFiles=[...this.customFiles,...n]:this.customFiles=n,this.trigger(U.fileSelect,{files:[...this.customFiles]}))}_sendCustomTemplateMessage(){if(this._generating){this.trigger(U.sendMessage,{generating:!0});return}let e=this._getInputValue().trim(),t=this.getFiles();!e.length&&!t.length||(this.trigger(U.sendMessage,{message:{text:e,files:t}}),this._setInputValue(``),this.clearFiles(),this.customInput?.trigger(`focus`))}_setCustomLoadingState(e){let t=this.options.messages||{};if(!this.customSendButton?.length)return;let n=e?t.sendButtonLoading||`Stop`:t.sendButton||`Send message`;if(this.customSendButton.toggleClass(V.generating,e),this.customSendButton.attr(`aria-label`,n),this.customSendButton.attr(`title`,n),e){this._customSendButtonText?.trim()&&this.customSendButton.text(n);return}this._customSendButtonText?.trim()?this.customSendButton.text(this._customSendButtonText):this._customSendButtonHtml!==void 0&&this.customSendButton.html(this._customSendButtonHtml)}_leftScrollButtonClick(e){e.preventDefault();let t=$(e.currentTarget),n=this.wrapper.find(`.${V.suggestionsScroll}`),r=this.options.dir===`rtl`,i=M.scrollByDelta(n,r?200:-200);this.wrapper.find(`[${H.rightScrollButton}]`).removeClass(V.disabled),i.atStart&&t.addClass(V.disabled)}_rightScrollButtonClick(e){e.preventDefault();let t=$(e.currentTarget),n=this.wrapper.find(`.${V.suggestionsScroll}`),r=this.options.dir===`rtl`,i=M.scrollByDelta(n,r?-200:200);this.wrapper.find(`[${H.leftScrollButton}]`).removeClass(V.disabled),i.atEnd&&t.addClass(V.disabled)}destroy(){this._dragHandler&&this._dragHandler.destroy(),this.promptBoxInstance&&this.promptBoxInstance.destroy(),this.customFiles=[],this.wrapper.remove()}},Pn=class e extends L{static{this.options={name:`ChatMessageMenu`,filter:`.${V.chatBubble}`,dataSource:[],keyboardAlignToAnchor:!0}}constructor(t,n){n=$.extend(!0,{},e.options,n),n.dataSource=e.normalizeActions(n.dataSource||[]),super(t,n),this.create(),this.attachEvents()}create(){this.menu=new kendo.ui.ContextMenu(this.element,this.options)}attachEvents(){this.menu.bind(`select`,this.onSelect.bind(this)).bind(`open`,this.onOpen.bind(this)).bind(`close`,this.onClose.bind(this))}static normalizeActions(e){return(e||[]).map(e=>({...e,attr:{...e.attr||{},"data-command":e.name.toLowerCase()}}))}setActions(t){let n=e.normalizeActions(t);this.options.dataSource=n,this.menu.setOptions({dataSource:n})}onSelect(e){let t=$(e.item),n=$(e.target).closest(`.`+V.message),r=t.data(`command`);r&&this.executeCommand(r,t,n)}onOpen(e){let t=!0,n=$(e.target),r=$(e.event?.target).length?$(e.event.target):n,i=n.closest(`.`+V.messageRemoved).length>0,a=n.find(`.`+V.typingIndicator).length>0,o=r.closest(`[${H.fileMenuButton}]`).length>0,s=n.closest(`.`+V.message);(i||a||o||!s.length)&&(e.preventDefault(),t=!1),n.toggleClass(V.active,t),this.trigger(`open`,{message:s})&&(e.preventDefault(),n.removeClass(V.active))}onClose(e){let t=$(e.target),n=t.closest(`.`+V.message);t.removeClass(V.active),this.trigger(`close`,{message:n})}executeCommand(e,t,n){this.trigger(`execute`,{type:e,item:t,message:n})}toggleDeleteVisibility(e){let t=this.element.find(`[data-command='delete']`);t.length&&t.toggleClass(V.hidden,!e)}destroy(){this.menu&&(this.menu.destroy(),this.menu=null,this.element.remove())}},Fn=class{constructor(e){this._pendingRemoteRangeRequests={},this._activeLatestRecoveryRequestKey=null,this._queuedLatestRecoveryRequest=null,this.context=e}reset(){this._pendingRemoteRangeRequests={},this._activeLatestRecoveryRequestKey=null,this._queuedLatestRecoveryRequest=null}requestRange(e){let t=this._prepareRequest(e);if(!t){this.context.updateEndlessState();return}if(this._mergePendingRequest(t)||this._queueLatestRecoveryRequestIfNeeded(t))return;let n=this._activateRequest(t);this._dispatchRequest(n)}_prepareRequest(e){let t=this._normalizeRequestOptions(e);return t?{key:this._getRemoteRangeRequestKey(t),options:t}:null}_normalizeRequestOptions(e){let t=this._normalizeRequestedRange(e);return t?{...e,startIndex:t.startIndex,endIndex:t.endIndex}:null}_normalizeRequestedRange(e){let t=this.context.getTotalCount(),n=this._isLatestScrollToBottomRequest(e),r=Math.max(0,e.startIndex),i=Math.max(r,e.endIndex);if(n){let e=Math.max(1,i-r);return{startIndex:r,endIndex:r+e}}return r=Math.max(0,Math.min(r,t)),i=Math.max(r,Math.min(i,t)),i<=r?null:{startIndex:r,endIndex:i}}_mergePendingRequest(e){let t=this._pendingRemoteRangeRequests[e.key];return t?(t.options.scrollToBottom=t.options.scrollToBottom||!!e.options.scrollToBottom,t.options.loadingState=this._mergeRemoteLoadingState(t.options.loadingState,e.options.loadingState),this.context.setRemoteLoadingState(t.options.loadingState),!0):!1}_queueLatestRecoveryRequestIfNeeded(e){return!this._isLatestScrollToBottomRequest(e.options)||!this._activeLatestRecoveryRequestKey||this._activeLatestRecoveryRequestKey===e.key?!1:(this._queueLatestRecoveryRequest(e.options),this.context.setRemoteLoadingState(this._queuedLatestRecoveryRequest.loadingState),!0)}_activateRequest(e){let t={key:e.key,options:e.options};return this._pendingRemoteRangeRequests[t.key]=t,this._isLatestScrollToBottomRequest(t.options)&&(this._activeLatestRecoveryRequestKey=t.key),this.context.setRemoteLoadingState(t.options.loadingState),t}_dispatchRequest(e){let t=this.context.getDataSource()?.transport?.read;if(typeof t!=`function`){this._handleRequestError(e);return}t({data:this._createTransportRequestData(e.options),success:t=>{this._handleRequestSuccess(e,t)},error:()=>{this._handleRequestError(e)}})}_createTransportRequestData(e){return this._buildRemoteRequestData(e.startIndex,e.endIndex,e.direction,e.reason,e.targetMessageId)}_handleRequestSuccess(e,t){let n=this.context.getDataSource(),r=this._createRequestLifecycle(e);if(!n){r.finalize();return}try{let i=this._parseResponse(n,t,e.options);this._resolveMissingReplyReferences(e.options,i.models,()=>{this._applyResponse(e.options,i),r.finalize()},r.fail)}catch(t){throw this._pendingRemoteRangeRequests[e.key]&&r.finalize(),t}}_createRequestLifecycle(e){return{finalize:()=>{this._completeRequest(e)},fail:t=>{throw this._completeRequest(e),this._normalizeReferenceResolverError(t)}}}_parseResponse(e,t,n){let r=e.reader.parse(t),i=e.reader.data(r)||[],a=Number(e.reader.total(r)),o=this._extractRemoteResponseTotal(a),s=this._createRemoteModels(i),c=this._extractRemoteResponseRange(r,s.length,o,n);return this._validateReferenceJumpResponse(n,s),this._validateAdjacentRangeResponse(n,c,s),{range:c,models:s,totalCount:o}}_applyResponse(e,t){this.context.applyResponse(e,t)}_handleRequestError(e){this.context.updateEndlessState(),this._completeRequest(e)}_completeRequest(e){let t=this._clearRequestState(e.key);this.context.completeEndlessLoad(e.options.loadingState,()=>{this._resumeQueuedLatestRecoveryRequest(t)})}_clearRequestState(e){let t=this._consumeQueuedLatestRecoveryRequest(e);return delete this._pendingRemoteRangeRequests[e],this._activeLatestRecoveryRequestKey===e&&(this._activeLatestRecoveryRequestKey=null),t}_resumeQueuedLatestRecoveryRequest(e){e&&this.context.canRequestRange()&&this.requestRange(e)}_mergeRemoteLoadingState(e,t){return e===`all`||t===`all`||e!==t?`all`:e}_getRemoteRangeRequestKey(e){return[e.startIndex,e.endIndex,e.direction,e.reason,e.mode,e.targetMessageId==null?``:String(e.targetMessageId)].join(`|`)}_isLatestScrollToBottomRequest(e){return e.direction===`latest`&&e.reason===`scroll-to-bottom`&&e.mode===`replace`}_isReferenceJumpRequest(e){return e.reason===`reference-jump`&&e.mode===`replace`&&e.targetMessageId!=null}_isLatestRecoveryRequest(e){if(!this._isLatestScrollToBottomRequest(e))return!1;let t=this.context.getRenderedRange();return t.endIndex>t.startIndex}_queueLatestRecoveryRequest(e){if(!this._queuedLatestRecoveryRequest){this._queuedLatestRecoveryRequest={...e};return}this._queuedLatestRecoveryRequest={...e,scrollToBottom:this._queuedLatestRecoveryRequest.scrollToBottom||!!e.scrollToBottom,loadingState:this._mergeRemoteLoadingState(this._queuedLatestRecoveryRequest.loadingState,e.loadingState)}}_consumeQueuedLatestRecoveryRequest(e){if(this._activeLatestRecoveryRequestKey!==e||!this._queuedLatestRecoveryRequest)return null;let t=this._queuedLatestRecoveryRequest;return this._queuedLatestRecoveryRequest=null,t}_buildRemoteRequestData(e,t,n,r,i){let a=this.context.getTotalCount(),o=Math.max(0,e),s=Math.max(o,Math.min(t,a||t)),c=Math.max(1,s-o),l=a?Math.max(1,Math.ceil(Math.max(a-s,0)/c)+1):1;return n===`latest`&&r===`scroll-to-bottom`?{page:l,pageSize:c,skip:o,take:c,direction:n,reason:r,intent:`latest`,targetMessageId:i}:r===`reference-jump`?{page:1,pageSize:c,skip:0,take:c,direction:n,reason:r,targetMessageId:i}:{page:l,pageSize:c,skip:o,take:c,startIndex:o,endIndex:s,direction:n,reason:r,targetMessageId:i}}_extractRemoteResponseTotal(e){if(!Number.isInteger(e)||e<0)throw Error(`The Chat endless response must include a valid total value.`);return e}_extractRemoteResponseRange(e,t,n,r){let i=Number(e?.startIndex),a=Number(e?.endIndex);if(!Number.isInteger(i)||!Number.isInteger(a))throw Error(`The Chat endless response must include valid startIndex and endIndex values.`);let o=i,s=a;if(o<0||s<o||s>n)throw Error(`The Chat endless response returned an invalid range window.`);if(s-o!==t)throw Error(`The Chat endless response count does not match the returned range.`);if(this._isLatestScrollToBottomRequest(r)&&s!==n&&(!this._isLatestRecoveryRequest(r)||o!==r.startIndex||s!==r.endIndex))throw Error(`The Chat endless latest response must end at total.`);return{startIndex:o,endIndex:s}}_validateReferenceJumpResponse(e,t){if(!this._isReferenceJumpRequest(e))return;let n=String(e.targetMessageId);if(!t.some(e=>String(e?.id)===n))throw Error(`The Chat endless jump response must contain the requested targetMessageId.`)}_validateAdjacentRangeResponse(e,t,n){if(e.mode!==`prepend`&&e.mode!==`append`)return;if(t.startIndex!==e.startIndex||t.endIndex!==e.endIndex)throw Error(`The Chat endless response must match the requested adjacent range.`);let r=this.context.getLoadedRange();if(e.mode===`prepend`&&t.endIndex!==r.startIndex||e.mode===`append`&&t.startIndex!==r.endIndex)throw Error(`The Chat endless response must match the requested adjacent range.`);let i=this.context.getLoadedMessagesInRange(r.startIndex,r.endIndex),a=new Set(i.map(e=>String(e.id)));if(n.some(e=>a.has(String(e.id))))throw Error(`The Chat endless response must match the requested adjacent range.`)}_createRemoteModels(e){let t=this.context.getDataSource()?.reader?.model;return e.map(e=>t?new t(e):e)}_collectMissingReplyTargetIds(e,t){let n=[],r=new Set,i=new Set;if(e.mode!==`replace`){let e=this.context.getLoadedRange();this.context.getLoadedMessagesInRange(e.startIndex,e.endIndex).forEach(e=>{e?.id!=null&&i.add(String(e.id))})}return t.forEach(e=>{e?.id!=null&&i.add(String(e.id))}),t.forEach(e=>{let t=e?.replyToId;if(!t)return;let a=String(t);i.has(a)||this.context.getReferenceMessageById(t)||r.has(a)||(r.add(a),n.push(t))}),n}_resolveMissingReplyReferences(e,t,n,r){let i=this._collectMissingReplyTargetIds(e,t);if(!i.length){n();return}let a=this.context.getChatOptions().referenceResolver;if(typeof a!=`function`){r(Error(`The Chat referenceResolver option is required to render off-batch reply previews.`));return}let o=!1;a({value:i,success:e=>{if(!o){o=!0;try{let t=this._mapResolvedReferenceMessages(i,e);this.context.cacheResolvedReferenceMessages(t),n()}catch(e){r(e)}}},error:e=>{o||(o=!0,r(e))}})}_mapResolvedReferenceMessages(e,t){let n={};return(Array.isArray(t)?t:[]).forEach(e=>{this._validateResolvedReferenceMessage(e);let t=String(e.id);n[t]||(n[t]=e)}),e.map(e=>{let t=n[String(e)];if(!t)throw Error(`The Chat referenceResolver must resolve every requested id.`);return t})}_validateResolvedReferenceMessage(e){let t=e?.id!==void 0&&e?.id!==null&&String(e.id)!==``,n=e?.authorId!==void 0&&e?.authorId!==null&&String(e.authorId)!==``,r=typeof e?.text==`string`&&e.text.length>0,i=!!e?.files&&typeof e.files.length==`number`&&e.files.length>0,a=e?.isDeleted===!0;if(!t||!n||!r&&!i&&!a)throw Error(`The Chat referenceResolver must return items with id, authorId, and enough data to render the reply preview.`)}_normalizeReferenceResolverError(e){if(e instanceof Error)return e;if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return Error(`${e}`);if(typeof e==`symbol`)return Error(e.description||`The Chat referenceResolver failed.`);if(typeof e==`object`&&e){if(`message`in e&&typeof e.message==`string`)return Error(e.message);try{return Error(JSON.stringify(e))}catch{return Error(`The Chat referenceResolver failed.`)}}return Error(`The Chat referenceResolver failed.`)}},In=class{constructor(e){this.context=e}commandExecute(e){let t=this.context.dataItem(e.message);if(!t)return;let n=this.context.fileDataItem(t,e.file),r=e.type;if(n){switch(r){case B.download:this.context.trigger(U.download,{files:[n],message:t});break}this.context.trigger(U.fileMenuAction,{type:r,file:n,message:t})}else switch(r){case B.reply:this.messageReply(t);break;case B.copy:this.messageCopy(t);break;case B.pin:this.messagePin(t);break;case B.delete:this.messageDelete(t);break}}contextMenuExecute(e){this.commandExecute(e);let t=this.context.dataItem(e.message),n=e.type;this.context.trigger(U.contextMenuAction,{type:n,message:t})}messageReply(e){let t=String(e.authorId)===String(this.context.getUserId());this.context.setCurrentMessageReplyId(e.id),this.context.setReplyMessage(e,t),this.context.setupAriaAttributes()}messageCopy(e){navigator&&navigator.clipboard&&navigator.clipboard.writeText(e.text)}messagePin(e){this.context.pinMessage(e)}messageDelete(e){this.context.removeMessage(e)}messageContextMenuOpen(e){let t=this.context.dataItem(e.message);if(!t)return;let n=String(t.authorId)===String(this.context.getUserId());if(!this.context.isContextMenuAllowed(n)){e.preventDefault();return}this.context.setContextMenuActions(n),this.context.toggleDeleteVisibility(n)}},Ln=class{constructor(e){this.context=e}_triggerSendMessage(e){let t=this.context;t.trigger(U.sendMessage,{message:e}),t.prepareLatestMessages(),t.postMessage(e)}_prepareLatestAndTrigger(e,t){let n=this.context;n.prepareLatestMessages(),n.trigger(e,t)}attach(){this._attachViewEvents(),this._attachMessageBoxEvents(),this._attachContextMenuEvents(),this._attachWrapperDomEvents()}_attachViewEvents(){let e=this.context;e.view.bind(`suggestedActionClick`,t=>{if(e.options.suggestionsBehavior===`insert`)e.value(t.text),e.trigger(U.suggestionClick,{text:t.text});else{let e={text:t.text,files:[]};this._triggerSendMessage(e)}}).bind(`messageToolbarExecute`,t=>{let n=e.dataItem(t.message);e.commandExecute({type:t.type,message:t.message}),e.trigger(U.toolbarAction,{type:t.type,message:n})}).bind(`fileMenuExecute`,t=>{e.commandExecute(t)}).bind(`downloadAllFiles`,t=>{let n=e.dataItem(t.messageElement);e.trigger(U.download,{files:n?.files,message:n})}).bind(`executeAction`,t=>{e.trigger(U.executeAction,t)}).bind(`resendMessage`,e=>{this._prepareLatestAndTrigger(U.resendMessage,e)}).bind(`expandableToggle`,t=>{e.accessibility.updateExpandableIndicatorAria(t.indicator,t.isExpanded)})}_attachMessageBoxEvents(){let e=this.context;e.messageBox.bind(`input`,t=>{e.trigger(U.input,{value:t.value})}).bind(`sendMessage`,t=>{let n=t.generating;if(n)e.trigger(U.sendMessage,{generating:n});else{let n={text:t.text||t.message?.text,files:t.files||t.message?.files||[]};this._triggerSendMessage(n),e.clearReplyState()}}).bind(`suggestionClick`,t=>{if(e.trigger(U.suggestionClick,{text:t.text}),t.behavior!==`insert`){let e={text:t.text,files:[]};this._triggerSendMessage(e)}}).bind(`fileSelect`,t=>{e.trigger(U.fileSelect,{files:t.files})}).bind(`fileRemove`,t=>{e.trigger(U.fileRemove,{file:t.file,files:t.files})}).bind(`replyMessageCloseButtonClick`,()=>{e.clearReplyState()})}_attachContextMenuEvents(){let e=this.context;e.messageContextMenu.bind(`execute`,e.contextMenuExecute.bind(e)).bind(`open`,e.messageContextMenuOpen.bind(e))}_attachWrapperDomEvents(){let e=this.context;e.wrapper.on(`click.kendoChat`,`[${H.pinnedMessageCloseButton}]`,()=>{e.trigger(U.unpin,{message:e.getPinnedMessage()}),e.clearPinnedMessage()}),e.wrapper.on(`click.kendoChat`,`[${H.messageReferencePinWrapper}]`,t=>{if($(t.target).closest(`[${H.pinnedMessageCloseButton}]`).length||$(t.target).is(`a`))return;t.preventDefault(),t.stopPropagation();let n=e.getPinnedMessage();n&&e.navigateToReferencedMessage(n.id)}),e.wrapper.on(`click.kendoChat`,`[${H.messageReferenceReplyWrapper}]`,t=>{if($(t.target).is(`a`))return;t.preventDefault(),t.stopPropagation();let n=$(t.currentTarget).closest(`.`+V.message),r=e.dataItem(n);r&&r.replyToId&&e.navigateToReferencedMessage(r.replyToId)}),e.wrapper.on(`keydown.kendoChat`,t=>{e.accessibility.handleKeyDown(t,e.messageBoxRef)}),e.wrapper.on(`focus${qe}`,`.${V.bubble}`,t=>{let n=$(t.target);if(!(n.find(`.${V.typingIndicator}`).length>0)&&n.attr(`data-keyboard-focus`)===`true`){let t=n.closest(`.${V.message}`),r=e.dataItem(t);r&&r.uid&&e.scrollToMessage(r.uid)}})}};let Rn=[{name:B.reply,text:`Reply`,icon:z.undo},{name:B.copy,text:`Copy`,icon:z.copy},{name:B.pin,text:`Pin`,icon:z.pin},{name:B.delete,text:`Delete`,icon:z.trash}],zn=[{name:B.download,text:`Download`,icon:z.download}],Bn={messageListLabel:`Message list`,placeholder:`Type a message...`,sendButton:`Send message`,sendButtonLoading:`Stop`,actionButton:`Send message`,actionButtonLoading:`Stop`,stopButton:`Stop`,speechToTextButton:`Toggle speech to text`,fileButton:`Attach file`,downloadAll:`Download all`,selfMessageDeleted:`You removed this message.`,otherMessageDeleted:`This message was removed by its sender.`,stopGeneration:`Stop generation`,messageBoxLabel:`Type your message here`,pinnedMessageCloseButton:`Unpin message`,replyMessageCloseButton:`Remove reply`,fileMenuButton:`File menu`,retryMessage:`Retry`};var Vn=class e extends L{static{this.options={name:`Chat`,scrollMode:`scrollable`,pageSize:20,endlessScrollDebounceDelay:150,autoAssignId:!0,autoBind:!0,allowMessageCollapse:!1,showUsername:!0,showAvatar:!0,timestampVisibility:`onFocus`,suggestionsBehavior:`send`,authorId:null,suggestionsScrollable:!1,suggestedActionsScrollable:!1,suggestionsLayoutMode:`scroll`,suggestedActionsLayoutMode:`scroll`,speechToText:!0,fileAttachment:!0,scrollToBottomButton:!0,autoScrollThreshold:`20%`,loading:!1,messageBox:{mode:`multi`,maxTextAreaHeight:110},messageToolbarActions:[],messageActions:Rn,fileActions:zn,suggestions:[],headerItems:[],dir:`ltr`,messageTimeFormat:`ddd MMM dd yyyy`,width:null,height:null,messages:Bn,messageWidthMode:`standard`,messageTemplate:null,messageGroupTemplate:Yt,messageReferenceTemplate:Ft,filesTemplate:Pt,suggestionsTemplate:null,suggestedActionsTemplate:Xt,suggestedActionsField:`suggestedActions`,timestampTemplate:null,messageStatusTemplate:null,messageStatusSettings:null,headerTemplate:null,noDataTemplate:null,messageContentTemplate:null,userStatusTemplate:null,attachmentTemplate:null,messageBoxTemplate:null,authorMessageSettings:null,receiverMessageSettings:null,actionButton:null,attachmentLayout:`list`,filesLayoutMode:`vertical`,pinnedMessages:[],referenceResolver:null,textField:`text`,authorIdField:`authorId`,authorNameField:`authorName`,authorImageUrlField:`authorImageUrl`,authorImageAltTextField:`authorImageAltText`,idField:`id`,timestampField:`timestamp`,filesField:`files`,replyToIdField:`replyToId`,isDeletedField:`isDeleted`,isPinnedField:`isPinned`,isTypingField:`isTyping`,statusField:`status`,failedField:`failed`,attachmentsField:`attachments`,attachmentLayoutField:`attachmentLayout`,skipSanitization:!1}}constructor(t,n,r){n||={},e.mergeContextMenuActions(n,e.options,`messageActions`),e.mergeContextMenuActions(n,e.options,`fileActions`),super(t,$.extend(!0,{},e.options,n)),this.currentMessageReplyId=null,this._hasHeader=!1,this._loading=!1,this._renderStartIndex=0,this._renderEndIndex=0,this._endlessPageSize=20,this._endlessRangeManager=new on,this.events=[U.sendMessage,U.suggestionClick,U.unpin,U.input,U.toolbarAction,U.fileMenuAction,U.contextMenuAction,U.download,U.fileSelect,U.fileRemove,U.executeAction,U.resendMessage,U.referencedMessageClick],this.options.messageActions=n.messageActions,this.options.fileActions=n.fileActions,r&&(this._events=r),this._init(n)}static mergeContextMenuActions(e,t,n){let r=e[n];if(Array.isArray(r)){let i=t[n]||[],a={};for(let e of i)a[e.name]={...e};e[n]=r.map(e=>e.name in a?{...a[e.name],...e}:{...e})}else e[n]=t[n]||[]}_init(e){this.currentMessageReplyId=null,this._hasHeader=!!e.headerItems?.length,this._initUser(),this._initWrapper(),this._initDataSource(),this._validateRemoteEndlessStartup(),this._initView(),e.toolbar&&x.logToConsole(`The 'toolbar' option has been deprecated.`,`warn`),this._initMessageBox(),this._initMenus(),this._initAccessibility(),this._initRemoteRangeLoader(),this._initEndlessScrollCoordinator(),this._attachEvents(),this.options.loading&&this.loading(!0),this._isEndlessScrollEnabled()&&(this.view._scrollManager._isLoadingOlder=!0),this.options.autoBind&&(this._isRemoteEndlessScroll()?this._requestLatestRemoteStartupRange():this.dataSource.fetch()),this.scrollToBottom()}_validateRemoteEndlessStartup(){if(this._isRemoteEndlessScroll()&&this.options.autoBind===!1)throw Error(`The Chat remote endless mode does not support autoBind: false.`)}_requestLatestRemoteStartupRange(){this._endlessScrollCoordinator.requestLatestRemoteStartupRange()}_initUser(){let e=this.options;if(e.authorId){e.authorId=e.authorId.toString();return}e.authorId=x.guid()}_initWrapper(){let e=this.options,t=e.height,n=e.width,r=e.headerItems,i=e.headerTemplate,a=`<div ${H.viewWrapper}></div>`;this.wrapper=this.element.addClass(V.wrapper).attr(`dir`,e.dir).append(a),(this._hasHeader||i)&&this.wrapper.prepend(en(r,i)),t&&this.wrapper.css({height:t,minHeight:t}),n&&this.wrapper.css({width:n,minWidth:n})}_initDataSource(){this._refreshHandler=this.refresh.bind(this),this._dataManager=new Ke({chatOptions:this.options}),this.dataSource=this._dataManager.getDataSource(),this._syncEndlessPageSize(),this.dataSource.bind(et,this._refreshHandler)}_syncEndlessPageSize(){let e=this.options;this._endlessPageSize=this._endlessRangeManager.syncPageSize(this._isEndlessScrollEnabled(e),this.dataSource)}_getEndlessPageSize(){return this._endlessPageSize}_unbindDataSource(){this.dataSource.unbind(et,this._refreshHandler),this._dataManager=null}_initView(){let e=$.extend(!0,{},this.options);delete e.name;let t=this.wrapper.find(`[${H.viewWrapper}]`),n={dataManager:this._dataManager};this._isEndlessScrollEnabled()&&(n.onScrollNearTop=this._loadOlderMessages.bind(this),n.onScrollNearBottom=this._loadNewerMessages.bind(this),n.onScrollToLatest=this._prepareLatestMessages.bind(this),n.isLatestRangeActive=this._isLatestRenderedRange.bind(this),n.hasLatestMessageRendered=this._hasRenderedLatestMessage.bind(this)),this.view=new an(t,e,n)}_initMessageBox(){let e=$.extend(!0,{},this.options);delete e.name,this.messageBox=new Nn($(`<textarea></textarea>`),e,{chatElement:this.wrapper})}_initMenus(){let e=this.options.messageActions;this.messageContextMenu=new Pn($(`<ul></ul>`),{dataSource:e,target:this.wrapper})}_initAccessibility(){this.accessibility=new at({wrapper:this.wrapper,getOptions:()=>this.options}),this.accessibility.setupAriaAttributes(),this.accessibility.setupBubbleTabNavigation()}_initRemoteRangeLoader(){this._remoteRangeLoader=new Fn({getDataSource:()=>this.dataSource,getChatOptions:()=>this.options,getTotalCount:()=>this._getEndlessDataCount(),getLoadedRange:()=>this._dataManager.getLoadedRange(),getRenderedRange:()=>({startIndex:this._renderStartIndex,endIndex:this._renderEndIndex}),getLoadedMessagesInRange:this._dataManager.getMessagesInRange.bind(this._dataManager),getLoadedMessageById:this._dataManager.getLoadedMessageById.bind(this._dataManager),getReferenceMessageById:this._dataManager.getAuxiliaryMessageById.bind(this._dataManager),cacheResolvedReferenceMessages:this._dataManager.cacheResolvedReferenceMessages.bind(this._dataManager),applyResponse:this._applyRemoteRangeResponse.bind(this),updateEndlessState:this._updateEndlessState.bind(this),completeEndlessLoad:this._completeEndlessLoad.bind(this),setRemoteLoadingState:this._setRemoteLoadingState.bind(this),canRequestRange:()=>!!(this.view&&this.dataSource)})}_initEndlessScrollCoordinator(){this._endlessScrollCoordinator=new sn({beginLatestRemoteStartup:this._beginLatestRemoteStartupRangeRequest.bind(this),isEndlessScrollEnabled:this._isEndlessScrollEnabled.bind(this),isRemoteEndlessScroll:this._isRemoteEndlessScroll.bind(this),getPageSize:this._getEndlessPageSize.bind(this),getTotalCount:this._getEndlessDataCount.bind(this),getRenderedRange:()=>({startIndex:this._renderStartIndex,endIndex:this._renderEndIndex}),getLoadedRange:()=>this._dataManager.getLoadedRange(),getLatestRange:this._getLatestRange.bind(this),getTargetRange:this._getTargetRange.bind(this),isLatestRenderedRange:this._isLatestRenderedRange.bind(this),isRangeLoaded:(e,t)=>this._dataManager.isRangeLoaded(e,t),getMessageIndexById:e=>this._dataManager.getMessageIndexById(e),requestRemoteRange:e=>this._remoteRangeLoader.requestRange(e),renderRange:(e,t,n={})=>this._renderEndlessRange(e,t,n),scrollToBottom:this.scrollToBottom.bind(this),refreshScrollState:()=>this.view.refreshScrollState(),scrollToMessage:this.scrollToMessage.bind(this),prependLocalRange:this._prependLocalEndlessRange.bind(this),appendLocalRange:this._appendLocalEndlessRange.bind(this),updateEndlessState:this._updateEndlessState.bind(this)})}_beginLatestRemoteStartupRangeRequest(){this.view._scrollManager._isLoadingOlder=!0,this.view._scrollManager._isLoadingNewer=!1,this.view.clearMessages()}_setRemoteLoadingState(e){this.view&&((e===`older`||e===`all`)&&(this.view._scrollManager._isLoadingOlder=!0),(e===`newer`||e===`all`)&&(this.view._scrollManager._isLoadingNewer=!0),this.view.refreshScrollState())}_applyRemoteRangeResponse(e,t){let n=this._updateRemoteRangeWindow(e.mode,t.range.startIndex,t.models,t.totalCount);e.mode===`prepend`?this._applyPrependedRemoteRange(t.range,n):e.mode===`append`?this._applyAppendedRemoteRange(t.range,n):this._applyReplacedRemoteRange(e,t.range),this._refreshPinnedState(this._dataManager.getPinnedMessage())}_updateRemoteRangeWindow(e,t,n,r){let i=n,a=this.dataSource.options.autoSync;this.dataSource.options.autoSync=!1,this.dataSource.unbind(et,this._refreshHandler);let o=this.dataSource.data();o.omitChangeEvent=!0;try{e===`replace`?(o.splice(0,o.length,...n),this._dataManager.setRemoteRangeStart(t)):e===`prepend`?(o.splice(0,0,...i),this._dataManager.setRemoteRangeStart(t)):o.splice(o.length,0,...i)}finally{o.omitChangeEvent=!1}return this.dataSource.bind(et,this._refreshHandler),this.dataSource.options.autoSync=a,this.dataSource._total=r,this.dataSource._pristineTotal=r,i}_applyPrependedRemoteRange(e,t){this.view&&t.length&&this.view._scrollManager.preserveScrollPosition(()=>{this.view._messageRenderer.prependMessages(t)}),this._renderStartIndex=Math.min(e.startIndex,this._renderStartIndex),this._renderEndIndex=Math.max(this._renderEndIndex,e.endIndex),this._updateEndlessState(),this._finalizeIncrementalEndlessRender()}_applyAppendedRemoteRange(e,t){t.forEach(e=>{this.renderMessage(e)}),this._renderEndIndex=Math.max(this._renderEndIndex,e.endIndex),this._updateEndlessState(),this._finalizeIncrementalEndlessRender()}_applyReplacedRemoteRange(e,t){let n=e.targetMessageId?this._dataManager.getLoadedMessageById(e.targetMessageId):null;this._renderEndlessRange(t.startIndex,t.endIndex,{scrollToBottom:e.scrollToBottom,scrollToMessageUid:n?.uid})}_finalizeIncrementalEndlessRender(){this.view&&(this.view.renderSuggestedActions(),this.view.updateSeparator(),this.view.refreshScrollState(),this.accessibility&&(this.accessibility.setupAriaAttributes(),this.accessibility.setupBubbleTabNavigation()))}_attachEvents(){let e=this.options;this._commandHandler=new In({getUserId:this.getUserId.bind(this),dataItem:this.dataItem.bind(this),fileDataItem:this.fileDataItem.bind(this),removeMessage:this.removeMessage.bind(this),pinMessage:e=>this._dataManager.pinMessage(e),setReplyMessage:(e,t)=>this.messageBox.setReplyMessage(e,t),setCurrentMessageReplyId:e=>{this.currentMessageReplyId=e},setupAriaAttributes:()=>this.accessibility.setupAriaAttributes(),setContextMenuActions:t=>{let n=t?e.authorMessageSettings:e.receiverMessageSettings;this.messageContextMenu.setActions(n?.messageActions??e.messageActions)},toggleDeleteVisibility:e=>this.messageContextMenu.toggleDeleteVisibility(e),isContextMenuAllowed:t=>(t?e.authorMessageSettings:e.receiverMessageSettings)?.enableContextMenuActions!==!1,trigger:this.trigger.bind(this)}),this._eventWiring=new Ln({options:this.options,wrapper:this.wrapper,view:this.view,messageBox:this.messageBox,messageContextMenu:this.messageContextMenu,value:this.value.bind(this),postMessage:this.postMessage.bind(this),clearReplyState:this.clearReplyState.bind(this),prepareLatestMessages:this._prepareLatestMessages.bind(this),commandExecute:this._commandHandler.commandExecute.bind(this._commandHandler),contextMenuExecute:this._commandHandler.contextMenuExecute.bind(this._commandHandler),messageContextMenuOpen:this._commandHandler.messageContextMenuOpen.bind(this._commandHandler),dataItem:this.dataItem.bind(this),scrollToMessage:this.scrollToMessage.bind(this),navigateToReferencedMessage:this._navigateToReferencedMessage.bind(this),clearPinnedMessage:this.clearPinnedMessage.bind(this),getPinnedMessage:()=>this._dataManager.getPinnedMessage(),getMessageById:e=>this._dataManager.getMessageById(e),trigger:this.trigger.bind(this),accessibility:this.accessibility,messageBoxRef:this.messageBox}),this._eventWiring.attach(),this.bind(this.events,this.options)}getUserId(){return this.options.authorId}value(e){if(e===void 0)return this.messageBox?.value()||``;this.messageBox&&(this.messageBox.value(e),this.trigger(U.input,{value:e}))}setOptions(t){super.setOptions(t),this.destroy();let n=new e(this.element,this.options);Object.assign(this,n)}setDataSource(e){this.dataSource&&this._unbindDataSource(),this._remoteRangeLoader.reset(),this.view.clearMessages(),this._renderStartIndex=0,this._renderEndIndex=0,this._isEndlessScrollEnabled()&&this.view._scrollManager.resetEndlessState(),this.options.dataSource=e,this._initDataSource(),this._validateRemoteEndlessStartup(),this.options.autoBind&&(this._isRemoteEndlessScroll()?this._requestLatestRemoteStartupRange():this.dataSource.fetch()),this.view&&this.view.refreshDataManager(this._dataManager)}postMessage(e){return this.currentMessageReplyId&&(typeof e==`string`&&(e={text:e}),e.replyToId=this.currentMessageReplyId),this._dataManager.postMessage(e,this.getUserId())}removeMessage(e){return this._dataManager.removeMessage(e)}updateMessage(e,t){return this._dataManager.updateMessage(e,t)}getMessageByUid(e){return this._dataManager.getMessageByUid(e)}dataItem(e){return this.view.dataItem(e)}fileDataItem(e,t){return this.view.fileDataItem(e,t)}clearMessages(){this.view.clearMessages()}renderMessage(e){this.view.renderMessage(e),this.accessibility.setupBubbleTabNavigation()}renderPinnedMessage(e){let t=String(e.authorId)===String(this.getUserId()),n=this.options,r=$(n.messageReferenceTemplate({text:e.text,files:e.files,isDeleted:e.isDeleted,isOwnMessage:t,messages:n.messages,isPinMessage:!0,renderCloseButton:!0,renderFileMenuButton:!1}));this.wrapper.find(`[${H.messageReferencePinWrapper}]`).remove();let i=this.wrapper.find(`.`+V.viewWrapper);i.length?i.prepend(r):this._hasHeader?r.insertAfter(this.wrapper.find(`.`+V.header)):this.wrapper.prepend(r),this.view._initFileMenus(r)}clearPinnedMessage(){this._dataManager.clearPinnedMessage(),this.wrapper.find(`.`+V.messagePinned).remove()}clearReplyState(){this.messageBox.removeReplyMessage(),this.currentMessageReplyId=null}scrollToBottom(){this.view.scrollToBottom()}scrollToMessage(e){return this.view.scrollToMessage(e)}_getEndlessDataCount(){return this._dataManager.getTotalCount()}_getLatestRange(e=this._getEndlessDataCount()){return this._endlessRangeManager.getLatestRange(this._getEndlessPageSize(),e)}_getTargetRange(e,t=this._getEndlessDataCount()){return this._endlessRangeManager.getTargetRange(e,this._getEndlessPageSize(),t)}_isLatestRenderedRange(e=this._getEndlessDataCount()){return this._endlessRangeManager.isLatestRenderedRange(this._renderEndIndex,e)}_hasRenderedLatestMessage(e=this._getEndlessDataCount()){return this._endlessRangeManager.hasRenderedLatestMessage(this._renderEndIndex,e)}_isEndlessScrollEnabled(e=this.options){return e.scrollMode===`endless`}_updateEndlessState(){let e=this.options;if(!this._isEndlessScrollEnabled(e)||!this.view)return;let t=this._getEndlessDataCount();this.view._scrollManager._allOlderLoaded=this._renderStartIndex<=0,this.view._scrollManager._allNewerLoaded=this._renderEndIndex>=t,this.view.refreshScrollState()}_completeEndlessLoad(e,t){requestAnimationFrame(()=>{if(!this.view){t?.();return}(e===`older`||e===`all`)&&(this.view._scrollManager._isLoadingOlder=!1),(e===`newer`||e===`all`)&&(this.view._scrollManager._isLoadingNewer=!1),this.view.refreshScrollState(),t?.()})}_renderEndlessRange(e,t,n={}){let r=this._dataManager.getMessagesInRange(e,t);this.view.clearMessages(),r.forEach(e=>{this.renderMessage(e)}),this._renderStartIndex=e,this._renderEndIndex=t,this._updateEndlessState(),this.view.renderSuggestedActions(),this.view.updateSeparator(),this.accessibility.setupAriaAttributes(),this.accessibility.setupBubbleTabNavigation(),requestAnimationFrame(()=>{this.view&&(n.scrollToBottom?this.scrollToBottom():n.scrollToMessageUid&&this.scrollToMessage(n.scrollToMessageUid),this.view.refreshScrollState())})}_prepareLatestMessages(){this._endlessScrollCoordinator.prepareLatestMessages()}_navigateToReferencedMessage(e){let t=this._dataManager.getMessageById(e),n=this._dataManager.getLoadedMessageById(e);this.trigger(U.referencedMessageClick,{id:e}),this._endlessScrollCoordinator.navigateToReferencedMessage(e,t,n)}loading(e){if(e===void 0)return this._loading;this._loading=e,this.wrapper&&this.wrapper.toggleClass(V.generating,e),this.messageBox&&this.messageBox.loading(e)}toggleSendButtonGenerating(e){this.loading(e)}refresh(e){e?.action===`add`&&this._bumpRemoteEndlessTotalForLocalAdd(e.items);let t=this._createRefreshState(e);e?.action||this._refreshFull(t),this._refreshPinnedState(t.pinnedMessage),(e?.action===`sync`||e?.action===`add`)&&this._refreshSync(t),this._finalizeRefresh()}_bumpRemoteEndlessTotalForLocalAdd(e){if(!this._isEndlessScrollEnabled()||!this._isRemoteEndlessScroll()||!e?.length)return;let t=this._dataManager.getLoadedRange().startIndex+this._dataManager.getLoadedCount();t>this.dataSource.total()&&(this.dataSource._total=t,this.dataSource._pristineTotal=t)}_createRefreshState(e){return{data:this.dataSource.data?this.dataSource.data():this.dataSource.view(),changedItems:e?.changedItems||[],pinnedMessage:this._dataManager.getPinnedMessage(),totalCount:this._getEndlessDataCount(),addedCount:e?.items?.length??0}}_refreshFull(e){if(this._refreshNoDataTemplate(e.data),this._isEndlessScrollEnabled()){this._refreshEndlessFull(e.totalCount);return}this._refreshStandardFull(e.data)}_refreshNoDataTemplate(e){let t=this.options;e.length===0&&t.noDataTemplate?this.view.showNoData(t.noDataTemplate()):t.noDataTemplate&&this.view.hideNoData()}_refreshEndlessFull(e){if(this.view._scrollManager._isLoadingOlder=!0,this.view._scrollManager._isLoadingNewer=!1,this.view.clearMessages(),e<=0){this._resetEmptyEndlessRefresh();return}if(this._isRemoteEndlessScroll()){this._refreshRemoteEndlessFull(e);return}this._refreshLocalEndlessFull(e)}_refreshRemoteEndlessFull(e){let t=this._getLatestRange(e);if(!this._dataManager.isRangeLoaded(t.startIndex,t.endIndex)){this._remoteRangeLoader.requestRange({startIndex:t.startIndex,endIndex:t.endIndex,direction:`latest`,reason:`scroll-to-bottom`,mode:`replace`,loadingState:`all`,scrollToBottom:!0});return}this._renderEndlessRange(t.startIndex,t.endIndex,{scrollToBottom:!0}),this._completeEndlessLoad(`all`)}_refreshLocalEndlessFull(e){let t=this._getLatestRange(e);this._renderEndlessRange(t.startIndex,t.endIndex,{scrollToBottom:!0}),this._completeEndlessLoad(`older`)}_resetEmptyEndlessRefresh(){this._renderStartIndex=0,this._renderEndIndex=0,this._updateEndlessState(),this.scrollToBottom(),this._completeEndlessLoad(`older`)}_refreshStandardFull(e){this.view.clearMessages(),e.forEach(e=>{this.renderMessage(e)}),this.scrollToBottom()}_refreshPinnedState(e){if(e){this.renderPinnedMessage(e);return}this.wrapper.find(`[${H.messageReferencePinWrapper}]`).remove()}_refreshSync(e){this.options.noDataTemplate&&!this.view.hasMessages()&&this.view.hideNoData();let t=e.changedItems.length?e.changedItems[0]:e.data[e.data.length-1],n=!!(t&&String(t.authorId)===String(this.getUserId())),r=this.view.isNearBottom(),i=!!(t?.uid&&this.view.hasMessage(t.uid));if(this._isEndlessScrollEnabled()){this._refreshEndlessSync(t,n,r,i,e.totalCount,e.addedCount);return}this._refreshStandardSync(t,n,r)}_refreshEndlessSync(e,t,n,r,i,a){if(!this.view.hasMessages()&&i>0){this._prepareLatestMessages();return}if(t&&i>0){this._refreshOwnEndlessSync(i);return}let o=a>0&&this._canAppendOwnEndlessSync(i);if(e&&(r||this._isLatestRenderedRange(i)||o)){this._refreshVisibleEndlessSyncMessage(e,t,n,r,i),o&&this.scrollToBottom();return}this._updateEndlessState()}_refreshOwnEndlessSync(e){if(this._isRemoteEndlessScroll()&&this._canAppendOwnEndlessSync(e)){this._dataManager.getMessagesInRange(this._renderEndIndex,e).forEach(e=>{this.renderMessage(e)}),this._renderEndIndex=e,this._updateEndlessState(),this.scrollToBottom();return}let t=this._getLatestRange(e);if(this._isRemoteEndlessScroll()&&!this._dataManager.isRangeLoaded(t.startIndex,t.endIndex)){this._prepareLatestMessages();return}this._renderEndlessRange(t.startIndex,t.endIndex,{scrollToBottom:!0})}_canAppendOwnEndlessSync(e){let t=this._dataManager.getLoadedRange();return this._renderEndIndex<e&&t.endIndex===e&&this._renderEndIndex>=t.startIndex}_refreshVisibleEndlessSyncMessage(e,t,n,r,i){this.renderMessage(e),r||(this._renderEndIndex=i),this._updateEndlessState(),!t&&n&&e.uid&&this.view.scrollIncomingMessage(e.uid)}_refreshStandardSync(e,t,n){e&&(this.renderMessage(e),t?this.scrollToBottom():n&&e.uid&&this.view.scrollIncomingMessage(e.uid))}_finalizeRefresh(){this.view.renderSuggestedActions(),this.view.updateSeparator(),this.view.refreshScrollState(),this.accessibility.setupAriaAttributes(),this.accessibility.setupBubbleTabNavigation()}_isRemoteEndlessScroll(){let e=this.options;return!!(this._isEndlessScrollEnabled(e)&&this.dataSource.options?.serverPaging)}_prependLocalEndlessRange(e,t){let n=this._dataManager.getMessagesInRange(e,t);if(!n.length){this._updateEndlessState();return}this.view._scrollManager._isLoadingOlder=!0,this.view._scrollManager.preserveScrollPosition(()=>{this.view._messageRenderer.prependMessages(n)}),this._renderStartIndex=e,this._updateEndlessState(),this._completeEndlessLoad(`older`),this.accessibility.setupAriaAttributes(),this.accessibility.setupBubbleTabNavigation()}_appendLocalEndlessRange(e,t){let n=this._dataManager.getMessagesInRange(e,t);if(!n.length){this._updateEndlessState();return}this.view._scrollManager._isLoadingNewer=!0,n.forEach(e=>{this.renderMessage(e)}),this._renderEndIndex=t,this._updateEndlessState(),this._completeEndlessLoad(`newer`),this.accessibility.setupAriaAttributes(),this.accessibility.setupBubbleTabNavigation()}_loadOlderMessages(){this._endlessScrollCoordinator.loadOlderMessages()}_loadNewerMessages(){this._endlessScrollCoordinator.loadNewerMessages()}commandExecute(e){this._commandHandler.commandExecute(e)}messageReply(e){this._commandHandler.messageReply(e)}messageCopy(e){this._commandHandler.messageCopy(e)}messagePin(e){this._commandHandler.messagePin(e)}messageDelete(e){this._commandHandler.messageDelete(e)}messageContextMenuOpen(e){this._commandHandler.messageContextMenuOpen(e)}destroy(){this._remoteRangeLoader.reset(),this.dataSource&&=(this._unbindDataSource(),null),this.view&&=(this.view.unbind(),this.view.destroy(),null),this.messageBox&&=(this.messageBox.unbind(),this.messageBox.destroy(),null),this.messageContextMenu&&this.messageContextMenu.destroy(),this.wrapper&&=(this.wrapper.off(),this.wrapper.empty(),null),super.destroy()}},Hn=class extends L{dataItems(){let e=this.dataSource;return e&&typeof e.view==`function`?e.flatView():[]}};Hn.fn=Hn.prototype;let Un=/[eE][\-+]?[0-9]+/,Wn=/\u00A0/g,Gn=/\s/g,Kn=new class{parseInt(e,t){let n=this.parseFloat(e,t);return n&&n|0}parseFloat(e,t,n){if(!e&&e!==0)return null;if(typeof e==`number`)return e;let r=e.toString(),i=K.getCulture(t).numberFormat,a=i.percent,o=i.currency,s=a.symbol,c=o.symbol,l=r.indexOf(`-`),u,d=!1;if(Un.test(r)){let e=parseFloat(r.replace(i[`.`],`.`));return isNaN(e)?null:e}if(l>0)return null;l=+(l>-1),r.indexOf(c)>-1||n&&n.toLowerCase().indexOf(`c`)>-1?(i=o,u=i.pattern[0].replace(`$`,c).split(`n`),r.indexOf(u[0])>-1&&r.indexOf(u[1])>-1&&(r=r.replace(u[0],``).replace(u[1],``),l=1)):r.indexOf(s)>-1&&(d=!0,i=a,c=s),r=r.replace(`-`,``).replace(c,``).replace(Wn,` `).split(i[`,`].replace(Wn,` `)).join(``).replace(Gn,``).replace(i[`.`],`.`);let f=parseFloat(r);return isNaN(f)?f=null:l&&(f*=-1),f&&d&&(f/=100),f}};new class{convert(e){let t=K.getCulture(e)||K.culture(),n={};return n[t.numberFormat.currency.abbr]=t.numberFormat.currency,{localeInfo:()=>this.buildLocaleInfo(t,n),parseDate:(e,n)=>Ot.parseExactDate(e,n,t),toString:(e,n)=>{let r=J.toString(e,n,t);return r==null?``:String(r)},format:(e,...t)=>J.format(e,...t)}}buildLocaleInfo(e,t){return{numbers:{localeCurrency:e.numberFormat.currency.abbr,currencies:t,symbols:{group:e.numberFormat[`,`],decimal:e.numberFormat[`.`],percentSign:e.numberFormat.percent.symbol}},calendar:{patterns:e.calendars.standard.patterns,months:{format:{wide:e.calendars.standard.months.names,abbreviated:e.calendars.standard.months.namesAbbr}},days:{format:{wide:e.calendars.standard.days.names,abbreviated:e.calendars.standard.days.namesAbbr}}}}}buildLocaleInfoAll(e,t){let n={},[r,i]=e.name.split(`-`);if(n.name=r,n.identity={language:r},i&&(n.territory=i),e.numberFormat&&(n.numbers={symbols:{decimal:e.numberFormat[`.`],group:e.numberFormat[`,`],percentSign:e.numberFormat.percent?.symbol||`%`},decimal:{patterns:e.numberFormat.pattern,groupSize:e.numberFormat.groupSize},currency:{patterns:e.numberFormat.currency?.pattern,groupSize:e.numberFormat.currency?.groupSize},percent:{patterns:e.numberFormat.percent?.pattern,groupSize:e.numberFormat.percent?.groupSize,decimals:e.numberFormat.percent?.decimals}},e.numberFormat.currency&&(n.numbers.currencies={[e.numberFormat.currency.abbr]:e.numberFormat.currency},n.numbers.localeCurrency=e.numberFormat.currency.abbr)),e.calendars&&e.calendars.standard){let t=e.calendars.standard;n.calendar={patterns:{d:t.patterns.d,D:t.patterns.D,F:t.patterns.F,g:t.patterns.g,G:t.patterns.G,m:t.patterns.m,M:t.patterns.M,s:t.patterns.s,t:t.patterns.t,T:t.patterns.T,u:t.patterns.u,y:t.patterns.y,Y:t.patterns.Y},days:{format:{wide:t.days.names,abbreviated:t.days.namesAbbr,short:t.days.namesShort},"stand-alone":{wide:t.days.names,abbreviated:t.days.namesAbbr,short:t.days.namesShort}},months:{format:{wide:t.months.names,abbreviated:t.months.namesAbbr,narrow:t.months.namesAbbr.map(e=>e.charAt(0))},"stand-alone":{wide:t.months.names,abbreviated:t.months.namesAbbr,narrow:t.months.namesAbbr.map(e=>e.charAt(0))}},dayPeriods:{format:{abbreviated:{am:t.AM[0],pm:t.PM[0]},narrow:{am:t.AM[1],pm:t.PM[1]},wide:{am:t.AM[0],pm:t.PM[0]}},"stand-alone":{abbreviated:{am:t.AM[0],pm:t.PM[0]},narrow:{am:t.AM[1],pm:t.PM[1]},wide:{am:t.AM[0],pm:t.PM[0]}}}},`firstDay`in t&&(n.firstDay=t.firstDay)}return n}};let qn=/^\w+/,Jn=/\$\{([^}]*)\}/g,Yn=/\\\}/g,Xn=/__CURLY__/g,Zn=/\\#/g,Qn=/__SHARP__/g;function $n(e,t){if(t)return`'`+e.split(`'`).join(`\\'`).split(`\\"`).join(`\\\\\\"`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/\t/g,`\\t`)+`'`;{let t=e.charAt(0),n=e.substring(1);return t===`=`?`+(`+n+`)+`:t===`:`?`+$kendoHtmlEncode(`+n+`)+`:`;`+e+`;$kendoOutput+=`}}let er=new class{constructor(){this.paramName=`data`,this.useWithBlock=!0,this.debugTemplates=!1}setDebugMode(e){this.debugTemplates=e}render(e,t){let n=``;for(let r=0;r<t.length;r++)n+=e(t[r]);return n}compile(e,t){if(typeof e==`function`)return e;let n={paramName:t?.paramName===void 0?this.paramName:t.paramName,useWithBlock:t?.useWithBlock===void 0?this.useWithBlock:t.useWithBlock},r=n.paramName,i=r.match(qn)[0],a=n.useWithBlock,o=`var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;`;o+=a?`with(`+r+`){`:``,o+=`$kendoOutput=`;let s=e.replace(Yn,`__CURLY__`).replace(Jn,`#=$kendoHtmlEncode($1)#`).replace(Xn,`}`).replace(Zn,`__SHARP__`).split(`#`);for(let e=0;e<s.length;e++)o+=$n(s[e],e%2==0);o+=a?`;}`:`;`,o+=`return $kendoOutput;`,o=o.replace(Qn,`#`);try{let e=Function(i,o);return e._slotCount=Math.floor(s.length/2),e}catch{if(this.debugTemplates)return console.warn(`Invalid template:'${e}' Generated code:'${o}'`),(()=>``);throw Error(J.format(`Invalid template:'{0}' Generated code:'{1}'`,e,o))}}};new class{constructor(){this._directions=this.createDirections(),this._effects=this.createEffects()}createDirections(){return{left:{reverse:`right`,property:`left`,transition:`translatex`,vertical:!1,modifier:-1},right:{reverse:`left`,property:`left`,transition:`translatex`,vertical:!1,modifier:1},down:{reverse:`up`,property:`top`,transition:`translatey`,vertical:!0,modifier:1},up:{reverse:`down`,property:`top`,transition:`translatey`,vertical:!0,modifier:-1},top:{reverse:`bottom`},bottom:{reverse:`top`},in:{reverse:`out`,modifier:-1},out:{reverse:`in`,modifier:1},vertical:{reverse:`vertical`},horizontal:{reverse:`horizontal`}}}createEffects(){let e={enabled:!0,Element:function(e){this.element=$(e)},promise:function(e,t){e.is(`:visible`)||e.css({display:e.data(`olddisplay`)||`block`}).css(`display`),t.hide&&e.data(`olddisplay`,e.data(`olddisplay`)||e.css(`display`)).hide(),t.init&&t.init(),t.completeCallback&&t.completeCallback(e),e.dequeue()},promiseShim:null,disable:function(){this.enabled=!1,this.promise=this.promiseShim},enable:function(){this.enabled=!0,this.promise=this.animatedPromise}};return e.promiseShim=e.promise,e}get directions(){return this._directions}get effects(){return this._effects}prepareAnimationOptions(e,t,n,r){return typeof e==`string`&&(x.isFunction(t)&&(r=t,t=400,n=!1),x.isFunction(n)&&(r=n,n=!1),typeof t==`boolean`&&(n=t,t=400),e={effects:e,duration:t,reverse:n,complete:r}),$.extend({effects:{},duration:400,reverse:!1,init:$.noop,teardown:$.noop,hide:!1},e,{completeCallback:e.complete,complete:$.noop})}animate(e,t,n,r,i){let a=this._effects,o=this.prepareAnimationOptions.bind(this),s=0,c=e.length,l;for(;s<c;s++)l=$(e[s]),l.queue(function(){a.promise($(this),o(t,n,r,i))});return e}toggleClass(e,t,n,r){if(t){let n=t.split(` `);$.each(n,(t,n)=>{e.toggleClass(n,r)})}return e}fx(e){return new this._effects.Element(e)}};let tr=`function`,nr=new class{constructor(){this.widgets=[],this.namespaces=new Map}isWidgetConstructor(e){if(typeof e!=tr||e===null)return!1;let t=e;return`fn`in t&&`extend`in t}createNamespace(e,t){let n={roles:{},...t};return this.namespaces.set(e,n),n}getNamespace(e){return this.namespaces.get(e)}register(e,t={}){let n=t.namespace||`ui`,r=this.namespaces.get(n);if(!r)throw Error(`Unknown widget namespace: ${n}`);this.registerToNamespace(e,r,t.prefix)}registerToNamespace(e,t,n){let r=e.fn.options.name||e.options?.name;if(!r)throw Error(`Widget must have a name in options`);n||=``;let i=r.toLowerCase();t[r]=e,t.roles[i]=e;let a=`getKendo`+n+r,o=`kendo`+n+r;this.createJQueryPlugin(o,e,a);let s={name:o,widget:e,prefix:n};this.widgets.push(s)}getWidget(e,t){if(t){let n=this.namespaces.get(t)?.[e];return this.isWidgetConstructor(n)?n:void 0}for(let t of this.namespaces.values()){let n=t[e];if(this.isWidgetConstructor(n))return n}}getWidgetByRole(e,t){let n=e.toLowerCase();if(t)return this.namespaces.get(t)?.roles[n];for(let e of this.namespaces.values())if(e.roles[n])return e.roles[n]}getAllWidgets(){return this.widgets.slice()}getWidgetInstance(e,t){let n=$(e),r,i=t?[t]:Array.from(this.namespaces.values());for(let e of i)for(let t in e.roles){let i=e.roles[t],a=`kendo`+(i.fn?.options?.prefix||``)+(i.fn?.options?.name||``);if(r=n.data(a),r)return r}}createJQueryPlugin(e,t,n){let r=Array.prototype.slice;$.fn[e]=function(n){let i=this,a;return typeof n==`string`?(a=r.call(arguments,1),this.each(function(){let t=$.data(this,e),r,o;if(!t)throw Error(J.format(`Cannot call method '{0}' of {1} before it is initialized`,n,e));if(r=t[n],typeof r!=tr)throw Error(J.format(`Cannot find method '{0}' of {1}`,n,e));if(o=r.apply(t,a),o!==void 0)return i=o,!1})):this.each(function(){return new t(this,n)}),i},$.fn[e].widget=t,$.fn[n]=function(){return this.data(e)}}rolesFromNamespaces(e,t){let n=[],r,i;for(!e[0]&&t&&(e=t),r=0,i=e.length;r<i;r++)n[r]=e[r].roles;let a=[...n].reverse();return $.extend.apply(null,[{}].concat(a))}},rr=new class{constructor(){this.getterCache={},this.setterCache={}}wrapExpression(e,t){let n=t||`d`,r=1;for(let t=0;t<e.length;t++){let i=e[t];if(i!==``){let a=i.indexOf(`[`);a!==0&&(a===-1?i=`.`+i:(r++,i=`.`+i.substring(0,a)+` || {})`+i.substring(a))),r++,n+=i+(t<e.length-1?` || {})`:`)`)}}return Array(r).join(`(`)+n}expr(e,t,n){return e||=``,typeof t==`string`&&(n=t,t=!1),n||=`d`,e&&e.charAt(0)!==`[`&&(e=`.`+e),t?(e=e.replace(/"([^.]*)\.([^"]*)"/g,`"$1_$DOT$_$2"`),e=e.replace(/'([^.]*)\.([^']*)'/g,`'$1_$DOT$_$2'`),e=this.wrapExpression(e.split(`.`),n),e=e.replace(/_\$DOT\$_/g,`.`)):e=n+e,e}exprToArray(e,t){return e||=``,e.indexOf(`.`)>=0||e.indexOf(`[`)>=0?e.split(/[[\].]/).map(e=>e.replace(/["']/g,``)).filter(e=>e):e===``?[]:[e]}getter(e,t){let n=e+t;return this.getterCache[n]||(this.getterCache[n]=n=>{let r=this.exprToArray(e,t),i=n;for(let e=0;e<r.length;e++)if(i=i[r[e]],!x.isPresent(i)&&t)return i;return i}),this.getterCache[n]}setter(e){return this.setterCache[e]||(this.setterCache[e]=(t,n)=>{let r=this.exprToArray(e),i=e=>{e.props.length?(e.parent=e.parent[e.props.shift()],i(e)):e.parent[e.prop]=e.val};i({parent:t,val:n,prop:r.pop(),props:r})}),this.setterCache[e]}accessor(e){return{get:this.getter(e),set:this.setter(e)}}},ir=/template$/i,ar=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,or=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]+\]$/,sr=/([A-Z])/g,cr=/^(\+|-?)\d+(\.?)\d*$/,lr=[`themeColor`,`fillMode`,`shape`,`size`,`rounded`,`positionMode`],ur=new class{getDefaultNamespaces(){return[nr.getNamespace(`ui`),nr.getNamespace(`dataviz.ui`),nr.getNamespace(`mobile.ui`)].filter(Boolean)}parseOption(e,t,n){let r=A.ns,i,a=!1;if(t.indexOf(`data`)===0&&(t=t.substring(4),t=t.charAt(0).toLowerCase()+t.substring(1)),t=t.replace(sr,`-$1`),i=e.getAttribute(`data-`+r+t),i===null&&(i=e.getAttribute(`bind:data-`+r+t),a=!0),i===null)i=void 0;else if(i===`null`)i=null;else if(i===`true`)i=!0;else if(i===`false`)i=!1;else if(cr.test(i)&&t!=`mask`&&t!=`format`)i=parseFloat(i);else if(ar.test(i)&&!or.test(i))try{i=JSON.parse(i)}catch{i=Function(`return (`+i+`)`)()}else a&&(i=n[i],i instanceof O&&(i=i.toJSON(!0)));return i}parseOptions(e,t,n){let r=A.ns,i={},a,o,s=e.getAttribute(`data-`+r+`role`),c=Object.keys(t);for(let e=0;e<lr.length;e++)c.indexOf(lr[e])===-1&&c.push(lr[e]);for(let t=0;t<c.length;t++)a=c[t],o=this.parseOption(e,a,n),o!==void 0&&(ir.test(a)&&s!=`drawer`&&(typeof o==`string`?o=this.validateQuerySelectorTemplate(o)?er.compile($(`#`+o).html()):n&&n[o]?er.compile(n[o]):er.compile(o):x.isFunction(o)||(o=e.getAttribute(a))),i[a]=o);return i}validateQuerySelectorTemplate(e){try{return!!$(`#`+e).length}catch{}return!1}initWidget(e,t,n,r){let i=A.ns,a,o,s,c,l,u,d,f,p,m;if(n?n.roles&&(n=n.roles):n=this.getDefaultNamespaces()[0].roles,e=e.nodeType?e:e[0],u=e.getAttribute(`data-`+i+`role`),!u)return;p=u.indexOf(`.`)===-1,s=p?n[u]:rr.getter(u)(window);let h=$(e).data(),g=s?`kendo`+s.fn.options.prefix+s.fn.options.name:``;for(var _ in m=RegExp(p?`^kendo.*`+u+`$`:`^`+g+`$`,`i`),h)if(_.match(m))if(_===g)a=h[_];else return h[_];if(s){for(f=this.parseOption(e,`dataSource`),t=$.extend({},this.parseOptions(e,$.extend({},s.fn.options,s.fn.defaults),r),t),f&&(typeof f==`string`?t.dataSource=rr.getter(f)(window):t.dataSource=f),c=0,l=s.fn.events.length;c<l;c++)o=s.fn.events[c],d=this.parseOption(e,o),d!==void 0&&(t[o]=rr.getter(d)(window));return a?$.isEmptyObject(t)||a.setOptions(t):a=new s(e,t),a}}init(e,...t){let n=A.ns,r=nr.rolesFromNamespaces(t,this.getDefaultNamespaces()),i=this;$(e).find(`[data-`+n+`role]`).addBack().each(function(){i.initWidget(this,{},r)})}destroy(e){let t=A.ns;$(e).find(`[data-`+t+`role]`).addBack().each(function(){let e=$(this).data();for(var t in e)t.indexOf(`kendo`)===0&&typeof e[t].destroy==`function`&&e[t].destroy()})}containmentComparer(e,t){return $.contains(e,t)?-1:1}resize(e,t){let n=A.ns,r=this,i=$(e).find(`[data-`+n+`role]`).addBack().filter(function(){let e=$(this);return $.inArray(e.attr(`data-`+n+`role`),[`slider`,`rangeslider`,`breadcrumb`])>-1||e.is(`:visible`)});if(!i.length)return;let a=$.makeArray(i);a.sort((e,t)=>r.containmentComparer(e,t)),$.each(a,function(){let e=r.widgetInstance($(this));e&&e.resize(t)})}widgetInstance(e,t){let n=A.ns,r=this.getDefaultNamespaces(),i=e.data(n+`role`),a=[],o,s,c=e.data(`kendoView`);if(i){if(i===`content`&&(i=`scroller`),i===`view`&&c)return c;if(t)if(t[0])for(o=0,s=t.length;o<s;o++)a.push(t[o].roles[i]);else a.push(t.roles[i]);else a=r.map(e=>e.roles[i]);for(i.indexOf(`.`)>=0&&(a=[rr.getter(i)(window)]),o=0,s=a.length;o<s;o++){let t=a[o];if(t){let n=e.data(`kendo`+t.fn.options.prefix+t.fn.options.name);if(n)return n}}}}};new class{focusable(e,t){let n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:n===`a`&&e.href||t)&&this.visible(e)}visible(e){return $.expr.pseudos.visible(e)&&!$(e).parents().addBack().filter(function(){return $.css(this,`visibility`)===`hidden`}).length}kendoFocusable(e){let t=$(e).attr(`tabindex`),n=t===void 0?NaN:parseInt(t,10);return this.focusable(e,!isNaN(n)&&n>-1)}focusElement(e){let t=M,n=[],r=e.parentsUntil(`body`).filter(function(e,n){return t.getComputedStyles(n,[`overflow`]).overflow!==`visible`}).add(window);r.each(function(e,t){n[e]=$(t).scrollTop()||0});try{e[0].setActive()}catch{e.trigger(`focus`)}r.each(function(e,t){$(t).scrollTop(n[e])})}focusNextElement(){if(document.activeElement){let e=$(`:kendoFocusable`),t=e.index(document.activeElement);t>-1&&(e[t+1]||e[0]).focus()}}cycleForm(e){let t=e.find(`input, .k-widget, .k-dropdownlist, .k-combobox`).first(),n=e.find(`button, .k-button`).last();function r(e){let t=ur.widgetInstance(e);t&&t.focus?t.focus():e.trigger(`focus`)}n.on(`keydown`,function(e){e.keyCode===9&&!e.shiftKey&&(e.preventDefault(),r(t))}),t.on(`keydown`,function(e){e.keyCode===9&&e.shiftKey&&(e.preventDefault(),r(n))})}getWidgetFocusableElement(e){let t=e.closest(`:kendoFocusable`),n=ur.widgetInstance(e),r;return r=t.length?t:n?n.options.name===`Editor`?$(n.body):n.wrapper.find(`:kendoFocusable`).first():e,r}registerFocusableSelector(){let e=this;$.extend($.expr.pseudos,{kendoFocusable:function(t){return e.kendoFocusable(t)}})}activeElement(){try{return document.activeElement}catch{return document.documentElement.activeElement}}},new class{getSeriesColors(){let e=$(`<div class="k-var--series-a"></div><div class="k-var--series-b"></div><div class="k-var--series-c"></div><div class="k-var--series-d"></div><div class="k-var--series-e"></div><div class="k-var--series-f"></div>`),t=[];return e.appendTo($(`body`)),e.each((e,n)=>{t.push($(n).css(`background-color`))}),e.remove(),t}},new class{selectorFromClasses(e){return`.`+e.split(` `).join(`.`)}roleSelector(e,t){return e.replace(/(\S+)/g,`[data-`+t+`role=$1],`).slice(0,-1)}directiveSelector(e){let t=e.split(` `);if(t)for(let e=0;e<t.length;e++)t[e]!==`view`&&(t[e]=t[e].replace(/(\w*)(view|bar|strip|over)$/,`$1-$2`));return t.join(` `).replace(/(\S+)/g,`kendo-mobile-$1,`).slice(0,-1)}};let dr=`string`;new class{constructor(){this.zones={},this.rules={},this.months={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},this.days={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6}}offset(e,t){if(t===`Etc/UTC`||t===`Etc/GMT`)return 0;let n=this.zoneAndRule(e,this.zones,this.rules,t),r=n.zone,i=n.rule;return Kn.parseFloat(i?r[0]-i[6]:r[0])}abbr(e,t){let n=this.zoneAndRule(e,this.zones,this.rules,t),r=n.zone,i=n.rule,a=r[2];return a.indexOf(`/`)>=0?a.split(`/`)[i&&+i[6]?1:0]:a.indexOf(`%s`)>=0?a.replace(`%s`,!i||i[7]===`-`?``:i[7]):a}convert(e,t,n){let r=n,i;typeof t==dr&&(t=this.offset(e,t)),typeof n==dr&&(n=this.offset(e,n));let a=e.getTimezoneOffset();e=new Date(e.getTime()+(t-n)*6e4);let o=e.getTimezoneOffset();return typeof r==dr&&(r=this.offset(e,r)),i=o-a+(n-r),new Date(e.getTime()+i*6e4)}apply(e,t){return this.convert(e,e.getTimezoneOffset(),t)}remove(e,t){return this.convert(e,t,e.getTimezoneOffset())}toLocalDate(e){return this.apply(new Date(e),`Etc/UTC`)}ruleToDate(e,t){let n,r,i,a=t[3],o=t[4],s=t[5],c=t[8];return c||(t[8]=c={}),c[e]?c[e]:(isNaN(o)?o.indexOf(`last`)===0?(n=new Date(Date.UTC(e,this.months[a]+1,1,s[0]-24,s[1],s[2],0)),r=this.days[o.substr(4,3)],i=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+r-i-(r>i?7:0))):o.indexOf(`>=`)>=0?(n=new Date(Date.UTC(e,this.months[a],parseInt(o.substr(5),10),s[0],s[1],s[2],0)),r=this.days[o.substr(0,3)],i=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+r-i+(r<i?7:0))):o.indexOf(`<=`)>=0&&(n=new Date(Date.UTC(e,this.months[a],parseInt(o.substr(5),10),s[0],s[1],s[2],0)),r=this.days[o.substr(0,3)],i=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+r-i-(r>i?7:0))):n=new Date(Date.UTC(e,this.months[a],o,s[0],s[1],s[2],0)),c[e]=n)}findRule(e,t,n){let r=t[n];if(!r){let e=n.split(`:`),t=0;return e.length>1&&(t=parseInt(e[0],10)*60+Number(e[1])),[-1e6,`max`,`-`,`Jan`,1,[0,0,0],t,`-`]}let i=new Date(e).getUTCFullYear();r=r.filter(e=>{let t=e[0],n=e[1];return t<=i&&(n>=i||t==i&&n===`only`||n===`max`)});let a=[...r,e];a.sort((e,t)=>{let n=e,r=t;return typeof e!=`number`&&(n=Number(this.ruleToDate(i,e))),typeof t!=`number`&&(r=Number(this.ruleToDate(i,t))),n-r});let o=a[a.indexOf(e)-1]||a[a.length-1];return isNaN(o)?o:null}findZone(e,t,n){let r=t[n];if(typeof r==`string`&&(r=t[r]),!r)throw Error(`Timezone "`+n+`" is either incorrect, or kendo.timezones.min.js is not included.`);let i=r,a;for(a=i.length-1;a>=0;a--){let t=i[a][3];if(t&&e>t)break}let o=i[a+1];if(!o)throw Error(`Timezone "`+n+`" not found on `+e+`.`);return o}zoneAndRule(e,t,n,r){if(typeof e!=`number`){let t=e;e=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())}let i=this.findZone(e,t,r);return{zone:i,rule:this.findRule(e,n,i[1])}}},new class{constructor(){this.class2type={},`Boolean Number String Function Array Date RegExp Object Error Symbol`.split(` `).forEach(e=>{this.class2type[`[object `+e+`]`]=e.toLowerCase()})}getClass2Type(){return this.class2type}type(e){return e==null?e+``:typeof e==`object`||typeof e==`function`?this.class2type[Object.prototype.toString.call(e)]||`object`:typeof e}},new class{constructor(){this.defaults={}}getDefaults(){return this.defaults}setDefaults(e,t){let n=e.split(`.`),r=this.defaults;e=n.pop(),n.forEach(e=>{r[e]===void 0&&(r[e]={}),r=r[e]}),typeof t==`object`&&t&&t.constructor===Object?r[e]=x.deepExtend({},r[e]||{},t):r[e]=t}getDefault(e){let t=e.split(`.`),n=this.defaults;for(let e of t){if(n[e]===void 0)return;n=n[e]}return n}};let fr={id:`chat`,name:`Chat`,category:`web`,description:`The Chat component.`,depends:[`data`,`draganddrop`,`html.button`,`textarea`,`menu`,`avatar`,`toolbar`,`speechtotextbutton`]};window.kendo.chat={},$.extend(window.kendo.chat,{ChatView:{},Component:{},Components:{},Templates:{},getTemplate:()=>x.logToConsole(`The getTemplate method is deprecated. Use one of the built-in templates or append elements manually.`,`warn`),getComponent:()=>x.logToConsole(`The getComponent method is deprecated. Use one of the built-in templates or append elements manually.`,`warn`),registerTemplate:()=>x.logToConsole(`The registerTemplate method is deprecated. Use one of the built-in templates or append elements manually.`,`warn`),registerComponent:()=>x.logToConsole(`The registerComponent method is deprecated. Use one of the built-in templates or append elements manually.`,`warn`)}),nr.register(Vn);var pr=kendo;e.Chat=Vn,e.__meta__=fr,e.default=pr});
//# sourceMappingURL=kendo.chat.min.js.map