@syncfusion/ej2-react-ribbon 26.1.40 → 26.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /*!
2
2
  * filename: ej2-react-ribbon.min.js
3
- * version : 26.1.40
3
+ * version : 26.1.41
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&&"object"==typeof module?module.exports=t(require("SyncfusionReactBase"),require("React"),require("SyncfusionBase"),require("SyncfusionNavigations"),require("SyncfusionDropdowns"),require("SyncfusionSplitbuttons"),require("SyncfusionButtons"),require("SyncfusionInputs"),require("SyncfusionPopups")):"function"==typeof define&&define.amd?define(["SyncfusionReactBase","React","SyncfusionBase","SyncfusionNavigations","SyncfusionDropdowns","SyncfusionSplitbuttons","SyncfusionButtons","SyncfusionInputs","SyncfusionPopups"],t):"object"==typeof exports?exports.SyncfusionReactRibbon=t(require("SyncfusionReactBase"),require("React"),require("SyncfusionBase"),require("SyncfusionNavigations"),require("SyncfusionDropdowns"),require("SyncfusionSplitbuttons"),require("SyncfusionButtons"),require("SyncfusionInputs"),require("SyncfusionPopups")):e.SyncfusionReactRibbon=t(e.SyncfusionReactBase,e.React,e.SyncfusionBase,e.SyncfusionNavigations,e.SyncfusionDropdowns,e.SyncfusionSplitbuttons,e.SyncfusionButtons,e.SyncfusionInputs,e.SyncfusionPopups)}(self,((e,t,o,i,r,n,s,a,l)=>(()=>{"use strict";var p={24:e=>{e.exports=t},766:e=>{e.exports=o},741:e=>{e.exports=s},778:e=>{e.exports=r},323:e=>{e.exports=a},215:e=>{e.exports=i},197:e=>{e.exports=l},705:t=>{t.exports=e},295:e=>{e.exports=n}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var o=c[e]={exports:{}};return p[e](o,o.exports,u),o.exports}u.d=(e,t)=>{for(var o in t)u.o(t,o)&&!u.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return(()=>{u.r(d),u.d(d,{BACKSTAGE_CLOSE_ICON:()=>We,BackStageMenu:()=>qe,BackstageBackButton:()=>Le,BackstageItem:()=>xe,COLLAPSE_BUTTON_ID:()=>uo,COLLECTION_ID:()=>po,CONTAINER_ID:()=>go,CONTENT_ID:()=>yo,DISABLED_CSS:()=>Ke,DROPDOWNBUTTON:()=>Gt,DROPDOWNBUTTON_HIDE:()=>Nt,DROPDOWN_ID:()=>So,DisplayMode:()=>r,EXPAND_COLLAPSE_ICON:()=>He,FileMenuSettings:()=>Te,GROUPOF_BUTTON_ID:()=>bo,GROUP_ID:()=>lo,HEADER_ID:()=>fo,HIDE_CSS:()=>et,HORIZONTAL_SCROLLBAR:()=>$e,ITEM_ID:()=>co,ITEM_VERTICAL_CENTER:()=>Ne,Inject:()=>a.Inject,ItemOrientation:()=>o,LAUNCHER_ID:()=>mo,OVERFLOW_ICON:()=>ze,OVERFLOW_ID:()=>vo,OVRLOF_BUTTON_ID:()=>ho,RIBBON_BACKSTAGE:()=>to,RIBBON_BACKSTAGE_CONTENT:()=>$t,RIBBON_BACKSTAGE_ITEMS_WRAPPER:()=>no,RIBBON_BACKSTAGE_MENU:()=>oo,RIBBON_BACKSTAGE_MENU_ID:()=>Co,RIBBON_BACKSTAGE_MENU_WRAPPER:()=>ro,RIBBON_BACKSTAGE_OPEN:()=>Qt,RIBBON_BACKSTAGE_POPUP:()=>Jt,RIBBON_BACKSTAGE_POPUP_ID:()=>wo,RIBBON_BACKSTAGE_TEMPLATE:()=>io,RIBBON_BACKSTAGE_TEXT_MENU:()=>so,RIBBON_COLLAPSE_BUTTON:()=>nt,RIBBON_COLLAPSIBLE:()=>at,RIBBON_COLLECTION:()=>Dt,RIBBON_COLUMN:()=>Mt,RIBBON_CONTENT_HEIGHT:()=>jt,RIBBON_CONTEXTUAL_TAB:()=>ot,RIBBON_CONTROL:()=>Xe,RIBBON_EXPAND_BUTTON:()=>st,RIBBON_FILE_MENU_ID:()=>Io,RIBBON_FILE_MENU_LIST:()=>Oo,RIBBON_FILE_MENU_WIDTH:()=>Eo,RIBBON_FOOTER_MENU_LIST:()=>To,RIBBON_GROUP:()=>bt,RIBBON_GROUP_BUTTON:()=>yt,RIBBON_GROUP_BUTTON_CONTENT:()=>vt,RIBBON_GROUP_BUTTON_ID:()=>Po,RIBBON_GROUP_BUTTON_OVERFLOW_POPUP:()=>gt,RIBBON_GROUP_CONTAINER:()=>St,RIBBON_GROUP_CONTENT:()=>wt,RIBBON_GROUP_HEADER:()=>Ot,RIBBON_GROUP_OF_BUTTON:()=>pt,RIBBON_GROUP_OVERFLOW:()=>Tt,RIBBON_GROUP_OVERFLOW_DDB:()=>Bt,RIBBON_HELP_PANE_TEMPLATE_ID:()=>Bo,RIBBON_HELP_PANE_TEMPLATE_WIDTH:()=>Do,RIBBON_HELP_TEMPLATE:()=>Wt,RIBBON_HOVER:()=>Ve,RIBBON_ITEM:()=>xt,RIBBON_KEYTIP:()=>Je,RIBBON_KEYTIP_ID:()=>Lo,RIBBON_LARGE_ITEM:()=>qt,RIBBON_LAUNCHER:()=>Pt,RIBBON_LAUNCHER_ICON:()=>Et,RIBBON_LAUNCHER_ICON_ELE:()=>Lt,RIBBON_MEDIUM_ITEM:()=>Rt,RIBBON_MENU_LIST:()=>ko,RIBBON_MINIMIZE:()=>ht,RIBBON_MULTIPLE_BUTTON_SELECTION:()=>mt,RIBBON_OF_GROUP_CONTAINER:()=>Ct,RIBBON_OF_TAB_CONTAINER:()=>It,RIBBON_OVERALL_OF_BUTTON:()=>lt,RIBBON_OVERFLOW:()=>ut,RIBBON_OVERFLOW_HEADER:()=>kt,RIBBON_OVERFLOW_TARGET:()=>ct,RIBBON_POPUP_CONTROL:()=>Ye,RIBBON_POPUP_OPEN:()=>Ze,RIBBON_ROW:()=>_t,RIBBON_SELECTED_CONTENT:()=>eo,RIBBON_SIMPLIFIED_MODE:()=>Zt,RIBBON_SINGLE_BUTTON_SELECTION:()=>ft,RIBBON_SMALL_ITEM:()=>At,RIBBON_TAB:()=>tt,RIBBON_TAB_ACTIVE:()=>it,RIBBON_TAB_ITEM:()=>rt,RIBBON_TEMPLATE:()=>Ht,RIBBON_TEXT_CONTAINER:()=>Yt,RIBBON_TOOLTIP:()=>zt,RIBBON_TOOLTIP_CONTAINER:()=>Xt,RIBBON_TOOLTIP_CONTENT:()=>Ut,RIBBON_TOOLTIP_ICON:()=>Vt,RIBBON_TOOLTIP_TARGET:()=>Ft,RIBBON_TOOLTIP_TITLE:()=>Kt,RTL_CSS:()=>Ue,Ribbon:()=>ui,RibbonBackstage:()=>bi,RibbonButton:()=>_o,RibbonButtonSettings:()=>E,RibbonCheckBox:()=>qo,RibbonCheckBoxSettings:()=>_,RibbonCollection:()=>ye,RibbonCollectionDirective:()=>y,RibbonCollectionsDirective:()=>g,RibbonColorPicker:()=>jo,RibbonColorPickerSettings:()=>R,RibbonComboBox:()=>No,RibbonComboBoxSettings:()=>N,RibbonComponent:()=>gi,RibbonContextualTab:()=>fi,RibbonContextualTabDirective:()=>w,RibbonContextualTabSettings:()=>je,RibbonContextualTabsDirective:()=>O,RibbonDropDown:()=>zo,RibbonDropDownSettings:()=>F,RibbonFileMenu:()=>di,RibbonGallery:()=>li,RibbonGalleryGroup:()=>le,RibbonGalleryItem:()=>ne,RibbonGallerySettings:()=>ue,RibbonGroup:()=>Se,RibbonGroupButton:()=>ai,RibbonGroupButtonItem:()=>$,RibbonGroupButtonSelection:()=>s,RibbonGroupButtonSettings:()=>oe,RibbonGroupDirective:()=>b,RibbonGroupsDirective:()=>f,RibbonItem:()=>be,RibbonItemDirective:()=>S,RibbonItemSize:()=>i,RibbonItemType:()=>n,RibbonItemsDirective:()=>I,RibbonKeyTip:()=>mi,RibbonLayout:()=>t,RibbonSplitButton:()=>Ko,RibbonSplitButtonSettings:()=>V,RibbonTab:()=>we,RibbonTabDirective:()=>p,RibbonTabsDirective:()=>c,RibbonTooltip:()=>Z,SPACE:()=>Qe,TAB_CONTENT:()=>dt,TAB_ID:()=>ao,VERTICAL_DDB:()=>Fe,createTooltip:()=>ii,destroyControl:()=>Jo,destroyTooltip:()=>ri,getCollection:()=>Yo,getGroup:()=>Zo,getIndex:()=>Uo,getItem:()=>Xo,getItemElement:()=>ei,getTemplateFunction:()=>Vo,isTooltipPresent:()=>ti,setCustomAttributes:()=>si,setToolTipContent:()=>oi,updateCommonProperty:()=>Qo,updateControlDisabled:()=>$o,updateTooltipProp:()=>ni});var e,t,o,i,r,n,s,a=u(705),l=(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])},e(t,o)},function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.moduleName="ribbonTab",t}(a.ComplexBase),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.propertyName="tabs",t.moduleName="ribbonTabs",t}(a.ComplexBase),h=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])},e(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){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),t.moduleName="ribbonGroup",t}(a.ComplexBase),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),t.propertyName="groups",t.moduleName="ribbonGroups",t}(a.ComplexBase),m=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])},e(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)}}(),y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return m(t,e),t.moduleName="ribbonCollection",t}(a.ComplexBase),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return m(t,e),t.propertyName="collections",t.moduleName="ribbonCollections",t}(a.ComplexBase),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])},e(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)}}(),S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.moduleName="ribbonItem",t}(a.ComplexBase),I=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.propertyName="items",t.moduleName="ribbonItems",t}(a.ComplexBase),C=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])},e(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){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t.moduleName="ribbonContextualTab",t}(a.ComplexBase),O=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t.propertyName="contextualTabs",t.moduleName="ribbonContextualTabs",t}(a.ComplexBase),k=u(24),T=u(766),B=u(215);!function(e){e.Classic="Classic",e.Simplified="Simplified"}(t||(t={})),function(e){e.Row="Row",e.Column="Column"}(o||(o={})),function(e){e[e.Large=4]="Large",e[e.Medium=2]="Medium",e[e.Small=1]="Small"}(i||(i={})),function(e){e[e.Classic=4]="Classic",e[e.Simplified=2]="Simplified",e[e.Overflow=1]="Overflow",e[e.Auto=7]="Auto"}(r||(r={})),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"}(n||(n={})),function(e){e.Single="Single",e.Multiple="Multiple"}(s||(s={}));var P=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])},e(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)}}(),L=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},E=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return P(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},L([(0,T.Property)("")],t.prototype,"content",void 0),L([(0,T.Property)("")],t.prototype,"cssClass",void 0),L([(0,T.Property)("")],t.prototype,"iconCss",void 0),L([(0,T.Property)(!1)],t.prototype,"isToggle",void 0),L([(0,T.Property)(!1)],t.prototype,"isPrimary",void 0),L([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),L([(0,T.Event)()],t.prototype,"created",void 0),L([(0,T.Event)()],t.prototype,"clicked",void 0),t}(T.ChildProperty),D=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])},e(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},_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return D(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},x([(0,T.Property)(!1)],t.prototype,"checked",void 0),x([(0,T.Property)("")],t.prototype,"cssClass",void 0),x([(0,T.Property)("")],t.prototype,"label",void 0),x([(0,T.Property)("After")],t.prototype,"labelPosition",void 0),x([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),x([(0,T.Event)()],t.prototype,"created",void 0),x([(0,T.Event)()],t.prototype,"change",void 0),t}(T.ChildProperty),M=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])},e(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},R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},q([(0,T.Property)(10)],t.prototype,"columns",void 0),q([(0,T.Property)("")],t.prototype,"cssClass",void 0),q([(0,T.Property)("")],t.prototype,"label",void 0),q([(0,T.Property)(!0)],t.prototype,"enableOpacity",void 0),q([(0,T.Property)("Palette")],t.prototype,"mode",void 0),q([(0,T.Property)(!0)],t.prototype,"modeSwitcher",void 0),q([(0,T.Property)(!1)],t.prototype,"noColor",void 0),q([(0,T.Property)(null)],t.prototype,"presetColors",void 0),q([(0,T.Property)(!0)],t.prototype,"showButtons",void 0),q([(0,T.Property)("#008000ff")],t.prototype,"value",void 0),q([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),q([(0,T.Event)()],t.prototype,"beforeClose",void 0),q([(0,T.Event)()],t.prototype,"beforeOpen",void 0),q([(0,T.Event)()],t.prototype,"beforeTileRender",void 0),q([(0,T.Event)()],t.prototype,"created",void 0),q([(0,T.Event)()],t.prototype,"change",void 0),q([(0,T.Event)()],t.prototype,"open",void 0),q([(0,T.Event)()],t.prototype,"select",void 0),t}(T.ChildProperty),A=u(778),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])},e(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},N=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},G([(0,T.Property)(!1)],t.prototype,"allowFiltering",void 0),G([(0,T.Property)(!0)],t.prototype,"autofill",void 0),G([(0,T.Property)("")],t.prototype,"cssClass",void 0),G([(0,T.Property)("")],t.prototype,"label",void 0),G([(0,T.Property)([])],t.prototype,"dataSource",void 0),G([(0,T.Complex)({text:null,value:null,iconCss:null,groupBy:null},A.FieldSettings)],t.prototype,"fields",void 0),G([(0,T.Property)("Contains")],t.prototype,"filterType",void 0),G([(0,T.Property)(null)],t.prototype,"footerTemplate",void 0),G([(0,T.Property)(null)],t.prototype,"groupTemplate",void 0),G([(0,T.Property)(null)],t.prototype,"headerTemplate",void 0),G([(0,T.Property)(null)],t.prototype,"index",void 0),G([(0,T.Property)(null)],t.prototype,"itemTemplate",void 0),G([(0,T.Property)("No records found")],t.prototype,"noRecordsTemplate",void 0),G([(0,T.Property)(null)],t.prototype,"placeholder",void 0),G([(0,T.Property)("300px")],t.prototype,"popupHeight",void 0),G([(0,T.Property)("100%")],t.prototype,"popupWidth",void 0),G([(0,T.Property)(!0)],t.prototype,"showClearButton",void 0),G([(0,T.Property)("None")],t.prototype,"sortOrder",void 0),G([(0,T.Property)(null)],t.prototype,"text",void 0),G([(0,T.Property)(null)],t.prototype,"value",void 0),G([(0,T.Property)("150px")],t.prototype,"width",void 0),G([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),G([(0,T.Event)()],t.prototype,"beforeOpen",void 0),G([(0,T.Event)()],t.prototype,"change",void 0),G([(0,T.Event)()],t.prototype,"close",void 0),G([(0,T.Event)()],t.prototype,"created",void 0),G([(0,T.Event)()],t.prototype,"filtering",void 0),G([(0,T.Event)()],t.prototype,"open",void 0),G([(0,T.Event)()],t.prototype,"select",void 0),t}(T.ChildProperty),H=u(295),W=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])},e(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)}}(),z=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},F=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return W(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},z([(0,T.Property)("")],t.prototype,"closeActionEvents",void 0),z([(0,T.Property)("")],t.prototype,"content",void 0),z([(0,T.Property)("")],t.prototype,"cssClass",void 0),z([(0,T.Property)("")],t.prototype,"iconCss",void 0),z([(0,T.Collection)([],H.Item)],t.prototype,"items",void 0),z([(0,T.Property)("")],t.prototype,"target",void 0),z([(0,T.Property)(!1)],t.prototype,"createPopupOnClick",void 0),z([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),z([(0,T.Event)()],t.prototype,"beforeClose",void 0),z([(0,T.Event)()],t.prototype,"beforeItemRender",void 0),z([(0,T.Event)()],t.prototype,"beforeOpen",void 0),z([(0,T.Event)()],t.prototype,"close",void 0),z([(0,T.Event)()],t.prototype,"created",void 0),z([(0,T.Event)()],t.prototype,"open",void 0),z([(0,T.Event)()],t.prototype,"select",void 0),t}(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])},e(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)}}(),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;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},V=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return K(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},U([(0,T.Property)("")],t.prototype,"closeActionEvents",void 0),U([(0,T.Property)("")],t.prototype,"content",void 0),U([(0,T.Property)("")],t.prototype,"cssClass",void 0),U([(0,T.Property)("")],t.prototype,"iconCss",void 0),U([(0,T.Collection)([],H.Item)],t.prototype,"items",void 0),U([(0,T.Property)("")],t.prototype,"target",void 0),U([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),U([(0,T.Event)()],t.prototype,"beforeClose",void 0),U([(0,T.Event)()],t.prototype,"beforeItemRender",void 0),U([(0,T.Event)()],t.prototype,"beforeOpen",void 0),U([(0,T.Event)()],t.prototype,"close",void 0),U([(0,T.Event)()],t.prototype,"click",void 0),U([(0,T.Event)()],t.prototype,"created",void 0),U([(0,T.Event)()],t.prototype,"open",void 0),U([(0,T.Event)()],t.prototype,"select",void 0),t}(T.ChildProperty),X=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])},e(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)}}(),Y=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 t(){return null!==e&&e.apply(this,arguments)||this}return X(t,e),Y([(0,T.Property)("")],t.prototype,"cssClass",void 0),Y([(0,T.Property)("")],t.prototype,"id",void 0),Y([(0,T.Property)("")],t.prototype,"title",void 0),Y([(0,T.Property)("")],t.prototype,"content",void 0),Y([(0,T.Property)("")],t.prototype,"iconCss",void 0),t}(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])},e(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},$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return J(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Q([(0,T.Property)("")],t.prototype,"content",void 0),Q([(0,T.Property)("")],t.prototype,"iconCss",void 0),Q([(0,T.Property)("")],t.prototype,"keyTip",void 0),Q([(0,T.Complex)({},Z)],t.prototype,"ribbonTooltipSettings",void 0),Q([(0,T.Property)(!1)],t.prototype,"selected",void 0),Q([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),Q([(0,T.Event)()],t.prototype,"beforeClick",void 0),Q([(0,T.Event)()],t.prototype,"click",void 0),t}(T.ChildProperty),ee=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])},e(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)}}(),te=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},oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),te([(0,T.Property)("")],t.prototype,"header",void 0),te([(0,T.Property)("Single")],t.prototype,"selection",void 0),te([(0,T.Collection)([],$)],t.prototype,"items",void 0),t}(T.ChildProperty),ie=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])},e(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)}}(),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;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},ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ie(t,e),re([(0,T.Property)("")],t.prototype,"content",void 0),re([(0,T.Property)("")],t.prototype,"iconCss",void 0),re([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),re([(0,T.Property)("")],t.prototype,"cssClass",void 0),re([(0,T.Property)(!1)],t.prototype,"disabled",void 0),t}(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])},e(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)}}(),ae=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},le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return se(t,e),ae([(0,T.Collection)([],ne)],t.prototype,"items",void 0),ae([(0,T.Property)("")],t.prototype,"header",void 0),ae([(0,T.Property)("auto")],t.prototype,"itemWidth",void 0),ae([(0,T.Property)("auto")],t.prototype,"itemHeight",void 0),ae([(0,T.Property)("")],t.prototype,"cssClass",void 0),t}(T.ChildProperty),pe=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])},e(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)}}(),ce=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},ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return pe(t,e),ce([(0,T.Collection)([],le)],t.prototype,"groups",void 0),ce([(0,T.Property)(3)],t.prototype,"itemCount",void 0),ce([(0,T.Property)(null)],t.prototype,"selectedItemIndex",void 0),ce([(0,T.Property)("auto")],t.prototype,"popupHeight",void 0),ce([(0,T.Property)("auto")],t.prototype,"popupWidth",void 0),ce([(0,T.Property)("")],t.prototype,"template",void 0),ce([(0,T.Property)("")],t.prototype,"popupTemplate",void 0),ce([(0,T.Event)()],t.prototype,"popupOpen",void 0),ce([(0,T.Event)()],t.prototype,"popupClose",void 0),ce([(0,T.Event)()],t.prototype,"itemHover",void 0),ce([(0,T.Event)()],t.prototype,"beforeItemRender",void 0),ce([(0,T.Event)()],t.prototype,"beforeSelect",void 0),ce([(0,T.Event)()],t.prototype,"select",void 0),t}(T.ChildProperty),de=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])},e(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)}}(),he=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},be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return de(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},he([(0,T.Property)("")],t.prototype,"keyTip",void 0),he([(0,T.Property)(i.Medium)],t.prototype,"activeSize",void 0),he([(0,T.Property)(i.Small|i.Medium|i.Large)],t.prototype,"allowedSizes",void 0),he([(0,T.Property)("")],t.prototype,"id",void 0),he([(0,T.Property)("")],t.prototype,"cssClass",void 0),he([(0,T.Property)(!1)],t.prototype,"disabled",void 0),he([(0,T.Property)("")],t.prototype,"itemTemplate",void 0),he([(0,T.Property)("Button")],t.prototype,"type",void 0),he([(0,T.Property)(r.Auto)],t.prototype,"displayOptions",void 0),he([(0,T.Complex)({},Z)],t.prototype,"ribbonTooltipSettings",void 0),he([(0,T.Complex)({},E)],t.prototype,"buttonSettings",void 0),he([(0,T.Complex)({},F)],t.prototype,"dropDownSettings",void 0),he([(0,T.Complex)({},_)],t.prototype,"checkBoxSettings",void 0),he([(0,T.Complex)({},R)],t.prototype,"colorPickerSettings",void 0),he([(0,T.Complex)({},N)],t.prototype,"comboBoxSettings",void 0),he([(0,T.Complex)({},V)],t.prototype,"splitButtonSettings",void 0),he([(0,T.Complex)({},oe)],t.prototype,"groupButtonSettings",void 0),he([(0,T.Complex)({},ue)],t.prototype,"gallerySettings",void 0),t}(T.ChildProperty),fe=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])},e(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},ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fe(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},me([(0,T.Property)("")],t.prototype,"id",void 0),me([(0,T.Property)("")],t.prototype,"cssClass",void 0),me([(0,T.Collection)([],be)],t.prototype,"items",void 0),t}(T.ChildProperty),ge=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])},e(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)}}(),ve=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},Se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ge(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},ve([(0,T.Property)("")],t.prototype,"keyTip",void 0),ve([(0,T.Property)("")],t.prototype,"launcherIconKeyTip",void 0),ve([(0,T.Collection)([],ye)],t.prototype,"collections",void 0),ve([(0,T.Property)("")],t.prototype,"cssClass",void 0),ve([(0,T.Property)("")],t.prototype,"id",void 0),ve([(0,T.Property)(!1)],t.prototype,"isCollapsed",void 0),ve([(0,T.Property)(!0)],t.prototype,"isCollapsible",void 0),ve([(0,T.Property)(!1)],t.prototype,"enableGroupOverflow",void 0),ve([(0,T.Property)("")],t.prototype,"groupIconCss",void 0),ve([(0,T.Property)("")],t.prototype,"header",void 0),ve([(0,T.Property)("Column")],t.prototype,"orientation",void 0),ve([(0,T.Property)("")],t.prototype,"overflowHeader",void 0),ve([(0,T.Property)(0)],t.prototype,"priority",void 0),ve([(0,T.Property)(!1)],t.prototype,"showLauncherIcon",void 0),t}(T.ChildProperty),Ie=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])},e(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)}}(),Ce=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},we=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ie(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Ce([(0,T.Property)("")],t.prototype,"keyTip",void 0),Ce([(0,T.Property)("")],t.prototype,"id",void 0),Ce([(0,T.Property)("")],t.prototype,"cssClass",void 0),Ce([(0,T.Collection)([],Se)],t.prototype,"groups",void 0),Ce([(0,T.Property)("")],t.prototype,"header",void 0),t}(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])},e(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)}}(),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;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 t(){return null!==e&&e.apply(this,arguments)||this}return Oe(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},ke([(0,T.Property)("File")],t.prototype,"text",void 0),ke([(0,T.Property)(!1)],t.prototype,"visible",void 0),ke([(0,T.Collection)([],B.MenuItem)],t.prototype,"menuItems",void 0),ke([(0,T.Property)(!1)],t.prototype,"showItemOnClick",void 0),ke([(0,T.Complex)({},B.MenuAnimationSettings)],t.prototype,"animationSettings",void 0),ke([(0,T.Property)("")],t.prototype,"itemTemplate",void 0),ke([(0,T.Property)("")],t.prototype,"popupTemplate",void 0),ke([(0,T.Complex)({},Z)],t.prototype,"ribbonTooltipSettings",void 0),ke([(0,T.Event)()],t.prototype,"beforeClose",void 0),ke([(0,T.Event)()],t.prototype,"beforeOpen",void 0),ke([(0,T.Event)()],t.prototype,"beforeItemRender",void 0),ke([(0,T.Event)()],t.prototype,"close",void 0),ke([(0,T.Event)()],t.prototype,"open",void 0),ke([(0,T.Event)()],t.prototype,"select",void 0),ke([(0,T.Property)("")],t.prototype,"keyTip",void 0),t}(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])},e(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},Le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Be(t,e),Pe([(0,T.Property)("")],t.prototype,"text",void 0),Pe([(0,T.Property)("")],t.prototype,"iconCss",void 0),Pe([(0,T.Property)(!0)],t.prototype,"visible",void 0),t}(T.ChildProperty),Ee=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])},e(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},xe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ee(t,e),De([(0,T.Property)("")],t.prototype,"text",void 0),De([(0,T.Property)("")],t.prototype,"id",void 0),De([(0,T.Property)("")],t.prototype,"keyTip",void 0),De([(0,T.Property)("")],t.prototype,"content",void 0),De([(0,T.Property)("")],t.prototype,"iconCss",void 0),De([(0,T.Property)(!1)],t.prototype,"separator",void 0),De([(0,T.Property)(!1)],t.prototype,"isFooter",void 0),De([(0,T.Event)()],t.prototype,"backStageItemClick",void 0),t}(T.ChildProperty),_e=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])},e(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},qe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _e(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Me([(0,T.Property)("File")],t.prototype,"text",void 0),Me([(0,T.Property)("")],t.prototype,"keyTip",void 0),Me([(0,T.Property)(!1)],t.prototype,"visible",void 0),Me([(0,T.Property)("auto")],t.prototype,"height",void 0),Me([(0,T.Property)("auto")],t.prototype,"width",void 0),Me([(0,T.Property)(null)],t.prototype,"target",void 0),Me([(0,T.Complex)({},Le)],t.prototype,"backButton",void 0),Me([(0,T.Collection)([],xe)],t.prototype,"items",void 0),Me([(0,T.Property)("")],t.prototype,"template",void 0),Me([(0,T.Complex)({},Z)],t.prototype,"ribbonTooltipSettings",void 0),t}(T.ChildProperty),Re=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])},e(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)}}(),Ae=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},je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Re(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Ae([(0,T.Property)(!1)],t.prototype,"visible",void 0),Ae([(0,T.Property)(!1)],t.prototype,"isSelected",void 0),Ae([(0,T.Collection)([],we)],t.prototype,"tabs",void 0),t}(T.ChildProperty),Ge=u(741),Ne="e-ribbon-vertical-center",He="e-icons e-drop-icon",We="e-icons e-arrow-left",ze="e-icons e-more-horizontal-1",Fe="e-vertical",Ke="e-disabled",Ue="e-rtl",Ve="e-ribbon-hover",Xe="e-ribbon-control",Ye="e-ribbon-popup-control",Ze="e-ribbon-open",Je="e-ribbon-keytip",Qe=" ",$e="e-hscroll-bar",et="e-ribbon-hide",tt="e-ribbon-tab",ot="e-ribbon-contextual-tab",it="e-ribbon-active",rt="e-ribbon-tab-item",nt="e-ribbon-collapse-btn",st="e-ribbon-expand-btn",at="e-ribbon-collapsible",lt="e-ribbon-overall-of-btn",pt="e-ribbon-group-of-btn",ct="e-ribbon-overflow-target",ut="e-ribbon-overflow",dt="e-content",ht="e-ribbon-minimize",bt="e-ribbon-group",ft="e-ribbon-single-selection",mt="e-ribbon-multiple-selection",yt="e-ribbon-group-button",gt="e-ribbon-group-button-overflow-popup",vt="e-ribbon-group-button-content",St="e-ribbon-group-container",It="e-ribbon-of-tab",Ct="e-ribbon-of-group-container",wt="e-ribbon-group-content",Ot="e-ribbon-group-header",kt="e-ribbon-overflow-header",Tt="e-ribbon-group-overflow",Bt="e-ribbon-group-overflow-ddb",Pt="e-ribbon-launcher",Lt="e-ribbon-launcher-icon",Et="e-icons e-launcher",Dt="e-ribbon-collection",xt="e-ribbon-item",_t="e-ribbon-row",Mt="e-ribbon-column",qt="e-ribbon-large-item",Rt="e-ribbon-medium-item",At="e-ribbon-small-item",jt="e-ribbon-content-height",Gt="e-dropdown-btn",Nt="e-caret-hide",Ht="e-ribbon-template",Wt="e-ribbon-help-template",zt="e-ribbon-tooltip",Ft="e-ribbon-tooltip-target",Kt="e-ribbon-tooltip-title",Ut="e-ribbon-tooltip-content",Vt="e-ribbon-tooltip-icon",Xt="e-ribbon-tooltip-container",Yt="e-ribbon-text-container",Zt="e-ribbon-simplified-mode",Jt="e-ribbon-backstage-popup",Qt="e-ribbon-backstage-open",$t="e-ribbon-backstage-content",eo="e-ribbon-selected-content",to="e-ribbon-backstage",oo="e-ribbon-backstage-menu",io="e-ribbon-backstage-template",ro="e-ribbon-backstage-wrapper",no="e-ribbon-backstage-items-wrapper",so="e-blankicon",ao="_tab",lo="_group",po="_collection",co="_item",uo="_collapsebutton",ho="_sim_ovrl_overflow",bo="_sim_grp_overflow",fo="_header",mo="_launcher",yo="_content",go="_container",vo="_overflow",So="_dropdown",Io="_filemenu",Co="_backstage",wo="_backstagepopup",Oo="_filemenulist",ko="_menulist",To="_footermenulist",Bo="_helppanetemplate",Po="_grpbtn",Lo="_keytip",Eo="--fileMenuWidth",Do="--helpTemplateWidth",xo=function(){return xo=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},xo.apply(this,arguments)},_o=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonButton"},e.prototype.destroy=function(){this.parent=null},e.prototype.createButton=function(e,t){var o=this,r=this.parent.createElement("button",{id:e.id});t.appendChild(r);var n=e.buttonSettings;if(new Ge.Button({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===i.Large?"Top":"Left",iconCss:n.iconCss,disabled:e.disabled,cssClass:(Ne+Qe+Xe+Qe+(n.cssClass?n.cssClass:"")).trim(),content:e.activeSize===i.Small?"":n.content,isPrimary:n.isPrimary,isToggle:n.isToggle,created:n.created},r),n.htmlAttributes){var s=xo({},n.htmlAttributes);s.id&&delete s.id,si(r,s)}r.onclick=function(e){n.clicked&&n.clicked.call(o,e)},n.content?r.setAttribute("aria-label",n.content):r.setAttribute("aria-label","button")},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=t.querySelector("#"+e.id);r.setAttribute("data-control",e.type.toString());var n=(0,T.getComponent)(r,Ge.Button);n.setProperties({cssClass:n.cssClass+Qe+Ye}),r.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(i,t),o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this,i=t.querySelector("#"+e.id),r=(0,T.getComponent)(i,Ge.Button),n=r.cssClass.split(Qe);n=n.filter((function(e){return e!==Ye})),r.setProperties({cssClass:n.join(Qe)}),i.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(o,t)}},e.prototype.click=function(e){var t=ei(this.parent,e);t&&(0,T.getComponent)(t,Ge.Button).click()},e.prototype.updateButton=function(e,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.buttonSettings,e);var r=ei(this.parent,t,o);if(r){var n=(0,T.getComponent)(r,Ge.Button);e.isToggle&&r.classList.add("e-active"),e.cssClass&&(e.cssClass=(Ne+Qe+Xe+Qe+e.cssClass).trim()),e.content&&(e.content=o.item.activeSize===i.Small?"":e.content,r.setAttribute("aria-label",e.content)),delete e.clicked,n.setProperties(e)}}},e.prototype.updateButtonSize=function(e,t){(0,T.getComponent)(e,Ge.Button).setProperties({iconPosition:t.activeSize===i.Large?"Top":"Left",content:t.activeSize===i.Small?"":t.buttonSettings.content})},e}(),Mo=function(){return Mo=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},Mo.apply(this,arguments)},qo=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,n={};r.htmlAttributes&&(n=Mo({},r.htmlAttributes)).id&&delete n.id,new Ge.CheckBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,checked:r.checked,cssClass:(Xe+Qe+(r.cssClass?r.cssClass:"")).trim(),label:r.label,labelPosition:r.labelPosition,disabled:e.disabled,created:r.created,htmlAttributes:n,change:function(e){r.change&&r.change.call(o,e)}},i)},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=t.querySelector("#"+e.id);r.setAttribute("data-control",e.type.toString());var n=(0,T.getComponent)(r,Ge.CheckBox);n.cssClass=n.cssClass+Qe+Ye,n.dataBind(),n.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(i,t),o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this,i=t.querySelector("#"+e.id),r=(0,T.getComponent)(i,Ge.CheckBox),n=r.cssClass.split(Qe);n=n.filter((function(e){return e!==Ye})),r.cssClass=n.join(Qe),r.dataBind(),r.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(o,t)}},e.prototype.click=function(e){var t=ei(this.parent,e);t&&(0,T.getComponent)(t,Ge.CheckBox).click()},e.prototype.updateCheckBox=function(e,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.checkBoxSettings,e);var i=ei(this.parent,t,o);if(i)e.cssClass&&(e.cssClass=(Xe+Qe+e.cssClass).trim()),delete e.change,(0,T.getComponent)(i,Ge.CheckBox).setProperties(e)}},e}(),Ro=u(323),Ao=function(){return Ao=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},Ao.apply(this,arguments)},jo=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,t){var o=this,i=this.parent.createElement("input",{id:e.id});t.appendChild(i);var r=e.colorPickerSettings,n=new Ro.ColorPicker({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,columns:r.columns,cssClass:(Xe+Qe+(r.cssClass?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(Ze),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(Ze),r.open&&r.open.call(o)},select:r.select},i);if(r.htmlAttributes){var s=Ao({},r.htmlAttributes);s.id&&delete s.id,si(i,s)}var a=n.element.parentElement;T.EventHandler.add(a,"mouseenter",this.toggleWrapperHover.bind(this,a,!0),this),T.EventHandler.add(a,"mouseleave",this.toggleWrapperHover.bind(this,a,!1),this)},e.prototype.toggleWrapperHover=function(e,t){t?e.classList.add(Ve):e.classList.remove(Ve)},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=e.colorPickerSettings;if(r.label&&"Simplified"===this.parent.activeLayout){var n=this.parent.createElement("div",{className:"e-ribbon-colorpicker-label",id:e.id+"_label",innerHTML:r.label});t.insertBefore(n,t.firstChild)}var s=t.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=(0,T.getComponent)(s,Ro.ColorPicker);a.setProperties({cssClass:a.cssClass+Qe+Ye});var l,p=a.splitBtn;a.beforeClose=function(t){l=t.event?t.event.target:null,a.element.parentElement.classList.remove(Ze),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(i)},p.close=function(){l&&!l.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this;if(e.colorPickerSettings.label){var i=t.querySelector("#"+e.id+"_label");i&&i.remove()}var r=t.querySelector("#"+e.id),n=(0,T.getComponent)(r,Ro.ColorPicker),s=n.cssClass.split(Qe);s=s.filter((function(e){return e!==Ye})),n.setProperties({cssClass:s.join(Qe)}),n.splitBtn.close=null,n.beforeClose=function(){n.element.parentElement.classList.remove(Ze),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(o)}},e.prototype.getColorPickerObj=function(e){var t=ei(this.parent,e);return t?(0,T.getComponent)(t,Ro.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,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.checkBoxSettings,e);var i=ei(this.parent,t,o);if(i)e.cssClass&&(e.cssClass=(Xe+Qe+e.cssClass).trim()),delete e.beforeClose,delete e.open,(0,T.getComponent)(i,Ro.ColorPicker).setProperties(e)}},e.prototype.unwireColorPickerEvents=function(e){var t=(0,T.getComponent)(e,Ro.ColorPicker).element.parentElement;T.EventHandler.remove(t,"mouseenter",this.toggleWrapperHover),T.EventHandler.remove(t,"mouseleave",this.toggleWrapperHover)},e}(),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},Go.apply(this,arguments)},No=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,i=this.parent.createElement("input",{id:e.id});t.appendChild(i);var r=e.comboBoxSettings,n={};r.htmlAttributes&&(n=Go({},r.htmlAttributes)).id&&delete n.id,new A.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:(Xe+Qe+(r.cssClass?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:n,close:function(e){r.close&&r.close.call(o,e)},filtering:r.filtering,change:r.change,select:r.select,created:r.created},i)},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=e.comboBoxSettings;if(r.label&&"Simplified"===this.parent.activeLayout){var n=this.parent.createElement("div",{className:"e-ribbon-combobox-label",id:e.id+"_label",innerHTML:r.label});t.insertBefore(n,t.firstChild)}var s=t.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=(0,T.getComponent)(s,A.ComboBox);a.setProperties({cssClass:a.cssClass+Qe+Ye}),a.close=function(t){var r=t.event?t.event.target:null;e.comboBoxSettings.close&&e.comboBoxSettings.close.call(i,t),r&&!r.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this;if(e.comboBoxSettings.label){var i=t.querySelector("#"+e.id+"_label");i&&i.remove()}var r=t.querySelector("#"+e.id),n=(0,T.getComponent)(r,A.ComboBox),s=n.cssClass.split(Qe);s=s.filter((function(e){return e!==Ye})),n.setProperties({cssClass:s.join(Qe)}),n.close=function(t){e.comboBoxSettings.close&&e.comboBoxSettings.close.call(o,t)}},e.prototype.getComboBoxObj=function(e){var t=ei(this.parent,e);return t?(0,T.getComponent)(t,A.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,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.comboBoxSettings,e);var i=ei(this.parent,t,o);if(i)e.cssClass&&(e.cssClass=(Xe+Qe+e.cssClass).trim()),delete e.close,(0,T.getComponent)(i,A.ComboBox).setProperties(e)}},e}(),Ho=u(197),Wo=function(){return Wo=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},Wo.apply(this,arguments)},zo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonDropDown"},e.prototype.destroy=function(){this.parent=null},e.prototype.createDropDown=function(e,t){var o=this,r=this.parent.createElement("button",{id:e.id});t.appendChild(r);var n=e.dropDownSettings,s=(Ne+Qe+Xe+Qe+(n.cssClass?n.cssClass:"")).trim();if(new H.DropDownButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===i.Large?"Top":"Left",closeActionEvents:n.closeActionEvents,content:e.activeSize===i.Small?"":n.content,cssClass:s+(e.activeSize===i.Large?Qe+Fe:""),disabled:e.disabled,iconCss:n.iconCss,items:n.items,target:n.target,createPopupOnClick:n.createPopupOnClick,beforeClose:function(e){n.beforeClose&&n.beforeClose.call(o,e)},beforeItemRender:n.beforeItemRender,beforeOpen:n.beforeOpen,close:function(e){n.close&&n.close.call(o,e)},created:n.created,open:n.open,select:n.select}).appendTo(r),n.htmlAttributes){var a=Wo({},n.htmlAttributes);a.id&&delete a.id,si(r,a)}},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=t.querySelector("#"+e.id);r.setAttribute("data-control",e.type.toString());var n,s=(0,T.getComponent)(r,H.DropDownButton);s.cssClass=s.cssClass+Qe+Ye,s.dataBind(),s.beforeClose=function(t){e.dropDownSettings.beforeClose&&e.dropDownSettings.beforeClose.call(i,t),n=t.event?t.event.target:null},s.close=function(t){e.dropDownSettings.close&&e.dropDownSettings.close.call(i,t),n&&!n.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this,i=t.querySelector("#"+e.id),r=(0,T.getComponent)(i,H.DropDownButton),n=r.cssClass.split(Qe);n=n.filter((function(e){return e!==Ye})),r.cssClass=n.join(Qe),r.dataBind(),r.close=function(t){e.dropDownSettings.close&&e.dropDownSettings.close.call(o,t)},r.beforeClose=function(t){e.dropDownSettings.beforeClose&&e.dropDownSettings.beforeClose.call(o,t)}},e.prototype.createOverFlowDropDown=function(e,t,o,i,r,n){var s=this;this.enableRtl=n;var a=this.parent.createElement("button",{id:e+vo+So});i.setAttribute("tabindex","0"),r.appendChild(a);var l=new H.DropDownButton({iconCss:o,target:i,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,cssClass:Fe+Qe+Bt,iconPosition:"Top",content:t,beforeClose:function(e){e.cancel=!(0,T.isNullOrUndefined)(e.event&&(0,T.closest)(e.event.target,"."+Ye))}},a);return ii(i,this.parent),a.onclick=a.onkeydown=function(){s.itemIndex=0},i.onkeydown=function(e){s.keyActionHandler(e,i)},l},e.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))},e.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--)},e.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)},e.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()},e.prototype.removeOverFlowDropDown=function(e){var t=(0,T.getComponent)(e,H.DropDownButton);(0,T.getComponent)(t.target,Ho.Tooltip).destroy(),e.parentElement.parentElement.insertBefore(t.target,e.parentElement),t.destroy(),(0,T.remove)(e)},e.prototype.getDDBItemElement=function(e,t){return(0,T.getComponent)(e,H.DropDownButton).dropDown.element.querySelector("#"+t)},e.prototype.getOverflowDropDownPopup=function(e,t){var o=t.querySelector("#"+this.parent.tabs[e.tabIndex].groups[e.groupIndex].id+vo+So);return(0,T.getComponent)(o,H.DropDownButton).dropDown.element},e.prototype.getDropDownObj=function(e){var t=ei(this.parent,e);return t?(0,T.getComponent)(t,H.DropDownButton):null},e.prototype.addItems=function(e,t,o){this.getDropDownObj(e).addItems(t,o)},e.prototype.removeItems=function(e,t,o){this.getDropDownObj(e).removeItems(t,o)},e.prototype.toggle=function(e){this.getDropDownObj(e).toggle()},e.prototype.updateDropDown=function(e,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.dropDownSettings,e);var r=ei(this.parent,t,o);if(r){var n=(0,T.getComponent)(r,H.DropDownButton);e.cssClass&&(e.cssClass=(Xe+Qe+Ne+Qe+e.cssClass).trim(),e.cssClass=o.item.activeSize===i.Large?(Fe+Qe+e.cssClass).trim():e.cssClass,n.cssClass=e.cssClass),delete e.close,delete e.beforeClose,e.content&&(e.content=o.item.activeSize===i.Small?"":e.content),n.setProperties(e)}}},e.prototype.updateDropDownSize=function(e,t){var o=(0,T.getComponent)(e,H.DropDownButton),r=o.cssClass.split(Qe);t.activeSize===i.Large?r.push(Fe):r=r.filter((function(e){return e!==Fe})),o.cssClass=r.join(Qe),o.setProperties({iconPosition:t.activeSize===i.Large?"Top":"Left"}),o.setProperties({content:t.activeSize===i.Small?"":t.dropDownSettings.content})},e}(),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},Fo.apply(this,arguments)},Ko=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonSplitButton"},e.prototype.destroy=function(){this.parent=null},e.prototype.createSplitButton=function(e,t){var o=this,r=this.parent.createElement("button",{id:e.id});t.appendChild(r);var n=e.splitButtonSettings,s=(Ne+Qe+Xe+Qe+(n.cssClass?n.cssClass:"")).trim(),a=new H.SplitButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===i.Large?"Top":"Left",closeActionEvents:n.closeActionEvents,cssClass:s+(e.activeSize===i.Large?Qe+Fe:""),disabled:e.disabled,iconCss:n.iconCss,items:n.items,target:n.target,beforeClose:function(e){n.beforeClose&&n.beforeClose.call(o,e)},beforeItemRender:n.beforeItemRender,beforeOpen:n.beforeOpen,close:function(){a.wrapper.classList.remove(Ze),n.close&&n.close.call(o)},created:n.created,open:function(){a.wrapper.classList.add(Ze),n.open&&n.open.call(o)},select:n.select,click:function(e){n.click&&n.click.call(o,e)}},r);if(n.htmlAttributes){var l=Fo({},n.htmlAttributes);l.id&&delete l.id,si(r,l)}var p=r.parentElement.querySelector(".e-dropdown-btn");p.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),p.click())},this.setContent(e,a);var c=a.wrapper;T.EventHandler.add(c,"mouseenter",(function(){c.classList.add(Ve)}),this),T.EventHandler.add(c,"mouseleave",(function(){c.classList.remove(Ve)}),this)},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=t.querySelector("#"+e.id);r.setAttribute("data-control",e.type.toString());var n=(0,T.getComponent)(r,H.SplitButton);n.cssClass=n.cssClass+Qe+Ye,n.dataBind();var s,a=r.parentElement.querySelector(".e-dropdown-btn"),l=a.getAttribute("id"),p=document.querySelector("#"+l+"-popup");a.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),a.click())},p.onkeydown=function(e){"Enter"===e.key&&(e.preventDefault(),n.wrapper.classList.remove("e-ribbon-open"),p.querySelector(".e-focused").click())},n.beforeClose=function(t){e.splitButtonSettings.beforeClose&&e.splitButtonSettings.beforeClose.call(i,t),s=t.event?t.event.target:null},n.click=function(t){e.splitButtonSettings.click&&e.splitButtonSettings.click.call(i,t),o.element.classList.contains("e-active")&&o.toggle()},n.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(i,t),n.wrapper.classList.remove(Ze),s&&!s.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this,i=t.querySelector("#"+e.id),r=(0,T.getComponent)(i,H.SplitButton),n=r.cssClass.split(Qe);n=n.filter((function(e){return e!==Ye})),r.cssClass=n.join(Qe),r.dataBind(),r.beforeClose=function(t){e.splitButtonSettings.beforeClose&&e.splitButtonSettings.beforeClose.call(o,t)},r.click=function(t){e.splitButtonSettings.click&&e.splitButtonSettings.click.call(o,t)},r.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(o,t),r.wrapper.classList.remove(Ze)}},e.prototype.setContent=function(e,t){t.primaryBtnObj.setProperties({content:e.activeSize===i.Medium?e.splitButtonSettings.content:""}),t.secondaryBtnObj.setProperties({content:e.activeSize===i.Large?e.splitButtonSettings.content:""})},e.prototype.getSplitButtonObj=function(e){var t=ei(this.parent,e);return(0,T.getComponent)(t,H.SplitButton)},e.prototype.addItems=function(e,t,o){this.getSplitButtonObj(e).addItems(t,o)},e.prototype.removeItems=function(e,t,o){this.getSplitButtonObj(e).removeItems(t,o)},e.prototype.toggle=function(e){this.getSplitButtonObj(e).toggle()},e.prototype.updateSplitButton=function(e,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.splitButtonSettings,e);var r=ei(this.parent,t,o);if(r){var n=(0,T.getComponent)(r,H.SplitButton);e.cssClass&&(e.cssClass=(Xe+Qe+Ne+Qe+e.cssClass).trim(),e.cssClass=o.item.activeSize===i.Large?(Fe+Qe+e.cssClass).trim():e.cssClass,n.cssClass=e.cssClass),delete e.open,delete e.click,delete e.close,delete e.beforeClose,n.setProperties(e),e.content&&this.setContent(o.item,n)}}},e.prototype.updateSplitButtonSize=function(e,t){var o=(0,T.getComponent)(e,H.SplitButton),r=o.cssClass.split(Qe);t.activeSize===i.Large?r.push(Fe):r=r.filter((function(e){return e!==Fe})),o.cssClass=r.join(Qe),o.setProperties({iconPosition:t.activeSize===i.Large?"Top":"Left"}),this.setContent(t,o)},e}();function Uo(e,t){for(var o=0;o<e.length;o++)if(t(e[parseInt(o.toString(),10)],o))return o;return-1}function Vo(e){if("string"==typeof e){var t="";try{var o=(0,T.select)(e);t=o?"SCRIPT"===o.tagName?o.innerHTML:o.outerHTML:e}catch(o){t=e}return(0,T.compile)(t)}return(0,T.compile)(e)}function Xo(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 Yo(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 Zo(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 Jo(e,t){(0,T.getComponent)(e,t).destroy()}function Qo(e,t,o){(0,T.getComponent)(e,t).setProperties(o)}function $o(e,t,o){(0,T.getComponent)(e,t).setProperties("combobox"===t?{enabled:!o}:{disabled:o})}function ei(e,o,i){if(!i&&!(i=Xo(e.tabs,o)))return null;var n=e.tabObj.items[i.tabIndex].content;if(""===n.innerHTML)return null;if(e.activeLayout===t.Classic)return i.item.displayOptions&r.Classic?(n=i.group.isCollapsed?e.ribbonDropDownModule.getOverflowDropDownPopup(i,n):n).querySelector("#"+o):null;var s=i.item.displayOptions&r.Simplified?n.querySelector("#"+i.item.id):null;return s||(s=(i.group.enableGroupOverflow?(0,T.getComponent)(n.querySelector("#"+i.group.id+bo),H.DropDownButton):e.overflowDDB).target.querySelector("#"+i.item.id)),s}function ti(e){return!!(e.content||e.iconCss||e.title||e.id||e.cssClass)}function oi(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?Xt+"_"+r.id:Xt});if(t.element.append(n),r.title){var s=t.createElement("div",{innerHTML:r.title,className:Kt});n.appendChild(s)}var a=t.createElement("div",{className:Yt});if(n.appendChild(a),r.iconCss){var l=t.createElement("div",{className:r.iconCss+" "+Vt});a.appendChild(l)}if(r.content){var p=t.createElement("div",{innerHTML:r.content,className:Ut});a.appendChild(p)}t.setProperties({content:n,cssClass:r.cssClass?r.cssClass+" "+zt:zt})}function ii(e,t){var o=new Ho.Tooltip({target:"."+Ft,beforeRender:function(e){oi(e,o,t.tooltipData)}.bind(this),windowCollision:!0});o.appendTo(e)}function ri(e){(0,T.getComponent)(e,Ho.Tooltip).destroy()}function ni(e,t){(0,T.getComponent)(e,Ho.Tooltip).setProperties(t)}function si(e,t){for(var o in t)if("class"===o){var i=t.class.replace(/\s+/g," ").trim();i&&(0,T.addClass)([e],i.split(" "))}else if("style"===o){var r=""+(e.getAttribute("style")||"")+t[""+o];e.setAttribute(""+o,r)}else e.setAttribute(o,t[""+o])}var ai=function(){function e(e){this.parent=e,this.isSelected=!1}return e.prototype.getModuleName=function(){return"ribbonGroupButton"},e.prototype.destroy=function(){this.parent=null},e.prototype.createGroupButton=function(e,t){var o=this,r=e.groupButtonSettings;this.count=0;var n=this.parent.createElement("div",{id:e.id+Po,className:"e-btn-group"});t.appendChild(n);for(var a=0;a<r.items.length;a++)if(r.items[parseInt(a.toString(),10)].iconCss){var l=this.parent.createElement("button",{id:e.id+Po+a,className:yt});n.appendChild(l),new Ge.Button({iconCss:r.items[parseInt(a.toString(),10)].iconCss,disabled:e.disabled,enableRtl:this.parent.enableRtl,content:e.activeSize===i.Small?"":r.items[parseInt(a.toString(),10)].content,iconPosition:e.activeSize===i.Large?"Top":"Left"},l),r.items[parseInt(a.toString(),10)].htmlAttributes&&si(l,r.items[parseInt(a.toString(),10)].htmlAttributes),r.items[parseInt(a.toString(),10)].content?(l.classList.add(vt),l.setAttribute("aria-label",r.items[parseInt(a.toString(),10)].content)):l.setAttribute("aria-label","groupbuttonitem");var p=t.querySelector("#"+e.id+Po+a);r.selection===s.Single?n.classList.add(ft):n.classList.add(mt),r.items[parseInt(a.toString(),10)].selected&&(r.selection===s.Multiple?p.classList.add("e-active"):this.count<1&&(p.classList.add("e-active"),this.count++)),r.items[parseInt(a.toString(),10)].ribbonTooltipSettings&&ti(r.items[parseInt(a.toString(),10)].ribbonTooltipSettings)&&(l.classList.add(Ft),this.parent.tooltipData.push({id:l.id,data:r.items[parseInt(a.toString(),10)].ribbonTooltipSettings})),T.EventHandler.add(p,"click",this.groupButtonClicked.bind(this,a,e,r),this)}if("Simplified"===this.parent.activeLayout){var c=void 0,u=0,d=0;p=this.parent.createElement("button",{id:e.id});t.appendChild(p);for(a=0;a<r.items.length;a++)e.groupButtonSettings.items[parseInt(a.toString(),10)].selected&&!this.isSelected&&r.selection===s.Single?(c=e.groupButtonSettings.items[parseInt(a.toString(),10)].iconCss,this.isSelected=!0):e.groupButtonSettings.items[parseInt(a.toString(),10)].selected&&r.selection===s.Multiple&&(c=1===++u?e.groupButtonSettings.items[parseInt(a.toString(),10)].iconCss:null);for(;d<e.groupButtonSettings.items.length&&!this.isSelected&&!c;)e.groupButtonSettings.items[parseInt(d.toString(),10)].iconCss&&(c=e.groupButtonSettings.items[parseInt(d.toString(),10)].iconCss,this.isSelected=!0),d++;var h=new H.DropDownButton({iconCss:c,target:n,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:e.disabled},p);if(r.header){var b=h.dropDown;this.addGroupButtonHeader(e.id,r,b.element)}p.onclick=p.onkeydown=function(){o.handleFocusState(e,t)},n.onkeydown=function(t){"Simplified"===o.parent.activeLayout&&o.handleGroupButtonNavigation(t,e)},ii(n,this.parent),this.isSelected=!1}},e.prototype.groupButtonClicked=function(e,t,o){for(var i,r,n=[],a=[],l=[],p=0;p<o.items.length;p++)document.querySelector("#"+t.id+Po+p)&&document.querySelector("#"+t.id+Po+p).classList.contains("e-active")&&n.push(o.items[parseInt(p.toString(),10)]);document.querySelector("#"+t.id+Po+e).classList.contains("e-active")||a.push(o.items[parseInt(e.toString(),10)]);var c={cancel:!1,previousItems:n,selectingItems:a};if(o.items[parseInt(e.toString(),10)].beforeClick&&o.items[parseInt(e.toString(),10)].beforeClick.call(this,c),!c.cancel){if(o.selection===s.Single){document.querySelector("#"+t.id+Po).classList.contains(mt)&&(document.querySelector("#"+t.id+Po).classList.remove(mt),document.querySelector("#"+t.id+Po).classList.add(ft));for(p=0;p<o.items.length;p++)document.querySelector("#"+t.id+Po+p)&&document.querySelector("#"+t.id+Po+p).classList.contains("e-active")&&(document.querySelector("#"+t.id+Po+p).classList.remove("e-active"),o.items[parseInt(p.toString(),10)].setProperties({selected:!1},!0));document.querySelector("#"+t.id+Po+e).classList.toggle("e-active"),o.items[parseInt(e.toString(),10)].setProperties({selected:!0},!0),document.querySelector("#"+t.id+Po+e).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&(this.grpBtnIndex=e,i=document.querySelector("#"+t.id),(r=(0,T.getComponent)(i,H.DropDownButton)).setProperties({iconCss:o.items[parseInt(e.toString(),10)].iconCss}))}else{document.querySelector("#"+t.id+Po).classList.contains(ft)&&(document.querySelector("#"+t.id+Po).classList.remove(ft),document.querySelector("#"+t.id+Po).classList.add(mt)),document.querySelector("#"+t.id+Po+e).classList.toggle("e-active"),document.querySelector("#"+t.id+Po+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 u=0,d=0;d<o.items.length;d++)document.querySelector("#"+t.id+Po+d)&&document.querySelector("#"+t.id+Po+d).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&d!==e&&(this.isSelected=!0,u++);if("Simplified"===this.parent.activeLayout){var h=null,b=0;if(i=document.querySelector("#"+t.id),r=(0,T.getComponent)(i,H.DropDownButton),this.isSelected){if(1===u&&!document.querySelector("#"+t.id+Po+e).classList.contains("e-active"))for(d=0;d<o.items.length;d++)document.querySelector("#"+t.id+Po+d)&&document.querySelector("#"+t.id+Po+d).classList.contains("e-active")&&(h=o.items[parseInt(d.toString(),10)].iconCss)}else document.querySelector("#"+t.id+Po+e).classList.contains("e-active")&&(h=o.items[parseInt(e.toString(),10)].iconCss);for(;b<o.items.length&&!h;)o.items[parseInt(b.toString(),10)].iconCss&&(h=o.items[parseInt(b.toString(),10)].iconCss),b++;r.setProperties({iconCss:h}),this.grpBtnIndex=e}this.isSelected=!1}document.querySelector("#"+t.id+Po+e).classList.contains("e-active")&&l.push(o.items[parseInt(e.toString(),10)]);var f={previousItems:n,selectedItems:l};o.items[parseInt(e.toString(),10)].click&&o.items[parseInt(e.toString(),10)].click.call(this,f)}},e.prototype.switchGroupButton=function(e,t){var o=this,i=e.groupButtonSettings,r=null,n=0,a=0;if("Simplified"===this.parent.activeLayout){var l=t.querySelector("#"+e.id+Po),p=this.parent.createElement("button",{id:e.id});t.appendChild(p);for(var c=0;c<i.items.length;c++)document.querySelector("#"+e.id+Po+c)&&(document.querySelector("#"+e.id+Po+c).classList.contains("e-active")&&i.selection===s.Single?r=i.items[parseInt(c.toString(),10)].iconCss:document.querySelector("#"+e.id+Po+c).classList.contains("e-active")&&i.selection===s.Multiple&&(1===++n?r=i.items[parseInt(c.toString(),10)].iconCss:n>1&&(r=null)));for(;a<i.items.length&&!r;)i.items[parseInt(a.toString(),10)].iconCss&&(r=i.items[parseInt(a.toString(),10)].iconCss),a++;var u=new H.DropDownButton({iconCss:r,target:l,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:e.disabled},p);if(i.header){var d=u.dropDown;this.addGroupButtonHeader(e.id,i,d.element)}p.onclick=p.onkeydown=function(){o.handleFocusState(e,t)},l.onkeydown=function(t){"Simplified"===o.parent.activeLayout&&o.handleGroupButtonNavigation(t,e)},ii(l,this.parent)}else{var h=t.querySelector("#"+e.id);u=(0,T.getComponent)(h,H.DropDownButton);t.appendChild(u.target),h&&(u.destroy(),(0,T.remove)(h))}},e.prototype.handleFocusState=function(e,t){if(t.querySelector("#"+e.id).classList.contains("e-active")){var o=document.querySelector("#"+e.id+"_grpbtn").querySelector("."+yt+".e-active");o?o.focus():document.querySelector("#"+e.id+Po+0).focus(),this.grpBtnIndex=0}},e.prototype.addGroupButtonHeader=function(e,t,o){var i=this.parent.createElement("div",{className:"e-ribbon-groupbutton-header",id:e+fo,innerHTML:t.header});o.insertBefore(i,o.firstChild)},e.prototype.handleGroupButtonNavigation=function(e,t){var o=document.querySelector("#"+t.id),i=(0,T.getComponent)(o,H.DropDownButton).target,r=!1;"Simplified"===this.parent.activeLayout&&i.closest(".e-ribbon-dropdown-group-button").classList.contains(gt)&&(r=!0),"Tab"===e.key&&e.preventDefault();var n=t.groupButtonSettings;"ArrowRight"===e.key&&!r||"ArrowDown"===e.key&&r?!this.parent.enableRtl||"ArrowDown"===e.key&&r?(this.grpBtnIndex++,this.grpBtnIndex<n.items.length||(this.grpBtnIndex=0),document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()):0===this.grpBtnIndex?(this.grpBtnIndex=n.items.length-1,document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()):("ArrowLeft"===e.key&&!r||"ArrowUp"===e.key&&r)&&(!this.parent.enableRtl||"ArrowUp"===e.key&&r?0===this.grpBtnIndex?(this.grpBtnIndex=n.items.length-1,document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()):(this.grpBtnIndex++,this.grpBtnIndex<n.items.length||(this.grpBtnIndex=0),document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()))},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=e.groupButtonSettings,n=!0,s=t.querySelector("#"+e.id),a=(0,T.getComponent)(s,H.DropDownButton);a.setProperties({cssClass:a.cssClass+Qe+gt,content:r.header?r.header:""});var l=a.target;if(l.children.length){for(var p=0;p<l.children.length;p++)if(r.items[parseInt(p.toString(),10)].content){n=!1;break}n&&l.classList.add("e-icon-btn")}l.onclick=function(){"Simplified"===i.parent.activeLayout&&l.closest(".e-ribbon-dropdown-group-button").classList.contains(gt)&&(a.toggle(),o.element.classList.contains("e-active")&&o.toggle())}},e.prototype.removeOverFlowEvents=function(e,t){var o=t.querySelector("#"+e.id);if(o){var i=(0,T.getComponent)(o,H.DropDownButton),r=i.target;r.classList.contains("e-icon-btn")&&r.classList.remove("e-icon-btn");var n=i.cssClass.split(Qe);n=n.filter((function(e){return e!==gt})),i.setProperties({cssClass:n.join(Qe),content:""})}},e.prototype.destroyDropDown=function(e){var t=document.querySelector("#"+e.id);if(t){var o=(0,T.getComponent)(t,H.DropDownButton);(0,T.getComponent)(o.target,Ho.Tooltip).destroy(),o.destroy(),(0,T.remove)(t)}},e.prototype.updateGroupButtonSize=function(e,t){for(var o,r=t.groupButtonSettings,n=0;n<r.items.length;n++){if(o="Classic"===this.parent.activeLayout?e.querySelector("#"+t.id+Po+n):document.querySelector("#"+t.id+Po+n))(0,T.getComponent)(o,Ge.Button).setProperties({iconPosition:t.activeSize===i.Large?"Top":"Left",content:t.activeSize===i.Small?"":r.items[parseInt(n.toString(),10)].content})}},e}(),li=function(){function e(e){this.count=0,this.isAdded=!1,this.galleryItemsIndex=0,this.registeredTemplate={},this.parent=e;var t="viewContainerRef";(0,T.setValue)("registeredTemplate",this.registeredTemplate,this),(0,T.setValue)(t,this.parent[""+t],this)}return e.prototype.getModuleName=function(){return"ribbonGallery"},e.prototype.destroy=function(){this.parent=null},e.prototype.createGallery=function(e,t){var o=this,i=e.gallerySettings;this.renderGalleryItems(i,!1,e.id,t);var r=this.parent.createElement("button",{id:e.id+"_popupButton",className:"e-ribbon-gallery-button e-icons e-drop-icon"});r.setAttribute("aria-label","gallerydropdownbutton"),t.appendChild(r),this.createPopup(e,r),r.onclick=function(t){var r=document.querySelector("#"+e.id+"_galleryPopup");if(r){var n=(0,T.getComponent)(r,Ho.Popup);r.classList.contains("e-popup-close")?o.showPopup(n,r,t,i,e.id):o.hidePopup(n,r,t,i,e.id)}},document.onclick=function(e){for(var t,i,r=document.querySelectorAll(".e-ribbon-gallery-popup.e-popup-open"),n=0;n<r.length;n++){var s=(0,T.getComponent)(r[parseInt(n.toString(),10)],Ho.Popup);if(!e.target.classList.contains("e-ribbon-gallery-button")){t=r[parseInt(n.toString(),10)].id.replace(/_galleryPopup/g,""),i=Xo(o.parent.tabs,t),o.hidePopup(s,r[parseInt(n.toString(),10)],e,i.item.gallerySettings,t);break}if(t=r[parseInt(n.toString(),10)].id.replace(/_galleryPopup/g,""),e.target.id.replace(/_popupButton/g,"")!==t){i=Xo(o.parent.tabs,t),o.hidePopup(s,r[parseInt(n.toString(),10)],e,i.item.gallerySettings,t);break}}}},e.prototype.renderGalleryItems=function(e,t,o,i){var r,n,s=this,a=Xo(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=c.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 u=function(i){n=c.parent.createElement("li",{className:"e-ribbon-gallery-item",id:(t?"popup_":"")+r.id+"_gallery"+i,attrs:{tabindex:"0"}});var u={name:"beforeItemRender",item:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]};if(e.beforeItemRender&&e.beforeItemRender.call(c,u),r.appendChild(n),e.selectedItemIndex&&e.selectedItemIndex===c.count?n.classList.add("e-ribbon-gallery-selected"):e.selectedItemIndex||0!==c.count||(n.classList.add("e-ribbon-gallery-selected"),e.selectedItemIndex=c.count),c.count=c.count+1,n.onclick=function(i){s.setActiveState(i.currentTarget,e,o,!0,i,t)},n.onkeydown=function(i){"Enter"!==i.key&&" "!==i.key||s.setActiveState(i.currentTarget,e,o,!0,i,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"===c.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&&si(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=c.parent.createElement("span",{className:"e-ribbon-gallery-icons "+e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].iconCss});n.appendChild(d),"Simplified"!==c.parent.activeLayout||t||d.classList.add("e-hidden")}e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].content&&n.appendChild(c.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&&c.createGalleryTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),e.popupTemplate&&t&&c.createGalleryPopupTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),!t&&!p&&e.itemCount===c.count)return l.appendChild(r),c.isAdded=!0,"break"},d=0;d<e.groups[parseInt(a.toString(),10)].items.length;d++){if("break"===u(d))break}if(c.isAdded&&!t)return"break";if(t?i.appendChild(r):l.appendChild(r),t&&e.groups[parseInt(a.toString(),10)].header){var h=c.parent.createElement("div",{className:"e-ribbon-gallery-header",innerHTML:e.groups[parseInt(a.toString(),10)].header});i.insertBefore(h,r)}},c=this,u=0;u<e.groups.length;u++){if("break"===p(u))break}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)},e.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(!(e>=r)){s=!0;break}var p=t.querySelector("#"+i+"_galleryContainer"+a+"_gallery"+l);if(p){n+=p.offsetWidth;var c=window.getComputedStyle(p);if(c){var u=parseFloat(c.paddingLeft)+parseFloat(c.paddingRight);(0,T.isNullOrUndefined)(u)||(n+=u);var d=parseFloat(c.marginLeft)+parseFloat(c.marginRight);(0,T.isNullOrUndefined)(d)||(n+=d)}}r++}if(s)break}n>0&&(t.style.width=n+"px")},e.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=Xo(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 u=0;u<p.item.gallerySettings.groups[parseInt(c.toString(),10)].items.length;u++){var d=s.querySelector("#"+a+"_galleryContainer"+c+"_gallery"+u);if(d)if("Classic"===this.parent.activeLayout)if(d.classList.contains("e-hidden")&&d.classList.remove("e-hidden"),n)d.remove();else{var h=0,b=window.getComputedStyle(d);if(b){var f=parseFloat(b.marginTop)+parseFloat(b.marginBottom);(0,T.isNullOrUndefined)(f)||(h+=f)}i++,p.item.gallerySettings.itemCount===i?(i=0,l>=d.offsetHeight+h?l-=d.offsetHeight+h:(n=!0,d.remove())):l<d.offsetHeight+h&&(n=!0,d.remove())}else++r>p.item.gallerySettings.itemCount&&d.classList.add("e-hidden")}}}},e.prototype.checkCollision=function(e,t,o){void 0===o&&(o=0);var i=0,r=0;if(t){var n=window.innerWidth,s=0===o?n:Math.abs(n-(n-o)),a=window.getComputedStyle(t);a&&(i=parseFloat(a.paddingLeft)+parseFloat(a.paddingRight),(0,T.isNullOrUndefined)(i)||(s-=i));var l=t.querySelectorAll(".e-ribbon-gallery-container");"auto"!==e.width&&l.forEach((function(e){e.style.flexFlow="wrap"}));for(var p=!1,c=0;c<l.length;c++){for(var u=0,d=0;d<l[parseInt(c.toString(),10)].querySelectorAll(".e-ribbon-gallery-item").length;d++){var h=window.getComputedStyle(l[parseInt(c.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(d.toString(),10)]);if(h&&(r=parseFloat(h.marginLeft)+parseFloat(h.marginRight),(0,T.isNullOrUndefined)(r)||(u+=r)),s<=(u+=Math.round(parseFloat(h.width)))&&"auto"===e.width||"auto"!==e.width&&s<=parseInt(e.width.toString(),10)&&s<=u){t.style.width=u+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)))}},e.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"},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 Ho.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+go),i=Xo(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");var l=this.parent.tabObj.element.querySelector("#"+this.parent.tabs[this.parent.selectedTab].id+yo);l&&this.checkAvailableHeight(l)}},e.prototype.addOverFlowEvents=function(e,t){var o=this;if(t.closest(".e-ribbon-overflow-target")){var i=this.parent.createElement("button",{id:e.id});t.appendChild(i),t.querySelector(".e-ribbon-gallery-wrapper").classList.add("e-hidden"),t.querySelectorAll(".e-ribbon-gallery-container").forEach((function(e){e.classList.add("e-hidden")}));var r=t.querySelector("#"+e.id+"_popupButton");r&&r.classList.add("e-hidden");var n=Xo(this.parent.tabs,e.id),s=n&&n.group.groupIconCss?n.group.groupIconCss:"",a=n&&n.group.header?n.group.header:"";if(!s)for(var l=0;l<e.gallerySettings.groups.length;l++){for(var p=0;p<e.gallerySettings.groups[parseInt(l.toString(),10)].items.length;p++)if(e.gallerySettings.groups[parseInt(l.toString(),10)].items[parseInt(p.toString(),10)].iconCss){s=e.gallerySettings.groups[parseInt(l.toString(),10)].items[parseInt(p.toString(),10)].iconCss;break}if(s)break}var c=document.querySelector("#"+e.id+"_galleryPopup"),u=(0,T.getComponent)(c,Ho.Popup),d=document.querySelector("#"+e.id+"_galleryPopup .e-ribbon-popup-container"),h=new H.DropDownButton({iconCss:s,content:a,target:d,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-gallery-dropdown",disabled:e.disabled,open:function(){o.setFoucsToFirstItem(d,!0,e.id)},beforeClose:function(t){o.popupEvents(t.event,e.gallerySettings,"popupClose",!1)&&(t.cancel=!0)}},i);"auto"!==u.width&&(h.dropDown.width=(0,T.formatUnit)(u.width)),"auto"!==u.height&&(h.dropDown.height=(0,T.formatUnit)(u.height),h.dropDown.element.style.height=u.height.toString())}},e.prototype.removeOverFlowEvents=function(e,t){var o=t.querySelector("#"+e.id+"_popupButton");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")}));var i=document.querySelector("#"+e.id);if(i){var r=document.querySelector("#"+e.id+"_galleryPopup"),n=(0,T.getComponent)(i,H.DropDownButton);r.appendChild(n.target),n.destroy(),(0,T.remove)(i)}},e.prototype.setActiveState=function(e,t,o,i,r,n){var s,a,l=document.querySelector("#"+o+go),p=Array.prototype.slice.call(l.querySelectorAll(".e-ribbon-gallery-selected")),c=document.querySelector("#"+o+"_popupContainer"),u=Array.prototype.slice.call(c.querySelectorAll(".e-ribbon-gallery-selected"));u.length&&(p=p.concat(u));for(var d=0;d<t.groups.length;d++)for(var h=0;h<t.groups[parseInt(d.toString(),10)].items.length;h++)p[0].id===o+"_galleryContainer"+d+"_gallery"+h&&(s=t.groups[parseInt(d.toString(),10)].items[parseInt(h.toString(),10)]),e.id===(n?"popup_":"")+o+"_galleryContainer"+d+"_gallery"+h&&(a=t.groups[parseInt(d.toString(),10)].items[parseInt(h.toString(),10)]);var b,f=document.getElementById(e.id),m={cancel:!1,name:"beforeSelect",previousItem:s,currentItem:a,isInteracted:i,event:r};if(t.beforeSelect&&t.beforeSelect.call(this,m),!m.cancel){for(d=0;d<p.length;d++)p[parseInt(d.toString(),10)].classList.remove("e-ribbon-gallery-selected");f.id.startsWith("popup_")?document.getElementById(f.id.slice(6))&&(b=document.getElementById(f.id.slice(6))):b=document.getElementById("popup_"+e.id),b&&b.classList.add("e-ribbon-gallery-selected"),f.classList.add("e-ribbon-gallery-selected");var y={previousItem:s,currentItem:a,name:"select",isInteracted:i,event:r},g=document.querySelectorAll("#"+o+"_popupContainer .e-ribbon-gallery-item");for(d=0;d<g.length;d++)if(g[parseInt(d.toString(),10)].id===e.id){t.selectedItemIndex=d;break}t.select&&t.select.call(this,y)}},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();t.offsetWidth>s.left&&this.checkCollision(e,t,s.left);var 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){this.popupEvents(o,i,"popupClose",!1)||(e.hide(),document.querySelector("#"+r+"_popupButton").classList.remove("e-gallery-button-active"))},e.prototype.showGalleryPopup=function(e){var t=Xo(this.parent.tabs,e),o=document.querySelector("#"+e+"_galleryPopup"),i=(0,T.getComponent)(o,Ho.Popup);this.showPopup(i,o,null,t.item.gallerySettings,e)},e.prototype.hideGalleryPopup=function(e){var t=Xo(this.parent.tabs,e),o=document.querySelector("#"+e+"_galleryPopup"),i=(0,T.getComponent)(o,Ho.Popup);this.hidePopup(i,o,null,t.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||"Escape"===e.key&&!o)&&this.hidePopup(r,t,e,n,i))},e.prototype.createGalleryTemplate=function(e,t,o,i){e.classList.add("e-ribbon-gallery-template");var r="ribbon"+o+"galleryTemplate";this.parent.clearTemplate([r]);var n=Vo(t.template);i.disabled&&e.classList.add("e-disabled"),i.cssClass&&e.classList.add(i.cssClass),(0,T.append)(n({items:i},this,r,o+"galleryTemplate",this.parent.isStringTemplate,null,null,this.parent),e)},e.prototype.createGalleryPopupTemplate=function(e,t,o,i){e.classList.add("e-ribbon-gallery-popup-template");var r="ribbon"+o+"galleryPopupTemplate";this.parent.clearTemplate([r]);var n=Vo(t.popupTemplate);i.disabled&&e.classList.add("e-disabled"),i.cssClass&&e.classList.add(i.cssClass),(0,T.append)(n({items:i},this,r,o+"galleryPopupTemplate",this.parent.isStringTemplate,null,null,this.parent),e)},e}(),pi=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])},e(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)}}(),ci=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},ui=function(e){function s(t,o){return a.Inject(_o,qo,zo,Ko,No,ai),e.call(this,t,o)||this}var a;return pi(s,e),a=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 e=[];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"});var t=Xo(this.tabs,null,n.ColorPicker),o=Xo(this.tabs,null,n.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},s.prototype.initialize=function(){this.element.id=this.element.id||(0,T.getUniqueID)("e-"+this.getModuleName()),(0,T.addClass)([this.element],["e-rbn"].concat(this.cssClass?this.cssClass.split(Qe):[])),this.enableRtl&&this.element.classList.add(Ue),this.element.style.width=(0,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(),ii(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+yo),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("."+St);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("."+St),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()}(e.target.classList.contains("e-ribbon-last-item")&&(t?(i=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+St)).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("."+St)).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+yo);if(this.checkOverflow(this.selectedTab,e),this.scrollModule){var t=this.tabObj.element.querySelector("."+$e);this.scrollModule.scrollStep=t.offsetWidth}if("Simplified"===this.activeLayout){var o=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(o.length)for(var i=0;i<o.length;i++){(0,T.getInstance)(o[parseInt(i.toString(),10)],H.DropDownButton).toggle()}}var r=document.querySelector(".e-ribbon-gallery-popup.e-popup-open");r&&(0,T.getComponent)(r,Ho.Popup).hide();this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},s.prototype.mouseEventHandler=function(){this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},s.prototype.keytipActionHandler=function(e){if(this.enableKeyTips){var t=!1,o=e.key;if(e.altKey&&"Meta"===e.key){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 r=0;r<i.length;r++){(0,T.getInstance)(i[parseInt(r.toString(),10)],H.DropDownButton).toggle()}this.ribbonKeyTipModule.removeKeytip()}else if(this.isKeytipOpen)this.ribbonKeyTipModule.removeKeytip();else{var n=document.querySelector(".e-ribbon-backstage-popup");n&&n.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(r=0;r<s.length;r++){if(s[parseInt(r.toString(),10)].innerHTML.toLowerCase()===o){t=!0,this.ribbonKeyTipModule.keytipPress(o);break}}t||this.checkKeyTipPresent(o,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 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&&(0,T.remove)(i)}},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[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})}},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+ao});this.element.appendChild(e),this.validateItemSize();var t=this.createTabItems(this.tabs);this.tabObj=new B.Tab({cssClass:tt,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(Eo,"0px"),this.element.style.setProperty(Do,"0px");var o=e.querySelector(".e-toolbar");(0,T.getComponent)(o,B.Toolbar).setProperties({width:"calc(100% - var(--fileMenuWidth) - var(--helpTemplateWidth))"}),this.element.classList[this.isMinimized?"add":"remove"](ht)},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(ht,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=Uo(this.tabs,(function(e){return e.id===t}));o=-1===o?this.selectedTab:o;var i=this.tabObj.items[parseInt(o.toString(),10)].content;if(!i.querySelector("."+bt)&&0!==this.tabs[parseInt(o.toString(),10)].groups.length){var r=this.createGroups(this.tabs[parseInt(o.toString(),10)].groups,o);(0,T.append)(r,i)}var n=this.isContextualTab(t);this.updateSelectedState(t);var s={previousIndex:this.selectedTab,selectedIndex:o,isContextual:n};if(this.setProperties({selectedTab:o},!0),this.calculateHiddenElementsWidth(o),this.isUpdateItems){for(var a=0;a<this.itemsModel.length;a++){var l=this.itemsModel[parseInt(a.toString(),10)];this.selectedTab===this.targetTabs[l.id]&&(this.updateItem(l),this.itemsModel.splice(a,1),a--)}0===this.itemsModel.length&&(this.isUpdateItems=!1)}if(this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(e.selectedContent.firstChild),this.checkOverflow(o,i),"Simplified"===this.activeLayout&&this.overflowDDB){var p=this.overflowDDB.target,c=p.querySelector("."+it);c&&c.classList.remove(it);var u=p.querySelector("#"+t+vo);u?(u.classList.add(it),this.overflowDDB.element.classList.remove(et),this.checkOverflowHiddenItems(!1,o)):this.overflowDDB.element.classList.add(et)}this.trigger("tabSelected",s)},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 o=t.closest("."+dt),i=o.offsetWidth<t.offsetWidth;if(i&&!this.scrollModule){if("Classic"===this.activeLayout){var r=!1;!(r=this.checkGroupShrinking(e,o,t,!0))&&o.offsetWidth<t.offsetWidth&&(r=this.checkGroupShrinking(e,o,t,!1)),o.offsetWidth<t.offsetWidth&&this.createOverflowDropdown(e,o,t)}else this.checkSimplifiedItemShrinking(e,o,t),o.offsetWidth<t.offsetWidth&&this.createSimplfiedOverflow(o,t,e);o.offsetWidth<t.offsetWidth&&!this.scrollModule&&(this.scrollModule=new B.HScroll({enableRtl:this.enableRtl},this.tabObj.element.querySelector("."+dt)))}else if(!i)if(this.destroyScroll(),"Classic"===this.activeLayout){r=!1;!(r=this.removeOverflowDropdown(o,t,!1,e))&&o.offsetWidth>t.offsetWidth&&(r=this.checkGroupExpanding(e,o,t,!0)),!r&&o.offsetWidth>t.offsetWidth&&(r=this.checkGroupExpanding(e,o,t,!1))}else this.removeSimplfiedOverflow(o,t,e),o.offsetWidth>t.offsetWidth&&this.checkSimplifiedItemExpanding(e,o,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(e,t,o){for(var n=this.tabs[parseInt(e.toString(),10)],s=n.groups.length-1;s>=0;s--)for(var a=n.groups[parseInt(s.toString(),10)],l=t.querySelector("#"+a.id+go),p=0;p<a.collections.length&&t.offsetWidth<o.offsetWidth;p++)for(var c=a.collections[parseInt(p.toString(),10)],u=c.items.length;u>=1&&t.offsetWidth<o.offsetWidth;u--){var d=c.items[u-1];if(d.allowedSizes&i.Small&&d.allowedSizes&i.Medium&&d.activeSize===i.Medium&&d.displayOptions&r.Simplified){var h=l.querySelector("#"+d.id+go);if(h){var b=h.querySelector("#"+d.id);h.setAttribute("data-medium-width",o.offsetWidth.toString()),d.setProperties({activeSize:i.Small},!0),this.setItemSize(b,d)}}}},s.prototype.checkSimplifiedItemExpanding=function(e,t,o){for(var n=this.tabs[parseInt(e.toString(),10)],s=n.groups.length-1;s>=0;s--)for(var a=n.groups[parseInt(s.toString(),10)],l=t.querySelector("#"+a.id+go),p=0;p<a.collections.length&&t.offsetWidth>o.offsetWidth;p++)for(var c=a.collections[parseInt(p.toString(),10)],u=c.items.length;u>=1&&t.offsetWidth>o.offsetWidth;u--){var d=c.items[u-1];if(d.allowedSizes&i.Small&&d.allowedSizes&i.Medium&&d.activeSize===i.Small&&d.displayOptions&r.Simplified){var h=l.querySelector("#"+d.id+go);if(h){var b=h.getAttribute("data-medium-width"),f=b?parseInt(b,10):null;if(f&&t.offsetWidth>f){h.removeAttribute("data-medium-width");var m=h.querySelector("#"+d.id);d.setProperties({activeSize:i.Medium},!0),this.setItemSize(m,d)}}}}},s.prototype.createSimplfiedOverflow=function(e,t,o){for(var s=this.getGroupResizeOrder(!0,o),a=0;a<s.length&&e.offsetWidth<t.offsetWidth;a++){for(var l=!1,p=s[parseInt(a.toString(),10)],c=e.querySelector("#"+p.id),u=c.querySelector("#"+p.id+go),d=p.collections.length;d>=1&&e.offsetWidth<t.offsetWidth;d--)for(var h=p.collections[parseInt((d-1).toString(),10)],b=c.querySelector("#"+h.id),f=h.items.length;f>=1&&e.offsetWidth<t.offsetWidth;f--){var m=h.items[f-1],y=b.querySelector("#"+m.id+go);if((m.displayOptions===r.Auto||m.displayOptions===(r.Simplified|r.Overflow))&&!(0,T.isNullOrUndefined)(y)){var g=!1,v=!1,S=!1,I=!1,C=void 0;if(c.classList.contains("e-hidden")||c.classList.contains("e-hide-group")){if((C=c.querySelectorAll(".e-ribbon-item.e-hidden")).length)for(var w=0;w<C.length;w++)C[parseInt(w.toString(),10)].classList.remove("e-hidden");c.classList.contains("e-hide-group")?(S=!0,c.classList.remove("e-hide-group"),c.classList.remove("e-ribbon-emptyCollection"),-1!==this.hiddenGroups.indexOf(c.id)&&this.hiddenGroups.splice(this.hiddenGroups.indexOf(c.id),1)):(g=!0,c.classList.remove("e-hidden")),l||(this.calculateOverflowItemsWidth(c.offsetWidth,!1,o),this.calculateMediumDataWidth(c.offsetWidth,o,!1),l=!0)}else y.classList.contains("e-hidden")&&(v=!0,y.classList.remove("e-hidden"),c.classList.contains("e-ribbon-emptyCollection")&&(I=!0,c.classList.remove("e-ribbon-emptyCollection")),this.calculateOverflowItemsWidth(y.offsetWidth,!1,o),this.calculateMediumDataWidth(y.offsetWidth,o,!1));if(y.setAttribute("data-simplified-width",t.offsetWidth.toString()),v&&y.classList.add("e-hidden"),C&&C.length)for(var O=0;O<C.length;O++)C[parseInt(O.toString(),10)].classList.add("e-hidden");if(g&&c.classList.add("e-hidden"),S&&(c.classList.add("e-hide-group"),c.classList.add("e-ribbon-emptyCollection")),I&&c.classList.add("e-ribbon-emptyCollection"),this.createOverflowPopup(m,o,p.enableGroupOverflow,p.id,p.header,y,u,!0),m.activeSize===i.Small){var k=y.querySelector("#"+m.id);m.setProperties({activeSize:i.Medium},!0),this.setItemSize(k,m)}m.type!==n.DropDown&&m.type!==n.SplitButton&&m.type!==n.GroupButton&&m.type!==n.Gallery||this.updatePopupItems(m,y,p.enableGroupOverflow,!0)}}p.enableGroupOverflow||c.querySelector("."+xt)||c.classList.add("e-ribbon-emptyCollection");var B=c.querySelectorAll("."+xt);B&&!p.enableGroupOverflow&&this.checkEmptyCollection(B)&&c.classList.add("e-ribbon-emptyCollection"),this.checkOverflowHiddenItems(p.enableGroupOverflow,o,p.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(e,t,o,i){var r=this,s=(0,T.getComponent)(t.querySelector("#"+e.id),e.type===n.DropDown||e.type===n.Gallery||e.type===n.GroupButton?H.DropDownButton:H.SplitButton),a=s.dropDown,l=(o&&i)===this.enableRtl;a&&(a.setProperties({position:{X:l?"left":"right",Y:i?"top":"bottom"}},!0),i?s.beforeOpen=function(){l&&(e.type===n.Gallery&&r.ribbonGalleryModule&&r.ribbonGalleryModule.checkCollision(a,a.element),a.element.style.setProperty("visibility","hidden"),a.element.style.setProperty("display","block"),a.setProperties({offsetX:-1*a.element.offsetWidth}),a.element.style.removeProperty("display"),a.element.style.removeProperty("visibility"))}:(a.setProperties({offsetX:0},!0),s.beforeOpen=null))},s.prototype.removeSimplfiedOverflow=function(e,t,o,s){void 0===s&&(s=!1);for(var a=this.getGroupResizeOrder(!1,o),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=e.querySelector("#"+c.id+bo);h&&(d=(u=(0,T.getInstance)(h,H.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 f=c.collections[parseInt(b.toString(),10)],m=0;m<f.items.length&&l&&!s&&e.offsetWidth>t.offsetWidth;m++){var y=f.items[parseInt(m.toString(),10)],g=void 0;if(d&&(g=d.querySelector("#"+y.id+go)),(y.displayOptions===r.Auto||y.displayOptions===(r.Simplified|r.Overflow))&&!(0,T.isNullOrUndefined)(g)){var v=parseInt(g.getAttribute("data-simplified-width"),10),S=e.querySelector("#"+c.id);if((g.classList.contains("e-hidden")||S.classList.contains("e-hidden"))&&(v=Math.abs(v-t.offsetWidth)),!s&&e.offsetWidth<v){l=!1;break}var I=e.querySelector("#"+f.id);if(y.type!==n.DropDown&&y.type!==n.SplitButton&&y.type!==n.GroupButton&&y.type!==n.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,w=0;g.classList.contains("e-hidden")&&(g.classList.remove("e-hidden"),S.classList.contains("e-hide-group")&&(C=!0,w=this.checkWidthDifference(g,S)),v=g.offsetWidth+w,g.classList.add("e-hidden")),this.calculateOverflowItemsWidth(v,!0,o),this.calculateMediumDataWidth(v,o,!0),C&&(S.classList.add("e-hide-group"),S.classList.add("e-ribbon-emptyCollection"))}this.removeOverflowEvent(y,g),y.allowedSizes&i.Small&&(y.setProperties({activeSize:i.Small},!0),this.setItemSize(g.querySelector("#"+y.id),y));var O=e.querySelector("#"+c.id),k=O.querySelector("."+xt);if(O.classList.contains("e-ribbon-emptyCollection")&&null!==k){var B=O.querySelectorAll("."+xt);B&&(this.checkEmptyCollection(B)||O.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 P=d.querySelector("#"+c.id+go);P&&1===P.childElementCount&&P.remove();var L=d.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+vo);L&&0===L.childElementCount&&(L.remove(),this.overflowDDB.element.classList.add(et))}}for(p=0;p<a.length;p++)this.checkOverflowHiddenItems(a[parseInt(p.toString(),10)].enableGroupOverflow,o,a[parseInt(p.toString(),10)].id);this.overflowDDB&&(0===this.overflowDDB.target.childElementCount&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null))},s.prototype.checkOverflowHiddenItems=function(e,t,o){if(e){var i=document.querySelector("#"+o+bo);if(i){for(var r=(0,T.getInstance)(i,H.DropDownButton),n=r.target.querySelectorAll(".e-ribbon-item"),s=!0,a=0;a<n.length;a++)if(!n[parseInt(a.toString(),10)].classList.contains("e-hidden")){s=!1;break}r.element.classList[s?"add":"remove"]("e-hidden")}}else if(this.overflowDDB){var l=!0,p=void 0,c=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+vo);if(c){for(var u=0;u<c.children.length;u++){p=!0;for(var d=c.children[parseInt(u.toString(),10)],h=d.querySelectorAll(".e-ribbon-item"),b=0;b<h.length;b++)if(!h[parseInt(b.toString(),10)].classList.contains("e-hidden")){p=!1;break}d.classList[p?"add":"remove"]("e-hide-group"),d.classList.contains("e-hide-group")||d.classList.contains("e-hidden")||(l=!1)}this.overflowDDB.element.classList[l?"add":"remove"](et)}}},s.prototype.createOverflowPopup=function(e,t,o,i,r,n,s,a){var l,p,c=Zo(this.tabs,i),u=this.tabObj.items[parseInt(t.toString(),10)].content.querySelector("#"+i);if(o){var d=s.querySelector("#"+i+bo);d?l=(0,T.getInstance)(d,H.DropDownButton):((l=this.addOverflowButton(i+bo,o)).element.classList.add(pt),s.appendChild(l.element)),this.addKeyTip(t,"0"+(c.groupIndex+1),l.element.id,"grpofbtn"),p=l.target;var h=l.target;if(!h.querySelector("#"+i+bo+fo)&&c.group.overflowHeader){var b=this.createElement("div",{className:kt,id:i+bo+fo,innerHTML:c.group.overflowHeader});h.append(b)}u&&(u.classList.contains("e-disabled")&&h.classList.add("e-disabled"),u.classList.contains("e-hidden")&&h.classList.add("e-hidden"),u.classList.contains("e-hide-group")&&h.classList.add("e-hide-group")),a?h.insertBefore(n,h.querySelector("."+xt)):h.append(n)}else{if(this.overflowDDB){this.overflowDDB.element.classList.remove(et);var f=this.overflowDDB.target,m=f.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+vo);if(m){var y=f.querySelector("#"+i+go);y||(y=c.group.overflowHeader?this.createGroupContainer(i,c.group.overflowHeader):this.createGroupContainer(i,r),u&&(u.classList.contains("e-disabled")&&y.classList.add("e-disabled"),u.classList.contains("e-hidden")&&y.classList.add("e-hidden"),u.classList.contains("e-hide-group")&&y.classList.add("e-hide-group")),m.append(y)),a?y.insertBefore(n,y.querySelector("."+xt)):y.append(n)}else this.createOfTabContainer(i,r,n,t)}else this.overflowDDB=this.addOverflowButton(this.tabObj.element.id+ho,o),this.tabObj.element.insertBefore(this.overflowDDB.element,this.collapseButton),this.overflowDDB.element.classList.add(lt),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")},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);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+vo,className:It});this.overflowDDB.target.append(r);var n=Zo(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(it);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(e){for(var t=0,o=0;o<e.length;o++){for(var i=e[parseInt(o.toString(),10)].items,n=0;n<i.length;n++)if(i[parseInt(n.toString(),10)].displayOptions&r.Classic){t++;break}if(t>1)return!1}return 1===t},s.prototype.checkClassicCollection=function(e,t,o){for(var i=e[parseInt(t.toString(),10)].items,n=0;n<i.length;n++)if(i[parseInt(n.toString(),10)].displayOptions&r.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)},s.prototype.checkClassicItem=function(e,t,o){return e[parseInt(t.toString(),10)].displayOptions&r.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))},s.prototype.checkLargeToMedium=function(e,t,s,a,l,p){var c=this;void 0===p&&(p=!1);var u=t.groups[parseInt(s.toString(),10)];if(u.isCollapsed&&!p)return!1;var d=function(e){return 1===e.items.length&&h(e.items[0])},h=function(e){return e.allowedSizes&i.Medium&&e.activeSize===i.Large},b=function(e,t,o,i){var r=c.createElement("div",{className:"e-ribbon-shrink"+Qe+_t,id:e+"_shrink_container"+o,attrs:{"data-start":o.toString(),"data-end":i.toString()}});return t.parentElement.insertBefore(r,t),p||r.setAttribute("data-large-width",l.offsetWidth.toString()),r},f=function(t,o){for(var a=c.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections[0],u=l.querySelector("#"+a.items[parseInt(t.toString(),10)].id+go),d=p?l.querySelector("#"+a.id+"_shrink_container"+t):b(a.id,u,t,o),h=t;h<=o;h++){var f=a.items[parseInt(h.toString(),10)];if(f.displayOptions&r.Classic){var m=l.querySelector("#"+f.id+go);d.appendChild(m),f.setProperties({activeSize:i.Medium},!0),f.type===n.GroupButton&&"Classic"===c.activeLayout?c.setItemSize(m.querySelector("#"+f.id+Po),f):c.setItemSize(m.querySelector("#"+f.id),f)}}},m=function(t,o){for(var r=c.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)],a=l.querySelector("#"+r.collections[parseInt(t.toString(),10)].id),u=p?l.querySelector("#"+r.id+"_shrink_container"+t):b(r.id,a,t,o),d=t;d<=o;d++){var h=r.collections[parseInt(d.toString(),10)],f=l.querySelector("#"+h.id);u.appendChild(f),h.items[0].setProperties({activeSize:i.Medium},!0),h.items[0].type===n.GroupButton&&"Classic"===c.activeLayout?c.setItemSize(f.querySelector("#"+h.items[0].id+Po),h.items[0]):c.setItemSize(f.querySelector("#"+h.items[0].id),h.items[0])}};if(u.orientation===o.Column)for(var y=u.collections.length-1;y>0;y--){if((v=(y=this.checkClassicCollection(u.collections,y,!1))-1)>=0&&d(u.collections[parseInt(y.toString(),10)]))if((v=this.checkClassicCollection(u.collections,v,!1))>=0&&d(u.collections[parseInt(v.toString(),10)])){if((S=v-1)>=0&&(S=this.checkClassicCollection(u.collections,S,!1)),S>=0&&d(u.collections[parseInt(S.toString(),10)])?m(S,y):m(v,y),y=S,!p&&a.offsetWidth>l.offsetWidth)return!0}else y=v}else if(this.checkValidCollectionLength(u.collections)){var g=u.collections[0];for(y=g.items.length-1;y>0;y--){var v,S;if((v=(y=this.checkClassicItem(g.items,y,!1))-1)>=0&&h(g.items[parseInt(y.toString(),10)]))if((v=this.checkClassicItem(g.items,v,!1))>=0&&h(g.items[parseInt(v.toString(),10)])){if((S=v-1)>=0&&(S=this.checkClassicItem(g.items,S,!1)),S>=0&&h(g.items[parseInt(S.toString(),10)])?f(S,y):f(v,y),y=S,!p&&a.offsetWidth>l.offsetWidth)return!0}else y=v}}return!1},s.prototype.checkMediumToSmall=function(e,t,s,a,l,p){var c=this;void 0===p&&(p=!1);var u=t.groups[parseInt(s.toString(),10)];if(u.isCollapsed&&!p)return!1;var d=u.orientation,h=l.querySelector("#"+u.id).querySelectorAll(".e-ribbon-shrink"),b=function(e){return e.allowedSizes&i.Small&&e.activeSize===i.Medium},f=function(t,o,a,p){void 0===p&&(p=null);var u=c.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections[parseInt(t.toString(),10)],d=function(e){var t=u.items[parseInt(e.toString(),10)];if(t.displayOptions&r.Classic){var o=l.querySelector("#"+t.id);t.setProperties({activeSize:i.Small},!0),t.type===n.GroupButton&&(o=l.querySelector("#"+t.id+"_grpbtn")),c.setItemSize(o,t)}};d(o),p&&d(p),d(a)},m=function(t,o,a,u){void 0===u&&(u=null);var d=c.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)];p||h[parseInt(t.toString(),10)].setAttribute("data-medium-width",l.offsetWidth.toString());var b=function(e){var t=d.collections[parseInt(e.toString(),10)];if(t.items[0].displayOptions&r.Classic){var o=l.querySelector("#"+t.items[0].id);t.items[0].setProperties({activeSize:i.Small},!0),t.items[0].type===n.GroupButton&&(o=l.querySelector("#"+t.items[0].id+Po)),c.setItemSize(o,t.items[0])}};b(o),u&&b(u),b(a)},y=function(e){p||l.querySelector("#"+e).setAttribute("data-medium-width",l.offsetWidth.toString())};if(d===o.Column){if(h.length>0)for(var g=h.length-1;g>=0;g--){var v=parseInt(h[parseInt(g.toString(),10)].getAttribute("data-start"),10),S=parseInt(h[parseInt(g.toString(),10)].getAttribute("data-end"),10),I=this.checkClassicCollection(u.collections,v+1,!1);if(b(u.collections[parseInt(v.toString(),10)].items[0])&&b(u.collections[parseInt(I.toString(),10)].items[0])&&(S===I?m(g,v,S):b(u.collections[parseInt(S.toString(),10)].items[0])&&m(g,v,S,I),!p&&a.offsetWidth>l.offsetWidth))return!0}for(g=u.collections.length-1;g>=0;g--){for(var C=u.collections[parseInt(g.toString(),10)],w=[],O=0;O<C.items.length;O++)C.items[parseInt(O.toString(),10)].displayOptions&r.Classic&&w.push(O);if(w.length>1&&b(C.items[w[0]])&&b(C.items[w[1]])&&(2===w.length?(y(C.id),f(g,w[0],w[1])):b(C.items[w[2]])&&(y(C.id),f(g,w[0],w[2],w[1])),!p&&a.offsetWidth>l.offsetWidth))return!0}}else if(this.checkValidCollectionLength(u.collections)){if(h.length>0)for(g=h.length-1;g>=0;g--){var k=h[parseInt(g.toString(),10)];v=parseInt(k.getAttribute("data-start"),10),S=parseInt(k.getAttribute("data-end"),10),C=u.collections[0],I=this.checkClassicItem(C.items,v+1,!1);if(b(u.collections[0].items[parseInt(v.toString(),10)])&&b(u.collections[0].items[parseInt(I.toString(),10)])&&(S===I?(y(k.id),f(0,v,S)):b(u.collections[0].items[parseInt(S.toString(),10)])&&(y(k.id),f(0,v,S,I)),!p&&a.offsetWidth>l.offsetWidth))return!0}}else for(g=u.collections.length-1;g>=0;g--)for(I=(C=u.collections[parseInt(g.toString(),10)]).items.length-1;I>=0;I--)if(!((I=this.checkClassicItem(C.items,I,!1))<0)){var T=C.items[parseInt(I.toString(),10)];if(b(T)&&(T.type!==n.GroupButton?y(T.id):y(T.id+Po),f(g,I,I),!p&&a.offsetWidth>l.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(e,t,s,a,l,p,c){var u=this,d=t.groups[parseInt(s.toString(),10)],h=d.orientation,b=l.querySelector("#"+d.id).querySelectorAll(".e-ribbon-shrink"),f=function(e){return e.allowedSizes&i.Medium&&e.activeSize===i.Small},m=function(t,o,a){var l=u.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections[parseInt(t.toString(),10)].items[parseInt(o.toString(),10)];if(l.displayOptions&r.Classic){var p=a.id===l.id?a:a.querySelector("#"+l.id);l.setProperties({activeSize:i.Medium},!0),l.type===n.GroupButton&&(p=document.querySelector("#"+l.id+Po)),u.setItemSize(p,l)}},y=function(t){var o=u.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections,a=o[parseInt(t.toString(),10)].items[0];if(a.displayOptions&r.Classic){var p=l.querySelector("#"+o[parseInt(t.toString(),10)].items[0].id);o[parseInt(t.toString(),10)].items[0].setProperties({activeSize:i.Medium},!0),a.type===n.GroupButton&&(p=l.querySelector("#"+o[parseInt(t.toString(),10)].items[0].id+Po)),u.setItemSize(p,o[parseInt(t.toString(),10)].items[0])}};if(h===o.Row){if(!this.checkValidCollectionLength(d.collections))for(var g=0;g<d.collections.length;g++)for(var v=d.collections[parseInt(g.toString(),10)],S=0;S<v.items.length;S++)if((S=this.checkClassicItem(v.items,S,!0))!==v.items.length){var I=v.items[parseInt(S.toString(),10)];if(f(I)){var C=l.querySelector("#"+I.id);if("GroupButton"===I.type&&(C=l.querySelector("#"+I.id+Po)),(w=(T=C.getAttribute("data-medium-width"))?parseInt(T,10):null)&&(p||a.offsetWidth>w))m(g,S,C),p&&!c||C.removeAttribute("data-medium-width");else if(w)return!0}}}else for(g=0;g<d.collections.length;g++)if(d.collections[parseInt(g.toString(),10)].items.length>1){v=d.collections[parseInt(g.toString(),10)];for(var w=(T=(C=l.querySelector("#"+v.id)).getAttribute("data-medium-width"))?parseInt(T,10):null,O=[],k=0;k<v.items.length;k++)v.items[parseInt(k.toString(),10)].displayOptions&r.Classic&&O.push(k);if(O.length>1&&w&&(p||a.offsetWidth>w))m(g,O[0],C),m(g,O[1],C),3===O.length&&m(g,O[2],C),p&&!c||C.removeAttribute("data-medium-width");else if(w)return!0}if(b.length>0)for(g=0;g<b.length;g++){var T,B=b[parseInt(g.toString(),10)];if((w=(T=B.getAttribute("data-medium-width"))?parseInt(T,10):null)&&(p||a.offsetWidth>w)){var P=parseInt(B.getAttribute("data-start"),10),L=parseInt(B.getAttribute("data-end"),10);if(h===o.Row){v=d.collections[0],S=this.checkClassicItem(v.items,P+1,!0);m(0,P,B),m(0,S,B),S!==L&&m(0,L,B)}else{var E=this.checkClassicCollection(d.collections,P+1,!0);y(P),y(E),E!==L&&y(L)}p&&!c||B.removeAttribute("data-medium-width")}else if(w)return!0}return!1},s.prototype.checkMediumToLarge=function(e,t,s,a,l,p,c){var u=this,d=t.groups[parseInt(s.toString(),10)],h=d.orientation,b=l.querySelector("#"+d.id).querySelectorAll(".e-ribbon-shrink");if(0===b.length)return!1;for(var f=function(t,o,a,l){var d=u.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections[0].items,h=function(e){var t=d[parseInt(e.toString(),10)];if(t.displayOptions&r.Classic){var o=a.querySelector("#"+t.id+go),s=o.querySelector("#"+t.id);t.setProperties({activeSize:i.Large},!0),t.type===n.GroupButton&&(s=o.querySelector("#"+t.id+Po)),u.setItemSize(s,t),a.insertAdjacentElement("beforebegin",o)}};h(t),l&&h(l),h(o),p&&!c||(0,T.remove)(a)},m=function(t,o,a,l){var d=u.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections,h=function(e){var t=d[parseInt(e.toString(),10)];if(t.items[0].displayOptions&r.Classic){var o=a.querySelector("#"+t.id),s=o.querySelector("#"+t.items[0].id);t.items[0].setProperties({activeSize:i.Large},!0),t.items[0].type===n.GroupButton&&(s=o.querySelector("#"+t.items[0].id+Po)),u.setItemSize(s,t.items[0]),a.insertAdjacentElement("beforebegin",o)}};h(t),l&&h(l),h(o),p&&!c||(0,T.remove)(a)},y=0;y<b.length;y++){var g=b[parseInt(y.toString(),10)],v=g.getAttribute("data-large-width"),S=v?parseInt(v,10):null;if(S&&(p||a.offsetWidth>S)){var I=parseInt(g.getAttribute("data-start"),10),C=parseInt(g.getAttribute("data-end"),10);if(h===o.Row){var w=d.collections[0],O=this.checkClassicItem(w.items,I+1,!0);O===C?f(I,C,g):f(I,C,g,O)}else{var k=this.checkClassicCollection(d.collections,I+1,!0);k===C?m(I,C,g):m(I,C,g,k)}p&&!c||g.removeAttribute("data-large-width")}else if(S)return!0}return!1},s.prototype.handleContentSize=function(e,t){var o=e.closest("."+wt);t?o.classList.add(jt):o.classList.remove(jt)},s.prototype.setItemSize=function(e,t){if(e){var o=e.closest("."+xt);t.type===n.Button?this.ribbonButtonModule.updateButtonSize(e,t):t.type===n.DropDown?this.ribbonDropDownModule.updateDropDownSize(e,t):t.type===n.SplitButton?this.ribbonSplitButtonModule.updateSplitButtonSize(e,t):t.type===n.Template?((0,T.remove)(e),this.createTemplateContent(t,o)):t.type===n.GroupButton&&this.ribbonGroupButtonModule.updateGroupButtonSize(e,t),o.classList.remove(jt,qt,Rt,At),t.activeSize===i.Large?o.classList.add(qt,jt):o.classList.add(t.activeSize===i.Medium?Rt:At)}},s.prototype.createOverflowDropdown=function(e,t,o){var i=this.getGroupResizeOrder(!0,e);if(0!==i.length)for(var r=function(r){var a=i[parseInt(r.toString(),10)],l=s.tabObj.element.querySelector("#"+a.id);l.setAttribute("data-expanded-width",o.offsetWidth.toString());var p=l.querySelector("#"+a.id+go),c=s.createElement("div",{className:Tt+Qe+qt,id:a.id+vo+go});l.insertBefore(c,p);var u=Uo(s.tabs[parseInt(e.toString(),10)].groups,(function(e){return e.id===a.id})),d=s.tabs[parseInt(e.toString(),10)];s.checkSmallToMedium(e,d,u,t,o,!0,!1),s.checkMediumToLarge(e,d,u,t,o,!0,!1);var h=s.ribbonDropDownModule.createOverFlowDropDown(a.id,a.header,a.groupIconCss,p,c,s.enableRtl);if(a.keyTip){var b=a.id+vo+So;s.addKeyTip(e,a.keyTip,b,"grpoverflow")}s.tabs[parseInt(e.toString(),10)].groups[parseInt(u.toString(),10)].setProperties({isCollapsed:!0},!0);for(var f=0;f<a.collections.length;f++)for(var m=a.collections[parseInt(f.toString(),10)],y=p.querySelector("#"+m.id),g=0;g<m.items.length;g++){var v=m.items[parseInt(g.toString(),10)],S=y.querySelector("#"+v.id+go);null!==S&&(s.handleContentSize(S),s.addOverflowEvents(v,S,h));b=document.querySelector("#"+a.id+vo+So);var I=(0,T.getInstance)(b,H.DropDownButton);if(I)if(I.target&&s.keyTipElements[parseInt(e.toString(),10)]){if(v.type===n.GroupButton)for(var C=0;C<v.groupButtonSettings.items.length;C++)v.groupButtonSettings.items[parseInt(C.toString(),10)].keyTip&&s.addKeyTip(e,v.groupButtonSettings.items[parseInt(C.toString(),10)].keyTip,v.id+(Po+C),"grpoverflowpopup");v.keyTip&&s.addKeyTip(e,v.keyTip,v.id,"grpoverflowpopup")}}},s=this,a=0;a<i.length&&t.offsetWidth<o.offsetWidth;a++)r(a)},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)],l=s.tabObj.element.querySelector("#"+a.id);if(!l)return"break";var p=parseInt(l.getAttribute("data-expanded-width"),10);if(!o&&e.offsetWidth<p)return{value:!0};s.removeDropdown(a.id);var c=Uo(s.tabs[parseInt(i.toString(),10)].groups,(function(e){return e.id===a.id}));s.tabs[parseInt(i.toString(),10)].groups[parseInt(c.toString(),10)].setProperties({isCollapsed:!1},!0);var u=s.tabs[parseInt(i.toString(),10)];s.checkLargeToMedium(i,u,c,e,t,!0),s.checkMediumToSmall(i,u,c,e,t,!0);for(var d=0;d<a.collections.length;d++)for(var h=a.collections[parseInt(d.toString(),10)],b=l.querySelector("#"+h.id),f=0;f<h.items.length;f++){var m=h.items[parseInt(f.toString(),10)],y=b.querySelector("#"+m.id+go);null!==y&&(s.handleContentSize(y,!0),s.removeOverflowEvent(m,y))}},s=this,a=0;a<r.length;a++){var l=n(a);if("object"==typeof l)return l.value;if("break"===l)break}return!1},s.prototype.removeDropdown=function(e){var t=this.tabObj.element.querySelector("#"+e+vo+So);if(t){var o=t.parentElement;this.ribbonDropDownModule.removeOverFlowDropDown(t),(0,T.remove)(o)}},s.prototype.getGroupResizeOrder=function(e,t){var o=this,i=this.tabs[parseInt(t.toString(),10)].groups;return(i=i.filter((function(t){return"Classic"!==o.activeLayout||((0,T.isUndefined)(t.isCollapsible)||t.isCollapsible)&&(e&&(0,T.isUndefined)(t.isCollapsed)||!(0,T.isUndefined)(t.isCollapsed)&&e!==t.isCollapsed)}))).sort((function(e,t){return e.priority-t.priority})),e?i.reverse():i},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+yo);if(t){var o=t.closest("."+dt);"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 t=this;this.currentControlIndex=0;var o=e.selectingItem?e.selectingItem.getAttribute("data-id"):null,i=e.previousItem.getAttribute("data-id"),r=Uo(this.tabs,(function(e){return e.id===o})),n=this.isContextualTab(o),s=Uo(this.tabs,(function(e){return e.id===i}));r=-1===r?this.selectedTab:r;var a={cancel:e.cancel,isInteracted:e.isInteracted,previousIndex:s,selectedIndex:r,isContextual:n};this.trigger("tabSelecting",a,(function(e){if(!e.cancel){t.destroyScroll(),t.isAddRemove||-1===s||t.clearOverflowDropDown(s);var o=t.tabObj.items[parseInt(r.toString(),10)].content;if(!o.querySelector("."+bt)&&0!==t.tabs[parseInt(r.toString(),10)].groups.length){var i=t.createGroups(t.tabs[parseInt(r.toString(),10)].groups,r);(0,T.append)(i,o)}}}))},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+fo}),a=Uo(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 l={header:{text:s},id:n.id,cssClass:n.cssClass},p=r.createElement("div",{className:l.cssClass,id:n.id+yo});p.classList.add(rt),l.content=p,o.push(l)},r=this,n=0;n<e.length;n++)i(n);return o},s.prototype.renderInitialTab=function(e){var t=this.createGroups(this.tabs[parseInt(e.toString(),10)].groups,e),o=this.tabObj.items[parseInt(e.toString(),10)].content;(0,T.append)(t,o),"Simplified"===this.activeLayout&&this.element.classList.add(Zt);var i=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+yo);this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(i),this.checkOverflow(this.selectedTab,i)},s.prototype.addOverflowButton=function(e,t){var o,i=this,r=this.createElement("button",{id:e}),n=this.createElement("div",{className:ct,attrs:{tabindex:"0"}}),s=new H.DropDownButton({iconCss:ze,cssClass:Nt+Qe+Bt,target:n,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 t=e.event?(0,T.closest)(e.event.target,"."+Ye):null,o=e.event?(0,T.closest)(e.event.target,".e-ribbon-group-button-overflow-popup"):null,r={element:e.element,event:e.event,cancel:e.cancel};i.trigger("overflowPopupClose",r,(function(i){(t||i.cancel||o)&&(e.cancel=!0)}))}},r);return this.element.classList.add(ut),ii(n,this),t||(this.keyTipElements.overflowbtn=[],this.keyTipElements.overflowbtn.push({id:e,type:"overflowbtn",keyTip:"00"})),r.onkeydown=r.onclick=function(){i.itemIndex=-1,o=!r.classList.contains("e-ribbon-overall-of-btn")},n.onkeydown=function(e){return i.upDownKeyHandler(e,n,o),i},s},s.prototype.upDownKeyHandler=function(e,t,o){var i;o?i=t.getElementsByClassName("e-ribbon-item"):i=t.querySelector(".e-ribbon-of-tab.e-ribbon-active").getElementsByClassName("e-ribbon-item");var r,n,s=i[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-control"),a=s&&s.classList.contains("e-combobox")?i[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-combobox"):null;if(null===a||"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===i.length-1){if(this.itemIndex=0,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!0),a&&"Tab"===e.key)e.preventDefault(),(l=i[this.itemIndex].querySelector(".e-control"))&&l.focus();n=i[this.itemIndex].querySelector(".e-ribbon-template")}else this.itemIndex<i.length-1&&this.itemIndex>=0&&(this.itemIndex++,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!0),n=i[this.itemIndex].querySelector(".e-ribbon-template"));n&&n.focus()}else if(("ArrowUp"===e.key||e.shiftKey&&"Tab"===e.key)&&(null===a||"Tab"===e.key)){if(this.itemIndex&&-1!==this.itemIndex)this.itemIndex<=i.length-1&&this.itemIndex>0&&(this.itemIndex--,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!1),n=i[this.itemIndex].querySelector(".e-ribbon-template"));else{var l;if(this.itemIndex=i.length-1,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!1),a&&e.shiftKey&&"Tab"===e.key)e.preventDefault(),(l=i[this.itemIndex].querySelector(".e-control"))&&l.focus();n=i[this.itemIndex].querySelector(".e-ribbon-template")}n&&n.focus()}t.setAttribute("index",this.itemIndex.toString())}var p=parseInt(t.getAttribute("index"),10),c="",u=i[parseInt(p.toString(),10)]?i[parseInt(p.toString(),10)].querySelector(".e-control"):null;if(u&&(c=u.getAttribute("data-control")),"ArrowDown"===e.key||"ArrowUp"===e.key||" "===e.key||"Tab"===e.key){if("ColorPicker"===c)"Tab"===e.key&&e.preventDefault(),i[parseInt(p.toString(),10)].querySelector(".e-split-colorpicker").focus();else{"Tab"===e.key&&e.preventDefault();var d=i[parseInt(p.toString(),10)].querySelector(".e-control");d&&d.focus()}if(" "===e.key&&"CheckBox"===c){var h=i[parseInt(p.toString(),10)].querySelector(".e-control"),b=(0,T.getComponent)(h,Ge.CheckBox);this.itemIndex=-1,b.click()}}"SplitButton"!==c||"ArrowRight"!==e.key&&"ArrowLeft"!==e.key||("ArrowRight"===e.key&&(this.enableRtl?i[parseInt(p.toString(),10)].querySelector(".e-control").focus():i[parseInt(p.toString(),10)].querySelector(".e-dropdown-btn").focus()),"ArrowLeft"===e.key&&(this.enableRtl?i[parseInt(p.toString(),10)].querySelector(".e-dropdown-btn").focus():i[parseInt(p.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;ri(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:Ct,id:e+go}),i=this.createElement("div",{className:kt,id:e+fo,innerHTML:t});return o.append(i),o},s.prototype.addExpandCollapse=function(){var e=this;this.collapseButton=this.createElement("span",{className:nt+Qe+He,id:this.tabObj.element.id+uo,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(at),"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}))},s.prototype.removeExpandCollapse=function(){var e=this,t=Uo(this.tooltipData,(function(t){return t.id===e.collapseButton.id}));-1!==t&&this.tooltipData.splice(t,1),this.element.classList.remove(at),(0,T.remove)(this.tabObj.element.querySelector("."+nt)),this.collapseButton=null},s.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),n=e[parseInt(r.toString(),10)],s=!1,a=0;a<this.tabObj.items.length;a++)if(this.tabs[parseInt(r.toString(),10)].id===this.tabObj.items[parseInt(a.toString(),10)].id){s=!0;break}if(!s){this.destroyTabItems(this.tabsInternal),this.tabsInternal=this.tabs.slice(),this.validateItemSize();var l=this.createTabItems(this.tabs);this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:l,selectedItem:this.selectedTab});break}var p=this.tabs[parseInt(r.toString(),10)].groups,c=this.tabObj.element,u=this.tabs[parseInt(r.toString(),10)];u.setProperties(n,!0),this.setProperties({groups:this.checkID(u.groups,"group",u.id)},!0),this.validateItemSize();var d=this.tabObj.items[parseInt(r.toString(),10)].content;if(p&&(n.header&&(this.tabObj.items[parseInt(r.toString(),10)].header.text.innerText=u.header),n.cssClass&&(this.tabObj.items[parseInt(r.toString(),10)].cssClass&&(d.classList.remove(this.tabObj.items[parseInt(r.toString(),10)].cssClass),c.querySelector(".e-active").classList.remove(this.tabObj.items[parseInt(r.toString(),10)].cssClass)),d.classList.add(u.cssClass),c.querySelector(".e-active").classList.add(u.cssClass)),n.groups)){for(var h=0,b=p;h<b.length;h++){for(var f=b[h],m=f.isCollapsed?d.querySelector("#"+f.id+vo+So):null,y=0,g=f.collections;y<g.length;y++)for(var v=0,S=g[y].items;v<S.length;v++){var I=S[v],C=m?this.ribbonDropDownModule.getDDBItemElement(m,I.id):d.querySelector("#"+I.id);C&&this.destroyFunction(I,C)}m&&this.ribbonDropDownModule.removeOverFlowDropDown(m)}d.querySelectorAll(".e-ribbon-group").forEach((function(e){e.remove()}));var w=this.createGroups(u.groups,r);(0,T.append)(w,d)}}var O=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+yo);this.checkOverflow(this.selectedTab,O)},s.prototype.switchLayout=function(){this.currentControlIndex=0,this.destroyScroll(),this.collapseButton.classList.toggle(st,"Simplified"===this.activeLayout),this.element.classList.toggle(Zt,"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)],s=this.tabs[parseInt(t.toString(),10)].groups,a=this.tabObj.element.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+yo),l=a.closest("."+dt);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(t,o,p,l,a,!0,!1),this.checkMediumToLarge(t,o,p,l,a,!0,!1));for(var d=l.querySelector("#"+c.id),h=(B=d.querySelector("#"+c.id+go)).querySelectorAll(".e-ribbon-shrink"),b=0;b<h.length;b++)h[parseInt(b.toString(),10)].remove();(L=B.querySelector("#"+c.id+fo)).remove(),(P=B.querySelector("#"+c.id+yo)).classList.replace(_t,Mt),P.classList.remove(jt);for(var f=0;f<c.collections.length;f++){var m=c.collections[parseInt(f.toString(),10)];(_=B.querySelector("#"+m.id)).classList.replace(_t,Mt);for(var y=0;y<m.items.length;y++){for(var g=m.items,v=m.items[parseInt(y.toString(),10)],S=!0;S&&v.displayOptions===r.Classic;){y++;var I=B.querySelector("#"+v.id+go),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 w=v.allowedSizes===i.Large||v.allowedSizes&i.Medium?i.Medium:i.Small;w=!(v.displayOptions&r.Simplified)&&v.displayOptions&r.Overflow?i.Medium:w;var O=void 0;if(v.displayOptions&r.Classic){if(O=B.querySelector("#"+v.id+go),v.displayOptions===(r.Classic|r.Overflow)&&(this.createOverflowPopup(v,t,c.enableGroupOverflow,c.id,c.header,O,B),v.type!==n.DropDown&&v.type!==n.SplitButton&&v.type!==n.GroupButton&&v.type!==n.Gallery||this.updatePopupItems(v,O,c.enableGroupOverflow,!0)),v.type===n.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(v,O),v.setProperties({activeSize:w},!0),O){C=O.querySelector("#"+v.id);this.setItemSize(C,v)}}else O=this.createItems([v],u,c.id,c.header,c.enableGroupOverflow,t,B)[0],v.displayOptions&r.Simplified&&_.append(O);v.type===n.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,v.id)}}c.enableGroupOverflow||d.querySelector("."+xt)||d.classList.add("e-ribbon-emptyCollection")}else{this.element.classList.remove(ut);for(var k=0;k<s.length;k++){c=s[parseInt(k.toString(),10)],u=s[parseInt(k.toString(),10)].orientation;var B,P=(B=l.querySelector("#"+c.id+go)).querySelector("#"+c.id+yo),L=this.createElement("div",{className:Ot,id:c.id+fo,innerHTML:c.header});B.appendChild(L),"Row"===u&&P.classList.replace(Mt,_t),P.classList.add(jt);for(f=0;f<c.collections.length;f++){var E=void 0,D=void 0;if(c.enableGroupOverflow){var x=B.querySelector("#"+c.id+bo);x&&(D=(E=(0,T.getInstance)(x,H.DropDownButton)).target)}else(E=this.overflowDDB)&&(D=this.overflowDDB.target);m=c.collections[parseInt(f.toString(),10)];var _=B.querySelector("#"+m.id);"Column"===u&&_.classList.replace(Mt,_t);for(y=0;y<m.items.length;y++){for(g=m.items,v=m.items[parseInt(y.toString(),10)],S=!0;S&&!(v.displayOptions&r.Classic);){y++;O=void 0;if((v.displayOptions&r.Simplified||v.displayOptions&r.Overflow)&&null!==(O=v.displayOptions&r.Simplified?B.querySelector("#"+v.id+go):D.querySelector("#"+v.id+go))){var M=O.querySelector("#"+v.id);this.destroyFunction(v,M),O.remove()}y<g.length?v=g[parseInt(y.toString(),10)]:S=!1}if(!S)break;if(v.displayOptions&(r.Simplified|r.Overflow)){!(O=B.querySelector("#"+v.id+go))&&D&&(O=D.querySelector("#"+v.id+go),v.type!==n.DropDown&&v.type!==n.SplitButton&&v.type!==n.GroupButton&&v.type!==n.Gallery||this.updatePopupItems(v,O,c.enableGroupOverflow,!1),this.removeOverflowEvent(v,O)),v.type===n.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(v,O),O&&_.append(O)}else{var O=this.createItems([v],u,c.id,c.header,c.enableGroupOverflow,t)[0];_.append(O)}C=B.querySelector("#"+v.id);v.type===n.GroupButton&&(C=B.querySelector("#"+v.id+Po));var q=v.allowedSizes&i.Large?i.Large:v.allowedSizes&i.Medium?i.Medium:i.Small;v.setProperties({activeSize:q},!0),this.setItemSize(C,v),v.type===n.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,v.id)}c.enableGroupOverflow&&E&&(0===D.childElementCount||1===D.childElementCount&&this.isHeaderVisible(D,c.id))&&this.removeOverflowButton(E)}}}this.selectedTab===t&&this.checkOverflow(t,a)}}"Classic"===this.activeLayout&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},s.prototype.createLauncherIcon=function(e,t,o){var i=this,r=this.createElement("div",{className:Lt+" "+(this.launcherIconCss?this.launcherIconCss:Et),id:e+mo,attrs:{tabindex:"0",type:"button","aria-label":"Launcher Icon",role:"button"}});t.appendChild(r),t.classList.add(Pt),T.EventHandler.add(r,"click",this.launcherIconClicked.bind(this,e),this),T.EventHandler.add(r,"keydown",(function(t){"Enter"===t.key&&i.launcherIconClicked(e)}),this);var n=Zo(this.tabs,e);n.group.launcherIconKeyTip&&this.addKeyTip(o,n.group.launcherIconKeyTip,r.id,"launcher")},s.prototype.launcherIconClicked=function(e){var t={groupId:e};this.trigger("launcherIconClick",t)},s.prototype.createGroups=function(e,t){for(var o=[],i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)],n=r.orientation,s=this.createElement("div",{className:r.cssClass,id:r.id});s.classList.add(bt),o.push(s);var a=this.createElement("div",{className:r.cssClass,id:r.id+go});a.classList.add(St),s.appendChild(a);var l=this.createElement("div",{className:"Simplified"===this.activeLayout?wt:wt+Qe+jt,id:r.id+yo});if(l.classList.add("Column"===n||"Simplified"===this.activeLayout?Mt:_t),a.appendChild(l),"Classic"===this.activeLayout){var p=this.createElement("div",{className:Ot,id:r.id+fo,innerHTML:r.header});a.appendChild(p)}r.showLauncherIcon&&this.createLauncherIcon(r.id,a,t);var c=this.createCollection(r.collections,r.orientation,r.id,r.header,r.enableGroupOverflow,t,a);(0,T.append)(c,l);for(var u=!0,d=0;d<c.length;d++)if(u)for(var h=0;h<c[parseInt(d.toString(),10)].children.length;h++)if(!c[parseInt(d.toString(),10)].children[parseInt(h.toString(),10)].classList.contains("e-hidden")){u=!1;break}u&&s.classList.add("e-hide-group"),"Simplified"!==this.activeLayout||r.enableGroupOverflow||s.querySelector("."+xt)||s.classList.add("e-ribbon-emptyCollection");var b=this.initialPropsData[parseInt(t.toString(),10)];b&&(b.hiddenGroups&&b.hiddenGroups.length&&this.updateGroupProps("hiddenGroups",b,s),b.disabledGroups&&b.disabledGroups.length&&this.updateGroupProps("disabledGroups",b,s))}return this.initialPropsData[parseInt(t.toString(),10)]&&delete this.initialPropsData[parseInt(t.toString(),10)],o},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 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 r=t[parseInt(o.toString(),10)].collections,n=t[parseInt(o.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:i.Small|i.Medium|i.Large},!0),"ColorPicker"===p.type&&p.allowedSizes!==i.Small)p.setProperties({allowedSizes:i.Small},!0);else if("ComboBox"!==p.type&&"CheckBox"!==p.type||p.allowedSizes===i.Medium){if(("Column"===n&&a.length>1||"Row"===n&&r.length>1)&&p.allowedSizes&i.Large){var c=p.allowedSizes&(i.Small|i.Medium);c=c||i.Medium,p.setProperties({allowedSizes:c},!0)}}else p.setProperties({allowedSizes:i.Medium},!0);var u=p.allowedSizes&i.Large?i.Large:p.allowedSizes&i.Medium?i.Medium:i.Small;p.setProperties({activeSize:u},!0)}},s.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});c.classList.add(Dt),c.classList.add("Column"!==t||"Simplified"===this.activeLayout?Mt:_t),a.push(c);var u=this.createItems(p.items,t,o,i,r,n,s);if((0,T.append)(u,c),"Row"===t&&2===l)break}return a},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(e,t,o,s,a,l,p){for(var c,u=[],d=0;d<e.length;d++){for(var h=e[parseInt(d.toString(),10)],b=!0;b&&("Simplified"===this.activeLayout&&!(h.displayOptions&(r.Simplified|r.Overflow))||"Classic"===this.activeLayout&&!(h.displayOptions&r.Classic));)++d<e.length?h=e[parseInt(d.toString(),10)]:b=!1;if(!b)break;var f=this.createElement("div",{className:h.cssClass,id:h.id+go});if((c=f.classList).add.apply(c,[xt].concat(h.disabled?[Ke]:[])),h.ribbonTooltipSettings&&ti(h.ribbonTooltipSettings)&&(f.classList.add(Ft),this.tooltipData.push({id:f.id,data:h.ribbonTooltipSettings})),h.type===n.GroupButton)for(var m=0;m<h.groupButtonSettings.items.length;m++)this.keyTipElements[parseInt(l.toString(),10)]&&h.groupButtonSettings.items[parseInt(m.toString(),10)].keyTip&&this.addKeyTip(l,h.groupButtonSettings.items[parseInt(m.toString(),10)].keyTip,h.id+(Po+m),"item");h.keyTip&&(h.type===n.Gallery?this.addKeyTip(l,h.keyTip,h.id+"_popupButton","item"):this.addKeyTip(l,h.keyTip,h.id,"item"));var y=h.activeSize;h.type!==n.Gallery&&("Simplified"===this.activeLayout&&(y=h.allowedSizes===i.Large||h.allowedSizes&i.Medium||h.displayOptions===r.Overflow?i.Medium:i.Small,h.setProperties({activeSize:y},!0)),y&i.Large?f.classList.add(qt,jt):f.classList.add(y&i.Medium?Rt:At));var g=this.initialPropsData[parseInt(l.toString(),10)];if(g&&g.hiddenItems&&g.hiddenItems.length)-1!==g.hiddenItems.indexOf(h.id)&&f.classList.add("e-hidden");if(this.createRibbonItem(h,f),"Simplified"!==this.activeLayout||h.displayOptions!==r.Overflow&&h.displayOptions!==(r.Classic|r.Overflow)?u.push(f):(this.createOverflowPopup(h,l,a,o,s,f,p),h.type!==n.DropDown&&h.type!==n.SplitButton&&h.type!==n.GroupButton&&h.type!==n.Gallery||this.updatePopupItems(h,f,a,!0)),"Column"===t&&2===d)break}return u},s.prototype.createHelpPaneTemplate=function(){if(this.helpPaneTemplate){var e="helpPaneTemplate";this.clearTemplate([e]),this.ribbonTempEle=this.createElement("div",{className:Wt,id:this.element.id+Bo});var t=Vo(this.helpPaneTemplate);(0,T.append)(t({},this,e,"helpPaneTemplate",this.isStringTemplate),this.ribbonTempEle);var o=this.tabObj.element;o.querySelector(".e-toolbar").after(this.ribbonTempEle),o.style.setProperty(Do,this.ribbonTempEle.offsetWidth+"px"),this.renderReactTemplates()}},s.prototype.createTemplateContent=function(e,t){var o=this.createElement("div",{className:e.cssClass?Ht+Qe+e.cssClass:Ht,id:e.id,attrs:{tabindex:"-1"}});e.disabled&&(o.classList.add(Ke),o.setAttribute("disabled","")),t.appendChild(o),this.renderItemTemplate(e,o)},s.prototype.renderItemTemplate=function(e,t){var o="ribbon"+e.id+"itemTemplate";this.clearTemplate([o]);var r=Vo(e.itemTemplate);(0,T.append)(r({activeSize:i[e.activeSize]},this,o,e.id+"itemTemplate",this.isStringTemplate),t),this.renderReactTemplates()},s.prototype.checkID=function(e,t,o){for(var i="tab"===t?ao:"group"===t?lo:"collection"===t?po:co,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(e){this.tabObj.setProperties(e),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.setCommonProperties(e),this.ribbonBackstageModule&&this.ribbonBackstageModule.setCommonProperties(e);for(var o=0;o<this.tabs.length;o++){var i=this.tabs[parseInt(o.toString(),10)],s=this.tabObj.items[parseInt(o.toString(),10)].content;if(s.querySelector("."+bt))for(var a=0,l=i.groups;a<l.length;a++){var p=l[a],c=void 0,u=void 0;this.activeLayout===t.Classic?c=p.isCollapsed?s.querySelector("#"+p.id+vo+So):null:(u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+bo):null)?(0,T.getComponent)(c,H.DropDownButton):this.overflowDDB)&&(ni(u.target,e),u.setProperties(e));for(var d=0,h=p.collections;d<h.length;d++)for(var b=0,f=h[d].items;b<f.length;b++){var m=f[b],y=null;if(this.activeLayout===t.Classic?m.displayOptions&r.Classic&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,m.id):m.type===n.GroupButton?s.querySelector("#"+m.id+Po):s.querySelector("#"+m.id)):(y=m.displayOptions&r.Simplified?s.querySelector("#"+m.id):null)||(y=u.target.querySelector("#"+m.id),"DropDown"===m.type&&this.updatePopupItems(m,u.target,p.enableGroupOverflow,!0)),y){var g=this.getItemModuleName(m);if("template"!==g)if("group-btn"===g&&"Classic"===this.activeLayout)for(var v=0;v<m.groupButtonSettings.items.length;v++){Qo(y.querySelector("#"+m.id+Po+v),"btn",e)}else if("group-btn"===g&&"Simplified"===this.activeLayout){Qo(y,"dropdown-btn",e);for(var S=0;S<m.groupButtonSettings.items.length;S++){Qo(document.querySelector("#"+m.id+Po+S),"btn",e)}}else Qo(y,g,e);else(0,T.isNullOrUndefined)(e.enableRtl)||y.classList.toggle(Ue,e.enableRtl)}}}}},s.prototype.removeLauncherIcon=function(e,t,o){var i=e+go,r=t?this.ribbonDropDownModule.getDDBItemElement(t,i):o.querySelector("#"+i);if(r){r.classList.remove(Pt);var n=r.querySelector("#"+e+mo);(0,T.remove)(n)}},s.prototype.destroyTabItems=function(e){for(var o=0;o<e.length;o++)for(var i=e[parseInt(o.toString(),10)],s=this.tabObj.items[parseInt(o.toString(),10)].content,a=0,l=i.groups;a<l.length;a++){var p=l[a],c=void 0,u=void 0;this.activeLayout===t.Classic?(c=p.isCollapsed?s.querySelector("#"+p.id+vo+So):null,p.showLauncherIcon&&this.removeLauncherIcon(p.id,c,s)):u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+bo):null)?(0,T.getComponent)(c,H.DropDownButton):this.overflowDDB;for(var d=0,h=p.collections;d<h.length;d++)for(var b=0,f=h[d].items;b<f.length;b++){var m=f[b],y=void 0;this.activeLayout===t.Classic?m.displayOptions&r.Classic&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,m.id):s.querySelector("#"+m.id),m.type===n.GroupButton&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,m.id+Po):s.querySelector("#"+m.id+Po)),m.type===n.Gallery&&(y=s.querySelector("#"+m.id+go))):(y=m.displayOptions&r.Simplified?s.querySelector("#"+m.id):null,m.type===n.Gallery&&(y=m.displayOptions&r.Simplified?s.querySelector("#"+m.id+go):null),y||(y=u?u.target.querySelector("#"+m.id):null)),y&&this.destroyFunction(m,y)}this.activeLayout===t.Classic&&c?this.ribbonDropDownModule.removeOverFlowDropDown(c):this.activeLayout===t.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+Po+i);r&&Jo(r,"btn")}else this.ribbonGroupButtonModule.destroyDropDown(e);var n=function(t){if(e.groupButtonSettings.items[parseInt(t.toString(),10)].ribbonTooltipSettings){var o=e.id+Po+t,i=Uo(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")){Jo(t,"dropdown-btn"),(p=Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"_galleryPopup"))).concat(Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"-popup")));for(i=0;i<p.length;i++)p[parseInt(i.toString(),10)].remove()}else{var a=t.querySelectorAll(".e-ribbon-gallery-item"),l=t.querySelector("#"+e.id+"_popupButton");l&&l.remove();for(i=0;i<a.length;i++)a[parseInt(i.toString(),10)].remove();var p=document.querySelectorAll("#"+e.id+"_galleryPopup");for(i=0;i<p.length;i++)p[parseInt(i.toString(),10)].remove()}else"template"!==o&&Jo(t,o);if(e.ribbonTooltipSettings){var c=Uo(this.tooltipData,(function(t){return t.id===e.id+go}));-1!==c&&this.tooltipData.splice(c,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+yo),o=t.closest("."+dt),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=Uo(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=Uo(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 l=!0,p=function(e){var t=Uo(c.tabs,(function(t){return t.id===r.tabs[parseInt(e.toString(),10)].id}));-1!==t&&(n.querySelectorAll(".e-toolbar-item")[parseInt(t.toString(),10)].classList.contains("e-hidden")||(l=!1))},c=this;for(s=0;s<r.tabs.length;s++)p(s);l?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=Uo(this.tabs,(function(t){return t.id===e}));if(-1!==o){var i=this.tabObj.items[parseInt(o.toString(),10)].content;this.tabObj.element.querySelector("#"+e+fo).classList[t?"remove":"add"]("e-disabled"),i.classList[t?"remove":"add"]("e-disabled"),this.tabObj.enableTab(o,t)}},s.prototype.addTab=function(e,t,o){var i=t?Uo(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(e){var t=Uo(this.tabs,(function(t){return t.id===e}));if(-1!==t){var o=this.tabObj.items[parseInt(t.toString(),10)].content,i=this.tabs[parseInt(t.toString(),10)].groups;if(i&&""!==o.innerHTML)for(var r=0,s=i;r<s.length;r++){for(var a=s[r],l=a.isCollapsed?o.querySelector("#"+a.id+vo+So):null,p=0,c=a.collections;p<c.length;p++)for(var u=0,d=c[p].items;u<d.length;u++){var h=d[u],b=l?this.ribbonDropDownModule.getDDBItemElement(l,h.id):o.querySelector("#"+h.id);h.type===n.GroupButton&&"Classic"===this.activeLayout&&(b=l?this.ribbonDropDownModule.getDDBItemElement(l,h.id+Po):o.querySelector("#"+h.id+Po)),b&&this.destroyFunction(h,b)}l&&this.ribbonDropDownModule.removeOverFlowDropDown(l)}t===this.selectedTab&&(this.isAddRemove=!0),this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(t,1),this.setProperties({tabs:this.tabsInternal},!0),this.tabObj.removeTab(t)}},s.prototype.addGroup=function(e,t,o,i){var r=Uo(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?Uo(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 l=this.tabObj.items[parseInt(r.toString(),10)].content;if(""!==l.innerHTML){var p=this.createGroups([n.groups[parseInt(a.toString(),10)]],r)[0],c=o?l.querySelector("#"+o):null;c?c.insertAdjacentElement(i?"afterend":"beforebegin",p):l.append(p)}this.selectedTab===r&&this.refreshLayout()}},s.prototype.removeGroup=function(e){var o=Zo(this.tabs,e);if(o){this.selectedTab===o.tabIndex&&this.clearOverflowResize();var i=this.tabObj.items[o.tabIndex].content;if(""!==i.innerHTML){var r=void 0,n=void 0;o.group.showLauncherIcon&&this.removeLauncherIcon(o.group.id,null,i),this.activeLayout===t.Simplified&&(n=(r=o.group.enableGroupOverflow?i.querySelector("#"+o.group.id+bo):null)?(0,T.getComponent)(r,H.DropDownButton):this.overflowDDB);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(i,c,n)}if(this.activeLayout===t.Simplified)if(o.group.enableGroupOverflow)(0===n.target.childElementCount||1===n.target.childElementCount&&this.isHeaderVisible(n.target,o.group.id))&&this.removeOverflowButton(n);else{var u=n.target.querySelector("#"+o.group.id+go);u&&1===u.childElementCount&&u.remove();var d=n.target.querySelector("#"+this.tabs[parseInt(o.tabIndex.toString(),10)].id+vo);d&&0===d.childElementCount&&d.remove()}var h=i.querySelector("#"+e);h&&h.remove()}var b=this.tabs[o.tabIndex].groups.slice();b.splice(o.groupIndex,1),this.tabs[o.tabIndex].setProperties({groups:b},!0),this.selectedTab===o.tabIndex&&this.refreshLayout()}},s.prototype.isHeaderVisible=function(e,t){return!!e.querySelector("#"+t+bo+fo)},s.prototype.hideGroup=function(e){this.showHideGroup(e,!0)},s.prototype.showGroup=function(e){this.showHideGroup(e,!1)},s.prototype.showHideGroup=function(e,t){var o,i=Zo(this.tabs,e);if(i){var r=this.tabObj.items[i.tabIndex].content,n=r.querySelector("#"+e);if(n?this.updateHiddenElements(i.tabIndex,t?"hideGroup":"showGroup",e,t,n):this.updateInitialProps(i.tabIndex,e,"hiddenGroups",t),this.overflowDDB){var s=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+vo);if(i.group.enableGroupOverflow){var a=r.querySelector("#"+e+bo);a&&(o=(0,T.getInstance)(a,H.DropDownButton).target),o&&(t?o.classList.add("e-hidden"):o.classList.remove("e-hidden"))}else if(s){var l=s.querySelector("#"+e+go);l&&(t?l.classList.add("e-hidden"):l.classList.remove("e-hidden"))}}this.selectedTab===i.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[parseInt(e.toString(),10)].content,l=void 0,p=!1,c=0;if(s="hideGroup"===t||"showGroup"===t?a.querySelector("#"+o[""+t][parseInt(r.toString(),10)]):a.querySelector("#"+o[""+t][parseInt(r.toString(),10)]+go)){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][parseInt(r.toString(),10)]);-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,t,o){if(this.selectedTab===t&&"Simplified"===this.activeLayout){var i=this.tabObj.element.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+yo),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+vo),a=0;a<n.length;a++){var l=n[parseInt(a.toString(),10)].closest("#"+this.tabs[parseInt(t.toString(),10)].id+vo);s&&l&&s.id===l.id&&n[parseInt(a.toString(),10)].hasAttribute("data-medium-width")&&r.push(n[parseInt(a.toString(),10)])}var p=i.querySelectorAll(".e-ribbon-group-of-btn");for(a=0;a<p.length;a++){n=(0,T.getInstance)(p[parseInt(a.toString(),10)],H.DropDownButton).target.querySelectorAll(".e-ribbon-item");for(var c=0;c<n.length;c++)n[parseInt(c.toString(),10)].hasAttribute("data-medium-width")&&r.push(n[parseInt(c.toString(),10)])}for(a=0;a<r.length;a++)if(r[parseInt(a.toString(),10)].hasAttribute("data-medium-width")){var u=parseInt(r[parseInt(a.toString(),10)].getAttribute("data-medium-width"),10);r[parseInt(a.toString(),10)].setAttribute("data-medium-width",o?(u-e).toString():(u+e).toString())}}},s.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,a=document.querySelector("#"+n.id).querySelector("#"+n.id+bo);if(a&&(s=(0,T.getInstance)(a,H.DropDownButton)),s)for(var l=s.target.querySelectorAll(".e-ribbon-item"),p=0;p<l.length;p++){(u=parseInt(l[parseInt(p.toString(),10)].getAttribute("data-simplified-width"),10))&&l[parseInt(p.toString(),10)].setAttribute("data-simplified-width",t?(u-e).toString():(u+e).toString())}}}if(this.overflowDDB){var c=document.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+vo);for(l=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),r=0;r<l.length;r++){var u,d=l[parseInt(r.toString(),10)].closest("#"+this.tabs[parseInt(o.toString(),10)].id+vo);if(c&&d&&c.id===d.id)(u=parseInt(l[parseInt(r.toString(),10)].getAttribute("data-simplified-width"),10))&&l[parseInt(r.toString(),10)].setAttribute("data-simplified-width",t?(u-e).toString():(u+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,t){var o,i=Zo(this.tabs,e);if(i){var r=this.tabObj.items[i.tabIndex].content,n=r.querySelector("#"+e);if(n?t?n.classList.add("e-disabled"):n.classList.remove("e-disabled"):this.updateInitialProps(i.tabIndex,e,"disabledGroups",t),this.overflowDDB){var s=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+vo);if(i.group.enableGroupOverflow){var a=r.querySelector("#"+e+bo);a&&(o=(0,T.getInstance)(a,H.DropDownButton).target),o&&(t?o.classList.add("e-disabled"):o.classList.remove("e-disabled"))}else if(s){var l=s.querySelector("#"+e+go);l&&(t?l.classList.add("e-disabled"):l.classList.remove("e-disabled"))}}}},s.prototype.addCollection=function(e,t,o,i){var r=Zo(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?Uo(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 l=r.group.collections[parseInt(s.toString(),10)],p=this.createCollection([l],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 c=o?a.querySelector("#"+o):null;c?c.insertAdjacentElement(i?"afterend":"beforebegin",p):a.querySelector("#"+e+yo).append(p)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},s.prototype.removeCollection=function(e){var o=Yo(this.tabs,e);if(o){this.selectedTab===o.tabIndex&&this.clearOverflowResize();var i=this.tabObj.items[o.tabIndex].content;if(""!==i.innerHTML){var r=void 0,n=void 0;this.activeLayout===t.Simplified&&(n=(r=o.group.enableGroupOverflow?i.querySelector("#"+o.group.id+bo):null)?(0,T.getComponent)(r,H.DropDownButton):this.overflowDDB);for(var s=0,a=o.collection.items;s<a.length;s++){var l=a[s];this.removeItemElement(i,l,n)}var p=i.querySelector("#"+e);p&&p.remove()}var c=o.group,u=c.collections.slice();u.splice(o.collectionIndex,1),c.setProperties({collections:u},!0),this.selectedTab===o.tabIndex&&this.refreshLayout()}},s.prototype.addItem=function(e,t,o,i){var r=Yo(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?Uo(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,l=a.querySelector("#"+r.group.id+go);if(""!==a.innerHTML){var p=r.collection.items[parseInt(s.toString(),10)],c=this.createItems([p],r.group.orientation,r.group.id,r.group.header,r.group.enableGroupOverflow,r.tabIndex,l)[0];r.group.isCollapsed&&(a=this.ribbonDropDownModule.getOverflowDropDownPopup(r,a));var u=o?a.querySelector("#"+o):null;u?u.closest("."+xt).insertAdjacentElement(i?"afterend":"beforebegin",c):c&&a.querySelector("#"+e).append(c)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},s.prototype.removeItem=function(e){var o=Xo(this.tabs,e);if(o){this.selectedTab===o.tabIndex&&this.clearOverflowResize();var i=this.tabObj.items[o.tabIndex].content;if(""!==i.innerHTML){var r=void 0,n=void 0;this.activeLayout===t.Simplified&&(n=(r=o.group.enableGroupOverflow?i.querySelector("#"+o.group.id+bo):null)?(0,T.getComponent)(r,H.DropDownButton):this.overflowDDB);var s=o.item;this.removeItemElement(i,s,n)}var a=o.collection,l=a.items;l.splice(o.itemIndex,1),a.setProperties({items:l},!0),this.selectedTab===o.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,t){var o,i=Xo(this.tabs,e);if(i)if(o="GroupButton"===i.item.type?ei(this,e+Po,i):ei(this,e,i)){var r=(0,T.closest)(o,".e-ribbon-item");this.updateHiddenElements(i.tabIndex,t?"hideItem":"showItem",e,t,r,i.group),this.selectedTab===i.tabIndex&&this.refreshLayout()}else this.updateInitialProps(i.tabIndex,e,"hiddenItems",t)},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 c=l.items[parseInt(p.toString(),10)],u=void 0;if("GroupButton"===c.type){var d=Xo(this.tabs,c.id);u=ei(this,c.id+Po,d)}else u=ei(this,c.id);if(!(u?u.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 h=s.querySelectorAll("."+xt);h&&(i=this.checkEmptyCollection(h),s.classList[i?"add":"remove"]("e-ribbon-emptyCollection"))}},s.prototype.checkOverflowItems=function(e,t,o,i,r){var n;if(o){var s=t.querySelector("#"+r+bo);s&&(n=(0,T.getInstance)(s,H.DropDownButton).target),n&&(e?n.classList.add("e-hide-group"):n.classList.remove("e-hide-group"))}else if(this.overflowDDB){var a=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+vo);if(a){var l=a.querySelector("#"+r+go);l&&(e?l.classList.add("e-hide-group"):l.classList.remove("e-hide-group"))}}},s.prototype.updateTab=function(e){var t=e.id,o=Uo(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,s=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),s.querySelector(".e-active").classList.remove(this.tabs[parseInt(o.toString(),10)].cssClass)),e.groups)){for(var a=0,l=r;a<l.length;a++){for(var p=l[a],c=p.isCollapsed?i.querySelector("#"+p.id+vo+So):null,u=0,d=p.collections;u<d.length;u++)for(var h=0,b=d[u].items;h<b.length;h++){var f=b[h],m=c?this.ribbonDropDownModule.getDDBItemElement(c,f.id):i.querySelector("#"+f.id);f.type===n.GroupButton&&"Classic"===this.activeLayout&&(m=c?this.ribbonDropDownModule.getDDBItemElement(c,f.id+Po):i.querySelector("#"+f.id+Po)),m&&this.destroyFunction(f,m)}c&&this.ribbonDropDownModule.removeOverFlowDropDown(c)}i.querySelectorAll(".e-ribbon-group").forEach((function(e){e.remove()}))}o===this.selectedTab&&(this.isAddRemove=!0);var y=this.tabs[parseInt(o.toString(),10)];if(y.setProperties(e,!0),this.setProperties({groups:this.checkID(y.groups,"group",y.id)},!0),this.validateItemSize(),""===i.innerHTML){if(e.groups){var g=this.createGroups(y.groups,o);(0,T.append)(g,i)}this.selectedTab===o&&this.refreshLayout(),e.cssClass&&(i.classList.add(y.cssClass),s.querySelector(".e-active").classList.add(y.cssClass)),e.header&&(s.querySelector("#"+t+fo).innerText=y.header)}}},s.prototype.updateGroup=function(e){var o=e.id,i=Zo(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var r,n,s=this.tabObj.items[i.tabIndex].content,a=s.querySelector("#"+o),l=a.querySelector("#"+e.id+go);if(""!==s.innerHTML){if(i.group.showLauncherIcon&&this.removeLauncherIcon(i.group.id,null,s),this.activeLayout===t.Simplified&&(n=(r=i.group.enableGroupOverflow?s.querySelector("#"+i.group.id+bo):null)?(0,T.getComponent)(r,H.DropDownButton):this.overflowDDB),e.cssClass&&i.group.cssClass&&(a.classList.remove(i.group.cssClass),l&&l.classList.remove(i.group.cssClass)),(e.collections||e.orientation)&&(i.group.collections||i.group.orientation)){for(var p=0,c=i.group.collections;p<c.length;p++)for(var u=0,d=c[p].items;u<d.length;u++){var h=d[u];this.removeItemElement(s,h,n)}if(a.querySelectorAll(".e-ribbon-collection").forEach((function(e){e.remove()})),e.orientation){var b=(g=l.querySelector(".e-ribbon-group-content")).classList.value.match(/(e-ribbon-[column|row]+)/g);b&&(0,T.removeClass)([g],b)}}if(this.activeLayout===t.Simplified)if(i.group.enableGroupOverflow)(0===n.target.childElementCount||1===n.target.childElementCount&&this.isHeaderVisible(n.target,i.group.id))&&this.removeOverflowButton(n);else{var f=n.target.querySelector("#"+i.group.id+go);f&&1===f.childElementCount&&f.remove();var m=n.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+vo);m&&0===m.childElementCount&&m.remove()}}var y=i.group;if(y.setProperties(e,!0),y.setProperties({collections:this.checkID(y.collections,"collection",y.id)},!0),this.validateItemSize(),""!==s.innerHTML){if(e.showLauncherIcon&&this.createLauncherIcon(y.id,l,i.tabIndex),e.collections||e.orientation){var g;(g=l.querySelector(".e-ribbon-group-content")).classList.add("Column"===y.orientation||"Simplified"===this.activeLayout?Mt:_t);var v=this.createCollection(y.collections,y.orientation,y.id,y.header,y.enableGroupOverflow,i.tabIndex,l);(0,T.append)(v,g)}if(this.selectedTab===i.tabIndex&&this.refreshLayout(),e.cssClass&&(a.classList.add(y.cssClass),l&&l.classList.add(y.cssClass)),e.header)if(this.activeLayout!==t.Simplified||e.enableGroupOverflow)if(this.activeLayout!==t.Classic||y.isCollapsed){if(this.activeLayout===t.Classic&&y.isCollapsed){var S,I=a.querySelector("#"+y.id+vo+So);(S=(0,T.getInstance)(I,H.DropDownButton).target.querySelector("#"+e.id+fo))&&(S.innerText=y.header)}}else a.querySelector(".e-ribbon-group-header").innerText=y.header;else(S=n.target.querySelector("#"+e.id+fo))&&(S.innerText=y.header)}}},s.prototype.updateCollection=function(e){var o=e.id,i=Yo(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var r=this.tabObj.items[i.tabIndex].content,n=r.querySelector("#"+o);if(""!==r.innerHTML){var s=void 0,a=void 0;if(this.activeLayout===t.Simplified&&(a=(s=i.group.enableGroupOverflow?r.querySelector("#"+i.group.id+bo):null)?(0,T.getComponent)(s,H.DropDownButton):this.overflowDDB),e.cssClass&&i.collection.cssClass&&n.classList.remove(i.collection.cssClass),e.items&&i.collection.items)for(var l=0,p=i.collection.items;l<p.length;l++){var c=p[l];this.removeItemElement(r,c,a)}}var u=i.collection;if(u.setProperties(e,!0),u.setProperties({items:this.checkID(u.items,"item",u.id)},!0),this.validateItemSize(),""!==r.innerHTML&&e.items){var d=r.querySelector("#"+i.group.id+go),h=this.createItems(u.items,i.group.orientation,i.group.id,i.group.header,i.group.enableGroupOverflow,i.tabIndex,d);(0,T.append)(h,n)}this.selectedTab===i.tabIndex&&this.refreshLayout(),e.cssClass&&n.classList.add(u.cssClass)}},s.prototype.updateItem=function(e){var o=e.id,s=Xo(this.tabs,o);if(s){this.selectedTab===s.tabIndex&&this.clearOverflowResize();var a=this.tabObj.items[s.tabIndex].content,l=a.querySelector("#"+s.group.id);if(l){var p=l.querySelector("#"+s.group.id+go),c=null,u=null,d=void 0,h=void 0;if(""!==a.innerHTML){if(this.activeLayout===t.Simplified&&(h=(d=s.group.enableGroupOverflow?a.querySelector("#"+s.group.id+bo):null)?(0,T.getComponent)(d,H.DropDownButton):this.overflowDDB),this.activeLayout===t.Simplified&&s.item.displayOptions===r.Overflow){if(c=h.target.querySelector("#"+o+go),u=h.target.querySelector("#"+o),e.displayOptions&&e.displayOptions!==r.Overflow){var b=p.querySelector("#"+s.collection.id);b&&b.appendChild(c)}}else c=p.querySelector("#"+o+go),u=a.querySelector("#"+o),"GroupButton"===s.item.type&&this.activeLayout===t.Classic&&(u=a.querySelector("#"+o+Po)),this.activeLayout===t.Simplified&&e.displayOptions===r.Overflow&&(this.createOverflowPopup(s.item,s.tabIndex,s.group.enableGroupOverflow,s.group.id,s.group.header,c,p),s.item.type!==n.DropDown&&s.item.type!==n.SplitButton&&e.type!==n.GroupButton&&e.type!==n.Gallery||this.updatePopupItems(s.item,c,s.group.enableGroupOverflow,!0));e.cssClass&&s.item.cssClass&&c.classList.remove(s.item.cssClass),this.destroyFunction(s.item,u),u.remove();var f=c.classList.value.match(/(e-ribbon-[large|medium|small]+-item)/g);f&&(0,T.removeClass)([c],f)}var m=s.item;if(m.setProperties(e,!0),this.validateItemSize(),""!==a.innerHTML){c=this.activeLayout!==t.Simplified||m.displayOptions!==r.Overflow?p.querySelector("#"+o+go):h.target.querySelector("#"+o+go),m.ribbonTooltipSettings&&ti(m.ribbonTooltipSettings)&&(c.classList.add(Ft),this.tooltipData.push({id:c.id,data:m.ribbonTooltipSettings}));var y=m.activeSize;"Simplified"===this.activeLayout&&(y=m.allowedSizes===i.Large||m.allowedSizes&i.Medium||m.displayOptions===r.Overflow?i.Medium:i.Small,m.setProperties({activeSize:y},!0)),y&i.Large?c.classList.add(qt,jt):y&i.Medium?c.classList.add(Rt):c.classList.add(At),this.createRibbonItem(m,c),"Simplified"===this.activeLayout&&s.group.enableGroupOverflow&&(0===h.target.childElementCount||1===h.target.childElementCount&&this.isHeaderVisible(h.target,s.group.id))&&this.removeOverflowButton(h),this.selectedTab===s.tabIndex&&this.refreshLayout(),e.cssClass&&c.classList.add(m.cssClass),!m.disabled&&c.classList.contains(Ke)&&c.classList.remove(Ke),this.enableDisableItem(m.id,m.disabled)}}else this.isUpdateItems=!0,this.itemsModel.push(e),this.targetTabs[e.id]=s.tabIndex}},s.prototype.removeItemElement=function(e,o,i){var n=null;this.activeLayout===t.Classic?(n=o.displayOptions&r.Classic?e.querySelector("#"+o.id):null,"GroupButton"===o.type&&(n=o.displayOptions&r.Classic?e.querySelector("#"+o.id+Po):null)):(n=o.displayOptions&r.Simplified?e.querySelector("#"+o.id):null)||(n=i.target.querySelector("#"+o.id)),n&&(this.destroyFunction(o,n),"GroupButton"===o.type&&this.activeLayout===t.Simplified?document.getElementById(o.id+go).remove():n.closest("#"+o.id+go).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 Xo(this.tabs,e).item},s.prototype.enableDisableItem=function(e,t){var o,i=!1,r=Xo(this.tabs,e);if(r&&(r.item.setProperties({disabled:t},!0),o="GroupButton"===r.item.type?ei(this,e+Po,r):ei(this,e,r))){var n=(0,T.closest)(o,".e-ribbon-item"),s=this.getItemModuleName(r.item);if(i=t?!n.classList.contains(Ke):n.classList.contains(Ke),"template"!==s){if(i)if("group-btn"===s&&"Simplified"===this.activeLayout){$o(o,"dropdown-btn",t);for(var a=0;a<r.item.groupButtonSettings.items.length;a++){$o(document.querySelector("#"+e+Po+a),"btn",t)}}else if("group-btn"===s&&"Classic"===this.activeLayout)for(a=0;a<r.item.groupButtonSettings.items.length;a++){$o(o.querySelector("#"+e+Po+a),"btn",t)}else $o(o,s,t)}else o.classList.toggle(Ke,t),o.toggleAttribute("disabled",t);n.classList.toggle(Ke,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,ri(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&&((0,T.remove)(this.ribbonTempEle),this.ribbonTempEle=null),e.prototype.destroy.call(this),this.tabObj.destroy(),this.tabObj=void 0,this.initialPropsData={},this.hiddenGroups=[],this.hiddenElements={},this.keyTipElements={},this.itemsModel=[],this.targetTabs={},(0,T.remove)(this.element.querySelector("#"+this.element.id+ao)),this.element.style.removeProperty(Eo),this.element.style.removeProperty(Do),this.element.style.removeProperty("width"),this.cssClass&&(0,T.removeClass)([this.element],this.cssClass.split(Qe)),this.element.classList.remove(Ue,Zt,ut,at,ht,"e-rbn"),this.unwireEvents()},s.prototype.onPropertyChanged=function(e,t){for(var o,i,r=0,n=Object.keys(e);r<n.length;r++){switch(n[r]){case"activeLayout":this.switchLayout();break;case"cssClass":t.cssClass&&(o=this.element.classList).remove.apply(o,t.cssClass.split(Qe)),e.cssClass&&(i=this.element.classList).add.apply(i,e.cssClass.split(Qe));break;case"isMinimized":this.element.classList.toggle(ht,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(Ue,this.enableRtl),this.updateCommonProperty({enableRtl:e.enableRtl}),this.scrollModule&&this.scrollModule.setProperties({enableRtl:e.enableRtl});break;case"launcherIconCss":for(var s=0;s<this.tabs.length;s++){var a=this.tabObj.items[parseInt(s.toString(),10)].content,l=this.tabs[parseInt(s.toString(),10)];if(a.querySelector("."+bt))for(var p=0,c=l.groups;p<c.length;p++){var u=c[p];if(u.showLauncherIcon){var d=Lt+" "+(this.launcherIconCss||Et);if(u.isCollapsed){var h=a.querySelector("#"+u.id+vo+So);(0,T.getComponent)(h,H.DropDownButton).target.querySelector("#"+u.id+mo).className=d}else{(h=a.querySelector("#"+u.id+mo)).className=d}}}}break;case"selectedTab":var b=this.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(e.selectedTab.toString(),10)];b.classList.contains("e-hidden")||b.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(s=0;s<this.contextualTabs.length;s++)e.contextualTabs[parseInt(s.toString(),10)]&&this.ribbonContextualTabModule.updateContextualTabs(e.contextualTabs[parseInt(s.toString(),10)],this.contextualTabs[parseInt(s.toString(),10)]);break;case"width":this.element.style.width=(0,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&&((0,T.remove)(this.ribbonTempEle),this.ribbonTempEle=null,this.tabObj.element.style.setProperty(Do,"0px")),this.helpPaneTemplate&&this.createHelpPaneTemplate(),this.tabObj.tbObj.refreshOverflow();break;case"hideLayoutSwitcher":this.hideLayoutSwitcher?this.removeExpandCollapse():this.addExpandCollapse()}}},ci([(0,T.Property)("Classic")],s.prototype,"activeLayout",void 0),ci([(0,T.Property)("")],s.prototype,"cssClass",void 0),ci([(0,T.Property)(!1)],s.prototype,"enableKeyTips",void 0),ci([(0,T.Property)("")],s.prototype,"layoutSwitcherKeyTip",void 0),ci([(0,T.Complex)({},Te)],s.prototype,"fileMenu",void 0),ci([(0,T.Complex)({},qe)],s.prototype,"backStageMenu",void 0),ci([(0,T.Property)("")],s.prototype,"launcherIconCss",void 0),ci([(0,T.Property)(!1)],s.prototype,"isMinimized",void 0),ci([(0,T.Property)("en-us")],s.prototype,"locale",void 0),ci([(0,T.Property)(0)],s.prototype,"selectedTab",void 0),ci([(0,T.Complex)({},B.TabAnimationSettings)],s.prototype,"tabAnimation",void 0),ci([(0,T.Collection)([],we)],s.prototype,"tabs",void 0),ci([(0,T.Collection)([],je)],s.prototype,"contextualTabs",void 0),ci([(0,T.Property)("100%")],s.prototype,"width",void 0),ci([(0,T.Property)("")],s.prototype,"helpPaneTemplate",void 0),ci([(0,T.Property)(!1)],s.prototype,"hideLayoutSwitcher",void 0),ci([(0,T.Event)()],s.prototype,"tabSelecting",void 0),ci([(0,T.Event)()],s.prototype,"tabSelected",void 0),ci([(0,T.Event)()],s.prototype,"ribbonExpanding",void 0),ci([(0,T.Event)()],s.prototype,"ribbonCollapsing",void 0),ci([(0,T.Event)()],s.prototype,"launcherIconClick",void 0),ci([(0,T.Event)()],s.prototype,"created",void 0),ci([(0,T.Event)()],s.prototype,"overflowPopupOpen",void 0),ci([(0,T.Event)()],s.prototype,"overflowPopupClose",void 0),s=a=ci([T.NotifyPropertyChanges],s)}(T.Component),di=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+Io});var o=this.parent.tabObj.element,i=o.querySelector(".e-toolbar");o.insertBefore(this.ddbElement,i),this.fileMenuDDB=new H.DropDownButton({content:e.text,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-file-menu e-caret-hide",created:function(){o.style.setProperty(Eo,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){ti(e.ribbonTooltipSettings)&&(this.ddbElement.classList.add(Ft),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 t=this,o=this.parent.createElement("ul",{id:this.parent.element.id+Oo});this.fileMenuDDB.setProperties({target:o}),this.menuctrl=new B.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),T.EventHandler.add(o,"keydown",(function(e){"Tab"===e.key&&t.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(Eo,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(Eo),this.destroyMenu(),this.fileMenuDDB.destroy(),this.fileMenuDDB=null,(0,T.remove)(this.ddbElement),this.ddbElement=null},e.prototype.removeFileMenuTooltip=function(){var e=this,t=Uo(this.parent.tooltipData,(function(t){return t.id===e.ddbElement.id}));-1!==t&&(this.ddbElement.classList.remove(Ft),this.parent.tooltipData.splice(t,1))},e.prototype.removeFileMenuKeytip=function(){var e=this;if(this.parent.keyTipElements.filemenu){var t=Uo(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}(),hi=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])},e(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)}}(),bi=function(e){function t(t){var o=e.call(this)||this;return o.parent=t,o}return hi(t,e),t.prototype.render=function(){},t.prototype.preRender=function(){},t.prototype.getPersistData=function(){return""},t.prototype.onPropertyChanged=function(){},t.prototype.getModuleName=function(){return"ribbonBackstage"},t.prototype.destroy=function(){this.backstageButton&&this.destroyDDB(),this.parent=null},t.prototype.createBackStage=function(e){var t=this;if(e.visible){this.backstageButtonEle=this.parent.createElement("button",{id:this.parent.element.id+Co});var o=this.parent.tabObj.element,i=o.querySelector(".e-toolbar");if(o.insertBefore(this.backstageButtonEle,i),this.backstageButton=new Ge.Button({content:e.text,enableRtl:this.parent.enableRtl,cssClass:to,created:function(){o.style.setProperty(Eo,t.backstageButtonEle.offsetWidth+"px")}},this.backstageButtonEle),this.createBackStagePopup(e),this.parent.backStageMenu.template)this.createBackStageTemplate(this.parent.backStageMenu.template);else{for(var r=0,n=0,s=0;s<e.items.length;s++){e.items[parseInt(s.toString(),10)].isFooter?r++:n++}n>0&&this.createBackstageMenu(e,!1),r>0&&this.createBackstageMenu(e,!0),this.menuCtrl&&this.checkMenuItems(this.menuCtrl.items),this.footerMenuCtrl&&this.checkMenuItems(this.footerMenuCtrl.items)}this.backstageButtonEle.onclick=function(o){o.stopPropagation(),t.showBackstage(),t.popupHTMLElement.classList.add(Qt);var i=t.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&&t.menuCtrl.items[0].text===n.text){var s=t.popupHTMLElement.querySelector("#"+t.menuCtrl.items[0].id);s&&(s.classList.add("e-selected"),s.focus(),t.menuIndex=0,t.isCloseBtn=!1),t.createBackStageContent(t.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)}},t.prototype.onClickEvent=function(e){var t=e.target;this.popupHTMLElement.contains(t)||this.hideBackstage()},t.prototype.addBackStageMenuTooltip=function(e){ti(e.ribbonTooltipSettings)&&(this.backstageButtonEle.classList.add(Ft),this.parent.tooltipData.push({id:this.backstageButtonEle.id,data:e.ribbonTooltipSettings}))},t.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})}},t.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(so)}},t.prototype.createBackStagePopup=function(e){var t=this;this.popupHTMLElement=this.parent.createElement("div",{id:this.parent.element.id+wo,className:Jt}),e.target?(e.target instanceof HTMLElement?e.target:document.querySelector(e.target)).appendChild(this.popupHTMLElement):this.parent.element.appendChild(this.popupHTMLElement),this.popupEle=new Ho.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(),T.EventHandler.add(this.popupHTMLElement,"keyup",(function(e){"Escape"===e.code&&t.hideBackstage(),t.handleNavigation(e)}),this)},t.prototype.handleNavigation=function(e){var t=this.popupHTMLElement.querySelector(".e-ribbon-close-btn"),o=this.popupHTMLElement.querySelectorAll(".e-menu-item"),i="ArrowUp"===e.key,r="ArrowDown"===e.key;if(i||r){i&&this.menuIndex>0||r&&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 n=0;n<o.length;n++)o[parseInt(n.toString(),10)].classList.remove("e-focused");this.isCloseBtn||(i&&o[this.menuIndex].classList.contains("e-separator")?this.menuIndex--:r&&o[this.menuIndex].classList.contains("e-separator")&&this.menuIndex++,o[this.menuIndex].classList.add("e-focused"),o[this.menuIndex].focus())}},t.prototype.updatePopupPositionOnRtl=function(e){var t=this.popupHTMLElement.style;e?(t.right=t.left,t.left="unset"):(t.left=t.right,t.right="unset")},t.prototype.createBackstageMenu=function(e,t){var o,i=this;if(this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_wrapper")||(this.menuWrapper=this.parent.createElement("div",{id:this.parent.element.id+"_wrapper",className:ro}),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 Ge.Button({content:e.backButton.text,iconCss:e.backButton.iconCss?e.backButton.iconCss:We,enableRtl:this.parent.enableRtl},r),this.menuWrapper.append(r),r.onclick=function(){i.popupHTMLElement.classList.remove(Qt),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:no}),this.menuWrapper.append(this.itemsWrapperEle)),t?(o=this.parent.createElement("ul",{id:this.parent.element.id+To}),this.itemsWrapperEle.appendChild(o)):(this.ulMenuElem=this.parent.createElement("ul",{id:this.parent.element.id+ko}),this.itemsWrapperEle.appendChild(this.ulMenuElem)),t?this.footerMenuCtrl=new B.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:oo,items:this.cloneFooterMenuItem(e.items),select:this.menuSelect.bind(this,e)},o):this.menuCtrl=new B.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:oo,items:this.cloneMenuItem(e.items),select:this.menuSelect.bind(this,e)},this.ulMenuElem)},t.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},t.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},t.prototype.createBackStageContent=function(e,t){var o="backstageContent";this.clearTemplate([o]),this.backstageContentEle?(this.backstageContentEle.innerHTML="",this.backstageContentEle.id=e+yo):this.backstageContentEle=this.parent.createElement("div",{id:e+yo,className:$t});var i=Vo(t);return(0,T.append)(i({},this,o,"backstageContent",this.parent.isStringTemplate),this.backstageContentEle),t&&this.popupHTMLElement.append(this.backstageContentEle),this.renderReactTemplates(),i},t.prototype.createBackStageTemplate=function(e){var t="backstageTemplate";this.clearTemplate([t]),this.backstageTempEle=this.parent.createElement("div",{id:this.parent.element.id+Co+"_template",className:io});var o=Vo(e);return(0,T.append)(o({},this,t,"backstageTemplate",this.parent.isStringTemplate),this.backstageTempEle),this.popupHTMLElement.append(this.backstageTempEle),this.renderReactTemplates(),o},t.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)},t.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)))},t.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(Eo,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&&((0,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 t=0,o=0,i=0;i<e.items.length;i++){e.items[parseInt(i.toString(),10)].isFooter?t++:o++}o>0&&this.createBackstageMenu(e,!1),t>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()},t.prototype.destroyMenu=function(){this.menuCtrl&&(this.menuCtrl.destroy(),this.menuCtrl=null)},t.prototype.destroyDDB=function(){this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip(),this.parent.tabObj.element.style.removeProperty(Eo),this.destroyMenu(),this.backstageButton.destroy(),this.backstageButton=null,(0,T.remove)(this.backstageButtonEle),this.backstageButtonEle=null,T.EventHandler.remove(document,"click",this.onClickEvent)},t.prototype.removeBackstageMenuTooltip=function(){var e=this,t=Uo(this.parent.tooltipData,(function(t){return t.id===e.backstageButtonEle.id}));-1!==t&&(this.backstageButtonEle.classList.remove(Ft),this.parent.tooltipData.splice(t,1))},t.prototype.removeBackstageMenuKeyTip=function(){var e=this;if(this.parent.keyTipElements.backstage&&this.parent.keyTipElements.backstage.length){var t=Uo(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--},t.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)},t.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)},t.prototype.showBackstage=function(){this.popupEle.show()},t.prototype.hideBackstage=function(){this.popupEle.element.classList.contains(Qt)&&this.popupEle.element.classList.remove(Qt),this.popupEle.hide()},t}(T.Component),fi=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(ot),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,t){if(!(0,T.isNullOrUndefined)(e.visible))for(var o=0;o<t.tabs.length;o++)e.visible?this.parent.showTab(t.tabs[parseInt(o.toString(),10)].id,!0):this.parent.hideTab(t.tabs[parseInt(o.toString(),10)].id,!0);if(!(0,T.isNullOrUndefined)(e.isSelected))if(e.isSelected&&t.visible)this.parent.selectTab(t.tabs[0].id);else{var i=this.parent.tabObj.element;for(o=0;o<this.parent.tabs.length;o++){var r=i.querySelectorAll(".e-toolbar-item")[parseInt(o.toString(),10)];if(!r.classList.contains("e-hidden")&&!r.classList.contains("e-disable")){this.parent.selectTab(this.parent.tabs[parseInt(o.toString(),10)].id);break}}}if(e.tabs)for(var n=function(e){var o=parseInt(e,10),i=s.parent.tabs.filter((function(e){return e.id===t.tabs[parseInt(o.toString(),10)].id}))[0];s.parent.updateTab(i)},s=this,a=0,l=Object.keys(e.tabs);a<l.length;a++){n(l[a])}},e}(),mi=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[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){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){var i,r;void 0===t&&(t=!1);var n=this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][""+e];if(n)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;-1!==n[parseInt(s.toString(),10)].id.indexOf("_grpbtn")&&(a=n[parseInt(s.toString(),10)].id.replace(/_grpbtn\d+/,""));var l=Xo(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 a,l=document.querySelector("#"+e),p=!1;(n&&(l=document.querySelector("#"+e+fo)),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));if((l&&l.offsetParent||n&&s)&&(s&&p||!s)){var c=this.parent.createElement("div",{className:Je,id:e+Lo});document.body.append(c),new Ho.Popup(c,{relateTo:"#"+(n?e+fo:a||e),content:t,collision:{X:"fit",Y:"flip"},targetType:"relative",position:{X:i,Y:r},enableRtl:this.parent.enableRtl}).show(),this.calculateKeyTipPosition(l,c,o,r),this.parent.isKeytipOpen=!0}},e.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")},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<Object.keys(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(-1!==n[parseInt(s.toString(),10)].id.indexOf("_popupButton")){var l=n[parseInt(s.toString(),10)].id.replace(/_popupButton/g,"");a=Xo(this.parent.tabs,l)}else a=Xo(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 c=n[parseInt(s.toString(),10)].id;if(t){if(-1!==n[parseInt(s.toString(),10)].id.indexOf("_launcher")||-1!==n[parseInt(s.toString(),10)].id.indexOf("_sim_grp_overflow")||-1!==n[parseInt(s.toString(),10)].id.indexOf("_overflow_dropdown"))c=n[parseInt(s.toString(),10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g,""),(a=Zo(this.parent.tabs,c)).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,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+ho+"-popup")&&document.querySelector("#"+s).closest("#"+this.parent.tabObj.element.id+ho+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+this.parent.tabObj.element.id+ho).click():document.querySelector("#"+s).closest("#"+e.group.id+vo+So+"-popup")&&document.querySelector("#"+s).closest("#"+e.group.id+vo+So+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+e.group.id+vo+So).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){(0,T.getInstance)(l,H.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+(Po+p),e.item.groupButtonSettings.items[parseInt(p.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 t=this,o=document.querySelectorAll(".e-ribbon-keytip"),i=!1;this.parent.keysPress="";for(var r=function(r){var s=o[parseInt(r.toString(),10)];if("Escape"===e&&n.parent.keyTipElements&&n.parent.keyTipElements[n.parent.selectedTab]){for(var a=0;a<Object.keys(n.parent.keyTipElements[n.parent.selectedTab]).length;a++){var l=Object.keys(n.parent.keyTipElements[parseInt(n.parent.selectedTab.toString(),10)])[parseInt(a.toString(),10)];if(-1!==Uo(n.parent.keyTipElements[parseInt(n.parent.selectedTab.toString(),10)][""+l],(function(e){return e.id+Lo===o[parseInt(r.toString(),10)].id}))){if("item"===l&&!n.isKeytipPopupOpen||"grpoverflow"===l&&"Classic"===n.parent.activeLayout){n.createKeytip("tab"),e="",i=!0;break}if(n.isKeytipPopupOpen&&("popupitem"===l&&"Simplified"===n.parent.activeLayout||"grpoverflowpopup"===l&&"Classic"===n.parent.activeLayout)){n.createKeytip("item"),e="",i=!0;break}}}for(var p=0;p<Object.keys(n.parent.keyTipElements).length;p++)if(n.parent.keyTipElements[parseInt(p.toString(),10)]){var c=n.parent.keyTipElements[parseInt(p.toString(),10)].tab;for(a=0;a<Object.keys(c).length;a++)if(s.id===c[0].id+Lo&&document.querySelector("#"+c[0].id+fo).closest(".e-toolbar-pop")){n.parent.tabObj.element.querySelector(".e-nav-active").click(),setTimeout((function(){t.createKeytip("tab")}),600),e="",i=!0;break}if(i)break}if(!i&&n.parent.keyTipElements.backstageMenu)-1!==Uo(n.parent.keyTipElements.backstageMenu,(function(e){return e.id+Lo===o[parseInt(r.toString(),10)].id}))&&(n.createKeytip("tab"),e="",i=!0)}s&&(0,T.remove)(s)},n=this,s=0;s<o.length;s++)r(s);this.isKeytipPopupOpen=!1,i||(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}(),yi=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])},e(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)}}(),gi=function(e){function t(t){var o=e.call(this,t)||this;return o.initRenderCalled=!1,o.checkInjectedModules=!0,o.directivekeys={ribbonTabs:{ribbonTab:{ribbonGroups:{ribbonGroup:{ribbonCollections:{ribbonCollection:{ribbonItems:"ribbonItem"}}}}}},ribbonContextualTabs:{ribbonContextualTab:{ribbonTabs:{ribbonTab:{ribbonGroups:{ribbonGroup:{ribbonCollections:{ribbonCollection:{ribbonItems:"ribbonItem"}}}}}}}}},o.statelessTemplateProps=null,o.templateProps=null,o.immediateRender=!1,o.portals=[],o}return yi(t,e),t.prototype.render=function(){if(!(this.element&&!this.initRenderCalled||this.refreshing)||this.isReactForeceUpdate)return k.createElement("div",this.getDefaultAttributes(),[].concat(this.props.children,this.portals));e.prototype.render.call(this),this.initRenderCalled=!0},t}(ui);(0,a.applyMixins)(gi,[a.ComponentBase,k.Component])})(),d})()));
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionReactBase"),require("React"),require("SyncfusionBase"),require("SyncfusionNavigations"),require("SyncfusionDropdowns"),require("SyncfusionSplitbuttons"),require("SyncfusionButtons"),require("SyncfusionInputs"),require("SyncfusionPopups")):"function"==typeof define&&define.amd?define(["SyncfusionReactBase","React","SyncfusionBase","SyncfusionNavigations","SyncfusionDropdowns","SyncfusionSplitbuttons","SyncfusionButtons","SyncfusionInputs","SyncfusionPopups"],t):"object"==typeof exports?exports.SyncfusionReactRibbon=t(require("SyncfusionReactBase"),require("React"),require("SyncfusionBase"),require("SyncfusionNavigations"),require("SyncfusionDropdowns"),require("SyncfusionSplitbuttons"),require("SyncfusionButtons"),require("SyncfusionInputs"),require("SyncfusionPopups")):e.SyncfusionReactRibbon=t(e.SyncfusionReactBase,e.React,e.SyncfusionBase,e.SyncfusionNavigations,e.SyncfusionDropdowns,e.SyncfusionSplitbuttons,e.SyncfusionButtons,e.SyncfusionInputs,e.SyncfusionPopups)}(self,((e,t,o,i,r,n,s,a,l)=>(()=>{"use strict";var p={24:e=>{e.exports=t},766:e=>{e.exports=o},741:e=>{e.exports=s},778:e=>{e.exports=r},323:e=>{e.exports=a},215:e=>{e.exports=i},197:e=>{e.exports=l},705:t=>{t.exports=e},295:e=>{e.exports=n}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var o=c[e]={exports:{}};return p[e](o,o.exports,u),o.exports}u.d=(e,t)=>{for(var o in t)u.o(t,o)&&!u.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return(()=>{u.r(d),u.d(d,{BACKSTAGE_CLOSE_ICON:()=>We,BackStageMenu:()=>qe,BackstageBackButton:()=>Le,BackstageItem:()=>xe,COLLAPSE_BUTTON_ID:()=>uo,COLLECTION_ID:()=>po,CONTAINER_ID:()=>go,CONTENT_ID:()=>yo,DISABLED_CSS:()=>Ke,DROPDOWNBUTTON:()=>Gt,DROPDOWNBUTTON_HIDE:()=>Nt,DROPDOWN_ID:()=>So,DisplayMode:()=>r,EXPAND_COLLAPSE_ICON:()=>He,FileMenuSettings:()=>Te,GROUPOF_BUTTON_ID:()=>bo,GROUP_ID:()=>lo,HEADER_ID:()=>fo,HIDE_CSS:()=>et,HORIZONTAL_SCROLLBAR:()=>$e,ITEM_ID:()=>co,ITEM_VERTICAL_CENTER:()=>Ne,Inject:()=>a.Inject,ItemOrientation:()=>o,LAUNCHER_ID:()=>mo,OVERFLOW_ICON:()=>ze,OVERFLOW_ID:()=>vo,OVRLOF_BUTTON_ID:()=>ho,RIBBON_BACKSTAGE:()=>to,RIBBON_BACKSTAGE_CONTENT:()=>$t,RIBBON_BACKSTAGE_ITEMS_WRAPPER:()=>no,RIBBON_BACKSTAGE_MENU:()=>oo,RIBBON_BACKSTAGE_MENU_ID:()=>Co,RIBBON_BACKSTAGE_MENU_WRAPPER:()=>ro,RIBBON_BACKSTAGE_OPEN:()=>Qt,RIBBON_BACKSTAGE_POPUP:()=>Jt,RIBBON_BACKSTAGE_POPUP_ID:()=>wo,RIBBON_BACKSTAGE_TEMPLATE:()=>io,RIBBON_BACKSTAGE_TEXT_MENU:()=>so,RIBBON_COLLAPSE_BUTTON:()=>nt,RIBBON_COLLAPSIBLE:()=>at,RIBBON_COLLECTION:()=>Dt,RIBBON_COLUMN:()=>Mt,RIBBON_CONTENT_HEIGHT:()=>jt,RIBBON_CONTEXTUAL_TAB:()=>ot,RIBBON_CONTROL:()=>Xe,RIBBON_EXPAND_BUTTON:()=>st,RIBBON_FILE_MENU_ID:()=>Io,RIBBON_FILE_MENU_LIST:()=>Oo,RIBBON_FILE_MENU_WIDTH:()=>Eo,RIBBON_FOOTER_MENU_LIST:()=>To,RIBBON_GROUP:()=>bt,RIBBON_GROUP_BUTTON:()=>yt,RIBBON_GROUP_BUTTON_CONTENT:()=>vt,RIBBON_GROUP_BUTTON_ID:()=>Po,RIBBON_GROUP_BUTTON_OVERFLOW_POPUP:()=>gt,RIBBON_GROUP_CONTAINER:()=>St,RIBBON_GROUP_CONTENT:()=>wt,RIBBON_GROUP_HEADER:()=>Ot,RIBBON_GROUP_OF_BUTTON:()=>pt,RIBBON_GROUP_OVERFLOW:()=>Tt,RIBBON_GROUP_OVERFLOW_DDB:()=>Bt,RIBBON_HELP_PANE_TEMPLATE_ID:()=>Bo,RIBBON_HELP_PANE_TEMPLATE_WIDTH:()=>Do,RIBBON_HELP_TEMPLATE:()=>Wt,RIBBON_HOVER:()=>Ve,RIBBON_ITEM:()=>xt,RIBBON_KEYTIP:()=>Je,RIBBON_KEYTIP_ID:()=>Lo,RIBBON_LARGE_ITEM:()=>qt,RIBBON_LAUNCHER:()=>Pt,RIBBON_LAUNCHER_ICON:()=>Et,RIBBON_LAUNCHER_ICON_ELE:()=>Lt,RIBBON_MEDIUM_ITEM:()=>Rt,RIBBON_MENU_LIST:()=>ko,RIBBON_MINIMIZE:()=>ht,RIBBON_MULTIPLE_BUTTON_SELECTION:()=>mt,RIBBON_OF_GROUP_CONTAINER:()=>Ct,RIBBON_OF_TAB_CONTAINER:()=>It,RIBBON_OVERALL_OF_BUTTON:()=>lt,RIBBON_OVERFLOW:()=>ut,RIBBON_OVERFLOW_HEADER:()=>kt,RIBBON_OVERFLOW_TARGET:()=>ct,RIBBON_POPUP_CONTROL:()=>Ye,RIBBON_POPUP_OPEN:()=>Ze,RIBBON_ROW:()=>_t,RIBBON_SELECTED_CONTENT:()=>eo,RIBBON_SIMPLIFIED_MODE:()=>Zt,RIBBON_SINGLE_BUTTON_SELECTION:()=>ft,RIBBON_SMALL_ITEM:()=>At,RIBBON_TAB:()=>tt,RIBBON_TAB_ACTIVE:()=>it,RIBBON_TAB_ITEM:()=>rt,RIBBON_TEMPLATE:()=>Ht,RIBBON_TEXT_CONTAINER:()=>Yt,RIBBON_TOOLTIP:()=>zt,RIBBON_TOOLTIP_CONTAINER:()=>Xt,RIBBON_TOOLTIP_CONTENT:()=>Ut,RIBBON_TOOLTIP_ICON:()=>Vt,RIBBON_TOOLTIP_TARGET:()=>Ft,RIBBON_TOOLTIP_TITLE:()=>Kt,RTL_CSS:()=>Ue,Ribbon:()=>ui,RibbonBackstage:()=>bi,RibbonButton:()=>_o,RibbonButtonSettings:()=>E,RibbonCheckBox:()=>qo,RibbonCheckBoxSettings:()=>_,RibbonCollection:()=>ye,RibbonCollectionDirective:()=>y,RibbonCollectionsDirective:()=>g,RibbonColorPicker:()=>jo,RibbonColorPickerSettings:()=>R,RibbonComboBox:()=>No,RibbonComboBoxSettings:()=>N,RibbonComponent:()=>gi,RibbonContextualTab:()=>fi,RibbonContextualTabDirective:()=>w,RibbonContextualTabSettings:()=>je,RibbonContextualTabsDirective:()=>O,RibbonDropDown:()=>zo,RibbonDropDownSettings:()=>F,RibbonFileMenu:()=>di,RibbonGallery:()=>li,RibbonGalleryGroup:()=>le,RibbonGalleryItem:()=>ne,RibbonGallerySettings:()=>ue,RibbonGroup:()=>Se,RibbonGroupButton:()=>ai,RibbonGroupButtonItem:()=>$,RibbonGroupButtonSelection:()=>s,RibbonGroupButtonSettings:()=>oe,RibbonGroupDirective:()=>b,RibbonGroupsDirective:()=>f,RibbonItem:()=>be,RibbonItemDirective:()=>S,RibbonItemSize:()=>i,RibbonItemType:()=>n,RibbonItemsDirective:()=>I,RibbonKeyTip:()=>mi,RibbonLayout:()=>t,RibbonSplitButton:()=>Ko,RibbonSplitButtonSettings:()=>V,RibbonTab:()=>we,RibbonTabDirective:()=>p,RibbonTabsDirective:()=>c,RibbonTooltip:()=>Z,SPACE:()=>Qe,TAB_CONTENT:()=>dt,TAB_ID:()=>ao,VERTICAL_DDB:()=>Fe,createTooltip:()=>ii,destroyControl:()=>Jo,destroyTooltip:()=>ri,getCollection:()=>Yo,getGroup:()=>Zo,getIndex:()=>Uo,getItem:()=>Xo,getItemElement:()=>ei,getTemplateFunction:()=>Vo,isTooltipPresent:()=>ti,setCustomAttributes:()=>si,setToolTipContent:()=>oi,updateCommonProperty:()=>Qo,updateControlDisabled:()=>$o,updateTooltipProp:()=>ni});var e,t,o,i,r,n,s,a=u(705),l=(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])},e(t,o)},function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.moduleName="ribbonTab",t}(a.ComplexBase),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.propertyName="tabs",t.moduleName="ribbonTabs",t}(a.ComplexBase),h=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])},e(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){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),t.moduleName="ribbonGroup",t}(a.ComplexBase),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),t.propertyName="groups",t.moduleName="ribbonGroups",t}(a.ComplexBase),m=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])},e(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)}}(),y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return m(t,e),t.moduleName="ribbonCollection",t}(a.ComplexBase),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return m(t,e),t.propertyName="collections",t.moduleName="ribbonCollections",t}(a.ComplexBase),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])},e(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)}}(),S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.moduleName="ribbonItem",t}(a.ComplexBase),I=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.propertyName="items",t.moduleName="ribbonItems",t}(a.ComplexBase),C=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])},e(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){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t.moduleName="ribbonContextualTab",t}(a.ComplexBase),O=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t.propertyName="contextualTabs",t.moduleName="ribbonContextualTabs",t}(a.ComplexBase),k=u(24),T=u(766),B=u(215);!function(e){e.Classic="Classic",e.Simplified="Simplified"}(t||(t={})),function(e){e.Row="Row",e.Column="Column"}(o||(o={})),function(e){e[e.Large=4]="Large",e[e.Medium=2]="Medium",e[e.Small=1]="Small"}(i||(i={})),function(e){e[e.Classic=4]="Classic",e[e.Simplified=2]="Simplified",e[e.Overflow=1]="Overflow",e[e.Auto=7]="Auto"}(r||(r={})),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"}(n||(n={})),function(e){e.Single="Single",e.Multiple="Multiple"}(s||(s={}));var P=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])},e(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)}}(),L=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},E=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return P(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},L([(0,T.Property)("")],t.prototype,"content",void 0),L([(0,T.Property)("")],t.prototype,"cssClass",void 0),L([(0,T.Property)("")],t.prototype,"iconCss",void 0),L([(0,T.Property)(!1)],t.prototype,"isToggle",void 0),L([(0,T.Property)(!1)],t.prototype,"isPrimary",void 0),L([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),L([(0,T.Event)()],t.prototype,"created",void 0),L([(0,T.Event)()],t.prototype,"clicked",void 0),t}(T.ChildProperty),D=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])},e(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},_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return D(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},x([(0,T.Property)(!1)],t.prototype,"checked",void 0),x([(0,T.Property)("")],t.prototype,"cssClass",void 0),x([(0,T.Property)("")],t.prototype,"label",void 0),x([(0,T.Property)("After")],t.prototype,"labelPosition",void 0),x([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),x([(0,T.Event)()],t.prototype,"created",void 0),x([(0,T.Event)()],t.prototype,"change",void 0),t}(T.ChildProperty),M=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])},e(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},R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},q([(0,T.Property)(10)],t.prototype,"columns",void 0),q([(0,T.Property)("")],t.prototype,"cssClass",void 0),q([(0,T.Property)("")],t.prototype,"label",void 0),q([(0,T.Property)(!0)],t.prototype,"enableOpacity",void 0),q([(0,T.Property)("Palette")],t.prototype,"mode",void 0),q([(0,T.Property)(!0)],t.prototype,"modeSwitcher",void 0),q([(0,T.Property)(!1)],t.prototype,"noColor",void 0),q([(0,T.Property)(null)],t.prototype,"presetColors",void 0),q([(0,T.Property)(!0)],t.prototype,"showButtons",void 0),q([(0,T.Property)("#008000ff")],t.prototype,"value",void 0),q([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),q([(0,T.Event)()],t.prototype,"beforeClose",void 0),q([(0,T.Event)()],t.prototype,"beforeOpen",void 0),q([(0,T.Event)()],t.prototype,"beforeTileRender",void 0),q([(0,T.Event)()],t.prototype,"created",void 0),q([(0,T.Event)()],t.prototype,"change",void 0),q([(0,T.Event)()],t.prototype,"open",void 0),q([(0,T.Event)()],t.prototype,"select",void 0),t}(T.ChildProperty),A=u(778),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])},e(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},N=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},G([(0,T.Property)(!1)],t.prototype,"allowFiltering",void 0),G([(0,T.Property)(!0)],t.prototype,"autofill",void 0),G([(0,T.Property)("")],t.prototype,"cssClass",void 0),G([(0,T.Property)("")],t.prototype,"label",void 0),G([(0,T.Property)([])],t.prototype,"dataSource",void 0),G([(0,T.Complex)({text:null,value:null,iconCss:null,groupBy:null},A.FieldSettings)],t.prototype,"fields",void 0),G([(0,T.Property)("Contains")],t.prototype,"filterType",void 0),G([(0,T.Property)(null)],t.prototype,"footerTemplate",void 0),G([(0,T.Property)(null)],t.prototype,"groupTemplate",void 0),G([(0,T.Property)(null)],t.prototype,"headerTemplate",void 0),G([(0,T.Property)(null)],t.prototype,"index",void 0),G([(0,T.Property)(null)],t.prototype,"itemTemplate",void 0),G([(0,T.Property)("No records found")],t.prototype,"noRecordsTemplate",void 0),G([(0,T.Property)(null)],t.prototype,"placeholder",void 0),G([(0,T.Property)("300px")],t.prototype,"popupHeight",void 0),G([(0,T.Property)("100%")],t.prototype,"popupWidth",void 0),G([(0,T.Property)(!0)],t.prototype,"showClearButton",void 0),G([(0,T.Property)("None")],t.prototype,"sortOrder",void 0),G([(0,T.Property)(null)],t.prototype,"text",void 0),G([(0,T.Property)(null)],t.prototype,"value",void 0),G([(0,T.Property)("150px")],t.prototype,"width",void 0),G([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),G([(0,T.Event)()],t.prototype,"beforeOpen",void 0),G([(0,T.Event)()],t.prototype,"change",void 0),G([(0,T.Event)()],t.prototype,"close",void 0),G([(0,T.Event)()],t.prototype,"created",void 0),G([(0,T.Event)()],t.prototype,"filtering",void 0),G([(0,T.Event)()],t.prototype,"open",void 0),G([(0,T.Event)()],t.prototype,"select",void 0),t}(T.ChildProperty),H=u(295),W=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])},e(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)}}(),z=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},F=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return W(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},z([(0,T.Property)("")],t.prototype,"closeActionEvents",void 0),z([(0,T.Property)("")],t.prototype,"content",void 0),z([(0,T.Property)("")],t.prototype,"cssClass",void 0),z([(0,T.Property)("")],t.prototype,"iconCss",void 0),z([(0,T.Collection)([],H.Item)],t.prototype,"items",void 0),z([(0,T.Property)("")],t.prototype,"target",void 0),z([(0,T.Property)(!1)],t.prototype,"createPopupOnClick",void 0),z([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),z([(0,T.Event)()],t.prototype,"beforeClose",void 0),z([(0,T.Event)()],t.prototype,"beforeItemRender",void 0),z([(0,T.Event)()],t.prototype,"beforeOpen",void 0),z([(0,T.Event)()],t.prototype,"close",void 0),z([(0,T.Event)()],t.prototype,"created",void 0),z([(0,T.Event)()],t.prototype,"open",void 0),z([(0,T.Event)()],t.prototype,"select",void 0),t}(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])},e(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)}}(),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;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},V=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return K(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},U([(0,T.Property)("")],t.prototype,"closeActionEvents",void 0),U([(0,T.Property)("")],t.prototype,"content",void 0),U([(0,T.Property)("")],t.prototype,"cssClass",void 0),U([(0,T.Property)("")],t.prototype,"iconCss",void 0),U([(0,T.Collection)([],H.Item)],t.prototype,"items",void 0),U([(0,T.Property)("")],t.prototype,"target",void 0),U([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),U([(0,T.Event)()],t.prototype,"beforeClose",void 0),U([(0,T.Event)()],t.prototype,"beforeItemRender",void 0),U([(0,T.Event)()],t.prototype,"beforeOpen",void 0),U([(0,T.Event)()],t.prototype,"close",void 0),U([(0,T.Event)()],t.prototype,"click",void 0),U([(0,T.Event)()],t.prototype,"created",void 0),U([(0,T.Event)()],t.prototype,"open",void 0),U([(0,T.Event)()],t.prototype,"select",void 0),t}(T.ChildProperty),X=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])},e(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)}}(),Y=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 t(){return null!==e&&e.apply(this,arguments)||this}return X(t,e),Y([(0,T.Property)("")],t.prototype,"cssClass",void 0),Y([(0,T.Property)("")],t.prototype,"id",void 0),Y([(0,T.Property)("")],t.prototype,"title",void 0),Y([(0,T.Property)("")],t.prototype,"content",void 0),Y([(0,T.Property)("")],t.prototype,"iconCss",void 0),t}(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])},e(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},$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return J(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Q([(0,T.Property)("")],t.prototype,"content",void 0),Q([(0,T.Property)("")],t.prototype,"iconCss",void 0),Q([(0,T.Property)("")],t.prototype,"keyTip",void 0),Q([(0,T.Complex)({},Z)],t.prototype,"ribbonTooltipSettings",void 0),Q([(0,T.Property)(!1)],t.prototype,"selected",void 0),Q([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),Q([(0,T.Event)()],t.prototype,"beforeClick",void 0),Q([(0,T.Event)()],t.prototype,"click",void 0),t}(T.ChildProperty),ee=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])},e(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)}}(),te=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},oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),te([(0,T.Property)("")],t.prototype,"header",void 0),te([(0,T.Property)("Single")],t.prototype,"selection",void 0),te([(0,T.Collection)([],$)],t.prototype,"items",void 0),t}(T.ChildProperty),ie=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])},e(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)}}(),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;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},ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ie(t,e),re([(0,T.Property)("")],t.prototype,"content",void 0),re([(0,T.Property)("")],t.prototype,"iconCss",void 0),re([(0,T.Property)({})],t.prototype,"htmlAttributes",void 0),re([(0,T.Property)("")],t.prototype,"cssClass",void 0),re([(0,T.Property)(!1)],t.prototype,"disabled",void 0),t}(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])},e(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)}}(),ae=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},le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return se(t,e),ae([(0,T.Collection)([],ne)],t.prototype,"items",void 0),ae([(0,T.Property)("")],t.prototype,"header",void 0),ae([(0,T.Property)("auto")],t.prototype,"itemWidth",void 0),ae([(0,T.Property)("auto")],t.prototype,"itemHeight",void 0),ae([(0,T.Property)("")],t.prototype,"cssClass",void 0),t}(T.ChildProperty),pe=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])},e(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)}}(),ce=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},ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return pe(t,e),ce([(0,T.Collection)([],le)],t.prototype,"groups",void 0),ce([(0,T.Property)(3)],t.prototype,"itemCount",void 0),ce([(0,T.Property)(null)],t.prototype,"selectedItemIndex",void 0),ce([(0,T.Property)("auto")],t.prototype,"popupHeight",void 0),ce([(0,T.Property)("auto")],t.prototype,"popupWidth",void 0),ce([(0,T.Property)("")],t.prototype,"template",void 0),ce([(0,T.Property)("")],t.prototype,"popupTemplate",void 0),ce([(0,T.Event)()],t.prototype,"popupOpen",void 0),ce([(0,T.Event)()],t.prototype,"popupClose",void 0),ce([(0,T.Event)()],t.prototype,"itemHover",void 0),ce([(0,T.Event)()],t.prototype,"beforeItemRender",void 0),ce([(0,T.Event)()],t.prototype,"beforeSelect",void 0),ce([(0,T.Event)()],t.prototype,"select",void 0),t}(T.ChildProperty),de=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])},e(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)}}(),he=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},be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return de(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},he([(0,T.Property)("")],t.prototype,"keyTip",void 0),he([(0,T.Property)(i.Medium)],t.prototype,"activeSize",void 0),he([(0,T.Property)(i.Small|i.Medium|i.Large)],t.prototype,"allowedSizes",void 0),he([(0,T.Property)("")],t.prototype,"id",void 0),he([(0,T.Property)("")],t.prototype,"cssClass",void 0),he([(0,T.Property)(!1)],t.prototype,"disabled",void 0),he([(0,T.Property)("")],t.prototype,"itemTemplate",void 0),he([(0,T.Property)("Button")],t.prototype,"type",void 0),he([(0,T.Property)(r.Auto)],t.prototype,"displayOptions",void 0),he([(0,T.Complex)({},Z)],t.prototype,"ribbonTooltipSettings",void 0),he([(0,T.Complex)({},E)],t.prototype,"buttonSettings",void 0),he([(0,T.Complex)({},F)],t.prototype,"dropDownSettings",void 0),he([(0,T.Complex)({},_)],t.prototype,"checkBoxSettings",void 0),he([(0,T.Complex)({},R)],t.prototype,"colorPickerSettings",void 0),he([(0,T.Complex)({},N)],t.prototype,"comboBoxSettings",void 0),he([(0,T.Complex)({},V)],t.prototype,"splitButtonSettings",void 0),he([(0,T.Complex)({},oe)],t.prototype,"groupButtonSettings",void 0),he([(0,T.Complex)({},ue)],t.prototype,"gallerySettings",void 0),t}(T.ChildProperty),fe=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])},e(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},ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fe(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},me([(0,T.Property)("")],t.prototype,"id",void 0),me([(0,T.Property)("")],t.prototype,"cssClass",void 0),me([(0,T.Collection)([],be)],t.prototype,"items",void 0),t}(T.ChildProperty),ge=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])},e(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)}}(),ve=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},Se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ge(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},ve([(0,T.Property)("")],t.prototype,"keyTip",void 0),ve([(0,T.Property)("")],t.prototype,"launcherIconKeyTip",void 0),ve([(0,T.Collection)([],ye)],t.prototype,"collections",void 0),ve([(0,T.Property)("")],t.prototype,"cssClass",void 0),ve([(0,T.Property)("")],t.prototype,"id",void 0),ve([(0,T.Property)(!1)],t.prototype,"isCollapsed",void 0),ve([(0,T.Property)(!0)],t.prototype,"isCollapsible",void 0),ve([(0,T.Property)(!1)],t.prototype,"enableGroupOverflow",void 0),ve([(0,T.Property)("")],t.prototype,"groupIconCss",void 0),ve([(0,T.Property)("")],t.prototype,"header",void 0),ve([(0,T.Property)("Column")],t.prototype,"orientation",void 0),ve([(0,T.Property)("")],t.prototype,"overflowHeader",void 0),ve([(0,T.Property)(0)],t.prototype,"priority",void 0),ve([(0,T.Property)(!1)],t.prototype,"showLauncherIcon",void 0),t}(T.ChildProperty),Ie=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])},e(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)}}(),Ce=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},we=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ie(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Ce([(0,T.Property)("")],t.prototype,"keyTip",void 0),Ce([(0,T.Property)("")],t.prototype,"id",void 0),Ce([(0,T.Property)("")],t.prototype,"cssClass",void 0),Ce([(0,T.Collection)([],Se)],t.prototype,"groups",void 0),Ce([(0,T.Property)("")],t.prototype,"header",void 0),t}(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])},e(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)}}(),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;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 t(){return null!==e&&e.apply(this,arguments)||this}return Oe(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},ke([(0,T.Property)("File")],t.prototype,"text",void 0),ke([(0,T.Property)(!1)],t.prototype,"visible",void 0),ke([(0,T.Collection)([],B.MenuItem)],t.prototype,"menuItems",void 0),ke([(0,T.Property)(!1)],t.prototype,"showItemOnClick",void 0),ke([(0,T.Complex)({},B.MenuAnimationSettings)],t.prototype,"animationSettings",void 0),ke([(0,T.Property)("")],t.prototype,"itemTemplate",void 0),ke([(0,T.Property)("")],t.prototype,"popupTemplate",void 0),ke([(0,T.Complex)({},Z)],t.prototype,"ribbonTooltipSettings",void 0),ke([(0,T.Event)()],t.prototype,"beforeClose",void 0),ke([(0,T.Event)()],t.prototype,"beforeOpen",void 0),ke([(0,T.Event)()],t.prototype,"beforeItemRender",void 0),ke([(0,T.Event)()],t.prototype,"close",void 0),ke([(0,T.Event)()],t.prototype,"open",void 0),ke([(0,T.Event)()],t.prototype,"select",void 0),ke([(0,T.Property)("")],t.prototype,"keyTip",void 0),t}(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])},e(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},Le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Be(t,e),Pe([(0,T.Property)("")],t.prototype,"text",void 0),Pe([(0,T.Property)("")],t.prototype,"iconCss",void 0),Pe([(0,T.Property)(!0)],t.prototype,"visible",void 0),t}(T.ChildProperty),Ee=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])},e(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},xe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ee(t,e),De([(0,T.Property)("")],t.prototype,"text",void 0),De([(0,T.Property)("")],t.prototype,"id",void 0),De([(0,T.Property)("")],t.prototype,"keyTip",void 0),De([(0,T.Property)("")],t.prototype,"content",void 0),De([(0,T.Property)("")],t.prototype,"iconCss",void 0),De([(0,T.Property)(!1)],t.prototype,"separator",void 0),De([(0,T.Property)(!1)],t.prototype,"isFooter",void 0),De([(0,T.Event)()],t.prototype,"backStageItemClick",void 0),t}(T.ChildProperty),_e=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])},e(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},qe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _e(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Me([(0,T.Property)("File")],t.prototype,"text",void 0),Me([(0,T.Property)("")],t.prototype,"keyTip",void 0),Me([(0,T.Property)(!1)],t.prototype,"visible",void 0),Me([(0,T.Property)("auto")],t.prototype,"height",void 0),Me([(0,T.Property)("auto")],t.prototype,"width",void 0),Me([(0,T.Property)(null)],t.prototype,"target",void 0),Me([(0,T.Complex)({},Le)],t.prototype,"backButton",void 0),Me([(0,T.Collection)([],xe)],t.prototype,"items",void 0),Me([(0,T.Property)("")],t.prototype,"template",void 0),Me([(0,T.Complex)({},Z)],t.prototype,"ribbonTooltipSettings",void 0),t}(T.ChildProperty),Re=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])},e(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)}}(),Ae=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},je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Re(t,e),t.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Ae([(0,T.Property)(!1)],t.prototype,"visible",void 0),Ae([(0,T.Property)(!1)],t.prototype,"isSelected",void 0),Ae([(0,T.Collection)([],we)],t.prototype,"tabs",void 0),t}(T.ChildProperty),Ge=u(741),Ne="e-ribbon-vertical-center",He="e-icons e-drop-icon",We="e-icons e-arrow-left",ze="e-icons e-more-horizontal-1",Fe="e-vertical",Ke="e-disabled",Ue="e-rtl",Ve="e-ribbon-hover",Xe="e-ribbon-control",Ye="e-ribbon-popup-control",Ze="e-ribbon-open",Je="e-ribbon-keytip",Qe=" ",$e="e-hscroll-bar",et="e-ribbon-hide",tt="e-ribbon-tab",ot="e-ribbon-contextual-tab",it="e-ribbon-active",rt="e-ribbon-tab-item",nt="e-ribbon-collapse-btn",st="e-ribbon-expand-btn",at="e-ribbon-collapsible",lt="e-ribbon-overall-of-btn",pt="e-ribbon-group-of-btn",ct="e-ribbon-overflow-target",ut="e-ribbon-overflow",dt="e-content",ht="e-ribbon-minimize",bt="e-ribbon-group",ft="e-ribbon-single-selection",mt="e-ribbon-multiple-selection",yt="e-ribbon-group-button",gt="e-ribbon-group-button-overflow-popup",vt="e-ribbon-group-button-content",St="e-ribbon-group-container",It="e-ribbon-of-tab",Ct="e-ribbon-of-group-container",wt="e-ribbon-group-content",Ot="e-ribbon-group-header",kt="e-ribbon-overflow-header",Tt="e-ribbon-group-overflow",Bt="e-ribbon-group-overflow-ddb",Pt="e-ribbon-launcher",Lt="e-ribbon-launcher-icon",Et="e-icons e-launcher",Dt="e-ribbon-collection",xt="e-ribbon-item",_t="e-ribbon-row",Mt="e-ribbon-column",qt="e-ribbon-large-item",Rt="e-ribbon-medium-item",At="e-ribbon-small-item",jt="e-ribbon-content-height",Gt="e-dropdown-btn",Nt="e-caret-hide",Ht="e-ribbon-template",Wt="e-ribbon-help-template",zt="e-ribbon-tooltip",Ft="e-ribbon-tooltip-target",Kt="e-ribbon-tooltip-title",Ut="e-ribbon-tooltip-content",Vt="e-ribbon-tooltip-icon",Xt="e-ribbon-tooltip-container",Yt="e-ribbon-text-container",Zt="e-ribbon-simplified-mode",Jt="e-ribbon-backstage-popup",Qt="e-ribbon-backstage-open",$t="e-ribbon-backstage-content",eo="e-ribbon-selected-content",to="e-ribbon-backstage",oo="e-ribbon-backstage-menu",io="e-ribbon-backstage-template",ro="e-ribbon-backstage-wrapper",no="e-ribbon-backstage-items-wrapper",so="e-blankicon",ao="_tab",lo="_group",po="_collection",co="_item",uo="_collapsebutton",ho="_sim_ovrl_overflow",bo="_sim_grp_overflow",fo="_header",mo="_launcher",yo="_content",go="_container",vo="_overflow",So="_dropdown",Io="_filemenu",Co="_backstage",wo="_backstagepopup",Oo="_filemenulist",ko="_menulist",To="_footermenulist",Bo="_helppanetemplate",Po="_grpbtn",Lo="_keytip",Eo="--fileMenuWidth",Do="--helpTemplateWidth",xo=function(){return xo=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},xo.apply(this,arguments)},_o=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonButton"},e.prototype.destroy=function(){this.parent=null},e.prototype.createButton=function(e,t){var o=this,r=this.parent.createElement("button",{id:e.id});t.appendChild(r);var n=e.buttonSettings;if(new Ge.Button({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===i.Large?"Top":"Left",iconCss:n.iconCss,disabled:e.disabled,cssClass:(Ne+Qe+Xe+Qe+(n.cssClass?n.cssClass:"")).trim(),content:e.activeSize===i.Small?"":n.content,isPrimary:n.isPrimary,isToggle:n.isToggle,created:n.created},r),n.htmlAttributes){var s=xo({},n.htmlAttributes);s.id&&delete s.id,si(r,s)}r.onclick=function(e){n.clicked&&n.clicked.call(o,e)},n.content?r.setAttribute("aria-label",n.content):r.setAttribute("aria-label","button")},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=t.querySelector("#"+e.id);r.setAttribute("data-control",e.type.toString());var n=(0,T.getComponent)(r,Ge.Button);n.setProperties({cssClass:n.cssClass+Qe+Ye}),r.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(i,t),o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this,i=t.querySelector("#"+e.id),r=(0,T.getComponent)(i,Ge.Button),n=r.cssClass.split(Qe);n=n.filter((function(e){return e!==Ye})),r.setProperties({cssClass:n.join(Qe)}),i.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(o,t)}},e.prototype.click=function(e){var t=ei(this.parent,e);t&&(0,T.getComponent)(t,Ge.Button).click()},e.prototype.updateButton=function(e,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.buttonSettings,e);var r=ei(this.parent,t,o);if(r){var n=(0,T.getComponent)(r,Ge.Button);e.isToggle&&r.classList.add("e-active"),e.cssClass&&(e.cssClass=(Ne+Qe+Xe+Qe+e.cssClass).trim()),e.content&&(e.content=o.item.activeSize===i.Small?"":e.content,r.setAttribute("aria-label",e.content)),delete e.clicked,n.setProperties(e)}}},e.prototype.updateButtonSize=function(e,t){(0,T.getComponent)(e,Ge.Button).setProperties({iconPosition:t.activeSize===i.Large?"Top":"Left",content:t.activeSize===i.Small?"":t.buttonSettings.content})},e}(),Mo=function(){return Mo=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},Mo.apply(this,arguments)},qo=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,n={};r.htmlAttributes&&(n=Mo({},r.htmlAttributes)).id&&delete n.id,new Ge.CheckBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,checked:r.checked,cssClass:(Xe+Qe+(r.cssClass?r.cssClass:"")).trim(),label:r.label,labelPosition:r.labelPosition,disabled:e.disabled,created:r.created,htmlAttributes:n,change:function(e){r.change&&r.change.call(o,e)}},i)},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=t.querySelector("#"+e.id);r.setAttribute("data-control",e.type.toString());var n=(0,T.getComponent)(r,Ge.CheckBox);n.cssClass=n.cssClass+Qe+Ye,n.dataBind(),n.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(i,t),o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this,i=t.querySelector("#"+e.id),r=(0,T.getComponent)(i,Ge.CheckBox),n=r.cssClass.split(Qe);n=n.filter((function(e){return e!==Ye})),r.cssClass=n.join(Qe),r.dataBind(),r.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(o,t)}},e.prototype.click=function(e){var t=ei(this.parent,e);t&&(0,T.getComponent)(t,Ge.CheckBox).click()},e.prototype.updateCheckBox=function(e,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.checkBoxSettings,e);var i=ei(this.parent,t,o);if(i)e.cssClass&&(e.cssClass=(Xe+Qe+e.cssClass).trim()),delete e.change,(0,T.getComponent)(i,Ge.CheckBox).setProperties(e)}},e}(),Ro=u(323),Ao=function(){return Ao=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},Ao.apply(this,arguments)},jo=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,t){var o=this,i=this.parent.createElement("input",{id:e.id});t.appendChild(i);var r=e.colorPickerSettings,n=new Ro.ColorPicker({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,columns:r.columns,cssClass:(Xe+Qe+(r.cssClass?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(Ze),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(Ze),r.open&&r.open.call(o)},select:r.select},i);if(r.htmlAttributes){var s=Ao({},r.htmlAttributes);s.id&&delete s.id,si(i,s)}var a=n.element.parentElement;T.EventHandler.add(a,"mouseenter",this.toggleWrapperHover.bind(this,a,!0),this),T.EventHandler.add(a,"mouseleave",this.toggleWrapperHover.bind(this,a,!1),this)},e.prototype.toggleWrapperHover=function(e,t){t?e.classList.add(Ve):e.classList.remove(Ve)},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=e.colorPickerSettings;if(r.label&&"Simplified"===this.parent.activeLayout){var n=this.parent.createElement("div",{className:"e-ribbon-colorpicker-label",id:e.id+"_label",innerHTML:r.label});t.insertBefore(n,t.firstChild)}var s=t.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=(0,T.getComponent)(s,Ro.ColorPicker);a.setProperties({cssClass:a.cssClass+Qe+Ye});var l,p=a.splitBtn;a.beforeClose=function(t){l=t.event?t.event.target:null,a.element.parentElement.classList.remove(Ze),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(i)},p.close=function(){l&&!l.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this;if(e.colorPickerSettings.label){var i=t.querySelector("#"+e.id+"_label");i&&i.remove()}var r=t.querySelector("#"+e.id),n=(0,T.getComponent)(r,Ro.ColorPicker),s=n.cssClass.split(Qe);s=s.filter((function(e){return e!==Ye})),n.setProperties({cssClass:s.join(Qe)}),n.splitBtn.close=null,n.beforeClose=function(){n.element.parentElement.classList.remove(Ze),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(o)}},e.prototype.getColorPickerObj=function(e){var t=ei(this.parent,e);return t?(0,T.getComponent)(t,Ro.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,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.checkBoxSettings,e);var i=ei(this.parent,t,o);if(i)e.cssClass&&(e.cssClass=(Xe+Qe+e.cssClass).trim()),delete e.beforeClose,delete e.open,(0,T.getComponent)(i,Ro.ColorPicker).setProperties(e)}},e.prototype.unwireColorPickerEvents=function(e){var t=(0,T.getComponent)(e,Ro.ColorPicker).element.parentElement;T.EventHandler.remove(t,"mouseenter",this.toggleWrapperHover),T.EventHandler.remove(t,"mouseleave",this.toggleWrapperHover)},e}(),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},Go.apply(this,arguments)},No=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,i=this.parent.createElement("input",{id:e.id});t.appendChild(i);var r=e.comboBoxSettings,n={};r.htmlAttributes&&(n=Go({},r.htmlAttributes)).id&&delete n.id,new A.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:(Xe+Qe+(r.cssClass?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:n,close:function(e){r.close&&r.close.call(o,e)},filtering:r.filtering,change:r.change,select:r.select,created:r.created},i)},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=e.comboBoxSettings;if(r.label&&"Simplified"===this.parent.activeLayout){var n=this.parent.createElement("div",{className:"e-ribbon-combobox-label",id:e.id+"_label",innerHTML:r.label});t.insertBefore(n,t.firstChild)}var s=t.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=(0,T.getComponent)(s,A.ComboBox);a.setProperties({cssClass:a.cssClass+Qe+Ye}),a.close=function(t){var r=t.event?t.event.target:null;e.comboBoxSettings.close&&e.comboBoxSettings.close.call(i,t),r&&!r.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this;if(e.comboBoxSettings.label){var i=t.querySelector("#"+e.id+"_label");i&&i.remove()}var r=t.querySelector("#"+e.id),n=(0,T.getComponent)(r,A.ComboBox),s=n.cssClass.split(Qe);s=s.filter((function(e){return e!==Ye})),n.setProperties({cssClass:s.join(Qe)}),n.close=function(t){e.comboBoxSettings.close&&e.comboBoxSettings.close.call(o,t)}},e.prototype.getComboBoxObj=function(e){var t=ei(this.parent,e);return t?(0,T.getComponent)(t,A.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,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.comboBoxSettings,e);var i=ei(this.parent,t,o);if(i)e.cssClass&&(e.cssClass=(Xe+Qe+e.cssClass).trim()),delete e.close,(0,T.getComponent)(i,A.ComboBox).setProperties(e)}},e}(),Ho=u(197),Wo=function(){return Wo=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},Wo.apply(this,arguments)},zo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonDropDown"},e.prototype.destroy=function(){this.parent=null},e.prototype.createDropDown=function(e,t){var o=this,r=this.parent.createElement("button",{id:e.id});t.appendChild(r);var n=e.dropDownSettings,s=(Ne+Qe+Xe+Qe+(n.cssClass?n.cssClass:"")).trim();if(new H.DropDownButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===i.Large?"Top":"Left",closeActionEvents:n.closeActionEvents,content:e.activeSize===i.Small?"":n.content,cssClass:s+(e.activeSize===i.Large?Qe+Fe:""),disabled:e.disabled,iconCss:n.iconCss,items:n.items,target:n.target,createPopupOnClick:n.createPopupOnClick,beforeClose:function(e){n.beforeClose&&n.beforeClose.call(o,e)},beforeItemRender:n.beforeItemRender,beforeOpen:n.beforeOpen,close:function(e){n.close&&n.close.call(o,e)},created:n.created,open:n.open,select:n.select}).appendTo(r),n.htmlAttributes){var a=Wo({},n.htmlAttributes);a.id&&delete a.id,si(r,a)}},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=t.querySelector("#"+e.id);r.setAttribute("data-control",e.type.toString());var n,s=(0,T.getComponent)(r,H.DropDownButton);s.cssClass=s.cssClass+Qe+Ye,s.dataBind(),s.beforeClose=function(t){e.dropDownSettings.beforeClose&&e.dropDownSettings.beforeClose.call(i,t),n=t.event?t.event.target:null},s.close=function(t){e.dropDownSettings.close&&e.dropDownSettings.close.call(i,t),n&&!n.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this,i=t.querySelector("#"+e.id),r=(0,T.getComponent)(i,H.DropDownButton),n=r.cssClass.split(Qe);n=n.filter((function(e){return e!==Ye})),r.cssClass=n.join(Qe),r.dataBind(),r.close=function(t){e.dropDownSettings.close&&e.dropDownSettings.close.call(o,t)},r.beforeClose=function(t){e.dropDownSettings.beforeClose&&e.dropDownSettings.beforeClose.call(o,t)}},e.prototype.createOverFlowDropDown=function(e,t,o,i,r,n){var s=this;this.enableRtl=n;var a=this.parent.createElement("button",{id:e+vo+So});i.setAttribute("tabindex","0"),r.appendChild(a);var l=new H.DropDownButton({iconCss:o,target:i,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,cssClass:Fe+Qe+Bt,iconPosition:"Top",content:t,beforeClose:function(e){e.cancel=!(0,T.isNullOrUndefined)(e.event&&(0,T.closest)(e.event.target,"."+Ye))}},a);return ii(i,this.parent),a.onclick=a.onkeydown=function(){s.itemIndex=0},i.onkeydown=function(e){s.keyActionHandler(e,i)},l},e.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))},e.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--)},e.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)},e.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()},e.prototype.removeOverFlowDropDown=function(e){var t=(0,T.getComponent)(e,H.DropDownButton);(0,T.getComponent)(t.target,Ho.Tooltip).destroy(),e.parentElement.parentElement.insertBefore(t.target,e.parentElement),t.destroy(),(0,T.remove)(e)},e.prototype.getDDBItemElement=function(e,t){return(0,T.getComponent)(e,H.DropDownButton).dropDown.element.querySelector("#"+t)},e.prototype.getOverflowDropDownPopup=function(e,t){var o=t.querySelector("#"+this.parent.tabs[e.tabIndex].groups[e.groupIndex].id+vo+So);return(0,T.getComponent)(o,H.DropDownButton).dropDown.element},e.prototype.getDropDownObj=function(e){var t=ei(this.parent,e);return t?(0,T.getComponent)(t,H.DropDownButton):null},e.prototype.addItems=function(e,t,o){this.getDropDownObj(e).addItems(t,o)},e.prototype.removeItems=function(e,t,o){this.getDropDownObj(e).removeItems(t,o)},e.prototype.toggle=function(e){this.getDropDownObj(e).toggle()},e.prototype.updateDropDown=function(e,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.dropDownSettings,e);var r=ei(this.parent,t,o);if(r){var n=(0,T.getComponent)(r,H.DropDownButton);e.cssClass&&(e.cssClass=(Xe+Qe+Ne+Qe+e.cssClass).trim(),e.cssClass=o.item.activeSize===i.Large?(Fe+Qe+e.cssClass).trim():e.cssClass,n.cssClass=e.cssClass),delete e.close,delete e.beforeClose,e.content&&(e.content=o.item.activeSize===i.Small?"":e.content),n.setProperties(e)}}},e.prototype.updateDropDownSize=function(e,t){var o=(0,T.getComponent)(e,H.DropDownButton),r=o.cssClass.split(Qe);t.activeSize===i.Large?r.push(Fe):r=r.filter((function(e){return e!==Fe})),o.cssClass=r.join(Qe),o.setProperties({iconPosition:t.activeSize===i.Large?"Top":"Left"}),o.setProperties({content:t.activeSize===i.Small?"":t.dropDownSettings.content})},e}(),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},Fo.apply(this,arguments)},Ko=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonSplitButton"},e.prototype.destroy=function(){this.parent=null},e.prototype.createSplitButton=function(e,t){var o=this,r=this.parent.createElement("button",{id:e.id});t.appendChild(r);var n=e.splitButtonSettings,s=(Ne+Qe+Xe+Qe+(n.cssClass?n.cssClass:"")).trim(),a=new H.SplitButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:e.activeSize===i.Large?"Top":"Left",closeActionEvents:n.closeActionEvents,cssClass:s+(e.activeSize===i.Large?Qe+Fe:""),disabled:e.disabled,iconCss:n.iconCss,items:n.items,target:n.target,beforeClose:function(e){n.beforeClose&&n.beforeClose.call(o,e)},beforeItemRender:n.beforeItemRender,beforeOpen:n.beforeOpen,close:function(){a.wrapper.classList.remove(Ze),n.close&&n.close.call(o)},created:n.created,open:function(){a.wrapper.classList.add(Ze),n.open&&n.open.call(o)},select:n.select,click:function(e){n.click&&n.click.call(o,e)}},r);if(n.htmlAttributes){var l=Fo({},n.htmlAttributes);l.id&&delete l.id,si(r,l)}var p=r.parentElement.querySelector(".e-dropdown-btn");p.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),p.click())},this.setContent(e,a);var c=a.wrapper;T.EventHandler.add(c,"mouseenter",(function(){c.classList.add(Ve)}),this),T.EventHandler.add(c,"mouseleave",(function(){c.classList.remove(Ve)}),this)},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=t.querySelector("#"+e.id);r.setAttribute("data-control",e.type.toString());var n=(0,T.getComponent)(r,H.SplitButton);n.cssClass=n.cssClass+Qe+Ye,n.dataBind();var s,a=r.parentElement.querySelector(".e-dropdown-btn"),l=a.getAttribute("id"),p=document.querySelector("#"+l+"-popup");a.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),a.click())},p.onkeydown=function(e){"Enter"===e.key&&(e.preventDefault(),n.wrapper.classList.remove("e-ribbon-open"),p.querySelector(".e-focused").click())},n.beforeClose=function(t){e.splitButtonSettings.beforeClose&&e.splitButtonSettings.beforeClose.call(i,t),s=t.event?t.event.target:null},n.click=function(t){e.splitButtonSettings.click&&e.splitButtonSettings.click.call(i,t),o.element.classList.contains("e-active")&&o.toggle()},n.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(i,t),n.wrapper.classList.remove(Ze),s&&!s.closest(".e-ribbon-group-overflow-ddb")&&o.element.classList.contains("e-active")&&o.toggle()}},e.prototype.removeOverFlowEvents=function(e,t){var o=this,i=t.querySelector("#"+e.id),r=(0,T.getComponent)(i,H.SplitButton),n=r.cssClass.split(Qe);n=n.filter((function(e){return e!==Ye})),r.cssClass=n.join(Qe),r.dataBind(),r.beforeClose=function(t){e.splitButtonSettings.beforeClose&&e.splitButtonSettings.beforeClose.call(o,t)},r.click=function(t){e.splitButtonSettings.click&&e.splitButtonSettings.click.call(o,t)},r.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(o,t),r.wrapper.classList.remove(Ze)}},e.prototype.setContent=function(e,t){t.primaryBtnObj.setProperties({content:e.activeSize===i.Medium?e.splitButtonSettings.content:""}),t.secondaryBtnObj.setProperties({content:e.activeSize===i.Large?e.splitButtonSettings.content:""})},e.prototype.getSplitButtonObj=function(e){var t=ei(this.parent,e);return(0,T.getComponent)(t,H.SplitButton)},e.prototype.addItems=function(e,t,o){this.getSplitButtonObj(e).addItems(t,o)},e.prototype.removeItems=function(e,t,o){this.getSplitButtonObj(e).removeItems(t,o)},e.prototype.toggle=function(e){this.getSplitButtonObj(e).toggle()},e.prototype.updateSplitButton=function(e,t){var o=Xo(this.parent.tabs,t);if(o){(0,T.merge)(o.item.splitButtonSettings,e);var r=ei(this.parent,t,o);if(r){var n=(0,T.getComponent)(r,H.SplitButton);e.cssClass&&(e.cssClass=(Xe+Qe+Ne+Qe+e.cssClass).trim(),e.cssClass=o.item.activeSize===i.Large?(Fe+Qe+e.cssClass).trim():e.cssClass,n.cssClass=e.cssClass),delete e.open,delete e.click,delete e.close,delete e.beforeClose,n.setProperties(e),e.content&&this.setContent(o.item,n)}}},e.prototype.updateSplitButtonSize=function(e,t){var o=(0,T.getComponent)(e,H.SplitButton),r=o.cssClass.split(Qe);t.activeSize===i.Large?r.push(Fe):r=r.filter((function(e){return e!==Fe})),o.cssClass=r.join(Qe),o.setProperties({iconPosition:t.activeSize===i.Large?"Top":"Left"}),this.setContent(t,o)},e}();function Uo(e,t){for(var o=0;o<e.length;o++)if(t(e[parseInt(o.toString(),10)],o))return o;return-1}function Vo(e){if("string"==typeof e){var t="";try{var o=(0,T.select)(e);t=o?"SCRIPT"===o.tagName?o.innerHTML:o.outerHTML:e}catch(o){t=e}return(0,T.compile)(t)}return(0,T.compile)(e)}function Xo(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 Yo(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 Zo(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 Jo(e,t){(0,T.getComponent)(e,t).destroy()}function Qo(e,t,o){(0,T.getComponent)(e,t).setProperties(o)}function $o(e,t,o){(0,T.getComponent)(e,t).setProperties("combobox"===t?{enabled:!o}:{disabled:o})}function ei(e,o,i){if(!i&&!(i=Xo(e.tabs,o)))return null;var n=e.tabObj.items[i.tabIndex].content;if(""===n.innerHTML)return null;if(e.activeLayout===t.Classic)return i.item.displayOptions&r.Classic?(n=i.group.isCollapsed?e.ribbonDropDownModule.getOverflowDropDownPopup(i,n):n).querySelector("#"+o):null;var s=i.item.displayOptions&r.Simplified?n.querySelector("#"+i.item.id):null;return s||(s=(i.group.enableGroupOverflow?(0,T.getComponent)(n.querySelector("#"+i.group.id+bo),H.DropDownButton):e.overflowDDB).target.querySelector("#"+i.item.id)),s}function ti(e){return!!(e.content||e.iconCss||e.title||e.id||e.cssClass)}function oi(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?Xt+"_"+r.id:Xt});if(t.element.append(n),r.title){var s=t.createElement("div",{innerHTML:r.title,className:Kt});n.appendChild(s)}var a=t.createElement("div",{className:Yt});if(n.appendChild(a),r.iconCss){var l=t.createElement("div",{className:r.iconCss+" "+Vt});a.appendChild(l)}if(r.content){var p=t.createElement("div",{innerHTML:r.content,className:Ut});a.appendChild(p)}t.setProperties({content:n,cssClass:r.cssClass?r.cssClass+" "+zt:zt})}function ii(e,t){var o=new Ho.Tooltip({target:"."+Ft,beforeRender:function(e){oi(e,o,t.tooltipData)}.bind(this),windowCollision:!0});o.appendTo(e)}function ri(e){(0,T.getComponent)(e,Ho.Tooltip).destroy()}function ni(e,t){(0,T.getComponent)(e,Ho.Tooltip).setProperties(t)}function si(e,t){for(var o in t)if("class"===o){var i=t.class.replace(/\s+/g," ").trim();i&&(0,T.addClass)([e],i.split(" "))}else if("style"===o){var r=""+(e.getAttribute("style")||"")+t[""+o];e.setAttribute(""+o,r)}else e.setAttribute(o,t[""+o])}var ai=function(){function e(e){this.parent=e,this.isSelected=!1}return e.prototype.getModuleName=function(){return"ribbonGroupButton"},e.prototype.destroy=function(){this.parent=null},e.prototype.createGroupButton=function(e,t){var o=this,r=e.groupButtonSettings;this.count=0;var n=this.parent.createElement("div",{id:e.id+Po,className:"e-btn-group"});t.appendChild(n);for(var a=0;a<r.items.length;a++)if(r.items[parseInt(a.toString(),10)].iconCss){var l=this.parent.createElement("button",{id:e.id+Po+a,className:yt});n.appendChild(l),new Ge.Button({iconCss:r.items[parseInt(a.toString(),10)].iconCss,disabled:e.disabled,enableRtl:this.parent.enableRtl,content:e.activeSize===i.Small?"":r.items[parseInt(a.toString(),10)].content,iconPosition:e.activeSize===i.Large?"Top":"Left"},l),r.items[parseInt(a.toString(),10)].htmlAttributes&&si(l,r.items[parseInt(a.toString(),10)].htmlAttributes),r.items[parseInt(a.toString(),10)].content?(l.classList.add(vt),l.setAttribute("aria-label",r.items[parseInt(a.toString(),10)].content)):l.setAttribute("aria-label","groupbuttonitem");var p=t.querySelector("#"+e.id+Po+a);r.selection===s.Single?n.classList.add(ft):n.classList.add(mt),r.items[parseInt(a.toString(),10)].selected&&(r.selection===s.Multiple?p.classList.add("e-active"):this.count<1&&(p.classList.add("e-active"),this.count++)),r.items[parseInt(a.toString(),10)].ribbonTooltipSettings&&ti(r.items[parseInt(a.toString(),10)].ribbonTooltipSettings)&&(l.classList.add(Ft),this.parent.tooltipData.push({id:l.id,data:r.items[parseInt(a.toString(),10)].ribbonTooltipSettings})),T.EventHandler.add(p,"click",this.groupButtonClicked.bind(this,a,e,r),this)}if("Simplified"===this.parent.activeLayout){var c=void 0,u=0,d=0;p=this.parent.createElement("button",{id:e.id});t.appendChild(p);for(a=0;a<r.items.length;a++)e.groupButtonSettings.items[parseInt(a.toString(),10)].selected&&!this.isSelected&&r.selection===s.Single?(c=e.groupButtonSettings.items[parseInt(a.toString(),10)].iconCss,this.isSelected=!0):e.groupButtonSettings.items[parseInt(a.toString(),10)].selected&&r.selection===s.Multiple&&(c=1===++u?e.groupButtonSettings.items[parseInt(a.toString(),10)].iconCss:null);for(;d<e.groupButtonSettings.items.length&&!this.isSelected&&!c;)e.groupButtonSettings.items[parseInt(d.toString(),10)].iconCss&&(c=e.groupButtonSettings.items[parseInt(d.toString(),10)].iconCss,this.isSelected=!0),d++;var h=new H.DropDownButton({iconCss:c,target:n,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:e.disabled},p);if(r.header){var b=h.dropDown;this.addGroupButtonHeader(e.id,r,b.element)}p.onclick=p.onkeydown=function(){o.handleFocusState(e,t)},n.onkeydown=function(t){"Simplified"===o.parent.activeLayout&&o.handleGroupButtonNavigation(t,e)},ii(n,this.parent),this.isSelected=!1}},e.prototype.groupButtonClicked=function(e,t,o){for(var i,r,n=[],a=[],l=[],p=0;p<o.items.length;p++)document.querySelector("#"+t.id+Po+p)&&document.querySelector("#"+t.id+Po+p).classList.contains("e-active")&&n.push(o.items[parseInt(p.toString(),10)]);document.querySelector("#"+t.id+Po+e).classList.contains("e-active")||a.push(o.items[parseInt(e.toString(),10)]);var c={cancel:!1,previousItems:n,selectingItems:a};if(o.items[parseInt(e.toString(),10)].beforeClick&&o.items[parseInt(e.toString(),10)].beforeClick.call(this,c),!c.cancel){if(o.selection===s.Single){document.querySelector("#"+t.id+Po).classList.contains(mt)&&(document.querySelector("#"+t.id+Po).classList.remove(mt),document.querySelector("#"+t.id+Po).classList.add(ft));for(p=0;p<o.items.length;p++)document.querySelector("#"+t.id+Po+p)&&document.querySelector("#"+t.id+Po+p).classList.contains("e-active")&&(document.querySelector("#"+t.id+Po+p).classList.remove("e-active"),o.items[parseInt(p.toString(),10)].setProperties({selected:!1},!0));document.querySelector("#"+t.id+Po+e).classList.toggle("e-active"),o.items[parseInt(e.toString(),10)].setProperties({selected:!0},!0),document.querySelector("#"+t.id+Po+e).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&(this.grpBtnIndex=e,i=document.querySelector("#"+t.id),(r=(0,T.getComponent)(i,H.DropDownButton)).setProperties({iconCss:o.items[parseInt(e.toString(),10)].iconCss}))}else{document.querySelector("#"+t.id+Po).classList.contains(ft)&&(document.querySelector("#"+t.id+Po).classList.remove(ft),document.querySelector("#"+t.id+Po).classList.add(mt)),document.querySelector("#"+t.id+Po+e).classList.toggle("e-active"),document.querySelector("#"+t.id+Po+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 u=0,d=0;d<o.items.length;d++)document.querySelector("#"+t.id+Po+d)&&document.querySelector("#"+t.id+Po+d).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&d!==e&&(this.isSelected=!0,u++);if("Simplified"===this.parent.activeLayout){var h=null,b=0;if(i=document.querySelector("#"+t.id),r=(0,T.getComponent)(i,H.DropDownButton),this.isSelected){if(1===u&&!document.querySelector("#"+t.id+Po+e).classList.contains("e-active"))for(d=0;d<o.items.length;d++)document.querySelector("#"+t.id+Po+d)&&document.querySelector("#"+t.id+Po+d).classList.contains("e-active")&&(h=o.items[parseInt(d.toString(),10)].iconCss)}else document.querySelector("#"+t.id+Po+e).classList.contains("e-active")&&(h=o.items[parseInt(e.toString(),10)].iconCss);for(;b<o.items.length&&!h;)o.items[parseInt(b.toString(),10)].iconCss&&(h=o.items[parseInt(b.toString(),10)].iconCss),b++;r.setProperties({iconCss:h}),this.grpBtnIndex=e}this.isSelected=!1}document.querySelector("#"+t.id+Po+e).classList.contains("e-active")&&l.push(o.items[parseInt(e.toString(),10)]);var f={previousItems:n,selectedItems:l};o.items[parseInt(e.toString(),10)].click&&o.items[parseInt(e.toString(),10)].click.call(this,f)}},e.prototype.switchGroupButton=function(e,t){var o=this,i=e.groupButtonSettings,r=null,n=0,a=0;if("Simplified"===this.parent.activeLayout){var l=t.querySelector("#"+e.id+Po),p=this.parent.createElement("button",{id:e.id});t.appendChild(p);for(var c=0;c<i.items.length;c++)document.querySelector("#"+e.id+Po+c)&&(document.querySelector("#"+e.id+Po+c).classList.contains("e-active")&&i.selection===s.Single?r=i.items[parseInt(c.toString(),10)].iconCss:document.querySelector("#"+e.id+Po+c).classList.contains("e-active")&&i.selection===s.Multiple&&(1===++n?r=i.items[parseInt(c.toString(),10)].iconCss:n>1&&(r=null)));for(;a<i.items.length&&!r;)i.items[parseInt(a.toString(),10)].iconCss&&(r=i.items[parseInt(a.toString(),10)].iconCss),a++;var u=new H.DropDownButton({iconCss:r,target:l,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:e.disabled},p);if(i.header){var d=u.dropDown;this.addGroupButtonHeader(e.id,i,d.element)}p.onclick=p.onkeydown=function(){o.handleFocusState(e,t)},l.onkeydown=function(t){"Simplified"===o.parent.activeLayout&&o.handleGroupButtonNavigation(t,e)},ii(l,this.parent)}else{var h=t.querySelector("#"+e.id);u=(0,T.getComponent)(h,H.DropDownButton);t.appendChild(u.target),h&&(u.destroy(),(0,T.remove)(h))}},e.prototype.handleFocusState=function(e,t){if(t.querySelector("#"+e.id).classList.contains("e-active")){var o=document.querySelector("#"+e.id+"_grpbtn").querySelector("."+yt+".e-active");o?o.focus():document.querySelector("#"+e.id+Po+0).focus(),this.grpBtnIndex=0}},e.prototype.addGroupButtonHeader=function(e,t,o){var i=this.parent.createElement("div",{className:"e-ribbon-groupbutton-header",id:e+fo,innerHTML:t.header});o.insertBefore(i,o.firstChild)},e.prototype.handleGroupButtonNavigation=function(e,t){var o=document.querySelector("#"+t.id),i=(0,T.getComponent)(o,H.DropDownButton).target,r=!1;"Simplified"===this.parent.activeLayout&&i.closest(".e-ribbon-dropdown-group-button").classList.contains(gt)&&(r=!0),"Tab"===e.key&&e.preventDefault();var n=t.groupButtonSettings;"ArrowRight"===e.key&&!r||"ArrowDown"===e.key&&r?!this.parent.enableRtl||"ArrowDown"===e.key&&r?(this.grpBtnIndex++,this.grpBtnIndex<n.items.length||(this.grpBtnIndex=0),document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()):0===this.grpBtnIndex?(this.grpBtnIndex=n.items.length-1,document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()):("ArrowLeft"===e.key&&!r||"ArrowUp"===e.key&&r)&&(!this.parent.enableRtl||"ArrowUp"===e.key&&r?0===this.grpBtnIndex?(this.grpBtnIndex=n.items.length-1,document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()):(this.grpBtnIndex++,this.grpBtnIndex<n.items.length||(this.grpBtnIndex=0),document.querySelector("#"+t.id+Po+this.grpBtnIndex).focus()))},e.prototype.addOverFlowEvents=function(e,t,o){var i=this,r=e.groupButtonSettings,n=!0,s=t.querySelector("#"+e.id),a=(0,T.getComponent)(s,H.DropDownButton);a.setProperties({cssClass:a.cssClass+Qe+gt,content:r.header?r.header:""});var l=a.target;if(l.children.length){for(var p=0;p<l.children.length;p++)if(r.items[parseInt(p.toString(),10)].content){n=!1;break}n&&l.classList.add("e-icon-btn")}l.onclick=function(){"Simplified"===i.parent.activeLayout&&l.closest(".e-ribbon-dropdown-group-button").classList.contains(gt)&&(a.toggle(),o.element.classList.contains("e-active")&&o.toggle())}},e.prototype.removeOverFlowEvents=function(e,t){var o=t.querySelector("#"+e.id);if(o){var i=(0,T.getComponent)(o,H.DropDownButton),r=i.target;r.classList.contains("e-icon-btn")&&r.classList.remove("e-icon-btn");var n=i.cssClass.split(Qe);n=n.filter((function(e){return e!==gt})),i.setProperties({cssClass:n.join(Qe),content:""})}},e.prototype.destroyDropDown=function(e){var t=document.querySelector("#"+e.id);if(t){var o=(0,T.getComponent)(t,H.DropDownButton);(0,T.getComponent)(o.target,Ho.Tooltip).destroy(),o.destroy(),(0,T.remove)(t)}},e.prototype.updateGroupButtonSize=function(e,t){for(var o,r=t.groupButtonSettings,n=0;n<r.items.length;n++){if(o="Classic"===this.parent.activeLayout?e.querySelector("#"+t.id+Po+n):document.querySelector("#"+t.id+Po+n))(0,T.getComponent)(o,Ge.Button).setProperties({iconPosition:t.activeSize===i.Large?"Top":"Left",content:t.activeSize===i.Small?"":r.items[parseInt(n.toString(),10)].content})}},e}(),li=function(){function e(e){this.count=0,this.isAdded=!1,this.galleryItemsIndex=0,this.registeredTemplate={},this.parent=e;var t="viewContainerRef";(0,T.setValue)("registeredTemplate",this.registeredTemplate,this),(0,T.setValue)(t,this.parent[""+t],this)}return e.prototype.getModuleName=function(){return"ribbonGallery"},e.prototype.destroy=function(){this.parent=null},e.prototype.createGallery=function(e,t){var o=this,i=e.gallerySettings;this.renderGalleryItems(i,!1,e.id,t);var r=this.parent.createElement("button",{id:e.id+"_popupButton",className:"e-ribbon-gallery-button e-icons e-drop-icon"});r.setAttribute("aria-label","gallerydropdownbutton"),t.appendChild(r),this.createPopup(e,r),r.onclick=function(t){var r=document.querySelector("#"+e.id+"_galleryPopup");if(r){var n=(0,T.getComponent)(r,Ho.Popup);r.classList.contains("e-popup-close")?o.showPopup(n,r,t,i,e.id):o.hidePopup(n,r,t,i,e.id)}},document.onclick=function(e){for(var t,i,r=document.querySelectorAll(".e-ribbon-gallery-popup.e-popup-open"),n=0;n<r.length;n++){var s=(0,T.getComponent)(r[parseInt(n.toString(),10)],Ho.Popup);if(!e.target.classList.contains("e-ribbon-gallery-button")){t=r[parseInt(n.toString(),10)].id.replace(/_galleryPopup/g,""),i=Xo(o.parent.tabs,t),o.hidePopup(s,r[parseInt(n.toString(),10)],e,i.item.gallerySettings,t);break}if(t=r[parseInt(n.toString(),10)].id.replace(/_galleryPopup/g,""),e.target.id.replace(/_popupButton/g,"")!==t){i=Xo(o.parent.tabs,t),o.hidePopup(s,r[parseInt(n.toString(),10)],e,i.item.gallerySettings,t);break}}}},e.prototype.renderGalleryItems=function(e,t,o,i){var r,n,s=this,a=Xo(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=c.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 u=function(i){n=c.parent.createElement("li",{className:"e-ribbon-gallery-item",id:(t?"popup_":"")+r.id+"_gallery"+i,attrs:{tabindex:"0"}});var u={name:"beforeItemRender",item:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]};if(e.beforeItemRender&&e.beforeItemRender.call(c,u),r.appendChild(n),e.selectedItemIndex&&e.selectedItemIndex===c.count?n.classList.add("e-ribbon-gallery-selected"):e.selectedItemIndex||0!==c.count||(n.classList.add("e-ribbon-gallery-selected"),e.selectedItemIndex=c.count),c.count=c.count+1,n.onclick=function(i){s.setActiveState(i.currentTarget,e,o,!0,i,t)},n.onkeydown=function(i){"Enter"!==i.key&&" "!==i.key||s.setActiveState(i.currentTarget,e,o,!0,i,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"===c.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&&si(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=c.parent.createElement("span",{className:"e-ribbon-gallery-icons "+e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].iconCss});n.appendChild(d),"Simplified"!==c.parent.activeLayout||t||d.classList.add("e-hidden")}e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].content&&n.appendChild(c.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&&c.createGalleryTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),e.popupTemplate&&t&&c.createGalleryPopupTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),!t&&!p&&e.itemCount===c.count)return l.appendChild(r),c.isAdded=!0,"break"},d=0;d<e.groups[parseInt(a.toString(),10)].items.length;d++){if("break"===u(d))break}if(c.isAdded&&!t)return"break";if(t?i.appendChild(r):l.appendChild(r),t&&e.groups[parseInt(a.toString(),10)].header){var h=c.parent.createElement("div",{className:"e-ribbon-gallery-header",innerHTML:e.groups[parseInt(a.toString(),10)].header});i.insertBefore(h,r)}},c=this,u=0;u<e.groups.length;u++){if("break"===p(u))break}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)},e.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(!(e>=r)){s=!0;break}var p=t.querySelector("#"+i+"_galleryContainer"+a+"_gallery"+l);if(p){n+=p.offsetWidth;var c=window.getComputedStyle(p);if(c){var u=parseFloat(c.paddingLeft)+parseFloat(c.paddingRight);(0,T.isNullOrUndefined)(u)||(n+=u);var d=parseFloat(c.marginLeft)+parseFloat(c.marginRight);(0,T.isNullOrUndefined)(d)||(n+=d)}}r++}if(s)break}n>0&&(t.style.width=n+"px")},e.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=Xo(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 u=0;u<p.item.gallerySettings.groups[parseInt(c.toString(),10)].items.length;u++){var d=s.querySelector("#"+a+"_galleryContainer"+c+"_gallery"+u);if(d)if("Classic"===this.parent.activeLayout)if(d.classList.contains("e-hidden")&&d.classList.remove("e-hidden"),n)d.remove();else{var h=0,b=window.getComputedStyle(d);if(b){var f=parseFloat(b.marginTop)+parseFloat(b.marginBottom);(0,T.isNullOrUndefined)(f)||(h+=f)}i++,p.item.gallerySettings.itemCount===i?(i=0,l>=d.offsetHeight+h?l-=d.offsetHeight+h:(n=!0,d.remove())):l<d.offsetHeight+h&&(n=!0,d.remove())}else++r>p.item.gallerySettings.itemCount&&d.classList.add("e-hidden")}}}},e.prototype.checkCollision=function(e,t,o){void 0===o&&(o=0);var i=0,r=0;if(t){var n=window.innerWidth,s=0===o?n:Math.abs(n-(n-o)),a=window.getComputedStyle(t);a&&(i=parseFloat(a.paddingLeft)+parseFloat(a.paddingRight),(0,T.isNullOrUndefined)(i)||(s-=i));var l=t.querySelectorAll(".e-ribbon-gallery-container");"auto"!==e.width&&l.forEach((function(e){e.style.flexFlow="wrap"}));for(var p=!1,c=0;c<l.length;c++){for(var u=0,d=0;d<l[parseInt(c.toString(),10)].querySelectorAll(".e-ribbon-gallery-item").length;d++){var h=window.getComputedStyle(l[parseInt(c.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(d.toString(),10)]);if(h&&(r=parseFloat(h.marginLeft)+parseFloat(h.marginRight),(0,T.isNullOrUndefined)(r)||(u+=r)),s<=(u+=Math.round(parseFloat(h.width)))&&"auto"===e.width||"auto"!==e.width&&s<=parseInt(e.width.toString(),10)&&s<=u){t.style.width=u+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)))}},e.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"},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 Ho.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+go),i=Xo(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");var l=this.parent.tabObj.element.querySelector("#"+this.parent.tabs[this.parent.selectedTab].id+yo);l&&this.checkAvailableHeight(l)}},e.prototype.addOverFlowEvents=function(e,t){var o=this;if(t.closest(".e-ribbon-overflow-target")){var i=this.parent.createElement("button",{id:e.id});t.appendChild(i),t.querySelector(".e-ribbon-gallery-wrapper").classList.add("e-hidden"),t.querySelectorAll(".e-ribbon-gallery-container").forEach((function(e){e.classList.add("e-hidden")}));var r=t.querySelector("#"+e.id+"_popupButton");r&&r.classList.add("e-hidden");var n=Xo(this.parent.tabs,e.id),s=n&&n.group.groupIconCss?n.group.groupIconCss:"",a=n&&n.group.header?n.group.header:"";if(!s)for(var l=0;l<e.gallerySettings.groups.length;l++){for(var p=0;p<e.gallerySettings.groups[parseInt(l.toString(),10)].items.length;p++)if(e.gallerySettings.groups[parseInt(l.toString(),10)].items[parseInt(p.toString(),10)].iconCss){s=e.gallerySettings.groups[parseInt(l.toString(),10)].items[parseInt(p.toString(),10)].iconCss;break}if(s)break}var c=document.querySelector("#"+e.id+"_galleryPopup"),u=(0,T.getComponent)(c,Ho.Popup),d=document.querySelector("#"+e.id+"_galleryPopup .e-ribbon-popup-container"),h=new H.DropDownButton({iconCss:s,content:a,target:d,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-gallery-dropdown",disabled:e.disabled,open:function(){o.setFoucsToFirstItem(d,!0,e.id)},beforeClose:function(t){o.popupEvents(t.event,e.gallerySettings,"popupClose",!1)&&(t.cancel=!0)}},i);"auto"!==u.width&&(h.dropDown.width=(0,T.formatUnit)(u.width)),"auto"!==u.height&&(h.dropDown.height=(0,T.formatUnit)(u.height),h.dropDown.element.style.height=u.height.toString())}},e.prototype.removeOverFlowEvents=function(e,t){var o=t.querySelector("#"+e.id+"_popupButton");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")}));var i=document.querySelector("#"+e.id);if(i){var r=document.querySelector("#"+e.id+"_galleryPopup"),n=(0,T.getComponent)(i,H.DropDownButton);r.appendChild(n.target),n.destroy(),(0,T.remove)(i)}},e.prototype.setActiveState=function(e,t,o,i,r,n){var s,a,l=document.querySelector("#"+o+go),p=Array.prototype.slice.call(l.querySelectorAll(".e-ribbon-gallery-selected")),c=document.querySelector("#"+o+"_popupContainer"),u=Array.prototype.slice.call(c.querySelectorAll(".e-ribbon-gallery-selected"));u.length&&(p=p.concat(u));for(var d=0;d<t.groups.length;d++)for(var h=0;h<t.groups[parseInt(d.toString(),10)].items.length;h++)p[0].id===o+"_galleryContainer"+d+"_gallery"+h&&(s=t.groups[parseInt(d.toString(),10)].items[parseInt(h.toString(),10)]),e.id===(n?"popup_":"")+o+"_galleryContainer"+d+"_gallery"+h&&(a=t.groups[parseInt(d.toString(),10)].items[parseInt(h.toString(),10)]);var b,f=document.getElementById(e.id),m={cancel:!1,name:"beforeSelect",previousItem:s,currentItem:a,isInteracted:i,event:r};if(t.beforeSelect&&t.beforeSelect.call(this,m),!m.cancel){for(d=0;d<p.length;d++)p[parseInt(d.toString(),10)].classList.remove("e-ribbon-gallery-selected");f.id.startsWith("popup_")?document.getElementById(f.id.slice(6))&&(b=document.getElementById(f.id.slice(6))):b=document.getElementById("popup_"+e.id),b&&b.classList.add("e-ribbon-gallery-selected"),f.classList.add("e-ribbon-gallery-selected");var y={previousItem:s,currentItem:a,name:"select",isInteracted:i,event:r},g=document.querySelectorAll("#"+o+"_popupContainer .e-ribbon-gallery-item");for(d=0;d<g.length;d++)if(g[parseInt(d.toString(),10)].id===e.id){t.selectedItemIndex=d;break}t.select&&t.select.call(this,y)}},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();t.offsetWidth>s.left&&this.checkCollision(e,t,s.left);var 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){this.popupEvents(o,i,"popupClose",!1)||(e.hide(),document.querySelector("#"+r+"_popupButton").classList.remove("e-gallery-button-active"))},e.prototype.showGalleryPopup=function(e){var t=Xo(this.parent.tabs,e),o=document.querySelector("#"+e+"_galleryPopup"),i=(0,T.getComponent)(o,Ho.Popup);this.showPopup(i,o,null,t.item.gallerySettings,e)},e.prototype.hideGalleryPopup=function(e){var t=Xo(this.parent.tabs,e),o=document.querySelector("#"+e+"_galleryPopup"),i=(0,T.getComponent)(o,Ho.Popup);this.hidePopup(i,o,null,t.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||"Escape"===e.key&&!o)&&this.hidePopup(r,t,e,n,i))},e.prototype.createGalleryTemplate=function(e,t,o,i){e.classList.add("e-ribbon-gallery-template");var r="ribbon"+o+"galleryTemplate";this.parent.clearTemplate([r]);var n=Vo(t.template);i.disabled&&e.classList.add("e-disabled"),i.cssClass&&e.classList.add(i.cssClass),(0,T.append)(n({items:i},this,r,o+"galleryTemplate",this.parent.isStringTemplate,null,null,this.parent),e)},e.prototype.createGalleryPopupTemplate=function(e,t,o,i){e.classList.add("e-ribbon-gallery-popup-template");var r="ribbon"+o+"galleryPopupTemplate";this.parent.clearTemplate([r]);var n=Vo(t.popupTemplate);i.disabled&&e.classList.add("e-disabled"),i.cssClass&&e.classList.add(i.cssClass),(0,T.append)(n({items:i},this,r,o+"galleryPopupTemplate",this.parent.isStringTemplate,null,null,this.parent),e)},e}(),pi=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])},e(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)}}(),ci=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},ui=function(e){function s(t,o){return a.Inject(_o,qo,zo,Ko,No,ai),e.call(this,t,o)||this}var a;return pi(s,e),a=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 e=[];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"});var t=Xo(this.tabs,null,n.ColorPicker),o=Xo(this.tabs,null,n.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},s.prototype.initialize=function(){this.element.id=this.element.id||(0,T.getUniqueID)("e-"+this.getModuleName()),(0,T.addClass)([this.element],["e-rbn"].concat(this.cssClass?this.cssClass.split(Qe):[])),this.enableRtl&&this.element.classList.add(Ue),this.element.style.width=(0,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(),ii(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+yo),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("."+St);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("."+St),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()}(e.target.classList.contains("e-ribbon-last-item")&&(t?(i=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+St)).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("."+St)).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+yo);if(this.checkOverflow(this.selectedTab,e),this.scrollModule){var t=this.tabObj.element.querySelector("."+$e);this.scrollModule.scrollStep=t.offsetWidth}if("Simplified"===this.activeLayout){var o=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(o.length)for(var i=0;i<o.length;i++){(0,T.getInstance)(o[parseInt(i.toString(),10)],H.DropDownButton).toggle()}}var r=document.querySelector(".e-ribbon-gallery-popup.e-popup-open");r&&(0,T.getComponent)(r,Ho.Popup).hide();this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},s.prototype.mouseEventHandler=function(){this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},s.prototype.keytipActionHandler=function(e){if(this.enableKeyTips){var t=!1,o=e.key;if(e.altKey&&"Meta"===e.key){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 r=0;r<i.length;r++){(0,T.getInstance)(i[parseInt(r.toString(),10)],H.DropDownButton).toggle()}this.ribbonKeyTipModule.removeKeytip()}else if(this.isKeytipOpen)this.ribbonKeyTipModule.removeKeytip();else{var n=document.querySelector(".e-ribbon-backstage-popup");n&&n.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(r=0;r<s.length;r++){if(s[parseInt(r.toString(),10)].innerHTML.toLowerCase()===o){t=!0,this.ribbonKeyTipModule.keytipPress(o);break}}t||this.checkKeyTipPresent(o,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 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&&(0,T.remove)(i)}},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[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})}},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+ao});this.element.appendChild(e),this.validateItemSize();var t=this.createTabItems(this.tabs);this.tabObj=new B.Tab({cssClass:tt,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(Eo,"0px"),this.element.style.setProperty(Do,"0px");var o=e.querySelector(".e-toolbar");(0,T.getComponent)(o,B.Toolbar).setProperties({width:"calc(100% - var(--fileMenuWidth) - var(--helpTemplateWidth))"}),this.element.classList[this.isMinimized?"add":"remove"](ht)},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(ht,t.isMinimized),t.tabObj.element.querySelector(".e-content").style.display=e?"none":"block",e||t.refreshLayout())}))}},s.prototype.toggleLayout=function(e){this.setProperties({activeLayout:"Simplified"===this.activeLayout?"Classic":"Simplified"},!0),this.switchLayout();var t={activeLayout:this.activeLayout,event:e};this.trigger("ribbonLayoutSwitched",t)},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=Uo(this.tabs,(function(e){return e.id===t}));o=-1===o?this.selectedTab:o;var i=this.tabObj.items[parseInt(o.toString(),10)].content;if(!i.querySelector("."+bt)&&0!==this.tabs[parseInt(o.toString(),10)].groups.length){var r=this.createGroups(this.tabs[parseInt(o.toString(),10)].groups,o);(0,T.append)(r,i)}var n=this.isContextualTab(t);this.updateSelectedState(t);var s={previousIndex:this.selectedTab,selectedIndex:o,isContextual:n};if(this.setProperties({selectedTab:o},!0),this.calculateHiddenElementsWidth(o),this.isUpdateItems){for(var a=0;a<this.itemsModel.length;a++){var l=this.itemsModel[parseInt(a.toString(),10)];this.selectedTab===this.targetTabs[l.id]&&(this.updateItem(l),this.itemsModel.splice(a,1),a--)}0===this.itemsModel.length&&(this.isUpdateItems=!1)}if(this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(e.selectedContent.firstChild),this.checkOverflow(o,i),"Simplified"===this.activeLayout&&this.overflowDDB){var p=this.overflowDDB.target,c=p.querySelector("."+it);c&&c.classList.remove(it);var u=p.querySelector("#"+t+vo);u?(u.classList.add(it),this.overflowDDB.element.classList.remove(et),this.checkOverflowHiddenItems(!1,o)):this.overflowDDB.element.classList.add(et)}this.trigger("tabSelected",s)},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 o=t.closest("."+dt),i=o.offsetWidth<t.offsetWidth;if(i&&!this.scrollModule){if("Classic"===this.activeLayout){var r=!1;!(r=this.checkGroupShrinking(e,o,t,!0))&&o.offsetWidth<t.offsetWidth&&(r=this.checkGroupShrinking(e,o,t,!1)),o.offsetWidth<t.offsetWidth&&this.createOverflowDropdown(e,o,t)}else this.checkSimplifiedItemShrinking(e,o,t),o.offsetWidth<t.offsetWidth&&this.createSimplfiedOverflow(o,t,e);o.offsetWidth<t.offsetWidth&&!this.scrollModule&&(this.scrollModule=new B.HScroll({enableRtl:this.enableRtl},this.tabObj.element.querySelector("."+dt)))}else if(!i)if(this.destroyScroll(),"Classic"===this.activeLayout){r=!1;!(r=this.removeOverflowDropdown(o,t,!1,e))&&o.offsetWidth>t.offsetWidth&&(r=this.checkGroupExpanding(e,o,t,!0)),!r&&o.offsetWidth>t.offsetWidth&&(r=this.checkGroupExpanding(e,o,t,!1))}else this.removeSimplfiedOverflow(o,t,e),o.offsetWidth>t.offsetWidth&&this.checkSimplifiedItemExpanding(e,o,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(e,t,o){for(var n=this.tabs[parseInt(e.toString(),10)],s=n.groups.length-1;s>=0;s--)for(var a=n.groups[parseInt(s.toString(),10)],l=t.querySelector("#"+a.id+go),p=0;p<a.collections.length&&t.offsetWidth<o.offsetWidth;p++)for(var c=a.collections[parseInt(p.toString(),10)],u=c.items.length;u>=1&&t.offsetWidth<o.offsetWidth;u--){var d=c.items[u-1];if(d.allowedSizes&i.Small&&d.allowedSizes&i.Medium&&d.activeSize===i.Medium&&d.displayOptions&r.Simplified){var h=l.querySelector("#"+d.id+go);if(h){var b=h.querySelector("#"+d.id);h.setAttribute("data-medium-width",o.offsetWidth.toString()),d.setProperties({activeSize:i.Small},!0),this.setItemSize(b,d)}}}},s.prototype.checkSimplifiedItemExpanding=function(e,t,o){for(var n=this.tabs[parseInt(e.toString(),10)],s=n.groups.length-1;s>=0;s--)for(var a=n.groups[parseInt(s.toString(),10)],l=t.querySelector("#"+a.id+go),p=0;p<a.collections.length&&t.offsetWidth>o.offsetWidth;p++)for(var c=a.collections[parseInt(p.toString(),10)],u=c.items.length;u>=1&&t.offsetWidth>o.offsetWidth;u--){var d=c.items[u-1];if(d.allowedSizes&i.Small&&d.allowedSizes&i.Medium&&d.activeSize===i.Small&&d.displayOptions&r.Simplified){var h=l.querySelector("#"+d.id+go);if(h){var b=h.getAttribute("data-medium-width"),f=b?parseInt(b,10):null;if(f&&t.offsetWidth>f){h.removeAttribute("data-medium-width");var m=h.querySelector("#"+d.id);d.setProperties({activeSize:i.Medium},!0),this.setItemSize(m,d)}}}}},s.prototype.createSimplfiedOverflow=function(e,t,o){for(var s=this.getGroupResizeOrder(!0,o),a=0;a<s.length&&e.offsetWidth<t.offsetWidth;a++){for(var l=!1,p=s[parseInt(a.toString(),10)],c=e.querySelector("#"+p.id),u=c.querySelector("#"+p.id+go),d=p.collections.length;d>=1&&e.offsetWidth<t.offsetWidth;d--)for(var h=p.collections[parseInt((d-1).toString(),10)],b=c.querySelector("#"+h.id),f=h.items.length;f>=1&&e.offsetWidth<t.offsetWidth;f--){var m=h.items[f-1],y=b.querySelector("#"+m.id+go);if((m.displayOptions===r.Auto||m.displayOptions===(r.Simplified|r.Overflow))&&!(0,T.isNullOrUndefined)(y)){var g=!1,v=!1,S=!1,I=!1,C=void 0;if(c.classList.contains("e-hidden")||c.classList.contains("e-hide-group")){if((C=c.querySelectorAll(".e-ribbon-item.e-hidden")).length)for(var w=0;w<C.length;w++)C[parseInt(w.toString(),10)].classList.remove("e-hidden");c.classList.contains("e-hide-group")?(S=!0,c.classList.remove("e-hide-group"),c.classList.remove("e-ribbon-emptyCollection"),-1!==this.hiddenGroups.indexOf(c.id)&&this.hiddenGroups.splice(this.hiddenGroups.indexOf(c.id),1)):(g=!0,c.classList.remove("e-hidden")),l||(this.calculateOverflowItemsWidth(c.offsetWidth,!1,o),this.calculateMediumDataWidth(c.offsetWidth,o,!1),l=!0)}else y.classList.contains("e-hidden")&&(v=!0,y.classList.remove("e-hidden"),c.classList.contains("e-ribbon-emptyCollection")&&(I=!0,c.classList.remove("e-ribbon-emptyCollection")),this.calculateOverflowItemsWidth(y.offsetWidth,!1,o),this.calculateMediumDataWidth(y.offsetWidth,o,!1));if(y.setAttribute("data-simplified-width",t.offsetWidth.toString()),v&&y.classList.add("e-hidden"),C&&C.length)for(var O=0;O<C.length;O++)C[parseInt(O.toString(),10)].classList.add("e-hidden");if(g&&c.classList.add("e-hidden"),S&&(c.classList.add("e-hide-group"),c.classList.add("e-ribbon-emptyCollection")),I&&c.classList.add("e-ribbon-emptyCollection"),this.createOverflowPopup(m,o,p.enableGroupOverflow,p.id,p.header,y,u,!0),m.activeSize===i.Small){var k=y.querySelector("#"+m.id);m.setProperties({activeSize:i.Medium},!0),this.setItemSize(k,m)}m.type!==n.DropDown&&m.type!==n.SplitButton&&m.type!==n.GroupButton&&m.type!==n.Gallery||this.updatePopupItems(m,y,p.enableGroupOverflow,!0)}}p.enableGroupOverflow||c.querySelector("."+xt)||c.classList.add("e-ribbon-emptyCollection");var B=c.querySelectorAll("."+xt);B&&!p.enableGroupOverflow&&this.checkEmptyCollection(B)&&c.classList.add("e-ribbon-emptyCollection"),this.checkOverflowHiddenItems(p.enableGroupOverflow,o,p.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(e,t,o,i){var r=this,s=(0,T.getComponent)(t.querySelector("#"+e.id),e.type===n.DropDown||e.type===n.Gallery||e.type===n.GroupButton?H.DropDownButton:H.SplitButton),a=s.dropDown,l=(o&&i)===this.enableRtl;a&&(a.setProperties({position:{X:l?"left":"right",Y:i?"top":"bottom"}},!0),i?s.beforeOpen=function(){l&&(e.type===n.Gallery&&r.ribbonGalleryModule&&r.ribbonGalleryModule.checkCollision(a,a.element),a.element.style.setProperty("visibility","hidden"),a.element.style.setProperty("display","block"),a.setProperties({offsetX:-1*a.element.offsetWidth}),a.element.style.removeProperty("display"),a.element.style.removeProperty("visibility"))}:(a.setProperties({offsetX:0},!0),s.beforeOpen=null))},s.prototype.removeSimplfiedOverflow=function(e,t,o,s){void 0===s&&(s=!1);for(var a=this.getGroupResizeOrder(!1,o),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=e.querySelector("#"+c.id+bo);h&&(d=(u=(0,T.getInstance)(h,H.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 f=c.collections[parseInt(b.toString(),10)],m=0;m<f.items.length&&l&&!s&&e.offsetWidth>t.offsetWidth;m++){var y=f.items[parseInt(m.toString(),10)],g=void 0;if(d&&(g=d.querySelector("#"+y.id+go)),(y.displayOptions===r.Auto||y.displayOptions===(r.Simplified|r.Overflow))&&!(0,T.isNullOrUndefined)(g)){var v=parseInt(g.getAttribute("data-simplified-width"),10),S=e.querySelector("#"+c.id);if((g.classList.contains("e-hidden")||S.classList.contains("e-hidden"))&&(v=Math.abs(v-t.offsetWidth)),!s&&e.offsetWidth<v){l=!1;break}var I=e.querySelector("#"+f.id);if(y.type!==n.DropDown&&y.type!==n.SplitButton&&y.type!==n.GroupButton&&y.type!==n.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,w=0;g.classList.contains("e-hidden")&&(g.classList.remove("e-hidden"),S.classList.contains("e-hide-group")&&(C=!0,w=this.checkWidthDifference(g,S)),v=g.offsetWidth+w,g.classList.add("e-hidden")),this.calculateOverflowItemsWidth(v,!0,o),this.calculateMediumDataWidth(v,o,!0),C&&(S.classList.add("e-hide-group"),S.classList.add("e-ribbon-emptyCollection"))}this.removeOverflowEvent(y,g),y.allowedSizes&i.Small&&(y.setProperties({activeSize:i.Small},!0),this.setItemSize(g.querySelector("#"+y.id),y));var O=e.querySelector("#"+c.id),k=O.querySelector("."+xt);if(O.classList.contains("e-ribbon-emptyCollection")&&null!==k){var B=O.querySelectorAll("."+xt);B&&(this.checkEmptyCollection(B)||O.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 P=d.querySelector("#"+c.id+go);P&&1===P.childElementCount&&P.remove();var L=d.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+vo);L&&0===L.childElementCount&&(L.remove(),this.overflowDDB.element.classList.add(et))}}for(p=0;p<a.length;p++)this.checkOverflowHiddenItems(a[parseInt(p.toString(),10)].enableGroupOverflow,o,a[parseInt(p.toString(),10)].id);this.overflowDDB&&(0===this.overflowDDB.target.childElementCount&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null))},s.prototype.checkOverflowHiddenItems=function(e,t,o){if(e){var i=document.querySelector("#"+o+bo);if(i){for(var r=(0,T.getInstance)(i,H.DropDownButton),n=r.target.querySelectorAll(".e-ribbon-item"),s=!0,a=0;a<n.length;a++)if(!n[parseInt(a.toString(),10)].classList.contains("e-hidden")){s=!1;break}r.element.classList[s?"add":"remove"]("e-hidden")}}else if(this.overflowDDB){var l=!0,p=void 0,c=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+vo);if(c){for(var u=0;u<c.children.length;u++){p=!0;for(var d=c.children[parseInt(u.toString(),10)],h=d.querySelectorAll(".e-ribbon-item"),b=0;b<h.length;b++)if(!h[parseInt(b.toString(),10)].classList.contains("e-hidden")){p=!1;break}d.classList[p?"add":"remove"]("e-hide-group"),d.classList.contains("e-hide-group")||d.classList.contains("e-hidden")||(l=!1)}this.overflowDDB.element.classList[l?"add":"remove"](et)}}},s.prototype.createOverflowPopup=function(e,t,o,i,r,n,s,a){var l,p,c=Zo(this.tabs,i),u=this.tabObj.items[parseInt(t.toString(),10)].content.querySelector("#"+i);if(o){var d=s.querySelector("#"+i+bo);d?l=(0,T.getInstance)(d,H.DropDownButton):((l=this.addOverflowButton(i+bo,o)).element.classList.add(pt),s.appendChild(l.element)),this.addKeyTip(t,"0"+(c.groupIndex+1),l.element.id,"grpofbtn"),p=l.target;var h=l.target;if(!h.querySelector("#"+i+bo+fo)&&c.group.overflowHeader){var b=this.createElement("div",{className:kt,id:i+bo+fo,innerHTML:c.group.overflowHeader});h.append(b)}u&&(u.classList.contains("e-disabled")&&h.classList.add("e-disabled"),u.classList.contains("e-hidden")&&h.classList.add("e-hidden"),u.classList.contains("e-hide-group")&&h.classList.add("e-hide-group")),a?h.insertBefore(n,h.querySelector("."+xt)):h.append(n)}else{if(this.overflowDDB){this.overflowDDB.element.classList.remove(et);var f=this.overflowDDB.target,m=f.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+vo);if(m){var y=f.querySelector("#"+i+go);y||(y=c.group.overflowHeader?this.createGroupContainer(i,c.group.overflowHeader):this.createGroupContainer(i,r),u&&(u.classList.contains("e-disabled")&&y.classList.add("e-disabled"),u.classList.contains("e-hidden")&&y.classList.add("e-hidden"),u.classList.contains("e-hide-group")&&y.classList.add("e-hide-group")),m.append(y)),a?y.insertBefore(n,y.querySelector("."+xt)):y.append(n)}else this.createOfTabContainer(i,r,n,t)}else this.overflowDDB=this.addOverflowButton(this.tabObj.element.id+ho,o),this.tabObj.element.insertBefore(this.overflowDDB.element,this.collapseButton),this.overflowDDB.element.classList.add(lt),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")},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);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+vo,className:It});this.overflowDDB.target.append(r);var n=Zo(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(it);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(e){for(var t=0,o=0;o<e.length;o++){for(var i=e[parseInt(o.toString(),10)].items,n=0;n<i.length;n++)if(i[parseInt(n.toString(),10)].displayOptions&r.Classic){t++;break}if(t>1)return!1}return 1===t},s.prototype.checkClassicCollection=function(e,t,o){for(var i=e[parseInt(t.toString(),10)].items,n=0;n<i.length;n++)if(i[parseInt(n.toString(),10)].displayOptions&r.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)},s.prototype.checkClassicItem=function(e,t,o){return e[parseInt(t.toString(),10)].displayOptions&r.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))},s.prototype.checkLargeToMedium=function(e,t,s,a,l,p){var c=this;void 0===p&&(p=!1);var u=t.groups[parseInt(s.toString(),10)];if(u.isCollapsed&&!p)return!1;var d=function(e){return 1===e.items.length&&h(e.items[0])},h=function(e){return e.allowedSizes&i.Medium&&e.activeSize===i.Large},b=function(e,t,o,i){var r=c.createElement("div",{className:"e-ribbon-shrink"+Qe+_t,id:e+"_shrink_container"+o,attrs:{"data-start":o.toString(),"data-end":i.toString()}});return t.parentElement.insertBefore(r,t),p||r.setAttribute("data-large-width",l.offsetWidth.toString()),r},f=function(t,o){for(var a=c.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections[0],u=l.querySelector("#"+a.items[parseInt(t.toString(),10)].id+go),d=p?l.querySelector("#"+a.id+"_shrink_container"+t):b(a.id,u,t,o),h=t;h<=o;h++){var f=a.items[parseInt(h.toString(),10)];if(f.displayOptions&r.Classic){var m=l.querySelector("#"+f.id+go);d.appendChild(m),f.setProperties({activeSize:i.Medium},!0),f.type===n.GroupButton&&"Classic"===c.activeLayout?c.setItemSize(m.querySelector("#"+f.id+Po),f):c.setItemSize(m.querySelector("#"+f.id),f)}}},m=function(t,o){for(var r=c.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)],a=l.querySelector("#"+r.collections[parseInt(t.toString(),10)].id),u=p?l.querySelector("#"+r.id+"_shrink_container"+t):b(r.id,a,t,o),d=t;d<=o;d++){var h=r.collections[parseInt(d.toString(),10)],f=l.querySelector("#"+h.id);u.appendChild(f),h.items[0].setProperties({activeSize:i.Medium},!0),h.items[0].type===n.GroupButton&&"Classic"===c.activeLayout?c.setItemSize(f.querySelector("#"+h.items[0].id+Po),h.items[0]):c.setItemSize(f.querySelector("#"+h.items[0].id),h.items[0])}};if(u.orientation===o.Column)for(var y=u.collections.length-1;y>0;y--){if((v=(y=this.checkClassicCollection(u.collections,y,!1))-1)>=0&&d(u.collections[parseInt(y.toString(),10)]))if((v=this.checkClassicCollection(u.collections,v,!1))>=0&&d(u.collections[parseInt(v.toString(),10)])){if((S=v-1)>=0&&(S=this.checkClassicCollection(u.collections,S,!1)),S>=0&&d(u.collections[parseInt(S.toString(),10)])?m(S,y):m(v,y),y=S,!p&&a.offsetWidth>l.offsetWidth)return!0}else y=v}else if(this.checkValidCollectionLength(u.collections)){var g=u.collections[0];for(y=g.items.length-1;y>0;y--){var v,S;if((v=(y=this.checkClassicItem(g.items,y,!1))-1)>=0&&h(g.items[parseInt(y.toString(),10)]))if((v=this.checkClassicItem(g.items,v,!1))>=0&&h(g.items[parseInt(v.toString(),10)])){if((S=v-1)>=0&&(S=this.checkClassicItem(g.items,S,!1)),S>=0&&h(g.items[parseInt(S.toString(),10)])?f(S,y):f(v,y),y=S,!p&&a.offsetWidth>l.offsetWidth)return!0}else y=v}}return!1},s.prototype.checkMediumToSmall=function(e,t,s,a,l,p){var c=this;void 0===p&&(p=!1);var u=t.groups[parseInt(s.toString(),10)];if(u.isCollapsed&&!p)return!1;var d=u.orientation,h=l.querySelector("#"+u.id).querySelectorAll(".e-ribbon-shrink"),b=function(e){return e.allowedSizes&i.Small&&e.activeSize===i.Medium},f=function(t,o,a,p){void 0===p&&(p=null);var u=c.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections[parseInt(t.toString(),10)],d=function(e){var t=u.items[parseInt(e.toString(),10)];if(t.displayOptions&r.Classic){var o=l.querySelector("#"+t.id);t.setProperties({activeSize:i.Small},!0),t.type===n.GroupButton&&(o=l.querySelector("#"+t.id+"_grpbtn")),c.setItemSize(o,t)}};d(o),p&&d(p),d(a)},m=function(t,o,a,u){void 0===u&&(u=null);var d=c.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)];p||h[parseInt(t.toString(),10)].setAttribute("data-medium-width",l.offsetWidth.toString());var b=function(e){var t=d.collections[parseInt(e.toString(),10)];if(t.items[0].displayOptions&r.Classic){var o=l.querySelector("#"+t.items[0].id);t.items[0].setProperties({activeSize:i.Small},!0),t.items[0].type===n.GroupButton&&(o=l.querySelector("#"+t.items[0].id+Po)),c.setItemSize(o,t.items[0])}};b(o),u&&b(u),b(a)},y=function(e){p||l.querySelector("#"+e).setAttribute("data-medium-width",l.offsetWidth.toString())};if(d===o.Column){if(h.length>0)for(var g=h.length-1;g>=0;g--){var v=parseInt(h[parseInt(g.toString(),10)].getAttribute("data-start"),10),S=parseInt(h[parseInt(g.toString(),10)].getAttribute("data-end"),10),I=this.checkClassicCollection(u.collections,v+1,!1);if(b(u.collections[parseInt(v.toString(),10)].items[0])&&b(u.collections[parseInt(I.toString(),10)].items[0])&&(S===I?m(g,v,S):b(u.collections[parseInt(S.toString(),10)].items[0])&&m(g,v,S,I),!p&&a.offsetWidth>l.offsetWidth))return!0}for(g=u.collections.length-1;g>=0;g--){for(var C=u.collections[parseInt(g.toString(),10)],w=[],O=0;O<C.items.length;O++)C.items[parseInt(O.toString(),10)].displayOptions&r.Classic&&w.push(O);if(w.length>1&&b(C.items[w[0]])&&b(C.items[w[1]])&&(2===w.length?(y(C.id),f(g,w[0],w[1])):b(C.items[w[2]])&&(y(C.id),f(g,w[0],w[2],w[1])),!p&&a.offsetWidth>l.offsetWidth))return!0}}else if(this.checkValidCollectionLength(u.collections)){if(h.length>0)for(g=h.length-1;g>=0;g--){var k=h[parseInt(g.toString(),10)];v=parseInt(k.getAttribute("data-start"),10),S=parseInt(k.getAttribute("data-end"),10),C=u.collections[0],I=this.checkClassicItem(C.items,v+1,!1);if(b(u.collections[0].items[parseInt(v.toString(),10)])&&b(u.collections[0].items[parseInt(I.toString(),10)])&&(S===I?(y(k.id),f(0,v,S)):b(u.collections[0].items[parseInt(S.toString(),10)])&&(y(k.id),f(0,v,S,I)),!p&&a.offsetWidth>l.offsetWidth))return!0}}else for(g=u.collections.length-1;g>=0;g--)for(I=(C=u.collections[parseInt(g.toString(),10)]).items.length-1;I>=0;I--)if(!((I=this.checkClassicItem(C.items,I,!1))<0)){var T=C.items[parseInt(I.toString(),10)];if(b(T)&&(T.type!==n.GroupButton?y(T.id):y(T.id+Po),f(g,I,I),!p&&a.offsetWidth>l.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(e,t,s,a,l,p,c){var u=this,d=t.groups[parseInt(s.toString(),10)],h=d.orientation,b=l.querySelector("#"+d.id).querySelectorAll(".e-ribbon-shrink"),f=function(e){return e.allowedSizes&i.Medium&&e.activeSize===i.Small},m=function(t,o,a){var l=u.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections[parseInt(t.toString(),10)].items[parseInt(o.toString(),10)];if(l.displayOptions&r.Classic){var p=a.id===l.id?a:a.querySelector("#"+l.id);l.setProperties({activeSize:i.Medium},!0),l.type===n.GroupButton&&(p=document.querySelector("#"+l.id+Po)),u.setItemSize(p,l)}},y=function(t){var o=u.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections,a=o[parseInt(t.toString(),10)].items[0];if(a.displayOptions&r.Classic){var p=l.querySelector("#"+o[parseInt(t.toString(),10)].items[0].id);o[parseInt(t.toString(),10)].items[0].setProperties({activeSize:i.Medium},!0),a.type===n.GroupButton&&(p=l.querySelector("#"+o[parseInt(t.toString(),10)].items[0].id+Po)),u.setItemSize(p,o[parseInt(t.toString(),10)].items[0])}};if(h===o.Row){if(!this.checkValidCollectionLength(d.collections))for(var g=0;g<d.collections.length;g++)for(var v=d.collections[parseInt(g.toString(),10)],S=0;S<v.items.length;S++)if((S=this.checkClassicItem(v.items,S,!0))!==v.items.length){var I=v.items[parseInt(S.toString(),10)];if(f(I)){var C=l.querySelector("#"+I.id);if("GroupButton"===I.type&&(C=l.querySelector("#"+I.id+Po)),(w=(T=C.getAttribute("data-medium-width"))?parseInt(T,10):null)&&(p||a.offsetWidth>w))m(g,S,C),p&&!c||C.removeAttribute("data-medium-width");else if(w)return!0}}}else for(g=0;g<d.collections.length;g++)if(d.collections[parseInt(g.toString(),10)].items.length>1){v=d.collections[parseInt(g.toString(),10)];for(var w=(T=(C=l.querySelector("#"+v.id)).getAttribute("data-medium-width"))?parseInt(T,10):null,O=[],k=0;k<v.items.length;k++)v.items[parseInt(k.toString(),10)].displayOptions&r.Classic&&O.push(k);if(O.length>1&&w&&(p||a.offsetWidth>w))m(g,O[0],C),m(g,O[1],C),3===O.length&&m(g,O[2],C),p&&!c||C.removeAttribute("data-medium-width");else if(w)return!0}if(b.length>0)for(g=0;g<b.length;g++){var T,B=b[parseInt(g.toString(),10)];if((w=(T=B.getAttribute("data-medium-width"))?parseInt(T,10):null)&&(p||a.offsetWidth>w)){var P=parseInt(B.getAttribute("data-start"),10),L=parseInt(B.getAttribute("data-end"),10);if(h===o.Row){v=d.collections[0],S=this.checkClassicItem(v.items,P+1,!0);m(0,P,B),m(0,S,B),S!==L&&m(0,L,B)}else{var E=this.checkClassicCollection(d.collections,P+1,!0);y(P),y(E),E!==L&&y(L)}p&&!c||B.removeAttribute("data-medium-width")}else if(w)return!0}return!1},s.prototype.checkMediumToLarge=function(e,t,s,a,l,p,c){var u=this,d=t.groups[parseInt(s.toString(),10)],h=d.orientation,b=l.querySelector("#"+d.id).querySelectorAll(".e-ribbon-shrink");if(0===b.length)return!1;for(var f=function(t,o,a,l){var d=u.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections[0].items,h=function(e){var t=d[parseInt(e.toString(),10)];if(t.displayOptions&r.Classic){var o=a.querySelector("#"+t.id+go),s=o.querySelector("#"+t.id);t.setProperties({activeSize:i.Large},!0),t.type===n.GroupButton&&(s=o.querySelector("#"+t.id+Po)),u.setItemSize(s,t),a.insertAdjacentElement("beforebegin",o)}};h(t),l&&h(l),h(o),p&&!c||(0,T.remove)(a)},m=function(t,o,a,l){var d=u.tabs[parseInt(e.toString(),10)].groups[parseInt(s.toString(),10)].collections,h=function(e){var t=d[parseInt(e.toString(),10)];if(t.items[0].displayOptions&r.Classic){var o=a.querySelector("#"+t.id),s=o.querySelector("#"+t.items[0].id);t.items[0].setProperties({activeSize:i.Large},!0),t.items[0].type===n.GroupButton&&(s=o.querySelector("#"+t.items[0].id+Po)),u.setItemSize(s,t.items[0]),a.insertAdjacentElement("beforebegin",o)}};h(t),l&&h(l),h(o),p&&!c||(0,T.remove)(a)},y=0;y<b.length;y++){var g=b[parseInt(y.toString(),10)],v=g.getAttribute("data-large-width"),S=v?parseInt(v,10):null;if(S&&(p||a.offsetWidth>S)){var I=parseInt(g.getAttribute("data-start"),10),C=parseInt(g.getAttribute("data-end"),10);if(h===o.Row){var w=d.collections[0],O=this.checkClassicItem(w.items,I+1,!0);O===C?f(I,C,g):f(I,C,g,O)}else{var k=this.checkClassicCollection(d.collections,I+1,!0);k===C?m(I,C,g):m(I,C,g,k)}p&&!c||g.removeAttribute("data-large-width")}else if(S)return!0}return!1},s.prototype.handleContentSize=function(e,t){var o=e.closest("."+wt);t?o.classList.add(jt):o.classList.remove(jt)},s.prototype.setItemSize=function(e,t){if(e){var o=e.closest("."+xt);t.type===n.Button?this.ribbonButtonModule.updateButtonSize(e,t):t.type===n.DropDown?this.ribbonDropDownModule.updateDropDownSize(e,t):t.type===n.SplitButton?this.ribbonSplitButtonModule.updateSplitButtonSize(e,t):t.type===n.Template?((0,T.remove)(e),this.createTemplateContent(t,o)):t.type===n.GroupButton&&this.ribbonGroupButtonModule.updateGroupButtonSize(e,t),o.classList.remove(jt,qt,Rt,At),t.activeSize===i.Large?o.classList.add(qt,jt):o.classList.add(t.activeSize===i.Medium?Rt:At)}},s.prototype.createOverflowDropdown=function(e,t,o){var i=this.getGroupResizeOrder(!0,e);if(0!==i.length)for(var r=function(r){var a=i[parseInt(r.toString(),10)],l=s.tabObj.element.querySelector("#"+a.id);l.setAttribute("data-expanded-width",o.offsetWidth.toString());var p=l.querySelector("#"+a.id+go),c=s.createElement("div",{className:Tt+Qe+qt,id:a.id+vo+go});l.insertBefore(c,p);var u=Uo(s.tabs[parseInt(e.toString(),10)].groups,(function(e){return e.id===a.id})),d=s.tabs[parseInt(e.toString(),10)];s.checkSmallToMedium(e,d,u,t,o,!0,!1),s.checkMediumToLarge(e,d,u,t,o,!0,!1);var h=s.ribbonDropDownModule.createOverFlowDropDown(a.id,a.header,a.groupIconCss,p,c,s.enableRtl);if(a.keyTip){var b=a.id+vo+So;s.addKeyTip(e,a.keyTip,b,"grpoverflow")}s.tabs[parseInt(e.toString(),10)].groups[parseInt(u.toString(),10)].setProperties({isCollapsed:!0},!0);for(var f=0;f<a.collections.length;f++)for(var m=a.collections[parseInt(f.toString(),10)],y=p.querySelector("#"+m.id),g=0;g<m.items.length;g++){var v=m.items[parseInt(g.toString(),10)],S=y.querySelector("#"+v.id+go);null!==S&&(s.handleContentSize(S),s.addOverflowEvents(v,S,h));b=document.querySelector("#"+a.id+vo+So);var I=(0,T.getInstance)(b,H.DropDownButton);if(I)if(I.target&&s.keyTipElements[parseInt(e.toString(),10)]){if(v.type===n.GroupButton)for(var C=0;C<v.groupButtonSettings.items.length;C++)v.groupButtonSettings.items[parseInt(C.toString(),10)].keyTip&&s.addKeyTip(e,v.groupButtonSettings.items[parseInt(C.toString(),10)].keyTip,v.id+(Po+C),"grpoverflowpopup");v.keyTip&&s.addKeyTip(e,v.keyTip,v.id,"grpoverflowpopup")}}},s=this,a=0;a<i.length&&t.offsetWidth<o.offsetWidth;a++)r(a)},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)],l=s.tabObj.element.querySelector("#"+a.id);if(!l)return"break";var p=parseInt(l.getAttribute("data-expanded-width"),10);if(!o&&e.offsetWidth<p)return{value:!0};s.removeDropdown(a.id);var c=Uo(s.tabs[parseInt(i.toString(),10)].groups,(function(e){return e.id===a.id}));s.tabs[parseInt(i.toString(),10)].groups[parseInt(c.toString(),10)].setProperties({isCollapsed:!1},!0);var u=s.tabs[parseInt(i.toString(),10)];s.checkLargeToMedium(i,u,c,e,t,!0),s.checkMediumToSmall(i,u,c,e,t,!0);for(var d=0;d<a.collections.length;d++)for(var h=a.collections[parseInt(d.toString(),10)],b=l.querySelector("#"+h.id),f=0;f<h.items.length;f++){var m=h.items[parseInt(f.toString(),10)],y=b.querySelector("#"+m.id+go);null!==y&&(s.handleContentSize(y,!0),s.removeOverflowEvent(m,y))}},s=this,a=0;a<r.length;a++){var l=n(a);if("object"==typeof l)return l.value;if("break"===l)break}return!1},s.prototype.removeDropdown=function(e){var t=this.tabObj.element.querySelector("#"+e+vo+So);if(t){var o=t.parentElement;this.ribbonDropDownModule.removeOverFlowDropDown(t),(0,T.remove)(o)}},s.prototype.getGroupResizeOrder=function(e,t){var o=this,i=this.tabs[parseInt(t.toString(),10)].groups;return(i=i.filter((function(t){return"Classic"!==o.activeLayout||((0,T.isUndefined)(t.isCollapsible)||t.isCollapsible)&&(e&&(0,T.isUndefined)(t.isCollapsed)||!(0,T.isUndefined)(t.isCollapsed)&&e!==t.isCollapsed)}))).sort((function(e,t){return e.priority-t.priority})),e?i.reverse():i},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+yo);if(t){var o=t.closest("."+dt);"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 t=this;this.currentControlIndex=0;var o=e.selectingItem?e.selectingItem.getAttribute("data-id"):null,i=e.previousItem.getAttribute("data-id"),r=Uo(this.tabs,(function(e){return e.id===o})),n=this.isContextualTab(o),s=Uo(this.tabs,(function(e){return e.id===i}));r=-1===r?this.selectedTab:r;var a={cancel:e.cancel,isInteracted:e.isInteracted,previousIndex:s,selectedIndex:r,isContextual:n};this.trigger("tabSelecting",a,(function(e){if(!e.cancel){t.destroyScroll(),t.isAddRemove||-1===s||t.clearOverflowDropDown(s);var o=t.tabObj.items[parseInt(r.toString(),10)].content;if(!o.querySelector("."+bt)&&0!==t.tabs[parseInt(r.toString(),10)].groups.length){var i=t.createGroups(t.tabs[parseInt(r.toString(),10)].groups,r);(0,T.append)(i,o)}}}))},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+fo}),a=Uo(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 l={header:{text:s},id:n.id,cssClass:n.cssClass},p=r.createElement("div",{className:l.cssClass,id:n.id+yo});p.classList.add(rt),l.content=p,o.push(l)},r=this,n=0;n<e.length;n++)i(n);return o},s.prototype.renderInitialTab=function(e){var t=this.createGroups(this.tabs[parseInt(e.toString(),10)].groups,e),o=this.tabObj.items[parseInt(e.toString(),10)].content;(0,T.append)(t,o),"Simplified"===this.activeLayout&&this.element.classList.add(Zt);var i=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+yo);this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(i),this.checkOverflow(this.selectedTab,i)},s.prototype.addOverflowButton=function(e,t){var o,i=this,r=this.createElement("button",{id:e}),n=this.createElement("div",{className:ct,attrs:{tabindex:"0"}}),s=new H.DropDownButton({iconCss:ze,cssClass:Nt+Qe+Bt,target:n,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 t=e.event?(0,T.closest)(e.event.target,"."+Ye):null,o=e.event?(0,T.closest)(e.event.target,".e-ribbon-group-button-overflow-popup"):null,r={element:e.element,event:e.event,cancel:e.cancel};i.trigger("overflowPopupClose",r,(function(i){(t||i.cancel||o)&&(e.cancel=!0)}))}},r);return this.element.classList.add(ut),ii(n,this),t||(this.keyTipElements.overflowbtn=[],this.keyTipElements.overflowbtn.push({id:e,type:"overflowbtn",keyTip:"00"})),r.onkeydown=r.onclick=function(){i.itemIndex=-1,o=!r.classList.contains("e-ribbon-overall-of-btn")},n.onkeydown=function(e){return i.upDownKeyHandler(e,n,o),i},s},s.prototype.upDownKeyHandler=function(e,t,o){var i;o?i=t.getElementsByClassName("e-ribbon-item"):i=t.querySelector(".e-ribbon-of-tab.e-ribbon-active").getElementsByClassName("e-ribbon-item");var r,n,s=i[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-control"),a=s&&s.classList.contains("e-combobox")?i[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-combobox"):null;if(null===a||"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===i.length-1){if(this.itemIndex=0,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!0),a&&"Tab"===e.key)e.preventDefault(),(l=i[this.itemIndex].querySelector(".e-control"))&&l.focus();n=i[this.itemIndex].querySelector(".e-ribbon-template")}else this.itemIndex<i.length-1&&this.itemIndex>=0&&(this.itemIndex++,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!0),n=i[this.itemIndex].querySelector(".e-ribbon-template"));n&&n.focus()}else if(("ArrowUp"===e.key||e.shiftKey&&"Tab"===e.key)&&(null===a||"Tab"===e.key)){if(this.itemIndex&&-1!==this.itemIndex)this.itemIndex<=i.length-1&&this.itemIndex>0&&(this.itemIndex--,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!1),n=i[this.itemIndex].querySelector(".e-ribbon-template"));else{var l;if(this.itemIndex=i.length-1,r=i[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(r,i,!1),a&&e.shiftKey&&"Tab"===e.key)e.preventDefault(),(l=i[this.itemIndex].querySelector(".e-control"))&&l.focus();n=i[this.itemIndex].querySelector(".e-ribbon-template")}n&&n.focus()}t.setAttribute("index",this.itemIndex.toString())}var p=parseInt(t.getAttribute("index"),10),c="",u=i[parseInt(p.toString(),10)]?i[parseInt(p.toString(),10)].querySelector(".e-control"):null;if(u&&(c=u.getAttribute("data-control")),"ArrowDown"===e.key||"ArrowUp"===e.key||" "===e.key||"Tab"===e.key){if("ColorPicker"===c)"Tab"===e.key&&e.preventDefault(),i[parseInt(p.toString(),10)].querySelector(".e-split-colorpicker").focus();else{"Tab"===e.key&&e.preventDefault();var d=i[parseInt(p.toString(),10)].querySelector(".e-control");d&&d.focus()}if(" "===e.key&&"CheckBox"===c){var h=i[parseInt(p.toString(),10)].querySelector(".e-control"),b=(0,T.getComponent)(h,Ge.CheckBox);this.itemIndex=-1,b.click()}}"SplitButton"!==c||"ArrowRight"!==e.key&&"ArrowLeft"!==e.key||("ArrowRight"===e.key&&(this.enableRtl?i[parseInt(p.toString(),10)].querySelector(".e-control").focus():i[parseInt(p.toString(),10)].querySelector(".e-dropdown-btn").focus()),"ArrowLeft"===e.key&&(this.enableRtl?i[parseInt(p.toString(),10)].querySelector(".e-dropdown-btn").focus():i[parseInt(p.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;ri(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:Ct,id:e+go}),i=this.createElement("div",{className:kt,id:e+fo,innerHTML:t});return o.append(i),o},s.prototype.addExpandCollapse=function(){var e=this;this.collapseButton=this.createElement("span",{className:nt+Qe+He,id:this.tabObj.element.id+uo,attrs:{tabindex:"0",type:"button","aria-label":"Layout Switcher",role:"button"}}),this.collapseButton.onclick=function(t){e.toggleLayout(t)},this.collapseButton.onkeydown=function(t){"Enter"===t.key&&e.toggleLayout(t)},this.element.classList.add(at),"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}))},s.prototype.removeExpandCollapse=function(){var e=this,t=Uo(this.tooltipData,(function(t){return t.id===e.collapseButton.id}));-1!==t&&this.tooltipData.splice(t,1),this.element.classList.remove(at),(0,T.remove)(this.tabObj.element.querySelector("."+nt)),this.collapseButton=null},s.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),n=e[parseInt(r.toString(),10)],s=!1,a=0;a<this.tabObj.items.length;a++)if(this.tabs[parseInt(r.toString(),10)].id===this.tabObj.items[parseInt(a.toString(),10)].id){s=!0;break}if(!s){this.destroyTabItems(this.tabsInternal),this.tabsInternal=this.tabs.slice(),this.validateItemSize();var l=this.createTabItems(this.tabs);this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:l,selectedItem:this.selectedTab});break}var p=this.tabs[parseInt(r.toString(),10)].groups,c=this.tabObj.element,u=this.tabs[parseInt(r.toString(),10)];u.setProperties(n,!0),this.setProperties({groups:this.checkID(u.groups,"group",u.id)},!0),this.validateItemSize();var d=this.tabObj.items[parseInt(r.toString(),10)].content;if(p&&(n.header&&(this.tabObj.items[parseInt(r.toString(),10)].header.text.innerText=u.header),n.cssClass&&(this.tabObj.items[parseInt(r.toString(),10)].cssClass&&(d.classList.remove(this.tabObj.items[parseInt(r.toString(),10)].cssClass),c.querySelector(".e-active").classList.remove(this.tabObj.items[parseInt(r.toString(),10)].cssClass)),d.classList.add(u.cssClass),c.querySelector(".e-active").classList.add(u.cssClass)),n.groups)){for(var h=0,b=p;h<b.length;h++){for(var f=b[h],m=f.isCollapsed?d.querySelector("#"+f.id+vo+So):null,y=0,g=f.collections;y<g.length;y++)for(var v=0,S=g[y].items;v<S.length;v++){var I=S[v],C=m?this.ribbonDropDownModule.getDDBItemElement(m,I.id):d.querySelector("#"+I.id);C&&this.destroyFunction(I,C)}m&&this.ribbonDropDownModule.removeOverFlowDropDown(m)}d.querySelectorAll(".e-ribbon-group").forEach((function(e){e.remove()}));var w=this.createGroups(u.groups,r);(0,T.append)(w,d)}}var O=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+yo);this.checkOverflow(this.selectedTab,O)},s.prototype.switchLayout=function(){this.currentControlIndex=0,this.destroyScroll(),this.collapseButton.classList.toggle(st,"Simplified"===this.activeLayout),this.element.classList.toggle(Zt,"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)],s=this.tabs[parseInt(t.toString(),10)].groups,a=this.tabObj.element.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+yo),l=a.closest("."+dt);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(t,o,p,l,a,!0,!1),this.checkMediumToLarge(t,o,p,l,a,!0,!1));for(var d=l.querySelector("#"+c.id),h=(B=d.querySelector("#"+c.id+go)).querySelectorAll(".e-ribbon-shrink"),b=0;b<h.length;b++)h[parseInt(b.toString(),10)].remove();(L=B.querySelector("#"+c.id+fo)).remove(),(P=B.querySelector("#"+c.id+yo)).classList.replace(_t,Mt),P.classList.remove(jt);for(var f=0;f<c.collections.length;f++){var m=c.collections[parseInt(f.toString(),10)];(_=B.querySelector("#"+m.id)).classList.replace(_t,Mt);for(var y=0;y<m.items.length;y++){for(var g=m.items,v=m.items[parseInt(y.toString(),10)],S=!0;S&&v.displayOptions===r.Classic;){y++;var I=B.querySelector("#"+v.id+go),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 w=v.allowedSizes===i.Large||v.allowedSizes&i.Medium?i.Medium:i.Small;w=!(v.displayOptions&r.Simplified)&&v.displayOptions&r.Overflow?i.Medium:w;var O=void 0;if(v.displayOptions&r.Classic){if(O=B.querySelector("#"+v.id+go),v.displayOptions===(r.Classic|r.Overflow)&&(this.createOverflowPopup(v,t,c.enableGroupOverflow,c.id,c.header,O,B),v.type!==n.DropDown&&v.type!==n.SplitButton&&v.type!==n.GroupButton&&v.type!==n.Gallery||this.updatePopupItems(v,O,c.enableGroupOverflow,!0)),v.type===n.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(v,O),v.setProperties({activeSize:w},!0),O){C=O.querySelector("#"+v.id);this.setItemSize(C,v)}}else O=this.createItems([v],u,c.id,c.header,c.enableGroupOverflow,t,B)[0],v.displayOptions&r.Simplified&&_.append(O);v.type===n.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,v.id)}}c.enableGroupOverflow||d.querySelector("."+xt)||d.classList.add("e-ribbon-emptyCollection")}else{this.element.classList.remove(ut);for(var k=0;k<s.length;k++){c=s[parseInt(k.toString(),10)],u=s[parseInt(k.toString(),10)].orientation;var B,P=(B=l.querySelector("#"+c.id+go)).querySelector("#"+c.id+yo),L=this.createElement("div",{className:Ot,id:c.id+fo,innerHTML:c.header});B.appendChild(L),"Row"===u&&P.classList.replace(Mt,_t),P.classList.add(jt);for(f=0;f<c.collections.length;f++){var E=void 0,D=void 0;if(c.enableGroupOverflow){var x=B.querySelector("#"+c.id+bo);x&&(D=(E=(0,T.getInstance)(x,H.DropDownButton)).target)}else(E=this.overflowDDB)&&(D=this.overflowDDB.target);m=c.collections[parseInt(f.toString(),10)];var _=B.querySelector("#"+m.id);"Column"===u&&_.classList.replace(Mt,_t);for(y=0;y<m.items.length;y++){for(g=m.items,v=m.items[parseInt(y.toString(),10)],S=!0;S&&!(v.displayOptions&r.Classic);){y++;O=void 0;if((v.displayOptions&r.Simplified||v.displayOptions&r.Overflow)&&null!==(O=v.displayOptions&r.Simplified?B.querySelector("#"+v.id+go):D.querySelector("#"+v.id+go))){var M=O.querySelector("#"+v.id);this.destroyFunction(v,M),O.remove()}y<g.length?v=g[parseInt(y.toString(),10)]:S=!1}if(!S)break;if(v.displayOptions&(r.Simplified|r.Overflow)){!(O=B.querySelector("#"+v.id+go))&&D&&(O=D.querySelector("#"+v.id+go),v.type!==n.DropDown&&v.type!==n.SplitButton&&v.type!==n.GroupButton&&v.type!==n.Gallery||this.updatePopupItems(v,O,c.enableGroupOverflow,!1),this.removeOverflowEvent(v,O)),v.type===n.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(v,O),O&&_.append(O)}else{var O=this.createItems([v],u,c.id,c.header,c.enableGroupOverflow,t)[0];_.append(O)}C=B.querySelector("#"+v.id);v.type===n.GroupButton&&(C=B.querySelector("#"+v.id+Po));var q=v.allowedSizes&i.Large?i.Large:v.allowedSizes&i.Medium?i.Medium:i.Small;v.setProperties({activeSize:q},!0),this.setItemSize(C,v),v.type===n.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,v.id)}c.enableGroupOverflow&&E&&(0===D.childElementCount||1===D.childElementCount&&this.isHeaderVisible(D,c.id))&&this.removeOverflowButton(E)}}}this.selectedTab===t&&this.checkOverflow(t,a)}}"Classic"===this.activeLayout&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},s.prototype.createLauncherIcon=function(e,t,o){var i=this,r=this.createElement("div",{className:Lt+" "+(this.launcherIconCss?this.launcherIconCss:Et),id:e+mo,attrs:{tabindex:"0",type:"button","aria-label":"Launcher Icon",role:"button"}});t.appendChild(r),t.classList.add(Pt),T.EventHandler.add(r,"click",this.launcherIconClicked.bind(this,e),this),T.EventHandler.add(r,"keydown",(function(t){"Enter"===t.key&&i.launcherIconClicked(e)}),this);var n=Zo(this.tabs,e);n.group.launcherIconKeyTip&&this.addKeyTip(o,n.group.launcherIconKeyTip,r.id,"launcher")},s.prototype.launcherIconClicked=function(e){var t={groupId:e};this.trigger("launcherIconClick",t)},s.prototype.createGroups=function(e,t){for(var o=[],i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)],n=r.orientation,s=this.createElement("div",{className:r.cssClass,id:r.id});s.classList.add(bt),o.push(s);var a=this.createElement("div",{className:r.cssClass,id:r.id+go});a.classList.add(St),s.appendChild(a);var l=this.createElement("div",{className:"Simplified"===this.activeLayout?wt:wt+Qe+jt,id:r.id+yo});if(l.classList.add("Column"===n||"Simplified"===this.activeLayout?Mt:_t),a.appendChild(l),"Classic"===this.activeLayout){var p=this.createElement("div",{className:Ot,id:r.id+fo,innerHTML:r.header});a.appendChild(p)}r.showLauncherIcon&&this.createLauncherIcon(r.id,a,t);var c=this.createCollection(r.collections,r.orientation,r.id,r.header,r.enableGroupOverflow,t,a);(0,T.append)(c,l);for(var u=!0,d=0;d<c.length;d++)if(u)for(var h=0;h<c[parseInt(d.toString(),10)].children.length;h++)if(!c[parseInt(d.toString(),10)].children[parseInt(h.toString(),10)].classList.contains("e-hidden")){u=!1;break}u&&s.classList.add("e-hide-group"),"Simplified"!==this.activeLayout||r.enableGroupOverflow||s.querySelector("."+xt)||s.classList.add("e-ribbon-emptyCollection");var b=this.initialPropsData[parseInt(t.toString(),10)];b&&(b.hiddenGroups&&b.hiddenGroups.length&&this.updateGroupProps("hiddenGroups",b,s),b.disabledGroups&&b.disabledGroups.length&&this.updateGroupProps("disabledGroups",b,s))}return this.initialPropsData[parseInt(t.toString(),10)]&&delete this.initialPropsData[parseInt(t.toString(),10)],o},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 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 r=t[parseInt(o.toString(),10)].collections,n=t[parseInt(o.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:i.Small|i.Medium|i.Large},!0),"ColorPicker"===p.type&&p.allowedSizes!==i.Small)p.setProperties({allowedSizes:i.Small},!0);else if("ComboBox"!==p.type&&"CheckBox"!==p.type||p.allowedSizes===i.Medium){if(("Column"===n&&a.length>1||"Row"===n&&r.length>1)&&p.allowedSizes&i.Large){var c=p.allowedSizes&(i.Small|i.Medium);c=c||i.Medium,p.setProperties({allowedSizes:c},!0)}}else p.setProperties({allowedSizes:i.Medium},!0);var u=p.allowedSizes&i.Large?i.Large:p.allowedSizes&i.Medium?i.Medium:i.Small;p.setProperties({activeSize:u},!0)}},s.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});c.classList.add(Dt),c.classList.add("Column"!==t||"Simplified"===this.activeLayout?Mt:_t),a.push(c);var u=this.createItems(p.items,t,o,i,r,n,s);if((0,T.append)(u,c),"Row"===t&&2===l)break}return a},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(e,t,o,s,a,l,p){for(var c,u=[],d=0;d<e.length;d++){for(var h=e[parseInt(d.toString(),10)],b=!0;b&&("Simplified"===this.activeLayout&&!(h.displayOptions&(r.Simplified|r.Overflow))||"Classic"===this.activeLayout&&!(h.displayOptions&r.Classic));)++d<e.length?h=e[parseInt(d.toString(),10)]:b=!1;if(!b)break;var f=this.createElement("div",{className:h.cssClass,id:h.id+go});if((c=f.classList).add.apply(c,[xt].concat(h.disabled?[Ke]:[])),h.ribbonTooltipSettings&&ti(h.ribbonTooltipSettings)&&(f.classList.add(Ft),this.tooltipData.push({id:f.id,data:h.ribbonTooltipSettings})),h.type===n.GroupButton)for(var m=0;m<h.groupButtonSettings.items.length;m++)this.keyTipElements[parseInt(l.toString(),10)]&&h.groupButtonSettings.items[parseInt(m.toString(),10)].keyTip&&this.addKeyTip(l,h.groupButtonSettings.items[parseInt(m.toString(),10)].keyTip,h.id+(Po+m),"item");h.keyTip&&(h.type===n.Gallery?this.addKeyTip(l,h.keyTip,h.id+"_popupButton","item"):this.addKeyTip(l,h.keyTip,h.id,"item"));var y=h.activeSize;h.type!==n.Gallery&&("Simplified"===this.activeLayout&&(y=h.allowedSizes===i.Large||h.allowedSizes&i.Medium||h.displayOptions===r.Overflow?i.Medium:i.Small,h.setProperties({activeSize:y},!0)),y&i.Large?f.classList.add(qt,jt):f.classList.add(y&i.Medium?Rt:At));var g=this.initialPropsData[parseInt(l.toString(),10)];if(g&&g.hiddenItems&&g.hiddenItems.length)-1!==g.hiddenItems.indexOf(h.id)&&f.classList.add("e-hidden");if(this.createRibbonItem(h,f),"Simplified"!==this.activeLayout||h.displayOptions!==r.Overflow&&h.displayOptions!==(r.Classic|r.Overflow)?u.push(f):(this.createOverflowPopup(h,l,a,o,s,f,p),h.type!==n.DropDown&&h.type!==n.SplitButton&&h.type!==n.GroupButton&&h.type!==n.Gallery||this.updatePopupItems(h,f,a,!0)),"Column"===t&&2===d)break}return u},s.prototype.createHelpPaneTemplate=function(){if(this.helpPaneTemplate){var e="helpPaneTemplate";this.clearTemplate([e]),this.ribbonTempEle=this.createElement("div",{className:Wt,id:this.element.id+Bo});var t=Vo(this.helpPaneTemplate);(0,T.append)(t({},this,e,"helpPaneTemplate",this.isStringTemplate),this.ribbonTempEle);var o=this.tabObj.element;o.querySelector(".e-toolbar").after(this.ribbonTempEle),o.style.setProperty(Do,this.ribbonTempEle.offsetWidth+"px"),this.renderReactTemplates()}},s.prototype.createTemplateContent=function(e,t){var o=this.createElement("div",{className:e.cssClass?Ht+Qe+e.cssClass:Ht,id:e.id,attrs:{tabindex:"-1"}});e.disabled&&(o.classList.add(Ke),o.setAttribute("disabled","")),t.appendChild(o),this.renderItemTemplate(e,o)},s.prototype.renderItemTemplate=function(e,t){var o="ribbon"+e.id+"itemTemplate";this.clearTemplate([o]);var r=Vo(e.itemTemplate);(0,T.append)(r({activeSize:i[e.activeSize]},this,o,e.id+"itemTemplate",this.isStringTemplate),t),this.renderReactTemplates()},s.prototype.checkID=function(e,t,o){for(var i="tab"===t?ao:"group"===t?lo:"collection"===t?po:co,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(e){this.tabObj.setProperties(e),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.setCommonProperties(e),this.ribbonBackstageModule&&this.ribbonBackstageModule.setCommonProperties(e);for(var o=0;o<this.tabs.length;o++){var i=this.tabs[parseInt(o.toString(),10)],s=this.tabObj.items[parseInt(o.toString(),10)].content;if(s.querySelector("."+bt))for(var a=0,l=i.groups;a<l.length;a++){var p=l[a],c=void 0,u=void 0;this.activeLayout===t.Classic?c=p.isCollapsed?s.querySelector("#"+p.id+vo+So):null:(u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+bo):null)?(0,T.getComponent)(c,H.DropDownButton):this.overflowDDB)&&(ni(u.target,e),u.setProperties(e));for(var d=0,h=p.collections;d<h.length;d++)for(var b=0,f=h[d].items;b<f.length;b++){var m=f[b],y=null;if(this.activeLayout===t.Classic?m.displayOptions&r.Classic&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,m.id):m.type===n.GroupButton?s.querySelector("#"+m.id+Po):s.querySelector("#"+m.id)):(y=m.displayOptions&r.Simplified?s.querySelector("#"+m.id):null)||(y=u.target.querySelector("#"+m.id),"DropDown"===m.type&&this.updatePopupItems(m,u.target,p.enableGroupOverflow,!0)),y){var g=this.getItemModuleName(m);if("template"!==g)if("group-btn"===g&&"Classic"===this.activeLayout)for(var v=0;v<m.groupButtonSettings.items.length;v++){Qo(y.querySelector("#"+m.id+Po+v),"btn",e)}else if("group-btn"===g&&"Simplified"===this.activeLayout){Qo(y,"dropdown-btn",e);for(var S=0;S<m.groupButtonSettings.items.length;S++){Qo(document.querySelector("#"+m.id+Po+S),"btn",e)}}else Qo(y,g,e);else(0,T.isNullOrUndefined)(e.enableRtl)||y.classList.toggle(Ue,e.enableRtl)}}}}},s.prototype.removeLauncherIcon=function(e,t,o){var i=e+go,r=t?this.ribbonDropDownModule.getDDBItemElement(t,i):o.querySelector("#"+i);if(r){r.classList.remove(Pt);var n=r.querySelector("#"+e+mo);(0,T.remove)(n)}},s.prototype.destroyTabItems=function(e){for(var o=0;o<e.length;o++)for(var i=e[parseInt(o.toString(),10)],s=this.tabObj.items[parseInt(o.toString(),10)].content,a=0,l=i.groups;a<l.length;a++){var p=l[a],c=void 0,u=void 0;this.activeLayout===t.Classic?(c=p.isCollapsed?s.querySelector("#"+p.id+vo+So):null,p.showLauncherIcon&&this.removeLauncherIcon(p.id,c,s)):u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+bo):null)?(0,T.getComponent)(c,H.DropDownButton):this.overflowDDB;for(var d=0,h=p.collections;d<h.length;d++)for(var b=0,f=h[d].items;b<f.length;b++){var m=f[b],y=void 0;this.activeLayout===t.Classic?m.displayOptions&r.Classic&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,m.id):s.querySelector("#"+m.id),m.type===n.GroupButton&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,m.id+Po):s.querySelector("#"+m.id+Po)),m.type===n.Gallery&&(y=s.querySelector("#"+m.id+go))):(y=m.displayOptions&r.Simplified?s.querySelector("#"+m.id):null,m.type===n.Gallery&&(y=m.displayOptions&r.Simplified?s.querySelector("#"+m.id+go):null),y||(y=u?u.target.querySelector("#"+m.id):null)),y&&this.destroyFunction(m,y)}this.activeLayout===t.Classic&&c?this.ribbonDropDownModule.removeOverFlowDropDown(c):this.activeLayout===t.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+Po+i);r&&Jo(r,"btn")}else this.ribbonGroupButtonModule.destroyDropDown(e);var n=function(t){if(e.groupButtonSettings.items[parseInt(t.toString(),10)].ribbonTooltipSettings){var o=e.id+Po+t,i=Uo(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")){Jo(t,"dropdown-btn"),(p=Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"_galleryPopup"))).concat(Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"-popup")));for(i=0;i<p.length;i++)p[parseInt(i.toString(),10)].remove()}else{var a=t.querySelectorAll(".e-ribbon-gallery-item"),l=t.querySelector("#"+e.id+"_popupButton");l&&l.remove();for(i=0;i<a.length;i++)a[parseInt(i.toString(),10)].remove();var p=document.querySelectorAll("#"+e.id+"_galleryPopup");for(i=0;i<p.length;i++)p[parseInt(i.toString(),10)].remove()}else"template"!==o&&Jo(t,o);if(e.ribbonTooltipSettings){var c=Uo(this.tooltipData,(function(t){return t.id===e.id+go}));-1!==c&&this.tooltipData.splice(c,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+yo),o=t.closest("."+dt),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=Uo(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=Uo(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 l=!0,p=function(e){var t=Uo(c.tabs,(function(t){return t.id===r.tabs[parseInt(e.toString(),10)].id}));-1!==t&&(n.querySelectorAll(".e-toolbar-item")[parseInt(t.toString(),10)].classList.contains("e-hidden")||(l=!1))},c=this;for(s=0;s<r.tabs.length;s++)p(s);l?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=Uo(this.tabs,(function(t){return t.id===e}));if(-1!==o){var i=this.tabObj.items[parseInt(o.toString(),10)].content;this.tabObj.element.querySelector("#"+e+fo).classList[t?"remove":"add"]("e-disabled"),i.classList[t?"remove":"add"]("e-disabled"),this.tabObj.enableTab(o,t)}},s.prototype.addTab=function(e,t,o){var i=t?Uo(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(e){var t=Uo(this.tabs,(function(t){return t.id===e}));if(-1!==t){var o=this.tabObj.items[parseInt(t.toString(),10)].content,i=this.tabs[parseInt(t.toString(),10)].groups;if(i&&""!==o.innerHTML)for(var r=0,s=i;r<s.length;r++){for(var a=s[r],l=a.isCollapsed?o.querySelector("#"+a.id+vo+So):null,p=0,c=a.collections;p<c.length;p++)for(var u=0,d=c[p].items;u<d.length;u++){var h=d[u],b=l?this.ribbonDropDownModule.getDDBItemElement(l,h.id):o.querySelector("#"+h.id);h.type===n.GroupButton&&"Classic"===this.activeLayout&&(b=l?this.ribbonDropDownModule.getDDBItemElement(l,h.id+Po):o.querySelector("#"+h.id+Po)),b&&this.destroyFunction(h,b)}l&&this.ribbonDropDownModule.removeOverFlowDropDown(l)}t===this.selectedTab&&(this.isAddRemove=!0),this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(t,1),this.setProperties({tabs:this.tabsInternal},!0),this.tabObj.removeTab(t)}},s.prototype.addGroup=function(e,t,o,i){var r=Uo(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?Uo(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 l=this.tabObj.items[parseInt(r.toString(),10)].content;if(""!==l.innerHTML){var p=this.createGroups([n.groups[parseInt(a.toString(),10)]],r)[0],c=o?l.querySelector("#"+o):null;c?c.insertAdjacentElement(i?"afterend":"beforebegin",p):l.append(p)}this.selectedTab===r&&this.refreshLayout()}},s.prototype.removeGroup=function(e){var o=Zo(this.tabs,e);if(o){this.selectedTab===o.tabIndex&&this.clearOverflowResize();var i=this.tabObj.items[o.tabIndex].content;if(""!==i.innerHTML){var r=void 0,n=void 0;o.group.showLauncherIcon&&this.removeLauncherIcon(o.group.id,null,i),this.activeLayout===t.Simplified&&(n=(r=o.group.enableGroupOverflow?i.querySelector("#"+o.group.id+bo):null)?(0,T.getComponent)(r,H.DropDownButton):this.overflowDDB);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(i,c,n)}if(this.activeLayout===t.Simplified)if(o.group.enableGroupOverflow)(0===n.target.childElementCount||1===n.target.childElementCount&&this.isHeaderVisible(n.target,o.group.id))&&this.removeOverflowButton(n);else{var u=n.target.querySelector("#"+o.group.id+go);u&&1===u.childElementCount&&u.remove();var d=n.target.querySelector("#"+this.tabs[parseInt(o.tabIndex.toString(),10)].id+vo);d&&0===d.childElementCount&&d.remove()}var h=i.querySelector("#"+e);h&&h.remove()}var b=this.tabs[o.tabIndex].groups.slice();b.splice(o.groupIndex,1),this.tabs[o.tabIndex].setProperties({groups:b},!0),this.selectedTab===o.tabIndex&&this.refreshLayout()}},s.prototype.isHeaderVisible=function(e,t){return!!e.querySelector("#"+t+bo+fo)},s.prototype.hideGroup=function(e){this.showHideGroup(e,!0)},s.prototype.showGroup=function(e){this.showHideGroup(e,!1)},s.prototype.showHideGroup=function(e,t){var o,i=Zo(this.tabs,e);if(i){var r=this.tabObj.items[i.tabIndex].content,n=r.querySelector("#"+e);if(n?this.updateHiddenElements(i.tabIndex,t?"hideGroup":"showGroup",e,t,n):this.updateInitialProps(i.tabIndex,e,"hiddenGroups",t),this.overflowDDB){var s=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+vo);if(i.group.enableGroupOverflow){var a=r.querySelector("#"+e+bo);a&&(o=(0,T.getInstance)(a,H.DropDownButton).target),o&&(t?o.classList.add("e-hidden"):o.classList.remove("e-hidden"))}else if(s){var l=s.querySelector("#"+e+go);l&&(t?l.classList.add("e-hidden"):l.classList.remove("e-hidden"))}}this.selectedTab===i.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[parseInt(e.toString(),10)].content,l=void 0,p=!1,c=0;if(s="hideGroup"===t||"showGroup"===t?a.querySelector("#"+o[""+t][parseInt(r.toString(),10)]):a.querySelector("#"+o[""+t][parseInt(r.toString(),10)]+go)){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][parseInt(r.toString(),10)]);-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,t,o){if(this.selectedTab===t&&"Simplified"===this.activeLayout){var i=this.tabObj.element.querySelector("#"+this.tabs[parseInt(t.toString(),10)].id+yo),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+vo),a=0;a<n.length;a++){var l=n[parseInt(a.toString(),10)].closest("#"+this.tabs[parseInt(t.toString(),10)].id+vo);s&&l&&s.id===l.id&&n[parseInt(a.toString(),10)].hasAttribute("data-medium-width")&&r.push(n[parseInt(a.toString(),10)])}var p=i.querySelectorAll(".e-ribbon-group-of-btn");for(a=0;a<p.length;a++){n=(0,T.getInstance)(p[parseInt(a.toString(),10)],H.DropDownButton).target.querySelectorAll(".e-ribbon-item");for(var c=0;c<n.length;c++)n[parseInt(c.toString(),10)].hasAttribute("data-medium-width")&&r.push(n[parseInt(c.toString(),10)])}for(a=0;a<r.length;a++)if(r[parseInt(a.toString(),10)].hasAttribute("data-medium-width")){var u=parseInt(r[parseInt(a.toString(),10)].getAttribute("data-medium-width"),10);r[parseInt(a.toString(),10)].setAttribute("data-medium-width",o?(u-e).toString():(u+e).toString())}}},s.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,a=document.querySelector("#"+n.id).querySelector("#"+n.id+bo);if(a&&(s=(0,T.getInstance)(a,H.DropDownButton)),s)for(var l=s.target.querySelectorAll(".e-ribbon-item"),p=0;p<l.length;p++){(u=parseInt(l[parseInt(p.toString(),10)].getAttribute("data-simplified-width"),10))&&l[parseInt(p.toString(),10)].setAttribute("data-simplified-width",t?(u-e).toString():(u+e).toString())}}}if(this.overflowDDB){var c=document.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+vo);for(l=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),r=0;r<l.length;r++){var u,d=l[parseInt(r.toString(),10)].closest("#"+this.tabs[parseInt(o.toString(),10)].id+vo);if(c&&d&&c.id===d.id)(u=parseInt(l[parseInt(r.toString(),10)].getAttribute("data-simplified-width"),10))&&l[parseInt(r.toString(),10)].setAttribute("data-simplified-width",t?(u-e).toString():(u+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,t){var o,i=Zo(this.tabs,e);if(i){var r=this.tabObj.items[i.tabIndex].content,n=r.querySelector("#"+e);if(n?t?n.classList.add("e-disabled"):n.classList.remove("e-disabled"):this.updateInitialProps(i.tabIndex,e,"disabledGroups",t),this.overflowDDB){var s=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+vo);if(i.group.enableGroupOverflow){var a=r.querySelector("#"+e+bo);a&&(o=(0,T.getInstance)(a,H.DropDownButton).target),o&&(t?o.classList.add("e-disabled"):o.classList.remove("e-disabled"))}else if(s){var l=s.querySelector("#"+e+go);l&&(t?l.classList.add("e-disabled"):l.classList.remove("e-disabled"))}}}},s.prototype.addCollection=function(e,t,o,i){var r=Zo(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?Uo(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 l=r.group.collections[parseInt(s.toString(),10)],p=this.createCollection([l],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 c=o?a.querySelector("#"+o):null;c?c.insertAdjacentElement(i?"afterend":"beforebegin",p):a.querySelector("#"+e+yo).append(p)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},s.prototype.removeCollection=function(e){var o=Yo(this.tabs,e);if(o){this.selectedTab===o.tabIndex&&this.clearOverflowResize();var i=this.tabObj.items[o.tabIndex].content;if(""!==i.innerHTML){var r=void 0,n=void 0;this.activeLayout===t.Simplified&&(n=(r=o.group.enableGroupOverflow?i.querySelector("#"+o.group.id+bo):null)?(0,T.getComponent)(r,H.DropDownButton):this.overflowDDB);for(var s=0,a=o.collection.items;s<a.length;s++){var l=a[s];this.removeItemElement(i,l,n)}var p=i.querySelector("#"+e);p&&p.remove()}var c=o.group,u=c.collections.slice();u.splice(o.collectionIndex,1),c.setProperties({collections:u},!0),this.selectedTab===o.tabIndex&&this.refreshLayout()}},s.prototype.addItem=function(e,t,o,i){var r=Yo(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?Uo(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,l=a.querySelector("#"+r.group.id+go);if(""!==a.innerHTML){var p=r.collection.items[parseInt(s.toString(),10)],c=this.createItems([p],r.group.orientation,r.group.id,r.group.header,r.group.enableGroupOverflow,r.tabIndex,l)[0];r.group.isCollapsed&&(a=this.ribbonDropDownModule.getOverflowDropDownPopup(r,a));var u=o?a.querySelector("#"+o):null;u?u.closest("."+xt).insertAdjacentElement(i?"afterend":"beforebegin",c):c&&a.querySelector("#"+e).append(c)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},s.prototype.removeItem=function(e){var o=Xo(this.tabs,e);if(o){this.selectedTab===o.tabIndex&&this.clearOverflowResize();var i=this.tabObj.items[o.tabIndex].content;if(""!==i.innerHTML){var r=void 0,n=void 0;this.activeLayout===t.Simplified&&(n=(r=o.group.enableGroupOverflow?i.querySelector("#"+o.group.id+bo):null)?(0,T.getComponent)(r,H.DropDownButton):this.overflowDDB);var s=o.item;this.removeItemElement(i,s,n)}var a=o.collection,l=a.items;l.splice(o.itemIndex,1),a.setProperties({items:l},!0),this.selectedTab===o.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,t){var o,i=Xo(this.tabs,e);if(i)if(o="GroupButton"===i.item.type?ei(this,e+Po,i):ei(this,e,i)){var r=(0,T.closest)(o,".e-ribbon-item");this.updateHiddenElements(i.tabIndex,t?"hideItem":"showItem",e,t,r,i.group),this.selectedTab===i.tabIndex&&this.refreshLayout()}else this.updateInitialProps(i.tabIndex,e,"hiddenItems",t)},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 c=l.items[parseInt(p.toString(),10)],u=void 0;if("GroupButton"===c.type){var d=Xo(this.tabs,c.id);u=ei(this,c.id+Po,d)}else u=ei(this,c.id);if(!(u?u.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 h=s.querySelectorAll("."+xt);h&&(i=this.checkEmptyCollection(h),s.classList[i?"add":"remove"]("e-ribbon-emptyCollection"))}},s.prototype.checkOverflowItems=function(e,t,o,i,r){var n;if(o){var s=t.querySelector("#"+r+bo);s&&(n=(0,T.getInstance)(s,H.DropDownButton).target),n&&(e?n.classList.add("e-hide-group"):n.classList.remove("e-hide-group"))}else if(this.overflowDDB){var a=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+vo);if(a){var l=a.querySelector("#"+r+go);l&&(e?l.classList.add("e-hide-group"):l.classList.remove("e-hide-group"))}}},s.prototype.updateTab=function(e){var t=e.id,o=Uo(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,s=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),s.querySelector(".e-active").classList.remove(this.tabs[parseInt(o.toString(),10)].cssClass)),e.groups)){for(var a=0,l=r;a<l.length;a++){for(var p=l[a],c=p.isCollapsed?i.querySelector("#"+p.id+vo+So):null,u=0,d=p.collections;u<d.length;u++)for(var h=0,b=d[u].items;h<b.length;h++){var f=b[h],m=c?this.ribbonDropDownModule.getDDBItemElement(c,f.id):i.querySelector("#"+f.id);f.type===n.GroupButton&&"Classic"===this.activeLayout&&(m=c?this.ribbonDropDownModule.getDDBItemElement(c,f.id+Po):i.querySelector("#"+f.id+Po)),m&&this.destroyFunction(f,m)}c&&this.ribbonDropDownModule.removeOverFlowDropDown(c)}i.querySelectorAll(".e-ribbon-group").forEach((function(e){e.remove()}))}o===this.selectedTab&&(this.isAddRemove=!0);var y=this.tabs[parseInt(o.toString(),10)];if(y.setProperties(e,!0),this.setProperties({groups:this.checkID(y.groups,"group",y.id)},!0),this.validateItemSize(),""===i.innerHTML){if(e.groups){var g=this.createGroups(y.groups,o);(0,T.append)(g,i)}this.selectedTab===o&&this.refreshLayout(),e.cssClass&&(i.classList.add(y.cssClass),s.querySelector(".e-active").classList.add(y.cssClass)),e.header&&(s.querySelector("#"+t+fo).innerText=y.header)}}},s.prototype.updateGroup=function(e){var o=e.id,i=Zo(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var r,n,s=this.tabObj.items[i.tabIndex].content,a=s.querySelector("#"+o),l=a.querySelector("#"+e.id+go);if(""!==s.innerHTML){if(i.group.showLauncherIcon&&this.removeLauncherIcon(i.group.id,null,s),this.activeLayout===t.Simplified&&(n=(r=i.group.enableGroupOverflow?s.querySelector("#"+i.group.id+bo):null)?(0,T.getComponent)(r,H.DropDownButton):this.overflowDDB),e.cssClass&&i.group.cssClass&&(a.classList.remove(i.group.cssClass),l&&l.classList.remove(i.group.cssClass)),(e.collections||e.orientation)&&(i.group.collections||i.group.orientation)){for(var p=0,c=i.group.collections;p<c.length;p++)for(var u=0,d=c[p].items;u<d.length;u++){var h=d[u];this.removeItemElement(s,h,n)}if(a.querySelectorAll(".e-ribbon-collection").forEach((function(e){e.remove()})),e.orientation){var b=(g=l.querySelector(".e-ribbon-group-content")).classList.value.match(/(e-ribbon-[column|row]+)/g);b&&(0,T.removeClass)([g],b)}}if(this.activeLayout===t.Simplified)if(i.group.enableGroupOverflow)(0===n.target.childElementCount||1===n.target.childElementCount&&this.isHeaderVisible(n.target,i.group.id))&&this.removeOverflowButton(n);else{var f=n.target.querySelector("#"+i.group.id+go);f&&1===f.childElementCount&&f.remove();var m=n.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+vo);m&&0===m.childElementCount&&m.remove()}}var y=i.group;if(y.setProperties(e,!0),y.setProperties({collections:this.checkID(y.collections,"collection",y.id)},!0),this.validateItemSize(),""!==s.innerHTML){if(e.showLauncherIcon&&this.createLauncherIcon(y.id,l,i.tabIndex),e.collections||e.orientation){var g;(g=l.querySelector(".e-ribbon-group-content")).classList.add("Column"===y.orientation||"Simplified"===this.activeLayout?Mt:_t);var v=this.createCollection(y.collections,y.orientation,y.id,y.header,y.enableGroupOverflow,i.tabIndex,l);(0,T.append)(v,g)}if(this.selectedTab===i.tabIndex&&this.refreshLayout(),e.cssClass&&(a.classList.add(y.cssClass),l&&l.classList.add(y.cssClass)),e.header)if(this.activeLayout!==t.Simplified||e.enableGroupOverflow)if(this.activeLayout!==t.Classic||y.isCollapsed){if(this.activeLayout===t.Classic&&y.isCollapsed){var S,I=a.querySelector("#"+y.id+vo+So);(S=(0,T.getInstance)(I,H.DropDownButton).target.querySelector("#"+e.id+fo))&&(S.innerText=y.header)}}else a.querySelector(".e-ribbon-group-header").innerText=y.header;else(S=n.target.querySelector("#"+e.id+fo))&&(S.innerText=y.header)}}},s.prototype.updateCollection=function(e){var o=e.id,i=Yo(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var r=this.tabObj.items[i.tabIndex].content,n=r.querySelector("#"+o);if(""!==r.innerHTML){var s=void 0,a=void 0;if(this.activeLayout===t.Simplified&&(a=(s=i.group.enableGroupOverflow?r.querySelector("#"+i.group.id+bo):null)?(0,T.getComponent)(s,H.DropDownButton):this.overflowDDB),e.cssClass&&i.collection.cssClass&&n.classList.remove(i.collection.cssClass),e.items&&i.collection.items)for(var l=0,p=i.collection.items;l<p.length;l++){var c=p[l];this.removeItemElement(r,c,a)}}var u=i.collection;if(u.setProperties(e,!0),u.setProperties({items:this.checkID(u.items,"item",u.id)},!0),this.validateItemSize(),""!==r.innerHTML&&e.items){var d=r.querySelector("#"+i.group.id+go),h=this.createItems(u.items,i.group.orientation,i.group.id,i.group.header,i.group.enableGroupOverflow,i.tabIndex,d);(0,T.append)(h,n)}this.selectedTab===i.tabIndex&&this.refreshLayout(),e.cssClass&&n.classList.add(u.cssClass)}},s.prototype.updateItem=function(e){var o=e.id,s=Xo(this.tabs,o);if(s){this.selectedTab===s.tabIndex&&this.clearOverflowResize();var a=this.tabObj.items[s.tabIndex].content,l=a.querySelector("#"+s.group.id);if(l){var p=l.querySelector("#"+s.group.id+go),c=null,u=null,d=void 0,h=void 0;if(""!==a.innerHTML){if(this.activeLayout===t.Simplified&&(h=(d=s.group.enableGroupOverflow?a.querySelector("#"+s.group.id+bo):null)?(0,T.getComponent)(d,H.DropDownButton):this.overflowDDB),this.activeLayout===t.Simplified&&s.item.displayOptions===r.Overflow){if(c=h.target.querySelector("#"+o+go),u=h.target.querySelector("#"+o),e.displayOptions&&e.displayOptions!==r.Overflow){var b=p.querySelector("#"+s.collection.id);b&&b.appendChild(c)}}else c=p.querySelector("#"+o+go),u=a.querySelector("#"+o),"GroupButton"===s.item.type&&this.activeLayout===t.Classic&&(u=a.querySelector("#"+o+Po)),this.activeLayout===t.Simplified&&e.displayOptions===r.Overflow&&(this.createOverflowPopup(s.item,s.tabIndex,s.group.enableGroupOverflow,s.group.id,s.group.header,c,p),s.item.type!==n.DropDown&&s.item.type!==n.SplitButton&&e.type!==n.GroupButton&&e.type!==n.Gallery||this.updatePopupItems(s.item,c,s.group.enableGroupOverflow,!0));e.cssClass&&s.item.cssClass&&c.classList.remove(s.item.cssClass),this.destroyFunction(s.item,u),u.remove();var f=c.classList.value.match(/(e-ribbon-[large|medium|small]+-item)/g);f&&(0,T.removeClass)([c],f)}var m=s.item;if(m.setProperties(e,!0),this.validateItemSize(),""!==a.innerHTML){c=this.activeLayout!==t.Simplified||m.displayOptions!==r.Overflow?p.querySelector("#"+o+go):h.target.querySelector("#"+o+go),m.ribbonTooltipSettings&&ti(m.ribbonTooltipSettings)&&(c.classList.add(Ft),this.tooltipData.push({id:c.id,data:m.ribbonTooltipSettings}));var y=m.activeSize;"Simplified"===this.activeLayout&&(y=m.allowedSizes===i.Large||m.allowedSizes&i.Medium||m.displayOptions===r.Overflow?i.Medium:i.Small,m.setProperties({activeSize:y},!0)),y&i.Large?c.classList.add(qt,jt):y&i.Medium?c.classList.add(Rt):c.classList.add(At),this.createRibbonItem(m,c),"Simplified"===this.activeLayout&&s.group.enableGroupOverflow&&(0===h.target.childElementCount||1===h.target.childElementCount&&this.isHeaderVisible(h.target,s.group.id))&&this.removeOverflowButton(h),this.selectedTab===s.tabIndex&&this.refreshLayout(),e.cssClass&&c.classList.add(m.cssClass),!m.disabled&&c.classList.contains(Ke)&&c.classList.remove(Ke),this.enableDisableItem(m.id,m.disabled)}}else this.isUpdateItems=!0,this.itemsModel.push(e),this.targetTabs[e.id]=s.tabIndex}},s.prototype.removeItemElement=function(e,o,i){var n=null;this.activeLayout===t.Classic?(n=o.displayOptions&r.Classic?e.querySelector("#"+o.id):null,"GroupButton"===o.type&&(n=o.displayOptions&r.Classic?e.querySelector("#"+o.id+Po):null)):(n=o.displayOptions&r.Simplified?e.querySelector("#"+o.id):null)||(n=i.target.querySelector("#"+o.id)),n&&(this.destroyFunction(o,n),"GroupButton"===o.type&&this.activeLayout===t.Simplified?document.getElementById(o.id+go).remove():n.closest("#"+o.id+go).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 Xo(this.tabs,e).item},s.prototype.enableDisableItem=function(e,t){var o,i=!1,r=Xo(this.tabs,e);if(r&&(r.item.setProperties({disabled:t},!0),o="GroupButton"===r.item.type?ei(this,e+Po,r):ei(this,e,r))){var n=(0,T.closest)(o,".e-ribbon-item"),s=this.getItemModuleName(r.item);if(i=t?!n.classList.contains(Ke):n.classList.contains(Ke),"template"!==s){if(i)if("group-btn"===s&&"Simplified"===this.activeLayout){$o(o,"dropdown-btn",t);for(var a=0;a<r.item.groupButtonSettings.items.length;a++){$o(document.querySelector("#"+e+Po+a),"btn",t)}}else if("group-btn"===s&&"Classic"===this.activeLayout)for(a=0;a<r.item.groupButtonSettings.items.length;a++){$o(o.querySelector("#"+e+Po+a),"btn",t)}else $o(o,s,t)}else o.classList.toggle(Ke,t),o.toggleAttribute("disabled",t);n.classList.toggle(Ke,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,ri(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&&((0,T.remove)(this.ribbonTempEle),this.ribbonTempEle=null),e.prototype.destroy.call(this),this.tabObj.destroy(),this.tabObj=void 0,this.initialPropsData={},this.hiddenGroups=[],this.hiddenElements={},this.keyTipElements={},this.itemsModel=[],this.targetTabs={},(0,T.remove)(this.element.querySelector("#"+this.element.id+ao)),this.element.style.removeProperty(Eo),this.element.style.removeProperty(Do),this.element.style.removeProperty("width"),this.cssClass&&(0,T.removeClass)([this.element],this.cssClass.split(Qe)),this.element.classList.remove(Ue,Zt,ut,at,ht,"e-rbn"),this.unwireEvents()},s.prototype.onPropertyChanged=function(e,t){for(var o,i,r=0,n=Object.keys(e);r<n.length;r++){switch(n[r]){case"activeLayout":this.switchLayout();break;case"cssClass":t.cssClass&&(o=this.element.classList).remove.apply(o,t.cssClass.split(Qe)),e.cssClass&&(i=this.element.classList).add.apply(i,e.cssClass.split(Qe));break;case"isMinimized":this.element.classList.toggle(ht,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(Ue,this.enableRtl),this.updateCommonProperty({enableRtl:e.enableRtl}),this.scrollModule&&this.scrollModule.setProperties({enableRtl:e.enableRtl});break;case"launcherIconCss":for(var s=0;s<this.tabs.length;s++){var a=this.tabObj.items[parseInt(s.toString(),10)].content,l=this.tabs[parseInt(s.toString(),10)];if(a.querySelector("."+bt))for(var p=0,c=l.groups;p<c.length;p++){var u=c[p];if(u.showLauncherIcon){var d=Lt+" "+(this.launcherIconCss||Et);if(u.isCollapsed){var h=a.querySelector("#"+u.id+vo+So);(0,T.getComponent)(h,H.DropDownButton).target.querySelector("#"+u.id+mo).className=d}else{(h=a.querySelector("#"+u.id+mo)).className=d}}}}break;case"selectedTab":var b=this.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(e.selectedTab.toString(),10)];b.classList.contains("e-hidden")||b.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(s=0;s<this.contextualTabs.length;s++)e.contextualTabs[parseInt(s.toString(),10)]&&this.ribbonContextualTabModule.updateContextualTabs(e.contextualTabs[parseInt(s.toString(),10)],this.contextualTabs[parseInt(s.toString(),10)]);break;case"width":this.element.style.width=(0,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&&((0,T.remove)(this.ribbonTempEle),this.ribbonTempEle=null,this.tabObj.element.style.setProperty(Do,"0px")),this.helpPaneTemplate&&this.createHelpPaneTemplate(),this.tabObj.tbObj.refreshOverflow();break;case"hideLayoutSwitcher":this.hideLayoutSwitcher?this.removeExpandCollapse():this.addExpandCollapse()}}},ci([(0,T.Property)("Classic")],s.prototype,"activeLayout",void 0),ci([(0,T.Property)("")],s.prototype,"cssClass",void 0),ci([(0,T.Property)(!1)],s.prototype,"enableKeyTips",void 0),ci([(0,T.Property)("")],s.prototype,"layoutSwitcherKeyTip",void 0),ci([(0,T.Complex)({},Te)],s.prototype,"fileMenu",void 0),ci([(0,T.Complex)({},qe)],s.prototype,"backStageMenu",void 0),ci([(0,T.Property)("")],s.prototype,"launcherIconCss",void 0),ci([(0,T.Property)(!1)],s.prototype,"isMinimized",void 0),ci([(0,T.Property)("en-us")],s.prototype,"locale",void 0),ci([(0,T.Property)(0)],s.prototype,"selectedTab",void 0),ci([(0,T.Complex)({},B.TabAnimationSettings)],s.prototype,"tabAnimation",void 0),ci([(0,T.Collection)([],we)],s.prototype,"tabs",void 0),ci([(0,T.Collection)([],je)],s.prototype,"contextualTabs",void 0),ci([(0,T.Property)("100%")],s.prototype,"width",void 0),ci([(0,T.Property)("")],s.prototype,"helpPaneTemplate",void 0),ci([(0,T.Property)(!1)],s.prototype,"hideLayoutSwitcher",void 0),ci([(0,T.Event)()],s.prototype,"tabSelecting",void 0),ci([(0,T.Event)()],s.prototype,"tabSelected",void 0),ci([(0,T.Event)()],s.prototype,"ribbonExpanding",void 0),ci([(0,T.Event)()],s.prototype,"ribbonCollapsing",void 0),ci([(0,T.Event)()],s.prototype,"ribbonLayoutSwitched",void 0),ci([(0,T.Event)()],s.prototype,"launcherIconClick",void 0),ci([(0,T.Event)()],s.prototype,"created",void 0),ci([(0,T.Event)()],s.prototype,"overflowPopupOpen",void 0),ci([(0,T.Event)()],s.prototype,"overflowPopupClose",void 0),s=a=ci([T.NotifyPropertyChanges],s)}(T.Component),di=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+Io});var o=this.parent.tabObj.element,i=o.querySelector(".e-toolbar");o.insertBefore(this.ddbElement,i),this.fileMenuDDB=new H.DropDownButton({content:e.text,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-file-menu e-caret-hide",created:function(){o.style.setProperty(Eo,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){ti(e.ribbonTooltipSettings)&&(this.ddbElement.classList.add(Ft),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 t=this,o=this.parent.createElement("ul",{id:this.parent.element.id+Oo});this.fileMenuDDB.setProperties({target:o}),this.menuctrl=new B.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),T.EventHandler.add(o,"keydown",(function(e){"Tab"===e.key&&t.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(Eo,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(Eo),this.destroyMenu(),this.fileMenuDDB.destroy(),this.fileMenuDDB=null,(0,T.remove)(this.ddbElement),this.ddbElement=null},e.prototype.removeFileMenuTooltip=function(){var e=this,t=Uo(this.parent.tooltipData,(function(t){return t.id===e.ddbElement.id}));-1!==t&&(this.ddbElement.classList.remove(Ft),this.parent.tooltipData.splice(t,1))},e.prototype.removeFileMenuKeytip=function(){var e=this;if(this.parent.keyTipElements.filemenu){var t=Uo(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}(),hi=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])},e(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)}}(),bi=function(e){function t(t){var o=e.call(this)||this;return o.parent=t,o}return hi(t,e),t.prototype.render=function(){},t.prototype.preRender=function(){},t.prototype.getPersistData=function(){return""},t.prototype.onPropertyChanged=function(){},t.prototype.getModuleName=function(){return"ribbonBackstage"},t.prototype.destroy=function(){this.backstageButton&&this.destroyDDB(),this.parent=null},t.prototype.createBackStage=function(e){var t=this;if(e.visible){this.backstageButtonEle=this.parent.createElement("button",{id:this.parent.element.id+Co});var o=this.parent.tabObj.element,i=o.querySelector(".e-toolbar");if(o.insertBefore(this.backstageButtonEle,i),this.backstageButton=new Ge.Button({content:e.text,enableRtl:this.parent.enableRtl,cssClass:to,created:function(){o.style.setProperty(Eo,t.backstageButtonEle.offsetWidth+"px")}},this.backstageButtonEle),this.createBackStagePopup(e),this.parent.backStageMenu.template)this.createBackStageTemplate(this.parent.backStageMenu.template);else{for(var r=0,n=0,s=0;s<e.items.length;s++){e.items[parseInt(s.toString(),10)].isFooter?r++:n++}n>0&&this.createBackstageMenu(e,!1),r>0&&this.createBackstageMenu(e,!0),this.menuCtrl&&this.checkMenuItems(this.menuCtrl.items),this.footerMenuCtrl&&this.checkMenuItems(this.footerMenuCtrl.items)}this.backstageButtonEle.onclick=function(o){o.stopPropagation(),t.showBackstage(),t.popupHTMLElement.classList.add(Qt);var i=t.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&&t.menuCtrl.items[0].text===n.text){var s=t.popupHTMLElement.querySelector("#"+t.menuCtrl.items[0].id);s&&(s.classList.add("e-selected"),s.focus(),t.menuIndex=0,t.isCloseBtn=!1),t.createBackStageContent(t.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)}},t.prototype.onClickEvent=function(e){var t=e.target;this.popupHTMLElement.contains(t)||this.hideBackstage()},t.prototype.addBackStageMenuTooltip=function(e){ti(e.ribbonTooltipSettings)&&(this.backstageButtonEle.classList.add(Ft),this.parent.tooltipData.push({id:this.backstageButtonEle.id,data:e.ribbonTooltipSettings}))},t.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})}},t.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(so)}},t.prototype.createBackStagePopup=function(e){var t=this;this.popupHTMLElement=this.parent.createElement("div",{id:this.parent.element.id+wo,className:Jt}),e.target?(e.target instanceof HTMLElement?e.target:document.querySelector(e.target)).appendChild(this.popupHTMLElement):this.parent.element.appendChild(this.popupHTMLElement),this.popupEle=new Ho.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(),T.EventHandler.add(this.popupHTMLElement,"keyup",(function(e){"Escape"===e.code&&t.hideBackstage(),t.handleNavigation(e)}),this)},t.prototype.handleNavigation=function(e){var t=this.popupHTMLElement.querySelector(".e-ribbon-close-btn"),o=this.popupHTMLElement.querySelectorAll(".e-menu-item"),i="ArrowUp"===e.key,r="ArrowDown"===e.key;if(i||r){i&&this.menuIndex>0||r&&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 n=0;n<o.length;n++)o[parseInt(n.toString(),10)].classList.remove("e-focused");this.isCloseBtn||(i&&o[this.menuIndex].classList.contains("e-separator")?this.menuIndex--:r&&o[this.menuIndex].classList.contains("e-separator")&&this.menuIndex++,o[this.menuIndex].classList.add("e-focused"),o[this.menuIndex].focus())}},t.prototype.updatePopupPositionOnRtl=function(e){var t=this.popupHTMLElement.style;e?(t.right=t.left,t.left="unset"):(t.left=t.right,t.right="unset")},t.prototype.createBackstageMenu=function(e,t){var o,i=this;if(this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_wrapper")||(this.menuWrapper=this.parent.createElement("div",{id:this.parent.element.id+"_wrapper",className:ro}),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 Ge.Button({content:e.backButton.text,iconCss:e.backButton.iconCss?e.backButton.iconCss:We,enableRtl:this.parent.enableRtl},r),this.menuWrapper.append(r),r.onclick=function(){i.popupHTMLElement.classList.remove(Qt),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:no}),this.menuWrapper.append(this.itemsWrapperEle)),t?(o=this.parent.createElement("ul",{id:this.parent.element.id+To}),this.itemsWrapperEle.appendChild(o)):(this.ulMenuElem=this.parent.createElement("ul",{id:this.parent.element.id+ko}),this.itemsWrapperEle.appendChild(this.ulMenuElem)),t?this.footerMenuCtrl=new B.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:oo,items:this.cloneFooterMenuItem(e.items),select:this.menuSelect.bind(this,e)},o):this.menuCtrl=new B.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:oo,items:this.cloneMenuItem(e.items),select:this.menuSelect.bind(this,e)},this.ulMenuElem)},t.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},t.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},t.prototype.createBackStageContent=function(e,t){var o="backstageContent";this.clearTemplate([o]),this.backstageContentEle?(this.backstageContentEle.innerHTML="",this.backstageContentEle.id=e+yo):this.backstageContentEle=this.parent.createElement("div",{id:e+yo,className:$t});var i=Vo(t);return(0,T.append)(i({},this,o,"backstageContent",this.parent.isStringTemplate),this.backstageContentEle),t&&this.popupHTMLElement.append(this.backstageContentEle),this.renderReactTemplates(),i},t.prototype.createBackStageTemplate=function(e){var t="backstageTemplate";this.clearTemplate([t]),this.backstageTempEle=this.parent.createElement("div",{id:this.parent.element.id+Co+"_template",className:io});var o=Vo(e);return(0,T.append)(o({},this,t,"backstageTemplate",this.parent.isStringTemplate),this.backstageTempEle),this.popupHTMLElement.append(this.backstageTempEle),this.renderReactTemplates(),o},t.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)},t.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)))},t.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(Eo,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&&((0,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 t=0,o=0,i=0;i<e.items.length;i++){e.items[parseInt(i.toString(),10)].isFooter?t++:o++}o>0&&this.createBackstageMenu(e,!1),t>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()},t.prototype.destroyMenu=function(){this.menuCtrl&&(this.menuCtrl.destroy(),this.menuCtrl=null)},t.prototype.destroyDDB=function(){this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip(),this.parent.tabObj.element.style.removeProperty(Eo),this.destroyMenu(),this.backstageButton.destroy(),this.backstageButton=null,(0,T.remove)(this.backstageButtonEle),this.backstageButtonEle=null,T.EventHandler.remove(document,"click",this.onClickEvent)},t.prototype.removeBackstageMenuTooltip=function(){var e=this,t=Uo(this.parent.tooltipData,(function(t){return t.id===e.backstageButtonEle.id}));-1!==t&&(this.backstageButtonEle.classList.remove(Ft),this.parent.tooltipData.splice(t,1))},t.prototype.removeBackstageMenuKeyTip=function(){var e=this;if(this.parent.keyTipElements.backstage&&this.parent.keyTipElements.backstage.length){var t=Uo(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--},t.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)},t.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)},t.prototype.showBackstage=function(){this.popupEle.show()},t.prototype.hideBackstage=function(){this.popupEle.element.classList.contains(Qt)&&this.popupEle.element.classList.remove(Qt),this.popupEle.hide()},t}(T.Component),fi=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(ot),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,t){if(!(0,T.isNullOrUndefined)(e.visible))for(var o=0;o<t.tabs.length;o++)e.visible?this.parent.showTab(t.tabs[parseInt(o.toString(),10)].id,!0):this.parent.hideTab(t.tabs[parseInt(o.toString(),10)].id,!0);if(!(0,T.isNullOrUndefined)(e.isSelected))if(e.isSelected&&t.visible)this.parent.selectTab(t.tabs[0].id);else{var i=this.parent.tabObj.element;for(o=0;o<this.parent.tabs.length;o++){var r=i.querySelectorAll(".e-toolbar-item")[parseInt(o.toString(),10)];if(!r.classList.contains("e-hidden")&&!r.classList.contains("e-disable")){this.parent.selectTab(this.parent.tabs[parseInt(o.toString(),10)].id);break}}}if(e.tabs)for(var n=function(e){var o=parseInt(e,10),i=s.parent.tabs.filter((function(e){return e.id===t.tabs[parseInt(o.toString(),10)].id}))[0];s.parent.updateTab(i)},s=this,a=0,l=Object.keys(e.tabs);a<l.length;a++){n(l[a])}},e}(),mi=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[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){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){var i,r;void 0===t&&(t=!1);var n=this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][""+e];if(n)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;-1!==n[parseInt(s.toString(),10)].id.indexOf("_grpbtn")&&(a=n[parseInt(s.toString(),10)].id.replace(/_grpbtn\d+/,""));var l=Xo(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 a,l=document.querySelector("#"+e),p=!1;(n&&(l=document.querySelector("#"+e+fo)),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));if((l&&l.offsetParent||n&&s)&&(s&&p||!s)){var c=this.parent.createElement("div",{className:Je,id:e+Lo});document.body.append(c),new Ho.Popup(c,{relateTo:"#"+(n?e+fo:a||e),content:t,collision:{X:"fit",Y:"flip"},targetType:"relative",position:{X:i,Y:r},enableRtl:this.parent.enableRtl}).show(),this.calculateKeyTipPosition(l,c,o,r),this.parent.isKeytipOpen=!0}},e.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")},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<Object.keys(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(-1!==n[parseInt(s.toString(),10)].id.indexOf("_popupButton")){var l=n[parseInt(s.toString(),10)].id.replace(/_popupButton/g,"");a=Xo(this.parent.tabs,l)}else a=Xo(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 c=n[parseInt(s.toString(),10)].id;if(t){if(-1!==n[parseInt(s.toString(),10)].id.indexOf("_launcher")||-1!==n[parseInt(s.toString(),10)].id.indexOf("_sim_grp_overflow")||-1!==n[parseInt(s.toString(),10)].id.indexOf("_overflow_dropdown"))c=n[parseInt(s.toString(),10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g,""),(a=Zo(this.parent.tabs,c)).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,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+ho+"-popup")&&document.querySelector("#"+s).closest("#"+this.parent.tabObj.element.id+ho+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+this.parent.tabObj.element.id+ho).click():document.querySelector("#"+s).closest("#"+e.group.id+vo+So+"-popup")&&document.querySelector("#"+s).closest("#"+e.group.id+vo+So+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+e.group.id+vo+So).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){(0,T.getInstance)(l,H.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+(Po+p),e.item.groupButtonSettings.items[parseInt(p.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 t=this,o=document.querySelectorAll(".e-ribbon-keytip"),i=!1;this.parent.keysPress="";for(var r=function(r){var s=o[parseInt(r.toString(),10)];if("Escape"===e&&n.parent.keyTipElements&&n.parent.keyTipElements[n.parent.selectedTab]){for(var a=0;a<Object.keys(n.parent.keyTipElements[n.parent.selectedTab]).length;a++){var l=Object.keys(n.parent.keyTipElements[parseInt(n.parent.selectedTab.toString(),10)])[parseInt(a.toString(),10)];if(-1!==Uo(n.parent.keyTipElements[parseInt(n.parent.selectedTab.toString(),10)][""+l],(function(e){return e.id+Lo===o[parseInt(r.toString(),10)].id}))){if("item"===l&&!n.isKeytipPopupOpen||"grpoverflow"===l&&"Classic"===n.parent.activeLayout){n.createKeytip("tab"),e="",i=!0;break}if(n.isKeytipPopupOpen&&("popupitem"===l&&"Simplified"===n.parent.activeLayout||"grpoverflowpopup"===l&&"Classic"===n.parent.activeLayout)){n.createKeytip("item"),e="",i=!0;break}}}for(var p=0;p<Object.keys(n.parent.keyTipElements).length;p++)if(n.parent.keyTipElements[parseInt(p.toString(),10)]){var c=n.parent.keyTipElements[parseInt(p.toString(),10)].tab;for(a=0;a<Object.keys(c).length;a++)if(s.id===c[0].id+Lo&&document.querySelector("#"+c[0].id+fo).closest(".e-toolbar-pop")){n.parent.tabObj.element.querySelector(".e-nav-active").click(),setTimeout((function(){t.createKeytip("tab")}),600),e="",i=!0;break}if(i)break}if(!i&&n.parent.keyTipElements.backstageMenu)-1!==Uo(n.parent.keyTipElements.backstageMenu,(function(e){return e.id+Lo===o[parseInt(r.toString(),10)].id}))&&(n.createKeytip("tab"),e="",i=!0)}s&&(0,T.remove)(s)},n=this,s=0;s<o.length;s++)r(s);this.isKeytipPopupOpen=!1,i||(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}(),yi=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])},e(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)}}(),gi=function(e){function t(t){var o=e.call(this,t)||this;return o.initRenderCalled=!1,o.checkInjectedModules=!0,o.directivekeys={ribbonTabs:{ribbonTab:{ribbonGroups:{ribbonGroup:{ribbonCollections:{ribbonCollection:{ribbonItems:"ribbonItem"}}}}}},ribbonContextualTabs:{ribbonContextualTab:{ribbonTabs:{ribbonTab:{ribbonGroups:{ribbonGroup:{ribbonCollections:{ribbonCollection:{ribbonItems:"ribbonItem"}}}}}}}}},o.statelessTemplateProps=null,o.templateProps=null,o.immediateRender=!1,o.portals=[],o}return yi(t,e),t.prototype.render=function(){if(!(this.element&&!this.initRenderCalled||this.refreshing)||this.isReactForeceUpdate)return k.createElement("div",this.getDefaultAttributes(),[].concat(this.props.children,this.portals));e.prototype.render.call(this),this.initRenderCalled=!0},t}(ui);(0,a.applyMixins)(gi,[a.ComponentBase,k.Component])})(),d})()));