@syncfusion/ej2-ribbon 30.1.39 → 30.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-ribbon.umd.min.js +2 -2
- package/dist/ej2-ribbon.umd.min.js.map +1 -1
- package/dist/es6/ej2-ribbon.es2015.js +4 -2
- package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
- package/dist/es6/ej2-ribbon.es5.js +4 -2
- package/dist/es6/ej2-ribbon.es5.js.map +1 -1
- package/dist/global/ej2-ribbon.min.js +2 -2
- package/dist/global/ej2-ribbon.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/ribbon/base/ribbon.js +4 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-ribbon.umd.min.js
|
|
3
|
-
* version : 30.1.
|
|
3
|
+
* version : 30.1.41
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-navigations","@syncfusion/ej2-dropdowns","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-popups"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Navigations,e.ej2Dropdowns,e.ej2Splitbuttons,e.ej2Buttons,e.ej2Inputs,e.ej2Popups)}(this,function(R,x,L,P,M,u,E,D){"use strict";(e=R.RibbonLayout||(R.RibbonLayout={})).Classic="Classic",e.Simplified="Simplified",(e=R.ItemOrientation||(R.ItemOrientation={})).Row="Row",e.Column="Column",(e=R.RibbonItemSize||(R.RibbonItemSize={}))[e.Large=4]="Large",e[e.Medium=2]="Medium",e[e.Small=1]="Small",(e=R.DisplayMode||(R.DisplayMode={}))[e.Classic=4]="Classic",e[e.Simplified=2]="Simplified",e[e.Overflow=1]="Overflow",e[e.Auto=7]="Auto",(e=R.RibbonItemType||(R.RibbonItemType={})).Button="Button",e.CheckBox="CheckBox",e.ColorPicker="ColorPicker",e.ComboBox="ComboBox",e.DropDown="DropDown",e.SplitButton="SplitButton",e.GroupButton="GroupButton",e.Gallery="Gallery",e.Template="Template",(e=R.RibbonGroupButtonSelection||(R.RibbonGroupButtonSelection={})).Single="Single",e.Multiple="Multiple",z=function(e,t){return(z=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var z,N,e=function(e,t){function o(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},H=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},e=(N=x.ChildProperty,e(W,N),W.prototype.setProperties=function(e,t){N.prototype.setProperties.call(this,e,t)},H([x.Property("")],W.prototype,"content",void 0),H([x.Property("")],W.prototype,"cssClass",void 0),H([x.Property("")],W.prototype,"iconCss",void 0),H([x.Property(!1)],W.prototype,"isToggle",void 0),H([x.Property(!1)],W.prototype,"isPrimary",void 0),H([x.Property({})],W.prototype,"htmlAttributes",void 0),H([x.Event()],W.prototype,"created",void 0),H([x.Event()],W.prototype,"clicked",void 0),W);function W(){return null!==N&&N.apply(this,arguments)||this}F=function(e,t){return(F=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var F,K,H=function(e,t){function o(){this.constructor=e}F(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},U=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},H=(K=x.ChildProperty,H(V,K),U([x.Property(!(V.prototype.setProperties=function(e,t){K.prototype.setProperties.call(this,e,t)}))],V.prototype,"checked",void 0),U([x.Property("")],V.prototype,"cssClass",void 0),U([x.Property("")],V.prototype,"label",void 0),U([x.Property("After")],V.prototype,"labelPosition",void 0),U([x.Property({})],V.prototype,"htmlAttributes",void 0),U([x.Event()],V.prototype,"created",void 0),U([x.Event()],V.prototype,"change",void 0),V);function V(){return null!==K&&K.apply(this,arguments)||this}X=function(e,t){return(X=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var X,Y,U=function(e,t){function o(){this.constructor=e}X(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},t=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},U=(Y=x.ChildProperty,U(o,Y),o.prototype.setProperties=function(e,t){Y.prototype.setProperties.call(this,e,t)},t([x.Property(10)],o.prototype,"columns",void 0),t([x.Property("")],o.prototype,"cssClass",void 0),t([x.Property("")],o.prototype,"label",void 0),t([x.Property(!0)],o.prototype,"enableOpacity",void 0),t([x.Property("Palette")],o.prototype,"mode",void 0),t([x.Property(!0)],o.prototype,"modeSwitcher",void 0),t([x.Property(!1)],o.prototype,"noColor",void 0),t([x.Property(null)],o.prototype,"presetColors",void 0),t([x.Property(!0)],o.prototype,"showButtons",void 0),t([x.Property("#008000ff")],o.prototype,"value",void 0),t([x.Property({})],o.prototype,"htmlAttributes",void 0),t([x.Event()],o.prototype,"beforeClose",void 0),t([x.Event()],o.prototype,"beforeOpen",void 0),t([x.Event()],o.prototype,"beforeTileRender",void 0),t([x.Event()],o.prototype,"created",void 0),t([x.Event()],o.prototype,"change",void 0),t([x.Event()],o.prototype,"open",void 0),t([x.Event()],o.prototype,"select",void 0),o);function o(){return null!==Y&&Y.apply(this,arguments)||this}Z=function(e,t){return(Z=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Z,J,t=function(e,t){function o(){this.constructor=e}Z(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},i=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},t=(J=x.ChildProperty,t(r,J),i([x.Property(!(r.prototype.setProperties=function(e,t){J.prototype.setProperties.call(this,e,t)}))],r.prototype,"allowFiltering",void 0),i([x.Property(!0)],r.prototype,"autofill",void 0),i([x.Property("")],r.prototype,"cssClass",void 0),i([x.Property("")],r.prototype,"label",void 0),i([x.Property([])],r.prototype,"dataSource",void 0),i([x.Complex({text:null,value:null,iconCss:null,groupBy:null},P.FieldSettings)],r.prototype,"fields",void 0),i([x.Property("Contains")],r.prototype,"filterType",void 0),i([x.Property(null)],r.prototype,"footerTemplate",void 0),i([x.Property(null)],r.prototype,"groupTemplate",void 0),i([x.Property(null)],r.prototype,"headerTemplate",void 0),i([x.Property(null)],r.prototype,"index",void 0),i([x.Property(null)],r.prototype,"itemTemplate",void 0),i([x.Property("No records found")],r.prototype,"noRecordsTemplate",void 0),i([x.Property(null)],r.prototype,"placeholder",void 0),i([x.Property("300px")],r.prototype,"popupHeight",void 0),i([x.Property("100%")],r.prototype,"popupWidth",void 0),i([x.Property(!0)],r.prototype,"showClearButton",void 0),i([x.Property("None")],r.prototype,"sortOrder",void 0),i([x.Property(null)],r.prototype,"text",void 0),i([x.Property(null)],r.prototype,"value",void 0),i([x.Property("150px")],r.prototype,"width",void 0),i([x.Property({})],r.prototype,"htmlAttributes",void 0),i([x.Event()],r.prototype,"beforeOpen",void 0),i([x.Event()],r.prototype,"change",void 0),i([x.Event()],r.prototype,"close",void 0),i([x.Event()],r.prototype,"created",void 0),i([x.Event()],r.prototype,"filtering",void 0),i([x.Event()],r.prototype,"open",void 0),i([x.Event()],r.prototype,"select",void 0),r);function r(){return null!==J&&J.apply(this,arguments)||this}Q=function(e,t){return(Q=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Q,$,i=function(e,t){function o(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},i=($=x.ChildProperty,i(s,$),s.prototype.setProperties=function(e,t){$.prototype.setProperties.call(this,e,t)},n([x.Property("")],s.prototype,"closeActionEvents",void 0),n([x.Property("")],s.prototype,"content",void 0),n([x.Property("")],s.prototype,"cssClass",void 0),n([x.Property("")],s.prototype,"iconCss",void 0),n([x.Collection([],M.Item)],s.prototype,"items",void 0),n([x.Property("")],s.prototype,"target",void 0),n([x.Property(!1)],s.prototype,"createPopupOnClick",void 0),n([x.Property({})],s.prototype,"htmlAttributes",void 0),n([x.Event()],s.prototype,"beforeClose",void 0),n([x.Event()],s.prototype,"beforeItemRender",void 0),n([x.Event()],s.prototype,"beforeOpen",void 0),n([x.Event()],s.prototype,"close",void 0),n([x.Event()],s.prototype,"created",void 0),n([x.Event()],s.prototype,"open",void 0),n([x.Event()],s.prototype,"select",void 0),s);function s(){return null!==$&&$.apply(this,arguments)||this}ee=function(e,t){return(ee=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var ee,te,n=function(e,t){function o(){this.constructor=e}ee(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},a=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},n=(te=x.ChildProperty,n(l,te),l.prototype.setProperties=function(e,t){te.prototype.setProperties.call(this,e,t)},a([x.Property("")],l.prototype,"closeActionEvents",void 0),a([x.Property("")],l.prototype,"content",void 0),a([x.Property("")],l.prototype,"cssClass",void 0),a([x.Property("")],l.prototype,"iconCss",void 0),a([x.Collection([],M.Item)],l.prototype,"items",void 0),a([x.Property("")],l.prototype,"target",void 0),a([x.Property({})],l.prototype,"htmlAttributes",void 0),a([x.Event()],l.prototype,"beforeClose",void 0),a([x.Event()],l.prototype,"beforeItemRender",void 0),a([x.Event()],l.prototype,"beforeOpen",void 0),a([x.Event()],l.prototype,"close",void 0),a([x.Event()],l.prototype,"click",void 0),a([x.Event()],l.prototype,"created",void 0),a([x.Event()],l.prototype,"open",void 0),a([x.Event()],l.prototype,"select",void 0),l);function l(){return null!==te&&te.apply(this,arguments)||this}oe=function(e,t){return(oe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var oe,ie,a=function(e,t){function o(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},re=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},a=(ie=x.ChildProperty,a(ne,ie),re([x.Property("")],ne.prototype,"cssClass",void 0),re([x.Property("")],ne.prototype,"id",void 0),re([x.Property("")],ne.prototype,"title",void 0),re([x.Property("")],ne.prototype,"content",void 0),re([x.Property("")],ne.prototype,"iconCss",void 0),ne);function ne(){return null!==ie&&ie.apply(this,arguments)||this}se=function(e,t){return(se=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var se,ae,re=function(e,t){function o(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},le=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},re=(ae=x.ChildProperty,re(pe,ae),pe.prototype.setProperties=function(e,t){ae.prototype.setProperties.call(this,e,t)},le([x.Property("")],pe.prototype,"content",void 0),le([x.Property("")],pe.prototype,"iconCss",void 0),le([x.Property("")],pe.prototype,"keyTip",void 0),le([x.Complex({},a)],pe.prototype,"ribbonTooltipSettings",void 0),le([x.Property(!1)],pe.prototype,"selected",void 0),le([x.Property({})],pe.prototype,"htmlAttributes",void 0),le([x.Event()],pe.prototype,"beforeClick",void 0),le([x.Event()],pe.prototype,"click",void 0),pe);function pe(){return null!==ae&&ae.apply(this,arguments)||this}ce=function(e,t){return(ce=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var ce,de,le=function(e,t){function o(){this.constructor=e}ce(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},ue=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},le=(de=x.ChildProperty,le(he,de),ue([x.Property("")],he.prototype,"header",void 0),ue([x.Property("Single")],he.prototype,"selection",void 0),ue([x.Collection([],re)],he.prototype,"items",void 0),he);function he(){return null!==de&&de.apply(this,arguments)||this}be=function(e,t){return(be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var be,me,ue=function(e,t){function o(){this.constructor=e}be(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},ye=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},ue=(me=x.ChildProperty,ue(fe,me),ye([x.Property("")],fe.prototype,"content",void 0),ye([x.Property("")],fe.prototype,"iconCss",void 0),ye([x.Property({})],fe.prototype,"htmlAttributes",void 0),ye([x.Property("")],fe.prototype,"cssClass",void 0),ye([x.Property(!1)],fe.prototype,"disabled",void 0),fe);function fe(){return null!==me&&me.apply(this,arguments)||this}ge=function(e,t){return(ge=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var ge,ve,ye=function(e,t){function o(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Se=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},ye=(ve=x.ChildProperty,ye(Ie,ve),Se([x.Collection([],ue)],Ie.prototype,"items",void 0),Se([x.Property("")],Ie.prototype,"header",void 0),Se([x.Property("auto")],Ie.prototype,"itemWidth",void 0),Se([x.Property("auto")],Ie.prototype,"itemHeight",void 0),Se([x.Property("")],Ie.prototype,"cssClass",void 0),Ie);function Ie(){return null!==ve&&ve.apply(this,arguments)||this}Ce=function(e,t){return(Ce=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Ce,we,Se=function(e,t){function o(){this.constructor=e}Ce(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},p=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},Se=(we=x.ChildProperty,Se(Te,we),p([x.Collection([],ye)],Te.prototype,"groups",void 0),p([x.Property(3)],Te.prototype,"itemCount",void 0),p([x.Property(null)],Te.prototype,"selectedItemIndex",void 0),p([x.Property("auto")],Te.prototype,"popupHeight",void 0),p([x.Property("auto")],Te.prototype,"popupWidth",void 0),p([x.Property("")],Te.prototype,"template",void 0),p([x.Property("")],Te.prototype,"popupTemplate",void 0),p([x.Event()],Te.prototype,"popupOpen",void 0),p([x.Event()],Te.prototype,"popupClose",void 0),p([x.Event()],Te.prototype,"itemHover",void 0),p([x.Event()],Te.prototype,"beforeItemRender",void 0),p([x.Event()],Te.prototype,"beforeSelect",void 0),p([x.Event()],Te.prototype,"select",void 0),Te);function Te(){return null!==we&&we.apply(this,arguments)||this}ke=function(e,t){return(ke=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var ke,Oe,p=function(e,t){function o(){this.constructor=e}ke(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},c=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},p=(Oe=x.ChildProperty,p(d,Oe),d.prototype.setProperties=function(e,t){Oe.prototype.setProperties.call(this,e,t)},c([x.Property("")],d.prototype,"keyTip",void 0),c([x.Property(R.RibbonItemSize.Medium)],d.prototype,"activeSize",void 0),c([x.Property(R.RibbonItemSize.Small|R.RibbonItemSize.Medium|R.RibbonItemSize.Large)],d.prototype,"allowedSizes",void 0),c([x.Property("")],d.prototype,"id",void 0),c([x.Property("")],d.prototype,"cssClass",void 0),c([x.Property(!1)],d.prototype,"disabled",void 0),c([x.Property("")],d.prototype,"itemTemplate",void 0),c([x.Property("Button")],d.prototype,"type",void 0),c([x.Property(R.DisplayMode.Auto)],d.prototype,"displayOptions",void 0),c([x.Complex({},a)],d.prototype,"ribbonTooltipSettings",void 0),c([x.Complex({},e)],d.prototype,"buttonSettings",void 0),c([x.Complex({},i)],d.prototype,"dropDownSettings",void 0),c([x.Complex({},H)],d.prototype,"checkBoxSettings",void 0),c([x.Complex({},U)],d.prototype,"colorPickerSettings",void 0),c([x.Complex({},t)],d.prototype,"comboBoxSettings",void 0),c([x.Complex({},n)],d.prototype,"splitButtonSettings",void 0),c([x.Complex({},le)],d.prototype,"groupButtonSettings",void 0),c([x.Complex({},Se)],d.prototype,"gallerySettings",void 0),d);function d(){return null!==Oe&&Oe.apply(this,arguments)||this}Be=function(e,t){return(Be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Be,Le,c=function(e,t){function o(){this.constructor=e}Be(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Pe=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},c=(Le=x.ChildProperty,c(Ee,Le),Ee.prototype.setProperties=function(e,t){Le.prototype.setProperties.call(this,e,t)},Pe([x.Property("")],Ee.prototype,"id",void 0),Pe([x.Property("")],Ee.prototype,"cssClass",void 0),Pe([x.Collection([],p)],Ee.prototype,"items",void 0),Ee);function Ee(){return null!==Le&&Le.apply(this,arguments)||this}De=function(e,t){return(De=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var De,Re,Pe=function(e,t){function o(){this.constructor=e}De(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},h=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},Pe=(Re=x.ChildProperty,Pe(b,Re),b.prototype.setProperties=function(e,t){Re.prototype.setProperties.call(this,e,t)},h([x.Property("")],b.prototype,"keyTip",void 0),h([x.Property("")],b.prototype,"launcherIconKeyTip",void 0),h([x.Collection([],c)],b.prototype,"collections",void 0),h([x.Property("")],b.prototype,"cssClass",void 0),h([x.Property("")],b.prototype,"id",void 0),h([x.Property(!1)],b.prototype,"isCollapsed",void 0),h([x.Property(!0)],b.prototype,"isCollapsible",void 0),h([x.Property(!1)],b.prototype,"enableGroupOverflow",void 0),h([x.Property("")],b.prototype,"groupIconCss",void 0),h([x.Property("")],b.prototype,"header",void 0),h([x.Property("Column")],b.prototype,"orientation",void 0),h([x.Property("")],b.prototype,"overflowHeader",void 0),h([x.Property(0)],b.prototype,"priority",void 0),h([x.Property(!1)],b.prototype,"showLauncherIcon",void 0),b);function b(){return null!==Re&&Re.apply(this,arguments)||this}xe=function(e,t){return(xe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var xe,Me,h=function(e,t){function o(){this.constructor=e}xe(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},_e=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},h=(Me=x.ChildProperty,h(qe,Me),qe.prototype.setProperties=function(e,t){Me.prototype.setProperties.call(this,e,t)},_e([x.Property("")],qe.prototype,"keyTip",void 0),_e([x.Property("")],qe.prototype,"id",void 0),_e([x.Property("")],qe.prototype,"cssClass",void 0),_e([x.Collection([],Pe)],qe.prototype,"groups",void 0),_e([x.Property("")],qe.prototype,"header",void 0),qe);function qe(){return null!==Me&&Me.apply(this,arguments)||this}Ae=function(e,t){return(Ae=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Ae,je,_e=function(e,t){function o(){this.constructor=e}Ae(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},m=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},_e=(je=x.ChildProperty,_e(y,je),y.prototype.setProperties=function(e,t){je.prototype.setProperties.call(this,e,t)},m([x.Property("File")],y.prototype,"text",void 0),m([x.Property(!1)],y.prototype,"visible",void 0),m([x.Collection([],L.MenuItem)],y.prototype,"menuItems",void 0),m([x.Property(!1)],y.prototype,"showItemOnClick",void 0),m([x.Complex({},L.MenuAnimationSettings)],y.prototype,"animationSettings",void 0),m([x.Property("")],y.prototype,"itemTemplate",void 0),m([x.Property("")],y.prototype,"popupTemplate",void 0),m([x.Complex({},a)],y.prototype,"ribbonTooltipSettings",void 0),m([x.Event()],y.prototype,"beforeClose",void 0),m([x.Event()],y.prototype,"beforeOpen",void 0),m([x.Event()],y.prototype,"beforeItemRender",void 0),m([x.Event()],y.prototype,"close",void 0),m([x.Event()],y.prototype,"open",void 0),m([x.Event()],y.prototype,"select",void 0),m([x.Property("")],y.prototype,"keyTip",void 0),y);function y(){return null!==je&&je.apply(this,arguments)||this}Ge=function(e,t){return(Ge=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Ge,ze,m=function(e,t){function o(){this.constructor=e}Ge(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Ne=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},m=(ze=x.ChildProperty,m(He,ze),Ne([x.Property("")],He.prototype,"text",void 0),Ne([x.Property("")],He.prototype,"iconCss",void 0),Ne([x.Property(!0)],He.prototype,"visible",void 0),He);function He(){return null!==ze&&ze.apply(this,arguments)||this}We=function(e,t){return(We=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var We,Fe,Ne=function(e,t){function o(){this.constructor=e}We(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Ke=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},Ne=(Fe=x.ChildProperty,Ne(Ue,Fe),Ke([x.Property("")],Ue.prototype,"text",void 0),Ke([x.Property("")],Ue.prototype,"id",void 0),Ke([x.Property("")],Ue.prototype,"keyTip",void 0),Ke([x.Property("")],Ue.prototype,"content",void 0),Ke([x.Property("")],Ue.prototype,"iconCss",void 0),Ke([x.Property(!1)],Ue.prototype,"separator",void 0),Ke([x.Property(!1)],Ue.prototype,"isFooter",void 0),Ke([x.Event()],Ue.prototype,"backStageItemClick",void 0),Ue);function Ue(){return null!==Fe&&Fe.apply(this,arguments)||this}Ve=function(e,t){return(Ve=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Ve,Xe,Ke=function(e,t){function o(){this.constructor=e}Ve(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Ye=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},Ke=(Xe=x.ChildProperty,Ke(Ze,Xe),Ze.prototype.setProperties=function(e,t){Xe.prototype.setProperties.call(this,e,t)},Ye([x.Property("File")],Ze.prototype,"text",void 0),Ye([x.Property("")],Ze.prototype,"keyTip",void 0),Ye([x.Property(!1)],Ze.prototype,"visible",void 0),Ye([x.Property("auto")],Ze.prototype,"height",void 0),Ye([x.Property("auto")],Ze.prototype,"width",void 0),Ye([x.Property(null)],Ze.prototype,"target",void 0),Ye([x.Complex({},m)],Ze.prototype,"backButton",void 0),Ye([x.Collection([],Ne)],Ze.prototype,"items",void 0),Ye([x.Property("")],Ze.prototype,"template",void 0),Ye([x.Complex({},a)],Ze.prototype,"ribbonTooltipSettings",void 0),Ze);function Ze(){return null!==Xe&&Xe.apply(this,arguments)||this}Je=function(e,t){return(Je=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Je,Qe,Ye=function(e,t){function o(){this.constructor=e}Je(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},$e=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},Ye=(Qe=x.ChildProperty,Ye(et,Qe),$e([x.Property(!(et.prototype.setProperties=function(e,t){Qe.prototype.setProperties.call(this,e,t)}))],et.prototype,"visible",void 0),$e([x.Property(!1)],et.prototype,"isSelected",void 0),$e([x.Collection([],h)],et.prototype,"tabs",void 0),et);function et(){return null!==Qe&&Qe.apply(this,arguments)||this}var tt="e-ribbon-vertical-center",ot="e-icons e-drop-icon",it="e-icons e-arrow-left",rt="e-icons e-more-horizontal-1",nt="e-vertical",st="e-disabled",at="e-rtl",lt="e-ribbon-hover",pt="e-ribbon-control",ct="e-ribbon-popup-control",dt="e-ribbon-open",ut="e-ribbon-keytip",v=" ",ht="e-hscroll-bar",bt="e-ribbon-hide",mt="e-ribbon-tab",yt="e-ribbon-contextual-tab",ft="e-ribbon-active",gt="e-ribbon-tab-item",vt="e-ribbon-collapse-btn",St="e-ribbon-expand-btn",It="e-ribbon-collapsible",Ct="e-ribbon-overall-of-btn",wt="e-ribbon-group-of-btn",Tt="e-ribbon-overflow-target",kt="e-ribbon-overflow",Ot="e-content",Bt="e-ribbon-minimize",Lt="e-ribbon-group",Pt="e-ribbon-single-selection",Et="e-ribbon-multiple-selection",Dt="e-ribbon-group-button",Rt="e-ribbon-group-button-overflow-popup",xt="e-ribbon-group-button-content",Mt="e-ribbon-group-container",_t="e-ribbon-of-tab",qt="e-ribbon-of-group-container",At="e-ribbon-group-content",jt="e-ribbon-group-header",Gt="e-ribbon-overflow-header",zt="e-ribbon-group-overflow",Nt="e-ribbon-group-overflow-ddb",Ht="e-ribbon-launcher",Wt="e-ribbon-launcher-icon",Ft="e-icons e-launcher",Kt="e-ribbon-collection",Ut="e-ribbon-item",Vt="e-ribbon-row",Xt="e-ribbon-column",Yt="e-ribbon-large-item",Zt="e-ribbon-medium-item",Jt="e-ribbon-small-item",Qt="e-ribbon-content-height",$t="e-caret-hide",eo="e-ribbon-template",to="e-ribbon-help-template",oo="e-ribbon-tooltip",io="e-ribbon-tooltip-target",ro="e-ribbon-tooltip-title",no="e-ribbon-tooltip-content",so="e-ribbon-tooltip-icon",ao="e-ribbon-tooltip-container",lo="e-ribbon-text-container",po="e-ribbon-simplified-mode",co="e-ribbon-backstage-popup",uo="e-ribbon-backstage-open",ho="e-ribbon-backstage-content",bo="e-ribbon-backstage",mo="e-ribbon-backstage-menu",yo="e-ribbon-backstage-template",fo="e-ribbon-backstage-wrapper",go="e-ribbon-backstage-items-wrapper",vo="e-blankicon",So="_tab",Io="_collection",Co="_collapsebutton",wo="_sim_ovrl_overflow",_="_sim_grp_overflow",q="_header",To="_launcher",A="_content",j="_container",w="_overflow",ko="_dropdown",Oo="_filemenu",Bo="_backstage",Lo="_backstagepopup",Po="_filemenulist",Eo="_menulist",Do="_footermenulist",Ro="_helppanetemplate",G="_grpbtn",xo="_keytip",Mo="--fileMenuWidth",_o="--helpTemplateWidth",qo=(Ao.prototype.getModuleName=function(){return"ribbonButton"},Ao.prototype.destroy=function(){this.parent=null},Ao.prototype.createButton=function(e,t){var o=this,i=this.parent.createElement("button",{id:e.id}),r=(t.appendChild(i),e.buttonSettings);new u.Button({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===R.RibbonItemSize.Large?"Top":"Left",iconCss:r.iconCss,disabled:e.disabled,cssClass:(tt+v+pt+v+(r.cssClass||"")).trim(),content:e.activeSize===R.RibbonItemSize.Small?"":r.content,isPrimary:r.isPrimary,isToggle:r.isToggle,created:r.created},i),r.htmlAttributes&&(r.htmlAttributes.id&&delete r.htmlAttributes.id,ii(i,r.htmlAttributes)),i.onclick=function(e){r.clicked&&r.clicked.call(o,e)},r.content?i.setAttribute("aria-label",r.content):i.setAttribute("aria-label","button")},Ao.prototype.addOverFlowEvents=function(t,e,o){var i=this,e=e.querySelector("#"+t.id),r=(e.setAttribute("data-control",t.type.toString()),x.getComponent(e,u.Button));r.setProperties({cssClass:r.cssClass+v+ct}),e.onclick=function(e){t.buttonSettings.clicked&&t.buttonSettings.clicked.call(i,e),o.element.classList.contains("e-active")&&o.toggle()}},Ao.prototype.removeOverFlowEvents=function(t,e){var o=this,e=e.querySelector("#"+t.id),i=x.getComponent(e,u.Button),r=(r=i.cssClass.split(v)).filter(function(e){return e!==ct});i.setProperties({cssClass:r.join(v)}),e.onclick=function(e){t.buttonSettings.clicked&&t.buttonSettings.clicked.call(o,e)}},Ao.prototype.click=function(e){var e=I(this.parent,e);!e||(e=x.getComponent(e,u.Button)).disabled||e.click()},Ao.prototype.updateButton=function(e,t){var o,i=g(this.parent.tabs,t);i&&(x.merge(i.item.buttonSettings,e),t=I(this.parent,t,i))&&(o=x.getComponent(t,u.Button),e.isToggle&&t.classList.add("e-active"),e.cssClass&&(e.cssClass=(tt+v+pt+v+e.cssClass).trim()),e.content&&(e.content=i.item.activeSize===R.RibbonItemSize.Small?"":e.content,t.setAttribute("aria-label",e.content)),delete e.clicked,o.setProperties(e))},Ao.prototype.updateButtonSize=function(e,t){x.getComponent(e,u.Button).setProperties({iconPosition:t.activeSize===R.RibbonItemSize.Large?"Top":"Left",content:t.activeSize===R.RibbonItemSize.Small?"":t.buttonSettings.content})},Ao);function Ao(e){this.parent=e}Go.prototype.getModuleName=function(){return"ribbonCheckBox"},Go.prototype.destroy=function(){this.parent=null},Go.prototype.createCheckBox=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id}),r=(t.appendChild(i),e.checkBoxSettings);r.htmlAttributes&&r.htmlAttributes.id&&delete r.htmlAttributes.id,new u.CheckBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,checked:r.checked,cssClass:(pt+v+(r.cssClass||"")).trim(),label:r.label,labelPosition:r.labelPosition,disabled:e.disabled,created:r.created,htmlAttributes:r.htmlAttributes,change:function(e){r.change&&r.change.call(o,e)}},i)},Go.prototype.addOverFlowEvents=function(t,e,o){var i=this,e=e.querySelector("#"+t.id),e=(e.setAttribute("data-control",t.type.toString()),x.getComponent(e,u.CheckBox));e.cssClass=e.cssClass+v+ct,e.dataBind(),e.change=function(e){t.checkBoxSettings.change&&t.checkBoxSettings.change.call(i,e),o.element.classList.contains("e-active")&&o.toggle()}},Go.prototype.removeOverFlowEvents=function(t,e){var o=this,e=e.querySelector("#"+t.id),e=x.getComponent(e,u.CheckBox),i=(i=e.cssClass.split(v)).filter(function(e){return e!==ct});e.cssClass=i.join(v),e.dataBind(),e.change=function(e){t.checkBoxSettings.change&&t.checkBoxSettings.change.call(o,e)}},Go.prototype.click=function(e){var e=I(this.parent,e);!e||(e=x.getComponent(e,u.CheckBox)).disabled||e.click()},Go.prototype.updateCheckBox=function(e,t){var o=g(this.parent.tabs,t);o&&(x.merge(o.item.checkBoxSettings,e),t=I(this.parent,t,o))&&(e.cssClass&&(e.cssClass=(pt+v+e.cssClass).trim()),delete e.change,x.getComponent(t,u.CheckBox).setProperties(e))};var jo=Go;function Go(e){this.parent=e}zo.prototype.getModuleName=function(){return"ribbonColorPicker"},zo.prototype.destroy=function(){this.parent=null},zo.prototype.createColorPicker=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id}),r=(t.appendChild(i),e.colorPickerSettings),n=new E.ColorPicker({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,columns:r.columns,cssClass:(pt+v+(r.cssClass||"")).trim(),disabled:e.disabled,enableOpacity:r.enableOpacity,mode:r.mode,modeSwitcher:r.modeSwitcher,noColor:r.noColor,presetColors:r.presetColors,showButtons:r.showButtons,value:r.value,beforeClose:function(){n.element.parentElement.classList.remove(dt),r.beforeClose&&r.beforeClose.call(o)},beforeOpen:r.beforeOpen,beforeTileRender:r.beforeTileRender,created:r.created,change:function(e){r.value=e.value.toString(),r.change&&r.change.call(o,e)},open:function(){n.element.parentElement.classList.add(dt),r.open&&r.open.call(o)},select:r.select},i),t=(r.htmlAttributes&&(r.htmlAttributes.id&&delete r.htmlAttributes.id,ii(i,r.htmlAttributes)),n.element.parentElement);x.EventHandler.add(t,"mouseenter",this.toggleWrapperHover.bind(this,t,!0),this),x.EventHandler.add(t,"mouseleave",this.toggleWrapperHover.bind(this,t,!1),this)},zo.prototype.toggleWrapperHover=function(e,t){t?e.classList.add(lt):e.classList.remove(lt)},zo.prototype.addOverFlowEvents=function(t,e,o){var i,r=this,n=t.colorPickerSettings,n=(n.label&&"Simplified"===this.parent.activeLayout&&(n=this.parent.createElement("div",{className:"e-ribbon-colorpicker-label",id:t.id+"_label",innerHTML:n.label}),e.insertBefore(n,e.firstChild)),e.querySelector("#"+t.id)),s=(n.setAttribute("data-control",t.type.toString()),x.getComponent(n,E.ColorPicker)),e=(s.setProperties({cssClass:s.cssClass+v+ct}),s.splitBtn);s.beforeClose=function(e){i=e.event?e.event.target:null,s.element.parentElement.classList.remove(dt),t.colorPickerSettings.beforeClose&&t.colorPickerSettings.beforeClose.call(r)},e.close=function(){i&&!i.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},zo.prototype.removeOverFlowEvents=function(e,t){var o=this,i=(e.colorPickerSettings.label&&(i=t.querySelector("#"+e.id+"_label"))&&i.remove(),t.querySelector("#"+e.id)),r=x.getComponent(i,E.ColorPicker),t=(t=r.cssClass.split(v)).filter(function(e){return e!==ct});r.setProperties({cssClass:t.join(v)}),r.splitBtn.close=null,r.beforeClose=function(){r.element.parentElement.classList.remove(dt),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(o)}},zo.prototype.getColorPickerObj=function(e){e=I(this.parent,e);return e?x.getComponent(e,E.ColorPicker):null},zo.prototype.getValue=function(e,t,o){e=this.getColorPickerObj(e);return e?e.getValue(t,o):""},zo.prototype.toggle=function(e){e=this.getColorPickerObj(e);e&&!e.disabled&&e.toggle()},zo.prototype.updateColorPicker=function(e,t){var o=g(this.parent.tabs,t);o&&(x.merge(o.item.checkBoxSettings,e),t=I(this.parent,t,o))&&(e.cssClass&&(e.cssClass=(pt+v+e.cssClass).trim()),delete e.beforeClose,delete e.open,x.getComponent(t,E.ColorPicker).setProperties(e))},zo.prototype.unwireColorPickerEvents=function(e){e=x.getComponent(e,E.ColorPicker).element.parentElement;x.EventHandler.remove(e,"mouseenter",this.toggleWrapperHover),x.EventHandler.remove(e,"mouseleave",this.toggleWrapperHover)};$e=zo;function zo(e){this.parent=e}Ho.prototype.getModuleName=function(){return"ribbonComboBox"},Ho.prototype.destroy=function(){this.parent=null},Ho.prototype.createComboBox=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id}),r=(t.appendChild(i),e.comboBoxSettings);r.htmlAttributes&&r.htmlAttributes.id&&delete r.htmlAttributes.id,new P.ComboBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,allowCustom:!1,floatLabelType:"Never",ignoreAccent:!0,ignoreCase:!0,allowFiltering:r.allowFiltering,autofill:r.autofill,cssClass:(pt+v+(r.cssClass||"")).trim(),dataSource:r.dataSource,enabled:!e.disabled,fields:r.fields,filterType:r.filterType,footerTemplate:r.footerTemplate,groupTemplate:r.groupTemplate,headerTemplate:r.headerTemplate,index:r.index,itemTemplate:r.itemTemplate,noRecordsTemplate:r.noRecordsTemplate,placeholder:r.placeholder,popupHeight:r.popupHeight,popupWidth:r.popupWidth,showClearButton:r.showClearButton,sortOrder:r.sortOrder,text:r.text,value:r.value,width:r.width,beforeOpen:r.beforeOpen,open:r.open,htmlAttributes:r.htmlAttributes,close:function(e){r.close&&r.close.call(o,e)},filtering:r.filtering,change:r.change,select:r.select,created:r.created},i)},Ho.prototype.addOverFlowEvents=function(o,e,i){var r=this,t=o.comboBoxSettings,t=(t.label&&"Simplified"===this.parent.activeLayout&&(t=this.parent.createElement("div",{className:"e-ribbon-combobox-label",id:o.id+"_label",innerHTML:t.label}),e.insertBefore(t,e.firstChild)),e.querySelector("#"+o.id)),e=(t.setAttribute("data-control",o.type.toString()),x.getComponent(t,P.ComboBox));e.setProperties({cssClass:e.cssClass+v+ct}),e.close=function(e){var t=e.event?e.event.target:null;o.comboBoxSettings.close&&o.comboBoxSettings.close.call(r,e),t&&!t.closest(".e-ribbon-group-overflow-ddb")&&i.element.classList.contains("e-active")&&i.toggle()}},Ho.prototype.removeOverFlowEvents=function(t,e){var o=this,i=(t.comboBoxSettings.label&&(i=e.querySelector("#"+t.id+"_label"))&&i.remove(),e.querySelector("#"+t.id)),e=x.getComponent(i,P.ComboBox),i=(i=e.cssClass.split(v)).filter(function(e){return e!==ct});e.setProperties({cssClass:i.join(v)}),e.close=function(e){t.comboBoxSettings.close&&t.comboBoxSettings.close.call(o,e)}},Ho.prototype.getComboBoxObj=function(e){e=I(this.parent,e);return e?x.getComponent(e,P.ComboBox):null},Ho.prototype.filter=function(e,t,o,i){this.getComboBoxObj(e).filter(t,o,i)},Ho.prototype.hidePopup=function(e){e=this.getComboBoxObj(e);e&&e.hidePopup()},Ho.prototype.showPopup=function(e){e=this.getComboBoxObj(e);e&&e.showPopup()},Ho.prototype.updateComboBox=function(e,t){var o=g(this.parent.tabs,t);o&&(x.merge(o.item.comboBoxSettings,e),t=I(this.parent,t,o))&&(e.cssClass&&(e.cssClass=(pt+v+e.cssClass).trim()),delete e.close,x.getComponent(t,P.ComboBox).setProperties(e))};var No=Ho;function Ho(e){this.parent=e}f.prototype.getModuleName=function(){return"ribbonDropDown"},f.prototype.destroy=function(){this.parent=null},f.prototype.createDropDown=function(e,t){var o=this,i=this.parent.createElement("button",{id:e.id}),r=(t.appendChild(i),e.dropDownSettings),t=(tt+v+pt+v+(r.cssClass||"")).trim();new M.DropDownButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===R.RibbonItemSize.Large?"Top":"Left",closeActionEvents:r.closeActionEvents,content:e.activeSize===R.RibbonItemSize.Small?"":r.content,cssClass:t+(e.activeSize===R.RibbonItemSize.Large?v+nt:""),disabled:e.disabled,iconCss:r.iconCss,items:r.items,target:r.target,createPopupOnClick:r.createPopupOnClick,beforeClose:function(e){r.beforeClose&&r.beforeClose.call(o,e)},beforeItemRender:r.beforeItemRender,beforeOpen:r.beforeOpen,close:function(e){r.close&&r.close.call(o,e)},created:r.created,open:r.open,select:r.select}).appendTo(i),r.htmlAttributes&&(r.htmlAttributes.id&&delete r.htmlAttributes.id,ii(i,r.htmlAttributes))},f.prototype.addOverFlowEvents=function(t,e,o){var i,r=this,e=e.querySelector("#"+t.id),e=(e.setAttribute("data-control",t.type.toString()),x.getComponent(e,M.DropDownButton));e.cssClass=e.cssClass+v+ct,e.dataBind(),e.beforeClose=function(e){t.dropDownSettings.beforeClose&&t.dropDownSettings.beforeClose.call(r,e),i=e.event?e.event.target:null},e.close=function(e){t.dropDownSettings.close&&t.dropDownSettings.close.call(r,e),i&&!i.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},f.prototype.removeOverFlowEvents=function(t,e){var o=this,e=e.querySelector("#"+t.id),e=x.getComponent(e,M.DropDownButton),i=(i=e.cssClass.split(v)).filter(function(e){return e!==ct});e.cssClass=i.join(v),e.dataBind(),e.close=function(e){t.dropDownSettings.close&&t.dropDownSettings.close.call(o,e)},e.beforeClose=function(e){t.dropDownSettings.beforeClose&&t.dropDownSettings.beforeClose.call(o,e)}},f.prototype.createOverFlowDropDown=function(e,t,o,i,r,n){var s=this,n=(this.enableRtl=n,this.parent.createElement("button",{id:e+w+ko})),e=(i.setAttribute("tabindex","0"),r.appendChild(n),new M.DropDownButton({iconCss:o,target:i,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,cssClass:nt+v+Nt,iconPosition:"Top",content:t,beforeClose:function(e){e.cancel=!x.isNullOrUndefined(e.event&&x.closest(e.event.target,"."+ct))}},n));return ei(i,this.parent),n.onclick=n.onkeydown=function(){s.itemIndex=0},i.onkeydown=function(e){s.keyActionHandler(e,i)},e},f.prototype.keyActionHandler=function(e,t){var o,i=Array.prototype.slice.call(t.querySelectorAll(".e-control")),r=Array.prototype.slice.call(t.querySelectorAll(".e-ribbon-template")),n=i.concat(r),s=t.querySelectorAll(".e-combobox");if(s)for(var a=0;a<s.length;a++)s[parseInt(a.toString(),10)].closest(".e-input-focus")&&(o=s[parseInt(a.toString(),10)]);if(o)for(a=0;a<n.length;a++)n[parseInt(a.toString(),10)].classList.contains("e-combobox")&&n[parseInt(a.toString(),10)].closest(".e-input-focus")&&(this.itemIndex=a);(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-launcher-icon")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-first-item"))&&("ArrowRight"!==e.key&&(e.shiftKey||"Tab"!==e.key)||this.handleNavigation(e,!this.enableRtl,n),"ArrowLeft"===e.key||e.shiftKey&&"Tab"===e.key)&&this.handleNavigation(e,this.enableRtl,n)},f.prototype.handleNavigation=function(e,t,o){o[0].classList.contains("e-ribbon-first-item")||o[0].classList.add("e-ribbon-first-item"),o[o.length-1].classList.contains("e-ribbon-last-item")||o[o.length-1].classList.add("e-ribbon-last-item"),t?(0===this.itemIndex&&o[parseInt(this.itemIndex.toString(),10)].classList.contains("e-ribbon-first-item")&&this.updateItemIndex(e,o,!0),e.target.classList.contains("e-combobox")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-group-container")||!e.target.classList.contains("e-ribbon-first-item")&&0===this.itemIndex||!e.target.classList.contains("e-control")&&!e.target.classList.contains("e-ribbon-template")||(this.itemIndex++,this.updateItemIndex(e,o,!0)),e.target.classList.contains("e-ribbon-last-item")&&!this.focusLauncherIcon(e,o)&&(this.itemIndex=0,this.updateItemIndex(e,o,!0)),e.target.classList.contains("e-ribbon-launcher-icon")&&(this.itemIndex=0,this.updateItemIndex(e,o,!0))):(e.target.classList.contains("e-combobox")||0===this.itemIndex||(this.itemIndex--,this.updateItemIndex(e,o,!1)),e.target.classList.contains("e-ribbon-first-item")&&!this.focusLauncherIcon(e,o)&&(this.itemIndex=o.length-1,this.updateItemIndex(e,o,!1)),e.target.classList.contains("e-ribbon-launcher-icon")&&(this.itemIndex=o.length-1,this.updateItemIndex(e,o,!1))),e.target.classList.contains("e-combobox")&&"Tab"===e.key&&(t?this.itemIndex<o.length-1&&this.itemIndex++:0<this.itemIndex&&this.itemIndex--)},f.prototype.focusLauncherIcon=function(e,t){var o,t=t[parseInt(this.itemIndex.toString(),10)].closest(".e-ribbon-group-container");return!!(o=t?t.querySelector(".e-ribbon-launcher-icon"):o)&&("Tab"===e.key&&e.preventDefault(),t.querySelector(".e-ribbon-launcher-icon").focus(),!0)},f.prototype.updateItemIndex=function(e,t,o){for(var i=t[this.itemIndex].closest(".e-ribbon-item");i&&i.classList.contains("e-disabled");){if(o)if(this.itemIndex<t.length-1)this.itemIndex++;else{if(this.focusLauncherIcon(e,t))break;this.itemIndex=0}else if(0<this.itemIndex)this.itemIndex--;else{if(this.focusLauncherIcon(e,t))break;this.itemIndex=t.length-1}i=t[this.itemIndex].closest(".e-ribbon-item")}"Tab"===e.key&&e.preventDefault(),t[parseInt(this.itemIndex.toString(),10)].focus()},f.prototype.removeOverFlowDropDown=function(e){var t=x.getComponent(e,M.DropDownButton);x.getComponent(t.target,D.Tooltip).destroy(),e.parentElement.parentElement.insertBefore(t.target,e.parentElement),t.destroy(),x.remove(e)},f.prototype.getDDBItemElement=function(e,t){return x.getComponent(e,M.DropDownButton).dropDown.element.querySelector("#"+t)},f.prototype.getOverflowDropDownPopup=function(e,t){t=t.querySelector("#"+this.parent.tabs[e.tabIndex].groups[e.groupIndex].id+w+ko);return x.getComponent(t,M.DropDownButton).dropDown.element},f.prototype.getDropDownObj=function(e){e=I(this.parent,e);return e?x.getComponent(e,M.DropDownButton):null},f.prototype.addItems=function(e,t,o){this.getDropDownObj(e).addItems(t,o)},f.prototype.removeItems=function(e,t,o){this.getDropDownObj(e).removeItems(t,o)},f.prototype.toggle=function(e){e=this.getDropDownObj(e);e&&!e.disabled&&e.toggle()},f.prototype.updateDropDown=function(e,t){var o=g(this.parent.tabs,t);o&&(x.merge(o.item.dropDownSettings,e),t=I(this.parent,t,o))&&(t=x.getComponent(t,M.DropDownButton),e.cssClass&&(e.cssClass=(pt+v+tt+v+e.cssClass).trim(),e.cssClass=o.item.activeSize===R.RibbonItemSize.Large?(nt+v+e.cssClass).trim():e.cssClass,t.cssClass=e.cssClass),delete e.close,delete e.beforeClose,e.content&&(e.content=o.item.activeSize===R.RibbonItemSize.Small?"":e.content),t.setProperties(e))},f.prototype.updateDropDownSize=function(e,t){var e=x.getComponent(e,M.DropDownButton),o=e.cssClass.split(v);t.activeSize===R.RibbonItemSize.Large?o.push(nt):o=o.filter(function(e){return e!==nt}),e.cssClass=o.join(v),e.setProperties({iconPosition:t.activeSize===R.RibbonItemSize.Large?"Top":"Left"}),e.setProperties({content:t.activeSize===R.RibbonItemSize.Small?"":t.dropDownSettings.content})};var Wo=f;function f(e){this.parent=e}Ko.prototype.getModuleName=function(){return"ribbonSplitButton"},Ko.prototype.destroy=function(){this.parent=null},Ko.prototype.createSplitButton=function(e,t){var o=this,i=this.parent.createElement("button",{id:e.id}),r=(t.appendChild(i),e.splitButtonSettings),t=(tt+v+pt+v+(r.cssClass||"")).trim(),n=new M.SplitButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===R.RibbonItemSize.Large?"Top":"Left",closeActionEvents:r.closeActionEvents,cssClass:t+(e.activeSize===R.RibbonItemSize.Large?v+nt:""),disabled:e.disabled,iconCss:r.iconCss,items:r.items,target:r.target,beforeClose:function(e){r.beforeClose&&r.beforeClose.call(o,e)},beforeItemRender:r.beforeItemRender,beforeOpen:r.beforeOpen,close:function(){n.wrapper.classList.remove(dt),r.close&&r.close.call(o)},created:r.created,open:function(){n.wrapper.classList.add(dt),r.open&&r.open.call(o)},select:r.select,click:function(e){r.click&&r.click.call(o,e)}},i),s=(r.htmlAttributes&&(r.htmlAttributes.id&&delete r.htmlAttributes.id,ii(i,r.htmlAttributes)),i.parentElement.querySelector(".e-dropdown-btn")),a=(s.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),s.click())},this.setContent(e,n),n.wrapper);x.EventHandler.add(a,"mouseenter",function(){a.classList.add(lt)},this),x.EventHandler.add(a,"mouseleave",function(){a.classList.remove(lt)},this)},Ko.prototype.addOverFlowEvents=function(t,e,o){var i,r=this,e=e.querySelector("#"+t.id),n=(e.setAttribute("data-control",t.type.toString()),x.getComponent(e,M.SplitButton)),s=(n.cssClass=n.cssClass+v+ct,n.dataBind(),e.parentElement.querySelector(".e-dropdown-btn")),e=s.getAttribute("id"),a=document.querySelector("#"+e+"-popup");s.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),s.click())},a.onkeydown=function(e){"Enter"===e.key&&(e.preventDefault(),n.wrapper.classList.remove("e-ribbon-open"),a.querySelector(".e-focused").click())},n.beforeClose=function(e){t.splitButtonSettings.beforeClose&&t.splitButtonSettings.beforeClose.call(r,e),i=e.event?e.event.target:null},n.click=function(e){t.splitButtonSettings.click&&t.splitButtonSettings.click.call(r,e),o.element.classList.contains("e-active")&&o.toggle()},n.close=function(e){t.splitButtonSettings.close&&t.splitButtonSettings.close.call(r,e),n.wrapper.classList.remove(dt),i&&!i.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},Ko.prototype.removeOverFlowEvents=function(t,e){var o=this,e=e.querySelector("#"+t.id),i=x.getComponent(e,M.SplitButton),e=(e=i.cssClass.split(v)).filter(function(e){return e!==ct});i.cssClass=e.join(v),i.dataBind(),i.beforeClose=function(e){t.splitButtonSettings.beforeClose&&t.splitButtonSettings.beforeClose.call(o,e)},i.click=function(e){t.splitButtonSettings.click&&t.splitButtonSettings.click.call(o,e)},i.close=function(e){t.splitButtonSettings.close&&t.splitButtonSettings.close.call(o,e),i.wrapper.classList.remove(dt)}},Ko.prototype.setContent=function(e,t){t.primaryBtnObj.setProperties({content:e.activeSize===R.RibbonItemSize.Medium?e.splitButtonSettings.content:""}),t.secondaryBtnObj.setProperties({content:e.activeSize===R.RibbonItemSize.Large?e.splitButtonSettings.content:""})},Ko.prototype.getSplitButtonObj=function(e){e=I(this.parent,e);return x.getComponent(e,M.SplitButton)},Ko.prototype.addItems=function(e,t,o){this.getSplitButtonObj(e).addItems(t,o)},Ko.prototype.removeItems=function(e,t,o){this.getSplitButtonObj(e).removeItems(t,o)},Ko.prototype.toggle=function(e){e=this.getSplitButtonObj(e);e&&!e.disabled&&e.toggle()},Ko.prototype.updateSplitButton=function(e,t){var o=g(this.parent.tabs,t);o&&(x.merge(o.item.splitButtonSettings,e),t=I(this.parent,t,o))&&(t=x.getComponent(t,M.SplitButton),e.cssClass&&(e.cssClass=(pt+v+tt+v+e.cssClass).trim(),e.cssClass=o.item.activeSize===R.RibbonItemSize.Large?(nt+v+e.cssClass).trim():e.cssClass,t.cssClass=e.cssClass),delete e.open,delete e.click,delete e.close,delete e.beforeClose,t.setProperties(e),e.content)&&this.setContent(o.item,t)},Ko.prototype.updateSplitButtonSize=function(e,t){var e=x.getComponent(e,M.SplitButton),o=e.cssClass.split(v);t.activeSize===R.RibbonItemSize.Large?o.push(nt):o=o.filter(function(e){return e!==nt}),e.cssClass=o.join(v),e.setProperties({iconPosition:t.activeSize===R.RibbonItemSize.Large?"Top":"Left"}),this.setContent(t,e)};var Fo=Ko;function Ko(e){this.parent=e}function S(e,t){for(var o=0;o<e.length;o++)if(t(e[parseInt(o.toString(),10)],o))return o;return-1}function Uo(t){if("string"!=typeof t)return x.compile(t);var o="";try{var e=x.select(t),o=e?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){o=t}return x.compile(o)}function g(e,t,o){for(var i=0;i<e.length;i++)for(var r=e[parseInt(i.toString(),10)],n=0;n<r.groups.length;n++)for(var s=r.groups[parseInt(n.toString(),10)],a=0;a<s.collections.length;a++)for(var l=s.collections[parseInt(a.toString(),10)],p=0;p<l.items.length;p++){var c=l.items[parseInt(p.toString(),10)];if(t&&c.id===t||o&&c.type===o)return{item:c,collection:l,group:s,tabIndex:i,groupIndex:n,collectionIndex:a,itemIndex:p}}return null}function Vo(e,t){for(var o=0;o<e.length;o++)for(var i=e[parseInt(o.toString(),10)],r=0;r<i.groups.length;r++)for(var n=i.groups[parseInt(r.toString(),10)],s=0;s<n.collections.length;s++){var a=n.collections[parseInt(s.toString(),10)];if(a.id===t)return{collection:a,group:n,tabIndex:o,groupIndex:r,collectionIndex:s}}return null}function Xo(e,t){for(var o=0;o<e.length;o++)for(var i=e[parseInt(o.toString(),10)],r=0;r<i.groups.length;r++){var n=i.groups[parseInt(r.toString(),10)];if(n.id===t)return{group:n,tabIndex:o,groupIndex:r}}return null}function Yo(e,t){x.getComponent(e,t).destroy()}function Zo(e,t,o){x.getComponent(e,t).setProperties(o)}function Jo(e,t,o){x.getComponent(e,t).setProperties("combobox"===t?{enabled:!o}:{disabled:o})}function I(e,t,o){var i;return!(o=o||g(e.tabs,t))||""===(i=e.tabObj.items[o.tabIndex].content).innerHTML?null:e.activeLayout===R.RibbonLayout.Classic?o.item.displayOptions&R.DisplayMode.Classic?(i=o.group.isCollapsed?e.ribbonDropDownModule.getOverflowDropDownPopup(o,i):i).querySelector("#"+t):null:(o.item.displayOptions&R.DisplayMode.Simplified?i.querySelector("#"+o.item.id):null)||(o.group.enableGroupOverflow?x.getComponent(i.querySelector("#"+o.group.id+_),M.DropDownButton):e.overflowDDB).target.querySelector("#"+o.item.id)}function Qo(e){return!!(e.content||e.iconCss||e.title||e.id||e.cssClass)}function $o(e,t,o){var i,r=e.target.getAttribute("id"),e=o.filter(function(e){return e.id===r})[0].data,o=t.createElement("div",{id:e.id?ao+"_"+e.id:ao}),n=(t.element.append(o),e.title&&(n=t.createElement("div",{innerHTML:e.title,className:ro}),o.appendChild(n)),t.createElement("div",{className:lo}));o.appendChild(n),e.iconCss&&(i=t.createElement("div",{className:e.iconCss+" "+so}),n.appendChild(i)),e.content&&(i=t.createElement("div",{innerHTML:e.content,className:no}),n.appendChild(i)),t.setProperties({content:o,cssClass:e.cssClass?e.cssClass+" "+oo:oo})}function ei(e,t){var o=new D.Tooltip({target:"."+io,beforeRender:function(e){$o(e,o,t.tooltipData)}.bind(this),windowCollision:!0});o.appendTo(e)}function ti(e){x.getComponent(e,D.Tooltip).destroy()}function oi(e,t){x.getComponent(e,D.Tooltip).setProperties(t)}function ii(e,t){for(var o in t){var i;"class"===o?(i=t.class.replace(/\s+/g," ").trim())&&x.addClass([e],i.split(" ")):"style"===o?(i=""+(e.getAttribute("style")||"")+t[""+o],e.setAttribute(""+o,i)):e.setAttribute(o,t[""+o])}}ni.prototype.getModuleName=function(){return"ribbonGroupButton"},ni.prototype.destroy=function(){this.parent=null},ni.prototype.createGroupButton=function(t,e){var o=this,i=t.groupButtonSettings,r=(this.count=0,this.parent.createElement("div",{id:t.id+G,className:"e-btn-group"}));e.appendChild(r);for(var n,s=0;s<i.items.length;s++)i.items[parseInt(s.toString(),10)].iconCss&&(n=this.parent.createElement("button",{id:t.id+G+s,className:Dt}),r.appendChild(n),new u.Button({iconCss:i.items[parseInt(s.toString(),10)].iconCss,disabled:t.disabled,enableRtl:this.parent.enableRtl,content:t.activeSize===R.RibbonItemSize.Small?"":i.items[parseInt(s.toString(),10)].content,iconPosition:t.activeSize===R.RibbonItemSize.Large?"Top":"Left"},n),i.items[parseInt(s.toString(),10)].htmlAttributes&&ii(n,i.items[parseInt(s.toString(),10)].htmlAttributes),i.items[parseInt(s.toString(),10)].content?(n.classList.add(xt),n.setAttribute("aria-label",i.items[parseInt(s.toString(),10)].content)):n.setAttribute("aria-label","groupbuttonitem"),c=e.querySelector("#"+t.id+G+s),i.selection===R.RibbonGroupButtonSelection.Single?r.classList.add(Pt):r.classList.add(Et),i.items[parseInt(s.toString(),10)].selected&&(i.selection===R.RibbonGroupButtonSelection.Multiple?c.classList.add("e-active"):this.count<1&&(c.classList.add("e-active"),this.count++),this.grpBtnIndex=s),i.items[parseInt(s.toString(),10)].ribbonTooltipSettings&&Qo(i.items[parseInt(s.toString(),10)].ribbonTooltipSettings)&&(n.classList.add(io),this.parent.tooltipData.push({id:n.id,data:i.items[parseInt(s.toString(),10)].ribbonTooltipSettings})),x.EventHandler.add(c,"click",this.groupButtonClicked.bind(this,s,t,i),this));if("Simplified"===this.parent.activeLayout){var a=void 0,l=0,p=0,c=this.parent.createElement("button",{id:t.id});e.appendChild(c);for(s=0;s<i.items.length;s++)t.groupButtonSettings.items[parseInt(s.toString(),10)].selected&&!this.isSelected&&i.selection===R.RibbonGroupButtonSelection.Single?(a=t.groupButtonSettings.items[parseInt(s.toString(),10)].iconCss,this.isSelected=!0):t.groupButtonSettings.items[parseInt(s.toString(),10)].selected&&i.selection===R.RibbonGroupButtonSelection.Multiple&&(a=1===++l?t.groupButtonSettings.items[parseInt(s.toString(),10)].iconCss:null);for(;p<t.groupButtonSettings.items.length&&!this.isSelected&&!a;)t.groupButtonSettings.items[parseInt(p.toString(),10)].iconCss&&(a=t.groupButtonSettings.items[parseInt(p.toString(),10)].iconCss,this.isSelected=!0),p++;var d=new M.DropDownButton({iconCss:a,target:r,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:t.disabled},c);i.header&&(d=d.dropDown,this.addGroupButtonHeader(t.id,i,d.element)),c.onclick=c.onkeydown=function(){o.handleFocusState(t,e)},r.onkeydown=function(e){"Simplified"===o.parent.activeLayout&&o.handleGroupButtonNavigation(e,t)},ei(r,this.parent),this.isSelected=!1}},ni.prototype.groupButtonClicked=function(e,t,o){for(var i=[],r=[],n=[],s=document.querySelector("#"+t.id),a=0;a<o.items.length;a++)document.querySelector("#"+t.id+G+a)&&document.querySelector("#"+t.id+G+a).classList.contains("e-active")&&i.push(o.items[parseInt(a.toString(),10)]);document.querySelector("#"+t.id+G+e).classList.contains("e-active")||r.push(o.items[parseInt(e.toString(),10)]);r={cancel:!1,previousItems:i,selectingItems:r};if(o.items[parseInt(e.toString(),10)].beforeClick&&o.items[parseInt(e.toString(),10)].beforeClick.call(this,r),!r.cancel){if(o.selection===R.RibbonGroupButtonSelection.Single){document.querySelector("#"+t.id+G).classList.contains(Et)&&(document.querySelector("#"+t.id+G).classList.remove(Et),document.querySelector("#"+t.id+G).classList.add(Pt));for(a=0;a<o.items.length;a++)document.querySelector("#"+t.id+G+a)&&document.querySelector("#"+t.id+G+a).classList.contains("e-active")&&(document.querySelector("#"+t.id+G+a).classList.remove("e-active"),o.items[parseInt(a.toString(),10)].setProperties({selected:!1},!0));document.querySelector("#"+t.id+G+e).classList.toggle("e-active"),o.items[parseInt(e.toString(),10)].setProperties({selected:!0},!0),document.querySelector("#"+t.id+G+e).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&(this.grpBtnIndex=e,(u=x.getComponent(s,M.DropDownButton)).setProperties({iconCss:o.items[parseInt(e.toString(),10)].iconCss}))}else{document.querySelector("#"+t.id+G).classList.contains(Pt)&&(document.querySelector("#"+t.id+G).classList.remove(Pt),document.querySelector("#"+t.id+G).classList.add(Et)),document.querySelector("#"+t.id+G+e).classList.toggle("e-active"),document.querySelector("#"+t.id+G+e).classList.contains("e-active")?o.items[parseInt(e.toString(),10)].setProperties({selected:!0},!0):o.items[parseInt(e.toString(),10)].setProperties({selected:!1},!0);for(var l=0,p=0;p<o.items.length;p++)document.querySelector("#"+t.id+G+p)&&document.querySelector("#"+t.id+G+p).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&p!==e&&(this.isSelected=!0,l++);if("Simplified"===this.parent.activeLayout){var c=null,d=0,u=x.getComponent(s,M.DropDownButton);if(this.isSelected){if(1===l&&!document.querySelector("#"+t.id+G+e).classList.contains("e-active"))for(p=0;p<o.items.length;p++)document.querySelector("#"+t.id+G+p)&&document.querySelector("#"+t.id+G+p).classList.contains("e-active")&&(c=o.items[parseInt(p.toString(),10)].iconCss)}else document.querySelector("#"+t.id+G+e).classList.contains("e-active")&&(c=o.items[parseInt(e.toString(),10)].iconCss);for(;d<o.items.length&&!c;)o.items[parseInt(d.toString(),10)].iconCss&&(c=o.items[parseInt(d.toString(),10)].iconCss),d++;u.setProperties({iconCss:c}),this.grpBtnIndex=e}this.isSelected=!1}document.querySelector("#"+t.id+G+e).classList.contains("e-active")&&n.push(o.items[parseInt(e.toString(),10)]);r={previousItems:i,selectedItems:n};o.items[parseInt(e.toString(),10)].click&&o.items[parseInt(e.toString(),10)].click.call(this,r),"Simplified"===this.parent.activeLayout&&s&&(u=x.getComponent(s,M.DropDownButton)).toggle()}},ni.prototype.switchGroupButton=function(t,e){var o=this,i=t.groupButtonSettings,r=null,n=0,s=0;if("Simplified"===this.parent.activeLayout){var a=e.querySelector("#"+t.id+G),l=this.parent.createElement("button",{id:t.id});e.appendChild(l);for(var p=0;p<i.items.length;p++)document.querySelector("#"+t.id+G+p)&&(document.querySelector("#"+t.id+G+p).classList.contains("e-active")&&i.selection===R.RibbonGroupButtonSelection.Single?r=i.items[parseInt(p.toString(),10)].iconCss:document.querySelector("#"+t.id+G+p).classList.contains("e-active")&&i.selection===R.RibbonGroupButtonSelection.Multiple&&(1===++n?r=i.items[parseInt(p.toString(),10)].iconCss:1<n&&(r=null)));for(;s<i.items.length&&!r;)i.items[parseInt(s.toString(),10)].iconCss&&(r=i.items[parseInt(s.toString(),10)].iconCss),s++;var c=new M.DropDownButton({iconCss:r,target:a,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:t.disabled},l);i.header&&(d=c.dropDown,this.addGroupButtonHeader(t.id,i,d.element)),l.onclick=l.onkeydown=function(){o.handleFocusState(t,e)},a.onkeydown=function(e){"Simplified"===o.parent.activeLayout&&o.handleGroupButtonNavigation(e,t)},ei(a,this.parent)}else{var d=e.querySelector("#"+t.id),c=x.getComponent(d,M.DropDownButton);e.appendChild(c.target),d&&(c.destroy(),x.remove(d))}},ni.prototype.handleFocusState=function(e,t){t.querySelector("#"+e.id).classList.contains("e-active")&&(document.querySelector("#"+e.id+"_grpbtn").querySelector("."+Dt+".e-active")||document.querySelector("#"+e.id+G+0)).focus()},ni.prototype.addGroupButtonHeader=function(e,t,o){e=this.parent.createElement("div",{className:"e-ribbon-groupbutton-header",id:e+q,innerHTML:t.header});o.insertBefore(e,o.firstChild)},ni.prototype.handleGroupButtonNavigation=function(e,t){var o=document.querySelector("#"+t.id),o=x.getComponent(o,M.DropDownButton).target,i=!1,o=("Simplified"===this.parent.activeLayout&&o.closest(".e-ribbon-dropdown-group-button").classList.contains(Rt)&&(i=!0),"Tab"===e.key&&e.preventDefault(),t.groupButtonSettings);"ArrowRight"===e.key&&!i||"ArrowDown"===e.key&&i?(!this.parent.enableRtl||"ArrowDown"===e.key&&i?(this.grpBtnIndex++,this.grpBtnIndex<o.items.length||(this.grpBtnIndex=0)):0===this.grpBtnIndex?this.grpBtnIndex=o.items.length-1:this.grpBtnIndex--,document.querySelector("#"+t.id+G+this.grpBtnIndex).focus()):("ArrowLeft"===e.key&&!i||"ArrowUp"===e.key&&i)&&(!this.parent.enableRtl||"ArrowUp"===e.key&&i?0===this.grpBtnIndex?this.grpBtnIndex=o.items.length-1:this.grpBtnIndex--:(this.grpBtnIndex++,this.grpBtnIndex<o.items.length||(this.grpBtnIndex=0)),document.querySelector("#"+t.id+G+this.grpBtnIndex).focus())},ni.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=e.groupButtonSettings,n=!0,s=t.querySelector("#"+e.id);if(s){var s=x.getComponent(s,M.DropDownButton),a=(s.setProperties({cssClass:s.cssClass+v+Rt,content:r.header||""}),s.target);if(a.children.length){for(var l=0;l<a.children.length;l++)if(r.items[parseInt(l.toString(),10)].content){n=!1;break}n&&a.classList.add("e-icon-btn")}a.onclick=function(){"Simplified"===i.parent.activeLayout&&a.closest(".e-ribbon-dropdown-group-button").classList.contains(Rt)&&o.element.classList.contains("e-active")&&o.toggle()}}s=t.querySelector("#"+e.id+"_grpbtn");"Classic"===this.parent.activeLayout&&s&&(s.onclick=function(){o.element.classList.contains("e-active")&&o.toggle()})},ni.prototype.removeOverFlowEvents=function(e,t){var t=t.querySelector("#"+e.id);t&&((t=(e=x.getComponent(t,M.DropDownButton)).target).classList.contains("e-icon-btn")&&t.classList.remove("e-icon-btn"),t=(t=e.cssClass.split(v)).filter(function(e){return e!==Rt}),e.setProperties({cssClass:t.join(v),content:""}))},ni.prototype.destroyDropDown=function(e){var t,e=document.querySelector("#"+e.id);e&&(t=x.getComponent(e,M.DropDownButton),x.getComponent(t.target,D.Tooltip).destroy(),t.destroy(),x.remove(e))},ni.prototype.updateGroupButtonSize=function(e,t){for(var o,i=t.groupButtonSettings,r=0;r<i.items.length;r++)(o=("Classic"===this.parent.activeLayout?e:document).querySelector("#"+t.id+G+r))&&x.getComponent(o,u.Button).setProperties({iconPosition:t.activeSize===R.RibbonItemSize.Large?"Top":"Left",content:t.activeSize===R.RibbonItemSize.Small?"":i.items[parseInt(r.toString(),10)].content})};var ri=ni;function ni(e){this.grpBtnIndex=0,this.parent=e,this.isSelected=!1}C.prototype.getModuleName=function(){return"ribbonGallery"},C.prototype.destroy=function(){this.parent=null},C.prototype.createGallery=function(i,e){var s=this,r=i.gallerySettings,t=(this.renderGalleryItems(r,!1,i.id,e),this.parent.createElement("button",{id:i.id+"_popupButton",className:"e-ribbon-gallery-button e-icons e-drop-icon"}));t.setAttribute("aria-label","gallerydropdownbutton"),e.appendChild(t),this.createPopup(i,t),t.onclick=function(e){var t,o=document.querySelector("#"+i.id+"_galleryPopup");o&&(t=x.getComponent(o,D.Popup),o.classList.contains("e-popup-close")?s.showPopup(t,o,e,r,i.id):s.hidePopup(t,o,e,r,i.id))},document.onclick=function(e){for(var t,o,i=document.querySelectorAll(".e-ribbon-gallery-popup.e-popup-open"),r=0;r<i.length;r++){var n=x.getComponent(i[parseInt(r.toString(),10)],D.Popup);if(!e.target.classList.contains("e-ribbon-gallery-button")){t=i[parseInt(r.toString(),10)].id.replace(/_galleryPopup/g,""),o=g(s.parent.tabs,t),s.hidePopup(n,i[parseInt(r.toString(),10)],e,o.item.gallerySettings,t);break}if(t=i[parseInt(r.toString(),10)].id.replace(/_galleryPopup/g,""),e.target.id.replace(/_popupButton/g,"")!==t){o=g(s.parent.tabs,t),s.hidePopup(n,i[parseInt(r.toString(),10)],e,o.item.gallerySettings,t);break}}}},C.prototype.renderGalleryItems=function(r,n,s,a){for(var l,p,c=this,e=g(this.parent.tabs,s),d=(e&&e.group&&(e.group.isCollapsible=!1),this.parent.createElement("div",{className:"e-ribbon-gallery-wrapper",id:s+"_galleryWrapper"})),t=(n||a.appendChild(d),function(o){for(var e,i=!1,t=(l=u.parent.createElement("ol",{className:"e-ribbon-gallery-container",id:s+"_galleryContainer"+o}),r.groups[parseInt(o.toString(),10)].itemHeight&&"auto"!==r.groups[parseInt(o.toString(),10)].itemHeight&&(i=!0),r.groups[parseInt(o.toString(),10)].cssClass&&l.classList.add(r.groups[parseInt(o.toString(),10)].cssClass),0);t<r.groups[parseInt(o.toString(),10)].items.length&&"break"!==function(t){p=u.parent.createElement("li",{className:"e-ribbon-gallery-item",id:(n?"popup_":"")+l.id+"_gallery"+t,attrs:{tabindex:"0"}});var e={name:"beforeItemRender",item:r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)]};if(r.beforeItemRender&&r.beforeItemRender.call(u,e),l.appendChild(p),r.selectedItemIndex&&r.selectedItemIndex===u.count?p.classList.add("e-ribbon-gallery-selected"):r.selectedItemIndex||0!==u.count||(p.classList.add("e-ribbon-gallery-selected"),r.selectedItemIndex=u.count),u.count=u.count+1,p.onclick=function(e){c.setActiveState(e.currentTarget,r,s,!0,e,n)},p.onkeydown=function(e){"Enter"!==e.key&&" "!==e.key||c.setActiveState(e.currentTarget,r,s,!0,e,n)},p.onmouseover=function(e){e={event:e,name:"itemHover",item:r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)]};r.itemHover&&r.itemHover.call(c,e)},r.groups[parseInt(o.toString(),10)].itemWidth&&"auto"!==r.groups[parseInt(o.toString(),10)].itemWidth&&(p.style.width=r.groups[parseInt(o.toString(),10)].itemWidth+"px"),r.groups[parseInt(o.toString(),10)].itemHeight&&"auto"!==r.groups[parseInt(o.toString(),10)].itemHeight&&(p.style.height=r.groups[parseInt(o.toString(),10)].itemHeight+"px","Simplified"===u.parent.activeLayout||n||(l.style.flexFlow="wrap")),(!r.template&&!r.popupTemplate||r.template&&!r.popupTemplate&&n||r.popupTemplate&&!r.template&&!n)&&(r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].htmlAttributes&&ii(p,r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].htmlAttributes),r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].iconCss&&(e=u.parent.createElement("span",{className:"e-ribbon-gallery-icons "+r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].iconCss}),p.appendChild(e),"Simplified"!==u.parent.activeLayout||n||e.classList.add("e-hidden")),r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].content&&p.appendChild(u.parent.createElement("span",{innerHTML:r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].content,className:"e-ribbon-gallery-text"})),r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].disabled&&p.classList.add("e-disabled"),r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].cssClass)&&p.classList.add(r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].cssClass),r.template&&!n&&u.createGalleryTemplate(p,r,s,r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)]),r.popupTemplate&&n&&u.createGalleryPopupTemplate(p,r,s,r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)]),!n&&!i&&r.itemCount===u.count)return d.appendChild(l),u.isAdded=!0,"break"}(t);t++);if(u.isAdded&&!n)return"break";(n?a:d).appendChild(l),n&&r.groups[parseInt(o.toString(),10)].header&&(e=u.parent.createElement("div",{className:"e-ribbon-gallery-header",innerHTML:r.groups[parseInt(o.toString(),10)].header}),a.insertBefore(e,l))}),u=this,o=0;o<r.groups.length&&"break"!==t(o);o++);this.count=0,this.isAdded=!1,this.parent.isReact&&(this.parent.portals=this.parent.portals.concat(this.portals),this.parent.renderReactTemplates(),this.portals=void 0)},C.prototype.setWrapperWidth=function(e,t,o,i){for(var r=1,n=0,s=!1,a=0;a<o.groups.length;a++){for(var l=0;l<o.groups[parseInt(a.toString(),10)].items.length;l++){if(!(r<=e)){s=!0;break}var p,c=t.querySelector("#"+i+"_galleryContainer"+a+"_gallery"+l);c&&(n+=c.offsetWidth,c=window.getComputedStyle(c))&&(p=parseFloat(c.paddingLeft)+parseFloat(c.paddingRight),x.isNullOrUndefined(p)||(n+=p),p=parseFloat(c.marginLeft)+parseFloat(c.marginRight),x.isNullOrUndefined(p)||(n+=p)),r++}if(s)break}0<n&&(t.style.width=n+"px")},C.prototype.setWrapperStyle=function(e,t){"auto"!==e.width&&t.forEach(function(e){e.style.flexFlow="wrap"})},C.prototype.checkAvailableHeight=function(e){for(var t=e.querySelectorAll(".e-ribbon-gallery-wrapper"),o=0;o<t.length;o++){var i=0,r=0,n=!1,s=t[parseInt(o.toString(),10)],a=s.id.replace(/_galleryWrapper/g,""),l=s.offsetHeight,p=g(this.parent.tabs,a);if(p){this.setWrapperWidth(p.item.gallerySettings.itemCount,s,p.item.gallerySettings,a);for(var c=0;c<p.item.gallerySettings.groups.length;c++)for(var d=0;d<p.item.gallerySettings.groups[parseInt(c.toString(),10)].items.length;d++){var u,h,b=s.querySelector("#"+a+"_galleryContainer"+c+"_gallery"+d);b&&("Classic"===this.parent.activeLayout?(b.classList.contains("e-hidden")&&b.classList.remove("e-hidden"),n?b.remove():(u=0,(h=window.getComputedStyle(b))&&(h=parseFloat(h.marginTop)+parseFloat(h.marginBottom),x.isNullOrUndefined(h)||(u+=h)),i++,p.item.gallerySettings.itemCount===i?(i=0,l>=b.offsetHeight+u?l-=b.offsetHeight+u:(n=!0,b.remove())):l<b.offsetHeight+u&&(n=!0,b.remove()))):++r>p.item.gallerySettings.itemCount&&b.classList.add("e-hidden"))}}}},C.prototype.checkCollision=function(e,t,o){void 0===o&&(o=0);var i=0,r=0;if(t){for(var n=window.innerWidth,s=0===o?n:Math.abs(n-(n-o)),a=window.getComputedStyle(t),l=(a&&(i=parseFloat(a.paddingLeft)+parseFloat(a.paddingRight),x.isNullOrUndefined(i)||(s-=i)),t.querySelectorAll(".e-ribbon-gallery-container")),p=(this.setWrapperStyle(e,l),!1),c=0;c<l.length;c++){for(var d=0,u=0;u<l[parseInt(c.toString(),10)].querySelectorAll(".e-ribbon-gallery-item").length;u++){var h=window.getComputedStyle(l[parseInt(c.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)]);if(h&&(r=parseFloat(h.marginLeft)+parseFloat(h.marginRight),x.isNullOrUndefined(r)||(d+=r)),s<=(d+=Math.round(parseFloat(h.width)))&&"auto"===e.width||"auto"!==e.width&&s<=parseInt(e.width.toString(),10)&&s<=d){t.style.width=d+Math.abs(i-r)-Math.round(parseFloat(h.width))+"px",p=!0;break}}if(p){l.forEach(function(e){e.style.flexFlow="wrap"}),"auto"===e.height&&this.setGalleryPopupHeight(t,parseFloat(a.height),parseFloat(a.top));break}}p||("auto"===e.width?(l.forEach(function(e){e.style.flexFlow="nowrap"}),t.style.width="auto"):t.style.width=e.width.toString(),"auto"===e.height&&this.setGalleryPopupHeight(t,parseFloat(a.height),parseFloat(a.top)))}},C.prototype.setGalleryPopupHeight=function(e,t,o){window.innerHeight<t||window.innerHeight<Math.round(t+o)?e.style.height=window.innerHeight-o+"px":e.style.height="auto"},C.prototype.createPopup=function(e,t){var o=this.parent.createElement("div",{className:"e-ribbon-popup-container",id:e.id+"_popupContainer"}),i=(this.renderGalleryItems(e.gallerySettings,!0,e.id,o),this.parent.createElement("div",{className:"e-ribbon-gallery-popup",id:e.id+"_galleryPopup"}));document.body.append(i),new D.Popup(i,{relateTo:t,content:o,collision:{X:"fit",Y:"flip"},actionOnScroll:"hide",targetType:"relative",position:{X:"left",Y:"bottom"},enableRtl:this.parent.enableRtl,width:e.gallerySettings.popupWidth,height:e.gallerySettings.popupHeight}).hide()},C.prototype.switchGalleryItems=function(e,t){var o=this.parent.element.querySelector("#"+t+j),i=g(this.parent.tabs,t);if(o){var r=o.querySelectorAll(".e-ribbon-gallery-icons"),n=o.querySelectorAll(".e-ribbon-gallery-container");if(r.length)for(var s=0;s<r.length;s++)"Simplified"===e?r[parseInt(s.toString(),10)].classList.add("e-hidden"):r[parseInt(s.toString(),10)].classList.remove("e-hidden");if(n.length&&i)for(var a=0;a<i.item.gallerySettings.groups.length;a++)for(s=0;s<n.length;s++)i.item.gallerySettings.groups[parseInt(a.toString(),10)].itemHeight&&"auto"!==i.item.gallerySettings.groups[parseInt(a.toString(),10)].itemHeight&&t+"_galleryContainer"+a===n[parseInt(s.toString(),10)].id&&(n[parseInt(s.toString(),10)].style.flexFlow="Simplified"===e?"nowrap":"wrap");o=this.parent.tabObj.element.querySelector("#"+this.parent.tabs[this.parent.selectedTab].id+A);o&&this.checkAvailableHeight(o)}},C.prototype.addOverFlowEvents=function(t,e){var o=this;if(e.closest(".e-ribbon-overflow-target")){var i=this.parent.createElement("button",{id:t.id}),e=(e.appendChild(i),e.querySelector(".e-ribbon-gallery-wrapper").classList.contains("e-disabled")&&i.classList.add("e-disabled"),e.querySelector(".e-ribbon-gallery-wrapper").classList.add("e-hidden"),e.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.add("e-hidden")}),e.querySelector("#"+t.id+"_popupButton")),e=(e&&e.classList.add("e-hidden"),g(this.parent.tabs,t.id)),r=e&&e.group.groupIconCss?e.group.groupIconCss:"",e=e&&e.group.header?e.group.header:"";if(!r)for(var n=0;n<t.gallerySettings.groups.length;n++){for(var s=0;s<t.gallerySettings.groups[parseInt(n.toString(),10)].items.length;s++)if(t.gallerySettings.groups[parseInt(n.toString(),10)].items[parseInt(s.toString(),10)].iconCss){r=t.gallerySettings.groups[parseInt(n.toString(),10)].items[parseInt(s.toString(),10)].iconCss;break}if(r)break}var a=document.querySelector("#"+t.id+"_galleryPopup"),l=x.getComponent(a,D.Popup),p=document.querySelector("#"+t.id+"_galleryPopup .e-ribbon-popup-container"),a=new M.DropDownButton({iconCss:r,content:e,target:p,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-gallery-dropdown",disabled:t.disabled,open:function(){var e=p.querySelectorAll(".e-ribbon-gallery-container");o.setWrapperStyle(l,e),o.setFoucsToFirstItem(p,!0,t.id)},beforeClose:function(e){o.popupEvents(e.event,t.gallerySettings,"popupClose",!1)&&(e.cancel=!0)}},i);"auto"!==l.width&&(a.dropDown.width=x.formatUnit(l.width)),"auto"!==l.height&&(a.dropDown.height=x.formatUnit(l.height),a.dropDown.element.style.height=l.height.toString())}},C.prototype.removeOverFlowEvents=function(e,t){var o=t.querySelector("#"+e.id+"_popupButton"),o=(o&&o.classList.remove("e-hidden"),t.querySelector(".e-ribbon-gallery-wrapper").classList.remove("e-hidden"),t.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.remove("e-hidden")}),document.querySelector("#"+e.id));o&&(t=document.querySelector("#"+e.id+"_galleryPopup"),e=x.getComponent(o,M.DropDownButton),t.appendChild(e.target),e.destroy(),x.remove(o))},C.prototype.setActiveState=function(e,t,o,i,r,n){var s,a,l=document.querySelector("#"+o+j),p=Array.prototype.slice.call(l.querySelectorAll(".e-ribbon-gallery-selected")),l=document.querySelector("#"+o+"_popupContainer"),l=Array.prototype.slice.call(l.querySelectorAll(".e-ribbon-gallery-selected"));l.length&&(p=p.concat(l));for(var c=0;c<t.groups.length;c++)for(var d=0;d<t.groups[parseInt(c.toString(),10)].items.length;d++)p[0].id===o+"_galleryContainer"+c+"_gallery"+d&&(s=t.groups[parseInt(c.toString(),10)].items[parseInt(d.toString(),10)]),e.id===(n?"popup_":"")+o+"_galleryContainer"+c+"_gallery"+d&&(a=t.groups[parseInt(c.toString(),10)].items[parseInt(d.toString(),10)]);var u,l=document.getElementById(e.id),h={cancel:!1,name:"beforeSelect",previousItem:s,currentItem:a,isInteracted:i,event:r};if(t.beforeSelect&&t.beforeSelect.call(this,h),!h.cancel){for(c=0;c<p.length;c++)p[parseInt(c.toString(),10)].classList.remove("e-ribbon-gallery-selected");l.id.startsWith("popup_")?document.getElementById(l.id.slice(6))&&(u=document.getElementById(l.id.slice(6))):u=document.getElementById("popup_"+e.id),u&&u.classList.add("e-ribbon-gallery-selected"),l.classList.add("e-ribbon-gallery-selected");for(var h={previousItem:s,currentItem:a,name:"select",isInteracted:i,event:r},b=document.querySelectorAll("#"+o+"_popupContainer .e-ribbon-gallery-item"),c=0;c<b.length;c++)if(b[parseInt(c.toString(),10)].id===e.id){t.selectedItemIndex=c;break}t.select&&t.select.call(this,h)}},C.prototype.popupEvents=function(e,t,o,i){e={cancel:!1,event:e,name:o};return i&&t.popupOpen?t.popupOpen.call(this,e):!i&&t.popupClose&&t.popupClose.call(this,e),!!e.cancel},C.prototype.showPopup=function(e,t,o,i,r){var n;this.popupEvents(o,i,"popupOpen",!0)||(e.show(),this.checkCollision(e,t),(o=document.querySelector("#"+r+"_popupButton")).classList.add("e-gallery-button-active"),n=o.getBoundingClientRect(),t.offsetWidth>n.left&&this.checkCollision(e,t,n.left),n=Math.abs(t.offsetWidth-n.left)+o.offsetWidth,t.style.left=n+"px",t.style.top=t.getBoundingClientRect().top+2+"px",this.setFoucsToFirstItem(t,!1,r,e,i))},C.prototype.hidePopup=function(e,t,o,i,r){this.popupEvents(o,i,"popupClose",!1)||(e.hide(),document.querySelector("#"+r+"_popupButton").classList.remove("e-gallery-button-active"))},C.prototype.showGalleryPopup=function(e){var t=g(this.parent.tabs,e),o=document.querySelector("#"+e+"_galleryPopup"),i=x.getComponent(o,D.Popup);this.showPopup(i,o,null,t.item.gallerySettings,e)},C.prototype.hideGalleryPopup=function(e){var t=g(this.parent.tabs,e),o=document.querySelector("#"+e+"_galleryPopup"),i=x.getComponent(o,D.Popup);this.hidePopup(i,o,null,t.item.gallerySettings,e)},C.prototype.setFoucsToFirstItem=function(t,o,i,r,n){var s=this;t.querySelectorAll(".e-ribbon-gallery-item")[0].focus(),this.galleryItemsIndex=0,t.onkeydown=function(e){s.handleGalleryPopupNavigation(e,t,o,i,r,n)}},C.prototype.handleGalleryPopupNavigation=function(e,t,o,i,r,n){var s=t.querySelectorAll(".e-ribbon-gallery-item");s&&("Home"===e.key?(this.galleryItemsIndex=0,s[this.galleryItemsIndex].focus()):"End"===e.key?(this.galleryItemsIndex=s.length-1,s[this.galleryItemsIndex].focus()):"ArrowRight"===e.key||"ArrowDown"===e.key?(this.galleryItemsIndex++,this.galleryItemsIndex!==s.length?s&&s[this.galleryItemsIndex]&&s[this.galleryItemsIndex].focus():(this.galleryItemsIndex=0,s[this.galleryItemsIndex].focus())):"ArrowLeft"===e.key||"ArrowUp"===e.key?0!==this.galleryItemsIndex?(this.galleryItemsIndex--,s&&s[this.galleryItemsIndex]&&s[this.galleryItemsIndex].focus()):(this.galleryItemsIndex=s.length-1,s[this.galleryItemsIndex].focus()):"Enter"!==e.key&&"Space"!==e.code&&("Escape"!==e.key||o)||this.hidePopup(r,t,e,n,i))},C.prototype.createGalleryTemplate=function(e,t,o,i){e.classList.add("e-ribbon-gallery-template");var r="ribbon"+o+"galleryTemplate",t=(this.parent.clearTemplate([r]),Uo(t.template));i.disabled&&e.classList.add("e-disabled"),i.cssClass&&e.classList.add(i.cssClass),x.append(t({items:i},this,r,o+"galleryTemplate",this.parent.isStringTemplate,null,null,this.parent),e)},C.prototype.createGalleryPopupTemplate=function(e,t,o,i){e.classList.add("e-ribbon-gallery-popup-template");var r="ribbon"+o+"galleryPopupTemplate",t=(this.parent.clearTemplate([r]),Uo(t.popupTemplate));i.disabled&&e.classList.add("e-disabled"),i.cssClass&&e.classList.add(i.cssClass),x.append(t({items:i},this,r,o+"galleryPopupTemplate",this.parent.isStringTemplate,null,null,this.parent),e)};var si=C;function C(e){this.count=0,this.isAdded=!1,this.galleryItemsIndex=0,this.registeredTemplate={},this.parent=e;e="viewContainerRef";x.setValue("registeredTemplate",this.registeredTemplate,this),x.setValue(e,this.parent[e],this)}ai=function(e,t){return(ai=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var ai,li,pi,ci=function(e,t){function o(){this.constructor=e}ai(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},T=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},ci=(li=x.Component,ci(k,li),(pi=k).prototype.render=function(){this.initialize()},k.prototype.preRender=function(){this.keysPress="",this.idIndex=0,this.tooltipData=[],this.initialPropsData={},this.hiddenElements={},this.keyTipElements={},this.hiddenGroups=[],this.itemsModel=[],this.targetTabs={},this.isAddRemove=!1,this.isUpdateItems=!1,this.keyConfigs={leftarrow:"leftarrow",rightarrow:"rightarrow",tab:"tab",shiftTab:"shift+tab"}},k.prototype.getPersistData=function(){return this.addOnPersist(["activeLayout"])},k.prototype.getModuleName=function(){return"ribbon"},k.prototype.requiredModules=function(){var e=[],t=(e.push({member:"ribbonButton",args:[this],name:"RibbonButton"},{member:"ribbonDropDown",args:[this],name:"RibbonDropDown"},{member:"ribbonSplitButton",args:[this],name:"RibbonSplitButton"},{member:"ribbonCheckBox",args:[this],name:"RibbonCheckBox"},{member:"ribbonComboBox",args:[this],name:"RibbonComboBox"},{member:"ribbonGroupButton",args:[this],name:"RibbonGroupButton"}),g(this.tabs,null,R.RibbonItemType.ColorPicker)),o=g(this.tabs,null,R.RibbonItemType.Gallery);return t&&e.push({member:"ribbonColorPicker",args:[this],name:"RibbonColorPicker"}),o&&e.push({member:"ribbonGallery",args:[this],name:"RibbonGallery"}),(this.backStageMenu.visible||this.backStageMenu.items.length)&&e.push({member:"ribbonBackstage",args:[this],name:"RibbonBackstage"}),(this.fileMenu.visible||this.fileMenu.menuItems.length)&&e.push({member:"ribbonFileMenu",args:[this],name:"RibbonFileMenu"}),this.contextualTabs.length&&e.push({member:"ribbonContextualTab",args:[this],name:"RibbonContextualTab"}),this.enableKeyTips&&e.push({member:"ribbonKeyTip",args:[this],name:"RibbonKeyTip"}),e},k.prototype.initialize=function(){this.element.id=this.element.id||x.getUniqueID("e-"+this.getModuleName()),x.addClass([this.element],["e-rbn"].concat(this.cssClass?this.cssClass.split(v):[])),this.enableRtl&&this.element.classList.add(at),this.element.style.width=x.formatUnit(this.width),this.renderTabs(),this.ribbonContextualTabModule&&this.ribbonContextualTabModule.addContextualTabs(),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.createFileMenu(this.fileMenu),this.ribbonBackstageModule&&this.ribbonBackstageModule.createBackStage(this.backStageMenu),this.createHelpPaneTemplate(),this.tabObj.tbObj.refreshOverflow(),this.addTabOverflowKeyTip(),ei(this.element,this),this.isKeytipOpen=!1,this.wireEvents(),this.wireKeyboardEvent(),this.currentControlIndex=0},k.prototype.wireEvents=function(){this.resizeListener=this.resizeHandler.bind(this),x.EventHandler.add(window,"resize",this.resizeListener),x.EventHandler.add(document.body,"keydown",this.keytipActionHandler,this),x.EventHandler.add(document,"mousedown",this.mouseEventHandler,this),x.EventHandler.add(document,"scroll",this.mouseEventHandler,this)},k.prototype.wireKeyboardEvent=function(){this.keyboardModuleRibbon=new x.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},k.prototype.keyActionHandler=function(e){"Tab"!==e.key||e.target.classList.contains("e-tab-wrap")||e.target.classList.contains("e-combobox")||e.preventDefault();var t,o=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A),i=Array.prototype.slice.call(o.querySelectorAll(".e-control")),r=Array.prototype.slice.call(o.querySelectorAll(".e-ribbon-template")),n=Array.prototype.slice.call(o.querySelectorAll(".e-ribbon-gallery-item")),s=i.concat(r,n),a=o.querySelectorAll(".e-combobox");if(a)for(var l=0;l<a.length;l++)a[parseInt(l.toString(),10)].closest(".e-input-focus")&&(t=a[parseInt(l.toString(),10)]);if(t)for(l=0;l<s.length;l++)s[parseInt(l.toString(),10)].classList.contains("e-combobox")&&s[parseInt(l.toString(),10)].closest(".e-input-focus")&&(this.currentControlIndex=l);if(0===this.currentControlIndex)for(var p=s[this.currentControlIndex].closest(".e-ribbon-item");p&&p.classList.contains("e-disabled");)this.currentControlIndex++,p=s[this.currentControlIndex].closest(".e-ribbon-item");if(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-launcher-icon")||e.target.classList.contains("e-ribbon-collapse-btn")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-first-item")||e.target.classList.contains("e-ribbon-group-of-btn")||e.target.classList.contains("e-ribbon-overall-of-btn")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-gallery-item"))switch(e.action){case"rightarrow":this.handleNavigation(e,!this.enableRtl,s);break;case"leftarrow":this.handleNavigation(e,this.enableRtl,s);break;case"tab":e.target.classList.contains("e-combobox")&&this.currentControlIndex<s.length-1&&this.currentControlIndex++;break;case"shiftTab":e.target.classList.contains("e-combobox")?0<this.currentControlIndex&&this.currentControlIndex--:(this.tabObj.element.querySelector(".e-toolbar-item.e-active").querySelector(".e-tab-wrap").focus(),this.currentControlIndex=0)}},k.prototype.handleNavigation=function(e,t,o){var i,r;if(t?this.currentControlIndex<o.length-1&&o[this.currentControlIndex+1].classList.contains("e-colorpicker")&&this.currentControlIndex++:0<this.currentControlIndex&&o[this.currentControlIndex-1].classList.contains("e-colorpicker")&&this.currentControlIndex--,!t&&0<this.currentControlIndex||t&&this.currentControlIndex<o.length-1){if(!e.target.classList.contains("e-combobox")&&(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-gallery-item"))&&!e.target.classList.contains("e-ribbon-last-item")){t?this.currentControlIndex++:((n=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+Mt))&&(i=n.getAttribute("id")),this.currentControlIndex--);for(var n,s,a,l=o[this.currentControlIndex].closest(".e-ribbon-item");l&&l.classList.contains("e-disabled");){if((t&&this.currentControlIndex===o.length-1||!t&&0===this.currentControlIndex)&&o[this.currentControlIndex].closest(".e-ribbon-item").classList.contains("e-disabled")){this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus();break}t?this.currentControlIndex++:this.currentControlIndex--,l=o[this.currentControlIndex].closest(".e-ribbon-item")}o[parseInt(this.currentControlIndex.toString(),10)].focus(),"Classic"===this.activeLayout?(a=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+Mt),t?(s=void 0,(s=a?a.querySelector(".e-ribbon-launcher-icon"):s)&&(n=(n=a.querySelectorAll(".e-ribbon-item"))[n.length-1].querySelector(".e-control"))&&n.classList.add("e-ribbon-last-item")):a&&i!==a.getAttribute("id")&&(s=a.querySelector(".e-ribbon-launcher-icon"))&&o[parseInt((this.currentControlIndex+1).toString(),10)].classList.add("e-ribbon-first-item")):o[parseInt(this.currentControlIndex.toString(),10)].classList.contains("e-ribbon-first-item")?o[parseInt(this.currentControlIndex.toString(),10)].classList.remove("e-ribbon-first-item"):o[parseInt(this.currentControlIndex.toString(),10)].classList.contains("e-ribbon-last-item")&&o[parseInt(this.currentControlIndex.toString(),10)].classList.remove("e-ribbon-last-item")}}else"Classic"===this.activeLayout&&this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus(),"Simplified"===this.activeLayout&&(r=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn"),(t&&r&&!r.classList.contains("e-ribbon-hide")?r:this.tabObj.element.querySelector(".e-ribbon-collapse-btn")).focus());if(e.target.classList.contains("e-ribbon-last-item")&&(t?(a=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+Mt)).querySelector(".e-ribbon-launcher-icon"):(this.currentControlIndex--,o[parseInt(this.currentControlIndex.toString(),10)])).focus(),!t&&e.target.classList.contains("e-ribbon-first-item")&&(s=(a=o[parseInt((this.currentControlIndex-1).toString(),10)].closest("."+Mt)).querySelector(".e-ribbon-launcher-icon"))&&a.querySelector(".e-ribbon-launcher-icon").focus(),e.target.classList.contains("e-ribbon-launcher-icon")&&(t?(this.currentControlIndex++,o[parseInt(this.currentControlIndex.toString(),10)].focus(),o[parseInt((this.currentControlIndex-1).toString(),10)].classList.contains("e-ribbon-last-item")&&o[parseInt((this.currentControlIndex-1).toString(),10)].classList.remove("e-ribbon-last-item")):(this.currentControlIndex,o[parseInt(this.currentControlIndex.toString(),10)].focus())),e.target.classList.contains("e-ribbon-collapse-btn"))if(t){this.currentControlIndex=0;for(var p=o[this.currentControlIndex].closest(".e-ribbon-item");p&&p.classList.contains("e-disabled");)this.currentControlIndex++,p=o[this.currentControlIndex].closest(".e-ribbon-item");o[parseInt(this.currentControlIndex.toString(),10)].focus()}else if((r=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn"))&&!r.classList.contains("e-ribbon-hide"))r.focus();else{this.currentControlIndex=o.length-1;for(p=o[this.currentControlIndex].closest(".e-ribbon-item");p&&p.classList.contains("e-disabled");)this.currentControlIndex--,p=o[this.currentControlIndex].closest(".e-ribbon-item");o[parseInt(this.currentControlIndex.toString(),10)].focus()}"Simplified"===this.activeLayout&&e.target.classList.contains("e-ribbon-overall-of-btn")&&(t?this.tabObj.element.querySelector(".e-ribbon-collapse-btn"):(this.currentControlIndex=o.length-1,o[parseInt(this.currentControlIndex.toString(),10)])).focus()},k.prototype.resizeHandler=function(){var e=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A);if(this.checkOverflow(this.selectedTab,e),this.scrollModule&&(e=this.tabObj.element.querySelector("."+ht),this.scrollModule.scrollStep=e.offsetWidth),"Simplified"===this.activeLayout){var t=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(t.length)for(var o=0;o<t.length;o++)x.getInstance(t[parseInt(o.toString(),10)],M.DropDownButton).toggle()}e=document.querySelector(".e-ribbon-gallery-popup.e-popup-open");e&&x.getComponent(e,D.Popup).hide(),this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},k.prototype.mouseEventHandler=function(){this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},k.prototype.keytipActionHandler=function(e){if(this.enableKeyTips){var t=!1,o=e.key;if(e.altKey&&"Meta"===e.key){var i,r=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(r.length){for(var n=0;n<r.length;n++)x.getInstance(r[parseInt(n.toString(),10)],M.DropDownButton).toggle();this.ribbonKeyTipModule.removeKeytip()}else this.isKeytipOpen?this.ribbonKeyTipModule.removeKeytip():((i=document.querySelector(".e-ribbon-backstage-popup"))&&i.classList.contains("e-popup-open")&&this.ribbonBackstageModule.hideBackstage(),this.ribbonKeyTipModule.createKeytip("tab"))}else if("Escape"===e.key||"Tab"===e.key||"ArrowLeft"===e.key||"ArrowUp"===e.key||"ArrowRight"===e.key||"ArrowDown"===e.key)this.ribbonKeyTipModule.removeKeytip(e.key);else{var s=document.querySelectorAll(".e-ribbon-keytip");if(s){for(n=0;n<s.length;n++)if(s[parseInt(n.toString(),10)].innerHTML.toLowerCase()===o){t=!0,this.ribbonKeyTipModule.keytipPress(o);break}t||this.checkKeyTipPresent(o,this.keysPress.length)}}}},k.prototype.checkKeyTipPresent=function(e,t){for(var o=document.querySelectorAll(".e-ribbon-keytip"),i=0;i<o.length;i++){var r=o[parseInt(i.toString(),10)];if(1<r.innerHTML.length&&r.innerHTML[parseInt(t.toString(),10)].toLowerCase()===e){this.keysPress+=e,this.ribbonKeyTipModule.keytipPress(this.keysPress),this.removeKeytip(this.keysPress);break}}},k.prototype.removeKeytip=function(e){for(var t=document.querySelectorAll(".e-ribbon-keytip"),o=0;o<t.length;o++){var i=t[parseInt(o.toString(),10)];i.innerHTML[0].toLowerCase()!==e&&""!==e&&x.remove(i)}},k.prototype.addKeyTip=function(e,t,o,i){if(this.keyTipElements&&this.keyTipElements[parseInt(e.toString(),10)]){var r=!1;if(this.keyTipElements[parseInt(e.toString(),10)][""+i]||(this.keyTipElements[parseInt(e.toString(),10)][""+i]=[]),Object.keys(this.keyTipElements[parseInt(e.toString(),10)][""+i]).length){for(var n=this.keyTipElements[parseInt(e.toString(),10)][""+i],s=0;s<Object.keys(this.keyTipElements[parseInt(e.toString(),10)][""+i]).length;s++)n[parseInt(s.toString(),10)].id===o&&(r=!0);r||this.keyTipElements[parseInt(e.toString(),10)][""+i].push({id:o,type:i,keyTip:t})}else this.keyTipElements[parseInt(e.toString(),10)][""+i].push({id:o,type:i,keyTip:t})}},k.prototype.renderTabs=function(){this.tabsInternal=this.tabs.slice(),this.tabsInternal=this.checkID(this.tabsInternal,"tab",this.element.id),this.setProperties({tabs:this.tabsInternal},!0);var e=this.createElement("div",{id:this.element.id+So}),t=(this.element.appendChild(e),this.validateItemSize(),this.createTabItems(this.tabs)),t=(this.tabObj=new L.Tab({cssClass:mt,selectedItem:this.selectedTab,overflowMode:"Popup",width:this.width,items:t,enableRtl:this.enableRtl,created:this.tabCreated.bind(this),selected:this.ribbonTabSelected.bind(this),selecting:this.ribbonTabSelecting.bind(this),animation:this.tabAnimation}),this.tabObj.appendTo(e),this.element.style.setProperty(Mo,"0px"),this.element.style.setProperty(_o,"0px"),e.querySelector(".e-toolbar"));x.getComponent(t,L.Toolbar).setProperties({width:"calc(100% - var(--fileMenuWidth) - var(--helpTemplateWidth))"}),this.element.classList[this.isMinimized?"add":"remove"](Bt)},k.prototype.minimize=function(t){var o=this;t!==this.isMinimized&&this.trigger(t?"ribbonCollapsing":"ribbonExpanding",{cancel:!1},function(e){e.cancel||(o.setProperties({isMinimized:t},!0),o.element.classList.toggle(Bt,o.isMinimized),o.tabObj.element.querySelector(".e-content").style.display=t?"none":"block",t)||o.refreshLayout()})},k.prototype.toggleLayout=function(e){this.setProperties({activeLayout:"Simplified"===this.activeLayout?"Classic":"Simplified"},!0),this.switchLayout();e={activeLayout:this.activeLayout,event:e};this.trigger("ribbonLayoutSwitched",e)},k.prototype.tabCreated=function(){this.hideLayoutSwitcher||this.addExpandCollapse(),this.renderInitialTab(this.selectedTab)},k.prototype.ribbonTabSelected=function(e){e.preventFocus=!0,this.isAddRemove=!1;var t=e.selectedItem.getAttribute("data-id"),o=-1===(o=S(this.tabs,function(e){return e.id===t}))?this.selectedTab:o,i=this.tabObj.items[parseInt(o.toString(),10)].content,r=(i.querySelector("."+Lt)||0===this.tabs[parseInt(o.toString(),10)].groups.length||(r=this.createGroups(this.tabs[parseInt(o.toString(),10)].groups,o),x.append(r,i)),this.isContextualTab(t)),r=(this.updateSelectedState(t),{previousIndex:this.selectedTab,selectedIndex:o,isContextual:r});if(this.setProperties({selectedTab:o},!0),this.calculateHiddenElementsWidth(o),this.isUpdateItems){for(var n=0;n<this.itemsModel.length;n++){var s=this.itemsModel[parseInt(n.toString(),10)];this.selectedTab===this.targetTabs[s.id]&&(this.updateItem(s),this.itemsModel.splice(n,1),n--)}0===this.itemsModel.length&&(this.isUpdateItems=!1)}this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(e.selectedContent.firstChild),this.checkOverflow(o,i),"Simplified"===this.activeLayout&&this.overflowDDB&&((i=(e=this.overflowDDB.target).querySelector("."+ft))&&i.classList.remove(ft),(i=e.querySelector("#"+t+w))?(i.classList.add(ft),this.overflowDDB.element.classList.remove(bt),this.checkOverflowHiddenItems(!1,o)):this.overflowDDB.element.classList.add(bt)),this.trigger("tabSelected",r)},k.prototype.updateSelectedState=function(e){if(this.contextualTabs.length)for(var t=0;t<this.contextualTabs.length;t++){for(var o=!1,i=0;i<this.contextualTabs[parseInt(t.toString(),10)].tabs.length;i++)if(this.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(i.toString(),10)].id===e){o=!0;break}this.contextualTabs[parseInt(t.toString(),10)].setProperties({isSelected:o},!0)}},k.prototype.checkOverflow=function(e,t){var o,i=t.closest("."+Ot),r=i.offsetWidth<t.offsetWidth;r&&!this.scrollModule?("Classic"===this.activeLayout?(!(o=this.checkGroupShrinking(e,i,t,!(o=!1)))&&i.offsetWidth<t.offsetWidth&&(o=this.checkGroupShrinking(e,i,t,!1)),i.offsetWidth<t.offsetWidth&&this.createOverflowDropdown(e,i,t)):(this.checkSimplifiedItemShrinking(e,i,t),i.offsetWidth<t.offsetWidth&&this.createSimplfiedOverflow(i,t,e)),i.offsetWidth<t.offsetWidth&&!this.scrollModule&&(this.scrollModule=new L.HScroll({enableRtl:this.enableRtl},this.tabObj.element.querySelector("."+Ot)))):r||(this.destroyScroll(),"Classic"===this.activeLayout?!(o=!(o=this.removeOverflowDropdown(i,t,o=!1,e))&&i.offsetWidth>t.offsetWidth?this.checkGroupExpanding(e,i,t,!0):o)&&i.offsetWidth>t.offsetWidth&&(o=this.checkGroupExpanding(e,i,t,!1)):(this.removeSimplfiedOverflow(i,t,e),i.offsetWidth>t.offsetWidth&&this.checkSimplifiedItemExpanding(e,i,t))),this.addTabOverflowKeyTip()},k.prototype.addTabOverflowKeyTip=function(){var e=this.tabObj.element.querySelector("#_nav");e?(this.keyTipElements.taboverflow=[],this.keyTipElements.taboverflow.push({id:e.id,type:"taboverflow",keyTip:"00"})):delete this.keyTipElements.taboverflow},k.prototype.checkSimplifiedItemShrinking=function(e,t,o){for(var i=this.tabs[parseInt(e.toString(),10)],r=i.groups.length-1;0<=r;r--)for(var n=i.groups[parseInt(r.toString(),10)],s=t.querySelector("#"+n.id+j),a=0;a<n.collections.length&&t.offsetWidth<o.offsetWidth;a++)for(var l=n.collections[parseInt(a.toString(),10)],p=l.items.length;1<=p&&t.offsetWidth<o.offsetWidth;p--){var c,d,u=l.items[p-1];u.allowedSizes&R.RibbonItemSize.Small&&u.allowedSizes&R.RibbonItemSize.Medium&&u.activeSize===R.RibbonItemSize.Medium&&u.displayOptions&R.DisplayMode.Simplified&&(c=s.querySelector("#"+u.id+j))&&(d=c.querySelector("#"+u.id),c.setAttribute("data-medium-width",o.offsetWidth.toString()),u.setProperties({activeSize:R.RibbonItemSize.Small},!0),this.setItemSize(d,u))}},k.prototype.checkSimplifiedItemExpanding=function(e,t,o){for(var i=this.tabs[parseInt(e.toString(),10)],r=i.groups.length-1;0<=r;r--)for(var n=i.groups[parseInt(r.toString(),10)],s=t.querySelector("#"+n.id+j),a=0;a<n.collections.length&&t.offsetWidth>o.offsetWidth;a++)for(var l=n.collections[parseInt(a.toString(),10)],p=l.items.length;1<=p&&t.offsetWidth>o.offsetWidth;p--){var c,d,u=l.items[p-1];u.allowedSizes&R.RibbonItemSize.Small&&u.allowedSizes&R.RibbonItemSize.Medium&&u.activeSize===R.RibbonItemSize.Small&&u.displayOptions&R.DisplayMode.Simplified&&(c=s.querySelector("#"+u.id+j))&&(d=(d=c.getAttribute("data-medium-width"))?parseInt(d,10):null)&&t.offsetWidth>d&&(c.removeAttribute("data-medium-width"),d=c.querySelector("#"+u.id),u.setProperties({activeSize:R.RibbonItemSize.Medium},!0),this.setItemSize(d,u))}},k.prototype.createSimplfiedOverflow=function(e,t,o){for(var i=this.getGroupResizeOrder(!0,o),r=0;r<i.length&&e.offsetWidth<t.offsetWidth;r++){for(var n=!1,s=i[parseInt(r.toString(),10)],a=e.querySelector("#"+s.id),l=a.querySelector("#"+s.id+j),p=s.collections.length;1<=p&&e.offsetWidth<t.offsetWidth;p--)for(var c=s.collections[parseInt((p-1).toString(),10)],d=a.querySelector("#"+c.id),u=c.items.length;1<=u&&e.offsetWidth<t.offsetWidth;u--){var h=c.items[u-1],b=d.querySelector("#"+h.id+j);if((h.displayOptions===R.DisplayMode.Auto||h.displayOptions===(R.DisplayMode.Simplified|R.DisplayMode.Overflow))&&!x.isNullOrUndefined(b)){var m=!1,y=!1,f=!1,g=!1,v=void 0;if(a.classList.contains("e-hidden")||a.classList.contains("e-hide-group")){if((v=a.querySelectorAll(".e-ribbon-item.e-hidden")).length)for(var S=0;S<v.length;S++)v[parseInt(S.toString(),10)].classList.remove("e-hidden");a.classList.contains("e-hide-group")?(f=!0,a.classList.remove("e-hide-group"),a.classList.remove("e-ribbon-emptyCollection"),-1!==this.hiddenGroups.indexOf(a.id)&&this.hiddenGroups.splice(this.hiddenGroups.indexOf(a.id),1)):(m=!0,a.classList.remove("e-hidden")),n||(this.calculateOverflowItemsWidth(a.offsetWidth,!1,o),this.calculateMediumDataWidth(a.offsetWidth,o,!1),n=!0)}else b.classList.contains("e-hidden")&&(y=!0,b.classList.remove("e-hidden"),a.classList.contains("e-ribbon-emptyCollection")&&(g=!0,a.classList.remove("e-ribbon-emptyCollection")),this.calculateOverflowItemsWidth(b.offsetWidth,!1,o),this.calculateMediumDataWidth(b.offsetWidth,o,!1));if(b.setAttribute("data-simplified-width",t.offsetWidth.toString()),y&&b.classList.add("e-hidden"),v&&v.length)for(var I=0;I<v.length;I++)v[parseInt(I.toString(),10)].classList.add("e-hidden");m&&a.classList.add("e-hidden"),f&&(a.classList.add("e-hide-group"),a.classList.add("e-ribbon-emptyCollection")),g&&a.classList.add("e-ribbon-emptyCollection"),this.createOverflowPopup(h,o,s.enableGroupOverflow,s.id,s.header,b,l,!0),h.activeSize===R.RibbonItemSize.Small&&(y=b.querySelector("#"+h.id),h.setProperties({activeSize:R.RibbonItemSize.Medium},!0),this.setItemSize(y,h)),h.type!==R.RibbonItemType.DropDown&&h.type!==R.RibbonItemType.SplitButton&&h.type!==R.RibbonItemType.GroupButton&&h.type!==R.RibbonItemType.Gallery||this.updatePopupItems(h,b,s.enableGroupOverflow,!0)}}s.enableGroupOverflow||a.querySelector("."+Ut)||a.classList.add("e-ribbon-emptyCollection");var C=a.querySelectorAll("."+Ut);C&&!s.enableGroupOverflow&&this.checkEmptyCollection(C)&&a.classList.add("e-ribbon-emptyCollection"),this.checkOverflowHiddenItems(s.enableGroupOverflow,o,s.id)}},k.prototype.checkEmptyCollection=function(e){for(var t=!0,o=0;o<e.length;o++)if(!e[parseInt(o.toString(),10)].classList.contains("e-hidden")){t=!1;break}return t},k.prototype.updatePopupItems=function(t,e,o,i){var r=this,e=x.getComponent(e.querySelector("#"+t.id),t.type===R.RibbonItemType.DropDown||t.type===R.RibbonItemType.Gallery||t.type===R.RibbonItemType.GroupButton?M.DropDownButton:M.SplitButton),n=e.dropDown,s=(o&&i)===this.enableRtl;n&&(n.setProperties({position:{X:s?"left":"right",Y:i?"top":"bottom"}},!0),i?e.beforeOpen=function(e){s&&(t.type===R.RibbonItemType.Gallery&&r.ribbonGalleryModule&&r.ribbonGalleryModule.checkCollision(n,n.element),n.element.style.setProperty("visibility","hidden"),n.element.style.setProperty("display","block"),n.setProperties({offsetX:-1*n.element.offsetWidth}),n.element.style.removeProperty("display"),n.element.style.removeProperty("visibility")),t.splitButtonSettings.beforeOpen&&t.splitButtonSettings.beforeOpen.call(r,e),t.dropDownSettings.beforeOpen&&t.dropDownSettings.beforeOpen.call(r,e)}:(n.setProperties({offsetX:0},!0),e.beforeOpen=null))},k.prototype.removeSimplfiedOverflow=function(e,t,o,i){void 0===i&&(i=!1);for(var r=this.getGroupResizeOrder(!1,o),n=!0,s=0;s<r.length&&n;s++){var a=r[parseInt(s.toString(),10)],l=void 0,p=void 0;a.enableGroupOverflow?(c=e.querySelector("#"+a.id+_))&&(p=(l=x.getInstance(c,M.DropDownButton)).target):(l=this.overflowDDB,p=this.overflowDDB?this.overflowDDB.target:null);for(var c,d=0;d<a.collections.length&&n;d++)for(var u=a.collections[parseInt(d.toString(),10)],h=0;h<u.items.length&&n&&!i&&e.offsetWidth>t.offsetWidth;h++){var b=u.items[parseInt(h.toString(),10)],m=void 0;if(p&&(m=p.querySelector("#"+b.id+j)),(b.displayOptions===R.DisplayMode.Auto||b.displayOptions===(R.DisplayMode.Simplified|R.DisplayMode.Overflow))&&!x.isNullOrUndefined(m)){var y=parseInt(m.getAttribute("data-simplified-width"),10),f=e.querySelector("#"+a.id);if((m.classList.contains("e-hidden")||f.classList.contains("e-hidden"))&&(y=Math.abs(y-t.offsetWidth)),!i&&e.offsetWidth<y){n=!1;break}var g=e.querySelector("#"+u.id),v=(b.type!==R.RibbonItemType.DropDown&&b.type!==R.RibbonItemType.SplitButton&&b.type!==R.RibbonItemType.GroupButton&&b.type!==R.RibbonItemType.Gallery||this.updatePopupItems(b,m,a.enableGroupOverflow,!1),g.append(m),(m.classList.contains("e-hidden")||f.classList.contains("e-hidden"))&&(m.setAttribute("data-simplified-width",y.toString()),g=!1,v=0,m.classList.contains("e-hidden")&&(m.classList.remove("e-hidden"),f.classList.contains("e-hide-group")&&(g=!0,v=this.checkWidthDifference(m,f)),y=m.offsetWidth+v,m.classList.add("e-hidden")),this.calculateOverflowItemsWidth(y,!0,o),this.calculateMediumDataWidth(y,o,!0),g)&&(f.classList.add("e-hide-group"),f.classList.add("e-ribbon-emptyCollection")),this.removeOverflowEvent(b,m),b.allowedSizes&R.RibbonItemSize.Small&&(b.setProperties({activeSize:R.RibbonItemSize.Small},!0),this.setItemSize(m.querySelector("#"+b.id),b)),e.querySelector("#"+a.id)),y=v.querySelector("."+Ut);v.classList.contains("e-ribbon-emptyCollection")&&null!==y&&(g=v.querySelectorAll("."+Ut))&&!this.checkEmptyCollection(g)&&v.classList.remove("e-ribbon-emptyCollection")}}l&&(a.enableGroupOverflow?(0===p.childElementCount||1===p.childElementCount&&this.isHeaderVisible(p,a.id))&&this.removeOverflowButton(l):((c=p.querySelector("#"+a.id+j))&&1===c.childElementCount&&c.remove(),(l=p.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+w))&&0===l.childElementCount&&(l.remove(),this.overflowDDB.element.classList.add(bt))))}for(s=0;s<r.length;s++)this.checkOverflowHiddenItems(r[parseInt(s.toString(),10)].enableGroupOverflow,o,r[parseInt(s.toString(),10)].id);this.overflowDDB&&0===this.overflowDDB.target.childElementCount&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},k.prototype.checkOverflowHiddenItems=function(e,t,o){if(e){e=document.querySelector("#"+o+_);if(e){for(var o=x.getInstance(e,M.DropDownButton),i=o.target.querySelectorAll(".e-ribbon-item"),r=!0,n=0;n<i.length;n++)if(!i[parseInt(n.toString(),10)].classList.contains("e-hidden")){r=!1;break}o.element.classList[r?"add":"remove"]("e-hidden")}}else if(this.overflowDDB){var s=!0,a=void 0,l=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+w);if(l){for(var p=0;p<l.children.length;p++){for(var a=!0,c=l.children[parseInt(p.toString(),10)],d=c.querySelectorAll(".e-ribbon-item"),u=0;u<d.length;u++)if(!d[parseInt(u.toString(),10)].classList.contains("e-hidden")){a=!1;break}c.classList[a?"add":"remove"]("e-hide-group"),c.classList.contains("e-hide-group")||c.classList.contains("e-hidden")||(s=!1)}this.overflowDDB.element.classList[s?"add":"remove"](bt)}}},k.prototype.createOverflowPopup=function(e,t,o,i,r,n,s,a){var l,p,c,d=Xo(this.tabs,i),u=this.tabObj.items[parseInt(t.toString(),10)].content.querySelector("#"+i);o?((p=s.querySelector("#"+i+_))?l=x.getInstance(p,M.DropDownButton):((l=this.addOverflowButton(i+_,o)).element.classList.add(wt),s.appendChild(l.element)),this.addKeyTip(t,"0"+(d.groupIndex+1),l.element.id,"grpofbtn"),p=l.target,(s=l.target).querySelector("#"+i+_+q)||d.group.overflowHeader&&(c=this.createElement("div",{className:Gt,id:i+_+q,innerHTML:d.group.overflowHeader}),s.append(c)),u&&(u.classList.contains("e-disabled")&&s.classList.add("e-disabled"),u.classList.contains("e-hidden")&&s.classList.add("e-hidden"),u.classList.contains("e-hide-group"))&&s.classList.add("e-hide-group"),a?s.insertBefore(n,s.querySelector("."+Ut)):s.append(n)):(this.overflowDDB?(this.overflowDDB.element.classList.remove(bt),(s=(c=this.overflowDDB.target).querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+w))?((c=c.querySelector("#"+i+j))||(c=d.group.overflowHeader?this.createGroupContainer(i,d.group.overflowHeader):this.createGroupContainer(i,r),u&&(u.classList.contains("e-disabled")&&c.classList.add("e-disabled"),u.classList.contains("e-hidden")&&c.classList.add("e-hidden"),u.classList.contains("e-hide-group"))&&c.classList.add("e-hide-group"),s.append(c)),a?c.insertBefore(n,c.querySelector("."+Ut)):c.append(n)):this.createOfTabContainer(i,r,n,t)):(this.overflowDDB=this.addOverflowButton(this.tabObj.element.id+wo,o),this.tabObj.element.insertBefore(this.overflowDDB.element,this.collapseButton),this.overflowDDB.element.classList.add(Ct),this.createOfTabContainer(i,r,n,t)),l=this.overflowDDB,p=this.overflowDDB?this.overflowDDB.target:null),null!==n&&this.addOverflowEvents(e,n,l),p&&e.keyTip&&this.addKeyTip(t,e.keyTip,e.id,"popupitem")},k.prototype.addOverflowEvents=function(e,t,o){switch(e.type){case"Button":this.ribbonButtonModule.addOverFlowEvents(e,t,o);break;case"DropDown":this.ribbonDropDownModule.addOverFlowEvents(e,t,o);break;case"SplitButton":this.ribbonSplitButtonModule.addOverFlowEvents(e,t,o);break;case"CheckBox":this.ribbonCheckBoxModule.addOverFlowEvents(e,t,o);break;case"ColorPicker":this.ribbonColorPickerModule.addOverFlowEvents(e,t,o);break;case"ComboBox":this.ribbonComboBoxModule.addOverFlowEvents(e,t,o);break;case"Gallery":"Simplified"===this.activeLayout&&this.ribbonGalleryModule.addOverFlowEvents(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.addOverFlowEvents(e,t,o)}},k.prototype.createOfTabContainer=function(e,t,o,i){var r=this.createElement("div",{id:this.tabs[parseInt(i.toString(),10)].id+w,className:_t}),n=(this.overflowDDB.target.append(r),Xo(this.tabs,e)),n=n.group.overflowHeader?this.createGroupContainer(e,n.group.overflowHeader):this.createGroupContainer(e,t),t=(n.append(o),r.append(n),i===this.selectedTab&&r.classList.add(ft),document.querySelector("#"+e));t&&(t.classList.contains("e-disabled")&&n.classList.add("e-disabled"),t.classList.contains("e-hidden")&&n.classList.add("e-hidden"),t.classList.contains("e-hide-group"))&&n.classList.add("e-hide-group")},k.prototype.checkGroupShrinking=function(e,t,o,i){for(var r=!0,n=!1,s=this.tabs[parseInt(e.toString(),10)],a=s.groups.length-1;r&&0<=a;a--)r=!(n=i?this.checkLargeToMedium(e,s,a,t,o):this.checkMediumToSmall(e,s,a,t,o))&&t.offsetWidth<o.offsetWidth;return n},k.prototype.checkValidCollectionLength=function(e){for(var t=0,o=0;o<e.length;o++){for(var i=e[parseInt(o.toString(),10)].items,r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].displayOptions&R.DisplayMode.Classic){t++;break}if(1<t)return!1}return 1===t},k.prototype.checkClassicCollection=function(e,t,o){for(var i=e[parseInt(t.toString(),10)].items,r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].displayOptions&R.DisplayMode.Classic)return t;return t=o?t+1:t-1,o?t===e.length?t:this.checkClassicCollection(e,t,o):t<0?t:this.checkClassicCollection(e,t,o)},k.prototype.checkClassicItem=function(e,t,o){return e[parseInt(t.toString(),10)].displayOptions&R.DisplayMode.Classic?t:(t=o?t+1:t-1,o?t===e.length?t:this.checkClassicItem(e,t,o):t<0?t:this.checkClassicItem(e,t,o))},k.prototype.checkLargeToMedium=function(l,e,p,t,c,d){var u=this,o=(void 0===d&&(d=!1),e.groups[parseInt(p.toString(),10)]);if(!o.isCollapsed||d){var i=function(e){return 1===e.items.length&&r(e.items[0])},r=function(e){return e.allowedSizes&R.RibbonItemSize.Medium&&e.activeSize===R.RibbonItemSize.Large},h=function(e,t,o,i){e=u.createElement("div",{className:"e-ribbon-shrink "+Vt,id:e+"_shrink_container"+o,attrs:{"data-start":o.toString(),"data-end":i.toString()}});return t.parentElement.insertBefore(e,t),d||e.setAttribute("data-large-width",c.offsetWidth.toString()),e},n=function(e,t){for(var o=u.tabs[parseInt(l.toString(),10)].groups[parseInt(p.toString(),10)].collections[0],i=c.querySelector("#"+o.items[parseInt(e.toString(),10)].id+j),r=d?c.querySelector("#"+o.id+"_shrink_container"+e):h(o.id,i,e,t),n=e;n<=t;n++){var s,a=o.items[parseInt(n.toString(),10)];a.displayOptions&R.DisplayMode.Classic&&(s=c.querySelector("#"+a.id+j),r.appendChild(s),a.setProperties({activeSize:R.RibbonItemSize.Medium},!0),a.type===R.RibbonItemType.GroupButton&&"Classic"===u.activeLayout?u.setItemSize(s.querySelector("#"+a.id+G),a):u.setItemSize(s.querySelector("#"+a.id),a))}},s=function(e,t){for(var o=u.tabs[parseInt(l.toString(),10)].groups[parseInt(p.toString(),10)],i=c.querySelector("#"+o.collections[parseInt(e.toString(),10)].id),r=d?c.querySelector("#"+o.id+"_shrink_container"+e):h(o.id,i,e,t),n=e;n<=t;n++){var s=o.collections[parseInt(n.toString(),10)],a=c.querySelector("#"+s.id);r.appendChild(a),s.items[0].setProperties({activeSize:R.RibbonItemSize.Medium},!0),s.items[0].type===R.RibbonItemType.GroupButton&&"Classic"===u.activeLayout?u.setItemSize(a.querySelector("#"+s.items[0].id+G),s.items[0]):u.setItemSize(a.querySelector("#"+s.items[0].id),s.items[0])}};if(o.orientation===R.ItemOrientation.Column)for(var a=o.collections.length-1;0<a;a--){var b=(a=this.checkClassicCollection(o.collections,a,!1))-1;if(0<=b&&i(o.collections[parseInt(a.toString(),10)]))if(0<=(b=this.checkClassicCollection(o.collections,b,!1))&&i(o.collections[parseInt(b.toString(),10)])){if(0<=(y=0<=(y=b-1)?this.checkClassicCollection(o.collections,y,!1):y)&&i(o.collections[parseInt(y.toString(),10)])?s(y,a):s(b,a),a=y,!d&&t.offsetWidth>c.offsetWidth)return!0}else a=b}else if(this.checkValidCollectionLength(o.collections))for(var m=o.collections[0],a=m.items.length-1;0<a;a--){var y,b=(a=this.checkClassicItem(m.items,a,!1))-1;if(0<=b&&r(m.items[parseInt(a.toString(),10)]))if(0<=(b=this.checkClassicItem(m.items,b,!1))&&r(m.items[parseInt(b.toString(),10)])){if(0<=(y=0<=(y=b-1)?this.checkClassicItem(m.items,y,!1):y)&&r(m.items[parseInt(y.toString(),10)])?n(y,a):n(b,a),a=y,!d&&t.offsetWidth>c.offsetWidth)return!0}else a=b}}return!1},k.prototype.checkMediumToSmall=function(s,e,a,t,l,p){var c=this,o=(void 0===p&&(p=!1),e.groups[parseInt(a.toString(),10)]);if(!o.isCollapsed||p){var e=o.orientation,d=l.querySelector("#"+o.id).querySelectorAll(".e-ribbon-shrink"),i=function(e){return e.allowedSizes&R.RibbonItemSize.Small&&e.activeSize===R.RibbonItemSize.Medium},r=function(e,t,o,i){void 0===i&&(i=null);function r(e){var t;(e=n.items[parseInt(e.toString(),10)]).displayOptions&R.DisplayMode.Classic&&(t=l.querySelector("#"+e.id),e.setProperties({activeSize:R.RibbonItemSize.Small},!0),e.type===R.RibbonItemType.GroupButton&&(t=l.querySelector("#"+e.id+"_grpbtn")),c.setItemSize(t,e))}var n=c.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)].collections[parseInt(e.toString(),10)];r(t),i&&r(i),r(o)},n=function(e,t,o,i){void 0===i&&(i=null);function r(e){var t;(e=n.collections[parseInt(e.toString(),10)]).items[0].displayOptions&R.DisplayMode.Classic&&(t=l.querySelector("#"+e.items[0].id),e.items[0].setProperties({activeSize:R.RibbonItemSize.Small},!0),e.items[0].type===R.RibbonItemType.GroupButton&&(t=l.querySelector("#"+e.items[0].id+G)),c.setItemSize(t,e.items[0]))}var n=c.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)];p||d[parseInt(e.toString(),10)].setAttribute("data-medium-width",l.offsetWidth.toString());r(t),i&&r(i),r(o)},u=function(e){p||l.querySelector("#"+e).setAttribute("data-medium-width",l.offsetWidth.toString())};if(e===R.ItemOrientation.Column){if(0<d.length)for(var h=d.length-1;0<=h;h--){var b=parseInt(d[parseInt(h.toString(),10)].getAttribute("data-start"),10),m=parseInt(d[parseInt(h.toString(),10)].getAttribute("data-end"),10),y=this.checkClassicCollection(o.collections,b+1,!1);if(i(o.collections[parseInt(b.toString(),10)].items[0])&&i(o.collections[parseInt(y.toString(),10)].items[0])&&(m===y?n(h,b,m):i(o.collections[parseInt(m.toString(),10)].items[0])&&n(h,b,m,y),!p)&&t.offsetWidth>l.offsetWidth)return!0}for(h=o.collections.length-1;0<=h;h--){for(var f=o.collections[parseInt(h.toString(),10)],g=[],v=0;v<f.items.length;v++)f.items[parseInt(v.toString(),10)].displayOptions&R.DisplayMode.Classic&&g.push(v);if(1<g.length&&i(f.items[g[0]])&&i(f.items[g[1]])&&(2===g.length?(u(f.id),r(h,g[0],g[1])):i(f.items[g[2]])&&(u(f.id),r(h,g[0],g[2],g[1])),!p)&&t.offsetWidth>l.offsetWidth)return!0}}else if(this.checkValidCollectionLength(o.collections)){if(0<d.length)for(h=d.length-1;0<=h;h--){var S=d[parseInt(h.toString(),10)],b=parseInt(S.getAttribute("data-start"),10),m=parseInt(S.getAttribute("data-end"),10),f=o.collections[0],y=this.checkClassicItem(f.items,b+1,!1);if(i(o.collections[0].items[parseInt(b.toString(),10)])&&i(o.collections[0].items[parseInt(y.toString(),10)])&&(m===y?(u(S.id),r(0,b,m)):i(o.collections[0].items[parseInt(m.toString(),10)])&&(u(S.id),r(0,b,m,y)),!p)&&t.offsetWidth>l.offsetWidth)return!0}}else for(h=o.collections.length-1;0<=h;h--)for(y=(f=o.collections[parseInt(h.toString(),10)]).items.length-1;0<=y;y--)if(!((y=this.checkClassicItem(f.items,y,!1))<0)){var I=f.items[parseInt(y.toString(),10)];if(i(I)&&(I.type!==R.RibbonItemType.GroupButton?u(I.id):u(I.id+G),r(h,y,y),!p)&&t.offsetWidth>l.offsetWidth)return!0}}return!1},k.prototype.checkGroupExpanding=function(e,t,o,i){for(var r=!1,n=this.tabs[parseInt(e.toString(),10)],s=0;!r&&s<n.groups.length;s++)r=i?this.checkSmallToMedium(e,n,s,t,o,!1,!0):this.checkMediumToLarge(e,n,s,t,o,!1,!0);return r},k.prototype.checkSmallToMedium=function(r,e,n,t,s,o,i){function a(e,t,o){(e=c.tabs[parseInt(r.toString(),10)].groups[parseInt(n.toString(),10)].collections[parseInt(e.toString(),10)].items[parseInt(t.toString(),10)]).displayOptions&R.DisplayMode.Classic&&(t=o.id===e.id?o:o.querySelector("#"+e.id),e.setProperties({activeSize:R.RibbonItemSize.Medium},!0),e.type===R.RibbonItemType.GroupButton&&(t=document.querySelector("#"+e.id+G)),c.setItemSize(t,e))}function l(e){var t,o=c.tabs[parseInt(r.toString(),10)].groups[parseInt(n.toString(),10)].collections,i=o[parseInt(e.toString(),10)].items[0];i.displayOptions&R.DisplayMode.Classic&&(t=s.querySelector("#"+o[parseInt(e.toString(),10)].items[0].id),o[parseInt(e.toString(),10)].items[0].setProperties({activeSize:R.RibbonItemSize.Medium},!0),i.type===R.RibbonItemType.GroupButton&&(t=s.querySelector("#"+o[parseInt(e.toString(),10)].items[0].id+G)),c.setItemSize(t,o[parseInt(e.toString(),10)].items[0]))}var p,c=this,d=e.groups[parseInt(n.toString(),10)],u=d.orientation,h=s.querySelector("#"+d.id).querySelectorAll(".e-ribbon-shrink");if(u===R.ItemOrientation.Row){if(!this.checkValidCollectionLength(d.collections))for(var b=0;b<d.collections.length;b++)for(var m=d.collections[parseInt(b.toString(),10)],y=0;y<m.items.length;y++)if((y=this.checkClassicItem(m.items,y,!0))!==m.items.length){var f=m.items[parseInt(y.toString(),10)];if((p=f).allowedSizes&R.RibbonItemSize.Medium&&p.activeSize===R.RibbonItemSize.Small){var g=s.querySelector("#"+f.id);if((v=(C=(g="GroupButton"===f.type?s.querySelector("#"+f.id+G):g).getAttribute("data-medium-width"))?parseInt(C,10):null)&&(o||t.offsetWidth>v))a(b,y,g),o&&!i||g.removeAttribute("data-medium-width");else if(v)return!0}}}else for(b=0;b<d.collections.length;b++)if(1<d.collections[parseInt(b.toString(),10)].items.length){for(var m=d.collections[parseInt(b.toString(),10)],v=(C=(g=s.querySelector("#"+m.id)).getAttribute("data-medium-width"))?parseInt(C,10):null,S=[],I=0;I<m.items.length;I++)m.items[parseInt(I.toString(),10)].displayOptions&R.DisplayMode.Classic&&S.push(I);if(1<S.length&&v&&(o||t.offsetWidth>v))a(b,S[0],g),a(b,S[1],g),3===S.length&&a(b,S[2],g),o&&!i||g.removeAttribute("data-medium-width");else if(v)return!0}if(0<h.length)for(b=0;b<h.length;b++){var C,w=h[parseInt(b.toString(),10)];if((v=(C=w.getAttribute("data-medium-width"))?parseInt(C,10):null)&&(o||t.offsetWidth>v)){var T,k=parseInt(w.getAttribute("data-start"),10),O=parseInt(w.getAttribute("data-end"),10);u===R.ItemOrientation.Row?(m=d.collections[0],y=this.checkClassicItem(m.items,k+1,!0),a(0,k,w),a(0,y,w),y!==O&&a(0,O,w)):(T=this.checkClassicCollection(d.collections,k+1,!0),l(k),l(T),T!==O&&l(O)),o&&!i||w.removeAttribute("data-medium-width")}else if(v)return!0}return!1},k.prototype.checkMediumToLarge=function(s,e,a,t,o,l,p){var c=this,i=e.groups[parseInt(a.toString(),10)],r=i.orientation,n=o.querySelector("#"+i.id).querySelectorAll(".e-ribbon-shrink");if(0!==n.length)for(var d=function(e,t,i,o){function r(e){var t,o;(e=n[parseInt(e.toString(),10)]).displayOptions&R.DisplayMode.Classic&&(o=(t=i.querySelector("#"+e.id+j)).querySelector("#"+e.id),e.setProperties({activeSize:R.RibbonItemSize.Large},!0),e.type===R.RibbonItemType.GroupButton&&(o=t.querySelector("#"+e.id+G)),c.setItemSize(o,e),i.insertAdjacentElement("beforebegin",t))}var n=c.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)].collections[0].items;r(e),o&&r(o),r(t),l&&!p||x.remove(i)},u=function(e,t,i,o){function r(e){var t,o;(e=n[parseInt(e.toString(),10)]).items[0].displayOptions&R.DisplayMode.Classic&&(o=(t=i.querySelector("#"+e.id)).querySelector("#"+e.items[0].id),e.items[0].setProperties({activeSize:R.RibbonItemSize.Large},!0),e.items[0].type===R.RibbonItemType.GroupButton&&(o=t.querySelector("#"+e.items[0].id+G)),c.setItemSize(o,e.items[0]),i.insertAdjacentElement("beforebegin",t))}var n=c.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)].collections;r(e),o&&r(o),r(t),l&&!p||x.remove(i)},h=0;h<n.length;h++){var b=n[parseInt(h.toString(),10)],m=b.getAttribute("data-large-width"),m=m?parseInt(m,10):null;if(m&&(l||t.offsetWidth>m)){var y,f=parseInt(b.getAttribute("data-start"),10),g=parseInt(b.getAttribute("data-end"),10);r===R.ItemOrientation.Row?(y=i.collections[0],(y=this.checkClassicItem(y.items,f+1,!0))===g?d(f,g,b):d(f,g,b,y)):(y=this.checkClassicCollection(i.collections,f+1,!0))===g?u(f,g,b):u(f,g,b,y),l&&!p||b.removeAttribute("data-large-width")}else if(m)return!0}return!1},k.prototype.handleContentSize=function(e,t){e=e.closest("."+At);t?e.classList.add(Qt):e.classList.remove(Qt)},k.prototype.setItemSize=function(e,t){var o;e&&(o=e.closest("."+Ut),t.type===R.RibbonItemType.Button?this.ribbonButtonModule.updateButtonSize(e,t):t.type===R.RibbonItemType.DropDown?this.ribbonDropDownModule.updateDropDownSize(e,t):t.type===R.RibbonItemType.SplitButton?this.ribbonSplitButtonModule.updateSplitButtonSize(e,t):t.type===R.RibbonItemType.Template?(x.remove(e),this.createTemplateContent(t,o)):t.type===R.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.updateGroupButtonSize(e,t),o.classList.remove(Qt,Yt,Zt,Jt),t.activeSize===R.RibbonItemSize.Large?o.classList.add(Yt,Qt):o.classList.add(t.activeSize===R.RibbonItemSize.Medium?Zt:Jt))},k.prototype.createOverflowDropdown=function(b,m,y){var f=this.getGroupResizeOrder(!0,b);if(0!==f.length)for(var g=this,e=0;e<f.length&&m.offsetWidth<y.offsetWidth;e++)!function(e){var t=f[parseInt(e.toString(),10)],e=g.tabObj.element.querySelector("#"+t.id),o=(e.setAttribute("data-expanded-width",y.offsetWidth.toString()),e.querySelector("#"+t.id+j)),i=g.createElement("div",{className:zt+v+Yt,id:t.id+w+j}),e=(e.insertBefore(i,o),S(g.tabs[parseInt(b.toString(),10)].groups,function(e){return e.id===t.id})),r=g.tabs[parseInt(b.toString(),10)],n=(g.checkSmallToMedium(b,r,e,m,y,!0,!1),g.checkMediumToLarge(b,r,e,m,y,!0,!1),g.ribbonDropDownModule.createOverFlowDropDown(t.id,t.header,t.groupIconCss,o,i,g.enableRtl));t.keyTip&&(u=t.id+w+ko,g.addKeyTip(b,t.keyTip,u,"grpoverflow")),g.tabs[parseInt(b.toString(),10)].groups[parseInt(e.toString(),10)].setProperties({isCollapsed:!0},!0);for(var s=0;s<t.collections.length;s++)for(var a=t.collections[parseInt(s.toString(),10)],l=o.querySelector("#"+a.id),p=0;p<a.items.length;p++){var c=a.items[parseInt(p.toString(),10)],d=l.querySelector("#"+c.id+j),u=(null!==d&&(g.handleContentSize(d),g.addOverflowEvents(c,d,n)),document.querySelector("#"+t.id+w+ko)),d=x.getInstance(u,M.DropDownButton);if(d){d=d.target;if(d&&g.keyTipElements[parseInt(b.toString(),10)]){if(c.type===R.RibbonItemType.GroupButton)for(var h=0;h<c.groupButtonSettings.items.length;h++)c.groupButtonSettings.items[parseInt(h.toString(),10)].keyTip&&g.addKeyTip(b,c.groupButtonSettings.items[parseInt(h.toString(),10)].keyTip,c.id+G+h,"grpoverflowpopup");c.keyTip&&g.addKeyTip(b,c.keyTip,c.id,"grpoverflowpopup")}}}}(e)},k.prototype.removeOverflowDropdown=function(c,d,u,h){void 0===u&&(u=!1);var b=this.getGroupResizeOrder(!1,h);if(0!==b.length)for(var m=this,e=0;e<b.length;e++){var t=function(e){var t=b[parseInt(e.toString(),10)],o=m.tabObj.element.querySelector("#"+t.id);if(!o)return"break";e=parseInt(o.getAttribute("data-expanded-width"),10);if(!u&&c.offsetWidth<e)return{value:!0};m.removeDropdown(t.id);var e=S(m.tabs[parseInt(h.toString(),10)].groups,function(e){return e.id===t.id}),i=(m.tabs[parseInt(h.toString(),10)].groups[parseInt(e.toString(),10)].setProperties({isCollapsed:!1},!0),m.tabs[parseInt(h.toString(),10)]);m.checkLargeToMedium(h,i,e,c,d,!0),m.checkMediumToSmall(h,i,e,c,d,!0);for(var r=0;r<t.collections.length;r++)for(var n=t.collections[parseInt(r.toString(),10)],s=o.querySelector("#"+n.id),a=0;a<n.items.length;a++){var l=n.items[parseInt(a.toString(),10)],p=s.querySelector("#"+l.id+j);null!==p&&(m.handleContentSize(p,!0),m.removeOverflowEvent(l,p))}}(e);if("object"==typeof t)return t.value;if("break"===t)break}return!1},k.prototype.removeDropdown=function(e){var t,e=this.tabObj.element.querySelector("#"+e+w+ko);e&&(t=e.parentElement,this.ribbonDropDownModule.removeOverFlowDropDown(e),x.remove(t))},k.prototype.getGroupResizeOrder=function(t,e){var o=this,e=this.tabs[parseInt(e.toString(),10)].groups;return(e=e.filter(function(e){return"Classic"!==o.activeLayout||(x.isUndefined(e.isCollapsible)||e.isCollapsible)&&(t&&x.isUndefined(e.isCollapsed)||!x.isUndefined(e.isCollapsed)&&t!==e.isCollapsed)})).sort(function(e,t){return e.priority-t.priority}),t?e.reverse():e},k.prototype.destroyScroll=function(){this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null)},k.prototype.clearOverflowDropDown=function(e){var t,o=this.tabObj.element.querySelector("#"+this.tabs[parseInt(e.toString(),10)].id+A);o&&(t=o.closest("."+Ot),"Simplified"===this.activeLayout?this.removeSimplfiedOverflow(o,t,e,!0):this.removeOverflowDropdown(o,t,!0,e))},k.prototype.isContextualTab=function(e){var t=!1;if(this.contextualTabs.length)for(var o=0;o<this.contextualTabs.length;o++)for(var i=0;i<this.contextualTabs[parseInt(o.toString(),10)].tabs.length;i++)if(this.contextualTabs[parseInt(o.toString(),10)].tabs[parseInt(i.toString(),10)].id===e){t=!0;break}return t},k.prototype.ribbonTabSelecting=function(e){var o=this,t=(this.currentControlIndex=0,e.selectingItem?e.selectingItem.getAttribute("data-id"):null),i=e.previousItem.getAttribute("data-id"),r=S(this.tabs,function(e){return e.id===t}),n=this.isContextualTab(t),s=S(this.tabs,function(e){return e.id===i}),r=-1===r?this.selectedTab:r,e={cancel:e.cancel,isInteracted:e.isInteracted,previousIndex:s,selectedIndex:r,isContextual:n};this.trigger("tabSelecting",e,function(e){var t;e.cancel||(o.destroyScroll(),o.isAddRemove||-1===s||o.clearOverflowDropDown(s),(e=o.tabObj.items[parseInt(r.toString(),10)].content).querySelector("."+Lt))||0===o.tabs[parseInt(r.toString(),10)].groups.length||(t=o.createGroups(o.tabs[parseInt(r.toString(),10)].groups,r),x.append(t,e))})},k.prototype.createTabItems=function(i){for(var r=this,n=[],s=this,e=0;e<i.length;e++)!function(e){var t=i[parseInt(e.toString(),10)],e=s.createElement("span",{innerHTML:t.header,id:t.id+q}),o=S(s.tabs,function(e){return e.id===t.id}),o=(t.keyTip&&(s.keyTipElements[parseInt(o.toString(),10)]||(s.keyTipElements[parseInt(o.toString(),10)]={}),s.addKeyTip(o,t.keyTip,t.id,"tab")),e.onclick=function(){r.minimize(!1)},e.ondblclick=function(){r.minimize(!0)},{header:{text:e},id:t.id,cssClass:t.cssClass}),e=s.createElement("div",{className:o.cssClass,id:t.id+A});e.classList.add(gt),o.content=e,n.push(o)}(e);return n},k.prototype.renderInitialTab=function(e){var t=this.createGroups(this.tabs[parseInt(e.toString(),10)].groups,e),e=this.tabObj.items[parseInt(e.toString(),10)].content,t=(x.append(t,e),"Simplified"===this.activeLayout&&this.element.classList.add(po),this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A));this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(t),this.checkOverflow(this.selectedTab,t)},k.prototype.addOverflowButton=function(e,t){var o,r=this,i=this.createElement("button",{id:e}),n=this.createElement("div",{className:Tt,attrs:{tabindex:"0"}}),s=this.cssClass?v+this.cssClass:"",s=new M.DropDownButton({iconCss:rt,cssClass:$t+v+Nt+s,target:n,locale:this.locale,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence,beforeOpen:function(t){var e={element:t.element,event:t.event,cancel:t.cancel};r.trigger("overflowPopupOpen",e,function(e){e.cancel&&(t.cancel=!0)})},beforeClose:function(t){var o=t.event?x.closest(t.event.target,"."+ct):null,i=t.event?x.closest(t.event.target,".e-ribbon-group-button-overflow-popup"):null,e={element:t.element,event:t.event,cancel:t.cancel};r.trigger("overflowPopupClose",e,function(e){(o||e.cancel||i)&&(t.element=null,t.cancel=!0)})}},i);return this.element.classList.add(kt),ei(n,this),t||(this.keyTipElements.overflowbtn=[],this.keyTipElements.overflowbtn.push({id:e,type:"overflowbtn",keyTip:"00"})),i.onkeydown=i.onclick=function(){r.itemIndex=-1,o=!i.classList.contains("e-ribbon-overall-of-btn")},n.onkeydown=function(e){return r.upDownKeyHandler(e,n,o),r},s},k.prototype.upDownKeyHandler=function(e,t,o){var i,r=(o=(o?t:t.querySelector(".e-ribbon-of-tab.e-ribbon-active")).getElementsByClassName("e-ribbon-item"))[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-control"),r=r&&r.classList.contains("e-combobox")?o[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-combobox"):null,n=((null===r||"Tab"===e.key||this.itemIndex<0)&&("ArrowDown"===e.key||!e.shiftKey&&"Tab"===e.key?(!this.itemIndex&&0!==this.itemIndex||this.itemIndex<0||this.itemIndex===o.length-1?(this.itemIndex=0,n=o[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(n,o,!0),r&&"Tab"===e.key&&(e.preventDefault(),s=o[this.itemIndex].querySelector(".e-control"))&&s.focus(),i=o[this.itemIndex].querySelector(".e-ribbon-template")):this.itemIndex<o.length-1&&0<=this.itemIndex&&(this.itemIndex++,n=o[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(n,o,!0),i=o[this.itemIndex].querySelector(".e-ribbon-template")),i&&i.focus()):!("ArrowUp"===e.key||e.shiftKey&&"Tab"===e.key)||null!==r&&"Tab"!==e.key||(this.itemIndex&&-1!==this.itemIndex?this.itemIndex<=o.length-1&&0<this.itemIndex&&(this.itemIndex--,n=o[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(n,o,!1),i=o[this.itemIndex].querySelector(".e-ribbon-template")):(this.itemIndex=o.length-1,n=o[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(n,o,!1),r&&e.shiftKey&&"Tab"===e.key&&(e.preventDefault(),s=o[this.itemIndex].querySelector(".e-control"))&&s.focus(),i=o[this.itemIndex].querySelector(".e-ribbon-template")),i&&i.focus()),t.setAttribute("index",this.itemIndex.toString())),parseInt(t.getAttribute("index"),10)),r="",s=o[parseInt(n.toString(),10)]?o[parseInt(n.toString(),10)].querySelector(".e-control"):null;s&&(r=s.getAttribute("data-control")),"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&" "!==e.key&&"Tab"!==e.key||("ColorPicker"===r?("Tab"===e.key&&e.preventDefault(),o[parseInt(n.toString(),10)].querySelector(".e-split-colorpicker").focus()):("Tab"===e.key&&e.preventDefault(),(i=o[parseInt(n.toString(),10)].querySelector(".e-control"))&&i.focus())," "===e.key&&"CheckBox"===r&&(t=o[parseInt(n.toString(),10)].querySelector(".e-control"),s=x.getComponent(t,u.CheckBox),this.itemIndex=-1,s.click())),"SplitButton"!==r||"ArrowRight"!==e.key&&"ArrowLeft"!==e.key||("ArrowRight"===e.key&&(this.enableRtl?o[parseInt(n.toString(),10)].querySelector(".e-control"):o[parseInt(n.toString(),10)].querySelector(".e-dropdown-btn")).focus(),"ArrowLeft"===e.key&&(this.enableRtl?o[parseInt(n.toString(),10)].querySelector(".e-dropdown-btn"):o[parseInt(n.toString(),10)].querySelector(".e-control")).focus()),"Enter"===e.key&&(this.itemIndex=-1)},k.prototype.findDisabledItem=function(e,t,o){for(;e&&e.classList.contains("e-disabled");)o?this.itemIndex===t.length-1&&t[this.itemIndex].closest(".e-ribbon-item").classList.contains("e-disabled")&&(this.itemIndex=-1):0===this.itemIndex&&t[this.itemIndex].closest(".e-ribbon-item").classList.contains("e-disabled")&&(this.itemIndex=t.length),o?this.itemIndex++:this.itemIndex--,e=t[this.itemIndex].closest(".e-ribbon-item")},k.prototype.removeOverflowButton=function(e){var t;e&&(t=e.element,ti(e.target),e.destroy(),t.remove())},k.prototype.removeOverflowEvent=function(e,t){if(t)switch(e.type){case"Button":this.ribbonButtonModule.removeOverFlowEvents(e,t);break;case"DropDown":this.ribbonDropDownModule.removeOverFlowEvents(e,t);break;case"SplitButton":this.ribbonSplitButtonModule.removeOverFlowEvents(e,t);break;case"CheckBox":this.ribbonCheckBoxModule.removeOverFlowEvents(e,t);break;case"ColorPicker":this.ribbonColorPickerModule.removeOverFlowEvents(e,t);break;case"ComboBox":this.ribbonComboBoxModule.removeOverFlowEvents(e,t);break;case"Gallery":this.ribbonGalleryModule.removeOverFlowEvents(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.removeOverFlowEvents(e,t)}},k.prototype.createGroupContainer=function(e,t){var o=this.createElement("div",{className:qt,id:e+j}),e=this.createElement("div",{className:Gt,id:e+q,innerHTML:t});return o.append(e),o},k.prototype.addExpandCollapse=function(){var t=this;this.collapseButton=this.createElement("span",{className:vt+v+ot,id:this.tabObj.element.id+Co,attrs:{tabindex:"0",type:"button","aria-label":"Layout Switcher",role:"button"}}),this.collapseButton.onclick=function(e){t.toggleLayout(e)},this.collapseButton.onkeydown=function(e){"Enter"===e.key&&t.toggleLayout(e)},this.element.classList.add(It),"Simplified"===this.activeLayout&&this.collapseButton.classList.add(St),this.tabObj.element.appendChild(this.collapseButton),this.layoutSwitcherKeyTip&&(this.keyTipElements.collapse=[],this.keyTipElements.collapse.push({id:this.collapseButton.id,type:"collapse",keyTip:this.layoutSwitcherKeyTip}))},k.prototype.removeExpandCollapse=function(){var t=this,e=S(this.tooltipData,function(e){return e.id===t.collapseButton.id});-1!==e&&this.tooltipData.splice(e,1),this.element.classList.remove(It),x.remove(this.tabObj.element.querySelector("."+vt)),this.collapseButton=null},k.prototype.reRenderTabs=function(e){this.destroyScroll(),this.checkID(this.tabs,"tab",this.element.id);for(var t=0,o=Object.keys(e);t<o.length;t++){for(var i=o[t],r=parseInt(i,10),i=e[parseInt(r.toString(),10)],n=!1,s=0;s<this.tabObj.items.length;s++)if(this.tabs[parseInt(r.toString(),10)].id===this.tabObj.items[parseInt(s.toString(),10)].id){n=!0;break}if(!n){this.destroyTabItems(this.tabsInternal),this.tabsInternal=this.tabs.slice(),this.validateItemSize();var a=this.createTabItems(this.tabs);this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:a,selectedItem:this.selectedTab});break}var l=this.tabs[parseInt(r.toString(),10)].groups,p=this.tabObj.element,c=this.tabs[parseInt(r.toString(),10)],d=(c.setProperties(i,!0),this.setProperties({groups:this.checkID(c.groups,"group",c.id)},!0),this.validateItemSize(),this.tabObj.items[parseInt(r.toString(),10)].content);if(l&&(i.header&&(this.tabObj.items[parseInt(r.toString(),10)].header.text.innerText=c.header),i.cssClass&&(this.tabObj.items[parseInt(r.toString(),10)].cssClass&&(d.classList.remove(this.tabObj.items[parseInt(r.toString(),10)].cssClass),p.querySelector(".e-active").classList.remove(this.tabObj.items[parseInt(r.toString(),10)].cssClass)),d.classList.add(c.cssClass),p.querySelector(".e-active").classList.add(c.cssClass)),i.groups)){for(var u=0,h=l;u<h.length;u++){for(var b=h[u],m=b.isCollapsed?d.querySelector("#"+b.id+w+ko):null,y=0,f=b.collections;y<f.length;y++)for(var g=0,v=f[y].items;g<v.length;g++){var S=v[g],I=m?this.ribbonDropDownModule.getDDBItemElement(m,S.id):d.querySelector("#"+S.id);I&&this.destroyFunction(S,I)}m&&this.ribbonDropDownModule.removeOverFlowDropDown(m)}d.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()});p=this.createGroups(c.groups,r);x.append(p,d)}}this.tabsInternal!==this.tabs&&(this.tabsInternal=this.tabs,a=this.createTabItems(this.tabs),this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:a,selectedItem:this.selectedTab}));var C=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A);this.checkOverflow(this.selectedTab,C)},k.prototype.switchLayout=function(){this.currentControlIndex=0,this.destroyScroll(),this.collapseButton.classList.toggle(St,"Simplified"===this.activeLayout),this.element.classList.toggle(po,"Simplified"===this.activeLayout);for(var e=0;e<=this.tabs.length-1;e++){var t=e;if(""!==this.tabObj.items[parseInt(t.toString(),10)].content.innerHTML){var o=this.tabs[parseInt(t.toString(),10)],i=this.tabs[parseInt(t.toString(),10)].groups,r=this.tabObj.element.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+A),n=r.closest("."+Ot);if("Simplified"===this.activeLayout)for(var s=0;s<i.length;s++){for(var a=i[parseInt(s.toString(),10)],l=i[parseInt(s.toString(),10)].orientation,p=(a.isCollapsed?(a.setProperties({isCollapsed:!1},!0),this.removeDropdown(a.id)):(this.checkSmallToMedium(t,o,s,n,r,!0,!1),this.checkMediumToLarge(t,o,s,n,r,!0,!1)),n.querySelector("#"+a.id)),c=(w=p.querySelector("#"+a.id+j)).querySelectorAll(".e-ribbon-shrink"),d=0;d<c.length;d++)c[parseInt(d.toString(),10)].remove();(k=w.querySelector("#"+a.id+q)).remove(),(T=w.querySelector("#"+a.id+A)).classList.replace(Vt,Xt),T.classList.remove(Qt);for(var u=0;u<a.collections.length;u++){var h=a.collections[parseInt(u.toString(),10)];(P=w.querySelector("#"+h.id)).classList.replace(Vt,Xt);for(var b=0;b<h.items.length;b++){for(var m=h.items,y=h.items[parseInt(b.toString(),10)],f=!0;f&&y.displayOptions===R.DisplayMode.Classic;){b++;var g=w.querySelector("#"+y.id+j),v=g.querySelector("#"+y.id);this.destroyFunction(y,v),g.remove(),b<m.length?y=m[parseInt(b.toString(),10)]:f=!1}if(!f)break;var S=y.allowedSizes===R.RibbonItemSize.Large||y.allowedSizes&R.RibbonItemSize.Medium?R.RibbonItemSize.Medium:R.RibbonItemSize.Small,S=!(y.displayOptions&R.DisplayMode.Simplified)&&y.displayOptions&R.DisplayMode.Overflow?R.RibbonItemSize.Medium:S,I=void 0;y.displayOptions&R.DisplayMode.Classic?(I=w.querySelector("#"+y.id+j),y.displayOptions===(R.DisplayMode.Classic|R.DisplayMode.Overflow)&&(this.createOverflowPopup(y,t,a.enableGroupOverflow,a.id,a.header,I,w),y.type!==R.RibbonItemType.DropDown&&y.type!==R.RibbonItemType.SplitButton&&y.type!==R.RibbonItemType.GroupButton&&y.type!==R.RibbonItemType.Gallery||this.updatePopupItems(y,I,a.enableGroupOverflow,!0)),y.type===R.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(y,I),y.setProperties({activeSize:S},!0),I&&(v=I.querySelector("#"+y.id),this.setItemSize(v,y))):(I=this.createItems([y],l,a.id,a.header,a.enableGroupOverflow,t,w)[0],y.displayOptions&R.DisplayMode.Simplified&&P.append(I)),y.type===R.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,y.id)}}a.enableGroupOverflow||p.querySelector("."+Ut)||p.classList.add("e-ribbon-emptyCollection")}else{this.element.classList.remove(kt);for(var C=0;C<i.length;C++){var w,a=i[parseInt(C.toString(),10)],l=i[parseInt(C.toString(),10)].orientation,T=(w=n.querySelector("#"+a.id+j)).querySelector("#"+a.id+A),k=this.createElement("div",{className:jt,id:a.id+q,innerHTML:a.header});w.appendChild(k),"Row"===l&&T.classList.replace(Xt,Vt),T.classList.add(Qt);for(u=0;u<a.collections.length;u++){var O,B=void 0,L=void 0,h=(a.enableGroupOverflow?(O=w.querySelector("#"+a.id+_))&&(L=(B=x.getInstance(O,M.DropDownButton)).target):(B=this.overflowDDB)&&(L=this.overflowDDB.target),a.collections[parseInt(u.toString(),10)]),P=w.querySelector("#"+h.id);"Column"===l&&P.classList.replace(Xt,Vt);for(b=0;b<h.items.length;b++){for(m=h.items,y=h.items[parseInt(b.toString(),10)],f=!0;f&&!(y.displayOptions&R.DisplayMode.Classic);){b++;var E,I=void 0;(y.displayOptions&R.DisplayMode.Simplified||y.displayOptions&R.DisplayMode.Overflow)&&null!==(I=(y.displayOptions&R.DisplayMode.Simplified?w:L).querySelector("#"+y.id+j))&&(E=I.querySelector("#"+y.id),this.destroyFunction(y,E),I.remove()),b<m.length?y=m[parseInt(b.toString(),10)]:f=!1}if(!f)break;y.displayOptions&(R.DisplayMode.Simplified|R.DisplayMode.Overflow)?(!(I=w.querySelector("#"+y.id+j))&&L&&(I=L.querySelector("#"+y.id+j),y.type!==R.RibbonItemType.DropDown&&y.type!==R.RibbonItemType.SplitButton&&y.type!==R.RibbonItemType.GroupButton&&y.type!==R.RibbonItemType.Gallery||this.updatePopupItems(y,I,a.enableGroupOverflow,!1),this.removeOverflowEvent(y,I)),y.type===R.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(y,I),I&&P.append(I)):(I=this.createItems([y],l,a.id,a.header,a.enableGroupOverflow,t)[0],P.append(I));var v=w.querySelector("#"+y.id),D=(y.type===R.RibbonItemType.GroupButton&&(v=w.querySelector("#"+y.id+G)),y.allowedSizes&R.RibbonItemSize.Large?R.RibbonItemSize.Large:y.allowedSizes&R.RibbonItemSize.Medium?R.RibbonItemSize.Medium:R.RibbonItemSize.Small);y.setProperties({activeSize:D},!0),this.setItemSize(v,y),y.type===R.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,y.id)}a.enableGroupOverflow&&B&&(0===L.childElementCount||1===L.childElementCount&&this.isHeaderVisible(L,a.id))&&this.removeOverflowButton(B)}}}this.selectedTab===t&&this.checkOverflow(t,r)}}"Classic"===this.activeLayout&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},k.prototype.createLauncherIcon=function(t,e,o){var i=this,r=this.createElement("div",{className:Wt+" "+(this.launcherIconCss||Ft),id:t+To,attrs:{tabindex:"0",type:"button","aria-label":"Launcher Icon",role:"button"}}),e=(e.appendChild(r),e.classList.add(Ht),x.EventHandler.add(r,"click",this.launcherIconClicked.bind(this,t),this),x.EventHandler.add(r,"keydown",function(e){"Enter"===e.key&&i.launcherIconClicked(t)},this),Xo(this.tabs,t));e.group.launcherIconKeyTip&&this.addKeyTip(o,e.group.launcherIconKeyTip,r.id,"launcher")},k.prototype.launcherIconClicked=function(e){this.trigger("launcherIconClick",{groupId:e})},k.prototype.createGroups=function(e,t){for(var o=[],i=0;i<e.length;i++){for(var r=e[parseInt(i.toString(),10)],n=r.orientation,s=this.createElement("div",{className:r.cssClass,id:r.id}),a=(s.classList.add(Lt),o.push(s),this.createElement("div",{className:r.cssClass,id:r.id+j})),l=(a.classList.add(Mt),s.appendChild(a),this.createElement("div",{className:"Simplified"===this.activeLayout?At:At+v+Qt,id:r.id+A})),p=(l.classList.add("Column"===n||"Simplified"===this.activeLayout?Xt:Vt),a.appendChild(l),"Classic"===this.activeLayout&&(n=this.createElement("div",{className:jt,id:r.id+q,innerHTML:r.header}),a.appendChild(n)),r.showLauncherIcon&&this.createLauncherIcon(r.id,a,t),this.createCollection(r.collections,r.orientation,r.id,r.header,r.enableGroupOverflow,t,a)),c=(x.append(p,l),!0),d=0;d<p.length;d++)if(c)for(var u=0;u<p[parseInt(d.toString(),10)].children.length;u++)if(!p[parseInt(d.toString(),10)].children[parseInt(u.toString(),10)].classList.contains("e-hidden")){c=!1;break}c&&s.classList.add("e-hide-group"),"Simplified"!==this.activeLayout||r.enableGroupOverflow||s.querySelector("."+Ut)||s.classList.add("e-ribbon-emptyCollection");n=this.initialPropsData[parseInt(t.toString(),10)];n&&(n.hiddenGroups&&n.hiddenGroups.length&&this.updateGroupProps("hiddenGroups",n,s),n.disabledGroups)&&n.disabledGroups.length&&this.updateGroupProps("disabledGroups",n,s)}return this.initialPropsData[parseInt(t.toString(),10)]&&delete this.initialPropsData[parseInt(t.toString(),10)],o},k.prototype.updateGroupProps=function(e,t,o){-1!==t[e].indexOf(o.id)&&("hiddenGroups"===e?o.classList.add("e-hidden"):o.classList.add("e-disabled"))},k.prototype.validateItemSize=function(){for(var e=0;e<this.tabs.length;e++)for(var t=this.tabs[parseInt(e.toString(),10)].groups,o=0;o<t.length;o++)for(var i=t[parseInt(o.toString(),10)].collections,r=t[parseInt(o.toString(),10)].orientation,n=0;n<i.length;n++)for(var s=i[parseInt(n.toString(),10)].items,a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)],p=(l.allowedSizes&&0!==l.allowedSizes||l.setProperties({allowedSizes:R.RibbonItemSize.Small|R.RibbonItemSize.Medium|R.RibbonItemSize.Large},!0),"ColorPicker"===l.type&&l.allowedSizes!==R.RibbonItemSize.Small?l.setProperties({allowedSizes:R.RibbonItemSize.Small},!0):"ComboBox"!==l.type&&"CheckBox"!==l.type||l.allowedSizes===R.RibbonItemSize.Medium?("Column"===r&&1<s.length||"Row"===r&&1<i.length)&&l.allowedSizes&R.RibbonItemSize.Large&&(p=(p=l.allowedSizes&(R.RibbonItemSize.Small|R.RibbonItemSize.Medium))||R.RibbonItemSize.Medium,l.setProperties({allowedSizes:p},!0)):l.setProperties({allowedSizes:R.RibbonItemSize.Medium},!0),l.allowedSizes&R.RibbonItemSize.Large?R.RibbonItemSize.Large:l.allowedSizes&R.RibbonItemSize.Medium?R.RibbonItemSize.Medium:R.RibbonItemSize.Small);l.setProperties({activeSize:p},!0)}},k.prototype.createCollection=function(e,t,o,i,r,n,s){for(var a=[],l=0;l<e.length;l++){var p=e[parseInt(l.toString(),10)],c=this.createElement("div",{className:p.cssClass,id:p.id}),p=(c.classList.add(Kt),c.classList.add("Column"!==t||"Simplified"===this.activeLayout?Xt:Vt),a.push(c),this.createItems(p.items,t,o,i,r,n,s));if(x.append(p,c),"Row"===t&&2===l)break}return a},k.prototype.createRibbonItem=function(e,t){switch(e.type){case"Button":this.ribbonButtonModule.createButton(e,t);break;case"DropDown":this.ribbonDropDownModule.createDropDown(e,t);break;case"SplitButton":this.ribbonSplitButtonModule.createSplitButton(e,t);break;case"CheckBox":this.ribbonCheckBoxModule.createCheckBox(e,t);break;case"ColorPicker":this.ribbonColorPickerModule.createColorPicker(e,t);break;case"ComboBox":this.ribbonComboBoxModule.createComboBox(e,t);break;case"Template":this.createTemplateContent(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.createGroupButton(e,t);break;case"Gallery":this.ribbonGalleryModule.createGallery(e,t)}},k.prototype.createItems=function(e,t,o,i,r,n,s){for(var a=[],l=0;l<e.length;l++){for(var p=e[parseInt(l.toString(),10)],c=!0;c&&("Simplified"===this.activeLayout&&!(p.displayOptions&(R.DisplayMode.Simplified|R.DisplayMode.Overflow))||"Classic"===this.activeLayout&&!(p.displayOptions&R.DisplayMode.Classic));)++l<e.length?p=e[parseInt(l.toString(),10)]:c=!1;if(!c)break;var d=this.createElement("div",{className:p.cssClass,id:p.id+j});if((h=d.classList).add.apply(h,[Ut].concat(p.disabled?[st]:[])),p.ribbonTooltipSettings&&Qo(p.ribbonTooltipSettings)&&(d.classList.add(io),this.tooltipData.push({id:d.id,data:p.ribbonTooltipSettings})),p.type===R.RibbonItemType.GroupButton)for(var u=0;u<p.groupButtonSettings.items.length;u++)this.keyTipElements[parseInt(n.toString(),10)]&&p.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip&&this.addKeyTip(n,p.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip,p.id+G+u,"item");p.keyTip&&(p.type===R.RibbonItemType.Gallery?this.addKeyTip(n,p.keyTip,p.id+"_popupButton","item"):this.addKeyTip(n,p.keyTip,p.id,"item"));var h=p.activeSize,h=(p.type!==R.RibbonItemType.Gallery&&("Simplified"===this.activeLayout&&(h=p.allowedSizes===R.RibbonItemSize.Large||p.allowedSizes&R.RibbonItemSize.Medium||p.displayOptions===R.DisplayMode.Overflow?R.RibbonItemSize.Medium:R.RibbonItemSize.Small,p.setProperties({activeSize:h},!0)),h&R.RibbonItemSize.Large?d.classList.add(Yt,Qt):d.classList.add(h&R.RibbonItemSize.Medium?Zt:Jt)),this.initialPropsData[parseInt(n.toString(),10)]);if(h&&h.hiddenItems&&h.hiddenItems.length&&-1!==h.hiddenItems.indexOf(p.id)&&d.classList.add("e-hidden"),this.createRibbonItem(p,d),"Simplified"!==this.activeLayout||p.displayOptions!==R.DisplayMode.Overflow&&p.displayOptions!==(R.DisplayMode.Classic|R.DisplayMode.Overflow)?a.push(d):(this.createOverflowPopup(p,n,r,o,i,d,s),p.type!==R.RibbonItemType.DropDown&&p.type!==R.RibbonItemType.SplitButton&&p.type!==R.RibbonItemType.GroupButton&&p.type!==R.RibbonItemType.Gallery||this.updatePopupItems(p,d,r,!0)),"Column"===t&&2===l)break}return a},k.prototype.createHelpPaneTemplate=function(){var e,t;this.helpPaneTemplate&&(this.clearTemplate([e="helpPaneTemplate"]),this.ribbonTempEle=this.createElement("div",{className:to,id:this.element.id+Ro}),t=Uo(this.helpPaneTemplate),x.append(t({},this,e,"helpPaneTemplate",this.isStringTemplate),this.ribbonTempEle),(t=this.tabObj.element).querySelector(".e-toolbar").after(this.ribbonTempEle),t.style.setProperty(_o,this.ribbonTempEle.offsetWidth+"px"),this.renderReactTemplates())},k.prototype.createTemplateContent=function(e,t){var o=this.createElement("div",{className:e.cssClass?eo+v+e.cssClass:eo,id:e.id,attrs:{tabindex:"-1"}});e.disabled&&(o.classList.add(st),o.setAttribute("disabled","")),t.appendChild(o),this.renderItemTemplate(e,o)},k.prototype.renderItemTemplate=function(e,t){var o="ribbon"+e.id+"itemTemplate",i=(this.clearTemplate([o]),Uo(e.itemTemplate));x.append(i({activeSize:R.RibbonItemSize[e.activeSize]},this,o,e.id+"itemTemplate",this.isStringTemplate),t),this.renderReactTemplates()},k.prototype.checkID=function(e,t,o){for(var i="tab"===t?So:"group"===t?"_group":"collection"===t?Io:"_item",r=0;r<e.length;r++){var n,s=e[parseInt(r.toString(),10)];switch(s.id||(n=void 0,"item"===t&&(n=this.hasHtmlAtrrID(s)),s.setProperties({id:n||o+i+this.idIndex++},!0)),t){case"tab":s.setProperties({groups:this.checkID(s.groups,"group",s.id)},!0);break;case"group":s.setProperties({collections:this.checkID(s.collections,"collection",s.id)},!0);break;case"collection":s.setProperties({items:this.checkID(s.items,"item",s.id)},!0)}}return e},k.prototype.hasHtmlAtrrID=function(e){var t="";return e.buttonSettings.htmlAttributes.id?t=e.buttonSettings.htmlAttributes.id:e.checkBoxSettings.htmlAttributes.id?t=e.checkBoxSettings.htmlAttributes.id:e.colorPickerSettings.htmlAttributes.id?t=e.colorPickerSettings.htmlAttributes.id:e.comboBoxSettings.htmlAttributes.id?t=e.comboBoxSettings.htmlAttributes.id:e.dropDownSettings.htmlAttributes.id?t=e.dropDownSettings.htmlAttributes.id:e.splitButtonSettings.htmlAttributes.id&&(t=e.splitButtonSettings.htmlAttributes.id),t},k.prototype.updateCommonProperty=function(e){this.tabObj.setProperties(e),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.setCommonProperties(e),this.ribbonBackstageModule&&this.ribbonBackstageModule.setCommonProperties(e);for(var t=0;t<this.tabs.length;t++){var o=this.tabs[parseInt(t.toString(),10)],i=this.tabObj.items[parseInt(t.toString(),10)].content;if(i.querySelector("."+Lt))for(var r=0,n=o.groups;r<n.length;r++){var s=n[r],a=void 0,l=void 0;this.activeLayout===R.RibbonLayout.Classic?a=s.isCollapsed?i.querySelector("#"+s.id+w+ko):null:(l=(a=s.enableGroupOverflow?i.querySelector("#"+s.id+_):null)?x.getComponent(a,M.DropDownButton):this.overflowDDB)&&(oi(l.target,e),l.setProperties(e));for(var p=0,c=s.collections;p<c.length;p++)for(var d=0,u=c[p].items;d<u.length;d++){var h=u[d],b=null;if(this.activeLayout===R.RibbonLayout.Classic?h.displayOptions&R.DisplayMode.Classic&&(b=a?this.ribbonDropDownModule.getDDBItemElement(a,h.id):h.type===R.RibbonItemType.GroupButton?i.querySelector("#"+h.id+G):i.querySelector("#"+h.id)):(b=h.displayOptions&R.DisplayMode.Simplified?i.querySelector("#"+h.id):null)||(b=l.target.querySelector("#"+h.id),"DropDown"===h.type&&this.updatePopupItems(h,l.target,s.enableGroupOverflow,!0)),b){var m=this.getItemModuleName(h);if("template"!==m)if("group-btn"===m&&"Classic"===this.activeLayout)for(var y=0;y<h.groupButtonSettings.items.length;y++)Zo(b.querySelector("#"+h.id+G+y),"btn",e);else if("group-btn"===m&&"Simplified"===this.activeLayout){Zo(b,"dropdown-btn",e);for(var f=0;f<h.groupButtonSettings.items.length;f++)Zo(document.querySelector("#"+h.id+G+f),"btn",e)}else Zo(b,m,e);else x.isNullOrUndefined(e.enableRtl)||b.classList.toggle(at,e.enableRtl)}}}}},k.prototype.removeLauncherIcon=function(e,t,o){var i=e+j,t=t?this.ribbonDropDownModule.getDDBItemElement(t,i):o.querySelector("#"+i);t&&(t.classList.remove(Ht),o=t.querySelector("#"+e+To),x.remove(o))},k.prototype.destroyTabItems=function(e){for(var t=0;t<e.length;t++)for(var o=e[parseInt(t.toString(),10)],i=this.tabObj.items[parseInt(t.toString(),10)].content,r=0,n=o.groups;r<n.length;r++){var s=n[r],a=void 0,l=void 0;this.activeLayout===R.RibbonLayout.Classic?(a=s.isCollapsed?i.querySelector("#"+s.id+w+ko):null,s.showLauncherIcon&&this.removeLauncherIcon(s.id,a,i)):l=(a=s.enableGroupOverflow?i.querySelector("#"+s.id+_):null)?x.getComponent(a,M.DropDownButton):this.overflowDDB;for(var p=0,c=s.collections;p<c.length;p++)for(var d=0,u=c[p].items;d<u.length;d++){var h=u[d],b=void 0;this.activeLayout===R.RibbonLayout.Classic?h.displayOptions&R.DisplayMode.Classic&&(b=a?this.ribbonDropDownModule.getDDBItemElement(a,h.id):i.querySelector("#"+h.id),h.type===R.RibbonItemType.GroupButton&&(b=a?this.ribbonDropDownModule.getDDBItemElement(a,h.id+G):i.querySelector("#"+h.id+G)),h.type===R.RibbonItemType.Gallery)&&(b=i.querySelector("#"+h.id+j)):(b=h.displayOptions&R.DisplayMode.Simplified?i.querySelector("#"+h.id):null,b=(b=h.type===R.RibbonItemType.Gallery?h.displayOptions&R.DisplayMode.Simplified?i.querySelector("#"+h.id+j):null:b)||(l?l.target.querySelector("#"+h.id):null)),b&&this.destroyFunction(h,b)}this.activeLayout===R.RibbonLayout.Classic&&a?this.ribbonDropDownModule.removeOverFlowDropDown(a):this.activeLayout===R.RibbonLayout.Simplified&&s.enableGroupOverflow&&a&&this.removeOverflowButton(l)}this.overflowDDB&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},k.prototype.destroyFunction=function(o,e){var t=this.getItemModuleName(o);if("colorpicker"===t)this.ribbonColorPickerModule.unwireColorPickerEvents(e);else if("group-btn"===t){if("Classic"===this.activeLayout)for(var i=0;i<o.groupButtonSettings.items.length;i++){var r=e.querySelector("#"+o.id+G+i);r&&Yo(r,"btn")}else this.ribbonGroupButtonModule.destroyDropDown(o);for(var n=this,i=0;i<o.groupButtonSettings.items.length;i++)!function(e){var t;o.groupButtonSettings.items[parseInt(e.toString(),10)].ribbonTooltipSettings&&(t=o.id+G+e,-1!==(e=S(n.tooltipData,function(e){return e.id===t})))&&n.tooltipData.splice(e,1)}(i)}else if("gallery"===t)if(e.closest(".e-ribbon-overflow-target")){Yo(e,"dropdown-btn"),(p=Array.prototype.slice.call(document.querySelectorAll("#"+o.id+"_galleryPopup"))).concat(Array.prototype.slice.call(document.querySelectorAll("#"+o.id+"-popup")));for(i=0;i<p.length;i++)p[parseInt(i.toString(),10)].remove();(a=document.querySelector("#"+o.id+"_popupButton"))&&a.remove();var s=document.querySelector("#"+o.id+"_galleryWrapper");s&&s.remove()}else{var a,l=e.querySelectorAll(".e-ribbon-gallery-item");(a=e.parentElement.querySelector("#"+o.id+"_popupButton"))&&a.remove();for(i=0;i<l.length;i++)l[parseInt(i.toString(),10)].remove();for(var p=document.querySelectorAll("#"+o.id+"_galleryPopup"),i=0;i<p.length;i++)p[parseInt(i.toString(),10)].remove()}else"template"!==t&&Yo(e,t);o.ribbonTooltipSettings&&-1!==(s=S(this.tooltipData,function(e){return e.id===o.id+j}))&&this.tooltipData.splice(s,1),"GroupButton"===o.type&&this.ribbonGroupButtonModule.destroyDropDown(o)},k.prototype.getItemModuleName=function(e){switch(e.type){case"Button":return"btn";case"DropDown":return"dropdown-btn";case"SplitButton":return"split-btn";case"CheckBox":return"checkbox";case"ColorPicker":return"colorpicker";case"ComboBox":return"combobox";case"GroupButton":return"group-btn";case"Gallery":return"gallery";default:return"template"}},k.prototype.clearOverflowResize=function(){this.destroyScroll(),this.clearOverflowDropDown(this.selectedTab);for(var e=this.tabs[this.selectedTab],t=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A),o=t.closest("."+Ot),i=0;i<e.groups.length;i++)this.checkSmallToMedium(this.selectedTab,e,i,o,t,!0,!0),this.checkMediumToLarge(this.selectedTab,e,i,o,t,!0,!0)},k.prototype.refreshLayout=function(){this.resizeHandler()},k.prototype.selectTab=function(t){var e=S(this.tabs,function(e){return e.id===t});this.setProperties({selectedTab:e})},k.prototype.showTab=function(e,t){this.showHideTab(e,!1,t=void 0===t?!1:t)},k.prototype.hideTab=function(e,t){this.showHideTab(e,!0,t=void 0===t?!1:t)},k.prototype.showHideTab=function(t,e,o){var i=S(this.tabs,function(e){return e.id===t});if(-1!==i&&(this.tabObj.hideTab(i,e),o)){for(var r,n=this.tabObj.element,s=0;s<this.contextualTabs.length;s++)for(var a=0;a<this.contextualTabs[parseInt(s.toString(),10)].tabs.length;a++)t===this.contextualTabs[parseInt(s.toString(),10)].tabs[parseInt(a.toString(),10)].id&&(r=this.contextualTabs[parseInt(s.toString(),10)]);if(r){for(var l=!0,p=this,s=0;s<r.tabs.length;s++)!function(t){var e=S(p.tabs,function(e){return e.id===r.tabs[parseInt(t.toString(),10)].id});-1===e||n.querySelectorAll(".e-toolbar-item")[parseInt(e.toString(),10)].classList.contains("e-hidden")||(l=!1)}(s);l?r.setProperties({visible:!1},!0):r.setProperties({visible:!0},!0)}}},k.prototype.enableTab=function(e){this.enableDisableTab(e,!0)},k.prototype.disableTab=function(e){this.enableDisableTab(e,!1)},k.prototype.enableDisableTab=function(t,e){var o,i=S(this.tabs,function(e){return e.id===t});-1!==i&&(o=this.tabObj.items[parseInt(i.toString(),10)].content,this.tabObj.element.querySelector("#"+t+q).classList[e?"remove":"add"]("e-disabled"),o.classList[e?"remove":"add"]("e-disabled"),this.tabObj.enableTab(i,e))},k.prototype.addTab=function(e,t,o){var i=-1===(i=t?S(this.tabs,function(e){return e.id===t}):-1)?this.tabs.length:i+(o?1:0),o=(this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(i,0,e),this.setProperties({tabs:this.tabsInternal},!0),this.checkID([this.tabs[parseInt(i.toString(),10)]],"tab",this.element.id),this.tabsInternal=this.tabs.slice(),this.validateItemSize(),this.createTabItems([e]));this.tabObj.addTab(o,i)},k.prototype.removeTab=function(t){var e=S(this.tabs,function(e){return e.id===t});if(-1!==e){var o=this.tabObj.items[parseInt(e.toString(),10)].content,i=this.tabs[parseInt(e.toString(),10)].groups;if(i&&""!==o.innerHTML)for(var r=0,n=i;r<n.length;r++){for(var s=n[r],a=s.isCollapsed?o.querySelector("#"+s.id+w+ko):null,l=0,p=s.collections;l<p.length;l++)for(var c=0,d=p[l].items;c<d.length;c++){var u=d[c],h=a?this.ribbonDropDownModule.getDDBItemElement(a,u.id):o.querySelector("#"+u.id);(h=u.type===R.RibbonItemType.GroupButton&&"Classic"===this.activeLayout?a?this.ribbonDropDownModule.getDDBItemElement(a,u.id+G):o.querySelector("#"+u.id+G):h)&&this.destroyFunction(u,h)}a&&this.ribbonDropDownModule.removeOverFlowDropDown(a)}e===this.selectedTab&&(this.isAddRemove=!0),this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(e,1),this.setProperties({tabs:this.tabsInternal},!0),this.tabObj.removeTab(e)}},k.prototype.addGroup=function(t,e,o,i){var r,n,s,a=S(this.tabs,function(e){return e.id===t});-1!==a&&(this.selectedTab===a&&this.clearOverflowResize(),n=(s=this.tabs[parseInt(a.toString(),10)]).groups.slice(),r=-1===(r=o?S(n,function(e){return e.id===o}):-1)?n.length:r+(i?1:0),n.splice(r,0,e),s.setProperties({groups:n},!0),this.checkID([s.groups[parseInt(r.toString(),10)]],"group",t),this.validateItemSize(),""!==(e=this.tabObj.items[parseInt(a.toString(),10)].content).innerHTML&&(n=this.createGroups([s.groups[parseInt(r.toString(),10)]],a)[0],(s=o?e.querySelector("#"+o):null)?s.insertAdjacentElement(i?"afterend":"beforebegin",n):e.append(n)),this.selectedTab===a)&&this.refreshLayout()},k.prototype.removeGroup=function(e){var t=Xo(this.tabs,e);if(t){this.selectedTab===t.tabIndex&&this.clearOverflowResize();var o=this.tabObj.items[t.tabIndex].content;if(""!==o.innerHTML){var i=void 0;t.group.showLauncherIcon&&this.removeLauncherIcon(t.group.id,null,o),this.activeLayout===R.RibbonLayout.Simplified&&(i=(p=t.group.enableGroupOverflow?o.querySelector("#"+t.group.id+_):null)?x.getComponent(p,M.DropDownButton):this.overflowDDB);for(var r=0,n=t.group.collections;r<n.length;r++)for(var s=0,a=n[r].items;s<a.length;s++){var l=a[s];this.removeItemElement(o,l,i)}this.activeLayout===R.RibbonLayout.Simplified&&(t.group.enableGroupOverflow?(0===i.target.childElementCount||1===i.target.childElementCount&&this.isHeaderVisible(i.target,t.group.id))&&this.removeOverflowButton(i):((p=i.target.querySelector("#"+t.group.id+j))&&1===p.childElementCount&&p.remove(),(p=i.target.querySelector("#"+this.tabs[parseInt(t.tabIndex.toString(),10)].id+w))&&0===p.childElementCount&&p.remove()));var p=o.querySelector("#"+e);p&&p.remove()}e=this.tabs[t.tabIndex].groups.slice();e.splice(t.groupIndex,1),this.tabs[t.tabIndex].setProperties({groups:e},!0),this.selectedTab===t.tabIndex&&this.refreshLayout()}},k.prototype.isHeaderVisible=function(e,t){return!!e.querySelector("#"+t+_+q)},k.prototype.hideGroup=function(e){this.showHideGroup(e,!0)},k.prototype.showGroup=function(e){this.showHideGroup(e,!1)},k.prototype.showHideGroup=function(e,t){var o,i,r,n=Xo(this.tabs,e);n&&((i=(r=this.tabObj.items[n.tabIndex].content).querySelector("#"+e))?this.updateHiddenElements(n.tabIndex,t?"hideGroup":"showGroup",e,t,i):this.updateInitialProps(n.tabIndex,e,"hiddenGroups",t),this.overflowDDB&&(i=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+w),n.group.enableGroupOverflow?(o=(r=r.querySelector("#"+e+_))?x.getInstance(r,M.DropDownButton).target:o)&&(t?o.classList.add("e-hidden"):o.classList.remove("e-hidden")):i&&(r=i.querySelector("#"+e+j))&&(t?r.classList.add("e-hidden"):r.classList.remove("e-hidden"))),this.selectedTab===n.tabIndex)&&this.refreshLayout()},k.prototype.updateHiddenElements=function(e,t,o,i,r,n){i?r.classList.contains("e-hidden")||(this.checkHiddenElements(t,o,e),r.classList.add("e-hidden"),"hideItem"===t&&this.checkHiddenItems(n,i,e),this.calculateHiddenElementsWidth(e)):r.classList.contains("e-hidden")&&(this.checkHiddenElements(t,o,e),r.classList.remove("e-hidden"),this.calculateHiddenElementsWidth(e),"showItem"===t)&&this.checkHiddenItems(n,i,e)},k.prototype.checkHiddenElements=function(e,t,o){var i;"Simplified"===this.activeLayout&&((i=this.hiddenElements[parseInt(o.toString(),10)])||(this.hiddenElements[parseInt(o.toString(),10)]={},i=this.hiddenElements[parseInt(o.toString(),10)]),i)&&(i[""+e]||(i[""+e]=[]),i[""+e].length&&-1!==i[""+e].indexOf(t)||i[""+e].push(t))},k.prototype.updateItemsSimplifiedWidth=function(s,a){var l=this.hiddenElements[parseInt(s.toString(),10)];if(l&&l[""+a]&&l[""+a].length)for(var p,c=this,e=0;e<l[""+a].length;e++)!function(e){var t=c.tabObj.items[parseInt(s.toString(),10)].content,o=void 0,i=!1,r=0,n="hideGroup"===a||"showGroup"===a?t.querySelector("#"+l[""+a][parseInt(e.toString(),10)]):t.querySelector("#"+l[""+a][parseInt(e.toString(),10)]+j),t=(n&&("hideGroup"===a||"hideItem"===a?(t=!1,n.classList.contains("e-hidden")&&(t=!0,n.classList.remove("e-hidden")),"hideItem"===a&&(o=n.closest(".e-ribbon-group")).classList.contains("e-hide-group")&&(i=!0,r=c.checkWidthDifference(n,o)),c.calculateOverflowItemsWidth(n.offsetWidth+r,!0,s),c.calculateMediumDataWidth(n.offsetWidth+r,s,!0),t&&n.classList.add("e-hidden")):("showItem"===a&&((o=n.closest(".e-ribbon-group")).classList.contains("e-hide-group")?(i=!0,o.classList.remove("e-hide-group"),o.classList.remove("e-ribbon-emptyCollection"),r=Math.abs(n.offsetWidth-o.offsetWidth),-1!==c.hiddenGroups.indexOf(o.id)&&c.hiddenGroups.splice(c.hiddenGroups.indexOf(o.id),1)):-1!==c.hiddenGroups.indexOf(o.id)&&((t=o.querySelectorAll(".e-ribbon-item:not(.e-hidden)")).forEach(function(e){e.id!==n.id&&e.classList.add("e-hidden")}),r=Math.abs(n.offsetWidth-o.offsetWidth),t.forEach(function(e){e.id!==n.id&&e.classList.remove("e-hidden")}),c.hiddenGroups.splice(c.hiddenGroups.indexOf(o.id),1))),c.calculateOverflowItemsWidth(n.offsetWidth+r,!1,s),c.calculateMediumDataWidth(n.offsetWidth+r,s,!1)),i)&&(o.classList.add("e-hide-group"),o.classList.add("e-ribbon-emptyCollection")),l[""+a].indexOf(l[""+a][parseInt(e.toString(),10)]));-1!==t&&(l[""+a].splice(t,1),e--),p=e}(e),e=p},k.prototype.checkWidthDifference=function(e,t){var o=0;return t.classList.remove("e-hide-group"),t.classList.remove("e-ribbon-emptyCollection"),this.hiddenGroups.length&&-1!==this.hiddenGroups.indexOf(t.id)||(this.hiddenGroups.push(t.id),o=Math.abs(e.offsetWidth-t.offsetWidth)),o},k.prototype.calculateHiddenElementsWidth=function(e){if(e===this.selectedTab&&"Simplified"===this.activeLayout){var t=this.hiddenElements[parseInt(e.toString(),10)];if(t)for(var o=0;o<Object.keys(t).length;o++)this.updateItemsSimplifiedWidth(e,Object.keys(t)[parseInt(o.toString(),10)])}},k.prototype.calculateMediumDataWidth=function(e,t,o){if(this.selectedTab===t&&"Simplified"===this.activeLayout){var i=this.tabObj.element.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+A),r=Array.prototype.slice.call(i.querySelectorAll(".e-ribbon-item"));if(this.overflowDDB)for(var n=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),s=document.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+w),a=0;a<n.length;a++){var l=n[parseInt(a.toString(),10)].closest("#"+this.tabs[parseInt(t.toString(),10)].id+w);s&&l&&s.id===l.id&&n[parseInt(a.toString(),10)].hasAttribute("data-medium-width")&&r.push(n[parseInt(a.toString(),10)])}for(var p=i.querySelectorAll(".e-ribbon-group-of-btn"),a=0;a<p.length;a++)for(var n=x.getInstance(p[parseInt(a.toString(),10)],M.DropDownButton).target.querySelectorAll(".e-ribbon-item"),c=0;c<n.length;c++)n[parseInt(c.toString(),10)].hasAttribute("data-medium-width")&&r.push(n[parseInt(c.toString(),10)]);for(var d,a=0;a<r.length;a++)r[parseInt(a.toString(),10)].hasAttribute("data-medium-width")&&(d=parseInt(r[parseInt(a.toString(),10)].getAttribute("data-medium-width"),10),r[parseInt(a.toString(),10)].setAttribute("data-medium-width",(o?d-e:d+e).toString()))}},k.prototype.calculateOverflowItemsWidth=function(e,t,o){if(this.selectedTab===o&&"Simplified"===this.activeLayout)for(var i=this.tabs[parseInt(o.toString(),10)].groups,r=0;r<i.length;r++){var n=i[parseInt(r.toString(),10)];if(n.enableGroupOverflow){var s=void 0,n=document.querySelector("#"+n.id).querySelector("#"+n.id+_);if(s=n?x.getInstance(n,M.DropDownButton):s)for(var a=s.target.querySelectorAll(".e-ribbon-item"),l=0;l<a.length;l++)(c=parseInt(a[parseInt(l.toString(),10)].getAttribute("data-simplified-width"),10))&&a[parseInt(l.toString(),10)].setAttribute("data-simplified-width",(t?c-e:c+e).toString())}}if(this.overflowDDB)for(var p=document.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+w),a=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),r=0;r<a.length;r++){var c,d=a[parseInt(r.toString(),10)].closest("#"+this.tabs[parseInt(o.toString(),10)].id+w);p&&d&&p.id===d.id&&(c=parseInt(a[parseInt(r.toString(),10)].getAttribute("data-simplified-width"),10))&&a[parseInt(r.toString(),10)].setAttribute("data-simplified-width",(t?c-e:c+e).toString())}},k.prototype.disableGroup=function(e){this.enableDisableGroup(e,!0)},k.prototype.enableGroup=function(e){this.enableDisableGroup(e,!1)},k.prototype.enableDisableGroup=function(e,t){var o,i,r,n=Xo(this.tabs,e);n&&((i=(r=this.tabObj.items[n.tabIndex].content).querySelector("#"+e))?t?i.classList.add("e-disabled"):i.classList.remove("e-disabled"):this.updateInitialProps(n.tabIndex,e,"disabledGroups",t),this.overflowDDB)&&(i=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+w),n.group.enableGroupOverflow?(o=(n=r.querySelector("#"+e+_))?x.getInstance(n,M.DropDownButton).target:o)&&(t?o.classList.add("e-disabled"):o.classList.remove("e-disabled")):i&&(r=i.querySelector("#"+e+j))&&(t?r.classList.add("e-disabled"):r.classList.remove("e-disabled")))},k.prototype.addCollection=function(e,t,o,i){var r,n,s=Xo(this.tabs,e);!s||"Row"===s.group.orientation&&3===s.group.collections.length||(this.selectedTab===s.tabIndex&&this.clearOverflowResize(),n=s.group.collections.slice(),r=-1===(r=o?S(n,function(e){return e.id===o}):-1)?n.length:r+(i?1:0),n.splice(r,0,t),s.group.setProperties({collections:n},!0),this.checkID([s.group.collections[parseInt(r.toString(),10)]],"collection",e),this.validateItemSize(),""!==(t=this.tabObj.items[s.tabIndex].content).innerHTML&&(n=s.group.collections[parseInt(r.toString(),10)],r=this.createCollection([n],s.group.orientation,s.group.id,s.group.header,s.group.enableGroupOverflow,s.tabIndex)[0],s.group.isCollapsed&&(t=this.ribbonDropDownModule.getOverflowDropDownPopup(s,t)),(n=o?t.querySelector("#"+o):null)?n.insertAdjacentElement(i?"afterend":"beforebegin",r):t.querySelector("#"+e+A).append(r)),this.selectedTab===s.tabIndex&&this.refreshLayout())},k.prototype.removeCollection=function(e){var t=Vo(this.tabs,e);if(t){this.selectedTab===t.tabIndex&&this.clearOverflowResize();var o=this.tabObj.items[t.tabIndex].content;if(""!==o.innerHTML){var i=void 0;this.activeLayout===R.RibbonLayout.Simplified&&(i=(a=t.group.enableGroupOverflow?o.querySelector("#"+t.group.id+_):null)?x.getComponent(a,M.DropDownButton):this.overflowDDB);for(var r=0,n=t.collection.items;r<n.length;r++){var s=n[r];this.removeItemElement(o,s,i)}var a=o.querySelector("#"+e);a&&a.remove()}e=t.group,a=e.collections.slice();a.splice(t.collectionIndex,1),e.setProperties({collections:a},!0),this.selectedTab===t.tabIndex&&this.refreshLayout()}},k.prototype.addItem=function(e,t,o,i){var r,n,s=Vo(this.tabs,e);!s||"Column"===s.group.orientation&&3===s.collection.items.length||(this.selectedTab===s.tabIndex&&this.clearOverflowResize(),n=s.collection.items.slice(),r=-1===(r=o?S(n,function(e){return e.id===o}):-1)?n.length:r+(i?1:0),n.splice(r,0,t),s.collection.setProperties({items:n},!0),this.checkID([s.collection.items[parseInt(r.toString(),10)]],"item",e),this.validateItemSize(),n=(t=this.tabObj.items[s.tabIndex].content).querySelector("#"+s.group.id+j),""!==t.innerHTML&&(r=s.collection.items[parseInt(r.toString(),10)],r=this.createItems([r],s.group.orientation,s.group.id,s.group.header,s.group.enableGroupOverflow,s.tabIndex,n)[0],s.group.isCollapsed&&(t=this.ribbonDropDownModule.getOverflowDropDownPopup(s,t)),(n=o?t.querySelector("#"+o):null)?n.closest("."+Ut).insertAdjacentElement(i?"afterend":"beforebegin",r):r&&t.querySelector("#"+e).append(r)),this.selectedTab===s.tabIndex&&this.refreshLayout())},k.prototype.removeItem=function(e){var t,o,i,e=g(this.tabs,e);e&&(this.selectedTab===e.tabIndex&&this.clearOverflowResize(),""!==(o=this.tabObj.items[e.tabIndex].content).innerHTML&&(t=i=void 0,this.activeLayout===R.RibbonLayout.Simplified&&(t=(i=e.group.enableGroupOverflow?o.querySelector("#"+e.group.id+_):null)?x.getComponent(i,M.DropDownButton):this.overflowDDB),i=e.item,this.removeItemElement(o,i,t)),(i=(o=e.collection).items).splice(e.itemIndex,1),o.setProperties({items:i},!0),this.selectedTab===e.tabIndex)&&this.refreshLayout()},k.prototype.hideItem=function(e){this.showHideItem(e,!0)},k.prototype.showItem=function(e){this.showHideItem(e,!1)},k.prototype.showHideItem=function(e,t){var o,i=g(this.tabs,e);i&&((o="GroupButton"===i.item.type?I(this,e+G,i):I(this,e,i))?(o=x.closest(o,".e-ribbon-item"),this.updateHiddenElements(i.tabIndex,t?"hideItem":"showItem",e,t,o,i.group),this.selectedTab===i.tabIndex&&this.refreshLayout()):this.updateInitialProps(i.tabIndex,e,"hiddenItems",t))},k.prototype.updateInitialProps=function(e,t,o,i){var r,n=this.initialPropsData[parseInt(e.toString(),10)];n||(this.initialPropsData[parseInt(e.toString(),10)]={},n=this.initialPropsData[parseInt(e.toString(),10)]),n&&(n[""+o]||(n[""+o]=[]),r=n[""+o].indexOf(t),i?-1===r&&n[""+o].push(t):(-1!==r&&n[""+o].splice(r,1),0===n[""+o].length&&delete n[""+o],0===Object.keys(n).length&&delete this.initialPropsData[parseInt(e.toString(),10)]))},k.prototype.checkHiddenItems=function(e,t,o){var i=!0,r=this.tabObj.items[parseInt(o.toString(),10)].content,n=r.querySelector("#"+e.id);if(t){for(var s=0;s<e.collections.length;s++)if(i)for(var a=e.collections[parseInt(s.toString(),10)],l=0;l<a.items.length;l++){var p,c=a.items[parseInt(l.toString(),10)],d=void 0;if(!((d="GroupButton"===c.type?(p=g(this.tabs,c.id),I(this,c.id+G,p)):I(this,c.id))?d.closest(".e-ribbon-item"):null).classList.contains("e-hidden")){i=!1;break}}i&&(n.classList.add("e-hide-group"),this.checkOverflowItems(t,r,e.enableGroupOverflow,o,e.id))}else n.classList.remove("e-hide-group"),this.checkOverflowItems(t,r,e.enableGroupOverflow,o,e.id);"Simplified"!==this.activeLayout||e.enableGroupOverflow||(t=n.querySelectorAll("."+Ut))&&(r=this.checkEmptyCollection(t),n.classList[r?"add":"remove"]("e-ribbon-emptyCollection"))},k.prototype.checkOverflowItems=function(e,t,o,i,r){var n;o?(n=(o=t.querySelector("#"+r+_))?x.getInstance(o,M.DropDownButton).target:n)&&(e?n.classList.add("e-hide-group"):n.classList.remove("e-hide-group")):this.overflowDDB&&(t=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+w))&&(o=t.querySelector("#"+r+j))&&(e?o.classList.add("e-hide-group"):o.classList.remove("e-hide-group"))},k.prototype.updateTab=function(e){var t=e.id,o=S(this.tabs,function(e){return e.id===t});if(-1!==o){var i=this.tabObj.items[parseInt(o.toString(),10)].content,r=this.tabs[parseInt(o.toString(),10)].groups,n=this.tabObj.element;if(r&&""!==i.innerHTML&&(e.cssClass&&this.tabs[parseInt(o.toString(),10)].cssClass&&(i.classList.remove(this.tabs[parseInt(o.toString(),10)].cssClass),n.querySelector(".e-active").classList.remove(this.tabs[parseInt(o.toString(),10)].cssClass)),e.groups)){for(var s=0,a=r;s<a.length;s++){for(var l=a[s],p=l.isCollapsed?i.querySelector("#"+l.id+w+ko):null,c=0,d=l.collections;c<d.length;c++)for(var u=0,h=d[c].items;u<h.length;u++){var b=h[u],m=p?this.ribbonDropDownModule.getDDBItemElement(p,b.id):i.querySelector("#"+b.id);(m=b.type===R.RibbonItemType.GroupButton&&"Classic"===this.activeLayout?p?this.ribbonDropDownModule.getDDBItemElement(p,b.id+G):i.querySelector("#"+b.id+G):m)&&this.destroyFunction(b,m)}p&&this.ribbonDropDownModule.removeOverFlowDropDown(p)}i.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()})}o===this.selectedTab&&(this.isAddRemove=!0);var y,r=this.tabs[parseInt(o.toString(),10)];r.setProperties(e,!0),this.setProperties({groups:this.checkID(r.groups,"group",r.id)},!0),this.validateItemSize(),""===i.innerHTML&&(e.groups&&(y=this.createGroups(r.groups,o),x.append(y,i)),this.selectedTab===o&&this.refreshLayout(),e.cssClass&&(i.classList.add(r.cssClass),n.querySelector(".e-active").classList.add(r.cssClass)),e.header)&&(n.querySelector("#"+t+q).innerText=r.header)}},k.prototype.updateGroup=function(e){var t=e.id,o=Xo(this.tabs,t);if(o){this.selectedTab===o.tabIndex&&this.clearOverflowResize();var i,r=this.tabObj.items[o.tabIndex].content,t=r.querySelector("#"+t),n=t.querySelector("#"+e.id+j);if(""!==r.innerHTML){if(o.group.showLauncherIcon&&this.removeLauncherIcon(o.group.id,null,r),this.activeLayout===R.RibbonLayout.Simplified&&(i=(b=o.group.enableGroupOverflow?r.querySelector("#"+o.group.id+_):null)?x.getComponent(b,M.DropDownButton):this.overflowDDB),e.cssClass&&o.group.cssClass&&(t.classList.remove(o.group.cssClass),n)&&n.classList.remove(o.group.cssClass),(e.collections||e.orientation)&&(o.group.collections||o.group.orientation)){for(var s=0,a=o.group.collections;s<a.length;s++)for(var l=0,p=a[s].items;l<p.length;l++){var c=p[l];this.removeItemElement(r,c,i)}t.querySelectorAll(".e-ribbon-collection").forEach(function(e){e.remove()}),e.orientation&&(b=(d=n.querySelector(".e-ribbon-group-content")).classList.value.match(/(e-ribbon-[column|row]+)/g))&&x.removeClass([d],b)}this.activeLayout===R.RibbonLayout.Simplified&&(o.group.enableGroupOverflow?(0===i.target.childElementCount||1===i.target.childElementCount&&this.isHeaderVisible(i.target,o.group.id))&&this.removeOverflowButton(i):((b=i.target.querySelector("#"+o.group.id+j))&&1===b.childElementCount&&b.remove(),(b=i.target.querySelector("#"+this.tabs[parseInt(o.tabIndex.toString(),10)].id+w))&&0===b.childElementCount&&b.remove()))}var d,u,h,b=o.group;b.setProperties(e,!0),b.setProperties({collections:this.checkID(b.collections,"collection",b.id)},!0),this.validateItemSize(),""!==r.innerHTML&&(e.showLauncherIcon&&this.createLauncherIcon(b.id,n,o.tabIndex),(e.collections||e.orientation)&&((d=n.querySelector(".e-ribbon-group-content")).classList.add("Column"===b.orientation||"Simplified"===this.activeLayout?Xt:Vt),u=this.createCollection(b.collections,b.orientation,b.id,b.header,b.enableGroupOverflow,o.tabIndex,n),x.append(u,d)),this.selectedTab===o.tabIndex&&this.refreshLayout(),e.cssClass&&(t.classList.add(b.cssClass),n)&&n.classList.add(b.cssClass),e.header)&&(this.activeLayout!==R.RibbonLayout.Simplified||e.enableGroupOverflow?this.activeLayout!==R.RibbonLayout.Classic||b.isCollapsed?this.activeLayout===R.RibbonLayout.Classic&&b.isCollapsed&&(u=t.querySelector("#"+b.id+w+ko),h=x.getInstance(u,M.DropDownButton).target.querySelector("#"+e.id+q))&&(h.innerText=b.header):t.querySelector(".e-ribbon-group-header").innerText=b.header:(h=i.target.querySelector("#"+e.id+q))&&(h.innerText=b.header))}},k.prototype.updateCollection=function(e){var t=e.id,o=Vo(this.tabs,t);if(o){this.selectedTab===o.tabIndex&&this.clearOverflowResize();var i=this.tabObj.items[o.tabIndex].content,t=i.querySelector("#"+t);if(""!==i.innerHTML){var r=void 0;if(this.activeLayout===R.RibbonLayout.Simplified&&(r=(p=o.group.enableGroupOverflow?i.querySelector("#"+o.group.id+_):null)?x.getComponent(p,M.DropDownButton):this.overflowDDB),e.cssClass&&o.collection.cssClass&&t.classList.remove(o.collection.cssClass),e.items&&o.collection.items)for(var n=0,s=o.collection.items;n<s.length;n++){var a=s[n];this.removeItemElement(i,a,r)}}var l,p=o.collection;p.setProperties(e,!0),p.setProperties({items:this.checkID(p.items,"item",p.id)},!0),this.validateItemSize(),""!==i.innerHTML&&e.items&&(l=i.querySelector("#"+o.group.id+j),l=this.createItems(p.items,o.group.orientation,o.group.id,o.group.header,o.group.enableGroupOverflow,o.tabIndex,l),x.append(l,t)),this.selectedTab===o.tabIndex&&this.refreshLayout(),e.cssClass&&t.classList.add(p.cssClass)}},k.prototype.updateItem=function(e){var t,o,i,r,n,s,a=e.id,l=g(this.tabs,a);l&&(this.selectedTab===l.tabIndex&&this.clearOverflowResize(),(o=(t=this.tabObj.items[l.tabIndex].content).querySelector("#"+l.group.id))?(o=o.querySelector("#"+l.group.id+j),n=r=null,i=s=void 0,""!==t.innerHTML&&(this.activeLayout===R.RibbonLayout.Simplified&&(i=(s=l.group.enableGroupOverflow?t.querySelector("#"+l.group.id+_):null)?x.getComponent(s,M.DropDownButton):this.overflowDDB),this.activeLayout===R.RibbonLayout.Simplified&&l.item.displayOptions===R.DisplayMode.Overflow?(r=i.target.querySelector("#"+a+j),n=i.target.querySelector("#"+a),e.displayOptions&&e.displayOptions!==R.DisplayMode.Overflow&&(s=o.querySelector("#"+l.collection.id))&&s.appendChild(r)):(r=o.querySelector("#"+a+j),n=t.querySelector("#"+a),r=r||(i?i.target:o).querySelector("#"+a+j),n=n||(i?i.target:t).querySelector("#"+a),"Gallery"===l.item.type&&(n=n||t.querySelector("#"+a+"_galleryWrapper")),"GroupButton"===l.item.type&&this.activeLayout===R.RibbonLayout.Classic&&(n=t.querySelector("#"+a+G)),this.activeLayout===R.RibbonLayout.Simplified&&e.displayOptions===R.DisplayMode.Overflow&&(this.createOverflowPopup(l.item,l.tabIndex,l.group.enableGroupOverflow,l.group.id,l.group.header,r,o),l.item.type!==R.RibbonItemType.DropDown&&l.item.type!==R.RibbonItemType.SplitButton&&e.type!==R.RibbonItemType.GroupButton&&e.type!==R.RibbonItemType.Gallery||this.updatePopupItems(l.item,r,l.group.enableGroupOverflow,!0))),e.cssClass&&l.item.cssClass&&r.classList.remove(l.item.cssClass),this.destroyFunction(l.item,n),n.remove(),s=r.classList.value.match(/(e-ribbon-[large|medium|small]+-item)/g))&&x.removeClass([r],s),(n=l.item).setProperties(e,!0),this.validateItemSize(),""!==t.innerHTML&&(n.ribbonTooltipSettings&&Qo(n.ribbonTooltipSettings)&&(r.classList.add(io),this.tooltipData.push({id:r.id,data:n.ribbonTooltipSettings})),s=n.activeSize,"Simplified"===this.activeLayout&&(s=n.allowedSizes===R.RibbonItemSize.Large||n.allowedSizes&R.RibbonItemSize.Medium||n.displayOptions===R.DisplayMode.Overflow?R.RibbonItemSize.Medium:R.RibbonItemSize.Small,n.setProperties({activeSize:s},!0)),s&R.RibbonItemSize.Large?r.classList.add(Yt,Qt):s&R.RibbonItemSize.Medium?r.classList.add(Zt):r.classList.add(Jt),this.createRibbonItem(n,r),"Gallery"===l.item.type&&document.querySelector("#"+a+"_container").closest(".e-ribbon-overflow-target")&&e.displayOptions!==R.DisplayMode.Overflow&&this.createOverflowPopup(l.item,l.tabIndex,l.group.enableGroupOverflow,l.group.id,l.group.header,r,o),"Simplified"===this.activeLayout&&l.group.enableGroupOverflow&&i&&(0===i.target.childElementCount||1===i.target.childElementCount&&this.isHeaderVisible(i.target,l.group.id))&&this.removeOverflowButton(i),this.selectedTab===l.tabIndex&&this.refreshLayout(),e.cssClass&&r.classList.add(n.cssClass),!n.disabled&&r.classList.contains(st)&&r.classList.remove(st),this.enableDisableItem(n.id,n.disabled))):(this.isUpdateItems=!0,this.itemsModel.push(e),this.targetTabs[e.id]=l.tabIndex))},k.prototype.removeItemElement=function(e,t,o){var i=null;this.activeLayout===R.RibbonLayout.Classic?(i=t.displayOptions&R.DisplayMode.Classic?e.querySelector("#"+t.id):null,"GroupButton"===t.type&&(i=t.displayOptions&R.DisplayMode.Classic?e.querySelector("#"+t.id+G):null)):i=(i=t.displayOptions&R.DisplayMode.Simplified?e.querySelector("#"+t.id):null)||o.target.querySelector("#"+t.id),i&&(this.destroyFunction(t,i),("GroupButton"===t.type&&this.activeLayout===R.RibbonLayout.Simplified?document.getElementById(t.id+j):i.closest("#"+t.id+j)).remove())},k.prototype.enableItem=function(e){this.enableDisableItem(e,!1)},k.prototype.disableItem=function(e){this.enableDisableItem(e,!0)},k.prototype.getItem=function(e){return g(this.tabs,e).item},k.prototype.enableDisableItem=function(e,t){var o,i=!1,r=g(this.tabs,e);if(r&&(r.item.setProperties({disabled:t},!0),"GroupButton"===r.item.type?o=I(this,e+G,r):"Gallery"===r.item.type?(o=document.querySelector("#"+e))?i=!0:o=document.querySelector("#"+e+"_galleryWrapper"):o=I(this,e,r),o)){var n=x.closest(o,".e-ribbon-item"),s=this.getItemModuleName(r.item),a=t?!n.classList.contains(st):n.classList.contains(st);if("template"!==s){if(a)if("group-btn"===s&&"Simplified"===this.activeLayout){Jo(o,"dropdown-btn",t);for(var l=0;l<r.item.groupButtonSettings.items.length;l++)Jo(document.querySelector("#"+e+G+l),"btn",t)}else if("group-btn"===s&&"Classic"===this.activeLayout)for(l=0;l<r.item.groupButtonSettings.items.length;l++)Jo(o.querySelector("#"+e+G+l),"btn",t);else"gallery"===s?(o.classList.toggle(st,t),document.getElementById(e+"_popupButton").classList.toggle(st,t),i&&document.getElementById(e+"_galleryWrapper").classList.toggle(st,t)):Jo(o,s,t)}else o.classList.toggle(st,t),o.toggleAttribute("disabled",t);n.classList.toggle(st,r.item.disabled)}},k.prototype.unwireEvents=function(){x.EventHandler.remove(window,"resize",this.resizeListener),x.EventHandler.remove(document.body,"keydown",this.keytipActionHandler),x.EventHandler.remove(document,"mousedown",this.mouseEventHandler),x.EventHandler.remove(document,"scroll",this.mouseEventHandler)},k.prototype.destroy=function(){this.keyboardModuleRibbon.destroy(),this.keyboardModuleRibbon=null,ti(this.element),this.refreshing&&this.clearOverflowDropDown(this.selectedTab),this.destroyTabItems(this.tabs),this.hideLayoutSwitcher||this.removeExpandCollapse(),this.collapseButton=void 0,this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.ribbonTempEle&&(x.remove(this.ribbonTempEle),this.ribbonTempEle=null),li.prototype.destroy.call(this),this.tabObj.destroy(),this.tabObj=void 0,this.initialPropsData={},this.hiddenGroups=[],this.hiddenElements={},this.keyTipElements={},this.itemsModel=[],this.targetTabs={},x.remove(this.element.querySelector("#"+this.element.id+So)),this.element.style.removeProperty(Mo),this.element.style.removeProperty(_o),this.element.style.removeProperty("width"),this.cssClass&&x.removeClass([this.element],this.cssClass.split(v)),this.element.classList.remove(at,po,kt,It,Bt,"e-rbn"),this.unwireEvents()},k.prototype.onPropertyChanged=function(e,t){for(var o,i=0,r=Object.keys(e);i<r.length;i++)switch(r[i]){case"activeLayout":this.switchLayout();break;case"cssClass":t.cssClass&&(o=this.element.classList).remove.apply(o,t.cssClass.split(v)),e.cssClass&&(o=this.element.classList).add.apply(o,e.cssClass.split(v));break;case"isMinimized":this.element.classList.toggle(Bt,this.isMinimized),this.tabObj.element.querySelector(".e-content").style.display=this.isMinimized?"none":"block",this.isMinimized||this.refreshLayout();break;case"locale":this.updateCommonProperty({locale:this.locale});break;case"enablePersistence":this.updateCommonProperty({enablePersistence:this.enablePersistence});break;case"enableRtl":this.element.classList.toggle(at,this.enableRtl),this.updateCommonProperty({enableRtl:e.enableRtl}),this.scrollModule&&this.scrollModule.setProperties({enableRtl:e.enableRtl});break;case"launcherIconCss":for(var n=0;n<this.tabs.length;n++){var s=this.tabObj.items[parseInt(n.toString(),10)].content,a=this.tabs[parseInt(n.toString(),10)];if(s.querySelector("."+Lt))for(var l=0,p=a.groups;l<p.length;l++){var c,d,u=p[l];u.showLauncherIcon&&(c=Wt+" "+(this.launcherIconCss||Ft),u.isCollapsed?(d=s.querySelector("#"+u.id+w+ko),x.getComponent(d,M.DropDownButton).target.querySelector("#"+u.id+To).className=c):(d=s.querySelector("#"+u.id+To)).className=c)}}break;case"selectedTab":var h=this.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(e.selectedTab.toString(),10)];h.classList.contains("e-hidden")||h.classList.contains("e-disable")||this.tabObj.setProperties({selectedItem:e.selectedTab});break;case"tabAnimation":this.tabObj.setProperties({animation:e.tabAnimation});break;case"tabs":this.reRenderTabs(e.tabs);break;case"contextualTabs":for(n=0;n<this.contextualTabs.length;n++)e.contextualTabs[parseInt(n.toString(),10)]&&this.ribbonContextualTabModule.updateContextualTabs(e.contextualTabs[parseInt(n.toString(),10)],this.contextualTabs[parseInt(n.toString(),10)]);break;case"width":this.element.style.width=x.formatUnit(e.width),this.refreshLayout();break;case"fileMenu":this.ribbonFileMenuModule&&this.ribbonFileMenuModule.updateFileMenu(this.fileMenu),this.tabObj.tbObj.refreshOverflow();break;case"backStageMenu":this.ribbonBackstageModule&&this.ribbonBackstageModule.updateBackStageMenu(this.backStageMenu),this.tabObj.tbObj.refreshOverflow();break;case"helpPaneTemplate":this.ribbonTempEle&&(x.remove(this.ribbonTempEle),this.ribbonTempEle=null,this.tabObj.element.style.setProperty(_o,"0px")),this.helpPaneTemplate&&this.createHelpPaneTemplate(),this.tabObj.tbObj.refreshOverflow();break;case"hideLayoutSwitcher":this.hideLayoutSwitcher?this.removeExpandCollapse():this.addExpandCollapse()}},T([x.Property("Classic")],k.prototype,"activeLayout",void 0),T([x.Property("")],k.prototype,"cssClass",void 0),T([x.Property(!1)],k.prototype,"enableKeyTips",void 0),T([x.Property("")],k.prototype,"layoutSwitcherKeyTip",void 0),T([x.Complex({},_e)],k.prototype,"fileMenu",void 0),T([x.Complex({},Ke)],k.prototype,"backStageMenu",void 0),T([x.Property("")],k.prototype,"launcherIconCss",void 0),T([x.Property(!1)],k.prototype,"isMinimized",void 0),T([x.Property("en-us")],k.prototype,"locale",void 0),T([x.Property(0)],k.prototype,"selectedTab",void 0),T([x.Complex({},L.TabAnimationSettings)],k.prototype,"tabAnimation",void 0),T([x.Collection([],h)],k.prototype,"tabs",void 0),T([x.Collection([],Ye)],k.prototype,"contextualTabs",void 0),T([x.Property("100%")],k.prototype,"width",void 0),T([x.Property("")],k.prototype,"helpPaneTemplate",void 0),T([x.Property(!1)],k.prototype,"hideLayoutSwitcher",void 0),T([x.Event()],k.prototype,"tabSelecting",void 0),T([x.Event()],k.prototype,"tabSelected",void 0),T([x.Event()],k.prototype,"ribbonExpanding",void 0),T([x.Event()],k.prototype,"ribbonCollapsing",void 0),T([x.Event()],k.prototype,"ribbonLayoutSwitched",void 0),T([x.Event()],k.prototype,"launcherIconClick",void 0),T([x.Event()],k.prototype,"created",void 0),T([x.Event()],k.prototype,"overflowPopupOpen",void 0),T([x.Event()],k.prototype,"overflowPopupClose",void 0),pi=T([x.NotifyPropertyChanges],k));function k(e,t){return pi.Inject(qo,jo,Wo,Fo,No,ri),li.call(this,e,t)||this}O.prototype.getModuleName=function(){return"ribbonFileMenu"},O.prototype.destroy=function(){this.fileMenuDDB&&this.destroyDDB(),this.parent=null},O.prototype.createFileMenu=function(e){var t,o,i=this;e.visible&&(this.ddbElement=this.parent.createElement("button",{id:this.parent.element.id+Oo}),o=(t=this.parent.tabObj.element).querySelector(".e-toolbar"),t.insertBefore(this.ddbElement,o),this.fileMenuDDB=new M.DropDownButton({content:e.text,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-file-menu e-caret-hide",created:function(){t.style.setProperty(Mo,i.ddbElement.offsetWidth+"px")},beforeClose:this.ddbBeforeEvent.bind(this,!1),beforeOpen:this.ddbBeforeEvent.bind(this,!0),close:this.ddbAfterEvent.bind(this,!1),open:this.ddbAfterEvent.bind(this,!0)},this.ddbElement),this.parent.fileMenu.popupTemplate?this.fileMenuDDB.setProperties({target:this.parent.fileMenu.popupTemplate}):this.createRibbonMenu(e),this.parent.tabObj.refreshActiveTabBorder(),this.addFileMenuTooltip(e),this.addFileMenuKeytip())},O.prototype.addFileMenuTooltip=function(e){Qo(e.ribbonTooltipSettings)&&(this.ddbElement.classList.add(io),this.parent.tooltipData.push({id:this.ddbElement.id,data:e.ribbonTooltipSettings}))},O.prototype.addFileMenuKeytip=function(){this.parent.fileMenu.keyTip&&(this.parent.keyTipElements.filemenu=[],this.parent.keyTipElements.filemenu.push({id:this.ddbElement.id,type:"filemenu",keyTip:this.parent.fileMenu.keyTip}))},O.prototype.ddbBeforeEvent=function(e,t){!e&&t.event&&t.event.target.closest(".e-ribbon-menu")&&(t.cancel=!0);var o,e=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;e&&(o={cancel:t.cancel,element:t.element,event:t.event},e.call(this,o),t.cancel=o.cancel)},O.prototype.ddbAfterEvent=function(e,t){(e?this.fileMenuDDB.target:this.fileMenuDDB.element).focus();e=e?this.parent.fileMenu.open:this.parent.fileMenu.close;e&&(t={element:t.element},e.call(this,t))},O.prototype.cloneMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];t.push({iconCss:i.iconCss,id:i.id,separator:i.separator,text:i.text,url:i.url,items:this.cloneMenuItem(i.items)})}return t},O.prototype.createRibbonMenu=function(e){var t=this,o=this.parent.createElement("ul",{id:this.parent.element.id+Po});this.fileMenuDDB.setProperties({target:o}),this.menuctrl=new L.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-menu",animationSettings:e.animationSettings,items:this.cloneMenuItem(e.menuItems),showItemOnClick:e.showItemOnClick,template:e.itemTemplate,beforeClose:this.menuBeforeEvent.bind(this,!1),beforeOpen:this.menuBeforeEvent.bind(this,!0),beforeItemRender:this.beforeItemRender.bind(this),onClose:this.menuAfterEvent.bind(this,!1),onOpen:this.menuAfterEvent.bind(this,!0),select:this.menuSelect.bind(this)},o),x.EventHandler.add(o,"keydown",function(e){"Tab"===e.key&&t.fileMenuDDB.toggle()},this)},O.prototype.menuBeforeEvent=function(e,t){var o,e=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;e&&(o={cancel:t.cancel,element:t.element,event:t.event,items:t.items,parentItem:t.parentItem},e.call(this,o),t.cancel=o.cancel)},O.prototype.menuAfterEvent=function(e,t){e=e?this.parent.fileMenu.open:this.parent.fileMenu.close;e&&(t={element:t.element,items:t.items,parentItem:t.parentItem},e.call(this,t))},O.prototype.beforeItemRender=function(e){var t=this.parent.fileMenu.beforeItemRender;t&&(e={element:e.element,item:e.item},t.call(this,e))},O.prototype.menuSelect=function(e){var t=this.parent.fileMenu.select,t=(t&&(o={element:e.element,item:e.item,event:e.event},t.call(this,o)),!!e.element.closest(".e-ribbon-menu.e-popup-open")),o=!!e.element.closest(".e-ribbon-file-menu.e-popup-open"),i=!!document.querySelector(".e-ribbon-file-menu.e-popup-open"),o=o||t&&i;!e.element.classList.contains("e-menu-caret-icon")&&o&&this.fileMenuDDB.toggle()},O.prototype.setCommonProperties=function(e){this.fileMenuDDB&&(this.fileMenuDDB.setProperties(e),this.menuctrl)&&this.menuctrl.setProperties(e)},O.prototype.updateFileMenu=function(e){e.visible?this.fileMenuDDB?(e.text&&(this.fileMenuDDB.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(Mo,this.ddbElement.offsetWidth+"px")),e.popupTemplate?(this.menuctrl&&this.destroyMenu(),this.fileMenuDDB.setProperties({target:e.popupTemplate})):this.menuctrl?this.menuctrl.setProperties({animationSettings:e.animationSettings,items:this.cloneMenuItem(e.menuItems),showItemOnClick:e.showItemOnClick,template:e.itemTemplate}):this.createRibbonMenu(e),this.removeFileMenuTooltip(),this.removeFileMenuKeytip(),this.addFileMenuTooltip(e),this.addFileMenuKeytip()):this.createFileMenu(e):this.fileMenuDDB&&this.destroyDDB(),this.parent.tabObj.refreshActiveTabBorder()},O.prototype.destroyMenu=function(){this.menuctrl&&(this.menuctrl.destroy(),this.menuctrl=null)},O.prototype.destroyDDB=function(){this.removeFileMenuTooltip(),this.removeFileMenuKeytip(),this.parent.tabObj.element.style.removeProperty(Mo),this.destroyMenu(),this.fileMenuDDB.destroy(),this.fileMenuDDB=null,x.remove(this.ddbElement),this.ddbElement=null},O.prototype.removeFileMenuTooltip=function(){var t=this,e=S(this.parent.tooltipData,function(e){return e.id===t.ddbElement.id});-1!==e&&(this.ddbElement.classList.remove(io),this.parent.tooltipData.splice(e,1))},O.prototype.removeFileMenuKeytip=function(){var e,t=this;this.parent.keyTipElements.filemenu&&-1!==(e=S(this.parent.keyTipElements.filemenu,function(e){return e.id===t.ddbElement.id}))&&this.parent.keyTipElements.filemenu.splice(e,1)},O.prototype.addItems=function(e,t,o,i){o?this.menuctrl.insertAfter(e,t,i):this.menuctrl.insertBefore(e,t,i),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},O.prototype.removeItems=function(e,t){this.menuctrl.removeItems(e,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},O.prototype.enableItems=function(e,t){this.menuctrl.enableItems(e,!0,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},O.prototype.disableItems=function(e,t){this.menuctrl.enableItems(e,!1,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},O.prototype.setItem=function(e,t,o){this.menuctrl.setItem(e,t,o),this.menuctrl.refresh(),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)};T=O;function O(e){this.parent=e}di=function(e,t){return(di=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var di,ui,hi=function(e,t){function o(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},hi=(ui=x.Component,hi(B,ui),B.prototype.render=function(){},B.prototype.preRender=function(){},B.prototype.getPersistData=function(){return""},B.prototype.onPropertyChanged=function(){},B.prototype.getModuleName=function(){return"ribbonBackstage"},B.prototype.destroy=function(){this.backstageButton&&this.destroyDDB(),this.parent=null},B.prototype.createBackStage=function(r){var n=this;if(r.visible){this.backstageButtonEle=this.parent.createElement("button",{id:this.parent.element.id+Bo});var e=this.parent.tabObj.element,t=e.querySelector(".e-toolbar");if(e.insertBefore(this.backstageButtonEle,t),this.backstageButton=new u.Button({content:r.text,enableRtl:this.parent.enableRtl,cssClass:bo,created:function(){e.style.setProperty(Mo,n.backstageButtonEle.offsetWidth+"px")}},this.backstageButtonEle),this.createBackStagePopup(r),this.parent.backStageMenu.template)this.createBackStageTemplate(this.parent.backStageMenu.template);else{for(var o=0,i=0,s=0;s<r.items.length;s++)r.items[parseInt(s.toString(),10)].isFooter?o++:i++;0<i&&this.createBackstageMenu(r,!1),0<o&&this.createBackstageMenu(r,!0),this.menuCtrl&&this.checkMenuItems(this.menuCtrl.items),this.footerMenuCtrl&&this.checkMenuItems(this.footerMenuCtrl.items)}this.backstageButtonEle.onclick=function(e){e.stopPropagation(),n.showBackstage(),n.popupHTMLElement.classList.add(uo);e=n.menuWrapper.querySelector(".e-menu-item.e-selected");e&&e.classList.remove("e-selected");for(var t=0;t<r.items.length;t++){var o=r.items[parseInt(t.toString(),10)];if(!o.isFooter&&n.menuCtrl.items[0].text===o.text){var i=n.popupHTMLElement.querySelector("#"+n.menuCtrl.items[0].id);i&&(i.classList.add("e-selected"),i.focus(),n.menuIndex=0,n.isCloseBtn=!1),n.createBackStageContent(n.menuCtrl.items[0].id,o.content);break}}},this.parent.tabObj.refreshActiveTabBorder(),this.addBackStageMenuTooltip(r),this.addBackStageMenuKeyTip(r),x.EventHandler.add(document,"click",this.onClickEvent,this)}},B.prototype.onClickEvent=function(e){e=e.target;this.popupHTMLElement.contains(e)||this.hideBackstage()},B.prototype.addBackStageMenuTooltip=function(e){Qo(e.ribbonTooltipSettings)&&(this.backstageButtonEle.classList.add(io),this.parent.tooltipData.push({id:this.backstageButtonEle.id,data:e.ribbonTooltipSettings}))},B.prototype.addBackStageMenuKeyTip=function(e){if(e.keyTip&&(this.parent.keyTipElements.backstage||(this.parent.keyTipElements.backstage=[]),this.parent.keyTipElements.backstage.push({id:this.backstageButtonEle.id,type:"backstage",keyTip:e.keyTip})),e.items&&e.items.length){this.parent.keyTipElements.backstageMenu||(this.parent.keyTipElements.backstageMenu=[]);for(var t=0;t<e.items.length;t++)e.items[parseInt(t.toString(),10)].keyTip&&this.parent.keyTipElements.backstageMenu.push({id:e.items[parseInt(t.toString(),10)].id,type:"backstageMenu",keyTip:e.items[parseInt(t.toString(),10)].keyTip})}},B.prototype.checkMenuItems=function(e){for(var t=0;t<e.length;t++){var o=e[parseInt(t.toString(),10)];o.iconCss||this.popupHTMLElement.querySelector("#"+o.id).classList.add(vo)}},B.prototype.createBackStagePopup=function(e){var t=this;this.popupHTMLElement=this.parent.createElement("div",{id:this.parent.element.id+Lo,className:co}),(e.target?e.target instanceof HTMLElement?e.target:document.querySelector(e.target):this.parent.element).appendChild(this.popupHTMLElement),this.popupEle=new D.Popup(this.popupHTMLElement,{height:e.height,width:e.width,relateTo:e.target||this.parent.element,enableRtl:this.parent.enableRtl}),this.parent.enableRtl&&this.updatePopupPositionOnRtl(this.parent.enableRtl),this.hideBackstage(),x.EventHandler.add(this.popupHTMLElement,"keyup",function(e){"Escape"===e.code&&t.hideBackstage(),t.handleNavigation(e)},this)},B.prototype.handleNavigation=function(e){var t=this.popupHTMLElement.querySelector(".e-ribbon-close-btn"),o=this.popupHTMLElement.querySelectorAll(".e-menu-item"),i="ArrowUp"===e.key,e="ArrowDown"===e.key;if(i||e){i&&0<this.menuIndex||e&&this.menuIndex<o.length-1&&!this.isCloseBtn?this.menuIndex=i?this.menuIndex-1:this.menuIndex+1:t&&!this.isCloseBtn?(t.focus(),this.isCloseBtn=!0):(this.menuIndex=i?o.length-1:0,this.isCloseBtn=!1);for(var r=0;r<o.length;r++)o[parseInt(r.toString(),10)].classList.remove("e-focused");this.isCloseBtn||(i&&o[this.menuIndex].classList.contains("e-separator")?this.menuIndex--:e&&o[this.menuIndex].classList.contains("e-separator")&&this.menuIndex++,o[this.menuIndex].classList.add("e-focused"),o[this.menuIndex].focus())}},B.prototype.updatePopupPositionOnRtl=function(e){var t=this.popupHTMLElement.style;e?(t.right=t.left,t.left="unset"):(t.left=t.right,t.right="unset")},B.prototype.createBackstageMenu=function(e,t){var o,i,r=this;this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_wrapper")||(this.menuWrapper=this.parent.createElement("div",{id:this.parent.element.id+"_wrapper",className:fo}),this.popupHTMLElement.appendChild(this.menuWrapper)),e.backButton.visible&&!t&&(o=this.parent.createElement("button",{id:this.parent.element.id+"_close",className:"e-ribbon-close-btn"}),this.closeBtn=new u.Button({content:e.backButton.text,iconCss:e.backButton.iconCss||it,enableRtl:this.parent.enableRtl},o),this.menuWrapper.append(o),o.onclick=function(){r.popupHTMLElement.classList.remove(uo),r.hideBackstage(),r.isBackButtonClicked=!0}),this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_itemswrapper")||(this.itemsWrapperEle=this.parent.createElement("div",{id:this.parent.element.id+"_itemswrapper",className:go}),this.menuWrapper.append(this.itemsWrapperEle)),t?(i=this.parent.createElement("ul",{id:this.parent.element.id+Do}),this.itemsWrapperEle.appendChild(i)):(this.ulMenuElem=this.parent.createElement("ul",{id:this.parent.element.id+Eo}),this.itemsWrapperEle.appendChild(this.ulMenuElem)),t?this.footerMenuCtrl=new L.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:mo,items:this.cloneFooterMenuItem(e.items),select:this.menuSelect.bind(this,e)},i):this.menuCtrl=new L.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:mo,items:this.cloneMenuItem(e.items),select:this.menuSelect.bind(this,e)},this.ulMenuElem)},B.prototype.cloneMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];i.isFooter||t.push({id:i.id,iconCss:i.iconCss,separator:i.separator,text:i.text})}return t},B.prototype.cloneFooterMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];i.isFooter&&t.push({id:i.id,iconCss:i.iconCss,separator:i.separator,text:i.text})}return t},B.prototype.createBackStageContent=function(e,t){var o="backstageContent",e=(this.clearTemplate([o]),this.backstageContentEle?(this.backstageContentEle.innerHTML="",this.backstageContentEle.id=e+A):this.backstageContentEle=this.parent.createElement("div",{id:e+A,className:ho}),Uo(t));return x.append(e({},this,o,"backstageContent",this.parent.isStringTemplate),this.backstageContentEle),t&&this.popupHTMLElement.append(this.backstageContentEle),this.renderReactTemplates(),e},B.prototype.createBackStageTemplate=function(e){var t="backstageTemplate",e=(this.clearTemplate([t]),this.backstageTempEle=this.parent.createElement("div",{id:this.parent.element.id+Bo+"_template",className:yo}),Uo(e));return x.append(e({},this,t,"backstageTemplate",this.parent.isStringTemplate),this.backstageTempEle),this.popupHTMLElement.append(this.backstageTempEle),this.renderReactTemplates(),e},B.prototype.menuSelect=function(e,t){for(var o=0;o<e.items.length;o++){var i=e.items[parseInt(o.toString(),10)];if(i.text===t.item.text){this.contentItem=i,this.menuIndex=o;break}}this.createBackStageContent(t.item.id,this.contentItem.content);var r={cancel:!1,target:t.element,item:this.contentItem,isBackButton:this.isBackButtonClicked};this.contentItem.backStageItemClick&&this.contentItem.backStageItemClick.call(this,r)},B.prototype.setCommonProperties=function(e){this.backstageButton&&(this.backstageButton.setProperties(e),this.popupEle)&&(this.popupEle.setProperties(e),this.popupHTMLElement&&this.updatePopupPositionOnRtl(e.enableRtl),this.menuCtrl&&(this.menuCtrl.setProperties(e),this.closeBtn)&&this.closeBtn.setProperties(e),this.footerMenuCtrl)&&this.footerMenuCtrl.setProperties(e)},B.prototype.updateBackStageMenu=function(e){if(e.visible)if(this.backstageButton){if(e.text&&(this.backstageButton.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(Mo,this.backstageButtonEle.offsetWidth+"px")),this.popupEle&&this.popupEle.setProperties({height:e.height,width:e.width,target:e.target||this.parent.element}),e.template)this.backstageTempEle&&(x.remove(this.backstageTempEle),this.backstageTempEle=null),this.createBackStageTemplate(e.template);else if(this.menuCtrl&&this.menuCtrl.setProperties({items:this.cloneMenuItem(e.items)}),this.footerMenuCtrl)this.footerMenuCtrl.setProperties({items:this.cloneFooterMenuItem(e.items)});else{for(var t=0,o=0,i=0;i<e.items.length;i++)e.items[parseInt(i.toString(),10)].isFooter?t++:o++;0<o&&this.createBackstageMenu(e,!1),0<t&&this.createBackstageMenu(e,!0)}this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip(),this.addBackStageMenuTooltip(e),this.addBackStageMenuKeyTip(e)}else this.createBackStage(e);else this.backstageButton&&this.destroyDDB();this.parent.tabObj.refreshActiveTabBorder()},B.prototype.destroyMenu=function(){this.menuCtrl&&(this.menuCtrl.destroy(),this.menuCtrl=null)},B.prototype.destroyDDB=function(){this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip(),this.parent.tabObj.element.style.removeProperty(Mo),this.destroyMenu(),this.backstageButton.destroy(),this.backstageButton=null,x.remove(this.backstageButtonEle),this.backstageButtonEle=null,x.EventHandler.remove(document,"click",this.onClickEvent)},B.prototype.removeBackstageMenuTooltip=function(){var t=this,e=S(this.parent.tooltipData,function(e){return e.id===t.backstageButtonEle.id});-1!==e&&(this.backstageButtonEle.classList.remove(io),this.parent.tooltipData.splice(e,1))},B.prototype.removeBackstageMenuKeyTip=function(){var e,t=this;if(this.parent.keyTipElements.backstage&&this.parent.keyTipElements.backstage.length&&-1!==(e=S(this.parent.keyTipElements.backstage,function(e){return e.id===t.backstageButtonEle.id}))&&this.parent.keyTipElements.backstage.splice(e,1),this.parent.keyTipElements.backstageMenu&&this.parent.keyTipElements.backstageMenu.length)for(var o=0;o<this.parent.keyTipElements.backstageMenu.length;o++)this.parent.keyTipElements.backstageMenu.splice(o,1),o--},B.prototype.addBackstageItems=function(e,t,o,i){for(var r=0;r<e.length;r++)(a=e[parseInt(r.toString(),10)]).isFooter?o?this.footerMenuCtrl.insertAfter(e,t,i):this.footerMenuCtrl.insertBefore(e,t,i):o?this.menuCtrl.insertAfter(e,t,i):this.menuCtrl.insertBefore(e,t,i);for(var n=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items),s=this.parent.backStageMenu,r=0;r<s.items.length;r++)for(var a=s.items[parseInt(r.toString(),10)],l=0;l<n.length;l++){var p=n[parseInt(l.toString(),10)];if(a.text===p.text){p.content=a.content;break}}this.parent.backStageMenu.setProperties({items:n},!0)},B.prototype.removeBackstageItems=function(e,t){this.menuCtrl.removeItems(e,t),this.footerMenuCtrl.removeItems(e,t);e=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items);this.parent.backStageMenu.setProperties({items:e},!0)},B.prototype.showBackstage=function(){this.popupEle.show()},B.prototype.hideBackstage=function(){this.popupEle.element.classList.contains(uo)&&this.popupEle.element.classList.remove(uo),this.popupEle.hide()},B);function B(e){var t=ui.call(this)||this;return t.parent=e,t}mi.prototype.getModuleName=function(){return"ribbonContextualTab"},mi.prototype.destroy=function(){this.parent=null},mi.prototype.addContextualTabs=function(){for(var e=!1,t=0;t<this.parent.contextualTabs.length;t++)for(var o=0;o<this.parent.contextualTabs[parseInt(t.toString(),10)].tabs.length;o++){this.parent.addTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(o.toString(),10)]);var i=this.parent.tabs.length-1,i=this.parent.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(i.toString(),10)];i.classList.add(yt),i.classList.add("e-hidden"),this.parent.contextualTabs[parseInt(t.toString(),10)].visible&&(this.parent.showTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(o.toString(),10)].id,!0),this.parent.contextualTabs[parseInt(t.toString(),10)].isSelected)&&!e&&(this.parent.selectTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[0].id),e=!0)}},mi.prototype.updateContextualTabs=function(e,o){if(!x.isNullOrUndefined(e.visible))for(var t=0;t<o.tabs.length;t++)e.visible?this.parent.showTab(o.tabs[parseInt(t.toString(),10)].id,!0):this.parent.hideTab(o.tabs[parseInt(t.toString(),10)].id,!0);if(!x.isNullOrUndefined(e.isSelected))if(e.isSelected&&o.visible)this.parent.selectTab(o.tabs[0].id);else for(var i=this.parent.tabObj.element,t=0;t<this.parent.tabs.length;t++){var r=i.querySelectorAll(".e-toolbar-item")[parseInt(t.toString(),10)];if(!r.classList.contains("e-hidden")&&!r.classList.contains("e-disable")){this.parent.selectTab(this.parent.tabs[parseInt(t.toString(),10)].id);break}}if(e.tabs)for(var n=this,s=0,a=Object.keys(e.tabs);s<a.length;s++)!function(e){var t=parseInt(e,10),e=n.parent.tabs.filter(function(e){return e.id===o.tabs[parseInt(t.toString(),10)].id})[0];n.parent.updateTab(e)}(a[s])};var bi=mi;function mi(e){this.parent=e}fi.prototype.getModuleName=function(){return"ribbonKeyTip"},fi.prototype.destroy=function(){this.parent=null},fi.prototype.createKeytip=function(e){if(this.parent.keyTipElements){var t=void 0;if("tab"===e){for(var o=0;o<this.parent.tabs.length;o++)this.parent.keyTipElements[parseInt(o.toString(),10)]&&(t=this.parent.keyTipElements[parseInt(o.toString(),10)][""+e],this.createKeyTipElement(t[0].id,t[0].keyTip,"tab","center","bottom",!0));this.parent.keyTipElements.filemenu&&(t=this.parent.keyTipElements.filemenu,this.createKeyTipElement(t[0].id,t[0].keyTip,"filemenu")),this.parent.keyTipElements.backstage&&(t=this.parent.keyTipElements.backstage,this.createKeyTipElement(t[0].id,t[0].keyTip,"backstage")),this.parent.keyTipElements.collapse&&(t=this.parent.keyTipElements.collapse,this.createKeyTipElement(t[0].id,t[0].keyTip,"collapse")),this.parent.keyTipElements.taboverflow&&(t=this.parent.keyTipElements.taboverflow,this.createKeyTipElement(t[0].id,t[0].keyTip,"taboverflow"))}else if("popupitem"===e){if(this.parent.keyTipElements[this.parent.selectedTab].popupitem)for(var i=this.parent.keyTipElements[this.parent.selectedTab].popupitem,o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].popupitem).length;o++)this.createKeyTipElement(i[parseInt(o.toString(),10)].id,i[parseInt(o.toString(),10)].keyTip,"popupitem","left","top",!1,!0)}else if("backstageMenu"===e){if(this.parent.keyTipElements.backstageMenu)for(var r=this.parent.keyTipElements.backstageMenu,o=0;o<Object.keys(this.parent.keyTipElements.backstageMenu).length;o++)this.createKeyTipElement(r[parseInt(o.toString(),10)].id,r[parseInt(o.toString(),10)].keyTip,"backstageMenu","left","center")}else if("grpoverflowpopup"===e&&"Classic"===this.parent.activeLayout){if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflowpopup&&this.calculateItemPosition(e),this.parent.keyTipElements[this.parent.selectedTab].launcher)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"launcher","center","bottom",!1,!0)}else{if(this.calculateItemPosition(e),"Classic"===this.parent.activeLayout){if(this.parent.keyTipElements[this.parent.selectedTab].launcher)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"launcher");if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].grpoverflow,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"grpoverflow")}if("Simplified"===this.parent.activeLayout&&(this.parent.keyTipElements.overflowbtn&&(t=this.parent.keyTipElements.overflowbtn,this.createKeyTipElement(t[0].id,t[0].keyTip,"overflowbtn")),this.parent.keyTipElements[this.parent.selectedTab].grpofbtn))for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpofbtn).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].grpofbtn,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"grpofbtn")}}},fi.prototype.calculateItemPosition=function(e,t,o){void 0===t&&(t=!1);var i,r,n=this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][""+e];if(n)for(var s,a=0;a<Object.keys(this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][""+e]).length;a++)(t&&n[parseInt(a.toString(),10)].keyTip===o||!t)&&(s=n[parseInt(a.toString(),10)].id,-1!==n[parseInt(a.toString(),10)].id.indexOf("_grpbtn")&&(s=n[parseInt(a.toString(),10)].id.replace(/_grpbtn\d+/,"")),(s=g(this.parent.tabs,s))&&"Column"===s.group.orientation&&1<s.collection.items.length&&"Simplified"!==this.parent.activeLayout?r=0===s.itemIndex?(i="center","top"):1===s.itemIndex?i="center":(i="center","bottom"):s&&"Row"===s.group.orientation&&1<s.group.collections.length&&"Simplified"!==this.parent.activeLayout&&(r=0===s.collectionIndex?(i="center","top"):(i="center","bottom")),"item"===e?this.createKeyTipElement(n[parseInt(a.toString(),10)].id,n[parseInt(a.toString(),10)].keyTip,e,i,r):this.createKeyTipElement(n[parseInt(a.toString(),10)].id,n[parseInt(a.toString(),10)].keyTip,e,i,r,!1,!0))},fi.prototype.createKeyTipElement=function(e,t,o,i,r,n,s){void 0===i&&(i="center"),void 0===r&&(r="bottom"),void 0===n&&(n=!1),void 0===s&&(s=!1);var a,l=document.querySelector("#"+e),p=!1;(l=n?document.querySelector("#"+e+q):l)&&(l.closest(".e-ribbon-group-overflow-ddb")&&(p=!0),n&&s&&l.closest(".e-toolbar-pop")&&(p=!0),l.closest(".e-split-btn-wrapper")?a=l.closest(".e-split-btn-wrapper").closest(".e-ribbon-item").id:l.closest(".e-colorpicker-wrapper")&&(a=(l=l.closest(".e-colorpicker-wrapper")).closest(".e-ribbon-item").id)),(l&&l.offsetParent||n&&s)&&(s&&p||!s)&&(p=this.parent.createElement("div",{className:ut,id:e+xo,attrs:{role:"dialog","aria-label":"ribbon-keytip"}}),document.body.append(p),new D.Popup(p,{relateTo:"#"+(n?e+q:a||e),content:t,collision:{X:"fit",Y:"flip"},targetType:"relative",position:{X:i,Y:r},enableRtl:this.parent.enableRtl,actionOnScroll:"hide"}).show(),this.calculateKeyTipPosition(l,p,o,r),this.parent.isKeytipOpen=!0)},fi.prototype.calculateKeyTipPosition=function(e,t,o,i){var r=e.getBoundingClientRect();"backstageMenu"===o?(t.style.top=r.top+t.offsetHeight/2+"px",t.style.left=r.left+e.offsetWidth/5+"px"):"popupitem"!==o&&(t.style.left=r.left+(r.width-t.offsetWidth)/2+"px"),"filemenu"===o||"backstage"===o?t.style.top=r.top+(e.offsetHeight-e.offsetHeight/3+t.offsetHeight/6)+"px":"item"===o&&"top"===i&&(t.style.top=r.top-e.offsetHeight/2+"px")},fi.prototype.keytipPress=function(e,t){var o=this;void 0===t&&(t=!1),this.isKeytipPresent=!1;for(var i=0;i<Object.keys(this.parent.keyTipElements).length&&!this.isKeytipPresent;i++)if(this.parent.keyTipElements[parseInt(i.toString(),10)])for(var r=0;r<Object.keys(this.parent.keyTipElements[parseInt(i.toString(),10)]).length&&!this.isKeytipPresent;r++)for(var n,s,a,l=this.parent.keyTipElements[parseInt(i.toString(),10)][Object.keys(this.parent.keyTipElements[parseInt(i.toString(),10)])[parseInt(r.toString(),10)]],p=0;p<Object.keys(l).length&&!this.isKeytipPresent;p++)e.toUpperCase()===l[parseInt(p.toString(),10)].keyTip&&(document.querySelector("#"+l[parseInt(p.toString(),10)].id+xo)||t)&&(this.isKeytipPresent=!0,this.removeKeytip(),"tab"===l[parseInt(p.toString(),10)].type?i!==this.parent.selectedTab?(this.parent.tabObj.select(i),setTimeout(function(){var e=o.parent.tabObj.element.querySelector(".e-nav-active");e&&e.click(),o.createKeytip("item")},600)):this.createKeytip("item"):"item"===l[parseInt(p.toString(),10)].type||"grpoverflowpopup"===l[parseInt(p.toString(),10)].type||"popupitem"===l[parseInt(p.toString(),10)].type?document.getElementById(l[parseInt(p.toString(),10)].id)&&document.getElementById(l[parseInt(p.toString(),10)].id).classList.contains("e-ribbon-group-button")?document.getElementById(l[parseInt(p.toString(),10)].id).click():(a=void 0,a=-1!==l[parseInt(p.toString(),10)].id.indexOf("_popupButton")?(n=l[parseInt(p.toString(),10)].id.replace(/_popupButton/g,""),g(this.parent.tabs,n)):g(this.parent.tabs,l[parseInt(p.toString(),10)].id),t&&a.tabIndex!==this.parent.selectedTab||this.clickItems(a,l,p,!1,t)):"grpoverflow"!==l[parseInt(p.toString(),10)].type&&"grpofbtn"!==l[parseInt(p.toString(),10)].type&&"launcher"!==l[parseInt(p.toString(),10)].type||(n=document.querySelector("#"+l[parseInt(p.toString(),10)].id),this.removeKeytip(),n&&(s=l[parseInt(p.toString(),10)].id,t?-1===l[parseInt(p.toString(),10)].id.indexOf("_launcher")&&-1===l[parseInt(p.toString(),10)].id.indexOf("_sim_grp_overflow")&&-1===l[parseInt(p.toString(),10)].id.indexOf("_overflow_dropdown")||(s=l[parseInt(p.toString(),10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g,""),(a=Xo(this.parent.tabs,s)).tabIndex===this.parent.selectedTab&&this.clickItems(a,l,p,!0,t,n)):this.clickItems(null,l,p,!0,t,n))));else this.parent.keyTipElements&&this.commonItemsKeyTipPress(e,Object.keys(this.parent.keyTipElements)[parseInt(i.toString(),10)],t)},fi.prototype.clickItems=function(e,t,o,i,r,n){if(i)n.click(),"launcher"!==t[parseInt(o.toString(),10)].type&&(this.isKeytipPopupOpen=!0,"grpoverflow"===t[parseInt(o.toString(),10)].type?this.createKeytip("grpoverflowpopup"):this.createKeytip("popupitem"));else{var s=t[parseInt(o.toString(),10)].id;switch(document.querySelector("#"+s)&&r&&("Simplified"===this.parent.activeLayout?document.querySelector("#"+s).closest("#"+e.group.id+"_sim_grp_overflow-popup")&&document.querySelector("#"+s).closest("#"+e.group.id+"_sim_grp_overflow-popup").classList.contains("e-popup-close")?document.querySelector("#"+e.group.id+"_sim_grp_overflow").click():document.querySelector("#"+s).closest("#"+this.parent.tabObj.element.id+wo+"-popup")&&document.querySelector("#"+s).closest("#"+this.parent.tabObj.element.id+wo+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+this.parent.tabObj.element.id+wo).click():document.querySelector("#"+s).closest("#"+e.group.id+w+ko+"-popup")&&document.querySelector("#"+s).closest("#"+e.group.id+w+ko+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+e.group.id+w+ko).click()),this.parent.getItemModuleName(e.item)){case"btn":this.parent.ribbonButtonModule.click(s);break;case"dropdown-btn":this.parent.ribbonDropDownModule.toggle(s);break;case"split-btn":this.parent.ribbonSplitButtonModule.toggle(s);break;case"checkbox":this.parent.ribbonCheckBoxModule.click(s);break;case"colorpicker":this.parent.ribbonColorPickerModule.toggle(s);break;case"combobox":var a=document.querySelector("#"+s);this.isInteractableElement(a)&&setTimeout(function(){a.focus()},100);break;case"gallery":var l=document.querySelector("#"+s);this.isInteractableElement(l)&&l.click();break;case"template":l=document.querySelector("#"+s);this.isInteractableElement(l)&&l.focus();break;case"group-btn":l=document.querySelector("#"+s);if(this.isInteractableElement(l)){x.getInstance(l,M.DropDownButton).toggle();for(var p=0;p<e.item.groupButtonSettings.items.length;p++)e.item.groupButtonSettings.items[parseInt(p.toString(),10)].keyTip&&this.createKeyTipElement(s+G+p,e.item.groupButtonSettings.items[parseInt(p.toString(),10)].keyTip,"item")}}}},fi.prototype.isInteractableElement=function(e){return e&&!e.closest(".e-ribbon-item").classList.contains("e-disabled")},fi.prototype.commonItemsKeyTipPress=function(e,t,o){var i=this;if(this.parent.keyTipElements[""+t]){var r=!1,n=this.parent.keyTipElements[""+t],s=void 0;if(n)if("backstageMenu"===t){for(var a=0;a<Object.keys(this.parent.keyTipElements[""+t]).length;a++)if(n[parseInt(a.toString(),10)].keyTip===e.toUpperCase()&&(s=document.querySelector("#"+n[parseInt(a.toString(),10)].id),document.querySelector("#"+s.id+xo)||o)){r=!0,o&&document.querySelector(".e-ribbon-backstage-popup").classList.contains("e-popup-close")&&this.parent.tabObj.element.querySelector(".e-ribbon-backstage").click();break}}else n[0]&&n[0].keyTip===e.toUpperCase()&&(s=document.querySelector("#"+n[0].id),document.querySelector("#"+n[0].id+xo)||o)&&(r=!0);r&&(this.removeKeytip(),this.isKeytipPresent=!0,s)&&(s.click(),"backstage"===t?this.createKeytip("backstageMenu"):"overflowbtn"===t?(this.isKeytipPopupOpen=!0,this.createKeytip("popupitem")):"taboverflow"===t&&setTimeout(function(){for(var e,t=0;t<Object.keys(i.parent.keyTipElements).length;t++)i.parent.keyTipElements[parseInt(t.toString(),10)]&&(e=i.parent.keyTipElements[parseInt(t.toString(),10)].tab,i.createKeyTipElement(e[0].id,e[0].keyTip,"tab","center","bottom",!0,!0))},600))}},fi.prototype.removeKeytip=function(s){for(var a=this,l=document.querySelectorAll(".e-ribbon-keytip"),p=!1,c=(this.parent.keysPress="",this),e=0;e<l.length;e++)!function(t){var e=l[parseInt(t.toString(),10)];if("Escape"===s&&c.parent.keyTipElements&&c.parent.keyTipElements[c.parent.selectedTab]){for(var o=0;o<Object.keys(c.parent.keyTipElements[c.parent.selectedTab]).length;o++){var i=Object.keys(c.parent.keyTipElements[parseInt(c.parent.selectedTab.toString(),10)])[parseInt(o.toString(),10)];if(-1!==S(c.parent.keyTipElements[parseInt(c.parent.selectedTab.toString(),10)][""+i],function(e){return e.id+xo===l[parseInt(t.toString(),10)].id})){if("item"===i&&!c.isKeytipPopupOpen||"grpoverflow"===i&&"Classic"===c.parent.activeLayout){c.createKeytip("tab"),p=!(s="");break}if(c.isKeytipPopupOpen&&("popupitem"===i&&"Simplified"===c.parent.activeLayout||"grpoverflowpopup"===i&&"Classic"===c.parent.activeLayout)){c.createKeytip("item"),p=!(s="");break}}}for(var r=0;r<Object.keys(c.parent.keyTipElements).length;r++)if(c.parent.keyTipElements[parseInt(r.toString(),10)]){for(var n=c.parent.keyTipElements[parseInt(r.toString(),10)].tab,o=0;o<Object.keys(n).length;o++)if(e.id===n[0].id+xo&&document.querySelector("#"+n[0].id+q).closest(".e-toolbar-pop")){c.parent.tabObj.element.querySelector(".e-nav-active").click(),setTimeout(function(){a.createKeytip("tab")},600),p=!(s="");break}if(p)break}!p&&c.parent.keyTipElements.backstageMenu&&-1!==S(c.parent.keyTipElements.backstageMenu,function(e){return e.id+xo===l[parseInt(t.toString(),10)].id})&&(c.createKeytip("tab"),p=!(s=""))}e&&x.remove(e)}(e);this.isKeytipPopupOpen=!1,p||(this.parent.isKeytipOpen=!1)},fi.prototype.showKeyTips=function(e){this.parent.enableKeyTips&&(e?this.keytipPress(e,!0):this.createKeytip("tab"))},fi.prototype.hideKeyTips=function(){this.removeKeytip()};var yi=fi;function fi(e){this.isKeytipPopupOpen=!1,this.parent=e}R.BACKSTAGE_CLOSE_ICON=it,R.BackStageMenu=Ke,R.BackstageBackButton=m,R.BackstageItem=Ne,R.COLLAPSE_BUTTON_ID=Co,R.COLLECTION_ID=Io,R.CONTAINER_ID=j,R.CONTENT_ID=A,R.DISABLED_CSS=st,R.DROPDOWNBUTTON="e-dropdown-btn",R.DROPDOWNBUTTON_HIDE=$t,R.DROPDOWN_ID=ko,R.EXPAND_COLLAPSE_ICON=ot,R.FileMenuSettings=_e,R.GROUPOF_BUTTON_ID=_,R.GROUP_ID="_group",R.HEADER_ID=q,R.HIDE_CSS=bt,R.HORIZONTAL_SCROLLBAR=ht,R.ITEM_ID="_item",R.ITEM_VERTICAL_CENTER=tt,R.LAUNCHER_ID=To,R.OVERFLOW_ICON=rt,R.OVERFLOW_ID=w,R.OVRLOF_BUTTON_ID=wo,R.RIBBON_BACKSTAGE=bo,R.RIBBON_BACKSTAGE_CONTENT=ho,R.RIBBON_BACKSTAGE_ITEMS_WRAPPER=go,R.RIBBON_BACKSTAGE_MENU=mo,R.RIBBON_BACKSTAGE_MENU_ID=Bo,R.RIBBON_BACKSTAGE_MENU_WRAPPER=fo,R.RIBBON_BACKSTAGE_OPEN=uo,R.RIBBON_BACKSTAGE_POPUP=co,R.RIBBON_BACKSTAGE_POPUP_ID=Lo,R.RIBBON_BACKSTAGE_TEMPLATE=yo,R.RIBBON_BACKSTAGE_TEXT_MENU=vo,R.RIBBON_COLLAPSE_BUTTON=vt,R.RIBBON_COLLAPSIBLE=It,R.RIBBON_COLLECTION=Kt,R.RIBBON_COLUMN=Xt,R.RIBBON_CONTENT_HEIGHT=Qt,R.RIBBON_CONTEXTUAL_TAB=yt,R.RIBBON_CONTROL=pt,R.RIBBON_EXPAND_BUTTON=St,R.RIBBON_FILE_MENU_ID=Oo,R.RIBBON_FILE_MENU_LIST=Po,R.RIBBON_FILE_MENU_WIDTH=Mo,R.RIBBON_FOOTER_MENU_LIST=Do,R.RIBBON_GROUP=Lt,R.RIBBON_GROUP_BUTTON=Dt,R.RIBBON_GROUP_BUTTON_CONTENT=xt,R.RIBBON_GROUP_BUTTON_ID=G,R.RIBBON_GROUP_BUTTON_OVERFLOW_POPUP=Rt,R.RIBBON_GROUP_CONTAINER=Mt,R.RIBBON_GROUP_CONTENT=At,R.RIBBON_GROUP_HEADER=jt,R.RIBBON_GROUP_OF_BUTTON=wt,R.RIBBON_GROUP_OVERFLOW=zt,R.RIBBON_GROUP_OVERFLOW_DDB=Nt,R.RIBBON_HELP_PANE_TEMPLATE_ID=Ro,R.RIBBON_HELP_PANE_TEMPLATE_WIDTH=_o,R.RIBBON_HELP_TEMPLATE=to,R.RIBBON_HOVER=lt,R.RIBBON_ITEM=Ut,R.RIBBON_KEYTIP=ut,R.RIBBON_KEYTIP_ID=xo,R.RIBBON_LARGE_ITEM=Yt,R.RIBBON_LAUNCHER=Ht,R.RIBBON_LAUNCHER_ICON=Ft,R.RIBBON_LAUNCHER_ICON_ELE=Wt,R.RIBBON_MEDIUM_ITEM=Zt,R.RIBBON_MENU_LIST=Eo,R.RIBBON_MINIMIZE=Bt,R.RIBBON_MULTIPLE_BUTTON_SELECTION=Et,R.RIBBON_OF_GROUP_CONTAINER=qt,R.RIBBON_OF_TAB_CONTAINER=_t,R.RIBBON_OVERALL_OF_BUTTON=Ct,R.RIBBON_OVERFLOW=kt,R.RIBBON_OVERFLOW_HEADER=Gt,R.RIBBON_OVERFLOW_TARGET=Tt,R.RIBBON_POPUP_CONTROL=ct,R.RIBBON_POPUP_OPEN=dt,R.RIBBON_ROW=Vt,R.RIBBON_SELECTED_CONTENT="e-ribbon-selected-content",R.RIBBON_SIMPLIFIED_MODE=po,R.RIBBON_SINGLE_BUTTON_SELECTION=Pt,R.RIBBON_SMALL_ITEM=Jt,R.RIBBON_TAB=mt,R.RIBBON_TAB_ACTIVE=ft,R.RIBBON_TAB_ITEM=gt,R.RIBBON_TEMPLATE=eo,R.RIBBON_TEXT_CONTAINER=lo,R.RIBBON_TOOLTIP=oo,R.RIBBON_TOOLTIP_CONTAINER=ao,R.RIBBON_TOOLTIP_CONTENT=no,R.RIBBON_TOOLTIP_ICON=so,R.RIBBON_TOOLTIP_TARGET=io,R.RIBBON_TOOLTIP_TITLE=ro,R.RTL_CSS=at,R.Ribbon=ci,R.RibbonBackstage=hi,R.RibbonButton=qo,R.RibbonButtonSettings=e,R.RibbonCheckBox=jo,R.RibbonCheckBoxSettings=H,R.RibbonCollection=c,R.RibbonColorPicker=$e,R.RibbonColorPickerSettings=U,R.RibbonComboBox=No,R.RibbonComboBoxSettings=t,R.RibbonContextualTab=bi,R.RibbonContextualTabSettings=Ye,R.RibbonDropDown=Wo,R.RibbonDropDownSettings=i,R.RibbonFileMenu=T,R.RibbonGallery=si,R.RibbonGalleryGroup=ye,R.RibbonGalleryItem=ue,R.RibbonGallerySettings=Se,R.RibbonGroup=Pe,R.RibbonGroupButton=ri,R.RibbonGroupButtonItem=re,R.RibbonGroupButtonSettings=le,R.RibbonItem=p,R.RibbonKeyTip=yi,R.RibbonSplitButton=Fo,R.RibbonSplitButtonSettings=n,R.RibbonTab=h,R.RibbonTooltip=a,R.SPACE=v,R.TAB_CONTENT=Ot,R.TAB_ID=So,R.VERTICAL_DDB=nt,R.createTooltip=ei,R.destroyControl=Yo,R.destroyTooltip=ti,R.getCollection=Vo,R.getGroup=Xo,R.getIndex=S,R.getItem=g,R.getItemElement=I,R.getTemplateFunction=Uo,R.isTooltipPresent=Qo,R.setCustomAttributes=ii,R.setToolTipContent=$o,R.updateCommonProperty=Zo,R.updateControlDisabled=Jo,R.updateTooltipProp=oi,Object.defineProperty(R,"__esModule",{value:!0})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-navigations","@syncfusion/ej2-dropdowns","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-popups"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Navigations,e.ej2Dropdowns,e.ej2Splitbuttons,e.ej2Buttons,e.ej2Inputs,e.ej2Popups)}(this,function(R,x,L,P,M,u,E,D){"use strict";(e=R.RibbonLayout||(R.RibbonLayout={})).Classic="Classic",e.Simplified="Simplified",(e=R.ItemOrientation||(R.ItemOrientation={})).Row="Row",e.Column="Column",(e=R.RibbonItemSize||(R.RibbonItemSize={}))[e.Large=4]="Large",e[e.Medium=2]="Medium",e[e.Small=1]="Small",(e=R.DisplayMode||(R.DisplayMode={}))[e.Classic=4]="Classic",e[e.Simplified=2]="Simplified",e[e.Overflow=1]="Overflow",e[e.Auto=7]="Auto",(e=R.RibbonItemType||(R.RibbonItemType={})).Button="Button",e.CheckBox="CheckBox",e.ColorPicker="ColorPicker",e.ComboBox="ComboBox",e.DropDown="DropDown",e.SplitButton="SplitButton",e.GroupButton="GroupButton",e.Gallery="Gallery",e.Template="Template",(e=R.RibbonGroupButtonSelection||(R.RibbonGroupButtonSelection={})).Single="Single",e.Multiple="Multiple",z=function(e,t){return(z=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var z,N,e=function(e,t){function o(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},H=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},e=(N=x.ChildProperty,e(W,N),W.prototype.setProperties=function(e,t){N.prototype.setProperties.call(this,e,t)},H([x.Property("")],W.prototype,"content",void 0),H([x.Property("")],W.prototype,"cssClass",void 0),H([x.Property("")],W.prototype,"iconCss",void 0),H([x.Property(!1)],W.prototype,"isToggle",void 0),H([x.Property(!1)],W.prototype,"isPrimary",void 0),H([x.Property({})],W.prototype,"htmlAttributes",void 0),H([x.Event()],W.prototype,"created",void 0),H([x.Event()],W.prototype,"clicked",void 0),W);function W(){return null!==N&&N.apply(this,arguments)||this}F=function(e,t){return(F=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var F,K,H=function(e,t){function o(){this.constructor=e}F(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},U=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},H=(K=x.ChildProperty,H(V,K),U([x.Property(!(V.prototype.setProperties=function(e,t){K.prototype.setProperties.call(this,e,t)}))],V.prototype,"checked",void 0),U([x.Property("")],V.prototype,"cssClass",void 0),U([x.Property("")],V.prototype,"label",void 0),U([x.Property("After")],V.prototype,"labelPosition",void 0),U([x.Property({})],V.prototype,"htmlAttributes",void 0),U([x.Event()],V.prototype,"created",void 0),U([x.Event()],V.prototype,"change",void 0),V);function V(){return null!==K&&K.apply(this,arguments)||this}X=function(e,t){return(X=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var X,Y,U=function(e,t){function o(){this.constructor=e}X(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},t=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},U=(Y=x.ChildProperty,U(o,Y),o.prototype.setProperties=function(e,t){Y.prototype.setProperties.call(this,e,t)},t([x.Property(10)],o.prototype,"columns",void 0),t([x.Property("")],o.prototype,"cssClass",void 0),t([x.Property("")],o.prototype,"label",void 0),t([x.Property(!0)],o.prototype,"enableOpacity",void 0),t([x.Property("Palette")],o.prototype,"mode",void 0),t([x.Property(!0)],o.prototype,"modeSwitcher",void 0),t([x.Property(!1)],o.prototype,"noColor",void 0),t([x.Property(null)],o.prototype,"presetColors",void 0),t([x.Property(!0)],o.prototype,"showButtons",void 0),t([x.Property("#008000ff")],o.prototype,"value",void 0),t([x.Property({})],o.prototype,"htmlAttributes",void 0),t([x.Event()],o.prototype,"beforeClose",void 0),t([x.Event()],o.prototype,"beforeOpen",void 0),t([x.Event()],o.prototype,"beforeTileRender",void 0),t([x.Event()],o.prototype,"created",void 0),t([x.Event()],o.prototype,"change",void 0),t([x.Event()],o.prototype,"open",void 0),t([x.Event()],o.prototype,"select",void 0),o);function o(){return null!==Y&&Y.apply(this,arguments)||this}Z=function(e,t){return(Z=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Z,J,t=function(e,t){function o(){this.constructor=e}Z(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},i=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},t=(J=x.ChildProperty,t(r,J),i([x.Property(!(r.prototype.setProperties=function(e,t){J.prototype.setProperties.call(this,e,t)}))],r.prototype,"allowFiltering",void 0),i([x.Property(!0)],r.prototype,"autofill",void 0),i([x.Property("")],r.prototype,"cssClass",void 0),i([x.Property("")],r.prototype,"label",void 0),i([x.Property([])],r.prototype,"dataSource",void 0),i([x.Complex({text:null,value:null,iconCss:null,groupBy:null},P.FieldSettings)],r.prototype,"fields",void 0),i([x.Property("Contains")],r.prototype,"filterType",void 0),i([x.Property(null)],r.prototype,"footerTemplate",void 0),i([x.Property(null)],r.prototype,"groupTemplate",void 0),i([x.Property(null)],r.prototype,"headerTemplate",void 0),i([x.Property(null)],r.prototype,"index",void 0),i([x.Property(null)],r.prototype,"itemTemplate",void 0),i([x.Property("No records found")],r.prototype,"noRecordsTemplate",void 0),i([x.Property(null)],r.prototype,"placeholder",void 0),i([x.Property("300px")],r.prototype,"popupHeight",void 0),i([x.Property("100%")],r.prototype,"popupWidth",void 0),i([x.Property(!0)],r.prototype,"showClearButton",void 0),i([x.Property("None")],r.prototype,"sortOrder",void 0),i([x.Property(null)],r.prototype,"text",void 0),i([x.Property(null)],r.prototype,"value",void 0),i([x.Property("150px")],r.prototype,"width",void 0),i([x.Property({})],r.prototype,"htmlAttributes",void 0),i([x.Event()],r.prototype,"beforeOpen",void 0),i([x.Event()],r.prototype,"change",void 0),i([x.Event()],r.prototype,"close",void 0),i([x.Event()],r.prototype,"created",void 0),i([x.Event()],r.prototype,"filtering",void 0),i([x.Event()],r.prototype,"open",void 0),i([x.Event()],r.prototype,"select",void 0),r);function r(){return null!==J&&J.apply(this,arguments)||this}Q=function(e,t){return(Q=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Q,$,i=function(e,t){function o(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},i=($=x.ChildProperty,i(s,$),s.prototype.setProperties=function(e,t){$.prototype.setProperties.call(this,e,t)},n([x.Property("")],s.prototype,"closeActionEvents",void 0),n([x.Property("")],s.prototype,"content",void 0),n([x.Property("")],s.prototype,"cssClass",void 0),n([x.Property("")],s.prototype,"iconCss",void 0),n([x.Collection([],M.Item)],s.prototype,"items",void 0),n([x.Property("")],s.prototype,"target",void 0),n([x.Property(!1)],s.prototype,"createPopupOnClick",void 0),n([x.Property({})],s.prototype,"htmlAttributes",void 0),n([x.Event()],s.prototype,"beforeClose",void 0),n([x.Event()],s.prototype,"beforeItemRender",void 0),n([x.Event()],s.prototype,"beforeOpen",void 0),n([x.Event()],s.prototype,"close",void 0),n([x.Event()],s.prototype,"created",void 0),n([x.Event()],s.prototype,"open",void 0),n([x.Event()],s.prototype,"select",void 0),s);function s(){return null!==$&&$.apply(this,arguments)||this}ee=function(e,t){return(ee=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var ee,te,n=function(e,t){function o(){this.constructor=e}ee(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},a=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},n=(te=x.ChildProperty,n(l,te),l.prototype.setProperties=function(e,t){te.prototype.setProperties.call(this,e,t)},a([x.Property("")],l.prototype,"closeActionEvents",void 0),a([x.Property("")],l.prototype,"content",void 0),a([x.Property("")],l.prototype,"cssClass",void 0),a([x.Property("")],l.prototype,"iconCss",void 0),a([x.Collection([],M.Item)],l.prototype,"items",void 0),a([x.Property("")],l.prototype,"target",void 0),a([x.Property({})],l.prototype,"htmlAttributes",void 0),a([x.Event()],l.prototype,"beforeClose",void 0),a([x.Event()],l.prototype,"beforeItemRender",void 0),a([x.Event()],l.prototype,"beforeOpen",void 0),a([x.Event()],l.prototype,"close",void 0),a([x.Event()],l.prototype,"click",void 0),a([x.Event()],l.prototype,"created",void 0),a([x.Event()],l.prototype,"open",void 0),a([x.Event()],l.prototype,"select",void 0),l);function l(){return null!==te&&te.apply(this,arguments)||this}oe=function(e,t){return(oe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var oe,ie,a=function(e,t){function o(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},re=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},a=(ie=x.ChildProperty,a(ne,ie),re([x.Property("")],ne.prototype,"cssClass",void 0),re([x.Property("")],ne.prototype,"id",void 0),re([x.Property("")],ne.prototype,"title",void 0),re([x.Property("")],ne.prototype,"content",void 0),re([x.Property("")],ne.prototype,"iconCss",void 0),ne);function ne(){return null!==ie&&ie.apply(this,arguments)||this}se=function(e,t){return(se=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var se,ae,re=function(e,t){function o(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},le=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},re=(ae=x.ChildProperty,re(pe,ae),pe.prototype.setProperties=function(e,t){ae.prototype.setProperties.call(this,e,t)},le([x.Property("")],pe.prototype,"content",void 0),le([x.Property("")],pe.prototype,"iconCss",void 0),le([x.Property("")],pe.prototype,"keyTip",void 0),le([x.Complex({},a)],pe.prototype,"ribbonTooltipSettings",void 0),le([x.Property(!1)],pe.prototype,"selected",void 0),le([x.Property({})],pe.prototype,"htmlAttributes",void 0),le([x.Event()],pe.prototype,"beforeClick",void 0),le([x.Event()],pe.prototype,"click",void 0),pe);function pe(){return null!==ae&&ae.apply(this,arguments)||this}ce=function(e,t){return(ce=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var ce,de,le=function(e,t){function o(){this.constructor=e}ce(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},ue=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},le=(de=x.ChildProperty,le(he,de),ue([x.Property("")],he.prototype,"header",void 0),ue([x.Property("Single")],he.prototype,"selection",void 0),ue([x.Collection([],re)],he.prototype,"items",void 0),he);function he(){return null!==de&&de.apply(this,arguments)||this}be=function(e,t){return(be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var be,me,ue=function(e,t){function o(){this.constructor=e}be(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},ye=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},ue=(me=x.ChildProperty,ue(fe,me),ye([x.Property("")],fe.prototype,"content",void 0),ye([x.Property("")],fe.prototype,"iconCss",void 0),ye([x.Property({})],fe.prototype,"htmlAttributes",void 0),ye([x.Property("")],fe.prototype,"cssClass",void 0),ye([x.Property(!1)],fe.prototype,"disabled",void 0),fe);function fe(){return null!==me&&me.apply(this,arguments)||this}ge=function(e,t){return(ge=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var ge,ve,ye=function(e,t){function o(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Se=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},ye=(ve=x.ChildProperty,ye(Ie,ve),Se([x.Collection([],ue)],Ie.prototype,"items",void 0),Se([x.Property("")],Ie.prototype,"header",void 0),Se([x.Property("auto")],Ie.prototype,"itemWidth",void 0),Se([x.Property("auto")],Ie.prototype,"itemHeight",void 0),Se([x.Property("")],Ie.prototype,"cssClass",void 0),Ie);function Ie(){return null!==ve&&ve.apply(this,arguments)||this}Ce=function(e,t){return(Ce=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Ce,we,Se=function(e,t){function o(){this.constructor=e}Ce(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},p=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},Se=(we=x.ChildProperty,Se(Te,we),p([x.Collection([],ye)],Te.prototype,"groups",void 0),p([x.Property(3)],Te.prototype,"itemCount",void 0),p([x.Property(null)],Te.prototype,"selectedItemIndex",void 0),p([x.Property("auto")],Te.prototype,"popupHeight",void 0),p([x.Property("auto")],Te.prototype,"popupWidth",void 0),p([x.Property("")],Te.prototype,"template",void 0),p([x.Property("")],Te.prototype,"popupTemplate",void 0),p([x.Event()],Te.prototype,"popupOpen",void 0),p([x.Event()],Te.prototype,"popupClose",void 0),p([x.Event()],Te.prototype,"itemHover",void 0),p([x.Event()],Te.prototype,"beforeItemRender",void 0),p([x.Event()],Te.prototype,"beforeSelect",void 0),p([x.Event()],Te.prototype,"select",void 0),Te);function Te(){return null!==we&&we.apply(this,arguments)||this}ke=function(e,t){return(ke=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var ke,Oe,p=function(e,t){function o(){this.constructor=e}ke(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},c=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},p=(Oe=x.ChildProperty,p(d,Oe),d.prototype.setProperties=function(e,t){Oe.prototype.setProperties.call(this,e,t)},c([x.Property("")],d.prototype,"keyTip",void 0),c([x.Property(R.RibbonItemSize.Medium)],d.prototype,"activeSize",void 0),c([x.Property(R.RibbonItemSize.Small|R.RibbonItemSize.Medium|R.RibbonItemSize.Large)],d.prototype,"allowedSizes",void 0),c([x.Property("")],d.prototype,"id",void 0),c([x.Property("")],d.prototype,"cssClass",void 0),c([x.Property(!1)],d.prototype,"disabled",void 0),c([x.Property("")],d.prototype,"itemTemplate",void 0),c([x.Property("Button")],d.prototype,"type",void 0),c([x.Property(R.DisplayMode.Auto)],d.prototype,"displayOptions",void 0),c([x.Complex({},a)],d.prototype,"ribbonTooltipSettings",void 0),c([x.Complex({},e)],d.prototype,"buttonSettings",void 0),c([x.Complex({},i)],d.prototype,"dropDownSettings",void 0),c([x.Complex({},H)],d.prototype,"checkBoxSettings",void 0),c([x.Complex({},U)],d.prototype,"colorPickerSettings",void 0),c([x.Complex({},t)],d.prototype,"comboBoxSettings",void 0),c([x.Complex({},n)],d.prototype,"splitButtonSettings",void 0),c([x.Complex({},le)],d.prototype,"groupButtonSettings",void 0),c([x.Complex({},Se)],d.prototype,"gallerySettings",void 0),d);function d(){return null!==Oe&&Oe.apply(this,arguments)||this}Be=function(e,t){return(Be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Be,Le,c=function(e,t){function o(){this.constructor=e}Be(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Pe=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},c=(Le=x.ChildProperty,c(Ee,Le),Ee.prototype.setProperties=function(e,t){Le.prototype.setProperties.call(this,e,t)},Pe([x.Property("")],Ee.prototype,"id",void 0),Pe([x.Property("")],Ee.prototype,"cssClass",void 0),Pe([x.Collection([],p)],Ee.prototype,"items",void 0),Ee);function Ee(){return null!==Le&&Le.apply(this,arguments)||this}De=function(e,t){return(De=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var De,Re,Pe=function(e,t){function o(){this.constructor=e}De(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},h=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},Pe=(Re=x.ChildProperty,Pe(b,Re),b.prototype.setProperties=function(e,t){Re.prototype.setProperties.call(this,e,t)},h([x.Property("")],b.prototype,"keyTip",void 0),h([x.Property("")],b.prototype,"launcherIconKeyTip",void 0),h([x.Collection([],c)],b.prototype,"collections",void 0),h([x.Property("")],b.prototype,"cssClass",void 0),h([x.Property("")],b.prototype,"id",void 0),h([x.Property(!1)],b.prototype,"isCollapsed",void 0),h([x.Property(!0)],b.prototype,"isCollapsible",void 0),h([x.Property(!1)],b.prototype,"enableGroupOverflow",void 0),h([x.Property("")],b.prototype,"groupIconCss",void 0),h([x.Property("")],b.prototype,"header",void 0),h([x.Property("Column")],b.prototype,"orientation",void 0),h([x.Property("")],b.prototype,"overflowHeader",void 0),h([x.Property(0)],b.prototype,"priority",void 0),h([x.Property(!1)],b.prototype,"showLauncherIcon",void 0),b);function b(){return null!==Re&&Re.apply(this,arguments)||this}xe=function(e,t){return(xe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var xe,Me,h=function(e,t){function o(){this.constructor=e}xe(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},_e=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},h=(Me=x.ChildProperty,h(qe,Me),qe.prototype.setProperties=function(e,t){Me.prototype.setProperties.call(this,e,t)},_e([x.Property("")],qe.prototype,"keyTip",void 0),_e([x.Property("")],qe.prototype,"id",void 0),_e([x.Property("")],qe.prototype,"cssClass",void 0),_e([x.Collection([],Pe)],qe.prototype,"groups",void 0),_e([x.Property("")],qe.prototype,"header",void 0),qe);function qe(){return null!==Me&&Me.apply(this,arguments)||this}Ae=function(e,t){return(Ae=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Ae,je,_e=function(e,t){function o(){this.constructor=e}Ae(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},m=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},_e=(je=x.ChildProperty,_e(y,je),y.prototype.setProperties=function(e,t){je.prototype.setProperties.call(this,e,t)},m([x.Property("File")],y.prototype,"text",void 0),m([x.Property(!1)],y.prototype,"visible",void 0),m([x.Collection([],L.MenuItem)],y.prototype,"menuItems",void 0),m([x.Property(!1)],y.prototype,"showItemOnClick",void 0),m([x.Complex({},L.MenuAnimationSettings)],y.prototype,"animationSettings",void 0),m([x.Property("")],y.prototype,"itemTemplate",void 0),m([x.Property("")],y.prototype,"popupTemplate",void 0),m([x.Complex({},a)],y.prototype,"ribbonTooltipSettings",void 0),m([x.Event()],y.prototype,"beforeClose",void 0),m([x.Event()],y.prototype,"beforeOpen",void 0),m([x.Event()],y.prototype,"beforeItemRender",void 0),m([x.Event()],y.prototype,"close",void 0),m([x.Event()],y.prototype,"open",void 0),m([x.Event()],y.prototype,"select",void 0),m([x.Property("")],y.prototype,"keyTip",void 0),y);function y(){return null!==je&&je.apply(this,arguments)||this}Ge=function(e,t){return(Ge=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Ge,ze,m=function(e,t){function o(){this.constructor=e}Ge(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Ne=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},m=(ze=x.ChildProperty,m(He,ze),Ne([x.Property("")],He.prototype,"text",void 0),Ne([x.Property("")],He.prototype,"iconCss",void 0),Ne([x.Property(!0)],He.prototype,"visible",void 0),He);function He(){return null!==ze&&ze.apply(this,arguments)||this}We=function(e,t){return(We=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var We,Fe,Ne=function(e,t){function o(){this.constructor=e}We(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Ke=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},Ne=(Fe=x.ChildProperty,Ne(Ue,Fe),Ke([x.Property("")],Ue.prototype,"text",void 0),Ke([x.Property("")],Ue.prototype,"id",void 0),Ke([x.Property("")],Ue.prototype,"keyTip",void 0),Ke([x.Property("")],Ue.prototype,"content",void 0),Ke([x.Property("")],Ue.prototype,"iconCss",void 0),Ke([x.Property(!1)],Ue.prototype,"separator",void 0),Ke([x.Property(!1)],Ue.prototype,"isFooter",void 0),Ke([x.Event()],Ue.prototype,"backStageItemClick",void 0),Ue);function Ue(){return null!==Fe&&Fe.apply(this,arguments)||this}Ve=function(e,t){return(Ve=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Ve,Xe,Ke=function(e,t){function o(){this.constructor=e}Ve(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},Ye=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},Ke=(Xe=x.ChildProperty,Ke(Ze,Xe),Ze.prototype.setProperties=function(e,t){Xe.prototype.setProperties.call(this,e,t)},Ye([x.Property("File")],Ze.prototype,"text",void 0),Ye([x.Property("")],Ze.prototype,"keyTip",void 0),Ye([x.Property(!1)],Ze.prototype,"visible",void 0),Ye([x.Property("auto")],Ze.prototype,"height",void 0),Ye([x.Property("auto")],Ze.prototype,"width",void 0),Ye([x.Property(null)],Ze.prototype,"target",void 0),Ye([x.Complex({},m)],Ze.prototype,"backButton",void 0),Ye([x.Collection([],Ne)],Ze.prototype,"items",void 0),Ye([x.Property("")],Ze.prototype,"template",void 0),Ye([x.Complex({},a)],Ze.prototype,"ribbonTooltipSettings",void 0),Ze);function Ze(){return null!==Xe&&Xe.apply(this,arguments)||this}Je=function(e,t){return(Je=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var Je,Qe,Ye=function(e,t){function o(){this.constructor=e}Je(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},$e=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},Ye=(Qe=x.ChildProperty,Ye(et,Qe),$e([x.Property(!(et.prototype.setProperties=function(e,t){Qe.prototype.setProperties.call(this,e,t)}))],et.prototype,"visible",void 0),$e([x.Property(!1)],et.prototype,"isSelected",void 0),$e([x.Collection([],h)],et.prototype,"tabs",void 0),et);function et(){return null!==Qe&&Qe.apply(this,arguments)||this}var tt="e-ribbon-vertical-center",ot="e-icons e-drop-icon",it="e-icons e-arrow-left",rt="e-icons e-more-horizontal-1",nt="e-vertical",st="e-disabled",at="e-rtl",lt="e-ribbon-hover",pt="e-ribbon-control",ct="e-ribbon-popup-control",dt="e-ribbon-open",ut="e-ribbon-keytip",v=" ",ht="e-hscroll-bar",bt="e-ribbon-hide",mt="e-ribbon-tab",yt="e-ribbon-contextual-tab",ft="e-ribbon-active",gt="e-ribbon-tab-item",vt="e-ribbon-collapse-btn",St="e-ribbon-expand-btn",It="e-ribbon-collapsible",Ct="e-ribbon-overall-of-btn",wt="e-ribbon-group-of-btn",Tt="e-ribbon-overflow-target",kt="e-ribbon-overflow",Ot="e-content",Bt="e-ribbon-minimize",Lt="e-ribbon-group",Pt="e-ribbon-single-selection",Et="e-ribbon-multiple-selection",Dt="e-ribbon-group-button",Rt="e-ribbon-group-button-overflow-popup",xt="e-ribbon-group-button-content",Mt="e-ribbon-group-container",_t="e-ribbon-of-tab",qt="e-ribbon-of-group-container",At="e-ribbon-group-content",jt="e-ribbon-group-header",Gt="e-ribbon-overflow-header",zt="e-ribbon-group-overflow",Nt="e-ribbon-group-overflow-ddb",Ht="e-ribbon-launcher",Wt="e-ribbon-launcher-icon",Ft="e-icons e-launcher",Kt="e-ribbon-collection",Ut="e-ribbon-item",Vt="e-ribbon-row",Xt="e-ribbon-column",Yt="e-ribbon-large-item",Zt="e-ribbon-medium-item",Jt="e-ribbon-small-item",Qt="e-ribbon-content-height",$t="e-caret-hide",eo="e-ribbon-template",to="e-ribbon-help-template",oo="e-ribbon-tooltip",io="e-ribbon-tooltip-target",ro="e-ribbon-tooltip-title",no="e-ribbon-tooltip-content",so="e-ribbon-tooltip-icon",ao="e-ribbon-tooltip-container",lo="e-ribbon-text-container",po="e-ribbon-simplified-mode",co="e-ribbon-backstage-popup",uo="e-ribbon-backstage-open",ho="e-ribbon-backstage-content",bo="e-ribbon-backstage",mo="e-ribbon-backstage-menu",yo="e-ribbon-backstage-template",fo="e-ribbon-backstage-wrapper",go="e-ribbon-backstage-items-wrapper",vo="e-blankicon",So="_tab",Io="_collection",Co="_collapsebutton",wo="_sim_ovrl_overflow",_="_sim_grp_overflow",q="_header",To="_launcher",A="_content",j="_container",w="_overflow",ko="_dropdown",Oo="_filemenu",Bo="_backstage",Lo="_backstagepopup",Po="_filemenulist",Eo="_menulist",Do="_footermenulist",Ro="_helppanetemplate",G="_grpbtn",xo="_keytip",Mo="--fileMenuWidth",_o="--helpTemplateWidth",qo=(Ao.prototype.getModuleName=function(){return"ribbonButton"},Ao.prototype.destroy=function(){this.parent=null},Ao.prototype.createButton=function(e,t){var o=this,i=this.parent.createElement("button",{id:e.id}),r=(t.appendChild(i),e.buttonSettings);new u.Button({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===R.RibbonItemSize.Large?"Top":"Left",iconCss:r.iconCss,disabled:e.disabled,cssClass:(tt+v+pt+v+(r.cssClass||"")).trim(),content:e.activeSize===R.RibbonItemSize.Small?"":r.content,isPrimary:r.isPrimary,isToggle:r.isToggle,created:r.created},i),r.htmlAttributes&&(r.htmlAttributes.id&&delete r.htmlAttributes.id,ii(i,r.htmlAttributes)),i.onclick=function(e){r.clicked&&r.clicked.call(o,e)},r.content?i.setAttribute("aria-label",r.content):i.setAttribute("aria-label","button")},Ao.prototype.addOverFlowEvents=function(t,e,o){var i=this,e=e.querySelector("#"+t.id),r=(e.setAttribute("data-control",t.type.toString()),x.getComponent(e,u.Button));r.setProperties({cssClass:r.cssClass+v+ct}),e.onclick=function(e){t.buttonSettings.clicked&&t.buttonSettings.clicked.call(i,e),o.element.classList.contains("e-active")&&o.toggle()}},Ao.prototype.removeOverFlowEvents=function(t,e){var o=this,e=e.querySelector("#"+t.id),i=x.getComponent(e,u.Button),r=(r=i.cssClass.split(v)).filter(function(e){return e!==ct});i.setProperties({cssClass:r.join(v)}),e.onclick=function(e){t.buttonSettings.clicked&&t.buttonSettings.clicked.call(o,e)}},Ao.prototype.click=function(e){var e=I(this.parent,e);!e||(e=x.getComponent(e,u.Button)).disabled||e.click()},Ao.prototype.updateButton=function(e,t){var o,i=g(this.parent.tabs,t);i&&(x.merge(i.item.buttonSettings,e),t=I(this.parent,t,i))&&(o=x.getComponent(t,u.Button),e.isToggle&&t.classList.add("e-active"),e.cssClass&&(e.cssClass=(tt+v+pt+v+e.cssClass).trim()),e.content&&(e.content=i.item.activeSize===R.RibbonItemSize.Small?"":e.content,t.setAttribute("aria-label",e.content)),delete e.clicked,o.setProperties(e))},Ao.prototype.updateButtonSize=function(e,t){x.getComponent(e,u.Button).setProperties({iconPosition:t.activeSize===R.RibbonItemSize.Large?"Top":"Left",content:t.activeSize===R.RibbonItemSize.Small?"":t.buttonSettings.content})},Ao);function Ao(e){this.parent=e}Go.prototype.getModuleName=function(){return"ribbonCheckBox"},Go.prototype.destroy=function(){this.parent=null},Go.prototype.createCheckBox=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id}),r=(t.appendChild(i),e.checkBoxSettings);r.htmlAttributes&&r.htmlAttributes.id&&delete r.htmlAttributes.id,new u.CheckBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,checked:r.checked,cssClass:(pt+v+(r.cssClass||"")).trim(),label:r.label,labelPosition:r.labelPosition,disabled:e.disabled,created:r.created,htmlAttributes:r.htmlAttributes,change:function(e){r.change&&r.change.call(o,e)}},i)},Go.prototype.addOverFlowEvents=function(t,e,o){var i=this,e=e.querySelector("#"+t.id),e=(e.setAttribute("data-control",t.type.toString()),x.getComponent(e,u.CheckBox));e.cssClass=e.cssClass+v+ct,e.dataBind(),e.change=function(e){t.checkBoxSettings.change&&t.checkBoxSettings.change.call(i,e),o.element.classList.contains("e-active")&&o.toggle()}},Go.prototype.removeOverFlowEvents=function(t,e){var o=this,e=e.querySelector("#"+t.id),e=x.getComponent(e,u.CheckBox),i=(i=e.cssClass.split(v)).filter(function(e){return e!==ct});e.cssClass=i.join(v),e.dataBind(),e.change=function(e){t.checkBoxSettings.change&&t.checkBoxSettings.change.call(o,e)}},Go.prototype.click=function(e){var e=I(this.parent,e);!e||(e=x.getComponent(e,u.CheckBox)).disabled||e.click()},Go.prototype.updateCheckBox=function(e,t){var o=g(this.parent.tabs,t);o&&(x.merge(o.item.checkBoxSettings,e),t=I(this.parent,t,o))&&(e.cssClass&&(e.cssClass=(pt+v+e.cssClass).trim()),delete e.change,x.getComponent(t,u.CheckBox).setProperties(e))};var jo=Go;function Go(e){this.parent=e}zo.prototype.getModuleName=function(){return"ribbonColorPicker"},zo.prototype.destroy=function(){this.parent=null},zo.prototype.createColorPicker=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id}),r=(t.appendChild(i),e.colorPickerSettings),n=new E.ColorPicker({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,columns:r.columns,cssClass:(pt+v+(r.cssClass||"")).trim(),disabled:e.disabled,enableOpacity:r.enableOpacity,mode:r.mode,modeSwitcher:r.modeSwitcher,noColor:r.noColor,presetColors:r.presetColors,showButtons:r.showButtons,value:r.value,beforeClose:function(){n.element.parentElement.classList.remove(dt),r.beforeClose&&r.beforeClose.call(o)},beforeOpen:r.beforeOpen,beforeTileRender:r.beforeTileRender,created:r.created,change:function(e){r.value=e.value.toString(),r.change&&r.change.call(o,e)},open:function(){n.element.parentElement.classList.add(dt),r.open&&r.open.call(o)},select:r.select},i),t=(r.htmlAttributes&&(r.htmlAttributes.id&&delete r.htmlAttributes.id,ii(i,r.htmlAttributes)),n.element.parentElement);x.EventHandler.add(t,"mouseenter",this.toggleWrapperHover.bind(this,t,!0),this),x.EventHandler.add(t,"mouseleave",this.toggleWrapperHover.bind(this,t,!1),this)},zo.prototype.toggleWrapperHover=function(e,t){t?e.classList.add(lt):e.classList.remove(lt)},zo.prototype.addOverFlowEvents=function(t,e,o){var i,r=this,n=t.colorPickerSettings,n=(n.label&&"Simplified"===this.parent.activeLayout&&(n=this.parent.createElement("div",{className:"e-ribbon-colorpicker-label",id:t.id+"_label",innerHTML:n.label}),e.insertBefore(n,e.firstChild)),e.querySelector("#"+t.id)),s=(n.setAttribute("data-control",t.type.toString()),x.getComponent(n,E.ColorPicker)),e=(s.setProperties({cssClass:s.cssClass+v+ct}),s.splitBtn);s.beforeClose=function(e){i=e.event?e.event.target:null,s.element.parentElement.classList.remove(dt),t.colorPickerSettings.beforeClose&&t.colorPickerSettings.beforeClose.call(r)},e.close=function(){i&&!i.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},zo.prototype.removeOverFlowEvents=function(e,t){var o=this,i=(e.colorPickerSettings.label&&(i=t.querySelector("#"+e.id+"_label"))&&i.remove(),t.querySelector("#"+e.id)),r=x.getComponent(i,E.ColorPicker),t=(t=r.cssClass.split(v)).filter(function(e){return e!==ct});r.setProperties({cssClass:t.join(v)}),r.splitBtn.close=null,r.beforeClose=function(){r.element.parentElement.classList.remove(dt),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(o)}},zo.prototype.getColorPickerObj=function(e){e=I(this.parent,e);return e?x.getComponent(e,E.ColorPicker):null},zo.prototype.getValue=function(e,t,o){e=this.getColorPickerObj(e);return e?e.getValue(t,o):""},zo.prototype.toggle=function(e){e=this.getColorPickerObj(e);e&&!e.disabled&&e.toggle()},zo.prototype.updateColorPicker=function(e,t){var o=g(this.parent.tabs,t);o&&(x.merge(o.item.checkBoxSettings,e),t=I(this.parent,t,o))&&(e.cssClass&&(e.cssClass=(pt+v+e.cssClass).trim()),delete e.beforeClose,delete e.open,x.getComponent(t,E.ColorPicker).setProperties(e))},zo.prototype.unwireColorPickerEvents=function(e){e=x.getComponent(e,E.ColorPicker).element.parentElement;x.EventHandler.remove(e,"mouseenter",this.toggleWrapperHover),x.EventHandler.remove(e,"mouseleave",this.toggleWrapperHover)};$e=zo;function zo(e){this.parent=e}Ho.prototype.getModuleName=function(){return"ribbonComboBox"},Ho.prototype.destroy=function(){this.parent=null},Ho.prototype.createComboBox=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id}),r=(t.appendChild(i),e.comboBoxSettings);r.htmlAttributes&&r.htmlAttributes.id&&delete r.htmlAttributes.id,new P.ComboBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,allowCustom:!1,floatLabelType:"Never",ignoreAccent:!0,ignoreCase:!0,allowFiltering:r.allowFiltering,autofill:r.autofill,cssClass:(pt+v+(r.cssClass||"")).trim(),dataSource:r.dataSource,enabled:!e.disabled,fields:r.fields,filterType:r.filterType,footerTemplate:r.footerTemplate,groupTemplate:r.groupTemplate,headerTemplate:r.headerTemplate,index:r.index,itemTemplate:r.itemTemplate,noRecordsTemplate:r.noRecordsTemplate,placeholder:r.placeholder,popupHeight:r.popupHeight,popupWidth:r.popupWidth,showClearButton:r.showClearButton,sortOrder:r.sortOrder,text:r.text,value:r.value,width:r.width,beforeOpen:r.beforeOpen,open:r.open,htmlAttributes:r.htmlAttributes,close:function(e){r.close&&r.close.call(o,e)},filtering:r.filtering,change:r.change,select:r.select,created:r.created},i)},Ho.prototype.addOverFlowEvents=function(o,e,i){var r=this,t=o.comboBoxSettings,t=(t.label&&"Simplified"===this.parent.activeLayout&&(t=this.parent.createElement("div",{className:"e-ribbon-combobox-label",id:o.id+"_label",innerHTML:t.label}),e.insertBefore(t,e.firstChild)),e.querySelector("#"+o.id)),e=(t.setAttribute("data-control",o.type.toString()),x.getComponent(t,P.ComboBox));e.setProperties({cssClass:e.cssClass+v+ct}),e.close=function(e){var t=e.event?e.event.target:null;o.comboBoxSettings.close&&o.comboBoxSettings.close.call(r,e),t&&!t.closest(".e-ribbon-group-overflow-ddb")&&i.element.classList.contains("e-active")&&i.toggle()}},Ho.prototype.removeOverFlowEvents=function(t,e){var o=this,i=(t.comboBoxSettings.label&&(i=e.querySelector("#"+t.id+"_label"))&&i.remove(),e.querySelector("#"+t.id)),e=x.getComponent(i,P.ComboBox),i=(i=e.cssClass.split(v)).filter(function(e){return e!==ct});e.setProperties({cssClass:i.join(v)}),e.close=function(e){t.comboBoxSettings.close&&t.comboBoxSettings.close.call(o,e)}},Ho.prototype.getComboBoxObj=function(e){e=I(this.parent,e);return e?x.getComponent(e,P.ComboBox):null},Ho.prototype.filter=function(e,t,o,i){this.getComboBoxObj(e).filter(t,o,i)},Ho.prototype.hidePopup=function(e){e=this.getComboBoxObj(e);e&&e.hidePopup()},Ho.prototype.showPopup=function(e){e=this.getComboBoxObj(e);e&&e.showPopup()},Ho.prototype.updateComboBox=function(e,t){var o=g(this.parent.tabs,t);o&&(x.merge(o.item.comboBoxSettings,e),t=I(this.parent,t,o))&&(e.cssClass&&(e.cssClass=(pt+v+e.cssClass).trim()),delete e.close,x.getComponent(t,P.ComboBox).setProperties(e))};var No=Ho;function Ho(e){this.parent=e}f.prototype.getModuleName=function(){return"ribbonDropDown"},f.prototype.destroy=function(){this.parent=null},f.prototype.createDropDown=function(e,t){var o=this,i=this.parent.createElement("button",{id:e.id}),r=(t.appendChild(i),e.dropDownSettings),t=(tt+v+pt+v+(r.cssClass||"")).trim();new M.DropDownButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===R.RibbonItemSize.Large?"Top":"Left",closeActionEvents:r.closeActionEvents,content:e.activeSize===R.RibbonItemSize.Small?"":r.content,cssClass:t+(e.activeSize===R.RibbonItemSize.Large?v+nt:""),disabled:e.disabled,iconCss:r.iconCss,items:r.items,target:r.target,createPopupOnClick:r.createPopupOnClick,beforeClose:function(e){r.beforeClose&&r.beforeClose.call(o,e)},beforeItemRender:r.beforeItemRender,beforeOpen:r.beforeOpen,close:function(e){r.close&&r.close.call(o,e)},created:r.created,open:r.open,select:r.select}).appendTo(i),r.htmlAttributes&&(r.htmlAttributes.id&&delete r.htmlAttributes.id,ii(i,r.htmlAttributes))},f.prototype.addOverFlowEvents=function(t,e,o){var i,r=this,e=e.querySelector("#"+t.id),e=(e.setAttribute("data-control",t.type.toString()),x.getComponent(e,M.DropDownButton));e.cssClass=e.cssClass+v+ct,e.dataBind(),e.beforeClose=function(e){t.dropDownSettings.beforeClose&&t.dropDownSettings.beforeClose.call(r,e),i=e.event?e.event.target:null},e.close=function(e){t.dropDownSettings.close&&t.dropDownSettings.close.call(r,e),i&&!i.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},f.prototype.removeOverFlowEvents=function(t,e){var o=this,e=e.querySelector("#"+t.id),e=x.getComponent(e,M.DropDownButton),i=(i=e.cssClass.split(v)).filter(function(e){return e!==ct});e.cssClass=i.join(v),e.dataBind(),e.close=function(e){t.dropDownSettings.close&&t.dropDownSettings.close.call(o,e)},e.beforeClose=function(e){t.dropDownSettings.beforeClose&&t.dropDownSettings.beforeClose.call(o,e)}},f.prototype.createOverFlowDropDown=function(e,t,o,i,r,n){var s=this,n=(this.enableRtl=n,this.parent.createElement("button",{id:e+w+ko})),e=(i.setAttribute("tabindex","0"),r.appendChild(n),new M.DropDownButton({iconCss:o,target:i,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,cssClass:nt+v+Nt,iconPosition:"Top",content:t,beforeClose:function(e){e.cancel=!x.isNullOrUndefined(e.event&&x.closest(e.event.target,"."+ct))}},n));return ei(i,this.parent),n.onclick=n.onkeydown=function(){s.itemIndex=0},i.onkeydown=function(e){s.keyActionHandler(e,i)},e},f.prototype.keyActionHandler=function(e,t){var o,i=Array.prototype.slice.call(t.querySelectorAll(".e-control")),r=Array.prototype.slice.call(t.querySelectorAll(".e-ribbon-template")),n=i.concat(r),s=t.querySelectorAll(".e-combobox");if(s)for(var a=0;a<s.length;a++)s[parseInt(a.toString(),10)].closest(".e-input-focus")&&(o=s[parseInt(a.toString(),10)]);if(o)for(a=0;a<n.length;a++)n[parseInt(a.toString(),10)].classList.contains("e-combobox")&&n[parseInt(a.toString(),10)].closest(".e-input-focus")&&(this.itemIndex=a);(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-launcher-icon")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-first-item"))&&("ArrowRight"!==e.key&&(e.shiftKey||"Tab"!==e.key)||this.handleNavigation(e,!this.enableRtl,n),"ArrowLeft"===e.key||e.shiftKey&&"Tab"===e.key)&&this.handleNavigation(e,this.enableRtl,n)},f.prototype.handleNavigation=function(e,t,o){o[0].classList.contains("e-ribbon-first-item")||o[0].classList.add("e-ribbon-first-item"),o[o.length-1].classList.contains("e-ribbon-last-item")||o[o.length-1].classList.add("e-ribbon-last-item"),t?(0===this.itemIndex&&o[parseInt(this.itemIndex.toString(),10)].classList.contains("e-ribbon-first-item")&&this.updateItemIndex(e,o,!0),e.target.classList.contains("e-combobox")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-group-container")||!e.target.classList.contains("e-ribbon-first-item")&&0===this.itemIndex||!e.target.classList.contains("e-control")&&!e.target.classList.contains("e-ribbon-template")||(this.itemIndex++,this.updateItemIndex(e,o,!0)),e.target.classList.contains("e-ribbon-last-item")&&!this.focusLauncherIcon(e,o)&&(this.itemIndex=0,this.updateItemIndex(e,o,!0)),e.target.classList.contains("e-ribbon-launcher-icon")&&(this.itemIndex=0,this.updateItemIndex(e,o,!0))):(e.target.classList.contains("e-combobox")||0===this.itemIndex||(this.itemIndex--,this.updateItemIndex(e,o,!1)),e.target.classList.contains("e-ribbon-first-item")&&!this.focusLauncherIcon(e,o)&&(this.itemIndex=o.length-1,this.updateItemIndex(e,o,!1)),e.target.classList.contains("e-ribbon-launcher-icon")&&(this.itemIndex=o.length-1,this.updateItemIndex(e,o,!1))),e.target.classList.contains("e-combobox")&&"Tab"===e.key&&(t?this.itemIndex<o.length-1&&this.itemIndex++:0<this.itemIndex&&this.itemIndex--)},f.prototype.focusLauncherIcon=function(e,t){var o,t=t[parseInt(this.itemIndex.toString(),10)].closest(".e-ribbon-group-container");return!!(o=t?t.querySelector(".e-ribbon-launcher-icon"):o)&&("Tab"===e.key&&e.preventDefault(),t.querySelector(".e-ribbon-launcher-icon").focus(),!0)},f.prototype.updateItemIndex=function(e,t,o){for(var i=t[this.itemIndex].closest(".e-ribbon-item");i&&i.classList.contains("e-disabled");){if(o)if(this.itemIndex<t.length-1)this.itemIndex++;else{if(this.focusLauncherIcon(e,t))break;this.itemIndex=0}else if(0<this.itemIndex)this.itemIndex--;else{if(this.focusLauncherIcon(e,t))break;this.itemIndex=t.length-1}i=t[this.itemIndex].closest(".e-ribbon-item")}"Tab"===e.key&&e.preventDefault(),t[parseInt(this.itemIndex.toString(),10)].focus()},f.prototype.removeOverFlowDropDown=function(e){var t=x.getComponent(e,M.DropDownButton);x.getComponent(t.target,D.Tooltip).destroy(),e.parentElement.parentElement.insertBefore(t.target,e.parentElement),t.destroy(),x.remove(e)},f.prototype.getDDBItemElement=function(e,t){return x.getComponent(e,M.DropDownButton).dropDown.element.querySelector("#"+t)},f.prototype.getOverflowDropDownPopup=function(e,t){t=t.querySelector("#"+this.parent.tabs[e.tabIndex].groups[e.groupIndex].id+w+ko);return x.getComponent(t,M.DropDownButton).dropDown.element},f.prototype.getDropDownObj=function(e){e=I(this.parent,e);return e?x.getComponent(e,M.DropDownButton):null},f.prototype.addItems=function(e,t,o){this.getDropDownObj(e).addItems(t,o)},f.prototype.removeItems=function(e,t,o){this.getDropDownObj(e).removeItems(t,o)},f.prototype.toggle=function(e){e=this.getDropDownObj(e);e&&!e.disabled&&e.toggle()},f.prototype.updateDropDown=function(e,t){var o=g(this.parent.tabs,t);o&&(x.merge(o.item.dropDownSettings,e),t=I(this.parent,t,o))&&(t=x.getComponent(t,M.DropDownButton),e.cssClass&&(e.cssClass=(pt+v+tt+v+e.cssClass).trim(),e.cssClass=o.item.activeSize===R.RibbonItemSize.Large?(nt+v+e.cssClass).trim():e.cssClass,t.cssClass=e.cssClass),delete e.close,delete e.beforeClose,e.content&&(e.content=o.item.activeSize===R.RibbonItemSize.Small?"":e.content),t.setProperties(e))},f.prototype.updateDropDownSize=function(e,t){var e=x.getComponent(e,M.DropDownButton),o=e.cssClass.split(v);t.activeSize===R.RibbonItemSize.Large?o.push(nt):o=o.filter(function(e){return e!==nt}),e.cssClass=o.join(v),e.setProperties({iconPosition:t.activeSize===R.RibbonItemSize.Large?"Top":"Left"}),e.setProperties({content:t.activeSize===R.RibbonItemSize.Small?"":t.dropDownSettings.content})};var Wo=f;function f(e){this.parent=e}Ko.prototype.getModuleName=function(){return"ribbonSplitButton"},Ko.prototype.destroy=function(){this.parent=null},Ko.prototype.createSplitButton=function(e,t){var o=this,i=this.parent.createElement("button",{id:e.id}),r=(t.appendChild(i),e.splitButtonSettings),t=(tt+v+pt+v+(r.cssClass||"")).trim(),n=new M.SplitButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===R.RibbonItemSize.Large?"Top":"Left",closeActionEvents:r.closeActionEvents,cssClass:t+(e.activeSize===R.RibbonItemSize.Large?v+nt:""),disabled:e.disabled,iconCss:r.iconCss,items:r.items,target:r.target,beforeClose:function(e){r.beforeClose&&r.beforeClose.call(o,e)},beforeItemRender:r.beforeItemRender,beforeOpen:r.beforeOpen,close:function(){n.wrapper.classList.remove(dt),r.close&&r.close.call(o)},created:r.created,open:function(){n.wrapper.classList.add(dt),r.open&&r.open.call(o)},select:r.select,click:function(e){r.click&&r.click.call(o,e)}},i),s=(r.htmlAttributes&&(r.htmlAttributes.id&&delete r.htmlAttributes.id,ii(i,r.htmlAttributes)),i.parentElement.querySelector(".e-dropdown-btn")),a=(s.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),s.click())},this.setContent(e,n),n.wrapper);x.EventHandler.add(a,"mouseenter",function(){a.classList.add(lt)},this),x.EventHandler.add(a,"mouseleave",function(){a.classList.remove(lt)},this)},Ko.prototype.addOverFlowEvents=function(t,e,o){var i,r=this,e=e.querySelector("#"+t.id),n=(e.setAttribute("data-control",t.type.toString()),x.getComponent(e,M.SplitButton)),s=(n.cssClass=n.cssClass+v+ct,n.dataBind(),e.parentElement.querySelector(".e-dropdown-btn")),e=s.getAttribute("id"),a=document.querySelector("#"+e+"-popup");s.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),s.click())},a.onkeydown=function(e){"Enter"===e.key&&(e.preventDefault(),n.wrapper.classList.remove("e-ribbon-open"),a.querySelector(".e-focused").click())},n.beforeClose=function(e){t.splitButtonSettings.beforeClose&&t.splitButtonSettings.beforeClose.call(r,e),i=e.event?e.event.target:null},n.click=function(e){t.splitButtonSettings.click&&t.splitButtonSettings.click.call(r,e),o.element.classList.contains("e-active")&&o.toggle()},n.close=function(e){t.splitButtonSettings.close&&t.splitButtonSettings.close.call(r,e),n.wrapper.classList.remove(dt),i&&!i.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},Ko.prototype.removeOverFlowEvents=function(t,e){var o=this,e=e.querySelector("#"+t.id),i=x.getComponent(e,M.SplitButton),e=(e=i.cssClass.split(v)).filter(function(e){return e!==ct});i.cssClass=e.join(v),i.dataBind(),i.beforeClose=function(e){t.splitButtonSettings.beforeClose&&t.splitButtonSettings.beforeClose.call(o,e)},i.click=function(e){t.splitButtonSettings.click&&t.splitButtonSettings.click.call(o,e)},i.close=function(e){t.splitButtonSettings.close&&t.splitButtonSettings.close.call(o,e),i.wrapper.classList.remove(dt)}},Ko.prototype.setContent=function(e,t){t.primaryBtnObj.setProperties({content:e.activeSize===R.RibbonItemSize.Medium?e.splitButtonSettings.content:""}),t.secondaryBtnObj.setProperties({content:e.activeSize===R.RibbonItemSize.Large?e.splitButtonSettings.content:""})},Ko.prototype.getSplitButtonObj=function(e){e=I(this.parent,e);return x.getComponent(e,M.SplitButton)},Ko.prototype.addItems=function(e,t,o){this.getSplitButtonObj(e).addItems(t,o)},Ko.prototype.removeItems=function(e,t,o){this.getSplitButtonObj(e).removeItems(t,o)},Ko.prototype.toggle=function(e){e=this.getSplitButtonObj(e);e&&!e.disabled&&e.toggle()},Ko.prototype.updateSplitButton=function(e,t){var o=g(this.parent.tabs,t);o&&(x.merge(o.item.splitButtonSettings,e),t=I(this.parent,t,o))&&(t=x.getComponent(t,M.SplitButton),e.cssClass&&(e.cssClass=(pt+v+tt+v+e.cssClass).trim(),e.cssClass=o.item.activeSize===R.RibbonItemSize.Large?(nt+v+e.cssClass).trim():e.cssClass,t.cssClass=e.cssClass),delete e.open,delete e.click,delete e.close,delete e.beforeClose,t.setProperties(e),e.content)&&this.setContent(o.item,t)},Ko.prototype.updateSplitButtonSize=function(e,t){var e=x.getComponent(e,M.SplitButton),o=e.cssClass.split(v);t.activeSize===R.RibbonItemSize.Large?o.push(nt):o=o.filter(function(e){return e!==nt}),e.cssClass=o.join(v),e.setProperties({iconPosition:t.activeSize===R.RibbonItemSize.Large?"Top":"Left"}),this.setContent(t,e)};var Fo=Ko;function Ko(e){this.parent=e}function S(e,t){for(var o=0;o<e.length;o++)if(t(e[parseInt(o.toString(),10)],o))return o;return-1}function Uo(t){if("string"!=typeof t)return x.compile(t);var o="";try{var e=x.select(t),o=e?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){o=t}return x.compile(o)}function g(e,t,o){for(var i=0;i<e.length;i++)for(var r=e[parseInt(i.toString(),10)],n=0;n<r.groups.length;n++)for(var s=r.groups[parseInt(n.toString(),10)],a=0;a<s.collections.length;a++)for(var l=s.collections[parseInt(a.toString(),10)],p=0;p<l.items.length;p++){var c=l.items[parseInt(p.toString(),10)];if(t&&c.id===t||o&&c.type===o)return{item:c,collection:l,group:s,tabIndex:i,groupIndex:n,collectionIndex:a,itemIndex:p}}return null}function Vo(e,t){for(var o=0;o<e.length;o++)for(var i=e[parseInt(o.toString(),10)],r=0;r<i.groups.length;r++)for(var n=i.groups[parseInt(r.toString(),10)],s=0;s<n.collections.length;s++){var a=n.collections[parseInt(s.toString(),10)];if(a.id===t)return{collection:a,group:n,tabIndex:o,groupIndex:r,collectionIndex:s}}return null}function Xo(e,t){for(var o=0;o<e.length;o++)for(var i=e[parseInt(o.toString(),10)],r=0;r<i.groups.length;r++){var n=i.groups[parseInt(r.toString(),10)];if(n.id===t)return{group:n,tabIndex:o,groupIndex:r}}return null}function Yo(e,t){x.getComponent(e,t).destroy()}function Zo(e,t,o){x.getComponent(e,t).setProperties(o)}function Jo(e,t,o){x.getComponent(e,t).setProperties("combobox"===t?{enabled:!o}:{disabled:o})}function I(e,t,o){var i;return!(o=o||g(e.tabs,t))||""===(i=e.tabObj.items[o.tabIndex].content).innerHTML?null:e.activeLayout===R.RibbonLayout.Classic?o.item.displayOptions&R.DisplayMode.Classic?(i=o.group.isCollapsed?e.ribbonDropDownModule.getOverflowDropDownPopup(o,i):i).querySelector("#"+t):null:(o.item.displayOptions&R.DisplayMode.Simplified?i.querySelector("#"+o.item.id):null)||(o.group.enableGroupOverflow?x.getComponent(i.querySelector("#"+o.group.id+_),M.DropDownButton):e.overflowDDB).target.querySelector("#"+o.item.id)}function Qo(e){return!!(e.content||e.iconCss||e.title||e.id||e.cssClass)}function $o(e,t,o){var i,r=e.target.getAttribute("id"),e=o.filter(function(e){return e.id===r})[0].data,o=t.createElement("div",{id:e.id?ao+"_"+e.id:ao}),n=(t.element.append(o),e.title&&(n=t.createElement("div",{innerHTML:e.title,className:ro}),o.appendChild(n)),t.createElement("div",{className:lo}));o.appendChild(n),e.iconCss&&(i=t.createElement("div",{className:e.iconCss+" "+so}),n.appendChild(i)),e.content&&(i=t.createElement("div",{innerHTML:e.content,className:no}),n.appendChild(i)),t.setProperties({content:o,cssClass:e.cssClass?e.cssClass+" "+oo:oo})}function ei(e,t){var o=new D.Tooltip({target:"."+io,beforeRender:function(e){$o(e,o,t.tooltipData)}.bind(this),windowCollision:!0});o.appendTo(e)}function ti(e){x.getComponent(e,D.Tooltip).destroy()}function oi(e,t){x.getComponent(e,D.Tooltip).setProperties(t)}function ii(e,t){for(var o in t){var i;"class"===o?(i=t.class.replace(/\s+/g," ").trim())&&x.addClass([e],i.split(" ")):"style"===o?(i=""+(e.getAttribute("style")||"")+t[""+o],e.setAttribute(""+o,i)):e.setAttribute(o,t[""+o])}}ni.prototype.getModuleName=function(){return"ribbonGroupButton"},ni.prototype.destroy=function(){this.parent=null},ni.prototype.createGroupButton=function(t,e){var o=this,i=t.groupButtonSettings,r=(this.count=0,this.parent.createElement("div",{id:t.id+G,className:"e-btn-group"}));e.appendChild(r);for(var n,s=0;s<i.items.length;s++)i.items[parseInt(s.toString(),10)].iconCss&&(n=this.parent.createElement("button",{id:t.id+G+s,className:Dt}),r.appendChild(n),new u.Button({iconCss:i.items[parseInt(s.toString(),10)].iconCss,disabled:t.disabled,enableRtl:this.parent.enableRtl,content:t.activeSize===R.RibbonItemSize.Small?"":i.items[parseInt(s.toString(),10)].content,iconPosition:t.activeSize===R.RibbonItemSize.Large?"Top":"Left"},n),i.items[parseInt(s.toString(),10)].htmlAttributes&&ii(n,i.items[parseInt(s.toString(),10)].htmlAttributes),i.items[parseInt(s.toString(),10)].content?(n.classList.add(xt),n.setAttribute("aria-label",i.items[parseInt(s.toString(),10)].content)):n.setAttribute("aria-label","groupbuttonitem"),c=e.querySelector("#"+t.id+G+s),i.selection===R.RibbonGroupButtonSelection.Single?r.classList.add(Pt):r.classList.add(Et),i.items[parseInt(s.toString(),10)].selected&&(i.selection===R.RibbonGroupButtonSelection.Multiple?c.classList.add("e-active"):this.count<1&&(c.classList.add("e-active"),this.count++),this.grpBtnIndex=s),i.items[parseInt(s.toString(),10)].ribbonTooltipSettings&&Qo(i.items[parseInt(s.toString(),10)].ribbonTooltipSettings)&&(n.classList.add(io),this.parent.tooltipData.push({id:n.id,data:i.items[parseInt(s.toString(),10)].ribbonTooltipSettings})),x.EventHandler.add(c,"click",this.groupButtonClicked.bind(this,s,t,i),this));if("Simplified"===this.parent.activeLayout){var a=void 0,l=0,p=0,c=this.parent.createElement("button",{id:t.id});e.appendChild(c);for(s=0;s<i.items.length;s++)t.groupButtonSettings.items[parseInt(s.toString(),10)].selected&&!this.isSelected&&i.selection===R.RibbonGroupButtonSelection.Single?(a=t.groupButtonSettings.items[parseInt(s.toString(),10)].iconCss,this.isSelected=!0):t.groupButtonSettings.items[parseInt(s.toString(),10)].selected&&i.selection===R.RibbonGroupButtonSelection.Multiple&&(a=1===++l?t.groupButtonSettings.items[parseInt(s.toString(),10)].iconCss:null);for(;p<t.groupButtonSettings.items.length&&!this.isSelected&&!a;)t.groupButtonSettings.items[parseInt(p.toString(),10)].iconCss&&(a=t.groupButtonSettings.items[parseInt(p.toString(),10)].iconCss,this.isSelected=!0),p++;var d=new M.DropDownButton({iconCss:a,target:r,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:t.disabled},c);i.header&&(d=d.dropDown,this.addGroupButtonHeader(t.id,i,d.element)),c.onclick=c.onkeydown=function(){o.handleFocusState(t,e)},r.onkeydown=function(e){"Simplified"===o.parent.activeLayout&&o.handleGroupButtonNavigation(e,t)},ei(r,this.parent),this.isSelected=!1}},ni.prototype.groupButtonClicked=function(e,t,o){for(var i=[],r=[],n=[],s=document.querySelector("#"+t.id),a=0;a<o.items.length;a++)document.querySelector("#"+t.id+G+a)&&document.querySelector("#"+t.id+G+a).classList.contains("e-active")&&i.push(o.items[parseInt(a.toString(),10)]);document.querySelector("#"+t.id+G+e).classList.contains("e-active")||r.push(o.items[parseInt(e.toString(),10)]);r={cancel:!1,previousItems:i,selectingItems:r};if(o.items[parseInt(e.toString(),10)].beforeClick&&o.items[parseInt(e.toString(),10)].beforeClick.call(this,r),!r.cancel){if(o.selection===R.RibbonGroupButtonSelection.Single){document.querySelector("#"+t.id+G).classList.contains(Et)&&(document.querySelector("#"+t.id+G).classList.remove(Et),document.querySelector("#"+t.id+G).classList.add(Pt));for(a=0;a<o.items.length;a++)document.querySelector("#"+t.id+G+a)&&document.querySelector("#"+t.id+G+a).classList.contains("e-active")&&(document.querySelector("#"+t.id+G+a).classList.remove("e-active"),o.items[parseInt(a.toString(),10)].setProperties({selected:!1},!0));document.querySelector("#"+t.id+G+e).classList.toggle("e-active"),o.items[parseInt(e.toString(),10)].setProperties({selected:!0},!0),document.querySelector("#"+t.id+G+e).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&(this.grpBtnIndex=e,(u=x.getComponent(s,M.DropDownButton)).setProperties({iconCss:o.items[parseInt(e.toString(),10)].iconCss}))}else{document.querySelector("#"+t.id+G).classList.contains(Pt)&&(document.querySelector("#"+t.id+G).classList.remove(Pt),document.querySelector("#"+t.id+G).classList.add(Et)),document.querySelector("#"+t.id+G+e).classList.toggle("e-active"),document.querySelector("#"+t.id+G+e).classList.contains("e-active")?o.items[parseInt(e.toString(),10)].setProperties({selected:!0},!0):o.items[parseInt(e.toString(),10)].setProperties({selected:!1},!0);for(var l=0,p=0;p<o.items.length;p++)document.querySelector("#"+t.id+G+p)&&document.querySelector("#"+t.id+G+p).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&p!==e&&(this.isSelected=!0,l++);if("Simplified"===this.parent.activeLayout){var c=null,d=0,u=x.getComponent(s,M.DropDownButton);if(this.isSelected){if(1===l&&!document.querySelector("#"+t.id+G+e).classList.contains("e-active"))for(p=0;p<o.items.length;p++)document.querySelector("#"+t.id+G+p)&&document.querySelector("#"+t.id+G+p).classList.contains("e-active")&&(c=o.items[parseInt(p.toString(),10)].iconCss)}else document.querySelector("#"+t.id+G+e).classList.contains("e-active")&&(c=o.items[parseInt(e.toString(),10)].iconCss);for(;d<o.items.length&&!c;)o.items[parseInt(d.toString(),10)].iconCss&&(c=o.items[parseInt(d.toString(),10)].iconCss),d++;u.setProperties({iconCss:c}),this.grpBtnIndex=e}this.isSelected=!1}document.querySelector("#"+t.id+G+e).classList.contains("e-active")&&n.push(o.items[parseInt(e.toString(),10)]);r={previousItems:i,selectedItems:n};o.items[parseInt(e.toString(),10)].click&&o.items[parseInt(e.toString(),10)].click.call(this,r),"Simplified"===this.parent.activeLayout&&s&&(u=x.getComponent(s,M.DropDownButton)).toggle()}},ni.prototype.switchGroupButton=function(t,e){var o=this,i=t.groupButtonSettings,r=null,n=0,s=0;if("Simplified"===this.parent.activeLayout){var a=e.querySelector("#"+t.id+G),l=this.parent.createElement("button",{id:t.id});e.appendChild(l);for(var p=0;p<i.items.length;p++)document.querySelector("#"+t.id+G+p)&&(document.querySelector("#"+t.id+G+p).classList.contains("e-active")&&i.selection===R.RibbonGroupButtonSelection.Single?r=i.items[parseInt(p.toString(),10)].iconCss:document.querySelector("#"+t.id+G+p).classList.contains("e-active")&&i.selection===R.RibbonGroupButtonSelection.Multiple&&(1===++n?r=i.items[parseInt(p.toString(),10)].iconCss:1<n&&(r=null)));for(;s<i.items.length&&!r;)i.items[parseInt(s.toString(),10)].iconCss&&(r=i.items[parseInt(s.toString(),10)].iconCss),s++;var c=new M.DropDownButton({iconCss:r,target:a,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:t.disabled},l);i.header&&(d=c.dropDown,this.addGroupButtonHeader(t.id,i,d.element)),l.onclick=l.onkeydown=function(){o.handleFocusState(t,e)},a.onkeydown=function(e){"Simplified"===o.parent.activeLayout&&o.handleGroupButtonNavigation(e,t)},ei(a,this.parent)}else{var d=e.querySelector("#"+t.id),c=x.getComponent(d,M.DropDownButton);e.appendChild(c.target),d&&(c.destroy(),x.remove(d))}},ni.prototype.handleFocusState=function(e,t){t.querySelector("#"+e.id).classList.contains("e-active")&&(document.querySelector("#"+e.id+"_grpbtn").querySelector("."+Dt+".e-active")||document.querySelector("#"+e.id+G+0)).focus()},ni.prototype.addGroupButtonHeader=function(e,t,o){e=this.parent.createElement("div",{className:"e-ribbon-groupbutton-header",id:e+q,innerHTML:t.header});o.insertBefore(e,o.firstChild)},ni.prototype.handleGroupButtonNavigation=function(e,t){var o=document.querySelector("#"+t.id),o=x.getComponent(o,M.DropDownButton).target,i=!1,o=("Simplified"===this.parent.activeLayout&&o.closest(".e-ribbon-dropdown-group-button").classList.contains(Rt)&&(i=!0),"Tab"===e.key&&e.preventDefault(),t.groupButtonSettings);"ArrowRight"===e.key&&!i||"ArrowDown"===e.key&&i?(!this.parent.enableRtl||"ArrowDown"===e.key&&i?(this.grpBtnIndex++,this.grpBtnIndex<o.items.length||(this.grpBtnIndex=0)):0===this.grpBtnIndex?this.grpBtnIndex=o.items.length-1:this.grpBtnIndex--,document.querySelector("#"+t.id+G+this.grpBtnIndex).focus()):("ArrowLeft"===e.key&&!i||"ArrowUp"===e.key&&i)&&(!this.parent.enableRtl||"ArrowUp"===e.key&&i?0===this.grpBtnIndex?this.grpBtnIndex=o.items.length-1:this.grpBtnIndex--:(this.grpBtnIndex++,this.grpBtnIndex<o.items.length||(this.grpBtnIndex=0)),document.querySelector("#"+t.id+G+this.grpBtnIndex).focus())},ni.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=e.groupButtonSettings,n=!0,s=t.querySelector("#"+e.id);if(s){var s=x.getComponent(s,M.DropDownButton),a=(s.setProperties({cssClass:s.cssClass+v+Rt,content:r.header||""}),s.target);if(a.children.length){for(var l=0;l<a.children.length;l++)if(r.items[parseInt(l.toString(),10)].content){n=!1;break}n&&a.classList.add("e-icon-btn")}a.onclick=function(){"Simplified"===i.parent.activeLayout&&a.closest(".e-ribbon-dropdown-group-button").classList.contains(Rt)&&o.element.classList.contains("e-active")&&o.toggle()}}s=t.querySelector("#"+e.id+"_grpbtn");"Classic"===this.parent.activeLayout&&s&&(s.onclick=function(){o.element.classList.contains("e-active")&&o.toggle()})},ni.prototype.removeOverFlowEvents=function(e,t){var t=t.querySelector("#"+e.id);t&&((t=(e=x.getComponent(t,M.DropDownButton)).target).classList.contains("e-icon-btn")&&t.classList.remove("e-icon-btn"),t=(t=e.cssClass.split(v)).filter(function(e){return e!==Rt}),e.setProperties({cssClass:t.join(v),content:""}))},ni.prototype.destroyDropDown=function(e){var t,e=document.querySelector("#"+e.id);e&&(t=x.getComponent(e,M.DropDownButton),x.getComponent(t.target,D.Tooltip).destroy(),t.destroy(),x.remove(e))},ni.prototype.updateGroupButtonSize=function(e,t){for(var o,i=t.groupButtonSettings,r=0;r<i.items.length;r++)(o=("Classic"===this.parent.activeLayout?e:document).querySelector("#"+t.id+G+r))&&x.getComponent(o,u.Button).setProperties({iconPosition:t.activeSize===R.RibbonItemSize.Large?"Top":"Left",content:t.activeSize===R.RibbonItemSize.Small?"":i.items[parseInt(r.toString(),10)].content})};var ri=ni;function ni(e){this.grpBtnIndex=0,this.parent=e,this.isSelected=!1}C.prototype.getModuleName=function(){return"ribbonGallery"},C.prototype.destroy=function(){this.parent=null},C.prototype.createGallery=function(i,e){var s=this,r=i.gallerySettings,t=(this.renderGalleryItems(r,!1,i.id,e),this.parent.createElement("button",{id:i.id+"_popupButton",className:"e-ribbon-gallery-button e-icons e-drop-icon"}));t.setAttribute("aria-label","gallerydropdownbutton"),e.appendChild(t),this.createPopup(i,t),t.onclick=function(e){var t,o=document.querySelector("#"+i.id+"_galleryPopup");o&&(t=x.getComponent(o,D.Popup),o.classList.contains("e-popup-close")?s.showPopup(t,o,e,r,i.id):s.hidePopup(t,o,e,r,i.id))},document.onclick=function(e){for(var t,o,i=document.querySelectorAll(".e-ribbon-gallery-popup.e-popup-open"),r=0;r<i.length;r++){var n=x.getComponent(i[parseInt(r.toString(),10)],D.Popup);if(!e.target.classList.contains("e-ribbon-gallery-button")){t=i[parseInt(r.toString(),10)].id.replace(/_galleryPopup/g,""),o=g(s.parent.tabs,t),s.hidePopup(n,i[parseInt(r.toString(),10)],e,o.item.gallerySettings,t);break}if(t=i[parseInt(r.toString(),10)].id.replace(/_galleryPopup/g,""),e.target.id.replace(/_popupButton/g,"")!==t){o=g(s.parent.tabs,t),s.hidePopup(n,i[parseInt(r.toString(),10)],e,o.item.gallerySettings,t);break}}}},C.prototype.renderGalleryItems=function(r,n,s,a){for(var l,p,c=this,e=g(this.parent.tabs,s),d=(e&&e.group&&(e.group.isCollapsible=!1),this.parent.createElement("div",{className:"e-ribbon-gallery-wrapper",id:s+"_galleryWrapper"})),t=(n||a.appendChild(d),function(o){for(var e,i=!1,t=(l=u.parent.createElement("ol",{className:"e-ribbon-gallery-container",id:s+"_galleryContainer"+o}),r.groups[parseInt(o.toString(),10)].itemHeight&&"auto"!==r.groups[parseInt(o.toString(),10)].itemHeight&&(i=!0),r.groups[parseInt(o.toString(),10)].cssClass&&l.classList.add(r.groups[parseInt(o.toString(),10)].cssClass),0);t<r.groups[parseInt(o.toString(),10)].items.length&&"break"!==function(t){p=u.parent.createElement("li",{className:"e-ribbon-gallery-item",id:(n?"popup_":"")+l.id+"_gallery"+t,attrs:{tabindex:"0"}});var e={name:"beforeItemRender",item:r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)]};if(r.beforeItemRender&&r.beforeItemRender.call(u,e),l.appendChild(p),r.selectedItemIndex&&r.selectedItemIndex===u.count?p.classList.add("e-ribbon-gallery-selected"):r.selectedItemIndex||0!==u.count||(p.classList.add("e-ribbon-gallery-selected"),r.selectedItemIndex=u.count),u.count=u.count+1,p.onclick=function(e){c.setActiveState(e.currentTarget,r,s,!0,e,n)},p.onkeydown=function(e){"Enter"!==e.key&&" "!==e.key||c.setActiveState(e.currentTarget,r,s,!0,e,n)},p.onmouseover=function(e){e={event:e,name:"itemHover",item:r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)]};r.itemHover&&r.itemHover.call(c,e)},r.groups[parseInt(o.toString(),10)].itemWidth&&"auto"!==r.groups[parseInt(o.toString(),10)].itemWidth&&(p.style.width=r.groups[parseInt(o.toString(),10)].itemWidth+"px"),r.groups[parseInt(o.toString(),10)].itemHeight&&"auto"!==r.groups[parseInt(o.toString(),10)].itemHeight&&(p.style.height=r.groups[parseInt(o.toString(),10)].itemHeight+"px","Simplified"===u.parent.activeLayout||n||(l.style.flexFlow="wrap")),(!r.template&&!r.popupTemplate||r.template&&!r.popupTemplate&&n||r.popupTemplate&&!r.template&&!n)&&(r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].htmlAttributes&&ii(p,r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].htmlAttributes),r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].iconCss&&(e=u.parent.createElement("span",{className:"e-ribbon-gallery-icons "+r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].iconCss}),p.appendChild(e),"Simplified"!==u.parent.activeLayout||n||e.classList.add("e-hidden")),r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].content&&p.appendChild(u.parent.createElement("span",{innerHTML:r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].content,className:"e-ribbon-gallery-text"})),r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].disabled&&p.classList.add("e-disabled"),r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].cssClass)&&p.classList.add(r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)].cssClass),r.template&&!n&&u.createGalleryTemplate(p,r,s,r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)]),r.popupTemplate&&n&&u.createGalleryPopupTemplate(p,r,s,r.groups[parseInt(o.toString(),10)].items[parseInt(t.toString(),10)]),!n&&!i&&r.itemCount===u.count)return d.appendChild(l),u.isAdded=!0,"break"}(t);t++);if(u.isAdded&&!n)return"break";(n?a:d).appendChild(l),n&&r.groups[parseInt(o.toString(),10)].header&&(e=u.parent.createElement("div",{className:"e-ribbon-gallery-header",innerHTML:r.groups[parseInt(o.toString(),10)].header}),a.insertBefore(e,l))}),u=this,o=0;o<r.groups.length&&"break"!==t(o);o++);this.count=0,this.isAdded=!1,this.parent.isReact&&(this.parent.portals=this.parent.portals.concat(this.portals),this.parent.renderReactTemplates(),this.portals=void 0)},C.prototype.setWrapperWidth=function(e,t,o,i){for(var r=1,n=0,s=!1,a=0;a<o.groups.length;a++){for(var l=0;l<o.groups[parseInt(a.toString(),10)].items.length;l++){if(!(r<=e)){s=!0;break}var p,c=t.querySelector("#"+i+"_galleryContainer"+a+"_gallery"+l);c&&(n+=c.offsetWidth,c=window.getComputedStyle(c))&&(p=parseFloat(c.paddingLeft)+parseFloat(c.paddingRight),x.isNullOrUndefined(p)||(n+=p),p=parseFloat(c.marginLeft)+parseFloat(c.marginRight),x.isNullOrUndefined(p)||(n+=p)),r++}if(s)break}0<n&&(t.style.width=n+"px")},C.prototype.setWrapperStyle=function(e,t){"auto"!==e.width&&t.forEach(function(e){e.style.flexFlow="wrap"})},C.prototype.checkAvailableHeight=function(e){for(var t=e.querySelectorAll(".e-ribbon-gallery-wrapper"),o=0;o<t.length;o++){var i=0,r=0,n=!1,s=t[parseInt(o.toString(),10)],a=s.id.replace(/_galleryWrapper/g,""),l=s.offsetHeight,p=g(this.parent.tabs,a);if(p){this.setWrapperWidth(p.item.gallerySettings.itemCount,s,p.item.gallerySettings,a);for(var c=0;c<p.item.gallerySettings.groups.length;c++)for(var d=0;d<p.item.gallerySettings.groups[parseInt(c.toString(),10)].items.length;d++){var u,h,b=s.querySelector("#"+a+"_galleryContainer"+c+"_gallery"+d);b&&("Classic"===this.parent.activeLayout?(b.classList.contains("e-hidden")&&b.classList.remove("e-hidden"),n?b.remove():(u=0,(h=window.getComputedStyle(b))&&(h=parseFloat(h.marginTop)+parseFloat(h.marginBottom),x.isNullOrUndefined(h)||(u+=h)),i++,p.item.gallerySettings.itemCount===i?(i=0,l>=b.offsetHeight+u?l-=b.offsetHeight+u:(n=!0,b.remove())):l<b.offsetHeight+u&&(n=!0,b.remove()))):++r>p.item.gallerySettings.itemCount&&b.classList.add("e-hidden"))}}}},C.prototype.checkCollision=function(e,t,o){void 0===o&&(o=0);var i=0,r=0;if(t){for(var n=window.innerWidth,s=0===o?n:Math.abs(n-(n-o)),a=window.getComputedStyle(t),l=(a&&(i=parseFloat(a.paddingLeft)+parseFloat(a.paddingRight),x.isNullOrUndefined(i)||(s-=i)),t.querySelectorAll(".e-ribbon-gallery-container")),p=(this.setWrapperStyle(e,l),!1),c=0;c<l.length;c++){for(var d=0,u=0;u<l[parseInt(c.toString(),10)].querySelectorAll(".e-ribbon-gallery-item").length;u++){var h=window.getComputedStyle(l[parseInt(c.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)]);if(h&&(r=parseFloat(h.marginLeft)+parseFloat(h.marginRight),x.isNullOrUndefined(r)||(d+=r)),s<=(d+=Math.round(parseFloat(h.width)))&&"auto"===e.width||"auto"!==e.width&&s<=parseInt(e.width.toString(),10)&&s<=d){t.style.width=d+Math.abs(i-r)-Math.round(parseFloat(h.width))+"px",p=!0;break}}if(p){l.forEach(function(e){e.style.flexFlow="wrap"}),"auto"===e.height&&this.setGalleryPopupHeight(t,parseFloat(a.height),parseFloat(a.top));break}}p||("auto"===e.width?(l.forEach(function(e){e.style.flexFlow="nowrap"}),t.style.width="auto"):t.style.width=e.width.toString(),"auto"===e.height&&this.setGalleryPopupHeight(t,parseFloat(a.height),parseFloat(a.top)))}},C.prototype.setGalleryPopupHeight=function(e,t,o){window.innerHeight<t||window.innerHeight<Math.round(t+o)?e.style.height=window.innerHeight-o+"px":e.style.height="auto"},C.prototype.createPopup=function(e,t){var o=this.parent.createElement("div",{className:"e-ribbon-popup-container",id:e.id+"_popupContainer"}),i=(this.renderGalleryItems(e.gallerySettings,!0,e.id,o),this.parent.createElement("div",{className:"e-ribbon-gallery-popup",id:e.id+"_galleryPopup"}));document.body.append(i),new D.Popup(i,{relateTo:t,content:o,collision:{X:"fit",Y:"flip"},actionOnScroll:"hide",targetType:"relative",position:{X:"left",Y:"bottom"},enableRtl:this.parent.enableRtl,width:e.gallerySettings.popupWidth,height:e.gallerySettings.popupHeight}).hide()},C.prototype.switchGalleryItems=function(e,t){var o=this.parent.element.querySelector("#"+t+j),i=g(this.parent.tabs,t);if(o){var r=o.querySelectorAll(".e-ribbon-gallery-icons"),n=o.querySelectorAll(".e-ribbon-gallery-container");if(r.length)for(var s=0;s<r.length;s++)"Simplified"===e?r[parseInt(s.toString(),10)].classList.add("e-hidden"):r[parseInt(s.toString(),10)].classList.remove("e-hidden");if(n.length&&i)for(var a=0;a<i.item.gallerySettings.groups.length;a++)for(s=0;s<n.length;s++)i.item.gallerySettings.groups[parseInt(a.toString(),10)].itemHeight&&"auto"!==i.item.gallerySettings.groups[parseInt(a.toString(),10)].itemHeight&&t+"_galleryContainer"+a===n[parseInt(s.toString(),10)].id&&(n[parseInt(s.toString(),10)].style.flexFlow="Simplified"===e?"nowrap":"wrap");o=this.parent.tabObj.element.querySelector("#"+this.parent.tabs[this.parent.selectedTab].id+A);o&&this.checkAvailableHeight(o)}},C.prototype.addOverFlowEvents=function(t,e){var o=this;if(e.closest(".e-ribbon-overflow-target")){var i=this.parent.createElement("button",{id:t.id}),e=(e.appendChild(i),e.querySelector(".e-ribbon-gallery-wrapper").classList.contains("e-disabled")&&i.classList.add("e-disabled"),e.querySelector(".e-ribbon-gallery-wrapper").classList.add("e-hidden"),e.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.add("e-hidden")}),e.querySelector("#"+t.id+"_popupButton")),e=(e&&e.classList.add("e-hidden"),g(this.parent.tabs,t.id)),r=e&&e.group.groupIconCss?e.group.groupIconCss:"",e=e&&e.group.header?e.group.header:"";if(!r)for(var n=0;n<t.gallerySettings.groups.length;n++){for(var s=0;s<t.gallerySettings.groups[parseInt(n.toString(),10)].items.length;s++)if(t.gallerySettings.groups[parseInt(n.toString(),10)].items[parseInt(s.toString(),10)].iconCss){r=t.gallerySettings.groups[parseInt(n.toString(),10)].items[parseInt(s.toString(),10)].iconCss;break}if(r)break}var a=document.querySelector("#"+t.id+"_galleryPopup"),l=x.getComponent(a,D.Popup),p=document.querySelector("#"+t.id+"_galleryPopup .e-ribbon-popup-container"),a=new M.DropDownButton({iconCss:r,content:e,target:p,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-gallery-dropdown",disabled:t.disabled,open:function(){var e=p.querySelectorAll(".e-ribbon-gallery-container");o.setWrapperStyle(l,e),o.setFoucsToFirstItem(p,!0,t.id)},beforeClose:function(e){o.popupEvents(e.event,t.gallerySettings,"popupClose",!1)&&(e.cancel=!0)}},i);"auto"!==l.width&&(a.dropDown.width=x.formatUnit(l.width)),"auto"!==l.height&&(a.dropDown.height=x.formatUnit(l.height),a.dropDown.element.style.height=l.height.toString())}},C.prototype.removeOverFlowEvents=function(e,t){var o=t.querySelector("#"+e.id+"_popupButton"),o=(o&&o.classList.remove("e-hidden"),t.querySelector(".e-ribbon-gallery-wrapper").classList.remove("e-hidden"),t.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.remove("e-hidden")}),document.querySelector("#"+e.id));o&&(t=document.querySelector("#"+e.id+"_galleryPopup"),e=x.getComponent(o,M.DropDownButton),t.appendChild(e.target),e.destroy(),x.remove(o))},C.prototype.setActiveState=function(e,t,o,i,r,n){var s,a,l=document.querySelector("#"+o+j),p=Array.prototype.slice.call(l.querySelectorAll(".e-ribbon-gallery-selected")),l=document.querySelector("#"+o+"_popupContainer"),l=Array.prototype.slice.call(l.querySelectorAll(".e-ribbon-gallery-selected"));l.length&&(p=p.concat(l));for(var c=0;c<t.groups.length;c++)for(var d=0;d<t.groups[parseInt(c.toString(),10)].items.length;d++)p[0].id===o+"_galleryContainer"+c+"_gallery"+d&&(s=t.groups[parseInt(c.toString(),10)].items[parseInt(d.toString(),10)]),e.id===(n?"popup_":"")+o+"_galleryContainer"+c+"_gallery"+d&&(a=t.groups[parseInt(c.toString(),10)].items[parseInt(d.toString(),10)]);var u,l=document.getElementById(e.id),h={cancel:!1,name:"beforeSelect",previousItem:s,currentItem:a,isInteracted:i,event:r};if(t.beforeSelect&&t.beforeSelect.call(this,h),!h.cancel){for(c=0;c<p.length;c++)p[parseInt(c.toString(),10)].classList.remove("e-ribbon-gallery-selected");l.id.startsWith("popup_")?document.getElementById(l.id.slice(6))&&(u=document.getElementById(l.id.slice(6))):u=document.getElementById("popup_"+e.id),u&&u.classList.add("e-ribbon-gallery-selected"),l.classList.add("e-ribbon-gallery-selected");for(var h={previousItem:s,currentItem:a,name:"select",isInteracted:i,event:r},b=document.querySelectorAll("#"+o+"_popupContainer .e-ribbon-gallery-item"),c=0;c<b.length;c++)if(b[parseInt(c.toString(),10)].id===e.id){t.selectedItemIndex=c;break}t.select&&t.select.call(this,h)}},C.prototype.popupEvents=function(e,t,o,i){e={cancel:!1,event:e,name:o};return i&&t.popupOpen?t.popupOpen.call(this,e):!i&&t.popupClose&&t.popupClose.call(this,e),!!e.cancel},C.prototype.showPopup=function(e,t,o,i,r){var n;this.popupEvents(o,i,"popupOpen",!0)||(e.show(),this.checkCollision(e,t),(o=document.querySelector("#"+r+"_popupButton")).classList.add("e-gallery-button-active"),n=o.getBoundingClientRect(),t.offsetWidth>n.left&&this.checkCollision(e,t,n.left),n=Math.abs(t.offsetWidth-n.left)+o.offsetWidth,t.style.left=n+"px",t.style.top=t.getBoundingClientRect().top+2+"px",this.setFoucsToFirstItem(t,!1,r,e,i))},C.prototype.hidePopup=function(e,t,o,i,r){this.popupEvents(o,i,"popupClose",!1)||(e.hide(),document.querySelector("#"+r+"_popupButton").classList.remove("e-gallery-button-active"))},C.prototype.showGalleryPopup=function(e){var t=g(this.parent.tabs,e),o=document.querySelector("#"+e+"_galleryPopup"),i=x.getComponent(o,D.Popup);this.showPopup(i,o,null,t.item.gallerySettings,e)},C.prototype.hideGalleryPopup=function(e){var t=g(this.parent.tabs,e),o=document.querySelector("#"+e+"_galleryPopup"),i=x.getComponent(o,D.Popup);this.hidePopup(i,o,null,t.item.gallerySettings,e)},C.prototype.setFoucsToFirstItem=function(t,o,i,r,n){var s=this;t.querySelectorAll(".e-ribbon-gallery-item")[0].focus(),this.galleryItemsIndex=0,t.onkeydown=function(e){s.handleGalleryPopupNavigation(e,t,o,i,r,n)}},C.prototype.handleGalleryPopupNavigation=function(e,t,o,i,r,n){var s=t.querySelectorAll(".e-ribbon-gallery-item");s&&("Home"===e.key?(this.galleryItemsIndex=0,s[this.galleryItemsIndex].focus()):"End"===e.key?(this.galleryItemsIndex=s.length-1,s[this.galleryItemsIndex].focus()):"ArrowRight"===e.key||"ArrowDown"===e.key?(this.galleryItemsIndex++,this.galleryItemsIndex!==s.length?s&&s[this.galleryItemsIndex]&&s[this.galleryItemsIndex].focus():(this.galleryItemsIndex=0,s[this.galleryItemsIndex].focus())):"ArrowLeft"===e.key||"ArrowUp"===e.key?0!==this.galleryItemsIndex?(this.galleryItemsIndex--,s&&s[this.galleryItemsIndex]&&s[this.galleryItemsIndex].focus()):(this.galleryItemsIndex=s.length-1,s[this.galleryItemsIndex].focus()):"Enter"!==e.key&&"Space"!==e.code&&("Escape"!==e.key||o)||this.hidePopup(r,t,e,n,i))},C.prototype.createGalleryTemplate=function(e,t,o,i){e.classList.add("e-ribbon-gallery-template");var r="ribbon"+o+"galleryTemplate",t=(this.parent.clearTemplate([r]),Uo(t.template));i.disabled&&e.classList.add("e-disabled"),i.cssClass&&e.classList.add(i.cssClass),x.append(t({items:i},this,r,o+"galleryTemplate",this.parent.isStringTemplate,null,null,this.parent),e)},C.prototype.createGalleryPopupTemplate=function(e,t,o,i){e.classList.add("e-ribbon-gallery-popup-template");var r="ribbon"+o+"galleryPopupTemplate",t=(this.parent.clearTemplate([r]),Uo(t.popupTemplate));i.disabled&&e.classList.add("e-disabled"),i.cssClass&&e.classList.add(i.cssClass),x.append(t({items:i},this,r,o+"galleryPopupTemplate",this.parent.isStringTemplate,null,null,this.parent),e)};var si=C;function C(e){this.count=0,this.isAdded=!1,this.galleryItemsIndex=0,this.registeredTemplate={},this.parent=e;e="viewContainerRef";x.setValue("registeredTemplate",this.registeredTemplate,this),x.setValue(e,this.parent[e],this)}ai=function(e,t){return(ai=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var ai,li,pi,ci=function(e,t){function o(){this.constructor=e}ai(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},T=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(n<3?r(s):3<n?r(t,o,s):r(t,o))||s);return 3<n&&s&&Object.defineProperty(t,o,s),s},ci=(li=x.Component,ci(k,li),(pi=k).prototype.render=function(){this.initialize()},k.prototype.preRender=function(){this.keysPress="",this.idIndex=0,this.tooltipData=[],this.initialPropsData={},this.hiddenElements={},this.keyTipElements={},this.hiddenGroups=[],this.itemsModel=[],this.targetTabs={},this.isAddRemove=!1,this.isUpdateItems=!1,this.keyConfigs={leftarrow:"leftarrow",rightarrow:"rightarrow",tab:"tab",shiftTab:"shift+tab"}},k.prototype.getPersistData=function(){return this.addOnPersist(["activeLayout"])},k.prototype.getModuleName=function(){return"ribbon"},k.prototype.requiredModules=function(){var e=[],t=(e.push({member:"ribbonButton",args:[this],name:"RibbonButton"},{member:"ribbonDropDown",args:[this],name:"RibbonDropDown"},{member:"ribbonSplitButton",args:[this],name:"RibbonSplitButton"},{member:"ribbonCheckBox",args:[this],name:"RibbonCheckBox"},{member:"ribbonComboBox",args:[this],name:"RibbonComboBox"},{member:"ribbonGroupButton",args:[this],name:"RibbonGroupButton"}),g(this.tabs,null,R.RibbonItemType.ColorPicker)),o=g(this.tabs,null,R.RibbonItemType.Gallery);return t&&e.push({member:"ribbonColorPicker",args:[this],name:"RibbonColorPicker"}),o&&e.push({member:"ribbonGallery",args:[this],name:"RibbonGallery"}),(this.backStageMenu.visible||this.backStageMenu.items.length)&&e.push({member:"ribbonBackstage",args:[this],name:"RibbonBackstage"}),(this.fileMenu.visible||this.fileMenu.menuItems.length)&&e.push({member:"ribbonFileMenu",args:[this],name:"RibbonFileMenu"}),this.contextualTabs.length&&e.push({member:"ribbonContextualTab",args:[this],name:"RibbonContextualTab"}),this.enableKeyTips&&e.push({member:"ribbonKeyTip",args:[this],name:"RibbonKeyTip"}),e},k.prototype.initialize=function(){this.element.id=this.element.id||x.getUniqueID("e-"+this.getModuleName()),x.addClass([this.element],["e-rbn"].concat(this.cssClass?this.cssClass.split(v):[])),this.enableRtl&&this.element.classList.add(at),this.element.style.width=x.formatUnit(this.width),this.renderTabs(),this.ribbonContextualTabModule&&this.ribbonContextualTabModule.addContextualTabs(),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.createFileMenu(this.fileMenu),this.ribbonBackstageModule&&this.ribbonBackstageModule.createBackStage(this.backStageMenu),this.createHelpPaneTemplate(),this.tabObj.tbObj.refreshOverflow(),this.addTabOverflowKeyTip(),ei(this.element,this),this.isKeytipOpen=!1,this.wireEvents(),this.wireKeyboardEvent(),this.currentControlIndex=0},k.prototype.wireEvents=function(){this.resizeListener=this.resizeHandler.bind(this),x.EventHandler.add(window,"resize",this.resizeListener),x.EventHandler.add(document.body,"keydown",this.keytipActionHandler,this),x.EventHandler.add(document,"mousedown",this.mouseEventHandler,this),x.EventHandler.add(document,"scroll",this.mouseEventHandler,this)},k.prototype.wireKeyboardEvent=function(){this.keyboardModuleRibbon=new x.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},k.prototype.keyActionHandler=function(e){"Tab"!==e.key||e.target.classList.contains("e-tab-wrap")||e.target.classList.contains("e-combobox")||e.preventDefault();var t,o=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A),i=Array.prototype.slice.call(o.querySelectorAll(".e-control")),r=Array.prototype.slice.call(o.querySelectorAll(".e-ribbon-template")),n=Array.prototype.slice.call(o.querySelectorAll(".e-ribbon-gallery-item")),s=i.concat(r,n),a=o.querySelectorAll(".e-combobox");if(a)for(var l=0;l<a.length;l++)a[parseInt(l.toString(),10)].closest(".e-input-focus")&&(t=a[parseInt(l.toString(),10)]);if(t)for(l=0;l<s.length;l++)s[parseInt(l.toString(),10)].classList.contains("e-combobox")&&s[parseInt(l.toString(),10)].closest(".e-input-focus")&&(this.currentControlIndex=l);if(0===this.currentControlIndex)for(var p=s[this.currentControlIndex].closest(".e-ribbon-item");p&&p.classList.contains("e-disabled");)this.currentControlIndex++,p=s[this.currentControlIndex].closest(".e-ribbon-item");if(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-launcher-icon")||e.target.classList.contains("e-ribbon-collapse-btn")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-first-item")||e.target.classList.contains("e-ribbon-group-of-btn")||e.target.classList.contains("e-ribbon-overall-of-btn")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-gallery-item"))switch(e.action){case"rightarrow":this.handleNavigation(e,!this.enableRtl,s);break;case"leftarrow":this.handleNavigation(e,this.enableRtl,s);break;case"tab":e.target.classList.contains("e-combobox")&&this.currentControlIndex<s.length-1&&this.currentControlIndex++;break;case"shiftTab":e.target.classList.contains("e-combobox")?0<this.currentControlIndex&&this.currentControlIndex--:(this.tabObj.element.querySelector(".e-toolbar-item.e-active").querySelector(".e-tab-wrap").focus(),this.currentControlIndex=0)}},k.prototype.handleNavigation=function(e,t,o){var i,r;if(t?this.currentControlIndex<o.length-1&&o[this.currentControlIndex+1].classList.contains("e-colorpicker")&&this.currentControlIndex++:0<this.currentControlIndex&&o[this.currentControlIndex-1].classList.contains("e-colorpicker")&&this.currentControlIndex--,!t&&0<this.currentControlIndex||t&&this.currentControlIndex<o.length-1){if(!e.target.classList.contains("e-combobox")&&(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-gallery-item"))&&!e.target.classList.contains("e-ribbon-last-item")){t?this.currentControlIndex++:((n=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+Mt))&&(i=n.getAttribute("id")),this.currentControlIndex--);for(var n,s,a,l=o[this.currentControlIndex].closest(".e-ribbon-item");l&&l.classList.contains("e-disabled");){if((t&&this.currentControlIndex===o.length-1||!t&&0===this.currentControlIndex)&&o[this.currentControlIndex].closest(".e-ribbon-item").classList.contains("e-disabled")){this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus();break}t?this.currentControlIndex++:this.currentControlIndex--,l=o[this.currentControlIndex].closest(".e-ribbon-item")}o[parseInt(this.currentControlIndex.toString(),10)].focus(),"Classic"===this.activeLayout?(a=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+Mt),t?(s=void 0,(s=a?a.querySelector(".e-ribbon-launcher-icon"):s)&&(n=(n=a.querySelectorAll(".e-ribbon-item"))[n.length-1].querySelector(".e-control"))&&n.classList.add("e-ribbon-last-item")):a&&i!==a.getAttribute("id")&&(s=a.querySelector(".e-ribbon-launcher-icon"))&&o[parseInt((this.currentControlIndex+1).toString(),10)].classList.add("e-ribbon-first-item")):o[parseInt(this.currentControlIndex.toString(),10)].classList.contains("e-ribbon-first-item")?o[parseInt(this.currentControlIndex.toString(),10)].classList.remove("e-ribbon-first-item"):o[parseInt(this.currentControlIndex.toString(),10)].classList.contains("e-ribbon-last-item")&&o[parseInt(this.currentControlIndex.toString(),10)].classList.remove("e-ribbon-last-item")}}else"Classic"===this.activeLayout&&this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus(),"Simplified"===this.activeLayout&&(r=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn"),(t&&r&&!r.classList.contains("e-ribbon-hide")?r:this.tabObj.element.querySelector(".e-ribbon-collapse-btn")).focus());if(e.target.classList.contains("e-ribbon-last-item")&&(t?(a=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+Mt)).querySelector(".e-ribbon-launcher-icon"):(this.currentControlIndex--,o[parseInt(this.currentControlIndex.toString(),10)])).focus(),!t&&e.target.classList.contains("e-ribbon-first-item")&&(s=(a=o[parseInt((this.currentControlIndex-1).toString(),10)].closest("."+Mt)).querySelector(".e-ribbon-launcher-icon"))&&a.querySelector(".e-ribbon-launcher-icon").focus(),e.target.classList.contains("e-ribbon-launcher-icon")&&(t?(this.currentControlIndex++,o[parseInt(this.currentControlIndex.toString(),10)].focus(),o[parseInt((this.currentControlIndex-1).toString(),10)].classList.contains("e-ribbon-last-item")&&o[parseInt((this.currentControlIndex-1).toString(),10)].classList.remove("e-ribbon-last-item")):(this.currentControlIndex,o[parseInt(this.currentControlIndex.toString(),10)].focus())),e.target.classList.contains("e-ribbon-collapse-btn"))if(t){this.currentControlIndex=0;for(var p=o[this.currentControlIndex].closest(".e-ribbon-item");p&&p.classList.contains("e-disabled");)this.currentControlIndex++,p=o[this.currentControlIndex].closest(".e-ribbon-item");o[parseInt(this.currentControlIndex.toString(),10)].focus()}else if((r=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn"))&&!r.classList.contains("e-ribbon-hide"))r.focus();else{this.currentControlIndex=o.length-1;for(p=o[this.currentControlIndex].closest(".e-ribbon-item");p&&p.classList.contains("e-disabled");)this.currentControlIndex--,p=o[this.currentControlIndex].closest(".e-ribbon-item");o[parseInt(this.currentControlIndex.toString(),10)].focus()}"Simplified"===this.activeLayout&&e.target.classList.contains("e-ribbon-overall-of-btn")&&(t?this.tabObj.element.querySelector(".e-ribbon-collapse-btn"):(this.currentControlIndex=o.length-1,o[parseInt(this.currentControlIndex.toString(),10)])).focus()},k.prototype.resizeHandler=function(){var e=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A);if(x.isNullOrUndefined(e)||this.checkOverflow(this.selectedTab,e),this.scrollModule&&(e=this.tabObj.element.querySelector("."+ht),this.scrollModule.scrollStep=e.offsetWidth),"Simplified"===this.activeLayout){var t=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(!x.isNullOrUndefined(t)&&t.length)for(var o=0;o<t.length;o++)x.getInstance(t[parseInt(o.toString(),10)],M.DropDownButton).toggle()}e=document.querySelector(".e-ribbon-gallery-popup.e-popup-open");e&&x.getComponent(e,D.Popup).hide(),this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},k.prototype.mouseEventHandler=function(){this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},k.prototype.keytipActionHandler=function(e){if(this.enableKeyTips){var t=!1,o=e.key;if(e.altKey&&"Meta"===e.key){var i,r=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(r.length){for(var n=0;n<r.length;n++)x.getInstance(r[parseInt(n.toString(),10)],M.DropDownButton).toggle();this.ribbonKeyTipModule.removeKeytip()}else this.isKeytipOpen?this.ribbonKeyTipModule.removeKeytip():((i=document.querySelector(".e-ribbon-backstage-popup"))&&i.classList.contains("e-popup-open")&&this.ribbonBackstageModule.hideBackstage(),this.ribbonKeyTipModule.createKeytip("tab"))}else if("Escape"===e.key||"Tab"===e.key||"ArrowLeft"===e.key||"ArrowUp"===e.key||"ArrowRight"===e.key||"ArrowDown"===e.key)this.ribbonKeyTipModule.removeKeytip(e.key);else{var s=document.querySelectorAll(".e-ribbon-keytip");if(s){for(n=0;n<s.length;n++)if(s[parseInt(n.toString(),10)].innerHTML.toLowerCase()===o){t=!0,this.ribbonKeyTipModule.keytipPress(o);break}t||this.checkKeyTipPresent(o,this.keysPress.length)}}}},k.prototype.checkKeyTipPresent=function(e,t){for(var o=document.querySelectorAll(".e-ribbon-keytip"),i=0;i<o.length;i++){var r=o[parseInt(i.toString(),10)];if(1<r.innerHTML.length&&r.innerHTML[parseInt(t.toString(),10)].toLowerCase()===e){this.keysPress+=e,this.ribbonKeyTipModule.keytipPress(this.keysPress),this.removeKeytip(this.keysPress);break}}},k.prototype.removeKeytip=function(e){for(var t=document.querySelectorAll(".e-ribbon-keytip"),o=0;o<t.length;o++){var i=t[parseInt(o.toString(),10)];i.innerHTML[0].toLowerCase()!==e&&""!==e&&x.remove(i)}},k.prototype.addKeyTip=function(e,t,o,i){if(this.keyTipElements&&this.keyTipElements[parseInt(e.toString(),10)]){var r=!1;if(this.keyTipElements[parseInt(e.toString(),10)][""+i]||(this.keyTipElements[parseInt(e.toString(),10)][""+i]=[]),Object.keys(this.keyTipElements[parseInt(e.toString(),10)][""+i]).length){for(var n=this.keyTipElements[parseInt(e.toString(),10)][""+i],s=0;s<Object.keys(this.keyTipElements[parseInt(e.toString(),10)][""+i]).length;s++)n[parseInt(s.toString(),10)].id===o&&(r=!0);r||this.keyTipElements[parseInt(e.toString(),10)][""+i].push({id:o,type:i,keyTip:t})}else this.keyTipElements[parseInt(e.toString(),10)][""+i].push({id:o,type:i,keyTip:t})}},k.prototype.renderTabs=function(){this.tabsInternal=this.tabs.slice(),this.tabsInternal=this.checkID(this.tabsInternal,"tab",this.element.id),this.setProperties({tabs:this.tabsInternal},!0);var e=this.createElement("div",{id:this.element.id+So}),t=(this.element.appendChild(e),this.validateItemSize(),this.createTabItems(this.tabs)),t=(this.tabObj=new L.Tab({cssClass:mt,selectedItem:this.selectedTab,overflowMode:"Popup",width:this.width,items:t,enableRtl:this.enableRtl,created:this.tabCreated.bind(this),selected:this.ribbonTabSelected.bind(this),selecting:this.ribbonTabSelecting.bind(this),animation:this.tabAnimation}),this.tabObj.appendTo(e),this.element.style.setProperty(Mo,"0px"),this.element.style.setProperty(_o,"0px"),e.querySelector(".e-toolbar"));x.getComponent(t,L.Toolbar).setProperties({width:"calc(100% - var(--fileMenuWidth) - var(--helpTemplateWidth))"}),this.element.classList[this.isMinimized?"add":"remove"](Bt)},k.prototype.minimize=function(t){var o=this;t!==this.isMinimized&&this.trigger(t?"ribbonCollapsing":"ribbonExpanding",{cancel:!1},function(e){e.cancel||(o.setProperties({isMinimized:t},!0),o.element.classList.toggle(Bt,o.isMinimized),o.tabObj.element.querySelector(".e-content").style.display=t?"none":"block",t)||o.refreshLayout()})},k.prototype.toggleLayout=function(e){this.setProperties({activeLayout:"Simplified"===this.activeLayout?"Classic":"Simplified"},!0),this.switchLayout();e={activeLayout:this.activeLayout,event:e};this.trigger("ribbonLayoutSwitched",e)},k.prototype.tabCreated=function(){this.hideLayoutSwitcher||this.addExpandCollapse(),this.renderInitialTab(this.selectedTab)},k.prototype.ribbonTabSelected=function(e){e.preventFocus=!0,this.isAddRemove=!1;var t=e.selectedItem.getAttribute("data-id"),o=-1===(o=S(this.tabs,function(e){return e.id===t}))?this.selectedTab:o,i=this.tabObj.items[parseInt(o.toString(),10)].content,r=(i.querySelector("."+Lt)||0===this.tabs[parseInt(o.toString(),10)].groups.length||(r=this.createGroups(this.tabs[parseInt(o.toString(),10)].groups,o),x.append(r,i)),this.isContextualTab(t)),r=(this.updateSelectedState(t),{previousIndex:this.selectedTab,selectedIndex:o,isContextual:r});if(this.setProperties({selectedTab:o},!0),this.calculateHiddenElementsWidth(o),this.isUpdateItems){for(var n=0;n<this.itemsModel.length;n++){var s=this.itemsModel[parseInt(n.toString(),10)];this.selectedTab===this.targetTabs[s.id]&&(this.updateItem(s),this.itemsModel.splice(n,1),n--)}0===this.itemsModel.length&&(this.isUpdateItems=!1)}this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(e.selectedContent.firstChild),this.checkOverflow(o,i),"Simplified"===this.activeLayout&&this.overflowDDB&&((i=(e=this.overflowDDB.target).querySelector("."+ft))&&i.classList.remove(ft),(i=e.querySelector("#"+t+w))?(i.classList.add(ft),this.overflowDDB.element.classList.remove(bt),this.checkOverflowHiddenItems(!1,o)):this.overflowDDB.element.classList.add(bt)),this.trigger("tabSelected",r)},k.prototype.updateSelectedState=function(e){if(this.contextualTabs.length)for(var t=0;t<this.contextualTabs.length;t++){for(var o=!1,i=0;i<this.contextualTabs[parseInt(t.toString(),10)].tabs.length;i++)if(this.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(i.toString(),10)].id===e){o=!0;break}this.contextualTabs[parseInt(t.toString(),10)].setProperties({isSelected:o},!0)}},k.prototype.checkOverflow=function(e,t){var o,i=t.closest("."+Ot),r=i.offsetWidth<t.offsetWidth;r&&!this.scrollModule?("Classic"===this.activeLayout?(!(o=this.checkGroupShrinking(e,i,t,!(o=!1)))&&i.offsetWidth<t.offsetWidth&&(o=this.checkGroupShrinking(e,i,t,!1)),i.offsetWidth<t.offsetWidth&&this.createOverflowDropdown(e,i,t)):(this.checkSimplifiedItemShrinking(e,i,t),i.offsetWidth<t.offsetWidth&&this.createSimplfiedOverflow(i,t,e)),i.offsetWidth<t.offsetWidth&&!this.scrollModule&&(this.scrollModule=new L.HScroll({enableRtl:this.enableRtl},this.tabObj.element.querySelector("."+Ot)))):r||(this.destroyScroll(),"Classic"===this.activeLayout?!(o=!(o=this.removeOverflowDropdown(i,t,o=!1,e))&&i.offsetWidth>t.offsetWidth?this.checkGroupExpanding(e,i,t,!0):o)&&i.offsetWidth>t.offsetWidth&&(o=this.checkGroupExpanding(e,i,t,!1)):(this.removeSimplfiedOverflow(i,t,e),i.offsetWidth>t.offsetWidth&&this.checkSimplifiedItemExpanding(e,i,t))),this.addTabOverflowKeyTip()},k.prototype.addTabOverflowKeyTip=function(){var e=this.tabObj.element.querySelector("#_nav");e?(this.keyTipElements.taboverflow=[],this.keyTipElements.taboverflow.push({id:e.id,type:"taboverflow",keyTip:"00"})):delete this.keyTipElements.taboverflow},k.prototype.checkSimplifiedItemShrinking=function(e,t,o){for(var i=this.tabs[parseInt(e.toString(),10)],r=i.groups.length-1;0<=r;r--)for(var n=i.groups[parseInt(r.toString(),10)],s=t.querySelector("#"+n.id+j),a=0;a<n.collections.length&&t.offsetWidth<o.offsetWidth;a++)for(var l=n.collections[parseInt(a.toString(),10)],p=l.items.length;1<=p&&t.offsetWidth<o.offsetWidth;p--){var c,d,u=l.items[p-1];u.allowedSizes&R.RibbonItemSize.Small&&u.allowedSizes&R.RibbonItemSize.Medium&&u.activeSize===R.RibbonItemSize.Medium&&u.displayOptions&R.DisplayMode.Simplified&&(c=s.querySelector("#"+u.id+j))&&(d=c.querySelector("#"+u.id),c.setAttribute("data-medium-width",o.offsetWidth.toString()),u.setProperties({activeSize:R.RibbonItemSize.Small},!0),this.setItemSize(d,u))}},k.prototype.checkSimplifiedItemExpanding=function(e,t,o){for(var i=this.tabs[parseInt(e.toString(),10)],r=i.groups.length-1;0<=r;r--)for(var n=i.groups[parseInt(r.toString(),10)],s=t.querySelector("#"+n.id+j),a=0;a<n.collections.length&&t.offsetWidth>o.offsetWidth;a++)for(var l=n.collections[parseInt(a.toString(),10)],p=l.items.length;1<=p&&t.offsetWidth>o.offsetWidth;p--){var c,d,u=l.items[p-1];u.allowedSizes&R.RibbonItemSize.Small&&u.allowedSizes&R.RibbonItemSize.Medium&&u.activeSize===R.RibbonItemSize.Small&&u.displayOptions&R.DisplayMode.Simplified&&(c=s.querySelector("#"+u.id+j))&&(d=(d=c.getAttribute("data-medium-width"))?parseInt(d,10):null)&&t.offsetWidth>d&&(c.removeAttribute("data-medium-width"),d=c.querySelector("#"+u.id),u.setProperties({activeSize:R.RibbonItemSize.Medium},!0),this.setItemSize(d,u))}},k.prototype.createSimplfiedOverflow=function(e,t,o){for(var i=this.getGroupResizeOrder(!0,o),r=0;r<i.length&&e.offsetWidth<t.offsetWidth;r++){for(var n=!1,s=i[parseInt(r.toString(),10)],a=e.querySelector("#"+s.id),l=a.querySelector("#"+s.id+j),p=s.collections.length;1<=p&&e.offsetWidth<t.offsetWidth;p--)for(var c=s.collections[parseInt((p-1).toString(),10)],d=a.querySelector("#"+c.id),u=c.items.length;1<=u&&e.offsetWidth<t.offsetWidth;u--){var h=c.items[u-1],b=d.querySelector("#"+h.id+j);if((h.displayOptions===R.DisplayMode.Auto||h.displayOptions===(R.DisplayMode.Simplified|R.DisplayMode.Overflow))&&!x.isNullOrUndefined(b)){var m=!1,y=!1,f=!1,g=!1,v=void 0;if(a.classList.contains("e-hidden")||a.classList.contains("e-hide-group")){if((v=a.querySelectorAll(".e-ribbon-item.e-hidden")).length)for(var S=0;S<v.length;S++)v[parseInt(S.toString(),10)].classList.remove("e-hidden");a.classList.contains("e-hide-group")?(f=!0,a.classList.remove("e-hide-group"),a.classList.remove("e-ribbon-emptyCollection"),-1!==this.hiddenGroups.indexOf(a.id)&&this.hiddenGroups.splice(this.hiddenGroups.indexOf(a.id),1)):(m=!0,a.classList.remove("e-hidden")),n||(this.calculateOverflowItemsWidth(a.offsetWidth,!1,o),this.calculateMediumDataWidth(a.offsetWidth,o,!1),n=!0)}else b.classList.contains("e-hidden")&&(y=!0,b.classList.remove("e-hidden"),a.classList.contains("e-ribbon-emptyCollection")&&(g=!0,a.classList.remove("e-ribbon-emptyCollection")),this.calculateOverflowItemsWidth(b.offsetWidth,!1,o),this.calculateMediumDataWidth(b.offsetWidth,o,!1));if(b.setAttribute("data-simplified-width",t.offsetWidth.toString()),y&&b.classList.add("e-hidden"),v&&v.length)for(var I=0;I<v.length;I++)v[parseInt(I.toString(),10)].classList.add("e-hidden");m&&a.classList.add("e-hidden"),f&&(a.classList.add("e-hide-group"),a.classList.add("e-ribbon-emptyCollection")),g&&a.classList.add("e-ribbon-emptyCollection"),this.createOverflowPopup(h,o,s.enableGroupOverflow,s.id,s.header,b,l,!0),h.activeSize===R.RibbonItemSize.Small&&(y=b.querySelector("#"+h.id),h.setProperties({activeSize:R.RibbonItemSize.Medium},!0),this.setItemSize(y,h)),h.type!==R.RibbonItemType.DropDown&&h.type!==R.RibbonItemType.SplitButton&&h.type!==R.RibbonItemType.GroupButton&&h.type!==R.RibbonItemType.Gallery||this.updatePopupItems(h,b,s.enableGroupOverflow,!0)}}s.enableGroupOverflow||a.querySelector("."+Ut)||a.classList.add("e-ribbon-emptyCollection");var C=a.querySelectorAll("."+Ut);C&&!s.enableGroupOverflow&&this.checkEmptyCollection(C)&&a.classList.add("e-ribbon-emptyCollection"),this.checkOverflowHiddenItems(s.enableGroupOverflow,o,s.id)}},k.prototype.checkEmptyCollection=function(e){for(var t=!0,o=0;o<e.length;o++)if(!e[parseInt(o.toString(),10)].classList.contains("e-hidden")){t=!1;break}return t},k.prototype.updatePopupItems=function(t,e,o,i){var r=this,e=x.getComponent(e.querySelector("#"+t.id),t.type===R.RibbonItemType.DropDown||t.type===R.RibbonItemType.Gallery||t.type===R.RibbonItemType.GroupButton?M.DropDownButton:M.SplitButton),n=e.dropDown,s=(o&&i)===this.enableRtl;n&&(n.setProperties({position:{X:s?"left":"right",Y:i?"top":"bottom"}},!0),i?e.beforeOpen=function(e){s&&(t.type===R.RibbonItemType.Gallery&&r.ribbonGalleryModule&&r.ribbonGalleryModule.checkCollision(n,n.element),n.element.style.setProperty("visibility","hidden"),n.element.style.setProperty("display","block"),n.setProperties({offsetX:-1*n.element.offsetWidth}),n.element.style.removeProperty("display"),n.element.style.removeProperty("visibility")),t.splitButtonSettings.beforeOpen&&t.splitButtonSettings.beforeOpen.call(r,e),t.dropDownSettings.beforeOpen&&t.dropDownSettings.beforeOpen.call(r,e)}:(n.setProperties({offsetX:0},!0),e.beforeOpen=null))},k.prototype.removeSimplfiedOverflow=function(e,t,o,i){void 0===i&&(i=!1);for(var r=this.getGroupResizeOrder(!1,o),n=!0,s=0;s<r.length&&n;s++){var a=r[parseInt(s.toString(),10)],l=void 0,p=void 0;a.enableGroupOverflow?(c=e.querySelector("#"+a.id+_))&&(p=(l=x.getInstance(c,M.DropDownButton)).target):(l=this.overflowDDB,p=this.overflowDDB?this.overflowDDB.target:null);for(var c,d=0;d<a.collections.length&&n;d++)for(var u=a.collections[parseInt(d.toString(),10)],h=0;h<u.items.length&&n&&!i&&e.offsetWidth>t.offsetWidth;h++){var b=u.items[parseInt(h.toString(),10)],m=void 0;if(p&&(m=p.querySelector("#"+b.id+j)),(b.displayOptions===R.DisplayMode.Auto||b.displayOptions===(R.DisplayMode.Simplified|R.DisplayMode.Overflow))&&!x.isNullOrUndefined(m)){var y=parseInt(m.getAttribute("data-simplified-width"),10),f=e.querySelector("#"+a.id);if((m.classList.contains("e-hidden")||f.classList.contains("e-hidden"))&&(y=Math.abs(y-t.offsetWidth)),!i&&e.offsetWidth<y){n=!1;break}var g=e.querySelector("#"+u.id),v=(b.type!==R.RibbonItemType.DropDown&&b.type!==R.RibbonItemType.SplitButton&&b.type!==R.RibbonItemType.GroupButton&&b.type!==R.RibbonItemType.Gallery||this.updatePopupItems(b,m,a.enableGroupOverflow,!1),g.append(m),(m.classList.contains("e-hidden")||f.classList.contains("e-hidden"))&&(m.setAttribute("data-simplified-width",y.toString()),g=!1,v=0,m.classList.contains("e-hidden")&&(m.classList.remove("e-hidden"),f.classList.contains("e-hide-group")&&(g=!0,v=this.checkWidthDifference(m,f)),y=m.offsetWidth+v,m.classList.add("e-hidden")),this.calculateOverflowItemsWidth(y,!0,o),this.calculateMediumDataWidth(y,o,!0),g)&&(f.classList.add("e-hide-group"),f.classList.add("e-ribbon-emptyCollection")),this.removeOverflowEvent(b,m),b.allowedSizes&R.RibbonItemSize.Small&&(b.setProperties({activeSize:R.RibbonItemSize.Small},!0),this.setItemSize(m.querySelector("#"+b.id),b)),e.querySelector("#"+a.id)),y=v.querySelector("."+Ut);v.classList.contains("e-ribbon-emptyCollection")&&null!==y&&(g=v.querySelectorAll("."+Ut))&&!this.checkEmptyCollection(g)&&v.classList.remove("e-ribbon-emptyCollection")}}l&&(a.enableGroupOverflow?(0===p.childElementCount||1===p.childElementCount&&this.isHeaderVisible(p,a.id))&&this.removeOverflowButton(l):((c=p.querySelector("#"+a.id+j))&&1===c.childElementCount&&c.remove(),(l=p.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+w))&&0===l.childElementCount&&(l.remove(),this.overflowDDB.element.classList.add(bt))))}for(s=0;s<r.length;s++)this.checkOverflowHiddenItems(r[parseInt(s.toString(),10)].enableGroupOverflow,o,r[parseInt(s.toString(),10)].id);this.overflowDDB&&0===this.overflowDDB.target.childElementCount&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},k.prototype.checkOverflowHiddenItems=function(e,t,o){if(e){e=document.querySelector("#"+o+_);if(e){for(var o=x.getInstance(e,M.DropDownButton),i=o.target.querySelectorAll(".e-ribbon-item"),r=!0,n=0;n<i.length;n++)if(!i[parseInt(n.toString(),10)].classList.contains("e-hidden")){r=!1;break}o.element.classList[r?"add":"remove"]("e-hidden")}}else if(this.overflowDDB){var s=!0,a=void 0,l=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+w);if(l){for(var p=0;p<l.children.length;p++){for(var a=!0,c=l.children[parseInt(p.toString(),10)],d=c.querySelectorAll(".e-ribbon-item"),u=0;u<d.length;u++)if(!d[parseInt(u.toString(),10)].classList.contains("e-hidden")){a=!1;break}c.classList[a?"add":"remove"]("e-hide-group"),c.classList.contains("e-hide-group")||c.classList.contains("e-hidden")||(s=!1)}this.overflowDDB.element.classList[s?"add":"remove"](bt)}}},k.prototype.createOverflowPopup=function(e,t,o,i,r,n,s,a){var l,p,c,d=Xo(this.tabs,i),u=this.tabObj.items[parseInt(t.toString(),10)].content.querySelector("#"+i);o?((p=s.querySelector("#"+i+_))?l=x.getInstance(p,M.DropDownButton):((l=this.addOverflowButton(i+_,o)).element.classList.add(wt),s.appendChild(l.element)),this.addKeyTip(t,"0"+(d.groupIndex+1),l.element.id,"grpofbtn"),p=l.target,(s=l.target).querySelector("#"+i+_+q)||d.group.overflowHeader&&(c=this.createElement("div",{className:Gt,id:i+_+q,innerHTML:d.group.overflowHeader}),s.append(c)),u&&(u.classList.contains("e-disabled")&&s.classList.add("e-disabled"),u.classList.contains("e-hidden")&&s.classList.add("e-hidden"),u.classList.contains("e-hide-group"))&&s.classList.add("e-hide-group"),a?s.insertBefore(n,s.querySelector("."+Ut)):s.append(n)):(this.overflowDDB?(this.overflowDDB.element.classList.remove(bt),(s=(c=this.overflowDDB.target).querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+w))?((c=c.querySelector("#"+i+j))||(c=d.group.overflowHeader?this.createGroupContainer(i,d.group.overflowHeader):this.createGroupContainer(i,r),u&&(u.classList.contains("e-disabled")&&c.classList.add("e-disabled"),u.classList.contains("e-hidden")&&c.classList.add("e-hidden"),u.classList.contains("e-hide-group"))&&c.classList.add("e-hide-group"),s.append(c)),a?c.insertBefore(n,c.querySelector("."+Ut)):c.append(n)):this.createOfTabContainer(i,r,n,t)):(this.overflowDDB=this.addOverflowButton(this.tabObj.element.id+wo,o),this.tabObj.element.insertBefore(this.overflowDDB.element,this.collapseButton),this.overflowDDB.element.classList.add(Ct),this.createOfTabContainer(i,r,n,t)),l=this.overflowDDB,p=this.overflowDDB?this.overflowDDB.target:null),null!==n&&this.addOverflowEvents(e,n,l),p&&e.keyTip&&this.addKeyTip(t,e.keyTip,e.id,"popupitem")},k.prototype.addOverflowEvents=function(e,t,o){switch(e.type){case"Button":this.ribbonButtonModule.addOverFlowEvents(e,t,o);break;case"DropDown":this.ribbonDropDownModule.addOverFlowEvents(e,t,o);break;case"SplitButton":this.ribbonSplitButtonModule.addOverFlowEvents(e,t,o);break;case"CheckBox":this.ribbonCheckBoxModule.addOverFlowEvents(e,t,o);break;case"ColorPicker":this.ribbonColorPickerModule.addOverFlowEvents(e,t,o);break;case"ComboBox":this.ribbonComboBoxModule.addOverFlowEvents(e,t,o);break;case"Gallery":"Simplified"===this.activeLayout&&this.ribbonGalleryModule.addOverFlowEvents(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.addOverFlowEvents(e,t,o)}},k.prototype.createOfTabContainer=function(e,t,o,i){var r=this.createElement("div",{id:this.tabs[parseInt(i.toString(),10)].id+w,className:_t}),n=(this.overflowDDB.target.append(r),Xo(this.tabs,e)),n=n.group.overflowHeader?this.createGroupContainer(e,n.group.overflowHeader):this.createGroupContainer(e,t),t=(n.append(o),r.append(n),i===this.selectedTab&&r.classList.add(ft),document.querySelector("#"+e));t&&(t.classList.contains("e-disabled")&&n.classList.add("e-disabled"),t.classList.contains("e-hidden")&&n.classList.add("e-hidden"),t.classList.contains("e-hide-group"))&&n.classList.add("e-hide-group")},k.prototype.checkGroupShrinking=function(e,t,o,i){for(var r=!0,n=!1,s=this.tabs[parseInt(e.toString(),10)],a=s.groups.length-1;r&&0<=a;a--)r=!(n=i?this.checkLargeToMedium(e,s,a,t,o):this.checkMediumToSmall(e,s,a,t,o))&&t.offsetWidth<o.offsetWidth;return n},k.prototype.checkValidCollectionLength=function(e){for(var t=0,o=0;o<e.length;o++){for(var i=e[parseInt(o.toString(),10)].items,r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].displayOptions&R.DisplayMode.Classic){t++;break}if(1<t)return!1}return 1===t},k.prototype.checkClassicCollection=function(e,t,o){for(var i=e[parseInt(t.toString(),10)].items,r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].displayOptions&R.DisplayMode.Classic)return t;return t=o?t+1:t-1,o?t===e.length?t:this.checkClassicCollection(e,t,o):t<0?t:this.checkClassicCollection(e,t,o)},k.prototype.checkClassicItem=function(e,t,o){return e[parseInt(t.toString(),10)].displayOptions&R.DisplayMode.Classic?t:(t=o?t+1:t-1,o?t===e.length?t:this.checkClassicItem(e,t,o):t<0?t:this.checkClassicItem(e,t,o))},k.prototype.checkLargeToMedium=function(l,e,p,t,c,d){var u=this,o=(void 0===d&&(d=!1),e.groups[parseInt(p.toString(),10)]);if(!o.isCollapsed||d){var i=function(e){return 1===e.items.length&&r(e.items[0])},r=function(e){return e.allowedSizes&R.RibbonItemSize.Medium&&e.activeSize===R.RibbonItemSize.Large},h=function(e,t,o,i){e=u.createElement("div",{className:"e-ribbon-shrink "+Vt,id:e+"_shrink_container"+o,attrs:{"data-start":o.toString(),"data-end":i.toString()}});return t.parentElement.insertBefore(e,t),d||e.setAttribute("data-large-width",c.offsetWidth.toString()),e},n=function(e,t){for(var o=u.tabs[parseInt(l.toString(),10)].groups[parseInt(p.toString(),10)].collections[0],i=c.querySelector("#"+o.items[parseInt(e.toString(),10)].id+j),r=d?c.querySelector("#"+o.id+"_shrink_container"+e):h(o.id,i,e,t),n=e;n<=t;n++){var s,a=o.items[parseInt(n.toString(),10)];a.displayOptions&R.DisplayMode.Classic&&(s=c.querySelector("#"+a.id+j),r.appendChild(s),a.setProperties({activeSize:R.RibbonItemSize.Medium},!0),a.type===R.RibbonItemType.GroupButton&&"Classic"===u.activeLayout?u.setItemSize(s.querySelector("#"+a.id+G),a):u.setItemSize(s.querySelector("#"+a.id),a))}},s=function(e,t){for(var o=u.tabs[parseInt(l.toString(),10)].groups[parseInt(p.toString(),10)],i=c.querySelector("#"+o.collections[parseInt(e.toString(),10)].id),r=d?c.querySelector("#"+o.id+"_shrink_container"+e):h(o.id,i,e,t),n=e;n<=t;n++){var s=o.collections[parseInt(n.toString(),10)],a=c.querySelector("#"+s.id);r.appendChild(a),s.items[0].setProperties({activeSize:R.RibbonItemSize.Medium},!0),s.items[0].type===R.RibbonItemType.GroupButton&&"Classic"===u.activeLayout?u.setItemSize(a.querySelector("#"+s.items[0].id+G),s.items[0]):u.setItemSize(a.querySelector("#"+s.items[0].id),s.items[0])}};if(o.orientation===R.ItemOrientation.Column)for(var a=o.collections.length-1;0<a;a--){var b=(a=this.checkClassicCollection(o.collections,a,!1))-1;if(0<=b&&i(o.collections[parseInt(a.toString(),10)]))if(0<=(b=this.checkClassicCollection(o.collections,b,!1))&&i(o.collections[parseInt(b.toString(),10)])){if(0<=(y=0<=(y=b-1)?this.checkClassicCollection(o.collections,y,!1):y)&&i(o.collections[parseInt(y.toString(),10)])?s(y,a):s(b,a),a=y,!d&&t.offsetWidth>c.offsetWidth)return!0}else a=b}else if(this.checkValidCollectionLength(o.collections))for(var m=o.collections[0],a=m.items.length-1;0<a;a--){var y,b=(a=this.checkClassicItem(m.items,a,!1))-1;if(0<=b&&r(m.items[parseInt(a.toString(),10)]))if(0<=(b=this.checkClassicItem(m.items,b,!1))&&r(m.items[parseInt(b.toString(),10)])){if(0<=(y=0<=(y=b-1)?this.checkClassicItem(m.items,y,!1):y)&&r(m.items[parseInt(y.toString(),10)])?n(y,a):n(b,a),a=y,!d&&t.offsetWidth>c.offsetWidth)return!0}else a=b}}return!1},k.prototype.checkMediumToSmall=function(s,e,a,t,l,p){var c=this,o=(void 0===p&&(p=!1),e.groups[parseInt(a.toString(),10)]);if(!o.isCollapsed||p){var e=o.orientation,d=l.querySelector("#"+o.id).querySelectorAll(".e-ribbon-shrink"),i=function(e){return e.allowedSizes&R.RibbonItemSize.Small&&e.activeSize===R.RibbonItemSize.Medium},r=function(e,t,o,i){void 0===i&&(i=null);function r(e){var t;(e=n.items[parseInt(e.toString(),10)]).displayOptions&R.DisplayMode.Classic&&(t=l.querySelector("#"+e.id),e.setProperties({activeSize:R.RibbonItemSize.Small},!0),e.type===R.RibbonItemType.GroupButton&&(t=l.querySelector("#"+e.id+"_grpbtn")),c.setItemSize(t,e))}var n=c.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)].collections[parseInt(e.toString(),10)];r(t),i&&r(i),r(o)},n=function(e,t,o,i){void 0===i&&(i=null);function r(e){var t;(e=n.collections[parseInt(e.toString(),10)]).items[0].displayOptions&R.DisplayMode.Classic&&(t=l.querySelector("#"+e.items[0].id),e.items[0].setProperties({activeSize:R.RibbonItemSize.Small},!0),e.items[0].type===R.RibbonItemType.GroupButton&&(t=l.querySelector("#"+e.items[0].id+G)),c.setItemSize(t,e.items[0]))}var n=c.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)];p||d[parseInt(e.toString(),10)].setAttribute("data-medium-width",l.offsetWidth.toString());r(t),i&&r(i),r(o)},u=function(e){p||l.querySelector("#"+e).setAttribute("data-medium-width",l.offsetWidth.toString())};if(e===R.ItemOrientation.Column){if(0<d.length)for(var h=d.length-1;0<=h;h--){var b=parseInt(d[parseInt(h.toString(),10)].getAttribute("data-start"),10),m=parseInt(d[parseInt(h.toString(),10)].getAttribute("data-end"),10),y=this.checkClassicCollection(o.collections,b+1,!1);if(i(o.collections[parseInt(b.toString(),10)].items[0])&&i(o.collections[parseInt(y.toString(),10)].items[0])&&(m===y?n(h,b,m):i(o.collections[parseInt(m.toString(),10)].items[0])&&n(h,b,m,y),!p)&&t.offsetWidth>l.offsetWidth)return!0}for(h=o.collections.length-1;0<=h;h--){for(var f=o.collections[parseInt(h.toString(),10)],g=[],v=0;v<f.items.length;v++)f.items[parseInt(v.toString(),10)].displayOptions&R.DisplayMode.Classic&&g.push(v);if(1<g.length&&i(f.items[g[0]])&&i(f.items[g[1]])&&(2===g.length?(u(f.id),r(h,g[0],g[1])):i(f.items[g[2]])&&(u(f.id),r(h,g[0],g[2],g[1])),!p)&&t.offsetWidth>l.offsetWidth)return!0}}else if(this.checkValidCollectionLength(o.collections)){if(0<d.length)for(h=d.length-1;0<=h;h--){var S=d[parseInt(h.toString(),10)],b=parseInt(S.getAttribute("data-start"),10),m=parseInt(S.getAttribute("data-end"),10),f=o.collections[0],y=this.checkClassicItem(f.items,b+1,!1);if(i(o.collections[0].items[parseInt(b.toString(),10)])&&i(o.collections[0].items[parseInt(y.toString(),10)])&&(m===y?(u(S.id),r(0,b,m)):i(o.collections[0].items[parseInt(m.toString(),10)])&&(u(S.id),r(0,b,m,y)),!p)&&t.offsetWidth>l.offsetWidth)return!0}}else for(h=o.collections.length-1;0<=h;h--)for(y=(f=o.collections[parseInt(h.toString(),10)]).items.length-1;0<=y;y--)if(!((y=this.checkClassicItem(f.items,y,!1))<0)){var I=f.items[parseInt(y.toString(),10)];if(i(I)&&(I.type!==R.RibbonItemType.GroupButton?u(I.id):u(I.id+G),r(h,y,y),!p)&&t.offsetWidth>l.offsetWidth)return!0}}return!1},k.prototype.checkGroupExpanding=function(e,t,o,i){for(var r=!1,n=this.tabs[parseInt(e.toString(),10)],s=0;!r&&s<n.groups.length;s++)r=i?this.checkSmallToMedium(e,n,s,t,o,!1,!0):this.checkMediumToLarge(e,n,s,t,o,!1,!0);return r},k.prototype.checkSmallToMedium=function(r,e,n,t,s,o,i){function a(e,t,o){(e=c.tabs[parseInt(r.toString(),10)].groups[parseInt(n.toString(),10)].collections[parseInt(e.toString(),10)].items[parseInt(t.toString(),10)]).displayOptions&R.DisplayMode.Classic&&(t=o.id===e.id?o:o.querySelector("#"+e.id),e.setProperties({activeSize:R.RibbonItemSize.Medium},!0),e.type===R.RibbonItemType.GroupButton&&(t=document.querySelector("#"+e.id+G)),c.setItemSize(t,e))}function l(e){var t,o=c.tabs[parseInt(r.toString(),10)].groups[parseInt(n.toString(),10)].collections,i=o[parseInt(e.toString(),10)].items[0];i.displayOptions&R.DisplayMode.Classic&&(t=s.querySelector("#"+o[parseInt(e.toString(),10)].items[0].id),o[parseInt(e.toString(),10)].items[0].setProperties({activeSize:R.RibbonItemSize.Medium},!0),i.type===R.RibbonItemType.GroupButton&&(t=s.querySelector("#"+o[parseInt(e.toString(),10)].items[0].id+G)),c.setItemSize(t,o[parseInt(e.toString(),10)].items[0]))}var p,c=this,d=e.groups[parseInt(n.toString(),10)],u=d.orientation,h=s.querySelector("#"+d.id).querySelectorAll(".e-ribbon-shrink");if(u===R.ItemOrientation.Row){if(!this.checkValidCollectionLength(d.collections))for(var b=0;b<d.collections.length;b++)for(var m=d.collections[parseInt(b.toString(),10)],y=0;y<m.items.length;y++)if((y=this.checkClassicItem(m.items,y,!0))!==m.items.length){var f=m.items[parseInt(y.toString(),10)];if((p=f).allowedSizes&R.RibbonItemSize.Medium&&p.activeSize===R.RibbonItemSize.Small){var g=s.querySelector("#"+f.id);if((v=(C=(g="GroupButton"===f.type?s.querySelector("#"+f.id+G):g).getAttribute("data-medium-width"))?parseInt(C,10):null)&&(o||t.offsetWidth>v))a(b,y,g),o&&!i||g.removeAttribute("data-medium-width");else if(v)return!0}}}else for(b=0;b<d.collections.length;b++)if(1<d.collections[parseInt(b.toString(),10)].items.length){for(var m=d.collections[parseInt(b.toString(),10)],v=(C=(g=s.querySelector("#"+m.id)).getAttribute("data-medium-width"))?parseInt(C,10):null,S=[],I=0;I<m.items.length;I++)m.items[parseInt(I.toString(),10)].displayOptions&R.DisplayMode.Classic&&S.push(I);if(1<S.length&&v&&(o||t.offsetWidth>v))a(b,S[0],g),a(b,S[1],g),3===S.length&&a(b,S[2],g),o&&!i||g.removeAttribute("data-medium-width");else if(v)return!0}if(0<h.length)for(b=0;b<h.length;b++){var C,w=h[parseInt(b.toString(),10)];if((v=(C=w.getAttribute("data-medium-width"))?parseInt(C,10):null)&&(o||t.offsetWidth>v)){var T,k=parseInt(w.getAttribute("data-start"),10),O=parseInt(w.getAttribute("data-end"),10);u===R.ItemOrientation.Row?(m=d.collections[0],y=this.checkClassicItem(m.items,k+1,!0),a(0,k,w),a(0,y,w),y!==O&&a(0,O,w)):(T=this.checkClassicCollection(d.collections,k+1,!0),l(k),l(T),T!==O&&l(O)),o&&!i||w.removeAttribute("data-medium-width")}else if(v)return!0}return!1},k.prototype.checkMediumToLarge=function(s,e,a,t,o,l,p){var c=this,i=e.groups[parseInt(a.toString(),10)],r=i.orientation,n=o.querySelector("#"+i.id).querySelectorAll(".e-ribbon-shrink");if(0!==n.length)for(var d=function(e,t,i,o){function r(e){var t,o;(e=n[parseInt(e.toString(),10)]).displayOptions&R.DisplayMode.Classic&&(o=(t=i.querySelector("#"+e.id+j)).querySelector("#"+e.id),e.setProperties({activeSize:R.RibbonItemSize.Large},!0),e.type===R.RibbonItemType.GroupButton&&(o=t.querySelector("#"+e.id+G)),c.setItemSize(o,e),i.insertAdjacentElement("beforebegin",t))}var n=c.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)].collections[0].items;r(e),o&&r(o),r(t),l&&!p||x.remove(i)},u=function(e,t,i,o){function r(e){var t,o;(e=n[parseInt(e.toString(),10)]).items[0].displayOptions&R.DisplayMode.Classic&&(o=(t=i.querySelector("#"+e.id)).querySelector("#"+e.items[0].id),e.items[0].setProperties({activeSize:R.RibbonItemSize.Large},!0),e.items[0].type===R.RibbonItemType.GroupButton&&(o=t.querySelector("#"+e.items[0].id+G)),c.setItemSize(o,e.items[0]),i.insertAdjacentElement("beforebegin",t))}var n=c.tabs[parseInt(s.toString(),10)].groups[parseInt(a.toString(),10)].collections;r(e),o&&r(o),r(t),l&&!p||x.remove(i)},h=0;h<n.length;h++){var b=n[parseInt(h.toString(),10)],m=b.getAttribute("data-large-width"),m=m?parseInt(m,10):null;if(m&&(l||t.offsetWidth>m)){var y,f=parseInt(b.getAttribute("data-start"),10),g=parseInt(b.getAttribute("data-end"),10);r===R.ItemOrientation.Row?(y=i.collections[0],(y=this.checkClassicItem(y.items,f+1,!0))===g?d(f,g,b):d(f,g,b,y)):(y=this.checkClassicCollection(i.collections,f+1,!0))===g?u(f,g,b):u(f,g,b,y),l&&!p||b.removeAttribute("data-large-width")}else if(m)return!0}return!1},k.prototype.handleContentSize=function(e,t){e=e.closest("."+At);t?e.classList.add(Qt):e.classList.remove(Qt)},k.prototype.setItemSize=function(e,t){var o;e&&(o=e.closest("."+Ut),t.type===R.RibbonItemType.Button?this.ribbonButtonModule.updateButtonSize(e,t):t.type===R.RibbonItemType.DropDown?this.ribbonDropDownModule.updateDropDownSize(e,t):t.type===R.RibbonItemType.SplitButton?this.ribbonSplitButtonModule.updateSplitButtonSize(e,t):t.type===R.RibbonItemType.Template?(x.remove(e),this.createTemplateContent(t,o)):t.type===R.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.updateGroupButtonSize(e,t),o.classList.remove(Qt,Yt,Zt,Jt),t.activeSize===R.RibbonItemSize.Large?o.classList.add(Yt,Qt):o.classList.add(t.activeSize===R.RibbonItemSize.Medium?Zt:Jt))},k.prototype.createOverflowDropdown=function(b,m,y){var f=this.getGroupResizeOrder(!0,b);if(0!==f.length)for(var g=this,e=0;e<f.length&&m.offsetWidth<y.offsetWidth;e++)!function(e){var t=f[parseInt(e.toString(),10)],e=g.tabObj.element.querySelector("#"+t.id),o=(e.setAttribute("data-expanded-width",y.offsetWidth.toString()),e.querySelector("#"+t.id+j)),i=g.createElement("div",{className:zt+v+Yt,id:t.id+w+j}),e=(e.insertBefore(i,o),S(g.tabs[parseInt(b.toString(),10)].groups,function(e){return e.id===t.id})),r=g.tabs[parseInt(b.toString(),10)],n=(g.checkSmallToMedium(b,r,e,m,y,!0,!1),g.checkMediumToLarge(b,r,e,m,y,!0,!1),g.ribbonDropDownModule.createOverFlowDropDown(t.id,t.header,t.groupIconCss,o,i,g.enableRtl));t.keyTip&&(u=t.id+w+ko,g.addKeyTip(b,t.keyTip,u,"grpoverflow")),g.tabs[parseInt(b.toString(),10)].groups[parseInt(e.toString(),10)].setProperties({isCollapsed:!0},!0);for(var s=0;s<t.collections.length;s++)for(var a=t.collections[parseInt(s.toString(),10)],l=o.querySelector("#"+a.id),p=0;p<a.items.length;p++){var c=a.items[parseInt(p.toString(),10)],d=l.querySelector("#"+c.id+j),u=(null!==d&&(g.handleContentSize(d),g.addOverflowEvents(c,d,n)),document.querySelector("#"+t.id+w+ko)),d=x.getInstance(u,M.DropDownButton);if(d){d=d.target;if(d&&g.keyTipElements[parseInt(b.toString(),10)]){if(c.type===R.RibbonItemType.GroupButton)for(var h=0;h<c.groupButtonSettings.items.length;h++)c.groupButtonSettings.items[parseInt(h.toString(),10)].keyTip&&g.addKeyTip(b,c.groupButtonSettings.items[parseInt(h.toString(),10)].keyTip,c.id+G+h,"grpoverflowpopup");c.keyTip&&g.addKeyTip(b,c.keyTip,c.id,"grpoverflowpopup")}}}}(e)},k.prototype.removeOverflowDropdown=function(c,d,u,h){void 0===u&&(u=!1);var b=this.getGroupResizeOrder(!1,h);if(0!==b.length)for(var m=this,e=0;e<b.length;e++){var t=function(e){var t=b[parseInt(e.toString(),10)],o=m.tabObj.element.querySelector("#"+t.id);if(!o)return"break";e=parseInt(o.getAttribute("data-expanded-width"),10);if(!u&&c.offsetWidth<e)return{value:!0};m.removeDropdown(t.id);var e=S(m.tabs[parseInt(h.toString(),10)].groups,function(e){return e.id===t.id}),i=(m.tabs[parseInt(h.toString(),10)].groups[parseInt(e.toString(),10)].setProperties({isCollapsed:!1},!0),m.tabs[parseInt(h.toString(),10)]);m.checkLargeToMedium(h,i,e,c,d,!0),m.checkMediumToSmall(h,i,e,c,d,!0);for(var r=0;r<t.collections.length;r++)for(var n=t.collections[parseInt(r.toString(),10)],s=o.querySelector("#"+n.id),a=0;a<n.items.length;a++){var l=n.items[parseInt(a.toString(),10)],p=s.querySelector("#"+l.id+j);null!==p&&(m.handleContentSize(p,!0),m.removeOverflowEvent(l,p))}}(e);if("object"==typeof t)return t.value;if("break"===t)break}return!1},k.prototype.removeDropdown=function(e){var t,e=this.tabObj.element.querySelector("#"+e+w+ko);e&&(t=e.parentElement,this.ribbonDropDownModule.removeOverFlowDropDown(e),x.remove(t))},k.prototype.getGroupResizeOrder=function(t,e){var o=this,e=this.tabs[parseInt(e.toString(),10)].groups;return(e=e.filter(function(e){return"Classic"!==o.activeLayout||(x.isUndefined(e.isCollapsible)||e.isCollapsible)&&(t&&x.isUndefined(e.isCollapsed)||!x.isUndefined(e.isCollapsed)&&t!==e.isCollapsed)})).sort(function(e,t){return e.priority-t.priority}),t?e.reverse():e},k.prototype.destroyScroll=function(){this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null)},k.prototype.clearOverflowDropDown=function(e){var t,o=this.tabObj.element.querySelector("#"+this.tabs[parseInt(e.toString(),10)].id+A);o&&(t=o.closest("."+Ot),"Simplified"===this.activeLayout?this.removeSimplfiedOverflow(o,t,e,!0):this.removeOverflowDropdown(o,t,!0,e))},k.prototype.isContextualTab=function(e){var t=!1;if(this.contextualTabs.length)for(var o=0;o<this.contextualTabs.length;o++)for(var i=0;i<this.contextualTabs[parseInt(o.toString(),10)].tabs.length;i++)if(this.contextualTabs[parseInt(o.toString(),10)].tabs[parseInt(i.toString(),10)].id===e){t=!0;break}return t},k.prototype.ribbonTabSelecting=function(e){var o=this,t=(this.currentControlIndex=0,e.selectingItem?e.selectingItem.getAttribute("data-id"):null),i=e.previousItem.getAttribute("data-id"),r=S(this.tabs,function(e){return e.id===t}),n=this.isContextualTab(t),s=S(this.tabs,function(e){return e.id===i}),r=-1===r?this.selectedTab:r,e={cancel:e.cancel,isInteracted:e.isInteracted,previousIndex:s,selectedIndex:r,isContextual:n};this.trigger("tabSelecting",e,function(e){var t;e.cancel||(o.destroyScroll(),o.isAddRemove||-1===s||o.clearOverflowDropDown(s),(e=o.tabObj.items[parseInt(r.toString(),10)].content).querySelector("."+Lt))||0===o.tabs[parseInt(r.toString(),10)].groups.length||(t=o.createGroups(o.tabs[parseInt(r.toString(),10)].groups,r),x.append(t,e))})},k.prototype.createTabItems=function(i){for(var r=this,n=[],s=this,e=0;e<i.length;e++)!function(e){var t=i[parseInt(e.toString(),10)],e=s.createElement("span",{innerHTML:t.header,id:t.id+q}),o=S(s.tabs,function(e){return e.id===t.id}),o=(t.keyTip&&(s.keyTipElements[parseInt(o.toString(),10)]||(s.keyTipElements[parseInt(o.toString(),10)]={}),s.addKeyTip(o,t.keyTip,t.id,"tab")),e.onclick=function(){r.minimize(!1)},e.ondblclick=function(){r.minimize(!0)},{header:{text:e},id:t.id,cssClass:t.cssClass}),e=s.createElement("div",{className:o.cssClass,id:t.id+A});e.classList.add(gt),o.content=e,n.push(o)}(e);return n},k.prototype.renderInitialTab=function(e){var t=this.createGroups(this.tabs[parseInt(e.toString(),10)].groups,e),e=this.tabObj.items[parseInt(e.toString(),10)].content,t=(x.append(t,e),"Simplified"===this.activeLayout&&this.element.classList.add(po),this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A));this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(t),this.checkOverflow(this.selectedTab,t)},k.prototype.addOverflowButton=function(e,t){var o,r=this,i=this.createElement("button",{id:e}),n=this.createElement("div",{className:Tt,attrs:{tabindex:"0"}}),s=this.cssClass?v+this.cssClass:"",s=new M.DropDownButton({iconCss:rt,cssClass:$t+v+Nt+s,target:n,locale:this.locale,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence,beforeOpen:function(t){var e={element:t.element,event:t.event,cancel:t.cancel};r.trigger("overflowPopupOpen",e,function(e){e.cancel&&(t.cancel=!0)})},beforeClose:function(t){var o=t.event?x.closest(t.event.target,"."+ct):null,i=t.event?x.closest(t.event.target,".e-ribbon-group-button-overflow-popup"):null,e={element:t.element,event:t.event,cancel:t.cancel};r.trigger("overflowPopupClose",e,function(e){(o||e.cancel||i)&&(t.element=null,t.cancel=!0)})}},i);return this.element.classList.add(kt),ei(n,this),t||(this.keyTipElements.overflowbtn=[],this.keyTipElements.overflowbtn.push({id:e,type:"overflowbtn",keyTip:"00"})),i.onkeydown=i.onclick=function(){r.itemIndex=-1,o=!i.classList.contains("e-ribbon-overall-of-btn")},n.onkeydown=function(e){return r.upDownKeyHandler(e,n,o),r},s},k.prototype.upDownKeyHandler=function(e,t,o){var i,r=(o=(o?t:t.querySelector(".e-ribbon-of-tab.e-ribbon-active")).getElementsByClassName("e-ribbon-item"))[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-control"),r=r&&r.classList.contains("e-combobox")?o[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-combobox"):null,n=((null===r||"Tab"===e.key||this.itemIndex<0)&&("ArrowDown"===e.key||!e.shiftKey&&"Tab"===e.key?(!this.itemIndex&&0!==this.itemIndex||this.itemIndex<0||this.itemIndex===o.length-1?(this.itemIndex=0,n=o[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(n,o,!0),r&&"Tab"===e.key&&(e.preventDefault(),s=o[this.itemIndex].querySelector(".e-control"))&&s.focus(),i=o[this.itemIndex].querySelector(".e-ribbon-template")):this.itemIndex<o.length-1&&0<=this.itemIndex&&(this.itemIndex++,n=o[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(n,o,!0),i=o[this.itemIndex].querySelector(".e-ribbon-template")),i&&i.focus()):!("ArrowUp"===e.key||e.shiftKey&&"Tab"===e.key)||null!==r&&"Tab"!==e.key||(this.itemIndex&&-1!==this.itemIndex?this.itemIndex<=o.length-1&&0<this.itemIndex&&(this.itemIndex--,n=o[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(n,o,!1),i=o[this.itemIndex].querySelector(".e-ribbon-template")):(this.itemIndex=o.length-1,n=o[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(n,o,!1),r&&e.shiftKey&&"Tab"===e.key&&(e.preventDefault(),s=o[this.itemIndex].querySelector(".e-control"))&&s.focus(),i=o[this.itemIndex].querySelector(".e-ribbon-template")),i&&i.focus()),t.setAttribute("index",this.itemIndex.toString())),parseInt(t.getAttribute("index"),10)),r="",s=o[parseInt(n.toString(),10)]?o[parseInt(n.toString(),10)].querySelector(".e-control"):null;s&&(r=s.getAttribute("data-control")),"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&" "!==e.key&&"Tab"!==e.key||("ColorPicker"===r?("Tab"===e.key&&e.preventDefault(),o[parseInt(n.toString(),10)].querySelector(".e-split-colorpicker").focus()):("Tab"===e.key&&e.preventDefault(),(i=o[parseInt(n.toString(),10)].querySelector(".e-control"))&&i.focus())," "===e.key&&"CheckBox"===r&&(t=o[parseInt(n.toString(),10)].querySelector(".e-control"),s=x.getComponent(t,u.CheckBox),this.itemIndex=-1,s.click())),"SplitButton"!==r||"ArrowRight"!==e.key&&"ArrowLeft"!==e.key||("ArrowRight"===e.key&&(this.enableRtl?o[parseInt(n.toString(),10)].querySelector(".e-control"):o[parseInt(n.toString(),10)].querySelector(".e-dropdown-btn")).focus(),"ArrowLeft"===e.key&&(this.enableRtl?o[parseInt(n.toString(),10)].querySelector(".e-dropdown-btn"):o[parseInt(n.toString(),10)].querySelector(".e-control")).focus()),"Enter"===e.key&&(this.itemIndex=-1)},k.prototype.findDisabledItem=function(e,t,o){for(;e&&e.classList.contains("e-disabled");)o?this.itemIndex===t.length-1&&t[this.itemIndex].closest(".e-ribbon-item").classList.contains("e-disabled")&&(this.itemIndex=-1):0===this.itemIndex&&t[this.itemIndex].closest(".e-ribbon-item").classList.contains("e-disabled")&&(this.itemIndex=t.length),o?this.itemIndex++:this.itemIndex--,e=t[this.itemIndex].closest(".e-ribbon-item")},k.prototype.removeOverflowButton=function(e){var t;e&&(t=e.element,ti(e.target),e.destroy(),t.remove())},k.prototype.removeOverflowEvent=function(e,t){if(t)switch(e.type){case"Button":this.ribbonButtonModule.removeOverFlowEvents(e,t);break;case"DropDown":this.ribbonDropDownModule.removeOverFlowEvents(e,t);break;case"SplitButton":this.ribbonSplitButtonModule.removeOverFlowEvents(e,t);break;case"CheckBox":this.ribbonCheckBoxModule.removeOverFlowEvents(e,t);break;case"ColorPicker":this.ribbonColorPickerModule.removeOverFlowEvents(e,t);break;case"ComboBox":this.ribbonComboBoxModule.removeOverFlowEvents(e,t);break;case"Gallery":this.ribbonGalleryModule.removeOverFlowEvents(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.removeOverFlowEvents(e,t)}},k.prototype.createGroupContainer=function(e,t){var o=this.createElement("div",{className:qt,id:e+j}),e=this.createElement("div",{className:Gt,id:e+q,innerHTML:t});return o.append(e),o},k.prototype.addExpandCollapse=function(){var t=this;this.collapseButton=this.createElement("span",{className:vt+v+ot,id:this.tabObj.element.id+Co,attrs:{tabindex:"0",type:"button","aria-label":"Layout Switcher",role:"button"}}),this.collapseButton.onclick=function(e){t.toggleLayout(e)},this.collapseButton.onkeydown=function(e){"Enter"===e.key&&t.toggleLayout(e)},this.element.classList.add(It),"Simplified"===this.activeLayout&&this.collapseButton.classList.add(St),this.tabObj.element.appendChild(this.collapseButton),this.layoutSwitcherKeyTip&&(this.keyTipElements.collapse=[],this.keyTipElements.collapse.push({id:this.collapseButton.id,type:"collapse",keyTip:this.layoutSwitcherKeyTip}))},k.prototype.removeExpandCollapse=function(){var t=this,e=S(this.tooltipData,function(e){return e.id===t.collapseButton.id});-1!==e&&this.tooltipData.splice(e,1),this.element.classList.remove(It),x.remove(this.tabObj.element.querySelector("."+vt)),this.collapseButton=null},k.prototype.reRenderTabs=function(e){this.destroyScroll(),this.checkID(this.tabs,"tab",this.element.id);for(var t=0,o=Object.keys(e);t<o.length;t++){for(var i=o[t],r=parseInt(i,10),i=e[parseInt(r.toString(),10)],n=!1,s=0;s<this.tabObj.items.length;s++)if(this.tabs[parseInt(r.toString(),10)].id===this.tabObj.items[parseInt(s.toString(),10)].id){n=!0;break}if(!n){this.destroyTabItems(this.tabsInternal),this.tabsInternal=this.tabs.slice(),this.validateItemSize();var a=this.createTabItems(this.tabs);this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:a,selectedItem:this.selectedTab});break}var l=this.tabs[parseInt(r.toString(),10)].groups,p=this.tabObj.element,c=this.tabs[parseInt(r.toString(),10)],d=(c.setProperties(i,!0),this.setProperties({groups:this.checkID(c.groups,"group",c.id)},!0),this.validateItemSize(),this.tabObj.items[parseInt(r.toString(),10)].content);if(l&&(i.header&&(this.tabObj.items[parseInt(r.toString(),10)].header.text.innerText=c.header),i.cssClass&&(this.tabObj.items[parseInt(r.toString(),10)].cssClass&&(d.classList.remove(this.tabObj.items[parseInt(r.toString(),10)].cssClass),p.querySelector(".e-active").classList.remove(this.tabObj.items[parseInt(r.toString(),10)].cssClass)),d.classList.add(c.cssClass),p.querySelector(".e-active").classList.add(c.cssClass)),i.groups)){for(var u=0,h=l;u<h.length;u++){for(var b=h[u],m=b.isCollapsed?d.querySelector("#"+b.id+w+ko):null,y=0,f=b.collections;y<f.length;y++)for(var g=0,v=f[y].items;g<v.length;g++){var S=v[g],I=m?this.ribbonDropDownModule.getDDBItemElement(m,S.id):d.querySelector("#"+S.id);I&&this.destroyFunction(S,I)}m&&this.ribbonDropDownModule.removeOverFlowDropDown(m)}d.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()});p=this.createGroups(c.groups,r);x.append(p,d)}}this.tabsInternal!==this.tabs&&(this.tabsInternal=this.tabs,a=this.createTabItems(this.tabs),this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:a,selectedItem:this.selectedTab}));var C=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A);this.checkOverflow(this.selectedTab,C)},k.prototype.switchLayout=function(){this.currentControlIndex=0,this.destroyScroll(),this.collapseButton.classList.toggle(St,"Simplified"===this.activeLayout),this.element.classList.toggle(po,"Simplified"===this.activeLayout);for(var e=0;e<=this.tabs.length-1;e++){var t=e;if(""!==this.tabObj.items[parseInt(t.toString(),10)].content.innerHTML){var o=this.tabs[parseInt(t.toString(),10)],i=this.tabs[parseInt(t.toString(),10)].groups,r=this.tabObj.element.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+A),n=r.closest("."+Ot);if("Simplified"===this.activeLayout)for(var s=0;s<i.length;s++){for(var a=i[parseInt(s.toString(),10)],l=i[parseInt(s.toString(),10)].orientation,p=(a.isCollapsed?(a.setProperties({isCollapsed:!1},!0),this.removeDropdown(a.id)):(this.checkSmallToMedium(t,o,s,n,r,!0,!1),this.checkMediumToLarge(t,o,s,n,r,!0,!1)),n.querySelector("#"+a.id)),c=(w=p.querySelector("#"+a.id+j)).querySelectorAll(".e-ribbon-shrink"),d=0;d<c.length;d++)c[parseInt(d.toString(),10)].remove();(k=w.querySelector("#"+a.id+q)).remove(),(T=w.querySelector("#"+a.id+A)).classList.replace(Vt,Xt),T.classList.remove(Qt);for(var u=0;u<a.collections.length;u++){var h=a.collections[parseInt(u.toString(),10)];(P=w.querySelector("#"+h.id)).classList.replace(Vt,Xt);for(var b=0;b<h.items.length;b++){for(var m=h.items,y=h.items[parseInt(b.toString(),10)],f=!0;f&&y.displayOptions===R.DisplayMode.Classic;){b++;var g=w.querySelector("#"+y.id+j),v=g.querySelector("#"+y.id);this.destroyFunction(y,v),g.remove(),b<m.length?y=m[parseInt(b.toString(),10)]:f=!1}if(!f)break;var S=y.allowedSizes===R.RibbonItemSize.Large||y.allowedSizes&R.RibbonItemSize.Medium?R.RibbonItemSize.Medium:R.RibbonItemSize.Small,S=!(y.displayOptions&R.DisplayMode.Simplified)&&y.displayOptions&R.DisplayMode.Overflow?R.RibbonItemSize.Medium:S,I=void 0;y.displayOptions&R.DisplayMode.Classic?(I=w.querySelector("#"+y.id+j),y.displayOptions===(R.DisplayMode.Classic|R.DisplayMode.Overflow)&&(this.createOverflowPopup(y,t,a.enableGroupOverflow,a.id,a.header,I,w),y.type!==R.RibbonItemType.DropDown&&y.type!==R.RibbonItemType.SplitButton&&y.type!==R.RibbonItemType.GroupButton&&y.type!==R.RibbonItemType.Gallery||this.updatePopupItems(y,I,a.enableGroupOverflow,!0)),y.type===R.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(y,I),y.setProperties({activeSize:S},!0),I&&(v=I.querySelector("#"+y.id),this.setItemSize(v,y))):(I=this.createItems([y],l,a.id,a.header,a.enableGroupOverflow,t,w)[0],y.displayOptions&R.DisplayMode.Simplified&&P.append(I)),y.type===R.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,y.id)}}a.enableGroupOverflow||p.querySelector("."+Ut)||p.classList.add("e-ribbon-emptyCollection")}else{this.element.classList.remove(kt);for(var C=0;C<i.length;C++){var w,a=i[parseInt(C.toString(),10)],l=i[parseInt(C.toString(),10)].orientation,T=(w=n.querySelector("#"+a.id+j)).querySelector("#"+a.id+A),k=this.createElement("div",{className:jt,id:a.id+q,innerHTML:a.header});w.appendChild(k),"Row"===l&&T.classList.replace(Xt,Vt),T.classList.add(Qt);for(u=0;u<a.collections.length;u++){var O,B=void 0,L=void 0,h=(a.enableGroupOverflow?(O=w.querySelector("#"+a.id+_))&&(L=(B=x.getInstance(O,M.DropDownButton)).target):(B=this.overflowDDB)&&(L=this.overflowDDB.target),a.collections[parseInt(u.toString(),10)]),P=w.querySelector("#"+h.id);"Column"===l&&P.classList.replace(Xt,Vt);for(b=0;b<h.items.length;b++){for(m=h.items,y=h.items[parseInt(b.toString(),10)],f=!0;f&&!(y.displayOptions&R.DisplayMode.Classic);){b++;var E,I=void 0;(y.displayOptions&R.DisplayMode.Simplified||y.displayOptions&R.DisplayMode.Overflow)&&null!==(I=(y.displayOptions&R.DisplayMode.Simplified?w:L).querySelector("#"+y.id+j))&&(E=I.querySelector("#"+y.id),this.destroyFunction(y,E),I.remove()),b<m.length?y=m[parseInt(b.toString(),10)]:f=!1}if(!f)break;y.displayOptions&(R.DisplayMode.Simplified|R.DisplayMode.Overflow)?(!(I=w.querySelector("#"+y.id+j))&&L&&(I=L.querySelector("#"+y.id+j),y.type!==R.RibbonItemType.DropDown&&y.type!==R.RibbonItemType.SplitButton&&y.type!==R.RibbonItemType.GroupButton&&y.type!==R.RibbonItemType.Gallery||this.updatePopupItems(y,I,a.enableGroupOverflow,!1),this.removeOverflowEvent(y,I)),y.type===R.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(y,I),I&&P.append(I)):(I=this.createItems([y],l,a.id,a.header,a.enableGroupOverflow,t)[0],P.append(I));var v=w.querySelector("#"+y.id),D=(y.type===R.RibbonItemType.GroupButton&&(v=w.querySelector("#"+y.id+G)),y.allowedSizes&R.RibbonItemSize.Large?R.RibbonItemSize.Large:y.allowedSizes&R.RibbonItemSize.Medium?R.RibbonItemSize.Medium:R.RibbonItemSize.Small);y.setProperties({activeSize:D},!0),this.setItemSize(v,y),y.type===R.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,y.id)}a.enableGroupOverflow&&B&&(0===L.childElementCount||1===L.childElementCount&&this.isHeaderVisible(L,a.id))&&this.removeOverflowButton(B)}}}this.selectedTab===t&&this.checkOverflow(t,r)}}"Classic"===this.activeLayout&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},k.prototype.createLauncherIcon=function(t,e,o){var i=this,r=this.createElement("div",{className:Wt+" "+(this.launcherIconCss||Ft),id:t+To,attrs:{tabindex:"0",type:"button","aria-label":"Launcher Icon",role:"button"}}),e=(e.appendChild(r),e.classList.add(Ht),x.EventHandler.add(r,"click",this.launcherIconClicked.bind(this,t),this),x.EventHandler.add(r,"keydown",function(e){"Enter"===e.key&&i.launcherIconClicked(t)},this),Xo(this.tabs,t));e.group.launcherIconKeyTip&&this.addKeyTip(o,e.group.launcherIconKeyTip,r.id,"launcher")},k.prototype.launcherIconClicked=function(e){this.trigger("launcherIconClick",{groupId:e})},k.prototype.createGroups=function(e,t){for(var o=[],i=0;i<e.length;i++){for(var r=e[parseInt(i.toString(),10)],n=r.orientation,s=this.createElement("div",{className:r.cssClass,id:r.id}),a=(s.classList.add(Lt),o.push(s),this.createElement("div",{className:r.cssClass,id:r.id+j})),l=(a.classList.add(Mt),s.appendChild(a),this.createElement("div",{className:"Simplified"===this.activeLayout?At:At+v+Qt,id:r.id+A})),p=(l.classList.add("Column"===n||"Simplified"===this.activeLayout?Xt:Vt),a.appendChild(l),"Classic"===this.activeLayout&&(n=this.createElement("div",{className:jt,id:r.id+q,innerHTML:r.header}),a.appendChild(n)),r.showLauncherIcon&&this.createLauncherIcon(r.id,a,t),this.createCollection(r.collections,r.orientation,r.id,r.header,r.enableGroupOverflow,t,a)),c=(x.append(p,l),!0),d=0;d<p.length;d++)if(c)for(var u=0;u<p[parseInt(d.toString(),10)].children.length;u++)if(!p[parseInt(d.toString(),10)].children[parseInt(u.toString(),10)].classList.contains("e-hidden")){c=!1;break}c&&s.classList.add("e-hide-group"),"Simplified"!==this.activeLayout||r.enableGroupOverflow||s.querySelector("."+Ut)||s.classList.add("e-ribbon-emptyCollection");n=this.initialPropsData[parseInt(t.toString(),10)];n&&(n.hiddenGroups&&n.hiddenGroups.length&&this.updateGroupProps("hiddenGroups",n,s),n.disabledGroups)&&n.disabledGroups.length&&this.updateGroupProps("disabledGroups",n,s)}return this.initialPropsData[parseInt(t.toString(),10)]&&delete this.initialPropsData[parseInt(t.toString(),10)],o},k.prototype.updateGroupProps=function(e,t,o){-1!==t[e].indexOf(o.id)&&("hiddenGroups"===e?o.classList.add("e-hidden"):o.classList.add("e-disabled"))},k.prototype.validateItemSize=function(){for(var e=0;e<this.tabs.length;e++)for(var t=this.tabs[parseInt(e.toString(),10)].groups,o=0;o<t.length;o++)for(var i=t[parseInt(o.toString(),10)].collections,r=t[parseInt(o.toString(),10)].orientation,n=0;n<i.length;n++)for(var s=i[parseInt(n.toString(),10)].items,a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)],p=(l.allowedSizes&&0!==l.allowedSizes||l.setProperties({allowedSizes:R.RibbonItemSize.Small|R.RibbonItemSize.Medium|R.RibbonItemSize.Large},!0),"ColorPicker"===l.type&&l.allowedSizes!==R.RibbonItemSize.Small?l.setProperties({allowedSizes:R.RibbonItemSize.Small},!0):"ComboBox"!==l.type&&"CheckBox"!==l.type||l.allowedSizes===R.RibbonItemSize.Medium?("Column"===r&&1<s.length||"Row"===r&&1<i.length)&&l.allowedSizes&R.RibbonItemSize.Large&&(p=(p=l.allowedSizes&(R.RibbonItemSize.Small|R.RibbonItemSize.Medium))||R.RibbonItemSize.Medium,l.setProperties({allowedSizes:p},!0)):l.setProperties({allowedSizes:R.RibbonItemSize.Medium},!0),l.allowedSizes&R.RibbonItemSize.Large?R.RibbonItemSize.Large:l.allowedSizes&R.RibbonItemSize.Medium?R.RibbonItemSize.Medium:R.RibbonItemSize.Small);l.setProperties({activeSize:p},!0)}},k.prototype.createCollection=function(e,t,o,i,r,n,s){for(var a=[],l=0;l<e.length;l++){var p=e[parseInt(l.toString(),10)],c=this.createElement("div",{className:p.cssClass,id:p.id}),p=(c.classList.add(Kt),c.classList.add("Column"!==t||"Simplified"===this.activeLayout?Xt:Vt),a.push(c),this.createItems(p.items,t,o,i,r,n,s));if(x.append(p,c),"Row"===t&&2===l)break}return a},k.prototype.createRibbonItem=function(e,t){switch(e.type){case"Button":this.ribbonButtonModule.createButton(e,t);break;case"DropDown":this.ribbonDropDownModule.createDropDown(e,t);break;case"SplitButton":this.ribbonSplitButtonModule.createSplitButton(e,t);break;case"CheckBox":this.ribbonCheckBoxModule.createCheckBox(e,t);break;case"ColorPicker":this.ribbonColorPickerModule.createColorPicker(e,t);break;case"ComboBox":this.ribbonComboBoxModule.createComboBox(e,t);break;case"Template":this.createTemplateContent(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.createGroupButton(e,t);break;case"Gallery":this.ribbonGalleryModule.createGallery(e,t)}},k.prototype.createItems=function(e,t,o,i,r,n,s){for(var a=[],l=0;l<e.length;l++){for(var p=e[parseInt(l.toString(),10)],c=!0;c&&("Simplified"===this.activeLayout&&!(p.displayOptions&(R.DisplayMode.Simplified|R.DisplayMode.Overflow))||"Classic"===this.activeLayout&&!(p.displayOptions&R.DisplayMode.Classic));)++l<e.length?p=e[parseInt(l.toString(),10)]:c=!1;if(!c)break;var d=this.createElement("div",{className:p.cssClass,id:p.id+j});if((h=d.classList).add.apply(h,[Ut].concat(p.disabled?[st]:[])),p.ribbonTooltipSettings&&Qo(p.ribbonTooltipSettings)&&(d.classList.add(io),this.tooltipData.push({id:d.id,data:p.ribbonTooltipSettings})),p.type===R.RibbonItemType.GroupButton)for(var u=0;u<p.groupButtonSettings.items.length;u++)this.keyTipElements[parseInt(n.toString(),10)]&&p.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip&&this.addKeyTip(n,p.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip,p.id+G+u,"item");p.keyTip&&(p.type===R.RibbonItemType.Gallery?this.addKeyTip(n,p.keyTip,p.id+"_popupButton","item"):this.addKeyTip(n,p.keyTip,p.id,"item"));var h=p.activeSize,h=(p.type!==R.RibbonItemType.Gallery&&("Simplified"===this.activeLayout&&(h=p.allowedSizes===R.RibbonItemSize.Large||p.allowedSizes&R.RibbonItemSize.Medium||p.displayOptions===R.DisplayMode.Overflow?R.RibbonItemSize.Medium:R.RibbonItemSize.Small,p.setProperties({activeSize:h},!0)),h&R.RibbonItemSize.Large?d.classList.add(Yt,Qt):d.classList.add(h&R.RibbonItemSize.Medium?Zt:Jt)),this.initialPropsData[parseInt(n.toString(),10)]);if(h&&h.hiddenItems&&h.hiddenItems.length&&-1!==h.hiddenItems.indexOf(p.id)&&d.classList.add("e-hidden"),this.createRibbonItem(p,d),"Simplified"!==this.activeLayout||p.displayOptions!==R.DisplayMode.Overflow&&p.displayOptions!==(R.DisplayMode.Classic|R.DisplayMode.Overflow)?a.push(d):(this.createOverflowPopup(p,n,r,o,i,d,s),p.type!==R.RibbonItemType.DropDown&&p.type!==R.RibbonItemType.SplitButton&&p.type!==R.RibbonItemType.GroupButton&&p.type!==R.RibbonItemType.Gallery||this.updatePopupItems(p,d,r,!0)),"Column"===t&&2===l)break}return a},k.prototype.createHelpPaneTemplate=function(){var e,t;this.helpPaneTemplate&&(this.clearTemplate([e="helpPaneTemplate"]),this.ribbonTempEle=this.createElement("div",{className:to,id:this.element.id+Ro}),t=Uo(this.helpPaneTemplate),x.append(t({},this,e,"helpPaneTemplate",this.isStringTemplate),this.ribbonTempEle),(t=this.tabObj.element).querySelector(".e-toolbar").after(this.ribbonTempEle),t.style.setProperty(_o,this.ribbonTempEle.offsetWidth+"px"),this.renderReactTemplates())},k.prototype.createTemplateContent=function(e,t){var o=this.createElement("div",{className:e.cssClass?eo+v+e.cssClass:eo,id:e.id,attrs:{tabindex:"-1"}});e.disabled&&(o.classList.add(st),o.setAttribute("disabled","")),t.appendChild(o),this.renderItemTemplate(e,o)},k.prototype.renderItemTemplate=function(e,t){var o="ribbon"+e.id+"itemTemplate",i=(this.clearTemplate([o]),Uo(e.itemTemplate));x.append(i({activeSize:R.RibbonItemSize[e.activeSize]},this,o,e.id+"itemTemplate",this.isStringTemplate),t),this.renderReactTemplates()},k.prototype.checkID=function(e,t,o){for(var i="tab"===t?So:"group"===t?"_group":"collection"===t?Io:"_item",r=0;r<e.length;r++){var n,s=e[parseInt(r.toString(),10)];switch(s.id||(n=void 0,"item"===t&&(n=this.hasHtmlAtrrID(s)),s.setProperties({id:n||o+i+this.idIndex++},!0)),t){case"tab":s.setProperties({groups:this.checkID(s.groups,"group",s.id)},!0);break;case"group":s.setProperties({collections:this.checkID(s.collections,"collection",s.id)},!0);break;case"collection":s.setProperties({items:this.checkID(s.items,"item",s.id)},!0)}}return e},k.prototype.hasHtmlAtrrID=function(e){var t="";return e.buttonSettings.htmlAttributes.id?t=e.buttonSettings.htmlAttributes.id:e.checkBoxSettings.htmlAttributes.id?t=e.checkBoxSettings.htmlAttributes.id:e.colorPickerSettings.htmlAttributes.id?t=e.colorPickerSettings.htmlAttributes.id:e.comboBoxSettings.htmlAttributes.id?t=e.comboBoxSettings.htmlAttributes.id:e.dropDownSettings.htmlAttributes.id?t=e.dropDownSettings.htmlAttributes.id:e.splitButtonSettings.htmlAttributes.id&&(t=e.splitButtonSettings.htmlAttributes.id),t},k.prototype.updateCommonProperty=function(e){this.tabObj.setProperties(e),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.setCommonProperties(e),this.ribbonBackstageModule&&this.ribbonBackstageModule.setCommonProperties(e);for(var t=0;t<this.tabs.length;t++){var o=this.tabs[parseInt(t.toString(),10)],i=this.tabObj.items[parseInt(t.toString(),10)].content;if(i.querySelector("."+Lt))for(var r=0,n=o.groups;r<n.length;r++){var s=n[r],a=void 0,l=void 0;this.activeLayout===R.RibbonLayout.Classic?a=s.isCollapsed?i.querySelector("#"+s.id+w+ko):null:(l=(a=s.enableGroupOverflow?i.querySelector("#"+s.id+_):null)?x.getComponent(a,M.DropDownButton):this.overflowDDB)&&(oi(l.target,e),l.setProperties(e));for(var p=0,c=s.collections;p<c.length;p++)for(var d=0,u=c[p].items;d<u.length;d++){var h=u[d],b=null;if(this.activeLayout===R.RibbonLayout.Classic?h.displayOptions&R.DisplayMode.Classic&&(b=a?this.ribbonDropDownModule.getDDBItemElement(a,h.id):h.type===R.RibbonItemType.GroupButton?i.querySelector("#"+h.id+G):i.querySelector("#"+h.id)):(b=h.displayOptions&R.DisplayMode.Simplified?i.querySelector("#"+h.id):null)||(b=l.target.querySelector("#"+h.id),"DropDown"===h.type&&this.updatePopupItems(h,l.target,s.enableGroupOverflow,!0)),b){var m=this.getItemModuleName(h);if("template"!==m)if("group-btn"===m&&"Classic"===this.activeLayout)for(var y=0;y<h.groupButtonSettings.items.length;y++)Zo(b.querySelector("#"+h.id+G+y),"btn",e);else if("group-btn"===m&&"Simplified"===this.activeLayout){Zo(b,"dropdown-btn",e);for(var f=0;f<h.groupButtonSettings.items.length;f++)Zo(document.querySelector("#"+h.id+G+f),"btn",e)}else Zo(b,m,e);else x.isNullOrUndefined(e.enableRtl)||b.classList.toggle(at,e.enableRtl)}}}}},k.prototype.removeLauncherIcon=function(e,t,o){var i=e+j,t=t?this.ribbonDropDownModule.getDDBItemElement(t,i):o.querySelector("#"+i);t&&(t.classList.remove(Ht),o=t.querySelector("#"+e+To),x.remove(o))},k.prototype.destroyTabItems=function(e){for(var t=0;t<e.length;t++)for(var o=e[parseInt(t.toString(),10)],i=this.tabObj.items[parseInt(t.toString(),10)].content,r=0,n=o.groups;r<n.length;r++){var s=n[r],a=void 0,l=void 0;this.activeLayout===R.RibbonLayout.Classic?(a=s.isCollapsed?i.querySelector("#"+s.id+w+ko):null,s.showLauncherIcon&&this.removeLauncherIcon(s.id,a,i)):l=(a=s.enableGroupOverflow?i.querySelector("#"+s.id+_):null)?x.getComponent(a,M.DropDownButton):this.overflowDDB;for(var p=0,c=s.collections;p<c.length;p++)for(var d=0,u=c[p].items;d<u.length;d++){var h=u[d],b=void 0;this.activeLayout===R.RibbonLayout.Classic?h.displayOptions&R.DisplayMode.Classic&&(b=a?this.ribbonDropDownModule.getDDBItemElement(a,h.id):i.querySelector("#"+h.id),h.type===R.RibbonItemType.GroupButton&&(b=a?this.ribbonDropDownModule.getDDBItemElement(a,h.id+G):i.querySelector("#"+h.id+G)),h.type===R.RibbonItemType.Gallery)&&(b=i.querySelector("#"+h.id+j)):(b=h.displayOptions&R.DisplayMode.Simplified?i.querySelector("#"+h.id):null,b=(b=h.type===R.RibbonItemType.Gallery?h.displayOptions&R.DisplayMode.Simplified?i.querySelector("#"+h.id+j):null:b)||(l?l.target.querySelector("#"+h.id):null)),b&&this.destroyFunction(h,b)}this.activeLayout===R.RibbonLayout.Classic&&a?this.ribbonDropDownModule.removeOverFlowDropDown(a):this.activeLayout===R.RibbonLayout.Simplified&&s.enableGroupOverflow&&a&&this.removeOverflowButton(l)}this.overflowDDB&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},k.prototype.destroyFunction=function(o,e){var t=this.getItemModuleName(o);if("colorpicker"===t)this.ribbonColorPickerModule.unwireColorPickerEvents(e);else if("group-btn"===t){if("Classic"===this.activeLayout)for(var i=0;i<o.groupButtonSettings.items.length;i++){var r=e.querySelector("#"+o.id+G+i);r&&Yo(r,"btn")}else this.ribbonGroupButtonModule.destroyDropDown(o);for(var n=this,i=0;i<o.groupButtonSettings.items.length;i++)!function(e){var t;o.groupButtonSettings.items[parseInt(e.toString(),10)].ribbonTooltipSettings&&(t=o.id+G+e,-1!==(e=S(n.tooltipData,function(e){return e.id===t})))&&n.tooltipData.splice(e,1)}(i)}else if("gallery"===t)if(e.closest(".e-ribbon-overflow-target")){Yo(e,"dropdown-btn"),(p=Array.prototype.slice.call(document.querySelectorAll("#"+o.id+"_galleryPopup"))).concat(Array.prototype.slice.call(document.querySelectorAll("#"+o.id+"-popup")));for(i=0;i<p.length;i++)p[parseInt(i.toString(),10)].remove();(a=document.querySelector("#"+o.id+"_popupButton"))&&a.remove();var s=document.querySelector("#"+o.id+"_galleryWrapper");s&&s.remove()}else{var a,l=e.querySelectorAll(".e-ribbon-gallery-item");(a=e.parentElement.querySelector("#"+o.id+"_popupButton"))&&a.remove();for(i=0;i<l.length;i++)l[parseInt(i.toString(),10)].remove();for(var p=document.querySelectorAll("#"+o.id+"_galleryPopup"),i=0;i<p.length;i++)p[parseInt(i.toString(),10)].remove()}else"template"!==t&&Yo(e,t);o.ribbonTooltipSettings&&-1!==(s=S(this.tooltipData,function(e){return e.id===o.id+j}))&&this.tooltipData.splice(s,1),"GroupButton"===o.type&&this.ribbonGroupButtonModule.destroyDropDown(o)},k.prototype.getItemModuleName=function(e){switch(e.type){case"Button":return"btn";case"DropDown":return"dropdown-btn";case"SplitButton":return"split-btn";case"CheckBox":return"checkbox";case"ColorPicker":return"colorpicker";case"ComboBox":return"combobox";case"GroupButton":return"group-btn";case"Gallery":return"gallery";default:return"template"}},k.prototype.clearOverflowResize=function(){this.destroyScroll(),this.clearOverflowDropDown(this.selectedTab);for(var e=this.tabs[this.selectedTab],t=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A),o=t.closest("."+Ot),i=0;i<e.groups.length;i++)this.checkSmallToMedium(this.selectedTab,e,i,o,t,!0,!0),this.checkMediumToLarge(this.selectedTab,e,i,o,t,!0,!0)},k.prototype.refreshLayout=function(){this.resizeHandler()},k.prototype.selectTab=function(t){var e=S(this.tabs,function(e){return e.id===t});this.setProperties({selectedTab:e})},k.prototype.showTab=function(e,t){this.showHideTab(e,!1,t=void 0===t?!1:t)},k.prototype.hideTab=function(e,t){this.showHideTab(e,!0,t=void 0===t?!1:t)},k.prototype.showHideTab=function(t,e,o){var i=S(this.tabs,function(e){return e.id===t});if(-1!==i&&(this.tabObj.hideTab(i,e),o)){for(var r,n=this.tabObj.element,s=0;s<this.contextualTabs.length;s++)for(var a=0;a<this.contextualTabs[parseInt(s.toString(),10)].tabs.length;a++)t===this.contextualTabs[parseInt(s.toString(),10)].tabs[parseInt(a.toString(),10)].id&&(r=this.contextualTabs[parseInt(s.toString(),10)]);if(r){for(var l=!0,p=this,s=0;s<r.tabs.length;s++)!function(t){var e=S(p.tabs,function(e){return e.id===r.tabs[parseInt(t.toString(),10)].id});-1===e||n.querySelectorAll(".e-toolbar-item")[parseInt(e.toString(),10)].classList.contains("e-hidden")||(l=!1)}(s);l?r.setProperties({visible:!1},!0):r.setProperties({visible:!0},!0)}}},k.prototype.enableTab=function(e){this.enableDisableTab(e,!0)},k.prototype.disableTab=function(e){this.enableDisableTab(e,!1)},k.prototype.enableDisableTab=function(t,e){var o,i=S(this.tabs,function(e){return e.id===t});-1!==i&&(o=this.tabObj.items[parseInt(i.toString(),10)].content,this.tabObj.element.querySelector("#"+t+q).classList[e?"remove":"add"]("e-disabled"),o.classList[e?"remove":"add"]("e-disabled"),this.tabObj.enableTab(i,e))},k.prototype.addTab=function(e,t,o){var i=-1===(i=t?S(this.tabs,function(e){return e.id===t}):-1)?this.tabs.length:i+(o?1:0),o=(this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(i,0,e),this.setProperties({tabs:this.tabsInternal},!0),this.checkID([this.tabs[parseInt(i.toString(),10)]],"tab",this.element.id),this.tabsInternal=this.tabs.slice(),this.validateItemSize(),this.createTabItems([e]));this.tabObj.addTab(o,i)},k.prototype.removeTab=function(t){var e=S(this.tabs,function(e){return e.id===t});if(-1!==e){var o=this.tabObj.items[parseInt(e.toString(),10)].content,i=this.tabs[parseInt(e.toString(),10)].groups;if(i&&""!==o.innerHTML)for(var r=0,n=i;r<n.length;r++){for(var s=n[r],a=s.isCollapsed?o.querySelector("#"+s.id+w+ko):null,l=0,p=s.collections;l<p.length;l++)for(var c=0,d=p[l].items;c<d.length;c++){var u=d[c],h=a?this.ribbonDropDownModule.getDDBItemElement(a,u.id):o.querySelector("#"+u.id);(h=u.type===R.RibbonItemType.GroupButton&&"Classic"===this.activeLayout?a?this.ribbonDropDownModule.getDDBItemElement(a,u.id+G):o.querySelector("#"+u.id+G):h)&&this.destroyFunction(u,h)}a&&this.ribbonDropDownModule.removeOverFlowDropDown(a)}e===this.selectedTab&&(this.isAddRemove=!0),this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(e,1),this.setProperties({tabs:this.tabsInternal},!0),this.tabObj.removeTab(e)}},k.prototype.addGroup=function(t,e,o,i){var r,n,s,a=S(this.tabs,function(e){return e.id===t});-1!==a&&(this.selectedTab===a&&this.clearOverflowResize(),n=(s=this.tabs[parseInt(a.toString(),10)]).groups.slice(),r=-1===(r=o?S(n,function(e){return e.id===o}):-1)?n.length:r+(i?1:0),n.splice(r,0,e),s.setProperties({groups:n},!0),this.checkID([s.groups[parseInt(r.toString(),10)]],"group",t),this.validateItemSize(),""!==(e=this.tabObj.items[parseInt(a.toString(),10)].content).innerHTML&&(n=this.createGroups([s.groups[parseInt(r.toString(),10)]],a)[0],(s=o?e.querySelector("#"+o):null)?s.insertAdjacentElement(i?"afterend":"beforebegin",n):e.append(n)),this.selectedTab===a)&&this.refreshLayout()},k.prototype.removeGroup=function(e){var t=Xo(this.tabs,e);if(t){this.selectedTab===t.tabIndex&&this.clearOverflowResize();var o=this.tabObj.items[t.tabIndex].content;if(""!==o.innerHTML){var i=void 0;t.group.showLauncherIcon&&this.removeLauncherIcon(t.group.id,null,o),this.activeLayout===R.RibbonLayout.Simplified&&(i=(p=t.group.enableGroupOverflow?o.querySelector("#"+t.group.id+_):null)?x.getComponent(p,M.DropDownButton):this.overflowDDB);for(var r=0,n=t.group.collections;r<n.length;r++)for(var s=0,a=n[r].items;s<a.length;s++){var l=a[s];this.removeItemElement(o,l,i)}this.activeLayout===R.RibbonLayout.Simplified&&(t.group.enableGroupOverflow?(0===i.target.childElementCount||1===i.target.childElementCount&&this.isHeaderVisible(i.target,t.group.id))&&this.removeOverflowButton(i):((p=i.target.querySelector("#"+t.group.id+j))&&1===p.childElementCount&&p.remove(),(p=i.target.querySelector("#"+this.tabs[parseInt(t.tabIndex.toString(),10)].id+w))&&0===p.childElementCount&&p.remove()));var p=o.querySelector("#"+e);p&&p.remove()}e=this.tabs[t.tabIndex].groups.slice();e.splice(t.groupIndex,1),this.tabs[t.tabIndex].setProperties({groups:e},!0),this.selectedTab===t.tabIndex&&this.refreshLayout()}},k.prototype.isHeaderVisible=function(e,t){return!!e.querySelector("#"+t+_+q)},k.prototype.hideGroup=function(e){this.showHideGroup(e,!0)},k.prototype.showGroup=function(e){this.showHideGroup(e,!1)},k.prototype.showHideGroup=function(e,t){var o,i,r,n=Xo(this.tabs,e);n&&((i=(r=this.tabObj.items[n.tabIndex].content).querySelector("#"+e))?this.updateHiddenElements(n.tabIndex,t?"hideGroup":"showGroup",e,t,i):this.updateInitialProps(n.tabIndex,e,"hiddenGroups",t),this.overflowDDB&&(i=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+w),n.group.enableGroupOverflow?(o=(r=r.querySelector("#"+e+_))?x.getInstance(r,M.DropDownButton).target:o)&&(t?o.classList.add("e-hidden"):o.classList.remove("e-hidden")):i&&(r=i.querySelector("#"+e+j))&&(t?r.classList.add("e-hidden"):r.classList.remove("e-hidden"))),this.selectedTab===n.tabIndex)&&this.refreshLayout()},k.prototype.updateHiddenElements=function(e,t,o,i,r,n){i?r.classList.contains("e-hidden")||(this.checkHiddenElements(t,o,e),r.classList.add("e-hidden"),"hideItem"===t&&this.checkHiddenItems(n,i,e),this.calculateHiddenElementsWidth(e)):r.classList.contains("e-hidden")&&(this.checkHiddenElements(t,o,e),r.classList.remove("e-hidden"),this.calculateHiddenElementsWidth(e),"showItem"===t)&&this.checkHiddenItems(n,i,e)},k.prototype.checkHiddenElements=function(e,t,o){var i;"Simplified"===this.activeLayout&&((i=this.hiddenElements[parseInt(o.toString(),10)])||(this.hiddenElements[parseInt(o.toString(),10)]={},i=this.hiddenElements[parseInt(o.toString(),10)]),i)&&(i[""+e]||(i[""+e]=[]),i[""+e].length&&-1!==i[""+e].indexOf(t)||i[""+e].push(t))},k.prototype.updateItemsSimplifiedWidth=function(s,a){var l=this.hiddenElements[parseInt(s.toString(),10)];if(l&&l[""+a]&&l[""+a].length)for(var p,c=this,e=0;e<l[""+a].length;e++)!function(e){var t=c.tabObj.items[parseInt(s.toString(),10)].content,o=void 0,i=!1,r=0,n="hideGroup"===a||"showGroup"===a?t.querySelector("#"+l[""+a][parseInt(e.toString(),10)]):t.querySelector("#"+l[""+a][parseInt(e.toString(),10)]+j),t=(n&&("hideGroup"===a||"hideItem"===a?(t=!1,n.classList.contains("e-hidden")&&(t=!0,n.classList.remove("e-hidden")),"hideItem"===a&&(o=n.closest(".e-ribbon-group")).classList.contains("e-hide-group")&&(i=!0,r=c.checkWidthDifference(n,o)),c.calculateOverflowItemsWidth(n.offsetWidth+r,!0,s),c.calculateMediumDataWidth(n.offsetWidth+r,s,!0),t&&n.classList.add("e-hidden")):("showItem"===a&&((o=n.closest(".e-ribbon-group")).classList.contains("e-hide-group")?(i=!0,o.classList.remove("e-hide-group"),o.classList.remove("e-ribbon-emptyCollection"),r=Math.abs(n.offsetWidth-o.offsetWidth),-1!==c.hiddenGroups.indexOf(o.id)&&c.hiddenGroups.splice(c.hiddenGroups.indexOf(o.id),1)):-1!==c.hiddenGroups.indexOf(o.id)&&((t=o.querySelectorAll(".e-ribbon-item:not(.e-hidden)")).forEach(function(e){e.id!==n.id&&e.classList.add("e-hidden")}),r=Math.abs(n.offsetWidth-o.offsetWidth),t.forEach(function(e){e.id!==n.id&&e.classList.remove("e-hidden")}),c.hiddenGroups.splice(c.hiddenGroups.indexOf(o.id),1))),c.calculateOverflowItemsWidth(n.offsetWidth+r,!1,s),c.calculateMediumDataWidth(n.offsetWidth+r,s,!1)),i)&&(o.classList.add("e-hide-group"),o.classList.add("e-ribbon-emptyCollection")),l[""+a].indexOf(l[""+a][parseInt(e.toString(),10)]));-1!==t&&(l[""+a].splice(t,1),e--),p=e}(e),e=p},k.prototype.checkWidthDifference=function(e,t){var o=0;return t.classList.remove("e-hide-group"),t.classList.remove("e-ribbon-emptyCollection"),this.hiddenGroups.length&&-1!==this.hiddenGroups.indexOf(t.id)||(this.hiddenGroups.push(t.id),o=Math.abs(e.offsetWidth-t.offsetWidth)),o},k.prototype.calculateHiddenElementsWidth=function(e){if(e===this.selectedTab&&"Simplified"===this.activeLayout){var t=this.hiddenElements[parseInt(e.toString(),10)];if(t)for(var o=0;o<Object.keys(t).length;o++)this.updateItemsSimplifiedWidth(e,Object.keys(t)[parseInt(o.toString(),10)])}},k.prototype.calculateMediumDataWidth=function(e,t,o){if(this.selectedTab===t&&"Simplified"===this.activeLayout){var i=this.tabObj.element.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+A),r=Array.prototype.slice.call(i.querySelectorAll(".e-ribbon-item"));if(this.overflowDDB)for(var n=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),s=document.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+w),a=0;a<n.length;a++){var l=n[parseInt(a.toString(),10)].closest("#"+this.tabs[parseInt(t.toString(),10)].id+w);s&&l&&s.id===l.id&&n[parseInt(a.toString(),10)].hasAttribute("data-medium-width")&&r.push(n[parseInt(a.toString(),10)])}for(var p=i.querySelectorAll(".e-ribbon-group-of-btn"),a=0;a<p.length;a++)for(var n=x.getInstance(p[parseInt(a.toString(),10)],M.DropDownButton).target.querySelectorAll(".e-ribbon-item"),c=0;c<n.length;c++)n[parseInt(c.toString(),10)].hasAttribute("data-medium-width")&&r.push(n[parseInt(c.toString(),10)]);for(var d,a=0;a<r.length;a++)r[parseInt(a.toString(),10)].hasAttribute("data-medium-width")&&(d=parseInt(r[parseInt(a.toString(),10)].getAttribute("data-medium-width"),10),r[parseInt(a.toString(),10)].setAttribute("data-medium-width",(o?d-e:d+e).toString()))}},k.prototype.calculateOverflowItemsWidth=function(e,t,o){if(this.selectedTab===o&&"Simplified"===this.activeLayout)for(var i=this.tabs[parseInt(o.toString(),10)].groups,r=0;r<i.length;r++){var n=i[parseInt(r.toString(),10)];if(n.enableGroupOverflow){var s=void 0,n=document.querySelector("#"+n.id).querySelector("#"+n.id+_);if(s=n?x.getInstance(n,M.DropDownButton):s)for(var a=s.target.querySelectorAll(".e-ribbon-item"),l=0;l<a.length;l++)(c=parseInt(a[parseInt(l.toString(),10)].getAttribute("data-simplified-width"),10))&&a[parseInt(l.toString(),10)].setAttribute("data-simplified-width",(t?c-e:c+e).toString())}}if(this.overflowDDB)for(var p=document.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+w),a=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),r=0;r<a.length;r++){var c,d=a[parseInt(r.toString(),10)].closest("#"+this.tabs[parseInt(o.toString(),10)].id+w);p&&d&&p.id===d.id&&(c=parseInt(a[parseInt(r.toString(),10)].getAttribute("data-simplified-width"),10))&&a[parseInt(r.toString(),10)].setAttribute("data-simplified-width",(t?c-e:c+e).toString())}},k.prototype.disableGroup=function(e){this.enableDisableGroup(e,!0)},k.prototype.enableGroup=function(e){this.enableDisableGroup(e,!1)},k.prototype.enableDisableGroup=function(e,t){var o,i,r,n=Xo(this.tabs,e);n&&((i=(r=this.tabObj.items[n.tabIndex].content).querySelector("#"+e))?t?i.classList.add("e-disabled"):i.classList.remove("e-disabled"):this.updateInitialProps(n.tabIndex,e,"disabledGroups",t),this.overflowDDB)&&(i=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+w),n.group.enableGroupOverflow?(o=(n=r.querySelector("#"+e+_))?x.getInstance(n,M.DropDownButton).target:o)&&(t?o.classList.add("e-disabled"):o.classList.remove("e-disabled")):i&&(r=i.querySelector("#"+e+j))&&(t?r.classList.add("e-disabled"):r.classList.remove("e-disabled")))},k.prototype.addCollection=function(e,t,o,i){var r,n,s=Xo(this.tabs,e);!s||"Row"===s.group.orientation&&3===s.group.collections.length||(this.selectedTab===s.tabIndex&&this.clearOverflowResize(),n=s.group.collections.slice(),r=-1===(r=o?S(n,function(e){return e.id===o}):-1)?n.length:r+(i?1:0),n.splice(r,0,t),s.group.setProperties({collections:n},!0),this.checkID([s.group.collections[parseInt(r.toString(),10)]],"collection",e),this.validateItemSize(),""!==(t=this.tabObj.items[s.tabIndex].content).innerHTML&&(n=s.group.collections[parseInt(r.toString(),10)],r=this.createCollection([n],s.group.orientation,s.group.id,s.group.header,s.group.enableGroupOverflow,s.tabIndex)[0],s.group.isCollapsed&&(t=this.ribbonDropDownModule.getOverflowDropDownPopup(s,t)),(n=o?t.querySelector("#"+o):null)?n.insertAdjacentElement(i?"afterend":"beforebegin",r):t.querySelector("#"+e+A).append(r)),this.selectedTab===s.tabIndex&&this.refreshLayout())},k.prototype.removeCollection=function(e){var t=Vo(this.tabs,e);if(t){this.selectedTab===t.tabIndex&&this.clearOverflowResize();var o=this.tabObj.items[t.tabIndex].content;if(""!==o.innerHTML){var i=void 0;this.activeLayout===R.RibbonLayout.Simplified&&(i=(a=t.group.enableGroupOverflow?o.querySelector("#"+t.group.id+_):null)?x.getComponent(a,M.DropDownButton):this.overflowDDB);for(var r=0,n=t.collection.items;r<n.length;r++){var s=n[r];this.removeItemElement(o,s,i)}var a=o.querySelector("#"+e);a&&a.remove()}e=t.group,a=e.collections.slice();a.splice(t.collectionIndex,1),e.setProperties({collections:a},!0),this.selectedTab===t.tabIndex&&this.refreshLayout()}},k.prototype.addItem=function(e,t,o,i){var r,n,s=Vo(this.tabs,e);!s||"Column"===s.group.orientation&&3===s.collection.items.length||(this.selectedTab===s.tabIndex&&this.clearOverflowResize(),n=s.collection.items.slice(),r=-1===(r=o?S(n,function(e){return e.id===o}):-1)?n.length:r+(i?1:0),n.splice(r,0,t),s.collection.setProperties({items:n},!0),this.checkID([s.collection.items[parseInt(r.toString(),10)]],"item",e),this.validateItemSize(),n=(t=this.tabObj.items[s.tabIndex].content).querySelector("#"+s.group.id+j),""!==t.innerHTML&&(r=s.collection.items[parseInt(r.toString(),10)],r=this.createItems([r],s.group.orientation,s.group.id,s.group.header,s.group.enableGroupOverflow,s.tabIndex,n)[0],s.group.isCollapsed&&(t=this.ribbonDropDownModule.getOverflowDropDownPopup(s,t)),(n=o?t.querySelector("#"+o):null)?n.closest("."+Ut).insertAdjacentElement(i?"afterend":"beforebegin",r):r&&t.querySelector("#"+e).append(r)),this.selectedTab===s.tabIndex&&this.refreshLayout())},k.prototype.removeItem=function(e){var t,o,i,e=g(this.tabs,e);e&&(this.selectedTab===e.tabIndex&&this.clearOverflowResize(),""!==(o=this.tabObj.items[e.tabIndex].content).innerHTML&&(t=i=void 0,this.activeLayout===R.RibbonLayout.Simplified&&(t=(i=e.group.enableGroupOverflow?o.querySelector("#"+e.group.id+_):null)?x.getComponent(i,M.DropDownButton):this.overflowDDB),i=e.item,this.removeItemElement(o,i,t)),(i=(o=e.collection).items).splice(e.itemIndex,1),o.setProperties({items:i},!0),this.selectedTab===e.tabIndex)&&this.refreshLayout()},k.prototype.hideItem=function(e){this.showHideItem(e,!0)},k.prototype.showItem=function(e){this.showHideItem(e,!1)},k.prototype.showHideItem=function(e,t){var o,i=g(this.tabs,e);i&&((o="GroupButton"===i.item.type?I(this,e+G,i):I(this,e,i))?(o=x.closest(o,".e-ribbon-item"),this.updateHiddenElements(i.tabIndex,t?"hideItem":"showItem",e,t,o,i.group),this.selectedTab===i.tabIndex&&this.refreshLayout()):this.updateInitialProps(i.tabIndex,e,"hiddenItems",t))},k.prototype.updateInitialProps=function(e,t,o,i){var r,n=this.initialPropsData[parseInt(e.toString(),10)];n||(this.initialPropsData[parseInt(e.toString(),10)]={},n=this.initialPropsData[parseInt(e.toString(),10)]),n&&(n[""+o]||(n[""+o]=[]),r=n[""+o].indexOf(t),i?-1===r&&n[""+o].push(t):(-1!==r&&n[""+o].splice(r,1),0===n[""+o].length&&delete n[""+o],0===Object.keys(n).length&&delete this.initialPropsData[parseInt(e.toString(),10)]))},k.prototype.checkHiddenItems=function(e,t,o){var i=!0,r=this.tabObj.items[parseInt(o.toString(),10)].content,n=r.querySelector("#"+e.id);if(t){for(var s=0;s<e.collections.length;s++)if(i)for(var a=e.collections[parseInt(s.toString(),10)],l=0;l<a.items.length;l++){var p,c=a.items[parseInt(l.toString(),10)],d=void 0;if(!((d="GroupButton"===c.type?(p=g(this.tabs,c.id),I(this,c.id+G,p)):I(this,c.id))?d.closest(".e-ribbon-item"):null).classList.contains("e-hidden")){i=!1;break}}i&&(n.classList.add("e-hide-group"),this.checkOverflowItems(t,r,e.enableGroupOverflow,o,e.id))}else n.classList.remove("e-hide-group"),this.checkOverflowItems(t,r,e.enableGroupOverflow,o,e.id);"Simplified"!==this.activeLayout||e.enableGroupOverflow||(t=n.querySelectorAll("."+Ut))&&(r=this.checkEmptyCollection(t),n.classList[r?"add":"remove"]("e-ribbon-emptyCollection"))},k.prototype.checkOverflowItems=function(e,t,o,i,r){var n;o?(n=(o=t.querySelector("#"+r+_))?x.getInstance(o,M.DropDownButton).target:n)&&(e?n.classList.add("e-hide-group"):n.classList.remove("e-hide-group")):this.overflowDDB&&(t=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+w))&&(o=t.querySelector("#"+r+j))&&(e?o.classList.add("e-hide-group"):o.classList.remove("e-hide-group"))},k.prototype.updateTab=function(e){var t=e.id,o=S(this.tabs,function(e){return e.id===t});if(-1!==o){var i=this.tabObj.items[parseInt(o.toString(),10)].content,r=this.tabs[parseInt(o.toString(),10)].groups,n=this.tabObj.element;if(r&&""!==i.innerHTML&&(e.cssClass&&this.tabs[parseInt(o.toString(),10)].cssClass&&(i.classList.remove(this.tabs[parseInt(o.toString(),10)].cssClass),n.querySelector(".e-active").classList.remove(this.tabs[parseInt(o.toString(),10)].cssClass)),e.groups)){for(var s=0,a=r;s<a.length;s++){for(var l=a[s],p=l.isCollapsed?i.querySelector("#"+l.id+w+ko):null,c=0,d=l.collections;c<d.length;c++)for(var u=0,h=d[c].items;u<h.length;u++){var b=h[u],m=p?this.ribbonDropDownModule.getDDBItemElement(p,b.id):i.querySelector("#"+b.id);(m=b.type===R.RibbonItemType.GroupButton&&"Classic"===this.activeLayout?p?this.ribbonDropDownModule.getDDBItemElement(p,b.id+G):i.querySelector("#"+b.id+G):m)&&this.destroyFunction(b,m)}p&&this.ribbonDropDownModule.removeOverFlowDropDown(p)}i.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()})}o===this.selectedTab&&(this.isAddRemove=!0);var y,r=this.tabs[parseInt(o.toString(),10)];r.setProperties(e,!0),this.setProperties({groups:this.checkID(r.groups,"group",r.id)},!0),this.validateItemSize(),""===i.innerHTML&&(e.groups&&(y=this.createGroups(r.groups,o),x.append(y,i)),this.selectedTab===o&&this.refreshLayout(),e.cssClass&&(i.classList.add(r.cssClass),n.querySelector(".e-active").classList.add(r.cssClass)),e.header)&&(n.querySelector("#"+t+q).innerText=r.header)}},k.prototype.updateGroup=function(e){var t=e.id,o=Xo(this.tabs,t);if(o){this.selectedTab===o.tabIndex&&this.clearOverflowResize();var i,r=this.tabObj.items[o.tabIndex].content,t=r.querySelector("#"+t),n=t.querySelector("#"+e.id+j);if(""!==r.innerHTML){if(o.group.showLauncherIcon&&this.removeLauncherIcon(o.group.id,null,r),this.activeLayout===R.RibbonLayout.Simplified&&(i=(b=o.group.enableGroupOverflow?r.querySelector("#"+o.group.id+_):null)?x.getComponent(b,M.DropDownButton):this.overflowDDB),e.cssClass&&o.group.cssClass&&(t.classList.remove(o.group.cssClass),n)&&n.classList.remove(o.group.cssClass),(e.collections||e.orientation)&&(o.group.collections||o.group.orientation)){for(var s=0,a=o.group.collections;s<a.length;s++)for(var l=0,p=a[s].items;l<p.length;l++){var c=p[l];this.removeItemElement(r,c,i)}t.querySelectorAll(".e-ribbon-collection").forEach(function(e){e.remove()}),e.orientation&&(b=(d=n.querySelector(".e-ribbon-group-content")).classList.value.match(/(e-ribbon-[column|row]+)/g))&&x.removeClass([d],b)}this.activeLayout===R.RibbonLayout.Simplified&&(o.group.enableGroupOverflow?(0===i.target.childElementCount||1===i.target.childElementCount&&this.isHeaderVisible(i.target,o.group.id))&&this.removeOverflowButton(i):((b=i.target.querySelector("#"+o.group.id+j))&&1===b.childElementCount&&b.remove(),(b=i.target.querySelector("#"+this.tabs[parseInt(o.tabIndex.toString(),10)].id+w))&&0===b.childElementCount&&b.remove()))}var d,u,h,b=o.group;b.setProperties(e,!0),b.setProperties({collections:this.checkID(b.collections,"collection",b.id)},!0),this.validateItemSize(),""!==r.innerHTML&&(e.showLauncherIcon&&this.createLauncherIcon(b.id,n,o.tabIndex),(e.collections||e.orientation)&&((d=n.querySelector(".e-ribbon-group-content")).classList.add("Column"===b.orientation||"Simplified"===this.activeLayout?Xt:Vt),u=this.createCollection(b.collections,b.orientation,b.id,b.header,b.enableGroupOverflow,o.tabIndex,n),x.append(u,d)),this.selectedTab===o.tabIndex&&this.refreshLayout(),e.cssClass&&(t.classList.add(b.cssClass),n)&&n.classList.add(b.cssClass),e.header)&&(this.activeLayout!==R.RibbonLayout.Simplified||e.enableGroupOverflow?this.activeLayout!==R.RibbonLayout.Classic||b.isCollapsed?this.activeLayout===R.RibbonLayout.Classic&&b.isCollapsed&&(u=t.querySelector("#"+b.id+w+ko),h=x.getInstance(u,M.DropDownButton).target.querySelector("#"+e.id+q))&&(h.innerText=b.header):t.querySelector(".e-ribbon-group-header").innerText=b.header:(h=i.target.querySelector("#"+e.id+q))&&(h.innerText=b.header))}},k.prototype.updateCollection=function(e){var t=e.id,o=Vo(this.tabs,t);if(o){this.selectedTab===o.tabIndex&&this.clearOverflowResize();var i=this.tabObj.items[o.tabIndex].content,t=i.querySelector("#"+t);if(""!==i.innerHTML){var r=void 0;if(this.activeLayout===R.RibbonLayout.Simplified&&(r=(p=o.group.enableGroupOverflow?i.querySelector("#"+o.group.id+_):null)?x.getComponent(p,M.DropDownButton):this.overflowDDB),e.cssClass&&o.collection.cssClass&&t.classList.remove(o.collection.cssClass),e.items&&o.collection.items)for(var n=0,s=o.collection.items;n<s.length;n++){var a=s[n];this.removeItemElement(i,a,r)}}var l,p=o.collection;p.setProperties(e,!0),p.setProperties({items:this.checkID(p.items,"item",p.id)},!0),this.validateItemSize(),""!==i.innerHTML&&e.items&&(l=i.querySelector("#"+o.group.id+j),l=this.createItems(p.items,o.group.orientation,o.group.id,o.group.header,o.group.enableGroupOverflow,o.tabIndex,l),x.append(l,t)),this.selectedTab===o.tabIndex&&this.refreshLayout(),e.cssClass&&t.classList.add(p.cssClass)}},k.prototype.updateItem=function(e){var t,o,i,r,n,s,a=e.id,l=g(this.tabs,a);l&&(this.selectedTab===l.tabIndex&&this.clearOverflowResize(),(o=(t=this.tabObj.items[l.tabIndex].content).querySelector("#"+l.group.id))?(o=o.querySelector("#"+l.group.id+j),n=r=null,i=s=void 0,""!==t.innerHTML&&(this.activeLayout===R.RibbonLayout.Simplified&&(i=(s=l.group.enableGroupOverflow?t.querySelector("#"+l.group.id+_):null)?x.getComponent(s,M.DropDownButton):this.overflowDDB),this.activeLayout===R.RibbonLayout.Simplified&&l.item.displayOptions===R.DisplayMode.Overflow?(r=i.target.querySelector("#"+a+j),n=i.target.querySelector("#"+a),e.displayOptions&&e.displayOptions!==R.DisplayMode.Overflow&&(s=o.querySelector("#"+l.collection.id))&&s.appendChild(r)):(r=o.querySelector("#"+a+j),n=t.querySelector("#"+a),r=r||(i?i.target:o).querySelector("#"+a+j),n=n||(i?i.target:t).querySelector("#"+a),"Gallery"===l.item.type&&(n=n||t.querySelector("#"+a+"_galleryWrapper")),"GroupButton"===l.item.type&&this.activeLayout===R.RibbonLayout.Classic&&(n=t.querySelector("#"+a+G)),this.activeLayout===R.RibbonLayout.Simplified&&e.displayOptions===R.DisplayMode.Overflow&&(this.createOverflowPopup(l.item,l.tabIndex,l.group.enableGroupOverflow,l.group.id,l.group.header,r,o),l.item.type!==R.RibbonItemType.DropDown&&l.item.type!==R.RibbonItemType.SplitButton&&e.type!==R.RibbonItemType.GroupButton&&e.type!==R.RibbonItemType.Gallery||this.updatePopupItems(l.item,r,l.group.enableGroupOverflow,!0))),e.cssClass&&l.item.cssClass&&r.classList.remove(l.item.cssClass),this.destroyFunction(l.item,n),n.remove(),s=r.classList.value.match(/(e-ribbon-[large|medium|small]+-item)/g))&&x.removeClass([r],s),(n=l.item).setProperties(e,!0),this.validateItemSize(),""!==t.innerHTML&&(n.ribbonTooltipSettings&&Qo(n.ribbonTooltipSettings)&&(r.classList.add(io),this.tooltipData.push({id:r.id,data:n.ribbonTooltipSettings})),s=n.activeSize,"Simplified"===this.activeLayout&&(s=n.allowedSizes===R.RibbonItemSize.Large||n.allowedSizes&R.RibbonItemSize.Medium||n.displayOptions===R.DisplayMode.Overflow?R.RibbonItemSize.Medium:R.RibbonItemSize.Small,n.setProperties({activeSize:s},!0)),s&R.RibbonItemSize.Large?r.classList.add(Yt,Qt):s&R.RibbonItemSize.Medium?r.classList.add(Zt):r.classList.add(Jt),this.createRibbonItem(n,r),"Gallery"===l.item.type&&document.querySelector("#"+a+"_container").closest(".e-ribbon-overflow-target")&&e.displayOptions!==R.DisplayMode.Overflow&&this.createOverflowPopup(l.item,l.tabIndex,l.group.enableGroupOverflow,l.group.id,l.group.header,r,o),"Simplified"===this.activeLayout&&l.group.enableGroupOverflow&&i&&(0===i.target.childElementCount||1===i.target.childElementCount&&this.isHeaderVisible(i.target,l.group.id))&&this.removeOverflowButton(i),this.selectedTab===l.tabIndex&&this.refreshLayout(),e.cssClass&&r.classList.add(n.cssClass),!n.disabled&&r.classList.contains(st)&&r.classList.remove(st),this.enableDisableItem(n.id,n.disabled))):(this.isUpdateItems=!0,this.itemsModel.push(e),this.targetTabs[e.id]=l.tabIndex))},k.prototype.removeItemElement=function(e,t,o){var i=null;this.activeLayout===R.RibbonLayout.Classic?(i=t.displayOptions&R.DisplayMode.Classic?e.querySelector("#"+t.id):null,"GroupButton"===t.type&&(i=t.displayOptions&R.DisplayMode.Classic?e.querySelector("#"+t.id+G):null)):i=(i=t.displayOptions&R.DisplayMode.Simplified?e.querySelector("#"+t.id):null)||o.target.querySelector("#"+t.id),i&&(this.destroyFunction(t,i),("GroupButton"===t.type&&this.activeLayout===R.RibbonLayout.Simplified?document.getElementById(t.id+j):i.closest("#"+t.id+j)).remove())},k.prototype.enableItem=function(e){this.enableDisableItem(e,!1)},k.prototype.disableItem=function(e){this.enableDisableItem(e,!0)},k.prototype.getItem=function(e){return g(this.tabs,e).item},k.prototype.enableDisableItem=function(e,t){var o,i=!1,r=g(this.tabs,e);if(r&&(r.item.setProperties({disabled:t},!0),"GroupButton"===r.item.type?o=I(this,e+G,r):"Gallery"===r.item.type?(o=document.querySelector("#"+e))?i=!0:o=document.querySelector("#"+e+"_galleryWrapper"):o=I(this,e,r),o)){var n=x.closest(o,".e-ribbon-item"),s=this.getItemModuleName(r.item),a=t?!n.classList.contains(st):n.classList.contains(st);if("template"!==s){if(a)if("group-btn"===s&&"Simplified"===this.activeLayout){Jo(o,"dropdown-btn",t);for(var l=0;l<r.item.groupButtonSettings.items.length;l++)Jo(document.querySelector("#"+e+G+l),"btn",t)}else if("group-btn"===s&&"Classic"===this.activeLayout)for(l=0;l<r.item.groupButtonSettings.items.length;l++)Jo(o.querySelector("#"+e+G+l),"btn",t);else"gallery"===s?(o.classList.toggle(st,t),document.getElementById(e+"_popupButton").classList.toggle(st,t),i&&document.getElementById(e+"_galleryWrapper").classList.toggle(st,t)):Jo(o,s,t)}else o.classList.toggle(st,t),o.toggleAttribute("disabled",t);n.classList.toggle(st,r.item.disabled)}},k.prototype.unwireEvents=function(){x.EventHandler.remove(window,"resize",this.resizeListener),x.EventHandler.remove(document.body,"keydown",this.keytipActionHandler),x.EventHandler.remove(document,"mousedown",this.mouseEventHandler),x.EventHandler.remove(document,"scroll",this.mouseEventHandler)},k.prototype.destroy=function(){this.keyboardModuleRibbon.destroy(),this.keyboardModuleRibbon=null,ti(this.element),this.refreshing&&this.clearOverflowDropDown(this.selectedTab),this.destroyTabItems(this.tabs),this.hideLayoutSwitcher||this.removeExpandCollapse(),this.collapseButton=void 0,this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.ribbonTempEle&&(x.remove(this.ribbonTempEle),this.ribbonTempEle=null),li.prototype.destroy.call(this),this.tabObj.destroy(),this.tabObj=void 0,this.initialPropsData={},this.hiddenGroups=[],this.hiddenElements={},this.keyTipElements={},this.itemsModel=[],this.targetTabs={},x.remove(this.element.querySelector("#"+this.element.id+So)),this.element.style.removeProperty(Mo),this.element.style.removeProperty(_o),this.element.style.removeProperty("width"),this.cssClass&&x.removeClass([this.element],this.cssClass.split(v)),this.element.classList.remove(at,po,kt,It,Bt,"e-rbn"),this.unwireEvents()},k.prototype.onPropertyChanged=function(e,t){for(var o,i=0,r=Object.keys(e);i<r.length;i++)switch(r[i]){case"activeLayout":this.switchLayout();break;case"cssClass":t.cssClass&&(o=this.element.classList).remove.apply(o,t.cssClass.split(v)),e.cssClass&&(o=this.element.classList).add.apply(o,e.cssClass.split(v));break;case"isMinimized":this.element.classList.toggle(Bt,this.isMinimized),this.tabObj.element.querySelector(".e-content").style.display=this.isMinimized?"none":"block",this.isMinimized||this.refreshLayout();break;case"locale":this.updateCommonProperty({locale:this.locale});break;case"enablePersistence":this.updateCommonProperty({enablePersistence:this.enablePersistence});break;case"enableRtl":this.element.classList.toggle(at,this.enableRtl),this.updateCommonProperty({enableRtl:e.enableRtl}),this.scrollModule&&this.scrollModule.setProperties({enableRtl:e.enableRtl});break;case"launcherIconCss":for(var n=0;n<this.tabs.length;n++){var s=this.tabObj.items[parseInt(n.toString(),10)].content,a=this.tabs[parseInt(n.toString(),10)];if(s.querySelector("."+Lt))for(var l=0,p=a.groups;l<p.length;l++){var c,d,u=p[l];u.showLauncherIcon&&(c=Wt+" "+(this.launcherIconCss||Ft),u.isCollapsed?(d=s.querySelector("#"+u.id+w+ko),x.getComponent(d,M.DropDownButton).target.querySelector("#"+u.id+To).className=c):(d=s.querySelector("#"+u.id+To)).className=c)}}break;case"selectedTab":var h=this.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(e.selectedTab.toString(),10)];h.classList.contains("e-hidden")||h.classList.contains("e-disable")||this.tabObj.setProperties({selectedItem:e.selectedTab});break;case"tabAnimation":this.tabObj.setProperties({animation:e.tabAnimation});break;case"tabs":this.reRenderTabs(e.tabs);break;case"contextualTabs":for(n=0;n<this.contextualTabs.length;n++)e.contextualTabs[parseInt(n.toString(),10)]&&this.ribbonContextualTabModule.updateContextualTabs(e.contextualTabs[parseInt(n.toString(),10)],this.contextualTabs[parseInt(n.toString(),10)]);break;case"width":this.element.style.width=x.formatUnit(e.width),this.refreshLayout();break;case"fileMenu":this.ribbonFileMenuModule&&this.ribbonFileMenuModule.updateFileMenu(this.fileMenu),this.tabObj.tbObj.refreshOverflow();break;case"backStageMenu":this.ribbonBackstageModule&&this.ribbonBackstageModule.updateBackStageMenu(this.backStageMenu),this.tabObj.tbObj.refreshOverflow();break;case"helpPaneTemplate":this.ribbonTempEle&&(x.remove(this.ribbonTempEle),this.ribbonTempEle=null,this.tabObj.element.style.setProperty(_o,"0px")),this.helpPaneTemplate&&this.createHelpPaneTemplate(),this.tabObj.tbObj.refreshOverflow();break;case"hideLayoutSwitcher":this.hideLayoutSwitcher?this.removeExpandCollapse():this.addExpandCollapse()}},T([x.Property("Classic")],k.prototype,"activeLayout",void 0),T([x.Property("")],k.prototype,"cssClass",void 0),T([x.Property(!1)],k.prototype,"enableKeyTips",void 0),T([x.Property("")],k.prototype,"layoutSwitcherKeyTip",void 0),T([x.Complex({},_e)],k.prototype,"fileMenu",void 0),T([x.Complex({},Ke)],k.prototype,"backStageMenu",void 0),T([x.Property("")],k.prototype,"launcherIconCss",void 0),T([x.Property(!1)],k.prototype,"isMinimized",void 0),T([x.Property("en-us")],k.prototype,"locale",void 0),T([x.Property(0)],k.prototype,"selectedTab",void 0),T([x.Complex({},L.TabAnimationSettings)],k.prototype,"tabAnimation",void 0),T([x.Collection([],h)],k.prototype,"tabs",void 0),T([x.Collection([],Ye)],k.prototype,"contextualTabs",void 0),T([x.Property("100%")],k.prototype,"width",void 0),T([x.Property("")],k.prototype,"helpPaneTemplate",void 0),T([x.Property(!1)],k.prototype,"hideLayoutSwitcher",void 0),T([x.Event()],k.prototype,"tabSelecting",void 0),T([x.Event()],k.prototype,"tabSelected",void 0),T([x.Event()],k.prototype,"ribbonExpanding",void 0),T([x.Event()],k.prototype,"ribbonCollapsing",void 0),T([x.Event()],k.prototype,"ribbonLayoutSwitched",void 0),T([x.Event()],k.prototype,"launcherIconClick",void 0),T([x.Event()],k.prototype,"created",void 0),T([x.Event()],k.prototype,"overflowPopupOpen",void 0),T([x.Event()],k.prototype,"overflowPopupClose",void 0),pi=T([x.NotifyPropertyChanges],k));function k(e,t){return pi.Inject(qo,jo,Wo,Fo,No,ri),li.call(this,e,t)||this}O.prototype.getModuleName=function(){return"ribbonFileMenu"},O.prototype.destroy=function(){this.fileMenuDDB&&this.destroyDDB(),this.parent=null},O.prototype.createFileMenu=function(e){var t,o,i=this;e.visible&&(this.ddbElement=this.parent.createElement("button",{id:this.parent.element.id+Oo}),o=(t=this.parent.tabObj.element).querySelector(".e-toolbar"),t.insertBefore(this.ddbElement,o),this.fileMenuDDB=new M.DropDownButton({content:e.text,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-file-menu e-caret-hide",created:function(){t.style.setProperty(Mo,i.ddbElement.offsetWidth+"px")},beforeClose:this.ddbBeforeEvent.bind(this,!1),beforeOpen:this.ddbBeforeEvent.bind(this,!0),close:this.ddbAfterEvent.bind(this,!1),open:this.ddbAfterEvent.bind(this,!0)},this.ddbElement),this.parent.fileMenu.popupTemplate?this.fileMenuDDB.setProperties({target:this.parent.fileMenu.popupTemplate}):this.createRibbonMenu(e),this.parent.tabObj.refreshActiveTabBorder(),this.addFileMenuTooltip(e),this.addFileMenuKeytip())},O.prototype.addFileMenuTooltip=function(e){Qo(e.ribbonTooltipSettings)&&(this.ddbElement.classList.add(io),this.parent.tooltipData.push({id:this.ddbElement.id,data:e.ribbonTooltipSettings}))},O.prototype.addFileMenuKeytip=function(){this.parent.fileMenu.keyTip&&(this.parent.keyTipElements.filemenu=[],this.parent.keyTipElements.filemenu.push({id:this.ddbElement.id,type:"filemenu",keyTip:this.parent.fileMenu.keyTip}))},O.prototype.ddbBeforeEvent=function(e,t){!e&&t.event&&t.event.target.closest(".e-ribbon-menu")&&(t.cancel=!0);var o,e=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;e&&(o={cancel:t.cancel,element:t.element,event:t.event},e.call(this,o),t.cancel=o.cancel)},O.prototype.ddbAfterEvent=function(e,t){(e?this.fileMenuDDB.target:this.fileMenuDDB.element).focus();e=e?this.parent.fileMenu.open:this.parent.fileMenu.close;e&&(t={element:t.element},e.call(this,t))},O.prototype.cloneMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];t.push({iconCss:i.iconCss,id:i.id,separator:i.separator,text:i.text,url:i.url,items:this.cloneMenuItem(i.items)})}return t},O.prototype.createRibbonMenu=function(e){var t=this,o=this.parent.createElement("ul",{id:this.parent.element.id+Po});this.fileMenuDDB.setProperties({target:o}),this.menuctrl=new L.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-menu",animationSettings:e.animationSettings,items:this.cloneMenuItem(e.menuItems),showItemOnClick:e.showItemOnClick,template:e.itemTemplate,beforeClose:this.menuBeforeEvent.bind(this,!1),beforeOpen:this.menuBeforeEvent.bind(this,!0),beforeItemRender:this.beforeItemRender.bind(this),onClose:this.menuAfterEvent.bind(this,!1),onOpen:this.menuAfterEvent.bind(this,!0),select:this.menuSelect.bind(this)},o),x.EventHandler.add(o,"keydown",function(e){"Tab"===e.key&&t.fileMenuDDB.toggle()},this)},O.prototype.menuBeforeEvent=function(e,t){var o,e=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;e&&(o={cancel:t.cancel,element:t.element,event:t.event,items:t.items,parentItem:t.parentItem},e.call(this,o),t.cancel=o.cancel)},O.prototype.menuAfterEvent=function(e,t){e=e?this.parent.fileMenu.open:this.parent.fileMenu.close;e&&(t={element:t.element,items:t.items,parentItem:t.parentItem},e.call(this,t))},O.prototype.beforeItemRender=function(e){var t=this.parent.fileMenu.beforeItemRender;t&&(e={element:e.element,item:e.item},t.call(this,e))},O.prototype.menuSelect=function(e){var t=this.parent.fileMenu.select,t=(t&&(o={element:e.element,item:e.item,event:e.event},t.call(this,o)),!!e.element.closest(".e-ribbon-menu.e-popup-open")),o=!!e.element.closest(".e-ribbon-file-menu.e-popup-open"),i=!!document.querySelector(".e-ribbon-file-menu.e-popup-open"),o=o||t&&i;!e.element.classList.contains("e-menu-caret-icon")&&o&&this.fileMenuDDB.toggle()},O.prototype.setCommonProperties=function(e){this.fileMenuDDB&&(this.fileMenuDDB.setProperties(e),this.menuctrl)&&this.menuctrl.setProperties(e)},O.prototype.updateFileMenu=function(e){e.visible?this.fileMenuDDB?(e.text&&(this.fileMenuDDB.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(Mo,this.ddbElement.offsetWidth+"px")),e.popupTemplate?(this.menuctrl&&this.destroyMenu(),this.fileMenuDDB.setProperties({target:e.popupTemplate})):this.menuctrl?this.menuctrl.setProperties({animationSettings:e.animationSettings,items:this.cloneMenuItem(e.menuItems),showItemOnClick:e.showItemOnClick,template:e.itemTemplate}):this.createRibbonMenu(e),this.removeFileMenuTooltip(),this.removeFileMenuKeytip(),this.addFileMenuTooltip(e),this.addFileMenuKeytip()):this.createFileMenu(e):this.fileMenuDDB&&this.destroyDDB(),this.parent.tabObj.refreshActiveTabBorder()},O.prototype.destroyMenu=function(){this.menuctrl&&(this.menuctrl.destroy(),this.menuctrl=null)},O.prototype.destroyDDB=function(){this.removeFileMenuTooltip(),this.removeFileMenuKeytip(),this.parent.tabObj.element.style.removeProperty(Mo),this.destroyMenu(),this.fileMenuDDB.destroy(),this.fileMenuDDB=null,x.remove(this.ddbElement),this.ddbElement=null},O.prototype.removeFileMenuTooltip=function(){var t=this,e=S(this.parent.tooltipData,function(e){return e.id===t.ddbElement.id});-1!==e&&(this.ddbElement.classList.remove(io),this.parent.tooltipData.splice(e,1))},O.prototype.removeFileMenuKeytip=function(){var e,t=this;this.parent.keyTipElements.filemenu&&-1!==(e=S(this.parent.keyTipElements.filemenu,function(e){return e.id===t.ddbElement.id}))&&this.parent.keyTipElements.filemenu.splice(e,1)},O.prototype.addItems=function(e,t,o,i){o?this.menuctrl.insertAfter(e,t,i):this.menuctrl.insertBefore(e,t,i),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},O.prototype.removeItems=function(e,t){this.menuctrl.removeItems(e,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},O.prototype.enableItems=function(e,t){this.menuctrl.enableItems(e,!0,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},O.prototype.disableItems=function(e,t){this.menuctrl.enableItems(e,!1,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},O.prototype.setItem=function(e,t,o){this.menuctrl.setItem(e,t,o),this.menuctrl.refresh(),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)};T=O;function O(e){this.parent=e}di=function(e,t){return(di=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}))(e,t)};var di,ui,hi=function(e,t){function o(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},hi=(ui=x.Component,hi(B,ui),B.prototype.render=function(){},B.prototype.preRender=function(){},B.prototype.getPersistData=function(){return""},B.prototype.onPropertyChanged=function(){},B.prototype.getModuleName=function(){return"ribbonBackstage"},B.prototype.destroy=function(){this.backstageButton&&this.destroyDDB(),this.parent=null},B.prototype.createBackStage=function(r){var n=this;if(r.visible){this.backstageButtonEle=this.parent.createElement("button",{id:this.parent.element.id+Bo});var e=this.parent.tabObj.element,t=e.querySelector(".e-toolbar");if(e.insertBefore(this.backstageButtonEle,t),this.backstageButton=new u.Button({content:r.text,enableRtl:this.parent.enableRtl,cssClass:bo,created:function(){e.style.setProperty(Mo,n.backstageButtonEle.offsetWidth+"px")}},this.backstageButtonEle),this.createBackStagePopup(r),this.parent.backStageMenu.template)this.createBackStageTemplate(this.parent.backStageMenu.template);else{for(var o=0,i=0,s=0;s<r.items.length;s++)r.items[parseInt(s.toString(),10)].isFooter?o++:i++;0<i&&this.createBackstageMenu(r,!1),0<o&&this.createBackstageMenu(r,!0),this.menuCtrl&&this.checkMenuItems(this.menuCtrl.items),this.footerMenuCtrl&&this.checkMenuItems(this.footerMenuCtrl.items)}this.backstageButtonEle.onclick=function(e){e.stopPropagation(),n.showBackstage(),n.popupHTMLElement.classList.add(uo);e=n.menuWrapper.querySelector(".e-menu-item.e-selected");e&&e.classList.remove("e-selected");for(var t=0;t<r.items.length;t++){var o=r.items[parseInt(t.toString(),10)];if(!o.isFooter&&n.menuCtrl.items[0].text===o.text){var i=n.popupHTMLElement.querySelector("#"+n.menuCtrl.items[0].id);i&&(i.classList.add("e-selected"),i.focus(),n.menuIndex=0,n.isCloseBtn=!1),n.createBackStageContent(n.menuCtrl.items[0].id,o.content);break}}},this.parent.tabObj.refreshActiveTabBorder(),this.addBackStageMenuTooltip(r),this.addBackStageMenuKeyTip(r),x.EventHandler.add(document,"click",this.onClickEvent,this)}},B.prototype.onClickEvent=function(e){e=e.target;this.popupHTMLElement.contains(e)||this.hideBackstage()},B.prototype.addBackStageMenuTooltip=function(e){Qo(e.ribbonTooltipSettings)&&(this.backstageButtonEle.classList.add(io),this.parent.tooltipData.push({id:this.backstageButtonEle.id,data:e.ribbonTooltipSettings}))},B.prototype.addBackStageMenuKeyTip=function(e){if(e.keyTip&&(this.parent.keyTipElements.backstage||(this.parent.keyTipElements.backstage=[]),this.parent.keyTipElements.backstage.push({id:this.backstageButtonEle.id,type:"backstage",keyTip:e.keyTip})),e.items&&e.items.length){this.parent.keyTipElements.backstageMenu||(this.parent.keyTipElements.backstageMenu=[]);for(var t=0;t<e.items.length;t++)e.items[parseInt(t.toString(),10)].keyTip&&this.parent.keyTipElements.backstageMenu.push({id:e.items[parseInt(t.toString(),10)].id,type:"backstageMenu",keyTip:e.items[parseInt(t.toString(),10)].keyTip})}},B.prototype.checkMenuItems=function(e){for(var t=0;t<e.length;t++){var o=e[parseInt(t.toString(),10)];o.iconCss||this.popupHTMLElement.querySelector("#"+o.id).classList.add(vo)}},B.prototype.createBackStagePopup=function(e){var t=this;this.popupHTMLElement=this.parent.createElement("div",{id:this.parent.element.id+Lo,className:co}),(e.target?e.target instanceof HTMLElement?e.target:document.querySelector(e.target):this.parent.element).appendChild(this.popupHTMLElement),this.popupEle=new D.Popup(this.popupHTMLElement,{height:e.height,width:e.width,relateTo:e.target||this.parent.element,enableRtl:this.parent.enableRtl}),this.parent.enableRtl&&this.updatePopupPositionOnRtl(this.parent.enableRtl),this.hideBackstage(),x.EventHandler.add(this.popupHTMLElement,"keyup",function(e){"Escape"===e.code&&t.hideBackstage(),t.handleNavigation(e)},this)},B.prototype.handleNavigation=function(e){var t=this.popupHTMLElement.querySelector(".e-ribbon-close-btn"),o=this.popupHTMLElement.querySelectorAll(".e-menu-item"),i="ArrowUp"===e.key,e="ArrowDown"===e.key;if(i||e){i&&0<this.menuIndex||e&&this.menuIndex<o.length-1&&!this.isCloseBtn?this.menuIndex=i?this.menuIndex-1:this.menuIndex+1:t&&!this.isCloseBtn?(t.focus(),this.isCloseBtn=!0):(this.menuIndex=i?o.length-1:0,this.isCloseBtn=!1);for(var r=0;r<o.length;r++)o[parseInt(r.toString(),10)].classList.remove("e-focused");this.isCloseBtn||(i&&o[this.menuIndex].classList.contains("e-separator")?this.menuIndex--:e&&o[this.menuIndex].classList.contains("e-separator")&&this.menuIndex++,o[this.menuIndex].classList.add("e-focused"),o[this.menuIndex].focus())}},B.prototype.updatePopupPositionOnRtl=function(e){var t=this.popupHTMLElement.style;e?(t.right=t.left,t.left="unset"):(t.left=t.right,t.right="unset")},B.prototype.createBackstageMenu=function(e,t){var o,i,r=this;this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_wrapper")||(this.menuWrapper=this.parent.createElement("div",{id:this.parent.element.id+"_wrapper",className:fo}),this.popupHTMLElement.appendChild(this.menuWrapper)),e.backButton.visible&&!t&&(o=this.parent.createElement("button",{id:this.parent.element.id+"_close",className:"e-ribbon-close-btn"}),this.closeBtn=new u.Button({content:e.backButton.text,iconCss:e.backButton.iconCss||it,enableRtl:this.parent.enableRtl},o),this.menuWrapper.append(o),o.onclick=function(){r.popupHTMLElement.classList.remove(uo),r.hideBackstage(),r.isBackButtonClicked=!0}),this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_itemswrapper")||(this.itemsWrapperEle=this.parent.createElement("div",{id:this.parent.element.id+"_itemswrapper",className:go}),this.menuWrapper.append(this.itemsWrapperEle)),t?(i=this.parent.createElement("ul",{id:this.parent.element.id+Do}),this.itemsWrapperEle.appendChild(i)):(this.ulMenuElem=this.parent.createElement("ul",{id:this.parent.element.id+Eo}),this.itemsWrapperEle.appendChild(this.ulMenuElem)),t?this.footerMenuCtrl=new L.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:mo,items:this.cloneFooterMenuItem(e.items),select:this.menuSelect.bind(this,e)},i):this.menuCtrl=new L.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:mo,items:this.cloneMenuItem(e.items),select:this.menuSelect.bind(this,e)},this.ulMenuElem)},B.prototype.cloneMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];i.isFooter||t.push({id:i.id,iconCss:i.iconCss,separator:i.separator,text:i.text})}return t},B.prototype.cloneFooterMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];i.isFooter&&t.push({id:i.id,iconCss:i.iconCss,separator:i.separator,text:i.text})}return t},B.prototype.createBackStageContent=function(e,t){var o="backstageContent",e=(this.clearTemplate([o]),this.backstageContentEle?(this.backstageContentEle.innerHTML="",this.backstageContentEle.id=e+A):this.backstageContentEle=this.parent.createElement("div",{id:e+A,className:ho}),Uo(t));return x.append(e({},this,o,"backstageContent",this.parent.isStringTemplate),this.backstageContentEle),t&&this.popupHTMLElement.append(this.backstageContentEle),this.renderReactTemplates(),e},B.prototype.createBackStageTemplate=function(e){var t="backstageTemplate",e=(this.clearTemplate([t]),this.backstageTempEle=this.parent.createElement("div",{id:this.parent.element.id+Bo+"_template",className:yo}),Uo(e));return x.append(e({},this,t,"backstageTemplate",this.parent.isStringTemplate),this.backstageTempEle),this.popupHTMLElement.append(this.backstageTempEle),this.renderReactTemplates(),e},B.prototype.menuSelect=function(e,t){for(var o=0;o<e.items.length;o++){var i=e.items[parseInt(o.toString(),10)];if(i.text===t.item.text){this.contentItem=i,this.menuIndex=o;break}}this.createBackStageContent(t.item.id,this.contentItem.content);var r={cancel:!1,target:t.element,item:this.contentItem,isBackButton:this.isBackButtonClicked};this.contentItem.backStageItemClick&&this.contentItem.backStageItemClick.call(this,r)},B.prototype.setCommonProperties=function(e){this.backstageButton&&(this.backstageButton.setProperties(e),this.popupEle)&&(this.popupEle.setProperties(e),this.popupHTMLElement&&this.updatePopupPositionOnRtl(e.enableRtl),this.menuCtrl&&(this.menuCtrl.setProperties(e),this.closeBtn)&&this.closeBtn.setProperties(e),this.footerMenuCtrl)&&this.footerMenuCtrl.setProperties(e)},B.prototype.updateBackStageMenu=function(e){if(e.visible)if(this.backstageButton){if(e.text&&(this.backstageButton.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(Mo,this.backstageButtonEle.offsetWidth+"px")),this.popupEle&&this.popupEle.setProperties({height:e.height,width:e.width,target:e.target||this.parent.element}),e.template)this.backstageTempEle&&(x.remove(this.backstageTempEle),this.backstageTempEle=null),this.createBackStageTemplate(e.template);else if(this.menuCtrl&&this.menuCtrl.setProperties({items:this.cloneMenuItem(e.items)}),this.footerMenuCtrl)this.footerMenuCtrl.setProperties({items:this.cloneFooterMenuItem(e.items)});else{for(var t=0,o=0,i=0;i<e.items.length;i++)e.items[parseInt(i.toString(),10)].isFooter?t++:o++;0<o&&this.createBackstageMenu(e,!1),0<t&&this.createBackstageMenu(e,!0)}this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip(),this.addBackStageMenuTooltip(e),this.addBackStageMenuKeyTip(e)}else this.createBackStage(e);else this.backstageButton&&this.destroyDDB();this.parent.tabObj.refreshActiveTabBorder()},B.prototype.destroyMenu=function(){this.menuCtrl&&(this.menuCtrl.destroy(),this.menuCtrl=null)},B.prototype.destroyDDB=function(){this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip(),this.parent.tabObj.element.style.removeProperty(Mo),this.destroyMenu(),this.backstageButton.destroy(),this.backstageButton=null,x.remove(this.backstageButtonEle),this.backstageButtonEle=null,x.EventHandler.remove(document,"click",this.onClickEvent)},B.prototype.removeBackstageMenuTooltip=function(){var t=this,e=S(this.parent.tooltipData,function(e){return e.id===t.backstageButtonEle.id});-1!==e&&(this.backstageButtonEle.classList.remove(io),this.parent.tooltipData.splice(e,1))},B.prototype.removeBackstageMenuKeyTip=function(){var e,t=this;if(this.parent.keyTipElements.backstage&&this.parent.keyTipElements.backstage.length&&-1!==(e=S(this.parent.keyTipElements.backstage,function(e){return e.id===t.backstageButtonEle.id}))&&this.parent.keyTipElements.backstage.splice(e,1),this.parent.keyTipElements.backstageMenu&&this.parent.keyTipElements.backstageMenu.length)for(var o=0;o<this.parent.keyTipElements.backstageMenu.length;o++)this.parent.keyTipElements.backstageMenu.splice(o,1),o--},B.prototype.addBackstageItems=function(e,t,o,i){for(var r=0;r<e.length;r++)(a=e[parseInt(r.toString(),10)]).isFooter?o?this.footerMenuCtrl.insertAfter(e,t,i):this.footerMenuCtrl.insertBefore(e,t,i):o?this.menuCtrl.insertAfter(e,t,i):this.menuCtrl.insertBefore(e,t,i);for(var n=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items),s=this.parent.backStageMenu,r=0;r<s.items.length;r++)for(var a=s.items[parseInt(r.toString(),10)],l=0;l<n.length;l++){var p=n[parseInt(l.toString(),10)];if(a.text===p.text){p.content=a.content;break}}this.parent.backStageMenu.setProperties({items:n},!0)},B.prototype.removeBackstageItems=function(e,t){this.menuCtrl.removeItems(e,t),this.footerMenuCtrl.removeItems(e,t);e=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items);this.parent.backStageMenu.setProperties({items:e},!0)},B.prototype.showBackstage=function(){this.popupEle.show()},B.prototype.hideBackstage=function(){this.popupEle.element.classList.contains(uo)&&this.popupEle.element.classList.remove(uo),this.popupEle.hide()},B);function B(e){var t=ui.call(this)||this;return t.parent=e,t}mi.prototype.getModuleName=function(){return"ribbonContextualTab"},mi.prototype.destroy=function(){this.parent=null},mi.prototype.addContextualTabs=function(){for(var e=!1,t=0;t<this.parent.contextualTabs.length;t++)for(var o=0;o<this.parent.contextualTabs[parseInt(t.toString(),10)].tabs.length;o++){this.parent.addTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(o.toString(),10)]);var i=this.parent.tabs.length-1,i=this.parent.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(i.toString(),10)];i.classList.add(yt),i.classList.add("e-hidden"),this.parent.contextualTabs[parseInt(t.toString(),10)].visible&&(this.parent.showTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(o.toString(),10)].id,!0),this.parent.contextualTabs[parseInt(t.toString(),10)].isSelected)&&!e&&(this.parent.selectTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[0].id),e=!0)}},mi.prototype.updateContextualTabs=function(e,o){if(!x.isNullOrUndefined(e.visible))for(var t=0;t<o.tabs.length;t++)e.visible?this.parent.showTab(o.tabs[parseInt(t.toString(),10)].id,!0):this.parent.hideTab(o.tabs[parseInt(t.toString(),10)].id,!0);if(!x.isNullOrUndefined(e.isSelected))if(e.isSelected&&o.visible)this.parent.selectTab(o.tabs[0].id);else for(var i=this.parent.tabObj.element,t=0;t<this.parent.tabs.length;t++){var r=i.querySelectorAll(".e-toolbar-item")[parseInt(t.toString(),10)];if(!r.classList.contains("e-hidden")&&!r.classList.contains("e-disable")){this.parent.selectTab(this.parent.tabs[parseInt(t.toString(),10)].id);break}}if(e.tabs)for(var n=this,s=0,a=Object.keys(e.tabs);s<a.length;s++)!function(e){var t=parseInt(e,10),e=n.parent.tabs.filter(function(e){return e.id===o.tabs[parseInt(t.toString(),10)].id})[0];n.parent.updateTab(e)}(a[s])};var bi=mi;function mi(e){this.parent=e}fi.prototype.getModuleName=function(){return"ribbonKeyTip"},fi.prototype.destroy=function(){this.parent=null},fi.prototype.createKeytip=function(e){if(this.parent.keyTipElements){var t=void 0;if("tab"===e){for(var o=0;o<this.parent.tabs.length;o++)this.parent.keyTipElements[parseInt(o.toString(),10)]&&(t=this.parent.keyTipElements[parseInt(o.toString(),10)][""+e],this.createKeyTipElement(t[0].id,t[0].keyTip,"tab","center","bottom",!0));this.parent.keyTipElements.filemenu&&(t=this.parent.keyTipElements.filemenu,this.createKeyTipElement(t[0].id,t[0].keyTip,"filemenu")),this.parent.keyTipElements.backstage&&(t=this.parent.keyTipElements.backstage,this.createKeyTipElement(t[0].id,t[0].keyTip,"backstage")),this.parent.keyTipElements.collapse&&(t=this.parent.keyTipElements.collapse,this.createKeyTipElement(t[0].id,t[0].keyTip,"collapse")),this.parent.keyTipElements.taboverflow&&(t=this.parent.keyTipElements.taboverflow,this.createKeyTipElement(t[0].id,t[0].keyTip,"taboverflow"))}else if("popupitem"===e){if(this.parent.keyTipElements[this.parent.selectedTab].popupitem)for(var i=this.parent.keyTipElements[this.parent.selectedTab].popupitem,o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].popupitem).length;o++)this.createKeyTipElement(i[parseInt(o.toString(),10)].id,i[parseInt(o.toString(),10)].keyTip,"popupitem","left","top",!1,!0)}else if("backstageMenu"===e){if(this.parent.keyTipElements.backstageMenu)for(var r=this.parent.keyTipElements.backstageMenu,o=0;o<Object.keys(this.parent.keyTipElements.backstageMenu).length;o++)this.createKeyTipElement(r[parseInt(o.toString(),10)].id,r[parseInt(o.toString(),10)].keyTip,"backstageMenu","left","center")}else if("grpoverflowpopup"===e&&"Classic"===this.parent.activeLayout){if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflowpopup&&this.calculateItemPosition(e),this.parent.keyTipElements[this.parent.selectedTab].launcher)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"launcher","center","bottom",!1,!0)}else{if(this.calculateItemPosition(e),"Classic"===this.parent.activeLayout){if(this.parent.keyTipElements[this.parent.selectedTab].launcher)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"launcher");if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].grpoverflow,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"grpoverflow")}if("Simplified"===this.parent.activeLayout&&(this.parent.keyTipElements.overflowbtn&&(t=this.parent.keyTipElements.overflowbtn,this.createKeyTipElement(t[0].id,t[0].keyTip,"overflowbtn")),this.parent.keyTipElements[this.parent.selectedTab].grpofbtn))for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpofbtn).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].grpofbtn,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"grpofbtn")}}},fi.prototype.calculateItemPosition=function(e,t,o){void 0===t&&(t=!1);var i,r,n=this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][""+e];if(n)for(var s,a=0;a<Object.keys(this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][""+e]).length;a++)(t&&n[parseInt(a.toString(),10)].keyTip===o||!t)&&(s=n[parseInt(a.toString(),10)].id,-1!==n[parseInt(a.toString(),10)].id.indexOf("_grpbtn")&&(s=n[parseInt(a.toString(),10)].id.replace(/_grpbtn\d+/,"")),(s=g(this.parent.tabs,s))&&"Column"===s.group.orientation&&1<s.collection.items.length&&"Simplified"!==this.parent.activeLayout?r=0===s.itemIndex?(i="center","top"):1===s.itemIndex?i="center":(i="center","bottom"):s&&"Row"===s.group.orientation&&1<s.group.collections.length&&"Simplified"!==this.parent.activeLayout&&(r=0===s.collectionIndex?(i="center","top"):(i="center","bottom")),"item"===e?this.createKeyTipElement(n[parseInt(a.toString(),10)].id,n[parseInt(a.toString(),10)].keyTip,e,i,r):this.createKeyTipElement(n[parseInt(a.toString(),10)].id,n[parseInt(a.toString(),10)].keyTip,e,i,r,!1,!0))},fi.prototype.createKeyTipElement=function(e,t,o,i,r,n,s){void 0===i&&(i="center"),void 0===r&&(r="bottom"),void 0===n&&(n=!1),void 0===s&&(s=!1);var a,l=document.querySelector("#"+e),p=!1;(l=n?document.querySelector("#"+e+q):l)&&(l.closest(".e-ribbon-group-overflow-ddb")&&(p=!0),n&&s&&l.closest(".e-toolbar-pop")&&(p=!0),l.closest(".e-split-btn-wrapper")?a=l.closest(".e-split-btn-wrapper").closest(".e-ribbon-item").id:l.closest(".e-colorpicker-wrapper")&&(a=(l=l.closest(".e-colorpicker-wrapper")).closest(".e-ribbon-item").id)),(l&&l.offsetParent||n&&s)&&(s&&p||!s)&&(p=this.parent.createElement("div",{className:ut,id:e+xo,attrs:{role:"dialog","aria-label":"ribbon-keytip"}}),document.body.append(p),new D.Popup(p,{relateTo:"#"+(n?e+q:a||e),content:t,collision:{X:"fit",Y:"flip"},targetType:"relative",position:{X:i,Y:r},enableRtl:this.parent.enableRtl,actionOnScroll:"hide"}).show(),this.calculateKeyTipPosition(l,p,o,r),this.parent.isKeytipOpen=!0)},fi.prototype.calculateKeyTipPosition=function(e,t,o,i){var r=e.getBoundingClientRect();"backstageMenu"===o?(t.style.top=r.top+t.offsetHeight/2+"px",t.style.left=r.left+e.offsetWidth/5+"px"):"popupitem"!==o&&(t.style.left=r.left+(r.width-t.offsetWidth)/2+"px"),"filemenu"===o||"backstage"===o?t.style.top=r.top+(e.offsetHeight-e.offsetHeight/3+t.offsetHeight/6)+"px":"item"===o&&"top"===i&&(t.style.top=r.top-e.offsetHeight/2+"px")},fi.prototype.keytipPress=function(e,t){var o=this;void 0===t&&(t=!1),this.isKeytipPresent=!1;for(var i=0;i<Object.keys(this.parent.keyTipElements).length&&!this.isKeytipPresent;i++)if(this.parent.keyTipElements[parseInt(i.toString(),10)])for(var r=0;r<Object.keys(this.parent.keyTipElements[parseInt(i.toString(),10)]).length&&!this.isKeytipPresent;r++)for(var n,s,a,l=this.parent.keyTipElements[parseInt(i.toString(),10)][Object.keys(this.parent.keyTipElements[parseInt(i.toString(),10)])[parseInt(r.toString(),10)]],p=0;p<Object.keys(l).length&&!this.isKeytipPresent;p++)e.toUpperCase()===l[parseInt(p.toString(),10)].keyTip&&(document.querySelector("#"+l[parseInt(p.toString(),10)].id+xo)||t)&&(this.isKeytipPresent=!0,this.removeKeytip(),"tab"===l[parseInt(p.toString(),10)].type?i!==this.parent.selectedTab?(this.parent.tabObj.select(i),setTimeout(function(){var e=o.parent.tabObj.element.querySelector(".e-nav-active");e&&e.click(),o.createKeytip("item")},600)):this.createKeytip("item"):"item"===l[parseInt(p.toString(),10)].type||"grpoverflowpopup"===l[parseInt(p.toString(),10)].type||"popupitem"===l[parseInt(p.toString(),10)].type?document.getElementById(l[parseInt(p.toString(),10)].id)&&document.getElementById(l[parseInt(p.toString(),10)].id).classList.contains("e-ribbon-group-button")?document.getElementById(l[parseInt(p.toString(),10)].id).click():(a=void 0,a=-1!==l[parseInt(p.toString(),10)].id.indexOf("_popupButton")?(n=l[parseInt(p.toString(),10)].id.replace(/_popupButton/g,""),g(this.parent.tabs,n)):g(this.parent.tabs,l[parseInt(p.toString(),10)].id),t&&a.tabIndex!==this.parent.selectedTab||this.clickItems(a,l,p,!1,t)):"grpoverflow"!==l[parseInt(p.toString(),10)].type&&"grpofbtn"!==l[parseInt(p.toString(),10)].type&&"launcher"!==l[parseInt(p.toString(),10)].type||(n=document.querySelector("#"+l[parseInt(p.toString(),10)].id),this.removeKeytip(),n&&(s=l[parseInt(p.toString(),10)].id,t?-1===l[parseInt(p.toString(),10)].id.indexOf("_launcher")&&-1===l[parseInt(p.toString(),10)].id.indexOf("_sim_grp_overflow")&&-1===l[parseInt(p.toString(),10)].id.indexOf("_overflow_dropdown")||(s=l[parseInt(p.toString(),10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g,""),(a=Xo(this.parent.tabs,s)).tabIndex===this.parent.selectedTab&&this.clickItems(a,l,p,!0,t,n)):this.clickItems(null,l,p,!0,t,n))));else this.parent.keyTipElements&&this.commonItemsKeyTipPress(e,Object.keys(this.parent.keyTipElements)[parseInt(i.toString(),10)],t)},fi.prototype.clickItems=function(e,t,o,i,r,n){if(i)n.click(),"launcher"!==t[parseInt(o.toString(),10)].type&&(this.isKeytipPopupOpen=!0,"grpoverflow"===t[parseInt(o.toString(),10)].type?this.createKeytip("grpoverflowpopup"):this.createKeytip("popupitem"));else{var s=t[parseInt(o.toString(),10)].id;switch(document.querySelector("#"+s)&&r&&("Simplified"===this.parent.activeLayout?document.querySelector("#"+s).closest("#"+e.group.id+"_sim_grp_overflow-popup")&&document.querySelector("#"+s).closest("#"+e.group.id+"_sim_grp_overflow-popup").classList.contains("e-popup-close")?document.querySelector("#"+e.group.id+"_sim_grp_overflow").click():document.querySelector("#"+s).closest("#"+this.parent.tabObj.element.id+wo+"-popup")&&document.querySelector("#"+s).closest("#"+this.parent.tabObj.element.id+wo+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+this.parent.tabObj.element.id+wo).click():document.querySelector("#"+s).closest("#"+e.group.id+w+ko+"-popup")&&document.querySelector("#"+s).closest("#"+e.group.id+w+ko+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+e.group.id+w+ko).click()),this.parent.getItemModuleName(e.item)){case"btn":this.parent.ribbonButtonModule.click(s);break;case"dropdown-btn":this.parent.ribbonDropDownModule.toggle(s);break;case"split-btn":this.parent.ribbonSplitButtonModule.toggle(s);break;case"checkbox":this.parent.ribbonCheckBoxModule.click(s);break;case"colorpicker":this.parent.ribbonColorPickerModule.toggle(s);break;case"combobox":var a=document.querySelector("#"+s);this.isInteractableElement(a)&&setTimeout(function(){a.focus()},100);break;case"gallery":var l=document.querySelector("#"+s);this.isInteractableElement(l)&&l.click();break;case"template":l=document.querySelector("#"+s);this.isInteractableElement(l)&&l.focus();break;case"group-btn":l=document.querySelector("#"+s);if(this.isInteractableElement(l)){x.getInstance(l,M.DropDownButton).toggle();for(var p=0;p<e.item.groupButtonSettings.items.length;p++)e.item.groupButtonSettings.items[parseInt(p.toString(),10)].keyTip&&this.createKeyTipElement(s+G+p,e.item.groupButtonSettings.items[parseInt(p.toString(),10)].keyTip,"item")}}}},fi.prototype.isInteractableElement=function(e){return e&&!e.closest(".e-ribbon-item").classList.contains("e-disabled")},fi.prototype.commonItemsKeyTipPress=function(e,t,o){var i=this;if(this.parent.keyTipElements[""+t]){var r=!1,n=this.parent.keyTipElements[""+t],s=void 0;if(n)if("backstageMenu"===t){for(var a=0;a<Object.keys(this.parent.keyTipElements[""+t]).length;a++)if(n[parseInt(a.toString(),10)].keyTip===e.toUpperCase()&&(s=document.querySelector("#"+n[parseInt(a.toString(),10)].id),document.querySelector("#"+s.id+xo)||o)){r=!0,o&&document.querySelector(".e-ribbon-backstage-popup").classList.contains("e-popup-close")&&this.parent.tabObj.element.querySelector(".e-ribbon-backstage").click();break}}else n[0]&&n[0].keyTip===e.toUpperCase()&&(s=document.querySelector("#"+n[0].id),document.querySelector("#"+n[0].id+xo)||o)&&(r=!0);r&&(this.removeKeytip(),this.isKeytipPresent=!0,s)&&(s.click(),"backstage"===t?this.createKeytip("backstageMenu"):"overflowbtn"===t?(this.isKeytipPopupOpen=!0,this.createKeytip("popupitem")):"taboverflow"===t&&setTimeout(function(){for(var e,t=0;t<Object.keys(i.parent.keyTipElements).length;t++)i.parent.keyTipElements[parseInt(t.toString(),10)]&&(e=i.parent.keyTipElements[parseInt(t.toString(),10)].tab,i.createKeyTipElement(e[0].id,e[0].keyTip,"tab","center","bottom",!0,!0))},600))}},fi.prototype.removeKeytip=function(s){for(var a=this,l=document.querySelectorAll(".e-ribbon-keytip"),p=!1,c=(this.parent.keysPress="",this),e=0;e<l.length;e++)!function(t){var e=l[parseInt(t.toString(),10)];if("Escape"===s&&c.parent.keyTipElements&&c.parent.keyTipElements[c.parent.selectedTab]){for(var o=0;o<Object.keys(c.parent.keyTipElements[c.parent.selectedTab]).length;o++){var i=Object.keys(c.parent.keyTipElements[parseInt(c.parent.selectedTab.toString(),10)])[parseInt(o.toString(),10)];if(-1!==S(c.parent.keyTipElements[parseInt(c.parent.selectedTab.toString(),10)][""+i],function(e){return e.id+xo===l[parseInt(t.toString(),10)].id})){if("item"===i&&!c.isKeytipPopupOpen||"grpoverflow"===i&&"Classic"===c.parent.activeLayout){c.createKeytip("tab"),p=!(s="");break}if(c.isKeytipPopupOpen&&("popupitem"===i&&"Simplified"===c.parent.activeLayout||"grpoverflowpopup"===i&&"Classic"===c.parent.activeLayout)){c.createKeytip("item"),p=!(s="");break}}}for(var r=0;r<Object.keys(c.parent.keyTipElements).length;r++)if(c.parent.keyTipElements[parseInt(r.toString(),10)]){for(var n=c.parent.keyTipElements[parseInt(r.toString(),10)].tab,o=0;o<Object.keys(n).length;o++)if(e.id===n[0].id+xo&&document.querySelector("#"+n[0].id+q).closest(".e-toolbar-pop")){c.parent.tabObj.element.querySelector(".e-nav-active").click(),setTimeout(function(){a.createKeytip("tab")},600),p=!(s="");break}if(p)break}!p&&c.parent.keyTipElements.backstageMenu&&-1!==S(c.parent.keyTipElements.backstageMenu,function(e){return e.id+xo===l[parseInt(t.toString(),10)].id})&&(c.createKeytip("tab"),p=!(s=""))}e&&x.remove(e)}(e);this.isKeytipPopupOpen=!1,p||(this.parent.isKeytipOpen=!1)},fi.prototype.showKeyTips=function(e){this.parent.enableKeyTips&&(e?this.keytipPress(e,!0):this.createKeytip("tab"))},fi.prototype.hideKeyTips=function(){this.removeKeytip()};var yi=fi;function fi(e){this.isKeytipPopupOpen=!1,this.parent=e}R.BACKSTAGE_CLOSE_ICON=it,R.BackStageMenu=Ke,R.BackstageBackButton=m,R.BackstageItem=Ne,R.COLLAPSE_BUTTON_ID=Co,R.COLLECTION_ID=Io,R.CONTAINER_ID=j,R.CONTENT_ID=A,R.DISABLED_CSS=st,R.DROPDOWNBUTTON="e-dropdown-btn",R.DROPDOWNBUTTON_HIDE=$t,R.DROPDOWN_ID=ko,R.EXPAND_COLLAPSE_ICON=ot,R.FileMenuSettings=_e,R.GROUPOF_BUTTON_ID=_,R.GROUP_ID="_group",R.HEADER_ID=q,R.HIDE_CSS=bt,R.HORIZONTAL_SCROLLBAR=ht,R.ITEM_ID="_item",R.ITEM_VERTICAL_CENTER=tt,R.LAUNCHER_ID=To,R.OVERFLOW_ICON=rt,R.OVERFLOW_ID=w,R.OVRLOF_BUTTON_ID=wo,R.RIBBON_BACKSTAGE=bo,R.RIBBON_BACKSTAGE_CONTENT=ho,R.RIBBON_BACKSTAGE_ITEMS_WRAPPER=go,R.RIBBON_BACKSTAGE_MENU=mo,R.RIBBON_BACKSTAGE_MENU_ID=Bo,R.RIBBON_BACKSTAGE_MENU_WRAPPER=fo,R.RIBBON_BACKSTAGE_OPEN=uo,R.RIBBON_BACKSTAGE_POPUP=co,R.RIBBON_BACKSTAGE_POPUP_ID=Lo,R.RIBBON_BACKSTAGE_TEMPLATE=yo,R.RIBBON_BACKSTAGE_TEXT_MENU=vo,R.RIBBON_COLLAPSE_BUTTON=vt,R.RIBBON_COLLAPSIBLE=It,R.RIBBON_COLLECTION=Kt,R.RIBBON_COLUMN=Xt,R.RIBBON_CONTENT_HEIGHT=Qt,R.RIBBON_CONTEXTUAL_TAB=yt,R.RIBBON_CONTROL=pt,R.RIBBON_EXPAND_BUTTON=St,R.RIBBON_FILE_MENU_ID=Oo,R.RIBBON_FILE_MENU_LIST=Po,R.RIBBON_FILE_MENU_WIDTH=Mo,R.RIBBON_FOOTER_MENU_LIST=Do,R.RIBBON_GROUP=Lt,R.RIBBON_GROUP_BUTTON=Dt,R.RIBBON_GROUP_BUTTON_CONTENT=xt,R.RIBBON_GROUP_BUTTON_ID=G,R.RIBBON_GROUP_BUTTON_OVERFLOW_POPUP=Rt,R.RIBBON_GROUP_CONTAINER=Mt,R.RIBBON_GROUP_CONTENT=At,R.RIBBON_GROUP_HEADER=jt,R.RIBBON_GROUP_OF_BUTTON=wt,R.RIBBON_GROUP_OVERFLOW=zt,R.RIBBON_GROUP_OVERFLOW_DDB=Nt,R.RIBBON_HELP_PANE_TEMPLATE_ID=Ro,R.RIBBON_HELP_PANE_TEMPLATE_WIDTH=_o,R.RIBBON_HELP_TEMPLATE=to,R.RIBBON_HOVER=lt,R.RIBBON_ITEM=Ut,R.RIBBON_KEYTIP=ut,R.RIBBON_KEYTIP_ID=xo,R.RIBBON_LARGE_ITEM=Yt,R.RIBBON_LAUNCHER=Ht,R.RIBBON_LAUNCHER_ICON=Ft,R.RIBBON_LAUNCHER_ICON_ELE=Wt,R.RIBBON_MEDIUM_ITEM=Zt,R.RIBBON_MENU_LIST=Eo,R.RIBBON_MINIMIZE=Bt,R.RIBBON_MULTIPLE_BUTTON_SELECTION=Et,R.RIBBON_OF_GROUP_CONTAINER=qt,R.RIBBON_OF_TAB_CONTAINER=_t,R.RIBBON_OVERALL_OF_BUTTON=Ct,R.RIBBON_OVERFLOW=kt,R.RIBBON_OVERFLOW_HEADER=Gt,R.RIBBON_OVERFLOW_TARGET=Tt,R.RIBBON_POPUP_CONTROL=ct,R.RIBBON_POPUP_OPEN=dt,R.RIBBON_ROW=Vt,R.RIBBON_SELECTED_CONTENT="e-ribbon-selected-content",R.RIBBON_SIMPLIFIED_MODE=po,R.RIBBON_SINGLE_BUTTON_SELECTION=Pt,R.RIBBON_SMALL_ITEM=Jt,R.RIBBON_TAB=mt,R.RIBBON_TAB_ACTIVE=ft,R.RIBBON_TAB_ITEM=gt,R.RIBBON_TEMPLATE=eo,R.RIBBON_TEXT_CONTAINER=lo,R.RIBBON_TOOLTIP=oo,R.RIBBON_TOOLTIP_CONTAINER=ao,R.RIBBON_TOOLTIP_CONTENT=no,R.RIBBON_TOOLTIP_ICON=so,R.RIBBON_TOOLTIP_TARGET=io,R.RIBBON_TOOLTIP_TITLE=ro,R.RTL_CSS=at,R.Ribbon=ci,R.RibbonBackstage=hi,R.RibbonButton=qo,R.RibbonButtonSettings=e,R.RibbonCheckBox=jo,R.RibbonCheckBoxSettings=H,R.RibbonCollection=c,R.RibbonColorPicker=$e,R.RibbonColorPickerSettings=U,R.RibbonComboBox=No,R.RibbonComboBoxSettings=t,R.RibbonContextualTab=bi,R.RibbonContextualTabSettings=Ye,R.RibbonDropDown=Wo,R.RibbonDropDownSettings=i,R.RibbonFileMenu=T,R.RibbonGallery=si,R.RibbonGalleryGroup=ye,R.RibbonGalleryItem=ue,R.RibbonGallerySettings=Se,R.RibbonGroup=Pe,R.RibbonGroupButton=ri,R.RibbonGroupButtonItem=re,R.RibbonGroupButtonSettings=le,R.RibbonItem=p,R.RibbonKeyTip=yi,R.RibbonSplitButton=Fo,R.RibbonSplitButtonSettings=n,R.RibbonTab=h,R.RibbonTooltip=a,R.SPACE=v,R.TAB_CONTENT=Ot,R.TAB_ID=So,R.VERTICAL_DDB=nt,R.createTooltip=ei,R.destroyControl=Yo,R.destroyTooltip=ti,R.getCollection=Vo,R.getGroup=Xo,R.getIndex=S,R.getItem=g,R.getItemElement=I,R.getTemplateFunction=Uo,R.isTooltipPresent=Qo,R.setCustomAttributes=ii,R.setToolTipContent=$o,R.updateCommonProperty=Zo,R.updateControlDisabled=Jo,R.updateTooltipProp=oi,Object.defineProperty(R,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-ribbon.umd.min.js.map
|