@syncfusion/ej2-ribbon 25.2.5 → 26.1.38
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/.eslintrc.json +3 -2
- 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 +830 -593
- package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
- package/dist/es6/ej2-ribbon.es5.js +821 -578
- 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 +13 -13
- package/src/ribbon/base/interface.d.ts +14 -0
- package/src/ribbon/base/ribbon-model.d.ts +1 -1
- package/src/ribbon/base/ribbon.d.ts +3 -1
- package/src/ribbon/base/ribbon.js +204 -95
- package/src/ribbon/items/ribbon-button.js +6 -1
- package/src/ribbon/items/ribbon-gallery.d.ts +15 -6
- package/src/ribbon/items/ribbon-gallery.js +164 -96
- package/src/ribbon/items/ribbon-groupbutton.d.ts +1 -0
- package/src/ribbon/items/ribbon-groupbutton.js +11 -3
- package/src/ribbon/models/ribbon-contextual-tab-settings-model.d.ts +1 -1
- package/src/ribbon/models/ribbon-gallery-group-model.d.ts +5 -5
- package/src/ribbon/models/ribbon-gallery-group.d.ts +2 -2
- package/src/ribbon/models/ribbon-gallery-group.js +2 -2
- package/src/ribbon/models/ribbon-gallery-item-model.d.ts +5 -5
- package/src/ribbon/models/ribbon-gallery-item.d.ts +1 -1
- package/src/ribbon/models/ribbon-gallery-item.js +1 -1
- package/src/ribbon/models/ribbon-gallery-settings-model.d.ts +1 -1
- package/src/ribbon/models/ribbon-gallery-settings.d.ts +3 -3
- package/src/ribbon/models/ribbon-gallery-settings.js +2 -2
- package/src/ribbon/modules/ribbon-backstage.d.ts +6 -3
- package/src/ribbon/modules/ribbon-backstage.js +65 -12
- package/src/ribbon/modules/ribbon-contextualtab.js +5 -2
- package/src/ribbon/modules/ribbon-keytip.d.ts +1 -0
- package/src/ribbon/modules/ribbon-keytip.js +58 -46
- package/styles/bootstrap-dark.css +477 -269
- package/styles/bootstrap-dark.scss +18 -1
- package/styles/bootstrap.css +481 -276
- package/styles/bootstrap.scss +18 -1
- package/styles/bootstrap4.css +480 -272
- package/styles/bootstrap4.scss +18 -1
- package/styles/bootstrap5-dark.css +495 -278
- package/styles/bootstrap5-dark.scss +18 -1
- package/styles/bootstrap5.css +495 -278
- package/styles/bootstrap5.scss +18 -1
- package/styles/fabric-dark.css +476 -269
- package/styles/fabric-dark.scss +18 -1
- package/styles/fabric.css +475 -272
- package/styles/fabric.scss +18 -1
- package/styles/fluent-dark.css +497 -277
- package/styles/fluent-dark.scss +18 -1
- package/styles/fluent.css +497 -277
- package/styles/fluent.scss +18 -1
- package/styles/fluent2.css +3893 -0
- package/styles/fluent2.scss +18 -0
- package/styles/highcontrast-light.css +470 -263
- package/styles/highcontrast-light.scss +17 -1
- package/styles/highcontrast.css +476 -273
- package/styles/highcontrast.scss +18 -1
- package/styles/material-dark.css +565 -283
- package/styles/material-dark.scss +18 -1
- package/styles/material.css +564 -289
- package/styles/material.scss +18 -1
- package/styles/material3-dark.css +521 -280
- package/styles/material3-dark.scss +18 -1
- package/styles/material3.css +521 -280
- package/styles/material3.scss +18 -1
- package/styles/ribbon/_bds-definition.scss +58 -20
- package/styles/ribbon/_bootstrap-dark-definition.scss +58 -20
- package/styles/ribbon/_bootstrap-definition.scss +59 -21
- package/styles/ribbon/_bootstrap4-definition.scss +59 -21
- package/styles/ribbon/_bootstrap5-definition.scss +59 -21
- package/styles/ribbon/_bootstrap5.3-definition.scss +398 -0
- package/styles/ribbon/_fabric-dark-definition.scss +57 -19
- package/styles/ribbon/_fabric-definition.scss +58 -20
- package/styles/ribbon/_fluent-definition.scss +61 -23
- package/styles/ribbon/_fluent2-definition.scss +398 -0
- package/styles/ribbon/_fusionnew-definition.scss +52 -14
- package/styles/ribbon/_highcontrast-definition.scss +60 -22
- package/styles/ribbon/_highcontrast-light-definition.scss +51 -13
- package/styles/ribbon/_layout.scss +371 -399
- package/styles/ribbon/_material-dark-definition.scss +58 -20
- package/styles/ribbon/_material-definition.scss +58 -20
- package/styles/ribbon/_material3-definition.scss +58 -19
- package/styles/ribbon/_tailwind-definition.scss +58 -20
- package/styles/ribbon/_theme.scss +118 -170
- package/styles/ribbon/bootstrap-dark.css +477 -269
- package/styles/ribbon/bootstrap.css +481 -276
- package/styles/ribbon/bootstrap4.css +480 -272
- package/styles/ribbon/bootstrap5-dark.css +495 -278
- package/styles/ribbon/bootstrap5.css +495 -278
- package/styles/ribbon/fabric-dark.css +476 -269
- package/styles/ribbon/fabric.css +475 -272
- package/styles/ribbon/fluent-dark.css +497 -277
- package/styles/ribbon/fluent.css +497 -277
- package/styles/ribbon/fluent2.css +3893 -0
- package/styles/ribbon/fluent2.scss +18 -0
- package/styles/ribbon/highcontrast-light.css +470 -263
- package/styles/ribbon/highcontrast.css +476 -273
- package/styles/ribbon/icons/_bootstrap5.3.scss +9 -0
- package/styles/ribbon/icons/_fluent2.scss +9 -0
- package/styles/ribbon/material-dark.css +565 -283
- package/styles/ribbon/material.css +564 -289
- package/styles/ribbon/material3-dark.css +521 -280
- package/styles/ribbon/material3.css +521 -280
- package/styles/ribbon/tailwind-dark.css +531 -280
- package/styles/ribbon/tailwind.css +531 -280
- package/styles/tailwind-dark.css +531 -280
- package/styles/tailwind-dark.scss +18 -1
- package/styles/tailwind.css +531 -280
- package/styles/tailwind.scss +18 -1
- package/CHANGELOG.md +0 -101
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-ribbon.umd.min.js
|
|
3
|
-
* version :
|
|
3
|
+
* version : 26.1.38
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. 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.ej={},e.ej2Base,e.ej2Navigations,e.ej2Dropdowns,e.ej2Splitbuttons,e.ej2Buttons,e.ej2Inputs,e.ej2Popups)}(this,function(e,t,o,i,r,n,s,a){"use strict";function l(e,t){for(var o=0;o<e.length;o++)if(t(e[parseInt(o.toString(),10)],o))return o;return-1}function p(e){if("string"==typeof e){var o="";try{var i=t.select(e);o=i?"SCRIPT"===i.tagName?i.innerHTML:i.outerHTML:e}catch(t){o=e}return t.compile(o)}return t.compile(e)}function c(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 u(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 d(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 h(e,o){t.getComponent(e,o).destroy()}function b(e,o,i){t.getComponent(e,o).setProperties(i)}function m(e,o,i){t.getComponent(e,o).setProperties("combobox"===o?{enabled:!i}:{disabled:i})}function f(o,i,n){if(!n&&!(n=c(o.tabs,i)))return null;var s=o.tabObj.items[n.tabIndex].content;if(""===s.innerHTML)return null;if(o.activeLayout===e.RibbonLayout.Classic)return n.item.displayOptions&e.DisplayMode.Classic?(s=n.group.isCollapsed?o.ribbonDropDownModule.getOverflowDropDownPopup(n,s):s).querySelector("#"+i):null;var a=n.item.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+n.item.id):null;if(!a){a=(n.group.enableGroupOverflow?t.getComponent(s.querySelector("#"+n.group.id+Yt),r.DropDownButton):o.overflowDDB).target.querySelector("#"+n.item.id)}return a}function y(e){return!!(e.content||e.iconCss||e.title||e.id||e.cssClass)}function g(e,t,o){var i=e.target.getAttribute("id"),r=o.filter(function(e){return e.id===i})[0].data,n=t.createElement("div",{id:r.id?qt+"_"+r.id:qt});if(t.element.append(n),r.title){var s=t.createElement("div",{innerHTML:r.title,className:xt});n.appendChild(s)}var a=t.createElement("div",{className:At});if(n.appendChild(a),r.iconCss){var l=t.createElement("div",{className:r.iconCss+" "+_t});a.appendChild(l)}if(r.content){var p=t.createElement("div",{innerHTML:r.content,className:Mt});a.appendChild(p)}t.setProperties({content:n,cssClass:r.cssClass?r.cssClass+" "+Dt:Dt})}function v(e,t){var o=new a.Tooltip({target:"."+Rt,beforeRender:function(e){g(e,o,t.tooltipData)}.bind(this),windowCollision:!0});o.appendTo(e)}function S(e){t.getComponent(e,a.Tooltip).destroy()}function I(e,o){t.getComponent(e,a.Tooltip).setProperties(o)}function C(e,o){for(var i in o)if("class"===i){var r=o.class.replace(/\s+/g," ").trim();r&&t.addClass([e],r.split(" "))}else if("style"===i){var n=""+(e.getAttribute("style")||"")+o[""+i];e.setAttribute(""+i,n)}else e.setAttribute(i,o[""+i])}!function(e){e.Classic="Classic",e.Simplified="Simplified"}(e.RibbonLayout||(e.RibbonLayout={})),function(e){e.Row="Row",e.Column="Column"}(e.ItemOrientation||(e.ItemOrientation={})),function(e){e[e.Large=4]="Large",e[e.Medium=2]="Medium",e[e.Small=1]="Small"}(e.RibbonItemSize||(e.RibbonItemSize={})),function(e){e[e.Classic=4]="Classic",e[e.Simplified=2]="Simplified",e[e.Overflow=1]="Overflow",e[e.Auto=7]="Auto"}(e.DisplayMode||(e.DisplayMode={})),function(e){e.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.RibbonItemType||(e.RibbonItemType={})),function(e){e.Single="Single",e.Multiple="Multiple"}(e.RibbonGroupButtonSelection||(e.RibbonGroupButtonSelection={}));var T=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),w=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},k=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return T(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},w([t.Property("")],o.prototype,"content",void 0),w([t.Property("")],o.prototype,"cssClass",void 0),w([t.Property("")],o.prototype,"iconCss",void 0),w([t.Property(!1)],o.prototype,"isToggle",void 0),w([t.Property(!1)],o.prototype,"isPrimary",void 0),w([t.Property({})],o.prototype,"htmlAttributes",void 0),w([t.Event()],o.prototype,"created",void 0),w([t.Event()],o.prototype,"clicked",void 0),o}(t.ChildProperty),O=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),B=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},P=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return O(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},B([t.Property(!1)],o.prototype,"checked",void 0),B([t.Property("")],o.prototype,"cssClass",void 0),B([t.Property("")],o.prototype,"label",void 0),B([t.Property("After")],o.prototype,"labelPosition",void 0),B([t.Property({})],o.prototype,"htmlAttributes",void 0),B([t.Event()],o.prototype,"created",void 0),B([t.Event()],o.prototype,"change",void 0),o}(t.ChildProperty),L=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},D=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return L(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},E([t.Property(10)],o.prototype,"columns",void 0),E([t.Property("")],o.prototype,"cssClass",void 0),E([t.Property("")],o.prototype,"label",void 0),E([t.Property(!0)],o.prototype,"enableOpacity",void 0),E([t.Property("Palette")],o.prototype,"mode",void 0),E([t.Property(!0)],o.prototype,"modeSwitcher",void 0),E([t.Property(!1)],o.prototype,"noColor",void 0),E([t.Property(null)],o.prototype,"presetColors",void 0),E([t.Property(!0)],o.prototype,"showButtons",void 0),E([t.Property("#008000ff")],o.prototype,"value",void 0),E([t.Property({})],o.prototype,"htmlAttributes",void 0),E([t.Event()],o.prototype,"beforeClose",void 0),E([t.Event()],o.prototype,"beforeOpen",void 0),E([t.Event()],o.prototype,"beforeTileRender",void 0),E([t.Event()],o.prototype,"created",void 0),E([t.Event()],o.prototype,"change",void 0),E([t.Event()],o.prototype,"open",void 0),E([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),R=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),x=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},M=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return R(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},x([t.Property(!1)],o.prototype,"allowFiltering",void 0),x([t.Property(!0)],o.prototype,"autofill",void 0),x([t.Property("")],o.prototype,"cssClass",void 0),x([t.Property("")],o.prototype,"label",void 0),x([t.Property([])],o.prototype,"dataSource",void 0),x([t.Complex({text:null,value:null,iconCss:null,groupBy:null},i.FieldSettings)],o.prototype,"fields",void 0),x([t.Property("Contains")],o.prototype,"filterType",void 0),x([t.Property(null)],o.prototype,"footerTemplate",void 0),x([t.Property(null)],o.prototype,"groupTemplate",void 0),x([t.Property(null)],o.prototype,"headerTemplate",void 0),x([t.Property(null)],o.prototype,"index",void 0),x([t.Property(null)],o.prototype,"itemTemplate",void 0),x([t.Property("No records found")],o.prototype,"noRecordsTemplate",void 0),x([t.Property(null)],o.prototype,"placeholder",void 0),x([t.Property("300px")],o.prototype,"popupHeight",void 0),x([t.Property("100%")],o.prototype,"popupWidth",void 0),x([t.Property(!0)],o.prototype,"showClearButton",void 0),x([t.Property("None")],o.prototype,"sortOrder",void 0),x([t.Property(null)],o.prototype,"text",void 0),x([t.Property(null)],o.prototype,"value",void 0),x([t.Property("150px")],o.prototype,"width",void 0),x([t.Property({})],o.prototype,"htmlAttributes",void 0),x([t.Event()],o.prototype,"beforeOpen",void 0),x([t.Event()],o.prototype,"change",void 0),x([t.Event()],o.prototype,"close",void 0),x([t.Event()],o.prototype,"created",void 0),x([t.Event()],o.prototype,"filtering",void 0),x([t.Event()],o.prototype,"open",void 0),x([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),_=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),q=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},A=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return _(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},q([t.Property("")],o.prototype,"closeActionEvents",void 0),q([t.Property("")],o.prototype,"content",void 0),q([t.Property("")],o.prototype,"cssClass",void 0),q([t.Property("")],o.prototype,"iconCss",void 0),q([t.Collection([],r.Item)],o.prototype,"items",void 0),q([t.Property("")],o.prototype,"target",void 0),q([t.Property(!1)],o.prototype,"createPopupOnClick",void 0),q([t.Property({})],o.prototype,"htmlAttributes",void 0),q([t.Event()],o.prototype,"beforeClose",void 0),q([t.Event()],o.prototype,"beforeItemRender",void 0),q([t.Event()],o.prototype,"beforeOpen",void 0),q([t.Event()],o.prototype,"close",void 0),q([t.Event()],o.prototype,"created",void 0),q([t.Event()],o.prototype,"open",void 0),q([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),j=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),G=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},z=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return j(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},G([t.Property("")],o.prototype,"closeActionEvents",void 0),G([t.Property("")],o.prototype,"content",void 0),G([t.Property("")],o.prototype,"cssClass",void 0),G([t.Property("")],o.prototype,"iconCss",void 0),G([t.Collection([],r.Item)],o.prototype,"items",void 0),G([t.Property("")],o.prototype,"target",void 0),G([t.Property({})],o.prototype,"htmlAttributes",void 0),G([t.Event()],o.prototype,"beforeClose",void 0),G([t.Event()],o.prototype,"beforeItemRender",void 0),G([t.Event()],o.prototype,"beforeOpen",void 0),G([t.Event()],o.prototype,"close",void 0),G([t.Event()],o.prototype,"click",void 0),G([t.Event()],o.prototype,"created",void 0),G([t.Event()],o.prototype,"open",void 0),G([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),N=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},W=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return N(o,e),H([t.Property("")],o.prototype,"cssClass",void 0),H([t.Property("")],o.prototype,"id",void 0),H([t.Property("")],o.prototype,"title",void 0),H([t.Property("")],o.prototype,"content",void 0),H([t.Property("")],o.prototype,"iconCss",void 0),o}(t.ChildProperty),K=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),F=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},U=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return K(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},F([t.Property("")],o.prototype,"content",void 0),F([t.Property("")],o.prototype,"iconCss",void 0),F([t.Property("")],o.prototype,"keyTip",void 0),F([t.Complex({},W)],o.prototype,"ribbonTooltipSettings",void 0),F([t.Property(!1)],o.prototype,"selected",void 0),F([t.Property({})],o.prototype,"htmlAttributes",void 0),F([t.Event()],o.prototype,"beforeClick",void 0),F([t.Event()],o.prototype,"click",void 0),o}(t.ChildProperty),V=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),X=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Y=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return V(o,e),X([t.Property("")],o.prototype,"header",void 0),X([t.Property("Single")],o.prototype,"selection",void 0),X([t.Collection([],U)],o.prototype,"items",void 0),o}(t.ChildProperty),Z=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),J=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Q=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Z(o,e),J([t.Property("")],o.prototype,"content",void 0),J([t.Property("")],o.prototype,"iconCss",void 0),J([t.Property({})],o.prototype,"htmlAttributes",void 0),J([t.Property("")],o.prototype,"cssClass",void 0),J([t.Property(!1)],o.prototype,"disabled",void 0),o}(t.ChildProperty),$=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),ee=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},te=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return $(o,e),ee([t.Collection([],Q)],o.prototype,"items",void 0),ee([t.Property("")],o.prototype,"header",void 0),ee([t.Property("auto")],o.prototype,"itemWidth",void 0),ee([t.Property("auto")],o.prototype,"itemHeight",void 0),ee([t.Property("")],o.prototype,"cssClass",void 0),o}(t.ChildProperty),oe=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),ie=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},re=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return oe(o,e),ie([t.Collection([],te)],o.prototype,"groups",void 0),ie([t.Property(3)],o.prototype,"itemCount",void 0),ie([t.Property(null)],o.prototype,"selectedItemIndex",void 0),ie([t.Property("auto")],o.prototype,"popupHeight",void 0),ie([t.Property("auto")],o.prototype,"popupWidth",void 0),ie([t.Property("")],o.prototype,"template",void 0),ie([t.Property("")],o.prototype,"popupTemplate",void 0),ie([t.Event()],o.prototype,"popupOpen",void 0),ie([t.Event()],o.prototype,"popupClose",void 0),ie([t.Event()],o.prototype,"itemHover",void 0),ie([t.Event()],o.prototype,"beforeItemRender",void 0),ie([t.Event()],o.prototype,"beforeSelect",void 0),ie([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),ne=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ae=function(o){function i(){return null!==o&&o.apply(this,arguments)||this}return ne(i,o),i.prototype.setProperties=function(e,t){o.prototype.setProperties.call(this,e,t)},se([t.Property("")],i.prototype,"keyTip",void 0),se([t.Property(e.RibbonItemSize.Medium)],i.prototype,"activeSize",void 0),se([t.Property(e.RibbonItemSize.Small|e.RibbonItemSize.Medium|e.RibbonItemSize.Large)],i.prototype,"allowedSizes",void 0),se([t.Property("")],i.prototype,"id",void 0),se([t.Property("")],i.prototype,"cssClass",void 0),se([t.Property(!1)],i.prototype,"disabled",void 0),se([t.Property("")],i.prototype,"itemTemplate",void 0),se([t.Property("Button")],i.prototype,"type",void 0),se([t.Property(e.DisplayMode.Auto)],i.prototype,"displayOptions",void 0),se([t.Complex({},W)],i.prototype,"ribbonTooltipSettings",void 0),se([t.Complex({},k)],i.prototype,"buttonSettings",void 0),se([t.Complex({},A)],i.prototype,"dropDownSettings",void 0),se([t.Complex({},P)],i.prototype,"checkBoxSettings",void 0),se([t.Complex({},D)],i.prototype,"colorPickerSettings",void 0),se([t.Complex({},M)],i.prototype,"comboBoxSettings",void 0),se([t.Complex({},z)],i.prototype,"splitButtonSettings",void 0),se([t.Complex({},Y)],i.prototype,"groupButtonSettings",void 0),se([t.Complex({},re)],i.prototype,"gallerySettings",void 0),i}(t.ChildProperty),le=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ce=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return le(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},pe([t.Property("")],o.prototype,"id",void 0),pe([t.Property("")],o.prototype,"cssClass",void 0),pe([t.Collection([],ae)],o.prototype,"items",void 0),o}(t.ChildProperty),ue=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),de=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},he=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return ue(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},de([t.Property("")],o.prototype,"keyTip",void 0),de([t.Property("")],o.prototype,"launcherIconKeyTip",void 0),de([t.Collection([],ce)],o.prototype,"collections",void 0),de([t.Property("")],o.prototype,"cssClass",void 0),de([t.Property("")],o.prototype,"id",void 0),de([t.Property(!1)],o.prototype,"isCollapsed",void 0),de([t.Property(!0)],o.prototype,"isCollapsible",void 0),de([t.Property(!1)],o.prototype,"enableGroupOverflow",void 0),de([t.Property("")],o.prototype,"groupIconCss",void 0),de([t.Property("")],o.prototype,"header",void 0),de([t.Property("Column")],o.prototype,"orientation",void 0),de([t.Property("")],o.prototype,"overflowHeader",void 0),de([t.Property(0)],o.prototype,"priority",void 0),de([t.Property(!1)],o.prototype,"showLauncherIcon",void 0),o}(t.ChildProperty),be=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),me=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},fe=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return be(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},me([t.Property("")],o.prototype,"keyTip",void 0),me([t.Property("")],o.prototype,"id",void 0),me([t.Property("")],o.prototype,"cssClass",void 0),me([t.Collection([],he)],o.prototype,"groups",void 0),me([t.Property("")],o.prototype,"header",void 0),o}(t.ChildProperty),ye=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),ge=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ye(i,e),i.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},ge([t.Property("File")],i.prototype,"text",void 0),ge([t.Property(!1)],i.prototype,"visible",void 0),ge([t.Collection([],o.MenuItem)],i.prototype,"menuItems",void 0),ge([t.Property(!1)],i.prototype,"showItemOnClick",void 0),ge([t.Complex({},o.MenuAnimationSettings)],i.prototype,"animationSettings",void 0),ge([t.Property("")],i.prototype,"itemTemplate",void 0),ge([t.Property("")],i.prototype,"popupTemplate",void 0),ge([t.Complex({},W)],i.prototype,"ribbonTooltipSettings",void 0),ge([t.Event()],i.prototype,"beforeClose",void 0),ge([t.Event()],i.prototype,"beforeOpen",void 0),ge([t.Event()],i.prototype,"beforeItemRender",void 0),ge([t.Event()],i.prototype,"close",void 0),ge([t.Event()],i.prototype,"open",void 0),ge([t.Event()],i.prototype,"select",void 0),ge([t.Property("")],i.prototype,"keyTip",void 0),i}(t.ChildProperty),Se=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Ie=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Ce=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Se(o,e),Ie([t.Property("")],o.prototype,"text",void 0),Ie([t.Property("")],o.prototype,"iconCss",void 0),Ie([t.Property(!0)],o.prototype,"visible",void 0),o}(t.ChildProperty),Te=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),we=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ke=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Te(o,e),we([t.Property("")],o.prototype,"text",void 0),we([t.Property("")],o.prototype,"id",void 0),we([t.Property("")],o.prototype,"keyTip",void 0),we([t.Property("")],o.prototype,"content",void 0),we([t.Property("")],o.prototype,"iconCss",void 0),we([t.Property(!1)],o.prototype,"separator",void 0),we([t.Property(!1)],o.prototype,"isFooter",void 0),we([t.Event()],o.prototype,"backStageItemClick",void 0),o}(t.ChildProperty),Oe=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Be=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Pe=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Oe(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Be([t.Property("File")],o.prototype,"text",void 0),Be([t.Property("")],o.prototype,"keyTip",void 0),Be([t.Property(!1)],o.prototype,"visible",void 0),Be([t.Property("auto")],o.prototype,"height",void 0),Be([t.Property("auto")],o.prototype,"width",void 0),Be([t.Property(null)],o.prototype,"target",void 0),Be([t.Complex({},Ce)],o.prototype,"backButton",void 0),Be([t.Collection([],ke)],o.prototype,"items",void 0),Be([t.Property("")],o.prototype,"template",void 0),Be([t.Complex({},W)],o.prototype,"ribbonTooltipSettings",void 0),o}(t.ChildProperty),Le=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Ee=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},De=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Le(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Ee([t.Property(!1)],o.prototype,"visible",void 0),Ee([t.Property(!1)],o.prototype,"isSelected",void 0),Ee([t.Collection([],fe)],o.prototype,"tabs",void 0),o}(t.ChildProperty),Re="e-ribbon-vertical-center",xe="e-icons e-drop-icon",Me="e-icons e-arrow-left",_e="e-icons e-more-horizontal-1",qe="e-vertical",Ae="e-disabled",je="e-rtl",Ge="e-ribbon-hover",ze="e-ribbon-control",Ne="e-ribbon-popup-control",He="e-ribbon-open",We="e-ribbon-keytip",Ke="e-hscroll-bar",Fe="e-ribbon-hide",Ue="e-ribbon-contextual-tab",Ve="e-ribbon-active",Xe="e-ribbon-tab-item",Ye="e-ribbon-collapse-btn",Ze="e-ribbon-expand-btn",Je="e-ribbon-collapsible",Qe="e-ribbon-overall-of-btn",$e="e-ribbon-group-of-btn",et="e-ribbon-overflow-target",tt="e-ribbon-overflow",ot="e-content",it="e-ribbon-minimize",rt="e-ribbon-group",nt="e-ribbon-single-selection",st="e-ribbon-multiple-selection",at="e-ribbon-group-button",lt="e-ribbon-group-button-overflow-popup",pt="e-ribbon-group-button-content",ct="e-ribbon-group-container",ut="e-ribbon-of-tab",dt="e-ribbon-of-group-container",ht="e-ribbon-group-content",bt="e-ribbon-group-header",mt="e-ribbon-overflow-header",ft="e-ribbon-group-overflow",yt="e-ribbon-group-overflow-ddb",gt="e-ribbon-launcher",vt="e-ribbon-launcher-icon",St="e-icons e-launcher",It="e-ribbon-collection",Ct="e-ribbon-item",Tt="e-ribbon-row",wt="e-ribbon-column",kt="e-ribbon-large-item",Ot="e-ribbon-medium-item",Bt="e-ribbon-small-item",Pt="e-ribbon-content-height",Lt="e-ribbon-template",Et="e-ribbon-help-template",Dt="e-ribbon-tooltip",Rt="e-ribbon-tooltip-target",xt="e-ribbon-tooltip-title",Mt="e-ribbon-tooltip-content",_t="e-ribbon-tooltip-icon",qt="e-ribbon-tooltip-container",At="e-ribbon-text-container",jt="e-ribbon-simplified-mode",Gt="e-ribbon-backstage-popup",zt="e-ribbon-backstage-open",Nt="e-ribbon-backstage-content",Ht="e-ribbon-backstage",Wt="e-ribbon-backstage-menu",Kt="e-ribbon-backstage-template",Ft="e-ribbon-backstage-wrapper",Ut="e-ribbon-backstage-items-wrapper",Vt="_collapsebutton",Xt="_sim_ovrl_overflow",Yt="_sim_grp_overflow",Zt="_header",Jt="_launcher",Qt="_content",$t="_container",eo="_overflow",to="_dropdown",oo="_backstage",io="_backstagepopup",ro="_filemenulist",no="_footermenulist",so="_helppanetemplate",ao="_grpbtn",lo="_keytip",po="--fileMenuWidth",co="--helpTemplateWidth",uo=function(){return(uo=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},ho=function(){function o(e){this.parent=e}return o.prototype.getModuleName=function(){return"ribbonButton"},o.prototype.destroy=function(){this.parent=null},o.prototype.createButton=function(t,o){var i=this,r=this.parent.createElement("button",{id:t.id});o.appendChild(r);var s=t.buttonSettings;if(new n.Button({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:t.activeSize===e.RibbonItemSize.Large?"Top":"Left",iconCss:s.iconCss,disabled:t.disabled,cssClass:(Re+" "+ze+" "+(s.cssClass?s.cssClass:"")).trim(),content:t.activeSize===e.RibbonItemSize.Small?"":s.content,isPrimary:s.isPrimary,isToggle:s.isToggle,created:s.created},r),s.htmlAttributes){var a=uo({},s.htmlAttributes);a.id&&delete a.id,C(r,a)}r.onclick=function(e){s.clicked&&s.clicked.call(i,e)},r.setAttribute("aria-label",s.content)},o.prototype.addOverFlowEvents=function(e,o,i){var r=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,n.Button);a.setProperties({cssClass:a.cssClass+" "+Ne}),s.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(r,t),i.toggle()}},o.prototype.removeOverFlowEvents=function(e,o){var i=this,r=o.querySelector("#"+e.id),s=t.getComponent(r,n.Button),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.setProperties({cssClass:a.join(" ")}),r.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(i,t)}},o.prototype.click=function(e){var o=f(this.parent,e);if(o){t.getComponent(o,n.Button).click()}},o.prototype.updateButton=function(o,i){var r=c(this.parent.tabs,i);if(r){t.merge(r.item.buttonSettings,o);var s=f(this.parent,i,r);if(s){var a=t.getComponent(s,n.Button);o.isToggle&&s.classList.add("e-active"),o.cssClass&&(o.cssClass=(Re+" "+ze+" "+o.cssClass).trim()),o.content&&(o.content=r.item.activeSize===e.RibbonItemSize.Small?"":o.content,s.setAttribute("aria-label",o.content)),delete o.clicked,a.setProperties(o)}}},o.prototype.updateButtonSize=function(o,i){t.getComponent(o,n.Button).setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left",content:i.activeSize===e.RibbonItemSize.Small?"":i.buttonSettings.content})},o}(),bo=function(){return(bo=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},mo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonCheckBox"},e.prototype.destroy=function(){this.parent=null},e.prototype.createCheckBox=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id});t.appendChild(i);var r=e.checkBoxSettings,s={};r.htmlAttributes&&(s=bo({},r.htmlAttributes)).id&&delete s.id,new n.CheckBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,checked:r.checked,cssClass:(ze+" "+(r.cssClass?r.cssClass:"")).trim(),label:r.label,labelPosition:r.labelPosition,disabled:e.disabled,created:r.created,htmlAttributes:s,change:function(e){r.change&&r.change.call(o,e)}},i)},e.prototype.addOverFlowEvents=function(e,o,i){var r=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,n.CheckBox);a.cssClass=a.cssClass+" "+Ne,a.dataBind(),a.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(r,t),i.toggle()}},e.prototype.removeOverFlowEvents=function(e,o){var i=this,r=o.querySelector("#"+e.id),s=t.getComponent(r,n.CheckBox),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.cssClass=a.join(" "),s.dataBind(),s.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(i,t)}},e.prototype.click=function(e){var o=f(this.parent,e);if(o){t.getComponent(o,n.CheckBox).click()}},e.prototype.updateCheckBox=function(e,o){var i=c(this.parent.tabs,o);if(i){t.merge(i.item.checkBoxSettings,e);var r=f(this.parent,o,i);if(r){e.cssClass&&(e.cssClass=(ze+" "+e.cssClass).trim()),delete e.change;t.getComponent(r,n.CheckBox).setProperties(e)}}},e}(),fo=function(){return(fo=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},yo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonColorPicker"},e.prototype.destroy=function(){this.parent=null},e.prototype.createColorPicker=function(e,o){var i=this,r=this.parent.createElement("input",{id:e.id});o.appendChild(r);var n=e.colorPickerSettings,a=new s.ColorPicker({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,columns:n.columns,cssClass:(ze+" "+(n.cssClass?n.cssClass:"")).trim(),disabled:e.disabled,enableOpacity:n.enableOpacity,mode:n.mode,modeSwitcher:n.modeSwitcher,noColor:n.noColor,presetColors:n.presetColors,showButtons:n.showButtons,value:n.value,beforeClose:function(){a.element.parentElement.classList.remove(He),n.beforeClose&&n.beforeClose.call(i)},beforeOpen:n.beforeOpen,beforeTileRender:n.beforeTileRender,created:n.created,change:function(e){n.value=e.value.toString(),n.change&&n.change.call(i,e)},open:function(){a.element.parentElement.classList.add(He),n.open&&n.open.call(i)},select:n.select},r);if(n.htmlAttributes){var l=fo({},n.htmlAttributes);l.id&&delete l.id,C(r,l)}var p=a.element.parentElement;t.EventHandler.add(p,"mouseenter",this.toggleWrapperHover.bind(this,p,!0),this),t.EventHandler.add(p,"mouseleave",this.toggleWrapperHover.bind(this,p,!1),this)},e.prototype.toggleWrapperHover=function(e,t){t?e.classList.add(Ge):e.classList.remove(Ge)},e.prototype.addOverFlowEvents=function(e,o,i){var r=this,n=e.colorPickerSettings;if(n.label&&"Simplified"===this.parent.activeLayout){var a=this.parent.createElement("div",{className:"e-ribbon-colorpicker-label",id:e.id+"_label",innerHTML:n.label});o.insertBefore(a,o.firstChild)}var l=o.querySelector("#"+e.id);l.setAttribute("data-control",e.type.toString());var p=t.getComponent(l,s.ColorPicker);p.setProperties({cssClass:p.cssClass+" "+Ne});var c,u=p.splitBtn;p.beforeClose=function(t){c=t.event?t.event.target:null,p.element.parentElement.classList.remove(He),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(r)},u.close=function(){c&&!c.closest(".e-ribbon-group-overflow-ddb")&&i.toggle()}},e.prototype.removeOverFlowEvents=function(e,o){var i=this;if(e.colorPickerSettings.label){var r=o.querySelector("#"+e.id+"_label");r&&r.remove()}var n=o.querySelector("#"+e.id),a=t.getComponent(n,s.ColorPicker),l=a.cssClass.split(" ");l=l.filter(function(e){return e!==Ne}),a.setProperties({cssClass:l.join(" ")});a.splitBtn.close=null,a.beforeClose=function(){a.element.parentElement.classList.remove(He),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(i)}},e.prototype.getColorPickerObj=function(e){var o=f(this.parent,e);return o?t.getComponent(o,s.ColorPicker):null},e.prototype.getValue=function(e,t,o){var i=this.getColorPickerObj(e);return i?i.getValue(t,o):""},e.prototype.toggle=function(e){var t=this.getColorPickerObj(e);t&&t.toggle()},e.prototype.updateColorPicker=function(e,o){var i=c(this.parent.tabs,o);if(i){t.merge(i.item.checkBoxSettings,e);var r=f(this.parent,o,i);if(r){e.cssClass&&(e.cssClass=(ze+" "+e.cssClass).trim()),delete e.beforeClose,delete e.open;t.getComponent(r,s.ColorPicker).setProperties(e)}}},e.prototype.unwireColorPickerEvents=function(e){var o=t.getComponent(e,s.ColorPicker).element.parentElement;t.EventHandler.remove(o,"mouseenter",this.toggleWrapperHover),t.EventHandler.remove(o,"mouseleave",this.toggleWrapperHover)},e}(),go=function(){return(go=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},vo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonComboBox"},e.prototype.destroy=function(){this.parent=null},e.prototype.createComboBox=function(e,t){var o=this,r=this.parent.createElement("input",{id:e.id});t.appendChild(r);var n=e.comboBoxSettings,s={};n.htmlAttributes&&(s=go({},n.htmlAttributes)).id&&delete s.id,new i.ComboBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,allowCustom:!1,floatLabelType:"Never",ignoreAccent:!0,ignoreCase:!0,allowFiltering:n.allowFiltering,autofill:n.autofill,cssClass:(ze+" "+(n.cssClass?n.cssClass:"")).trim(),dataSource:n.dataSource,enabled:!e.disabled,fields:n.fields,filterType:n.filterType,footerTemplate:n.footerTemplate,groupTemplate:n.groupTemplate,headerTemplate:n.headerTemplate,index:n.index,itemTemplate:n.itemTemplate,noRecordsTemplate:n.noRecordsTemplate,placeholder:n.placeholder,popupHeight:n.popupHeight,popupWidth:n.popupWidth,showClearButton:n.showClearButton,sortOrder:n.sortOrder,text:n.text,value:n.value,width:n.width,beforeOpen:n.beforeOpen,open:n.open,htmlAttributes:s,close:function(e){n.close&&n.close.call(o,e)},filtering:n.filtering,change:n.change,select:n.select,created:n.created},r)},e.prototype.addOverFlowEvents=function(e,o,r){var n=this,s=e.comboBoxSettings;if(s.label&&"Simplified"===this.parent.activeLayout){var a=this.parent.createElement("div",{className:"e-ribbon-combobox-label",id:e.id+"_label",innerHTML:s.label});o.insertBefore(a,o.firstChild)}var l=o.querySelector("#"+e.id);l.setAttribute("data-control",e.type.toString());var p=t.getComponent(l,i.ComboBox);p.setProperties({cssClass:p.cssClass+" "+Ne}),p.close=function(t){var o=t.event?t.event.target:null;e.comboBoxSettings.close&&e.comboBoxSettings.close.call(n,t),o&&!o.closest(".e-ribbon-group-overflow-ddb")&&r.toggle()}},e.prototype.removeOverFlowEvents=function(e,o){var r=this;if(e.comboBoxSettings.label){var n=o.querySelector("#"+e.id+"_label");n&&n.remove()}var s=o.querySelector("#"+e.id),a=t.getComponent(s,i.ComboBox),l=a.cssClass.split(" ");l=l.filter(function(e){return e!==Ne}),a.setProperties({cssClass:l.join(" ")}),a.close=function(t){e.comboBoxSettings.close&&e.comboBoxSettings.close.call(r,t)}},e.prototype.getComboBoxObj=function(e){var o=f(this.parent,e);return o?t.getComponent(o,i.ComboBox):null},e.prototype.filter=function(e,t,o,i){this.getComboBoxObj(e).filter(t,o,i)},e.prototype.hidePopup=function(e){var t=this.getComboBoxObj(e);t&&t.hidePopup()},e.prototype.showPopup=function(e){var t=this.getComboBoxObj(e);t&&t.showPopup()},e.prototype.updateComboBox=function(e,o){var r=c(this.parent.tabs,o);if(r){t.merge(r.item.comboBoxSettings,e);var n=f(this.parent,o,r);if(n){e.cssClass&&(e.cssClass=(ze+" "+e.cssClass).trim()),delete e.close;t.getComponent(n,i.ComboBox).setProperties(e)}}},e}(),So=function(){return(So=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},Io=function(){function o(e){this.parent=e}return o.prototype.getModuleName=function(){return"ribbonDropDown"},o.prototype.destroy=function(){this.parent=null},o.prototype.createDropDown=function(t,o){var i=this,n=this.parent.createElement("button",{id:t.id});o.appendChild(n);var s=t.dropDownSettings,a=(Re+" "+ze+" "+(s.cssClass?s.cssClass:"")).trim();if(new r.DropDownButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:t.activeSize===e.RibbonItemSize.Large?"Top":"Left",closeActionEvents:s.closeActionEvents,content:t.activeSize===e.RibbonItemSize.Small?"":s.content,cssClass:a+(t.activeSize===e.RibbonItemSize.Large?" "+qe:""),disabled:t.disabled,iconCss:s.iconCss,items:s.items,target:s.target,createPopupOnClick:s.createPopupOnClick,beforeClose:function(e){s.beforeClose&&s.beforeClose.call(i,e)},beforeItemRender:s.beforeItemRender,beforeOpen:s.beforeOpen,close:function(e){s.close&&s.close.call(i,e)},created:s.created,open:s.open,select:s.select}).appendTo(n),s.htmlAttributes){var l=So({},s.htmlAttributes);l.id&&delete l.id,C(n,l)}},o.prototype.addOverFlowEvents=function(e,o,i){var n=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,r.DropDownButton);a.cssClass=a.cssClass+" "+Ne,a.dataBind();var l;a.beforeClose=function(t){e.dropDownSettings.beforeClose&&e.dropDownSettings.beforeClose.call(n,t),l=t.event?t.event.target:null},a.close=function(t){e.dropDownSettings.close&&e.dropDownSettings.close.call(n,t),l&&!l.closest(".e-ribbon-group-overflow-ddb")&&i.toggle()}},o.prototype.removeOverFlowEvents=function(e,o){var i=this,n=o.querySelector("#"+e.id),s=t.getComponent(n,r.DropDownButton),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.cssClass=a.join(" "),s.dataBind(),s.close=function(t){e.dropDownSettings.close&&e.dropDownSettings.close.call(i,t)},s.beforeClose=function(t){e.dropDownSettings.beforeClose&&e.dropDownSettings.beforeClose.call(i,t)}},o.prototype.createOverFlowDropDown=function(e,o,i,n,s,a){var l=this;this.enableRtl=a;var p=this.parent.createElement("button",{id:e+eo+to});n.setAttribute("tabindex","0"),s.appendChild(p);var c=new r.DropDownButton({iconCss:i,target:n,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,cssClass:qe+" "+yt,iconPosition:"Top",content:o,beforeClose:function(e){e.cancel=!t.isNullOrUndefined(e.event&&t.closest(e.event.target,"."+Ne))}},p);return v(n,this.parent),p.onclick=p.onkeydown=function(){l.itemIndex=0},n.onkeydown=function(e){l.keyActionHandler(e,n)},c},o.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))},o.prototype.handleNavigation=function(e,t,o){if(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){if(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))}else{if(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++:this.itemIndex>0&&this.itemIndex--)},o.prototype.focusLauncherIcon=function(e,t){var o,i=t[parseInt(this.itemIndex.toString(),10)].closest(".e-ribbon-group-container");return i&&(o=i.querySelector(".e-ribbon-launcher-icon")),!!o&&("Tab"===e.key&&e.preventDefault(),i.querySelector(".e-ribbon-launcher-icon").focus(),!0)},o.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(this.itemIndex>0)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()},o.prototype.removeOverFlowDropDown=function(e){var o=t.getComponent(e,r.DropDownButton);t.getComponent(o.target,a.Tooltip).destroy(),e.parentElement.parentElement.insertBefore(o.target,e.parentElement),o.destroy(),t.remove(e)},o.prototype.getDDBItemElement=function(e,o){return t.getComponent(e,r.DropDownButton).dropDown.element.querySelector("#"+o)},o.prototype.getOverflowDropDownPopup=function(e,o){var i=o.querySelector("#"+this.parent.tabs[e.tabIndex].groups[e.groupIndex].id+eo+to);return t.getComponent(i,r.DropDownButton).dropDown.element},o.prototype.getDropDownObj=function(e){var o=f(this.parent,e);return o?t.getComponent(o,r.DropDownButton):null},o.prototype.addItems=function(e,t,o){this.getDropDownObj(e).addItems(t,o)},o.prototype.removeItems=function(e,t,o){this.getDropDownObj(e).removeItems(t,o)},o.prototype.toggle=function(e){this.getDropDownObj(e).toggle()},o.prototype.updateDropDown=function(o,i){var n=c(this.parent.tabs,i);if(n){t.merge(n.item.dropDownSettings,o);var s=f(this.parent,i,n);if(s){var a=t.getComponent(s,r.DropDownButton);o.cssClass&&(o.cssClass=(ze+" "+Re+" "+o.cssClass).trim(),o.cssClass=n.item.activeSize===e.RibbonItemSize.Large?(qe+" "+o.cssClass).trim():o.cssClass,a.cssClass=o.cssClass),delete o.close,delete o.beforeClose,o.content&&(o.content=n.item.activeSize===e.RibbonItemSize.Small?"":o.content),a.setProperties(o)}}},o.prototype.updateDropDownSize=function(o,i){var n=t.getComponent(o,r.DropDownButton),s=n.cssClass.split(" ");i.activeSize===e.RibbonItemSize.Large?s.push(qe):s=s.filter(function(e){return e!==qe}),n.cssClass=s.join(" "),n.setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left"}),n.setProperties({content:i.activeSize===e.RibbonItemSize.Small?"":i.dropDownSettings.content})},o}(),Co=function(){return(Co=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},To=function(){function o(e){this.parent=e}return o.prototype.getModuleName=function(){return"ribbonSplitButton"},o.prototype.destroy=function(){this.parent=null},o.prototype.createSplitButton=function(o,i){var n=this,s=this.parent.createElement("button",{id:o.id});i.appendChild(s);var a=o.splitButtonSettings,l=(Re+" "+ze+" "+(a.cssClass?a.cssClass:"")).trim(),p=new r.SplitButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:o.activeSize===e.RibbonItemSize.Large?"Top":"Left",closeActionEvents:a.closeActionEvents,cssClass:l+(o.activeSize===e.RibbonItemSize.Large?" "+qe:""),disabled:o.disabled,iconCss:a.iconCss,items:a.items,target:a.target,beforeClose:function(e){a.beforeClose&&a.beforeClose.call(n,e)},beforeItemRender:a.beforeItemRender,beforeOpen:a.beforeOpen,close:function(){p.wrapper.classList.remove(He),a.close&&a.close.call(n)},created:a.created,open:function(){p.wrapper.classList.add(He),a.open&&a.open.call(n)},select:a.select,click:function(e){a.click&&a.click.call(n,e)}},s);if(a.htmlAttributes){var c=Co({},a.htmlAttributes);c.id&&delete c.id,C(s,c)}var u=s.parentElement.querySelector(".e-dropdown-btn");u.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),u.click())},this.setContent(o,p);var d=p.wrapper;t.EventHandler.add(d,"mouseenter",function(){d.classList.add(Ge)},this),t.EventHandler.add(d,"mouseleave",function(){d.classList.remove(Ge)},this)},o.prototype.addOverFlowEvents=function(e,o,i){var n=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,r.SplitButton);a.cssClass=a.cssClass+" "+Ne,a.dataBind();var l=s.parentElement.querySelector(".e-dropdown-btn"),p=l.getAttribute("id"),c=document.querySelector("#"+p+"-popup");l.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),l.click())},c.onkeydown=function(e){"Enter"===e.key&&(e.preventDefault(),a.wrapper.classList.remove("e-ribbon-open"),c.querySelector(".e-focused").click())};var u;a.beforeClose=function(t){e.splitButtonSettings.beforeClose&&e.splitButtonSettings.beforeClose.call(n,t),u=t.event?t.event.target:null},a.click=function(t){e.splitButtonSettings.click&&e.splitButtonSettings.click.call(n,t),i.toggle()},a.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(n,t),a.wrapper.classList.remove(He),u&&!u.closest(".e-ribbon-group-overflow-ddb")&&i.toggle()}},o.prototype.removeOverFlowEvents=function(e,o){var i=this,n=o.querySelector("#"+e.id),s=t.getComponent(n,r.SplitButton),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.cssClass=a.join(" "),s.dataBind(),s.beforeClose=function(t){e.splitButtonSettings.beforeClose&&e.splitButtonSettings.beforeClose.call(i,t)},s.click=function(t){e.splitButtonSettings.click&&e.splitButtonSettings.click.call(i,t)},s.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(i,t),s.wrapper.classList.remove(He)}},o.prototype.setContent=function(t,o){o.primaryBtnObj.setProperties({content:t.activeSize===e.RibbonItemSize.Medium?t.splitButtonSettings.content:""}),o.secondaryBtnObj.setProperties({content:t.activeSize===e.RibbonItemSize.Large?t.splitButtonSettings.content:""})},o.prototype.getSplitButtonObj=function(e){var o=f(this.parent,e);return t.getComponent(o,r.SplitButton)},o.prototype.addItems=function(e,t,o){this.getSplitButtonObj(e).addItems(t,o)},o.prototype.removeItems=function(e,t,o){this.getSplitButtonObj(e).removeItems(t,o)},o.prototype.toggle=function(e){this.getSplitButtonObj(e).toggle()},o.prototype.updateSplitButton=function(o,i){var n=c(this.parent.tabs,i);if(n){t.merge(n.item.splitButtonSettings,o);var s=f(this.parent,i,n);if(s){var a=t.getComponent(s,r.SplitButton);o.cssClass&&(o.cssClass=(ze+" "+Re+" "+o.cssClass).trim(),o.cssClass=n.item.activeSize===e.RibbonItemSize.Large?(qe+" "+o.cssClass).trim():o.cssClass,a.cssClass=o.cssClass),delete o.open,delete o.click,delete o.close,delete o.beforeClose,a.setProperties(o),o.content&&this.setContent(n.item,a)}}},o.prototype.updateSplitButtonSize=function(o,i){var n=t.getComponent(o,r.SplitButton),s=n.cssClass.split(" ");i.activeSize===e.RibbonItemSize.Large?s.push(qe):s=s.filter(function(e){return e!==qe}),n.cssClass=s.join(" "),n.setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left"}),this.setContent(i,n)},o}(),wo=function(){function o(e){this.parent=e,this.isSelected=!1}return o.prototype.getModuleName=function(){return"ribbonGroupButton"},o.prototype.destroy=function(){this.parent=null},o.prototype.createGroupButton=function(o,i){var s=this,a=o.groupButtonSettings;this.count=0;var l=this.parent.createElement("div",{id:o.id+ao,className:"e-btn-group"});i.appendChild(l);for(var p=0;p<a.items.length;p++)if(a.items[parseInt(p.toString(),10)].iconCss){var c=this.parent.createElement("button",{id:o.id+ao+p,className:at});l.appendChild(c),new n.Button({iconCss:a.items[parseInt(p.toString(),10)].iconCss,disabled:o.disabled,enableRtl:this.parent.enableRtl,content:o.activeSize===e.RibbonItemSize.Small?"":a.items[parseInt(p.toString(),10)].content,iconPosition:o.activeSize===e.RibbonItemSize.Large?"Top":"Left"},c),a.items[parseInt(p.toString(),10)].htmlAttributes&&C(c,a.items[parseInt(p.toString(),10)].htmlAttributes),a.items[parseInt(p.toString(),10)].content&&c.classList.add(pt);var u=i.querySelector("#"+o.id+ao+p);a.selection===e.RibbonGroupButtonSelection.Single?l.classList.add(nt):l.classList.add(st),a.items[parseInt(p.toString(),10)].selected&&(a.selection===e.RibbonGroupButtonSelection.Multiple?u.classList.add("e-active"):this.count<1&&(u.classList.add("e-active"),this.count++)),a.items[parseInt(p.toString(),10)].ribbonTooltipSettings&&y(a.items[parseInt(p.toString(),10)].ribbonTooltipSettings)&&(c.classList.add(Rt),this.parent.tooltipData.push({id:c.id,data:a.items[parseInt(p.toString(),10)].ribbonTooltipSettings})),t.EventHandler.add(u,"click",this.groupButtonClicked.bind(this,p,o,a),this)}if("Simplified"===this.parent.activeLayout){var d=void 0,h=0,b=0;u=this.parent.createElement("button",{id:o.id});i.appendChild(u);for(p=0;p<a.items.length;p++)o.groupButtonSettings.items[parseInt(p.toString(),10)].selected&&!this.isSelected&&a.selection===e.RibbonGroupButtonSelection.Single?(d=o.groupButtonSettings.items[parseInt(p.toString(),10)].iconCss,this.isSelected=!0):o.groupButtonSettings.items[parseInt(p.toString(),10)].selected&&a.selection===e.RibbonGroupButtonSelection.Multiple&&(d=1===++h?o.groupButtonSettings.items[parseInt(p.toString(),10)].iconCss:null);for(;b<o.groupButtonSettings.items.length&&!this.isSelected&&!d;)o.groupButtonSettings.items[parseInt(b.toString(),10)].iconCss&&(d=o.groupButtonSettings.items[parseInt(b.toString(),10)].iconCss,this.isSelected=!0),b++;var m=new r.DropDownButton({iconCss:d,target:l,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:o.disabled},u);if(a.header){var f=m.dropDown;this.addGroupButtonHeader(o.id,a,f.element)}u.onclick=u.onkeydown=function(){s.handleFocusState(o,i)},l.onkeydown=function(e){"Simplified"===s.parent.activeLayout&&s.handleGroupButtonNavigation(e,o)},v(l,this.parent),this.isSelected=!1}},o.prototype.groupButtonClicked=function(o,i,n){for(var s,a,l=[],p=[],c=[],u=0;u<n.items.length;u++)document.querySelector("#"+i.id+ao+u)&&document.querySelector("#"+i.id+ao+u).classList.contains("e-active")&&l.push(n.items[parseInt(u.toString(),10)]);document.querySelector("#"+i.id+ao+o).classList.contains("e-active")||p.push(n.items[parseInt(o.toString(),10)]);var d={cancel:!1,previousItems:l,selectingItems:p};if(n.items[parseInt(o.toString(),10)].beforeClick&&n.items[parseInt(o.toString(),10)].beforeClick.call(this,d),!d.cancel){if(n.selection===e.RibbonGroupButtonSelection.Single){document.querySelector("#"+i.id+ao).classList.contains(st)&&(document.querySelector("#"+i.id+ao).classList.remove(st),document.querySelector("#"+i.id+ao).classList.add(nt));for(u=0;u<n.items.length;u++)document.querySelector("#"+i.id+ao+u)&&document.querySelector("#"+i.id+ao+u).classList.contains("e-active")&&(document.querySelector("#"+i.id+ao+u).classList.remove("e-active"),n.items[parseInt(u.toString(),10)].setProperties({selected:!1},!0));document.querySelector("#"+i.id+ao+o).classList.toggle("e-active"),n.items[parseInt(o.toString(),10)].setProperties({selected:!0},!0),document.querySelector("#"+i.id+ao+o).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&(this.grpBtnIndex=o,s=document.querySelector("#"+i.id),(a=t.getComponent(s,r.DropDownButton)).setProperties({iconCss:n.items[parseInt(o.toString(),10)].iconCss}))}else{document.querySelector("#"+i.id+ao).classList.contains(nt)&&(document.querySelector("#"+i.id+ao).classList.remove(nt),document.querySelector("#"+i.id+ao).classList.add(st)),document.querySelector("#"+i.id+ao+o).classList.toggle("e-active"),document.querySelector("#"+i.id+ao+o).classList.contains("e-active")?n.items[parseInt(o.toString(),10)].setProperties({selected:!0},!0):n.items[parseInt(o.toString(),10)].setProperties({selected:!1},!0);for(var h=0,b=0;b<n.items.length;b++)document.querySelector("#"+i.id+ao+b)&&document.querySelector("#"+i.id+ao+b).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&b!==o&&(this.isSelected=!0,h++);if("Simplified"===this.parent.activeLayout){var m=null,f=0;if(s=document.querySelector("#"+i.id),a=t.getComponent(s,r.DropDownButton),this.isSelected){if(1===h&&!document.querySelector("#"+i.id+ao+o).classList.contains("e-active"))for(b=0;b<n.items.length;b++)document.querySelector("#"+i.id+ao+b)&&document.querySelector("#"+i.id+ao+b).classList.contains("e-active")&&(m=n.items[parseInt(b.toString(),10)].iconCss)}else document.querySelector("#"+i.id+ao+o).classList.contains("e-active")&&(m=n.items[parseInt(o.toString(),10)].iconCss);for(;f<n.items.length&&!m;)n.items[parseInt(f.toString(),10)].iconCss&&(m=n.items[parseInt(f.toString(),10)].iconCss),f++;a.setProperties({iconCss:m}),this.grpBtnIndex=o}this.isSelected=!1}document.querySelector("#"+i.id+ao+o).classList.contains("e-active")&&c.push(n.items[parseInt(o.toString(),10)]);var y={previousItems:l,selectedItems:c};n.items[parseInt(o.toString(),10)].click&&n.items[parseInt(o.toString(),10)].click.call(this,y)}},o.prototype.switchGroupButton=function(o,i){var n=this,s=o.groupButtonSettings,a=null,l=0,p=0;if("Simplified"===this.parent.activeLayout){var c=i.querySelector("#"+o.id+ao),u=this.parent.createElement("button",{id:o.id});i.appendChild(u);for(var d=0;d<s.items.length;d++)document.querySelector("#"+o.id+ao+d)&&(document.querySelector("#"+o.id+ao+d).classList.contains("e-active")&&s.selection===e.RibbonGroupButtonSelection.Single?a=s.items[parseInt(d.toString(),10)].iconCss:document.querySelector("#"+o.id+ao+d).classList.contains("e-active")&&s.selection===e.RibbonGroupButtonSelection.Multiple&&(1===++l?a=s.items[parseInt(d.toString(),10)].iconCss:l>1&&(a=null)));for(;p<s.items.length&&!a;)s.items[parseInt(p.toString(),10)].iconCss&&(a=s.items[parseInt(p.toString(),10)].iconCss),p++;var h=new r.DropDownButton({iconCss:a,target:c,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:o.disabled},u);if(s.header){var b=h.dropDown;this.addGroupButtonHeader(o.id,s,b.element)}u.onclick=u.onkeydown=function(){n.handleFocusState(o,i)},c.onkeydown=function(e){"Simplified"===n.parent.activeLayout&&n.handleGroupButtonNavigation(e,o)},v(c,this.parent)}else{var m=i.querySelector("#"+o.id);h=t.getComponent(m,r.DropDownButton);i.appendChild(h.target),m&&(h.destroy(),t.remove(m))}},o.prototype.handleFocusState=function(e,t){if(t.querySelector("#"+e.id).classList.contains("e-active")){var o=document.querySelector("#"+e.id+"_grpbtn").querySelector("."+at+".e-active");o?o.focus():document.querySelector("#"+e.id+ao+0).focus(),this.grpBtnIndex=0}},o.prototype.addGroupButtonHeader=function(e,t,o){var i=this.parent.createElement("div",{className:"e-ribbon-groupbutton-header",id:e+Zt,innerHTML:t.header});o.insertBefore(i,o.firstChild)},o.prototype.handleGroupButtonNavigation=function(e,o){var i=document.querySelector("#"+o.id),n=t.getComponent(i,r.DropDownButton).target,s=!1;"Simplified"===this.parent.activeLayout&&n.closest(".e-ribbon-dropdown-group-button").classList.contains(lt)&&(s=!0),"Tab"===e.key&&e.preventDefault();var a=o.groupButtonSettings;"ArrowRight"===e.key&&!s||"ArrowDown"===e.key&&s?!this.parent.enableRtl||"ArrowDown"===e.key&&s?(this.grpBtnIndex++,this.grpBtnIndex<a.items.length?document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus():(this.grpBtnIndex=0,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus())):0===this.grpBtnIndex?(this.grpBtnIndex=a.items.length-1,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):("ArrowLeft"===e.key&&!s||"ArrowUp"===e.key&&s)&&(!this.parent.enableRtl||"ArrowUp"===e.key&&s?0===this.grpBtnIndex?(this.grpBtnIndex=a.items.length-1,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):(this.grpBtnIndex++,this.grpBtnIndex<a.items.length?document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus():(this.grpBtnIndex=0,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus())))},o.prototype.addOverFlowEvents=function(e,o,i){var n=this,s=e.groupButtonSettings,a=!0,l=o.querySelector("#"+e.id),p=t.getComponent(l,r.DropDownButton);p.setProperties({cssClass:p.cssClass+" "+lt,content:s.header?s.header:""});var c=p.target;if(c.children.length){for(var u=0;u<c.children.length;u++)if(s.items[parseInt(u.toString(),10)].content){a=!1;break}a&&c.classList.add("e-icon-btn")}c.onclick=function(){"Simplified"===n.parent.activeLayout&&c.closest(".e-ribbon-dropdown-group-button").classList.contains(lt)&&(p.toggle(),i.toggle())}},o.prototype.removeOverFlowEvents=function(e,o){var i=o.querySelector("#"+e.id);if(i){var n=t.getComponent(i,r.DropDownButton),s=n.target;s.classList.contains("e-icon-btn")&&s.classList.remove("e-icon-btn");var a=n.cssClass.split(" ");a=a.filter(function(e){return e!==lt}),n.setProperties({cssClass:a.join(" "),content:""})}},o.prototype.destroyDropDown=function(e){var o=document.querySelector("#"+e.id);if(o){var i=t.getComponent(o,r.DropDownButton);t.getComponent(i.target,a.Tooltip).destroy(),i.destroy(),t.remove(o)}},o.prototype.updateGroupButtonSize=function(o,i){for(var r,s=i.groupButtonSettings,a=0;a<s.items.length;a++)if(r="Classic"===this.parent.activeLayout?o.querySelector("#"+i.id+ao+a):document.querySelector("#"+i.id+ao+a)){t.getComponent(r,n.Button).setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left",content:i.activeSize===e.RibbonItemSize.Small?"":s.items[parseInt(a.toString(),10)].content})}},o}(),ko=function(){function e(e){this.count=0,this.isAdded=!1,this.galleryItemsIndex=0,this.parent=e}return e.prototype.getModuleName=function(){return"ribbonGallery"},e.prototype.destroy=function(){this.parent=null},e.prototype.createGallery=function(e,o){var i=this,r=e.gallerySettings;this.renderGalleryItems(r,!1,e.id,o);var n=this.parent.createElement("button",{id:e.id+"_popupButton",className:"e-ribbon-gallery-button e-icons e-drop-icon"});o.appendChild(n),this.createPopup(e,n),n.onclick=function(o){var n=document.querySelector("#"+e.id+"_galleryPopup");if(n){var s=t.getComponent(n,a.Popup);n.classList.contains("e-popup-close")?i.showPopup(s,n,o,r,e.id):i.hidePopup(s,n,o,r,e.id)}},document.onclick=function(e){for(var o,r,n=document.querySelectorAll(".e-ribbon-gallery-popup.e-popup-open"),s=0;s<n.length;s++){var l=t.getComponent(n[parseInt(s.toString(),10)],a.Popup);if(!e.target.classList.contains("e-ribbon-gallery-button")){o=n[parseInt(s.toString(),10)].id.replace(/_galleryPopup/g,""),r=c(i.parent.tabs,o),i.hidePopup(l,n[parseInt(s.toString(),10)],e,r.item.gallerySettings,o);break}if(o=n[parseInt(s.toString(),10)].id.replace(/_galleryPopup/g,""),e.target.id.replace(/_popupButton/g,"")!==o){r=c(i.parent.tabs,o),i.hidePopup(l,n[parseInt(s.toString(),10)],e,r.item.gallerySettings,o);break}}}},e.prototype.renderGalleryItems=function(e,t,o,i){var r,n,s=this,a=c(this.parent.tabs,o);a&&a.group&&(a.group.isCollapsible=!1);var l=this.parent.createElement("div",{className:"e-ribbon-gallery-wrapper",id:o+"_galleryWrapper"});t||i.appendChild(l);for(var p=function(a){var p=!1;r=u.parent.createElement("ol",{className:"e-ribbon-gallery-container",id:o+"_galleryContainer"+a}),e.groups[parseInt(a.toString(),10)].itemHeight&&"auto"!==e.groups[parseInt(a.toString(),10)].itemHeight&&(p=!0),e.groups[parseInt(a.toString(),10)].cssClass&&r.classList.add(e.groups[parseInt(a.toString(),10)].cssClass);for(var c=function(i){n=u.parent.createElement("li",{className:"e-ribbon-gallery-item",id:r.id+"_gallery"+i,attrs:{tabindex:"0"}});var c={name:"beforeItemRender",item:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]};if(e.beforeItemRender&&e.beforeItemRender.call(u,c),r.appendChild(n),e.selectedItemIndex&&e.selectedItemIndex===u.count?n.classList.add("e-ribbon-gallery-selected"):e.selectedItemIndex||0!==u.count||(n.classList.add("e-ribbon-gallery-selected"),e.selectedItemIndex=u.count),u.count=u.count+1,n.onclick=function(t){s.setActiveState(t.currentTarget,e,o,!0,t)},n.onkeydown=function(t){"Enter"!==t.key&&" "!==t.key||s.setActiveState(t.currentTarget,e,o,!0,t)},n.onmouseover=function(t){var o={event:t,name:"itemHover",item:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]};e.itemHover&&e.itemHover.call(s,o)},e.groups[parseInt(a.toString(),10)].itemWidth&&"auto"!==e.groups[parseInt(a.toString(),10)].itemWidth&&(n.style.width=e.groups[parseInt(a.toString(),10)].itemWidth+"px"),e.groups[parseInt(a.toString(),10)].itemHeight&&"auto"!==e.groups[parseInt(a.toString(),10)].itemHeight&&(n.style.height=e.groups[parseInt(a.toString(),10)].itemHeight+"px",n.style.paddingTop="0px",n.style.paddingBottom="0px","Simplified"===u.parent.activeLayout||t||(r.style.flexFlow="wrap")),!e.template&&!e.popupTemplate||e.template&&!e.popupTemplate&&t||e.popupTemplate&&!e.template&&!t){if(e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].htmlAttributes&&C(n,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].htmlAttributes),e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].iconCss){var d=u.parent.createElement("span",{className:"e-ribbon-gallery-icons "+e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].iconCss});n.appendChild(d),"Simplified"!==u.parent.activeLayout||t||d.classList.add("e-hidden")}e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].content&&n.appendChild(u.parent.createElement("span",{innerHTML:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].content,className:"e-ribbon-gallery-text"})),e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].disabled&&n.classList.add("e-disabled"),e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].cssClass&&n.classList.add(e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].cssClass)}if(e.template&&!t&&u.createGalleryTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),e.popupTemplate&&t&&u.createGalleryPopupTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),!t&&!p&&e.itemCount===u.count)return l.appendChild(r),u.isAdded=!0,"break"},d=0;d<e.groups[parseInt(a.toString(),10)].items.length;d++){if("break"===c(d))break}if(u.isAdded&&!t)return"break";if(t?i.appendChild(r):l.appendChild(r),t&&e.groups[parseInt(a.toString(),10)].header){var h=u.parent.createElement("div",{className:"e-ribbon-gallery-header",innerHTML:e.groups[parseInt(a.toString(),10)].header});i.insertBefore(h,r)}},u=this,d=0;d<e.groups.length;d++){if("break"===p(d))break}this.count=0,this.isAdded=!1},e.prototype.setWrapperWidth=function(e,o,i,r){for(var n=1,s=0,a=!1,l=0;l<i.groups.length;l++){for(var p=0;p<i.groups[parseInt(l.toString(),10)].items.length;p++)if(i.groups[parseInt(l.toString(),10)].itemHeight&&"auto"!==i.groups[parseInt(l.toString(),10)].itemHeight){if(!(e>=n)){a=!0;break}var c=o.querySelector("#"+r+"_galleryContainer"+l+"_gallery"+p);if(c){s+=c.offsetWidth;var u=window.getComputedStyle(c);if(u){var d=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight);t.isNullOrUndefined(d)||(s+=d);var h=parseFloat(u.marginLeft)+parseFloat(u.marginRight);t.isNullOrUndefined(h)||(s+=h)}}n++}if(a)break}s>0&&(o.style.width=s+"px")},e.prototype.checkAvailableHeight=function(e,o){for(var i=o.querySelectorAll(".e-ribbon-gallery-wrapper"),r=0;r<i.length;r++){var n=!1,s=0,a=i[parseInt(r.toString(),10)],l=a.offsetHeight,p=a.id.replace(/_galleryWrapper/g,""),u=c(this.parent.tabs,p);if(u){this.setWrapperWidth(u.item.gallerySettings.itemCount,a,u.item.gallerySettings,p);for(var d=0;d<u.item.gallerySettings.groups.length;d++)if(u.item.gallerySettings.groups[parseInt(d.toString(),10)].itemHeight&&"auto"!==u.item.gallerySettings.groups[parseInt(d.toString(),10)].itemHeight)for(var h=0;h<u.item.gallerySettings.groups[parseInt(d.toString(),10)].items.length;h++){var b=a.querySelector("#"+p+"_galleryContainer"+d+"_gallery"+h);if(b)if(s++,n)b.remove();else{if(1===s){var m=0,f=window.getComputedStyle(b);if(f){var y=parseFloat(f.paddingTop)+parseFloat(f.paddingBottom);t.isNullOrUndefined(y)||(m+=y);var g=parseFloat(f.marginTop)+parseFloat(f.marginBottom);t.isNullOrUndefined(g)||(m+=g)}l>b.offsetHeight+m?l-=b.offsetHeight+m:(n=!0,b.remove())}s===u.item.gallerySettings.itemCount&&(s=0)}}}}},e.prototype.checkCollision=function(e,o){var i=0,r=0;if(o){var n=window.innerWidth,s=window.getComputedStyle(o);s&&(i=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),t.isNullOrUndefined(i)||(n-=i));var a=o.querySelectorAll(".e-ribbon-gallery-container");"auto"!==e.width&&a.forEach(function(e){e.style.flexFlow="wrap"});for(var l=!1,p=0;p<a.length;p++){for(var c=0,u=0;u<a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item").length;u++){var d=window.getComputedStyle(a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)]);if(d&&(r=parseFloat(d.marginLeft)+parseFloat(d.marginRight),t.isNullOrUndefined(r)||(c+=r)),c+=a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)].offsetWidth,n<=c&&"auto"===e.width||"auto"!==e.width&&n<=parseInt(e.width.toString(),10)&&n<=c){o.style.width=c+Math.abs(i-r)-a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)].offsetWidth+"px",l=!0;break}}if(l){a.forEach(function(e){e.style.flexFlow="wrap"});break}}l||("auto"===e.width?(a.forEach(function(e){e.style.flexFlow="nowrap"}),o.style.width="auto"):o.style.width=e.width.toString())}},e.prototype.createPopup=function(e,t){var o=this.parent.createElement("div",{className:"e-ribbon-popup-container",id:e.id+"_popupContainer"});this.renderGalleryItems(e.gallerySettings,!0,e.id,o);var i=this.parent.createElement("div",{className:"e-ribbon-gallery-popup",id:e.id+"_galleryPopup"});document.body.append(i);new a.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()},e.prototype.switchGalleryItems=function(e,t){var o=this.parent.element.querySelector("#"+t+$t),i=0,r=c(this.parent.tabs,t);if(o){var n=o.querySelector(".e-ribbon-gallery-wrapper"),s=o.querySelectorAll(".e-ribbon-gallery-icons"),a=o.querySelectorAll(".e-ribbon-gallery-container");if(s.length)for(var l=0;l<s.length;l++)"Simplified"===e?s[parseInt(l.toString(),10)].classList.add("e-hidden"):s[parseInt(l.toString(),10)].classList.remove("e-hidden");if(a.length&&r)for(var p=0;p<r.item.gallerySettings.groups.length;p++)for(l=0;l<a.length;l++)r.item.gallerySettings.groups[parseInt(p.toString(),10)].itemHeight&&"auto"!==r.item.gallerySettings.groups[parseInt(p.toString(),10)].itemHeight&&t+"_galleryContainer"+p===a[parseInt(l.toString(),10)].id&&(a[parseInt(l.toString(),10)].style.flexFlow="Simplified"===e?"nowrap":"wrap");if(n)for(p=0;p<r.item.gallerySettings.groups.length;p++)for(l=0;l<r.item.gallerySettings.groups[parseInt(p.toString(),10)].items.length;l++)if(++i>r.item.gallerySettings.itemCount){var u=n.querySelector("#"+t+"_galleryContainer"+p+"_gallery"+l);u&&("Simplified"===e?u.classList.add("e-hidden"):u.classList.remove("e-hidden"))}}},e.prototype.addOverFlowEvents=function(e,o,i){var n=this;if(o.closest(".e-ribbon-overflow-target")){var s=this.parent.createElement("button",{id:e.id});o.appendChild(s),o.querySelector(".e-ribbon-gallery-wrapper").classList.add("e-hidden"),o.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.add("e-hidden")});var l=o.querySelector("#"+e.id+"_popupButton");l&&l.classList.add("e-hidden");var p=c(this.parent.tabs,e.id),u=p&&p.group.groupIconCss?p.group.groupIconCss:"",d=p&&p.group.header?p.group.header:"";if(!u)for(var h=0;h<e.gallerySettings.groups.length;h++){for(var b=0;b<e.gallerySettings.groups[parseInt(h.toString(),10)].items.length;b++)if(e.gallerySettings.groups[parseInt(h.toString(),10)].items[parseInt(b.toString(),10)].iconCss){u=e.gallerySettings.groups[parseInt(h.toString(),10)].items[parseInt(b.toString(),10)].iconCss;break}if(u)break}var m=document.querySelector("#"+e.id+"_galleryPopup"),f=t.getComponent(m,a.Popup),y=document.querySelector("#"+e.id+"_galleryPopup .e-ribbon-popup-container"),g=new r.DropDownButton({iconCss:u,content:d,target:y,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-gallery-dropdown",disabled:e.disabled,open:function(){n.setFoucsToFirstItem(y,!0,e.id),n.checkCollision(g.dropDown,g.dropDown.element)},beforeClose:function(t){n.popupEvents(t.event,e.gallerySettings,"popupClose",!1)&&(t.cancel=!0)}},s);"auto"!==f.width&&(g.dropDown.width=t.formatUnit(f.width)),"auto"!==f.height&&(g.dropDown.height=t.formatUnit(f.height),g.dropDown.element.style.height=f.height.toString())}},e.prototype.removeOverFlowEvents=function(e,o){var i=o.querySelector("#"+e.id+"_popupButton");i&&i.classList.remove("e-hidden"),o.querySelector(".e-ribbon-gallery-wrapper").classList.remove("e-hidden"),o.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.remove("e-hidden")});var n=document.querySelector("#"+e.id);if(n){var s=document.querySelector("#"+e.id+"_galleryPopup"),a=t.getComponent(n,r.DropDownButton);s.appendChild(a.target),a.destroy(),t.remove(n)}},e.prototype.setActiveState=function(e,t,o,i,r){var n,s,a=document.querySelector("#"+o+$t),l=Array.prototype.slice.call(a.querySelectorAll(".e-ribbon-gallery-selected")),p=document.querySelector("#"+o+"_popupContainer"),c=Array.prototype.slice.call(p.querySelectorAll(".e-ribbon-gallery-selected"));c.length&&(l=l.concat(c));for(var u=0;u<t.groups.length;u++)for(var d=0;d<t.groups[parseInt(u.toString(),10)].items.length;d++)l[0].id===o+"_galleryContainer"+u+"_gallery"+d&&(n=t.groups[parseInt(u.toString(),10)].items[parseInt(d.toString(),10)]),e.id===o+"_galleryContainer"+u+"_gallery"+d&&(s=t.groups[parseInt(u.toString(),10)].items[parseInt(d.toString(),10)]);var h=document.querySelectorAll("#"+e.id),b={cancel:!1,name:"beforeSelect",previousItem:n,currentItem:s,isInteracted:i,event:r};if(t.beforeSelect&&t.beforeSelect.call(this,b),!b.cancel){for(u=0;u<l.length;u++)l[parseInt(u.toString(),10)].classList.remove("e-ribbon-gallery-selected");for(u=0;u<h.length;u++)h[parseInt(u.toString(),10)].classList.add("e-ribbon-gallery-selected");var m={previousItem:n,currentItem:s,name:"select",isInteracted:i,event:r},f=document.querySelectorAll("#"+o+"_popupContainer .e-ribbon-gallery-item");for(u=0;u<f.length;u++)if(f[parseInt(u.toString(),10)].id===e.id){t.selectedItemIndex=u;break}t.select&&t.select.call(this,m)}},e.prototype.popupEvents=function(e,t,o,i){var r={cancel:!1,event:e,name:o};return i&&t.popupOpen?t.popupOpen.call(this,r):!i&&t.popupClose&&t.popupClose.call(this,r),!!r.cancel},e.prototype.showPopup=function(e,t,o,i,r){if(!this.popupEvents(o,i,"popupOpen",!0)){e.show(),this.checkCollision(e,t);var n=document.querySelector("#"+r+"_popupButton");n.classList.add("e-gallery-button-active");var s=n.getBoundingClientRect(),a=Math.abs(t.offsetWidth-s.left)+n.offsetWidth;t.style.left=a+"px",t.style.top=t.getBoundingClientRect().top+2+"px",this.setFoucsToFirstItem(t,!1,r,e,i)}},e.prototype.hidePopup=function(e,t,o,i,r){if(!this.popupEvents(o,i,"popupClose",!1)){e.hide();document.querySelector("#"+r+"_popupButton").classList.remove("e-gallery-button-active")}},e.prototype.showGalleryPopup=function(e){var o=c(this.parent.tabs,e),i=document.querySelector("#"+e+"_galleryPopup"),r=t.getComponent(i,a.Popup);this.showPopup(r,i,null,o.item.gallerySettings,e)},e.prototype.hideGalleryPopup=function(e){var o=c(this.parent.tabs,e),i=document.querySelector("#"+e+"_galleryPopup"),r=t.getComponent(i,a.Popup);this.hidePopup(r,i,null,o.item.gallerySettings,e)},e.prototype.setFoucsToFirstItem=function(e,t,o,i,r){var n=this;e.querySelectorAll(".e-ribbon-gallery-item")[0].focus(),this.galleryItemsIndex=0,e.onkeydown=function(s){n.handleGalleryPopupNavigation(s,e,t,o,i,r)}},e.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?s[this.galleryItemsIndex].click():"Escape"!==e.key||o||this.hidePopup(r,t,e,n,i))},e.prototype.createGalleryTemplate=function(e,o,i,r){e.classList.add("e-ribbon-gallery-template");var n="ribbon"+i+"galleryTemplate";this.parent.clearTemplate([n]);var s=p(o.template);r.disabled&&e.classList.add("e-disabled"),r.cssClass&&e.classList.add(r.cssClass),t.append(s({items:r},this,n,i+"galleryTemplate",this.parent.isStringTemplate),e),this.parent.renderReactTemplates()},e.prototype.createGalleryPopupTemplate=function(e,o,i,r){e.classList.add("e-ribbon-gallery-popup-template");var n="ribbon"+i+"galleryPopupTemplate";this.parent.clearTemplate([n]);var s=p(o.popupTemplate);r.disabled&&e.classList.add("e-disabled"),r.cssClass&&e.classList.add(r.cssClass),t.append(s({items:r},this,n,i+"galleryPopupTemplate",this.parent.isStringTemplate),e),this.parent.renderReactTemplates()},e}(),Oo=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Bo=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;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Po=function(i){function s(e,t){return g.Inject(ho,mo,Io,To,vo,wo),i.call(this,e,t)||this}Oo(s,i),g=s,s.prototype.render=function(){this.initialize()},s.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"}},s.prototype.getPersistData=function(){return this.addOnPersist(["activeLayout"])},s.prototype.getModuleName=function(){return"ribbon"},s.prototype.requiredModules=function(){var t=[];t.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"});var o=c(this.tabs,null,e.RibbonItemType.ColorPicker),i=c(this.tabs,null,e.RibbonItemType.Gallery);return o&&t.push({member:"ribbonColorPicker",args:[this],name:"RibbonColorPicker"}),i&&t.push({member:"ribbonGallery",args:[this],name:"RibbonGallery"}),(this.backStageMenu.visible||this.backStageMenu.items.length)&&t.push({member:"ribbonBackstage",args:[this],name:"RibbonBackstage"}),(this.fileMenu.visible||this.fileMenu.menuItems.length)&&t.push({member:"ribbonFileMenu",args:[this],name:"RibbonFileMenu"}),this.contextualTabs.length&&t.push({member:"ribbonContextualTab",args:[this],name:"RibbonContextualTab"}),this.enableKeyTips&&t.push({member:"ribbonKeyTip",args:[this],name:"RibbonKeyTip"}),t},s.prototype.initialize=function(){this.element.id=this.element.id||t.getUniqueID("e-"+this.getModuleName()),t.addClass([this.element],["e-rbn"].concat(this.cssClass?this.cssClass.split(" "):[])),this.enableRtl&&this.element.classList.add(je),this.element.style.width=t.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(),v(this.element,this),this.isKeytipOpen=!1,this.wireEvents(),this.wireKeyboardEvent(),this.currentControlIndex=0},s.prototype.wireEvents=function(){t.EventHandler.add(window,"resize",this.resizeHandler,this),t.EventHandler.add(document.body,"keydown",this.keytipActionHandler,this),t.EventHandler.add(document,"mousedown",this.mouseEventHandler,this),t.EventHandler.add(document,"scroll",this.mouseEventHandler,this)},s.prototype.wireKeyboardEvent=function(){this.keyboardModuleRibbon=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.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+Qt),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")?this.currentControlIndex>0&&this.currentControlIndex--:(this.tabObj.element.querySelector(".e-toolbar-item.e-active").querySelector(".e-tab-wrap").focus(),this.currentControlIndex=0)}},s.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++:this.currentControlIndex>0&&o[this.currentControlIndex-1].classList.contains("e-colorpicker")&&this.currentControlIndex--,!t&&this.currentControlIndex>0||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")){if(t)this.currentControlIndex++;else{var n=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+ct);n&&(r=n.getAttribute("id")),this.currentControlIndex--}for(var s=o[this.currentControlIndex].closest(".e-ribbon-item");s&&s.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--,s=o[this.currentControlIndex].closest(".e-ribbon-item")}if(o[parseInt(this.currentControlIndex.toString(),10)].focus(),"Classic"===this.activeLayout){if(i=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+ct),t){var a=void 0;if(i&&(a=i.querySelector(".e-ribbon-launcher-icon")),a){var l=i.querySelectorAll(".e-ribbon-item"),p=l[l.length-1].querySelector(".e-control");p&&p.classList.add("e-ribbon-last-item")}}else if(i){if(r!==i.getAttribute("id")){(a=i.querySelector(".e-ribbon-launcher-icon"))&&o[parseInt((this.currentControlIndex+1).toString(),10)].classList.add("e-ribbon-first-item")}}}else 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 if("Classic"===this.activeLayout&&this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus(),"Simplified"===this.activeLayout){var c=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn");t&&c&&!c.classList.contains("e-ribbon-hide")?c.focus():this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus()}if(e.target.classList.contains("e-ribbon-last-item")&&(t?(i=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+ct)).querySelector(".e-ribbon-launcher-icon").focus():(this.currentControlIndex--,o[parseInt(this.currentControlIndex.toString(),10)].focus())),!t&&e.target.classList.contains("e-ribbon-first-item")){(a=(i=o[parseInt((this.currentControlIndex-1).toString(),10)].closest("."+ct)).querySelector(".e-ribbon-launcher-icon"))&&i.querySelector(".e-ribbon-launcher-icon").focus()}if(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 u=o[this.currentControlIndex].closest(".e-ribbon-item");u&&u.classList.contains("e-disabled");)this.currentControlIndex++,u=o[this.currentControlIndex].closest(".e-ribbon-item");o[parseInt(this.currentControlIndex.toString(),10)].focus()}else{if((c=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn"))&&!c.classList.contains("e-ribbon-hide"))c.focus();else{this.currentControlIndex=o.length-1;for(u=o[this.currentControlIndex].closest(".e-ribbon-item");u&&u.classList.contains("e-disabled");)this.currentControlIndex--,u=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").focus():(this.currentControlIndex=o.length-1,o[parseInt(this.currentControlIndex.toString(),10)].focus()))},s.prototype.resizeHandler=function(){var e=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt);if(this.checkOverflow(this.selectedTab,e),this.scrollModule){var o=this.tabObj.element.querySelector("."+Ke);this.scrollModule.scrollStep=o.offsetWidth}if("Simplified"===this.activeLayout){var i=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(i.length)for(var n=0;n<i.length;n++){t.getInstance(i[parseInt(n.toString(),10)],r.DropDownButton).toggle()}}var s=document.querySelector(".e-ribbon-gallery-popup.e-popup-open");if(s){t.getComponent(s,a.Popup).hide()}this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},s.prototype.mouseEventHandler=function(e){this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},s.prototype.keytipActionHandler=function(e){if(this.enableKeyTips){var o=!1,i=e.key;if(e.altKey&&"Meta"===e.key){var n=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(n.length){for(var s=0;s<n.length;s++){t.getInstance(n[parseInt(s.toString(),10)],r.DropDownButton).toggle()}this.ribbonKeyTipModule.removeKeytip()}else if(this.isKeytipOpen)this.ribbonKeyTipModule.removeKeytip();else{var a=document.querySelector(".e-ribbon-backstage-popup");a&&a.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 l=document.querySelectorAll(".e-ribbon-keytip");if(l){for(s=0;s<l.length;s++){if(l[parseInt(s.toString(),10)].innerHTML.toLowerCase()===i){o=!0,this.ribbonKeyTipModule.keytipPress(i);break}}o||this.checkKeyTipPresent(i,this.keysPress.length)}}}},s.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(r.innerHTML.length>1&&r.innerHTML[parseInt(t.toString(),10)].toLowerCase()===e){this.keysPress+=e,this.ribbonKeyTipModule.keytipPress(this.keysPress),this.removeKeytip(this.keysPress);break}}},s.prototype.removeKeytip=function(e){for(var o=document.querySelectorAll(".e-ribbon-keytip"),i=0;i<o.length;i++){var r=o[parseInt(i.toString(),10)];r.innerHTML[0].toLowerCase()!==e&&""!==e&&t.remove(r)}},s.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[e][i]).length){for(var n=this.keyTipElements[e][i],s=0;s<Object.keys(this.keyTipElements[e][i]).length;s++)n[parseInt(s.toString(),10)].id===o&&(r=!0);r||this.keyTipElements[e][i].push({id:o,type:i,keyTip:t})}else this.keyTipElements[e][i].push({id:o,type:i,keyTip:t})}},s.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+"_tab"});this.element.appendChild(e),this.validateItemSize();var i=this.createTabItems(this.tabs);this.tabObj=new o.Tab({cssClass:"e-ribbon-tab",selectedItem:this.selectedTab,overflowMode:"Popup",width:this.width,items:i,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(po,"0px"),this.element.style.setProperty(co,"0px");var r=e.querySelector(".e-toolbar");t.getComponent(r,o.Toolbar).setProperties({width:"calc(100% - var(--fileMenuWidth) - var(--helpTemplateWidth))"}),this.element.classList[this.isMinimized?"add":"remove"](it)},s.prototype.minimize=function(e){var t=this;if(e!==this.isMinimized){this.trigger(e?"ribbonCollapsing":"ribbonExpanding",{cancel:!1},function(o){o.cancel||(t.setProperties({isMinimized:e},!0),t.element.classList.toggle(it,t.isMinimized),t.tabObj.element.querySelector(".e-content").style.display=e?"none":"block",e||t.refreshLayout())})}},s.prototype.toggleLayout=function(){this.setProperties({activeLayout:"Simplified"===this.activeLayout?"Classic":"Simplified"},!0),this.switchLayout()},s.prototype.tabCreated=function(){this.hideLayoutSwitcher||this.addExpandCollapse(),this.renderInitialTab(this.selectedTab)},s.prototype.ribbonTabSelected=function(e){e.preventFocus=!0,this.isAddRemove=!1;var t=e.selectedItem.getAttribute("data-id"),o=l(this.tabs,function(e){return e.id===t});o=-1===o?this.selectedTab:o;var i=this.isContextualTab(t);this.updateSelectedState(t);var r={previousIndex:this.selectedTab,selectedIndex:o,isContextual:i};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)}if(this.checkOverflow(o,e.selectedContent.firstChild),"Classic"===this.activeLayout&&this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(o,e.selectedContent.firstChild),"Simplified"===this.activeLayout&&this.overflowDDB){var a=this.overflowDDB.target,p=a.querySelector("."+Ve);p&&p.classList.remove(Ve);var c=a.querySelector("#"+t+eo);c?(c.classList.add(Ve),this.overflowDDB.element.classList.remove(Fe),this.checkOverflowHiddenItems(!1,o)):this.overflowDDB.element.classList.add(Fe)}this.trigger("tabSelected",r)},s.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)}},s.prototype.checkOverflow=function(e,t){var i=t.closest("."+ot),r=i.offsetWidth<t.offsetWidth;if(r&&!this.scrollModule){if("Classic"===this.activeLayout){var n=!1;!(n=this.checkGroupShrinking(e,i,t,!0))&&i.offsetWidth<t.offsetWidth&&(n=this.checkGroupShrinking(e,i,t,!1)),i.offsetWidth<t.offsetWidth&&this.createOverflowDropdown(e,i,t)}else this.checkSimplifiedItemShrinking(e,i,t),i.offsetWidth<t.offsetWidth&&this.createSimplfiedOverflow(i,t,e);i.offsetWidth<t.offsetWidth&&!this.scrollModule&&(this.scrollModule=new o.HScroll({enableRtl:this.enableRtl},this.tabObj.element.querySelector("."+ot)))}else if(!r)if(this.destroyScroll(),"Classic"===this.activeLayout){n=!1;!(n=this.removeOverflowDropdown(i,t,!1,e))&&i.offsetWidth>t.offsetWidth&&(n=this.checkGroupExpanding(e,i,t,!0)),!n&&i.offsetWidth>t.offsetWidth&&(n=this.checkGroupExpanding(e,i,t,!1))}else this.removeSimplfiedOverflow(i,t,e),i.offsetWidth>t.offsetWidth&&this.checkSimplifiedItemExpanding(e,i,t);this.addTabOverflowKeyTip()},s.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},s.prototype.checkSimplifiedItemShrinking=function(t,o,i){for(var r=this.tabs[parseInt(t.toString(),10)],n=r.groups.length-1;n>=0;n--)for(var s=r.groups[parseInt(n.toString(),10)],a=o.querySelector("#"+s.id+$t),l=0;l<s.collections.length&&o.offsetWidth<i.offsetWidth;l++)for(var p=s.collections[parseInt(l.toString(),10)],c=p.items.length;c>=1&&o.offsetWidth<i.offsetWidth;c--){var u=p.items[c-1];if(u.allowedSizes&e.RibbonItemSize.Small&&u.allowedSizes&e.RibbonItemSize.Medium&&u.activeSize===e.RibbonItemSize.Medium&&u.displayOptions&e.DisplayMode.Simplified){var d=a.querySelector("#"+u.id+$t);if(d){var h=d.querySelector("#"+u.id);d.setAttribute("data-medium-width",i.offsetWidth.toString()),u.setProperties({activeSize:e.RibbonItemSize.Small},!0),this.setItemSize(h,u)}}}},s.prototype.checkSimplifiedItemExpanding=function(t,o,i){for(var r=this.tabs[parseInt(t.toString(),10)],n=r.groups.length-1;n>=0;n--)for(var s=r.groups[parseInt(n.toString(),10)],a=o.querySelector("#"+s.id+$t),l=0;l<s.collections.length&&o.offsetWidth>i.offsetWidth;l++)for(var p=s.collections[parseInt(l.toString(),10)],c=p.items.length;c>=1&&o.offsetWidth>i.offsetWidth;c--){var u=p.items[c-1];if(u.allowedSizes&e.RibbonItemSize.Small&&u.allowedSizes&e.RibbonItemSize.Medium&&u.activeSize===e.RibbonItemSize.Small&&u.displayOptions&e.DisplayMode.Simplified){var d=a.querySelector("#"+u.id+$t);if(d){var h=d.getAttribute("data-medium-width"),b=h?parseInt(h,10):null;if(b&&o.offsetWidth>b){d.removeAttribute("data-medium-width");var m=d.querySelector("#"+u.id);u.setProperties({activeSize:e.RibbonItemSize.Medium},!0),this.setItemSize(m,u)}}}}},s.prototype.createSimplfiedOverflow=function(o,i,r){for(var n=this.getGroupResizeOrder(!0,r),s=0;s<n.length&&o.offsetWidth<i.offsetWidth;s++){for(var a=!1,l=n[parseInt(s.toString(),10)],p=o.querySelector("#"+l.id),c=p.querySelector("#"+l.id+$t),u=l.collections.length;u>=1&&o.offsetWidth<i.offsetWidth;u--)for(var d=l.collections[parseInt((u-1).toString(),10)],h=p.querySelector("#"+d.id),b=d.items.length;b>=1&&o.offsetWidth<i.offsetWidth;b--){var m=d.items[b-1],f=h.querySelector("#"+m.id+$t);if((m.displayOptions===e.DisplayMode.Auto||m.displayOptions===(e.DisplayMode.Simplified|e.DisplayMode.Overflow))&&!t.isNullOrUndefined(f)){var y=!1,g=!1,v=!1,S=!1,I=void 0;if(p.classList.contains("e-hidden")||p.classList.contains("e-hide-group")){if((I=p.querySelectorAll(".e-ribbon-item.e-hidden")).length)for(var C=0;C<I.length;C++)I[parseInt(C.toString(),10)].classList.remove("e-hidden");p.classList.contains("e-hide-group")?(v=!0,p.classList.remove("e-hide-group"),p.classList.remove("e-ribbon-emptyCollection"),-1!==this.hiddenGroups.indexOf(p.id)&&this.hiddenGroups.splice(this.hiddenGroups.indexOf(p.id),1)):(y=!0,p.classList.remove("e-hidden")),a||(this.calculateOverflowItemsWidth(p.offsetWidth,!1,r),this.calculateMediumDataWidth(p.offsetWidth,r,!1),a=!0)}else f.classList.contains("e-hidden")&&(g=!0,f.classList.remove("e-hidden"),p.classList.contains("e-ribbon-emptyCollection")&&(S=!0,p.classList.remove("e-ribbon-emptyCollection")),this.calculateOverflowItemsWidth(f.offsetWidth,!1,r),this.calculateMediumDataWidth(f.offsetWidth,r,!1));if(f.setAttribute("data-simplified-width",i.offsetWidth.toString()),g&&f.classList.add("e-hidden"),I&&I.length)for(var T=0;T<I.length;T++)I[parseInt(T.toString(),10)].classList.add("e-hidden");if(y&&p.classList.add("e-hidden"),v&&(p.classList.add("e-hide-group"),p.classList.add("e-ribbon-emptyCollection")),S&&p.classList.add("e-ribbon-emptyCollection"),this.createOverflowPopup(m,r,l.enableGroupOverflow,l.id,l.header,f,c,!0),m.activeSize===e.RibbonItemSize.Small){var w=f.querySelector("#"+m.id);m.setProperties({activeSize:e.RibbonItemSize.Medium},!0),this.setItemSize(w,m)}m.type!==e.RibbonItemType.DropDown&&m.type!==e.RibbonItemType.SplitButton&&m.type!==e.RibbonItemType.GroupButton&&m.type!==e.RibbonItemType.Gallery||this.updatePopupItems(m,f,l.enableGroupOverflow,!0)}}l.enableGroupOverflow||p.querySelector("."+Ct)||p.classList.add("e-ribbon-emptyCollection");var k=p.querySelectorAll("."+Ct);k&&!l.enableGroupOverflow&&this.checkEmptyCollection(k)&&p.classList.add("e-ribbon-emptyCollection"),this.checkOverflowHiddenItems(l.enableGroupOverflow,r,l.id)}},s.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},s.prototype.updatePopupItems=function(o,i,n,s){var a=t.getComponent(i.querySelector("#"+o.id),o.type===e.RibbonItemType.DropDown||o.type===e.RibbonItemType.Gallery||o.type===e.RibbonItemType.GroupButton?r.DropDownButton:r.SplitButton),l=a.dropDown,p=(n&&s)===this.enableRtl;l&&(l.setProperties({position:{X:p?"left":"right",Y:s?"top":"bottom"}},!0),s?a.beforeOpen=function(){p&&(l.element.style.setProperty("visibility","hidden"),l.element.style.setProperty("display","block"),l.setProperties({offsetX:-1*l.element.offsetWidth}),l.element.style.removeProperty("display"),l.element.style.removeProperty("visibility"))}:(l.setProperties({offsetX:0},!0),a.beforeOpen=null))},s.prototype.removeSimplfiedOverflow=function(o,i,n,s){void 0===s&&(s=!1);for(var a=this.getGroupResizeOrder(!1,n),l=!0,p=0;p<a.length&&l;p++){var c=a[parseInt(p.toString(),10)],u=void 0,d=void 0;if(c.enableGroupOverflow){var h=o.querySelector("#"+c.id+Yt);h&&(d=(u=t.getInstance(h,r.DropDownButton)).target)}else u=this.overflowDDB,d=this.overflowDDB?this.overflowDDB.target:null;for(var b=0;b<c.collections.length&&l;b++)for(var m=c.collections[parseInt(b.toString(),10)],f=0;f<m.items.length&&l&&!s&&o.offsetWidth>i.offsetWidth;f++){var y=m.items[parseInt(f.toString(),10)],g=void 0;if(d&&(g=d.querySelector("#"+y.id+$t)),(y.displayOptions===e.DisplayMode.Auto||y.displayOptions===(e.DisplayMode.Simplified|e.DisplayMode.Overflow))&&!t.isNullOrUndefined(g)){var v=parseInt(g.getAttribute("data-simplified-width"),10),S=o.querySelector("#"+c.id);if((g.classList.contains("e-hidden")||S.classList.contains("e-hidden"))&&(v=Math.abs(v-i.offsetWidth)),!s&&o.offsetWidth<v){l=!1;break}var I=o.querySelector("#"+m.id);if(y.type!==e.RibbonItemType.DropDown&&y.type!==e.RibbonItemType.SplitButton&&y.type!==e.RibbonItemType.GroupButton&&y.type!==e.RibbonItemType.Gallery||this.updatePopupItems(y,g,c.enableGroupOverflow,!1),I.append(g),g.classList.contains("e-hidden")||S.classList.contains("e-hidden")){g.setAttribute("data-simplified-width",v.toString());var C=!1,T=0;g.classList.contains("e-hidden")&&(g.classList.remove("e-hidden"),S.classList.contains("e-hide-group")&&(C=!0,T=this.checkWidthDifference(g,S)),v=g.offsetWidth+T,g.classList.add("e-hidden")),this.calculateOverflowItemsWidth(v,!0,n),this.calculateMediumDataWidth(v,n,!0),C&&(S.classList.add("e-hide-group"),S.classList.add("e-ribbon-emptyCollection"))}this.removeOverflowEvent(y,g),y.allowedSizes&e.RibbonItemSize.Small&&(y.setProperties({activeSize:e.RibbonItemSize.Small},!0),this.setItemSize(g.querySelector("#"+y.id),y));var w=o.querySelector("#"+c.id),k=w.querySelector("."+Ct);if(w.classList.contains("e-ribbon-emptyCollection")&&null!==k){var O=w.querySelectorAll("."+Ct);O&&(this.checkEmptyCollection(O)||w.classList.remove("e-ribbon-emptyCollection"))}}}if(u)if(c.enableGroupOverflow)(0===d.childElementCount||1===d.childElementCount&&this.isHeaderVisible(d,c.id))&&this.removeOverflowButton(u);else{var B=d.querySelector("#"+c.id+$t);B&&1===B.childElementCount&&B.remove();var P=d.querySelector("#"+this.tabs[parseInt(n.toString(),10)].id+eo);P&&0===P.childElementCount&&(P.remove(),this.overflowDDB.element.classList.add(Fe))}}for(p=0;p<a.length;p++)this.checkOverflowHiddenItems(a[parseInt(p.toString(),10)].enableGroupOverflow,n,a[parseInt(p.toString(),10)].id);if(this.overflowDDB){0===this.overflowDDB.target.childElementCount&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)}},s.prototype.checkOverflowHiddenItems=function(e,o,i){if(e){var n=document.querySelector("#"+i+Yt);if(n){for(var s=t.getInstance(n,r.DropDownButton),a=s.target.querySelectorAll(".e-ribbon-item"),l=!0,p=0;p<a.length;p++)if(!a[parseInt(p.toString(),10)].classList.contains("e-hidden")){l=!1;break}s.element.classList[l?"add":"remove"]("e-hidden")}}else if(this.overflowDDB){var c=!0,u=void 0,d=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+eo);if(d){for(var h=0;h<d.children.length;h++){u=!0;for(var b=d.children[parseInt(h.toString(),10)],m=b.querySelectorAll(".e-ribbon-item"),f=0;f<m.length;f++)if(!m[parseInt(f.toString(),10)].classList.contains("e-hidden")){u=!1;break}b.classList[u?"add":"remove"]("e-hide-group"),b.classList.contains("e-hide-group")||b.classList.contains("e-hidden")||(c=!1)}this.overflowDDB.element.classList[c?"add":"remove"](Fe)}}},s.prototype.createOverflowPopup=function(e,o,i,n,s,a,l,p){var c,u,h=d(this.tabs,n),b=this.tabObj.items[parseInt(o.toString(),10)].content.querySelector("#"+n);if(i){var m=l.querySelector("#"+n+Yt);m?c=t.getInstance(m,r.DropDownButton):((c=this.addOverflowButton(n+Yt,i)).element.classList.add($e),l.appendChild(c.element)),this.addKeyTip(o,"0"+(h.groupIndex+1),c.element.id,"grpofbtn"),u=c.target;var f=c.target;if(!f.querySelector("#"+n+Yt+Zt)&&h.group.overflowHeader){var y=this.createElement("div",{className:mt,id:n+Yt+Zt,innerHTML:h.group.overflowHeader});f.append(y)}b&&(b.classList.contains("e-disabled")&&f.classList.add("e-disabled"),b.classList.contains("e-hidden")&&f.classList.add("e-hidden"),b.classList.contains("e-hide-group")&&f.classList.add("e-hide-group")),p?f.insertBefore(a,f.querySelector("."+Ct)):f.append(a)}else{if(this.overflowDDB){this.overflowDDB.element.classList.remove(Fe);var g=this.overflowDDB.target,v=g.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+eo);if(v){var S=g.querySelector("#"+n+$t);S||(S=h.group.overflowHeader?this.createGroupContainer(n,h.group.overflowHeader):this.createGroupContainer(n,s),b&&(b.classList.contains("e-disabled")&&S.classList.add("e-disabled"),b.classList.contains("e-hidden")&&S.classList.add("e-hidden"),b.classList.contains("e-hide-group")&&S.classList.add("e-hide-group")),v.append(S)),p?S.insertBefore(a,S.querySelector("."+Ct)):S.append(a)}else this.createOfTabContainer(n,s,a,o)}else this.overflowDDB=this.addOverflowButton(this.tabObj.element.id+Xt,i),this.tabObj.element.insertBefore(this.overflowDDB.element,this.collapseButton),this.overflowDDB.element.classList.add(Qe),this.createOfTabContainer(n,s,a,o);c=this.overflowDDB,u=this.overflowDDB?this.overflowDDB.target:null}null!==a&&this.addOverflowEvents(e,a,c),u&&e.keyTip&&this.addKeyTip(o,e.keyTip,e.id,"popupitem")},s.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,o);break;case"GroupButton":if("Simplified"===this.activeLayout){this.ribbonGroupButtonModule.addOverFlowEvents(e,t,o);break}}},s.prototype.createOfTabContainer=function(e,t,o,i){var r=this.createElement("div",{id:this.tabs[parseInt(i.toString(),10)].id+eo,className:ut});this.overflowDDB.target.append(r);var n=d(this.tabs,e),s=n.group.overflowHeader?this.createGroupContainer(e,n.group.overflowHeader):this.createGroupContainer(e,t);s.append(o),r.append(s),i===this.selectedTab&&r.classList.add(Ve);var a=document.querySelector("#"+e);a&&(a.classList.contains("e-disabled")&&s.classList.add("e-disabled"),a.classList.contains("e-hidden")&&s.classList.add("e-hidden"),a.classList.contains("e-hide-group")&&s.classList.add("e-hide-group"))},s.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&&a>=0;a--)r=!(n=i?this.checkLargeToMedium(e,s,a,t,o):this.checkMediumToSmall(e,s,a,t,o))&&t.offsetWidth<o.offsetWidth;return n},s.prototype.checkValidCollectionLength=function(t){for(var o=0,i=0;i<t.length;i++){for(var r=t[parseInt(i.toString(),10)].items,n=0;n<r.length;n++)if(r[parseInt(n.toString(),10)].displayOptions&e.DisplayMode.Classic){o++;break}if(o>1)return!1}return 1===o},s.prototype.checkClassicCollection=function(t,o,i){for(var r=t[parseInt(o.toString(),10)].items,n=0;n<r.length;n++)if(r[parseInt(n.toString(),10)].displayOptions&e.DisplayMode.Classic)return o;return o=i?o+1:o-1,i?o===t.length?o:this.checkClassicCollection(t,o,i):o<0?o:this.checkClassicCollection(t,o,i)},s.prototype.checkClassicItem=function(t,o,i){return t[parseInt(o.toString(),10)].displayOptions&e.DisplayMode.Classic?o:(o=i?o+1:o-1,i?o===t.length?o:this.checkClassicItem(t,o,i):o<0?o:this.checkClassicItem(t,o,i))},s.prototype.checkLargeToMedium=function(t,o,i,r,n,s){var a=this;void 0===s&&(s=!1);var l=o.groups[parseInt(i.toString(),10)];if(l.isCollapsed&&!s)return!1;var p=function(e){return 1===e.items.length&&c(e.items[0])},c=function(t){return t.allowedSizes&e.RibbonItemSize.Medium&&t.activeSize===e.RibbonItemSize.Large},u=function(e,t,o,i){var r=a.createElement("div",{className:"e-ribbon-shrink "+Tt,id:e+"_shrink_container"+o,attrs:{"data-start":o.toString(),"data-end":i.toString()}});return t.parentElement.insertBefore(r,t),s||r.setAttribute("data-large-width",n.offsetWidth.toString()),r},d=function(o,r){for(var l=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections[0],p=n.querySelector("#"+l.items[parseInt(o.toString(),10)].id+$t),c=s?n.querySelector("#"+l.id+"_shrink_container"+o):u(l.id,p,o,r),d=o;d<=r;d++){var h=l.items[parseInt(d.toString(),10)];if(h.displayOptions&e.DisplayMode.Classic){var b=n.querySelector("#"+h.id+$t);c.appendChild(b),h.setProperties({activeSize:e.RibbonItemSize.Medium},!0),h.type===e.RibbonItemType.GroupButton&&"Classic"===a.activeLayout?a.setItemSize(b.querySelector("#"+h.id+ao),h):a.setItemSize(b.querySelector("#"+h.id),h)}}},h=function(o,r){for(var l=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)],p=n.querySelector("#"+l.collections[parseInt(o.toString(),10)].id),c=s?n.querySelector("#"+l.id+"_shrink_container"+o):u(l.id,p,o,r),d=o;d<=r;d++){var h=l.collections[parseInt(d.toString(),10)],b=n.querySelector("#"+h.id);c.appendChild(b),h.items[0].setProperties({activeSize:e.RibbonItemSize.Medium},!0),h.items[0].type===e.RibbonItemType.GroupButton&&"Classic"===a.activeLayout?a.setItemSize(b.querySelector("#"+h.items[0].id+ao),h.items[0]):a.setItemSize(b.querySelector("#"+h.items[0].id),h.items[0])}};if(l.orientation===e.ItemOrientation.Column)for(var b=l.collections.length-1;b>0;b--){if((f=(b=this.checkClassicCollection(l.collections,b,!1))-1)>=0&&p(l.collections[parseInt(b.toString(),10)]))if((f=this.checkClassicCollection(l.collections,f,!1))>=0&&p(l.collections[parseInt(f.toString(),10)])){if((y=f-1)>=0&&(y=this.checkClassicCollection(l.collections,y,!1)),y>=0&&p(l.collections[parseInt(y.toString(),10)])?h(y,b):h(f,b),b=y,!s&&r.offsetWidth>n.offsetWidth)return!0}else b=f}else if(this.checkValidCollectionLength(l.collections)){var m=l.collections[0];for(b=m.items.length-1;b>0;b--){var f;if((f=(b=this.checkClassicItem(m.items,b,!1))-1)>=0&&c(m.items[parseInt(b.toString(),10)]))if((f=this.checkClassicItem(m.items,f,!1))>=0&&c(m.items[parseInt(f.toString(),10)])){var y;if((y=f-1)>=0&&(y=this.checkClassicItem(m.items,y,!1)),y>=0&&c(m.items[parseInt(y.toString(),10)])?d(y,b):d(f,b),b=y,!s&&r.offsetWidth>n.offsetWidth)return!0}else b=f}}return!1},s.prototype.checkMediumToSmall=function(t,o,i,r,n,s){var a=this;void 0===s&&(s=!1);var l=o.groups[parseInt(i.toString(),10)];if(l.isCollapsed&&!s)return!1;var p=l.orientation,c=n.querySelector("#"+l.id).querySelectorAll(".e-ribbon-shrink"),u=function(t){return t.allowedSizes&e.RibbonItemSize.Small&&t.activeSize===e.RibbonItemSize.Medium},d=function(o,r,s,l){void 0===l&&(l=null);var p=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections[parseInt(o.toString(),10)],c=function(t){var o=p.items[parseInt(t.toString(),10)];if(o.displayOptions&e.DisplayMode.Classic){var i=n.querySelector("#"+o.id);o.setProperties({activeSize:e.RibbonItemSize.Small},!0),o.type===e.RibbonItemType.GroupButton&&(i=n.querySelector("#"+o.id+"_grpbtn")),a.setItemSize(i,o)}};c(r),l&&c(l),c(s)},h=function(o,r,l,p){void 0===p&&(p=null);var u=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)];s||c[parseInt(o.toString(),10)].setAttribute("data-medium-width",n.offsetWidth.toString());var d=function(t){var o=u.collections[parseInt(t.toString(),10)];if(o.items[0].displayOptions&e.DisplayMode.Classic){var i=n.querySelector("#"+o.items[0].id);o.items[0].setProperties({activeSize:e.RibbonItemSize.Small},!0),o.items[0].type===e.RibbonItemType.GroupButton&&(i=n.querySelector("#"+o.items[0].id+ao)),a.setItemSize(i,o.items[0])}};d(r),p&&d(p),d(l)},b=function(e){if(!s){n.querySelector("#"+e).setAttribute("data-medium-width",n.offsetWidth.toString())}};if(p===e.ItemOrientation.Column){if(c.length>0)for(var m=c.length-1;m>=0;m--){var f=parseInt(c[parseInt(m.toString(),10)].getAttribute("data-start"),10),y=parseInt(c[parseInt(m.toString(),10)].getAttribute("data-end"),10),g=this.checkClassicCollection(l.collections,f+1,!1);if(u(l.collections[parseInt(f.toString(),10)].items[0])&&u(l.collections[parseInt(g.toString(),10)].items[0])&&(y===g?h(m,f,y):u(l.collections[parseInt(y.toString(),10)].items[0])&&h(m,f,y,g),!s&&r.offsetWidth>n.offsetWidth))return!0}for(m=l.collections.length-1;m>=0;m--){for(var v=l.collections[parseInt(m.toString(),10)],S=[],I=0;I<v.items.length;I++)v.items[parseInt(I.toString(),10)].displayOptions&e.DisplayMode.Classic&&S.push(I);if(S.length>1&&u(v.items[S[0]])&&u(v.items[S[1]])&&(2===S.length?(b(v.id),d(m,S[0],S[1])):u(v.items[S[2]])&&(b(v.id),d(m,S[0],S[2],S[1])),!s&&r.offsetWidth>n.offsetWidth))return!0}}else if(this.checkValidCollectionLength(l.collections)){if(c.length>0)for(m=c.length-1;m>=0;m--){var C=c[parseInt(m.toString(),10)];f=parseInt(C.getAttribute("data-start"),10),y=parseInt(C.getAttribute("data-end"),10),v=l.collections[0],g=this.checkClassicItem(v.items,f+1,!1);if(u(l.collections[0].items[parseInt(f.toString(),10)])&&u(l.collections[0].items[parseInt(g.toString(),10)])&&(y===g?(b(C.id),d(0,f,y)):u(l.collections[0].items[parseInt(y.toString(),10)])&&(b(C.id),d(0,f,y,g)),!s&&r.offsetWidth>n.offsetWidth))return!0}}else for(m=l.collections.length-1;m>=0;m--)for(g=(v=l.collections[parseInt(m.toString(),10)]).items.length-1;g>=0;g--)if(!((g=this.checkClassicItem(v.items,g,!1))<0)){var T=v.items[parseInt(g.toString(),10)];if(u(T)&&(T.type!==e.RibbonItemType.GroupButton?b(T.id):b(T.id+ao),d(m,g,g),!s&&r.offsetWidth>n.offsetWidth))return!0}return!1},s.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},s.prototype.checkSmallToMedium=function(t,o,i,r,n,s,a){var l=this,p=o.groups[parseInt(i.toString(),10)],c=p.orientation,u=n.querySelector("#"+p.id).querySelectorAll(".e-ribbon-shrink"),d=function(t){return t.allowedSizes&e.RibbonItemSize.Medium&&t.activeSize===e.RibbonItemSize.Small},h=function(o,r,n){var s=l.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections[parseInt(o.toString(),10)].items[parseInt(r.toString(),10)];if(s.displayOptions&e.DisplayMode.Classic){var a=n.id===s.id?n:n.querySelector("#"+s.id);s.setProperties({activeSize:e.RibbonItemSize.Medium},!0),s.type===e.RibbonItemType.GroupButton&&(a=document.querySelector("#"+s.id+ao)),l.setItemSize(a,s)}},b=function(o){var r=l.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections,s=r[parseInt(o.toString(),10)].items[0];if(s.displayOptions&e.DisplayMode.Classic){var a=n.querySelector("#"+r[parseInt(o.toString(),10)].items[0].id);r[parseInt(o.toString(),10)].items[0].setProperties({activeSize:e.RibbonItemSize.Medium},!0),s.type===e.RibbonItemType.GroupButton&&(a=n.querySelector("#"+r[parseInt(o.toString(),10)].items[0].id+ao)),l.setItemSize(a,r[parseInt(o.toString(),10)].items[0])}};if(c===e.ItemOrientation.Row){if(!this.checkValidCollectionLength(p.collections))for(var m=0;m<p.collections.length;m++)for(var f=p.collections[parseInt(m.toString(),10)],y=0;y<f.items.length;y++)if((y=this.checkClassicItem(f.items,y,!0))!==f.items.length){var g=f.items[parseInt(y.toString(),10)];if(d(g)){var v=n.querySelector("#"+g.id);"GroupButton"===g.type&&(v=n.querySelector("#"+g.id+ao));if((S=(T=v.getAttribute("data-medium-width"))?parseInt(T,10):null)&&(s||r.offsetWidth>S))h(m,y,v),s&&!a||v.removeAttribute("data-medium-width");else if(S)return!0}}}else for(m=0;m<p.collections.length;m++)if(p.collections[parseInt(m.toString(),10)].items.length>1){f=p.collections[parseInt(m.toString(),10)];for(var S=(T=(v=n.querySelector("#"+f.id)).getAttribute("data-medium-width"))?parseInt(T,10):null,I=[],C=0;C<f.items.length;C++)f.items[parseInt(C.toString(),10)].displayOptions&e.DisplayMode.Classic&&I.push(C);if(I.length>1&&S&&(s||r.offsetWidth>S))h(m,I[0],v),h(m,I[1],v),3===I.length&&h(m,I[2],v),s&&!a||v.removeAttribute("data-medium-width");else if(S)return!0}if(u.length>0)for(m=0;m<u.length;m++){var T,w=u[parseInt(m.toString(),10)];if((S=(T=w.getAttribute("data-medium-width"))?parseInt(T,10):null)&&(s||r.offsetWidth>S)){var k=parseInt(w.getAttribute("data-start"),10),O=parseInt(w.getAttribute("data-end"),10);if(c===e.ItemOrientation.Row){f=p.collections[0],y=this.checkClassicItem(f.items,k+1,!0);h(0,k,w),h(0,y,w),y!==O&&h(0,O,w)}else{var B=this.checkClassicCollection(p.collections,k+1,!0);b(k),b(B),B!==O&&b(O)}s&&!a||w.removeAttribute("data-medium-width")}else if(S)return!0}return!1},s.prototype.checkMediumToLarge=function(o,i,r,n,s,a,l){var p=this,c=i.groups[parseInt(r.toString(),10)],u=c.orientation,d=s.querySelector("#"+c.id).querySelectorAll(".e-ribbon-shrink");if(0===d.length)return!1;for(var h=function(i,n,s,c){var u=p.tabs[parseInt(o.toString(),10)].groups[parseInt(r.toString(),10)].collections[0].items,d=function(t){var o=u[parseInt(t.toString(),10)];if(o.displayOptions&e.DisplayMode.Classic){var i=s.querySelector("#"+o.id+$t),r=i.querySelector("#"+o.id);o.setProperties({activeSize:e.RibbonItemSize.Large},!0),o.type===e.RibbonItemType.GroupButton&&(r=i.querySelector("#"+o.id+ao)),p.setItemSize(r,o),s.insertAdjacentElement("beforebegin",i)}};d(i),c&&d(c),d(n),a&&!l||t.remove(s)},b=function(i,n,s,c){var u=p.tabs[parseInt(o.toString(),10)].groups[parseInt(r.toString(),10)].collections,d=function(t){var o=u[parseInt(t.toString(),10)];if(o.items[0].displayOptions&e.DisplayMode.Classic){var i=s.querySelector("#"+o.id),r=i.querySelector("#"+o.items[0].id);o.items[0].setProperties({activeSize:e.RibbonItemSize.Large},!0),o.items[0].type===e.RibbonItemType.GroupButton&&(r=i.querySelector("#"+o.items[0].id+ao)),p.setItemSize(r,o.items[0]),s.insertAdjacentElement("beforebegin",i)}};d(i),c&&d(c),d(n),a&&!l||t.remove(s)},m=0;m<d.length;m++){var f=d[parseInt(m.toString(),10)],y=f.getAttribute("data-large-width"),g=y?parseInt(y,10):null;if(g&&(a||n.offsetWidth>g)){var v=parseInt(f.getAttribute("data-start"),10),S=parseInt(f.getAttribute("data-end"),10);if(u===e.ItemOrientation.Row){var I=c.collections[0],C=this.checkClassicItem(I.items,v+1,!0);C===S?h(v,S,f):h(v,S,f,C)}else{var T=this.checkClassicCollection(c.collections,v+1,!0);T===S?b(v,S,f):b(v,S,f,T)}a&&!l||f.removeAttribute("data-large-width")}else if(g)return!0}return!1},s.prototype.handleContentSize=function(e,t){var o=e.closest("."+ht);t?o.classList.add(Pt):o.classList.remove(Pt)},s.prototype.setItemSize=function(o,i){if(o){var r=o.closest("."+Ct);i.type===e.RibbonItemType.Button?this.ribbonButtonModule.updateButtonSize(o,i):i.type===e.RibbonItemType.DropDown?this.ribbonDropDownModule.updateDropDownSize(o,i):i.type===e.RibbonItemType.SplitButton?this.ribbonSplitButtonModule.updateSplitButtonSize(o,i):i.type===e.RibbonItemType.Template?(t.remove(o),this.createTemplateContent(i,r)):i.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.updateGroupButtonSize(o,i),r.classList.remove(Pt,kt,Ot,Bt),i.activeSize===e.RibbonItemSize.Large?r.classList.add(kt,Pt):r.classList.add(i.activeSize===e.RibbonItemSize.Medium?Ot:Bt)}},s.prototype.createOverflowDropdown=function(o,i,n){var s=this.getGroupResizeOrder(!0,o);if(0!==s.length)for(var a=function(a){var c=s[parseInt(a.toString(),10)],u=p.tabObj.element.querySelector("#"+c.id);u.setAttribute("data-expanded-width",n.offsetWidth.toString());var d=u.querySelector("#"+c.id+$t),h=p.createElement("div",{className:ft+" "+kt,id:c.id+eo+$t});u.insertBefore(h,d);var b=l(p.tabs[parseInt(o.toString(),10)].groups,function(e){return e.id===c.id}),m=p.tabs[parseInt(o.toString(),10)];p.checkSmallToMedium(o,m,b,i,n,!0,!1),p.checkMediumToLarge(o,m,b,i,n,!0,!1);var f=p.ribbonDropDownModule.createOverFlowDropDown(c.id,c.header,c.groupIconCss,d,h,p.enableRtl);if(c.keyTip){var y=c.id+eo+to;p.addKeyTip(o,c.keyTip,y,"grpoverflow")}p.tabs[parseInt(o.toString(),10)].groups[parseInt(b.toString(),10)].setProperties({isCollapsed:!0},!0);for(var g=0;g<c.collections.length;g++)for(var v=c.collections[parseInt(g.toString(),10)],S=d.querySelector("#"+v.id),I=0;I<v.items.length;I++){var C=v.items[parseInt(I.toString(),10)],T=S.querySelector("#"+C.id+$t);null!==T&&(p.handleContentSize(T),p.addOverflowEvents(C,T,f));y=document.querySelector("#"+c.id+eo+to);var w=t.getInstance(y,r.DropDownButton);if(w){if(w.target&&p.keyTipElements[parseInt(o.toString(),10)]){if(C.type===e.RibbonItemType.GroupButton)for(var k=0;k<C.groupButtonSettings.items.length;k++)C.groupButtonSettings.items[parseInt(k.toString(),10)].keyTip&&p.addKeyTip(o,C.groupButtonSettings.items[parseInt(k.toString(),10)].keyTip,C.id+(ao+k),"grpoverflowpopup");C.keyTip&&p.addKeyTip(o,C.keyTip,C.id,"grpoverflowpopup")}}}},p=this,c=0;c<s.length&&i.offsetWidth<n.offsetWidth;c++)a(c)},s.prototype.removeOverflowDropdown=function(e,t,o,i){void 0===o&&(o=!1);var r=this.getGroupResizeOrder(!1,i);if(0===r.length)return!1;for(var n=function(n){var a=r[parseInt(n.toString(),10)],p=s.tabObj.element.querySelector("#"+a.id);if(!p)return"break";var c=parseInt(p.getAttribute("data-expanded-width"),10);if(!o&&e.offsetWidth<c)return{value:!0};s.removeDropdown(a.id);var u=l(s.tabs[parseInt(i.toString(),10)].groups,function(e){return e.id===a.id});s.tabs[parseInt(i.toString(),10)].groups[parseInt(u.toString(),10)].setProperties({isCollapsed:!1},!0);var d=s.tabs[parseInt(i.toString(),10)];s.checkLargeToMedium(i,d,u,e,t,!0),s.checkMediumToSmall(i,d,u,e,t,!0);for(var h=0;h<a.collections.length;h++)for(var b=a.collections[parseInt(h.toString(),10)],m=p.querySelector("#"+b.id),f=0;f<b.items.length;f++){var y=b.items[parseInt(f.toString(),10)],g=m.querySelector("#"+y.id+$t);null!==g&&(s.handleContentSize(g,!0),s.removeOverflowEvent(y,g))}},s=this,a=0;a<r.length;a++){var p=n(a);if("object"==typeof p)return p.value;if("break"===p)break}return!1},s.prototype.removeDropdown=function(e){var o=this.tabObj.element.querySelector("#"+e+eo+to);if(o){var i=o.parentElement;this.ribbonDropDownModule.removeOverFlowDropDown(o),t.remove(i)}},s.prototype.getGroupResizeOrder=function(e,o){var i=this,r=this.tabs[parseInt(o.toString(),10)].groups;return(r=r.filter(function(o){return"Classic"!==i.activeLayout||(t.isUndefined(o.isCollapsible)||o.isCollapsible)&&(e&&t.isUndefined(o.isCollapsed)||!t.isUndefined(o.isCollapsed)&&e!==o.isCollapsed)})).sort(function(e,t){return e.priority-t.priority}),e?r.reverse():r},s.prototype.destroyScroll=function(){this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null)},s.prototype.clearOverflowDropDown=function(e){var t=this.tabObj.element.querySelector("#"+this.tabs[parseInt(e.toString(),10)].id+Qt);if(t){var o=t.closest("."+ot);"Simplified"===this.activeLayout?this.removeSimplfiedOverflow(t,o,e,!0):this.removeOverflowDropdown(t,o,!0,e)}},s.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},s.prototype.ribbonTabSelecting=function(e){var o=this;this.currentControlIndex=0;var i=e.selectingItem.getAttribute("data-id"),r=e.previousItem.getAttribute("data-id"),n=l(this.tabs,function(e){return e.id===i}),s=this.isContextualTab(i),a=l(this.tabs,function(e){return e.id===r});n=-1===n?this.selectedTab:n;var p={cancel:e.cancel,isInteracted:e.isInteracted,previousIndex:a,selectedIndex:n,isContextual:s};this.trigger("tabSelecting",p,function(e){if(!e.cancel){o.destroyScroll(),o.isAddRemove||-1===a||o.clearOverflowDropDown(a);var i=o.tabObj.items[parseInt(n.toString(),10)].content;if(!i.querySelector("."+rt)&&0!==o.tabs[parseInt(n.toString(),10)].groups.length){var r=o.createGroups(o.tabs[parseInt(n.toString(),10)].groups,n);t.append(r,i)}}})},s.prototype.createTabItems=function(e){for(var t=this,o=[],i=function(i){var n=e[parseInt(i.toString(),10)],s=r.createElement("span",{innerHTML:n.header,id:n.id+Zt}),a=l(r.tabs,function(e){return e.id===n.id});n.keyTip&&(r.keyTipElements[parseInt(a.toString(),10)]||(r.keyTipElements[parseInt(a.toString(),10)]={}),r.addKeyTip(a,n.keyTip,n.id,"tab")),s.onclick=function(){t.minimize(!1)},s.ondblclick=function(){t.minimize(!0)};var p={header:{text:s},id:n.id,cssClass:n.cssClass},c=r.createElement("div",{className:p.cssClass,id:n.id+Qt});c.classList.add(Xe),p.content=c,o.push(p)},r=this,n=0;n<e.length;n++)i(n);return o},s.prototype.renderInitialTab=function(e){var o=this.createGroups(this.tabs[parseInt(e.toString(),10)].groups,e),i=this.tabObj.items[parseInt(e.toString(),10)].content;t.append(o,i),"Simplified"===this.activeLayout&&this.element.classList.add(jt);var r=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt);this.checkOverflow(this.selectedTab,r),"Classic"===this.activeLayout&&this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(this.selectedTab,r)},s.prototype.addOverflowButton=function(e,o){var i=this,n=this.createElement("button",{id:e}),s=this.createElement("div",{className:et,attrs:{tabindex:"0"}}),a=new r.DropDownButton({iconCss:_e,cssClass:"e-caret-hide "+yt,target:s,locale:this.locale,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence,beforeOpen:function(e){var t={element:e.element,event:e.event,cancel:e.cancel};i.trigger("overflowPopupOpen",t,function(t){t.cancel&&(e.cancel=!0)})},beforeClose:function(e){var o=e.event?t.closest(e.event.target,"."+Ne):null,r=e.event?t.closest(e.event.target,".e-ribbon-group-button-overflow-popup"):null,n={element:e.element,event:e.event,cancel:e.cancel};i.trigger("overflowPopupClose",n,function(t){(o||t.cancel||r)&&(e.cancel=!0)})}},n);this.element.classList.add(tt),v(s,this),o||(this.keyTipElements.overflowbtn=[],this.keyTipElements.overflowbtn.push({id:e,type:"overflowbtn",keyTip:"00"}));var l;return n.onkeydown=n.onclick=function(){i.itemIndex=-1,l=!n.classList.contains("e-ribbon-overall-of-btn")},s.onkeydown=function(e){return i.upDownKeyHandler(e,s,l),i},a},s.prototype.upDownKeyHandler=function(e,o,i){var r;if(i)r=o.getElementsByClassName("e-ribbon-item");else{r=o.querySelector(".e-ribbon-of-tab.e-ribbon-active").getElementsByClassName("e-ribbon-item")}var s,a,l=r[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-control"),p=l&&l.classList.contains("e-combobox")?r[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-combobox"):null;if(null===p||"Tab"===e.key||this.itemIndex<0){if("ArrowDown"===e.key||!e.shiftKey&&"Tab"===e.key){if(!this.itemIndex&&0!==this.itemIndex||this.itemIndex<0||this.itemIndex===r.length-1){if(this.itemIndex=0,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!0),p&&"Tab"===e.key){e.preventDefault();(c=r[this.itemIndex].querySelector(".e-control"))&&c.focus()}a=r[this.itemIndex].querySelector(".e-ribbon-template")}else this.itemIndex<r.length-1&&this.itemIndex>=0&&(this.itemIndex++,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!0),a=r[this.itemIndex].querySelector(".e-ribbon-template"));a&&a.focus()}else if(("ArrowUp"===e.key||e.shiftKey&&"Tab"===e.key)&&(null===p||"Tab"===e.key)){if(this.itemIndex&&-1!==this.itemIndex)this.itemIndex<=r.length-1&&this.itemIndex>0&&(this.itemIndex--,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!1),a=r[this.itemIndex].querySelector(".e-ribbon-template"));else{if(this.itemIndex=r.length-1,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!1),p&&e.shiftKey&&"Tab"===e.key){e.preventDefault();var c;(c=r[this.itemIndex].querySelector(".e-control"))&&c.focus()}a=r[this.itemIndex].querySelector(".e-ribbon-template")}a&&a.focus()}o.setAttribute("index",this.itemIndex.toString())}var u=parseInt(o.getAttribute("index"),10),d="",h=r[parseInt(u.toString(),10)]?r[parseInt(u.toString(),10)].querySelector(".e-control"):null;if(h&&(d=h.getAttribute("data-control")),"ArrowDown"===e.key||"ArrowUp"===e.key||" "===e.key||"Tab"===e.key){if("ColorPicker"===d)"Tab"===e.key&&e.preventDefault(),r[parseInt(u.toString(),10)].querySelector(".e-split-colorpicker").focus();else{"Tab"===e.key&&e.preventDefault();var b=r[parseInt(u.toString(),10)].querySelector(".e-control");b&&b.focus()}if(" "===e.key&&"CheckBox"===d){var m=r[parseInt(u.toString(),10)].querySelector(".e-control"),f=t.getComponent(m,n.CheckBox);this.itemIndex=-1,f.click()}}"SplitButton"!==d||"ArrowRight"!==e.key&&"ArrowLeft"!==e.key||("ArrowRight"===e.key&&(this.enableRtl?r[parseInt(u.toString(),10)].querySelector(".e-control").focus():r[parseInt(u.toString(),10)].querySelector(".e-dropdown-btn").focus()),"ArrowLeft"===e.key&&(this.enableRtl?r[parseInt(u.toString(),10)].querySelector(".e-dropdown-btn").focus():r[parseInt(u.toString(),10)].querySelector(".e-control").focus())),"Enter"===e.key&&(this.itemIndex=-1)},s.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")},s.prototype.removeOverflowButton=function(e){if(e){var t=e.element;S(e.target),e.destroy(),t.remove()}},s.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)}},s.prototype.createGroupContainer=function(e,t){var o=this.createElement("div",{className:dt,id:e+$t}),i=this.createElement("div",{className:mt,id:e+Zt,innerHTML:t});return o.append(i),o},s.prototype.addExpandCollapse=function(){var e=this;this.collapseButton=this.createElement("span",{className:Ye+" "+xe,id:this.tabObj.element.id+Vt,attrs:{tabindex:"0",type:"button","aria-label":"Layout Switcher",role:"button"}}),this.collapseButton.onclick=function(){e.toggleLayout()},this.collapseButton.onkeydown=function(t){"Enter"===t.key&&e.toggleLayout()},this.element.classList.add(Je),"Simplified"===this.activeLayout&&this.collapseButton.classList.add(Ze),this.tabObj.element.appendChild(this.collapseButton),this.layoutSwitcherKeyTip&&(this.keyTipElements.collapse=[],this.keyTipElements.collapse.push({id:this.collapseButton.id,type:"collapse",keyTip:this.layoutSwitcherKeyTip}))},s.prototype.removeExpandCollapse=function(){var e=this,o=l(this.tooltipData,function(t){return t.id===e.collapseButton.id});-1!==o&&this.tooltipData.splice(o,1),this.element.classList.remove(Je),t.remove(this.tabObj.element.querySelector("."+Ye)),this.collapseButton=null},s.prototype.reRenderTabs=function(e){this.destroyScroll(),this.checkID(this.tabs,"tab",this.element.id);for(var o in e){for(var i=parseInt(o,10),r=e[parseInt(i.toString(),10)],n=!1,s=0;s<this.tabObj.items.length;s++)if(this.tabs[parseInt(i.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(i.toString(),10)].groups,p=this.tabObj.element,c=this.tabs[parseInt(i.toString(),10)];c.setProperties(r,!0),this.setProperties({groups:this.checkID(c.groups,"group",c.id)},!0),this.validateItemSize();var u=this.tabObj.items[parseInt(i.toString(),10)].content;if(l&&(r.header&&(this.tabObj.items[parseInt(i.toString(),10)].header.text.innerText=c.header),r.cssClass&&(this.tabObj.items[parseInt(i.toString(),10)].cssClass&&(u.classList.remove(this.tabObj.items[parseInt(i.toString(),10)].cssClass),p.querySelector(".e-active").classList.remove(this.tabObj.items[parseInt(i.toString(),10)].cssClass)),u.classList.add(c.cssClass),p.querySelector(".e-active").classList.add(c.cssClass)),r.groups)){for(var d=0,h=l;d<h.length;d++){for(var b=h[d],m=b.isCollapsed?u.querySelector("#"+b.id+eo+to):null,f=0,y=b.collections;f<y.length;f++)for(var g=0,v=y[f].items;g<v.length;g++){var S=v[g],I=m?this.ribbonDropDownModule.getDDBItemElement(m,S.id):u.querySelector("#"+S.id);I&&this.destroyFunction(S,I)}m&&this.ribbonDropDownModule.removeOverFlowDropDown(m)}u.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()});var C=this.createGroups(c.groups,i);t.append(C,u)}}var T=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt);this.checkOverflow(this.selectedTab,T)},s.prototype.switchLayout=function(){this.currentControlIndex=0,this.destroyScroll(),this.collapseButton.classList.toggle(Ze,"Simplified"===this.activeLayout),this.element.classList.toggle(jt,"Simplified"===this.activeLayout);for(var o=0;o<=this.tabs.length-1;o++){var i=o;if(""!==this.tabObj.items[parseInt(i.toString(),10)].content.innerHTML){var n=this.tabs[parseInt(i.toString(),10)],s=this.tabs[parseInt(i.toString(),10)].groups,a=this.tabObj.element.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+Qt),l=a.closest("."+ot);if("Simplified"===this.activeLayout)for(var p=0;p<s.length;p++){var c=s[parseInt(p.toString(),10)],u=s[parseInt(p.toString(),10)].orientation;c.isCollapsed?(c.setProperties({isCollapsed:!1},!0),this.removeDropdown(c.id)):(this.checkSmallToMedium(i,n,p,l,a,!0,!1),this.checkMediumToLarge(i,n,p,l,a,!0,!1));for(var d=l.querySelector("#"+c.id),h=(O=d.querySelector("#"+c.id+$t)).querySelectorAll(".e-ribbon-shrink"),b=0;b<h.length;b++)h[parseInt(b.toString(),10)].remove();(P=O.querySelector("#"+c.id+Zt)).remove();(B=O.querySelector("#"+c.id+Qt)).classList.replace(Tt,wt),B.classList.remove(Pt);for(var m=0;m<c.collections.length;m++){var f=c.collections[parseInt(m.toString(),10)];(R=O.querySelector("#"+f.id)).classList.replace(Tt,wt);for(var y=0;y<f.items.length;y++){for(var g=f.items,v=f.items[parseInt(y.toString(),10)],S=!0;S&&v.displayOptions===e.DisplayMode.Classic;){y++;var I=O.querySelector("#"+v.id+$t),C=I.querySelector("#"+v.id);this.destroyFunction(v,C),I.remove(),y<g.length?v=g[parseInt(y.toString(),10)]:S=!1}if(!S)break;var T=v.allowedSizes===e.RibbonItemSize.Large||v.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;T=!(v.displayOptions&e.DisplayMode.Simplified)&&v.displayOptions&e.DisplayMode.Overflow?e.RibbonItemSize.Medium:T;var w=void 0;if(v.displayOptions&e.DisplayMode.Classic){if(w=O.querySelector("#"+v.id+$t),v.displayOptions===(e.DisplayMode.Classic|e.DisplayMode.Overflow)&&(this.createOverflowPopup(v,i,c.enableGroupOverflow,c.id,c.header,w,O),v.type!==e.RibbonItemType.DropDown&&v.type!==e.RibbonItemType.SplitButton&&v.type!==e.RibbonItemType.GroupButton&&v.type!==e.RibbonItemType.Gallery||this.updatePopupItems(v,w,c.enableGroupOverflow,!0)),v.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(v,w),v.setProperties({activeSize:T},!0),w){C=w.querySelector("#"+v.id);this.setItemSize(C,v)}}else w=this.createItems([v],u,c.id,c.header,c.enableGroupOverflow,i,O)[0],v.displayOptions&e.DisplayMode.Simplified&&R.append(w);v.type===e.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,v.id)}}c.enableGroupOverflow||d.querySelector("."+Ct)||d.classList.add("e-ribbon-emptyCollection")}else{this.element.classList.remove(tt);for(var k=0;k<s.length;k++){c=s[parseInt(k.toString(),10)],u=s[parseInt(k.toString(),10)].orientation;var O,B=(O=l.querySelector("#"+c.id+$t)).querySelector("#"+c.id+Qt),P=this.createElement("div",{className:bt,id:c.id+Zt,innerHTML:c.header});O.appendChild(P),"Row"===u&&B.classList.replace(wt,Tt),B.classList.add(Pt);for(m=0;m<c.collections.length;m++){var L=void 0,E=void 0;if(c.enableGroupOverflow){var D=O.querySelector("#"+c.id+Yt);D&&(E=(L=t.getInstance(D,r.DropDownButton)).target)}else(L=this.overflowDDB)&&(E=this.overflowDDB.target);f=c.collections[parseInt(m.toString(),10)];var R=O.querySelector("#"+f.id);"Column"===u&&R.classList.replace(wt,Tt);for(y=0;y<f.items.length;y++){for(g=f.items,v=f.items[parseInt(y.toString(),10)],S=!0;S&&!(v.displayOptions&e.DisplayMode.Classic);){y++;w=void 0;if((v.displayOptions&e.DisplayMode.Simplified||v.displayOptions&e.DisplayMode.Overflow)&&null!==(w=v.displayOptions&e.DisplayMode.Simplified?O.querySelector("#"+v.id+$t):E.querySelector("#"+v.id+$t))){var x=w.querySelector("#"+v.id);this.destroyFunction(v,x),w.remove()}y<g.length?v=g[parseInt(y.toString(),10)]:S=!1}if(!S)break;if(v.displayOptions&(e.DisplayMode.Simplified|e.DisplayMode.Overflow)){!(w=O.querySelector("#"+v.id+$t))&&E&&(w=E.querySelector("#"+v.id+$t),v.type!==e.RibbonItemType.DropDown&&v.type!==e.RibbonItemType.SplitButton&&v.type!==e.RibbonItemType.GroupButton&&v.type!==e.RibbonItemType.Gallery||this.updatePopupItems(v,w,c.enableGroupOverflow,!1),this.removeOverflowEvent(v,w)),v.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(v,w),w&&R.append(w)}else{var w=this.createItems([v],u,c.id,c.header,c.enableGroupOverflow,i)[0];R.append(w)}C=O.querySelector("#"+v.id);v.type===e.RibbonItemType.GroupButton&&(C=O.querySelector("#"+v.id+ao));var M=v.allowedSizes&e.RibbonItemSize.Large?e.RibbonItemSize.Large:v.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;v.setProperties({activeSize:M},!0),this.setItemSize(C,v),v.type===e.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,v.id)}c.enableGroupOverflow&&L&&(0===E.childElementCount||1===E.childElementCount&&this.isHeaderVisible(E,c.id))&&this.removeOverflowButton(L)}}}this.selectedTab===i&&this.checkOverflow(i,a)}}"Classic"===this.activeLayout&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},s.prototype.createLauncherIcon=function(e,o,i){var r=this,n=this.createElement("div",{className:vt+" "+(this.launcherIconCss?this.launcherIconCss:St),id:e+Jt,attrs:{tabindex:"0",type:"button","aria-label":"Launcher Icon",role:"button"}});o.appendChild(n),o.classList.add(gt),t.EventHandler.add(n,"click",this.launcherIconClicked.bind(this,e),this),t.EventHandler.add(n,"keydown",function(t){"Enter"===t.key&&r.launcherIconClicked(e)},this);var s=d(this.tabs,e);s.group.launcherIconKeyTip&&this.addKeyTip(i,s.group.launcherIconKeyTip,n.id,"launcher")},s.prototype.launcherIconClicked=function(e){var t={groupId:e};this.trigger("launcherIconClick",t)},s.prototype.createGroups=function(e,o){for(var i=[],r=0;r<e.length;r++){var n=e[parseInt(r.toString(),10)],s=n.orientation,a=this.createElement("div",{className:n.cssClass,id:n.id});a.classList.add(rt),i.push(a);var l=this.createElement("div",{className:n.cssClass,id:n.id+$t});l.classList.add(ct),a.appendChild(l);var p=this.createElement("div",{className:"Simplified"===this.activeLayout?ht:ht+" "+Pt,id:n.id+Qt});if(p.classList.add("Column"===s||"Simplified"===this.activeLayout?wt:Tt),l.appendChild(p),"Classic"===this.activeLayout){var c=this.createElement("div",{className:bt,id:n.id+Zt,innerHTML:n.header});l.appendChild(c)}n.showLauncherIcon&&this.createLauncherIcon(n.id,l,o);var u=this.createCollection(n.collections,n.orientation,n.id,n.header,n.enableGroupOverflow,o,l);t.append(u,p);for(var d=!0,h=0;h<u.length;h++)if(d)for(var b=0;b<u[parseInt(h.toString(),10)].children.length;b++)if(!u[parseInt(h.toString(),10)].children[parseInt(b.toString(),10)].classList.contains("e-hidden")){d=!1;break}d&&a.classList.add("e-hide-group"),"Simplified"!==this.activeLayout||n.enableGroupOverflow||a.querySelector("."+Ct)||a.classList.add("e-ribbon-emptyCollection");var m=this.initialPropsData[parseInt(o.toString(),10)];m&&(m.hiddenGroups&&m.hiddenGroups.length&&this.updateGroupProps("hiddenGroups",m,a),m.disabledGroups&&m.disabledGroups.length&&this.updateGroupProps("disabledGroups",m,a))}return this.initialPropsData[parseInt(o.toString(),10)]&&delete this.initialPropsData[parseInt(o.toString(),10)],i},s.prototype.updateGroupProps=function(e,t,o){-1!==t[e].indexOf(o.id)&&("hiddenGroups"===e?o.classList.add("e-hidden"):o.classList.add("e-disabled"))},s.prototype.validateItemSize=function(){for(var t=0;t<this.tabs.length;t++)for(var o=this.tabs[parseInt(t.toString(),10)].groups,i=0;i<o.length;i++)for(var r=o[parseInt(i.toString(),10)].collections,n=o[parseInt(i.toString(),10)].orientation,s=0;s<r.length;s++)for(var a=r[parseInt(s.toString(),10)].items,l=0;l<a.length;l++){var p=a[parseInt(l.toString(),10)];if(p.allowedSizes&&0!==p.allowedSizes||p.setProperties({allowedSizes:e.RibbonItemSize.Small|e.RibbonItemSize.Medium|e.RibbonItemSize.Large},!0),"ColorPicker"===p.type&&p.allowedSizes!==e.RibbonItemSize.Small)p.setProperties({allowedSizes:e.RibbonItemSize.Small},!0);else if("ComboBox"!==p.type&&"CheckBox"!==p.type||p.allowedSizes===e.RibbonItemSize.Medium){if(("Column"===n&&a.length>1||"Row"===n&&r.length>1)&&p.allowedSizes&e.RibbonItemSize.Large){var c=p.allowedSizes&(e.RibbonItemSize.Small|e.RibbonItemSize.Medium);c=c||e.RibbonItemSize.Medium,p.setProperties({allowedSizes:c},!0)}}else p.setProperties({allowedSizes:e.RibbonItemSize.Medium},!0);var u=p.allowedSizes&e.RibbonItemSize.Large?e.RibbonItemSize.Large:p.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;p.setProperties({activeSize:u},!0)}},s.prototype.createCollection=function(e,o,i,r,n,s,a){for(var l=[],p=0;p<e.length;p++){var c=e[parseInt(p.toString(),10)],u=this.createElement("div",{className:c.cssClass,id:c.id});u.classList.add(It),u.classList.add("Column"!==o||"Simplified"===this.activeLayout?wt:Tt),l.push(u);var d=this.createItems(c.items,o,i,r,n,s,a);if(t.append(d,u),"Row"===o&&2===p)break}return l},s.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)}},s.prototype.createItems=function(t,o,i,r,n,s,a){for(var l,p=[],c=0;c<t.length;c++){for(var u=t[parseInt(c.toString(),10)],d=!0;d&&("Simplified"===this.activeLayout&&!(u.displayOptions&(e.DisplayMode.Simplified|e.DisplayMode.Overflow))||"Classic"===this.activeLayout&&!(u.displayOptions&e.DisplayMode.Classic));)++c<t.length?u=t[parseInt(c.toString(),10)]:d=!1;if(!d)break;var h=this.createElement("div",{className:u.cssClass,id:u.id+$t});if((l=h.classList).add.apply(l,[Ct].concat(u.disabled?[Ae]:[])),u.ribbonTooltipSettings&&y(u.ribbonTooltipSettings)&&(h.classList.add(Rt),this.tooltipData.push({id:h.id,data:u.ribbonTooltipSettings})),u.type===e.RibbonItemType.GroupButton)for(var b=0;b<u.groupButtonSettings.items.length;b++)this.keyTipElements[parseInt(s.toString(),10)]&&u.groupButtonSettings.items[parseInt(b.toString(),10)].keyTip&&this.addKeyTip(s,u.groupButtonSettings.items[parseInt(b.toString(),10)].keyTip,u.id+(ao+b),"item");u.keyTip&&(u.type===e.RibbonItemType.Gallery?this.addKeyTip(s,u.keyTip,u.id+"_popupButton","item"):this.addKeyTip(s,u.keyTip,u.id,"item"));var m=u.activeSize;u.type!==e.RibbonItemType.Gallery&&("Simplified"===this.activeLayout&&(m=u.allowedSizes===e.RibbonItemSize.Large||u.allowedSizes&e.RibbonItemSize.Medium||u.displayOptions===e.DisplayMode.Overflow?e.RibbonItemSize.Medium:e.RibbonItemSize.Small,u.setProperties({activeSize:m},!0)),m&e.RibbonItemSize.Large?h.classList.add(kt,Pt):h.classList.add(m&e.RibbonItemSize.Medium?Ot:Bt));var f=this.initialPropsData[parseInt(s.toString(),10)];if(f&&f.hiddenItems&&f.hiddenItems.length){-1!==f.hiddenItems.indexOf(u.id)&&h.classList.add("e-hidden")}if(this.createRibbonItem(u,h),"Simplified"!==this.activeLayout||u.displayOptions!==e.DisplayMode.Overflow&&u.displayOptions!==(e.DisplayMode.Classic|e.DisplayMode.Overflow)?p.push(h):(this.createOverflowPopup(u,s,n,i,r,h,a),u.type!==e.RibbonItemType.DropDown&&u.type!==e.RibbonItemType.SplitButton&&u.type!==e.RibbonItemType.GroupButton&&u.type!==e.RibbonItemType.Gallery||this.updatePopupItems(u,h,n,!0)),"Column"===o&&2===c)break}return p},s.prototype.createHelpPaneTemplate=function(){if(this.helpPaneTemplate){var e="helpPaneTemplate";this.clearTemplate([e]),this.ribbonTempEle=this.createElement("div",{className:Et,id:this.element.id+so});var o=p(this.helpPaneTemplate);t.append(o({},this,e,"helpPaneTemplate",this.isStringTemplate),this.ribbonTempEle);var i=this.tabObj.element;i.querySelector(".e-toolbar").after(this.ribbonTempEle),i.style.setProperty(co,this.ribbonTempEle.offsetWidth+"px"),this.renderReactTemplates()}},s.prototype.createTemplateContent=function(e,t){var o=this.createElement("div",{className:e.cssClass?Lt+" "+e.cssClass:Lt,id:e.id,attrs:{tabindex:"-1"}});e.disabled&&(o.classList.add(Ae),o.setAttribute("disabled","")),t.appendChild(o),this.renderItemTemplate(e,o)},s.prototype.renderItemTemplate=function(o,i){var r="ribbon"+o.id+"itemTemplate";this.clearTemplate([r]);var n=p(o.itemTemplate);t.append(n({activeSize:e.RibbonItemSize[o.activeSize]},this,r,o.id+"itemTemplate",this.isStringTemplate),i),this.renderReactTemplates()},s.prototype.checkID=function(e,t,o){for(var i="tab"===t?"_tab":"group"===t?"_group":"collection"===t?"_collection":"_item",r=0;r<e.length;r++){var n=e[parseInt(r.toString(),10)];if(!n.id){var s=void 0;"item"===t&&(s=this.hasHtmlAtrrID(n)),n.setProperties({id:s||o+i+this.idIndex++},!0)}switch(t){case"tab":n.setProperties({groups:this.checkID(n.groups,"group",n.id)},!0);break;case"group":n.setProperties({collections:this.checkID(n.collections,"collection",n.id)},!0);break;case"collection":n.setProperties({items:this.checkID(n.items,"item",n.id)},!0)}}return e},s.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},s.prototype.updateCommonProperty=function(o){this.tabObj.setProperties(o),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.setCommonProperties(o),this.ribbonBackstageModule&&this.ribbonBackstageModule.setCommonProperties(o);for(var i=0;i<this.tabs.length;i++){var n=this.tabs[parseInt(i.toString(),10)],s=this.tabObj.items[parseInt(i.toString(),10)].content;if(s.querySelector("."+rt))for(var a=0,l=n.groups;a<l.length;a++){var p=l[a],c=void 0,u=void 0;this.activeLayout===e.RibbonLayout.Classic?c=p.isCollapsed?s.querySelector("#"+p.id+eo+to):null:(u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+Yt):null)?t.getComponent(c,r.DropDownButton):this.overflowDDB)&&(I(u.target,o),u.setProperties(o));for(var d=0,h=p.collections;d<h.length;d++)for(var m=0,f=h[d].items;m<f.length;m++){var y=f[m],g=null;if(this.activeLayout===e.RibbonLayout.Classic?y.displayOptions&e.DisplayMode.Classic&&(g=c?this.ribbonDropDownModule.getDDBItemElement(c,y.id):y.type===e.RibbonItemType.GroupButton?s.querySelector("#"+y.id+ao):s.querySelector("#"+y.id)):(g=y.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+y.id):null)||(g=u.target.querySelector("#"+y.id),"DropDown"===y.type&&this.updatePopupItems(y,u.target,p.enableGroupOverflow,!0)),g){var v=this.getItemModuleName(y);if("template"!==v)if("group-btn"===v&&"Classic"===this.activeLayout)for(var S=0;S<y.groupButtonSettings.items.length;S++){b(g.querySelector("#"+y.id+ao+S),"btn",o)}else if("group-btn"===v&&"Simplified"===this.activeLayout){b(g,"dropdown-btn",o);for(var C=0;C<y.groupButtonSettings.items.length;C++){b(document.querySelector("#"+y.id+ao+C),"btn",o)}}else b(g,v,o);else t.isNullOrUndefined(o.enableRtl)||g.classList.toggle(je,o.enableRtl)}}}}},s.prototype.removeLauncherIcon=function(e,o,i){var r=e+$t,n=o?this.ribbonDropDownModule.getDDBItemElement(o,r):i.querySelector("#"+r);if(n){n.classList.remove(gt);var s=n.querySelector("#"+e+Jt);t.remove(s)}},s.prototype.destroyTabItems=function(o){for(var i=0;i<o.length;i++)for(var n=o[parseInt(i.toString(),10)],s=this.tabObj.items[parseInt(i.toString(),10)].content,a=0,l=n.groups;a<l.length;a++){var p=l[a],c=void 0,u=void 0;this.activeLayout===e.RibbonLayout.Classic?(c=p.isCollapsed?s.querySelector("#"+p.id+eo+to):null,p.showLauncherIcon&&this.removeLauncherIcon(p.id,c,s)):u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+Yt):null)?t.getComponent(c,r.DropDownButton):this.overflowDDB;for(var d=0,h=p.collections;d<h.length;d++)for(var b=0,m=h[d].items;b<m.length;b++){var f=m[b],y=void 0;this.activeLayout===e.RibbonLayout.Classic?f.displayOptions&e.DisplayMode.Classic&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,f.id):s.querySelector("#"+f.id),f.type===e.RibbonItemType.GroupButton&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,f.id+ao):s.querySelector("#"+f.id+ao)),f.type===e.RibbonItemType.Gallery&&(y=s.querySelector("#"+f.id+$t))):(y=f.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+f.id):null,f.type===e.RibbonItemType.Gallery&&(y=f.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+f.id+$t):null),y||(y=u?u.target.querySelector("#"+f.id):null)),y&&this.destroyFunction(f,y)}this.activeLayout===e.RibbonLayout.Classic&&c?this.ribbonDropDownModule.removeOverFlowDropDown(c):this.activeLayout===e.RibbonLayout.Simplified&&p.enableGroupOverflow&&c&&this.removeOverflowButton(u)}this.overflowDDB&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},s.prototype.destroyFunction=function(e,t){var o=this.getItemModuleName(e);if("colorpicker"===o)this.ribbonColorPickerModule.unwireColorPickerEvents(t);else if("group-btn"===o){if("Classic"===this.activeLayout)for(var i=0;i<e.groupButtonSettings.items.length;i++){var r=t.querySelector("#"+e.id+ao+i);r&&h(r,"btn")}else this.ribbonGroupButtonModule.destroyDropDown(e);var n=function(t){if(e.groupButtonSettings.items[parseInt(t.toString(),10)].ribbonTooltipSettings){var o=e.id+ao+t,i=l(s.tooltipData,function(e){return e.id===o});-1!==i&&s.tooltipData.splice(i,1)}},s=this;for(i=0;i<e.groupButtonSettings.items.length;i++)n(i)}else if("gallery"===o)if(t.closest(".e-ribbon-overflow-target")){h(t,"dropdown-btn");(c=Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"_galleryPopup"))).concat(Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"-popup")));for(i=0;i<c.length;i++)c[parseInt(i.toString(),10)].remove()}else{var a=t.querySelectorAll(".e-ribbon-gallery-item"),p=t.querySelector("#"+e.id+"_popupButton");p&&p.remove();for(i=0;i<a.length;i++)a[parseInt(i.toString(),10)].remove();var c=document.querySelectorAll("#"+e.id+"_galleryPopup");for(i=0;i<c.length;i++)c[parseInt(i.toString(),10)].remove()}else"template"!==o&&h(t,o);if(e.ribbonTooltipSettings){var u=l(this.tooltipData,function(t){return t.id===e.id+$t});-1!==u&&this.tooltipData.splice(u,1)}"GroupButton"===e.type&&this.ribbonGroupButtonModule.destroyDropDown(e)},s.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"}},s.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+Qt),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)},s.prototype.refreshLayout=function(){this.resizeHandler()},s.prototype.selectTab=function(e){var t=l(this.tabs,function(t){return t.id===e});this.setProperties({selectedTab:t})},s.prototype.showTab=function(e,t){void 0===t&&(t=!1),this.showHideTab(e,!1,t)},s.prototype.hideTab=function(e,t){void 0===t&&(t=!1),this.showHideTab(e,!0,t)},s.prototype.showHideTab=function(e,t,o){var i=l(this.tabs,function(t){return t.id===e});if(-1!==i&&(this.tabObj.hideTab(i,t),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++)e===this.contextualTabs[parseInt(s.toString(),10)].tabs[parseInt(a.toString(),10)].id&&(r=this.contextualTabs[parseInt(s.toString(),10)]);if(r){var p=!0,c=function(e){var t=l(u.tabs,function(t){return t.id===r.tabs[parseInt(e.toString(),10)].id});if(-1!==t){n.querySelectorAll(".e-toolbar-item")[parseInt(t.toString(),10)].classList.contains("e-hidden")||(p=!1)}},u=this;for(s=0;s<r.tabs.length;s++)c(s);p?r.setProperties({visible:!1},!0):r.setProperties({visible:!0},!0)}}},s.prototype.enableTab=function(e){this.enableDisableTab(e,!0)},s.prototype.disableTab=function(e){this.enableDisableTab(e,!1)},s.prototype.enableDisableTab=function(e,t){var o=l(this.tabs,function(t){return t.id===e});-1!==o&&this.tabObj.enableTab(o,t)},s.prototype.addTab=function(e,t,o){var i=t?l(this.tabs,function(e){return e.id===t}):-1;i=-1===i?this.tabs.length:i+(o?1:0),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();var r=this.createTabItems([e]);this.tabObj.addTab(r,i)},s.prototype.removeTab=function(t){var o=l(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;if(r&&""!==i.innerHTML)for(var n=0,s=r;n<s.length;n++){for(var a=s[n],p=a.isCollapsed?i.querySelector("#"+a.id+eo+to):null,c=0,u=a.collections;c<u.length;c++)for(var d=0,h=u[c].items;d<h.length;d++){var b=h[d],m=p?this.ribbonDropDownModule.getDDBItemElement(p,b.id):i.querySelector("#"+b.id);b.type===e.RibbonItemType.GroupButton&&"Classic"===this.activeLayout&&(m=p?this.ribbonDropDownModule.getDDBItemElement(p,b.id+ao):i.querySelector("#"+b.id+ao)),m&&this.destroyFunction(b,m)}p&&this.ribbonDropDownModule.removeOverFlowDropDown(p)}o===this.selectedTab&&(this.isAddRemove=!0),this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(o,1),this.setProperties({tabs:this.tabsInternal},!0),this.tabObj.removeTab(o)}},s.prototype.addGroup=function(e,t,o,i){var r=l(this.tabs,function(t){return t.id===e});if(-1!==r){this.selectedTab===r&&this.clearOverflowResize();var n=this.tabs[parseInt(r.toString(),10)],s=n.groups.slice(),a=o?l(s,function(e){return e.id===o}):-1;a=-1===a?s.length:a+(i?1:0),s.splice(a,0,t),n.setProperties({groups:s},!0),this.checkID([n.groups[parseInt(a.toString(),10)]],"group",e),this.validateItemSize();var p=this.tabObj.items[parseInt(r.toString(),10)].content;if(""!==p.innerHTML){var c=this.createGroups([n.groups[parseInt(a.toString(),10)]],r)[0],u=o?p.querySelector("#"+o):null;u?u.insertAdjacentElement(i?"afterend":"beforebegin",c):p.append(c)}this.selectedTab===r&&this.refreshLayout()}},s.prototype.removeGroup=function(o){var i=d(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n=this.tabObj.items[i.tabIndex].content;if(""!==n.innerHTML){var s=void 0,a=void 0;i.group.showLauncherIcon&&this.removeLauncherIcon(i.group.id,null,n),this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=i.group.enableGroupOverflow?n.querySelector("#"+i.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB);for(var l=0,p=i.group.collections;l<p.length;l++)for(var c=0,u=p[l].items;c<u.length;c++){var h=u[c];this.removeItemElement(n,h,a)}if(this.activeLayout===e.RibbonLayout.Simplified)if(i.group.enableGroupOverflow)(0===a.target.childElementCount||1===a.target.childElementCount&&this.isHeaderVisible(a.target,i.group.id))&&this.removeOverflowButton(a);else{var b=a.target.querySelector("#"+i.group.id+$t);b&&1===b.childElementCount&&b.remove();var m=a.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+eo);m&&0===m.childElementCount&&m.remove()}var f=n.querySelector("#"+o);f&&f.remove()}var y=this.tabs[i.tabIndex].groups.slice();y.splice(i.groupIndex,1),this.tabs[i.tabIndex].setProperties({groups:y},!0),this.selectedTab===i.tabIndex&&this.refreshLayout()}},s.prototype.isHeaderVisible=function(e,t){return!!e.querySelector("#"+t+Yt+Zt)},s.prototype.hideGroup=function(e){this.showHideGroup(e,!0)},s.prototype.showGroup=function(e){this.showHideGroup(e,!1)},s.prototype.showHideGroup=function(e,o){var i,n=d(this.tabs,e);if(n){var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+e);if(a?this.updateHiddenElements(n.tabIndex,o?"hideGroup":"showGroup",e,o,a):this.updateInitialProps(n.tabIndex,e,"hiddenGroups",o),this.overflowDDB){var l=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+eo);if(n.group.enableGroupOverflow){var p=s.querySelector("#"+e+Yt);p&&(i=t.getInstance(p,r.DropDownButton).target),i&&(o?i.classList.add("e-hidden"):i.classList.remove("e-hidden"))}else if(l){var c=l.querySelector("#"+e+$t);c&&(o?c.classList.add("e-hidden"):c.classList.remove("e-hidden"))}}this.selectedTab===n.tabIndex&&this.refreshLayout()}},s.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))},s.prototype.checkHiddenElements=function(e,t,o){if("Simplified"===this.activeLayout){var i=this.hiddenElements[parseInt(o.toString(),10)];if(i||(this.hiddenElements[parseInt(o.toString(),10)]={},i=this.hiddenElements[parseInt(o.toString(),10)]),i)if(i[e]||(i[e]=[]),i[e].length){-1===i[e].indexOf(t)&&i[e].push(t)}else i[e].push(t)}},s.prototype.updateItemsSimplifiedWidth=function(e,t){var o=this.hiddenElements[parseInt(e.toString(),10)];if(o&&o[t]&&o[t].length)for(var i,r=function(r){var s,a=n.tabObj.items[e].content,l=void 0,p=!1,c=0;if(s="hideGroup"===t||"showGroup"===t?a.querySelector("#"+o[t][r]):a.querySelector("#"+o[t][r]+$t)){if("hideGroup"===t||"hideItem"===t){var u=!1;s.classList.contains("e-hidden")&&(u=!0,s.classList.remove("e-hidden")),"hideItem"===t&&(l=s.closest(".e-ribbon-group")).classList.contains("e-hide-group")&&(p=!0,c=n.checkWidthDifference(s,l)),n.calculateOverflowItemsWidth(s.offsetWidth+c,!0,e),n.calculateMediumDataWidth(s.offsetWidth+c,e,!0),u&&s.classList.add("e-hidden")}else{if("showItem"===t)if((l=s.closest(".e-ribbon-group")).classList.contains("e-hide-group"))p=!0,l.classList.remove("e-hide-group"),l.classList.remove("e-ribbon-emptyCollection"),c=Math.abs(s.offsetWidth-l.offsetWidth),-1!==n.hiddenGroups.indexOf(l.id)&&n.hiddenGroups.splice(n.hiddenGroups.indexOf(l.id),1);else if(-1!==n.hiddenGroups.indexOf(l.id)){var d=l.querySelectorAll(".e-ribbon-item:not(.e-hidden)");d.forEach(function(e){e.id!==s.id&&e.classList.add("e-hidden")}),c=Math.abs(s.offsetWidth-l.offsetWidth),d.forEach(function(e){e.id!==s.id&&e.classList.remove("e-hidden")}),n.hiddenGroups.splice(n.hiddenGroups.indexOf(l.id),1)}n.calculateOverflowItemsWidth(s.offsetWidth+c,!1,e),n.calculateMediumDataWidth(s.offsetWidth+c,e,!1)}p&&(l.classList.add("e-hide-group"),l.classList.add("e-ribbon-emptyCollection"))}var h=o[t].indexOf(o[t][r]);-1!==h&&(o[t].splice(h,1),r--),i=r},n=this,s=0;s<o[t].length;s++)r(s),s=i},s.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)):(this.hiddenGroups.push(t.id),o=Math.abs(e.offsetWidth-t.offsetWidth)),o},s.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)])}},s.prototype.calculateMediumDataWidth=function(e,o,i){if(this.selectedTab===o&&"Simplified"===this.activeLayout){var n=this.tabObj.element.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+Qt),s=Array.prototype.slice.call(n.querySelectorAll(".e-ribbon-item"));if(this.overflowDDB)for(var a=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),l=document.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+eo),p=0;p<a.length;p++){var c=a[parseInt(p.toString(),10)].closest("#"+this.tabs[parseInt(o.toString(),10)].id+eo);l&&c&&l.id===c.id&&a[parseInt(p.toString(),10)].hasAttribute("data-medium-width")&&s.push(a[parseInt(p.toString(),10)])}var u=n.querySelectorAll(".e-ribbon-group-of-btn");for(p=0;p<u.length;p++){a=t.getInstance(u[parseInt(p.toString(),10)],r.DropDownButton).target.querySelectorAll(".e-ribbon-item");for(var d=0;d<a.length;d++)a[parseInt(d.toString(),10)].hasAttribute("data-medium-width")&&s.push(a[parseInt(d.toString(),10)])}for(p=0;p<s.length;p++)if(s[parseInt(p.toString(),10)].hasAttribute("data-medium-width")){var h=parseInt(s[parseInt(p.toString(),10)].getAttribute("data-medium-width"),10);s[parseInt(p.toString(),10)].setAttribute("data-medium-width",i?(h-e).toString():(h+e).toString())}}},s.prototype.calculateOverflowItemsWidth=function(e,o,i){if(this.selectedTab===i&&"Simplified"===this.activeLayout)for(var n=this.tabs[parseInt(i.toString(),10)].groups,s=0;s<n.length;s++){var a=n[parseInt(s.toString(),10)];if(a.enableGroupOverflow){var l=void 0,p=document.querySelector("#"+a.id).querySelector("#"+a.id+Yt);if(p&&(l=t.getInstance(p,r.DropDownButton)),l)for(var c=l.target.querySelectorAll(".e-ribbon-item"),u=0;u<c.length;u++){(b=parseInt(c[parseInt(u.toString(),10)].getAttribute("data-simplified-width"),10))&&c[parseInt(u.toString(),10)].setAttribute("data-simplified-width",o?(b-e).toString():(b+e).toString())}}}if(this.overflowDDB){var d=document.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+eo);for(c=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),s=0;s<c.length;s++){var h=c[parseInt(s.toString(),10)].closest("#"+this.tabs[parseInt(i.toString(),10)].id+eo);if(d&&h&&d.id===h.id){var b;(b=parseInt(c[parseInt(s.toString(),10)].getAttribute("data-simplified-width"),10))&&c[parseInt(s.toString(),10)].setAttribute("data-simplified-width",o?(b-e).toString():(b+e).toString())}}}},s.prototype.disableGroup=function(e){this.enableDisableGroup(e,!0)},s.prototype.enableGroup=function(e){this.enableDisableGroup(e,!1)},s.prototype.enableDisableGroup=function(e,o){var i,n=d(this.tabs,e);if(n){var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+e);if(a?o?a.classList.add("e-disabled"):a.classList.remove("e-disabled"):this.updateInitialProps(n.tabIndex,e,"disabledGroups",o),this.overflowDDB){var l=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+eo);if(n.group.enableGroupOverflow){var p=s.querySelector("#"+e+Yt);p&&(i=t.getInstance(p,r.DropDownButton).target),i&&(o?i.classList.add("e-disabled"):i.classList.remove("e-disabled"))}else if(l){var c=l.querySelector("#"+e+$t);c&&(o?c.classList.add("e-disabled"):c.classList.remove("e-disabled"))}}}},s.prototype.addCollection=function(e,t,o,i){var r=d(this.tabs,e);if(r&&("Row"!==r.group.orientation||3!==r.group.collections.length)){this.selectedTab===r.tabIndex&&this.clearOverflowResize();var n=r.group.collections.slice(),s=o?l(n,function(e){return e.id===o}):-1;s=-1===s?n.length:s+(i?1:0),n.splice(s,0,t),r.group.setProperties({collections:n},!0),this.checkID([r.group.collections[parseInt(s.toString(),10)]],"collection",e),this.validateItemSize();var a=this.tabObj.items[r.tabIndex].content;if(""!==a.innerHTML){var p=r.group.collections[parseInt(s.toString(),10)],c=this.createCollection([p],r.group.orientation,r.group.id,r.group.header,r.group.enableGroupOverflow,r.tabIndex)[0];r.group.isCollapsed&&(a=this.ribbonDropDownModule.getOverflowDropDownPopup(r,a));var u=o?a.querySelector("#"+o):null;u?u.insertAdjacentElement(i?"afterend":"beforebegin",c):a.querySelector("#"+e+Qt).append(c)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},s.prototype.removeCollection=function(o){var i=u(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n=this.tabObj.items[i.tabIndex].content;if(""!==n.innerHTML){var s=void 0,a=void 0;this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=i.group.enableGroupOverflow?n.querySelector("#"+i.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB);for(var l=0,p=i.collection.items;l<p.length;l++){var c=p[l];this.removeItemElement(n,c,a)}var d=n.querySelector("#"+o);d&&d.remove()}var h=i.group,b=h.collections.slice();b.splice(i.collectionIndex,1),h.setProperties({collections:b},!0),this.selectedTab===i.tabIndex&&this.refreshLayout()}},s.prototype.addItem=function(e,t,o,i){var r=u(this.tabs,e);if(r&&("Column"!==r.group.orientation||3!==r.collection.items.length)){this.selectedTab===r.tabIndex&&this.clearOverflowResize();var n=r.collection.items.slice(),s=o?l(n,function(e){return e.id===o}):-1;s=-1===s?n.length:s+(i?1:0),n.splice(s,0,t),r.collection.setProperties({items:n},!0),this.checkID([r.collection.items[parseInt(s.toString(),10)]],"item",e),this.validateItemSize();var a=this.tabObj.items[r.tabIndex].content,p=a.querySelector("#"+r.group.id+$t);if(""!==a.innerHTML){var c=r.collection.items[parseInt(s.toString(),10)],d=this.createItems([c],r.group.orientation,r.group.id,r.group.header,r.group.enableGroupOverflow,r.tabIndex,p)[0];r.group.isCollapsed&&(a=this.ribbonDropDownModule.getOverflowDropDownPopup(r,a));var h=o?a.querySelector("#"+o):null;h?h.closest("."+Ct).insertAdjacentElement(i?"afterend":"beforebegin",d):d&&a.querySelector("#"+e).append(d)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},s.prototype.removeItem=function(o){var i=c(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n=this.tabObj.items[i.tabIndex].content;if(""!==n.innerHTML){var s=void 0,a=void 0;this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=i.group.enableGroupOverflow?n.querySelector("#"+i.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB);var l=i.item;this.removeItemElement(n,l,a)}var p=i.collection,u=p.items;u.splice(i.itemIndex,1),p.setProperties({items:u},!0),this.selectedTab===i.tabIndex&&this.refreshLayout()}},s.prototype.hideItem=function(e){this.showHideItem(e,!0)},s.prototype.showItem=function(e){this.showHideItem(e,!1)},s.prototype.showHideItem=function(e,o){var i=c(this.tabs,e);if(i){var r;if(r="GroupButton"===i.item.type?f(this,e+ao,i):f(this,e,i)){var n=t.closest(r,".e-ribbon-item");this.updateHiddenElements(i.tabIndex,o?"hideItem":"showItem",e,o,n,i.group),this.selectedTab===i.tabIndex&&this.refreshLayout()}else this.updateInitialProps(i.tabIndex,e,"hiddenItems",o)}},s.prototype.updateInitialProps=function(e,t,o,i){var r=this.initialPropsData[parseInt(e.toString(),10)];if(r||(this.initialPropsData[parseInt(e.toString(),10)]={},r=this.initialPropsData[parseInt(e.toString(),10)]),r){r[o]||(r[o]=[]);var n=r[o].indexOf(t);i?-1===n&&r[o].push(t):(-1!==n&&r[o].splice(n,1),0===r[o].length&&delete r[o],0===Object.keys(r).length&&delete this.initialPropsData[parseInt(e.toString(),10)])}},s.prototype.checkHiddenItems=function(e,t,o){var i,r=!0,n=this.tabObj.items[parseInt(o.toString(),10)].content,s=n.querySelector("#"+e.id);if(t){for(var a=0;a<e.collections.length;a++)if(r)for(var l=e.collections[parseInt(a.toString(),10)],p=0;p<l.items.length;p++){var u=l.items[parseInt(p.toString(),10)],d=void 0;if("GroupButton"===u.type){var h=c(this.tabs,u.id);d=f(this,u.id+ao,h)}else d=f(this,u.id);if(!(d?d.closest(".e-ribbon-item"):null).classList.contains("e-hidden")){r=!1;break}}r&&(s.classList.add("e-hide-group"),this.checkOverflowItems(t,n,e.enableGroupOverflow,o,e.id))}else s.classList.remove("e-hide-group"),this.checkOverflowItems(t,n,e.enableGroupOverflow,o,e.id);if("Simplified"===this.activeLayout&&!e.enableGroupOverflow){var b=s.querySelectorAll("."+Ct);b&&(i=this.checkEmptyCollection(b),s.classList[i?"add":"remove"]("e-ribbon-emptyCollection"))}},s.prototype.checkOverflowItems=function(e,o,i,n,s){var a;if(i){var l=o.querySelector("#"+s+Yt);l&&(a=t.getInstance(l,r.DropDownButton).target),a&&(e?a.classList.add("e-hide-group"):a.classList.remove("e-hide-group"))}else if(this.overflowDDB){var p=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.toString(),10)].id+eo);if(p){var c=p.querySelector("#"+s+$t);c&&(e?c.classList.add("e-hide-group"):c.classList.remove("e-hide-group"))}}},s.prototype.updateTab=function(o){var i=o.id,r=l(this.tabs,function(e){return e.id===i});if(-1!==r){var n=this.tabObj.items[parseInt(r.toString(),10)].content,s=this.tabs[parseInt(r.toString(),10)].groups,a=this.tabObj.element;if(s&&""!==n.innerHTML&&(o.cssClass&&this.tabs[parseInt(r.toString(),10)].cssClass&&(n.classList.remove(this.tabs[parseInt(r.toString(),10)].cssClass),a.querySelector(".e-active").classList.remove(this.tabs[parseInt(r.toString(),10)].cssClass)),o.groups)){for(var p=0,c=s;p<c.length;p++){for(var u=c[p],d=u.isCollapsed?n.querySelector("#"+u.id+eo+to):null,h=0,b=u.collections;h<b.length;h++)for(var m=0,f=b[h].items;m<f.length;m++){var y=f[m],g=d?this.ribbonDropDownModule.getDDBItemElement(d,y.id):n.querySelector("#"+y.id);y.type===e.RibbonItemType.GroupButton&&"Classic"===this.activeLayout&&(g=d?this.ribbonDropDownModule.getDDBItemElement(d,y.id+ao):n.querySelector("#"+y.id+ao)),g&&this.destroyFunction(y,g)}d&&this.ribbonDropDownModule.removeOverFlowDropDown(d)}n.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()})}r===this.selectedTab&&(this.isAddRemove=!0);var v=this.tabs[parseInt(r.toString(),10)];if(v.setProperties(o,!0),this.setProperties({groups:this.checkID(v.groups,"group",v.id)},!0),this.validateItemSize(),""===n.innerHTML){if(o.groups){var S=this.createGroups(v.groups,r);t.append(S,n)}this.selectedTab===r&&this.refreshLayout(),o.cssClass&&(n.classList.add(v.cssClass),a.querySelector(".e-active").classList.add(v.cssClass)),o.header&&(a.querySelector("#"+i+Zt).innerText=v.header)}}},s.prototype.updateGroup=function(o){var i=o.id,n=d(this.tabs,i);if(n){this.selectedTab===n.tabIndex&&this.clearOverflowResize();var s,a,l=this.tabObj.items[n.tabIndex].content,p=l.querySelector("#"+i),c=p.querySelector("#"+o.id+$t);if(""!==l.innerHTML){if(n.group.showLauncherIcon&&this.removeLauncherIcon(n.group.id,null,l),this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=n.group.enableGroupOverflow?l.querySelector("#"+n.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB),o.cssClass&&n.group.cssClass&&(p.classList.remove(n.group.cssClass),c&&c.classList.remove(n.group.cssClass)),(o.collections||o.orientation)&&(n.group.collections||n.group.orientation)){for(var u=0,h=n.group.collections;u<h.length;u++)for(var b=0,m=h[u].items;b<m.length;b++){var f=m[b];this.removeItemElement(l,f,a)}if(p.querySelectorAll(".e-ribbon-collection").forEach(function(e){e.remove()}),o.orientation){var y=(I=c.querySelector(".e-ribbon-group-content")).classList.value.match(/(e-ribbon-[column|row]+)/g);y&&t.removeClass([I],y)}}if(this.activeLayout===e.RibbonLayout.Simplified)if(n.group.enableGroupOverflow)(0===a.target.childElementCount||1===a.target.childElementCount&&this.isHeaderVisible(a.target,n.group.id))&&this.removeOverflowButton(a);else{var g=a.target.querySelector("#"+n.group.id+$t);g&&1===g.childElementCount&&g.remove();var v=a.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+eo);v&&0===v.childElementCount&&v.remove()}}var S=n.group;if(S.setProperties(o,!0),S.setProperties({collections:this.checkID(S.collections,"collection",S.id)},!0),this.validateItemSize(),""!==l.innerHTML){if(o.showLauncherIcon&&this.createLauncherIcon(S.id,c,n.tabIndex),o.collections||o.orientation){var I;(I=c.querySelector(".e-ribbon-group-content")).classList.add("Column"===S.orientation||"Simplified"===this.activeLayout?wt:Tt);var C=this.createCollection(S.collections,S.orientation,S.id,S.header,S.enableGroupOverflow,n.tabIndex,c);t.append(C,I)}if(this.selectedTab===n.tabIndex&&this.refreshLayout(),o.cssClass&&(p.classList.add(S.cssClass),c&&c.classList.add(S.cssClass)),o.header)if(this.activeLayout!==e.RibbonLayout.Simplified||o.enableGroupOverflow)if(this.activeLayout!==e.RibbonLayout.Classic||S.isCollapsed){if(this.activeLayout===e.RibbonLayout.Classic&&S.isCollapsed){var T=p.querySelector("#"+S.id+eo+to);(w=t.getInstance(T,r.DropDownButton).target.querySelector("#"+o.id+Zt))&&(w.innerText=S.header)}}else p.querySelector(".e-ribbon-group-header").innerText=S.header;else{var w;(w=a.target.querySelector("#"+o.id+Zt))&&(w.innerText=S.header)}}}},s.prototype.updateCollection=function(o){var i=o.id,n=u(this.tabs,i);if(n){this.selectedTab===n.tabIndex&&this.clearOverflowResize();var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+i);if(""!==s.innerHTML){var l=void 0,p=void 0;if(this.activeLayout===e.RibbonLayout.Simplified&&(p=(l=n.group.enableGroupOverflow?s.querySelector("#"+n.group.id+Yt):null)?t.getComponent(l,r.DropDownButton):this.overflowDDB),o.cssClass&&n.collection.cssClass&&a.classList.remove(n.collection.cssClass),o.items&&n.collection.items)for(var c=0,d=n.collection.items;c<d.length;c++){var h=d[c];this.removeItemElement(s,h,p)}}var b=n.collection;if(b.setProperties(o,!0),b.setProperties({items:this.checkID(b.items,"item",b.id)},!0),this.validateItemSize(),""!==s.innerHTML&&o.items){var m=s.querySelector("#"+n.group.id+$t),f=this.createItems(b.items,n.group.orientation,n.group.id,n.group.header,n.group.enableGroupOverflow,n.tabIndex,m);t.append(f,a)}this.selectedTab===n.tabIndex&&this.refreshLayout(),o.cssClass&&a.classList.add(b.cssClass)}},s.prototype.updateItem=function(o){var i=o.id,n=c(this.tabs,i);if(n){this.selectedTab===n.tabIndex&&this.clearOverflowResize();var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+n.group.id);if(a){var l=a.querySelector("#"+n.group.id+$t),p=null,u=null,d=void 0,h=void 0;if(""!==s.innerHTML){if(this.activeLayout===e.RibbonLayout.Simplified&&(h=(d=n.group.enableGroupOverflow?s.querySelector("#"+n.group.id+Yt):null)?t.getComponent(d,r.DropDownButton):this.overflowDDB),this.activeLayout===e.RibbonLayout.Simplified&&n.item.displayOptions===e.DisplayMode.Overflow){if(p=h.target.querySelector("#"+i+$t),u=h.target.querySelector("#"+i),o.displayOptions&&o.displayOptions!==e.DisplayMode.Overflow){var b=l.querySelector("#"+n.collection.id);b&&b.appendChild(p)}}else p=l.querySelector("#"+i+$t),u=s.querySelector("#"+i),"GroupButton"===n.item.type&&this.activeLayout===e.RibbonLayout.Classic&&(u=s.querySelector("#"+i+ao)),this.activeLayout===e.RibbonLayout.Simplified&&o.displayOptions===e.DisplayMode.Overflow&&(this.createOverflowPopup(n.item,n.tabIndex,n.group.enableGroupOverflow,n.group.id,n.group.header,p,l),n.item.type!==e.RibbonItemType.DropDown&&n.item.type!==e.RibbonItemType.SplitButton&&o.type!==e.RibbonItemType.GroupButton&&o.type!==e.RibbonItemType.Gallery||this.updatePopupItems(n.item,p,n.group.enableGroupOverflow,!0));o.cssClass&&n.item.cssClass&&p.classList.remove(n.item.cssClass),this.destroyFunction(n.item,u),u.remove();var m=p.classList.value.match(/(e-ribbon-[large|medium|small]+-item)/g);m&&t.removeClass([p],m)}var f=n.item;if(f.setProperties(o,!0),this.validateItemSize(),""!==s.innerHTML){p=this.activeLayout!==e.RibbonLayout.Simplified||f.displayOptions!==e.DisplayMode.Overflow?l.querySelector("#"+i+$t):h.target.querySelector("#"+i+$t),f.ribbonTooltipSettings&&y(f.ribbonTooltipSettings)&&(p.classList.add(Rt),this.tooltipData.push({id:p.id,data:f.ribbonTooltipSettings}));var g=f.activeSize;"Simplified"===this.activeLayout&&(g=f.allowedSizes===e.RibbonItemSize.Large||f.allowedSizes&e.RibbonItemSize.Medium||f.displayOptions===e.DisplayMode.Overflow?e.RibbonItemSize.Medium:e.RibbonItemSize.Small,f.setProperties({activeSize:g},!0)),g&e.RibbonItemSize.Large?p.classList.add(kt,Pt):g&e.RibbonItemSize.Medium?p.classList.add(Ot):p.classList.add(Bt),this.createRibbonItem(f,p),"Simplified"===this.activeLayout&&n.group.enableGroupOverflow&&(0===h.target.childElementCount||1===h.target.childElementCount&&this.isHeaderVisible(h.target,n.group.id))&&this.removeOverflowButton(h),this.selectedTab===n.tabIndex&&this.refreshLayout(),o.cssClass&&p.classList.add(f.cssClass),!f.disabled&&p.classList.contains(Ae)&&p.classList.remove(Ae),this.enableDisableItem(f.id,f.disabled)}}else this.isUpdateItems=!0,this.itemsModel.push(o),this.targetTabs[o.id]=n.tabIndex}},s.prototype.removeItemElement=function(t,o,i){var r=null;this.activeLayout===e.RibbonLayout.Classic?(r=o.displayOptions&e.DisplayMode.Classic?t.querySelector("#"+o.id):null,"GroupButton"===o.type&&(r=o.displayOptions&e.DisplayMode.Classic?t.querySelector("#"+o.id+ao):null)):(r=o.displayOptions&e.DisplayMode.Simplified?t.querySelector("#"+o.id):null)||(r=i.target.querySelector("#"+o.id)),r&&(this.destroyFunction(o,r),"GroupButton"===o.type&&this.activeLayout===e.RibbonLayout.Simplified?document.getElementById(o.id+$t).remove():r.closest("#"+o.id+$t).remove())},s.prototype.enableItem=function(e){this.enableDisableItem(e,!1)},s.prototype.disableItem=function(e){this.enableDisableItem(e,!0)},s.prototype.getItem=function(e){return c(this.tabs,e).item},s.prototype.enableDisableItem=function(e,o){var i=!1,r=c(this.tabs,e);if(r){r.item.setProperties({disabled:o},!0);var n;if(n="GroupButton"===r.item.type?f(this,e+ao,r):f(this,e,r)){var s=t.closest(n,".e-ribbon-item"),a=this.getItemModuleName(r.item);if(i=o?!s.classList.contains(Ae):s.classList.contains(Ae),"template"!==a){if(i)if("group-btn"===a&&"Simplified"===this.activeLayout){m(n,"dropdown-btn",o);for(var l=0;l<r.item.groupButtonSettings.items.length;l++){m(document.querySelector("#"+e+ao+l),"btn",o)}}else if("group-btn"===a&&"Classic"===this.activeLayout)for(l=0;l<r.item.groupButtonSettings.items.length;l++){m(n.querySelector("#"+e+ao+l),"btn",o)}else m(n,a,o)}else n.classList.toggle(Ae,o),n.toggleAttribute("disabled",o);s.classList.toggle(Ae,r.item.disabled)}}},s.prototype.unwireEvents=function(){t.EventHandler.remove(window,"resize",this.resizeHandler),t.EventHandler.remove(document.body,"keydown",this.keytipActionHandler),t.EventHandler.remove(document,"mousedown",this.mouseEventHandler),t.EventHandler.remove(document,"scroll",this.mouseEventHandler)},s.prototype.destroy=function(){this.keyboardModuleRibbon.destroy(),this.keyboardModuleRibbon=null,S(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&&(t.remove(this.ribbonTempEle),this.ribbonTempEle=null),i.prototype.destroy.call(this),this.tabObj.destroy(),this.tabObj=void 0,this.initialPropsData={},this.hiddenGroups=[],this.hiddenElements={},this.keyTipElements={},this.itemsModel=[],this.targetTabs={},t.remove(this.element.querySelector("#"+this.element.id+"_tab")),this.element.style.removeProperty(po),this.element.style.removeProperty(co),this.element.style.removeProperty("width"),this.cssClass&&t.removeClass([this.element],this.cssClass.split(" ")),this.element.classList.remove(je,jt,tt,Je,it,"e-rbn"),this.unwireEvents()},s.prototype.onPropertyChanged=function(e,o){for(var i,n,s=0,a=Object.keys(e);s<a.length;s++){switch(a[s]){case"activeLayout":this.switchLayout();break;case"cssClass":o.cssClass&&(i=this.element.classList).remove.apply(i,o.cssClass.split(" ")),e.cssClass&&(n=this.element.classList).add.apply(n,e.cssClass.split(" "));break;case"isMinimized":this.element.classList.toggle(it,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(je,this.enableRtl),this.updateCommonProperty({enableRtl:e.enableRtl}),this.scrollModule&&this.scrollModule.setProperties({enableRtl:e.enableRtl});break;case"launcherIconCss":for(var l=0;l<this.tabs.length;l++){var p=this.tabObj.items[parseInt(l.toString(),10)].content,c=this.tabs[parseInt(l.toString(),10)];if(p.querySelector("."+rt))for(var u=0,d=c.groups;u<d.length;u++){var h=d[u];if(h.showLauncherIcon){var b=vt+" "+(this.launcherIconCss||St);if(h.isCollapsed){var m=p.querySelector("#"+h.id+eo+to);t.getComponent(m,r.DropDownButton).target.querySelector("#"+h.id+Jt).className=b}else{(m=p.querySelector("#"+h.id+Jt)).className=b}}}}break;case"selectedTab":var f=this.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(e.selectedTab.toString(),10)];f.classList.contains("e-hidden")||f.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(l=0;l<this.contextualTabs.length;l++)e.contextualTabs[parseInt(l.toString(),10)]&&this.ribbonContextualTabModule.updateContextualTabs(e.contextualTabs[parseInt(l.toString(),10)],this.contextualTabs[parseInt(l.toString(),10)]);break;case"width":this.element.style.width=t.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&&(t.remove(this.ribbonTempEle),this.ribbonTempEle=null,this.tabObj.element.style.setProperty(co,"0px")),this.helpPaneTemplate&&this.createHelpPaneTemplate();this.tabObj.tbObj.refreshOverflow();break;case"hideLayoutSwitcher":this.hideLayoutSwitcher?this.removeExpandCollapse():this.addExpandCollapse()}}};var g;return Bo([t.Property("Classic")],s.prototype,"activeLayout",void 0),Bo([t.Property("")],s.prototype,"cssClass",void 0),Bo([t.Property(!1)],s.prototype,"enableKeyTips",void 0),Bo([t.Property("")],s.prototype,"layoutSwitcherKeyTip",void 0),Bo([t.Complex({},ve)],s.prototype,"fileMenu",void 0),Bo([t.Complex({},Pe)],s.prototype,"backStageMenu",void 0),Bo([t.Property("")],s.prototype,"launcherIconCss",void 0),Bo([t.Property(!1)],s.prototype,"isMinimized",void 0),Bo([t.Property("en-us")],s.prototype,"locale",void 0),Bo([t.Property(0)],s.prototype,"selectedTab",void 0),Bo([t.Complex({},o.TabAnimationSettings)],s.prototype,"tabAnimation",void 0),Bo([t.Collection([],fe)],s.prototype,"tabs",void 0),Bo([t.Collection([],De)],s.prototype,"contextualTabs",void 0),Bo([t.Property("100%")],s.prototype,"width",void 0),Bo([t.Property("")],s.prototype,"helpPaneTemplate",void 0),Bo([t.Property(!1)],s.prototype,"hideLayoutSwitcher",void 0),Bo([t.Event()],s.prototype,"tabSelecting",void 0),Bo([t.Event()],s.prototype,"tabSelected",void 0),Bo([t.Event()],s.prototype,"ribbonExpanding",void 0),Bo([t.Event()],s.prototype,"ribbonCollapsing",void 0),Bo([t.Event()],s.prototype,"launcherIconClick",void 0),Bo([t.Event()],s.prototype,"created",void 0),Bo([t.Event()],s.prototype,"overflowPopupOpen",void 0),Bo([t.Event()],s.prototype,"overflowPopupClose",void 0),s=g=Bo([t.NotifyPropertyChanges],s)}(t.Component),Lo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonFileMenu"},e.prototype.destroy=function(){this.fileMenuDDB&&this.destroyDDB(),this.parent=null},e.prototype.createFileMenu=function(e){var t=this;if(e.visible){this.ddbElement=this.parent.createElement("button",{id:this.parent.element.id+"_filemenu"});var o=this.parent.tabObj.element,i=o.querySelector(".e-toolbar");o.insertBefore(this.ddbElement,i),this.fileMenuDDB=new r.DropDownButton({content:e.text,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-file-menu e-caret-hide",created:function(){o.style.setProperty(po,t.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()}},e.prototype.addFileMenuTooltip=function(e){y(e.ribbonTooltipSettings)&&(this.ddbElement.classList.add(Rt),this.parent.tooltipData.push({id:this.ddbElement.id,data:e.ribbonTooltipSettings}))},e.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}))},e.prototype.ddbBeforeEvent=function(e,t){!e&&t.event&&t.event.target.closest(".e-ribbon-menu")&&(t.cancel=!0);var o=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;if(o){var i={cancel:t.cancel,element:t.element,event:t.event};o.call(this,i),t.cancel=i.cancel}},e.prototype.ddbAfterEvent=function(e,t){(e?this.fileMenuDDB.target:this.fileMenuDDB.element).focus();var o=e?this.parent.fileMenu.open:this.parent.fileMenu.close;if(o){var i={element:t.element};o.call(this,i)}},e.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},e.prototype.createRibbonMenu=function(e){var i=this,r=this.parent.createElement("ul",{id:this.parent.element.id+ro});this.fileMenuDDB.setProperties({target:r}),this.menuctrl=new o.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)},r),t.EventHandler.add(r,"keydown",function(e){"Tab"===e.key&&i.fileMenuDDB.toggle()},this)},e.prototype.menuBeforeEvent=function(e,t){var o=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;if(o){var i={cancel:t.cancel,element:t.element,event:t.event,items:t.items,parentItem:t.parentItem};o.call(this,i),t.cancel=i.cancel}},e.prototype.menuAfterEvent=function(e,t){var o=e?this.parent.fileMenu.open:this.parent.fileMenu.close;if(o){var i={element:t.element,items:t.items,parentItem:t.parentItem};o.call(this,i)}},e.prototype.beforeItemRender=function(e){var t=this.parent.fileMenu.beforeItemRender;if(t){var o={element:e.element,item:e.item};t.call(this,o)}},e.prototype.menuSelect=function(e){var t=this.parent.fileMenu.select;if(t){var o={element:e.element,item:e.item,event:e.event};t.call(this,o),e.element.classList.contains("e-menu-caret-icon")||this.fileMenuDDB.toggle()}},e.prototype.setCommonProperties=function(e){this.fileMenuDDB&&(this.fileMenuDDB.setProperties(e),this.menuctrl&&this.menuctrl.setProperties(e))},e.prototype.updateFileMenu=function(e){e.visible?this.fileMenuDDB?(e.text&&(this.fileMenuDDB.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(po,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()},e.prototype.destroyMenu=function(){this.menuctrl&&(this.menuctrl.destroy(),this.menuctrl=null)},e.prototype.destroyDDB=function(){this.removeFileMenuTooltip(),this.removeFileMenuKeytip();this.parent.tabObj.element.style.removeProperty(po),this.destroyMenu(),this.fileMenuDDB.destroy(),this.fileMenuDDB=null,t.remove(this.ddbElement),this.ddbElement=null},e.prototype.removeFileMenuTooltip=function(){var e=this,t=l(this.parent.tooltipData,function(t){return t.id===e.ddbElement.id});-1!==t&&(this.ddbElement.classList.remove(Rt),this.parent.tooltipData.splice(t,1))},e.prototype.removeFileMenuKeytip=function(){var e=this;if(this.parent.keyTipElements.filemenu){var t=l(this.parent.keyTipElements.filemenu,function(t){return t.id===e.ddbElement.id});-1!==t&&this.parent.keyTipElements.filemenu.splice(t,1)}},e.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)},e.prototype.removeItems=function(e,t){this.menuctrl.removeItems(e,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.enableItems=function(e,t){this.menuctrl.enableItems(e,!0,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.disableItems=function(e,t){this.menuctrl.enableItems(e,!1,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.setItem=function(e,t,o){this.menuctrl.setItem(e,t,o),this.menuctrl.refresh(),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e}(),Eo=function(){var e=function(t,o){return(e=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])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Do=function(e){function i(t){var o=e.call(this)||this;return o.parent=t,o}return Eo(i,e),i.prototype.render=function(){},i.prototype.preRender=function(){},i.prototype.getPersistData=function(){return""},i.prototype.onPropertyChanged=function(){},i.prototype.getModuleName=function(){return"ribbonBackstage"},i.prototype.destroy=function(){this.backstageButton&&this.destroyDDB(),this.parent=null},i.prototype.createBackStage=function(e){var o=this;if(e.visible){this.backstageButtonEle=this.parent.createElement("button",{id:this.parent.element.id+oo});var i=this.parent.tabObj.element,r=i.querySelector(".e-toolbar");if(i.insertBefore(this.backstageButtonEle,r),this.backstageButton=new n.Button({content:e.text,enableRtl:this.parent.enableRtl,cssClass:Ht,created:function(){i.style.setProperty(po,o.backstageButtonEle.offsetWidth+"px")}},this.backstageButtonEle),this.createBackStagePopup(e),this.parent.backStageMenu.template)this.createBackStageTemplate(this.parent.backStageMenu.template);else{for(var s=0,a=0,l=0;l<e.items.length;l++){e.items[parseInt(l.toString(),10)].isFooter?s++:a++}a>0&&this.createBackstageMenu(e,!1),s>0&&this.createBackstageMenu(e,!0),this.menuCtrl&&this.checkMenuItems(this.menuCtrl.items),this.footerMenuCtrl&&this.checkMenuItems(this.footerMenuCtrl.items)}this.backstageButtonEle.onclick=function(t){t.stopPropagation(),o.showBackstage(),o.popupHTMLElement.classList.add(zt);var i=o.menuWrapper.querySelector(".e-menu-item.e-selected");i&&i.classList.remove("e-selected");for(var r=0;r<e.items.length;r++){var n=e.items[parseInt(r.toString(),10)];if(!n.isFooter&&o.menuCtrl.items[0].text===n.text){var s=o.popupHTMLElement.querySelector("#"+o.menuCtrl.items[0].id);s&&(s.classList.add("e-selected"),s.focus()),o.createBackStageContent(o.menuCtrl.items[0].id,n.content);break}}},this.parent.tabObj.refreshActiveTabBorder(),this.addBackStageMenuTooltip(e),this.addBackStageMenuKeyTip(e),t.EventHandler.add(document,"click",this.onClickEvent,this)}},i.prototype.onClickEvent=function(e){var t=e.target;this.popupHTMLElement.contains(t)||this.hideBackstage()},i.prototype.addBackStageMenuTooltip=function(e){y(e.ribbonTooltipSettings)&&(this.backstageButtonEle.classList.add(Rt),this.parent.tooltipData.push({id:this.backstageButtonEle.id,data:e.ribbonTooltipSettings}))},i.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})}},i.prototype.checkMenuItems=function(e){for(var t=0;t<e.length;t++){var o=e[parseInt(t.toString(),10)];if(!o.iconCss){this.popupHTMLElement.querySelector("#"+o.id).classList.add("e-blankicon")}}},i.prototype.createBackStagePopup=function(e){var t=this;this.popupHTMLElement=this.parent.createElement("div",{id:this.parent.element.id+io,className:Gt});e.target?(e.target instanceof HTMLElement?e.target:document.querySelector(e.target)).appendChild(this.popupHTMLElement):this.parent.element.appendChild(this.popupHTMLElement),this.popupEle=new a.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.popupHTMLElement.onkeydown=function(e){"Escape"===e.code&&t.hideBackstage()},this.hideBackstage()},i.prototype.updatePopupPositionOnRtl=function(e){var t=this.popupHTMLElement.style;e?(t.right=t.left,t.left="unset"):(t.left=t.right,t.right="unset")},i.prototype.createBackstageMenu=function(e,t){var i=this;if(this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_wrapper")||(this.menuWrapper=this.parent.createElement("div",{id:this.parent.element.id+"_wrapper",className:Ft}),this.popupHTMLElement.appendChild(this.menuWrapper)),e.backButton.visible&&!t){var r=this.parent.createElement("button",{id:this.parent.element.id+"_close",className:"e-ribbon-close-btn"});this.closeBtn=new n.Button({content:e.backButton.text,iconCss:e.backButton.iconCss?e.backButton.iconCss:Me,enableRtl:this.parent.enableRtl},r),this.menuWrapper.append(r),r.onclick=function(){i.popupHTMLElement.classList.remove(zt),i.hideBackstage(),i.isBackButtonClicked=!0}}this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_itemswrapper")||(this.itemsWrapperEle=this.parent.createElement("div",{id:this.parent.element.id+"_itemswrapper",className:Ut}),this.menuWrapper.append(this.itemsWrapperEle));var s;t?(s=this.parent.createElement("ul",{id:this.parent.element.id+no}),this.itemsWrapperEle.appendChild(s)):(this.ulMenuElem=this.parent.createElement("ul",{id:this.parent.element.id+"_menulist"}),this.itemsWrapperEle.appendChild(this.ulMenuElem)),t?this.footerMenuCtrl=new o.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:Wt,items:this.cloneFooterMenuItem(e.items),select:this.menuSelect.bind(this,e)},s):this.menuCtrl=new o.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:Wt,items:this.cloneMenuItem(e.items),select:this.menuSelect.bind(this,e)},this.ulMenuElem)},i.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},i.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},i.prototype.createBackStageContent=function(e,o){var i="backstageContent";this.clearTemplate([i]),this.backstageContentEle?(this.backstageContentEle.innerHTML="",this.backstageContentEle.id=e+Qt):this.backstageContentEle=this.parent.createElement("div",{id:e+Qt,className:Nt});var r=p(o);return t.append(r({},this,i,"backstageContent",this.parent.isStringTemplate),this.backstageContentEle),o&&this.popupHTMLElement.append(this.backstageContentEle),this.renderReactTemplates(),r},i.prototype.createBackStageTemplate=function(e){var o="backstageTemplate";this.clearTemplate([o]),this.backstageTempEle=this.parent.createElement("div",{id:this.parent.element.id+oo+"_template",className:Kt});var i=p(e);return t.append(i({},this,o,"backstageTemplate",this.parent.isStringTemplate),this.backstageTempEle),this.popupHTMLElement.append(this.backstageTempEle),this.renderReactTemplates(),i},i.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;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)},i.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)))},i.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(po,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&&(t.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 o=0,i=0,r=0;r<e.items.length;r++){e.items[parseInt(r.toString(),10)].isFooter?o++:i++}i>0&&this.createBackstageMenu(e,!1),o>0&&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()},i.prototype.destroyMenu=function(){this.menuCtrl&&(this.menuCtrl.destroy(),this.menuCtrl=null)},i.prototype.destroyDDB=function(){this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip();this.parent.tabObj.element.style.removeProperty(po),this.destroyMenu(),this.backstageButton.destroy(),this.backstageButton=null,t.remove(this.backstageButtonEle),this.backstageButtonEle=null,t.EventHandler.remove(document,"click",this.onClickEvent)},i.prototype.removeBackstageMenuTooltip=function(){var e=this,t=l(this.parent.tooltipData,function(t){return t.id===e.backstageButtonEle.id});-1!==t&&(this.backstageButtonEle.classList.remove(Rt),this.parent.tooltipData.splice(t,1))},i.prototype.removeBackstageMenuKeyTip=function(){var e=this;if(this.parent.keyTipElements.backstage&&this.parent.keyTipElements.backstage.length){var t=l(this.parent.keyTipElements.backstage,function(t){return t.id===e.backstageButtonEle.id});-1!==t&&this.parent.keyTipElements.backstage.splice(t,1)}if(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--},i.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)}var n=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items),s=this.parent.backStageMenu;for(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)},i.prototype.removeBackstageItems=function(e,t){this.menuCtrl.removeItems(e,t),this.footerMenuCtrl.removeItems(e,t);var o=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items);this.parent.backStageMenu.setProperties({items:o},!0)},i.prototype.showBackstage=function(){this.popupEle.show()},i.prototype.hideBackstage=function(){this.popupEle.element.classList.contains(zt)&&this.popupEle.element.classList.remove(zt),this.popupEle.hide()},i}(t.Component),Ro=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonContextualTab"},e.prototype.destroy=function(){this.parent=null},e.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,r=this.parent.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(i.toString(),10)];r.classList.add(Ue),r.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))}},e.prototype.updateContextualTabs=function(e,o){if(!t.isNullOrUndefined(e.visible))for(var i=0;i<o.tabs.length;i++)e.visible?this.parent.showTab(o.tabs[parseInt(i.toString(),10)].id,!0):this.parent.hideTab(o.tabs[parseInt(i.toString(),10)].id,!0);if(!t.isNullOrUndefined(e.isSelected))if(e.isSelected&&o.visible)this.parent.selectTab(o.tabs[0].id);else{var r=this.parent.tabObj.element;for(i=0;i<this.parent.tabs.length;i++){var n=r.querySelectorAll(".e-toolbar-item")[parseInt(i.toString(),10)];if(!n.classList.contains("e-hidden")&&!n.classList.contains("e-disable")){this.parent.selectTab(this.parent.tabs[parseInt(i.toString(),10)].id);break}}}if(e.tabs){var s=function(e){var t=parseInt(e,10),i=a.parent.tabs.filter(function(e){return e.id===o.tabs[parseInt(t.toString(),10)].id})[0];a.parent.updateTab(i)},a=this;for(var l in e.tabs)s(l)}},e}(),xo=function(){function e(e){this.isKeytipPopupOpen=!1,this.parent=e}return e.prototype.getModuleName=function(){return"ribbonKeyTip"},e.prototype.destroy=function(){this.parent=null},e.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[o][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){var i=this.parent.keyTipElements[this.parent.selectedTab].popupitem;for(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){var r=this.parent.keyTipElements.backstageMenu;for(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")}}},e.prototype.calculateItemPosition=function(e,t,o){void 0===t&&(t=!1);var i,r,n;if(n=this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][e])for(var s=0;s<Object.keys(this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][e]).length;s++)if(t&&n[parseInt(s.toString(),10)].keyTip===o||!t){var a=n[parseInt(s.toString(),10)].id;n[parseInt(s.toString(),10)].id.includes("_grpbtn")&&(a=n[parseInt(s.toString(),10)].id.replace(/_grpbtn\d+/,""));var l=c(this.parent.tabs,a);l&&"Column"===l.group.orientation&&l.collection.items.length>1&&"Simplified"!==this.parent.activeLayout?0===l.itemIndex?(i="center",r="top"):1===l.itemIndex?(i="center",r="center"):(i="center",r="bottom"):l&&"Row"===l.group.orientation&&l.group.collections.length>1&&"Simplified"!==this.parent.activeLayout&&(0===l.collectionIndex?(i="center",r="top"):(i="center",r="bottom")),"item"===e?this.createKeyTipElement(n[parseInt(s.toString(),10)].id,n[parseInt(s.toString(),10)].keyTip,e,i,r):this.createKeyTipElement(n[parseInt(s.toString(),10)].id,n[parseInt(s.toString(),10)].keyTip,e,i,r,!1,!0)}},e.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 l,p=document.querySelector("#"+e),c=!1;if(n&&(p=document.querySelector("#"+e+Zt)),p)if(p.closest(".e-ribbon-group-overflow-ddb")&&(c=!0),n&&s&&p.closest(".e-toolbar-pop")&&(c=!0),p.closest(".e-split-btn-wrapper")){l=p.closest(".e-split-btn-wrapper").closest(".e-ribbon-item").id}else p.closest(".e-colorpicker-wrapper")&&(l=(p=p.closest(".e-colorpicker-wrapper")).closest(".e-ribbon-item").id);if((p&&p.offsetParent||n&&s)&&(s&&c||!s)){var u=this.parent.createElement("div",{className:We,id:e+lo});document.body.append(u);new a.Popup(u,{relateTo:"#"+(n?e+Zt:l||e),content:t,collision:{X:"fit",Y:"flip"},targetType:"relative",position:{X:i,Y:r},enableRtl:this.parent.enableRtl}).show(),this.calculateKeyTipPosition(p,u,o,r,n&&s),this.parent.isKeytipOpen=!0}},e.prototype.calculateKeyTipPosition=function(e,t,o,i,r){void 0===r&&(r=!1);var n=e.getBoundingClientRect();"backstageMenu"===o?(t.style.top=n.top+t.offsetHeight/2+"px",t.style.left=n.left+e.offsetWidth/5+"px"):"popupitem"!==o&&(t.style.left=n.left+(n.width-t.offsetWidth)/2+"px"),"filemenu"===o||"backstage"===o?t.style.top=n.top+(e.offsetHeight-e.offsetHeight/3+t.offsetHeight/6)+"px":"item"===o&&"top"===i&&(t.style.top=n.top-e.offsetHeight/2+"px")},e.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=this.parent.keyTipElements[parseInt(i.toString(),10)][Object.keys(this.parent.keyTipElements[parseInt(i.toString(),10)])[parseInt(r.toString(),10)]],s=0;s<n.length&&!this.isKeytipPresent;s++)if(e.toUpperCase()===n[parseInt(s.toString(),10)].keyTip){if(document.querySelector("#"+n[parseInt(s.toString(),10)].id+lo)||t)if(this.isKeytipPresent=!0,this.removeKeytip(),"tab"===n[parseInt(s.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");else if("item"===n[parseInt(s.toString(),10)].type||"grpoverflowpopup"===n[parseInt(s.toString(),10)].type||"popupitem"===n[parseInt(s.toString(),10)].type)if(document.getElementById(n[parseInt(s.toString(),10)].id)&&document.getElementById(n[parseInt(s.toString(),10)].id).classList.contains("e-ribbon-group-button"))document.getElementById(n[parseInt(s.toString(),10)].id).click();else{var a=void 0;if(n[parseInt(s.toString(),10)].id.includes("_popupButton")){var l=n[parseInt(s.toString(),10)].id.replace(/_popupButton/g,"");a=c(this.parent.tabs,l)}else a=c(this.parent.tabs,n[parseInt(s.toString(),10)].id);(!t||t&&a.tabIndex===this.parent.selectedTab)&&this.clickItems(a,n,s,!1,t)}else if("grpoverflow"===n[parseInt(s.toString(),10)].type||"grpofbtn"===n[parseInt(s.toString(),10)].type||"launcher"===n[parseInt(s.toString(),10)].type){var p=document.querySelector("#"+n[parseInt(s.toString(),10)].id);if(this.removeKeytip(),p){var u=n[parseInt(s.toString(),10)].id;if(t){if(n[parseInt(s.toString(),10)].id.includes("_launcher")||n[parseInt(s.toString(),10)].id.includes("_sim_grp_overflow")||n[parseInt(s.toString(),10)].id.includes("_overflow_dropdown")){u=n[parseInt(s.toString(),10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g,"");(a=d(this.parent.tabs,u)).tabIndex===this.parent.selectedTab&&this.clickItems(a,n,s,!0,t,p)}}else this.clickItems(null,n,s,!0,t,p)}}}}else this.parent.keyTipElements&&this.commonItemsKeyTipPress(e,Object.keys(this.parent.keyTipElements)[parseInt(i.toString(),10)],t)},e.prototype.clickItems=function(e,o,i,n,s,a){if(n)a.click(),"launcher"!==o[parseInt(i.toString(),10)].type&&(this.isKeytipPopupOpen=!0,"grpoverflow"===o[parseInt(i.toString(),10)].type?this.createKeytip("grpoverflowpopup"):this.createKeytip("popupitem"));else{var l=o[parseInt(i.toString(),10)].id;document.querySelector("#"+l)&&s&&("Simplified"===this.parent.activeLayout?document.querySelector("#"+l).closest("#"+e.group.id+"_sim_grp_overflow-popup")&&document.querySelector("#"+l).closest("#"+e.group.id+"_sim_grp_overflow-popup").classList.contains("e-popup-close")?document.querySelector("#"+e.group.id+"_sim_grp_overflow").click():document.querySelector("#"+l).closest("#"+this.parent.tabObj.element.id+Xt+"-popup")&&document.querySelector("#"+l).closest("#"+this.parent.tabObj.element.id+Xt+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+this.parent.tabObj.element.id+Xt).click():document.querySelector("#"+l).closest("#"+e.group.id+eo+to+"-popup")&&document.querySelector("#"+l).closest("#"+e.group.id+eo+to+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+e.group.id+eo+to).click());switch(this.parent.getItemModuleName(e.item)){case"btn":this.parent.ribbonButtonModule.click(l);break;case"dropdown-btn":this.parent.ribbonDropDownModule.toggle(l);break;case"split-btn":this.parent.ribbonSplitButtonModule.toggle(l);break;case"checkbox":this.parent.ribbonCheckBoxModule.click(l);break;case"colorpicker":this.parent.ribbonColorPickerModule.toggle(l);break;case"combobox":var p=document.querySelector("#"+l);setTimeout(function(){p.focus()},100);break;case"gallery":document.querySelector("#"+l).click();break;case"template":document.querySelector("#"+l).focus();break;case"group-btn":var c=document.querySelector("#"+l);if(c){t.getInstance(c,r.DropDownButton).toggle();for(var u=0;u<e.item.groupButtonSettings.items.length;u++)e.item.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip&&this.createKeyTipElement(l+(ao+u),e.item.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip,"item")}}}},e.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+lo)||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+lo)||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=0;e<Object.keys(i.parent.keyTipElements).length;e++)if(i.parent.keyTipElements[parseInt(e.toString(),10)]){var t=i.parent.keyTipElements[parseInt(e.toString(),10)].tab;i.createKeyTipElement(t[0].id,t[0].keyTip,"tab","center","bottom",!0,!0)}},600)))}},e.prototype.removeKeytip=function(e){var o=this,i=document.querySelectorAll(".e-ribbon-keytip"),r=!1;this.parent.keysPress="";for(var n=function(n){var a=i[parseInt(n.toString(),10)];if("Escape"===e&&s.parent.keyTipElements&&s.parent.keyTipElements[s.parent.selectedTab]){for(var p=0;p<Object.keys(s.parent.keyTipElements[s.parent.selectedTab]).length;p++){var c=Object.keys(s.parent.keyTipElements[s.parent.selectedTab])[p];if(s.parent.keyTipElements[s.parent.selectedTab][c]){if(-1!==l(s.parent.keyTipElements[s.parent.selectedTab][c],function(e){return e.id+lo===i[parseInt(n.toString(),10)].id})){if("item"===c&&!s.isKeytipPopupOpen||"grpoverflow"===c&&"Classic"===s.parent.activeLayout){s.createKeytip("tab"),e="",r=!0;break}if(s.isKeytipPopupOpen&&("popupitem"===c&&"Simplified"===s.parent.activeLayout||"grpoverflowpopup"===c&&"Classic"===s.parent.activeLayout)){s.createKeytip("item"),e="",r=!0;break}}}}for(var u=0;u<Object.keys(s.parent.keyTipElements).length;u++)if(s.parent.keyTipElements[parseInt(u.toString(),10)]){var d=s.parent.keyTipElements[parseInt(u.toString(),10)].tab;for(p=0;p<d.length;p++)if(a.id===d[0].id+lo&&document.querySelector("#"+d[0].id+Zt).closest(".e-toolbar-pop")){s.parent.tabObj.element.querySelector(".e-nav-active").click(),setTimeout(function(){o.createKeytip("tab")},600),e="",r=!0;break}if(r)break}if(!r&&s.parent.keyTipElements.backstageMenu){-1!==l(s.parent.keyTipElements.backstageMenu,function(e){return e.id+lo===i[parseInt(n.toString(),10)].id})&&(s.createKeytip("tab"),e="",r=!0)}}a&&t.remove(a)},s=this,a=0;a<i.length;a++)n(a);this.isKeytipPopupOpen=!1,r||(this.parent.isKeytipOpen=!1)},e.prototype.showKeyTips=function(e){this.parent.enableKeyTips&&(e?this.keytipPress(e,!0):this.createKeytip("tab"))},e.prototype.hideKeyTips=function(){this.removeKeytip()},e}();e.Ribbon=Po,e.ITEM_VERTICAL_CENTER=Re,e.EXPAND_COLLAPSE_ICON=xe,e.BACKSTAGE_CLOSE_ICON=Me,e.OVERFLOW_ICON=_e,e.VERTICAL_DDB=qe,e.DISABLED_CSS=Ae,e.RTL_CSS=je,e.RIBBON_HOVER=Ge,e.RIBBON_CONTROL=ze,e.RIBBON_POPUP_CONTROL=Ne,e.RIBBON_POPUP_OPEN=He,e.RIBBON_KEYTIP=We,e.SPACE=" ",e.HORIZONTAL_SCROLLBAR=Ke,e.HIDE_CSS=Fe,e.RIBBON_TAB="e-ribbon-tab",e.RIBBON_CONTEXTUAL_TAB=Ue,e.RIBBON_TAB_ACTIVE=Ve,e.RIBBON_TAB_ITEM=Xe,e.RIBBON_COLLAPSE_BUTTON=Ye,e.RIBBON_EXPAND_BUTTON=Ze,e.RIBBON_COLLAPSIBLE=Je,e.RIBBON_OVERALL_OF_BUTTON=Qe,e.RIBBON_GROUP_OF_BUTTON=$e,e.RIBBON_OVERFLOW_TARGET=et,e.RIBBON_OVERFLOW=tt,e.TAB_CONTENT=ot,e.RIBBON_MINIMIZE=it,e.RIBBON_GROUP=rt,e.RIBBON_SINGLE_BUTTON_SELECTION=nt,e.RIBBON_MULTIPLE_BUTTON_SELECTION=st,e.RIBBON_GROUP_BUTTON=at,e.RIBBON_GROUP_BUTTON_OVERFLOW_POPUP=lt,e.RIBBON_GROUP_BUTTON_CONTENT=pt,e.RIBBON_GROUP_CONTAINER=ct,e.RIBBON_OF_TAB_CONTAINER=ut,e.RIBBON_OF_GROUP_CONTAINER=dt,e.RIBBON_GROUP_CONTENT=ht,e.RIBBON_GROUP_HEADER=bt,e.RIBBON_OVERFLOW_HEADER=mt,e.RIBBON_GROUP_OVERFLOW=ft,e.RIBBON_GROUP_OVERFLOW_DDB=yt,e.RIBBON_LAUNCHER=gt,e.RIBBON_LAUNCHER_ICON_ELE=vt,e.RIBBON_LAUNCHER_ICON=St,e.RIBBON_COLLECTION=It,e.RIBBON_ITEM=Ct,e.RIBBON_ROW=Tt,e.RIBBON_COLUMN=wt,e.RIBBON_LARGE_ITEM=kt,e.RIBBON_MEDIUM_ITEM=Ot,e.RIBBON_SMALL_ITEM=Bt,e.RIBBON_CONTENT_HEIGHT=Pt,e.DROPDOWNBUTTON="e-dropdown-btn",e.DROPDOWNBUTTON_HIDE="e-caret-hide",e.RIBBON_TEMPLATE=Lt,e.RIBBON_HELP_TEMPLATE=Et,e.RIBBON_TOOLTIP=Dt,e.RIBBON_TOOLTIP_TARGET=Rt,e.RIBBON_TOOLTIP_TITLE=xt,e.RIBBON_TOOLTIP_CONTENT=Mt,e.RIBBON_TOOLTIP_ICON=_t,e.RIBBON_TOOLTIP_CONTAINER=qt,e.RIBBON_TEXT_CONTAINER=At,e.RIBBON_SIMPLIFIED_MODE=jt,e.RIBBON_BACKSTAGE_POPUP=Gt,e.RIBBON_BACKSTAGE_OPEN=zt,e.RIBBON_BACKSTAGE_CONTENT=Nt,e.RIBBON_SELECTED_CONTENT="e-ribbon-selected-content",e.RIBBON_BACKSTAGE=Ht,e.RIBBON_BACKSTAGE_MENU=Wt,e.RIBBON_BACKSTAGE_TEMPLATE=Kt,e.RIBBON_BACKSTAGE_MENU_WRAPPER=Ft,e.RIBBON_BACKSTAGE_ITEMS_WRAPPER=Ut,e.RIBBON_BACKSTAGE_TEXT_MENU="e-blankicon",e.TAB_ID="_tab",e.GROUP_ID="_group",e.COLLECTION_ID="_collection",e.ITEM_ID="_item",e.COLLAPSE_BUTTON_ID=Vt,e.OVRLOF_BUTTON_ID=Xt,e.GROUPOF_BUTTON_ID=Yt,e.HEADER_ID=Zt,e.LAUNCHER_ID=Jt,e.CONTENT_ID=Qt,e.CONTAINER_ID=$t,e.OVERFLOW_ID=eo,e.DROPDOWN_ID=to,e.RIBBON_FILE_MENU_ID="_filemenu",e.RIBBON_BACKSTAGE_MENU_ID=oo,e.RIBBON_BACKSTAGE_POPUP_ID=io,e.RIBBON_FILE_MENU_LIST=ro,e.RIBBON_MENU_LIST="_menulist",e.RIBBON_FOOTER_MENU_LIST=no,e.RIBBON_HELP_PANE_TEMPLATE_ID=so,e.RIBBON_GROUP_BUTTON_ID=ao,e.RIBBON_KEYTIP_ID=lo,e.RIBBON_FILE_MENU_WIDTH=po,e.RIBBON_HELP_PANE_TEMPLATE_WIDTH=co,e.getIndex=l,e.getTemplateFunction=p,e.getItem=c,e.getCollection=u,e.getGroup=d,e.destroyControl=h,e.updateCommonProperty=b,e.updateControlDisabled=m,e.getItemElement=f,e.isTooltipPresent=y,e.setToolTipContent=g,e.createTooltip=v,e.destroyTooltip=S,e.updateTooltipProp=I,e.setCustomAttributes=C,e.RibbonTab=fe,e.RibbonGroup=he,e.RibbonCollection=ce,e.RibbonItem=ae,e.RibbonButtonSettings=k,e.RibbonCheckBoxSettings=P,e.RibbonColorPickerSettings=D,e.RibbonComboBoxSettings=M,e.RibbonDropDownSettings=A,e.RibbonSplitButtonSettings=z,e.FileMenuSettings=ve,e.BackStageMenu=Pe,e.BackstageBackButton=Ce,e.BackstageItem=ke,e.RibbonTooltip=W,e.RibbonGroupButtonSettings=Y,e.RibbonGroupButtonItem=U,e.RibbonContextualTabSettings=De,e.RibbonGalleryGroup=te,e.RibbonGalleryItem=Q,e.RibbonGallerySettings=re,e.RibbonButton=ho,e.RibbonCheckBox=mo,e.RibbonColorPicker=yo,e.RibbonComboBox=vo,e.RibbonDropDown=Io,e.RibbonSplitButton=To,e.RibbonGroupButton=wo,e.RibbonGallery=ko,e.RibbonFileMenu=Lo,e.RibbonBackstage=Do,e.RibbonContextualTab=Ro,e.RibbonKeyTip=xo,Object.defineProperty(e,"__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,P,L,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},L.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}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,ke,p=function(e,t){function o(){this.constructor=e}Oe(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=(ke=x.ChildProperty,p(d,ke),d.prototype.setProperties=function(e,t){ke.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!==ke&&ke.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,Pe,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)},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},c=(Pe=x.ChildProperty,c(Ee,Pe),Ee.prototype.setProperties=function(e,t){Pe.prototype.setProperties.call(this,e,t)},Le([x.Property("")],Ee.prototype,"id",void 0),Le([x.Property("")],Ee.prototype,"cssClass",void 0),Le([x.Collection([],p)],Ee.prototype,"items",void 0),Ee);function Ee(){return null!==Pe&&Pe.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,Le=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},Le=(Re=x.ChildProperty,Le(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([],Le)],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([],P.MenuItem)],y.prototype,"menuItems",void 0),m([x.Property(!1)],y.prototype,"showItemOnClick",void 0),m([x.Complex({},P.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",Ot="e-ribbon-overflow",kt="e-content",Bt="e-ribbon-minimize",Pt="e-ribbon-group",Lt="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",C="_overflow",Oo="_dropdown",ko="_filemenu",Bo="_backstage",Po="_backstagepopup",Lo="_filemenulist",Eo="_menulist",Do="_footermenulist",Ro="_helppanetemplate",G="_grpbtn",xo="_keytip",Mo="--fileMenuWidth",_o="--helpTemplateWidth",qo=function(){return(qo=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Ao=(jo.prototype.getModuleName=function(){return"ribbonButton"},jo.prototype.destroy=function(){this.parent=null},jo.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&&((t=qo({},r.htmlAttributes)).id&&delete t.id,pi(i,t)),i.onclick=function(e){r.clicked&&r.clicked.call(o,e)},r.content?i.setAttribute("aria-label",r.content):i.setAttribute("aria-label","button")},jo.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.toggle()}},jo.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)}},jo.prototype.click=function(e){e=I(this.parent,e);e&&x.getComponent(e,u.Button).click()},jo.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))},jo.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})},jo);function jo(e){this.parent=e}var Go=function(){return(Go=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},zo=(No.prototype.getModuleName=function(){return"ribbonCheckBox"},No.prototype.destroy=function(){this.parent=null},No.prototype.createCheckBox=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id}),r=(t.appendChild(i),e.checkBoxSettings),t={};r.htmlAttributes&&(t=Go({},r.htmlAttributes)).id&&delete t.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:t,change:function(e){r.change&&r.change.call(o,e)}},i)},No.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.toggle()}},No.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)}},No.prototype.click=function(e){e=I(this.parent,e);e&&x.getComponent(e,u.CheckBox).click()},No.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))},No);function No(e){this.parent=e}var Ho=function(){return(Ho=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},$e=(Wo.prototype.getModuleName=function(){return"ribbonColorPicker"},Wo.prototype.destroy=function(){this.parent=null},Wo.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),e=(r.htmlAttributes&&((t=Ho({},r.htmlAttributes)).id&&delete t.id,pi(i,t)),n.element.parentElement);x.EventHandler.add(e,"mouseenter",this.toggleWrapperHover.bind(this,e,!0),this),x.EventHandler.add(e,"mouseleave",this.toggleWrapperHover.bind(this,e,!1),this)},Wo.prototype.toggleWrapperHover=function(e,t){t?e.classList.add(lt):e.classList.remove(lt)},Wo.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.toggle()}},Wo.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)}},Wo.prototype.getColorPickerObj=function(e){e=I(this.parent,e);return e?x.getComponent(e,E.ColorPicker):null},Wo.prototype.getValue=function(e,t,o){e=this.getColorPickerObj(e);return e?e.getValue(t,o):""},Wo.prototype.toggle=function(e){e=this.getColorPickerObj(e);e&&e.toggle()},Wo.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))},Wo.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)},Wo);function Wo(e){this.parent=e}var Fo=function(){return(Fo=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Ko=(Uo.prototype.getModuleName=function(){return"ribbonComboBox"},Uo.prototype.destroy=function(){this.parent=null},Uo.prototype.createComboBox=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id}),r=(t.appendChild(i),e.comboBoxSettings),t={};r.htmlAttributes&&(t=Fo({},r.htmlAttributes)).id&&delete t.id,new L.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:t,close:function(e){r.close&&r.close.call(o,e)},filtering:r.filtering,change:r.change,select:r.select,created:r.created},i)},Uo.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,L.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.toggle()}},Uo.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,L.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)}},Uo.prototype.getComboBoxObj=function(e){e=I(this.parent,e);return e?x.getComponent(e,L.ComboBox):null},Uo.prototype.filter=function(e,t,o,i){this.getComboBoxObj(e).filter(t,o,i)},Uo.prototype.hidePopup=function(e){e=this.getComboBoxObj(e);e&&e.hidePopup()},Uo.prototype.showPopup=function(e){e=this.getComboBoxObj(e);e&&e.showPopup()},Uo.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,L.ComboBox).setProperties(e))},Uo);function Uo(e){this.parent=e}var Vo=function(){return(Vo=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Xo=(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&&((t=Vo({},r.htmlAttributes)).id&&delete t.id,pi(i,t))},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.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+C+Oo})),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 si(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+C+Oo);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){this.getDropDownObj(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})},f);function f(e){this.parent=e}var Yo=function(){return(Yo=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Zo=(Jo.prototype.getModuleName=function(){return"ribbonSplitButton"},Jo.prototype.destroy=function(){this.parent=null},Jo.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&&((t=Yo({},r.htmlAttributes)).id&&delete t.id,pi(i,t)),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)},Jo.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.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.toggle()}},Jo.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)}},Jo.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:""})},Jo.prototype.getSplitButtonObj=function(e){e=I(this.parent,e);return x.getComponent(e,M.SplitButton)},Jo.prototype.addItems=function(e,t,o){this.getSplitButtonObj(e).addItems(t,o)},Jo.prototype.removeItems=function(e,t,o){this.getSplitButtonObj(e).removeItems(t,o)},Jo.prototype.toggle=function(e){this.getSplitButtonObj(e).toggle()},Jo.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)},Jo.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)},Jo);function Jo(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 Qo(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 $o(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 ei(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 ti(e,t){x.getComponent(e,t).destroy()}function oi(e,t,o){x.getComponent(e,t).setProperties(o)}function ii(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 ri(e){return!!(e.content||e.iconCss||e.title||e.id||e.cssClass)}function ni(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 si(e,t){var o=new D.Tooltip({target:"."+io,beforeRender:function(e){ni(e,o,t.tooltipData)}.bind(this),windowCollision:!0});o.appendTo(e)}function ai(e){x.getComponent(e,D.Tooltip).destroy()}function li(e,t){x.getComponent(e,D.Tooltip).setProperties(t)}function pi(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])}}di.prototype.getModuleName=function(){return"ribbonGroupButton"},di.prototype.destroy=function(){this.parent=null},di.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&&pi(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(Lt):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++)),i.items[parseInt(s.toString(),10)].ribbonTooltipSettings&&ri(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)},si(r,this.parent),this.isSelected=!1}},di.prototype.groupButtonClicked=function(e,t,o){for(var i=[],r=[],n=[],s=0;s<o.items.length;s++)document.querySelector("#"+t.id+G+s)&&document.querySelector("#"+t.id+G+s).classList.contains("e-active")&&i.push(o.items[parseInt(s.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(Lt));for(s=0;s<o.items.length;s++)document.querySelector("#"+t.id+G+s)&&document.querySelector("#"+t.id+G+s).classList.contains("e-active")&&(document.querySelector("#"+t.id+G+s).classList.remove("e-active"),o.items[parseInt(s.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,d=document.querySelector("#"+t.id),(u=x.getComponent(d,M.DropDownButton)).setProperties({iconCss:o.items[parseInt(e.toString(),10)].iconCss}))}else{document.querySelector("#"+t.id+G).classList.contains(Lt)&&(document.querySelector("#"+t.id+G).classList.remove(Lt),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 a=0,l=0;l<o.items.length;l++)document.querySelector("#"+t.id+G+l)&&document.querySelector("#"+t.id+G+l).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&l!==e&&(this.isSelected=!0,a++);if("Simplified"===this.parent.activeLayout){var p=null,c=0,d=document.querySelector("#"+t.id),u=x.getComponent(d,M.DropDownButton);if(this.isSelected){if(1===a&&!document.querySelector("#"+t.id+G+e).classList.contains("e-active"))for(l=0;l<o.items.length;l++)document.querySelector("#"+t.id+G+l)&&document.querySelector("#"+t.id+G+l).classList.contains("e-active")&&(p=o.items[parseInt(l.toString(),10)].iconCss)}else document.querySelector("#"+t.id+G+e).classList.contains("e-active")&&(p=o.items[parseInt(e.toString(),10)].iconCss);for(;c<o.items.length&&!p;)o.items[parseInt(c.toString(),10)].iconCss&&(p=o.items[parseInt(c.toString(),10)].iconCss),c++;u.setProperties({iconCss:p}),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)}},di.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)},si(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))}},di.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(),this.grpBtnIndex=0)},di.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)},di.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())},di.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=e.groupButtonSettings,n=!0,t=t.querySelector("#"+e.id),s=x.getComponent(t,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)&&(s.toggle(),o.toggle())}},di.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:""}))},di.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))},di.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 ci=di;function di(e){this.parent=e,this.isSelected=!1}w.prototype.getModuleName=function(){return"ribbonGallery"},w.prototype.destroy=function(){this.parent=null},w.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}}}},w.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",p.style.paddingTop="0px",p.style.paddingBottom="0px","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&&pi(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)},w.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")},w.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"))}}}},w.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=("auto"!==e.width&&l.forEach(function(e){e.style.flexFlow="wrap"}),!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)))}},w.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"},w.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()},w.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)}},w.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.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"),a=x.getComponent(a,D.Popup),l=document.querySelector("#"+t.id+"_galleryPopup .e-ribbon-popup-container"),e=new M.DropDownButton({iconCss:r,content:e,target:l,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-gallery-dropdown",disabled:t.disabled,open:function(){o.setFoucsToFirstItem(l,!0,t.id)},beforeClose:function(e){o.popupEvents(e.event,t.gallerySettings,"popupClose",!1)&&(e.cancel=!0)}},i);"auto"!==a.width&&(e.dropDown.width=x.formatUnit(a.width)),"auto"!==a.height&&(e.dropDown.height=x.formatUnit(a.height),e.dropDown.element.style.height=a.height.toString())}},w.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))},w.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)}},w.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},w.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))},w.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"))},w.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)},w.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)},w.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)}},w.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))},w.prototype.createGalleryTemplate=function(e,t,o,i){e.classList.add("e-ribbon-gallery-template");var r="ribbon"+o+"galleryTemplate",t=(this.parent.clearTemplate([r]),Qo(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)},w.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]),Qo(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 ui=w;function w(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)}hi=function(e,t){return(hi=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 hi,bi,mi,yi=function(e,t){function o(){this.constructor=e}hi(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},yi=(bi=x.Component,yi(O,bi),(mi=O).prototype.render=function(){this.initialize()},O.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"}},O.prototype.getPersistData=function(){return this.addOnPersist(["activeLayout"])},O.prototype.getModuleName=function(){return"ribbon"},O.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},O.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(),si(this.element,this),this.isKeytipOpen=!1,this.wireEvents(),this.wireKeyboardEvent(),this.currentControlIndex=0},O.prototype.wireEvents=function(){x.EventHandler.add(window,"resize",this.resizeHandler,this),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)},O.prototype.wireKeyboardEvent=function(){this.keyboardModuleRibbon=new x.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},O.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)}},O.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()},O.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()},O.prototype.mouseEventHandler=function(){this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},O.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)}}}},O.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}}},O.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)}},O.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})}},O.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 P.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,P.Toolbar).setProperties({width:"calc(100% - var(--fileMenuWidth) - var(--helpTemplateWidth))"}),this.element.classList[this.isMinimized?"add":"remove"](Bt)},O.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()})},O.prototype.toggleLayout=function(){this.setProperties({activeLayout:"Simplified"===this.activeLayout?"Classic":"Simplified"},!0),this.switchLayout()},O.prototype.tabCreated=function(){this.hideLayoutSwitcher||this.addExpandCollapse(),this.renderInitialTab(this.selectedTab)},O.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("."+Pt)||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+C))?(i.classList.add(ft),this.overflowDDB.element.classList.remove(bt),this.checkOverflowHiddenItems(!1,o)):this.overflowDDB.element.classList.add(bt)),this.trigger("tabSelected",r)},O.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)}},O.prototype.checkOverflow=function(e,t){var o,i=t.closest("."+kt),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 P.HScroll({enableRtl:this.enableRtl},this.tabObj.element.querySelector("."+kt)))):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()},O.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},O.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))}},O.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))}},O.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)}},O.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},O.prototype.updatePopupItems=function(e,t,o,i){var r=this,t=x.getComponent(t.querySelector("#"+e.id),e.type===R.RibbonItemType.DropDown||e.type===R.RibbonItemType.Gallery||e.type===R.RibbonItemType.GroupButton?M.DropDownButton:M.SplitButton),n=t.dropDown,s=(o&&i)===this.enableRtl;n&&(n.setProperties({position:{X:s?"left":"right",Y:i?"top":"bottom"}},!0),i?t.beforeOpen=function(){s&&(e.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"))}:(n.setProperties({offsetX:0},!0),t.beforeOpen=null))},O.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+C))&&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)},O.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+C);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)}}},O.prototype.createOverflowPopup=function(e,t,o,i,r,n,s,a){var l,p,c,d=ei(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+C))?((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")},O.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":"Simplified"===this.activeLayout&&this.ribbonGroupButtonModule.addOverFlowEvents(e,t,o)}},O.prototype.createOfTabContainer=function(e,t,o,i){var r=this.createElement("div",{id:this.tabs[parseInt(i.toString(),10)].id+C,className:_t}),n=(this.overflowDDB.target.append(r),ei(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")},O.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},O.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},O.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)},O.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))},O.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},O.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},O.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},O.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,O=parseInt(w.getAttribute("data-start"),10),k=parseInt(w.getAttribute("data-end"),10);u===R.ItemOrientation.Row?(m=d.collections[0],y=this.checkClassicItem(m.items,O+1,!0),a(0,O,w),a(0,y,w),y!==k&&a(0,k,w)):(T=this.checkClassicCollection(d.collections,O+1,!0),l(O),l(T),T!==k&&l(k)),o&&!i||w.removeAttribute("data-medium-width")}else if(v)return!0}return!1},O.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},O.prototype.handleContentSize=function(e,t){e=e.closest("."+At);t?e.classList.add(Qt):e.classList.remove(Qt)},O.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))},O.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+C+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+C+Oo,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+C+Oo)),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)},O.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},O.prototype.removeDropdown=function(e){var t,e=this.tabObj.element.querySelector("#"+e+C+Oo);e&&(t=e.parentElement,this.ribbonDropDownModule.removeOverFlowDropDown(e),x.remove(t))},O.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},O.prototype.destroyScroll=function(){this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null)},O.prototype.clearOverflowDropDown=function(e){var t,o=this.tabObj.element.querySelector("#"+this.tabs[parseInt(e.toString(),10)].id+A);o&&(t=o.closest("."+kt),"Simplified"===this.activeLayout?this.removeSimplfiedOverflow(o,t,e,!0):this.removeOverflowDropdown(o,t,!0,e))},O.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},O.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("."+Pt))||0===o.tabs[parseInt(r.toString(),10)].groups.length||(t=o.createGroups(o.tabs[parseInt(r.toString(),10)].groups,r),x.append(t,e))})},O.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},O.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)},O.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=new M.DropDownButton({iconCss:rt,cssClass:$t+v+Nt,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.cancel=!0)})}},i);return this.element.classList.add(Ot),si(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},O.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)},O.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")},O.prototype.removeOverflowButton=function(e){var t;e&&(t=e.element,ai(e.target),e.destroy(),t.remove())},O.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)}},O.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},O.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(){t.toggleLayout()},this.collapseButton.onkeydown=function(e){"Enter"===e.key&&t.toggleLayout()},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}))},O.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},O.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 a=this.tabs[parseInt(r.toString(),10)].groups,l=this.tabObj.element,p=this.tabs[parseInt(r.toString(),10)],c=(p.setProperties(i,!0),this.setProperties({groups:this.checkID(p.groups,"group",p.id)},!0),this.validateItemSize(),this.tabObj.items[parseInt(r.toString(),10)].content);if(a&&(i.header&&(this.tabObj.items[parseInt(r.toString(),10)].header.text.innerText=p.header),i.cssClass&&(this.tabObj.items[parseInt(r.toString(),10)].cssClass&&(c.classList.remove(this.tabObj.items[parseInt(r.toString(),10)].cssClass),l.querySelector(".e-active").classList.remove(this.tabObj.items[parseInt(r.toString(),10)].cssClass)),c.classList.add(p.cssClass),l.querySelector(".e-active").classList.add(p.cssClass)),i.groups)){for(var d=0,u=a;d<u.length;d++){for(var h=u[d],b=h.isCollapsed?c.querySelector("#"+h.id+C+Oo):null,m=0,y=h.collections;m<y.length;m++)for(var f=0,g=y[m].items;f<g.length;f++){var v=g[f],S=b?this.ribbonDropDownModule.getDDBItemElement(b,v.id):c.querySelector("#"+v.id);S&&this.destroyFunction(v,S)}b&&this.ribbonDropDownModule.removeOverFlowDropDown(b)}c.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()});l=this.createGroups(p.groups,r);x.append(l,c)}}var I=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+A);this.checkOverflow(this.selectedTab,I)},O.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("."+kt);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();(O=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)];(L=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&&L.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(Ot);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),O=this.createElement("div",{className:jt,id:a.id+q,innerHTML:a.header});w.appendChild(O),"Row"===l&&T.classList.replace(Xt,Vt),T.classList.add(Qt);for(u=0;u<a.collections.length;u++){var k,B=void 0,P=void 0,h=(a.enableGroupOverflow?(k=w.querySelector("#"+a.id+_))&&(P=(B=x.getInstance(k,M.DropDownButton)).target):(B=this.overflowDDB)&&(P=this.overflowDDB.target),a.collections[parseInt(u.toString(),10)]),L=w.querySelector("#"+h.id);"Column"===l&&L.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:P).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))&&P&&(I=P.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&&L.append(I)):(I=this.createItems([y],l,a.id,a.header,a.enableGroupOverflow,t)[0],L.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===P.childElementCount||1===P.childElementCount&&this.isHeaderVisible(P,a.id))&&this.removeOverflowButton(B)}}}this.selectedTab===t&&this.checkOverflow(t,r)}}"Classic"===this.activeLayout&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},O.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),ei(this.tabs,t));e.group.launcherIconKeyTip&&this.addKeyTip(o,e.group.launcherIconKeyTip,r.id,"launcher")},O.prototype.launcherIconClicked=function(e){this.trigger("launcherIconClick",{groupId:e})},O.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(Pt),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},O.prototype.updateGroupProps=function(e,t,o){-1!==t[e].indexOf(o.id)&&("hiddenGroups"===e?o.classList.add("e-hidden"):o.classList.add("e-disabled"))},O.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)}},O.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},O.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)}},O.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&&ri(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},O.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=Qo(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())},O.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)},O.prototype.renderItemTemplate=function(e,t){var o="ribbon"+e.id+"itemTemplate",i=(this.clearTemplate([o]),Qo(e.itemTemplate));x.append(i({activeSize:R.RibbonItemSize[e.activeSize]},this,o,e.id+"itemTemplate",this.isStringTemplate),t),this.renderReactTemplates()},O.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},O.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},O.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("."+Pt))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+C+Oo):null:(l=(a=s.enableGroupOverflow?i.querySelector("#"+s.id+_):null)?x.getComponent(a,M.DropDownButton):this.overflowDDB)&&(li(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++)oi(b.querySelector("#"+h.id+G+y),"btn",e);else if("group-btn"===m&&"Simplified"===this.activeLayout){oi(b,"dropdown-btn",e);for(var f=0;f<h.groupButtonSettings.items.length;f++)oi(document.querySelector("#"+h.id+G+f),"btn",e)}else oi(b,m,e);else x.isNullOrUndefined(e.enableRtl)||b.classList.toggle(at,e.enableRtl)}}}}},O.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))},O.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+C+Oo):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)},O.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&&ti(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")){ti(e,"dropdown-btn"),(l=Array.prototype.slice.call(document.querySelectorAll("#"+o.id+"_galleryPopup"))).concat(Array.prototype.slice.call(document.querySelectorAll("#"+o.id+"-popup")));for(i=0;i<l.length;i++)l[parseInt(i.toString(),10)].remove()}else{var s=e.querySelectorAll(".e-ribbon-gallery-item"),a=e.querySelector("#"+o.id+"_popupButton");a&&a.remove();for(i=0;i<s.length;i++)s[parseInt(i.toString(),10)].remove();for(var l=document.querySelectorAll("#"+o.id+"_galleryPopup"),i=0;i<l.length;i++)l[parseInt(i.toString(),10)].remove()}else"template"!==t&&ti(e,t);o.ribbonTooltipSettings&&-1!==(a=S(this.tooltipData,function(e){return e.id===o.id+j}))&&this.tooltipData.splice(a,1),"GroupButton"===o.type&&this.ribbonGroupButtonModule.destroyDropDown(o)},O.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"}},O.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("."+kt),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)},O.prototype.refreshLayout=function(){this.resizeHandler()},O.prototype.selectTab=function(t){var e=S(this.tabs,function(e){return e.id===t});this.setProperties({selectedTab:e})},O.prototype.showTab=function(e,t){this.showHideTab(e,!1,t=void 0===t?!1:t)},O.prototype.hideTab=function(e,t){this.showHideTab(e,!0,t=void 0===t?!1:t)},O.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)}}},O.prototype.enableTab=function(e){this.enableDisableTab(e,!0)},O.prototype.disableTab=function(e){this.enableDisableTab(e,!1)},O.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))},O.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)},O.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+C+Oo):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)}},O.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()},O.prototype.removeGroup=function(e){var t=ei(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+C))&&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()}},O.prototype.isHeaderVisible=function(e,t){return!!e.querySelector("#"+t+_+q)},O.prototype.hideGroup=function(e){this.showHideGroup(e,!0)},O.prototype.showGroup=function(e){this.showHideGroup(e,!1)},O.prototype.showHideGroup=function(e,t){var o,i,r,n=ei(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+C),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()},O.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)},O.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))},O.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},O.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},O.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)])}},O.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+C),a=0;a<n.length;a++){var l=n[parseInt(a.toString(),10)].closest("#"+this.tabs[parseInt(t.toString(),10)].id+C);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()))}},O.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+C),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+C);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())}},O.prototype.disableGroup=function(e){this.enableDisableGroup(e,!0)},O.prototype.enableGroup=function(e){this.enableDisableGroup(e,!1)},O.prototype.enableDisableGroup=function(e,t){var o,i,r,n=ei(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+C),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")))},O.prototype.addCollection=function(e,t,o,i){var r,n,s=ei(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())},O.prototype.removeCollection=function(e){var t=$o(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()}},O.prototype.addItem=function(e,t,o,i){var r,n,s=$o(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())},O.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()},O.prototype.hideItem=function(e){this.showHideItem(e,!0)},O.prototype.showItem=function(e){this.showHideItem(e,!1)},O.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))},O.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)]))},O.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"))},O.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+C))&&(o=t.querySelector("#"+r+j))&&(e?o.classList.add("e-hide-group"):o.classList.remove("e-hide-group"))},O.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+C+Oo):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)}},O.prototype.updateGroup=function(e){var t=e.id,o=ei(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+C))&&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+C+Oo),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))}},O.prototype.updateCollection=function(e){var t=e.id,o=$o(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)}},O.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),"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&&(r=(this.activeLayout!==R.RibbonLayout.Simplified||n.displayOptions!==R.DisplayMode.Overflow?o:i.target).querySelector("#"+a+j),n.ribbonTooltipSettings&&ri(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),"Simplified"===this.activeLayout&&l.group.enableGroupOverflow&&(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))},O.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())},O.prototype.enableItem=function(e){this.enableDisableItem(e,!1)},O.prototype.disableItem=function(e){this.enableDisableItem(e,!0)},O.prototype.getItem=function(e){return g(this.tabs,e).item},O.prototype.enableDisableItem=function(e,t){var o,i=g(this.tabs,e);if(i&&(i.item.setProperties({disabled:t},!0),o="GroupButton"===i.item.type?I(this,e+G,i):I(this,e,i))){var r=x.closest(o,".e-ribbon-item"),n=this.getItemModuleName(i.item),s=t?!r.classList.contains(st):r.classList.contains(st);if("template"!==n){if(s)if("group-btn"===n&&"Simplified"===this.activeLayout){ii(o,"dropdown-btn",t);for(var a=0;a<i.item.groupButtonSettings.items.length;a++)ii(document.querySelector("#"+e+G+a),"btn",t)}else if("group-btn"===n&&"Classic"===this.activeLayout)for(a=0;a<i.item.groupButtonSettings.items.length;a++)ii(o.querySelector("#"+e+G+a),"btn",t);else ii(o,n,t)}else o.classList.toggle(st,t),o.toggleAttribute("disabled",t);r.classList.toggle(st,i.item.disabled)}},O.prototype.unwireEvents=function(){x.EventHandler.remove(window,"resize",this.resizeHandler),x.EventHandler.remove(document.body,"keydown",this.keytipActionHandler),x.EventHandler.remove(document,"mousedown",this.mouseEventHandler),x.EventHandler.remove(document,"scroll",this.mouseEventHandler)},O.prototype.destroy=function(){this.keyboardModuleRibbon.destroy(),this.keyboardModuleRibbon=null,ai(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),bi.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,Ot,It,Bt,"e-rbn"),this.unwireEvents()},O.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("."+Pt))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+C+Oo),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")],O.prototype,"activeLayout",void 0),T([x.Property("")],O.prototype,"cssClass",void 0),T([x.Property(!1)],O.prototype,"enableKeyTips",void 0),T([x.Property("")],O.prototype,"layoutSwitcherKeyTip",void 0),T([x.Complex({},_e)],O.prototype,"fileMenu",void 0),T([x.Complex({},Ke)],O.prototype,"backStageMenu",void 0),T([x.Property("")],O.prototype,"launcherIconCss",void 0),T([x.Property(!1)],O.prototype,"isMinimized",void 0),T([x.Property("en-us")],O.prototype,"locale",void 0),T([x.Property(0)],O.prototype,"selectedTab",void 0),T([x.Complex({},P.TabAnimationSettings)],O.prototype,"tabAnimation",void 0),T([x.Collection([],h)],O.prototype,"tabs",void 0),T([x.Collection([],Ye)],O.prototype,"contextualTabs",void 0),T([x.Property("100%")],O.prototype,"width",void 0),T([x.Property("")],O.prototype,"helpPaneTemplate",void 0),T([x.Property(!1)],O.prototype,"hideLayoutSwitcher",void 0),T([x.Event()],O.prototype,"tabSelecting",void 0),T([x.Event()],O.prototype,"tabSelected",void 0),T([x.Event()],O.prototype,"ribbonExpanding",void 0),T([x.Event()],O.prototype,"ribbonCollapsing",void 0),T([x.Event()],O.prototype,"launcherIconClick",void 0),T([x.Event()],O.prototype,"created",void 0),T([x.Event()],O.prototype,"overflowPopupOpen",void 0),T([x.Event()],O.prototype,"overflowPopupClose",void 0),mi=T([x.NotifyPropertyChanges],O));function O(e,t){return mi.Inject(Ao,zo,Xo,Zo,Ko,ci),bi.call(this,e,t)||this}k.prototype.getModuleName=function(){return"ribbonFileMenu"},k.prototype.destroy=function(){this.fileMenuDDB&&this.destroyDDB(),this.parent=null},k.prototype.createFileMenu=function(e){var t,o,i=this;e.visible&&(this.ddbElement=this.parent.createElement("button",{id:this.parent.element.id+ko}),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())},k.prototype.addFileMenuTooltip=function(e){ri(e.ribbonTooltipSettings)&&(this.ddbElement.classList.add(io),this.parent.tooltipData.push({id:this.ddbElement.id,data:e.ribbonTooltipSettings}))},k.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}))},k.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)},k.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))},k.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},k.prototype.createRibbonMenu=function(e){var t=this,o=this.parent.createElement("ul",{id:this.parent.element.id+Lo});this.fileMenuDDB.setProperties({target:o}),this.menuctrl=new P.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)},k.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)},k.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))},k.prototype.beforeItemRender=function(e){var t=this.parent.fileMenu.beforeItemRender;t&&(e={element:e.element,item:e.item},t.call(this,e))},k.prototype.menuSelect=function(e){var t,o=this.parent.fileMenu.select;o&&(t={element:e.element,item:e.item,event:e.event},o.call(this,t),e.element.classList.contains("e-menu-caret-icon")||this.fileMenuDDB.toggle())},k.prototype.setCommonProperties=function(e){this.fileMenuDDB&&(this.fileMenuDDB.setProperties(e),this.menuctrl)&&this.menuctrl.setProperties(e)},k.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()},k.prototype.destroyMenu=function(){this.menuctrl&&(this.menuctrl.destroy(),this.menuctrl=null)},k.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},k.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))},k.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)},k.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)},k.prototype.removeItems=function(e,t){this.menuctrl.removeItems(e,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},k.prototype.enableItems=function(e,t){this.menuctrl.enableItems(e,!0,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},k.prototype.disableItems=function(e,t){this.menuctrl.enableItems(e,!1,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},k.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=k;function k(e){this.parent=e}fi=function(e,t){return(fi=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 fi,gi,vi=function(e,t){function o(){this.constructor=e}fi(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},vi=(gi=x.Component,vi(B,gi),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){ri(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+Po,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 P.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:mo,items:this.cloneFooterMenuItem(e.items),select:this.menuSelect.bind(this,e)},i):this.menuCtrl=new P.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}),Qo(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}),Qo(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=gi.call(this)||this;return t.parent=e,t}Ii.prototype.getModuleName=function(){return"ribbonContextualTab"},Ii.prototype.destroy=function(){this.parent=null},Ii.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)}},Ii.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 Si=Ii;function Ii(e){this.parent=e}wi.prototype.getModuleName=function(){return"ribbonKeyTip"},wi.prototype.destroy=function(){this.parent=null},wi.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")}}},wi.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))},wi.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}),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}).show(),this.calculateKeyTipPosition(l,p,o,r),this.parent.isKeytipOpen=!0)},wi.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")},wi.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=ei(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)},wi.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+C+Oo+"-popup")&&document.querySelector("#"+s).closest("#"+e.group.id+C+Oo+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+e.group.id+C+Oo).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);setTimeout(function(){a.focus()},100);break;case"gallery":document.querySelector("#"+s).click();break;case"template":document.querySelector("#"+s).focus();break;case"group-btn":var l=document.querySelector("#"+s);if(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")}}}},wi.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))}},wi.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)},wi.prototype.showKeyTips=function(e){this.parent.enableKeyTips&&(e?this.keytipPress(e,!0):this.createKeytip("tab"))},wi.prototype.hideKeyTips=function(){this.removeKeytip()};var Ci=wi;function wi(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=Oo,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=C,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=Po,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=ko,R.RIBBON_FILE_MENU_LIST=Lo,R.RIBBON_FILE_MENU_WIDTH=Mo,R.RIBBON_FOOTER_MENU_LIST=Do,R.RIBBON_GROUP=Pt,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=Ot,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=Lt,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=yi,R.RibbonBackstage=vi,R.RibbonButton=Ao,R.RibbonButtonSettings=e,R.RibbonCheckBox=zo,R.RibbonCheckBoxSettings=H,R.RibbonCollection=c,R.RibbonColorPicker=$e,R.RibbonColorPickerSettings=U,R.RibbonComboBox=Ko,R.RibbonComboBoxSettings=t,R.RibbonContextualTab=Si,R.RibbonContextualTabSettings=Ye,R.RibbonDropDown=Xo,R.RibbonDropDownSettings=i,R.RibbonFileMenu=T,R.RibbonGallery=ui,R.RibbonGalleryGroup=ye,R.RibbonGalleryItem=ue,R.RibbonGallerySettings=Se,R.RibbonGroup=Le,R.RibbonGroupButton=ci,R.RibbonGroupButtonItem=re,R.RibbonGroupButtonSettings=le,R.RibbonItem=p,R.RibbonKeyTip=Ci,R.RibbonSplitButton=Zo,R.RibbonSplitButtonSettings=n,R.RibbonTab=h,R.RibbonTooltip=a,R.SPACE=v,R.TAB_CONTENT=kt,R.TAB_ID=So,R.VERTICAL_DDB=nt,R.createTooltip=si,R.destroyControl=ti,R.destroyTooltip=ai,R.getCollection=$o,R.getGroup=ei,R.getIndex=S,R.getItem=g,R.getItemElement=I,R.getTemplateFunction=Qo,R.isTooltipPresent=ri,R.setCustomAttributes=pi,R.setToolTipContent=ni,R.updateCommonProperty=oi,R.updateControlDisabled=ii,R.updateTooltipProp=li,Object.defineProperty(R,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-ribbon.umd.min.js.map
|