@oracle/oraclejet 14.1.2 → 14.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/THIRDPARTYLICENSE.txt +8 -8
- package/dist/css/alta/oj-alta-min.css +1 -1
- package/dist/css/alta/oj-alta-notag-min.css +1 -1
- package/dist/css/alta/oj-alta-notag.css +1 -1
- package/dist/css/alta/oj-alta.css +1 -1
- package/dist/css/alta-android/oj-alta-min.css +1 -1
- package/dist/css/alta-android/oj-alta.css +1 -1
- package/dist/css/alta-ios/oj-alta-min.css +1 -1
- package/dist/css/alta-ios/oj-alta.css +1 -1
- package/dist/css/alta-windows/oj-alta-min.css +1 -1
- package/dist/css/alta-windows/oj-alta.css +1 -1
- package/dist/css/redwood/oj-redwood-min.css +1 -1
- package/dist/css/redwood/oj-redwood-notag-min.css +1 -1
- package/dist/css/redwood/oj-redwood-notag.css +1 -1
- package/dist/css/redwood/oj-redwood.css +1 -1
- package/dist/css/stable/oj-stable-min.css +1 -1
- package/dist/css/stable/oj-stable.css +1 -1
- package/dist/icu-l10n/Bundler.d.ts +42 -0
- package/dist/icu-l10n/Bundler.js +85 -41
- package/dist/icu-l10n/PatternCompiler.d.ts +83 -0
- package/dist/icu-l10n/PatternCompiler.js +1 -1
- package/dist/icu-l10n/README.md +6 -1
- package/dist/icu-l10n/l10nBundleBuilder.js +1 -1
- package/dist/icu-l10n/package.json +3 -1
- package/dist/icu-l10n/test/bundleTypeTest.ts +40 -0
- package/dist/icu-l10n/test/jest.config.js +2 -1
- package/dist/icu-l10n/test/l10nTest.js +64 -59
- package/dist/icu-l10n/test/{custom-hooks.js → resources/custom-hooks.js} +1 -1
- package/dist/icu-l10n/test/resources/nls/app-strings-legacy-keys.json +5 -0
- package/dist/icu-l10n/test/resources/nls/app-strings.json +2 -1
- package/dist/icu-l10n/tsconfig.json +7 -0
- package/dist/js/libs/oj/debug/ojconverter-nativedatetime.js +28 -17
- package/dist/js/libs/oj/debug/ojcore-base.js +2 -2
- package/dist/js/libs/oj/debug/ojdatagrid.js +18 -8
- package/dist/js/libs/oj/debug/ojdatetimepicker.js +45 -10
- package/dist/js/libs/oj/debug/ojmenu.js +21 -2
- package/dist/js/libs/oj/debug/ojnavigationlist.js +0 -7
- package/dist/js/libs/oj/debug/ojpopupcore.js +9 -0
- package/dist/js/libs/oj/debug/ojstreamlist.js +3 -0
- package/dist/js/libs/oj/debug/ojtable.js +95 -113
- package/dist/js/libs/oj/debug_esm/ojconverter-nativedatetime.js +28 -17
- package/dist/js/libs/oj/debug_esm/ojcore-base.js +2 -2
- package/dist/js/libs/oj/debug_esm/ojdatagrid.js +18 -8
- package/dist/js/libs/oj/debug_esm/ojdatetimepicker.js +45 -10
- package/dist/js/libs/oj/debug_esm/ojmenu.js +21 -2
- package/dist/js/libs/oj/debug_esm/ojnavigationlist.js +0 -7
- package/dist/js/libs/oj/debug_esm/ojpopupcore.js +9 -0
- package/dist/js/libs/oj/debug_esm/ojstreamlist.js +3 -0
- package/dist/js/libs/oj/debug_esm/ojtable.js +95 -113
- package/dist/js/libs/oj/main-template.js +3 -3
- package/dist/js/libs/oj/min/ojconverter-nativedatetime.js +1 -1
- package/dist/js/libs/oj/min/ojconverter-nativedatetime.js.map +1 -1
- package/dist/js/libs/oj/min/ojcore-base.js +1 -1
- package/dist/js/libs/oj/min/ojdatagrid.js +1 -1
- package/dist/js/libs/oj/min/ojdatagrid.js.map +1 -1
- package/dist/js/libs/oj/min/ojdatetimepicker.js +1 -1
- package/dist/js/libs/oj/min/ojdatetimepicker.js.map +1 -1
- package/dist/js/libs/oj/min/ojmenu.js +1 -1
- package/dist/js/libs/oj/min/ojmenu.js.map +1 -1
- package/dist/js/libs/oj/min/ojnavigationlist.js +1 -1
- package/dist/js/libs/oj/min/ojnavigationlist.js.map +1 -1
- package/dist/js/libs/oj/min/ojpopupcore.js +1 -1
- package/dist/js/libs/oj/min/ojpopupcore.js.map +1 -1
- package/dist/js/libs/oj/min/ojstreamlist.js +1 -1
- package/dist/js/libs/oj/min/ojstreamlist.js.map +1 -1
- package/dist/js/libs/oj/min/ojtable.js +1 -1
- package/dist/js/libs/oj/min/ojtable.js.map +1 -1
- package/dist/metadata/components/allComponents.json +239 -239
- package/dist/package-backup.json +1 -1
- package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/helpers/themes/base/_oj-helpers.scss +1 -1
- package/dist/scss/common/helpers/_oj.common.helpers.scss +1 -1
- package/dist/webpack-tools/4.x/webpack.config.js +3 -3
- package/dist/webpack-tools/webpack.config.js +3 -3
- package/package.json +2 -2
- /package/dist/icu-l10n/test/{custom-hooks-no-def.js → resources/custom-hooks-no-def.js} +0 -0
- /package/dist/icu-l10n/test/{escape-util.js → resources/escape-util.js} +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/accordion/themes/base/_oj-accordion.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/accordion/themes/redwood/_oj-accordion.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/accordion/themes/redwood/oj-accordion.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/accordion/themes/stable/_oj-accordion.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/accordion/themes/stable/oj-accordion.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/action-card/themes/base/_oj-action-card.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/action-card/themes/redwood/_oj-action-card.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/action-card/themes/redwood/oj-action-card.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/action-card/themes/stable/_oj-action-card.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/action-card/themes/stable/oj-action-card.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/base/_oj.common.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/base/oj.common.settings.cssvariables.css +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/redwood/_oj-all-components-common.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/redwood/_oj-all-components-notag.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/redwood/_oj-all-components.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/redwood/_oj.redwood.settings.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/redwood/oj.redwood.cssvars.settings.css +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/stable/_oj-all-components-common.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/stable/_oj-all-components-notag.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/stable/_oj-all-components.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/stable/_oj.stable.settings.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/all-components/themes/stable/oj.stable.cssvars.settings.css +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/animation/themes/base/_oj-animation.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/animation/themes/redwood/_oj-animation.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/animation/themes/redwood/_oj-animation.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/animation/themes/redwood/oj-animation.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/animation/themes/stable/_oj-animation.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/animation/themes/stable/_oj-animation.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/animation/themes/stable/oj-animation.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout/themes/base/_oj-app-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout/themes/redwood/_oj-app-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout/themes/redwood/_oj-app-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout/themes/stable/_oj-app-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout/themes/stable/_oj-app-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-hybrid/themes/base/_oj-app-layout-hybrid-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-hybrid/themes/base/_oj-app-layout-hybrid.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-hybrid/themes/redwood/_oj-app-layout-hybrid.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-hybrid/themes/redwood/oj-app-layout-hybrid.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-hybrid/themes/stable/_oj-app-layout-hybrid.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-hybrid/themes/stable/oj-app-layout-hybrid.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-web/themes/base/_oj-app-layout-web.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-web/themes/redwood/_oj-app-layout-web.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-web/themes/redwood/oj-app-layout-web.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-web/themes/stable/_oj-app-layout-web.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/app-layout-web/themes/stable/oj-app-layout-web.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/avatar/themes/base/_oj-avatar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/avatar/themes/redwood/_oj-avatar-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/avatar/themes/redwood/_oj-avatar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/avatar/themes/redwood/_oj-avatar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/avatar/themes/redwood/oj-avatar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/avatar/themes/stable/_oj-avatar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/avatar/themes/stable/_oj-avatar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/avatar/themes/stable/oj-avatar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/badge/themes/base/_oj-badge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/badge/themes/redwood/_oj-badge-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/badge/themes/redwood/_oj-badge-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/badge/themes/redwood/_oj-badge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/badge/themes/redwood/oj-badge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/badge/themes/stable/_oj-badge-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/badge/themes/stable/_oj-badge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/badge/themes/stable/oj-badge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/button/themes/base/_oj-button.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/button/themes/redwood/_oj-button-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/button/themes/redwood/_oj-button-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/button/themes/redwood/_oj-button.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/button/themes/redwood/oj-button.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/button/themes/stable/_oj-button-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/button/themes/stable/_oj-button-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/button/themes/stable/_oj-button.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/button/themes/stable/oj-button.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset/themes/base/_oj-buttonset.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset/themes/redwood/_oj-buttonset-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset/themes/redwood/_oj-buttonset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset/themes/redwood/_oj-buttonset.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset/themes/stable/_oj-buttonset-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset/themes/stable/_oj-buttonset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset/themes/stable/_oj-buttonset.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset-many/themes/redwood/oj-buttonset-many.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset-many/themes/stable/oj-buttonset-many.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset-one/themes/redwood/oj-buttonset-one.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/buttonset-one/themes/stable/oj-buttonset-one.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/chart/themes/base/_oj-chart.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/chart/themes/redwood/_oj-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/chart/themes/redwood/oj-chart.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/chart/themes/stable/_oj-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/chart/themes/stable/oj-chart.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/checkboxset/themes/redwood/_oj-checkboxset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/checkboxset/themes/redwood/oj-checkboxset.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/checkboxset/themes/stable/_oj-checkboxset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/checkboxset/themes/stable/oj-checkboxset.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/collapsible/themes/base/_oj-collapsible.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/collapsible/themes/redwood/_oj-collapsible.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/collapsible/themes/redwood/oj-collapsible.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/collapsible/themes/stable/_oj-collapsible.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/collapsible/themes/stable/oj-collapsible.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/collection/themes/redwood/_oj-collection-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/collection/themes/redwood/_oj-collection-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/collection/themes/redwood/_oj-collection.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/collection/themes/stable/_oj-collection.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/color-palette/themes/base/_oj-color-palette.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/color-palette/themes/redwood/_oj-color-palette.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/color-palette/themes/redwood/oj-color-palette.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/color-palette/themes/stable/_oj-color-palette.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/color-palette/themes/stable/oj-color-palette.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/color-spectrum/themes/base/_oj-color-spectrum.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/color-spectrum/themes/redwood/_oj-color-spectrum.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/color-spectrum/themes/redwood/oj-color-spectrum.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/color-spectrum/themes/stable/_oj-color-spectrum.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/color-spectrum/themes/stable/oj-color-spectrum.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/combobox/themes/base/_oj-combobox.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/combobox/themes/redwood/_oj-combobox.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/combobox/themes/redwood/_oj-combobox.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/combobox/themes/stable/_oj-combobox.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/combobox/themes/stable/_oj-combobox.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/combobox-many/themes/redwood/oj-combobox-many.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/combobox-many/themes/stable/oj-combobox-many.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/combobox-one/themes/redwood/oj-combobox-one.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/combobox-one/themes/stable/oj-combobox-one.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/conveyor-belt/themes/base/_oj-conveyor-belt.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/conveyor-belt/themes/redwood/_oj-conveyor-belt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/conveyor-belt/themes/redwood/oj-conveyor-belt.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/conveyor-belt/themes/stable/_oj-conveyor-belt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/conveyor-belt/themes/stable/oj-conveyor-belt.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/core/themes/redwood/_oj-core-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/core/themes/redwood/_oj-core-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/core/themes/redwood/_oj-core.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/core/themes/stable/_oj-core-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/core/themes/stable/_oj-core-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/core/themes/stable/_oj-core.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/data-grid/themes/base/_oj-data-grid.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/data-grid/themes/redwood/_oj-data-grid-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/data-grid/themes/redwood/_oj-data-grid.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/data-grid/themes/redwood/oj-data-grid.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/data-grid/themes/stable/_oj-data-grid-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/data-grid/themes/stable/_oj-data-grid.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/data-grid/themes/stable/oj-data-grid.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/date-picker/themes/redwood/oj-date-picker.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/date-picker/themes/stable/oj-date-picker.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/date-time-picker/themes/base/_oj-date-time-picker.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/date-time-picker/themes/redwood/_oj-date-time-picker.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/date-time-picker/themes/redwood/_oj-date-time-picker.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/date-time-picker/themes/redwood/oj-date-time-picker.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/date-time-picker/themes/stable/_oj-date-time-picker.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/date-time-picker/themes/stable/_oj-date-time-picker.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/date-time-picker/themes/stable/oj-date-time-picker.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/diagram/themes/base/_oj-diagram.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/diagram/themes/redwood/_oj-diagram.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/diagram/themes/redwood/oj-diagram.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/diagram/themes/stable/_oj-diagram.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/diagram/themes/stable/oj-diagram.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/base/_oj-dialog-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/base/_oj-dialog.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/redwood/_oj-dialog-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/redwood/_oj-dialog-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/redwood/_oj-dialog.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/redwood/_oj-dialog.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/redwood/oj-dialog.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/stable/_oj-dialog-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/stable/_oj-dialog.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/stable/_oj-dialog.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dialog/themes/stable/oj-dialog.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-layout/themes/base/_oj-drawer-layout-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-layout/themes/base/_oj-drawer-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-layout/themes/redwood/_oj-drawer-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-layout/themes/redwood/oj-drawer-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-layout/themes/stable/_oj-drawer-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-layout/themes/stable/oj-drawer-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-popup/themes/base/_oj-drawer-popup-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-popup/themes/base/_oj-drawer-popup.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-popup/themes/redwood/_oj-drawer-popup.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-popup/themes/redwood/oj-drawer-popup.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-popup/themes/stable/_oj-drawer-popup.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/drawer-popup/themes/stable/oj-drawer-popup.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dvt/themes/base/_oj-dvt.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dvt/themes/redwood/_oj-dvt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dvt/themes/redwood/_oj-dvt.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dvt/themes/stable/_oj-dvt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/dvt/themes/stable/_oj-dvt.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/file-picker/themes/base/_oj-file-picker.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/file-picker/themes/redwood/_oj-file-picker.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/file-picker/themes/redwood/oj-file-picker.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/file-picker/themes/stable/_oj-file-picker.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/file-picker/themes/stable/oj-file-picker.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/film-strip/themes/base/_oj-film-strip.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/film-strip/themes/redwood/_oj-film-strip.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/film-strip/themes/redwood/oj-film-strip.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/film-strip/themes/stable/_oj-film-strip.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/film-strip/themes/stable/oj-film-strip.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/flex/themes/base/_oj-flex.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/flex/themes/redwood/oj-flex.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/flex/themes/stable/oj-flex.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/base/_oj-form-control.mixins.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/base/_oj-form-control.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/base/_oj-messaging.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/redwood/_oj-form-control.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/redwood/_oj-form-control.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/redwood/_oj-messaging.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/redwood/_oj-messaging.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/stable/_oj-form-control.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/stable/_oj-form-control.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/stable/_oj-messaging.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-control/themes/stable/_oj-messaging.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-layout/themes/base/_oj-form-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-layout/themes/redwood/_oj-form-layout-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-layout/themes/redwood/_oj-form-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-layout/themes/redwood/_oj-form-layout.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-layout/themes/redwood/oj-form-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-layout/themes/stable/_oj-form-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-layout/themes/stable/_oj-form-layout.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/form-layout/themes/stable/oj-form-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/gantt/themes/base/_oj-gantt.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/gantt/themes/redwood/_oj-gantt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/gantt/themes/redwood/oj-gantt.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/gantt/themes/stable/_oj-gantt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/gantt/themes/stable/oj-gantt.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/gauge/themes/base/_oj-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/gauge/themes/redwood/_oj-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/gauge/themes/redwood/oj-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/gauge/themes/stable/_oj-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/gauge/themes/stable/oj-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/grid/themes/base/_oj-grid.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/grid/themes/redwood/oj-grid.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/grid/themes/stable/oj-grid.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/helpers/themes/base/_oj-helpers-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/helpers/themes/base/_oj-responsive-helpers.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/helpers/themes/redwood/_oj-theme.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/helpers/themes/redwood/oj-helpers.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/helpers/themes/redwood/oj-responsive.helpers.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/helpers/themes/stable/_oj-theme.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/helpers/themes/stable/oj-helpers.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/helpers/themes/stable/oj-responsive.helpers.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/highlight-text/themes/base/_oj-highlight-text.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/highlight-text/themes/redwood/oj-highlight-text.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/highlight-text/themes/stable/oj-highlight-text.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icon-circle/themes/base/_oj-icon-circle.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icon-circle/themes/redwood/_oj-icon-circle-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icon-circle/themes/redwood/_oj-icon-circle.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icon-circle/themes/redwood/oj-icon-circle.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icons/themes/base/_oj-icons.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icons/themes/redwood/_oj-icon-font.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icons/themes/redwood/_oj-icons-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icons/themes/redwood/_oj-icons.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icons/themes/redwood/oj-icons.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icons/themes/stable/_oj-icon-font.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icons/themes/stable/_oj-icons-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icons/themes/stable/_oj-icons.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/icons/themes/stable/oj-icons.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/indexer/themes/base/_oj-indexer.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/indexer/themes/redwood/_oj-indexer.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/indexer/themes/redwood/oj-indexer.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/indexer/themes/stable/_oj-indexer.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/indexer/themes/stable/oj-indexer.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-date/themes/redwood/oj-input-date.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-date/themes/stable/oj-input-date.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-date-time/themes/redwood/oj-input-date-time.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-date-time/themes/stable/oj-input-date-time.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-number/themes/base/_oj-input-number.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-number/themes/redwood/_oj-input-number.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-number/themes/redwood/oj-input-number.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-number/themes/stable/_oj-input-number.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-number/themes/stable/oj-input-number.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-password/themes/redwood/oj-input-password.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-password/themes/stable/oj-input-password.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-search/themes/base/_oj-input-search.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-search/themes/redwood/_oj-input-search-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-search/themes/redwood/_oj-input-search.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-search/themes/redwood/_oj-input-search.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-search/themes/stable/_oj-input-search-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-search/themes/stable/_oj-input-search.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-search/themes/stable/_oj-input-search.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-text/themes/base/_oj-input-text.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-text/themes/redwood/_oj-input-text.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-text/themes/redwood/oj-input-text.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-text/themes/stable/_oj-input-text.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-text/themes/stable/oj-input-text.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-time/themes/redwood/oj-input-time.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/input-time/themes/stable/oj-input-time.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/label/themes/base/_oj-label.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/label/themes/redwood/_oj-label-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/label/themes/redwood/_oj-label.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/label/themes/redwood/oj-label.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/label/themes/stable/_oj-label-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/label/themes/stable/_oj-label.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/label/themes/stable/oj-label.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/label-value/themes/base/_oj-label-value.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/label-value/themes/redwood/_oj-label-value.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/label-value/themes/stable/_oj-label-value.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/led-gauge/themes/base/_oj-led-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/led-gauge/themes/redwood/_oj-led-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/led-gauge/themes/redwood/oj-led-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/led-gauge/themes/stable/_oj-led-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/led-gauge/themes/stable/oj-led-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/legend/themes/base/_oj-legend.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/legend/themes/redwood/_oj-legend.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/legend/themes/redwood/oj-legend.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/legend/themes/stable/_oj-legend.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/legend/themes/stable/oj-legend.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-box/themes/base/_oj-list-box.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-box/themes/redwood/_oj-list-box.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-box/themes/redwood/_oj-list-box.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-box/themes/stable/_oj-list-box.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-box/themes/stable/_oj-list-box.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-item-layout/themes/base/_oj-list-item-layout.scoped.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-item-layout/themes/base/_oj-list-item-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-item-layout/themes/redwood/_oj-list-item-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-item-layout/themes/redwood/oj-list-item-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-item-layout/themes/stable/_oj-list-item-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-item-layout/themes/stable/oj-list-item-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-view/themes/base/_oj-list-view.scoped.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-view/themes/base/_oj-list-view.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-view/themes/redwood/_oj-list-view-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-view/themes/redwood/_oj-list-view.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-view/themes/redwood/oj-list-view.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-view/themes/stable/_oj-list-view.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/list-view/themes/stable/oj-list-view.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/masonry-layout/themes/base/_oj-masonry-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/masonry-layout/themes/redwood/_oj-masonry-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/masonry-layout/themes/redwood/_oj-masonry-layout.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/masonry-layout/themes/redwood/oj-masonry-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/masonry-layout/themes/stable/_oj-masonry-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/masonry-layout/themes/stable/_oj-masonry-layout.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/masonry-layout/themes/stable/oj-masonry-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu/themes/base/_oj-menu.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu/themes/redwood/_oj-menu.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu/themes/redwood/oj-menu.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu/themes/stable/_oj-menu.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu/themes/stable/oj-menu.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-button/themes/base/_oj-menu-button.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-button/themes/redwood/_oj-menu-button.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-button/themes/redwood/_oj-menu-button.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-button/themes/redwood/oj-menu-button.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-button/themes/stable/_oj-menu-button.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-button/themes/stable/_oj-menu-button.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-button/themes/stable/oj-menu-button.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-select-many/themes/base/_oj-menu-select-many.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-select-many/themes/redwood/_oj-menu-select-many.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-select-many/themes/redwood/oj-menu-select-many.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-select-many/themes/stable/_oj-menu-select-many.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/menu-select-many/themes/stable/oj-menu-select-many.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message/themes/base/_oj-message.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message/themes/redwood/_oj-message-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message/themes/redwood/_oj-message.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message/themes/redwood/_oj-message.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message/themes/redwood/oj-message.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message/themes/stable/_oj-message-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message/themes/stable/_oj-message.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message/themes/stable/_oj-message.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message/themes/stable/oj-message.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message-banner/themes/base/_oj-message-banner.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message-banner/themes/redwood/_oj-message-banner-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message-banner/themes/redwood/_oj-message-banner.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message-banner/themes/redwood/_oj-message-banner.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message-banner/themes/stable/_oj-message-banner-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message-banner/themes/stable/_oj-message-banner.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/message-banner/themes/stable/_oj-message-banner.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/messages/themes/base/_oj-messages.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/messages/themes/redwood/_oj-messages.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/messages/themes/redwood/_oj-messages.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/messages/themes/redwood/oj-messages.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/messages/themes/stable/_oj-messages.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/messages/themes/stable/_oj-messages.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/messages/themes/stable/oj-messages.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/module/themes/base/_oj-module.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/module/themes/redwood/oj-module.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/module/themes/stable/oj-module.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/n-box/themes/base/_oj-n-box.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/n-box/themes/redwood/_oj-n-box.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/n-box/themes/redwood/oj-n-box.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/n-box/themes/stable/_oj-n-box.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/n-box/themes/stable/oj-n-box.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/navigation-list/themes/base/_oj-navigation-list.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/navigation-list/themes/redwood/_oj-navigation-list-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/navigation-list/themes/redwood/_oj-navigation-list.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/navigation-list/themes/redwood/oj-navigation-list.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/navigation-list/themes/stable/_oj-navigation-list-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/navigation-list/themes/stable/_oj-navigation-list.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/navigation-list/themes/stable/oj-navigation-list.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/off-canvas/themes/base/_oj-off-canvas.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/off-canvas/themes/redwood/_oj-off-canvas.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/off-canvas/themes/redwood/oj-off-canvas.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/off-canvas/themes/stable/_oj-off-canvas.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/off-canvas/themes/stable/oj-off-canvas.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/optgroup/themes/base/_oj-optgroup.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/optgroup/themes/redwood/oj-optgroup.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/optgroup/themes/stable/oj-optgroup.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/option/themes/base/_oj-option.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/option/themes/redwood/oj-option.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/option/themes/stable/oj-option.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/paging-control/themes/base/_oj-paging-control.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/paging-control/themes/redwood/_oj-paging-control.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/paging-control/themes/redwood/oj-paging-control.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/paging-control/themes/stable/_oj-paging-control.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/paging-control/themes/stable/oj-paging-control.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/palette/themes/redwood/_oj-palette-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/palette/themes/redwood/_oj-palette.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/palette/themes/stable/_oj-palette.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/panel/themes/base/_oj-panel-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/panel/themes/base/_oj-panel.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/panel/themes/redwood/_oj-panel-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/panel/themes/redwood/_oj-panel.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/panel/themes/redwood/oj-panel.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/panel/themes/stable/_oj-panel-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/panel/themes/stable/_oj-panel.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/panel/themes/stable/oj-panel.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/picto-chart/themes/base/_oj-picto-chart.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/picto-chart/themes/redwood/_oj-picto-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/picto-chart/themes/redwood/oj-picto-chart.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/picto-chart/themes/stable/_oj-picto-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/picto-chart/themes/stable/oj-picto-chart.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/popup/themes/base/_oj-layer.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/popup/themes/base/_oj-popup-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/popup/themes/base/_oj-popup.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/popup/themes/redwood/_oj-layer.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/popup/themes/redwood/_oj-popup-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/popup/themes/redwood/_oj-popup.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/popup/themes/redwood/oj-popup.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/popup/themes/stable/_oj-layer.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/popup/themes/stable/_oj-popup.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/popup/themes/stable/oj-popup.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-bar/themes/base/_oj-progress-bar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-bar/themes/redwood/_oj-progress-bar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-bar/themes/redwood/_oj-progress-bar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-bar/themes/redwood/oj-progress-bar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-bar/themes/stable/_oj-progress-bar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-bar/themes/stable/_oj-progress-bar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-bar/themes/stable/oj-progress-bar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-circle/themes/base/_oj-progress-circle.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-circle/themes/redwood/_oj-progress-circle-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-circle/themes/redwood/_oj-progress-circle.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-circle/themes/redwood/oj-progress-circle.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-circle/themes/stable/_oj-progress-circle-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-circle/themes/stable/_oj-progress-circle.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/progress-circle/themes/stable/oj-progress-circle.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radio-checkbox/themes/base/_oj-radiocheckbox.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radioset/themes/redwood/_oj-radioset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radioset/themes/redwood/oj-radioset.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radioset/themes/stable/_oj-radioset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/radioset/themes/stable/oj-radioset.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/rangeslider/themes/redwood/_oj-rangeslider.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/rangeslider/themes/redwood/oj-rangeslider.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/rangeslider/themes/stable/_oj-rangeslider.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/rangeslider/themes/stable/oj-rangeslider.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/rating-gauge/themes/base/_oj-rating-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/rating-gauge/themes/redwood/_oj-rating-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/rating-gauge/themes/redwood/oj-rating-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/rating-gauge/themes/stable/_oj-rating-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/rating-gauge/themes/stable/oj-rating-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/refresher/themes/base/_oj-refresher.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/refresher/themes/redwood/_oj-refresher.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/refresher/themes/redwood/_oj-refresher.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/refresher/themes/redwood/oj-refresher.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/refresher/themes/stable/_oj-refresher.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/refresher/themes/stable/_oj-refresher.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/refresher/themes/stable/oj-refresher.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/resizable/themes/base/_oj-resizable.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/resizable/themes/redwood/_oj-resizable.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/resizable/themes/stable/_oj-resizable.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/row-expander/themes/base/_oj-row-expander.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/row-expander/themes/redwood/_oj-row-expander.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/row-expander/themes/redwood/oj-row-expander.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/row-expander/themes/stable/_oj-row-expander.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/row-expander/themes/stable/oj-row-expander.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/scrollbar/themes/base/_oj-scrollbar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/scrollbar/themes/redwood/_oj-scrollbar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/scrollbar/themes/redwood/_oj-scrollbar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/scrollbar/themes/redwood/_oj-scrollbar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/scrollbar/themes/stable/_oj-scrollbar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/scrollbar/themes/stable/_oj-scrollbar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/scrollbar/themes/stable/_oj-scrollbar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select/themes/base/_oj-select.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select/themes/redwood/_oj-select.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select/themes/redwood/_oj-select.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select/themes/stable/_oj-select.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select/themes/stable/_oj-select.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-many/themes/redwood/oj-select-many.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-many/themes/stable/oj-select-many.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-one/themes/redwood/oj-select-one.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-original/themes/base/_oj-select-original.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-original/themes/redwood/_oj-select-original.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-original/themes/redwood/_oj-select-original.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-original/themes/stable/_oj-select-original.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-original/themes/stable/_oj-select-original.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-single/themes/base/_oj-select-single.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-single/themes/redwood/oj-select-single.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/select-single/themes/stable/oj-select-single.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/selector/themes/base/_oj-selector.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/selector/themes/redwood/_oj-selector.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/selector/themes/redwood/oj-selector.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/selector/themes/stable/_oj-selector.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/selector/themes/stable/oj-selector.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/slider/themes/base/_oj-slider.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/slider/themes/redwood/_oj-slider.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/slider/themes/redwood/oj-slider.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/slider/themes/stable/_oj-slider.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/slider/themes/stable/oj-slider.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/spark-chart/themes/base/_oj-spark-chart.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/spark-chart/themes/redwood/_oj-spark-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/spark-chart/themes/redwood/oj-spark-chart.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/spark-chart/themes/stable/_oj-spark-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/spark-chart/themes/stable/oj-spark-chart.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/status-meter-gauge/themes/base/_oj-status-meter-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/status-meter-gauge/themes/redwood/_oj-status-meter-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/status-meter-gauge/themes/redwood/oj-status-meter-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/status-meter-gauge/themes/stable/_oj-status-meter-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/status-meter-gauge/themes/stable/oj-status-meter-gauge.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/stream-list/themes/base/_oj-stream-list.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/stream-list/themes/redwood/_oj-stream-list.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/stream-list/themes/redwood/_oj-stream-list.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/stream-list/themes/redwood/oj-stream-list.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/stream-list/themes/stable/_oj-stream-list.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/stream-list/themes/stable/_oj-stream-list.servervars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/stream-list/themes/stable/oj-stream-list.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/sunburst/themes/base/_oj-sunburst.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/sunburst/themes/redwood/_oj-sunburst.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/sunburst/themes/redwood/oj-sunburst.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/sunburst/themes/stable/_oj-sunburst.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/sunburst/themes/stable/oj-sunburst.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/swipe-actions/themes/base/_oj-swipe-actions.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/swipe-actions/themes/redwood/_oj-swipe-actions.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/swipe-actions/themes/redwood/oj-swipe-actions.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/swipe-actions/themes/stable/_oj-swipe-actions.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/swipe-actions/themes/stable/oj-swipe-actions.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/switch/themes/base/_oj-switch.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/switch/themes/redwood/_oj-switch.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/switch/themes/redwood/oj-switch.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/switch/themes/stable/_oj-switch.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/switch/themes/stable/oj-switch.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/switcher/themes/base/_oj-switcher.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/switcher/themes/redwood/oj-switcher.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/switcher/themes/stable/oj-switcher.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tab-bar/themes/base/_oj-tab-bar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tab-bar/themes/redwood/_oj-tab-bar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tab-bar/themes/redwood/_oj-tab-bar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tab-bar/themes/redwood/oj-tab-bar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tab-bar/themes/stable/_oj-tab-bar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tab-bar/themes/stable/_oj-tab-bar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tab-bar/themes/stable/oj-tab-bar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/table/themes/base/_oj-table.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/table/themes/redwood/_oj-table-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/table/themes/redwood/_oj-table.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/table/themes/redwood/oj-table.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/table/themes/stable/_oj-table-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/table/themes/stable/_oj-table.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/table/themes/stable/oj-table.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tag-cloud/themes/base/_oj-tag-cloud.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tag-cloud/themes/redwood/_oj-tag-cloud.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tag-cloud/themes/redwood/oj-tag-cloud.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tag-cloud/themes/stable/_oj-tag-cloud.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tag-cloud/themes/stable/oj-tag-cloud.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/base/_oj-notags-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/base/_oj-notags.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/base/_oj-tags-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/base/_oj-tags.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/redwood/_oj-tags-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/redwood/_oj-tags.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/redwood/oj-notags.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/redwood/oj-tags.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/stable/_oj-tags-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/stable/_oj-tags.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/stable/oj-notags.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tags/themes/stable/oj-tags.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-area/themes/base/_oj-text-area.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-area/themes/redwood/_oj-text-area.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-area/themes/redwood/oj-text-area.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-area/themes/stable/_oj-text-area.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-area/themes/stable/oj-text-area.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-field/themes/base/_oj-text-field.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-field/themes/redwood/_oj-text-field-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-field/themes/redwood/_oj-text-field-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-field/themes/redwood/_oj-text-field.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-field/themes/stable/_oj-text-field-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/text-field/themes/stable/_oj-text-field.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/thematic-map/themes/base/_oj-thematic-map.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/thematic-map/themes/redwood/_oj-thematic-map.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/thematic-map/themes/redwood/oj-thematic-map.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/thematic-map/themes/stable/_oj-thematic-map.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/thematic-map/themes/stable/oj-thematic-map.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/time-axis/themes/base/_oj-time-axis.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/time-axis/themes/redwood/_oj-time-axis.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/time-axis/themes/redwood/oj-time-axis.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/time-axis/themes/stable/_oj-time-axis.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/time-axis/themes/stable/oj-time-axis.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/timeline/themes/base/_oj-timeline.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/timeline/themes/redwood/_oj-timeline-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/timeline/themes/redwood/_oj-timeline.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/timeline/themes/redwood/oj-timeline.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/timeline/themes/stable/_oj-timeline-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/timeline/themes/stable/_oj-timeline.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/timeline/themes/stable/oj-timeline.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/toolbar/themes/base/_oj-toolbar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/toolbar/themes/redwood/_oj-toolbar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/toolbar/themes/redwood/oj-toolbar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/toolbar/themes/stable/_oj-toolbar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/toolbar/themes/stable/oj-toolbar.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tooltip/themes/base/_oj-tooltip.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tooltip/themes/redwood/_oj-tooltip.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tooltip/themes/redwood/oj-tooltip.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tooltip/themes/stable/_oj-tooltip.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tooltip/themes/stable/oj-tooltip.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/train/themes/base/_oj-train.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/train/themes/redwood/_oj-train-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/train/themes/redwood/_oj-train.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/train/themes/redwood/oj-train.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/train/themes/stable/_oj-train.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/train/themes/stable/oj-train.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tree-view/themes/base/_oj-tree-view.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tree-view/themes/redwood/_oj-tree-view.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tree-view/themes/redwood/oj-tree-view.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tree-view/themes/stable/_oj-tree-view.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/tree-view/themes/stable/oj-tree-view.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/treemap/themes/base/_oj-treemap.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/treemap/themes/redwood/_oj-treemap.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/treemap/themes/redwood/oj-treemap.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/treemap/themes/stable/_oj-treemap.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/treemap/themes/stable/oj-treemap.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/typography/themes/base/_oj-typography.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/typography/themes/redwood/_oj-typography-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/typography/themes/redwood/_oj-typography-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/typography/themes/redwood/_oj-typography.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/typography/themes/redwood/oj-typography.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/typography/themes/stable/_oj-typography-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/typography/themes/stable/_oj-typography.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/typography/themes/stable/oj-typography.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/utilities/_oj.utilities.bidi.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/utilities/_oj.utilities.icons.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/utilities/_oj.utilities.json.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/utilities/_oj.utilities.masonrylayout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/utilities/_oj.utilities.modules.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/validation-group/themes/base/_oj-validation-group.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/validation-group/themes/redwood/oj-validation-group.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/validation-group/themes/stable/oj-validation-group.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/waterfall-layout/themes/base/_oj-waterfall-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/waterfall-layout/themes/redwood/_oj-waterfall-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/waterfall-layout/themes/redwood/oj-waterfall-layout.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/waterfall-layout/themes/stable/_oj-waterfall-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{14.1.2 → 14.1.3}/oj/waterfall-layout/themes/stable/oj-waterfall-layout.scss +0 -0
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
6
6
|
* @ignore
|
|
7
7
|
*/
|
|
8
|
-
define(["touchr","ojs/ojdatasource-common","ojs/ojdatacollection-utils","ojs/ojinputnumber","ojs/ojmenu","ojs/ojmenuselectmany","ojs/ojdialog","ojs/ojbutton","ojdnd","ojs/ojcore-base","@oracle/oraclejet-preact/hooks/UNSAFE_useFormVariantContext","ojs/ojcomponentcore","ojs/ojcontext","ojs/ojdatacollection-common","ojs/ojdomutils","ojs/ojconfig","ojs/ojcustomelement-utils","ojs/ojkeyboardfocus-utils","jquery","ojs/ojlogger","ojs/ojthemeutils"],function(e,t,i,s,n,o,r,l,a,h,d,c,m,u,_,p,g,f,C,y,v){"use strict";var E;h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h,m=m&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m,C=C&&Object.prototype.hasOwnProperty.call(C,"default")?C.default:C,(E={properties:{bandingInterval:{type:"object",properties:{column:{type:"number",value:0},row:{type:"number",value:0}}},cell:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},currentCell:{type:"object",writeback:!0},data:{type:"DataGridProvider",extension:{webelement:{exceptionStatus:[{type:"unsupported",since:"13.0.0",description:"Data sets from a DataProvider cannot be sent to WebDriverJS; use ViewModels or page variables instead."}]}}},dataTransferOptions:{type:"object",properties:{copy:{type:"string",enumValues:["disable","enable"],value:"disable"},cut:{type:"string",enumValues:["disable","enable"],value:"disable"},fill:{type:"string",enumValues:["disable","enable"],value:"disable"},paste:{type:"string",enumValues:["disable","enable"],value:"disable"}}},dnd:{type:"object",properties:{drag:{type:"object",properties:{columns:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},drag:{type:"function"},dragEnd:{type:"function"},dragStart:{type:"function"}}},rows:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},drag:{type:"function"},dragEnd:{type:"function"},dragStart:{type:"function"}}}}},drop:{type:"object",properties:{columns:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},dragEnter:{type:"function"},dragLeave:{type:"function"},dragOver:{type:"function"},drop:{type:"function"}}},rows:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},dragEnter:{type:"function"},dragLeave:{type:"function"},dragOver:{type:"function"},drop:{type:"function"}}}}},reorder:{type:"object",properties:{row:{type:"string",enumValues:["disable","enable"],value:"disable"}}}}},editMode:{type:"string",writeback:!0,enumValues:["cellEdit","cellNavigation","none"],value:"none"},gridlines:{type:"object",properties:{horizontal:{type:"string",enumValues:["hidden","visible"],value:"visible"},vertical:{type:"string",enumValues:["hidden","visible"],value:"visible"}}},header:{type:"object",properties:{column:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string",enumValues:["disable","enable"],value:"disable"},width:{type:"string|function",enumValues:["disable","enable"],value:"disable"}}},sortable:{type:"function|string",enumValues:["auto","disable","enable"],value:"auto"},style:{type:"function|string"}}},columnEnd:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string",enumValues:["disable","enable"],value:"disable"},width:{type:"string|function",enumValues:["disable","enable"],value:"disable"}}},style:{type:"function|string"}}},row:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string|function",enumValues:["disable","enable"],value:"disable"},width:{type:"string",enumValues:["disable","enable"],value:"disable"}}},sortable:{type:"function|string",enumValues:["auto","disable","enable"],value:"auto"},style:{type:"function|string"}}},rowEnd:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string|function",enumValues:["disable","enable"],value:"disable"},width:{type:"string",enumValues:["disable","enable"],value:"disable"}}},style:{type:"function|string"}}}}},scrollPolicy:{type:"string",enumValues:["auto","loadMoreOnScroll","scroll"],value:"auto"},scrollPolicyOptions:{type:"object",properties:{maxColumnCount:{type:"number",value:500},maxRowCount:{type:"number",value:500}}},scrollPosition:{type:"object",writeback:!0,value:{x:0,y:0},properties:{columnIndex:{type:"number"},columnKey:{type:"any"},offsetX:{type:"number"},offsetY:{type:"number"},rowIndex:{type:"number"},rowKey:{type:"any"},x:{type:"number"},y:{type:"number"}}},scrollToKey:{type:"string",enumValues:["always","auto","capability","never"],value:"auto"},selection:{type:"Array<Object>",writeback:!0,value:[]},selectionMode:{type:"object",properties:{cell:{type:"string",enumValues:["multiple","none","single"],value:"none"},row:{type:"string",enumValues:["multiple","none","single"],value:"none"}}},translations:{type:"object",value:{},properties:{accessibleActionableMode:{type:"string"},accessibleCollapsed:{type:"string"},accessibleColumnContext:{type:"string"},accessibleColumnEndHeaderContext:{type:"string"},accessibleColumnEndHeaderLabelContext:{type:"string"},accessibleColumnHeaderContext:{type:"string"},accessibleColumnHeaderLabelContext:{type:"string"},accessibleColumnHierarchicalFull:{type:"string"},accessibleColumnHierarchicalPartial:{type:"string"},accessibleColumnHierarchicalUnknown:{type:"string"},accessibleColumnSelected:{type:"string"},accessibleColumnSpanContext:{type:"string"},accessibleContainsControls:{type:"string"},accessibleExpanded:{type:"string"},accessibleFirstColumn:{type:"string"},accessibleFirstRow:{type:"string"},accessibleLastColumn:{type:"string"},accessibleLastRow:{type:"string"},accessibleLevelContext:{type:"string"},accessibleLevelHierarchicalContext:{type:"string"},accessibleMultiCellSelected:{type:"string"},accessibleNavigationMode:{type:"string"},accessibleRangeSelectModeOff:{type:"string"},accessibleRangeSelectModeOn:{type:"string"},accessibleRowCollapsed:{type:"string"},accessibleRowContext:{type:"string"},accessibleRowEndHeaderContext:{type:"string"},accessibleRowEndHeaderLabelContext:{type:"string"},accessibleRowExpanded:{type:"string"},accessibleRowHeaderContext:{type:"string"},accessibleRowHeaderLabelContext:{type:"string"},accessibleRowHierarchicalFull:{type:"string"},accessibleRowHierarchicalPartial:{type:"string"},accessibleRowHierarchicalUnknown:{type:"string"},accessibleRowSelected:{type:"string"},accessibleRowSpanContext:{type:"string"},accessibleSelectionAffordanceBottom:{type:"string"},accessibleSelectionAffordanceTop:{type:"string"},accessibleSortAscending:{type:"string"},accessibleSortDescending:{type:"string"},accessibleSortable:{type:"string"},accessibleStateSelected:{type:"string"},accessibleSummaryEstimate:{type:"string"},accessibleSummaryExact:{type:"string"},accessibleSummaryExpanded:{type:"string"},collapsedText:{type:"string"},columnWidth:{type:"string"},expandedText:{type:"string"},labelCopyCells:{type:"string"},labelCut:{type:"string"},labelCutCells:{type:"string"},labelDisableNonContiguous:{type:"string"},labelEnableNonContiguous:{type:"string"},labelFillCells:{type:"string"},labelPaste:{type:"string"},labelPasteCells:{type:"string"},labelResize:{type:"string"},labelResizeColumn:{type:"string"},labelResizeDialogApply:{type:"string"},labelResizeDialogCancel:{type:"string"},labelResizeDialogSubmit:{type:"string"},labelResizeFitToContent:{type:"string"},labelResizeHeight:{type:"string"},labelResizeRow:{type:"string"},labelResizeWidth:{type:"string"},labelSelectMultiple:{type:"string"},labelSortAsc:{type:"string"},labelSortCol:{type:"string"},labelSortColAsc:{type:"string"},labelSortColDsc:{type:"string"},labelSortDsc:{type:"string"},labelSortRow:{type:"string"},labelSortRowAsc:{type:"string"},labelSortRowDsc:{type:"string"},msgFetchingData:{type:"string"},msgNoData:{type:"string"},resizeColumnDialog:{type:"string"},resizeRowDialog:{type:"string"},rowHeight:{type:"string"},tooltipRequired:{type:"string"}}}},methods:{getContextByNode:{},getProperty:{},refresh:{},setProperties:{},setProperty:{},getNodeBySubId:{},getSubIdByNode:{}},events:{ojBeforeCurrentCell:{},ojBeforeEdit:{},ojBeforeEditEnd:{},ojCollapseRequest:{},ojCopyRequest:{},ojCutRequest:{},ojExpandRequest:{},ojFillRequest:{},ojPasteRequest:{},ojResize:{},ojScroll:{},ojSort:{},ojSortRequest:{}},extension:{}}).extension._WIDGET_NAME="ojDataGrid",E.extension._BINDING={provide:[{name:"__oj_private_contexts",default:new Map([[d.FormVariantContext,"embedded"]])}]},h.CustomElementBridge.register("oj-data-grid",{metadata:E});const w=function(e,t,i,s){this.rtlMode=e,this.translationFunction=t,this.defaultOptions=i,this.widgetName=s,this.styles={},this.styles.datagrid="oj-datagrid",this.styles.cell="oj-datagrid-cell",this.styles.banded="oj-datagrid-banded",this.styles.row="oj-datagrid-row",this.styles.databody="oj-datagrid-databody",this.styles.topcorner="oj-datagrid-top-corner",this.styles.bottomcorner="oj-datagrid-bottom-corner",this.styles.rowheaderspacer="oj-datagrid-row-header-spacer",this.styles.colheaderspacer="oj-datagrid-column-header-spacer",this.styles.status="oj-datagrid-status",this.styles.loadingicon="oj-icon oj-datagrid-loading-icon",this.styles.emptytext="oj-datagrid-empty-text",this.styles.header="oj-datagrid-header",this.styles.endheader="oj-datagrid-end-header",this.styles.groupingcontainer="oj-datagrid-header-grouping",this.styles.headercell="oj-datagrid-header-cell",this.styles.rowheader="oj-datagrid-row-header",this.styles.colheader="oj-datagrid-column-header",this.styles.colheadercell="oj-datagrid-column-header-cell",this.styles.rowheadercell="oj-datagrid-row-header-cell",this.styles.endheadercell="oj-datagrid-end-header-cell",this.styles.rowendheader="oj-datagrid-row-end-header",this.styles.colendheader="oj-datagrid-column-end-header",this.styles.colendheadercell="oj-datagrid-column-end-header-cell",this.styles.rowendheadercell="oj-datagrid-row-end-header-cell",this.styles.headerlabel="oj-datagrid-header-label",this.styles.rowheaderlabel="oj-datagrid-row-header-label",this.styles.columnheaderlabel="oj-datagrid-column-header-label",this.styles.rowendheaderlabel="oj-datagrid-row-end-header-label",this.styles.columnendheaderlabel="oj-datagrid-column-end-header-label",this.styles["scroller-mobile"]="oj-datagrid-scroller-touch",this.styles.scroller="oj-datagrid-scroller",this.styles.scrollers="oj-datagrid-scrollers",this.styles.scrollbarForce="oj-scrollbar-force",this.styles.focus="oj-focus",this.styles.hover="oj-hover",this.styles.active="oj-active",this.styles.selected="oj-selected",this.styles.topSelected="oj-datagrid-selected-top",this.styles.bottomSelected="oj-datagrid-selected-bottom",this.styles.startSelected="oj-datagrid-selected-start",this.styles.endSelected="oj-datagrid-selected-end",this.styles.topEdit="oj-datagrid-cell-edit-top",this.styles.bottomEdit="oj-datagrid-cell-edit-bottom",this.styles.startEdit="oj-datagrid-cell-edit-start",this.styles.endEdit="oj-datagrid-cell-edit-end",this.styles.topFloodfill="oj-datagrid-floodfill-top",this.styles.bottomFloodfill="oj-datagrid-floodfill-bottom",this.styles.startFloodfill="oj-datagrid-floodfill-start",this.styles.endFloodfill="oj-datagrid-floodfill-end",this.styles.topResized="oj-datagrid-resized-top",this.styles.bottomResized="oj-datagrid-resized-bottom",this.styles.endResized="oj-datagrid-resized-end",this.styles.startResized="oj-datagrid-resized-start",this.styles.disabled="oj-disabled",this.styles.enabled="oj-enabled",this.styles.default="oj-default",this.styles.sortIcon="oj-datagrid-sort-icon",this.styles.sortascending="oj-datagrid-sort-ascending-icon",this.styles.sortdescending="oj-datagrid-sort-descending-icon",this.styles.sortdefault="oj-datagrid-sort-default-icon",this.styles.icon="oj-component-icon",this.styles.clickableicon="oj-clickable-icon-nocontext",this.styles.info="oj-helper-hidden-accessible",this.styles.rowexpander="oj-rowexpander",this.styles.cut="oj-datagrid-cut",this.styles.selectaffordance="oj-datagrid-touch-selection-affordance",this.styles.selectaffordancetopcornerbounded="oj-datagrid-touch-selection-affordance-top-corner-bounded",this.styles.selectaffordancebottomcornerbounded="oj-datagrid-touch-selection-affordance-bottom-corner-bounded",this.styles.selectaffordancetoprow="oj-datagrid-touch-selection-affordance-top-row",this.styles.selectaffordancebottomrow="oj-datagrid-touch-selection-affordance-bottom-row",this.styles.selectaffordancetopcolumn="oj-datagrid-touch-selection-affordance-top-column",this.styles.selectaffordancebottomcolumn="oj-datagrid-touch-selection-affordance-bottom-column",this.styles.floodfillaffordance="oj-datagrid-floodfill-affordance",this.styles.toucharea="oj-datagrid-touch-area",this.styles.readOnly="oj-read-only",this.styles.editable="oj-datagrid-editable",this.styles.cellEdit="oj-datagrid-cell-edit",this.styles.draggable="oj-draggable",this.styles.drag="oj-drag",this.styles.drop="oj-drop",this.styles.activedrop="oj-active-drop",this.styles.validdrop="oj-valid-drop",this.styles.invaliddrop="oj-invalid-drop",this.styles.formcontrol="oj-form-control-inherit",this.styles.borderHorizontalNone="oj-datagrid-border-horizontal-none",this.styles.borderVerticalNone="oj-datagrid-border-vertical-none",this.styles.borderHorizontalSmall="oj-datagrid-small-content-border-horizontal",this.styles.borderVerticalSmall="oj-datagrid-small-content-border-vertical",this.styles.offsetOutline="oj-datagrid-focus-offset",this.styles.depth="oj-datagrid-depth-",this.styles.popupHeader="oj-datagrid-popup-header",this.styles.popupContent="oj-datagrid-popup-content",this.styles.popupFooter="oj-datagrid-popup-footer",this.styles.dialogTitle="oj-dialog-title",this.styles.resizeDialog="oj-datagrid-resize-dialog",this.styles.headerAllSelected="oj-selected",this.styles.headerPartialSelected="oj-partial-selected",this.styles.disclosureContainer="oj-datagrid-disclosure-icon-container",this.styles.disclosureIcon="oj-datagrid-disclosure-icon",this.styles.expanded="oj-datagrid-expanded-icon",this.styles.collapsed="oj-datagrid-collapsed-icon",this.styles.spacer="oj-datagrid-tree-spacer",this.styles.hierarchicalTree="oj-datagrid-hierarchical-tree",this.styles.hierarchicalGroup="oj-datagrid-hierarchical-group",this.styles.iconContainer="oj-datagrid-icon-container",this.styles.requiredIcon="oj-datagrid-required-icon",this.styles.noDataContainer="oj-datagrid-no-data-container",this.styles.draggableItem="oj-datagrid-draggable",this.styles.dragSourceOpaque="drag-source-opaque",this.styles.rowDropTargetLine="oj-datagrid-row-drop-target-line",this.styles.colDropTargetLine="oj-datagrid-col-drop-target-line",this.styles.dragging="oj-datagrid-drag-active",this.styles.dropTarget="oj-datagrid-drop-target",this.styles.disabledElement="oj-datagrid-disabled-element",this.commands={},this.commands.sortCol="oj-datagrid-sortCol",this.commands.sortColAsc="oj-datagrid-sortColAsc",this.commands.sortColDsc="oj-datagrid-sortColDsc",this.commands.sortRow="oj-datagrid-sortRow",this.commands.sortRowAsc="oj-datagrid-sortRowAsc",this.commands.sortRowDsc="oj-datagrid-sortRowDsc",this.commands.resize="oj-datagrid-resize",this.commands.resizeWidth="oj-datagrid-resizeWidth",this.commands.resizeHeight="oj-datagrid-resizeHeight",this.commands.resizeFitToContent="oj-datagrid-resizeFitToContent",this.commands.cut="oj-datagrid-cut",this.commands.paste="oj-datagrid-paste",this.commands.cutCells="oj-datagrid-cutCells",this.commands.copyCells="oj-datagrid-copyCells",this.commands.pasteCells="oj-datagrid-pasteCells",this.commands.autoFill="oj-datagrid-fillCells",this.commands.discontiguousSelection="oj-datagrid-discontiguousSelection",this.attributes={},this.attributes.busyContext=m._OJ_CONTEXT_ATTRIBUTE,this.attributes.context="data-oj-cellContext",this.attributes.resizable="data-oj-resizable",this.attributes.sortable="data-oj-sortable",this.attributes.sortDir="data-oj-sortdir",this.attributes.expander="data-oj-expander",this.attributes.expanderIndex="data-oj-expander-index",this.attributes.container=c._OJ_CONTAINER_ATTR,this.attributes.extent="data-oj-extent",this.attributes.start="data-oj-start",this.attributes.depth="data-oj-depth",this.attributes.level="data-oj-level",this.attributes.metadata="data-oj-metaData"};h._registerLegacyNamespaceProp("DataGridResources",w),w.prototype.setRTLMode=function(e){this.rtlMode=e},w.prototype.isRTLMode=function(){return"rtl"===this.rtlMode},w.prototype.getTranslatedText=function(e,t){return this.translationFunction(e,t)},w.prototype.getDefaultOption=function(e){return this.defaultOptions[e]},w.prototype.getMappedStyle=function(e){return null!=e?this.styles[e]:null},w.prototype.getMappedCommand=function(e){return null!=e?this.commands[e]:null},w.prototype.getMappedAttribute=function(e){return null!=e?this.attributes[e]:null};const S=function(e){this.dataprovider=e,this.pendingHeaderCallback={},e.options&&e.options.implicitSort&&(this.currentSortCriteria=e.options.implicitSort),this.sortUpdated=!1;var t=this.dataprovider.getCapability("fetchByOffset");this.fetchByOffset=null!=t&&"randomAccess"===t.implementation,this._registerEventListeners(),S.superclass.constructor.call(this)};function H(e,t,i,s){this.indexes=e,this.data=i,this.metadata=t,this.columns=s}function x(e,t,i){this.response=e,this.results=e.results,this.cellRanges=t,this.columns=i,this._setBounds(e,t,i)}function b(e,t,i,s){this.start=e,this.end=t,this.headers=i,this.sortCriteria=s}h.Object.createSubclass(S,h.DataGridDataSource,"DataProviderDataGridDataSource"),S.prototype._registerEventListeners=function(){this._mutationListener=this._handlDataProviderMutationEvent.bind(this),this._refreshListener=this._handlDataProviderRefreshEvent.bind(this),this.dataprovider.addEventListener("mutate",this._mutationListener),this.dataprovider.addEventListener("refresh",this._refreshListener)},S.prototype._handlDataProviderMutationEvent=function(e){var t,i=e.detail.add;if(null!=i){var s={indexes:[],keys:[]},n=[],o=[],r=[];for(t=0;t<i.data.length;t++)s.source=this,s.operation="insert",s.keys.push({row:i.metadata[t].key,column:null}),s.indexes.push({row:i.indexes[t],column:-1}),r.push(i.indexes[t]),n.push(i.data[t]),o.push(i.metadata[t]),t!==i.data.length-1&&i.indexes[t+1]===i.indexes[t]+1||(s.result=new H(r,o,n,this.columns),this.handleEvent("change",s),(s={}).indexes=[],s.keys=[],n=[],o=[],r=[])}var l=e.detail.remove;if(null!=l){var a={source:this,operation:"delete",keys:[],indexes:[]};for(t=0;t<l.data.length;t++)a.keys.push({row:l.metadata[t].key,column:null}),a.indexes.push({row:l.indexes[t],column:-1});this.handleEvent("change",a)}var h=e.detail.update;if(null!=h)for(t=0;t<h.data.length;t++){var d={source:this,operation:"update",keys:{row:h.metadata[t].key,column:null},indexes:{row:h.indexes[t],column:-1}};d.result=new H([h.indexes[t]],[h.metadata[t]],[h.data[t]],this.columns),this.handleEvent("change",d)}},H.prototype.getData=function(e){var t=this,i={};return Object.defineProperty(i,"data",{enumerable:!0,get:function(){return t.data[e.row-t.getStart("row")][t.columns[e.column]]},set:function(i){t.data[e.row-t.getStart("row")][t.columns[e.column]]=i}}),i},H.prototype.getMetadata=function(e){var t=this.metadata[e.row-this.getStart("row")];return t.keys={row:t.key,column:this.columns[e.column]},t},H.prototype.getStart=function(e){return"row"===e?this.indexes[0]:0},H.prototype.getCount=function(e){return"row"===e?this.data.length:"column"===e?this.columns.length:0},H.prototype.getExtent=function(){return{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}},S.prototype._handlDataProviderRefreshEvent=function(){this._asyncIterator=null,this.handleEvent("change",{operation:"refresh"})},S.prototype.fetchHeaders=function(e,t,i){if(null!=t){var s=e.axis,n={headerRange:e,callbacks:t,callbackObjects:i};this.pendingHeaderCallback[s]=n}},S.prototype._processPendingHeaderCallbacks=function(e){var t=this.pendingHeaderCallback[e];if(null!=t){var i=t.headerRange,s=t.callbacks,n=t.callbackObjects;this._handleHeaderFetchSuccess(i,s,n),this.pendingHeaderCallback[e]=null}},S.prototype._handleHeaderFetchSuccess=function(e,t,i){var s,n=e.axis,o=e.start,r=e.count;"column"===n&&null!=this.columns?s=new b(o,Math.min(this.columns.length,o+r),this.columns,this.currentSortCriteria):s=null;null!=t&&t.success&&t.success.call(i.success,s,e,null)},x.prototype._setBounds=function(e,t,i){for(var s=0;s<t.length;s+=1){var n=t[s];"row"===n.axis?(this.rowStart=e.fetchParameters.offset?e.fetchParameters.offset:n.start,this.rowEnd=this.rowStart+e.results.length-1):"column"===n.axis&&(this.colStart=n.start,this.colEnd=Math.min(this.colStart+n.count-1,this.colStart+i.length-1))}},x.prototype.getData=function(e){var t=this,i={};return Object.defineProperty(i,"data",{enumerable:!0,get:function(){return t.results[e.row-t.rowStart].data[t.columns[e.column]]},set:function(i){t.results[e.row-t.rowStart].data[t.columns[e.column]]=i}}),i},x.prototype.getMetadata=function(e){var t=this.results[e.row-this.rowStart].metadata;return t.keys={row:this.results[e.row-this.rowStart].metadata.key,column:this.columns[e.column]},t},x.prototype.getCount=function(e){return"row"===e?this.rowEnd-this.rowStart+1:"column"===e?this.colEnd-this.colStart+1:0},x.prototype.getExtent=function(){return{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}},S.prototype.setUpColumns=function(e){if(null==this.columns||0===this.columns.length){var t=[];if(e.results.length)for(var i=Object.keys(e.results[0].data),s=0;s<i.length;s++)t.push(i[s]);this.columns=t}},S.prototype.getRangeInfo=function(e){for(var t={},i=0;i<e.length;i+=1){var s=e[i];"row"===s.axis?(t.rowStart=s.start,t.rowEnd=t.rowStart+s.count-1):"column"===s.axis&&(t.colStart=s.start,t.colEnd=t.colStart+s.count-1)}return t},S.prototype._createResults=function(e){e.results=[];for(var t=0;t<e.value.data.length;t++){var i={data:e.value.data[t],metadata:e.value.metadata[t]};e.results.push(i)}},S.prototype.handleFetchResult=function(e,t,i,s){var n=s[0];n.results||(this._createResults(n),n.fetchParameters=n.value.fetchParameters),this.setUpColumns(n),this._processPendingHeaderCallbacks("column"),this._processPendingHeaderCallbacks("row");var o=new x(n,e,this.columns);if(null!=t&&null!=t.success){var r=i?i.success:null;t.success.call(r,o,e)}},S.prototype.fetchCells=function(e,t,i){this.getCount("row");var s=this.getRangeInfo(e),n=s.rowEnd-s.rowStart+1;if(this.fetchByOffset){var o=s.rowStart;this._fetchPromise=this.dataprovider.fetchByOffset({size:n,offset:o,sortCriteria:this.currentSortCriteria})}else(null==this._asyncIterator||this.sortUpdated)&&(this._clientId=this._clientId||Symbol(),this._asyncIterator=this.dataprovider.fetchFirst({clientId:this._clientId,size:n,sortCriteria:this.currentSortCriteria})[Symbol.asyncIterator]()),this._fetchPromise=this._asyncIterator.next();this.sortUpdated=!1,Promise.all([this._fetchPromise,this._getCountPromise]).then(this.handleFetchResult.bind(this,e,t,i))},S.prototype.getCapability=function(e){if("sort"===e){var t=this.dataprovider.getCapability(e).attributes;return"multiple"===t||"single"===t?"column":t}return"none"},S.prototype.getCount=function(e){var t=this;if("row"===e){if(void 0!==t.totalRowCount)return t.totalRowCount;t._getCountPromise=this.dataprovider.getTotalSize(),t._getCountPromise.then(function(e){t.totalRowCount=e})}else if("column"===e&&null!=this.columns)return this.columns.length;return-1},S.prototype.getCountPrecision=function(){return"estimate"},S.prototype.indexes=function(){return{row:-1,column:-1}},S.prototype.keys=function(){return{row:null,column:null}},S.prototype.move=function(){return!1},S.prototype.moveOK=function(){return"invalid"},S.prototype.sort=function(e,t,i){this.sortUpdated=!0,this.currentSortCriteria=[{attribute:e.key,direction:e.direction}],null==i&&(i={}),null!=t&&null!=t.success&&t.success.call(i.success)},b.prototype.getData=function(e){return this.headers[e]},b.prototype.getMetadata=function(e){var t=this.getData(e),i={key:t};if(null!=this.sortCriteria)for(var s=0;s<this.sortCriteria.length;s++)this.sortCriteria[s].attribute===t&&(i.sortDirection=this.sortCriteria[s].direction);return i},b.prototype.getLevelCount=function(){return 1},b.prototype.getExtent=function(){return{extent:1,more:{before:!1,after:!1}}},b.prototype.getLabel=function(){return null},b.prototype.getDepth=function(){return 1},b.prototype.getCount=function(){return Math.max(0,this.end-this.start)};const R=function(e){this.grid=e};R.prototype.getAction=function(e,t){var i=e.keyCode,s=this.grid.m_utils.ctrlEquivalent(e),n=e.shiftKey,o=e.altKey,r=this.grid.keyCodes,l=t.cellOrHeader,a=t.readOnly,h=t.currentMode,d=t.activeMove,c=t.activeDrag,m=t.rowMove,u=t.columnSort;let _=t.rowSort;var p=t.selection,g=t.selectionMode,f=t.multipleSelection,C=t.expandCollapse,y=t.copyCells,v=t.cutCells,E=t.pasteCells,w=t.fill;switch(i){case r.TAB_KEY:if("actionable"===h)return n?"TAB_PREV_IN_CELL":"TAB_NEXT_IN_CELL";if(!a)return n?"FOCUS_LEFT":"FOCUS_RIGHT";break;case r.ENTER_KEY:if("actionable"===h)return"NO_OP";if("column"===l&&u||"row"===l&&_)return"SORT";if(!o&&a&&"navigation"===h||"cell"!==l)return"ACTIONABLE";if(!a&&!o)return n?"FOCUS_UP":"FOCUS_DOWN";if(o&&a&&"navigation"===h)return"EDITABLE";if(!a&&("navigation"===h||"edit"===h))return"EDIT";break;case r.ESC_KEY:if("actionable"===h)return"EXIT_ACTIONABLE";if(d)return"CANCEL_REORDER";if(c)return"CANCEL_DRAG";if(a){if(this.grid.m_discontiguousSelection)return"SELECT_DISCONTIGUOUS"}else{if("navigation"===h)return"EXIT_EDITABLE";if("edit"===h)return"CANCEL_EDIT"}break;case r.SPACE_KEY:if(-1!==l.indexOf("row")&&p&&("cell"===g&&f||"row"===g)&&"navigation"===h)return"SELECT_ROW";if(-1!==l.indexOf("column")&&p&&"cell"===g&&f&&"navigation"===h)return"SELECT_COLUMN";if("cell"===l)if(a&&"navigation"===h){if(s&&p&&"cell"===g&&f)return"SELECT_COLUMN";if(n&&p&&("cell"===g&&f||"row"===g))return"SELECT_ROW"}else if("navigation"===h)return"DATA_ENTRY";break;case r.PAGEUP_KEY:if("navigation"===h)return"FOCUS_ROW_FIRST";break;case r.PAGEDOWN_KEY:if("navigation"===h)return"FOCUS_ROW_LAST";break;case r.END_KEY:if("navigation"===h)return s&&"cell"===l?"FOCUS_LAST_CELL_IN_GRID":"FOCUS_COLUMN_LAST";break;case r.HOME_KEY:if("navigation"===h)return s&&"cell"===l?"FOCUS_FIRST_CELL_IN_GRID":"FOCUS_COLUMN_FIRST";break;case r.LEFT_KEY:if(s&&C&&this.grid._isHeaderExpanded(e.target))return"COLLAPSE";if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&"cell"===g&&f?"SELECT_EXTEND_LEFT":s?"FOCUS_LEFT_NON_EMPTY_CELL":"FOCUS_LEFT";break;case r.UP_KEY:if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&f?"SELECT_EXTEND_UP":s?"FOCUS_UP_NON_EMPTY_CELL":"FOCUS_UP";break;case r.RIGHT_KEY:if(s&&C&&this.grid._isHeaderCollapsed(e.target))return"EXPAND";if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&"cell"===g&&f?"SELECT_EXTEND_RIGHT":s?"FOCUS_RIGHT_NON_EMPTY_CELL":"FOCUS_RIGHT";break;case r.DOWN_KEY:if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&f?"SELECT_EXTEND_DOWN":s?"FOCUS_DOWN_NON_EMPTY_CELL":"FOCUS_DOWN";break;case r.F2_KEY:if("actionable"===h)return"EXIT_ACTIONABLE";if("cell"!==l)return"ACTIONABLE";if(a&&"navigation"===h)return"EDITABLE";if(!a&&"navigation"===h)return"EDIT";if(!a&&"edit"===h)return"CANCEL_EDIT";break;case r.F8_KEY:if(n&&p&&f)return"SELECT_DISCONTIGUOUS";break;case r.F10_KEY:if(n)return"NO_OP";break;case r.V_KEY:if("navigation"===h&&s){if(m)return"PASTE";if(E)return"PASTE_CELLS"}if(!a&&"navigation"===h&&"cell"===l)return"DATA_ENTRY";break;case r.X_KEY:if("navigation"===h&&s){if(m)return"CUT";if(v)return"CUT_CELLS"}if(!a&&"navigation"===h&&"cell"===l)return"DATA_ENTRY";break;case r.C_KEY:if("navigation"===h&&s&&y)return"COPY_CELLS";if(!a&&"navigation"===h&&"cell"===l)return"DATA_ENTRY";break;case r.D_KEY:case r.R_KEY:if("navigation"===h&&s&&w)return"FILL";if(!a&&"navigation"===h&&"cell"===l&&!s)return"DATA_ENTRY";break;case r.SHIFT_KEY:case r.CTRL_KEY:case r.ALT_KEY:break;case r.A_KEY:if(s&&p&&f&&"navigation"===h)return"SELECT_ALL";case r.NUM5_KEY:if(s&&o&&"navigation"===h)return"READ_CELL";default:if((i<r.F1_KEY||i>r.F15_KEY)&&!a&&"navigation"===h&&"cell"===l&&!s)return"DATA_ENTRY"}return"NO_OP"},R.prototype.getNoDataAction=function(e,t){var i=e.keyCode,s=e.shiftKey,n=this.grid.keyCodes,o=t.currentMode;switch(i){case n.TAB_KEY:if("actionable"===o)return s?"TAB_PREV_IN_CELL":"TAB_NEXT_IN_CELL";break;case n.ESC_KEY:if("actionable"===o)return"EXIT_ACTIONABLE";break;case n.F2_KEY:return"actionable"===o?"EXIT_ACTIONABLE":"ACTIONABLE";case n.UP_KEY:if("navigation"===o)return"FOCUS_COLUMN_HEADER";break;case n.DOWN_KEY:if("navigation"===o)return"FOCUS_COLUMN_END_HEADER";break;case n.LEFT_KEY:if("navigation"===o)return"FOCUS_ROW_HEADER";break;case n.RIGHT_KEY:if("navigation"===o)return"FOCUS_ROW_END_HEADER"}return"NO_OP"};const I=function(e,t){this.options=e,this.rendererWrapperFunction=t};I.prototype.extract=function(e,t,i,s){if(null!=e){var n=this.options[e];if(null!=t&&null!=n){var o=n[t];if(null!=i&&null!=o){var r=o[i];return null!=s&&null!=r?r[s]:r}return o}return n}return null},I.prototype.evaluate=function(e,t){return"function"==typeof e?e.call(this,t):e},I.prototype.getRawProperty=function(e,t,i){var s,n,o,r;return"row"===t||"column"===t||"rowEnd"===t||"columnEnd"===t?(s="header",n=t,i?(o="label",r=e):o=e):"cell"===t&&(s="cell",n=e),this.extract(s,n,o,r)},I.prototype.getProperty=function(e,t,i,s){return void 0===i?this.extract(e,t,s):this.evaluate(this.getRawProperty(e,t,s),i)},I.prototype.getRowBandingInterval=function(){var e=this.getProperty("bandingInterval","row");return null!=e?e:0},I.prototype.getColumnBandingInterval=function(){var e=this.getProperty("bandingInterval","column");return null!=e?e:0},I.prototype.getEmptyText=function(){return this.getProperty("emptyText")},I.prototype.getHorizontalGridlines=function(){var e=this.extract("gridlines","horizontal");return null!=e?e:"visible"},I.prototype.getVerticalGridlines=function(){var e=this.extract("gridlines","vertical");return null!=e?e:"visible"},I.prototype.getScrollToKey=function(){var e=this.getProperty("scrollToKey");return null!=e?e:"auto"},I.prototype.getScrollPosition=function(){var e=this.getProperty("scrollPosition");return null!=e?e:null},I.prototype.getSelectionCardinality=function(){var e=this.getProperty("selectionMode");if(null==e)return"none";var t=e[this.getSelectionMode()];return null!=t?t:"none"},I.prototype.getSelectionMode=function(){var e=this.getProperty("selectionMode");if(null==e)return"cell";var t=e.row;return null!=t&&"none"!==t?"row":"cell"},I.prototype.getSelection=function(){return this.getProperty("selection")},I.prototype.getCurrentCell=function(){return this.getProperty("currentCell")},I.prototype.getEditMode=function(){return this.getProperty("editMode")},I.prototype.isSortable=function(e,t){return this.getProperty("sortable",e,t)},I.prototype.isResizable=function(e,t,i){var s=this.extract("header",e,"resizable",t);return null!=i?this.evaluate(s,i):s},I.prototype.isMoveable=function(e){return this.extract("dnd","reorder",e)},I.prototype._isDragEnabled=function(e){let t=!1,i="row"===e||"rowEnd"===e?"rows":"columns",s=this.getProperty("dnd").drag;return s&&s[i]&&(t=!0),t},I.prototype._getDraggable=function(){return this.getProperty("dnd").drag},I.prototype.isFloodFillEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","fill")&&(e=!0),e},I.prototype.isCopyEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","copy")&&(e=!0),e},I.prototype.isCutEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","cut")&&(e=!0),e},I.prototype.isPasteEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","paste")&&(e=!0),e},I.prototype.getInlineStyle=function(e,t,i){return this.getProperty("style",e,t,i)},I.prototype.getStyleClass=function(e,t,i){return this.getProperty("className",e,t,i)},I.prototype.getRenderer=function(e,t){return this.rendererWrapperFunction?this.rendererWrapperFunction(this.getRawProperty("renderer",e,t)):this.getRawProperty("renderer",e,t)},I.prototype.getScrollPolicy=function(){var e=this.getProperty("scrollPolicy");return null==e&&(e="auto"),e},I.prototype.getScrollPolicyOptions=function(){return this.getProperty("scrollPolicyOptions")};const M=function(){this.sizes={column:new Map,row:new Map}};M.prototype.setSize=function(e,t,i){this.sizes[e].set(t,i)},M.prototype.getSize=function(e,t){var i=this.sizes[e].get(t);return null!=i||this.sizes[e].forEach(function(e,s){null==i&&h.Object.compareValues(s,t)&&(i=e)}),i},M.prototype.clear=function(){this.sizes.column.clear(),this.sizes.row.clear()};const L=function(e){this.scrollbarSize=-1,this.dataGrid=e};L.prototype._getMaxDivHeightForScrolling=function(){return null==this.m_maxDivHeightForScrolling&&this._setMaxValuesForScrolling(),this.m_maxDivHeightForScrolling},L.prototype._getMaxDivWidthForScrolling=function(){return null==this.m_maxDivWidthForScrolling&&this._setMaxValuesForScrolling(),this.m_maxDivWidthForScrolling},L.prototype._setMaxValuesForScrolling=function(){this._calculateBrowserDefinedValues()},L.prototype._calculateBrowserDefinedValues=function(){var e=document.createElement("div");e.style.width="1000000000px",e.style.height="1000000000px",e.style.display="none";var t=document.createElement("div");t.style.width="100px",t.style.height="100px",t.style.overflow="scroll",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);let i=!1;u.isIE()||u.isEdge()?(this.m_maxDivHeightForScrolling=1e6,this.m_maxDivWidthForScrolling=1e6):(i=!0,document.body.appendChild(e),this.m_maxDivHeightForScrolling=parseInt(parseFloat(window.getComputedStyle(e).height)/2,10),this.m_maxDivWidthForScrolling=parseInt(parseFloat(window.getComputedStyle(e).width)/2,10)),this.scrollbarSize=t.offsetWidth-t.clientWidth,i&&document.body.removeChild(e),document.body.removeChild(t)},L.prototype.getScrollbarSize=function(){return-1===this.scrollbarSize&&this._calculateBrowserDefinedValues(),this.scrollbarSize},L.prototype.getScrollbarSize=function(){return-1===this.scrollbarSize&&this.calculateScrollbarSize(),this.scrollbarSize},L.prototype.isTouchDevice=function(){return null==this.isTouch&&(this.isTouch=u.isMobileTouchDevice()),this.isTouch},L.prototype.isTouchDeviceNotIOS=function(){if(null==this.isTouchNotIOS){let e=this.isTouchDevice();this.isTouchNotIOS=!!e&&!u.isIos()}return this.isTouchNotIOS},L.prototype.addCSSClassName=function(e,t){null!=t&&""!==t&&null!=e&&null!=e.classList&&e.classList.add(t)},L.prototype.removeCSSClassName=function(e,t){null!=t&&""!==t&&null!=e&&null!=e.classList&&e.classList.remove(t)},L.prototype.containsCSSClassName=function(e,t){var i=!1;return null!=t&&null!=e&&null!=e.classList&&(i=e.classList.contains(t)),i},L._getCSSClassNameIndex=function(e,t){if(!e||!e.indexOf)return-1;if(t===e)return 0;var i=t.length,s=e.length,n=e.indexOf(t);if(n>=0){var o=0===n||" "===e.charAt(n-1),r=n+i,l=r===s||" "===e.charAt(r);if(o&&l)return n;var a=e.lastIndexOf(t);if(a!==n)return o=e.charAt(a-1),l=(r=a+i)===s||" "===e.charAt(r),o&&l?a:e.indexOf(" "+t+" ")}return-1},L.prototype.ctrlEquivalent=function(e){return u.isMac()?e.metaKey:e.ctrlKey},L.prototype.getElementScrollLeft=function(e){return Math.abs(e.scrollLeft)},L.prototype.setElementScrollLeft=function(e,t){_.setScrollLeft(e,t)},L.prototype.getMousewheelEvent=function(){return"wheel"},L.prototype.getMousewheelScrollDelta=function(e){var t=-1,i=e.deltaMode;return i===e.DOM_DELTA_PIXEL?t=-1:i!==e.DOM_DELTA_LINE&&i!==e.DOM_DELTA_PAGE||(t=-40),{deltaX:e.deltaX*t,deltaY:e.deltaY*t}},L.prototype.empty=function(e){for(;e.firstChild;)this.dataGrid._remove(e.firstChild)},L.prototype.supportsTransitions=function(){var e=(document.body||document.documentElement).style,t="transition";if(!!u.isIE()&&u.getBrowserVersion()<11)return!1;if("string"==typeof e[t])return!0;var i=["Moz","webkit","Webkit","Khtml","O","ms"];t=t.charAt(0).toUpperCase()+t.substr(1);for(var s=0;s<i.length;s++)if("string"==typeof e[i[s]+t])return!0;return!1},L.prototype._isNodeEditableOrClickable=function(e,t){for(;null!=e&&e!==t;){var i=e.nodeName;if(3===e.nodeType)e=e.parentNode;else{var s=parseInt(e.getAttribute("tabIndex"),10),n=parseInt(e.getAttribute(this.dataGrid.getResources().getMappedAttribute("tabindex")),10);if(null!=s&&s>=0)return!(this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("cell"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("headerlabel"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("headercell"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("endheadercell")));if(i.match(/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA/)&&(-1!==s||-1!==n))return!0;e=e.parentNode}}return!1},L.prototype.shouldOffsetOutline=function(){return!(!u.isMac()||!u.isWebkit())};const D=function(e){this.m_root=e,this.MAX_COLUMN_THRESHOLD=20,this.MAX_ROW_THRESHOLD=30,this.m_utils=new L(this),this.m_discontiguousSelection=!1,this.m_sizingManager=new M,this.m_keyboardHandler=new R(this),this.m_rowHeaderWidth=null,this.m_rowEndHeaderWidth=null,this.m_colHeaderHeight=null,this.m_colEndHeaderHeight=null,this.m_styleClassDimensionMap={width:{},height:{}},this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.m_fetchingForUpdate=!1,this.m_initialized=!1,this.m_shouldFocus=null,this.m_renderCount=0,this.callbacks={},this._setupActions(),this.m_readinessStack=[],this.m_modelEvents=[],this.m_databodyMap=new Map};D.prototype.keyCodes={TAB_KEY:9,ENTER_KEY:13,SHIFT_KEY:16,CTRL_KEY:17,ALT_KEY:18,ESC_KEY:27,SPACE_KEY:32,PAGEUP_KEY:33,PAGEDOWN_KEY:34,END_KEY:35,HOME_KEY:36,LEFT_KEY:37,UP_KEY:38,RIGHT_KEY:39,DOWN_KEY:40,NUM5_KEY:53,V_KEY:86,X_KEY:88,C_KEY:67,D_KEY:68,R_KEY:82,F1_KEY:112,F2_KEY:113,F8_KEY:119,F10_KEY:121,F15_KEY:126,A_KEY:65},D.UPDATE_ANIMATION_FADE_INOUT=1,D.UPDATE_ANIMATION_SLIDE_INOUT=2,D.UPDATE_ANIMATION_DURATION=250,D.EXPAND_ANIMATION_DURATION=500,D.COLLAPSE_ANIMATION_DURATION=400,D.MAX_OVERSCROLL_PIXEL=50,D.BOUNCE_ANIMATION_DURATION=500,D.DECELERATION_FACTOR=6e-4,D.TAP_AND_SCROLL_RESET=300,D.MIN_SWIPE_DURATION=200,D.MAX_SWIPE_DURATION=400,D.MIN_SWIPE_DISTANCE=10,D.MIN_SWIPE_TRANSITION_DURATION=100,D.MAX_SWIPE_TRANSITION_DURATION=500,D.CONTEXT_MENU_TAP_HOLD_DURATION=750,D.HEADER_TAP_SHORT_HOLD_DURATION=300,D.FETCH_PIXEL_THRESHOLD=5,D.VISIBILITY_STATE_HIDDEN="hidden",D.VISIBILITY_STATE_REFRESH="refresh",D.VISIBILITY_STATE_RENDER="render",D.VISIBILITY_STATE_VISIBLE="visible",D.SPACER_DEFAULT_WIDTH=2,D.prototype.SetOptions=function(e,t){this.m_options=new I(e,t)},D.prototype.SetSortOriginalEvent=function(e){this.m_sortInfo&&(this.m_sortInfo.originalEvent=e)},D.prototype.UpdateOptions=function(e,t){var i,s,n=Object.keys(e);for(s=0;s<n.length;s++)(i=n[s])in this.m_options.options&&this.m_options.options[i]!==e[i]&&(this.m_options.options[i]=e[i]);for(s=0;s<n.length;s++)if(i=n[s],!this._updateDataGrid(i,t)){this.empty(),this.refresh(this.m_root);break}},D.prototype._updateDataGrid=function(e,t){var i;switch(e){case"bandingInterval":this._removeBanding(),this.updateColumnBanding(),this.updateRowBanding();break;case"currentCell":i=this.m_options.getCurrentCell(),this._updateActive(i,!0,!1);break;case"editMode":this.m_editMode=this.m_options.getEditMode();break;case"gridlines":this._updateGridlines();break;case"header":i=this.m_options.options.header,this._updateHeaderOptions(i,t);break;case"scrollPosition":i=this.m_options.getScrollPosition(),this._updateScrollPosition(i);break;case"selection":i=this.m_options.getSelection(),this._updateSelection(i);break;case"selectionMode":this._clearSelection(null);break;default:return!1}return!0},D.prototype._updateSelection=function(e){null!=e&&this._isSelectionEnabled()&&this.SetSelection(e)},D.prototype._updateHeaderOptions=function(e,t){if(null!=t&&null!=t.subkey){var i,s=t.subkey.split("."),n=s[0],o=s[1];if("column"===n&&null!=this.m_colHeader&&null!=this.m_colHeader.firstChild?i=this.m_colHeader.firstChild.childNodes:"row"===n&&null!=this.m_rowHeader&&null!=this.m_rowHeader.firstChild?i=this.m_rowHeader.firstChild.childNodes:"columnEnd"===n&&null!=this.m_colEndHeader&&null!=this.m_colEndHeader.firstChild?i=this.m_colEndHeader.firstChild.childNodes:"rowEnd"===n&&null!=this.m_rowEndHeader&&null!=this.m_rowEndHeader.firstChild&&(i=this.m_rowEndHeader.firstChild.childNodes),null!=i)for(var r=0;r<i.length;r++){var l=i[r],a=l[this.getResources().getMappedAttribute("context")];if(a.index=this.getHeaderCellIndex(l),"resizable"===o)this._isHeaderResizeEnabled(n,a)?this._setAttribute(l,o,"true"):this._setAttribute(l,o,"false");else if("sortable"===o){var h=this.m_utils.containsCSSClassName(l.lastChild,this.getMappedStyle("sortIcon"));if(this._isSortEnabled(n,a)){if(!h){var d=this._buildSortIcon(a,l);l.appendChild(d)}this._setAttribute(l,o,"true")}else h&&this._remove(l.lastChild),this._setAttribute(l,o,"false")}}}},D.prototype._updateGridlines=function(){var e=this.m_options.getHorizontalGridlines(),t=this.m_options.getVerticalGridlines(),i=this.getResources().isRTLMode()?"right":"left";if(this.m_databody&&this.m_databody.firstChild){let s=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),n=this._getLastAxis("row"),o=this._getLastAxis("column");for(let r=0;r<s.length;r++){let l=s[r],a=this.getCellIndexes(l);"hidden"===t||a.column===o&&(this.getRowHeaderWidth()+this.getElementDir(l,i)+this.calculateColumnWidth(l)>=this.getWidth()||this.m_endRowEndHeader>-1)?this.m_utils.addCSSClassName(l,this.getMappedStyle("borderVerticalNone")):this.m_utils.removeCSSClassName(l,this.getMappedStyle("borderVerticalNone")),"hidden"===e||a.row===n&&(this.getRowBottom(l,null)>=this.getHeight()||this.m_endColEndHeader>-1)?this.m_utils.addCSSClassName(l,this.getMappedStyle("borderHorizontalNone")):this.m_utils.removeCSSClassName(l,this.getMappedStyle("borderHorizontalNone"))}}},D.prototype._updateEdgeCellBorders=function(e){if(null!=this.m_active&&"cell"===this.m_active.type){var t=this._getActiveElement();null!=t&&((this._isCellEditable()&&""===e||""!==e)&&this._applyBorderClassesAroundRange(t,{startIndex:this.m_active.indexes},""===e,"Edit"),this._isLastRow(this.m_active.indexes.row)&&("none"===e?this.m_utils.addCSSClassName(t,this.getMappedStyle("borderHorizontalNone")):this.m_utils.removeCSSClassName(t,this.getMappedStyle("borderHorizontalNone"))),this._isLastColumn(this.m_active.indexes.column)&&("none"===e?this.m_utils.addCSSClassName(t,this.getMappedStyle("borderVerticalNone")):this.m_utils.removeCSSClassName(t,this.getMappedStyle("borderVerticalNone"))))}},D.prototype.SetResources=function(e){this.m_resources=e},D.prototype.getResources=function(){return this.m_resources},D.prototype.getStartRowHeader=function(){return this.m_startRowHeader},D.prototype.getStartColumnHeader=function(){return this.m_startColHeader},D.prototype.getStartRowEndHeader=function(){return this.m_startRowEndHeader},D.prototype.getStartColumnEndHeader=function(){return this.m_startColEndHeader},D.prototype.getMappedStyle=function(e){return this.getResources().getMappedStyle(e)},D.prototype.SetDataSource=function(e){this.m_modelEvents=[],this.m_dataSource=e},D.prototype.getDataSource=function(){return this.m_dataSource},D.prototype.setVisibility=function(e){this.m_visibility=e},D.prototype.getVisibility=function(){return null==this.m_visibility&&(null!=this.m_root.offsetParent?this.setVisibility(D.VISIBILITY_STATE_VISIBLE):this.setVisibility(D.VISIBILITY_STATE_HIDDEN)),this.m_visibility},D.prototype.SetOptionCallback=function(e){this.m_setOptionCallback=e},D.prototype.SetContextCallback=function(e){this.m_contextCallback=e},D.prototype.SetCustomElementCallback=function(e){this.m_isCustomElementCallback=e},D.prototype.SetRemoveCallback=function(e){this.m_removeCallback=e},D.prototype.SetUniqueIdCallback=function(e){this._uniqueIdCallback=e},D.prototype.SetCompareValuesCallback=function(e){this._compareValuesCallback=e},D.prototype.SetSubtreeAttachedCallback=function(e){this.m_subtreeAttachedCallback=e},D.prototype.SetUpdateScrollPostionOnRefreshCallback=function(e){this.m_updateScrollPostionOnRefreshCallback=e},D.prototype._remove=function(e){null!=e&&(this._uniqueIdCallback(e,!0),this.m_removeCallback.call(null,e))},D.prototype._removeFromArray=function(e){for(var t=0;t<e.length;t++)this._remove(e[t])},D.prototype.SetNotReadyCallback=function(e){this.m_notReady=e},D.prototype.SetMakeReadyCallback=function(e){this.m_makeReady=e},D.prototype._signalTaskStart=function(){this.m_readinessStack&&(0===this.m_readinessStack.length&&this.m_notReady(),this.m_readinessStack.push(1))},D.prototype._signalTaskEnd=function(){this.m_readinessStack&&this.m_readinessStack.length>0&&(this.m_readinessStack.pop(),0===this.m_readinessStack.length&&this.m_makeReady())},D.prototype._indexes=function(e,t){var i=this,s=this.getDataSource().indexes(e);"function"==typeof s.then?(i._signalTaskStart(),s.then(function(s){t.call(i,s,e),i._signalTaskEnd()},function(){t.call(i,{row:-1,column:-1},e),i._signalTaskEnd()})):t.call(i,s,e)},D.prototype._keys=function(e,t){var i=this,s=this._getLocalKeys(e);if(void 0===s){var n=this.getDataSource().keys(e);"function"==typeof n.then?(i._signalTaskStart(),n.then(function(s){t.call(i,s,e),i._signalTaskEnd()},function(){t.call(i,{row:null,column:null},e),i._signalTaskEnd()})):t.call(i,n,e)}else t.call(i,s,e)},D.prototype._getLocalKeys=function(e){var t=this._getCellByIndex(e);if(t)return this.getCellKeys(t);var i,s,n=e.row,o=e.column;if(void 0!==n){if(-1===n)i=null;else{var r=this._getCellOrHeaderByIndex(n,"row");r&&(i=this._getKey(r,"row"))}if(void 0===i)return}if(void 0!==o){if(-1===o)s=null;else{var l=this._getCellOrHeaderByIndex(o,"column");l&&(s=this._getKey(l,"column"))}if(void 0===s)return}return this.createIndex(i,s)},D.prototype.SetCreateContextCallback=function(e){this.m_createContextCallback=e},D.prototype.SetFocusableCallback=function(e,t){this.m_focusInHandler=e,this.m_focusOutHandler=t},D.prototype.SetFixContextCallback=function(e){this.m_fixContextCallback=e},D.prototype.SetCustomElement=function(e){this.m_customElement=e},D.prototype._isHighWatermarkScrolling=function(){return"scroll"!==this.m_options.getScrollPolicy()},D.prototype.destroy=function(){delete this.m_fetching,this._removeDataSourceEventListeners(),this._removeDomEventListeners(),delete this.m_styleClassDimensionMap,this.m_styleClassDimensionMap={width:{},height:{}}},D.prototype._addDataSourceEventListeners=function(){this._removeDataSourceEventListeners(),null!=this.m_dataSource&&(this.m_handleModelEventListener=this.handleModelEvent.bind(this),this.m_handleExpandEventListener=this.handleExpandEvent.bind(this),this.m_handleCollapseEventListener=this.handleCollapseEvent.bind(this),this.m_dataSource.on("change",this.m_handleModelEventListener,this),this.m_dataSource.on("expand",this.m_handleExpandEventListener,this),this.m_dataSource.on("collapse",this.m_handleCollapseEventListener,this))},D.prototype._removeDataSourceEventListeners=function(){null!=this.m_dataSource&&(this.m_dataSource.off("change",this.m_handleModelEventListener),this.m_dataSource.off("expand",this.m_handleExpandEventListener),this.m_dataSource.off("collapse",this.m_handleCollapseEventListener))},D.prototype._addDomEventListeners=function(){this.m_handleDatabodyKeyDown||(this.m_handleDatabodyKeyDown=this.handleDatabodyKeyDown.bind(this)),this.m_handleDatabodyKeyUp||(this.m_handleDatabodyKeyUp=this.handleDatabodyKeyUp.bind(this)),this.m_handleRootFocus||(this.m_handleRootFocus=this.handleRootFocus.bind(this)),this.m_handleRootBlur||(this.m_handleRootBlur=this.handleRootBlur.bind(this)),this.m_root.addEventListener("keydown",this.m_handleDatabodyKeyDown,!1),this.m_root.addEventListener("keyup",this.m_handleDatabodyKeyUp,!1),this.m_root.addEventListener("focus",this.m_handleRootFocus,!0),this.m_root.addEventListener("blur",this.m_handleRootBlur,!0)},D.prototype._removeDomEventListeners=function(){document.removeEventListener("mousemove",this.m_docMouseMoveListener,!1),document.removeEventListener("mouseup",this.m_docMouseUpListener,!1),null!=this.m_root&&(this.m_handleDatabodyKeyDown&&this.m_root.removeEventListener("keydown",this.m_handleDatabodyKeyDown,!1),this.m_handleDatabodyKeyUp&&this.m_root.removeEventListener("keyup",this.m_handleDatabodyKeyUp,!1),this.m_handleRootFocus&&this.m_root.removeEventListener("focus",this.m_handleRootFocus,!0),this.m_handleRootBlur&&this.m_root.removeEventListener("blur",this.m_handleRootBlur,!0))},D.prototype.getRootElement=function(){return this.m_root},D.prototype.getWidth=function(){return null==this.m_width&&(this.m_width=this.getRootElement().clientWidth),this.m_width},D.prototype.getHeight=function(){return null==this.m_height&&(this.m_height=this.getRootElement().clientHeight),this.m_height},D.prototype.getScrollableWidth=function(){var e=this.m_databody.firstChild;return this.getElementWidth(e)},D.prototype.getViewportWidth=function(){var e=this.getWidth();return Math.round(1.5*e)},D.prototype.getViewportHeight=function(){var e=this.getHeight();return Math.round(1.5*e)},D.prototype._getViewportTop=function(){return this.m_currentScrollTop},D.prototype._getViewportBottom=function(){var e=this._getViewportTop(),t=this.getElementHeight(this.m_databody),i=this.m_utils.getScrollbarSize();return this.m_hasHorizontalScroller?e+t-i:e+t},D.prototype._getViewportLeft=function(){return this.m_currentScrollLeft},D.prototype._getViewportRight=function(){var e=this._getViewportLeft(),t=this.getElementWidth(this.m_databody),i=this.m_utils.getScrollbarSize();return this.m_hasVerticalScroller?e+t-i:e+t},D.prototype.getFetchSize=function(e){return"row"===e?(null==this.m_rowFetchSize&&(this.m_rowFetchSize=Math.max(1,Math.round(this.getViewportHeight()/this.getDefaultRowHeight()))),this.m_rowFetchSize):"column"===e?(null==this.m_columnFetchSize&&(this.m_columnFetchSize=Math.max(1,Math.round(this.getViewportWidth()/this.getDefaultColumnWidth()))),this.m_columnFetchSize):0},D.prototype.getEmptyText=function(){var e=this.m_options.getEmptyText();null==e&&(e=this.getResources().getTranslatedText("msgNoData"));return e},D.prototype._buildEmptyText=function(){let e;if(null==this.getDataSource()){let t=this.getWidth(),i=this.getHeight();e=this.buildDatabody(!0),this.setElementWidth(e,t),this.setElementHeight(e,i),this.m_root.insertBefore(e,this.m_status)}const t=this._getTemplateEngine(),i=this._getItemTemplateBySlotName("noData");if(e=this.m_databody,i&&null!=t){let s=document.createElement("div");return s.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),s.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),s.id=this.createSubId("noData"),this.m_utils.addCSSClassName(s,this.getMappedStyle("noDataContainer")),t.execute(this.getRootElement(),i,{},null,e).forEach(function(e){s.appendChild(e)}),this._removeFocusFromChildElements({},s),s}var s=this.getEmptyText(),n=document.createElement("div");return n.id=this.createSubId("empty"),n.className=this.getMappedStyle("emptytext"),n.textContent=s,this.m_empty=n,n},D.prototype.getRowThreshold=function(){return 0},D.prototype.getColumnThreshold=function(){return 0},D.prototype.setDefaultDimensions=function(){var e=document.createElement("div");e.style.visibilty="hidden";var t=this.getResources();e.className=t.getMappedStyle("rowheadercell")+" "+t.getMappedStyle("colheadercell")+" "+t.getMappedStyle("headercell"),this.m_root.appendChild(e);var i=e.getBoundingClientRect();this.m_defaultColumnWidth=Math.round(i.width),this.m_defaultRowHeight=Math.round(i.height),this.getViewportWidth(),this.getViewportHeight(),this.m_root.removeChild(e)},D.prototype.getDefaultRowHeight=function(){return null==this.m_defaultRowHeight&&this.setDefaultDimensions(),this.m_defaultRowHeight},D.prototype.getDefaultColumnWidth=function(){return null==this.m_defaultColumnWidth&&this.setDefaultDimensions(),this.m_defaultColumnWidth},D.prototype._getHeaderDimension=function(e,t,i,s){var n=this.m_sizingManager.getSize(i,t);if(null!=n)return n;if(""!==e.style[s])return n=this.getElementDir(e,s),this.m_sizingManager.setSize(i,t,n),n;var o=e.className;return null==(n=this.m_styleClassDimensionMap[s][o])&&(n=this.getElementDir(e,s)),this.m_sizingManager.setSize(i,t,n),this.m_styleClassDimensionMap[s][o]=n,n},D.prototype.createSubId=function(e){return[this.getRootElement().id,e].join(":")},D.prototype.isHeaderFetchComplete=function(){return!1===this.m_fetching.row&&!1===this.m_fetching.column},D.prototype.isFetchComplete=function(){return null!=this.m_fetching&&this.isHeaderFetchComplete()&&!1===this.m_fetching.cells},D.prototype._isLastRow=function(e){return this._isCountUnknown("row")?e===this.m_endRow&&this.m_stopRowFetch:e+1===this.getDataSource().getCount("row")},D.prototype._isLastColumn=function(e){return this._isCountUnknown("column")?e===this.m_endCol&&this.m_stopColumnFetch:e+1===this.getDataSource().getCount("column")},D.prototype._getLastAxis=function(e){return this._isCountUnknown(e)?("row"===e?this.m_stopRowFetch:this.m_stopColumnFetch)?"row"===e?this.m_endRow:this.m_endCol:"row"===e?this.m_endRow+1:this.m_endCol+1:this.getDataSource().getCount(e)-1},D.prototype.empty=function(){this.m_empty&&this._remove(this.m_empty),this.m_corner&&this._remove(this.m_corner),this.m_bottomCorner&&this._remove(this.m_bottomCorner),this.m_columnHeaderScrollbarSpacer&&this._remove(this.m_columnHeaderScrollbarSpacer),this.m_rowHeaderScrollbarSpacer&&this._remove(this.m_rowHeaderScrollbarSpacer),this.m_root.removeChild(this.m_placeHolder),this.m_root.removeChild(this.m_status),this.m_root.removeChild(this.m_accSummary),this.m_root.removeChild(this.m_accInfo),this.m_root.removeChild(this.m_stateInfo),this.m_root.removeChild(this.m_contextInfo),this._remove(this.m_colHeader),this._remove(this.m_rowHeader),this._remove(this.m_colEndHeader),this._remove(this.m_rowEndHeader),this._remove(this.m_databody),this._clearDatabodyMap()},D.prototype.refresh=function(e){this.resetInternal(),this.render(e)},D.prototype.resetInternal=function(){this.m_initialized=!1,this.m_readinessStack=[],this._signalTaskStart(),this._signalTaskEnd(),this._clearDatabodyMap(),this.m_cursor=null,this.m_corner=null,this.m_bottomCorner=null,this.m_columnHeaderScrollbarSpacer=null,this.m_rowHeaderScrollbarSpacer=null,this.m_colHeader=null,this.m_colEndHeader=null,this.m_rowHeader=null,this.m_rowEndHeader=null,this.m_databody=null,this.m_empty=null,this.m_accInfo=null,this.m_accSummary=null,this.m_contextInfo=null,this.m_placeHolder=null,this.m_stateInfo=null,this.m_status=null,this.m_headerLabels={row:[],column:[],rowEnd:[],columnEnd:[]},this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.m_rowFetchSize=null,this.m_columnFetchSize=null,this.m_fetching=null,this.m_processingModelEvent=!1,this.m_processingEventQueue=!1,this.m_animating=!1,this.m_fetchingForUpdate=!1,this.m_sizingManager.clear(),this.m_styleClassDimensionMap={width:{},height:{}},this.m_height=null,this.m_width=null,this.m_scrollHeight=null,this.m_scrollWidth=null,this.m_avgRowHeight=void 0,this.m_avgColWidth=void 0,this.m_defaultColumnWidth=null,this.m_defaultRowHeight=null,this.m_colHeaderHeight=null,this.m_colEndHeaderHeight=null,this.m_rowHeaderWidth=null,this.m_rowEndHeaderWidth=null,this.m_rowHeaderLevelWidths=[],this.m_rowEndHeaderLevelWidths=[],this.m_columnHeaderLevelHeights=[],this.m_columnEndHeaderLevelHeights=[],this.m_collisionResize=!1,this.m_active=null,this.m_prevActive=null,this.m_trueIndex={},this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_databodyMove=!1,this.m_moveRow=null,this.m_moveRowHeader=null,this.m_dropTarget=null,this.m_dropTargetHeader=null,this.m_floodFillDragState=!1,this.m_dataTransferAction=null,this.m_discontiguousSelection=!1,this.m_selectionFrontier=null,this.m_docMouseMoveListener=null,this.m_docMouseUpListener=null,this.m_modelEvents=[],this.m_hasHorizontalScroller=null,this.m_hasVerticalScroller=null,this.m_currentScrollLeft=null,this.m_currentScrollTop=null,this.m_prevScrollLeft=null,this.m_prevScrollTop=null,this.m_handleScrollOverflow=null,this._clearScrollPositionTimeout(),this.m_resizing=!1,this.m_resizingElement=null,this.m_resizingElementSibling=null,this.m_resizingElementMin=null,this.m_startRow=null,this.m_startCol=null,this.m_endRow=null,this.m_endCol=null,this.m_startRowPixel=null,this.m_startColPixel=null,this.m_endRowPixel=null,this.m_endColPixel=null,this.m_startRowHeader=null,this.m_startColHeader=null,this.m_endRowHeader=null,this.m_endColHeader=null,this.m_startRowHeaderPixel=null,this.m_startColHeaderPixel=null,this.m_endRowHeaderPixel=null,this.m_endColHeaderPixel=null,this.m_rowHeaderLevelCount=null,this.m_columnHeaderLevelCount=null,this.m_startRowEndHeader=null,this.m_startColEndHeader=null,this.m_endRowEndHeader=null,this.m_endColEndHeader=null,this.m_startRowEndHeaderPixel=null,this.m_startColEndHeaderPixel=null,this.m_endRowEndHeaderPixel=null,this.m_endColEndHeaderPixel=null,this.m_rowEndHeaderLevelCount=null,this.m_columnEndHeaderLevelCount=null,this.m_sortInfo=null,this.m_expandCollapseInfo=null,this.m_resizeRequired=null,this.m_externalFocus=null,this.m_currentMode=null,this.m_editMode=null,this.m_hasCells=null,this.m_hasRowHeader=null,this.m_hasRowEndHeader=null,this.m_hasColHeader=null,this.m_hasColEndHeader=null,this.m_isLongScroll=null,this.m_addBorderBottom=null,this.m_addBorderRight=null,this.m_sortContainerWidth=null,this.m_sortContainerHeight=null,this._destroyEditableClone(),this._clearFocusoutTimeout(),this._clearFocusoutBusyState()},D.prototype._shouldInitialize=function(){return this.isFetchComplete()&&!this.m_initialized&&null!=this.m_databody.parentNode},D.prototype._handleInitialization=function(e){!0===e?(this.resizeGrid(),0===this.m_startRow&&0===this.m_startCol&&this.fillViewport(),this.isFetchComplete()&&(this._updateActive(this.m_options.getCurrentCell(),!!this.m_focusOnRefresh,!0),this.m_initialized=!0,this.fireEvent("ready",{}),this._runModelEventQueue())):(this.m_initialized=!0,this.fireEvent("ready",{}),this._runModelEventQueue())},D.prototype._runModelEventQueue=function(){var e;if(null!=this.m_modelEvents){if(this.m_processingEventQueue=!0,0===this.m_modelEvents.length)return void(this.m_processingEventQueue=!1);"expand"===(e=this.m_modelEvents.shift()).operation?this.handleExpandEvent(e,!0):"collapse"===e.operation?this.handleCollapseEvent(e,!0):this.handleModelEvent(e,!0)}else this.m_processingEventQueue=!1},D.prototype.render=function(e){this.m_renderCount+=1,this.m_timingStart=new Date,this.m_fetching={},this.m_startRow=0,this.m_startCol=0,this.m_endRow=-1,this.m_endCol=-1,this.m_startRowPixel=0,this.m_startColPixel=0,this.m_endRowPixel=0,this.m_endColPixel=0,this.m_startRowHeader=0,this.m_startColHeader=0,this.m_endRowHeader=-1,this.m_endColHeader=-1,this.m_startRowHeaderPixel=0,this.m_startColHeaderPixel=0,this.m_endRowHeaderPixel=0,this.m_endColHeaderPixel=0,this.m_startRowEndHeader=0,this.m_startColEndHeader=0,this.m_endRowEndHeader=-1,this.m_endColEndHeader=-1,this.m_startRowEndHeaderPixel=0,this.m_startColEndHeaderPixel=0,this.m_endRowEndHeaderPixel=0,this.m_endColEndHeaderPixel=0,this.m_currentScrollLeft=0,this.m_currentScrollTop=0,this.m_prevScrollLeft=0,this.m_prevScrollTop=0,this.m_handleScrollOverflow=!1,this.m_rowHeaderLevelWidths=[],this.m_rowEndHeaderLevelWidths=[],this.m_columnHeaderLevelHeights=[],this.m_columnEndHeaderLevelHeights=[];var t=this._loadTemplateEngine();t?(this._signalTaskStart("loading template engine"),t.then(()=>{this._signalTaskEnd(),this.m_renderCount-=1,0===this.m_renderCount&&this.buildGrid(e)})):(this.m_renderCount-=1,this.buildGrid(e))},D.prototype._loadTemplateEngine=function(){var e=this._getSlotMap();if(this._isDataGridProvider()&&Object.keys(e).length>1||null==this.getDataSource()&&Object.keys(e).length>0){var t={customElement:this.m_customElement};return new Promise(e=>{p.__getTemplateEngine(t).then(t=>{this.m_engine=t,e(t)},function(e){throw new Error("Error loading template engine: "+e)})})}return null},D.prototype._getTemplateEngine=function(){return this.m_engine},D.prototype._cleanTemplateNodes=function(e){var t=this._getTemplateEngine();null!=t&&t.clean(e)},D.prototype._isDataGridProvider=function(){return this.m_options.options.data&&this.m_options.options.data.fetchByOffset&&!this.m_options.options.data.fetchFirst},D.prototype._getSlotMap=function(){return g.CustomElementUtils.getSlotMap(this.m_root)},D.prototype._getItemTemplateBySlotName=function(e){var t=this._getSlotMap()[e];return t&&t.length>0&&"template"===t[0].tagName.toLowerCase()?t[0]:null},D.prototype.buildGrid=function(e){this.m_root=e,this.m_root.setAttribute("role","application"),this._isCellEditable()?this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("editable")):this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.setDefaultDimensions(),e.tabIndex=0;var t=this.buildStatus();e.appendChild(t),this.m_status=t;var i=this.buildAccSummary();e.appendChild(i),this.m_accSummary=i;var s=this.buildAccInfo();e.appendChild(s),this.m_accInfo=s;var n=this.buildStateInfo();e.appendChild(n),this.m_stateInfo=n;var o=this.buildContextInfo();e.appendChild(o),this.m_contextInfo=o;var r=this.buildPlaceHolder();if(e.appendChild(r),this.m_placeHolder=r,this.m_headerLabels={row:[],column:[],rowEnd:[],columnEnd:[]},null!=this.getDataSource()){this.m_empty=null;var l=this.getResources().isRTLMode(),a=this.buildHeaders("column",this.getMappedStyle("colheader"),this.getMappedStyle("colendheader")),h=a.root,d=a.endRoot;e.insertBefore(h,t),e.insertBefore(d,t);var c=(a=this.buildHeaders("row",this.getMappedStyle("rowheader"),this.getMappedStyle("rowendheader"))).root,m=a.endRoot;e.insertBefore(c,t),e.insertBefore(m,t);var u=this.buildDatabody();if(e.insertBefore(u,t),l&&(h.style.direction="rtl",u.style.direction="rtl"),this.m_isResizing=!1,this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_databodyDragState=!1,this.m_docMouseMoveListener=this.handleMouseMove.bind(this),this.m_docMouseUpListener=this.handleMouseUp.bind(this),this.m_utils.isTouchDevice())u.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),u.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),u.addEventListener("touchend",this.handleTouchEnd.bind(this),!1),u.addEventListener("touchcancel",this.handleTouchCancel.bind(this),!1),h.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),h.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),h.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),h.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),c.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),c.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),c.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),c.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),d.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),d.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),d.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),d.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),m.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),m.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),m.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),m.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1);else{var _=this.m_utils.getMousewheelEvent();u.addEventListener(_,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),u.addEventListener("mousedown",this.handleDatabodyMouseDown.bind(this),!1),u.addEventListener("mousemove",this.handleDatabodyMouseMove.bind(this),!1),u.addEventListener("mouseup",this.handleDatabodyMouseUp.bind(this),!1),u.addEventListener("mouseout",this.handleDatabodyMouseOut.bind(this),!1),u.addEventListener("mouseover",this.handleDatabodyMouseOver.bind(this),!1),u.addEventListener("dblclick",this.handleDatabodyDoubleClick.bind(this),!1),c.addEventListener(_,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),h.addEventListener(_,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),c.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),h.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),c.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),h.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),c.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),h.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),c.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),h.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),c.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),h.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),c.addEventListener("click",this.handleHeaderClick.bind(this),!1),c.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),h.addEventListener("click",this.handleHeaderClick.bind(this),!1),h.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),m.addEventListener(_,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),d.addEventListener(_,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),m.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),d.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),m.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),d.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),m.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),d.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),m.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),d.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),m.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),d.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),m.addEventListener("click",this.handleHeaderClick.bind(this),!1),m.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),d.addEventListener("click",this.handleHeaderClick.bind(this),!1),d.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1)}this._addDnDEventListener(c,m,h,d,u),this._shouldInitialize()&&this._handleInitialization(!0)}else{var p=this._buildEmptyText();this.m_databody.firstChild.appendChild(p),this._handleInitialization(!1)}},D.prototype._addDnDEventListener=function(e,t,i,s,n){e.addEventListener("drag",this.handleRowDrag.bind(this),!1),e.addEventListener("dragstart",this.handleDragStart.bind(this),!1),e.addEventListener("dragend",this.handleRowDragEnd.bind(this),!1),e.addEventListener("dragover",this.handleRowDragOver.bind(this),!1),e.addEventListener("dragenter",this.handleRowDragEnter.bind(this),!1),e.addEventListener("dragleave",this.handleRowDragLeave.bind(this),!1),e.addEventListener("drop",this.handleRowDrop.bind(this),!1),i.addEventListener("dragstart",this.handleDragStart.bind(this),!1),i.addEventListener("dragend",this.handleColumnDragEnd.bind(this),!1),i.addEventListener("dragover",this.handleColumnDragOver.bind(this),!1),i.addEventListener("dragenter",this.handleColumnDragEnter.bind(this),!1),i.addEventListener("dragleave",this.handleColumnDragLeave.bind(this),!1),i.addEventListener("drop",this.handleColumnDrop.bind(this),!1),t.addEventListener("drag",this.handleRowDrag.bind(this),!1),t.addEventListener("dragstart",this.handleDragStart.bind(this),!1),t.addEventListener("dragend",this.handleRowDragEnd.bind(this),!1),t.addEventListener("dragover",this.handleRowDragOver.bind(this),!1),t.addEventListener("dragenter",this.handleRowDragEnter.bind(this),!1),t.addEventListener("dragleave",this.handleRowDragLeave.bind(this),!1),t.addEventListener("drop",this.handleRowDrop.bind(this),!1),s.addEventListener("dragstart",this.handleDragStart.bind(this),!1),s.addEventListener("dragend",this.handleColumnDragEnd.bind(this),!1),s.addEventListener("dragover",this.handleColumnDragOver.bind(this),!1),s.addEventListener("dragenter",this.handleColumnDragEnter.bind(this),!1),s.addEventListener("dragleave",this.handleColumnDragLeave.bind(this),!1),s.addEventListener("drop",this.handleColumnDrop.bind(this),!1),n.addEventListener("dragover",this.handleDatabodyDragOver.bind(this),!1),n.addEventListener("dragenter",this.handleDatabodyDragEnter.bind(this),!1),n.addEventListener("drop",this.handleDatabodyDrop.bind(this),!1)},D.prototype.HandleResize=function(e,t){e=this.getRootElement().clientWidth,t=this.getRootElement().clientHeight,e===this.m_width&&t===this.m_height||(this.m_width=e,this.m_height=t,this.m_rowFetchSize=null,this.m_columnFetchSize=null,this.m_initialized&&(this.resizeGrid(),this.isFetchComplete()&&(this.m_resizeRequired=!0,this.fillViewport())))},D.prototype.resizeGrid=function(){var e=this.getWidth(),t=this.getHeight(),i=this.m_colHeader,s=this.m_colEndHeader,n=this.m_rowHeader,o=this.m_rowEndHeader,r=this.m_databody,l=r.firstChild,a=this.getColumnHeaderHeight(),h=this.getColumnEndHeaderHeight(),d=this.getRowHeaderWidth(),c=this.getRowEndHeaderWidth();this.m_headerLabels.row&&this.m_headerLabels.row.length&&0===a&&(a=this._getCellDimension(this.m_headerLabels.row[0],0,null,"column","height"),this.m_colHeaderHeight=a),this.m_headerLabels.column&&this.m_headerLabels.column.length&&0===d&&(d=this._getCellDimension(this.m_headerLabels.column[0],0,null,"row","width"),this.m_rowHeaderWidth=d);var m,u,_,p=t-a-h,g=e-d-c,f=this.m_utils.getScrollbarSize();this._databodyEmpty()&&(null==this.m_empty?(m=this._buildEmptyText(),u=this.getElementHeight(m),_=this.getElementWidth(m),l=r.firstChild,u>this.getElementHeight(l)&&this.setElementHeight(l,u),_>this.getElementWidth(l)&&this.setElementWidth(l,_),this.m_databody.firstChild.appendChild(m)):m=this.m_empty);var C,y,v,E,w,S=this.getElementWidth(r.firstChild),H=this.getElementHeight(r.firstChild),x=this.isDatabodyHorizontalScrollbarRequired(g);if(x)C=this.isDatabodyVerticalScrollbarRequired(p-f),r.style.overflow="auto";else if(C=this.isDatabodyVerticalScrollbarRequired(p))x=this.isDatabodyHorizontalScrollbarRequired(g-f),r.style.overflow="auto";else{this.m_handleScrollOverflow=!1;var b=this;setTimeout(function(){b.m_handleScrollOverflow||b.m_hasVerticalScroller||b.m_hasHorizontalScroller||(r.style.overflow="hidden",b.m_handleScrollOverflow=!0)},10)}this.m_hasHorizontalScroller=x,this.m_hasVerticalScroller=C,-1!==this.m_endColEndHeader?(y=Math.min(H+(x?f:0),p),v=x?y-f:y):(y=p,v=Math.min(H,x?y-f:y)),-1!==this.m_endRowEndHeader?(E=Math.min(S+(C?f:0),g),w=C?E-f:E):(E=g,w=Math.min(S,C?E-f:E));var R=d+w+(C?f:0),I=a+v+(x?f:0),M=this.getResources().isRTLMode()?"right":"left";this.setElementDir(n,0,M),this.setElementDir(n,a,"top"),this.setElementHeight(n,v),this.setElementDir(o,R,M),this.setElementDir(o,a,"top"),this.setElementHeight(o,v),this.setElementDir(i,d,M),this.setElementWidth(i,w),this.setElementDir(s,d,M),this.setElementDir(s,I,"top"),this.setElementWidth(s,w),this.setElementDir(r,a,"top"),this.setElementDir(r,d,M),this.setElementWidth(r,E),this.setElementHeight(r,y),this.m_scrollWidth=S-w,this.m_scrollHeight=H-v,this.buildCorners(),this._adjustHeaderBorders(),this._updateGridlines(),this.m_resizeRequired=!1},D.prototype._sizeDatabodyScroller=function(){var e,t,i=this.m_databody,s=i.firstChild,n=this._databodyEmptyState(),o=this._isHighWatermarkScrolling(),r=this.m_utils._getMaxDivHeightForScrolling(),l=this.m_utils._getMaxDivWidthForScrolling(),a=this.getDataSource().getCount("row"),h=this.getDataSource().getCount("column"),d=0,c=0;n?(d=Math.max(Math.max(this.m_endRowHeaderPixel,this.m_endRowEndHeaderPixel),1),c=Math.max(Math.max(this.m_endColHeaderPixel,this.m_endColEndHeaderPixel),1)):(d=this.m_endRowPixel,c=this.m_endColPixel),e=-1===a||o?d:a*this.m_avgRowHeight,t=-1===h||o?c:h*this.m_avgColWidth,this.setElementHeight(s,Math.min(r,e)),this.setElementWidth(s,Math.min(l,t)),this.m_initialized&&(this.m_scrollWidth=this.getElementWidth(s)-Math.min(this.getElementWidth(s),this.getElementWidth(i)-(this.m_hasVerticalScroller?this.m_utils.getScrollbarSize():0)),this.m_scrollHeight=this.getElementHeight(s)-Math.min(this.getElementHeight(s),this.getElementHeight(i)-(this.m_hasHorizontalScroller?this.m_utils.getScrollbarSize():0)))},D.prototype._adjustLastHeadersAlongAxis=function(e,t,i,s,n,o){for(var r=0;r<t;){var l=this._getHeaderByIndex(e,r,i,t,s);o?this.m_utils.removeCSSClassName(l,n):this.m_utils.addCSSClassName(l,n),r+=this.getHeaderCellDepth(l)}},D.prototype._adjustHeaderBordersAlongAxis=function(e,t,i,s,n,o,r,l){null!=e&&i>=0&&(s?this.m_utils.addCSSClassName(n,o):this.m_utils.removeCSSClassName(n,o),t(i)&&this._adjustLastHeadersAlongAxis(i,r,e,l,o,s))},D.prototype._adjustHeaderBorders=function(){var e,t,i,s,n,o=this.m_utils.getScrollbarSize(),r=this.getWidth(),l=this.getHeight(),a=this.getColumnHeaderHeight(),h=this.getElementWidth(this.m_colHeader),d=this.getColumnEndHeaderHeight(),c=this.getRowHeaderWidth(),m=this.getElementHeight(this.m_rowHeader),u=c+h+this.getRowEndHeaderWidth()+(this.m_hasVerticalScroller?o:0)<r,_=a+m+d+(this.m_hasHorizontalScroller?o:0)<l;if(u&&this.m_endRowEndHeader>=0?(e=!0,this.m_addBorderRight=!0):!0===this.m_addBorderRight&&(e=!1),null!=e)for(t=this.getMappedStyle("borderVerticalSmall"),null!=this.m_columnHeaderScrollbarSpacer&&(e?this.m_utils.addCSSClassName(this.m_columnHeaderScrollbarSpacer,t):this.m_utils.removeCSSClassName(this.m_columnHeaderScrollbarSpacer,t)),null!=this.m_bottomCorner&&(e?this.m_utils.addCSSClassName(this.m_bottomCorner,t):this.m_utils.removeCSSClassName(this.m_bottomCorner,t)),s=this.m_rowEndHeader.firstChild.childNodes,i=0;i<s.length;i++)e?this.m_utils.addCSSClassName(s[i],t):this.m_utils.removeCSSClassName(s[i],t);else t=this.getMappedStyle("borderVerticalNone"),n=this._isLastColumn.bind(this),this._adjustHeaderBordersAlongAxis(this.m_colHeader,n,this.m_endColHeader,u,this.m_columnHeaderScrollbarSpacer,t,this.m_columnHeaderLevelCount,this.m_startColHeader),this._adjustHeaderBordersAlongAxis(this.m_colEndHeader,n,this.m_endColEndHeader,u,this.m_bottomCorner,t,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader);if(e=null,_&&this.m_endColEndHeader>=0?(this.m_addBorderBottom=!0,e=!0):!0===this.m_addBorderBottom&&(e=!1),null!=e)for(t=this.getMappedStyle("borderHorizontalSmall"),null!=this.m_rowHeaderScrollbarSpacer&&(e?this.m_utils.addCSSClassName(this.m_rowHeaderScrollbarSpacer,t):this.m_utils.removeCSSClassName(this.m_rowHeaderScrollbarSpacer,t)),null!=this.m_bottomCorner&&(e?this.m_utils.addCSSClassName(this.m_bottomCorner,t):this.m_utils.removeCSSClassName(this.m_bottomCorner,t)),s=this.m_colEndHeader.firstChild.childNodes,i=0;i<s.length;i++)e?this.m_utils.addCSSClassName(s[i],t):this.m_utils.removeCSSClassName(s[i],t);else t=this.getMappedStyle("borderHorizontalNone"),n=this._isLastRow.bind(this),this._adjustHeaderBordersAlongAxis(this.m_rowHeader,n,this.m_endRowHeader,_,this.m_rowHeaderScrollbarSpacer,t,this.m_rowHeaderLevelCount,this.m_startRowHeader),this._adjustHeaderBordersAlongAxis(this.m_rowEndHeader,n,this.m_endRowEndHeader,_,this.m_bottomCorner,t,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader)},D.prototype._isHeaderLabelCollision=function(){return this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]},D.prototype.buildCorners=function(){var e,t,i,s,n=this.m_utils.getScrollbarSize(),o=this.getWidth(),r=this.getHeight(),l=this.getColumnHeaderHeight(),a=this.getElementWidth(this.m_colHeader),h=this.getColumnEndHeaderHeight(),d=this.getRowHeaderWidth(),c=this.getRowEndHeaderWidth(),m=this.getElementHeight(this.m_rowHeader),u=this.getResources().isRTLMode()?"right":"left";let _,p,g,f,C,y,v=!0,E=l,w=d;if(-1!==this.m_endRowHeader&&-1!==this.m_endColHeader?(p=this.m_headerLabels.column.length?this.m_columnHeaderLevelHeights[this.m_columnHeaderLevelCount-1]:this.m_colHeaderHeight,_=this.m_headerLabels.row.length?this.m_rowHeaderLevelWidths[this.m_rowHeaderLevelCount-1]:this.m_rowHeaderWidth,C=m+l,y=h+(this.m_hasHorizontalScroller?n:0),g=d+a,f=c+(this.m_hasVerticalScroller?n:0)):-1!==this.m_endRowHeader&&-1===this.m_endColHeader?(p=l,C=m+l,y=h+(this.m_hasHorizontalScroller?n:0),g=d,f=c+a+(this.m_hasVerticalScroller?n:0)):-1===this.m_endRowHeader&&-1!==this.m_endColHeader?(_=d,C=l,y=h+m+(this.m_hasHorizontalScroller?n:0),g=d+a,f=c+(this.m_hasVerticalScroller?n:0)):v=!1,v){if(null!=this.m_corner?e=this.m_corner:((e=document.createElement("div")).id=this.createSubId("corner"),e.className=this.getMappedStyle("topcorner")),this.setElementWidth(e,d),this.setElementHeight(e,l),null==this.m_corner){if(this._attachEventListenersOnCorner(e),this.m_root.appendChild(e),this.m_corner=e,p)for(s=0;s<this.m_headerLabels.row.length;s++)null!=(i=this.m_headerLabels.row[s])&&(this.setElementHeight(i,p),e.appendChild(i));if(_)for(s=0;s<this.m_headerLabels.column.length;s++)null!=(i=this.m_headerLabels.column[s])&&(this.setElementWidth(i,_),e.appendChild(i));if(this.m_subtreeAttachedCallback(e),this._isHeaderLabelCollision()){let e=this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],t=this.getElementHeight(e);return this.m_colHeaderHeight+=t,this.m_columnHeaderLevelHeights[this.m_columnHeaderLevelCount-1]+=t,this.resizeColumnHeightsAndShift(t,this.m_columnHeaderLevelCount-1,!1),this.setElementHeight(this.m_colHeader,this.m_colHeaderHeight),void this.manageResizeScrollbars()}}else{this.m_utils.isTouchDevice()?(e.addEventListener("touchstart",this.handleHeaderLabelMouseDown.bind(this),!1),e.addEventListener("touchmove",this.handleHeaderLabelMouseMove.bind(this),!1)):(e.addEventListener("mousedown",this.handleHeaderLabelMouseDown.bind(this),!1),e.addEventListener("mousemove",this.handleHeaderLabelMouseMove.bind(this),!1))}this._buildCornerOnHeaderAxisDisabled("row",u,0,C,w,y),this._buildCornerOnHeaderAxisDisabled("column",u,g,0,f,E)}else this.m_headerLabels.row=[],this.m_headerLabels.column=[];null!=this.m_corner&&null==e&&(this.m_root.removeChild(this.m_corner),this.m_corner=null),(this.m_hasHorizontalScroller&&this.m_hasVerticalScroller||this.m_hasVerticalScroller&&-1!==this.m_endColEndHeader||this.m_hasHorizontalScroller&&-1!==this.m_endRowEndHeader||-1!==this.m_endRowEndHeader&&-1!==this.m_endColEndHeader)&&(null!=this.m_bottomCorner?t=this.m_bottomCorner:((t=document.createElement("div")).id=this.createSubId("bcorner"),t.className=this.getMappedStyle("bottomcorner")),this.setElementDir(t,m+l,"top"),this.setElementDir(t,d+a,u),-1!==this.m_endRowEndHeader?this.setElementWidth(t,c+(this.m_hasVerticalScroller?n:0)):this.setElementWidth(t,o-a-d),-1!==this.m_endColEndHeader?this.setElementHeight(t,h+(this.m_hasHorizontalScroller?n:0)):this.setElementHeight(t,r-m-l),null==this.m_bottomCorner&&(this.m_root.appendChild(t),this.m_bottomCorner=t)),null!=this.m_bottomCorner&&null==t&&(this.m_root.removeChild(this.m_bottomCorner),this.m_bottomCorner=null)},D.prototype._attachEventListenersOnCorner=function(e){this.m_utils.isTouchDevice()?e.addEventListener("touchstart",this.handleCornerMouseDown.bind(this),{passive:!0}):(e.addEventListener("mousedown",this.handleCornerMouseDown.bind(this),!1),e.addEventListener("mouseover",this.handleCornerMouseOver.bind(this),!1),e.addEventListener("mouseout",this.handleCornerMouseOut.bind(this),!1)),e.addEventListener("click",this.handleCornerClick.bind(this),!1)},D.prototype._buildCornerOnHeaderAxisDisabled=function(e,t,i,s,n,o){let r,l="column"===e?this.m_columnHeaderScrollbarSpacer:this.m_rowHeaderScrollbarSpacer,a=!1;if("column"===e?(this.m_hasVerticalScroller||-1!==this.m_endRowEndHeader)&&(a=!0,null!=this.m_columnHeaderScrollbarSpacer?r=this.m_columnHeaderScrollbarSpacer:(r=document.createElement("div"),r.id=this.createSubId("chSbSpacer"),r.className=this.getMappedStyle("colheaderspacer"))):"row"===e&&(this.m_hasHorizontalScroller||-1!==this.m_endColEndHeader)&&(a=!0,null!=this.m_rowHeaderScrollbarSpacer?r=this.m_rowHeaderScrollbarSpacer:(r=document.createElement("div"),r.id=this.createSubId("rhSbSpacer"),r.className=this.getMappedStyle("rowheaderspacer"))),a){let a,h;if(this.setElementDir(r,i,t),this.setElementDir(r,s,"top"),this.setElementWidth(r,n),this.setElementHeight(r,o),null==l){if(this.m_utils.isTouchDevice()?r.addEventListener("touchstart",this.handleCornerMouseDown.bind(this),{passive:!0}):(r.addEventListener("mousedown",this.handleCornerMouseDown.bind(this),!1),r.addEventListener("mouseover",this.handleCornerMouseOver.bind(this),!1),r.addEventListener("mouseout",this.handleCornerMouseOut.bind(this),!1),"disable"!==this.isResizeEnabled()&&(r.addEventListener("mousedown",this.handleHeaderLabelMouseDown.bind(this),!1),r.addEventListener("mousemove",this.handleHeaderLabelMouseMove.bind(this),!1))),this.m_root.appendChild(r),"column"===e?(this.m_columnHeaderScrollbarSpacer=r,a=this.m_headerLabels.rowEnd):(this.m_rowHeaderScrollbarSpacer=r,a=this.m_headerLabels.columnEnd),a.length)for(let e=0;e<a.length;e++)h=a[e],null!=h&&r.appendChild(h);this.m_subtreeAttachedCallback(r)}}else"column"===e?(null!=this.m_columnHeaderScrollbarSpacer&&this.m_root.removeChild(this.m_columnHeaderScrollbarSpacer),this.m_columnHeaderScrollbarSpacer=null,this.m_headerLabels.rowEnd=[]):(null!=this.m_rowHeaderScrollbarSpacer&&this.m_root.removeChild(this.m_rowHeaderScrollbarSpacer),this.m_rowHeaderScrollbarSpacer=null,this.m_headerLabels.columnEnd=[])},D.prototype._updateScrollPosition=function(e){this._scrollToScrollPositionObject(e)},D.prototype._setScrollPosition=function(){this.m_setOptionCallback("scrollPosition",this._createScrollPositionObject(this.m_currentScrollLeft,this.m_currentScrollTop),{_context:{writeback:!0,internalSet:!0}})},D.prototype._clearScrollPositionKeys=function(){var e=this.m_options.getScrollPosition();e.rowKey=void 0,e.columnKey=void 0,this.m_setOptionCallback("scrollPosition",e,{_context:{internalSet:!0}})},D.prototype._createScrollPositionObject=function(e,t){var i={x:e,y:t},s=this.getResources().isRTLMode()?"right":"left",n=this._getCellAtPixel(e,t);if(null!=n)i.rowIndex=this._getIndex(n,"row"),i.columnIndex=this._getIndex(n,"column"),i.rowKey=this._getKey(n,"row"),i.columnKey=this._getKey(n,"column"),i.offsetX=e-this.getElementDir(n,s),i.offsetY=t-this.getElementDir(n,"top");else{var o=this._getHeaderAtPixel(t,"row");null!=o&&(i.rowIndex=this._getIndex(o),i.rowKey=this._getKey(o),i.offsetY=t-this.getElementDir(o,"top"));var r=this._getHeaderAtPixel(e,"column");null!=r&&(i.columnIndex=this._getIndex(r),i.columnKey=this._getKey(r),i.offsetX=e-this.getElementDir(r,s))}return i},D.prototype._getCellAtPixel=function(e,t){for(var i=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),s=this.getResources().isRTLMode()?"right":"left",n=0;n<i.length;n++){var o=i[n],r=this.getElementDir(o,s),l=r+this.getElementWidth(o);if(r<=e&&e<l){var a=this.getElementDir(o,"top"),h=a+this.getElementHeight(o);if(a<=t&&t<h)return o}}return null},D.prototype._getAxisInnerMostHeaders=function(e){var t,i,s=this.getMappedStyle("headercell");switch(e){case"row":t=this.m_rowHeader,i=this.m_rowHeaderLevelCount;break;case"column":t=this.m_colHeader,i=this.m_columnHeaderLevelCount;break;case"rowEnd":t=this.m_rowEndHeader,i=this.m_rowEndHeaderLevelCount;break;case"columnEnd":t=this.m_colEndHeader,i=this.m_columnEndHeaderLevelCount}var n=[];if(t)for(var o=t.getElementsByClassName(s),r=0;r<o.length;r++){var l=o[r],a=l[this.getResources().getMappedAttribute("context")];a.level+a.depth===i&&n.push(l)}return n},D.prototype._getHeaderAtPixel=function(e,t){var i,s,n,o,r=this;function l(t){for(var i=0;i<t.length;i++){var s=t[i],l=r.getElementDir(s,n),a=l+r.getElementDir(s,o);if(l<=e&&e<a)return s}}i=this._getAxisInnerMostHeaders(t),s=this._getAxisInnerMostHeaders(t+"End"),"row"===t?(n="top",o="height"):"column"===t&&(n=this.getResources().isRTLMode()?"right":"left",o="width");var a=l(i);return null==a&&(a=l(s)),a},D.prototype._checkScrollPosition=function(){null!=this.m_desiredScrollPositionObject?this._scrollToScrollPositionObject(this.m_desiredScrollPositionObject):this._setScrollPosition()},D.prototype._areKeysLocallyAvailable=function(e,t){var i=!0;return e&&null==this._getCellOrHeaderByKey(e,"row")&&(i=!1),t&&null==this._getCellOrHeaderByKey(t,"column")&&(i=!1),i},D.prototype._scrollToScrollPositionObject=function(e){var t=e.x,i=e.y,s=e.rowIndex,n=e.columnIndex,o=e.rowKey,r=e.columnKey,l=e.offsetX?e.offsetX:0,a=e.offsetY?e.offsetY:0,h=this.getResources().isRTLMode()?"right":"left",d=this.m_options.getScrollToKey();if("never"!==d||!o&&!r){if("always"!==d)if(this.getDataSource()instanceof S&&!this._areKeysLocallyAvailable(o,r)){var c=this.m_options.getProperty("data").getCapability("fetchFirst");if(null==c||"immediate"!==c.iterationSpeed)return}var m=this;this._getIndexFromKeyPromise(o,r).then(function(d){var c=Math.floor(m._getPositionEstimate("column",h,r,d.columnIndexFromKey,n,t,l,m.m_currentScrollLeft,m._getMaxRightPixel(),m.m_avgColWidth)),u=Math.floor(m._getPositionEstimate("row","top",o,d.rowIndexFromKey,s,i,a,m.m_currentScrollTop,m._getMaxBottomPixel(),m.m_avgRowHeight));c!==m.m_currentScrollLeft&&(m.m_currentScrollLeft!==m.m_scrollWidth||c<m.m_currentScrollLeft)||u!==m.m_currentScrollTop&&(m.m_currentScrollTop!==m.m_scrollHeight||u<m.m_currentScrollTop)?(null==m.m_desiredScrollPositionObject&&m._signalTaskStart("begin scrolling to new desired location"),m.m_desiredScrollPositionObject=e,m._setScrollPositionTimeout(),m._initiateScroll(c,u)):(null!=m.m_desiredScrollPositionObject&&m._signalTaskEnd("reached desired location"),m.m_desiredScrollPositionObject=null,m._setScrollPosition())})}},D.prototype._setScrollPositionTimeout=function(){this.m_utils.isTouchDeviceNotIOS()||(this.pendingScrollTimeout=setTimeout(function(){null!=this.m_desiredScrollPositionObject&&this._signalTaskEnd("reached desired location"),this.m_desiredScrollPositionObject=null,this._setScrollPosition()}.bind(this),300))},D.prototype._clearScrollPositionTimeout=function(){null!=this.pendingScrollTimeout&&(clearTimeout(this.pendingScrollTimeout),this.pendingScrollTimeout=null)},D.prototype._getPositionEstimate=function(e,t,i,s,n,o,r,l,a,h){var d,c,m=this._isHighWatermarkScrolling();return null!=i&&-1!==s&&(null!=(c=this._getCellOrHeaderByKey(i,e))?d=this.getElementDir(c,t)+r:m?d=a:null!=s&&(d=h*s+r),null!=d)?d:d=null!=n?null!=(c=this._getCellOrHeaderByIndex(n,e))?this.getElementDir(c,t)+r:m?a:h*n:null!=o?o:l},D.prototype.isDatabodyHorizontalScrollbarRequired=function(e){var t=this.m_databody.firstChild;return this.getElementWidth(t)>e},D.prototype.isDatabodyVerticalScrollbarRequired=function(e){var t=this.m_databody.firstChild;return this.getElementHeight(t)>e},D.prototype.buildStatus=function(){var e=document.createElement("div");e.className=this.getMappedStyle("loadingicon");var t=document.createElement("div");return t.id=this.createSubId("status"),t.className=this.getMappedStyle("status"),t.setAttribute("role","status"),t.appendChild(e),t},D.prototype.buildAccInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("info"),e.className=this.getMappedStyle("info"),e.setAttribute("role","status"),e},D.prototype.buildAccSummary=function(){var e=document.createElement("div");return e.id=this.createSubId("summary"),e.className=this.getMappedStyle("info"),e},D.prototype.buildStateInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("state"),e.className=this.getMappedStyle("info"),e},D.prototype.buildContextInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("context"),e.className=this.getMappedStyle("info"),e},D.prototype.buildPlaceHolder=function(){var e=document.createElement("div");return e.id=this.createSubId("placeHolder"),e.className=this.getMappedStyle("info"),e},D.prototype.populateAccInfo=function(){var e=this.getResources().getTranslatedText("accessibleSummaryExact",{rownum:this.m_endRow+1,colnum:this.m_endCol+1});this.getDataSource().getExpandedKeys&&(e=e+". "+this.getResources().getTranslatedText("accessibleSummaryExpanded",{num:this.getDataSource().getExpandedKeys().length}));e+=". ",this.m_accSummary.textContent=e},D.prototype.SetAccessibleContext=function(e){if(null!=e&&(null!=e.context&&(this.m_accessibleContext=e.context),null!=e.state&&(this.m_stateInfo.textContent=e.state),null!=e.ancestors&&this._isDatabodyCellActive())){var t="",i=e.ancestors,s=this.m_active.indexes.column;if(null!=s&&s>=0)for(var n=0;n<i.length;n++){n>0&&(t=t.concat(", "));var o=i[n],r=this._getAxisCellsByKey(o.key,"row");if(null!=r){var l=r[0].textContent;l=null!=l?l.replace(/\n|<br\s*\/?>/gi,"").trim():"",t=t.concat(o.label).concat(" ").concat(l)}}this.m_accessibleContext=t.concat(", ").concat(this.m_accessibleContext)}},D.prototype._updateStateInfo=function(e){for(var t=". ",i=0;i<e.length;i++){var s=this.getResources().getTranslatedText(e[i].key,e[i].args);null!=s&&(t=2===t.length?t+s:t+", "+s)}t=2===t.length?t:t+". ",this.m_stateInfo.textContent=t},D.prototype._updateContextInfo=function(e,t){var i,s;e.indexes&&(i=e.indexes.row,s=e.indexes.column);var n=e.level,o=e.rowHeader,r=e.rowEndHeader,l=e.columnHeader,a=e.columnEndHeader,h=e.rowHeaderLabel,d=e.rowEndHeaderLabel,c=e.columnHeaderLabel,m=e.columnEndHeaderLabel,u="";null!=this.m_accessibleContext||isNaN(i)||"row"===t||(u=this._updateAccessibleInfoString(u,"accessibleRowContext",{index:i+1})),isNaN(s)||"column"===t||(u=this._updateAccessibleInfoString(u,"accessibleColumnContext",{index:s+1})),isNaN(o)||(u=this._updateAccessibleInfoString(u,"accessibleRowHeaderContext",{index:o+1})),isNaN(l)||(u=this._updateAccessibleInfoString(u,"accessibleColumnHeaderContext",{index:l+1})),isNaN(r)||(u=this._updateAccessibleInfoString(u,"accessibleRowEndHeaderContext",{index:r+1})),isNaN(a)||(u=this._updateAccessibleInfoString(u,"accessibleColumnEndHeaderContext",{index:a+1})),isNaN(h)||(u=this._updateAccessibleInfoString(u,"accessibleRowHeaderLabelContext",{level:h+1})),isNaN(c)||(u=this._updateAccessibleInfoString(u,"accessibleColumnHeaderLabelContext",{level:c+1})),isNaN(d)||(u=this._updateAccessibleInfoString(u,"accessibleRowEndHeaderLabelContext",{level:d+1})),isNaN(m)||(u=this._updateAccessibleInfoString(u,"accessibleColumnEndHeaderLabelContext",{level:m+1})),isNaN(n)||(u=this._updateAccessibleInfoString(u,"accessibleLevelContext",{level:n+1})),u=0===u.length?u:u+". ",null!=this.m_accessibleContext&&(u+=this.m_accessibleContext,this.m_accessibleContext=null),this.m_contextInfo.textContent=u},D.prototype._updateAccessibleInfoString=function(e,t,i){var s=this.getResources().getTranslatedText(t,i);return null!=s?0===e.length?s:e+", "+s:e},D.prototype._isCountUnknown=function(e){var t=this.getDataSource();if("row"===e||"rowEnd"===e){var i=t.getCountPrecision("row"),s=t.getCount("row");return this.m_isEstimateRowCount="estimate"===i||s<0,this.m_isEstimateRowCount}if("column"===e||"columnEnd"===e){var n=t.getCountPrecision("column"),o=t.getCount("column");return this.m_isEstimateColumnCount="estimate"===n||o<0,this.m_isEstimateColumnCount}return!1},D.prototype._isCountUnknownOrHighwatermark=function(e){return this._isCountUnknown(e)||this._isHighWatermarkScrolling()},D.prototype._hideHeader=function(e){e.style.display="none"},D.prototype._showHeader=function(e){e.style.display=""},D.prototype.buildHeaders=function(e,t,i){var s=this.getMappedStyle("scroller")+(this.m_utils.isTouchDeviceNotIOS()?" "+this.getMappedStyle("scroller-mobile"):""),n=document.createElement("div");n.id=this.createSubId(e+"Header"),n.className=t+" "+this.getMappedStyle("header");var o=document.createElement("div");o.className=s,n.appendChild(o);var r=document.createElement("div");r.id=this.createSubId(e+"EndHeader"),r.className=i+" "+this.getMappedStyle("endheader");var l=document.createElement("div");if(l.className=s,r.appendChild(l),"column"===e?(this.m_colHeader=n,this.m_colEndHeader=r):"row"===e&&(this.m_rowHeader=n,this.m_rowEndHeader=r),this._isHighWatermarkScrolling()){this.fetchHeaders(e,0,n,r,null,null)}else{var a=this,h=this.m_options.getScrollPosition();this._getIndexesFromScrollPosition(h).then(function(t){var i=t[e];"column"===e?(a.m_startColHeader=i,a.m_startColEndHeader=i):"row"===e&&(a.m_startRowHeader=i,a.m_startRowEndHeader=i),a.m_fetching[e]=!1,a.fetchHeaders(e,i,n,r,null,null)}),this.m_fetching[e]=!0}return{root:n,endRoot:r}},D.prototype.fetchHeaders=function(e,t,i,s,n,o){if(!this.m_fetching[e]){null==n&&(n=this.getFetchCount(e,t));var r,l={axis:e,start:t,count:n,header:i,endHeader:s};this.m_fetching[e]=l,r=null!=o&&null!=o.success?o.success:this.handleHeadersFetchSuccess,this.showStatusText(),this._signalTaskStart(),this.getDataSource().fetchHeaders(l,{success:r,error:this.handleHeadersFetchError},{success:this,error:this})}},D.prototype.isHeaderFetchResponseValid=function(e){var t=e.axis;return null!=this.m_fetching&&e===this.m_fetching[t]},D.prototype.isHeaderFetchResponseInViewport=function(e){if(!this.m_initialized)return!0;var t=e.axis,i=e.start;return("row"===t?this._getLongScrollStart(this.m_currentScrollTop,this.m_prevScrollTop,t):this._getLongScrollStart(this.m_currentScrollLeft,this.m_prevScrollLeft,t)).start===i},D.prototype.handleHeadersFetchSuccess=function(e,t,i,s){var n=this.m_options.getScrollPolicyOptions(),o=n?n.maxRowCount:null,r=n?n.maxColumnCount:null;if(this.isHeaderFetchResponseValid(t)){var l=t.axis;if(this.isLongScroll()&&!this.isHeaderFetchResponseInViewport(t))return this.m_fetching[l]=!1,this.m_headerInvalid=!0,void this._signalTaskEnd();this.m_fetching[l]=!1;var a=t.header,h=t.endHeader,d=t.start,c=this.getDataSource().getCount(l);"column"===l?(null!=e?(this.buildColumnHeaders(a,e,d,c,!1,!1),(e.getCount()<t.count||r&&r>0&&r===d+e.getCount())&&(this.m_stopColumnHeaderFetch=!0)):this.m_stopColumnHeaderFetch=!0,this.m_endColHeader<0?(this._hideHeader(a),this.m_stopColumnHeaderFetch=!0,this.m_startColHeader=0):(this.m_hasColHeader=!0,this._buildHeaderLabels(l,e)),null!=i?(this.buildColumnEndHeaders(h,i,d,c,!1,!1),(i.getCount()<t.count||r&&r>0&&r===d+i.getCount())&&(this.m_stopColumnEndHeaderFetch=!0)):this.m_stopColumnEndHeaderFetch=!0,this.m_endColEndHeader<0?(this._hideHeader(h),this.m_stopColumnEndHeaderFetch=!0,this.m_startColEndHeader=0):(this.m_hasColEndHeader=!0,this._buildHeaderLabels("columnEnd",i))):"row"===l&&(null!=e?(this.buildRowHeaders(a,e,d,c,s,!1),(e.getCount()<t.count||o&&o>0&&o===d+e.getCount())&&(this.m_stopRowHeaderFetch=!0)):this.m_stopRowHeaderFetch=!0,this.m_endRowHeader<0?(this._hideHeader(a),this.m_stopRowHeaderFetch=!0,this.m_startRowHeader=0):(this.m_hasRowHeader=!0,this._buildHeaderLabels(l,e)),null!=i?(this.buildRowEndHeaders(h,i,d,c,s,!1),(i.getCount()<t.count||o&&o>0&&o===d+i.getCount())&&(this.m_stopRowEndHeaderFetch=!0)):this.m_stopRowEndHeaderFetch=!0,this.m_endRowEndHeader<0?(this._hideHeader(h),this.m_stopRowEndHeaderFetch=!0,this.m_startRowEndHeader=0):(this.m_hasRowEndHeader=!0,this._buildHeaderLabels("rowEnd",i))),this.isFetchComplete()&&(this.hideStatusText(),this._shouldInitialize()&&!s&&this._handleInitialization(!0)),this.m_initialized&&this._sizeDatabodyScroller(),this._signalTaskEnd()}else this._signalTaskEnd()},D.prototype.handleHeadersFetchError=function(e,t){var i=t.axis;this.m_fetching[i]=!1,this._signalTaskEnd()},D.prototype.createHeaderContext=function(e,t,i,s,n,o,r,l){var a={axis:e,index:t,data:i};a.component=this,a.datasource=this.m_options.getProperty("data"),a.level=o,a.depth=l,a.extent=r,null!=n&&(a.parentElement=n);for(var h=Object.keys(s),d=0;d<h.length;d++){var c=h[d];a[c]=s[c]}return null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,a),this.m_fixContextCallback.call(this,a)},D.prototype._createLabelContext=function(e,t,i,s,n){var o={axis:e,level:t,data:i};if(o.component=this,o.datasource=this.m_options.getProperty("data"),null!=s&&(o.parentElement=s),null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,o),this._isDataGridProvider()&&null!=n)for(var r=Object.keys(n),l=0;l<r.length;l++){var a=r[l];o[a]=n[a]}return this.m_fixContextCallback.call(this,o)},D.prototype._buildHeaderLabels=function(e,t){if(0===this.m_headerLabels[e].length&&t&&t.getLabel){var i,s=t.getLevelCount();"rowEnd"===e?i=this.getResources().isRTLMode()?"left":"right":"row"===e?i=this.getResources().isRTLMode()?"right":"left":"column"===e?i="top":"columnEnd"===e&&(i="bottom");var n=0;if(s>0)for(var o=0;o<s;o++){var r,l=document.createElement("div"),a=t.getLabel(o);this._isDataGridProvider()&&(r=t.getLabelMetadata(o));var h=this._getLabelDimension(e,o);if(null!=a){var d=this._createLabelContext(e,o,a,l,r);l.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),l.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(l),l[this.getResources().getMappedAttribute("context")]=d;var c=this.m_options.getInlineStyle(e,d,!0);null!=c&&u.applyMergedInlineStyles(l,c,""),l.className=this.getMappedStyle("headerlabel")+" "+this.getMappedStyle(e.toLowerCase()+"headerlabel");var m=this.m_options.getStyleClass(e,d,!0);null!=m&&(l.className+=" "+m),"row"===e||"rowEnd"===e?("rowEnd"===e&&(l.style.height="100%"),this.setElementWidth(l,h),this.setElementDir(l,n,i),this.setElementDir(l,0,"bottom")):("columnEnd"===e&&(l.style.width="100%"),this.setElementHeight(l,h),this.setElementDir(l,n,i),this.setElementDir(l,0,this.getResources().isRTLMode()?"left":"right")),"enable"!==this.m_options.isResizable(e,"width")&&"enable"!==this.m_options.isResizable(e,"height")||this._setAttribute(l,"resizable","true");var _=this.getRendererOrTemplate(e,!0);this._renderContent(_,d,l,a,this.buildLabelTemplateContext(d,r||{})),this.m_headerLabels[e][o]=l}n+=h}}},D.prototype.buildLabelTemplateContext=function(e,t){return{item:{data:e.data,metadata:t.metadata},datasource:e.datasource}},D.prototype.buildHeaderTemplateContext=function(e,t){return{item:{data:e.data,depth:e.depth,extent:e.extent,index:e.index,level:e.level,metadata:t.metadata,axis:e.axis},datasource:e.datasource}},D.prototype.buildCellTemplateContext=function(e,t){return{item:{columnExtent:e.extents.column,columnIndex:e.indexes.column,data:e.data,metadata:t.metadata,rowExtent:e.extents.row,rowIndex:e.indexes.row},datasource:e.datasource,mode:e.mode}},D.prototype.getRendererOrTemplate=function(e,t){var i,s=this.m_options.getRenderer(e,t);return s||(i="cell"===e?"cellTemplate":t?e+"HeaderLabelTemplate":e+"HeaderTemplate",this._getItemTemplateBySlotName(i)||null)},D.prototype.buildColumnHeaders=function(e,t,i,s,n,o){if(null==this.m_columnHeaderLevelCount&&(this.m_columnHeaderLevelCount=t.getLevelCount()),0!==this.m_columnHeaderLevelCount){var r=t.getCount(),l=i>this.m_endColHeader;!1;var a=l?this.m_endColHeaderPixel:this.m_startColHeaderPixel,h=this.m_endColHeader,d=this.m_columnHeaderLevelCount,c=this.getMappedStyle("colheader")+" "+this.getMappedStyle("header"),m=this.getMappedStyle("headercell")+" "+this.getMappedStyle("colheadercell");!1;var u=this.buildAxisHeaders(e,t,"column",i,r,l,!1,null,a,h,d,c,m,!1),_=u.totalHeaderDimension,p=u.totalLevelDimension;if(0===_||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=_/r),this.m_colHeaderHeight||(this.m_colHeaderHeight=p,this.setElementHeight(e,this.m_colHeaderHeight)),l?(this.m_endColHeader=i+r-1,this.m_endColHeaderPixel+=_):(this.m_startColHeader-=r,this.m_startColHeaderPixel-=_),-1===s&&(s=this.m_endColHeader),!this._isCountUnknown("column")&&this._isHighWatermarkScrolling()&&this.m_endColHeader+1>=s?this.m_stopColumnHeaderFetch=!0:this.m_stopColumnHeaderFetch=u.stopFetch,0===this.m_startColHeader&&0!==this.m_startColHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startColHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this.m_endColHeaderPixel-=this.m_startColHeaderPixel,this.m_startColHeaderPixel=0),!this.m_initialized&&this.m_startColHeader>0){var g=Math.round(this.m_avgColWidth*this.m_startColHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startColHeader,g-this.m_startColHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this.m_endColHeaderPixel=g+_,this.m_startColHeaderPixel=g}}},D.prototype.buildColumnEndHeaders=function(e,t,i,s,n,o){if(null==this.m_columnEndHeaderLevelCount&&(this.m_columnEndHeaderLevelCount=t.getLevelCount()),0!==this.m_columnEndHeaderLevelCount){var r=t.getCount(),l=i>this.m_endColEndHeader;!1;var a=l?this.m_endColEndHeaderPixel:this.m_startColEndHeaderPixel,h=this.m_endColEndHeader,d=this.m_columnEndHeaderLevelCount,c=this.getMappedStyle("colendheader")+" "+this.getMappedStyle("endheader"),m=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("colendheadercell");!1;var u=this.buildAxisHeaders(e,t,"columnEnd",i,r,l,!1,null,a,h,d,c,m,!1),_=u.totalHeaderDimension,p=u.totalLevelDimension;if(0===_||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=_/r),this.m_colEndHeaderHeight||(this.m_colEndHeaderHeight=p,this.setElementHeight(e,this.m_colEndHeaderHeight)),l?(this.m_endColEndHeader=i+(r-1),this.m_endColEndHeaderPixel+=_):(this.m_startColEndHeader-=r,this.m_startColEndHeaderPixel-=_),-1===s&&(s=this.m_endColEndHeader),!this._isCountUnknown("column")&&this._isHighWatermarkScrolling()&&this.m_endColEndHeader+1>=s?this.m_stopColumnEndHeaderFetch=!0:this.m_stopColumnEndHeaderFetch=u.stopFetch,0===this.m_startColEndHeader&&0!==this.m_startColEndHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startColEndHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell")),this.m_endColEndHeaderPixel-=this.m_startColEndHeaderPixel,this.m_startColEndHeaderPixel=0),!this.m_initialized&&this.m_startColEndHeader>0){var g=Math.round(this.m_avgColWidth*this.m_startColEndHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startColEndHeader,g-this.m_startColEndHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell")),this.m_endColEndHeaderPixel=g+_,this.m_startColEndHeaderPixel=g}}},D.prototype.buildRowHeaders=function(e,t,i,s,n,o){if(null==this.m_rowHeaderLevelCount&&(this.m_rowHeaderLevelCount=t.getLevelCount()),0!==this.m_rowHeaderLevelCount){var r,l=t.getCount(),a=i>this.m_endRowHeader,h=a?this.m_endRowHeaderPixel:this.m_startRowHeaderPixel;n?(r=e.firstChild.childNodes[i-this.m_startRowHeader],h=this.getElementDir(r,"top")):r=null;var d=this.m_endRowHeader,c=this.m_rowHeaderLevelCount,m=this.getMappedStyle("rowheader")+" "+this.getMappedStyle("header"),u=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell"),_=this.buildAxisHeaders(e,t,"row",i,l,a,n,r,h,d,c,m,u,o),p=_.totalHeaderDimension,g=_.totalLevelDimension;if(o)return _;if(0===p||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=p/l),this.m_rowHeaderWidth||(this.m_rowHeaderWidth=g,this.setElementWidth(e,this.m_rowHeaderWidth)),a){if(-1!==this.m_endRowHeader&&0!==l){var f=e.firstChild.childNodes[this.m_endRowHeader-this.m_startRowHeader];null!=f&&this.m_utils.removeCSSClassName(f,this.getMappedStyle("borderHorizontalNone"))}this.m_endRowHeader=i+(l-1),this.m_endRowHeaderPixel+=p}else n?(i<this.m_startRowHeader&&(this.m_startRowHeader=i,this.m_startRowHeaderPixel=Math.max(0,this.m_startRowHeaderPixel-p)),this.m_endRowHeader+=l,this.m_endRowHeaderPixel=Math.max(0,this.m_endRowHeaderPixel+p),this.pushRowHeadersDown(r,p)):(this.m_startRowHeader=Math.max(0,this.m_startRowHeader-l),this.m_startRowHeaderPixel-=p);if(-1===s&&(s=this.m_endRowHeader),!this._isCountUnknown("row")&&this._isHighWatermarkScrolling()&&this.m_endRowHeader+1>=s?this.m_stopRowHeaderFetch=!0:this.m_stopRowHeaderFetch=_.stopFetch,0===this.m_startRowHeader&&0!==this.m_startRowHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startRowHeaderPixel,"top",this.getMappedStyle("rowheadercell")),this.m_endRowHeaderPixel-=this.m_startRowHeaderPixel,this.m_startRowHeaderPixel=0),!this.m_initialized&&this.m_startRowHeader>0){var C=Math.round(this.m_avgRowHeight*this.m_startRowHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startRowHeader,C-this.m_startRowHeaderPixel,"top",this.getMappedStyle("rowheadercell")),this.m_endRowHeaderPixel=C+p,this.m_startRowHeaderPixel=C}}},D.prototype.buildRowEndHeaders=function(e,t,i,s,n,o){if(null==this.m_rowEndHeaderLevelCount&&(this.m_rowEndHeaderLevelCount=t.getLevelCount()),0!==this.m_rowEndHeaderLevelCount){var r,l=t.getCount(),a=i>this.m_endRowEndHeader,h=a?this.m_endRowEndHeaderPixel:this.m_startRowEndHeaderPixel;n?(r=e.firstChild.childNodes[i-this.m_startRowEndHeader],h=this.getElementDir(r,"top")):r=null;var d=this.m_endRowEndHeader,c=this.m_rowEndHeaderLevelCount,m=this.getMappedStyle("rowendheader")+" "+this.getMappedStyle("endheader"),u=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell"),_=this.buildAxisHeaders(e,t,"rowEnd",i,l,a,n,r,h,d,c,m,u,o);if(o)return _;var p=_.totalHeaderDimension,g=_.totalLevelDimension;if(0===p||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=p/l),this.m_rowEndHeaderWidth||(this.m_rowEndHeaderWidth=g,this.setElementWidth(e,this.m_rowEndHeaderWidth)),a){if(-1!==this.m_endRowEndHeader&&0!==l){var f=e.firstChild.childNodes[this.m_endRowEndHeader-this.m_startRowEndHeader];null!=f&&this.m_utils.removeCSSClassName(f,this.getMappedStyle("borderHorizontalNone"))}this.m_endRowEndHeader=i+(l-1),this.m_endRowEndHeaderPixel+=p}else n?(i<this.m_startRowEndHeader&&(this.m_startRowEndHeader=i,this.m_startRowEndHeaderPixel=Math.max(0,this.m_startRowEndHeaderPixel-p)),this.m_endRowEndHeader+=l,this.m_endRowEndHeaderPixel=Math.max(0,this.m_endRowEndHeaderPixel+p),this.pushRowHeadersDown(r,p)):(this.m_startRowEndHeader=Math.max(0,this.m_startRowEndHeader-l),this.m_startRowEndHeaderPixel-=p);if(-1===s&&(s=this.m_endRowEndHeader),!this._isCountUnknown("row")&&this._isHighWatermarkScrolling()&&this.m_endRowEndHeader+1>=s?this.m_stopRowEndHeaderFetch=!0:this.m_stopRowEndHeaderFetch=_.stopFetch,0===this.m_startRowEndHeader&&0!==this.m_startRowEndHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startRowEndHeaderPixel,"top",this.getMappedStyle("rowendheadercell")),this.m_endRowEndHeaderPixel-=this.m_startRowEndHeaderPixel,this.m_startRowEndHeaderPixel=0),!this.m_initialized&&this.m_startRowEndHeader>0){var C=Math.round(this.m_avgRowHeight*this.m_startRowEndHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startRowEndHeader,C-this.m_startRowEndHeaderPixel,"top",this.getMappedStyle("rowendheadercell")),this.m_endRowEndHeaderPixel=C+p,this.m_startRowEndHeaderPixel=C}}},D.prototype.buildAxisHeaders=function(e,t,i,s,n,o,r,l,a,h,d,c,m,u){var _,p,g=-1!==i.indexOf("column"),f=g?"height":"width",C=!1,y=0,v=0,E=0,w=0;if(!u){if(0===n&&this._isCountUnknown(i))return{totalHeaderDimension:y,totalLevelDimension:v,stopFetch:C=!0};_=e.firstChild,-1===h&&""===e.className&&(e.className=c,e.style[f]="",_.style[f]="")}for(var S=this.getRendererOrTemplate(i),H=document.createDocumentFragment(),x=0;n-x>0;){o||r?(p=s+x,E=g?a+y:0,w=g?0:a+y):(p=s+(n-1-x),E=g?a-y:0,w=g?0:a-y);var b=this.buildLevelHeaders(H,p,0,E,w,o,r,S,t,i,m,d);x+=b.count,y+=b.totalHeaderDimension,b.totalLevelDimension>v&&(v=b.totalLevelDimension)}return u?H:(o?_.appendChild(H):r?_.insertBefore(H,l):_.insertBefore(H,_.firstChild),e.hasChildNodes()||r||e.appendChild(_),this.m_subtreeAttachedCallback(_),{totalHeaderDimension:y,totalLevelDimension:v,stopFetch:C})},D.prototype._renderContent=function(e,t,i,s,n){if(null!=e&&"function"==typeof e){var o=e.call(this,t);null!=o&&(null===o.parentNode||o.parentNode instanceof DocumentFragment?(i.appendChild(o),this.m_isCustomElementCallback()||this.m_subtreeAttachedCallback(o)):null!=o.parentNode||o.toString&&i.appendChild(document.createTextNode(o.toString()))),this._removeFocusFromChildElements(t,i)}else if(null!=e&&"object"==typeof e&&this.m_engine){for(var r=this.m_engine.execute(this.m_root,e,n,null),l=0;l<r.length;l++)i.appendChild(r[l]);this._removeFocusFromChildElements(t,i)}else null!=s&&"object"==typeof s&&Object.prototype.hasOwnProperty.call(s,"data")&&(s=s.data),null==s&&(s=""),i.appendChild(document.createTextNode(s.toString()))},D.prototype._removeFocusFromChildElements=function(e,t){if("edit"!==e.mode){var i=this;this._signalTaskStart(),this.m_contextCallback(t).getBusyContext().whenReady().then(function(){u.disableAllFocusableElements(t),i._signalTaskEnd()})}},D.prototype.buildLevelHeaders=function(e,t,i,s,n,o,r,l,a,h,d,c){var m,_,p,g,f,C,y,v,E,w,S,H,x,b,R,I=0,M=0,L=0,D=0;"row"===h?(m="row",_=this.m_rowHeader,p="width",g=this.m_rowHeaderLevelWidths,f="height",C="top",y=n,v=this.getResources().isRTLMode()?"right":"left",E=s,w=this.m_startRowHeader,S=this.m_endRowHeader):"rowEnd"===h?(m="row",_=this.m_rowEndHeader,p="width",g=this.m_rowEndHeaderLevelWidths,f="height",C="top",y=n,v=this.getResources().isRTLMode()?"left":"right",E=s,w=this.m_startRowEndHeader,S=this.m_endRowEndHeader):"column"===h?(m="column",_=this.m_colHeader,p="height",g=this.m_columnHeaderLevelHeights,f="width",C=this.getResources().isRTLMode()?"right":"left",y=s,v="top",E=n,w=this.m_startColHeader,S=this.m_endColHeader):(m="column",_=this.m_colEndHeader,p="height",g=this.m_columnEndHeaderLevelHeights,f="width",C=this.getResources().isRTLMode()?"right":"left",y=s,v="bottom",E=n,w=this.m_startColEndHeader,S=this.m_endColEndHeader);var A=a.getExtent(t,i),T=A.extent,F=A.more.before,N=A.more.after,O=a.getDepth(t,i);let P;if(F&&t===S+1){for(H=this._getHeaderContainer(t-1,i,0,null,_,c),this._setAttribute(H,"extent",this._getAttribute(H,"extent",!0)+T),P=(x=H.firstChild)[this.getResources().getMappedAttribute("context")],P.extent+=T,I=this.getElementDir(x,p),b=0;b<T;)y+=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(H,t+b,i+O,y,E+I,o,r,l,a,h,d,c):this.buildLevelHeaders(H,t+b,i+O,E+I,y,o,r,l,a,h,d,c)).totalHeaderDimension,L+=R.totalHeaderDimension,D+=R.count,b+=R.count;this.setElementDir(x,this.getElementDir(x,f)+L,f)}else if(N&&t===w-1){for(H=this._getHeaderContainer(t+1,i,0,null,_,c),this._setAttribute(H,"extent",this._getAttribute(H,"extent",!0)+T),this._setAttribute(H,"start",this._getAttribute(H,"start",!0)-T),P=(x=H.firstChild)[this.getResources().getMappedAttribute("context")],P.extent+=T,P.index-=T,I=this.getElementDir(x,p),b=0;b<T;)y-=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(H,t-b,i+O,y,E+I,o,r,l,a,h,d,c):this.buildLevelHeaders(H,t-b,i+O,E+I,y,o,r,l,a,h,d,c)).totalHeaderDimension,L+=R.totalHeaderDimension,D+=R.count,b+=R.count;this.setElementDir(x,this.getElementDir(x,f)+L,f),this.setElementDir(x,y,C)}else{var z=a.getData(t,i),k=a.getMetadata(t,i);x=document.createElement("div"),P=this.createHeaderContext(h,t,z,k,x,i,T,O),x.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),x.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(x),x[this.getResources().getMappedAttribute("context")]=P,x[this.getResources().getMappedAttribute("metadata")]=k,x.extentInfo=A;var B=this.m_options.getInlineStyle(h,P),j=this.m_options.getStyleClass(h,P);null!=B&&u.applyMergedInlineStyles(x,B,""),x.className=d,x.className+=" "+this.getMappedStyle("depth")+O,null!=j&&(x.className+=" "+j),this.setElementDir(x,E,v),this.setElementDir(x,y,C);var W=this._getHeaderDimensions(x,f,p,g,i,m,P.key,O);I=W[p],this.setElementDir(x,I,p);var K=W[f];if(this._setAttribute(x,"depth",O),i!==c-1&&((H=document.createElement("div")).className=this.getMappedStyle("groupingcontainer"),H.appendChild(x),this._setAttribute(H,"start",o||r?t:t-T+1),this._setAttribute(H,"extent",T),this._setAttribute(H,"level",i)),i+O===c)this.setElementDir(x,K,f),L+=K,D+=1,M=I,o||r||(y-=K,this.setElementDir(x,y,C));else{for(b=0;b<T;b++){var U=o||r?t+b:t-b;K=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(H,U,i+O,y,E+I,o,r,l,a,h,d,c):this.buildLevelHeaders(H,U,i+O,E+I,y,o,r,l,a,h,d,c)).totalHeaderDimension,y=o||r?y+K:y-K,L+=K,D+=R.count,b+=R.count-1}M=I,R&&!isNaN(R.totalLevelDimension)&&(M+=R.totalLevelDimension),o||r||this.setElementDir(x,y,C),this.setElementDir(x,L,f)}if("columnEnd"===h&&this.m_addBorderBottom&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderHorizontalSmall")),"rowEnd"===h&&this.m_addBorderRight&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderVerticalSmall")),this._isHeaderResizeEnabled(h,P)&&this._setAttribute(x,"resizable","true"),this.m_isCustomElementCallback()||(null!=H?this.m_root.appendChild(H):this.m_root.appendChild(x)),this._renderContent(l,P,x,z,this.buildHeaderTemplateContext(P,k)),("column"===h||this._isDataGridProvider())&&this._isSortEnabled(h,P)){null!=k.sortDirection&&null==this.m_sortInfo&&(this.m_sortInfo={},this.m_sortInfo.key=k.key,this.m_sortInfo.direction=k.sortDirection,this.m_sortInfo.axis=h);var Y=this._buildSortIcon(P,x,h);x.appendChild(Y),this._setAttribute(x,"sortable","true")}if(this._isRequired(P)){var V=document.createElement("span");this.m_utils.addCSSClassName(V,this.getMappedStyle("iconContainer")),this.m_utils.addCSSClassName(V,this.getMappedStyle("requiredIcon")),V.setAttribute("title",this.getResources().getTranslatedText("tooltipRequired")),x.appendChild(V)}if(this._isParentNode(P)){const e=this._buildDisclosureIcon(P);this._isHierarchicalGroup(P)?this.m_utils.addCSSClassName(x,this.getMappedStyle("hierarchicalGroup")):this.m_utils.addCSSClassName(x,this.getMappedStyle("hierarchicalTree")),x.prepend(e);const t=this._buildSpacer(P);x.prepend(t)}else if(this._isLeafNode(P)){this.m_utils.addCSSClassName(x,this.getMappedStyle("hierarchical"));const e=this._buildSpacer(P);x.prepend(e)}o||r?null!=H?e.appendChild(H):e.appendChild(x):null!=H?e.firstChild?this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("groupingcontainer"))?e.insertBefore(H,e.firstChild):(this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("headercell"))||this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("endheadercell")))&&e.insertBefore(H,e.firstChild.nextSibling):e.appendChild(H):this.m_utils.containsCSSClassName(e,this.getMappedStyle("groupingcontainer"))?e.insertBefore(x,e.firstChild.nextSibling):e.insertBefore(x,e.firstChild)}return"column"===h||"columnEnd"===h?this._isLastColumn(t+(T-1))&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderVerticalNone")):this._isLastRow(t+(T-1))&&!r&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderHorizontalNone")),{totalLevelDimension:M,totalHeaderDimension:L,count:D}},D.prototype._getHeaderDimensions=function(e,t,i,s,n,o,r,l){for(var a={},h=0,d=0;d<l;d++){var c=s[n+d];if(null==c){h=null;break}h+=c}null==h?a=this._computeElementWidthAndHeight(e):a[i]=h,1===l&&(s[n]=a[i]);var m=this.m_sizingManager.getSize(o,r);if(null!=m)return a[t]=m,a;if(""!==e.style[t])return null==a[t]&&(a[t]=this.getElementDir(e,t)),this.m_sizingManager.setSize(o,r,a[t]),a;var u=e.className;return null==a[t]&&(a[t]=this.m_styleClassDimensionMap[t][u],null==a[t]&&(a[t]=this.getElementDir(e,t))),this.m_sizingManager.setSize(o,r,a[t]),this.m_styleClassDimensionMap[t][u]=a[t],a},D.prototype._getHeaderLevelDimension=function(e,t,i,s,n){for(var o=0,r=0;r<n;r++){var l=i[e+r];if(null==l){o=null;break}o+=l}return null!=o||(o=this.getElementDir(t,s),1===n&&(i[e]=o)),o},D.prototype._getHeaderContainer=function(e,t,i,s,n,o){var r;if(null==s?(s=n.firstChild.childNodes,r=0):r=1,i===o-1)return s[0].parentNode;for(;r<s.length;r++){var l=this._getAttribute(s[r],"start",!0),a=this._getAttribute(s[r],"extent",!0),h=this._getAttribute(s[r].firstChild,"depth",!0);if(e>=l&&e<l+a)return t<i+h?s[r]:this._getHeaderContainer(e,t,i+h,s[r].childNodes,n,o)}return null},D.prototype._getHeaderByIndex=function(e,t,i,s,n){var o;if(t<0)return null;if(1===s)return i.firstChild.childNodes[o=e-n];var r=this._getHeaderContainer(e,t,0,null,i,s);return null==r?null:t<=this._getAttribute(r,"level",!0)+this._getAttribute(r.firstChild,"depth",!0)-1?r.firstChild:(o=e-this._getAttribute(r,"start",!0)+1,r.childNodes[o])},D.prototype._getHeadersByIndex=function(e,t,i,s){let n=[],o=1;for(let r=i-1;r>=0;r-=o){let l=this._getHeaderByIndex(e,r,t,i,s);l&&(o=this.getHeaderCellDepth(l),n.push(l))}return n},D.prototype._getAttribute=function(e,t,i){var s=e.getAttribute(this.getResources().getMappedAttribute(t));return i?parseInt(s,10):s},D.prototype._setAttribute=function(e,t,i){e.setAttribute(this.getResources().getMappedAttribute(t),i)},D.prototype.buildDatabody=function(e){var t=document.createElement("div");t.id=this.createSubId("databody"),t.className=this.getMappedStyle("databody")+" "+this.getMappedStyle("scrollbarForce"),t.tabIndex="-1",this.m_databody=t;var i=document.createElement("div");if(i.className=this.getMappedStyle("scroller")+(this.m_utils.isTouchDeviceNotIOS()?" "+this.getMappedStyle("scroller-mobile"):""),t.appendChild(i),!e)if(t.addEventListener?t.addEventListener("scroll",this.handleScroll.bind(this),!1):t.attachEvent("onscroll",this.handleScroll.bind(this)),this._isHighWatermarkScrolling()){this.fetchCells(t,0,0)}else{var s=this,n=this.m_options.getScrollPosition();this._getIndexesFromScrollPosition(n).then(function(e){var i=e.row,n=e.column;s.m_startRow=i,s.m_startCol=n,s.m_fetching.cells=!1,s.fetchCells(t,i,n)}),this.m_fetching.cells=!0}return t},D.prototype._getIndexFromKeyPromise=function(e,t){var i=this;return new Promise(function(s){null!=e||null!=t?i._indexes({row:e,column:t},function(e){s({rowIndexFromKey:e.row,columnIndexFromKey:e.column})}):s({rowIndexFromKey:null,columnIndexFromKey:null})})},D.prototype._getIndexesFromScrollPosition=function(e){var t=this,i=e.rowKey,s=e.columnKey;return this._getIndexFromKeyPromise(i,s).then(function(i){var s={};return null!=i.rowIndexFromKey&&i.rowIndexFromKey>0?s.row=i.rowIndexFromKey:null!=e.rowIndex?s.row=e.rowIndex:null!=e.y?s.row=Math.round(e.y/t.getDefaultRowHeight()):s.row=0,null!=i.columnIndexFromKey&&i.columnIndexFromKey>0?s.column=i.columnIndexFromKey:null!=e.columnIndex?s.column=e.columnIndex:null!=e.x?s.column=Math.round(e.x/t.getDefaultColumnWidth()):s.column=0,s})},D.prototype.getFetchCount=function(e,t){var i=this.getFetchSize(e);if(this._isHighWatermarkScrolling()){var s="row"===e?"maxRowCount":"maxColumnCount",n=this.m_options.getScrollPolicyOptions();n&&null!=n[s]&&n[s]>0&&(i=Math.max(Math.min(i,n[s]-t),0))}return i},D.prototype.fetchCells=function(e,t,i,s,n,o){var r;if(!this.m_fetching.cells){null==s&&(s=this.getFetchCount("row",t)),null==n&&(n=this.getFetchCount("column",i));var l={axis:"row",start:t,count:s},a={axis:"column",start:i,count:n,databody:e};this.m_fetching.cells={rowRange:l,columnRange:a},r=null!=o&&null!=o.success?o.success:this.handleCellsFetchSuccess,this.showStatusText(),this._signalTaskStart(),this.getDataSource().fetchCells([l,a],{success:r,error:this.handleCellsFetchError},{success:this,error:this})}},D.prototype.isCellFetchResponseValid=function(e){if(null==this.m_fetching)return!1;var t=e[0],i=e[1],s=this.m_fetching.cells;return t===s.rowRange&&i===s.columnRange},D.prototype.isLongScroll=function(){return this.m_isLongScroll},D.prototype.isCellFetchResponseInViewport=function(e,t){if(isNaN(this.m_avgRowHeight)||isNaN(this.m_avgColWidth)||null!=this.m_empty||!this.m_initialized)return!0;var i=t[0].start,s=t[1].start,n=this._getLongScrollStart(this.m_currentScrollTop,this.m_prevScrollTop,"row"),o=this._getLongScrollStart(this.m_currentScrollLeft,this.m_prevScrollLeft,"column");return n.start===i&&o.start===s},D.prototype.handleCellsFetchSuccess=function(e,t,i){var s=this.m_options.getScrollPolicyOptions(),n=s?s.maxRowCount:null,o=s?s.maxColumnCount:null,r=this.getDataSource().getCount("row"),l=this.getDataSource().getCount("column");if(void 0===i){if(i=!1,!this.isCellFetchResponseValid(t))return void this._signalTaskEnd();if(this.isLongScroll()&&(!this.isCellFetchResponseInViewport(e,t)||this.m_headerInvalid))return this.m_fetching.cells=!1,this.m_headerInvalid=!1,this.handleLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop),void this._signalTaskEnd();this.m_isLongScroll=!1}var a=t[0],h=a.start,d=e.getCount("row"),c=d>0&&(h>this.m_endRow||h+d<=this.m_startRow);(0===d&&this._isCountUnknown("row")&&a.count>0||c&&this._isHighWatermarkScrolling()&&!this._isCountUnknown("row")&&this.m_endRow+d+1>=r||d<a.count||this._isHighWatermarkScrolling()&&n&&n>0&&h+d===n)&&(this.m_stopRowFetch=!0);var m=t[1],u=m.start,_=e.getCount("column"),p=_>0&&(u>this.m_endCol||u+_===this.m_startCol);(0===_&&this._isCountUnknown("column")&&m.count>0||p&&this._isHighWatermarkScrolling()&&!this._isCountUnknown("column")&&this.m_endCol+_+1>=l||_<m.count||this._isHighWatermarkScrolling()&&o&&o>0&&u+_===o)&&(this.m_stopColumnFetch=!0);var g=this.m_databody;null==g&&(g=m.databody);var f,C,y,v,E,w,S,H,x,b,R=g.firstChild;if(c||i){if(f=!(i||!(h>=this.m_startRow)))C=this.m_endRowPixel;else if(i){var I=this._getCellByIndex({row:h+d,column:this.m_startCol});C=this.getElementDir(I,"top")}else C=this.m_startRowPixel;y=u>=this.m_startCol?this.m_startColPixel:this.m_endColPixel,v=document.createDocumentFragment(),w=(E=this._addCellsToFragment(v,e,h,C,u,y)).totalColumnWidth,S=E.totalRowHeight,H=E.avgWidth,x=S/d,this._populateDatabody(R,v),f?(-1!==this.m_endRow&&0!==d&&this._highlightCellsAlongAxis(this.m_endRow,"row","index","remove",["borderHorizontalNone"]),this.m_endRow=h+(d-1),this.m_endRowPixel+=S):i?(h<this.m_startRow&&(this.m_startRow=h,this.m_startRowPixel=Math.max(0,this.m_startRowPixel-S)),this.m_endRow+=d,this.m_endRowPixel+=S,this.pushRowsDown(h+d,S)):(this.m_startRow-=d,this.m_startRowPixel-=S)}else p&&(y=(f=u>=this.m_startCol)?this.m_endColPixel:this.m_startColPixel,C=h>=this.m_startRow?this.m_startRowPixel:this.m_endRowPixel,v=document.createDocumentFragment(),E=this._addCellsToFragment(v,e,h,C,u,y),this._populateDatabody(R,v),w=E.totalColumnWidth);if(null==H||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=H),null==x||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=x),p&&(u<this.m_startCol?(this.m_startCol-=_,this.m_startColPixel-=w):(this.m_endCol=u+(_-1),this.m_endColPixel+=w)),this._sizeDatabodyScroller(),this.m_endCol>=0&&this.m_endRow>=0?this.m_hasCells=!0:(this.m_startCol=0,this.m_startRow=0),0===this.m_startCol&&0!==this.m_startColPixel&&(this._shiftCellsAlongAxis("column",-this.m_startColPixel,0,!0),this.m_endColPixel-=this.m_startColPixel,this.m_startColPixel=0),0===this.m_startRow&&0!==this.m_startRowPixel&&(this._shiftCellsAlongAxis("row",-this.m_startRowPixel,0,!0),this.m_endRowPixel-=this.m_startRowPixel,this.m_startRowPixel=0),!this.m_initialized&&this.m_startCol>0&&(b=Math.round(this.m_avgColWidth*this.m_startCol),this._shiftCellsAlongAxis("column",b-this.m_startColPixel,this.m_startCol,!0),this.m_endColPixel=b+w,this.m_startColPixel=b),!this.m_initialized&&this.m_startRow>0&&(b=Math.round(this.m_avgRowHeight*this.m_startRow),this._shiftCellsAlongAxis("row",b-this.m_startRowPixel,this.m_startRow,!0),this.m_endRowPixel=b+S,this.m_startRowPixel=b),this.m_fetching.cells=!1,this.isFetchComplete()){if(this.hideStatusText(),this.m_initialized)this._checkScroll&&this._checkScrollPosition();else{if(this.m_utils.isTouchDeviceNotIOS()&&Object.prototype.hasOwnProperty.call(window,"WebKitCSSMatrix")){const e="translate3d(0, 0, 0)";R.style.transform=e,null!=this.m_rowHeader&&(this.m_rowHeader.firstChild.style.transform=e),null!=this.m_colHeader&&(this.m_colHeader.firstChild.style.transform=e),null!=this.m_rowEndHeader&&(this.m_rowEndHeader.firstChild.style.transform=e),null!=this.m_colEndHeader&&(this.m_colEndHeader.firstChild.style.transform=e)}this._updateScrollPosition(this.m_options.getScrollPosition())}if(null!=this.m_scrollIndexAfterFetch?this.scrollToIndex(this.m_scrollIndexAfterFetch):null!=this.m_scrollHeaderAfterFetch?this.scrollToHeader(this.m_scrollHeaderAfterFetch):this.isActionableMode()||null==this._getActiveElement()||this.m_utils.containsCSSClassName(this._getActiveElement(),this.getMappedStyle("focus"))||(!0!==this.m_shouldFocus&&(this.m_shouldFocus=!1),this._highlightActive(),this._manageMoveCursor()),this._isSelectionEnabled()&&this.applySelection(h,h+d,u,u+_),this.populateAccInfo(),this._shouldInitialize())this._handleInitialization(!0);else if(this.m_initialized){var M;(!0===this.m_resizeRequired||this.m_endRowPixel-S<this.getElementHeight(g))&&this.resizeGrid(),c?f?M="top":i||(M="bottom"):p&&(M=u===this.m_startCol?"right":"left"),this._cleanupViewport(M),this.fillViewport(),this.isFetchComplete()&&this.fireEvent("ready",{})}}this._isSelectionEnabled()&&this.isMultipleSelection()&&this._resetHeaderHighLight(),this._signalTaskEnd()},D.prototype._setZIndexBefore=function(e,t,i,s){if("row"===e)for(var n=this.m_startRow,o=this.m_currentScrollTop,r=this.m_rowHeader,l=this.m_rowHeaderLevelCount,a=this.m_startRowHeader,h=this.m_rowEndHeader,d=this.m_rowEndHeaderLevelCount,c=this.m_startRowEndHeader,m=t;m>=n;m--){var u,_=this._getAxisCellsByIndex(m,e);if(this.getElementDir(_[0],"top")<o)break;for(var p=0;p<_.length;p++)this.changeStyleProperty(_[p],this.getCssSupport("z-index"),10);i&&(u=this._getHeaderByIndex(m,0,r,l,a),this.changeStyleProperty(u,this.getCssSupport("z-index"),10)),s&&(u=this._getHeaderByIndex(m,0,h,d,c),this.changeStyleProperty(u,this.getCssSupport("z-index"),10))}},D.prototype._onTransitionEnd=function(e,t,i){var s;function n(){s&&(clearTimeout(s),s=void 0),e.removeEventListener("transitionend",n),t()}e.addEventListener("transitionend",n),s=setTimeout(n,i+100)},D.prototype._insertRowsWithAnimation=function(e,t,i,s,n,o,r,l){var a,h,d,c,m,u,_,p,g,f,C=this,y=0,v=0,E=0;C._signalTaskStart();var w=s>this.m_endRow,S=this.m_databody.firstChild,H=null!=t,x=null!=i;for(s>0&&(E=s-1,f=this._getAxisCellsByIndex(s-1,"row"),y=(v=this.getElementDir(f[0],"top"))+this.getElementHeight(f[0])),this._setZIndexBefore("row",E,H,x),H&&(d=(h=this.m_rowHeader.firstChild).childNodes[s-this.m_startRow-1]),x&&(m=(c=this.m_rowEndHeader.firstChild).childNodes[s-this.m_startRow-1]),a=0;a<e.childNodes.length;a++){var b=e.childNodes[a];p=v-(_=y+this.getElementDir(b,"top"))-this.getElementHeight(b),this.setElementDir(b,_,"top"),this.addTransformMoveStyle(b,0,0,"linear",0,p,0)}if(H)for(a=0;a<t.childNodes.length;a++)u=t.childNodes[a],p=v-(_=y+this.getElementDir(u,"top"))-this.getElementHeight(u),this.setElementDir(u,_,"top"),this.addTransformMoveStyle(u,0,0,"linear",0,p,0);if(x)for(a=0;a<i.childNodes.length;a++)g=i.childNodes[a],p=v-(_=y+this.getElementDir(g,"top"))-this.getElementHeight(g),this.setElementDir(g,_,"top"),this.addTransformMoveStyle(g,0,0,"linear",0,p,0);for(a=s;a<=this.m_endRow;a++){var R=this._getAxisCellsByIndex(a-this.m_startRow,"row");_=o+this.getElementDir(R[0],"top"),p=-o;for(var I=0;I<R.length;I++)this.setElementDir(R[I],_,"top"),this.addTransformMoveStyle(R[I],0,0,"linear",0,p,0);H&&(u=h.childNodes[a],this.setElementDir(u,_,"top"),this.addTransformMoveStyle(u,0,0,"linear",0,p,0)),x&&(g=c.childNodes[a],this.setElementDir(g,_,"top"),this.addTransformMoveStyle(g,0,0,"linear",0,p,0))}this._modifyAxisCellContextIndex("row",s,this.m_endRow-s+1,n),this.m_endRow+=n,this.m_endRowPixel+=o,H&&(this.m_endRowHeader+=t.childNodes.length,this.m_endRowHeaderPixel+=o),x&&(this.m_endRowEndHeader+=i.childNodes.length,this.m_endRowEndHeaderPixel+=o),S.appendChild(e),w?(H&&h.appendChild(t),x&&c.appendChild(i)):(H&&h.insertBefore(t,d.nextSibling),x&&c.insertBefore(i,m.nextSibling)),this.setElementHeight(S,this.getElementHeight(S)+o),this.resizeGrid(),this.updateRowBanding(),this._refreshDatabodyMap(),this._isSelectionEnabled()&&this.applySelection(s,s+n,r,r+l);var M=this._getCellByIndex(this.createIndex(s+(n-1),this.m_endCol));this.m_animating=!0;var L=C.m_processingEventQueue?1:D.EXPAND_ANIMATION_DURATION;this._onTransitionEnd(M,function(){C._handleAnimationEnd()},L),setTimeout(function(){for(var e=D.EXPAND_ANIMATION_DURATION,t=s;t<=C.m_endRow;t++){for(var i=C._getAxisCellsByIndex(t,"row"),n=0;n<i.length;n++)C.addTransformMoveStyle(i[n],e+"ms",0,"ease-out",0,0,0);H&&C.addTransformMoveStyle(h.childNodes[t],e+"ms",0,"ease-out",0,0,0),x&&C.addTransformMoveStyle(c.childNodes[t],e+"ms",0,"ease-out",0,0,0)}},0)},D.prototype._addCellsToFragment=function(e,t,i,s,n,o){for(var r=this.getResources().isRTLMode()?"right":"left",l=this.getRendererOrTemplate("cell"),a=this.m_options.getColumnBandingInterval(),h=this.m_options.getRowBandingInterval(),d=this.m_options.getHorizontalGridlines(),c=this.m_options.getVerticalGridlines(),m=t.getCount("row"),_=t.getCount("column"),p=i>=this.m_startRow,g=n>=this.m_startCol,f=0,C=s,y=[],v=[],E=0;E<m;E+=1){for(var w,S,H,x,b=o,R=p?i+E:i+(m-1-E),I=Math.floor(R/h)%2==1,M=0;M<_;M+=S.column){var L=0;w=0;var D,A=g?n+M:n+(_-1-M);S={row:(D=t.getExtent?t.getExtent(this.createIndex(R,A)):{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}).row.extent,column:D.column.extent},g||(A=A-S.column+1);var T=p?R:R-S.row+1,F=this.createIndex(T,A);if(y[E]&&y[E][M])L=y[E][M].width,b=g?b+L:b-L;else{var N=this._patchExistingCells(D,A,T,y);if(N)L=N.width;else{var O=t.getData(this.createIndex(T,A)),P=t.getMetadata(this.createIndex(T,A));H=document.createElement("div"),x=this.createCellContext(F,O,P,H,S),H.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),H.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(H),H[this.getResources().getMappedAttribute("context")]=x,H[this.getResources().getMappedAttribute("metadata")]=P;var z=this.m_options.getInlineStyle("cell",x);null!=z&&u.applyMergedInlineStyles(H,z,""),""!==H.style.height&&(H.style.height=""),""!==H.style.width&&(H.style.width=""),this.m_utils.addCSSClassName(H,this.getMappedStyle("cell")),this.m_utils.addCSSClassName(H,this.getMappedStyle("formcontrol")),u.isIos()&&(H.setAttribute("aria-labelledby",this.getLabelledBy(this._createActiveObject(H),null,H,!0)),H.setAttribute("role","text")),(I||Math.floor(A/a)%2==1)&&this.m_utils.addCSSClassName(H,this.getMappedStyle("banded"));var k,B=this.m_options.getStyleClass("cell",x);for(null!=B&&(H.className+=" "+B),k=0;k<S.row;k++){var j=0===k?x.keys.row:this._getKey(this._getHeaderByIndex(T+k,0,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),"row");v[E+k]=this._getCellDimension(H,T+k,j,"row","height"),w+=v[E+k]}for(this.setElementHeight(H,w),k=0;k<S.column;k++){var W=0===k?x.keys.column:this._getKey(this._getHeaderByIndex(A+k,0,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),"column");L+=this._getCellDimension(H,A,W,"column","width")}this.setElementWidth(H,L),("hidden"===c||this._isLastColumn(A+(S.column-1))&&(this.getRowHeaderWidth()+b+L>=this.getWidth()||-1!==this.m_endRowEndHeader))&&this.m_utils.addCSSClassName(H,this.getMappedStyle("borderVerticalNone")),("hidden"===d||this._isLastRow(T+(S.row-1))&&(this.getRowBottom(H,C+w)>=this.getHeight()||-1!==this.m_endColEndHeader))&&this.m_utils.addCSSClassName(H,this.getMappedStyle("borderHorizontalNone")),p?this.setElementDir(H,C,"top"):this.setElementDir(H,C-w,"top"),g?this.setElementDir(H,b,r):this.setElementDir(H,b-L,r),this.m_isCustomElementCallback()&&this.m_root.appendChild(H),this._renderContent(l,x,H,O,this.buildCellTemplateContext(x,P)),e.appendChild(H)}this._updateTempArray(y,{width:L},E,M,S.row,S.column),b=g?b+L:b-L,0===E&&(f+=L)}}w=v[E],C=p?C+w:C-w,w}return{avgWidth:f/_,totalRowHeight:v.reduce(function(e,t){return e+t},0),totalColumnWidth:f}},D.prototype._updateCellDimension=function(e,t,i,s,n,o,r,l){var a,h,d,c,m,u=0,_="width"===r?"height":"width",p=this._getCellByIndex(this.createIndex(s,i)),g=this.getElementDir(p,r),f=p[this.getResources().getMappedAttribute("context")];f.extents[o]+=e,"row"===o?(a=s,h=this.m_rowHeader,d=this.m_rowHeaderLevelCount,c=this.m_startRowHeader):(a=i,h=this.m_colHeader,d=this.m_columnHeaderLevelCount,c=this.m_startColHeader);for(var C=1;C<=e;C++){var y=this._getKey(this._getHeaderByIndex(l?a-C:a+C,0,h,d,c),o);u+=this._getCellDimension(p,l?a-C:a+C,y,o,r);for(var v=0;v<t;v++){var E,w;"row"===o?(E=l?s-C:s+C,w=i+v):(E=s+v,w=l?i-C:i+C),this._addIndexToDatabodyMap(this.createIndex(E,w),p.id)}}l&&(m="width"===r?this.getResources().isRTLMode()?"right":"left":"top",this.setElementDir(p,this.getElementDir(p,m)-u,m),f.indexes[o]-=e);this.setElementDir(p,g+u,r);var S={};return S[r]=u,S[_]=this.getElementDir(p,_),S.cell=p,S},D.prototype._patchExistingCells=function(e,t,i,s){var n=e.column.extent,o=e.row.extent,r=e.row.more.before,l=e.row.more.after,a=e.column.more.before,h=e.column.more.after;return t-1===this.m_endCol&&a?this._updateCellDimension(n,o,this.m_endCol,i,s,"column","width",!1):i-1===this.m_endRow&&r?this._updateCellDimension(o,n,t,this.m_endRow,s,"row","height",!1):t+n===this.m_startCol&&h?this._updateCellDimension(n,o,this.m_startCol,i,s,"column","width",!0):!(i+o!==this.m_startRow||!l)&&this._updateCellDimension(o,n,t,this.m_startRow,s,"row","height",!0)},D.prototype._updateTempArray=function(e,t,i,s,n,o){for(var r=0;r<n;r++){null==e[i+r]&&(e[i+r]=[]);for(var l=0;l<o;l++)e[i+r][s+l]=t}},D.prototype._getCellDimension=function(e,t,i,s,n){var o,r,l;if("row"===s?(o=this.getMappedStyle("rowheadercell")+" "+this.getMappedStyle("headercell"),r=this.m_endRowHeader):"column"===s&&(o=this.getMappedStyle("colheadercell")+" "+this.getMappedStyle("headercell"),r=this.m_endColHeader),-1===r){var a=this.createHeaderContext(s,t,null,{key:i},null,0,0,1),h=this.m_options.getInlineStyle(s,a),d=this.m_options.getStyleClass(s,a);l=document.createElement("div"),null!=h&&u.applyMergedInlineStyles(l,h,""),l.className=o+" "+d}else l=e;return this._getHeaderDimension(l,i,s,n)},D.prototype._getLabelDimension=function(e,t){let i,s,n,o,r;"column"===e?(i=this.m_columnHeaderLevelHeights,s="height",n=this.m_startColHeader,o=this.m_columnHeaderLevelCount,r=this.m_colHeader):"columnEnd"===e?(i=this.m_columnEndHeaderLevelHeights,s="height",n=this.m_startColEndHeader,o=this.m_columnEndHeaderLevelCount,r=this.m_colEndHeader):"row"===e?(i=this.m_rowHeaderLevelWidths,s="width",n=this.m_startRowHeader,o=this.m_rowHeaderLevelCount,r=this.m_rowHeader):(i=this.m_rowEndHeaderLevelWidths,s="width",n=this.m_startRowEndHeader,o=this.m_rowEndHeaderLevelCount,r=this.m_rowEndHeader);let l=i[t];if(null!=l)return l;const a=this._getHeaderByIndex(n,t,r,o,n),h=a[this.getResources().getMappedAttribute("context")],d=h.level,c=h.depth,m=this.getElementDir(a,s);let u=0,_=0;for(let e=d;e<d+c;e++){let t=i[e];null!=t?u+=t:_+=1}return 0===_?m:(l=Math.max(0,Math.round((m-u)/_)),i[t]=l,l)},D.prototype._modifyAndPushCells=function(e,t,i,s,n,o){let r=this.getResources().isRTLMode()?"right":"left",l="row"===i?"top":r,a=this.getResources().getMappedAttribute("context"),h=o?1:-1,d=function(i,s,n){i.forEach(i=>{let r=s(i),l=0;if(o)r>=e[0]&&(l=e.length);else for(;l<e.length&&!(e[l]>=r);l++);if(l>0){let e=t.length?t.slice(0,l).reduce((e,t)=>e+t):0;e*=h,l*=h,n(i,e,l,r)}})};d(this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),e=>e[a].indexes[i],(e,t,s)=>{if(0!==t){let i=this.getElementDir(e,l)+t;this.setElementDir(e,i,l)}e[a].indexes[i]+=s}),d(s.querySelectorAll("."+this.getMappedStyle("headercell")),e=>e[a].index,(e,t,i)=>{if(0!==t){let i=this.getElementDir(e,l)+t;this.setElementDir(e,i,l)}e[a].index+=i}),d(s.querySelectorAll("."+this.getMappedStyle("groupingcontainer")),e=>this._getAttribute(e,"start",!0),(e,t,i,s)=>{this._setAttribute(e,"start",s+i)}),d(n.querySelectorAll("."+this.getMappedStyle("endheadercell")),e=>e[a].index,(e,t,i)=>{if(0!==t){let i=this.getElementDir(e,l)+t;this.setElementDir(e,i,l)}e[a].index+=i}),d(n.querySelectorAll("."+this.getMappedStyle("groupingcontainer")),e=>this._getAttribute(e,"start",!0),(e,t,i,s)=>{this._setAttribute(e,"start",s+i)})},D.prototype.pushRowsDown=function(e,t){for(;e<=this.m_endRow;){var i=this._getAxisCellsByIndex(e,"row");if(i.length>0)for(var s=0;s<i.length;s++){var n=i[s],o=this.getElementDir(n,"top")+t;n.style.top=o+"px"}e+=1}},D.prototype.pushRowsUp=function(e,t){this.pushRowsDown(e,-t)},D.prototype.pushRowHeadersDown=function(e,t){for(;e;){var i=this.getElementDir(e,"top")+t;e.style.top=i+"px",e=e.nextSibling}},D.prototype.pushRowHeadersUp=function(e,t){this.pushRowHeadersDown(e,-t)},D.prototype.createCellContext=function(e,t,i,s,n){var o={parentElement:s,indexes:e,cell:t};this._isDataGridProvider()?o.data=t:o.data=null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"data")?t.data:t,o.component=this,o.datasource=this.m_options.getProperty("data"),o.mode="navigation",o.extents=n;for(var r=Object.keys(i),l=0;l<r.length;l++){var a=r[l];o[a]=i[a]}return null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,o),this.m_fixContextCallback.call(this,o)},D.prototype._createUniqueId=function(e){return this._uniqueIdCallback(e,!1)},D.prototype.getRowHeaderWidth=function(){return null===this.m_rowHeaderWidth?0:this.m_rowHeaderWidth},D.prototype.getColumnHeaderHeight=function(){return null===this.m_colHeaderHeight?0:this.m_colHeaderHeight},D.prototype.getRowEndHeaderWidth=function(){return-1===this.m_endRowEndHeader?0:this.m_rowEndHeaderWidth},D.prototype.getColumnEndHeaderHeight=function(){return-1===this.m_endColEndHeader?0:this.m_colEndHeaderHeight},D.prototype.getRowBottom=function(e,t){var i=this.getColumnHeaderHeight();if(null!=t)return i+t;var s=this.getElementDir(e,"top"),n=this.calculateRowHeight(e);return isNaN(s)||isNaN(n)?i:i+s+n},D.prototype.handleCellsFetchError=function(e,t){if(this.m_fetching.cells=!1,this.hideStatusText(),null==this.m_databody.firstChild)this._shouldInitialize()&&this._handleInitialization(!0);else{var i=t[0],s=t[1];s.start+(s.count-1)>this.m_endCol&&(this.m_stopColumnFetch=!0,this.m_stopColumnHeaderFetch=!0,this.m_stopColumnEndHeaderFetch=!0),i.start+(i.count-1)>this.m_endRow&&(this.m_stopRowFetch=!0,this.m_stopRowHeaderFetch=!0,this.m_stopRowEndHeaderFetch=!0)}},D.prototype.showStatusText=function(){var e=this;"block"===this.m_status.style.display||this.m_showStatusTimeout||(this.m_showStatusTimeout=setTimeout(function(){var t=e.getResources().getTranslatedText("msgFetchingData");e.m_status.setAttribute("aria-label",t),e.m_status.style.display="block";var i=e.getWidth()/2-e.m_status.offsetWidth/2,s=e.getHeight()/2-e.m_status.offsetHeight/2;e.m_status.style.left=i+"px",e.m_status.style.top=s+"px",e.m_showStatusTimeout=null},this.getShowStatusDelay()))},D.prototype.getShowStatusDelay=function(){var e=_.getCSSTimeUnitAsMillis(this.getResources().getDefaultOption("showIndicatorDelay"));return isNaN(e)?0:e},D.prototype.hideStatusText=function(){this.m_showStatusTimeout&&(clearTimeout(this.m_showStatusTimeout),this.m_showStatusTimeout=null),this.m_status.style.display="none"},D.prototype._isFocusableElementBeforeCell=function(e){if(null==e||e===this.getRootElement()||this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return!1;var t=e.tagName;return!!("INPUT"===t||"TEXTAREA"===t||"SELECT"===t||"BUTTON"===t||"A"===t||this.m_utils.containsCSSClassName(e,this.getMappedStyle("active"))||null!=e.getAttribute("tabIndex")&&parseInt(e.getAttribute("tabIndex"),10)>=0&&this.findCell(e)!==e)||this._isFocusableElementBeforeCell(e.parentNode)},D.prototype._setFocusToFirstFocusableElement=function(e,t){u.enableAllFocusableElements(e);var i=u.getFocusableElementsInNode(e);if(i.length>0){var s=i[0];if(s.focus(),t&&t.preventDefault(),s.setSelectionRange&&s.value)try{s.setSelectionRange(s.value.length,s.value.length)}catch(e){}return!0===this._overwriteFlag&&"function"==typeof i[0].select&&s.select(),!0}return!1},D.prototype.handleScroll=function(e){if(this._clearScrollPositionTimeout(),this.m_handleScrollOverflow||(this.m_hasVerticalScroller||this.m_hasHorizontalScroller||(this.m_databody.style.overflow="hidden"),this.m_handleScrollOverflow=!0),this.m_animating)e.preventDefault();else if(!this.m_utils.isTouchDeviceNotIOS())if(!0!==this.m_silentScroll){var t;e||(e=window.event),t=e.target?e.target:e.srcElement;var i=this.m_utils.getElementScrollLeft(t),s=t.scrollTop;this.scrollTo(i,s)}else this.m_silentScroll=!1},D.prototype._getMaxScrollWidth=function(){return this._isCountUnknownOrHighwatermark("column")&&!this.m_stopColumnFetch?Number.MAX_VALUE:this.m_scrollWidth},D.prototype._getMaxScrollHeight=function(){return this._isCountUnknownOrHighwatermark("row")&&!this.m_stopRowFetch?Number.MAX_VALUE:this.m_scrollHeight},D.prototype.scroll=function(e){if(null!=e.position){var t={};t.x=Math.max(0,Math.min(this.m_scrollWidth,e.position.scrollX)),t.y=Math.max(0,Math.min(this.m_scrollHeight,e.position.scrollY)),this._scrollToScrollPositionObject(t)}},D.prototype.scrollDelta=function(e,t){this._adjustScrollerSize();var i=Math.max(0,Math.min(this._getMaxScrollWidth(),this.m_currentScrollLeft-e)),s=Math.max(0,Math.min(this._getMaxScrollHeight(),this.m_currentScrollTop-t));this._initiateScroll(i,s)},D.prototype.adjustTouchScroll=function(e,t){return this.m_utils.isTouchDevice()&&0!==e&&0!==t&&(Math.abs(e)>Math.abs(t)?(t=0,this.m_extraScrollOverY=null):(e=0,this.m_extraScrollOverX=null)),[e,t]},D.prototype._initiateScroll=function(e,t){this.m_utils.isTouchDeviceNotIOS()?this.scrollTo(e,t):(this.m_utils.setElementScrollLeft(this.m_databody,e),this.m_databody.scrollTop=t)},D.prototype._initiateScrollOnAttached=function(){this._initiateScroll(this.m_currentScrollLeft,this.m_currentScrollTop)},D.prototype._disableTouchScrollAnimation=function(){this.m_databody.firstChild.style.transitionDuration="0ms",this.m_rowHeader.firstChild.style.transitionDuration="0ms",this.m_colHeader.firstChild.style.transitionDuration="0ms",this.m_rowEndHeader.firstChild.style.transitionDuration="0ms",this.m_colEndHeader.firstChild.style.transitionDuration="0ms"},D.prototype._shouldLongScroll=function(e,t){return!this._isHighWatermarkScrolling()&&(e+this.getViewportWidth()<this._getMaxLeftPixel()||t+this.getViewportHeight()<this._getMaxTopPixel()||e>this._getMaxRightPixel()||t>this._getMaxBottomPixel())},D.prototype.scrollTo=function(e,t){if(this.m_prevScrollLeft=this.m_currentScrollLeft,this.m_currentScrollLeft=e,this.m_prevScrollTop=this.m_currentScrollTop,this.m_currentScrollTop=t,this._checkScroll=!1,this.m_utils.isTouchDeviceNotIOS()||(this._shouldLongScroll(e,t)?this.handleLongScroll(e,t):this.fillViewport(),this._checkScroll=!0),this._syncScroller(),this._adjustScrollerSize(),null!=this.m_cellToFocus){var i=this.m_cellToFocus;this.m_cellToFocus=null,this._setActive(i,this._createActiveObject(i),null,!1,!1,!0)}null!=this.m_scrollIndexAfterFetch&&this._isInViewport(this.m_scrollIndexAfterFetch)===D.INSIDE&&(this._isDatabodyCellActive()&&this.m_scrollIndexAfterFetch.row===this.m_active.indexes.row&&this.m_scrollIndexAfterFetch.column===this.m_active.indexes.column&&this._highlightActive(),this.m_scrollIndexAfterFetch=null),null!=this.m_scrollHeaderAfterFetch&&(this._isDatabodyCellActive()||this.m_scrollHeaderAfterFetch.axis!==this.m_active.axis||this.m_scrollHeaderAfterFetch.index!==this.m_active.index||this.m_scrollHeaderAfterFetch.level!==this.m_active.level||this._highlightActive(),this.m_scrollHeaderAfterFetch=null),this.m_utils.isTouchDeviceNotIOS()||this.m_prevScrollTop===t&&this.m_prevScrollLeft===e||this.fireEvent("scroll",{event:null,ui:{scrollX:e,scrollY:t}}),!this.m_utils.isTouchDeviceNotIOS()&&this.isFetchComplete()&&this._checkScrollPosition()},D.prototype._scrollTransitionEnd=function(){this._isSelectionEnabled()&&this._scrollTouchSelectionAffordance(),this.fireEvent("scroll",{event:null,ui:{scrollX:this.m_currentScrollLeft,scrollY:this.m_currentScrollTop}}),this._shouldLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop)?this.handleLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop):this.fillViewport(),this._checkScroll=!0,this.isFetchComplete()&&this._checkScrollPosition()},D.prototype._bounceBack=function(){var e=this.m_currentScrollLeft,t=this.m_currentScrollTop,i=this.m_databody.firstChild,s=this.m_colHeader.firstChild,n=this.m_rowHeader.firstChild,o=this.m_colEndHeader.firstChild,r=this.m_rowEndHeader.firstChild;i.style.transitionDuration=D.BOUNCE_ANIMATION_DURATION+"ms",n.style.transitionDuration=D.BOUNCE_ANIMATION_DURATION+"ms",r.style.transitionDuration=D.BOUNCE_ANIMATION_DURATION+"ms",s.style.transitionDuration=D.BOUNCE_ANIMATION_DURATION+"ms",o.style.transitionDuration=D.BOUNCE_ANIMATION_DURATION+"ms",null==this.m_scrollTransitionEnd&&(this.m_scrollTransitionEnd=this._scrollTransitionEnd.bind(this)),this._onTransitionEnd(i,this.m_scrollTransitionEnd,D.BOUNCE_ANIMATION_DURATION),this.getResources().isRTLMode()?(i.style.transform="translate3d("+e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+e+"px, 0, 0)",o.style.transform="translate3d("+e+"px, 0, 0)"):(i.style.transform="translate3d("+-e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+-e+"px, 0, 0)",o.style.transform="translate3d("+-e+"px, 0, 0)"),n.style.transform="translate3d(0, "+-t+"px, 0)",r.style.transform="translate3d(0, "+-t+"px, 0)",this.m_extraScrollOverX=null,this.m_extraScrollOverY=null},D.prototype._syncScroller=function(){var e=this.m_currentScrollLeft,t=this.m_currentScrollTop,i=this.m_databody.firstChild,s=this.m_colHeader.firstChild,n=this.m_rowHeader.firstChild,o=this.m_colEndHeader.firstChild,r=this.m_rowEndHeader.firstChild;if(this.m_utils.isTouchDeviceNotIOS()&&Object.prototype.hasOwnProperty.call(window,"WebKitCSSMatrix"))this._checkScroll=!1,null!=this.m_extraScrollOverX||null!=this.m_extraScrollOverY?(null!=this.m_extraScrollOverX?e+=this.m_extraScrollOverX:t+=this.m_extraScrollOverY,null==this.m_bounceBack&&(this.m_bounceBack=this._bounceBack.bind(this)),this._onTransitionEnd(i,this.m_bounceBack,500)):"0ms"===i.style.transitionDuration?this._scrollTransitionEnd():(null==this.m_scrollTransitionEnd&&(this.m_scrollTransitionEnd=this._scrollTransitionEnd.bind(this)),this._onTransitionEnd(i,this.m_scrollTransitionEnd,i.style.transitionDuration)),this.getResources().isRTLMode()?(i.style.transform="translate3d("+e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+e+"px, 0, 0)",o.style.transform="translate3d("+e+"px, 0, 0)"):(i.style.transform="translate3d("+-e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+-e+"px, 0, 0)",o.style.transform="translate3d("+-e+"px, 0, 0)"),n.style.transform="translate3d(0, "+-t+"px, 0)",r.style.transform="translate3d(0, "+-t+"px, 0)";else{var l=this.getResources().isRTLMode()?"right":"left";this.setElementDir(s,-e,l),this.setElementDir(o,-e,l),this.setElementDir(n,-t,"top"),this.setElementDir(r,-t,"top")}},D.prototype._adjustScrollerSize=function(){var e=this.m_databody.firstChild,t=this.getElementHeight(e),i=this.getElementWidth(e),s=this._getEmptyElement(),n=0,o=0;s&&(n=this.getElementHeight(s),o=this.getElementWidth(s)),(this._getMaxBottomPixel()>t||this.getDataSource().getCount("row")===this._getMaxBottom()+1&&!this._isCountUnknown("row")&&this._getMaxBottom()>-1)&&this.setElementHeight(e,Math.max(this._getMaxBottomPixel(),n)),(this._getMaxRightPixel()>i||this.getDataSource().getCount("column")===this._getMaxRight()+1&&!this._isCountUnknown("column")&&this._getMaxRight()>-1)&&this.setElementWidth(e,Math.max(this._getMaxRightPixel(),o))},D.prototype._getLongScrollStart=function(e,t,i){var s,n,o,r,l,a,h,d;if(t!==e){"row"===i?(s=this.getElementHeight(this.m_databody.firstChild),n=this.m_utils._getMaxDivHeightForScrolling(),o=this._getMaxScrollHeight(),r=this.m_avgRowHeight,l=this.m_hasHorizontalScroller?this.m_utils.getScrollbarSize():0,d=Math.max(Math.max(this.getDataSource().getCount(i),this.m_endRow),0)):"column"===i&&(s=this.getElementWidth(this.m_databody.firstChild),n=this.m_utils._getMaxDivWidthForScrolling(),o=this._getMaxScrollWidth(),r=this.m_avgColWidth,l=this.m_hasVerticalScroller?this.m_utils.getScrollbarSize():0,d=Math.max(Math.max(this.getDataSource().getCount(i),this.m_endCol),0));var c=Math.max(Math.min(e/s,1),0),m=this.getFetchSize(i);a=Math.floor(d*c),h=n<=s?Math.min(e,o):a*r,(1===c||e+m*r>s-l)&&(a=Math.max(d-m,0),h=Math.max(s-m*r,0))}else"row"===i?(a=this.m_startRow,h=this.m_startRowPixel):"column"===i&&(a=this.m_startCol,h=this.m_startColPixel);return{start:a,startPixel:h}},D.prototype.handleLongScroll=function(e,t){if(this.m_isLongScroll=!0,this.isFetchComplete()&&this._isScrollBackToEditable(!0)){var i=this._getLongScrollStart(t,this.m_prevScrollTop,"row"),s=i.start,n=i.startPixel,o=this._getLongScrollStart(e,this.m_prevScrollLeft,"column"),r=o.start,l=o.startPixel;this.m_hasCells&&(this.m_startRow=s,this.m_endRow=-1,this.m_startRowPixel=n,this.m_endRowPixel=n,this.m_startCol=r,this.m_endCol=-1,this.m_startColPixel=l,this.m_endColPixel=l),this.m_hasRowHeader&&(this.m_startRowHeader=s,this.m_endRowHeader=-1,this.m_startRowHeaderPixel=n,this.m_endRowHeaderPixel=n),this.m_hasRowEndHeader&&(this.m_startRowEndHeader=s,this.m_endRowEndHeader=-1,this.m_startRowEndHeaderPixel=n,this.m_endRowEndHeaderPixel=n),this.m_hasColHeader&&(this.m_startColHeader=r,this.m_endColHeader=-1,this.m_startColHeaderPixel=l,this.m_endColHeaderPixel=l),this.m_hasColEndHeader&&(this.m_startColEndHeader=r,this.m_endColEndHeader=-1,this.m_startColEndHeaderPixel=l,this.m_endColEndHeaderPixel=l),this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.fetchHeaders("row",s,this.m_rowHeader,this.m_rowEndHeader,void 0,{success:function(e,t,i){this.handleRowHeadersFetchSuccessForLongScroll(e,t,i)}}),this.fetchHeaders("column",r,this.m_colHeader,this.m_colEndHeader,void 0,{success:function(e,t,i){this.handleColumnHeadersFetchSuccessForLongScroll(e,t,i)}}),this.fetchCells(this.m_databody,s,r,null,null,{success:function(e,t){this.handleCellsFetchSuccessForLongScroll(e,t,s,r,n,l)}})}},D.prototype.handleRowHeadersFetchSuccessForLongScroll=function(e,t,i){var s=this.m_rowHeader.firstChild,n=this.m_rowEndHeader.firstChild;null!=s&&this.m_utils.empty(s),null!=n&&this.m_utils.empty(n),this.handleHeadersFetchSuccess(e,t,i,!1)},D.prototype.handleColumnHeadersFetchSuccessForLongScroll=function(e,t,i){var s=this.m_colHeader.firstChild,n=this.m_colEndHeader.firstChild;null!=s&&this.m_utils.empty(s),null!=n&&this.m_utils.empty(n),this.handleHeadersFetchSuccess(e,t,i,!1)},D.prototype.handleCellsFetchSuccessForLongScroll=function(e,t,i,s,n,o){var r=this.m_databody.firstChild;null==r||this._getEmptyElement()||this._emptyDatabody(r),this.handleCellsFetchSuccess(e,t)},D.prototype._cleanupViewport=function(e){if(!this._isHighWatermarkScrolling()&&this._isScrollBackToEditable()){null==e&&(this.m_prevScrollLeft>this.m_currentScrollLeft?e="right":this.m_prevScrollLeft<this.m_currentScrollLeft?e="left":this.m_prevScrollTop>this.m_currentScrollTop?e="bottom":this.m_prevScrollTop<this.m_currentScrollTop&&(e="top"));var t=this._getViewportLeft(),i=this._getViewportRight(),s=this._getViewportTop(),n=this._getViewportBottom();"top"===e&&s>this._getMaxTopPixel()?(this.removeRowsFromTop(this.m_databody),this.removeRowHeadersFromTop()):"bottom"===e&&n<this._getMaxBottomPixel()?(this.removeRowsFromBottom(this.m_databody),this.removeRowHeadersFromBottom()):"left"===e&&t>this._getMaxLeftPixel()?(this.removeColumnsFromLeft(this.m_databody),this.removeColumnHeadersFromLeft()):"right"===e&&i<this._getMaxRightPixel()&&(this.removeColumnsFromRight(this.m_databody),this.removeColumnHeadersFromRight())}},D.prototype.fillViewport=function(){var e,t;if(this.isFetchComplete()){var i=this._getViewportLeft(),s=this._getViewportRight()+D.FETCH_PIXEL_THRESHOLD,n=this._getViewportTop(),o=this._getViewportBottom()+D.FETCH_PIXEL_THRESHOLD;if(this._getMaxBottomPixel()<=o&&(!this.m_stopRowHeaderFetch||!this.m_stopRowEndHeaderFetch||!this.m_stopRowFetch))return e=Math.max(0,this._getMaxBottom()+1),t=Math.max(0,this.getFetchCount("row",e)),this.fetchHeaders("row",e,this.m_rowHeader,this.m_rowEndHeader,t),void this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1);if((this._getMaxTopPixel()>n||0===this.m_currentScrollTop)&&this._getMaxTop()>0)return e=Math.max(0,this._getMaxTop()-this.getFetchSize("row")),t=Math.max(0,this._getMaxTop()-e),this.fetchHeaders("row",e,this.m_rowHeader,this.m_rowEndHeader,t),void this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1);if(this._getMaxRightPixel()<=s&&(!this.m_stopColumnHeaderFetch||!this.m_stopColumnEndHeaderFetch||!this.m_stopColumnFetch))return e=Math.max(0,this._getMaxRight()+1),t=Math.max(0,this.getFetchCount("column",e)),this.fetchHeaders("column",e,this.m_colHeader,this.m_colEndHeader,t),void this.fetchCells(this.m_databody,this.m_startRow,e,this.m_endRow-this.m_startRow+1,t);(this._getMaxLeftPixel()>i||0===this.m_currentScrollLeft)&&this._getMaxLeft()>0&&(e=Math.max(0,this._getMaxLeft()-this.getFetchSize("column")),t=Math.max(0,this._getMaxLeft()-e),this.fetchHeaders("column",e,this.m_colHeader,this.m_colEndHeader,t),this.fetchCells(this.m_databody,this.m_startRow,e,this.m_endRow-this.m_startRow+1,t))}},D.prototype._getMaxRight=function(){return Math.max(Math.max(this.m_endCol,this.m_endColHeader),this.m_endColEndHeader)},D.prototype._getMaxLeft=function(){return Math.max(Math.max(this.m_startCol,this.m_startColHeader),this.m_startColEndHeader)},D.prototype._getMaxRightPixel=function(){return Math.max(Math.max(this.m_endColPixel,this.m_endColHeaderPixel),this.m_endColEndHeaderPixel)},D.prototype._getMaxLeftPixel=function(){return Math.max(Math.max(this.m_startColPixel,this.m_startColHeaderPixel),this.m_startColEndHeaderPixel)},D.prototype._getMaxBottom=function(){return Math.max(Math.max(this.m_endRow,this.m_endRowHeader),this.m_endRowEndHeader)},D.prototype._getMaxTop=function(){return Math.max(Math.max(this.m_startRow,this.m_startRowHeader),this.m_startRowEndHeader)},D.prototype._getMaxBottomPixel=function(){return Math.max(Math.max(this.m_endRowPixel,this.m_endRowHeaderPixel),this.m_endRowEndHeaderPixel)},D.prototype._getMaxTopPixel=function(){return Math.max(Math.max(this.m_startRowPixel,this.m_startRowHeaderPixel),this.m_startRowEndHeaderPixel)},D.prototype._isScrollBackToEditable=function(e){var t=this._getCurrentMode(),i=this._getActiveElement();return"edit"!==t||!e&&!this._isCellGoingToBeRemoved(i)||this._handleExitEdit(null,i)},D.prototype._isCellGoingToBeRemoved=function(e){if(!this._isHighWatermarkScrolling()){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.getElementDir(e.parentNode,"top");if(t+this.getElementHeight(e)<this.m_currentScrollTop||t<this.m_currentScrollTop+this.getViewportHeight())return!0}if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var i=this.getElementDir(e,"left");if(i+this.getElementWidth(e)<this.m_currentScrollLeft||i<this.m_currentScrollLeft+this.getViewportHeight())return!0}}},D.prototype._removeCellsAlongAxis=function(e,t,i){var s,n,o,r,l,a,h,d,c,m,u,_,p,g,f=0,C=0;for("row"===e?(n=this.m_startRow,o=this.m_endRow,r=this.m_rowHeader,l=this.m_rowHeaderLevelCount,a=this.m_startRowHeader,h="height",d=this.m_startRowPixel,c=this.m_endRowPixel,m=this.m_currentScrollTop,u="column",_=this.m_startCol,p=this.m_endCol,g="top",s=i?o:n):(n=this.m_startCol,o=this.m_endCol,r=this.m_colHeader,l=this.m_columnHeaderLevelCount,a=this.m_startColHeader,h="width",d=this.m_startColPixel,c=this.m_endColPixel,m=this.m_currentScrollLeft,u="row",_=this.m_startRow,p=this.m_endRow,g=this.getResources().isRTLMode()?"right":"left",s=i?o:n);s<=o&&s>=n;){var y=this._getKey(this._getHeaderByIndex(s,l-1,r,l,a),e);null==y&&(y=this._getKey(this._getCellByIndex("column"===e?this.createIndex(this.m_startRow,s):this.createIndex(s,this.m_startCol)),e));var v=this._getCellDimension(null,s,y,e,h);if(!(i?c-v-f>t:d+v+f<m-t))break;for(var E,w=_;w<=p;w+=E){var S=this._getCellByIndex("column"===e?this.createIndex(w,s):this.createIndex(s,w)),H=S[this.getResources().getMappedAttribute("context")],x=H.extents[e];E=H.extents[u],1===x?this._remove(S):(H.extents[e]-=1,this.setElementDir(S,this.getElementDir(S,h)-v,h),i||(H.indexes[e]+=1,this.setElementDir(S,this.getElementDir(S,g)+v,g)));for(var b=0;b<E;b++){var R="column"===e?this.createIndex(w+b,s):this.createIndex(s,w+b);this._removeIndexFromDatabodyMap(R)}}f+=v,C+=1,s=i?s-1:s+1}return{dimensionChange:f,extentChange:C}},D.prototype.removeHeadersFromStartOfContainer=function(e,t,i,s,n,o,r,l){var a=0,h=0,d=null==t?e.firstChild:t.nextSibling;if(null==d)return{extentChange:0,dimensionChange:0};for(var c=this.m_utils.containsCSSClassName(d,n),m=c?d:d.firstChild,u=this.getElementDir(m,o);i+u<l-s;){if(this._remove(d),h+=u,a+=c?1:this._getAttribute(d,"extent",!0),i+=u,null==(d=null==t?e.firstChild:t.nextSibling))return{extentChange:a,dimensionChange:h};m=(c=this.m_utils.containsCSSClassName(d,n))?d:d.firstChild,u=this.getElementDir(m,o)}if(!c){var _=this.removeHeadersFromStartOfContainer(d,d.firstChild,i,s,n,o,r,l);this._setAttribute(d,"start",this._getAttribute(d,"start",!0)+_.extentChange),this._setAttribute(d,"extent",this._getAttribute(d,"extent",!0)-_.extentChange),this.setElementDir(m,this.getElementDir(m,r)+_.dimensionChange,r),this.setElementDir(m,this.getElementDir(m,o)-_.dimensionChange,o),a+=_.extentChange,h+=_.dimensionChange}return{extentChange:a,dimensionChange:h}},D.prototype.removeHeadersFromEndOfContainer=function(e,t,i,s,n){for(var o=0,r=0,l=e.lastChild,a=this.m_utils.containsCSSClassName(l,s),h=a?l:l.firstChild,d=this.getElementDir(h,n);t-d>i;)this._remove(l),r+=d,o+=a?1:this._getAttribute(l,"extent",!0),t-=d,l=e.lastChild,h=(a=this.m_utils.containsCSSClassName(l,s))?l:l.firstChild,d=this.getElementDir(h,n);if(!a){var c=this.removeHeadersFromEndOfContainer(l,t,i,s,n);this._setAttribute(l,"extent",this._getAttribute(l,"extent",!0)-c.extentChange),this.setElementDir(h,this.getElementDir(h,n)-c.dimensionChange,n),o+=c.extentChange,r+=c.dimensionChange}return{extentChange:o,dimensionChange:r}},D.prototype.removeColumnHeadersFromLeft=function(){var e,t;if(this.m_endColHeader-this.m_startColHeader>this.MAX_COLUMN_THRESHOLD){var i=this.m_colHeader.firstChild;e=this.getColumnThreshold(),this.m_startColHeaderPixel<=this.m_currentScrollLeft-e&&(t=this.removeHeadersFromStartOfContainer(i,null,this.m_startColHeaderPixel,e,this.getMappedStyle("colheadercell"),"width",this.getResources().isRTLMode()?"right":"left",this.m_currentScrollLeft),this.m_startColHeaderPixel+=t.dimensionChange,this.m_startColHeader+=t.extentChange)}if(this.m_endColEndHeader-this.m_startColEndHeader>this.MAX_COLUMN_THRESHOLD){var s=this.m_colEndHeader.firstChild;e=this.getColumnThreshold(),this.m_startColEndHeaderPixel<this.m_currentScrollLeft-e&&(t=this.removeHeadersFromStartOfContainer(s,null,this.m_startColEndHeaderPixel,e,this.getMappedStyle("colendheadercell"),"width",this.getResources().isRTLMode()?"right":"left",this.m_currentScrollLeft),this.m_startColEndHeaderPixel+=t.dimensionChange,this.m_startColEndHeader+=t.extentChange)}},D.prototype.removeColumnsFromLeft=function(e){if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var t=e.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getColumnThreshold();if(t.length<1)return;var s=this._removeCellsAlongAxis("column",i,!1);this.m_startColPixel+=s.dimensionChange,this.m_startCol+=s.extentChange}},D.prototype.removeColumnHeadersFromRight=function(){var e,t,i=this.m_currentScrollLeft+this.getViewportWidth()+this.getColumnThreshold();this.m_endColHeader-this.m_startColHeader>this.MAX_COLUMN_THRESHOLD&&(e=this.m_colHeader.firstChild,this.m_endColHeaderPixel>i&&(this.m_stopColumnHeaderFetch&&(this.m_stopColumnHeaderFetch=!1),t=this.removeHeadersFromEndOfContainer(e,this.m_endColHeaderPixel,i,this.getMappedStyle("colheadercell"),"width"),this.m_endColHeaderPixel-=t.dimensionChange,this.m_endColHeader-=t.extentChange)),this.m_endColEndHeader-this.m_startColEndHeader>this.MAX_COLUMN_THRESHOLD&&(e=this.m_colEndHeader.firstChild,this.m_endColEndHeaderPixel>i&&(this.m_stopColumnEndHeaderFetch&&(this.m_stopColumnEndHeaderFetch=!1),t=this.removeHeadersFromEndOfContainer(e,this.m_endColEndHeaderPixel,i,this.getMappedStyle("colendheadercell"),"width"),this.m_endColEndHeaderPixel-=t.dimensionChange,this.m_endColEndHeader-=t.extentChange))},D.prototype.removeColumnsFromRight=function(e){if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var t=e.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.m_currentScrollLeft+this.getViewportWidth()+this.getColumnThreshold();if(this.m_endColPixel<=i||t.length<1)return;this.m_stopColumnFetch&&(this.m_stopColumnFetch=!1);var s=this._removeCellsAlongAxis("column",i,!0);this.m_endColPixel-=s.dimensionChange,this.m_endCol-=s.extentChange}},D.prototype.removeRowHeadersFromTop=function(){var e,t;if(this.m_endRowHeader-this.m_startRowHeader>this.MAX_ROW_THRESHOLD){var i=this.m_rowHeader.firstChild;t=this.getRowThreshold(),this.m_startRowHeaderPixel>=this.m_currentScrollTop-t||(e=this.removeHeadersFromStartOfContainer(i,null,this.m_startRowHeaderPixel,t,this.getMappedStyle("rowheadercell"),"height","top",this.m_currentScrollTop),this.m_startRowHeaderPixel+=e.dimensionChange,this.m_startRowHeader+=e.extentChange)}if(this.m_endRowEndHeader-this.m_startRowEndHeader>this.MAX_ROW_THRESHOLD){var s=this.m_rowEndHeader.firstChild;t=this.getRowThreshold(),this.m_startRowEndHeaderPixel>=this.m_currentScrollTop-t||(e=this.removeHeadersFromStartOfContainer(s,null,this.m_startRowEndHeaderPixel,t,this.getMappedStyle("rowendheadercell"),"height","top",this.m_currentScrollTop),this.m_startRowEndHeaderPixel+=e.dimensionChange,this.m_startRowEndHeader+=e.extentChange)}},D.prototype.removeRowsFromTop=function(e){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.getRowThreshold();if(this.m_startRowPixel>=this.m_currentScrollTop-t)return;var i=this._removeCellsAlongAxis("row",t,!1);this.m_startRowPixel+=i.dimensionChange,this.m_startRow+=i.extentChange}},D.prototype.removeRowHeadersFromBottom=function(){var e,t=this.m_currentScrollTop+this.getViewportHeight()+this.getRowThreshold();if(this.m_endRowHeader-this.m_startRowHeader>this.MAX_ROW_THRESHOLD){var i=this.m_rowHeader.firstChild;this.m_endRowHeaderPixel<=t||(this.m_stopRowHeaderFetch&&(this.m_stopRowHeaderFetch=!1),e=this.removeHeadersFromEndOfContainer(i,this.m_endRowHeaderPixel,t,this.getMappedStyle("rowheadercell"),"height"),this.m_endRowHeaderPixel-=e.dimensionChange,this.m_endRowHeader-=e.extentChange)}if(this.m_endRowEndHeader-this.m_startRowEndHeader>this.MAX_ROW_THRESHOLD){var s=this.m_rowEndHeader.firstChild;this.m_endRowEndHeaderPixel<=t||(this.m_stopRowEndHeaderFetch&&(this.m_stopRowEndHeaderFetch=!1),e=this.removeHeadersFromEndOfContainer(s,this.m_endRowEndHeaderPixel,t,this.getMappedStyle("rowendheadercell"),"height"),this.m_endRowEndHeaderPixel-=e.dimensionChange,this.m_endRowEndHeader-=e.extentChange)}},D.prototype.removeRowsFromBottom=function(e){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.m_currentScrollTop+this.getViewportHeight()+this.getRowThreshold();if(this.m_endRowPixel<=t)return;this.m_stopRowFetch&&(this.m_stopRowFetch=!1);var i=this._removeCellsAlongAxis("row",t,!0);this.m_endRowPixel-=i.dimensionChange,this.m_endRow-=i.extentChange}},D.prototype.handleContextMenuGesture=function(e,t,i){var s,n,o,r,l=e.originalEvent.target,a=this.findCell(l),h=!1;if(null===a&&(a=this.findHeader(l))&&(h=!0,r=this.getHeaderCellAxis(a)),"touch"===t&&null!=a){s=h?this.getHeaderCellIndex(a):this.getCellIndexes(a);let t=h?this._isHeaderInsideSelection(s,r):this._isContainSelection(s);(!this.isMultipleSelection()||!t||this._isDatabodyCellActive()&&s.row!==this.m_active.indexes.row&&s.column!==this.m_active.indexes.column)&&(this._isSelectionEnabled()?this.handleDatabodyClickSelection(e.originalEvent):this.handleDatabodyClickActive(e.originalEvent))}if(!this.m_utils._isNodeEditableOrClickable(l,this.m_root)){if(null==a||h)if(null==(a=this.findHeader(l)||this.findLabel(l))){var d="disable";n={resize:d,resizeWidth:d,resizeHeight:d,sortRow:d,sortCol:d,cut:d,paste:d,sortColAsc:d,sortColDsc:d,sortRowAsc:d,sortRowDsc:d},o=a}else(n=this._getHeaderCapability(a)).resizeFitToContent=h?"enable":"disable","column"!==r&&"columnEnd"!==r||!this.m_selectionFrontier||"column"!==this.m_selectionFrontier.axis?"row"!==r&&"rowEnd"!==r||!this.m_selectionFrontier||"row"!==this.m_selectionFrontier.axis||(n.resizeWidth="disable"):n.resizeHeight="disable",o=a;else s=this.getCellIndexes(a),this.isMultipleSelection()&&this._isContainSelection(s)?(o=this._getActiveElement(),this._isDatabodyCellActive()?(null==o&&(o=a),(n="keyboard"===t?this._getCellCapability(o):this._getCellCapability(o,a)).resizeFitToContent="disable"):(n=this._getHeaderCapability(o,a)).resizeFitToContent="enable"):(o=a,(n=this._getCellCapability(o)).resizeFitToContent="disable"),this.m_selectionFrontier&&"row"===this.m_selectionFrontier.axis?n.resizeWidth="disable":this.m_selectionFrontier&&"column"===this.m_selectionFrontier.axis&&(n.resizeHeight="disable");i.call(null,{capabilities:n,launcher:o},e,t)}},D.prototype._getCellCapability=function(e,t){var i=!0,s=!0,n="disable",o="enable",r={resize:n,resizeWidth:n,resizeHeight:n,sortRow:n,sortCol:n,cut:n,cutCells:n,copyCells:n,paste:n,pasteCells:n,autoFill:n,sortColAsc:n,sortColDsc:n,sortRowAsc:n,sortRowDsc:n};if(null!=t&&(i=this._getIndex(e,"column")===this._getIndex(t,"column"),!1===(s=this._getKey(e,"row")===this._getKey(t,"row"))&&!1===i))return r;this.m_options.isCopyEnabled()&&(r.copyCells=o),this.m_options.isCutEnabled()&&(r.cutCells=o),this.m_options.isPasteEnabled()&&(r.pasteCells=o);let l=this.m_selection,a=!1;if(!this.m_discontiguousSelection&&l&&1===l.length){let e=l[0].startIndex.row,t=l[0].startIndex.column,i=l[0].endIndex.row,s=l[0].endIndex.column;e===i&&t===s||(a=!0)}this.m_options.isFloodFillEnabled()&&a&&(r.autoFill=o);var h=this.getHeaderFromCell(e,"row"),d=this.getHeaderFromCell(e,"column"),c=this.getResources().getMappedAttribute("resizable"),m=this.getResources().getMappedAttribute("sortable");if(null!=d&&i&&("true"===d.getAttribute(c)&&(r.resize=o,r.resizeWidth=o),"true"===d.getAttribute(m))){r.sortCol=o,r.sortColAsc=o,r.sortColDsc=o;var u=d.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===u?r.sortColAsc=n:"descending"===u&&(r.sortColDsc=n)}return null!=h&&s&&(this._isMoveEnabled("row")&&(r.cut=o,r.paste=o),"true"===h.getAttribute(m)&&(r.sortRow=o,r.sortRowAsc=o,r.sortRowDsc=o),null!=h&&("true"===h.getAttribute(c)&&(r.resize=o,r.resizeHeight=o),"true"===h.getAttribute(m)&&(r.sortRow=o))),r},D.prototype._getHeaderCapability=function(e,t){var i=!0,s=!0,n="disable",o="enable",r={resize:n,resizeWidth:n,resizeHeight:n,sortRow:n,sortCol:n,cut:n,paste:n,sortColAsc:n,sortColDsc:n,sortRowAsc:n,sortRowDsc:n};if(null!=t&&(i=this.getHeaderCellIndex(e)===this._getIndex(t,"column"),!1===(s=this._getKey(e,"row")===this._getKey(t,"row"))&&!1===i))return r;var l=this.getHeaderCellAxis(e),a=this.getResources().getMappedAttribute("resizable"),h=this.getResources().getMappedAttribute("sortable");if(null!==e)if("column"!==l&&"columnEnd"!==l||!i){if(s&&(this._isMoveEnabled("row")&&(r.cut=o,r.paste=o),"true"===e.getAttribute(a)&&(r.resize=o,r.resizeHeight=o),r.resizeWidth=this.m_options.isResizable(l,"width"),"true"===e.getAttribute(h))){r.sortRow=o,r.sortRowAsc=o,r.sortRowDsc=o;let t=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===t?r.sortRowAsc=n:"descending"===t&&(r.sortRowDsc=n)}}else if("true"===e.getAttribute(a)&&(r.resizeWidth=o,r.resize=o),r.resizeHeight=this.m_options.isResizable(l,"height"),"true"===e.getAttribute(h)){r.sortCol=o,r.sortColAsc=o,r.sortColDsc=o;var d=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===d?r.sortColAsc=n:"descending"===d&&(r.sortColDsc=n)}return r.resize=r.resizeHeight===o||r.resizeWidth===o?o:n,r},D.prototype.handleContextMenuReturn=function(e,t,i){var s,n;if(null!=this.m_active&&(s=this._getActiveElement()),t===this.m_resources.getMappedCommand("resizeHeight")||t===this.m_resources.getMappedCommand("resizeWidth"))this.isResizeEnabled()&&this.handleContextMenuResize(e,t,i,s);else if(t===this.m_resources.getMappedCommand("resizeFitToContent")){let t,i=this.findCell(e.target);i&&(t=this.getHeaderFromCell(i,this.m_selectionFrontier.axis)),t||(t=this.findHeader(e.target)),t||(t=this.findLabel(e.target)),t&&(this.m_resizingElement=t);const s=this.getHeaderCellAxis(this.m_resizingElement),n=this.getHeaderCellLevel(this.m_resizingElement);let o=!1;("row"!==s&&"rowEnd"!==s||n!==this.m_rowHeaderLevelCount-1)&&("column"!==s&&"columnEnd"!==s||n!==this.m_columnHeaderLevelCount-1)||(o=!0),o&&this.isResizeEnabled()&&this._getHeadersForResizeFitToContent(e)}else t===this.m_resources.getMappedCommand("sortColAsc")||t===this.m_resources.getMappedCommand("sortColDsc")?(n=t===this.m_resources.getMappedCommand("sortColAsc")?"ascending":"descending",this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=this.getHeaderFromCell(s,"column")),this._isDOMElementSortable(s)&&this._handleCellSort(e,n,s)):t===this.m_resources.getMappedCommand("sortRowAsc")||t===this.m_resources.getMappedCommand("sortRowDsc")?(n=t===this.m_resources.getMappedCommand("sortRowAsc")?"ascending":"descending",this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=this.getHeaderFromCell(s,"row")),this._isDOMElementSortable(s)&&this._handleCellSort(e,n,s)):t===this.m_resources.getMappedCommand("cut")?this._handleCut(e,s):t===this.m_resources.getMappedCommand("paste")?this._handlePaste(e,s):t===this.m_resources.getMappedCommand("cutCells")?this._handleCutCells(e,s):t===this.m_resources.getMappedCommand("copyCells")?this._handleCopyCells(e,s):t===this.m_resources.getMappedCommand("pasteCells")?this._handlePasteCells(e,s):t===this.m_resources.getMappedCommand("autoFill")?this._handleAutofill(e,s):t===this.m_resources.getMappedCommand("discontiguousSelection")&&this.setDiscontiguousSelectionMode(i)},D.prototype._isSortEnabled=function(e,t){var i=this.getDataSource().getCapability("sort"),s=this.m_options.isSortable(e,t);return!("enable"!==s&&"auto"!==s||"full"!==i&&i!==e)&&(!this._isDataGridProvider()||null!=t.metadata.sortDirection)},D.prototype._isParentNode=function(e){return!!this._isDataGridProvider()&&(e.metadata.expanded&&null!==e.metadata.expanded)},D.prototype._isRequired=function(e){return!!this._isDataGridProvider()&&!0===e.metadata.showRequired},D.prototype._isHierarchicalGroup=function(e){return null==e.metadata.treeDepth},D.prototype._isLeafNode=function(e){if(!e.metadata)return!1;const t=e.metadata.treeDepth;return!!this._isDataGridProvider()&&(null!=t&&0!==t)},D.prototype._isDOMElementSortable=function(e){if(null==e)return!1;var t=this.findHeader(e);return null!=t&&"true"===t.getAttribute(this.getResources().getMappedAttribute("sortable"))},D.prototype._isSelectionEnabled=function(){return"none"!==this.m_options.getSelectionCardinality()},D.prototype.isMultipleSelection=function(){return"multiple"===this.m_options.getSelectionCardinality()},D.prototype.isResizeEnabled=function(){return this.m_options.isResizable("row","width")||this.m_options.isResizable("row","height")||this.m_options.isResizable("column","width")||this.m_options.isResizable("column","height")||this.m_options.isResizable("rowEnd","width")||this.m_options.isResizable("rowEnd","height")||this.m_options.isResizable("columnEnd","width")||this.m_options.isResizable("columnEnd","height")},D.prototype._isHeaderResizeEnabled=function(e,t){return"column"===e||"columnEnd"===e?"enable"===this.m_options.isResizable(e,"width",t):("row"===e||"rowEnd"===e)&&"enable"===this.m_options.isResizable(e,"height",t)},D.prototype.handleMouseMove=function(e){this.isResizeEnabled()&&!1===this.m_databodyDragState&&this.handleResize(e)},D.prototype.handleRowHeaderMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_databodyMove&&!this._isDataGridProvider()?this._handleMove(e):this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("row")||this.m_deselectInfo&&this.m_deselectInfo.axis&&-1!==this.m_deselectInfo.axis.indexOf("row"))?this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress):this.m_isResizing||this.handleMouseMove(e)},D.prototype.handleColumnHeaderMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("column")||this.m_deselectInfo&&this.m_deselectInfo.axis&&-1!==this.m_deselectInfo.axis.indexOf("column"))?this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress):this.m_isResizing||this.handleMouseMove(e)},D.prototype.handleHeaderLabelMouseMove=function(e){this.m_isResizing||this.handleMouseMove(e)},D.prototype.handleHeaderMouseDown=function(e){var t;this._exitActionableMode();var i=e.target;if(this._isEditOrEnter()){var s=this._getActiveElement();if(!1===this._leaveEditing(e,s,!1))return}if(!this._isDisclosureIcon(i)){var n=this.m_options.getSelectionMode();if(0===e.button){if((this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdescending")))&&this._isDOMElementSortable(i))return e.preventDefault(),void this._handleSortIconMouseDown(i);if(this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortIcon"))&&this._isDOMElementSortable(i.lastChild))return e.preventDefault(),void this._handleSortIconMouseDown(i.lastChild);this.isResizeEnabled()&&(t=this.handleResizeMouseDown(e),this._highlightResizeMouseDown());var o=this.m_utils.ctrlEquivalent(e);this._isDataGridProvider()||this.m_isResizing||o||!this._isMoveOnElementEnabled(this.findHeader(i))||(this.m_databodyMove=!0,this.m_currentX=e.pageX,this.m_currentY=e.pageY,t=!0);let s=this.findHeader(e.target),n=this.getHeaderCellAxis(s);if(this.m_utils.containsCSSClassName(s,this.getMappedStyle("draggableItem"))&&this.m_utils.addCSSClassName(s,this.getMappedStyle("dragging")),this._isDataGridProvider()&&this.m_options._isDragEnabled(n)&&this.shouldHoverHeader(s)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(s))return}if(!this.m_isResizing&&"default"===this.manageHeaderCursor(e,!1)){this.m_root.contains(document.activeElement)&&document.activeElement!==this.m_root||(this.m_externalFocus=!0);var r=this.findHeader(i)[this.getResources().getMappedAttribute("context")];if(!this._isSelectionEnabled()||!this.isMultipleSelection()||"row"===n&&-1===r.axis.indexOf("row")||this.m_databodyMove)if("row"===n&&-1!==r.axis.indexOf("row")&&this._isSelectionEnabled())this.handleHeaderClickSelection(e);else if("row"===n&&-1!==r.axis.indexOf("column")&&this._isSelectionEnabled()){let t=!1;e.shiftKey||(t=!0),this.handleHeaderClickActive(e,t)}else this.handleHeaderClickActive(e);else 0===e.button&&(this.m_headerDragState=!0),this.handleHeaderClickSelection(e)}this.m_options.isFloodFillEnabled()&&this.m_bottomFloodFillIconContainer&&this.m_bottomFloodFillIconContainer.parentNode&&(this.m_bottomFloodFillIconContainer.parentNode.removeChild(this.m_bottomFloodFillIconContainer),this.m_bottomFloodFillIconContainer.removeEventListener("mouseover",this.handleDatabodyMouseMove)),!0===t&&e.preventDefault()}},D.prototype.handleHeaderLabelMouseDown=function(e){var t;this.isResizeEnabled()&&(t=this.handleResizeMouseDown(e),this._highlightResizeMouseDown()),!0===t&&e.preventDefault()},D.prototype.handleMouseUp=function(e){this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_deselectInProgress=!1,this.m_databodyMove?this._handleMoveMouseUp(e,!1):this.isResizeEnabled()&&this.handleResizeMouseUp(e),this.m_databodyMove=!1},D.prototype.shouldHoverHeader=function(e){const t=null==e?null:this.getHeaderCellAxis(e),i=null===e?null:this.getHeaderCellLevel(e),s="row"===t||"rowEnd"===t,n=this.m_options.getSelectionMode();return this._isSelectionEnabled()&&(this.isMultipleSelection()&&"cell"===n||"row"===n&&s&&(this.isMultipleSelection()||null!==i&&i===this.m_rowHeaderLevelCount-1))},D.prototype.handleHeaderMouseOver=function(e){var t=e.target,i=this.findHeader(t);!this.m_isResizing&&"default"===this.manageHeaderCursor(e,!1)&&this.shouldHoverHeader(i)&&this.m_utils.addCSSClassName(i,this.getMappedStyle("hover"));let s=this.getHeaderCellAxis(i);this._isDataGridProvider()&&this.shouldHoverHeader(i)&&this.m_options._isDragEnabled(s)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(i)},D.prototype.handleHeaderMouseOut=function(e){var t=e.target;this.m_utils.removeCSSClassName(this.findHeader(t),this.getMappedStyle("hover")),!this.m_isResizing&&this.m_resizingElement&&(this.m_resizingElement.style.cursor="",null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor="")),this._isDOMElementSortable(t)&&this._handleSortMouseOut(e)},D.prototype.handleHeaderMouseUp=function(e){this.handleDragAnchorChange(e),this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_deselectInProgress=!1,this.m_floodFillDragState&&(this.unhighlightFloodFillRange(),this.m_selectionRange=null,this.m_floodFillRange=null,this.m_floodFillDirection=null,this.m_databody.style.cursor="default",this.m_cursor="default"),this.m_databodyMove&&this._handleMoveMouseUp(e,!0);let t=this.findHeader(e.target),i=this.getHeaderCellAxis(t);this._isDataGridProvider()&&this.m_options._isDragEnabled(i)&&this.shouldHoverHeader(t)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(t),this.m_utils.containsCSSClassName(t,this.getMappedStyle("dragging"))&&this.m_utils.removeCSSClassName(t,this.getMappedStyle("dragging"))},D.prototype.handleCornerMouseDown=function(e){let t,i=e.target,s=this.m_utils.containsCSSClassName(i,this.getMappedStyle("rowendheaderlabel"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("columnendheaderlabel")),n=this.findLabel(i);null!=n&&(t=s,this._setActive(n,this._createActiveObject(n),e,t),this.handleHeaderLabelMouseDown(e))},D.prototype.handleCornerMouseOver=function(e){var t=e.target;let i=this.findLabel(t);this._isSelectionEnabled()&&this.isMultipleSelection()&&(i?this.m_utils.addCSSClassName(i,this.getMappedStyle("hover")):this.m_utils.addCSSClassName(this.find(t,"topcorner"),this.getMappedStyle("hover"))),this.m_isResizing||null===i||this.handleMouseMove(e)},D.prototype.handleCornerMouseMove=function(e){var t=e.target;let i=this.findLabel(t);this.m_isResizing||null===i||this.handleMouseMove(e)},D.prototype.handleCornerMouseOut=function(e){var t=e.target;let i=this.findLabel(t);i?this.m_utils.removeCSSClassName(i,this.getMappedStyle("hover")):this.m_utils.removeCSSClassName(this.find(t,"topcorner"),this.getMappedStyle("hover"))},D.prototype.handleCornerClick=function(e){this._handleSelectAll(e)},D.prototype.handleHeaderClick=function(e){var t=e.target;(this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortdefault")))&&this._isDOMElementSortable(t)||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortIcon"))&&this._isDOMElementSortable(t.lastChild)?(this._removeTouchSelectionAffordance(),this._handleHeaderSort(e),e.preventDefault()):this._isDisclosureIcon(e.target)&&(this._removeTouchSelectionAffordance(),this._handleExpandCollapseRequest(e),e.preventDefault())},D.prototype.handleHeaderDoubleClick=function(e){if(document.contains(e.target)){let t=!1;if(this.m_cursor=this.manageHeaderCursor(e,t),"col-resize"===this.m_cursor||"row-resize"===this.m_cursor){this.m_resizingElement||(this.m_resizingElement=this.findHeader(e.target));const t=this.getHeaderCellAxis(this.m_resizingElement),i=this.getHeaderCellLevel(this.m_resizingElement);let s=!1;("row"!==t&&"rowEnd"!==t||i!==this.m_rowHeaderLevelCount-1||"row-resize"!==this.m_cursor)&&("column"!==t&&"columnEnd"!==t||i!==this.m_columnHeaderLevelCount-1||"col-resize"!==this.m_cursor)||(s=!0),s&&this.isResizeEnabled()&&this._getHeadersForResizeFitToContent(e)}}},D.prototype._getHeadersForResizeFitToContent=function(e){const t=this.getHeaderCellAxis(this.m_resizingElement),i=this.getHeaderCellIndex(this.m_resizingElement);let s=[];if(this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection.length){let e=this.m_selection[0];s=this._getHeadersWithinSelection(e,i,t)}s.length||s.push(this.m_resizingElement),s.forEach(i=>{this.handleResizeFitToContent(e,i,t)})},D.prototype._getHeadersWithinSelection=function(e,t,i){let s,n,o,r,l,a,h,d=[];if("column"===i?(s=this.m_startColHeader,n=this.m_columnHeaderLevelCount-1,o=this.m_columnHeaderLevelCount,r=this.m_colHeader,l="column"):"columnEnd"===i?(s=this.m_startColEndHeader,n=this.m_columnEndHeaderLevelCount-1,o=this.m_columnEndHeaderLevelCount,r=this.m_colEndHeader,l="column"):"row"===i?(s=this.m_startRowHeader,n=this.m_rowHeaderLevelCount-1,o=this.m_rowHeaderLevelCount,r=this.m_rowHeader,l="row"):(s=this.m_startRowEndHeader,n=this.m_rowEndHeaderLevelCount-1,o=this.m_rowEndHeaderLevelCount,r=this.m_rowEndHeader,l="row"),0===e.startIndex.column&&-1===e.endIndex.column&&0===e.startIndex.row&&-1===e.endIndex.row){a=0,h="row"===l?this.m_endRowHeader-this.m_startRowHeader:this.m_endColHeader-this.m_startColHeader}else 0===e.startIndex.column&&-1===e.endIndex.column||void 0===e.startIndex.column?e.startIndex.row<=t&&t<=e.endIndex.row&&("row"===i||"rowEnd"===i)&&(a=e.startIndex.row,h=e.endIndex.row):(0===e.startIndex.row&&-1===e.endIndex.row||void 0===e.startIndex.row)&&e.startIndex.column<=t&&t<=e.endIndex.column&&("column"===i||"columnEnd"===i)&&(a=e.startIndex.column,h=e.endIndex.column);for(let e=a;e<=h;e++){let t=this._getHeaderByIndex(e,n,r,o,s);t&&d.push(t)}return d},D.prototype._setHeaderDraggable=function(e){let t=!1;if(this.m_selection&&this.m_selection.length){if(this._isSelectionAcrossAxis())return!1;this.m_utils.containsCSSClassName(e,this.getMappedStyle("selected"))&&(t=!0)}return t&&(this.m_utils.addCSSClassName(e,this.getMappedStyle("draggableItem")),e.setAttribute("draggable",!0)),t},D.prototype._isSelectionAcrossAxis=function(){let e,t=!1;for(let i=0;i<this.m_selection.length;i++){let s=this.m_selection[i];if(e&&(-1===s.endIndex.row&&"column"!==e||-1===s.endIndex.column&&"row"!==e)){t=!0;break}-1===s.endIndex.row?e="column":-1===s.endIndex.column&&(e="row")}return t},D.prototype.handleDatabodyMouseDown=function(e){var t=e.target,i=this.findCell(t);if(null!=i){if(this._isEditOrEnter()){var s=this._getActiveElement();if(i===s)return;if(!1===this._leaveEditing(e,s,!1))return}else this._exitActionableMode();var n=this.m_utils.ctrlEquivalent(e);0!==e.button||n||this._isMoveOnElementEnabled(i)&&(this.m_databodyMove=!0,this.m_currentX=e.pageX,this.m_currentY=e.pageY),this.m_root.contains(document.activeElement)&&document.activeElement!==this.m_root||(this.m_externalFocus=!0),this._isGridEditable()&&(this.m_shouldFocus=!this._isFocusableElementBeforeCell(t)),this._isSelectionEnabled()?(this.isMultipleSelection()&&0===e.button&&(this.m_databodyDragState=!0),this.handleDatabodyClickSelection(e)):this.handleDatabodyClickActive(e)}else this.m_scrollbarFocus=!0},D.prototype.handleDatabodyMouseOut=function(e){if(!this.m_databodyMove){var t=e.target,i=this.findCell(t);this._setCellHover(i,"remove")}},D.prototype.handleDatabodyMouseOver=function(e){if(!this.m_databodyMove){var t=e.target,i=this.findCell(t);this._setCellHover(i,"add")}},D.prototype._setCellHover=function(e,t){if(null!=e&&this._isSelectionEnabled()){var i=this.m_options.getSelectionMode();if("cell"===i)"add"===t?this.m_utils.addCSSClassName(e,this.getMappedStyle("hover")):this.m_utils.removeCSSClassName(e,this.getMappedStyle("hover"));else if("row"===i)for(var s=this._getIndex(e,"row"),n=this._getSelectionStartAndEnd(this.createIndex(s,this.m_startCol),this.createIndex(s,this.m_endCol),0),o=n.min.row;o<=n.max.row;o++)this._highlightCellsAlongAxis(o,"row","index",t,["hover"])}},D.prototype.handleDatabodyDoubleClick=function(e){if(this._isGridEditable()){var t=e.target,i=this.findCell(t);if("edit"===this._getCurrentMode()){var s=this._getActiveElement();if(i===s)return;if(!this._handleExitEdit(e,s))return}this._handleEditable(e,i),this._handleEdit(e,i)}},D.prototype.handleDatabodyMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_databodyMove?this._handleMove(e):this.m_databodyDragState?this.m_floodFillDragState?this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionRange||(this.m_selectionRange=this.GetSelection()),this.handleDatabodyFloodFillDrag(e)):this.handleDatabodySelectionDrag(e):this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&(-1!==this.m_selectionFrontier.axis.indexOf("row")||-1!==this.m_selectionFrontier.axis.indexOf("column"))||this.m_deselectInfo&&this.m_deselectInfo.axis&&(-1!==this.m_deselectInfo.axis.indexOf("row")||-1!==this.m_deselectInfo.axis.indexOf("column")))&&this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress)},D.prototype.handleDatabodyMouseUp=function(e){this.m_databodyDragState=!1,this.m_headerDragState=!1,this.m_deselectInProgress=!1,this.m_databodyMove&&this._handleMoveMouseUp(e,!0),this.m_options.isFloodFillEnabled()&&this.m_floodFillDragState&&(this._handleFloodFillMouseUp(e),this.m_floodFillDragState=!1)},D.prototype.handleDatabodyKeyUp=function(e){this.m_deselectInProgress&&(this.m_deselectInProgress=e.shiftKey)},D.prototype.handleDatabodyKeyDown=function(e){var t,i=this.m_utils.ctrlEquivalent(e);if(e.defaultPrevented&&i&&(this.keyCodes.LEFT_KEY||this.keyCodes.RIGHT_KEY)||this.m_animating)return;let s=this._getActiveElement();null!=(t=null!=this.m_active&&"header"===this.m_active.type?this._getActionFromKeyDown(e,this.m_active.axis,!1):null!=this.m_active&&"label"===this.m_active.type?this._getActionFromKeyDown(e,this.m_active.axis,!0):null!=this.m_active&&"empty"===this.m_active.type?this._getActionFromNoDataKeydown(e):this._getActionFromKeyDown(e,"cell",!1))&&t.call(this,e,s)&&e.preventDefault()},D.prototype.findPos=function(e){if(e){var t=this.findPos(e.offsetParent),i=this.getElementTranslationXYZ(e.offsetParent);return[parseInt(t[0],10)+parseInt(e.offsetLeft,10)+i[0],parseInt(t[1],10)+parseInt(e.offsetTop,10)+i[1]]}return[0,0]},D.prototype._findHeaderOffset=function(e,t,i){if(i||(i=[0,0]),e!==t){for(;!e.offsetParent;)e=e.parentElement;return e.offsetLeft&&(i[0]+=parseInt(e.offsetLeft,10)),e.offsetTop&&(i[1]+=parseInt(e.offsetTop,10)),this._findHeaderOffset(e.offsetParent,t,i)}return i},D.prototype.getElementTranslationXYZ=function(e){if(e){var t=document.defaultView.getComputedStyle(e,null),i=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("-moz-transform")||t.getPropertyValue("-ms-transform")||t.getPropertyValue("-o-transform")||t.getPropertyValue("transform"),s=i.substr(7,i.length-8).split(", ");return[isNaN(parseInt(s[4],10))?0:parseInt(s[4],10),isNaN(parseInt(s[5],10))?0:parseInt(s[5],10),isNaN(parseInt(s[6],10))?0:parseInt(s[6],10)]}return[0,0,0]},D.prototype.handleDatabodyMouseWheel=function(e){var t,i=this.find(e.target,"header");if(null==i&&(i=this.find(e.target,"endheader")),i&&(t=i===this.m_rowHeader||i===this.m_rowEndHeader?"row":"column"),("row"!==t||this.m_stopRowHeaderFetch&&this.m_stopRowEndHeaderFetch&&this.m_stopRowFetch)&&("column"!==t||this.m_stopColumnHeaderFetch&&this.m_stopColumnEndHeaderFetch&&this.m_stopColumnFetch)||e.preventDefault(),!this.m_animating){var s=this.m_utils.getMousewheelScrollDelta(e),n=s.deltaX,o=s.deltaY;"row"===t?n=0:"column"===t&&(o=0);var r=Math.max(0,Math.min(this._getMaxScrollHeight(),this.m_currentScrollTop-o));this._getMaxScrollHeight()!==r&&0!==r&&this.find(e.target,"header")&&e.preventDefault(),this.scrollDelta(n,o)}},D.prototype.handleTouchStart=function(e){var t=e.touches.length,i=e.touches[0].target;if(1===t){if(this.m_startX=e.touches[0].pageX,this.m_startY=e.touches[0].pageY,this.m_currentX=this.m_startX,this.m_currentY=this.m_startY,this.m_prevX=this.m_startX,this.m_prevY=this.m_startY,this.m_startTime=(new Date).getTime(),this.m_touchActive=!0,this.isMultipleSelection()){i.classList.contains(this.getMappedStyle("selectaffordance"))&&(i=i.parentNode);var s=null;if(i===this.m_topSelectIconContainer?s="top":i===this.m_bottomSelectIconContainer&&(s="bottom"),s){this.m_touchMultipleSelect=!0;var n=this.GetSelection();this.m_touchSelectAnchor="top"===s?n[n.length-1].endIndex:n[n.length-1].startIndex}}!this.m_touchMultipleSelect&&this._isMoveOnElementEnabled(this.findCell(i))&&(this.m_databodyMove=!0)}else this.handleTouchCancel(e)},D.prototype.handleTouchMove=function(e){var t=e.target;if(this.m_touchActive){e.cancelable&&e.preventDefault(),this.m_currentX=e.touches[0].pageX,this.m_currentY=e.touches[0].pageY;var i=this.m_currentX-this.m_prevX,s=this.m_currentY-this.m_prevY,n=this.adjustTouchScroll(i,s);if(i=n[0],s=n[1],this.getResources().isRTLMode()&&(i*=-1),this.m_touchMultipleSelect)this.handleDatabodySelectionDrag(e),this.m_utils.isTouchDeviceNotIOS()||e.preventDefault();else if(this.m_databodyMove)this._removeTouchSelectionAffordance(),this._handleMove(e),this.m_utils.isTouchDeviceNotIOS()||e.preventDefault();else if(this._isEditOrEnter()&&this.m_utils.isTouchDeviceNotIOS()){var o=this._getActiveElement();this.findCell(t)!==o&&this._handleNonSwipeScroll(i,s)}else this._handleNonSwipeScroll(i,s);this.m_prevX=this.m_currentX,this.m_prevY=this.m_currentY}else this.handleTouchCancel(e)},D.prototype.handleTouchEnd=function(e){var t,i=e.target;if(this._isEditOrEnter()){if(t=this._getActiveElement(),this.findCell(i)===t)return void this.handleTouchCancel(e);this._leaveEditing(e,t,!1)}else this._exitActionableMode();if(null!=this.m_lastTapTime&&this.m_startTime-this.m_lastTapTime<250&&this.m_lastTapTarget===i?(this.m_lastTapTime=null,this.m_lastTapTarget=null,null!=(t=this.findCell(i))&&(this._handleEditable(e,t),this._handleEdit(e,t),e.cancelable&&e.preventDefault())):(this.m_lastTapTarget=e.target,this.m_lastTapTime=(new Date).getTime()),this.m_touchActive&&!e.defaultPrevented)if(this.m_touchMultipleSelect)e.cancelable&&e.preventDefault(),this.m_touchMultipleSelect=!1;else{var s=this.m_lastTapTime-this.m_startTime;if(this.m_currentX===this.m_startX&&this.m_currentY===this.m_startY)return this.m_databodyMove=!1,this._isSelectionEnabled()&&s<D.CONTEXT_MENU_TAP_HOLD_DURATION?void this.handleDatabodyClickSelection(e):void this.handleDatabodyClickActive(e);if(this.m_databodyMove)return e.cancelable&&e.preventDefault(),this.m_databodyMove=!1,void this._handleMoveMouseUp(e,!0);this.m_utils.isTouchDeviceNotIOS()&&this._handleSwipe(e)}this.handleTouchCancel(e)},D.prototype._calculateMomentum=function(e,t,i,s,n,o){var r,l=e-t,a=Math.abs(l)/i,h=a*a/(2*D.DECELERATION_FACTOR)*(l<0?-1:1),d=a/D.DECELERATION_FACTOR;return o&&(h*=-1),s-h>n?(r=Math.max(-1*D.MAX_OVERSCROLL_PIXEL,h),h=s-n,d=(l=n-s)/a):s-h<0&&(r=Math.min(D.MAX_OVERSCROLL_PIXEL,h),h=s,d=(l=s)/a),{destination:Math.round(h),duration:Math.min(Math.max(D.MIN_SWIPE_TRANSITION_DURATION,d),D.MAX_SWIPE_TRANSITION_DURATION),overScroll:r}},D.prototype.handleTouchCancel=function(e){this.m_databodyMove&&(this._handleMoveMouseUp(e,!1),this.m_databodyMove=!1),this.m_touchSelectAnchor=null,this.m_touchMultipleSelect=!1,this.m_touchActive=!1,this.m_startX=0,this.m_startY=0,this.m_prevX=0,this.m_prevY=0,this.m_currentX=0,this.m_currentY=0,this.m_startTime=0},D.prototype.handleHeaderTouchStart=function(e){this.m_touchStart=(new Date).getTime();var t=e.touches.length,i=e.target;if(1===t){this.m_startX=e.touches[0].pageX,this.m_startY=e.touches[0].pageY,this.m_currentX=this.m_startX,this.m_currentY=this.m_startY,this.m_prevX=this.m_startX,this.m_prevY=this.m_startY,this.m_touchActive=!0;var s=this.findHeader(i);this.isResizeEnabled()&&(this.handleResize(e),this.handleResizeMouseDown(e),this._highlightResizeMouseDown()),!this.m_isResizing&&this._isMoveOnElementEnabled(s)&&(this.m_databodyMove=!0);let t=this.getHeaderCellAxis(s);this._isDataGridProvider()&&this.m_options._isDragEnabled(t)&&(this.m_utils.addCSSClassName(s,this.getMappedStyle("draggableItem")),s.setAttribute("draggable",!0))}else this.handleHeaderTouchCancel(e)},D.prototype.handleHeaderTouchMove=function(e){if(this.m_touchActive){e.cancelable&&e.preventDefault(),this.m_currentX=e.touches[0].pageX,this.m_currentY=e.touches[0].pageY;var t=this.m_currentX-this.m_prevX,i=this.m_currentY-this.m_prevY;if(this.m_isResizing&&this.isResizeEnabled())this.handleResize(e);else if(this.m_databodyMove)this._removeTouchSelectionAffordance(),this._handleMove(e);else if(this.m_databodyReorder)this._removeTouchSelectionAffordance();else{var s=e.target,n=this.findHeader(s),o=this.getHeaderCellAxis(n);"column"===o||"columnEnd"===o?this._handleNonSwipeScroll(t,0):this._handleNonSwipeScroll(0,i)}this.m_prevX=this.m_currentX,this.m_prevY=this.m_currentY}else this.handleTouchCancel(e)},D.prototype.handleHeaderTouchEnd=function(e){var t;if(this.m_touchActive&&!e.defaultPrevented){var i=e.target;if(this.m_isResizing&&this.isResizeEnabled())this.handleResizeMouseUp(e),this.m_currentX!==this.m_startX&&this.m_currentY!==this.m_startY&&e.cancelable&&e.preventDefault();else if(this.m_currentX===this.m_startX&&this.m_currentY===this.m_startY){var s=this.m_options.getSelectionMode(),n=(t=this.findHeader(i))[this.getResources().getMappedAttribute("context")],o=this.m_root.getAttribute("id"),r=document.querySelector("#"+o+"contextmenu");r&&"none"===r.style.display&&((this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))&&this._isDOMElementSortable(i)?(e.cancelable&&e.preventDefault(),this._removeTouchSelectionAffordance(),this._handleSortIconMouseDown(i),this._handleHeaderSort(e)):this._isDisclosureIcon(i)?(this._removeTouchSelectionAffordance(),this._handleExpandCollapseRequest(e),e.preventDefault()):!this._isSelectionEnabled()||!this.isMultipleSelection()||"row"===s&&-1===n.axis.indexOf("row")||this.m_databodyMove?"row"===s&&-1!==n.axis.indexOf("row")&&this._isSelectionEnabled()?this.handleHeaderClickSelection(e):this.handleHeaderClickActive(e):(0===e.button&&(this.m_headerDragState=!0),this.handleHeaderClickSelection(e)))}else if(this.m_databodyMove)e.cancelable&&e.preventDefault(),this.m_databodyMove=!1,this._handleMoveMouseUp(e,!0);else if(this.m_databodyReorder){e.cancelable&&e.preventDefault(),this.m_databodyReorder=!1,t=this.findHeader(i),"row"===this.getHeaderCellAxis(t)?this.handleRowDragEnd(e):this.handleColumnDragEnd(e)}else t=this.findHeader(i),this._handleSwipe(e,this.getHeaderCellAxis(t))}this.handleHeaderTouchCancel(e)},D.prototype.handleHeaderTouchCancel=function(e){this.m_databodyMove&&(this._handleMoveMouseUp(e,!1),this.m_databodyMove=!1),this.m_touchActive=!1,this.m_startX=0,this.m_startY=0,this.m_prevX=0,this.m_prevY=0,this.m_currentX=0,this.m_currentY=0},D.prototype._handleNonSwipeScroll=function(e,t){var i=(new Date).getTime();this._disableTouchScrollAnimation();var s=this.adjustTouchScroll(e,t);e=s[0],t=s[1],this.scrollDelta(e,t),i-this.m_startTime>D.TAP_AND_SCROLL_RESET&&(this.m_startX=this.m_currentX,this.m_startY=this.m_currentY,this.m_startTime=(new Date).getTime())},D.prototype._handleSwipe=function(e,t){var i=(new Date).getTime()-this.m_startTime,s=this.getResources().isRTLMode(),n=this.m_currentX-this.m_startX,o=this.m_currentY-this.m_startY;if(s&&(n*=-1),Math.abs(n)<D.MIN_SWIPE_DISTANCE&&Math.abs(o)<D.MIN_SWIPE_DISTANCE&&i<D.MIN_SWIPE_DURATION)e.cancelable&&e.preventDefault(),this._isSelectionEnabled()&&this._scrollTouchSelectionAffordance();else if(i<D.MAX_SWIPE_DURATION){var r,l;if(e.cancelable&&e.preventDefault(),"row"!==t&&"rowEnd"!==t?(r=this._calculateMomentum(this.m_currentX,this.m_startX,i,this.m_currentScrollLeft,this.m_scrollWidth,s),isNaN(r.overScroll)||(r.overScroll>0||this.m_stopColumnFetch)&&(this.m_extraScrollOverX=-1*r.overScroll)):(r={duration:0,destination:0},n=0),"column"!==t&&"columnEnd"!==t?(l=this._calculateMomentum(this.m_currentY,this.m_startY,i,this.m_currentScrollTop,this.m_scrollHeight),isNaN(l.overScroll)||(l.overScroll>0||this.m_stopRowFetch)&&(this.m_extraScrollOverY=-1*l.overScroll)):(l={duration:0,destination:0},o=0),this.m_utils.isTouchDeviceNotIOS()){var a=Math.max(r.duration,l.duration);this.m_databody.firstChild.style.transitionDuration=a+"ms",this.m_rowHeader.firstChild.style.transitionDuration=a+"ms",this.m_colHeader.firstChild.style.transitionDuration=a+"ms",this.m_rowEndHeader.firstChild.style.transitionDuration=a+"ms",this.m_colEndHeader.firstChild.style.transitionDuration=a+"ms"}n+=r.destination,o+=l.destination;var h=this.adjustTouchScroll(n,o);n=h[0],o=h[1],this.scrollDelta(n,o)}},D.prototype.fireEvent=function(e,t){if(null!=e&&null!=t){var i=this.callbacks[e];return null==i||i(t)}},D.prototype.addListener=function(e,t){this.callbacks[e]=t},D.prototype.setElementHeight=function(e,t){e.style.height=t+"px"},D.prototype.getElementHeight=function(e){return this.getElementDir(e,"height")},D.prototype.setElementWidth=function(e,t){e.style.width=t+"px"},D.prototype.getElementWidth=function(e){return this.getElementDir(e,"width")},D.prototype.setElementDir=function(e,t,i){e.style[i]=t+"px"},D.prototype.getElementDir=function(e,t){var i;return e.style[t].indexOf("px")>-1&&-1===e.style[t].indexOf("e")?parseFloat(e.style[t]):(document.body.contains(e)?i=Math.round(e["offset"+t.charAt(0).toUpperCase()+t.slice(1)]):(e.style.visibility="hidden",this.m_root.appendChild(e),i=Math.round(e["offset"+t.charAt(0).toUpperCase()+t.slice(1)]),this.m_root.removeChild(e),e.style.visibility=""),i)},D.prototype._computeElementWidthAndHeight=function(e){var t={};return e.style.width.indexOf("px")>-1&&-1===e.style.width.indexOf("e")&&(t.width=parseFloat(e.style.width)),e.style.height.indexOf("px")>-1&&-1===e.style.height.indexOf("e")&&(t.height=parseFloat(e.style.height)),null!=t.width&&null!=t.height||(document.body.contains(e)?(t.width=Math.round(e.offsetWidth),t.height=Math.round(e.offsetHeight)):(e.style.visibility="hidden",this.m_root.appendChild(e),t.width=Math.round(e.offsetWidth),t.height=Math.round(e.offsetHeight),this.m_root.removeChild(e),e.style.visibility="")),t},D.BEFORE=1,D.AFTER=2,D.INSIDE=3,D.prototype._isInViewport=function(e){var t=e.row,i=e.column;return-1===t&&-1===i?-1:-1===t?this._isColumnIndexInViewport(i):-1===i?this._isRowIndexInViewport(t):i>=this.m_startCol&&i<=this.m_endCol&&t>=this.m_startRow&&t<=this.m_endRow?D.INSIDE:-1},D.prototype._isAxisIndexInViewport=function(e,t){return-1===e?-1:"column"===t?this._isColumnIndexInViewport(e):"row"===t?this._isRowIndexInViewport(e):-1},D.prototype._isColumnIndexInViewport=function(e){return e<this.m_startCol?D.BEFORE:e>this.m_endCol?D.AFTER:D.INSIDE},D.prototype._isRowIndexInViewport=function(e){return e<this.m_startRow?D.BEFORE:e>this.m_endRow?D.AFTER:D.INSIDE},D.prototype._isCellBoundaryInViewport=function(e,t,i,s){var n=this._getViewportTop(),o=this._getViewportBottom(),r=this._getViewportLeft(),l=this._getViewportRight();return(s<=o&&s>n||i>=n&&i<o)&&(t<=l&&t>r||e>=r&&e<l)},D.prototype.queueModelEvent=function(e){return!(this.m_initialized&&!this.m_processingEventQueue&&!this.m_animating&&!this.m_processingModelEvent)&&(null==this.m_modelEvents&&(this.m_modelEvents=[]),this.m_modelEvents.push(e),!0)},D.prototype.handleModelEvent=function(e,t){if(void 0!==t||!this.queueModelEvent(e)){var i=e.operation,s=e.keys,n=e.indexes,o=e.result,r=e.header,l=e.endheader,a=e.silent,h=!1;if(this.m_processingModelEvent=!0,e.detail)"delete"===i&&this._handleDeleteRangeEvent(e.detail),"insert"===i&&this._handleInsertRangeEvent(e.detail),"update"===i&&this._handleUpdateRangeEvent(e.detail),"refresh"===i&&this._handleModelRefreshEvent(e.detail);else if("insert"===i)this._adjustActive(i,n),this.m_shouldFocus=!0,this._adjustSelectionOnModelChange(i,s,n),null!=o?(this._handleModelInsertRangeEvent(o,r,l),h=!0):this._handleModelInsertEvent(n,s);else if("update"===i)this._handleModelUpdateEvent(n,s,o),h=!0;else if("delete"===i){let t;if(this._isEditOrEnter()&&(t=this._getCellByIndex(this.m_active.indexes)),t){let i=this.getCellIndexes(t),s=!1;n.forEach(e=>{e.row!==i.row&&e.column!==i.column||(s=!0)}),s&&(this._handleExitEditable(e,t),this._handleExitEdit(e,t))}this._adjustSelectionOnModelChange(i,s,n),this.m_utils.supportsTransitions()?(Array.isArray(s)||(s=new Array(s)),this._handleModelDeleteEventWithAnimation(e,s),s.length>0&&(h=!0)):(this._handleModelDeleteEvent(n,s,a),this._adjustActive(i,n))}else"refresh"===i||"reset"===i?this._handleModelRefreshEvent():"sync"===i&&this._handleModelSyncEvent(e);this.m_processingModelEvent=!1,!h&&t&&this._runModelEventQueue()}},D.prototype._adjustActive=function(e,t){var i,s;if(null!=this.m_active){if("cell"===this.m_active.type)s=!1,i=this.m_active.indexes.row;else{if("header"!==this.m_active.type||"row"!==this.m_active.axis)return;s=!0,i=this.m_active.index}if(Array.isArray(t)||(t=new Array(t)),!0===this.m_moveActive){if("insert"===e)return void(s?this.m_active.index=t[0].row:this.m_active.indexes.row=t[0].row);if("delete"===e&&t[0].row===i)return}for(var n="insert"===e?1:-1,o=0;o<t.length;o++){var r=this._isDataGridProvider()?t[o]:t[o].row;r<i&&this.m_active?s?this.m_active.index+=n:this.m_active.indexes.row+=n:r===i&&"delete"===e&&this._setActive(null,null)}}},D.prototype._adjustSelectionOnModelChange=function(e,t,i){Array.isArray(t)||(t=new Array(t)),Array.isArray(i)||(i=new Array(i));var s=this.GetSelection();if(null!=t&&null!=i&&t.length===i.length&&0!==s.length)for(var n="insert"===e?1:-1,o=0;o<t.length;o++)for(var r,l=t[o].row,a=i[o].row,h=s.length-1;h>=0;h--){var d=s[h],c=d.startKey.row,m=d.endKey.row,u=d.startIndex.row,_=d.endIndex.row;if(c===l){if(m===l&&"delete"===e){s.splice(h,1);continue}r=this._getKey(this._getAxisCellsByIndex(d.startIndex.row+1,"row")[0],"row"),d.startKey.row=r,d.endIndex.row+=n}else m===l?(r=this._getKey(this._getAxisCellsByIndex(d.startIndex.row-1,"row")[0],"row"),d.endKey.row=r,d.endIndex.row+=n):a<=u?(d.startIndex.row+=n,d.endIndex.row+=n):a<_&&(d.endIndex.row+=n)}else if(this.m_moveActive&&"insert"===e){var p;if(this._isSelectionEnabled()&&this._isDatabodyCellActive())p="cell"===this.m_options.getSelectionMode()?this.createRange(this.m_active.indexes,this.m_active.indexes,t[0],t[0]):this.createRange(i[0],i[0],t[0],t[0]),this.m_selectionFrontier=this.m_active.indexes,s.push(p);this.m_moveActive=!1}},D.prototype._simpleAdjustSelectionOnChange=function(e,t,i){let s=this.GetSelection(),n="insert"===e?1:-1;for(let o=0;o<t.length;o++){let r=t[o];for(let t=s.length-1;t>=0;t--){let o=s[t],l=o.startIndex[i],a=o.endIndex[i];if(l===r){if(a===r&&"delete"===e){s.splice(t,1);continue}if("delete"===e){let e=this._getKey(this._getAxisCellsByIndex(o.startIndex[i]+1,i)[0],i);o.startKey[i]=e}else o.startIndex[i]+=n;o.endIndex[i]+=n}else if(a===r){if("delete"===e){let e=this._getKey(this._getAxisCellsByIndex(o.endIndex[i]-1,i)[0],i);o.endKey[i]=e}o.endIndex[i]+=n}else r<l?(o.startIndex[i]+=n,o.endIndex[i]+=n):r<a&&(o.endIndex[i]+=n)}}},D.prototype._handleInsertRangeEvent=function(e){let t=e.axis,i=e.ranges;if(0===i.length)return void this.fillViewport();i.sort(function(e,t){return e.offset-t.offset});let s=i.shift(),n=s.offset,o=s.count,r=this._isAxisIndexInViewport(n,t);if(r===D.INSIDE){let i=n,r=o,l=this.m_startCol,a=this.m_endCol-this.m_startCol+1;"column"===t&&(i=this.m_startRow,r=this.m_endRow-this.m_startRow+1,l=n,a=o);let h,d=document.createDocumentFragment(),c=document.createDocumentFragment(),m=new Promise(function(e){h=e}),u={axis:t,range:s,headerFragment:d,endHeaderFragment:c,totalDimension:0,promiseResolve:h};this.fetchHeaders(t,n,d,c,o,{success:this._handleInsertRangeHeaderFetchSuccess.bind(this,u),error:this.handleCellsFetchError}),this.fetchCells(this.m_databody,i,l,r,a,{success:this._handleInsertRangeCellFetchSuccess.bind(this,u),error:this.handleCellsFetchError}),m.then(this._handleInsertRangeEvent.bind(this,e))}else if(r===D.BEFORE){let i=this.m_avgRowHeight,s=i*o,r=this.m_rowHeader,l=this.m_rowEndHeader;"row"===t?(this.m_endRow>=0&&(this.m_startRow+=o,this.m_endRow+=o,this.m_startRowPixel+=s,this.m_endRowPixel+=s),this.m_endRowHeader>=0&&(this.m_startRowHeader+=o,this.m_endRowHeader+=o,this.m_startRowHeaderPixel+=s,this.m_endRowHeaderPixel+=s),this.m_endRowEndHeader>=0&&(this.m_startRowEndHeader+=o,this.m_endRowEndHeader+=o,this.m_startRowEndHeaderPixel+=s,this.m_endRowEndHeaderPixel+=s)):(i=this.m_avgColWidth,s=i*o,r=this.m_colHeader,l=this.m_colEndHeader,this.m_endCol>=0&&(this.m_startCol+=o,this.m_endCol+=o,this.m_startColPixel+=s,this.m_endColPixel+=s),this.m_endColHeader>=0&&(this.m_startColHeader+=o,this.m_endColHeader+=o,this.m_startColHeaderPixel+=s,this.m_endColHeaderPixel+=s),this.m_endColEndHeader>=0&&(this.m_startColEndHeader+=o,this.m_endColEndHeader+=o,this.m_startColEndHeaderPixel+=s,this.m_endColEndHeaderPixel+=s));let a=new Array(o).fill(n).map((e,t)=>e+t),h=new Array(o).fill(i);this._modifyAndPushCells(a,h,t,r,l,!0),this._refreshDatabodyMap(),this._handleInsertRangeEvent(e)}else r===D.AFTER&&("row"===t?(this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1):(this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1),this._handleInsertRangeEvent(e))},D.prototype._handleUpdateRangeEvent=function(e){let t=e.ranges;if(0===t.length)return this._highlightActive(),this._resetEditableClone(),this.applySelection(),this._resetHeaderHighLight(),void this.fillViewport();t.sort(function(e,t){return e.offset-t.offset});let i=t.shift(),s=i.rowOffset,n=i.columnOffset,o=-1===i.rowCount?this._getMaxBottom()+1:i.rowCount,r=-1===i.columnCount?this._getMaxRight()+1:i.columnCount,l=s+o-1,a=n+r-1,h=this._isAxisIndexInViewport(s,"row"),d=this._isAxisIndexInViewport(l,"row"),c=this._isAxisIndexInViewport(n,"column"),m=this._isAxisIndexInViewport(a,"column");if(h!==D.AFTER&&d!==D.BEFORE&&c!==D.AFTER&&m!==D.BEFORE){let t;h===D.BEFORE&&(s=this._getMaxTop()),d===D.AFTER&&(l=this._getMaxBottom()),c===D.BEFORE&&(n=this._getMaxLeft()),m===D.AFTER&&(a=this._getMaxRight()),o=l-s+1,r=a-n+1;let u,_,p=!1;-1!==i.rowCount&&-1!==i.columnCount||(p=!0,t=-1===i.rowCount?"column":"row"),"row"===t?(u=s,_=o):"column"===t&&(u=n,_=r);let g,f=document.createDocumentFragment(),C=document.createDocumentFragment(),y=new Promise(function(e){g=e}),v={axis:t,range:i,headerFragment:f,endHeaderFragment:C,totalDimension:0,promiseResolve:g};this.m_fetchingForUpdate=!0,p?(v.editHeader=!0,this.fetchHeaders(t,u,f,void 0,_,{success:this._handleInsertRangeHeaderFetchSuccess.bind(this,v),error:this.handleHeadersFetchError}),this.fetchCells(this.m_databody,s,n,o,r,{success:this._handleUpdateEditableHeader.bind(this,v),error:this.handleCellsFetchError})):this.fetchCells(this.m_databody,s,n,o,r,{success:this._handleUpdateRangeFetchSuccess.bind(this,v),error:this.handleCellsFetchError}),y.then(this._handleUpdateRangeEvent.bind(this,e))}else this._handleUpdateRangeEvent(e)},D.prototype._handleUpdateEditableHeader=function(e,t,i){this.m_fetchingForUpdate=!1;let s,n,o=e,r=o.range,l=o.axis,a=o.editHeader;"column"===l?(s=r.columnOffset,n=r.columnCount):"row"===l&&(s=r.rowOffset,n=r.rowCount);let h={axis:l,ranges:[{offset:s,count:n}],editHeader:a};this._handleDeleteRangeEvent(h),delete o.range,o.range={offset:s,count:n},this._handleInsertRangeCellFetchSuccess(o,t,i),this._signalTaskEnd()},D.prototype._handleInsertRangeHeaderFetchSuccess=function(e,t,i,s){const n=i.axis;this._signalTaskEnd(),this.m_fetching[n]=!1;const o=this.getResources().isRTLMode()?"right":"left",r=i.start,l=e.headerFragment,a=e.endHeaderFragment,h="row"===n?"top":o;let d,c,m,u,_,p,g,f,C,y,v,E,w=0,S=0;if(null!=t){for(f=this.getMappedStyle("headercell"),"row"===n?(d=this.m_rowHeader,c=this.m_startRowHeader,y=this.m_rowHeaderLevelCount,f+=" "+this.getMappedStyle("rowheadercell")):(d=this.m_colHeader,c=this.m_startColHeader,y=this.m_columnHeaderLevelCount,f+=" "+this.getMappedStyle("colheadercell")),m=this._getHeaderByIndex(r,y-1,d,y,c),u=this.getElementDir(m,h),_=t.getCount(),C=this.getRendererOrTemplate(n);_-w>0;)"row"===n?(v=0,E=u+S):(v=u+S,E=0),p=r+w,g=this.buildLevelHeaders(l,p,0,v,E,!0,!1,C,t,n,f,y),w+=g.count,S+=g.totalHeaderDimension;S>e.totalDimension&&(e.totalDimension=S)}if(S=0,w=0,null!=s){for(f=this.getMappedStyle("endheadercell"),"row"===n?(d=this.m_rowEndHeader,c=this.m_startRowEndHeader,y=this.m_rowEndHeaderLevelCount,f+=" "+this.getMappedStyle("rowendheadercell")):(d=this.m_colEndHeader,c=this.m_startColEndHeader,y=this.m_columnEndHeaderLevelCount,f+=" "+this.getMappedStyle("colendheadercell")),m=this._getHeaderByIndex(r,y-1,d,y,c),u=this.getElementDir(m,h),_=s.getCount(),C=this.getRendererOrTemplate(n+"End");_-w>0;)"row"===n?(v=0,E=u+S):(v=u+S,E=0),p=r+w,g=this.buildLevelHeaders(a,p,0,v,E,!0,!1,C,s,n+"End",f,y),w+=g.count,S+=g.totalHeaderDimension;S>e.totalDimension&&(e.totalDimension=S)}},D.prototype._handleInsertRangeCellFetchSuccess=function(e,t,i){const s=e.range,n=e.axis,o=e.editHeader,r=e.headerFragment,l=e.endHeaderFragment;let a=e.totalDimension;const h=this.getResources().isRTLMode()?"right":"left",d=document.createDocumentFragment();let c=this.m_rowHeader,m=this.m_rowEndHeader;if("column"===n&&(c=this.m_colHeader,m=this.m_colEndHeader),this._signalTaskEnd(),this.m_fetching.cells=!1,o||this.unhighlightSelection(),t){const e=i[0].start,s=i[1].start,o=this._getCellByIndex(this.createIndex(e,s));let r,l;o?(r="row"===n?this.getElementDir(o,"top"):this.m_startRowPixel,l="row"===n?this.m_startColPixel:this.getElementDir(o,h)):(r="row"===n?this._getMaxBottomPixel():this.m_startRowPixel,l="row"===n?this.m_startColPixel:this._getMaxRightPixel());const c=this._addCellsToFragment(d,t,e,r,s,l);a=Math.max(a,"row"===n?c.totalRowHeight:c.totalColumnWidth)}const u=s.offset,_=s.count;let p=new Array(_).fill(u).map((e,t)=>e+t),g=new Array(_).fill(a/_),f=d.childNodes.length,C=r.childNodes.length,y=l.childNodes.length;const v=this.m_databody.firstChild;if(this._modifyAndPushCells(p,g,n,c,m,!0),o||this._simpleAdjustSelectionOnChange("insert",p,n),d.childNodes.length&&(v.appendChild(d),this._refreshDatabodyMap()),this._insertHeaders(n,u,r,l),this.hideStatusText(),"row"===n){f&&(this.m_endRow+=_,this.m_endRowPixel+=a,this.m_stopRowFetch=!1),C&&(this.m_endRowHeader+=_,this.m_endRowHeaderPixel+=a,this.m_stopRowHeaderFetch=!1),y&&(this.m_endRowEndHeader+=_,this.m_endRowEndHeaderPixel+=a,this.m_stopRowEndHeaderFetch=!1);let e=this.getElementHeight(v)+a;this.setElementHeight(v,e),this.updateRowBanding()}else if("column"===n){f&&(this.m_endCol+=_,this.m_endColPixel+=a,this.m_stopColumnFetch=!1),C&&(this.m_endColHeader+=_,this.m_endColHeaderPixel+=a,this.m_stopColumnHeaderFetch=!1),y&&(this.m_endColEndHeader+=_,this.m_endColEndHeaderPixel+=a,this.m_stopColumnEndHeaderFetch=!1);var E=this.getElementWidth(v)+a;this.setElementWidth(v,E),this.updateColumnBanding()}o||(this.applySelection(),this._resetHeaderHighLight(),this.resizeGrid()),e.promiseResolve()},D.prototype._insertHeaders=function(e,t,i,s){let n,o=this.m_rowHeader,r=this.m_rowEndHeader,l=this.m_rowHeaderLevelCount,a=this.m_rowEndHeaderLevelCount,h=this.m_startRowHeader,d=this.m_startRowEndHeader,c="height",m="top";"column"===e&&(o=this.m_colHeader,r=this.m_colEndHeader,l=this.m_columnHeaderLevelCount,a=this.m_columnEndHeaderLevelCount,h=this.m_startColHeader,d=this.m_startColEndHeader,c="width",m=this.getResources().isRTLMode()?"right":"left");let u=(e,t,i,s,n,o)=>{for(;e.childNodes.length;){let r,l=e.firstChild;if(this.m_utils.containsCSSClassName(l,this.getMappedStyle("groupingcontainer"))){if(r=l.firstChild,null==r||this.m_utils.containsCSSClassName(r,this.getMappedStyle("groupingcontainer"))){e.removeChild(l);continue}}else r=l;let a=r.extentInfo,h=a.more.before,d=a.more.after,c=r[this.getResources().getMappedAttribute("context")],m=c.index,_=c.extent,p=c.level;if(h){let e=this._getHeaderContainer(m-1,p,0,null,t,i),s=e.firstChild,l=s[this.getResources().getMappedAttribute("context")];c.extent+=l.extent,c.index=l.index;let a=this._getAttribute(e,"extent",!0);this._setAttribute(e,"extent",a+_);let h=this.getElementDir(s,n),d=this.getElementDir(r,n);this.setElementDir(r,h+d,n);let u=this.getElementDir(s,o);this.setElementDir(r,u,o),e.replaceChild(r,s)}else if(d){let e=this._getHeaderContainer(m+_,p,0,null,t,i),s=e.firstChild,l=s[this.getResources().getMappedAttribute("context")];c.extent+=l.extent,c.index=l.index-_;let a=this._getAttribute(e,"extent",!0);this._setAttribute(e,"extent",a+_);let h=this._getAttribute(e,"start",!0);this._setAttribute(e,"start",h-_);let d=this.getElementDir(s,n),u=this.getElementDir(r,n);this.setElementDir(r,d+u,n);let g=this.getElementDir(s,o);this.setElementDir(r,g-u,o),e.replaceChild(r,s)}else{let e=this._getHeaderContainer(m,p,0,null,t,i);if(e){let n=this._getHeaderByIndex(m-1,p,t,i,s);if(null===n||n.parentNode!==e){let t=p===i-1?e.childNodes[1]:e.childNodes[0];e.insertBefore(r,t)}else n.nextSibling&&n.nextSibling.parentNode===e?e.insertBefore(r,n.nextSibling):e.appendChild(r)}else{let e=this._getHeaderContainer(m-1,p,0,null,t,i);if(null===e){let e=t.firstChild;e.firstChild?e.insertBefore(l,e.firstChild):e.appendChild(l)}else e.nextSibling?e.parentNode.insertBefore(l,e.nextSibling):e.parentNode.appendChild(l)}}if(h||d){let e=l.querySelector("."+this.getMappedStyle("groupingcontainer"));e&&u(e,t,i,s,n,o)}}};i.childNodes.length&&(1===l?(n=this._getHeaderByIndex(t,l-1,o,l,h),o.firstChild.insertBefore(i,n)):u(i,o,l,h,c,m)),s.childNodes.length&&(1===a?(n=this._getHeaderByIndex(t,a-1,r,a,d),r.firstChild.insertBefore(s,n)):u(s,r,a,d,c,m))},D.prototype._handleModelInsertEvent=function(e,t){var i=this._isInViewport(e);if(i===D.INSIDE||i===D.AFTER&&e.row===this.m_endRow+1)null!=t.row&&(this._databodyEmpty()?(this.empty(),this.refresh(this.m_root)):(this._modifyAxisCellContextIndex("row",e.row,this.m_endRow-e.row+1,1),this._refreshDatabodyMap(),this.fetchHeaders("row",e.row,this.m_rowHeader,this.m_rowEndHeader,1,{success:this._handleHeaderInsertsFetchSuccess}),this.fetchCells(this.m_databody,e.row,this.m_startCol,1,this.m_endCol-this.m_startCol+1,{success:this._handleCellInsertsFetchSuccess})));else{if(i===D.BEFORE){this._modifyAxisCellContextIndex("row",0,this.m_endRow+1,1),this._refreshDatabodyMap(),this.m_startRow+=1,this.m_startRowHeader+=1,this.m_endRow+=1,this.m_endRowHeader+=1,this.m_startRowPixel+=this.m_avgRowHeight,this.m_startRowHeaderPixel+=this.m_avgRowHeight,this.m_endRowPixel+=this.m_avgRowHeight,this.m_endRowHeaderPixel+=this.m_avgRowHeight;var s=this.m_databody.firstChild.firstChild;null!=s&&this.pushRowsDown(s,this.m_avgRowHeight);var n=this.m_rowHeader.firstChild.firstChild;null!=n&&this.pushRowsDown(n,this.m_avgRowHeight);var o=this.m_rowEndHeader.firstChild.firstChild;null!=o&&this.pushRowsDown(o,this.m_avgRowHeight)}this.scrollToIndex(e)}},D.prototype._handleCellInsertsFetchSuccess=function(e,t){this.m_resizeRequired=!0,this.handleCellsFetchSuccess(e,t,this.m_endRow>=t[0].start);var i=t[0].start;this._scrollRowIntoViewport(i),this._isHighWatermarkScrolling()||this._cleanupViewport("top"),this.updateRowBanding(),this.m_stopRowFetch=!1,-1!==this.m_endRowHeader&&(this.m_stopRowHeaderFetch=!1),-1!==this.m_endRowEndHeader&&(this.m_stopRowEndHeaderFetch=!1),this.fillViewport()},D.prototype._handleHeaderInsertsFetchSuccess=function(e,t,i){this.m_resizeRequired=!0,this.handleHeadersFetchSuccess(e,t,i,this.m_endRowHeader>=t.start)},D.prototype._scrollRowIntoViewport=function(e){var t=this._getAxisCellsByIndex(e,"row");if(null!=t){var i=this._getViewportTop(),s=this._getViewportBottom(),n=this.getElementDir(t[0],"top"),o=i-n;(o>0||(o=s-n)<0)&&this.scrollDelta(0,o)}},D.prototype._handleModelInsertRangeEvent=function(e,t,i){var s,n,o,r,l,a,h,d,c=this._getEmptyElement(),m=e.getStart("row"),u=e.getCount("row"),_=e.getStart("column"),p=e.getCount("column");if(!(m>this.m_endRow+1))if(c)this.empty(),this.refresh(this.m_root);else if(this.m_utils.supportsTransitions()){if(null!=t){s=document.createDocumentFragment();var g=t.getCount();for(r=0,n=0,a=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell"),h=this.getRendererOrTemplate("row");g-n>0;)o=m+n,n+=(l=this.buildLevelHeaders(s,o,0,0,r,!0,m!==this.m_endRowHeader+1,h,t,"row",a,this.m_rowHeaderLevelCount)).count,r+=l.totalHeaderDimension}if(null!=i){d=document.createDocumentFragment();var f=i.getCount();for(r=0,n=0,a=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell"),h=this.getRendererOrTemplate("rowEnd");f-n>0;)o=m+n,n+=(l=this.buildLevelHeaders(d,o,0,0,r,!0,m!==this.m_endRowEndHeader+1,h,i,"rowEnd",a,this.m_rowEndHeaderLevelCount)).count,r+=l.totalHeaderDimension}var C=document.createDocumentFragment();if(l=this._addCellsToFragment(C,e,m,0,_,0),!(0!==C.childNodes.length||null!=s&&0!==s.childNodes.length||null!=d&&0!==d.childNodes.length))return;this._insertRowsWithAnimation(C,s,d,m,e.getCount("row"),l.totalRowHeight,_,p)}else{var y={axis:"row",start:m,count:u},v={axis:"column",start:_,count:p};if(null!=t){var E={axis:"row",header:this.m_rowHeader,endHeader:this.m_rowEndHeader,start:m,count:t.getCount()};this.m_fetching.row=E,this._handleHeaderInsertsFetchSuccess(t,E,i)}this._modifyAxisCellContextIndex("row",m,this.m_endRow-m+1,u),this._refreshDatabodyMap(),this._handleCellInsertsFetchSuccess(e,[y,v])}},D.prototype._handleModelUpdateEvent=function(e,t,i){if(this._isInViewport(e)===D.INSIDE)if(null!=i){var s=this.getRendererOrTemplate("cell"),n=this.m_options.getColumnBandingInterval();this._updateCellsInRow(i,i.getStart("row"),s,this.m_startCol,n)}else-1!==this.m_endRowHeader&&this.fetchHeaders("row",e.row,this.m_rowHeader,this.m_rowEndHeader,1,{success:this._handleHeaderUpdatesFetchSuccess,error:this.handleHeadersFetchError}),this.fetchCells(this.m_databody,e.row,this.m_startCol,1,this.m_endCol-this.m_startCol+1,{success:this._handleCellUpdatesFetchSuccess,error:this.handleCellsFetchError})},D.prototype._handleHeaderUpdatesFetchSuccess=function(e,t,i){var s=t.axis;this.m_fetching[s]=!1;var n=t.start;this._replaceHeaders(this.buildRowHeaders.bind(this),e,this.m_rowHeader,n,this.m_startRowHeader),this._replaceHeaders(this.buildRowEndHeaders.bind(this),i,this.m_rowEndHeader,n,this.m_startRowEndHeader);var o=this.m_rowHeader.firstChild.childNodes[n-this.m_startRowHeader];null==this.m_active||"header"!==this.m_active.type||"row"!==this.m_active.axis&&"rowEnd"!==this.m_active.axis||this._getKey(o,"row")!==this.m_active.key||this._highlightActive(),this._signalTaskEnd()},D.prototype._replaceHeaders=function(e,t,i,s,n){if(null!=t){var o=e(i,t,s,1,!0,!0),r=i.firstChild,l=r.childNodes[s-n];r.replaceChild(o,l)}},D.prototype._handleCellUpdatesFetchSuccess=function(e,t){this.m_fetching.cells=!1;var i=t[0].start,s=this.getRendererOrTemplate("cell"),n=this.m_options.getColumnBandingInterval();this._updateCellsInRow(e,i,s,this.m_startCol,n),this._signalTaskEnd()},D.prototype._getUpdateAnimationDuration=function(){return D.UPDATE_ANIMATION_DURATION},D.prototype._updateCellsInRow=function(e,t,i,s,n){var o,r=this._getUpdateAnimationDuration(),l=this._getAxisCellsByIndex(t,"row"),a=this.getElementDir(l[0],"top");if(0!==r&&this.m_utils.supportsTransitions()){var h=this;h._signalTaskStart(),this._removeFromArray(l),o=document.createDocumentFragment(),this._addCellsToFragment(o,e,t,a,s,this.m_startColPixel),l=o.childNodes;for(var d=this.getElementWidth(this.m_databody),c=0;c<l.length;c++)this.addTransformMoveStyle(l[c],0,0,"linear",d,0,0);this._populateDatabody(this.m_databody.firstChild,o),l=this._getAxisCellsByIndex(t,"row"),this.hideStatusText();this._onTransitionEnd(l[l.length-1],function(){for(var e=0;e<l.length;e++)h.removeTransformMoveStyle(l[e]);h._isSelectionEnabled()&&h.applySelection(),h._highlightActive(),h._signalTaskEnd(),h._runModelEventQueue()},r),setTimeout(function(){for(var e=0;e<l.length;e++)h.addTransformMoveStyle(l[e],r+"ms",0,"linear",0,0,0)},0)}else this._removeFromArray(l),o=document.createDocumentFragment(),this._addCellsToFragment(o,e,t,a,s,this.m_startColPixel),this._populateDatabody(this.m_databody.firstChild,o),this._isSelectionEnabled()&&this.applySelection(),this._highlightActive(),this.hideStatusText()},D.prototype._handleUpdateRangeFetchSuccess=function(e,t,i){this.m_fetching.cells=!1,this.m_fetchingForUpdate=!1;const s=i[0].start,n=s+t.getCount("row")-1,o=i[1].start,r=o+t.getCount("column")-1;var l=this._getCellsInRange(s,o,n,r);const a=this.getElementDir(l[0],"top"),h=this.getResources().isRTLMode()?"right":"left",d=this.getElementDir(l[0],h);this._removeFromArray(l);let c=document.createDocumentFragment();this._addCellsToFragment(c,t,s,a,o,d),this._populateDatabody(this.m_databody.firstChild,c),this.hideStatusText(),this._signalTaskEnd(),e.promiseResolve()},D.prototype._removeAndModifyCells=function(e,t){e.forEach(e=>{let i=e[this.getResources().getMappedAttribute("context")];1===i.extents[t]?this._remove(e):i.extent[t]-=1})},D.prototype._removeAndModifyHeaders=function(e,t,i,s,n){e.forEach(e=>{let o=e[this.getResources().getMappedAttribute("context")],r=o.extent,l=e.parentNode;if(1===r)this._remove(e),0!==l.childNodes.length||l.classList.contains(this.getMappedStyle("scroller"))||this._remove(l);else{let r=this.getElementDir(e,i);this.setElementDir(e,r-t,i),o.extent-=1;let a=o.index;if(a===n){o.index+=1;let i=this.getElementDir(e,s);this.setElementDir(e,i+t,s)}if(l.classList.contains(this.getMappedStyle("groupingcontainer"))){let e=this._getAttribute(l,"extent",!0),t=this._getAttribute(l,"start",!0);this._setAttribute(l,"extent",e-1),a===n&&this._setAttribute(l,"start",t+1)}}})},D.prototype._handleDeleteRangeEvent=function(e){let t=e.ranges,i=new Set,s=e.axis,n=e.editHeader,o=this.getResources().isRTLMode()?"right":"left",r=this.m_selection;for(let e=0;e<r.length;e++)this._applyBorderClassesAroundRange(this.getElementsInRange(r[e]),r[e],!1,"Selected");t.forEach(function(e){let t=e.offset,s=e.count;for(var n=0;n<s;n++)i.add(t+n)});let l=Array.from(i);l.sort(function(e,t){return t-e});let a=0,h=0,d=0,c=0,m=0,u=this.m_rowHeader,_=this.m_startRowHeader,p=this.m_startRowEndHeader,g=this.m_rowEndHeader,f=this.m_rowHeaderLevelCount,C=this.m_rowEndHeaderLevelCount,y=this.m_avgRowHeight,v=-1!==this.m_endRow,E=-1!==this.m_endRowHeader,w=-1!==this.m_endRowEndHeader,S="height",H="top";"column"===s&&(_=this.m_startColHeader,p=this.m_startColEndHeader,u=this.m_colHeader,g=this.m_colEndHeader,f=this.m_columnHeaderLevelCount,C=this.m_columnEndHeaderLevelCount,y=this.m_avgColWidth,v=-1!==this.m_endCol,E=-1!==this.m_endColHeader,w=-1!==this.m_endColEndHeader,S="width",H=o);let x,b=[];if(this._isEditOrEnter()&&(x=this._getCellByIndex(this.m_active.indexes)),x){let t=this.getCellIndexes(x),i=!1;l.forEach(e=>{("row"===s&&e===t.row||"column"===s&&e===t.column)&&(i=!0)}),i&&(this._handleExitEditable(e,x),this._handleExitEdit(e,x))}for(let e=0;e<l.length;e++){let t=l[e],i=0,n=this._isAxisIndexInViewport(t,s);if(n===D.BEFORE||n===D.INSIDE){if(n===D.BEFORE)c+=1,i=y,a+=i;else if(n===D.INSIDE){m+=1,i=this.getElementDir(this._getCellOrHeaderByIndex(t,s),S),h+=i;let e=this._getAxisCellsByIndex(t,s);null!=e&&(this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]),this._removeAndModifyCells(e,s));let n=this._getHeadersByIndex(t,u,f,_);n.length&&this._removeAndModifyHeaders(n,i,S,H,t);let o=this._getHeadersByIndex(t,g,C,p);o.length&&this._removeAndModifyHeaders(o,i,S,H,t)}b.unshift(i)}else n===D.AFTER&&"scroll"===this.m_options.getScrollPolicy()&&(d+=i)}if(l.reverse(),this._modifyAndPushCells(l,b,s,u,g,!1),this._refreshDatabodyMap(),!n){let t;this._adjustActive("delete",l),this._simpleAdjustSelectionOnChange("delete",l.reverse(),s);let i={};if(this.m_active&&"cell"===this.m_active.type&&(Object.assign(i,this.m_active.indexes),t=this._getCellByIndex(i),"row"===s))for(;!t&&i.row-1>0;)i.row-=1,t=this._getCellByIndex(i);t&&(this._setActiveByIndex(i,e),this._highlightActive())}var R=a+h+d,I=this.m_databody.firstChild;if("row"===s){v&&(this.m_startRow-=c,this.m_endRow=this.m_endRow-c-m,this.m_startRowPixel-=a,this.m_endRowPixel=this.m_endRowPixel-a-h,this.m_stopRowFetch=!1),E&&(this.m_startRowHeader-=c,this.m_endRowHeader=this.m_endRowHeader-c-m,this.m_startRowHeaderPixel-=a,this.m_endRowHeaderPixel=this.m_endRowHeaderPixel-a-h,this.m_stopRowHeaderFetch=!1),w&&(this.m_startRowEndHeader-=c,this.m_endRowEndHeader=this.m_endRowEndHeader-c-m,this.m_startRowEndHeaderPixel-=a,this.m_endRowEndHeaderPixel=this.m_endRowEndHeaderPixel-a-h,this.m_stopRowEndHeaderFetch=!1);var M=this.getElementHeight(I)-R;this.setElementHeight(I,M),this.updateRowBanding()}else if("column"===s){v&&(this.m_startCol-=c,this.m_endCol=this.m_endCol-c-m,this.m_startColPixel-=a,this.m_endColPixel=this.m_endColPixel-a-h,this.m_stopColumnFetch=!1),E&&(this.m_startColHeader-=c,this.m_endColHeader=this.m_endColHeader-c-m,this.m_startColHeaderPixel-=a,this.m_endColHeaderPixel=this.m_endColHeaderPixel-a-h,this.m_stopColumnHeaderFetch=!1),w&&(this.m_startColEndHeader-=c,this.m_endColEndHeader=this.m_endColEndHeader-c-m,this.m_startColEndHeaderPixel-=a,this.m_endColEndHeaderPixel=this.m_endColEndHeaderPixel-a-h,this.m_stopColumnEndHeaderFetch=!1);var L=this.getElementWidth(I)-R;this.setElementWidth(I,L),this.updateColumnBanding()}if(!n){this.applySelection(),this.m_utils.isTouchDevice()&&(this.GetSelection().length?this._moveTouchSelectionAffordance():this._removeTouchSelectionAffordance(!0)),this.resizeGrid(),this.m_resizeRequired=!0;let e=this;Promise.resolve().then(()=>{null!=e.m_modelEvents&&0===e.m_modelEvents.length&&e.fillViewport()})}},D.prototype._handleModelDeleteEvent=function(e,t,i){var s,n,o,r;Array.isArray(t)||(t=new Array(t),e=new Array(e));for(var l=0,a=0,h=0,d=0,c=0,m=0;m<t.length;m++){var u=t[m],_=e[m];if(null!=u.row){var p=0,g=u.row,f=this._isInViewport(_);f===D.BEFORE?(this._modifyAxisCellContextIndex("row",this.m_startRow,this.m_endRow-this.m_startRow+1,-1),d+=1,l+=this.m_avgRowHeight,this.m_startRowPixel-=this.m_avgRowHeight,this.m_endRowPixel-=this.m_avgRowHeight,-1!==this.m_endRowHeader&&(this.m_startRowHeaderPixel-=this.m_avgRowHeight,this.m_endRowHeaderPixel-=this.m_avgRowHeight),null!=(r=this._getAxisCellsByKey(g,"row"))&&this.pushRowsUp(this.m_startRow,this.m_avgRowHeight),null!=(n=this.m_rowHeader.firstChild.firstChild)&&this.pushRowHeadersUp(n,this.m_avgRowHeight),null!=(o=this.m_rowEndHeader.firstChild.firstChild)&&this.pushRowHeadersUp(o,this.m_avgRowHeight)):f===D.INSIDE?(c+=1,null!=(r=this._getAxisCellsByKey(g,"row"))&&(p=this.calculateRowHeight(r[0]),_=r[0][this.getResources().getMappedAttribute("context")].indexes.row,this._modifyAxisCellContextIndex("row",_+1,this.m_endRow-_,-1),this._removeFromArray(r),this.pushRowsUp(_,p),this.m_endRowPixel-=p),null!=(n=this._findHeaderByKey(g,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(p=this.calculateRowHeaderHeight(n),s=n.nextSibling,this._remove(n),this.pushRowHeadersUp(s,p),this.m_endRowHeaderPixel-=p),null!=(o=this._findHeaderByKey(g,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")))&&(p=this.calculateRowHeaderHeight(o),s=o.nextSibling,this._remove(o),this.pushRowHeadersUp(s,p),this.m_endRowEndHeaderPixel-=p),a+=p):"scroll"===this.m_options.getScrollPolicy()&&(h+=this.m_avgRowHeight)}}this._refreshDatabodyMap(),this.m_startRow-=d,this.m_endRow=this.m_endRow-d-c,-1!==this.m_endRowHeader&&(this.m_startRowHeader-=d,this.m_endRowHeader=this.m_endRowHeader-d-c),-1!==this.m_endRowEndHeader&&(this.m_startRowEndHeader-=d,this.m_endRowEndHeader=this.m_endRowEndHeader-d-c);var C=l+a+h,y=this.m_databody.firstChild,v=this.getElementHeight(y)-C;this.setElementHeight(y,v),this.resizeGrid(),i||!0===this.m_moveActive||(this.m_resizeRequired=!0,this.m_stopRowFetch=!1,-1!==this.m_endRowHeader&&(this.m_stopRowHeaderFetch=!1),-1!==this.m_endRowEndHeader&&(this.m_stopRowEndHeaderFetch=!1),this.fillViewport()),this.updateRowBanding()},D.prototype._handleModelDeleteEventWithAnimation=function(e,t){this._collapseRowsWithAnimation(e,t)},D.prototype._collapseRowsWithAnimation=function(e,t){var i,s,n,o,r,l,a,h;let d=e.indexes;if(0!==t.length){var c=this;c._signalTaskStart();var m=this.m_processingEventQueue?1:D.COLLAPSE_ANIMATION_DURATION,u=[],_=0,p=-1!==this.m_endRowHeader,g=-1!==this.m_endRowEndHeader,f=this.m_databody.firstChild,C=this._getIndex(this._getAxisCellsByKey(t[0].row,"row")[0],"row")-1;for(s=C;s>=this.m_startRow&&(i=this._getAxisCellsByIndex(s,"row"),!(this.getElementDir(i[0],"top")+this.getElementHeight(i[0])<this.m_currentScrollTop));s--)for(n=0;n<i.length;n++)this.changeStyleProperty(i[n],this.getCssSupport("z-index"),10);if(p)for(r=[],o=this._findHeaderByKey(t[0].row,this.m_rowHeader,this.getMappedStyle("rowheadercell")).previousSibling;o&&!(this.getElementDir(o,"top")+this.getElementHeight(o)<this.m_currentScrollTop);)this.changeStyleProperty(o,this.getCssSupport("z-index"),10),o=o.previousSibling;if(g)for(l=[],o=this._findHeaderByKey(t[0].row,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")).previousSibling;o&&!(this.getElementDir(o,"top")+this.getElementHeight(o)<this.m_currentScrollTop);)this.changeStyleProperty(o,this.getCssSupport("z-index"),10),o=o.previousSibling;for(s=0;s<t.length;s++){var y=t[s].row;if((i=this._getAxisCellsByKey(y,"row")).length)for(u.push(i),_+=this.getElementHeight(i[0]),n=0;n<i.length;n++)this.setElementDir(i[n],this.getElementDir(i[n],"top")-_,"top"),this.addTransformMoveStyle(i[n],0,0,"linear",0,_,0);p&&null!=(a=this._findHeaderByKey(y,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(r.push(a),this.setElementDir(a,this.getElementDir(a,"top")-_,"top"),this.addTransformMoveStyle(a,0,0,"linear",0,_,0)),g&&null!=(h=this._findHeaderByKey(y,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")))&&(l.push(h),this.setElementDir(h,this.getElementDir(h,"top")-_,"top"),this.addTransformMoveStyle(h,0,0,"linear",0,_,0))}for(s=C+t.length+1;s<=this.m_endRow;s++){for(i=this._getAxisCellsByIndex(s,"row"),n=0;n<i.length;n++)this.setElementDir(i[n],this.getElementDir(i[n],"top")-_,"top"),this.addTransformMoveStyle(i[n],0,0,"linear",0,_,0);p&&(a=a.nextSibling,this.setElementDir(a,this.getElementDir(a,"top")-_,"top"),this.addTransformMoveStyle(a,0,0,"linear",0,_,0)),g&&(h=h.nextSibling,this.setElementDir(h,this.getElementDir(h,"top")-_,"top"),this.addTransformMoveStyle(h,0,0,"linear",0,_,0))}var v=this._getCellByIndex(this.createIndex(this.m_endRow,this.m_endCol));c._onTransitionEnd(v,function(){u.length&&c._modifyAxisCellContextIndex("row",C+t.length+1,c.m_endRow-(C+t.length),-1*t.length),p&&r.length&&c._modifyAxisHeaderContextIndex("row",C+t.length+1,c.m_endRow-(C+t.length),-1*t.length),g&&l.length&&c._modifyAxisHeaderContextIndex("rowEnd",C+t.length+1,c.m_endRow-(C+t.length),-1*t.length);for(var e=0;e<u.length;e++){for(var i=0;i<u[e].length;i++)c._remove(u[e][i]);p&&c._remove(r[e]),g&&c._remove(l[e])}c._adjustActive("delete",d),c._refreshDatabodyMap(),c._isEditOrEnter()&&(c._highlightActiveObject(c.m_active,c.m_prevActive),c._updateEdgeCellBorders("")),c.m_endRow-=u.length,c.m_endRowPixel-=_,c.m_stopRowFetch=!1,p&&(c.m_endRowHeader-=r.length,c.m_endRowHeaderPixel-=_,c.m_stopRowHeaderFetch=!1),g&&(c.m_endRowEndHeader-=r.length,c.m_endRowEndHeaderPixel-=_,c.m_stopRowEndHeaderFetch=!1),c.setElementHeight(f,c.m_endRowPixel-c.m_startRowPixel),c.resizeGrid(),c.updateRowBanding(),null==c.m_modelEvents||0!==c.m_modelEvents.length||c.m_moveActive||c.fillViewport(),c._handleAnimationEnd()},m),this.m_animating=!0,setTimeout(function(){for(s=C+1;s<=c.m_endRow;s++){for(i=c._getAxisCellsByIndex(s,"row"),n=0;n<i.length;n++)c.addTransformMoveStyle(i[n],m+"ms",0,"ease-out",0,0,0);p&&(a=c._getHeaderByIndex(s,0,c.m_rowHeader,c.m_rowHeaderLevelCount,c.m_startRowHeader),c.addTransformMoveStyle(a,m+"ms",0,"ease-out",0,0,0)),g&&(h=c._getHeaderByIndex(s,0,c.m_rowEndHeader,c.m_rowEndHeaderLevelCount,c.m_startRowEndHeader),c.addTransformMoveStyle(h,m+"ms",0,"ease-out",0,0,0))}},0)}},D.prototype._handleAnimationEnd=function(){var e,t=this.m_databody.firstChild,i=this.m_rowHeader.firstChild,s=this.m_rowEndHeader.firstChild;for(e=0;e<t.childNodes.length;e++)this.removeTransformMoveStyle(t.childNodes[e]),this.changeStyleProperty(t.childNodes[e],this.getCssSupport("z-index"),null,"remove");if(-1!==this.m_endRowHeader)for(e=0;e<i.childNodes.length;e++)this.removeTransformMoveStyle(i.childNodes[e]),this.changeStyleProperty(i.childNodes[e],this.getCssSupport("z-index"),null,"remove");if(-1!==this.m_endRowEndHeader)for(e=0;e<s.childNodes.length;e++)this.removeTransformMoveStyle(s.childNodes[e]),this.changeStyleProperty(s.childNodes[e],this.getCssSupport("z-index"),null,"remove");this.m_animating=!1,this._runModelEventQueue(),this._signalTaskEnd()},D.prototype._getCellOrHeaderByKey=function(e,t){var i=null,s=this._getAxisCellsByKey(e,t,!0);return null!=s&&s.length>0&&(i=s[0]),null==i&&("row"===t?null==(i=this._findHeaderByKey(e,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(i=this._findHeaderByKey(e,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell"))):"column"===t&&null==(i=this._findHeaderByKey(e,this.m_colHeader,this.getMappedStyle("colheadercell")))&&(i=this._findHeaderByKey(e,this.m_colEndHeader,this.getMappedStyle("colendheadercell")))),i},D.prototype._findHeaderByKey=function(e,t,i){if(null==t)return null;var s;s=t.getElementsByClassName?t.getElementsByClassName(i):t.childNodes;for(var n=0;n<s.length;n++){var o=s[n],r=this._getKey(o);if(this._shallowThenDeepCompare(r,e))return o}return null},D.prototype._handleModelRefreshEvent=function(){var e=this.getVisibility();this.m_focusOnRefresh=this.m_root.contains(document.activeElement),this.m_updateScrollPostionOnRefreshCallback(),e===D.VISIBILITY_STATE_VISIBLE?(this.empty(),null!=this.m_root.offsetParent?this.refresh(this.m_root):this.setVisibility(D.VISIBILITY_STATE_REFRESH)):e===D.VISIBILITY_STATE_HIDDEN&&(this.empty(),this.setVisibility(D.VISIBILITY_STATE_REFRESH))},D.prototype._handleModelSyncEvent=function(e){var t=e.pageSize;this.m_fetching={},this.m_startRow=0,this.m_endRow=-1,this.m_startRowHeader=0,this.m_endRowHeader=-1,this.m_startRowEndHeader=0,this.m_endRowEndHeader=-1,this.m_startRowPixel=0,this.m_endRowPixel=0,this.m_startRowHeaderPixel=0,this.m_endRowHeaderPixel=0,this.m_startRowEndHeaderPixel=0,this.m_endRowEndHeaderPixel=0,this.m_startCol=0,this.m_endCol=-1,this.m_startColHeader=0,this.m_endColHeader=-1,this.m_startColEndHeader=0,this.m_endColEndHeader=-1,this.m_startColPixel=0,this.m_endColPixel=0,this.m_startColHeaderPixel=0,this.m_endColHeaderPixel=0,this.m_startColEndHeaderPixel=0,this.m_endColEndHeaderPixel=0,this.m_rowHeaderLevelCount=void 0,this.m_columnHeaderLevelCount=void 0,this.m_rowEndHeaderLevelCount=void 0,this.m_columnEndHeaderLevelCount=void 0,this.m_avgRowHeight=void 0,this.m_avgColWidth=void 0,this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this._clearScrollPositionKeys(),this.m_selection=null,this.m_selectionRange=null,this.m_active=null,this.m_prevActive=null,this.m_trueIndex={},null!=this.m_empty&&(this.m_databody.firstChild.removeChild(this.m_empty),this.m_empty=null),this._showHeader(this.m_rowHeader),this._showHeader(this.m_colHeader),this._showHeader(this.m_rowEndHeader),this._showHeader(this.m_colEndHeader),this._emptyHeaders(),this._emptyHeaderLabels();var i=this.m_databody.firstChild;null!=i&&this._emptyDatabody(i),this.m_initialized=!1,this.fetchHeaders("row",0,this.m_rowHeader,this.m_rowEndHeader,t,{success:function(e,t,i){this.handleHeadersFetchSuccess(e,t,i,!1)}}),this.fetchHeaders("column",0,this.m_colHeader,this.m_colEndHeader,void 0,{success:function(e,t,i){this.handleHeadersFetchSuccess(e,t,i,!1)}}),this.fetchCells(this.m_databody,0,0,t,null,{success:function(e,t){this.handleCellsFetchSuccess(e,t)}})},D.prototype._emptyHeaders=function(){var e=this.m_rowHeader.firstChild,t=this.m_rowEndHeader.firstChild;null!=e&&this.m_utils.empty(e),null!=t&&this.m_utils.empty(t);var i=this.m_colHeader.firstChild,s=this.m_colEndHeader.firstChild;null!=i&&this.m_utils.empty(i),null!=s&&this.m_utils.empty(s)},D.prototype._emptyHeaderLabels=function(){var e=this.m_headerLabels.row,t=this.m_headerLabels.rowEnd,i=this.m_headerLabels.column,s=this.m_headerLabels.columnEnd;e&&e.length&&e.forEach(e=>{this.m_utils.empty(e)}),t&&t.length&&t.forEach(e=>{this.m_utils.empty(e)}),i&&i.length&&i.forEach(e=>{this.m_utils.empty(e)}),s&&s.length&&s.forEach(e=>{this.m_utils.empty(e)})},D.prototype._setActiveByIndex=function(e,t,i,s,n){return this._setActive(this._getCellByIndex(e),{type:"cell",indexes:e},t,i,s,n)},D.prototype._updateActive=function(e,t,i){var s;if(null==e)this._setActive(null,null,null,!0,!1,i);else if(null!=e.keys)s=this._getCellByKeys(e.keys);else if(null!=e.indexes)s=this._getCellByIndex(e.indexes);else if(null!=e.axis){var n=null==e.level?0:e.level;"column"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_colHeader,this.getMappedStyle("colheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader)):"row"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_rowHeader,this.getMappedStyle("rowheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader)):"columnEnd"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_colEndHeader,this.getMappedStyle("colendheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader)):"rowEnd"===e.axis&&(null!=e.key?s=this._findHeaderByKey(e.key,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader)))}null!=s&&(t||(this.m_shouldFocus=!1),this._setActive(s,e,null,!0,!1,i))},D.prototype._setActive=function(e,t,i,s,n,o){var r;if(null==t||o||this._scrollToActive(t),null!=e)if(r=this._createActiveObject(e),this._compareActive(r,this.m_active)){if(n||this._fireBeforeCurrentCellEvent(r,this.m_active,i))return this.m_prevActive=this.m_active,this.m_active=r,i&&"mousedown"===i.type&&(this.m_trueIndex=null),s&&this._isSelectionEnabled()&&this._clearSelection(i),this._unhighlightActiveObject(this.m_prevActive),this._highlightActiveObject(this.m_active,this.m_prevActive),this._manageMoveCursor(),this._isGridEditable()&&"cell"===r.type&&(this._setEditableClone(e),this._updateEdgeCellBorders("")),n||this._fireCurrentCellEvent(r,i),this.m_options.isFloodFillEnabled()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"cell"===this.m_active.type&&(this._addFloodfillAffordance(i),this._moveFloodFillAffordance()),!0}else this._highlightActive();else if(!this.m_scrollIndexAfterFetch&&!this.m_scrollHeaderAfterFetch)return(n||this._fireBeforeCurrentCellEvent(r,this.m_active,i))&&(this.m_prevActive=this.m_active,this.m_active=null,this._unhighlightActiveObject(this.m_prevActive),n||this._fireCurrentCellEvent(r,i)),!0;return!1},D.prototype._createActiveObject=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.m_utils.containsCSSClassName(e,this.getMappedStyle("headercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("endheadercell"))?{type:"header",axis:t.axis,index:this.getHeaderCellIndex(e),key:t.key,level:t.level}:this.m_utils.containsCSSClassName(e,this.getMappedStyle("headerlabel"))?{type:"label",axis:t.axis,level:t.level}:this.m_utils.containsCSSClassName(e,this.getMappedStyle("noDataContainer"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("emptytext"))?{type:"empty"}:{type:"cell",indexes:{row:t.indexes.row,column:t.indexes.column},keys:{row:t.keys.row,column:t.keys.column},extents:{row:t.extents.row,column:t.extents.column}}},D.prototype._getActiveElement=function(){return this._getElementFromActiveObject(this.m_active)},D.prototype._getElementFromActiveObject=function(e){if(null!=e){if("header"!==e.type)return"label"===e.type?this._getLabel(e.axis,e.level):"empty"===e.type?this._getEmptyElement():this._getCellByIndex(e.indexes);if("row"===e.axis)return this._findHeaderByKey(e.key,this.m_rowHeader,this.getMappedStyle("rowheadercell"));if("column"===e.axis)return this._findHeaderByKey(e.key,this.m_colHeader,this.getMappedStyle("colheadercell"));if("rowEnd"===e.axis)return this._findHeaderByKey(e.key,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell"));if("columnEnd"===e.axis)return this._findHeaderByKey(e.key,this.m_colEndHeader,this.getMappedStyle("colendheadercell"))}return null},D.prototype._compareActive=function(e,t){if(null==e&&null==t)return!1;if(null==e&&null!=t||null!=e&&null==t)return!0;if(e.type!==t.type)return!0;if("header"===e.type){if(e.index!==t.index||e.key!==t.key||e.axis!==t.axis||e.level!==t.level)return!0}else if("label"===e.type){if(e.axis!==t.axis||e.level!==t.level)return!0}else if(e.indexes.row!==t.indexes.row||e.indexes.column!==t.indexes.column||e.keys.row!==t.keys.row||e.keys.column!==t.keys.column)return!0;return!1},D.prototype._fireBeforeCurrentCellEvent=function(e,t,i){var s={event:i,ui:{currentCell:e,previousCurrentCell:t}};return this.fireEvent("beforeCurrentCell",s)},D.prototype._fireCurrentCellEvent=function(e,t){var i={event:t,ui:e};return this.fireEvent("currentCell",i)},D.prototype._isDatabodyCellActive=function(){return null!=this.m_active&&"cell"===this.m_active.type},D.prototype._updateActiveContext=function(e,t){var i,s,n,o={};if("header"===e.type){i=e.axis;var r=e.index;s=e.level,"row"===e.axis?(this.m_rowHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.rowHeader=r)):"column"===i?(this.m_columnHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.columnHeader=r)):"rowEnd"===e.axis?(this.m_rowEndHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.rowEndHeader=r)):"columnEnd"===i&&(this.m_columnEndHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.columnEndHeader=r)),this._updateContextInfo(o,n)}else"cell"===e.type?(null==t||"cell"!==t.type||null==e||this.m_externalFocus||(e.indexes.row===t.indexes.row?n="row":e.indexes.column===t.indexes.column&&(n="column")),this._updateContextInfo(e,n)):"label"===e.type&&(i=e.axis,s=e.level,(null==t||"label"!==t.type||"label"===t.type&&t.axis!==i||this.m_externalFocus)&&("column"===i?o.columnHeaderLabel=s:"row"===i?o.rowHeaderLabel=s:"rowEnd"===i?o.rowEndHeaderLabel=s:"columnEnd"===i&&(o.columnEndHeaderLabel=s)),this._updateContextInfo(o,n))},D.prototype.handleDatabodyClickActive=function(e){var t=e.target,i=this.findCell(t);null!=i&&this._setActive(i,this._createActiveObject(i),e)},D.prototype.handleHeaderClickActive=function(e,t){var i=e.target,s=this.findHeader(i);null!=s&&(t||this._clearSelection(e),this._setActive(s,this._createActiveObject(s),e))},D.prototype._scrollToActive=function(e){"header"===e.type?this.scrollToHeader(e):"cell"===e.type&&this.scrollToIndex(e.indexes)},D.prototype._getCellByKeys=function(e){if(null==e||null==e.row||null==e.column||null==this.m_databody||null==this.m_databody.firstChild)return null;for(var t=this.m_databody.firstChild.getElementsByClassName(this.getMappedStyle("cell")),i=0;i<t.length;i++){var s=t[i],n=this._getKey(s,"row");if(this._shallowThenDeepCompare(n,e.row)){var o=this._getKey(s,"column");if(this._shallowThenDeepCompare(o,e.column))return s}}return null},D.prototype._shallowThenDeepCompare=function(e,t){return e===t||this._compareValuesCallback(e,t)},D.prototype.getCellKeys=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.keys.row,t.keys.column)},D.prototype.getCellIndexes=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.indexes.row,t.indexes.column)},D.prototype.getCellExtents=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.extents.row,t.extents.column)},D.prototype.getCellEndIndexes=function(e){var t=this.getCellIndexes(e),i=this.getCellExtents(e);return this.createIndex(t.row+(i.row-1),t.column+(i.column-1))},D.prototype._getIndex=function(e,t){if(null!=e){if(null==t||!this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return this.getHeaderCellIndex(e);var i=e[this.getResources().getMappedAttribute("context")];if("row"===t)return i.indexes.row;if("column"===t)return i.indexes.column}return null},D.prototype._getExtent=function(e,t){if(null!=e){if(null==t||!this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return parseInt(this._getAttribute(e,"extent",!0),10);var i=e[this.getResources().getMappedAttribute("context")];if("row"===t)return i.extents.row;if("column"===t)return i.extents.column}return null},D.prototype.getHeaderCellIndex=function(e){var t,i,s;switch(this.getHeaderCellAxis(e)){case"column":t=this.m_columnHeaderLevelCount,i=this.m_startColHeader;break;case"row":t=this.m_rowHeaderLevelCount,i=this.m_startRowHeader;break;case"columnEnd":t=this.m_columnEndHeaderLevelCount,i=this.m_startColEndHeader;break;case"rowEnd":t=this.m_rowEndHeaderLevelCount,i=this.m_startRowEndHeader;break;default:return-1}if(t>1){if(s=this._getAttribute(e.parentNode,"start",!0),e===e.parentNode.firstChild)return s;s-=1}else s=i;for(;e.previousSibling;)s+=1,e=e.previousSibling;return s},D.prototype.getHeaderCellAxis=function(e){return this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))?"column":this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowheadercell"))?"row":this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowendheadercell"))?"rowEnd":this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))?"columnEnd":null},D.prototype.getHeaderCellLevel=function(e){if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))){if(1===this.m_columnHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowheadercell"))){if(1===this.m_rowHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))){if(1===this.m_columnEndHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowendheadercell"))&&1===this.m_rowEndHeaderLevelCount)return 0;var t=this._getAttribute(e.parentNode,"level",!0);return e===e.parentNode.firstChild?t:t+this.getHeaderCellDepth(e.parentNode.firstChild)},D.prototype.getHeaderCellDepth=function(e){return this._getAttribute(e,"depth",!0)},D.prototype.getHeaderLabelLevel=function(e){let t=e[this.getResources().getMappedAttribute("context")];return t?t.level:null},D.prototype.getHeaderLabelAxis=function(e){let t=e[this.getResources().getMappedAttribute("context")];return t?t.axis:null},D.prototype._getResizeHeaderMode=function(e){var t="row";return(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnheaderlabel"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnendheaderlabel")))&&(t="column"),t},D.prototype.findCellOrHeader=function(e){var t=this.findCell(e);return null==t&&(t=this.findHeader(e)),t},D.prototype.findCell=function(e){return this.find(e,"cell")},D.prototype.findLabel=function(e){return this.find(e,"headerlabel")},D.prototype.find=function(e,t,i){return null==e||e===this.getRootElement()?null:(null==i&&(i=this.getMappedStyle(t)),null==i?null:this.m_utils.containsCSSClassName(e,i)?e:this.find(e.parentNode,t,i))},D.prototype._highlightActive=function(e){this._highlightActiveObject(this.m_active,this.m_prevActive,e)},D.prototype._unhighlightActive=function(e){this._unhighlightActiveObject(this.m_active,e)},D.prototype._highlightActiveObject=function(e,t,i){if(null==i&&this.m_utils.shouldOffsetOutline()&&(i=["offsetOutline"]),null!=e){var s=this._getElementFromActiveObject(e);null!=s&&(this.m_focusInHandler(s),null!=i&&this._highlightElement(s,i),this._isCellEditable()&&"cell"===e.type&&this._applyBorderClassesAroundRange(s,{startIndex:e.indexes},!0,"Edit"),this._setAriaProperties(e,t,s))}},D.prototype._unhighlightActiveObject=function(e,t){if(null==t&&this.m_utils.shouldOffsetOutline()&&(t=["offsetOutline"]),null!=e){var i=this._getElementFromActiveObject(e);null!=i&&(this.m_focusOutHandler(i),null!=t&&this._unhighlightElement(i,t),this._isGridEditable()&&"cell"===e.type&&this._applyBorderClassesAroundRange(i,{startIndex:e.indexes},!1,"Edit"),this._unsetAriaProperties(i))}},D.prototype._highlightCellsAlongAxis=function(e,t,i,s,n){for(var o="key"===i?this._getAxisCellsByKey(e,t):this._getAxisCellsByIndex(e,t),r=0;r<o.length;r++)"add"===s?this._highlightElement(o[r],n):this._unhighlightElement(o[r],n)},D.prototype._highlightElement=function(e,t){for(var i=0;i<t.length;i++){var s=this.getMappedStyle(t[i]);this.m_utils.addCSSClassName(e,s)}},D.prototype._unhighlightElement=function(e,t){for(var i=0;i<t.length;i++){var s=this.getMappedStyle(t[i]);this.m_utils.removeCSSClassName(e,s)}},D.prototype._unhighlightElementsByClassName=function(e,t){if(e.length&&t.length)for(var i=0;i<e.length;i++)this._unhighlightElement(e[i],t)},D.prototype._setAriaProperties=function(e,t,i){var s=this.getLabelledBy(e,t,i);this._updateActiveContext(e,t),i.setAttribute("tabIndex",0),i.setAttribute("aria-labelledby",s),u.isFirefox()&&i.setAttribute("role","gridcell"),null!=this.m_cellToFocus&&this.m_cellToFocus===i||!1===this.m_shouldFocus||i.focus(),this.m_shouldFocus=null},D.prototype._unsetAriaProperties=function(e){null!=e&&(e.setAttribute("tabIndex",-1),e.removeAttribute("aria-labelledby"),u.isFirefox()&&e.removeAttribute("role"))},D.prototype.getLabelledBy=function(e,t,i,s){var n,o,r,l,a="",h=[];const d=i[this.getResources().getMappedAttribute("metadata")];if("header"===e.type){null==t||"header"!==t.type||this.m_externalFocus||("row"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader):"column"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader):"rowEnd"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader):"columnEnd"===t.axis&&(n=this._getHeaderByIndex(t.index,t.level,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader))),a=[this.createSubId("context"),this._getHeaderAndParentIds(i,n)].join(" ");var c=i.getAttribute(this.getResources().getMappedAttribute("sortDir"));if("ascending"===c?o="accessibleSortAscending":"descending"===c?o="accessibleSortDescending":this._getAttribute(i,"sortable")&&(o="accessibleSortable"),null!=o&&h.push({key:o,args:{id:""}}),d&&d.metadata){"expanded"===d.metadata.expanded?h.push({key:"accessibleExpanded",args:{}}):"collapsed"===d.metadata.expanded&&h.push({key:"accessibleCollapsed",args:{}});const t=d.metadata.treeDepth;if(null!=t){let i,s,n,o,r;"row"===e.axis?(i=this.m_stopRowHeaderFetch&&this.m_stopRowEndHeaderFetch&&this.m_stopRowFetch,s=this.m_endRowHeader,n=this.m_startRowHeader):"column"===e.axis&&(s=this.m_endColHeader,n=this.m_startColHeader,i=this.m_stopColumnHeaderFetch&&this.m_stopColumnEndHeaderFetch&&this.m_stopColumnFetch),h.push({key:"accessibleLevelHierarchicalContext",args:{level:t+1}});let l="";const a=[...this.m_root.querySelectorAll(".oj-datagrid-"+e.axis+"-header-cell")];if(t>0){let h,d;a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")],n=s.metadata;n.treeDepth<t&&s.index>e.index&&(!d||s.index<d)&&(d=s.index),n.treeDepth===t-1&&s.index<e.index&&(!h||s.index>h)&&(h=s.index)}),null!=h&&null!=d?l="Full":null!=h&&null==d?(d=s+1,l=i?"Full":"Partial"):null==h&&null!=d?(h=n-1,l="Unknown"):(h=n-1,d=s+1,l="Unknown"),o=0,r=0,a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")];s.metadata.treeDepth===t&&(s.index<=e.index&&s.index>h&&(r+=1),s.index>h&&s.index<d&&(o+=1))})}else{o=0,r=1;l=0===this.m_startRowHeader?i?"Full":"Partial":"Unknown",a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")];s.metadata.treeDepth===t&&(o+=1,s.index<e.index&&(r+=1))})}const d=this._getHierarchicalTranslationKey(l,e.axis);h.push({key:d,args:{posInSet:r,setSize:o}})}}0!==h.length&&(a=a+" "+this.createSubId("state")),i.setAttribute("tabIndex",0)}else if("label"===e.type)a=[this.createSubId("context"),this._getActiveElement().id].join(" ");else if("empty"===e.type)a=this._getActiveElement().id;else{null!=t&&("header"===t.type?(r="row"===t.axis?t.index:null,l="column"===t.axis?t.index:null):"cell"===t.type&&(r=t.indexes.row,l=t.indexes.column));var m=this._getHeaderLabelledBy("row",this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader,this.m_endRowHeader,e.indexes.row,r,i),_=this._getHeaderLabelledBy("rowEnd",this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader,this.m_endRowEndHeader,e.indexes.row,r,i),p=this._getHeaderLabelledBy("column",this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader,this.m_endColHeader,e.indexes.column,l,i),g=this._getHeaderLabelledBy("columnEnd",this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader,this.m_endColEndHeader,e.indexes.column,l,i),f=e.extents.row,C=e.extents.column;f>1&&h.push({key:"accessibleRowSpanContext",args:{extent:f}}),C>1&&h.push({key:"accessibleColumnSpanContext",args:{extent:C}}),a=(a=s?[m,_,p,g,i.id].join(" "):[this.createSubId("context"),m,_,p,g,i.id,this.createSubId("state")].join(" ")).replace(/ +(?= )/g,"")}!0===this.m_externalFocus&&(null!=this.m_root.id&&(a=[this.m_root.id,a].join(" ")),a=[this.createSubId("summary"),a].join(" "),this.m_externalFocus=!1);let y=u.getActionableElementsInNode(i);return y&&y.length>0&&h.push({key:"accessibleContainsControls"}),this._updateStateInfo(h),a},D.prototype._getHierarchicalTranslationKey=function(e,t){return"accessible"+(t.charAt(0).toUpperCase()+t.slice(1))+"Hierarchical"+e},D.prototype.getHeaderFromCell=function(e,t,i){var s,n,o,r,l,a;return"row"===t?null!=this.m_rowHeader&&(s=this._getIndex(e,"row"),n=this._getExtent(e,"row"),o=this.m_rowHeaderLevelCount-1,r=this.m_rowHeader,l=this.m_rowHeaderLevelCount,a=this.m_startRowHeader):"column"===t?null!=this.m_colHeader&&(s=this._getIndex(e,"column"),n=this._getExtent(e,"column"),o=this.m_columnHeaderLevelCount-1,r=this.m_colHeader,l=this.m_columnHeaderLevelCount,a=this.m_startColHeader):"rowEnd"===t?null!=this.m_rowEndHeader&&(s=this._getIndex(e,"row"),n=this._getExtent(e,"row"),o=this.m_rowEndHeaderLevelCount-1,r=this.m_rowEndHeader,l=this.m_rowEndHeaderLevelCount,a=this.m_startRowEndHeader):"columnEnd"===t&&null!=this.m_colEndHeader&&(s=this._getIndex(e,"column"),n=this._getExtent(e,"column"),o=this.m_columnEndHeaderLevelCount-1,r=this.m_colEndHeader,l=this.m_columnEndHeaderLevelCount,a=this.m_startColEndHeader),null!=s&&null!=o&&s>-1?(i&&(s+=n-1),this._getHeaderByIndex(s,o,r,l,a)):null},D.prototype._trimRangeForSelectionMode=function(e){return"row"===this.m_options.getSelectionMode()?this.createRange(this.createIndex(e.startIndex.row),this.createIndex(e.endIndex.row)):e},D.prototype.createRange=function(e,t,i,s){var n,o,r,l,a,h,d,c;return t&&(e.row<t.row||-1===t.row?(n=e.row,o=t.row,i&&(a=i.row,h=s.row)):(n=t.row,o=e.row,i&&(a=s.row,h=i.row)),isNaN(e.column)||isNaN(t.column)?(e={row:n},t={row:o},i&&(i={row:a,column:d},s={row:h,column:c})):(e.column<t.column||-1===t.column?(r=e.column,l=t.column,i&&(d=i.column,c=s.column)):(r=t.column,l=e.column,i&&(d=s.column,c=i.column)),e={row:n,column:r},t={row:o,column:l},i&&(i={row:a,column:d},s={row:h,column:c}))),i?{startIndex:e,endIndex:t,startKey:i,endKey:s}:{startIndex:e,endIndex:t}},D.prototype._createRangeWithKeys=function(e,t,i){this._keys(e,this._createRangeStartKeyCallback.bind(this,t,i))},D.prototype._createRangeStartKeyCallback=function(e,t,i,s){null!=e&&null!=s&&e.row===s.row&&e.column===s.column?this._createRangeEndKeyCallback(i,s,t,i,s):e?this._keys(e,this._createRangeEndKeyCallback.bind(this,i,s,t)):t.call(this,{startIndex:s,endIndex:s,startKey:i,endKey:i})},D.prototype._createRangeEndKeyCallback=function(e,t,i,s,n){i.call(this,this.createRange(t,n,e,s))},D.prototype.getEndIndex=function(e){return null==e.endIndex?e.startIndex:e.endIndex},D.prototype.getElementsInRange=function(e,t,i,s,n){var o,r,l,a,h;null==t&&(t=this.m_startRow),null==i&&(i=this.m_endRow+1);var d=e.startIndex,c=this.getEndIndex(e),m=d.row,u=c.row;if(-1===u&&(u=Number.MAX_VALUE),i<m||u<t)return null;if(!isNaN(d.column)&&!isNaN(c.column)&&(o=d.column,-1===(r=c.column)&&(r=Number.MAX_VALUE),this.m_endCol+1<o||r<this.m_startCol))return null;var _=[];if(null==this.m_databody.firstChild)return null;if(m=Math.max(this.m_startRow,m),u=Math.min(this.m_endRow,u),isNaN(o)||isNaN(r))for(o=Math.max(0,this.m_startCol),r=Math.max(o,this.m_endCol),l=m;l<=u;l+=1)for(a=o;a<=r;a+=1)null!=(h=this._getCellByIndex(this.createIndex(l,a)))&&-1===_.indexOf(h)&&_.push(h);else for(o=Math.max(this.m_startCol,o),r=Math.min(this.m_endCol,r),l=m;l<=u;l+=1)for(a=o;a<=r;a+=1)null!=(h=this._getCellByIndex(this.createIndex(l,a)))&&-1===_.indexOf(h)&&_.push(h);return _},D.prototype._getRangeInView=function(e){let t=e.startIndex,i=this.getEndIndex(e),s=t.row,n=i.row,o=t.column,r=i.column;return-1===n&&(n=Number.MAX_VALUE),-1===r&&(r=Number.MAX_VALUE),s=Math.max(this.m_startRow,s),n=Math.min(this.m_endRow,n),(isNaN(t.column)||isNaN(i.column))&&(o=Math.max(0,this.m_startCol),r=Math.max(o,this.m_endCol)),o=Math.max(this.m_startCol,o),r=Math.min(this.m_endCol,r),this.createRange(this.createIndex(s,o),this.createIndex(n,r))},D.prototype._applyBorderClassesAroundRange=function(e,t,i,s){if(null==this.m_databody.firstChild||null==e||0===e.length)return;let n=this._getRangeInView(t),o=n.startIndex.row,r=n.startIndex.column,l=n.endIndex.row,a=n.endIndex.column,h=0===o,d=0===r,c=h?0:o-1,m=l,u=d?0:r-1,_=a;for(let e=o;e<=l;e++){let t=this._getCellByIndex(this.createIndex(e,u)),n=this._getCellByIndex(this.createIndex(e,_)),o=(d?"start":"end")+s,r="end"+s;i?(this._highlightElement(t,[o]),this._highlightElement(n,[r])):(this._unhighlightElement(t,[o]),this._unhighlightElement(n,[r]))}for(let e=r;e<=a;e++){let t=this._getCellByIndex(this.createIndex(c,e)),n=this._getCellByIndex(this.createIndex(m,e)),o=(h?"top":"bottom")+s,r="bottom"+s;i?(this._highlightElement(t,[o]),this._highlightElement(n,[r])):(this._unhighlightElement(t,[o]),this._unhighlightElement(n,[r]))}},D.prototype.readCurrentContent=function(){var e,t;if(null==this.m_active)return!1;if("header"===this.m_active.type)e={},"row"===this.m_active.axis?(this.m_rowHeaderLevelCount>1&&(e.level=this.m_active.level),e.rowHeader=this.m_active.index):(this.m_columnHeaderLevelCount>1&&(e.level=this.m_active.level),e.columnHeader=this.m_active.index),t=this._getActiveElement();else if("cell"===this.m_active.type){if(e=this.m_active.indexes,this._isSelectionEnabled()&&this.isMultipleSelection()&&null!=this.m_selectionFrontier&&(e=this.m_selectionFrontier),null==e)return!1;var i=this.createRange(e),s=this.getElementsInRange(i);if(null==s||0===s.length)return!1;t=s[0]}else t=this._getActiveElement();this._updateActiveContext(this.m_active,this.m_prevActive),this.m_placeHolder.tabIndex=-1;var n=t.getAttribute("aria-labelledby");return this.m_placeHolder.setAttribute("aria-labelledby",n+" "+t.id),this.m_placeHolder===document.activeElement?t.focus():this.m_placeHolder.focus(),!0},D.prototype._enterActionableMode=function(e,t){return this._setFocusToFirstFocusableElement(e,t)&&(this.m_focusOutHandler(e),this.setActionableMode(!0)),!1},D.prototype._exitActionableMode=function(){if(this.isActionableMode()){var e=this._getActiveElement();this.setActionableMode(!1),u.disableAllFocusableElements(e),this.m_focusInHandler(e)}},D.prototype._reRenderCell=function(e,t,i,s){var n=this.getRendererOrTemplate("cell"),o=e[this.getResources().getMappedAttribute("context")],r=e[this.getResources().getMappedAttribute("metadata")];if(o.mode=t,this.m_utils.empty(e),this.m_utils.containsCSSClassName(e,i)?this.m_utils.removeCSSClassName(e,i):this.m_utils.addCSSClassName(e,i),s){for(;s.hasChildNodes();)e.appendChild(s.firstChild);this._destroyEditableClone()}else this._renderContent(n,o,e,o.data,this.buildCellTemplateContext(o,r))},D.prototype._resetEditableClone=function(){if(this._isGridEditable()&&this.m_active&&"cell"===this.m_active.type){let e=this._getActiveElement();e&&this._setEditableClone(e)}},D.prototype._setEditableClone=function(e){if(this._destroyEditableClone(),null!=e){var t=e.cloneNode(!1);t.removeAttribute("id"),this._createUniqueId(t),t[this.getResources().getMappedAttribute("context")]=e[this.getResources().getMappedAttribute("context")],t[this.getResources().getMappedAttribute("metadata")]=e[this.getResources().getMappedAttribute("metadata")],t[this.getResources().getMappedAttribute("context")].parentElement=t,this.m_root.appendChild(t),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),null),t.style.display="none",t[this.getResources().getMappedAttribute("context")].parentElement=e,this.m_editableClone=t}},D.prototype._destroyEditableClone=function(){this.m_editableClone&&(null!=this.m_editableClone.parentNode?this._remove(this.m_editableClone):this._cleanTemplateNodes(this.m_editableClone),delete this.m_editableClone)},D.prototype.isArrowKey=function(e){return e===this.keyCodes.UP_KEY||e===this.keyCodes.DOWN_KEY||e===this.keyCodes.LEFT_KEY||e===this.keyCodes.RIGHT_KEY},D.prototype.createIndex=function(e,t){var i={};return void 0!==e&&(i.row=e),void 0!==t&&(i.column=t),i},D.prototype.checkCorners=function(e,t,i){return"column"===this.m_selectionFrontier.axis&&this.m_columnHeaderLevelCount!==this.m_selectionFrontier.level||"row"===this.m_selectionFrontier.axis&&this.m_rowHeaderLevelCount!==this.m_selectionFrontier.level||"rowEnd"===this.m_selectionFrontier.axis&&this.m_rowEndHeaderLevelCount!==this.m_selectionFrontier.level||"columnEnd"===this.m_selectionFrontier.axis&&this.m_columnEndHeaderLevelCount!==this.m_selectionFrontier.level||(-1!==e.indexOf("row")?t===i.startIndex.row&&this.m_selectionFrontier.end===i.endIndex.row||t===i.endIndex.row&&this.m_selectionFrontier.end===i.startIndex.row:-1!==e.indexOf("column")&&(t===i.startIndex.column&&this.m_selectionFrontier.end===i.endIndex.column||t===i.endIndex.column&&this.m_selectionFrontier.end===i.startIndex.column))},D.prototype.handleLabelFocusChange=function(e,t,i,s){var n,o,r,l,a;if(!this.isFetchComplete())return!0;this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY));var h=this.m_active.axis,d=this.m_active.level;switch("column"===h?(r=this.m_colHeader,l=this.m_startColHeader,a=this.m_columnHeaderLevelCount):"row"===h&&(r=this.m_rowHeader,l=this.m_startRowHeader,a=this.m_rowHeaderLevelCount),"columnEnd"===h&&(e===this.keyCodes.DOWN_KEY?e=this.keyCodes.UP_KEY:e===this.keyCodes.UP_KEY&&(e=this.keyCodes.DOWN_KEY),r=this.m_colEndHeader,l=this.m_startColEndHeader,a=this.m_columnEndHeaderLevelCount),"rowEnd"===h&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY),r=this.m_rowEndHeader,l=this.m_startRowEndHeader,a=this.m_rowEndHeaderLevelCount),e){case this.keyCodes.DOWN_KEY:"row"!==h&&"rowEnd"!==h||(n=this._getHeaderByIndex(l,d,r,a,l),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:l,level:d,axis:h},t)),"column"!==h&&"columnEnd"!==h||((n=this.m_headerLabels[h][d+1])?this._setActive(n,{type:"label",level:d+1,axis:h},t):"column"===h&&d===a-1&&this.m_headerLabels.row.length?(n=this.m_headerLabels.row[this.m_headerLabels.row.length-1],this._setActive(n,{type:"label",level:this.m_headerLabels.row.length-1,axis:"row"},t)):d===a-1&&(o="column"===h?this.m_startRowHeader:this.m_endRowHeader,n=this._getHeaderByIndex(o,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),n&&this._setActive(n,{type:"header",index:o,level:d,axis:"row"},t)));break;case this.keyCodes.UP_KEY:"row"===h&&d===a-1&&this.m_headerLabels.column.length&&(n=this.m_headerLabels.column[this.m_headerLabels.column.length-1],this._setActive(n,{type:"label",level:this.m_headerLabels.column.length-1,axis:"column"},t)),"column"!==h&&"columnEnd"!==h||(n=this.m_headerLabels[h][d-1])&&this._setActive(n,{type:"label",level:d-1,axis:h},t);break;case this.keyCodes.RIGHT_KEY:"row"!==h&&"rowEnd"!==h||((n=this.m_headerLabels[h][d+1])?this._setActive(n,{type:"label",level:d+1,axis:h},t):d===a-1&&(o="row"===h?this.m_startColHeader:this.m_endColHeader,(n=this._getHeaderByIndex(o,this.m_columnHeaderLevelCount,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader))&&(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:o,level:d,axis:"column"},t)))),"column"!==h&&"columnEnd"!==h||(n=this._getHeaderByIndex(l,d,r,a,l),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:l,level:d,axis:h},t));break;case this.keyCodes.LEFT_KEY:"row"!==h&&"rowEnd"!==h||(n=this.m_headerLabels[h][d-1])&&this._setActive(n,{type:"label",level:d-1,axis:h},t)}return!0},D.prototype.handleHeaderFocusChange=function(e,t,i,s,n){var o,r,l,a,h,d,c,m,u;let _=this._getEmptyElement();if(!this.isFetchComplete())return!0;this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY));var p=this.m_active.axis,g=this.m_active.index,f=this.m_active.level,C=this._getActiveElement(),y=null!=C?this._getAttribute(C,"depth",!0):1;if(p||g||!this.m_active||(p=this.m_selectionFrontier.axis,g=this.m_active.indexes[p]),t.shiftKey&&!i&&this.m_selectionFrontier&&this.isMultipleSelection()&&(i=this.checkHeaderToDatabody(p,e)),!(i&&this.isArrowKey(e)&&this.isHeaderSelectionType(this.m_selectionFrontier)&&this.checkCorners(p,g,this.m_selection[this.m_selection.length-1]))||(p=this.m_selectionFrontier.axis,g=this.m_selectionFrontier.index,f=this.m_selectionFrontier.level,-1===g&&(g=this.m_active.indexes[p]),"cell"!==this.m_active.type||(e!==this.keyCodes.LEFT_KEY&&e!==this.keyCodes.RIGHT_KEY||-1===p.indexOf("row"))&&(e!==this.keyCodes.UP_KEY&&e!==this.keyCodes.DOWN_KEY||-1===p.indexOf("column")))){"column"===p?(h=this.m_colHeader,d=this.m_startColHeader,c=this.m_endColHeader,m=this.m_columnHeaderLevelCount,u=this.m_stopColumnHeaderFetch):"row"===p&&(h=this.m_rowHeader,d=this.m_startRowHeader,c=this.m_endRowHeader,m=this.m_rowHeaderLevelCount,u=this.m_stopRowHeaderFetch),"columnEnd"===p&&(e===this.keyCodes.DOWN_KEY?e=this.keyCodes.UP_KEY:e===this.keyCodes.UP_KEY&&(e=this.keyCodes.DOWN_KEY),h=this.m_colEndHeader,d=this.m_startColEndHeader,c=this.m_endColEndHeader,m=this.m_columnEndHeaderLevelCount,u=this.m_stopColumnEndHeaderFetch),"rowEnd"===p&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY),h=this.m_rowEndHeader,d=this.m_startRowEndHeader,c=this.m_endRowEndHeader,m=this.m_rowEndHeaderLevelCount,u=this.m_stopRowEndHeaderFetch),i&&this.isArrowKey(e)&&this.isHeaderSelectionType(this.m_selectionFrontier)&&(y=null!=(C=this._getHeaderByIndex(g,f,h,m,d))?this._getAttribute(C,"depth",!0):1);var v=this._isSelectionEnabled()?this.selectAndFocus.bind(this):this._setActiveByIndex.bind(this);switch(e){case this.keyCodes.LEFT_KEY:if("column"===p||"columnEnd"===p)if(g>0){if(s&&this.m_headerLabels[p][f]){this._setActive(this.m_headerLabels[p][f],{type:"label",level:f,axis:p},t);break}if("column"===p&&s&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]){this._setActive(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],{type:"label",level:this.m_rowHeaderLevelCount-1,axis:"row"},t);break}if(1===m)l=g-1,r=null!=C?C.previousSibling:null,a=f;else if(l=null!=(r=this._getHeaderByIndex(g-1,f,h,m,d))?this._getAttribute(r.parentNode,"start",!0):g-1,a=null!=r?this.getHeaderCellLevel(r):f,l<0)break;i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"row"!==this.m_options.getSelectionMode()&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive())}else this.m_headerLabels[p][f]?this._setActive(this.m_headerLabels[p][f],{type:"label",level:f,axis:p},t):"column"===p&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],{type:"label",level:this.m_rowHeaderLevelCount-1,axis:"row"},t);else("row"===p||"rowEnd"===p)&&f>0&&(r=this._getHeaderByIndex(g,f-1,h,m,d),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.RIGHT_KEY:if("rowEnd"===p&&s&&-1!==this.m_endRowHeader)r=this._getHeaderByIndex(g,this.m_rowHeaderLevelCount,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:g,level:this.m_rowHeaderLevelCount,axis:p},t),this._highlightActive());else if("row"===p&&s&&-1!==this.m_endRowEndHeader)r=this._getHeaderByIndex(g,this.m_rowEndHeaderLevelCount,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:g,level:this.m_rowEndHeaderLevelCount,axis:p},t),this._highlightActive());else if("row"===p||"rowEnd"===p)if(f+y>=m&&!i)if(this.m_trueIndex={row:g},n){if("row"===p){let e=this._getEmptyCellNeighborIndex({row:g,column:-1},{right:!0},this._getMaxRight(),this.m_endRowEndHeader);if(e)if(e.cell)v(e.cell,t);else if(e.header){let e=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader);this._setActive(e,{type:"header",index:g,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t,!0)}}else if("rowEnd"===p){let e=this._getEmptyCellNeighborIndex({row:g,column:this.m_endCol+1},{left:!0},this._getMaxLeft(),this.m_startRowHeader);if(e.cell)v(e.cell,t);else if(e.header){let e=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader);this._setActive(e,{type:"header",index:g,level:this.m_rowHeaderLevelCount-1,axis:"row"},t,!0)}}}else _?this._setActive(_,{type:"empty"},t,!0):(o="row"===p?this.createIndex(g,0):this._isHighWatermarkScrolling()?this.createIndex(g,this.m_endCol):this.createIndex(g,this.getDataSource().getCount("column")-1),this._isSelectionEnabled()?this.selectAndFocus(o,t):(this._setActiveByIndex(o,t),this._highlightActive()));else r=this._getHeaderByIndex(g,f+y,h,m,d),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive());else"column"===p&&s&&this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1]?this._setActive(this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t):(1===m?(l=g+1,r=null!=C?C.nextSibling:null,a=f):(f===m-1?(l=g+1,r=this._getHeaderByIndex(l,f,h,m,d)):(l=null!=C?this._getAttribute(C.parentNode,"start",!0)+this._getAttribute(C.parentNode,"extent",!0):g+1,r=this._getHeaderByIndex(l,f,h,m,d)),a=null!=r?this.getHeaderCellLevel(r):f),l>c&&u||!(this._isCountUnknown("column")||l<this.getDataSource().getCount("column"))?"column"===p&&this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t):i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"row"!==this.m_options.getSelectionMode()&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.UP_KEY:if("row"===p||"rowEnd"===p){if(s&&this.m_headerLabels[p][f]){this._setActive(this.m_headerLabels[p][f],{type:"label",level:f,axis:p},t);break}if("row"===p&&s&&this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]){this._setActive(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],{type:"label",level:this.m_columnHeaderLevelCount-1,axis:"column"},t);break}if(g>0){if(1===m)l=g-1,r=null!=C?C.previousSibling:null,a=f;else if(f===m-1?(l=g-1,r=this._getHeaderByIndex(l,f,h,m,d)):l=null!=(r=null!=C?this._getHeaderByIndex(this._getAttribute(C.parentNode,"start",!0)-1,f,h,m,d):null)?this._getAttribute(r.parentNode,"start",!0):g-1,a=null!=r?this.getHeaderCellLevel(r):f,l<0)break;i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive())}else this.m_headerLabels[p][f]?this._setActive(this.m_headerLabels[p][f],{type:"label",level:f,axis:p},t):"row"===p&&this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],{type:"label",level:this.m_columnHeaderLevelCount-1,axis:"column"},t)}else("column"===p||"columnEnd"===p)&&f>0&&(r=this._getHeaderByIndex(g,f-1,h,m,d),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.DOWN_KEY:if("columnEnd"===p&&s&&-1!==this.m_endColHeader)r=this._getHeaderByIndex(g,this.m_columnHeaderLevelCount,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(r,{type:"header",index:g,level:this.m_columnHeaderLevelCount,axis:p},t),this._highlightActive());else if("column"===p&&s&&-1!==this.m_endColEndHeader)r=this._getHeaderByIndex(g,this.m_columnEndHeaderLevelCount,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:g,level:this.m_columnEndHeaderLevelCount,axis:p},t),this._highlightActive());else if("column"===p||"columnEnd"===p)if(f+y>=m&&!i)if(this.m_trueIndex={column:g},n){if("column"===p){let e=this._getEmptyCellNeighborIndex({row:0,column:this.m_trueIndex.column},{down:!0},this._getMaxBottom(),this.m_endColEndHeader);if(e)if(e.cell)v(e.cell,t);else if(e.header){let e=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader);this._setActive(e,{type:"header",index:g,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t,!0)}}else if("columnEnd"===p){let e=this._getEmptyCellNeighborIndex({row:this.m_endRow+1,column:this.m_trueIndex.column},{up:!0},this._getMaxTop(),this.m_startColHeader);if(e)if(e.cell)v(e.cell,t);else if(e.header){let e=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader);this._setActive(e,{type:"header",index:g,level:this.m_columnHeaderLevelCount-1,axis:"column"},t,!0)}}}else _?this._setActive(_,{type:"empty"},t,!0):(o="column"===p?this.createIndex(0,g):this._isHighWatermarkScrolling()?this.createIndex(this.m_endRow,g):this.createIndex(this.getDataSource().getCount("row")-1,g),this._isSelectionEnabled()?this.selectAndFocus(o,t):(this._setActiveByIndex(o,t),this._highlightActive()));else r=this._getHeaderByIndex(g,f+y,h,m,d),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive());else"row"===p&&s&&this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1]?this._setActive(this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1],{type:"label",level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t):(1===m?(l=g+1,r=null!=C?C.nextSibling:null,a=f):(f===m-1?(l=g+1,r=this._getHeaderByIndex(l,f,h,m,d)):(l=null!=C?this._getAttribute(C.parentNode,"start",!0)+this._getAttribute(C.parentNode,"extent",!0):g+1,r=this._getHeaderByIndex(l,f,h,m,d)),a=null!=r?this.getHeaderCellLevel(r):f),l>c&&u||!(this._isCountUnknown("row")||l<this.getDataSource().getCount("row"))?"row"===p&&this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.columnEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t):i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.PAGEUP_KEY:"row"!==p&&"rowEnd"!==p||(C=this._getHeaderByIndex(0,f,h,m,d),this._setActive(C,{type:"header",index:0,level:f,axis:p},t));break;case this.keyCodes.PAGEDOWN_KEY:"row"!==p&&"rowEnd"!==p||(g=this._isCountUnknown("row")||this._isHighWatermarkScrolling()?Math.max(0,c):Math.max(0,this.getDataSource().getCount("row")-1),C=this._getHeaderByIndex(g,f,h,m,d),this._setActive(C,{type:"header",index:g,level:f,axis:p},t));break;case this.keyCodes.HOME_KEY:"column"!==p&&"columnEnd"!==p||(C=this._getHeaderByIndex(0,f,h,m,d),this._setActive(C,{type:"header",index:0,level:f,axis:p},t));break;case this.keyCodes.END_KEY:"column"!==p&&"columnEnd"!==p||(g=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?Math.max(0,c):Math.max(0,this.getDataSource().getCount("column")-1),C=this._getHeaderByIndex(g,f,h,m,d),this._setActive(C,{type:"header",index:g,level:f,axis:p},t))}return!0}},D.prototype.checkHeaderToDatabody=function(e,t){return!("row"===e&&this.m_rowHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.RIGHT_KEY||"rowEnd"===e&&this.m_rowEndHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.LEFT_KEY||"column"===e&&this.m_columnHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.DOWN_KEY||"columnEnd"===e&&this.m_columnEndHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.UP_KEY)},D.prototype._getHeaderLabelledBy=function(e,t,i,s,n,o,r,l){var a;if(-1!==n&&(o!==r||this.m_externalFocus)){var h=this.getHeaderFromCell(l,e);return null!=r&&(a=this._getHeaderByIndex(r,i-1,t,i,s)),this._getHeaderAndParentIds(h,a)}return""},D.prototype._getHeaderAndParentIds=function(e,t){var i="",s=[];if(null==e)return"";var n=this._getHeaderAndParents(e);null!=t&&(s=this._getHeaderAndParents(t));for(var o=0;o<n.length;o++)s[o]===n[o]&&o!==n.length-1||(i+=(""===i?"":" ")+n[o].id);return i},D.prototype._getHeaderAndParents=function(e){var t,i=[e],s=this.getHeaderCellAxis(e),n=this.getHeaderCellLevel(e),o=this._getLabel(s,n);if("row"===s?t=this.m_rowHeaderLevelCount:"column"===s?t=this.m_columnHeaderLevelCount:"rowEnd"===s?t=this.m_rowEndHeaderLevelCount:"columnEnd"===s&&(t=this.m_columnEndHeaderLevelCount),o&&i.unshift(o),1===t)return i;for(n===t-1&&(e=e.parentNode.firstChild,i.unshift(e),n-=1,(o=this._getLabel(s,n))&&i.unshift(o));n>0;)e=e.parentNode.parentNode.firstChild,i.unshift(e),n-=1,(o=this._getLabel(s,n))&&i.unshift(o);return i},D.prototype.isHeaderSelectionType=function(e){return!(!e||!e.axis)},D.prototype._isChildEmpty=function(e){if(e){let t=e.textContent.trim();return!(e.children.length>0||t.length>0)}return!1},D.prototype._isNeighborCellEmpty=function(e,t){let i=this._getIndex(e,"row"),s=this._getIndex(e,"column");if("row"===t){let t=this._getCellByIndex({row:i,column:s-1}),n=this._getCellByIndex({row:i,column:s+1});if((this._isChildEmpty(t)||this._isChildEmpty(n))&&!this._isChildEmpty(e))return!0}else if("column"===t){let t=this._getCellByIndex({row:i-1,column:s}),n=this._getCellByIndex({row:i+1,column:s});if((this._isChildEmpty(t)||this._isChildEmpty(n))&&!this._isChildEmpty(e))return!0}return!1},D.prototype._getEmptyCellNeighborIndex=function(e,t,i,s){let n,o,r,l,a,h,d,c=e.row,m=e.column,u=Object.create({}),_=t.left||t.right,p=t.up||t.down,g=t.right||t.down,f=t.left||t.up;_?(n="row",o=m,r=c):p&&(n="column",o=c,l=m),g?(a=1,d=i):f&&(a=-1,d=i-1);let C,y=o;for(;f?y>=i:y<=i;){if(g?C=y<i:f&&(C=y>i),_?l=y===i?d:y+a:p&&(r=y===i?d:y+a),h=this._getCellByIndex({row:r,column:l}),C&&this._isNeighborCellEmpty(h,n))return u.cell=this.createIndex(r,l),u;if(y===i){let e;return g?e=(t.right?this._isLastColumn(y):this._isLastRow(y))&&-1!==s:f&&(e=0===y),e?(u.header=!0,u):(u.cell=this.createIndex(r,l),u)}y+=a}return null},D.prototype.handleNoDataFocusChange=function(e,t,i,s){let n;if(null==this.m_active)return null;switch(this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY)),e){case this.keyCodes.UP_KEY:!t&&s&&-1!==this.m_endColHeader&&(n=this._getHeaderByIndex(this.m_startColHeader,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader,!0),this._setActive(n,{type:"header",index:this.m_startColHeader,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0));break;case this.keyCodes.DOWN_KEY:-1!==this.m_endColEndHeader&&s&&(n=this._getHeaderByIndex(this.m_startColEndHeader,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader,!0),this._setActive(n,{type:"header",index:this.m_startColEndHeader,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0));break;case this.keyCodes.LEFT_KEY:!t&&s&&-1!==this.m_endRowHeader&&(n=this._getHeaderByIndex(this.m_startRowHeader,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader,!0),this._setActive(n,{type:"header",index:this.m_startRowHeader,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0));break;case this.keyCodes.RIGHT_KEY:-1!==this.m_endRowEndHeader&&s&&(n=this._getHeaderByIndex(this.m_startRowEndHeader,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader,!0),this._setActive(n,{type:"header",index:this.m_startRowEndHeader,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0))}return!0},D.prototype.handleFocusChange=function(e,t,i,s,n,o=!1,r=!1){var l,a,h,d=1,c=1;if(!this.isFetchComplete()&&!1===this.m_fetchingForUpdate)return!0;if(t){if(l=this.m_selectionFrontier,this.isHeaderSelectionType(this.m_selectionFrontier))return void this.handleHeaderFocusChange(e,i,t,n)}else l=this.m_active.indexes;if(null!=l){var m,u,_,p,g;switch(null==this.m_trueIndex&&(this.m_trueIndex={}),this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY)),m=this._isSelectionEnabled()?this.selectAndFocus.bind(this):this._setActiveByIndex.bind(this),u=l.row,_=l.column,(p=this._getCellByIndex(l))&&(d=(g=p[this.getResources().getMappedAttribute("context")]).extents.row,c=g.extents.column),e){case this.keyCodes.LEFT_KEY:if(this.m_trueIndex.row||t||(this.m_trueIndex={row:u}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{left:!0},this._getMaxLeft(),this.m_startRowHeader);s&&(s.cell?m(s.cell,i):s.header&&(h=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0)))}else _>0&&(!n||-1===this.m_endRowHeader)?"row"===this.m_options.getSelectionMode()?(a=this.createIndex(this.m_trueIndex.row,_-1),this._setActiveByIndex(a,i)):(t?(a=this.createIndex(u,_-1),this.extendSelection(a,i,e)):m(a=this.createIndex(this.m_trueIndex.row,_-1),i),_-1==0&&this._setAccInfoText("accessibleFirstColumn")):!t&&s&&(h=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"row",h,this.m_rowHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0));break;case this.keyCodes.RIGHT_KEY:if(this.m_trueIndex.row||t||(this.m_trueIndex={row:u}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{right:!0},this._getMaxRight(),this.m_endRowEndHeader);s&&(s.cell?m(s.cell,i):s.header&&(h=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0)))}else this._isLastColumn(_+(c-1))||n&&-1!==this.m_endRowEndHeader?-1!==this.m_endRowEndHeader&&s?(h=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"rowEnd",h,this.m_rowEndHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0)):t||m(l,i):"row"===this.m_options.getSelectionMode()?(a=this.createIndex(this.m_trueIndex.row,_+c),this._setActiveByIndex(a,i)):(t?(a=this.createIndex(u,_+1),this.extendSelection(a,i,e)):m(a=this.createIndex(this.m_trueIndex.row,_+c),i),this._isLastColumn(_+c)&&this._setAccInfoText("accessibleLastColumn"));break;case this.keyCodes.UP_KEY:if(this.m_trueIndex.column||t||(this.m_trueIndex={column:_}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{up:!0},this._getMaxTop(),this.m_startColHeader);s&&(s.cell?m(s.cell,i):s.header&&(h=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0)))}else u>0&&(!n||-1===this.m_endColHeader)?(t?(a=this.createIndex(u-1,_),this.extendSelection(a,i,e)):m(a=this.createIndex(u-1,this.m_trueIndex.column),i),u-1==0&&this._setAccInfoText("accessibleFirstRow")):!t&&s&&(h=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"column",h,this.m_columnHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0));break;case this.keyCodes.DOWN_KEY:if(this.m_trueIndex.column||t||(this.m_trueIndex={column:_}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{down:!0},this._getMaxBottom(),this.m_endColEndHeader);s&&(s.cell?m(s.cell,i):s.header&&(h=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0)))}else this._isLastRow(u+(d-1))||n&&-1!==this.m_endColEndHeader?-1!==this.m_endColEndHeader&&s?(h=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"columnEnd",h,this.m_columnEndHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0)):t||m(l,i):(t?(a=this.createIndex(u+1,_),this.extendSelection(a,i,e)):m(a=this.createIndex(u+d,this.m_trueIndex.column),i),this._isLastRow(u+d)&&this._setAccInfoText("accessibleLastRow"));break;case this.keyCodes.HOME_KEY:if(r)m(this.createIndex(0,0),i);else this.m_trueIndex.row||(this.m_trueIndex={row:u}),m(a=this.createIndex(this.m_trueIndex.row,0),i);break;case this.keyCodes.END_KEY:if(this.m_trueIndex.row||(this.m_trueIndex={row:u,column:_}),r){let e;e=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(Math.max(0,this.m_endRow),Math.max(0,this.m_endCol)):this.createIndex(Math.max(0,this.getDataSource().getCount("row")-1),Math.max(0,this.getDataSource().getCount("column")-1)),m(e,i)}else m(a=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(this.m_trueIndex.row,Math.max(0,this.m_endCol)):this.createIndex(this.m_trueIndex.row,Math.max(0,this.getDataSource().getCount("column")-1)),i);break;case this.keyCodes.PAGEUP_KEY:this.m_trueIndex.column||(this.m_trueIndex={column:_}),m(a=this.createIndex(0,_),i);break;case this.keyCodes.PAGEDOWN_KEY:this.m_trueIndex.column||(this.m_trueIndex={column:_}),m(a=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(Math.max(0,this.m_endRow),this.m_trueIndex.column):this.createIndex(Math.max(0,this.getDataSource().getCount("row")-1),this.m_trueIndex.column),i)}return!0}},D.prototype.scrollToIndex=function(e,t,i){var s,n,o=e.row,r=e.column;t&&(this.m_shouldFocus=!1),i&&(e.scrollToOrigin=!0);var l=this.getResources().isRTLMode()?"right":"left",a=0,h=0,d=this._getViewportTop(),c=this._getViewportBottom(),m=this._getViewportLeft(),u=this._getViewportRight();if(o<this.m_startRow||o>this.m_endRow){var _;_=o<this.m_startRow?this.m_avgRowHeight*o:this.m_avgRowHeight*(o+1)-c+d,h=this.m_currentScrollTop-_,this.m_scrollIndexAfterFetch=e,s=!0}else{var p;null===(n=this._getCellByIndex(e))?(n=this._getFirstCellWithMatchingStartIndex(o,"row"),p=this.m_sizingManager.getSize("row",this._getKey(n,"row"))):p=this.getElementHeight(n);var g=this.getElementDir(n,"top");i||e.scrollToOrigin?h=d-g:g+p>c?h=c-(g+p):g<d&&(h=d-g)}if(!isNaN(r)&&!0!==s)if(r<this.m_startCol||r>this.m_endCol){var f;f=r<this.m_startCol?this.m_avgColWidth*r:this.m_avgColWidth*(r+1)-u+m,a=this.m_currentScrollLeft-f,this.m_scrollIndexAfterFetch=e}else{var C;null===(n=this._getCellByIndex(e))?(n=this._getFirstCellWithMatchingStartIndex(r,"column"),C=this.m_sizingManager.getSize("column",this._getKey(n,"column"))):C=this.getElementWidth(n);var y=this.getElementDir(n,l);i||e.scrollToOrigin||y<m?a=m-y:y+C>u&&(a=u-(y+C))}0!==a||0!==h?(null!=(n=this._getCellByIndex(e))&&!0!==t&&!1!==this.m_shouldFocus&&(this.m_cellToFocus=n),this.scrollDelta(a,h)):null!=this.m_scrollIndexAfterFetch&&(t||!1===this.m_shouldFocus||this._setActiveByIndex(this.m_scrollIndexAfterFetch,null,!1,!1,!0))&&(this.m_scrollIndexAfterFetch=null)},D.prototype.scrollToHeader=function(e){var t,i,s,n,o,r,l,a,h,d=e.axis,c=e.index,m=e.level,u=0;"row"===d?(t=this.m_startRowHeader,i=this.m_endRowHeader,s=this.m_avgRowHeight,n=this.m_currentScrollTop,a=this._getViewportTop(),h=this._getViewportBottom()):"column"===d?(t=this.m_startColHeader,i=this.m_endColHeader,s=this.m_avgColWidth,n=this.m_currentScrollLeft,a=this._getViewportLeft(),h=this._getViewportRight()):"rowEnd"===d?(t=this.m_startRowEndHeader,i=this.m_endRowEndHeader,s=this.m_avgRowHeight,n=this.m_currentScrollTop,a=this._getViewportTop(),h=this._getViewportBottom()):"columnEnd"===d&&(t=this.m_startColEndHeader,i=this.m_endColEndHeader,s=this.m_avgColWidth,n=this.m_currentScrollLeft,a=this._getViewportLeft(),h=this._getViewportRight());var _=h-a;c<t||c>i?(u=n-(c<t?s*c:s*(c+1)-_),this.m_scrollHeaderAfterFetch=e):("row"===d||"rowEnd"===d?(l="row"===d?this._getHeaderByIndex(c,m,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader):this._getHeaderByIndex(c,m,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),o=this.getElementDir(l,"top"),r=this.getElementHeight(l)):"column"!==d&&"columnEnd"!==d||(l="column"===d?this._getHeaderByIndex(c,m,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader):this._getHeaderByIndex(c,m,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),o=this.getElementDir(l,this.getResources().isRTLMode()?"right":"left"),r=this.getElementWidth(l)),_>r?o+r>h?u=h-(o+r):o<a&&(u=a-o):u=a-o),0!==u?(null!=l&&!1!==this.m_shouldFocus&&(this.m_cellToFocus=l),"row"===d||"rowEnd"===d?this.scrollDelta(0,u):this.scrollDelta(u,0)):null!=this.m_scrollHeaderAfterFetch&&(this._updateActive(e,!0,!0),this.m_scrollHeaderAfterFetch=null)},D.prototype.findHeader=function(e,t,i){if(null==t&&(t=this.getMappedStyle("headercell")),null==i&&(i=this.getMappedStyle("endheadercell")),null!=t){if(this.m_utils.containsCSSClassName(e,t)||this.m_utils.containsCSSClassName(e,i))return e;if(e.parentNode)return this.findHeader(e.parentNode,t,i);if(e===this.m_root)return null}return null},D.prototype.updateRowBanding=function(){var e=this.m_options.getRowBandingInterval();if(e>0)for(var t=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getMappedStyle("banded"),s=0;s<t.length;s++){var n=t[s],o=this._getIndex(n,"row");Math.floor(o/e)%2==1?this.m_utils.containsCSSClassName(n,i)||this.m_utils.addCSSClassName(n,i):this.m_utils.containsCSSClassName(n,i)&&this.m_utils.removeCSSClassName(n,i)}},D.prototype.updateColumnBanding=function(){var e=this.m_options.getColumnBandingInterval();if(e>0)for(var t=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getMappedStyle("banded"),s=0;s<t.length;s+=1){var n=t[s],o=this._getIndex(n,"column");Math.floor(o/e)%2==1?this.m_utils.containsCSSClassName(n,i)||this.m_utils.addCSSClassName(n,i):this.m_utils.containsCSSClassName(n,i)&&this.m_utils.removeCSSClassName(n,i)}},D.prototype._removeBanding=function(){for(var e=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),t=this.getMappedStyle("banded"),i=0;i<e.length;i++)this.m_utils.containsCSSClassName(e[i],t)&&this.m_utils.removeCSSClassName(e[i],t)},D.prototype._setAccInfoText=function(e,t){var i=this.getResources().getTranslatedText(e,t);null!=i&&(this.m_accInfo.textContent=i)},D.prototype.handleExpandEvent=function(e,t){void 0===t&&this.queueModelEvent(e)?e.operation="expand":(this._setAccInfoText("accessibleRowExpanded"),this.populateAccInfo(),t&&this._runModelEventQueue())},D.prototype.handleCollapseEvent=function(e,t){void 0===t&&this.queueModelEvent(e)?e.operation="collapse":(this._setAccInfoText("accessibleRowCollapsed"),this.populateAccInfo(),t&&this._runModelEventQueue())},D.prototype._getKey=function(e,t){return null!=e&&e[this.getResources().getMappedAttribute("context")]?null!=t&&this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell"))?e[this.getResources().getMappedAttribute("context")].keys[t]:e[this.getResources().getMappedAttribute("context")].key:null},D.prototype._getActiveKey=function(e,t){if(t&&null!=this.m_prevActive){if("header"===this.m_prevActive.type&&(this.m_prevActive.axis===e||this.m_prevActive.axis===e+"End"))return this.m_prevActive.key;if("cell"===this.m_prevActive.type)return this.m_prevActive.keys[e]}else if(null!=this.m_active){if("header"===this.m_active.type&&(this.m_active.axis===e||this.m_active.axis===e+"End"))return this.m_active.key;if("cell"===this.m_active.type)return this.m_active.keys[e]}return null},D.prototype._handleCut=function(e,t){null==t&&(t=e.target);var i=this.findCellOrHeader(t);if(this._isMoveOnElementEnabled(i)){if(null!=this.m_cutCells)for(var s=0;s<this.m_cutCells.length;s++)this.m_utils.removeCSSClassName(this.m_cutCells[s],this.getMappedStyle("cut"));var n=this._getKey(i,"row");return this.m_cutCells=this._getAxisCellsByKey(n,"row"),this.m_cutRowHeader=this._findHeaderByKey(n,this.m_rowHeader,this.getMappedStyle("rowheadercell")),this.m_cutRowEndHeader=this._findHeaderByKey(n,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")),this._highlightCellsAlongAxis(n,"row","key","add",["cut"]),null!==this.m_cutRowHeader&&this.m_utils.addCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),null!==this.m_cutRowEndHeader&&this.m_utils.addCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),!0}return!1},D.prototype._handleCutCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&this.m_options.isCutEnabled()){this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]);let t=this.m_selection[this.m_selection.length-1];this.m_selectionRange=[t],this.m_dataTransferAction="cut";var i={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0]}};if(!this.fireEvent("cutRequest",i))return!0;this.highlightFloodFillRange(t),this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance()}return!0},D.prototype._handleCopyCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&this.m_options.isCopyEnabled()){this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]);let t=this.m_selection[this.m_selection.length-1];this.m_selectionRange=[t],this.m_dataTransferAction="copy";let i={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0]}};return!this.fireEvent("copyRequest",i)||(this.highlightFloodFillRange(t),this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance(),!0)}return!1},D.prototype._handlePaste=function(e,t){if(null==t&&(t=e.target),null!=this.m_cutCells){for(var i=0;i<this.m_cutCells.length;i++)this.m_utils.removeCSSClassName(this.m_cutCells[i],this.getMappedStyle("cut"));null!==this.m_cutRowHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),this.m_cutRowHeader=null),null!==this.m_cutRowEndHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),this.m_cutRowEndHeader=null);var s=this._getKey(this.findCellOrHeader(t),"row"),n=this._getKey(this.m_cutCells[0],"row");n!==s&&(this._isSelectionEnabled()&&this._clearSelection(e),this._isDatabodyCellActive()&&this._unhighlightActive(),this.m_moveActive=!0,this.getDataSource().move(n,s)),this.m_cutCells=null}return!0},D.prototype._handlePasteCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this.m_options.isPasteEnabled())if(this.m_selectionRange&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&1===this.m_selection.length){let t={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0],targetRange:this.m_selection[0]}};if(!this.fireEvent("pasteRequest",t))return!0;this.unhighlightFloodFillRange(this.m_selectionRange[0]),this.m_selectionRange=null,this.m_dataTransferAction=null}else if(!this.m_selectionRange){let t={event:e,ui:{action:"unknown",sourceRange:{},targetRange:this.m_selection[0]}};if(!this.fireEvent("pasteRequest",t))return!0;this.m_selectionRange=null,this.m_dataTransferAction=null}return!0},D.prototype._handleAutofill=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&this.m_options.isFloodFillEnabled()&&1===this.m_selection.length){let t="down";"keydown"===e.type&&(t="d"===e.key?"down":"end");let s=this.m_selection[0].startIndex,n=this.m_selection[0].endIndex,o=this.createRange(s,n),r=this.createRange(s,n),l=!1;if("down"===t?(o.endIndex.row=o.startIndex.row,r.startIndex.row=o.startIndex.row+1,r.startIndex.row>=o.startIndex.row&&r.startIndex.row<=r.endIndex.row&&(l=!0)):(o.endIndex.column=o.startIndex.column,r.startIndex.column=o.startIndex.column+1,r.startIndex.column>=o.startIndex.column&&r.startIndex.column<=r.endIndex.column&&(l=!0)),l){var i={event:e,ui:{action:t,sourceRange:o,targetRange:r}};if(!this.fireEvent("fillRequest",i))return!0}return this.unhighlightFloodFillRange(this.m_selection[0]),this._removeFloodFillAffordance(),this.m_selectionRange=null,this.m_dataTransferAction=null,this.m_floodFillDirection=null,!0}return!1},D.prototype._handleCancelReorder=function(e,t){if(null!=this.m_cutCells){for(var i=0;i<this.m_cutCells.length;i++)this.m_utils.removeCSSClassName(this.m_cutCells[i],this.getMappedStyle("cut"));return this.m_cutCells=null,null!==this.m_cutRowHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),this.m_cutRowHeader=null),null!==this.m_cutRowEndHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),this.m_cutRowEndHeader=null),!0}null!==this.m_dataTransferAction&&(this.unhighlightFloodFillRange(this.m_selectionRange[0]),this.m_selectionRange=null,this.m_dataTransferAction=null)},D.prototype._handleMove=function(e){if(null==this.m_moveCells){var t=e.target,i=this.findCellOrHeader(t),s=this._getKey(i,"row");this.m_originalMoveIndex=this._getIndex(i,"row"),this.m_moveIndex=this.m_originalMoveIndex,this.m_moveCells=this._getAxisCellsByIndex(this.m_moveIndex,"row"),this.m_moveRowHeader=this._findHeaderByKey(s,this.m_rowHeader,this.getMappedStyle("rowheadercell")),this.m_moveRowEndHeader=this._findHeaderByKey(s,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")),this._highlightCellsAlongAxis(this.m_moveIndex,"row","index","add",["drag"]),this.m_originalTop=this.getElementDir(this.m_moveCells[0],"top"),this.m_dropTarget=document.createElement("div"),this.m_utils.addCSSClassName(this.m_dropTarget,this.getMappedStyle("drop")),this.setElementHeight(this.m_dropTarget,this.calculateRowHeight(this.m_moveCells[0])),this.setElementDir(this.m_dropTarget,this.m_originalTop,"top"),this.m_databody.firstChild.appendChild(this.m_dropTarget),this._addHeaderDropTarget(this.m_moveRowHeader,this.m_rowHeader,!1),this._addHeaderDropTarget(this.m_moveRowEndHeader,this.m_rowEndHeader,!0)}this.m_utils.isTouchDevice()||(this.m_prevY=this.m_currentY,this.m_currentY=e.pageY);for(var n=this.m_currentY-this.m_prevY,o=this.calculateRowHeight(this.m_moveCells[0]),r=0;r<this.m_moveCells.length;r++)this.setElementDir(this.m_moveCells[r],this.getElementDir(this.m_moveCells[r],"top")+n,"top");null!==this.m_moveRowHeader&&this.setElementDir(this.m_moveRowHeader,this.getElementDir(this.m_moveRowHeader,"top")+n,"top"),null!==this.m_moveRowEndHeader&&this.setElementDir(this.m_moveRowEndHeader,this.getElementDir(this.m_moveRowEndHeader,"top")+n,"top");var l=this.m_moveIndex+1,a=this.m_moveIndex-1,h=this._getCellByIndex(this.createIndex(l,this.m_startCol)),d=this._getCellByIndex(this.createIndex(a,this.m_startCol));null!=h&&this.getElementDir(h,"top")<this.getElementDir(this.m_moveCells[0],"top")+o/2?this._moveDropRows("nextSibling",l):null!=d&&this.getElementDir(d,"top")>this.getElementDir(this.m_moveCells[0],"top")-o/2&&this._moveDropRows("previousSibling",a)},D.prototype._addHeaderDropTarget=function(e,t,i){var s;null!==e&&(null==e.style.height&&this.setElementHeight(e,this.calculateRowHeight(e)),this.m_utils.addCSSClassName(e,this.getMappedStyle("drag")),s=document.createElement("div"),this.m_utils.addCSSClassName(s,this.getMappedStyle("drop")),this.setElementHeight(s,this.calculateRowHeight(e)),this.setElementDir(s,this.m_originalTop,"top"),t.firstChild.appendChild(s),i?this.m_dropTargetEndHeader=s:this.m_dropTargetHeader=s)},D.prototype._moveDropRows=function(e,t){var i,s,n,o,r;"nextSibling"===e?(r=this._getAxisCellsByIndex(t,"row"),i=this.m_originalTop+this.calculateRowHeight(r[0]),s=this.m_originalTop):(r=this._getAxisCellsByIndex(t,"row"),s=(i=this.getElementDir(r[0],"top"))+this.calculateRowHeight(r[0])),this.setElementDir(this.m_dropTarget,i,"top");for(var l=0;l<r.length;l++)this.setElementDir(r[l],s,"top");null!==this.m_moveRowHeader&&(n=this.m_moveRowHeader.parentNode,this.setElementDir(this.m_dropTargetHeader,i,"top"),this.setElementDir(this.m_moveRowHeader[e],s,"top")),null!==this.m_moveRowEndHeader&&(o=this.m_moveRowEndHeader.parentNode,this.setElementDir(this.m_dropTargetEndHeader,i,"top"),this.setElementDir(this.m_moveRowEndHeader[e],s,"top")),this.m_originalTop=i,this._highlightCellsAlongAxis(this.m_moveIndex+1,"row","index","remove",["activedrop"]),"nextSibling"===e?(this._modifyAxisCellContextIndex("row",this.m_moveIndex,1,1),this._modifyAxisCellContextIndex("row",this.m_moveIndex+1,1,-1),this.m_moveIndex+=1,null!==this.m_moveRowHeader&&n&&n.insertBefore(this.m_moveRowHeader,this.m_moveRowHeader[e][e]),null!==this.m_moveRowEndHeader&&o&&o.insertBefore(this.m_moveRowEndHeader,this.m_moveRowEndHeader[e][e])):(this._modifyAxisCellContextIndex("row",this.m_moveIndex,1,-1),this._modifyAxisCellContextIndex("row",this.m_moveIndex-1,1,1),this.m_moveIndex-=1,null!==this.m_moveRowHeader&&n&&n.insertBefore(this.m_moveRowHeader,this.m_moveRowHeader[e]),null!==this.m_moveRowEndHeader&&o&&o.insertBefore(this.m_moveRowEndHeader,this.m_moveRowEndHeader[e])),this._refreshDatabodyMap(),this._highlightCellsAlongAxis(this.m_moveIndex+1,"row","index","add",["activedrop"])},D.prototype._isMoveEnabled=function(e){var t=this.getDataSource().getCapability("move");return"enable"===this.m_options.isMoveable("row")&&("full"===t||t===e)},D.prototype._handleMoveMouseUp=function(e,t){if(null!=this.m_moveCells){this._remove(this.m_dropTarget),null!==this.m_moveRowHeader&&this._remove(this.m_dropTargetHeader),null!==this.m_moveRowEndHeader&&this._remove(this.m_dropTargetEndHeader),null!=this.m_active&&"column"!==this.m_active.axis&&(this.m_moveActive=!0),this._isSelectionEnabled()&&this._clearSelection(e);var i=this.m_moveCells[0],s=this._getKey(i,"row");if(!0===t){var n=this.m_moveIndex+1,o=this._getKey(this._getCellByIndex(this.createIndex(n,this.m_startCol)),"row");this.getDataSource().move(s,o)}else this.getDataSource().move(s,s);this.m_moveCells=null,this.m_originalMoveIndex=null,this.m_moveIndex=null}this.m_databodyMove=!1},D.prototype._handleFloodFillMouseUp=function(e){if(this.m_floodFillRange&&this.m_floodFillRange.length){var t={event:e,ui:{action:this.m_floodFillDirection,sourceRange:this.m_selectionRange[0],targetRange:this.m_floodFillRange[0]}};if(!this.fireEvent("fillRequest",t))return!0;this.unhighlightFloodFillRange()}return this.m_selectionRange=null,this.m_floodFillRange=null,this.m_floodFillDirection=null,this.m_databody&&(this.m_databody.style.cursor="default"),this.m_cursor="default",!0},D.prototype._isMoveOnElementEnabled=function(e){return!(null==e||!this._isMoveEnabled("row")||this._getActiveKey("row")!==this._getKey(e,"row"))},D.prototype._manageMoveCursor=function(){if(!this._isDataGridProvider()){var e=this._getActiveKey("row"),t=this._getActiveKey("row",!0),i=this.getMappedStyle("draggable"),s=this.getMappedStyle("rowheadercell"),n=this.getMappedStyle("rowendheadercell");if(null!=t){this._highlightCellsAlongAxis(t,"row","key","remove",["draggable"]);var o=this._findHeaderByKey(t,this.m_rowHeader,s);this.m_utils.containsCSSClassName(o,i)&&this.m_utils.removeCSSClassName(o,i),o=this._findHeaderByKey(t,this.m_rowEndHeader,n),this.m_utils.containsCSSClassName(o,i)&&this.m_utils.removeCSSClassName(o,i)}if(null!=e){var r=this._getAxisCellsByKey(e,"row");if(this._isMoveOnElementEnabled(r[0])){this._highlightCellsAlongAxis(e,"row","key","add",["draggable"]);var l=this._findHeaderByKey(e,this.m_rowHeader,s);this.m_utils.addCSSClassName(l,i);var a=this._findHeaderByKey(e,this.m_rowEndHeader,n);this.m_utils.addCSSClassName(a,i)}}}},D.prototype.handleRootFocus=function(e,t){if(this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("focus")),this._clearFocusoutTimeout(),this._clearFocusoutBusyState(),!t){if(this._clearOpenPopupListeners(),!this.m_root.contains(document.activeElement)||document.activeElement===this.m_root&&0===this.m_root.tabIndex||document.activeElement===this.m_databody&&this.m_scrollbarFocus&&0===this.m_root.tabIndex){this.m_externalFocus=!0,this._isCellEditable()?this._setAccInfoText("accessibleEditableMode"):this._isGridEditable()&&this._setAccInfoText("accessibleNavigationMode");var i=!1;!0===this.m_scrollbarFocus&&(this.m_shouldFocus=!1,this.m_scrollbarFocus=!1,i=!0);let t=this._getEmptyElement();if(null==this.m_active&&t)this._setActive(t,{type:"empty"},e,null,null,i,!0);else if(null!=this.m_active||this._databodyEmpty())null!=this.m_active&&this._highlightActive();else{var s=this.createIndex(0,0);i||this.scrollToIndex(s),this._setActiveByIndex(s,e,null,null,i)}}this.m_root.tabIndex=-1}},D.prototype._handlePopupFocusout=function(e){this.handleRootBlur(e,!0)},D.prototype._handlePopupFocusin=function(e){this.handleRootFocus(e,!0)},D.prototype.handleRootBlur=function(e,t){if(this._clearFocusoutTimeout(),!t){this._clearOpenPopupListeners();var i=f.getLogicalChildPopup(this.m_root);if(null!=i)return this._openPopup=i,t=!1,this._handlePopupFocusinListener=this._handlePopupFocusin.bind(this),this._handlePopupFocusoutListener=this._handlePopupFocusout.bind(this),i.addEventListener("focusin",this._handlePopupFocusinListener),void i.addEventListener("focusout",this._handlePopupFocusoutListener)}this._setFocusoutBusyState(),this.m_focusoutTimeout=setTimeout(function(){if(!this.m_root.contains(document.activeElement)||!0===t){this.m_root.tabIndex=0;var i=this._getActiveElement();null!=i&&(this._unsetAriaProperties(i),this._isEditOrEnter()&&!this.m_animating&&this._leaveEditing(e,i,!1,!1))}this._clearFocusoutBusyState()}.bind(this),100),null==this.m_moveRow&&this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("focus"))},D.prototype._clearOpenPopupListeners=function(){null!=this._openPopup&&(this._openPopup.removeEventListener("focusin",this._handlePopupFocusinListener),this._openPopup.removeEventListener("focusout",this._handlePopupFocusoutListener),this._openPopup=null),this._handlePopupFocusinListener=null,this._handlePopupFocusoutListener=null},D.prototype._handlePopupFocusout=function(e){this.handleRootBlur(e,!0)},D.prototype._handlePopupFocusin=function(e){this.handleRootFocus(e,!0)},D.prototype._clearFocusoutTimeout=function(){this.m_focusoutTimeout&&(clearTimeout(this.m_focusoutTimeout),this.m_focusoutTimeout=null)},D.prototype._setFocusoutBusyState=function(){if(!this.m_focusoutResolveFunc){var e=m.getContext(this.m_root).getBusyContext(),t={description:"Datagrid component 'is handling focusout."};this.m_focusoutResolveFunc=e.addBusyState(t)}},D.prototype._clearFocusoutBusyState=function(){this.m_focusoutResolveFunc&&(this.m_focusoutResolveFunc(),this.m_focusoutResolveFunc=null)},D.prototype.calculateRowHeight=function(e){return""!==e.style.height?this.getElementHeight(e):null!=e.nextSibling?this.getElementDir(e.nextSibling,"top")-this.getElementDir(e,"top"):this.m_endRowPixel-this.getElementDir(e,"top")},D.prototype.calculateRowHeaderHeight=function(e){return""!==e.style.height?this.getElementHeight(e):null!=e.nextSibling?this.getElementDir(e.nextSibling,"top")-this.getElementDir(e,"top"):this.m_endRowHeaderPixel-this.getElementDir(e,"top")},D.prototype.calculateRowHeaderLabelHeight=function(e){return this.getElementHeight(e)},D.prototype.calculateColumnWidth=function(e){if(""!==e.style.width)return this.getElementWidth(e);var t=this.getResources().isRTLMode()?"right":"left";return null!=e.nextSibling?this.getElementDir(e.nextSibling,t)-this.getElementDir(e,t):this.m_endColPixel-this.getElementDir(e,t)},D.prototype.calculateColumnHeaderWidth=function(e){if(""!==e.style.width)return this.getElementWidth(e);var t=this.getResources().isRTLMode()?"right":"left";return null!=e.nextSibling?this.getElementDir(e.nextSibling,t)-this.getElementDir(e,t):this.m_endColHeaderPixel-this.getElementDir(e,t)},D.prototype._databodyEmpty=function(){return null==this.m_databody.firstChild||null==this.m_databody.firstChild.firstChild},D.prototype._databodyEmptyState=function(){return!(null!=this.m_databody.firstChild&&null!=this.m_databody.firstChild.firstChild&&!this._getEmptyElement())},D.prototype._getEmptyElement=function(){let e=this.m_databody.querySelector("."+this.getMappedStyle("noDataContainer")),t=this.m_databody.querySelector("."+this.getMappedStyle("emptytext"));return e||t},D.prototype.changeStyleProperty=function(e,t,i,s){void 0!==t&&(e.style[t]="remove"===s?"":i)},D.prototype.addTransformMoveStyle=function(e,t,i,s,n,o,r){this.changeStyleProperty(e,this.getCssSupport("transition-delay"),i),this.changeStyleProperty(e,this.getCssSupport("transition-timing-function"),s),this.changeStyleProperty(e,this.getCssSupport("transition-duration"),t),this.changeStyleProperty(e,this.getCssSupport("transform"),"translate3d("+n+"px,"+o+"px,"+r+"px)")},D.prototype.removeTransformMoveStyle=function(e){this.changeStyleProperty(e,this.getCssSupport("transition-delay"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transition-timing-function"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transition-duration"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transform"),null,"remove")},D.prototype.getCssSupport=function(e){var t=["","-moz-","-webkit-","-o-","-ms-","-khtml-"],i=document.documentElement;for(var s=0;s<t.length;s++){var n=(t[s]+e).replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()});if("Ms"===n.substr(0,2)&&(n="m"+n.substr(1)),n in i.style)return n}},D.prototype._refreshDatabodyMap=function(){this._clearDatabodyMap(),this._addNodesToDatabodyMap(this.m_databody.firstChild.childNodes)},D.prototype._populateDatabody=function(e,t){this._addNodesToDatabodyMap(t.childNodes),e.appendChild(t),this.m_subtreeAttachedCallback(e)},D.prototype._emptyDatabody=function(e){this._clearDatabodyMap(),this.m_utils.empty(e)},D.prototype._addNodesToDatabodyMap=function(e){for(var t=0;t<e.length;t++){var i=e[t];if(this.m_utils.containsCSSClassName(i,this.getMappedStyle("cell"))){var s=this.getCellIndexes(i),n=this.getCellExtents(i),o=i.id;this._addToDatabodyMap(s,o,n)}}},D.prototype._addToDatabodyMap=function(e,t,i){for(var s=i.row,n=i.column,o=0;o<s;o++)for(var r=0;r<n;r++)this._addIndexToDatabodyMap(this.createIndex(e.row+o,e.column+r),t)},D.prototype._addIndexToDatabodyMap=function(e,t){var i="r"+e.row+"c"+e.column;this.m_databodyMap.set(i,t)},D.prototype._removeIndexFromDatabodyMap=function(e){var t="r"+e.row+"c"+e.column;return this.m_databodyMap.delete(t)},D.prototype._getFromDatabodyMap=function(e){var t="r"+e.row+"c"+e.column;return this.m_databodyMap.get(t)},D.prototype._clearDatabodyMap=function(){return this.m_databodyMap.clear()},D.prototype._modifyAxisCellContextIndex=function(e,t,i,s){for(var n=t;n<t+i;n++)for(var o=this._getAxisCellsByIndex(n,e),r=0;r<o.length;r++){o[r][this.getResources().getMappedAttribute("context")].indexes[e]+=s}},D.prototype._modifyAxisHeaderContextIndex=function(e,t,i,s){for(var n=t;n<t+i;n++){var o;o="row"===e?this._getHeadersByIndex(n,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader):this._getHeadersByIndex(n,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader);for(var r=0;r<o.length;r++){o[r][this.getResources().getMappedAttribute("context")].index+=s}}},D.prototype._getCellOrHeaderByIndex=function(e,t){var i=null,s=this._getAxisCellsByIndex(e,t,!0);return null!=s&&s.length>0&&(i=s[0]),null==i&&("row"===t&&null==(i=this._getHeaderByIndex(e,0,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader))&&(i=this._getHeaderByIndex(e,0,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader)),"column"===t&&null==(i=this._getHeaderByIndex(e,0,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader))&&(i=this._getHeaderByIndex(e,0,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader))),i},D.prototype._getLabel=function(e,t){return this.m_headerLabels[e][t]},D.prototype._getCellByIndex=function(e){var t=this._getFromDatabodyMap(e);return null!=t?this.m_databody.querySelector("#"+t):null},D.prototype._getCellsInRange=function(e,t,i,s){let n=[];for(let o=e;o<=i;o++)for(let e=t;e<=s;e++){let t=this._getCellByIndex(this.createIndex(o,e));t&&n.push(t)}return n},D.prototype._getFirstCellWithMatchingStartIndex=function(e,t){let i,s,n="row"===t?this.m_startCol:this.m_startRow,o="row"===t?this.m_endCol:this.m_endRow;for(let r=n;r<=o;r++)if(i=this.createIndex("row"===t?e:r,"row"===t?r:e),s=this._getCellByIndex(i),this._getIndex(s,t)===e)return s;return null},D.prototype._getAxisCellsByIndex=function(e,t,i){for(var s,n="row"===t?this.m_startCol:this.m_startRow,o="row"===t?this.m_endCol:this.m_endRow,r=[],l=n;l<=o;l+=s){var a=this._getCellByIndex(this.createIndex("row"===t?e:l,"row"===t?l:e));if(null!=a){if(s=this.getCellExtents(a)["row"===t?"column":"row"],r.push(a),i)break}else s=1}return r},D.prototype._getAxisCellsByKey=function(e,t,i){if(null==e||null==this.m_databody||null==this.m_databody.firstChild)return null;for(var s=[],n=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),o=0;o<n.length;o++){var r=n[o];if(this.m_utils.containsCSSClassName(r,this.getMappedStyle("cell")))if(this._getKey(r,t)===e&&(s.push(r),i))break}return s},D.prototype._setupActions=function(){this.actions={ACTIONABLE:this._handleActionable,EXIT_ACTIONABLE:this._handleExitActionable,TAB_NEXT_IN_CELL:u.handleActionableTab,TAB_PREV_IN_CELL:u.handleActionablePrevTab,EDITABLE:this._handleEditable,EXIT_EDITABLE:this._handleExitEditable,DATA_ENTRY:this._handleDataEntry,EXIT_DATA_ENTRY:this._handleExitDataEntry,EDIT:this._handleEdit,EXIT_EDIT:this._handleExitEdit,CANCEL_EDIT:this._handleCancelEdit,NO_OP:this._handleNoOp,FOCUS_LEFT:this._handleFocusLeft,FOCUS_LEFT_NON_EMPTY_CELL:this._handleFocusLeftNonEmptyCell,FOCUS_RIGHT:this._handleFocusRight,FOCUS_RIGHT_NON_EMPTY_CELL:this._handleFocusRightNonEmptyCell,FOCUS_UP:this._handleFocusUp,FOCUS_UP_NON_EMPTY_CELL:this._handleFocusUpNonEmptyCell,FOCUS_DOWN:this._handleFocusDown,FOCUS_DOWN_NON_EMPTY_CELL:this._handleFocusDownNonEmptyCell,FOCUS_ROW_FIRST:this._handleFocusRowFirst,FOCUS_ROW_LAST:this._handleFocusRowLast,FOCUS_COLUMN_FIRST:this._handleFocusColumnFirst,FOCUS_COLUMN_LAST:this._handleFocusColumnLast,FOCUS_COLUMN_HEADER:this._handleFocusColumnHeader,FOCUS_COLUMN_END_HEADER:this._handleFocusColumnEndHeader,FOCUS_ROW_HEADER:this._handleFocusRowHeader,FOCUS_ROW_END_HEADER:this._handleFocusRowEndHeader,FOCUS_FIRST_CELL_IN_GRID:this._handleFocusFirstCellInGrid,FOCUS_LAST_CELL_IN_GRID:this._handleFocusLastCellInGrid,READ_CELL:this.readCurrentContent,SORT:this._handleSortKey,EXPAND:this._handleExpandKey,COLLAPSE:this._handleCollapseKey,SELECT_DISCONTIGUOUS:this._handleSelectDiscontiguous,SELECT_EXTEND_LEFT:this._handleExtendSelectionLeft,SELECT_EXTEND_RIGHT:this._handleExtendSelectionRight,SELECT_EXTEND_UP:this._handleExtendSelectionUp,SELECT_EXTEND_DOWN:this._handleExtendSelectionDown,SELECT_ROW:this._handleSelectRow,SELECT_COLUMN:this._handleSelectColumn,SELECT_ALL:this._handleSelectAll,CUT:this._handleCut,CUT_CELLS:this._handleCutCells,COPY_CELLS:this._handleCopyCells,CANCEL_REORDER:this._handleCancelReorder,PASTE:this._handlePaste,PASTE_CELLS:this._handlePasteCells,FILL:this._handleAutofill,CANCEL_DRAG:this.handleCancelDrag}},D.prototype._getActionFromKeyDown=function(e,t,i){var s={cellOrHeader:t,isLabel:i,readOnly:!this._isCellEditable(),currentMode:this._getCurrentMode(),activeMove:null!=this.m_cutCells||null!=this.m_dataTransferAction,rowMove:this._isMoveEnabled("row"),columnSort:"column"===t&&this._isDOMElementSortable(this._getActiveElement()),rowSort:"row"===t&&this._isDOMElementSortable(this._getActiveElement()),selection:this._isSelectionEnabled(),selectionMode:this.m_options.getSelectionMode(),multipleSelection:this.isMultipleSelection(),expandCollapse:this._isTargetExpandCollapseEnabled(e.target)};return this._isDataGridProvider()&&(s.cutCells=!0,s.copyCells=!0,s.pasteCells=!0,s.activeDrag=!(!this._cellsDragged||!this._cellsDragged.length)),this.m_options.isFloodFillEnabled()&&(s.fill=!0),this.actions[this.m_keyboardHandler.getAction(e,s)]},D.prototype._getActionFromNoDataKeydown=function(e){var t={readOnly:!this._isCellEditable(),currentMode:this._getCurrentMode()};return this.actions[this.m_keyboardHandler.getNoDataAction(e,t)]},D.prototype.isActionableMode=function(){return"actionable"===this.m_currentMode},D.prototype.setActionableMode=function(e){this.m_currentMode=e?"actionable":"navigation",this._setAccInfoText(this.isActionableMode()?"accessibleActionableMode":"accessibleNavigationMode")},D.prototype._handleActionable=function(e,t){return this._enterActionableMode(t,e),!1},D.prototype._handleExitActionable=function(e,t){return this._exitActionableMode(),this._highlightActive(),!1},D.prototype._getEditMode=function(){return null==this.m_editMode&&(this.m_editMode=this.m_options.getEditMode()),this.m_editMode},D.prototype._getCurrentMode=function(){return null==this.m_currentMode&&(this.m_currentMode="navigation"),this.m_currentMode},D.prototype._isEditOrEnter=function(){return"edit"===this._getCurrentMode()},D.prototype._isGridEditable=function(){var e=this._getEditMode();return"cellNavigation"===e||"cellEdit"===e},D.prototype._isCellEditable=function(){return"cellEdit"===this._getEditMode()},D.prototype._handleEditable=function(e,t){return this._isGridEditable()?(this.m_editMode=null,this.m_setOptionCallback("editMode","cellEdit",{_context:{writeback:!0,internalSet:!0}}),this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("editable")),this._updateEdgeCellBorders(""),this._setAccInfoText("accessibleEditableMode"),this._setEditableClone(t)):this._handleActionable(e,t),!1},D.prototype._handleExitEditable=function(e,t){this.m_editMode=null,this.m_setOptionCallback("editMode","cellNavigation",{_context:{writeback:!0,internalSet:!0}}),this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("editable")),this._updateEdgeCellBorders("none"),this._setAccInfoText("accessibleNavigationMode"),this._destroyEditableClone()},D.prototype._handleDataEntry=function(e,t){var i={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")]}};return this.fireEvent("beforeEdit",i)&&(this._removeFloodFillAffordance(),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),this.m_editableClone),this._overwriteFlag=!0,this._setFocusToFirstFocusableElement(t)?this.m_currentMode="edit":this.m_utils.removeCSSClassName(t,this.getMappedStyle("cellEdit")),this._overwriteFlag=!1),!1},D.prototype._handleExitDataEntry=function(e,t){return this._leaveEditing(e,t,!1)},D.prototype._handleEdit=function(e,t){var i={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")]}},s=this.fireEvent("beforeEdit",i);if(s){this._removeFloodFillAffordance(),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),this.m_editableClone),this.m_currentMode="edit";var n=this;m.getContext(t).getBusyContext().whenReady().then(function(){n._setFocusToFirstFocusableElement(t)||(n.m_utils.removeCSSClassName(t,n.getMappedStyle("cellEdit")),n.m_currentMode="navigation")})}else s=!1,this._enterActionableMode(t);return s},D.prototype._handleExitEdit=function(e,t){return this._leaveEditing(e,t,!1)},D.prototype._handleCancelEdit=function(e,t){return!!this._leaveEditing(e,t,!0)&&(this._setEditableClone(t),!0)},D.prototype._leaveEditing=function(e,t,i,s){var n={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")],cancelEdit:i}};i||(u.disableAllFocusableElements(t),!1===s&&(this.m_shouldFocus=s),this._highlightActive());var o=this.fireEvent("beforeEditEnd",n);return o?(this.m_currentMode="navigation",u.disableAllFocusableElements(t),!1===s&&(this.m_shouldFocus=s),this._highlightActive(),this._reRenderCell(t,"navigation",this.getMappedStyle("cellEdit"),this.m_editableClone)):(o=!1,this._scrollToActive(this.m_active),this._setFocusToFirstFocusableElement(t)),o},D.prototype._handleFocusKey=function(e,t,i,s,n,o,r){var l,a=!0,h=!0;if(null!=this.m_active){if("cell"===this.m_active.type){if(this._isEditOrEnter()?(l=!0,a=this._leaveEditing(e,t,!1),h=!1):this.isActionableMode()&&this._exitActionableMode(),a){this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance();var d=this.m_active,c=this.handleFocusChange(i,s,e,h,n,o,r);return this._isGridEditable()&&d!==this.m_active&&l&&this.m_utils.isTouchDevice()?this._handleDataEntry(e,this._getActiveElement()):c}return!0}if("header"===this.m_active.type)return this.handleHeaderFocusChange(i,e,s,n,o);if("label"===this.m_active.type)return this.handleLabelFocusChange(i,e,s,n);if("empty"===this.m_active.type)return this.handleNoDataFocusChange(i,s,e,h)}return!1},D.prototype._handleFocusLeft=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!1)},D.prototype._handleFocusLeftNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!1,!0)},D.prototype._handleFocusRight=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!1)},D.prototype._handleFocusRightNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!1,!0)},D.prototype._handleFocusUp=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!1)},D.prototype._handleFocusUpNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!1,!0)},D.prototype._handleFocusDown=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!1)},D.prototype._handleFocusDownNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!1,!0)},D.prototype._handleFocusRowFirst=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.PAGEUP_KEY,!1,!1)},D.prototype._handleFocusRowLast=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.PAGEDOWN_KEY,!1,!1)},D.prototype._handleFocusColumnFirst=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.HOME_KEY,!1,!1)},D.prototype._handleFocusColumnLast=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.END_KEY,!1,!1)},D.prototype._handleFocusRowHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!0)},D.prototype._handleFocusRowEndHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!0)},D.prototype._handleFocusColumnHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!0)},D.prototype._handleFocusColumnEndHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!0)},D.prototype._handleFocusFirstCellInGrid=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.HOME_KEY,!1,!1,!1,!0)},D.prototype._handleFocusLastCellInGrid=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.END_KEY,!1,!1,!1,!0)},D.prototype._handleSelectRow=function(e,t){var i,s,n,o,r=1;if(!this._isSelectionEnabled()||!this.isMultipleSelection()&&"row"!==this.m_options.getSelectionMode())return!1;if(this.m_utils.containsCSSClassName(t,this.getMappedStyle("cell")))i=o=this.m_active.indexes.row,s=o,n=this.m_rowHeaderLevelCount-1;else{if(null==this.m_active||"header"!==this.m_active.type||-1===this.m_active.axis.indexOf("row"))return!1;if(o=this.m_active.index,n=this.m_active.level,this.m_rowHeaderLevelCount-1===n)i=o,s=o;else{var l=this._getActiveElement();s=(i=this._getAttribute(l.parentNode,"start",!0))+(r=this._getAttribute(l.parentNode,"extent",!0))-1}}if(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("column"))return this._handleSelectAll(e),!0;if(this.setHeaderSelectionFrontier("row",s,o,n,t,!0),this._shouldDeselectHeader(o,r,"row")){var a=this.createIndex(o,0),h=this.createIndex(o+r-1,-1),d=this._getSelectionStartAndEnd(a,h,0),c=this.createRange(this.createIndex(d.min.row,0),this.createIndex(d.max.row,-1)),m=this._trimRangeForSelectionMode(c);return this.m_deselectInfo={selection:this.GetSelection()},this._deselectRange(m,e),!0}return this._selectEntireRow(i,s,e),this._setAccInfoText("accessibleRowSelected",{row:o+1}),!0},D.prototype._handleSelectColumn=function(e,t){var i,s,n,o,r=1;if(!this._isSelectionEnabled()||!this.isMultipleSelection()||"cell"!==this.m_options.getSelectionMode())return!1;if(this.m_utils.containsCSSClassName(t,this.getMappedStyle("cell")))i=o=this.m_active.indexes.column,s=o,n=this.m_columnHeaderLevelCount-1;else{if(null==this.m_active||"header"!==this.m_active.type||-1===this.m_active.axis.indexOf("column"))return!1;if(o=this.m_active.index,n=this.m_active.level,this.m_columnHeaderLevelCount-1===n)i=o,s=o;else{var l=this._getActiveElement();s=(i=this._getAttribute(l.parentNode,"start",!0))+(r=this._getAttribute(l.parentNode,"extent",!0))-1}}if(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("row"))return this._handleSelectAll(e),!0;if(this.setHeaderSelectionFrontier("column",s,o,n,t,!0),this._shouldDeselectHeader(o,r,"column")){var a=this.createIndex(0,o),h=this.createIndex(-1,o+r-1),d=this._getSelectionStartAndEnd(a,h,0),c=this.createRange(this.createIndex(0,d.min.column),this.createIndex(-1,d.max.column)),m=this._trimRangeForSelectionMode(c);return this.m_deselectInfo={selection:this.GetSelection()},this._deselectRange(m,e),!0}return this._selectEntireColumn(i,s,e),this._setAccInfoText("accessibleColumnSelected",{column:o+1}),!0},D.prototype._handleSelectDiscontiguous=function(e,t){return this.setDiscontiguousSelectionMode(!this.m_discontiguousSelection),!0},D.prototype._handleExtendSelectionLeft=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!0,!1)},D.prototype._handleExtendSelectionRight=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!0,!1)},D.prototype._handleExtendSelectionUp=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!0,!1)},D.prototype._handleExtendSelectionDown=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!0,!1)},D.prototype._handleSortKey=function(e,t){return"true"===t.getAttribute(this.getResources().getMappedAttribute("sortable"))?(this._handleKeyboardSort(t,e),!0):this._handleActionable(e,t)},D.prototype._handleExpandKey=function(e,t){return!!this._isHeaderCollapsed(t)&&(this._handleExpandCollapseRequest(e),!0)},D.prototype._handleCollapseKey=function(e,t){return!!this._isHeaderExpanded(t)&&(this._handleExpandCollapseRequest(e),!0)},D.prototype._handleNoOp=function(e,t){return!1},D.RESIZE_OFFSET=5,D.RESIZE_TOUCH_OFFSET=8,D.prototype.handleResize=function(e){if(!1===this.m_isResizing){var t=this.find(e.target,"header"),i=this.find(e.target,"headerlabel");if(null==t&&(t=this.find(e.target,"endheader")),null!=t&&(t===this.m_rowHeader||t===this.m_colHeader||t===this.m_rowEndHeader||t===this.m_colEndHeader)||null!=i){let s=!1;i&&(s=!0),this.m_cursor=this.manageHeaderCursor(e,s),null!=this.m_resizingElement&&("default"===this.m_cursor?(this.m_resizingElement.style.cursor="",this._isSelectionEnabled()&&(t&&this.shouldHoverHeader(t)||i)&&this.m_utils.addCSSClassName(e.target,this.getMappedStyle("hover")),null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor="")):(this.m_resizingElement.style.cursor=this.m_cursor,this.m_utils.removeCSSClassName(e.target,this.getMappedStyle("hover")),null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor=this.m_cursor)))}}else this.handleResizeMouseMove(e)},D.prototype.handleResizeMouseDown=function(e){return("col-resize"===this.m_cursor||"row-resize"===this.m_cursor)&&(this.m_isResizing=!0,this.m_utils.isTouchDevice()?(this.m_lastMouseX=e.touches[0].pageX,this.m_lastMouseY=e.touches[0].pageY):(document.addEventListener("mousemove",this.m_docMouseMoveListener,!1),document.addEventListener("mouseup",this.m_docMouseUpListener,!1),this.m_lastMouseX=e.pageX,this.m_lastMouseY=e.pageY),this.m_overResizeLeft=0,this.m_overResizeMinLeft=0,this.m_overResizeTop=0,this.m_overResizeMinTop=0,this.m_overResizeRight=0,this.m_overResizeBottom=0,this.m_orginalResizeDimensions={width:this.getElementWidth(this.m_resizingElement),height:this.getElementHeight(this.m_resizingElement)},!0)},D.prototype._resizeSelectedHeaders=function(e,t,i,s,n,o){let r,l=this.m_resizingElement,a=this.getHeaderCellAxis(this.m_resizingElement),h=this.getHeaderCellIndex(this.m_resizingElement),d=this._getResizeHeaderMode(this.m_resizingElement),c=this.getHeaderCellLevel(this.m_resizingElement),m=!1;if(("column"===a&&c===this.m_columnHeaderLevelCount-1||"row"===a&&c===this.m_rowHeaderLevelCount-1||"columnEnd"===a&&c===this.m_columnEndHeaderLevelCount-1||"rowEnd"===a&&c===this.m_rowEndHeaderLevelCount-1)&&(m=!0),this.m_selection&&this.m_selection.length&&m&&!this.m_discontiguousSelection&&(r=this._getHeadersWithinSelection(this.m_selection[0],h,a)),r&&r.length)for(let a=0;a<r.length;a++)l!==r[a]&&(this.m_resizingElement=r[a],"column"===d?this.resizeColWidth(this.getElementDir(r[a],"width"),s):this.resizeRowHeight(this.getElementDir(r[a],"height"),n)),this._fireResizeEvent(e,t,i,s,n,o);else"column"===d?this.resizeColWidth(this.getElementDir(this.m_resizingElement,"width"),s):this.resizeRowHeight(this.getElementDir(this.m_resizingElement,"height"),n),this._fireResizeEvent(e,t,i,s,n,o)},D.prototype._fireResizeEvent=function(e,t,i,s,n,o){let r={event:e,ui:{header:this._getKey(this.m_resizingElement),oldDimensions:{width:t,height:i},newDimensions:{width:s,height:n},size:o}};this.fireEvent("resize",r)},D.prototype.handleResizeMouseUp=function(e){if(!0===this.m_isResizing){var t=this.getElementWidth(this.m_resizingElement),i=this.getElementHeight(this.m_resizingElement);let s=this.m_orginalResizeDimensions.width,n=this.m_orginalResizeDimensions.height,o=this.m_resizingElement,r="col-resize"===this.m_cursor?o.style.width:o.style.height;t===this.m_orginalResizeDimensions.width&&i===this.m_orginalResizeDimensions.height||"col-resize"!==this.m_cursor&&"row-resize"!==this.m_cursor||this._resizeSelectedHeaders(e,s,n,t,i,r),o.style.cursor="",this._unhighlightResizeBorderColor(),this.m_isResizing=!1,this.m_cursor="default",null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor=""),this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_resizingElementSibling=null,this.m_orginalResizeDimensions=null,document.removeEventListener("mousemove",this.m_docMouseMoveListener,!1),document.removeEventListener("mouseup",this.m_docMouseUpListener,!1)}},D.prototype._isDOMElementResizable=function(e){return null!=e&&"true"===e.getAttribute(this.getResources().getMappedAttribute("resizable"))},D.prototype.manageHeaderCursor=function(e,t){var i,s,n,o,r,l,a,h,d;if((d=t?this.find(e.target,"headerlabel"):this.find(e.target,"headercell"))||t||(d=this.find(e.target,"endheadercell")),!d)return"default";var c=t?this.getHeaderLabelAxis(d):this.getHeaderCellAxis(d),m=t?this.getHeaderLabelLevel(d):this.getHeaderCellIndex(d),u=t?m:this.getHeaderCellLevel(d);if("column"===c?(r="enable"===this.m_options.isResizable(c,"height"),o=this._isDOMElementResizable(d),t?(a=null,l=null,h=this.m_headerLabels.column[m-1]):((a=this._getHeaderByIndex(m-1,u,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader))||(this.m_headerLabels.column.length?(a=this._getLabel("column",u),u===this.m_columnHeaderLevelCount-1&&this._isHeaderLabelCollision()&&(a=this.m_headerLabels.row[this.m_rowHeaderLevelCount-1])):a=this._getLabel("row",u)),l=this._isDOMElementResizable(a),h=this._getHeaderByIndex(m,u-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader))):"row"===c?(o="enable"===this.m_options.isResizable(c,"width"),r=t?"enable"===this.m_options.isResizable(c,"height"):this._isDOMElementResizable(d),t?(h=this.m_headerLabels.row[m-1],this._isHeaderLabelCollision()&&d===this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]&&(a=this.m_headerLabels.column[this.m_columnHeaderLevelCount-1])):(a=this._getHeaderByIndex(m-1,u,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),l=this._isDOMElementResizable(a),h=this._getHeaderByIndex(m,u-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader))):"columnEnd"===c?(r="enable"===this.m_options.isResizable(c).height,o=this._isDOMElementResizable(d),t?(a=null,l=null,h=this.m_headerLabels.columnEnd[m-1]):((a=this._getHeaderByIndex(m-1,u,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader))||(a=this._getLabel("columnEnd",u)),l=this._isDOMElementResizable(a),h=this._getHeaderByIndex(m,u-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader))):"rowEnd"===c&&(o="enable"===this.m_options.isResizable(c).width,r=this._isDOMElementResizable(d),t?(a=this.m_headerLabels.rowEnd[m-1],l=this._isDOMElementResizable(a)):(a=this._getHeaderByIndex(m-1,u,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),l=this._isDOMElementResizable(a),h=this._getHeaderByIndex(m,u-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader))),this.m_utils.isTouchDevice())i=e.touches[0].pageX,s=e.touches[0].pageY,n=D.RESIZE_TOUCH_OFFSET;else{i=e.offsetX,s=e.offsetY,n=D.RESIZE_OFFSET;var _=this._findHeaderOffset(e.target,d);i+=_[0],s+=_[1]}var p=this.getHeaderEdgePixels(d),g=this.getResources().isRTLMode(),f="columnEnd"===c||"rowEnd"===c,C=i<p[0]+n,y=s<p[1]+n,v=i>p[2]-n,E=s>p[3]-n;if("column"===c||"columnEnd"===c){if(o&&(g?C:v))return this.m_resizingElement=d,"col-resize";if(l&&(g?v:C)){if(this.m_resizingElement=a,this.m_resizingElementSibling=d,null!==this.m_resizingElement)return"col-resize"}else if(r){if(!f&&E||f&&y)return this.m_resizingElement=d,"row-resize";if(!f&&y||f&&E)return this.m_resizingElement=h,this.m_resizingElementSibling=d,"row-resize"}}else if("row"===c||"rowEnd"===c){if(r&&E)return this.m_resizingElement=d,"row-resize";if(l&&y&&!t){if(this.m_resizingElement=a,this.m_resizingElementSibling=d,null!==this.m_resizingElement)return"row-resize"}else if(h&&y&&t&&a&&(this.m_resizingElement=h,this.m_resizingElementSibling=d,null!==this.m_resizingElement))return"row-resize";if(o){if(!f&&(g?C:v)||f&&(g?v:C))return this.m_resizingElement=d,"col-resize";if((!f&&(g?v:C)||f&&(g?C:v))&&(this.m_resizingElement=h,this.m_resizingElementSibling=d,null!==this.m_resizingElement))return"col-resize"}}return"default"},D.prototype.handleResizeMouseMove=function(e){var t,i,s,n,o;this.m_currentMouseX=e.pageX,this.m_currentMouseY=e.pageY,this.m_utils.isTouchDevice()?(this.m_currentMouseX=e.touches[0].pageX,this.m_currentMouseY=e.touches[0].pageY):(this.m_currentMouseX=e.pageX,this.m_currentMouseY=e.pageY),t=this._getResizeHeaderMode(this.m_resizingElement);var r=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"));let l=this.find(this.m_resizingElement,"headerlabel");"col-resize"===this.m_cursor?"column"===t?(r=!l&&r,i=this.calculateColumnHeaderWidth(this.m_resizingElement),s=this.getNewElementWidth("column",i,r,null,l),l?this.resizeRowWidth(s,s-i,r,l):this.resizeColWidth(i,s)):"row"===t&&(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(r=!0),i=this.getElementWidth(this.m_resizingElement),s=this.getNewElementWidth("row",i,r,null,l),this.resizeRowWidth(s,s-i,r,l)):"row-resize"===this.m_cursor&&("row"===t?(n=this.calculateRowHeaderHeight(this.m_resizingElement),o=this.getNewElementHeight("row",n,r,null,l),l?this.resizeColHeight(o,o-n,r):this.resizeRowHeight(n,o)):"column"===t&&(n=this.getElementHeight(this.m_resizingElement),o=this.getNewElementHeight("column",n,r,null,l),this.resizeColHeight(o,o-n,r))),this.buildCorners(),this.m_utils.isTouchDevice()&&this._moveTouchSelectionAffordance(),this.m_lastMouseX=this.m_currentMouseX,this.m_lastMouseY=this.m_currentMouseY},D.prototype.resizeColWidth=function(e,t){var i,s=t-e;if(0!==s){if(null!=this.m_databody.firstChild)i=this.getElementWidth(this.m_databody.firstChild)+s,this.setElementWidth(this.m_databody.firstChild,i);this.resizeColumnWidthAndShift(s),this.m_endColPixel+=s,this.m_endColHeaderPixel+=s,this.m_endColEndHeaderPixel+=s,null!=i&&(this.m_avgColWidth=i/this.getDataSource().getCount("column")),this.manageResizeScrollbars()}},D.prototype.resizeRowHeight=function(e,t){var i,s=t-e;if(0!==s){if(null!=this.m_databody.firstChild)i=this.getElementHeight(this.m_databody.firstChild)+s,this.setElementHeight(this.m_databody.firstChild,i);this.resizeRowHeightAndShift(s),this.m_endRowPixel+=s,this.m_endRowHeaderPixel+=s,this.m_endRowEndHeaderPixel+=s,null!=i&&(this.m_avgRowHeight=i/this.getDataSource().getCount("row")),this.manageResizeScrollbars()}},D.prototype.resizeColHeight=function(e,t,i){if(0!==t){var s,n,o,r=!0,l=this.find(this.m_resizingElement,"headerlabel");if(l?"column"===(o=this.getHeaderLabelAxis(this.m_resizingElement))||"columnEnd"===o?n=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==o&&"rowEnd"!==o||(n=this.m_columnHeaderLevelCount-1,r=!1):(n=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),o=this.getHeaderCellAxis(this.m_resizingElement)),i?this.m_columnEndHeaderLevelHeights[n]+=t:(s=this.m_columnHeaderLevelHeights[n],this.m_columnHeaderLevelHeights[n]+=t),!i&&n===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(r=!1),this.resizeColumnHeightsAndShift(t,n,i,r),i)this.m_colEndHeaderHeight+=t,this.setElementHeight(this.m_colEndHeader,this.m_colEndHeaderHeight);else{if(this.m_colHeaderHeight+=t,this.setElementHeight(this.m_colHeader,this.m_colHeaderHeight),0===this.m_headerLabels.column.length&&-1!==n)this._resizeHeaderLabelDirs(n,t,["row"],"height");else if(null!=this.m_columnHeaderLevelCount&&n===this.m_columnHeaderLevelCount-1)if(this.m_headerLabels.row.length){var a,h;if(l){if("column"===o)h=e,this.m_collisionResize=!0;else if("row"===o)a=t,this.m_collisionResize=!0;else if("rowEnd"===o)if(this._isHeaderLabelCollision()){let e=0;for(let t=0;t<this.m_columnHeaderLevelCount-1;t++)e+=this.getElementHeight(this.m_headerLabels.column[t]);let t=this.m_colHeaderHeight-e,i=this._calculateCollisionDimension(t,s,l,o);a=i.rowHeightChange,h=i.colHeight}else a=t,h=this.m_colHeaderHeight}else if(this._isHeaderLabelCollision()){let t=this._calculateCollisionDimension(e,s,!0,o);a=t.rowHeightChange,h=t.colHeight}else a=t,h=e;var d=this._getLabel("column",this.m_columnHeaderLevelCount-1);d&&this.setElementHeight(d,h),this._resizeHeaderLabelDirs(this.m_rowHeaderLevelCount-1,a,["row"],"height")}else{let t=["bottomResized"],i=this._getLabel("column",this.m_columnHeaderLevelCount-1);this._highlightElement(i.parentNode,t);let s=0;if("rowEnd"===o)for(let e=0;e<this.m_columnHeaderLevelCount-1;e++)s+=this.getElementHeight(this.m_headerLabels.column[e]);let n=e-s;this.setElementHeight(i,n)}else if(n<0){let t=this._getLabel("row",this.m_rowHeaderLevelCount-1),i=["bottomResized"];if(t&&n<0){this._highlightElement(t.parentNode,i);for(let i=0;i<this.m_rowHeaderLevelCount;i++)t=this._getLabel("row",i),this.setElementHeight(t,e)}}let i=this._getLabel("rowEnd",this.m_rowEndHeaderLevelCount-1),r=["bottomResized"];if(i){let t=-1===this.m_endColHeader?e:this.m_colHeaderHeight;this._highlightElement(i.parentNode,r);for(let e=0;e<this.m_rowEndHeaderLevelCount;e++)i=this._getLabel("rowEnd",e),this.setElementHeight(i,t)}}this.manageResizeScrollbars()}},D.prototype._calculateCollisionDimension=function(e,t,i,s){let n,o,r={},l=this._getMinValue("height",s,i);if(this.m_collisionResize){let r=this.getElementDir(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],"height"),a=this.getElementDir(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],"height"),h=r+a,d=a/h,c=r/h;r===l&&a===l?(n=Math.floor(e/2)-Math.floor(t/2),o=Math.ceil(e/2),this.m_collisionResize=!1):d>c?(o=Math.floor(e*d),n=e-o-r,r+n<this._getMinValue("height",s,i)&&(n=0)):(n=Math.floor(e*c)-r,r+n<this._getMinValue("height",s,i)&&(n=0),o=e-(r+n),o=Math.max(o,this._getMinValue("height",s,i)))}else n=Math.floor(e/2)-Math.floor(t/2),o=Math.ceil(e/2);return r.colHeight=o,r.rowHeightChange=n,r},D.prototype.resizeRowWidth=function(e,t,i,s){if(0!==t){var n;if(s){let e=this.getHeaderLabelAxis(this.m_resizingElement);"column"===e||"columnEnd"===e?n=this.m_rowHeaderLevelCount-1:"row"!==e&&"rowEnd"!==e||(n=this.getHeaderLabelLevel(this.m_resizingElement))}else n=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1);if(i?this.m_rowEndHeaderLevelWidths[n]+=t:this.m_rowHeaderLevelWidths[n]+=t,this.resizeRowWidthsAndShift(t,n,i),i)this.m_rowEndHeaderWidth+=t,this.setElementWidth(this.m_rowEndHeader,this.m_rowEndHeaderWidth);else{if(this.m_rowHeaderWidth+=t,n<0){let t=this.getResources().isRTLMode()?["startResized"]:["endResized"],i=this._getLabel("column",this.m_columnHeaderLevelCount-1);this._highlightElement(i.parentNode,t);for(let t=0;t<this.m_columnHeaderLevelCount;t++)i=this._getLabel("column",t),this.setElementWidth(i,e)}else this.setElementWidth(this.m_rowHeader,this.m_rowHeaderWidth),(n===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._resizeHeaderLabelDirs(n,t,["column"],"width");let i=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1),s=this.getResources().isRTLMode()?["startResized"]:["endResized"];if(i){this._highlightElement(i.parentNode,s);let e=this.getElementWidth(i)+t;for(let t=0;t<this.m_columnEndHeaderLevelCount;t++)i=this._getLabel("columnEnd",t),this.setElementWidth(i,e)}}this.manageResizeScrollbars()}},D.prototype._resizeHeaderLabelDirs=function(e,t,i,s){for(var n=0;n<i.length;n++){for(var o=i[n],r=0;r<this.m_headerLabels[o].length;r++){var l=this.m_headerLabels[o][r];if(null!=l){var a=this.getElementDir(l,s)+t;this.setElementDir(l,a,s)}}this._highlightResizeLabelDirs(o,e)}},D.prototype._highlightResizeLabelDirs=function(e,t){let i=this.getResources().isRTLMode()?["startResized"]:["endResized"],s="column"===e?i:["bottomResized"];this.m_corner&&("column"===e&&t===this.m_columnHeaderLevelCount-1||"row"===e&&t===this.m_rowHeaderLevelCount-1)&&this._highlightElement(this.m_corner,s);let n=this._getLabel("rowEnd",this.m_columnHeaderLevelCount-1);n&&this._highlightElement(n.parentNode,s)},D.prototype._unhighlightResizeBorderColor=function(){let e=this.m_root.querySelectorAll(".oj-datagrid-resized-start,\n .oj-datagrid-resized-end, .oj-datagrid-resized-top, .oj-datagrid-resized-bottom");this._unhighlightElementsByClassName(e,["startResized","endResized","topResized","bottomResized"])},D.prototype.getNewElementWidth=function(e,t,i,s,n){var o;o=this._getMinValue("width",e,n),null==s&&(s=this.getResources().isRTLMode()?this.m_lastMouseX-this.m_currentMouseX:this.m_currentMouseX-this.m_lastMouseX),i&&"row"===e&&(s*=-1);var r=t+s+this.m_overResizeLeft+this.m_overResizeMinLeft+this.m_overResizeRight;if(r<o?(this.m_overResizeMinLeft+=s-o+t,r=o):(this.m_overResizeMinLeft=0,this.m_overResizeLeft=0),"row"===e){var l=this.getRowHeaderWidth()+this.getRowEndHeaderWidth()-t,a=Math.round(this.getWidth()-this.m_utils.getScrollbarSize()-1)-l;r>a?(this.m_overResizeRight+=s-a+t,r=a):this.m_overResizeRight=0}return r},D.prototype.getNewElementHeight=function(e,t,i,s,n){var o;let r=this._getMinValue("height",e,!0);if(n){if(o=r,"rowEnd"===this.getHeaderLabelAxis(this.m_resizingElement)&&this.m_headerLabels.column&&this.m_headerLabels.column.length){this._isHeaderLabelCollision()&&(o=2*r);for(let e=0;e<this.m_columnHeaderLevelCount-1;e++)o+=this.getElementHeight(this.m_headerLabels.column[e])}}else o=this._getMinValue("height",e,n);"column"===e&&!i&&this.getHeaderCellLevel(this.m_resizingElement)+this.getHeaderCellDepth(this.m_resizingElement)===this.m_columnHeaderLevelCount&&this._isHeaderLabelCollision()&&(o=2*r),null==s&&(s=this.m_currentMouseY-this.m_lastMouseY),i&&"column"===e&&(s*=-1);var l=t+s+this.m_overResizeTop+this.m_overResizeMinTop+this.m_overResizeBottom;if(l<o?(this.m_overResizeMinTop+=s-o+t,l=o):(this.m_overResizeMinTop=0,this.m_overResizeTop=0),"column"===e){var a=this.getColumnHeaderHeight()+this.getColumnEndHeaderHeight()-t,h=Math.round(this.getHeight()-this.m_utils.getScrollbarSize()-1)-a;l>h?(this.m_overResizeBottom+=s-h+t,l=h):this.m_overResizeBottom=0}return l},D.prototype._getMinValue=function(e,t,i){var s,n,o=this.m_resizingElement,r=this._getCellPaddingBorder(e,o),l=r;if(i)return Math.max(this.m_utils.isTouchDevice()?2*D.RESIZE_TOUCH_OFFSET:2*D.RESIZE_OFFSET,l);var a=this.getHeaderCellLevel(o),h=this.getHeaderCellDepth(o),d=this.getResources().getMappedAttribute("sortable");"true"===o.getAttribute(d)&&this._setSortContainerSize(this._getSortContainer(o),r),"column"===t&&"true"===o.getAttribute(d)&&(l="width"===e?this.m_sortContainerWidth:this.m_sortContainerHeight);var c=Math.max(this.m_utils.isTouchDevice()?2*D.RESIZE_TOUCH_OFFSET:2*D.RESIZE_OFFSET,l);if("column"===t&&(1===this.m_columnHeaderLevelCount||"width"===e&&this.m_columnHeaderLevelCount===a+1||"height"===e&&1===h)||"row"===t&&-1===this.m_endRowHeader||"column"===t&&-1===this.m_endColHeader||"row"===t&&(1===this.m_rowHeaderLevelCount||"height"===e&&this.m_rowHeaderLevelCount===a+1||"width"===e&&1===h))return c;var m=this.getHeaderCellIndex(o),u=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0),_=this.getElementDir(o,e);return"column"===t?"width"===e?(s=this._getHeaderByIndex(m+(u-1),this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),n=this.getElementDir(s,e)):n=this._getHeaderLevelDimension(a+(h-1),o,this.m_columnHeaderLevelHeights,"height",1):"row"===t&&("height"===e?(s=this._getHeaderByIndex(m+(u-1),this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),n=this.getElementDir(s,e)):n=this._getHeaderLevelDimension(a+(h-1),o,this.m_rowHeaderLevelWidths,"width",1)),_-(n-c)},D.prototype._getLabelMinValue=function(e){var t=this.m_resizingElement,i=this._getCellPaddingBorder(e,t);return Math.max(this.m_utils.isTouchDevice()?2*D.RESIZE_TOUCH_OFFSET:2*D.RESIZE_OFFSET,i)},D.prototype._setSortContainerSize=function(e,t){this.m_sortContainerWidth=this.getElementWidth(e)+t,this.m_sortContainerHeight=this.getElementHeight(e)},D.prototype._getCellPaddingBorder=function(e,t){if(null==this.m_resizingElementMin){for(var i=["top","right","bottom","left"],s="width"===e?1:0,n=0,o=window.getComputedStyle(t);s<4;s+=2)n+=parseFloat(o.getPropertyValue("padding-"+i[s])),n+=parseFloat(o.getPropertyValue("border-"+i[s]+"-width"));this.m_resizingElementMin=Math.round(n)}return this.m_resizingElementMin},D.prototype.manageResizeScrollbars=function(){var e=this.getWidth(),t=this.getHeight(),i=this.m_colHeader,s=this.m_colEndHeader,n=this.m_rowHeader,o=this.m_rowEndHeader,r=this.m_databody,l=r.firstChild,a=this.getColumnHeaderHeight(),h=this.getColumnEndHeaderHeight(),d=this.getRowHeaderWidth(),c=this.getRowEndHeaderWidth();if(-1===this.m_endRowHeader&&-1!==this.m_endColHeader){let e=this._getLabel("column",this.m_columnHeaderLevelCount-1);e&&(d=this.getElementWidth(e))}else if(-1!==this.m_endRowHeader&&-1===this.m_endColHeader){let e=this._getLabel("row",this.m_rowHeaderLevelCount-1);e&&(a=this.getElementHeight(e))}var m,u=t-a-h,_=e-d-c,p=this.m_utils.getScrollbarSize(),g=this.getResources().isRTLMode()?"right":"left";if(this._databodyEmpty())if(null==this.m_empty){m=this._buildEmptyText();var f=this.getElementHeight(m),C=this.getElementWidth(m);f>this.getElementHeight(l)&&this.setElementHeight(l,f),C>this.getElementWidth(l)&&this.setElementWidth(l,C),this.m_databody.firstChild.appendChild(m)}else m=this.m_empty,this.setElementDir(m,this.m_endColHeader>=0?a:0,"top");var y,v,E,w,S,H=this.getElementWidth(r.firstChild),x=this.getElementHeight(r.firstChild),b=this.isDatabodyHorizontalScrollbarRequired(_);b?(y=this.isDatabodyVerticalScrollbarRequired(u-p),r.style.overflow="auto"):(y=this.isDatabodyVerticalScrollbarRequired(u))?(b=this.isDatabodyHorizontalScrollbarRequired(_-p),r.style.overflow="auto"):r.style.overflow="hidden",this.m_hasHorizontalScroller=b,this.m_hasVerticalScroller=y,-1!==this.m_endColEndHeader?(v=Math.min(x+(b?p:0),u),E=b?v-p:v):(v=u,E=Math.min(x,b?v-p:v)),-1!==this.m_endRowEndHeader?(w=Math.min(H+(y?p:0),_),S=y?w-p:w):(w=_,S=Math.min(H,y?w-p:w));var R=d+S+(y?p:0),I=a+E+(b?p:0);if(this.setElementDir(n,0,g),this.setElementDir(n,a,"top"),this.setElementHeight(n,E),this.setElementDir(o,R,g),this.setElementDir(o,a,"top"),this.setElementHeight(o,E),this.setElementDir(i,d,g),this.setElementWidth(i,S),this.setElementDir(s,d,g),this.setElementDir(s,I,"top"),this.setElementWidth(s,S),this.setElementDir(r,a,"top"),this.setElementDir(r,d,g),this.setElementWidth(r,w),this.setElementHeight(r,v),-1===this.m_endRowHeader&&-1!==this.m_endColHeader&&this.m_rowHeaderScrollbarSpacer?(this.setElementDir(this.m_rowHeaderScrollbarSpacer,a,"top"),this.setElementHeight(this.m_rowHeaderScrollbarSpacer,v+h),this.setElementWidth(this.m_rowHeaderScrollbarSpacer,d)):-1!==this.m_endRowHeader&&-1===this.m_endColHeader&&this.m_columnHeaderScrollbarSpacer&&(this.setElementDir(this.m_columnHeaderScrollbarSpacer,d,"left"),this.setElementWidth(this.m_columnHeaderScrollbarSpacer,w+c),this.setElementHeight(this.m_columnHeaderScrollbarSpacer,a)),this.m_scrollWidth=H-S,this.m_scrollHeight=x-E,this.buildCorners(),this._adjustHeaderBorders(),this._updateGridlines(),this.m_utils.isTouchDevice()){var M=0,L=0;if(this.m_currentScrollLeft>this.m_scrollWidth&&(M=this.m_scrollWidth-this.m_currentScrollLeft),this.m_currentScrollTop>this.m_scrollHeight&&(L=this.m_scrollHeight-this.m_currentScrollTop),0!==M||0!==L){this.m_utils.isTouchDeviceNotIOS()&&this._disableTouchScrollAnimation();var D=this.adjustTouchScroll(M,L);M=D[0],L=D[1],this.scrollDelta(M,L)}}},D.prototype.resizeColumnWidthAndShift=function(e){var t=this.getResources().isRTLMode()?"right":"left",i=this.m_colHeader.style.display,s=this.m_colEndHeader.style.display;this.m_databody.style.display="none",this.m_colHeader.style.display="none",this.m_colEndHeader.style.display="none";var n=this.getHeaderCellIndex(this.m_resizingElement);this.m_columnHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(n+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);var o,r=this.createIndex(-1,n),l=this.getElementsInRange(this.createRange(r,r));if(l)for(let e=0;e<l.length;e++)o=this.getResources().isRTLMode()?["startResized"]:["endResized"],this._highlightElement(l[e],o);this._shiftHeadersAlongAxisInContainer(this.m_colHeader.firstChild,n,e,t,this.getMappedStyle("colheadercell"),"column"),this._shiftHeadersAlongAxisInContainer(this.m_colEndHeader.firstChild,n,e,t,this.getMappedStyle("colendheadercell"),"column"),this._shiftCellsAlongAxis("column",e,n),this.m_databody.style.display="",this.m_colHeader.style.display=i,this.m_colEndHeader.style.display=s},D.prototype._shiftCellsAlongAxis=function(e,t,i,s){var n,o,r,l,a,h=[];if(null==s&&(s=!1),"row"===e?(n="height",o="top",r=this.m_endRow,l=this.m_startCol,a=this.m_endCol):(n="width",o=this.getResources().isRTLMode()?"right":"left",r=this.m_endCol,l=this.m_startRow,a=this.m_endRow),null!=this.m_databody.firstChild)for(var d=l;d<=a;d++){var c="row"===e?this.createIndex(i,d):this.createIndex(d,i),m=this._getCellByIndex(c),u=m[this.getResources().getMappedAttribute("context")],_=u.indexes[e],p=u.extents[e],g=i-_,f=p-g;h[d]&&h[d][i]||!0===s||(this.setElementDir(m,this.getElementDir(m,n)+t,n),"row"===e?this._updateTempArray(h,!0,d,i,u.extents.column,p-g):this._updateTempArray(h,!0,d,i,u.extents.row,p-g));var C=i;!0!==s&&(C=i+f);for(var y=C;y<=r;y++)if(!h[d]||!h[d][y]){c="row"===e?this.createIndex(y,d):this.createIndex(d,y),p=(u=(m=this._getCellByIndex(c))[this.getResources().getMappedAttribute("context")]).extents[e];var v=this.getElementDir(m,o)+t;this.setElementDir(m,v,o),"row"===e?this._updateTempArray(h,!0,d,y,u.extents.column,p):this._updateTempArray(h,!0,d,y,u.extents.row,p)}}},D.prototype.resizeRowHeightAndShift=function(e){var t=this.m_rowHeader.style.display,i=this.m_rowEndHeader.style.display;this.m_databody.style.display="none",this.m_rowHeader.style.display="none",this.m_rowEndHeader.style.display="none";var s=this.getHeaderCellIndex(this.m_resizingElement);this.m_rowHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(s+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);var n,o=this.createIndex(s,-1),r=this.getElementsInRange(this.createRange(o,o));if(r)for(let e=0;e<r.length;e++)n=["bottomResized"],this._highlightElement(r[e],n);this._shiftHeadersAlongAxisInContainer(this.m_rowHeader.firstChild,s,e,"top",this.getMappedStyle("rowheadercell"),"row"),this._shiftHeadersAlongAxisInContainer(this.m_rowEndHeader.firstChild,s,e,"top",this.getMappedStyle("rowendheadercell"),"row"),this._shiftCellsAlongAxis("row",e,s),this.m_databody.style.display="",this.m_rowHeader.style.display=t,this.m_rowEndHeader.style.display=i},D.prototype._shiftHeadersAlongAxisInContainer=function(e,t,i,s,n,o){var r,l,a,h,d=0,c=e.lastChild;if(null!=c){var m,u=this.m_utils.containsCSSClassName(c,n);for(u?(l=c.parentNode,r=c,a=this.getHeaderCellIndex(r)):(l=c,r=c.firstChild,a=this._getAttribute(l,"start",!0));t<a;)if(u)h=this.getElementDir(r,s)+i,this.setElementDir(r,h,s),c=c.previousSibling,u=this.m_utils.containsCSSClassName(c,n),l=c.parentNode,r=c,a=this.getHeaderCellIndex(r);else{for(var _=l.getElementsByClassName(n),p=0;p<_.length;p++)h=this.getElementDir(_[p],s)+i,this.setElementDir(_[p],h,s);c=c.previousSibling,u=this.m_utils.containsCSSClassName(c,n),l=c,r=c.firstChild,a=this._getAttribute(l,"start",!0)}if(this.m_resizingElement&&(m=this.getHeaderCellLevel(this.m_resizingElement)),"column"===o?(d=this.getElementWidth(r)+i,this.setElementWidth(r,d)):"row"===o?(d=this.getElementHeight(r)+i,this.setElementHeight(r,d)):null==o&&(h=this.getElementDir(r,s)+i,this.setElementDir(r,h,s)),"row"===o||"column"===o){let e=this.getResources().isRTLMode()?["startResized"]:["endResized"],t="row"===o?["bottomResized"]:e;void 0!==m&&this.getHeaderCellLevel(r)>=m&&this._highlightElement(r,t),r!==this.m_resizingElement||r!==l.lastChild&&r!==l.firstChild||this._highlightResizeBorder(t,o)}u||null==r.nextSibling?null!=o&&this.m_sizingManager.setSize(o,this._getKey(r),d):this._shiftHeadersAlongAxisInContainer(c,t,i,s,n,o)}},D.prototype._highlightResizeBorder=function(e,t){let i=this.getHeaderCellIndex(this.m_resizingElement),s="column"===t?this.m_columnHeaderLevelCount:this.m_rowHeaderLevelCount,n=this.m_resizingElement[this.getResources().getMappedAttribute("context")],o=n.index+n.extent-1;for(let n=0;n<s-1;n++){let r;r="row"===t?this._getHeaderByIndex(i,n,this.m_rowHeader,s,this.m_startRowHeader):this._getHeaderByIndex(i,n,this.m_colHeader,s,this.m_startColumnHeader);let l=r[this.getResources().getMappedAttribute("context")];l.index+l.extent-1===o&&this._highlightElement(r,e)}},D.prototype.resizeColumnHeightsAndShift=function(e,t,i,s){var n,o,r,l;i?(n=this.m_colEndHeader,o=this.getMappedStyle("colendheadercell"),r="columnEnd",l="bottom"):(n=this.m_colHeader,o=this.getMappedStyle("colheadercell"),r="column",l="top"),n.style.display="none",this.m_databody.style.display="none",s&&this._shiftLabelsDir(this.m_headerLabels[r],e,t,l,r),this._shiftHeadersDirInContainer(n.firstChild,e,t,l,o,r),n.style.display="",this.m_databody.style.display=""},D.prototype.resizeRowWidthsAndShift=function(e,t,i){var s,n,o,r;i?(s=this.m_rowEndHeader,n=this.getMappedStyle("rowendheadercell"),o="rowEnd",r=this.getResources().isRTLMode()?"left":"right"):(s=this.m_rowHeader,n=this.getMappedStyle("rowheadercell"),o="row",r=this.getResources().isRTLMode()?"right":"left"),s.style.display="none",this.m_databody.style.display="none",this._shiftLabelsDir(this.m_headerLabels[o],e,t,r,o),this._shiftHeadersDirInContainer(s.firstChild,e,t,r,n,o),s.style.display="",this.m_databody.style.display=""},D.prototype._shiftLabelsDir=function(e,t,i,s,n){for(var o=0;o<e.length;o++){var r,l=e[o];if(o===i)if("column"===n||"columnEnd"===n)if(r=this.getElementHeight(l)+t,this.setElementHeight(l,r),"column"===n&&this._isHeaderLabelCollision()&&i===this.m_columnHeaderLevelCount-1){let e=["bottomResized"];this._highlightElement(this.m_corner,e)}else if("columnEnd"===n){let e=["topResized"],t=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1);t&&this._highlightElement(t,e)}else{let e="column"===n?["bottomResized"]:["topResized"];this._highlightElement(l,e)}else{r=this.getElementWidth(l)+t,this.setElementWidth(l,r);let e=this.getResources().isRTLMode()?["startResized"]:["endResized"],i=this.getResources().isRTLMode()?["endResized"]:["startResized"],s="row"===n?e:i;this._highlightElement(l,s);let o=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1);o&&this._highlightElement(o.parentNode,s)}o>i&&(r=this.getElementDir(l,s)+t,this.setElementDir(l,r,s))}},D.prototype._shiftHeadersDirInContainer=function(e,t,i,s,n,o){for(var r=e.childNodes,l=0;l<r.length;l++){var a,h,d=r[l];if(this.m_utils.containsCSSClassName(d,n)){a=this.getHeaderCellLevel(d);var c=this.getHeaderCellDepth(d);if(a<=i&&i<a+c){if("column"===o||"columnEnd"===o){if(h=this.getElementHeight(d)+t,this.setElementHeight(d,h),this.m_resizingElement){var m=this.getMappedStyle("colendheadercell");if(this.m_utils.containsCSSClassName(d,m)){let e=["topResized"];this._highlightElement(d,e)}else{let e=["bottomResized"];this._highlightElement(d,e)}}}else if(h=this.getElementWidth(d)+t,this.setElementWidth(d,h),this.m_resizingElement){var u=this.getMappedStyle("rowendheadercell");if(this.m_utils.containsCSSClassName(d,u)){let e=this.getResources().isRTLMode()?["endResized"]:["startResized"];this._highlightElement(d,e)}else{let e=this.getResources().isRTLMode()?["startResized"]:["endResized"];this._highlightElement(d,e)}}}else a>i&&(h=this.getElementDir(d,s)+t,this.setElementDir(d,h,s))}else if((a=this._getAttribute(d,"level",!0))<=i)this._shiftHeadersDirInContainer(d,t,i,s,n,o);else for(var _=d.getElementsByClassName(n),p=0;p<_.length;p++)h=this.getElementDir(_[p],s)+t,this.setElementDir(_[p],h,s)}},D.prototype.handleContextMenuResize=function(e,t,i,s){this.m_overResizeLeft=0,this.m_overResizeMinLeft=0,this.m_overResizeTop=0,this.m_overResizeMinTop=0,this.m_overResizeRight=0,this.m_overResizeBottom=0;var n=parseFloat(i,10),o=n-this.getElementWidth(s),r=n-this.getElementHeight(s);this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=t===this.m_resources.getMappedCommand("resizeHeight")?this.getHeaderFromCell(s,"row",!0):this.getHeaderFromCell(s,"column",!0)),this.m_isResizing=!0,this.m_resizingElement=s;let l=this.find(this.m_resizingElement,"headerlabel");var a=this.getElementWidth(s),h=this.getElementHeight(s),d=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"));if(t===this.m_resources.getMappedCommand("resizeWidth")){if(a!==n)if("column"===this._getResizeHeaderMode(this.m_resizingElement)){if(this._isDOMElementResizable(this.m_resizingElement))if(l)this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"))&&(d=!1),this.resizeRowWidth(n,n-a,d,l),this._fireResizeEvent(e,a,h,n,h,n);else{let t=this.getNewElementWidth("column",a,d,o,l);this.resizeColWidth(a,t),this._resizeSelectedHeaders(e,a,h,n,h,n)}}else this.resizeRowWidth(n,n-a,d,l),this._fireResizeEvent(e,a,h,n,h,n)}else if(t===this.m_resources.getMappedCommand("resizeHeight")&&h!==n)if("column"===this._getResizeHeaderMode(this.m_resizingElement))this.resizeColHeight(n,n-h,d),this._fireResizeEvent(e,a,h,a,n,n);else if(this._isDOMElementResizable(this.m_resizingElement)){let t=this.getNewElementHeight("row",h,d,r,l);l?(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(d=!1),this.resizeColHeight(t,t-h,d),this._fireResizeEvent(e,a,h,a,n,n)):(this.resizeRowHeight(h,t),this._resizeSelectedHeaders(e,a,h,a,t,n))}var c=this.getElementWidth(s),m=this.getElementHeight(s);c===a&&m===h||(this.buildCorners(),this.m_utils.isTouchDevice()&&this._moveTouchSelectionAffordance()),this._unhighlightResizeBorderColor(),this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_isResizing=!1},D.prototype._getResizeNestedHeaderIndex=function(e,t){let i=this.getHeaderCellIndex(this.m_resizingElement),s=t?this.m_columnEndHeaderLevelCount:this.m_columnHeaderLevelCount,n=t?this.m_rowEndHeaderLevelCount:this.m_rowHeaderLevelCount;return("column"===e||"columnEnd"===e?s:n)>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1),i},D.prototype._highlightResizeMouseDown=function(){let e,t,i=this.getHeaderCellIndex(this.m_resizingElement),s=this._getResizeHeaderMode(this.m_resizingElement),n=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel")),o=this.getResources().isRTLMode()?"right":"left",r=this.find(this.m_resizingElement,"headerlabel");if("col-resize"===this.m_cursor)if("column"===s)if(n=!r&&n,r)t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.m_rowHeaderLevelCount-1:"row"!==t&&"rowEnd"!==t||(e=this.getHeaderLabelLevel(this.m_resizingElement)),this.resizeRowWidthsAndShift(0,e,n),n||(e===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._highlightResizeLabelDirs("column",e);else{this.m_columnHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);let e,t=this.createIndex(-1,i),s=this.getElementsInRange(this.createRange(t,t));if(s)for(let t=0;t<s.length;t++)e=this.getResources().isRTLMode()?["startResized"]:["endResized"],this._highlightElement(s[t],e);this._shiftHeadersAlongAxisInContainer(this.m_colHeader.firstChild,i,0,o,this.getMappedStyle("colheadercell"),"column"),this._shiftHeadersAlongAxisInContainer(this.m_colEndHeader.firstChild,i,0,o,this.getMappedStyle("colendheadercell"),"column")}else"row"===s&&(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(n=!0),r?(t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.m_rowHeaderLevelCount-1:"row"!==t&&"rowEnd"!==t||(e=this.getHeaderLabelLevel(this.m_resizingElement))):e=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),this.resizeRowWidthsAndShift(0,e,n),n||(e===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._highlightResizeLabelDirs("column",e));else if("row-resize"===this.m_cursor)if("row"===s)if(r){let i=!0;t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==t&&"rowEnd"!==t||(e=this.m_columnHeaderLevelCount-1,i=!1),!n&&e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(i=!1),this.resizeColumnHeightsAndShift(0,e,n,i),n||(0===this.m_headerLabels.column.length||e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length)&&this._highlightResizeLabelDirs("row",e)}else{this.m_rowHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);let e,t=this.createIndex(i,-1),s=this.getElementsInRange(this.createRange(t,t));if(s)for(let t=0;t<s.length;t++)e=["bottomResized"],this._highlightElement(s[t],e);this._shiftHeadersAlongAxisInContainer(this.m_rowHeader.firstChild,i,0,"top",this.getMappedStyle("rowheadercell"),"row"),this._shiftHeadersAlongAxisInContainer(this.m_rowEndHeader.firstChild,i,0,"top",this.getMappedStyle("rowendheadercell"),"row")}else{let i=!0;r?(t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==t&&"rowEnd"!==t||(e=this.m_columnHeaderLevelCount-1,i=!1)):(e=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),t=this.getHeaderCellAxis(this.m_resizingElement)),!n&&e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(i=!1),this.resizeColumnHeightsAndShift(0,e,n,i),n||(0===this.m_headerLabels.column.length||e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length)&&this._highlightResizeLabelDirs("row",e)}},D.prototype.handleResizeFitToContent=function(e,t,i){let s=this.find(t,"header")||this.find(t,"endheadercell"),n=this.m_utils.containsCSSClassName(t,this.getMappedStyle("endheadercell"));if(!s){let e=this.findCell(t);if(!e)return;t=this.getHeaderFromCell(e,i)}this.m_resizingElement=t;let o,r,l,a,h,d,c=this.m_resizingElement,m=this.getHeaderCellAxis(c),u=!1;if("column"===m||"columnEnd"===m){let e=s?this._getResizeNestedHeaderIndex(m,n):this.getHeaderCellIndex(c);this.m_resizingElement=n?this._getHeaderByIndex(e,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader):this._getHeaderByIndex(e,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader);let t=this.createIndex(-1,e);o=this.getElementsInRange(this.createRange(t,t)),o.push(c),r=this.calculateColumnHeaderWidth(this.m_resizingElement),l=this.getElementHeight(this.m_resizingElement),a=this._calculateResizeFitToContentValue(o,"column"),h=l,d=a,u=r!==a,this.resizeColWidth(r,a)}else if("row"===m||"rowEnd"===m){let e=s?this._getResizeNestedHeaderIndex(m,n):this.getHeaderCellIndex(c);this.m_resizingElement=n?this._getHeaderByIndex(e,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader):this._getHeaderByIndex(e,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader);let t=this.createIndex(e,-1);o=this.getElementsInRange(this.createRange(t,t)),o.push(c),r=this.getElementWidth(this.m_resizingElement),l=this.calculateRowHeaderHeight(this.m_resizingElement),a=r,h=this._calculateResizeFitToContentValue(o,"row"),d=h,u=l!==h,this.resizeRowHeight(l,h)}u&&this._fireResizeEvent(e,r,l,a,h,d),this._unhighlightResizeBorderColor()},D.prototype._calculateResizeFitToContentValue=function(e,t){let i,s="height";"column"===t&&(s="width");let n=this._getMinValue(s,t,!1),o=document.createElement("div");if("width"===s){o.style.display="inline-flex",o.style.flexFlow="column nowrap",o.style.justifyContent="flex-start",o.style.alignItems="stretch";for(let t=0;t<e.length;t++){let i=e[t].cloneNode(!0);i.classList.remove(...i.classList),i.style[s]="",i.style.whiteSpace="nowrap !important",i.style.overflow="hidden",o.appendChild(i)}}else if("height"===s){o.style.display="flex";for(let t=0;t<e.length;t++){let i=e[t].cloneNode(!0);i.style[s]="",i.style.whiteSpace="break-spaces",o.appendChild(i)}}o.style.visibility="hidden",o.style.top="0px",this.m_root.appendChild(o);let r="column"===t?this.m_databody.offsetWidth:this.m_databody.offsetHeight,l="column"===t?this._getCellPaddingBorder(s,this.m_resizingElement):0;return i=("column"===t?Math.ceil(o.firstElementChild.getBoundingClientRect().width):Math.ceil(o.firstElementChild.getBoundingClientRect().height))+l,i=i<n?n:i,i=i>r?r:i,this.m_root.removeChild(o),i},D.prototype.getHeaderEdgePixels=function(e){var t,i,s=0,n=0;if(this.m_utils.isTouchDevice()){var o=this.findPos(e);s=o[0],n=o[1]}return this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))?(t=this.calculateColumnHeaderWidth(e),i=this.getElementHeight(e)):(t=this.getElementWidth(e),i=this.calculateRowHeaderHeight(e)),[s,n,s+t,n+i]},D.prototype.getHeaderLabelEdgePixels=function(e){var t,i,s=this.findPos(e),n=s[0],o=s[1];return this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnheaderlabel"))?(t=this.calculateColumnHeaderWidth(e),i=this.getElementHeight(e)):(t=this.getElementWidth(e),i=this.calculateRowHeaderLabelHeight(e)),[n,o,n+t,o+i]},D.prototype.unhighlightSelection=function(){for(var e=this.GetSelection(),t=0;t<e.length;t+=1)this.unhighlightRange(e[t]);this.getResources()&&this._clearHeaderHighLight()},D.prototype.unhighlightRange=function(e){var t=this.getElementsInRange(e);this.unhighlightElems(t),this._applyBorderClassesAroundRange(t,e,!1,"Selected")},D.prototype.highlightRange=function(e,t){const i=this.getHeadersByRange(e,"row"),s=this.getHeadersByRange(e,"column");this._highlightHeaders(e,i,s);var n,o=this.getElementsInRange(e);(this.highlightElems(o,e),this._applyBorderClassesAroundRange(o,e,!0,"Selected"),t)&&(n=1===this.GetSelection().length?o.length:this._getCurrentSelectionCellCount(),this._setAccInfoText("accessibleMultiCellSelected",{num:n}))},D.prototype.getHeadersByRange=function(e,t){const i=new Set;let s,n,o,r;if("row"===t&&this.m_rowHeaderLevelCount>0){for(e.endIndex&&e.endIndex.row&&(r=e.endIndex.row),r?-1===r&&(r=this.m_endRowHeader):r=e.startIndex.row,n=Math.max(this.m_startRowHeader,e.startIndex.row);n<=r;n++)for(s=this._getHeadersByIndex(n,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),o=0;o<s.length;o++)i.add(s[o])}else if("column"===t&&this.m_columnHeaderLevelCount>0){for(e.endIndex&&e.endIndex.column&&(r=e.endIndex.column),r?-1===r&&(r=this.m_endColHeader):r=e.startIndex.column,n=Math.max(this.m_startColHeader,e.startIndex.column);n<=r;n++)for(s=this._getHeadersByIndex(n,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),o=0;o<s.length;o++)i.add(s[o])}if("row"===t&&this.m_rowEndHeaderLevelCount>0){for(e.endIndex&&e.endIndex.row&&(r=e.endIndex.row),r?-1===r&&(r=this.m_endRowHeader):r=e.startIndex.row,n=Math.max(this.m_startRowEndHeader,e.startIndex.row);n<=r;n++)for(s=this._getHeadersByIndex(n,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),o=0;o<s.length;o++)i.add(s[o])}else if("column"===t&&this.m_columnEndHeaderLevelCount>0){for(e.endIndex&&e.endIndex.column&&(r=e.endIndex.column),r?-1===r&&(r=this.m_endColHeader):r=e.startIndex.column,n=Math.max(this.m_startColEndHeader,e.startIndex.column);n<=r;n++)for(s=this._getHeadersByIndex(n,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),o=0;o<s.length;o++)i.add(s[o])}return i},D.prototype._highlightHeaders=function(e,t,i){t.forEach(t=>{const i=t[this.getResources().getMappedAttribute("context")];null==e.endIndex.column||-1===e.endIndex.row&&-1===e.endIndex.column||-1===e.endIndex.column&&0===e.startIndex.column&&this._isHeaderSelected(i,"row")?(t.classList.remove(this.getMappedStyle("headerPartialSelected")),t.classList.add(this.getMappedStyle("headerAllSelected"))):(t.classList.remove(this.getMappedStyle("headerAllSelected")),t.classList.add(this.getMappedStyle("headerPartialSelected")))}),i.forEach(t=>{const i=t[this.getResources().getMappedAttribute("context")];-1===e.endIndex.row&&-1===e.endIndex.column||-1===e.endIndex.row&&0===e.startIndex.row&&this._isHeaderSelected(i,"column")?(t.classList.remove(this.getMappedStyle("headerPartialSelected")),t.classList.add(this.getMappedStyle("headerAllSelected"))):(t.classList.remove(this.getMappedStyle("headerAllSelected")),t.classList.add(this.getMappedStyle("headerPartialSelected")))})},D.prototype._isHeaderSelected=function(e,t){let i=!1;return this.GetSelection().forEach(s=>{e.index>=s.startIndex[t]&&e.index+(e.extent-1)<=s.endIndex[t]&&(i=!0)}),i},D.prototype._clearHeaderHighLight=function(){const e="."+this.getMappedStyle("headerPartialSelected")+"."+this.getMappedStyle("headercell"),t=this.m_root.querySelectorAll(e),i="."+this.getMappedStyle("headerPartialSelected")+"."+this.getMappedStyle("endheadercell"),s=[...t,...this.m_root.querySelectorAll(i)];for(let e=0;e<s.length;e++)s[e].classList.remove(this.getMappedStyle("headerPartialSelected")),s[e].classList.remove(this.getMappedStyle("draggableItem"));const n="."+this.getMappedStyle("headerAllSelected")+"."+this.getMappedStyle("headercell"),o=this.m_root.querySelectorAll(n);for(let e=0;e<o.length;e++)o[e].classList.remove(this.getMappedStyle("headerAllSelected")),o[e].classList.remove(this.getMappedStyle("draggableItem"))},D.prototype._getCurrentSelectionCellCount=function(){for(var e=0,t=this.GetSelection(),i=0;i<t.length;i++){var s=this.getElementsInRange(t[i]);null!=s&&(e+=s.length)}return e},D.prototype.unhighlightElems=function(e){if(null!=e&&0!==e.length)for(let t=0;t<e.length;t+=1){let i=e[t],s=["selected","topSelected","bottomSelected","startSelected","endSelected"];this._unhighlightElement(i,s)}},D.prototype.highlightElems=function(e){if(null!=e&&0!==e.length)for(let t=0;t<e.length;t+=1)this._highlightElement(e[t],["selected"])},D.prototype.applySelection=function(e,t,i,s){for(var n=this.GetSelection(),o=0;o<n.length;o+=1){var r=this.getElementsInRange(n[o],e,t,i,s);if(this.highlightElems(r),this._applyBorderClassesAroundRange(r,n[o],!0,"Selected"),this.m_dragIndex&&r&&r.length)for(let e=0;e<r.length;e++)this._highlightElement(r[e],["dragSourceOpaque"])}},D.prototype.handleDatabodySelectionDrag=function(e){var t,i;if(this.m_utils.isTouchDevice()?t=this.findCell(document.elementFromPoint(e.touches[0].clientX,e.touches[0].clientY)):(i=e.target,t=this.findCell(i)),null!=t){var s=this.getCellIndexes(t);this.m_deselectInProgress?this.extendDeselection(s,e):this.isHeaderSelectionType(this.m_selectionFrontier)?this.extendSelectionHeader(t,e):this.extendSelection(s,e)}},D.prototype.handleHeaderClickSelection=function(e){var t,i,s,n,o=e.target,r=this.findHeader(o),l=e.shiftKey,a=this.isMultipleSelection(),h=this.m_utils.ctrlEquivalent(e);if(l&&a||!r||this._setActive(r,this._createActiveObject(r),e),null==this.m_active||"header"!==this.m_active.type&&!e.shiftKey)return!1;var d=r[this.getResources().getMappedAttribute("context")];if(t=d.axis,i=d.index,n=d.extent,h&&this._shouldDeselectHeader(i,n,t)){var c,m,u,_;-1!==t.indexOf("row")?(c=this.createIndex(i,0),m=this.createIndex(i+n-1,-1),_=this._getSelectionStartAndEnd(c,m,0),u=this.createRange(this.createIndex(_.min.row,0),this.createIndex(_.max.row,-1))):(c=this.createIndex(0,i),m=this.createIndex(-1,i+n-1),_=this._getSelectionStartAndEnd(c,m,0),u=this.createRange(this.createIndex(0,_.min.column),this.createIndex(-1,_.max.column)));var p=this._trimRangeForSelectionMode(u);return this.m_deselectInfo={anchor:p.startIndex,selection:this.GetSelection(),axis:-1!==t.indexOf("row")?"row":"column",sourceParent:r},void(this.m_deselectInProgress=this._deselectRange(p,e))}"header"===this.m_active.type&&(t=this.m_active.axis,i=this.m_active.index,s=this.m_active.level),this.m_utils.isTouchDevice()?(this._removeTouchSelectionAffordance(),this._selectHeader(t,i,s,e)):l&&a?(null==t&&(t=d.axis),(-1!==t.indexOf("row")&&-1!==d.axis.indexOf("row")||-1!==t.indexOf("column")&&-1!==d.axis.indexOf("column"))&&this.extendSelectionHeader(r,e)):2!==e.button&&this._selectHeader(t,i,s,e)},D.prototype.discontiguousHeaderSetActiveFromDatabody=function(e,t,i,s){var n=t.replace("End",""),o=this.m_selection[this.m_selection.length-1];this.unhighlightSelection(),o.startIndex.row===this.m_active.indexes.row&&o.endIndex.row===this.m_active.indexes.row&&o.startIndex.column===this.m_active.indexes.column&&o.endIndex.column===this.m_active.indexes.column&&this.m_selection.pop(),this._setActive(i,{type:"header",index:this.m_trueIndex[n],level:s-1,axis:t},e,!1),this.rehighlightSelection()},D.prototype.handleDragAnchorChange=function(e){if(this.m_headerDragState){var t,i,s=e.target,n=this.findHeader(s),o=n[this.getResources().getMappedAttribute("context")],r=this._getActiveElement(),l=r[this.getResources().getMappedAttribute("context")],a=this._getAttribute(r.parentNode,"start",!0),h=a+(this._getAttribute(r.parentNode,"extent",!0)-1);if(!o.extent)return;1===o.extent?(t=o.index,i=o.index):i=(t=this._getAttribute(n.parentNode,"start",!0))+(this._getAttribute(n.parentNode,"extent",!0)-1),1!==l.extent?(t<=a&&i>=h||t>=a&&i<=h)&&this._setActive(n,this._createActiveObject(n),e):t!==i&&t<=a&&a<=i&&this._setActive(n,this._createActiveObject(n),e)}},D.prototype.handleDatabodyClickSelection=function(e){var t,i=e.target,s=this.findCell(i);if(null!=s&&(t=this.getCellIndexes(s)),null!=t){if(this.isMultipleSelection()&&2===e.button&&this._isContainSelection(t))return;var n=this.m_utils.ctrlEquivalent(e),o=e.shiftKey;if(this.m_utils.containsCSSClassName(s,this.getMappedStyle("selected"))&&n){this.m_deselectInfo={anchor:t,selection:this.GetSelection()};var r=this.getCellEndIndexes(s),l=this._trimRangeForSelectionMode(this.createRange(t,r));return void(this.m_deselectInProgress=this._deselectRange(l,e))}this.isMultipleSelection()?(this._removeTouchSelectionAffordance(),this.m_utils.isTouchDevice()?(null!=this.m_active&&this._unhighlightActive(),this.selectAndFocus(t,e,!1)):n?n&&o?this.extendSelection(t,e):this.selectAndFocus(t,e,!0):o?this.extendSelection(t,e):this.selectAndFocus(t,e,!1)):this.selectAndFocus(t,e,!1)}},D.prototype._doRangesOverlap=function(e,t){var i=e.startIndex,s=i.column,n=i.row,o=e.endIndex,r=o.column,l=o.row,a=t.startIndex,h=a.column,d=a.row,c=t.endIndex,m=c.column,u=c.row;return(s<=m||-1===m||void 0===m)&&(r>=h||-1===r||void 0===r)&&(n<=u||-1===u)&&(l>=d||-1===l)},D.prototype._isRangeValid=function(e){return(e.startIndex.row<=e.endIndex.row||e.startIndex.row>=0&&-1===e.endIndex.row)&&(e.startIndex.column<=e.endIndex.column||e.startIndex.column>=0&&-1===e.endIndex.column||void 0===e.startIndex.column&&void 0===e.endIndex.column)},D.prototype._deselectRange=function(e,t){var i=this.m_deselectInfo.selection,s=e.startIndex,n=s.column,o=s.row,r=e.endIndex,l=r.column,a=r.row,h=!1,d=[],c=0,m=[],u=this;return i.forEach(function(t){var i=t.startIndex,s=i.column,r=i.row,_=t.endIndex,p=_.column,g=_.row;if(this._doRangesOverlap(t,e)){var f,C,y=function(e,t,i){return new Promise(function(s){u._createRangeWithKeys(e,t,function(e){d[i]=e,s()})})};h=!0,r<o&&(f=this.createIndex(r,s),C=this.createIndex(o-1,p),this._isRangeValid({startIndex:f,endIndex:C})&&(m.push(y(f,C,c)),c+=1)),-1!==a&&(f=this.createIndex(a+1,s),C=this.createIndex(g,p),this._isRangeValid({startIndex:f,endIndex:C})&&(m.push(y(f,C,c)),c+=1)),s<n&&void 0!==s&&(f=this.createIndex(Math.max(o,r),s),C=this.createIndex(Math.min(-1===a?g:a,-1===g?a:g),n-1),this._isRangeValid({startIndex:f,endIndex:C})&&(m.push(y(f,C,c)),c+=1)),-1!==l&&void 0!==s&&(f=this.createIndex(Math.max(o,r),l+1),C=this.createIndex(Math.min(-1===a?g:a,-1===g?a:g),p),this._isRangeValid({startIndex:f,endIndex:C})&&(m.push(y(f,C,c)),c+=1))}else d[c]=t,c+=1},this),!!h&&(Promise.all(m).then(function(){var e=u.m_selection;u.SetSelection(d),u._compareSelectionAndFire(t,e)}),!0)},D.prototype._shouldDeselectHeader=function(e,t,i){var s,n,o=this.GetSelection();"row"===i||"rowEnd"===i?(s="row",n="column"):(s="column",n="row");var r=!1,l=this.m_options.getSelectionMode();return o.forEach(function(i){var o=i.startIndex[n],a=i.endIndex[n];if(0===o&&-1===a||"row"===l&&"row"===s){var h=i.startIndex[s],d=i.endIndex[s];h<=e&&(d>=e+t-1||-1===d)&&(r=!0)}}),r},D.prototype._handleSelectAll=function(e){return!(!this._isSelectionEnabled()||!this.isMultipleSelection())&&("row"===this.m_options.getSelectionMode()?this._selectRange(this.createIndex(0),this.createIndex(-1),e):this._selectRange(this.createIndex(0,0),this.createIndex(-1,-1),e),this.m_utils.isTouchDevice()&&this.m_topSelectIconContainer&&this.m_bottomSelectIconContainer&&(this.m_topSelectIconContainer.parentNode.removeChild(this.m_topSelectIconContainer),this.m_bottomSelectIconContainer.parentNode.removeChild(this.m_bottomSelectIconContainer)),!0)},D.prototype._isContainSelection=function(e,t){null==t&&(t=this.GetSelection());for(var i=0;i<t.length;i+=1){var s=t[i],n=s.startIndex,o=this.getEndIndex(s),r=n.row,l=o.row;if(e.row>=r&&(-1===l||e.row<=l)){var a=n.column,h=o.column;if(isNaN(a)||isNaN(h))return!0;if(e.column>=a&&(-1===h||e.column<=h))return!0}}return!1},D.prototype._isHeaderInsideSelection=function(e,t){const i=this.GetSelection();for(let s=0;s<i.length;s+=1){let n=i[s],o=n.startIndex,r=this.getEndIndex(n),l=o.row,a=r.row,h=o.column,d=r.column;if("column"===t||"columnEnd"===t){if(e>=h&&(-1===d||e<=d)&&0===l&&-1===a)return!0}else if(("row"===t||"rowEnd"===t)&&e>=l&&(-1===a||e<=a)&&0===h&&-1===d)return!0}return!1},D.prototype._getContainedSelectionCssClass=function(e,t){var i=[],s={contains:!1,class:[]};null==t&&(t=this.GetSelection());for(var n=0;n<t.length;n+=1){var o=t[n],r=o.startIndex,l=this.getEndIndex(o),a=r.row,h=l.row,d=r.column,c=l.column;e.row>=a&&(-1===h||e.row<=h)&&(e.column>=d&&(-1===c||e.column<=c)||isNaN(d)||isNaN(c))&&(e.row===a&&i.push("topSelected"),e.row===h&&i.push("bottomSelected"),(isNaN(d)||isNaN(c))&&(s.contains=!0,s.class=i),e.column>=d&&(-1===c||e.column<=c)&&(e.column===d&&i.push("startSelected"),e.column===c&&i.push("endSelected"),s.contains=!0,s.class=i))}return s},D.prototype._compareSelections=function(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i+=1){for(var s=!1,n=0;n<t.length;n+=1)this._compareIndividualSelectionObjects(e[i],t[n])&&(s=!0);if(!1===s)return!1}return!0},D.prototype._compareIndividualSelectionObjects=function(e,t){return e.startIndex.row===t.startIndex.row&&e.startIndex.column===t.startIndex.column&&e.endIndex.row===t.endIndex.row&&e.endIndex.column===t.endIndex.column},D.prototype._clearSelection=function(e){this.unhighlightSelection(),this._removeTouchSelectionAffordance();var t=this.GetSelection();this.m_selection=[],this._compareSelectionAndFire(e,t)},D.prototype.setDiscontiguousSelectionMode=function(e){this.m_discontiguousSelection=e,this._setAccInfoText(e?"accessibleRangeSelectModeOn":"accessibleRangeSelectModeOff")},D.prototype._selectEntireRow=function(e,t,i){var s=this.createIndex(e,0),n=this.createIndex(t,-1),o=this._getSelectionStartAndEnd(s,n,0);"row"===this.m_options.getSelectionMode()?this._selectRange(this.createIndex(o.min.row),this.createIndex(o.max.row),i):this._selectRange(this.createIndex(o.min.row,0),this.createIndex(o.max.row,-1),i)},D.prototype._selectEntireColumn=function(e,t,i){var s=this.createIndex(0,e),n=this.createIndex(-1,t),o=this._getSelectionStartAndEnd(s,n,0);this._selectRange(this.createIndex(0,o.min.column),this.createIndex(-1,o.max.column),i)},D.prototype._selectRange=function(e,t,i){this.unhighlightSelection(),this._createRangeWithKeys(e,t,this._selectRangeCallback.bind(this,i))},D.prototype._selectRangeCallback=function(e,t){var i,s=this.GetSelection();(i=this.m_discontiguousSelection||!e||this.m_utils.ctrlEquivalent(e)&&this.isMultipleSelection()&&0===e.button?this.m_utils.ctrlEquivalent(e)&&this.isMultipleSelection()&&!0===e.shiftKey?s.slice(0,s.length-1):s.slice(0):[]).push(t),this.m_selection=i,this.rehighlightSelection(),this._isDatabodyCellActive()&&e.target[this.getResources().getMappedAttribute("context")]&&!e.target[this.getResources().getMappedAttribute("context")].axis&&!this.m_selectionFrontier.axis&&(this.m_selectionFrontier=this.m_active.indexes,this._highlightActive()),this._compareSelectionAndFire(e,s)},D.prototype.rehighlightSelection=function(){for(var e=0;e<this.m_selection.length;e++)this.highlightRange(this.m_selection[e])},D.prototype.GetSelection=function(){return null==this.m_selection&&(this.m_selection=[]),this.m_selection},D.prototype.SetSelection=function(e){void 0!==e&&(null===e&&(e=[]),this.unhighlightSelection(),this.m_selection=e,this._resetHeaderHighLight(),null!=this.m_databody&&this.applySelection(this.m_startRow,this.m_endRow,this.m_startCol,this.m_endCol),this.m_bottomFloodFillIconContainer&&(1===this.m_selection.length?this._moveFloodFillAffordance():this._removeFloodFillAffordance()))},D.prototype.fireSelectionEvent=function(e,t){var i={event:e,ui:{selection:this.GetSelection(),previousSelection:t}};this.fireEvent("select",i)},D.prototype.extendSelection=function(e,t,i){if("header"!==this.m_active.type){var s;if(this.m_utils.isTouchDevice())s=this.m_touchSelectAnchor;else s={row:this.m_active.indexes.row,column:this.m_active.indexes.column};if(null!=s){this._resetSelectionFrontierFocus();var n=this._updateSelectionFrontier(s,e,i),o=n.min,r=n.max;if("row"===this.m_options.getSelectionMode()&&(o=this.createIndex(o.row),r=this.createIndex(r.row)),this.m_discontiguousSelection&&(this.m_deselectInProgress||this._isContainSelection(s,this.GetSelection().slice(0,-1)))){this.m_deselectInProgress||(this.m_deselectInfo={anchor:s,selection:this.GetSelection()});var l=this._trimRangeForSelectionMode(this.createRange(o,r));this.m_deselectInProgress=this._deselectRange(l,t)}else this._createRangeWithKeys(o,r,this._extendSelectionCallback.bind(this,t,s))}}},D.prototype.extendDeselection=function(e,t){var i=this.m_deselectInfo.anchor,s=this._updateSelectionFrontier(i,e),n=s.min,o=s.max,r=this._trimRangeForSelectionMode(this.createRange(n,o));this._deselectRange(r,t)},D.prototype.extendSelectionHeader=function(e,t,i,s){if(null!==e){var n=this.findCellOrHeader(e);if(null!==n){var o,r,l,a,h,d=n[this.getResources().getMappedAttribute("context")];if(null==i&&(i=this.m_discontiguousSelection),d){if(d.cell)a=l=-1!==this.m_selectionFrontier.axis.indexOf("column")?d.indexes.column:d.indexes.row,h=l;else{if(this.m_selectionFrontier&&d.index===this.m_selectionFrontier.index&&d.level===this.m_selectionFrontier.level)return;1===d.extent?(l=d.index,a=d.index,h=d.index):a=(l=this._getAttribute(e.parentNode,"start",!0))+(this._getAttribute(e.parentNode,"extent",!0)-1)}var c=s?this.m_deselectInfo.sourceParent:this._getActiveElement();if(c){var m,u,_,p=c[this.getResources().getMappedAttribute("context")];if(s?(r=this.m_deselectInfo.axis,o=this.m_deselectInfo.anchor[r],u=(m=this._getAttribute(c.parentNode,"start",!0))+(this._getAttribute(c.parentNode,"extent",!0)-1)):this.m_utils.isTouchDevice()?(-1===(o=-1!==this.m_selectionFrontier.axis.indexOf("column")?this.m_touchSelectAnchor.column:this.m_touchSelectAnchor.row)&&(o=0),m=o,u=o,r=this.m_selectionFrontier.axis):(u=(m=this._getAttribute(c.parentNode,"start",!0))+(this._getAttribute(c.parentNode,"extent",!0)-1),"header"===this.m_active.type&&(r=this.m_active.axis,o=this.m_active.index)),"cell"===this.m_active.type?(_=1,o=-1!==(r=d.axis).indexOf("row")?this.m_active.indexes.row:this.m_active.indexes.column):_=p.extent,i&&!s){var g=this.m_selection[this.m_selection.length-1];this.unhighlightSelection(),g&&this.checkCorners(r,o,g)&&this.m_selection.pop()}if(1!==_?l<=m&&a>=u||l>=m&&a<=u?(this.m_headerDragState||this._setActive(n,this._createActiveObject(n),t),o=l,h=a):l>m&&a>u?(o=m,h=a):l<m&&a<u&&(o=l,h=u):1===_&&l!==a&&(l<=o&&o<=a?(this.m_headerDragState||"cell"===this.m_active.type||this._setActive(n,this._createActiveObject(n),t),o=l,h=a):l<=o&&a<=o?(h=o,o=l):l>=o&&a>=o&&(h=a)),d.cell?this.setHeaderSelectionFrontier(r,h,h,this.m_selectionFrontier.level,n,!0):this.setHeaderSelectionFrontier(r,h,d.index,d.level,n,!0),!s&&r)-1!==r.indexOf("column")?this._selectEntireColumn(o,h,t):-1!==r.indexOf("row")&&this._selectEntireRow(o,h,t);else{var f,C=Math.min(o,h),y=Math.max(o,h);f=null!=r&&-1!==r.indexOf("row")?this.createRange(this.createIndex(C,0),this.createIndex(y,-1)):this.createRange(this.createIndex(0,C),this.createIndex(-1,y));var v=this._trimRangeForSelectionMode(f);this._deselectRange(v,t)}}}}}},D.prototype._updateSelectionFrontier=function(e,t,i){var s,n,o;if("row"===this.m_options.getSelectionMode()?(s=this.createIndex(e.row,this.m_startCol),n=this.createIndex(t.row,this.m_endCol)):(s=e,n=t),null!=i){if(this.m_deselectInProgress)o=this.createRange(this.m_deselectInfo.anchor,this.m_selectionFrontier);else{var r=this.GetSelection();o=r[this._getLastAnchoredSelectionIndex(r,s)]}var l=o.startIndex,a=o.endIndex;l.row===this.m_selectionFrontier.row&&s.row!==l.row?s.row=a.row:a.row===this.m_selectionFrontier.row&&s.row!==a.row&&(s.row=l.row),l.column===this.m_selectionFrontier.column&&s.column!==l.column?s.column=a.column:a.column===this.m_selectionFrontier.column&&s.column!==a.column&&(s.column=l.column)}var h=this._getSelectionStartAndEnd(s,n,0),d=n;if(null!=i){var c=h.min,m=h.max;for("row"===this.m_options.getSelectionMode()&&(c=this.createIndex(c.row),m=this.createIndex(m.row));this._compareIndividualSelectionObjects(o,this.createRange(c,m));){if(i===this.keyCodes.LEFT_KEY){if(0===n.column)break;n.column-=1}else if(i===this.keyCodes.RIGHT_KEY){if(n.column===this.m_endCol)break;n.column+=1}else if(i===this.keyCodes.UP_KEY){if(0===n.row)break;n.row-=1}else{if(i!==this.keyCodes.DOWN_KEY)break;if(n.row===this.m_endRow)break;n.row+=1}c=(h=this._getSelectionStartAndEnd(s,n,0)).min,m=h.max,"row"===this.m_options.getSelectionMode()&&(c=this.createIndex(c.row),m=this.createIndex(m.row))}i===this.keyCodes.LEFT_KEY?(d.column=c.column<s.column?c.column:m.column,d.row=c.row<s.row?c.row:m.row):i===this.keyCodes.RIGHT_KEY?(d.column=m.column>s.column?m.column:c.column,d.row=c.row<s.row?c.row:m.row):i===this.keyCodes.UP_KEY?(d.row=c.row<s.row?c.row:m.row,d.column=c.column<s.column?c.column:m.column):i===this.keyCodes.DOWN_KEY&&(d.row=m.row>s.row?m.row:c.row,d.column=c.column<s.column?c.column:m.column)}else d=this.getCellIndexes(this._getCellByIndex(d));return"row"===this.m_options.getSelectionMode()&&(d=this.createIndex(d.row,this.m_active.indexes.column)),this.m_selectionFrontier=d,h},D.prototype._getMinOrMax=function(e,t,i){return isNaN(e)?isNaN(t)?null:t:isNaN(t)?e:i(e,t)},D.prototype._getSelectionStartAndEnd=function(e,t,i){var s=this.getElementsInRange(this.createRange(e,t));if(null==s||s.length===i)return{min:e,max:t};for(var n={row:this._getMinOrMax(e.row,t.row,Math.min),column:this._getMinOrMax(e.column,t.column,Math.min)},o={row:this._getMinOrMax(e.row,t.row,Math.max),column:this._getMinOrMax(e.column,t.column,Math.max)},r=0;r<s.length;r++){var l=this.getCellIndexes(s[r]),a=this.getCellEndIndexes(s[r]);(l.row<n.row||null==n.row)&&(n.row=l.row),(l.column<n.column||null==n.column)&&(n.column=l.column),(a.row>o.row||null==o.row)&&(o.row=a.row),(a.column>o.column||null==o.column)&&(o.column=a.column)}return this._getSelectionStartAndEnd(n,o,s.length)},D.prototype._getLastAnchoredSelectionIndex=function(e,t){var i;for(i=e.length-1;i>-1;i--)if(this._isContainSelection(t,[e[i]]))return i;return i-1},D.prototype._extendSelectionCallback=function(e,t,i){var s=this.GetSelection(),n=this._getLastAnchoredSelectionIndex(s,t),o=s[n];if(null!=o){var r=o.startIndex.row===i.startIndex.row;null!=o.startIndex.column&&null!=i.startIndex.column&&(r=r&&o.startIndex.column===i.startIndex.column);var l=o.endIndex.row===i.endIndex.row;if(null!=o.endIndex.column&&null!=i.endIndex.column&&(l=l&&o.endIndex.column===i.endIndex.column),!r||!l){var a;if(this.m_discontiguousSelection||e&&this.m_utils.ctrlEquivalent(e)&&0===e.button?(a=s.slice(0),this.unhighlightRange(o),a.splice(n,1)):(a=[],this.unhighlightSelection()),a.push(i),this.m_selection=a,this.m_discontiguousSelection||e&&this.m_utils.ctrlEquivalent(e)&&0===e.button)for(var h=0;h<this.m_selection.length;h++)this.highlightRange(this.m_selection[h]);else this.highlightRange(i,!0);this._makeSelectionFrontierFocus(),this._compareSelectionAndFire(e,s)}}},D.prototype._resetSelectionFrontierFocus=function(){if(!(null==this.m_selectionFrontier||this._isDatabodyCellActive()&&this.m_selectionFrontier.row===this.m_active.indexes.row&&this.m_selectionFrontier.column===this.m_active.indexes.column)){var e=this.createRange(this.m_selectionFrontier),t=this.getElementsInRange(e);null!=t&&t.length>0&&this._unsetAriaProperties(t[0])}},D.prototype._makeSelectionFrontierFocus=function(){if(!(null==this.m_selectionFrontier||this._isDatabodyCellActive()&&this.m_selectionFrontier.row===this.m_active.indexes.row&&this.m_selectionFrontier.column===this.m_active.indexes.column)){if(this._isDatabodyCellActive()){var e=this.createRange(this.m_active.indexes),t=this.getElementsInRange(e);null!=t&&t.length>0&&this._unsetAriaProperties(t[0])}var i=this.createRange(this.m_selectionFrontier),s=this.getElementsInRange(i);if(null!=s&&0!==s.length){this._updateContextInfo(this.m_selectionFrontier);var n=this.m_utils.containsCSSClassName(s[0],this.getMappedStyle("row"))?s[0].firstChild:s[0];this._setAriaProperties(this._createActiveObject(n),null,n)}}},D.prototype._selectHeader=function(e,t,i,s){var n,o;if(-1!==e.indexOf("row")&&this.m_rowHeaderLevelCount-1===i||-1!==e.indexOf("column")&&this.m_columnHeaderLevelCount-1===i)n=t,o=t;else{var r=this._getActiveElement();o=(n=this._getAttribute(r.parentNode,"start",!0))+(this._getAttribute(r.parentNode,"extent",!0)-1)}-1!==e.indexOf("row")?((n===o&&!this.isMultipleSelection()||this.isMultipleSelection())&&(this.setHeaderSelectionFrontier(e,o,t,i,s.target,!0),this._selectEntireRow(n,o,s)),this._setAccInfoText("accessibleRowSelected",{row:t+1})):-1!==e.indexOf("column")&&(this.setHeaderSelectionFrontier(e,o,t,i,s.target,!0),this._selectEntireColumn(n,o,s),this._setAccInfoText("accessibleColumnSelected",{column:t+1})),this.isMultipleSelection()&&(this.m_headerDragState=!0)},D.prototype.setHeaderSelectionFrontier=function(e,t,i,s,n,o){o&&(this.m_selectionFrontier={}),this.m_selectionFrontier.axis=e,this.m_selectionFrontier.end=t,this.m_selectionFrontier.index=i,this.m_selectionFrontier.level=s,this.m_selectionFrontier.target=n},D.prototype._resetHeaderHighLight=function(){this.GetSelection().forEach(e=>{var t=this.getHeadersByRange(e,"row"),i=this.getHeadersByRange(e,"column");this._highlightHeaders(e,t,i)})},D.prototype.updateSelectionHeader=function(){this.m_selectionFrontier&&this.m_selectionFrontier.target&&(this.m_utils.isTouchDevice()&&this.m_selection.length&&(this.m_touchSelectAnchor=this.m_selection[this.m_selection.length-1].startIndex),this.extendSelectionHeader(this.m_selectionFrontier.target,null)),this._resetHeaderHighLight()},D.prototype.selectAndFocus=function(e,t,i){null==i&&(i=!1),this._resetSelectionFrontierFocus(),this._setActiveByIndex(e,t),"row"===this.m_options.getSelectionMode()&&(e=this.createIndex(e.row));var s=this._getSelectionStartAndEnd(e,e,0),n=s.min,o=s.max;"row"===this.m_options.getSelectionMode()&&(n=this.createIndex(n.row),o=this.createIndex(o.row)),this._createRangeWithKeys(n,o,this._selectAndFocusRangeCallback.bind(this,n,t,i))},D.prototype._selectAndFocusRangeCallback=function(e,t,i,s){var n=this.GetSelection(),o=n.slice(0);i||(this.m_discontiguousSelection||!t||this.isMultipleSelection()&&this.m_utils.ctrlEquivalent(t)&&0===t.button?!this._isDatabodyCellActive()||null==this.m_prevActive||"cell"!==this.m_prevActive.type||this.m_selectionFrontier.row!==this.m_prevActive.indexes.row||this.m_selectionFrontier.column!==this.m_prevActive.indexes.column||this.m_utils.isTouchDevice()||!t.keyCode&&this.isMultipleSelection()||(o.pop(),this._unhighlightDiscontiguousSelection(o)):(this.unhighlightSelection(),o=[])),this.m_selectionFrontier=e,o.push(s),this.m_selection=o,this.highlightRange(s),this._compareSelectionAndFire(t,n)},D.prototype._getSurrondingCellIndexes=function(e,t,i){let s={};return Object.assign(s,t),s[e]+=i,s},D.prototype._unhighlightDiscontiguousSelection=function(e){var t=this._getContainedSelectionCssClass(this.m_prevActive.indexes,e);let i=this._getSurrondingCellIndexes("row",this.m_prevActive.indexes,-1),s=this._getSurrondingCellIndexes("column",this.m_prevActive.indexes,-1),n=this._getSurrondingCellIndexes("row",this.m_prevActive.indexes,1),o=this._getSurrondingCellIndexes("column",this.m_prevActive.indexes,1),r=this._getContainedSelectionCssClass(s,e),l=this._getContainedSelectionCssClass(i,e),a=this._getContainedSelectionCssClass(o,e),h=this._getContainedSelectionCssClass(n,e);if(t.contains){let e=t.class,n=-1!==e.indexOf("topSelected"),o=-1!==e.indexOf("bottomSelected"),d=-1!==e.indexOf("startSelected"),c=-1!==e.indexOf("endSelected"),m=[];e.length?(n&&o?c&&d||(c&&this.unhighlightPreviousColumnCell(r,s),d&&this.getNextColumnCellSelectedClass(a,m),d||c||(this.getNextColumnCellSelectedClass(a,m),this.unhighlightPreviousColumnCell(r,s)),n||this.unhighlightPreviousRowCell(l,i),o||this.getNextRowCellSelectedClass(h,m)):(n&&this.getNextRowCellSelectedClass(h,m),o&&this.unhighlightPreviousRowCell(l,i),n||o||(this.getNextRowCellSelectedClass(h,m),this.unhighlightPreviousRowCell(l,i)),d||this.unhighlightPreviousColumnCell(r,s),c||this.getNextColumnCellSelectedClass(a,m)),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),m)):(this.getNextRowCellSelectedClass(h,m),c||this.getNextColumnCellSelectedClass(a,m),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),m),d||this.unhighlightPreviousColumnCell(r,s),this.unhighlightPreviousRowCell(l,i))}else{let e=["selected","topSelected","startSelected"];h.contains||e.push("bottomSelected"),a.contains||e.push("endSelected"),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),e),l.contains||this._unhighlightElement(this._getCellByIndex(i),["bottomSelected"]),r.contains||this._unhighlightElement(this._getCellByIndex(s),["endSelected"])}},D.prototype.unhighlightPreviousRowCell=function(e,t){e.contains?-1===e.class.indexOf("bottomSelected")&&this._unhighlightElement(this._getCellByIndex(t),["bottomSelected"]):this._unhighlightElement(this._getCellByIndex(t),["bottomSelected"])},D.prototype.unhighlightPreviousColumnCell=function(e,t){e.contains?-1===e.class.indexOf("endSelected")&&this._unhighlightElement(this._getCellByIndex(t),["endSelected"]):this._unhighlightElement(this._getCellByIndex(t),["endSelected"])},D.prototype.getNextColumnCellSelectedClass=function(e,t){e.contains?-1===e.class.indexOf("startSelected")&&t.push("endSelected"):t.push("endSelected")},D.prototype.getNextRowCellSelectedClass=function(e,t){e.contains?-1===e.class.indexOf("topSelected")&&t.push("bottomSelected"):t.push("bottomSelected")},D.prototype._compareSelectionAndFire=function(e,t){var i=this.GetSelection();this.isMultipleSelection()&&i.length>0&&(this.m_utils.isTouchDevice()?(this._addTouchSelectionAffordance(e),this._moveTouchSelectionAffordance()):this.m_options.isFloodFillEnabled()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"cell"===this.m_active.type&&(this._addFloodfillAffordance(e),this._moveFloodFillAffordance())),this._compareSelections(i,t)||(this._resetHeaderHighLight(),this.fireSelectionEvent(e,t))},D.prototype._addTouchSelectionAffordance=function(e){if(null==this.m_topSelectIconContainer&&null==this.m_bottomSelectIconContainer){var t=e.target,i=this.findCell(t);if(i||(i=this.findHeader(t)),!i)return;this.m_topSelectIconContainer=document.createElement("div"),this.m_topSelectIconContainer.className=this.getMappedStyle("toucharea");var s=document.createElement("div");s.className=this.getMappedStyle("selectaffordance"),s.setAttribute("role","button"),s.setAttribute("aria-label",this.getResources().getTranslatedText("accessibleSelectionAffordanceTop")),this.m_topSelectIconContainer.appendChild(s),this.m_bottomSelectIconContainer=document.createElement("div"),this.m_bottomSelectIconContainer.className=this.getMappedStyle("toucharea");var n=document.createElement("div");n.className=this.getMappedStyle("selectaffordance"),n.setAttribute("role","button"),n.setAttribute("aria-label",this.getResources().getTranslatedText("accessibleSelectionAffordanceBottom")),this.m_bottomSelectIconContainer.appendChild(n),this.m_databody.firstChild.appendChild(this.m_topSelectIconContainer),this.m_databody.firstChild.appendChild(this.m_bottomSelectIconContainer),this.m_touchSelectionAffordanceHeight=this.m_topSelectIconContainer.firstElementChild.offsetHeight,this.m_touchSelectionAffordanceWidth=this.m_topSelectIconContainer.firstElementChild.offsetWidth}},D.prototype._addRoundedAffordanceClasses=function(e,t,i,s){if(e&&t)i||"row"!==s?i||"column"!==s?(e.classList.add(this.getMappedStyle("selectaffordancetopcornerbounded")),t.classList.add(this.getMappedStyle("selectaffordancebottomcornerbounded"))):(e.classList.add(this.getMappedStyle("selectaffordancetopcolumn")),t.classList.add(this.getMappedStyle("selectaffordancebottomcolumn"))):(e.classList.add(this.getMappedStyle("selectaffordancetoprow")),t.classList.add(this.getMappedStyle("selectaffordancebottomrow")));else if(t){let e;e=i||"row"!==s?i||"column"!==s?"selectaffordancebottomcornerbounded":"selectaffordancebottomcolumn":"selectaffordancebottomrow",t.classList.add(this.getMappedStyle(e))}},D.prototype._clearRoundedAffordanceClasses=function(e,t){e&&(e.classList.remove(this.getMappedStyle("selectaffordancetopcornerbounded")),e.classList.remove(this.getMappedStyle("selectaffordancetopcolumn")),e.classList.remove(this.getMappedStyle("selectaffordancetoprow"))),t.classList.remove(this.getMappedStyle("selectaffordancebottomcornerbounded")),t.classList.remove(this.getMappedStyle("selectaffordancebottomcolumn")),t.classList.remove(this.getMappedStyle("selectaffordancebottomrow"))},D.prototype._removeTouchSelectionAffordance=function(e){(this._isDatabodyCellActive()||e)&&this.m_topSelectIconContainer&&this.m_topSelectIconContainer.parentNode&&(this.m_topSelectIconContainer.parentNode.removeChild(this.m_topSelectIconContainer),this.m_bottomSelectIconContainer.parentNode.removeChild(this.m_bottomSelectIconContainer))},D.prototype._moveTouchSelectionAffordance=function(){var e,t,i=this.getResources().isRTLMode()?"right":"left",s=this.GetSelection();if(s.length>0){var n=this.m_options.getSelectionMode(),o=this._getTouchSelectionAffordanceSize();if(null!=this.m_topSelectIconContainer&&null!=this.m_bottomSelectIconContainer){var r=this.m_topSelectIconContainer.firstElementChild,l=this.m_bottomSelectIconContainer.firstElementChild;if(this._clearRoundedAffordanceClasses(r,l),"row"===n||-1!==s[s.length-1].endIndex.row&&-1===s[s.length-1].endIndex.column){this._addRoundedAffordanceClasses(r,l,!1,"row");const n=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft-o/2;let a;if(this.setElementDir(this.m_topSelectIconContainer,n,i),this.setElementDir(this.m_bottomSelectIconContainer,n,i),e=this._getAxisCellsByKey(s[s.length-1].startKey.row,"row"),(t=this._getAxisCellsByKey(s[s.length-1].endKey.row,"row"))&&t.length&&(a=t[0]),!a){let e=this.createIndex(-1,0),t=this.getElementsInRange(this.createRange(e,e));a=t[t.length-1]}this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(e[0],"top")-this.m_touchSelectionAffordanceHeight-1,"top"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(a,"top")+this.getElementHeight(a)-o+this.m_touchSelectionAffordanceHeight,"top")}else if(-1!==s[s.length-1].endIndex.column&&-1===s[s.length-1].endIndex.row){this._addRoundedAffordanceClasses(r,l,!1,"column"),e=this._getAxisCellsByKey(s[s.length-1].startKey.column,"column"),t=this._getAxisCellsByKey(s[s.length-1].endKey.column,"column");var a=this.getElementHeight(this.m_databody)/2+this.m_currentScrollTop-o/2;this.setElementDir(this.m_topSelectIconContainer,a,"top"),this.setElementDir(this.m_bottomSelectIconContainer,a,"top"),this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(e[0],"left")-this.m_touchSelectionAffordanceWidth-2,"left"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(t[0],"left")+this.getElementWidth(t[0])-(o-this.m_touchSelectionAffordanceWidth-1),"left")}else{this._addRoundedAffordanceClasses(r,l,!0);var h=this._getCellByIndex(s[s.length-1].startIndex),d=this._getCellByIndex(s[s.length-1].endIndex);if(!d){let e=this.createIndex(-1,-1),t=this.getElementsInRange(this.createRange(e,e));d=t[t.length-1]}this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(h,"top")-this.m_touchSelectionAffordanceHeight-1,"top"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(d,"top")+this.getElementHeight(d)-o+this.m_touchSelectionAffordanceWidth,"top"),this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(h,i)-this.m_touchSelectionAffordanceWidth-2,i),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(d,i)+this.getElementWidth(d)-(o-this.m_touchSelectionAffordanceWidth),i)}null==this.m_topSelectIconContainer.parentNode&&(this.m_databody.firstChild.appendChild(this.m_topSelectIconContainer),this.m_databody.firstChild.appendChild(this.m_bottomSelectIconContainer))}}},D.prototype._scrollTouchSelectionAffordance=function(){var e,t,i=this.m_options.getSelectionMode();if("row"===i)null!=this.m_topSelectIconContainer&&(t=this.getResources().isRTLMode()?"right":"left",e=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft,this.setElementDir(this.m_topSelectIconContainer,e,t),this.setElementDir(this.m_bottomSelectIconContainer,e,t));else if("cell"===i&&this.isHeaderSelectionType(this.m_selectionFrontier)&&null!=this.m_topSelectIconContainer)if(-1!==this.m_selectionFrontier.axis.indexOf("row"))t=this.getResources().isRTLMode()?"right":"left",e=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft,this.setElementDir(this.m_topSelectIconContainer,e,t),this.setElementDir(this.m_bottomSelectIconContainer,e,t);else{var s=this.getElementHeight(this.m_databody)/2+this.m_currentScrollTop;this.setElementDir(this.m_topSelectIconContainer,s,"top"),this.setElementDir(this.m_bottomSelectIconContainer,s,"top")}},D.prototype._getTouchSelectionAffordanceSize=function(){if(null==this.m_touchSelectionAffordanceSize){var e=document.createElement("div");e.className=this.getMappedStyle("toucharea"),e.style.visibilty="hidden",e.style.top="0px",e.style.visibilty="0px",this.m_root.appendChild(e);var t=e.offsetWidth;this.m_root.removeChild(e),this.m_touchSelectionAffordanceSize=t}return this.m_touchSelectionAffordanceSize},D.SORT_ANIMATION_DURATION=800,D.prototype._handleSortContainerMouseOver=function(e){var t=e.target,i=this.findHeader(t),s=this._getSortIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("sortIcon"))&&(this.m_utils.addCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("disabled")))},D.prototype._handleSortMouseOut=function(e){if(!this._databodyEmpty()){var t,i=e.target,s=e.relatedTarget,n=this.findHeader(i);null!=n&&null!=s&&n===this.findHeader(s)||this._displaySortIcon(n),(t=this._getSortIcon(n))&&(this.m_utils.removeCSSClassName(t,this.getMappedStyle("hover")),this.m_utils.containsCSSClassName(t,this.getMappedStyle("selected"))||(this.m_utils.addCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("enabled"))));var o=this._getSortContainer(n);o&&(this.m_utils.removeCSSClassName(o,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(o,this.getMappedStyle("selected")))}},D.prototype._handleSortIconMouseDown=function(e){this._databodyEmpty()||(this.m_utils.addCSSClassName(e,this.getMappedStyle("selected")),this.m_utils.removeCSSClassName(e,this.getMappedStyle("disabled")))},D.prototype._toggleSortIconDirection=function(e,t){if(null!=e){var i=this._getSortIcon(e);"descending"===t&&(this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))?(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortascending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdefault")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortdescending"))):"ascending"===t&&(this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))?(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdescending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdefault")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortascending"))):"default"===t&&(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdescending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortascending")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortdefault")))}},D.prototype._displaySortIcon=function(e){var t=!1;if(null!=e){var i=this._getSortIcon(e);null!=this.m_sortInfo&&(t=this.m_sortInfo.key===this._getKey(e)),t&&this.m_utils.addCSSClassName(i,this.getMappedStyle("default"))}},D.prototype._buildSortIcon=function(e,t,i){var s=document.createElement("div");this.m_utils.addCSSClassName(s,this.getMappedStyle("iconContainer")),this.m_utils.addCSSClassName(s,this.getMappedStyle("sortIcon"));var n=document.createElement("div"),o=this.getMappedStyle("icon")+" "+this.getMappedStyle("clickableicon"),r=null!=this.m_sortInfo&&this.m_sortInfo.axis===i?this.m_sortInfo.key:null;if(e.key===r){var l=null!=this.m_sortInfo&&this.m_sortInfo.axis===i?this.m_sortInfo.direction:null;"ascending"===l?(n.className=this.getMappedStyle("sortascending")+" "+o,t.setAttribute(this.getResources().getMappedAttribute("sortDir"),l),n.setAttribute("title",this.getResources().getTranslatedText("labelSortDsc"))):"descending"===l?(n.className=this.getMappedStyle("sortdescending")+" "+o,t.setAttribute(this.getResources().getMappedAttribute("sortDir"),l),n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc"))):(n.className=this.getMappedStyle("sortdefault")+" "+o,n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc")))}else o+=" "+this.getMappedStyle("disabled"),n.className=this.getMappedStyle("sortdefault")+" "+o,n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc"));return s.appendChild(n),s.addEventListener("mouseover",this._handleSortContainerMouseOver.bind(this)),s},D.prototype._handleKeyboardSort=function(e,t){if(!this._databodyEmpty()){var i=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));i=null==i||"descending"===i?"ascending":"descending",this._doHeaderSort(t,e,i)}},D.prototype._handleHeaderSort=function(e,t){if(!this._databodyEmpty()){var i=e.target,s=this.findHeader(i);null!=s&&(null==t&&(t=null!=this.m_sortInfo&&this.m_sortInfo.key===this._getKey(s)&&"ascending"===this.m_sortInfo.direction?"descending":"ascending"),this._doHeaderSort(e,s,t))}},D.prototype._handleCellSort=function(e,t,i){null==i||this._databodyEmpty()||(this._removeTouchSelectionAffordance(),this._doHeaderSort(e,i,t))},D.prototype._doHeaderSort=function(e,t,i){if(!0!==this.m_isSorting){this.m_delayedSort=null;var s=this._getKey(t),n=this._getAxis(t);if(this._removeSortSelection(),t.setAttribute(this.getResources().getMappedAttribute("sortDir"),i),this.m_sortInfo={event:e,key:s,axis:n,direction:i,header:t},this._toggleSortIconDirection(t,i),this._addSortSelection(),this._setAccInfoText("ascending"===i?"accessibleSortAscending":"accessibleSortDescending",{id:s}),null!=i&&null!=s&&null!=n)if(this._isDataGridProvider())this._fireSortRequestEvent(n);else{this.m_isSorting=!0,this.showStatusText();var o={axis:n,key:s,direction:i};this.getDataSource().sort(o,{success:this._handleSortSuccess.bind(this),error:this._handleSortError.bind(this)})}}else this.m_delayedSort={event:e,header:t,direction:i}},D.prototype._handleSortError=function(){this.hideStatusText()},D.prototype._removeSortSelection=function(){if(null!=this.m_sortInfo){var e;if(!(e="column"===this.m_sortInfo.axis?this._findHeaderByKey(this.m_sortInfo.key,this.m_colHeader,this.getMappedStyle("colheadercell")):this._findHeaderByKey(this.m_sortInfo.key,this.m_rowHeader,this.getMappedStyle("rowheadercell"))))return;e.removeAttribute(this.getResources().getMappedAttribute("sortDir"));var t=this._getSortIcon(e);this._toggleSortIconDirection(e,"default"),"descending"===this.m_sortInfo.direction&&(this.m_utils.removeCSSClassName(t,this.getMappedStyle("sortdescending")),this.m_utils.addCSSClassName(t,this.getMappedStyle("sortascending"))),this.m_utils.addCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("default")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("selected")),this.m_utils.removeCSSClassName(this._getSortContainer(e),this.getMappedStyle("enabled"))}},D.prototype._addSortSelection=function(){if(null!=this.m_sortInfo){var e;e="column"===this.m_sortInfo.axis?this._findHeaderByKey(this.m_sortInfo.key,this.m_colHeader,this.getMappedStyle("colheadercell")):this._findHeaderByKey(this.m_sortInfo.key,this.m_rowHeader,this.getMappedStyle("rowheadercell"));var t=this._getSortIcon(e);this.m_utils.addCSSClassName(t,this.getMappedStyle("default")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.addCSSClassName(t,this.getMappedStyle("selected"))}},D.prototype._getAxis=function(e){var t=this.getMappedStyle("colheadercell"),i=this.getMappedStyle("rowheadercell");return this.m_utils.containsCSSClassName(e,t)?"column":this.m_utils.containsCSSClassName(e,i)?"row":null},D.prototype._handleSortSuccess=function(){this.hideStatusText(),this._isDatabodyCellActive()?this._indexes({row:this.m_active.keys.row,column:this.m_active.keys.column},this._handlePreSortScrolling):this._fetchForSort(this.m_startRow,this.m_endRow-this.m_startRow+1,!1)},D.prototype._handlePreSortScrolling=function(e){var t=(-1===e.row?0:e.row)*this.m_avgRowHeight,i=t+this.m_avgRowHeight,s=this._isHighWatermarkScrolling();if(this.m_currentScrollTop<=t&&i<=this.m_currentScrollTop+this.getElementHeight(this.m_databody)||s)this._fetchForSort(this.m_startRow,this.m_endRow-this.m_startRow+1,!1);else{this.m_currentScrollTop=Math.min(t,this._getMaxScrollHeight());var n=Math.floor(this.m_currentScrollTop/this.m_avgRowHeight),o=n*this.m_avgRowHeight;this.m_startRow=n,this.m_endRow=-1,this.m_startRowHeader=n,this.m_endRowHeader=-1,this.m_startRowPixel=o,this.m_endRowPixel=o,this.m_startRowHeaderPixel=o,this.m_endRowHeaderPixel=o,this._fetchForSort(n,null,!0)}},D.prototype._fetchForSort=function(e,t,i){var s=document.createDocumentFragment(),n=document.createDocumentFragment();this.fetchHeaders("row",e,s,n,t,{success:this.handleHeadersFetchSuccessForSort.bind(this),error:this.handleCellsFetchError}),this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1,{success:this.handleCellsFetchSuccessForSort.bind(this,s,n,i),error:this.handleCellsFetchError})},D.prototype.handleHeadersFetchSuccessForSort=function(e,t,i,s){var n,o,r,l,a,h,d,c=t.axis,m=t.start,u=t.header,_=t.endHeader;if(this.m_fetching[c]=!1,null!=e){for(n=e.getCount(),l=0,o=0,h=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell"),d=this.getRendererOrTemplate("row");n-o>0;)r=m+o,o+=(a=this.buildLevelHeaders(u,r,0,0,this.m_startRowPixel+l,!0,s,d,e,"row",h,this.m_rowHeaderLevelCount)).count,l+=a.totalHeaderDimension;this.m_endRowHeader=this.m_startRowHeader+(n-1),this.m_endRowHeaderPixel=this.m_startRowHeaderPixel+l}if(null!=i){for(n=i.getCount(),l=0,o=0,h=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell"),d=this.getRendererOrTemplate("rowEnd");n-o>0;)r=m+o,o+=(a=this.buildLevelHeaders(_,r,0,0,this.m_startRowPixel+l,!0,s,d,i,"rowEnd",h,this.m_rowEndHeaderLevelCount)).count,l+=a.totalHeaderDimension;this.m_endRowEndHeader=this.m_startRowEndHeader+(n-1),this.m_endRowEndHeaderPixel=this.m_startRowEndHeaderPixel+l}this._signalTaskEnd()},D.prototype.handleCellsFetchSuccessForSort=function(e,t,i,s,n){var o;this.m_fetching.cells=!1;var r=D.SORT_ANIMATION_DURATION;this.isFetchComplete()&&this.hideStatusText();var l=n[0].start,a=s.getCount("row"),h=n[1].start,d=document.createDocumentFragment(),c=this._addCellsToFragment(d,s,l,this.m_startRowPixel,h,this.m_startColPixel);this.m_endRow=this.m_startRow+(a-1),this.m_endRowPixel=this.m_startRowPixel+c.totalRowHeight;var u=this.m_databody.firstChild,_=this.m_rowHeader.firstChild,p=this.m_rowEndHeader.firstChild;if(!0===i&&(o=this._isHighWatermarkScrolling(),this.m_utils.isTouchDeviceNotIOS()?(this._disableTouchScrollAnimation(),this.scrollTo(this.m_currentScrollLeft,this.m_currentScrollTop)):(this.m_silentScroll=!0,this.m_databody.scrollTop=this.m_currentScrollTop,this._syncScroller())),!r||!this.m_utils.supportsTransitions()||1===a||this.m_rowHeaderLevelCount>1&&null!=this.m_rowHeaderLevelCount||!1===o)this._signalTaskStart(),this._handleSortEnd(d,e,t);else if(this.m_isCustomElementCallback()){this._signalTaskStart("processing sort render");let i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("div");i.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),s.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),n.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),i.className=this.getMappedStyle("info"),s.className=this.getMappedStyle("info"),n.className=this.getMappedStyle("info"),i.appendChild(d),s.appendChild(e),n.appendChild(t),this.m_root.appendChild(i),this.m_root.appendChild(s),this.m_root.appendChild(n);var g=m.getContext(i).getBusyContext().whenReady(),f=m.getContext(s).getBusyContext().whenReady(),C=m.getContext(n).getBusyContext().whenReady();Promise.all([g,f,C]).then(function(){for(;i.childNodes.length>0;)d.appendChild(i.childNodes[0]);for(;s.childNodes.length>0;)e.appendChild(s.childNodes[0]);for(;n.childNodes.length>0;)t.appendChild(n.childNodes[0]);this.m_root.removeChild(i),this.m_root.removeChild(s),this.m_root.removeChild(n),this._signalTaskEnd(),this.processSortAnimationToPosition(r,0,"ease-in",_,e,u,d,p,t)}.bind(this))}else this.processSortAnimationToPosition(r,0,"ease-in",_,e,u,d,p,t);this._signalTaskEnd()},D.prototype._handleSortEnd=function(e,t,i,s,n,o){var r;if(t.childNodes.length>1){if(r=this.m_rowHeader.firstChild,n)for(let e=0;e<n.length;e++){let i=n[e];t.insertBefore(i.element,t.childNodes[i.index])}this.m_utils.empty(r),r.appendChild(t),this.m_subtreeAttachedCallback(r)}if(i.childNodes.length>1){if(r=this.m_rowEndHeader.firstChild,o)for(let e=0;e<o.length;e++){let t=o[e];i.insertBefore(t.element,i.childNodes[t.index])}this.m_utils.empty(r),r.appendChild(i),this.m_subtreeAttachedCallback(r)}var l=this.m_databody.firstChild,a=this.m_rowHeader.firstChild,h=this.m_rowEndHeader.firstChild;if(s)for(let t=0;t<s.length;t++)e.appendChild(s[t]);this._emptyDatabody(l),this._populateDatabody(l,e),this._fireSortEvent(),this._restoreActive(),this.m_isSorting=!1,this._doDelayedSort(),this.m_animating=!1;for(let e=0;e<l.childNodes.length;e++)this.removeTransformMoveStyle(l.childNodes[e]);if(-1!==this.m_endRowHeader)for(let e=0;e<a.childNodes.length;e++)this.removeTransformMoveStyle(a.childNodes[e]);if(-1!==this.m_endRowEndHeader)for(let e=0;e<h.childNodes.length;e++)this.removeTransformMoveStyle(h.childNodes[e]);this._signalTaskEnd(),this._runModelEventQueue()},D.prototype.processSortAnimationToPosition=function(e,t,i,s,n,o,r,l,a){var h,d,c,m,u,_,p,g,f,C,y=this;this._signalTaskStart();var v=n.childNodes.length>1,E=a.childNodes.length>1,w=this.getResources().isRTLMode()?"right":"left",S=this._getViewportBottom(),H=this._getViewportLeft(),x=this._getViewportRight(),b={},R={},I=[];for(m=0;m<o.childNodes.length;m++)u=o.childNodes[m],h=this._getKey(u,"row"),C=(f=this.getElementDir(u,w))+this.getElementWidth(u),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(f,C,d,_)&&(b[h]?b[h].cell.push(u):(c=S,b[h]={cell:[u],oldTop:d,newTop:c}),c-d!=0&&(g=u));for(m=0;m<s.childNodes.length;m++)v&&(u=s.childNodes[m],h=this._getKey(u,"row"),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(H,x,d,_)&&(c=S,b[h]||(b[h]={oldTop:d,newTop:c}),b[h].rowHeader=u));for(m=0;m<l.childNodes.length;m++)v&&(u=l.childNodes[m],h=this._getKey(u,"row"),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(H,x,d,_)&&(c=S,b[h]||(b[h]={oldTop:d,newTop:c}),b[h].rowEndHeader=u));for(m=0;m<r.childNodes.length;m++)u=r.childNodes[m],h=this._getKey(u,"row"),c=this.getElementDir(u,"top"),b[h]?b[h].newTop=c:(d=S,p=c+this.getElementHeight(u),C=(f=this.getElementDir(u,w))+this.getElementWidth(u),this._isCellBoundaryInViewport(f,C,c,p)&&(this.changeStyleProperty(u,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),I.push(u),R[h]?R[h].cell.push(u):R[h]={cell:[u],oldTop:d,newTop:c,add:!0},c-d!=0&&(g=u)));for(let e=0;e<I.length;e++)o.appendChild(I[e]);var M=[];for(m=0;m<n.childNodes.length;m++)if(v){var L=n.childNodes[m];h=this._getKey(L,"row"),b[h]||(p=(c=this.getElementDir(L,"top"))+this.getElementHeight(L),d=S,this._isCellBoundaryInViewport(H,x,c,p)&&(this.changeStyleProperty(L,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),M.push({element:L,index:m}),R[h]||(R[h]={oldTop:d,newTop:c,add:!0}),R[h].rowHeader=L))}for(let e=0;e<M.length;e++)s.appendChild(M[e].element);var D=[];for(m=0;m<a.childNodes.length;m++)if(E){var A=a.childNodes[m];h=this._getKey(A,"row"),b[h]||(p=(c=this.getElementDir(A,"top"))+this.getElementHeight(A),d=S,this._isCellBoundaryInViewport(H,-1,c,p)&&(this.changeStyleProperty(A,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),D.push({element:A,index:m}),R[h].rowEndHeader=A,R[h]||(R[h]={oldTop:d,newTop:c,add:!0})))}for(let e=0;e<D.length;e++)l.appendChild(D[e].element);if(null!=g){var T=this._handleSortEnd.bind(this,r,n,a,I,M,D);y._onTransitionEnd(g,T,e),this.m_animating=!0,setTimeout(function(){var s,n,o,r,l=0,a=Object.keys(b);for(r=0;r<a.length;r++){if(h=a[r],o=b[a[r]],n=t+"ms",s=o.newTop-o.oldTop,o.cell)for(l=0;l<o.cell.length;l++)y.addTransformMoveStyle(o.cell[l],e/2+"ms",n,i,0,s,0);v&&o.rowHeader&&y.addTransformMoveStyle(o.rowHeader,e/2+"ms",n,i,0,s,0),E&&o.rowEndHeader&&y.addTransformMoveStyle(o.rowEndHeader,e/2+"ms",n,i,0,s,0)}for(a=Object.keys(R),r=0;r<a.length;r++){if(h=a[r],o=R[a[r]],n=t*l+"ms",s=0,o.cell)for(var d=0;d<o.cell.length;d++)y.addTransformMoveStyle(o.cell[d],e/2+"ms",n,i,0,s,0);v&&o.rowHeader&&y.addTransformMoveStyle(o.rowHeader,e/2+"ms",n,i,0,s,0),E&&o.rowEndHeader&&y.addTransformMoveStyle(o.rowEndHeader,e/2+"ms",n,i,0,s,0)}},0)}else this._handleSortEnd(r,n,a)},D.prototype._restoreActive=function(){if(null!=this.m_active){var e=this.m_active.axis,t=this.m_sortInfo.originalEvent;if("cell"===this.m_active.type){var i=this._getCellByKeys(this.m_active.keys);if(null!=i){var s=this.getCellIndexes(i);this._isSelectionEnabled()?this.selectAndFocus(s,t):this._setActiveByIndex(s,t)}else this._setActive(null,null,t,!0),this._isSelectionEnabled()&&this._clearSelection(t)}else if("row"===e||"rowEnd"===e){var n="row"===e?this.m_rowHeader:this.m_rowEndHeader,o="row"===e?this.getMappedStyle("rowheadercell"):this.getMappedStyle("rowendheadercell"),r=this._findHeaderByKey(this.m_active.key,n,o);if(null!=r){var l=r[this.getResources().getMappedAttribute("context")];this._setActive(r,{type:"header",axis:e,index:l.index,key:l.key,level:l.level},t)}else this._setActive(null,null,t)}}},D.prototype._getSortIcon=function(e){return e.lastChild.firstChild},D.prototype._getSortContainer=function(e){return e.lastChild},D.prototype._fireSortEvent=function(){var e={event:this.m_sortInfo.event,ui:{header:this.m_sortInfo.key,direction:this.m_sortInfo.direction}};this.fireEvent("sort",e)},D.prototype._fireSortRequestEvent=function(){let e=this.m_sortInfo.header[this.getResources().getMappedAttribute("context")],t=this.m_sortInfo.header[this.getResources().getMappedAttribute("metadata")],i=this.buildHeaderTemplateContext(e,t).item;var s={event:this.m_sortInfo.event,ui:{direction:this.m_sortInfo.direction,item:i,axis:this.m_sortInfo.axis}};this.fireEvent("sortRequest",s)},D.prototype._doDelayedSort=function(){null!=this.m_delayedSort?this._doHeaderSort(this.m_delayedSort.event,this.m_delayedSort.header,this.m_delayedSort.direction):this.fillViewport()},D.prototype._fireExpandRequestEvent=function(e){const t=this.findHeader(e.target),i=t[this.getResources().getMappedAttribute("context")],s=t[this.getResources().getMappedAttribute("metadata")],n={item:this.buildHeaderTemplateContext(i,s).item,axis:i.axis},o=this._getDisclosureIcon(t);this.m_utils.removeCSSClassName(o,this.getMappedStyle("collapsed")),this.m_utils.addCSSClassName(o,this.getMappedStyle("expanded")),this.fireEvent("expandRequest",n)},D.prototype._fireCollapseRequestEvent=function(e){const t=this.findHeader(e.target),i=t[this.getResources().getMappedAttribute("context")],s=t[this.getResources().getMappedAttribute("metadata")],n={item:this.buildHeaderTemplateContext(i,s).item,axis:i.axis},o=this._getDisclosureIcon(t);this.m_utils.removeCSSClassName(o,this.getMappedStyle("expanded")),this.m_utils.addCSSClassName(o,this.getMappedStyle("collapsed")),this.fireEvent("collapseRequest",n)},D.prototype._handleExpandCollapseRequest=function(e){this._isHeaderExpanded(e.target)?this._fireCollapseRequestEvent(e):this._isHeaderCollapsed(e.target)&&this._fireExpandRequestEvent(e)},D.prototype._isTargetExpandCollapseEnabled=function(e){return this._isHeaderCollapsed(e)||this._isHeaderExpanded(e)},D.prototype._isHeaderCollapsed=function(e){const t=this._getDisclosureIcon(e);return!!t&&this.m_utils.containsCSSClassName(t,this.getMappedStyle("collapsed"))},D.prototype._isHeaderExpanded=function(e){const t=this._getDisclosureIcon(e);return!!t&&this.m_utils.containsCSSClassName(t,this.getMappedStyle("expanded"))},D.prototype._buildDisclosureIcon=function(e){const t=document.createElement("div");t.classList.add(this.getMappedStyle("iconContainer")),t.classList.add(this.getMappedStyle("disclosureIcon"));const i=document.createElement("div");let s;return i.classList.add(this.getMappedStyle("icon")),i.classList.add(this.getMappedStyle("clickableicon")),"expanded"===e.metadata.expanded?(i.classList.add(this.getMappedStyle("expanded")),s=this.getResources().getTranslatedText("collapsedText")):"collapsed"===e.metadata.expanded&&(i.classList.add(this.getMappedStyle("collapsed")),s=this.getResources().getTranslatedText("expandedText")),t.setAttribute("title",s),t.appendChild(i),t.addEventListener("mouseover",this._handleExpandCollapseContainerMouseOver.bind(this)),t.addEventListener("mouseout",this._handleDisclosureMouseOut.bind(this)),t},D.prototype._handleExpandCollapseContainerMouseOver=function(e){const t=e.target,i=this.findHeader(t),s=this._getDisclosureIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("disclosureIcon"))&&(this.m_utils.addCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("disabled")))},D.prototype._buildSpacer=function(e){const t=document.createElement("span");return this._addDataGridSpacerClass(t),this._addIndentation(e,t),t},D.prototype._getTreeDepth=function(e){return e.metadata.treeDepth?e.metadata.treeDepth:null},D.prototype._addDataGridSpacerClass=function(e){this.m_utils.addCSSClassName(e,this.getMappedStyle("spacer"))},D.prototype._isLeaf=function(e){return!e.metadata.expanded||null===e.metadata.expanded},D.prototype._addIndentation=function(e,t){let i=this._getTreeDepth(e);null!==i&&this._appendSpacerClass(i,t,e)},D.prototype._appendSpacerClass=function(e,t,i){t.style.width=e*D.SPACER_DEFAULT_WIDTH+(this._isLeaf(i)?D.SPACER_DEFAULT_WIDTH:0)+"rem"},D.prototype._handleDisclosureMouseOut=function(e){const t=e.target,i=this.findHeader(t),s=this._getDisclosureIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("disclosureIcon"))&&(this.m_utils.removeCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("enabled")))},D.prototype._isDisclosureIcon=function(e){return this.m_utils.containsCSSClassName(e,this.getMappedStyle("icon"))},D.prototype._getDisclosureIcon=function(e){return this.m_utils.containsCSSClassName(e,this.getMappedStyle("icon"))?e:e.getElementsByClassName(this.getMappedStyle("icon"))[0]},D.prototype._getDisclosureIconContainer=function(e){return e.firstChild};const A=function(e){this.datagridprovider=e,this.pendingHeaderCallback={},this._registerEventListeners(),this.totalRowCount=-1,this.totalColumnCount=-1,this.rowKeyMap=new N,this.columnKeyMap=new N,A.superclass.constructor.call(this)};function T(e,t,i){this.results=e,this.rowKeyMap=t,this.columnKeyMap=i,this.databodyResults=e.results.databody,this.rowStart=this.results.rowOffset,this.rowCount=this.results.rowCount,this.rowEnd=this.rowStart+this.rowCount-1,this.columnStart=this.results.columnOffset,this.columnCount=this.results.columnCount,this.columnEnd=this.columnStart+this.columnCount-1,this.lastItem=null}function F(e,t,i){this.results=e,this.axis=t,this.axisResults=e.results[this.axis+"Header"],this.axisLabels=e.results[this.axis+"HeaderLabel"],"row"===this.axis||"rowEnd"===this.axis?(this.start=this.results.rowOffset,this.count=this.results.rowCount):(this.start=this.results.columnOffset,this.count=this.results.columnCount),this.end=this.start+this.count-1,this.lastItem=null,this.keyMap=i,this.levelCount=null}function N(){this.keyMap=new Map,this.nextKey=0,this.set=(e,t,i,s)=>{const n=""+this.nextKey;null==s&&(s=1);for(let o=0;o<s;o++){let s=null==t?t:t+o,r=this.pairIndexLevel(e,s,i);this.keyMap.set(r,n)}return this.nextKey+=1,n},this.get=(e,t,i,s)=>{const n=this.pairIndexLevel(e,t,i);let o=this.keyMap.get(n);return null==o&&(o=this.set(e,t,i,s)),o},this.pairIndexLevel=(e,t,i)=>null==t||null!=i&&t===i-1?""+e:e+","+t,this.handleChange=(e,t)=>{let i=new Set;e.forEach(function(e){let t=e.offset,s=e.count;for(var n=0;n<s;n++)i.add(t+n)});let s=Array.from(i);s.sort(function(e,t){return e-t});let n=new Map;this.keyMap.forEach((e,i)=>{let o=i.split(","),r=parseInt(o[0],10),l=o[1];if(t&&s.some(e=>e===r))return;let a=0;if(r>=s[0]){let e=r;a=s.findIndex(i=>(!t&&e>=i&&(e+=1),i>e)),-1===a&&(a=s.length)}let h=t?r-a:r+a,d=this.pairIndexLevel(h,l);n.set(d,e)}),this.keyMap=n}}h.Object.createSubclass(A,h.DataGridDataSource,"DataGridProviderDataGridDataSource"),A.prototype.fetchHeaders=function(e,t,i){if(null!=t){var s=e.axis,n={headerRange:e,callbacks:t,callbackObjects:i};this.pendingHeaderCallback[s]=n}},A.prototype.fetchCells=function(e,t,i){let s,n,o,r;for(let t=0;t<e.length;t+=1){let i=e[t];"row"===i.axis?(s=i.start,n=i.count):"column"===i.axis&&(o=i.start,r=i.count)}let l,a=this.pendingHeaderCallback.row,h=this.pendingHeaderCallback.column;this.pendingHeaderCallback={},l=a&&h?["all"]:a?["databody","rowHeader","rowEndHeader","rowHeaderLabel","rowEndHeaderLabel"]:h?["databody","columnHeader","columnEndHeader","columnHeaderLabel","columnEndHeaderLabel"]:["databody"];let d={rowOffset:s,columnOffset:o,rowCount:n,columnCount:r,fetchRegions:new Set(l)},c=(s,n)=>{let o,r,l;null!=n?(s.results=Object.assign({},s.results,n.results),null!=n.next&&(o=n.next)):null!=s.next&&(o=s.next),this.totalRowCount=s.totalRowCount,this.totalColumnCount=s.totalColumnCount;let d=s.results;if(h&&(!o||null!=d.columnHeader&&null!=d.columnEndHeader&&null!=d.columnHeaderLabel&&null!=d.columnEndHeaderLabel)&&(r=h.callbacks,null!=r&&null!=r.success)){let e,t;l=h.callbackObjects,null!=d.columnHeader&&(e=new F(s,"column",this.columnKeyMap)),null!=d.columnEndHeader&&(t=new F(s,"columnEnd",this.columnKeyMap)),r.success.call(l.success,e,h.headerRange,t),h=null}if(a&&(!o||null!=d.rowHeader&&null!=d.rowEndHeader&&null!=d.rowHeaderLabel&&null!=d.rowEndHeaderLabel)&&(r=a.callbacks,null!=r&&null!=r.success)){let e,t;l=a.callbackObjects,null!=d.rowHeader&&(e=new F(s,"row",this.rowKeyMap)),null!=d.rowEndHeader&&(t=new F(s,"rowEnd",this.rowKeyMap)),r.success.call(l.success,e,a.headerRange,t),a=null}if(null!=t&&null!=t.success&&!o){let n=new T(s,this.rowKeyMap,this.columnKeyMap);t.success.call(i.success,n,e)}o&&o.then(c.bind(this,s))};this.datagridprovider.fetchByOffset(d).then(c)},A.prototype.getCapability=function(e){return"sort"===e?"full":"sort"===e||"move"===e?"none":null},A.prototype.getCount=function(e){return"row"===e?this.totalRowCount:"column"===e?this.totalColumnCount:-1},A.prototype.getCountPrecision=function(){return"exact"},A.prototype.indexes=function(){return{row:-1,column:-1}},A.prototype.keys=function(){return{row:null,column:null}},A.prototype.move=function(){},A.prototype.moveOK=function(){return"invalid"},A.prototype.sort=function(){},A.prototype._registerEventListeners=function(){this._addListener=this._handleDataGridProviderAddEvent.bind(this),this._removeListener=this._handleDataGridProviderRemoveEvent.bind(this),this._updateListener=this._handleDataGridProviderUpdateEvent.bind(this),this._refreshListener=this._handleDataGridProviderRefreshEvent.bind(this),this.datagridprovider.addEventListener("add",this._addListener),this.datagridprovider.addEventListener("remove",this._removeListener),this.datagridprovider.addEventListener("update",this._updateListener),this.datagridprovider.addEventListener("refresh",this._refreshListener)},A.prototype.Destroy=function(){this.datagridprovider.removeEventListener("add",this._addListener),this.datagridprovider.removeEventListener("remove",this._removeListener),this.datagridprovider.removeEventListener("update",this._updateListener),this.datagridprovider.removeEventListener("refresh",this._refreshListener)},A.prototype._handleDataGridProviderAddEvent=function(e){var t={source:this,operation:"insert",detail:e.detail};("row"===e.detail.axis?this.rowKeyMap:this.columnKeyMap).handleChange(e.detail.ranges,!1),this.handleEvent("change",t)},A.prototype._handleDataGridProviderRemoveEvent=function(e){var t={source:this,operation:"delete",detail:e.detail};("row"===e.detail.axis?this.rowKeyMap:this.columnKeyMap).handleChange(e.detail.ranges,!0),this.handleEvent("change",t)},A.prototype._handleDataGridProviderUpdateEvent=function(e){var t={source:this,operation:"update",detail:e.detail};this.handleEvent("change",t)},A.prototype._handleDataGridProviderRefreshEvent=function(){this.rowKeyMap=new N,this.columnKeyMap=new N;var e={source:this,operation:"refresh"};this.handleEvent("change",e)},T.prototype.getData=function(e){return this._findItemByIndex(e.row,e.column).data},T.prototype.getMetadata=function(e){let t=this._findItemByIndex(e.row,e.column);return{metadata:t.metadata,keys:{row:this.rowKeyMap.get(t.rowIndex),column:this.columnKeyMap.get(t.columnIndex)}}},T.prototype.getCount=function(e){if(null!=this.databodyResults){if("row"===e)return this.rowCount;if("column"===e)return this.columnCount}return 0},T.prototype.getExtent=function(e){let t=!1,i=!1,s=!1,n=!1,o=this._findItemByIndex(e.row,e.column),r=o.rowIndex,l=o.rowExtent,a=r+l-1,h=o.columnIndex,d=o.columnExtent,c=h+d-1;return r<this.rowStart&&(l-=this.rowStart-r,t=!0),a>this.rowEnd&&(l-=a-this.rowEnd,i=!0),h<this.columnStart&&(d-=this.columnStart-h,s=!0),c>this.columnEnd&&(d-=c-this.columnEnd,n=!0),{row:{extent:l,more:{before:t,after:i}},column:{extent:d,more:{before:s,after:n}}}},T.prototype._findItemByIndex=function(e,t){let i=i=>{let s=i.rowIndex,n=i.rowExtent,o=i.columnIndex,r=i.columnExtent;return e>=s&&e<s+n&&t>=o&&t<o+r};return null!=this.lastItem&&i(this.lastItem)||(this.lastItem=this.databodyResults.find(i)),this.lastItem},F.prototype.getData=function(e,t){return this._findItemByIndexLevel(e,t).data},F.prototype.getMetadata=function(e,t){let i=this._findItemByIndexLevel(e,t),s=i.metadata.sortDirection;return null!=s&&(s="unsorted"===i.metadata.sortDirection?null:s),{metadata:i.metadata,key:this.keyMap.get(i.index,i.level,this.getLevelCount(),i.depth),sortDirection:s}},F.prototype.getLevelCount=function(){if(null==this.levelCount){let e=0;null!=this.axisResults&&this.axisResults.forEach(t=>{let i=t.level+t.depth-1;i>e&&(e=i)}),this.levelCount=e+1}return this.levelCount},F.prototype.getExtent=function(e,t){let i=this._findItemByIndexLevel(e,t),s=i.extent,n=i.index,o=i.index+s-1,r=!1,l=!1;return n<this.start&&(s-=this.start-n,r=!0),o>this.end&&(s-=o-this.end,l=!0),{extent:s,more:{before:r,after:l}}},F.prototype.getLabel=function(e){return null!=this.axisLabels?this.axisLabels[e].data:null},F.prototype.getLabelMetadata=function(e){return null!=this.axisLabels?{metadata:this.axisLabels[e].metadata}:null},F.prototype.getDepth=function(e,t){return this._findItemByIndexLevel(e,t).depth},F.prototype.getCount=function(){return null!=this.axisResults?this.count:0},F.prototype._findItemByIndexLevel=function(e,t){let i=i=>{let s=i.index,n=i.extent,o=i.level,r=i.depth;return e>=s&&e<s+n&&t>=o&&t<o+r};return null!=this.lastItem&&i(this.lastItem)||(this.lastItem=this.axisResults.find(i)),this.lastItem},h.__registerWidget("oj.ojDataGrid",C.oj.baseComponent,{widgetEventPrefix:"oj",options:{bandingInterval:{row:0,column:0},data:null,gridlines:{horizontal:"visible",vertical:"visible"},scrollToKey:"auto",scrollPosition:{x:0,y:0},selectionMode:{cell:"none",row:"none"},dnd:{reorder:{row:"disable"},drag:null,drop:null},dataTransferOptions:{cut:"disable",copy:"disable",paste:"disable",fill:"disable"},scrollPolicy:"auto",scrollPolicyOptions:{maxRowCount:500,maxColumnCount:500},selection:[],currentCell:null,editMode:"none",header:{row:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},sortable:"auto",style:null},column:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},sortable:"auto",style:null},columnEnd:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},style:null},rowEnd:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},style:null}},cell:{className:null,renderer:null,style:null},resize:null,sort:null,sortRequest:null,collapseRequest:null,expandRequest:null,ready:null,scroll:null,beforeCurrentCell:null,beforeEdit:null,beforeEditEnd:null,cutRequest:null,copyRequest:null,pasteRequest:null,fillRequest:null},_ComponentCreate:function(){this._super(),this.root=this.element[0],this.rootId=this.root.getAttribute("id"),this.grid=new D(this.root),this.grid.setVisibility(D.VISIBILITY_STATE_RENDER),C(this.root).addClass("oj-datagrid oj-component"),C(this.root).attr(c._OJ_CONTAINER_ATTR,this.widgetName),u.disableDefaultBrowserStyling(this.root),this.redrawSet={data:"all",header:["className","renderer","style","template"]}},_AfterCreate:function(){var e=this;this._unregisterResizeListener(this.root),this._removeAllChildren(),this._super(),this.resources=new w(this._GetReadingDirection(),this._getTranslation.bind(e),{showIndicatorDelay:v.getCachedCSSVarValues(["--oj-private-core-global-loading-indicator-delay-duration"])[0]},this.widgetName),this._setDataSource(),this._setSelection(),null!=this.datasource&&(this.grid.SetDataSource(this.datasource),this._addContextMenu(),this._isCreate=!0,this.grid._addDataSourceEventListeners()),this._checkSelectionMode(this.options),this.grid.SetOptions(this.options,this._WrapCustomElementRenderer.bind(e)),this.grid.SetResources(this.resources),this.grid.SetCreateContextCallback(this._modifyContext.bind(e)),this.grid.SetFixContextCallback(this._FixRendererContext.bind(e)),this.grid.SetRemoveCallback(this._remove.bind(e)),this.grid.SetUniqueIdCallback(this._uniqueId.bind(e)),this.grid.SetCompareValuesCallback(this._compareValues.bind(e)),this.grid.SetNotReadyCallback(this._NotReady.bind(e)),this.grid.SetMakeReadyCallback(this._MakeReady.bind(e)),this.grid.SetOptionCallback(this.option.bind(e)),this.grid.SetSubtreeAttachedCallback(c.subtreeAttached),this.grid.SetContextCallback(m.getContext),this.grid.SetCustomElementCallback(this._IsCustomElement.bind(e)),this.grid.SetUpdateScrollPostionOnRefreshCallback(this._updateScrollPositionOnRefresh.bind(e)),this.grid.SetCustomElement(this._GetCustomElement()),this._focusable({applyHighlight:!0,setupHandlers:function(t,i){e.grid.SetFocusableCallback.call(e.grid,function(e){return t(C(e))},function(e){return i(C(e))})}}),this._registerEventListeners(),this._possiblyRenderOrRefresh()},_SetupResources:function(){this._super(),this.setupResources()},setupResources:function(){null!=this.datasource&&(this._isCreate||this.grid._addDataSourceEventListeners(),this.grid._addDomEventListeners(),this._registerResizeListener(this.root)),this._isCreate=!1},_ReleaseResources:function(){this._super(),this.releaseResources()},releaseResources:function(){this.grid._removeDataSourceEventListeners(),this.grid._removeDomEventListeners(),this._unregisterResizeListener(this.root),this.contextMenuEvent=null},_registerEventListeners:function(){var e=this;this.grid.addListener("resize",function(t){e._trigger("resize",t.event,t.ui)}),this.grid.addListener("select",function(t){e.option("selection",t.ui.selection,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("currentCell",function(t){e.option("currentCell",t.ui,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("beforeCurrentCell",function(t){return e._trigger("beforeCurrentCell",t.event,t.ui)}),this.grid.addListener("sort",function(t){var i=e._trigger2("sort",t.event,t.ui);e.grid.SetSortOriginalEvent(i.event)}),this.grid.addListener("sortRequest",function(t){return e._trigger("sortRequest",t.event,t.ui)}),this.grid.addListener("expandRequest",function(t){return e._trigger("expandRequest",t.event,t)}),this.grid.addListener("collapseRequest",function(t){return e._trigger("collapseRequest",t.event,t)}),this.grid.addListener("keydown",function(t){return e._trigger("keydown",t.event,t.ui)}),this.grid.addListener("ready",function(){e._trigger("ready",null,{})}),this.grid.addListener("scroll",function(t){e._trigger("scroll",t.event,t.ui)}),this.grid.addListener("beforeEdit",function(t){return e._trigger("beforeEdit",t.event,t.ui)}),this.grid.addListener("beforeEditEnd",function(t){return e._trigger("beforeEditEnd",t.event,t.ui)}),this.grid.addListener("cutRequest",function(t){return e._trigger("cutRequest",t.event,t.ui)}),this.grid.addListener("copyRequest",function(t){return e._trigger("copyRequest",t.event,t.ui)}),this.grid.addListener("pasteRequest",function(t){return e._trigger("pasteRequest",t.event,t.ui)}),this.grid.addListener("fillRequest",function(t){return e._trigger("fillRequest",t.event,t.ui)})},refresh:function(){this._super();let e=!this._IsCustomElement()||null!=this._defaultContextMenu;e?this._ReleaseResources():this.releaseResources(),this._removeAllChildren(),this._defaultContextMenu&&(this.options.contextMenu=null,this._defaultContextMenu=null),this._setDataSource(),null!=this.datasource&&(h.FlattenedTreeDataGridDataSource&&this.datasource instanceof h.FlattenedTreeDataGridDataSource&&(this.datasource.Destroy(),this.datasource.Init()),this.grid.SetDataSource(this.datasource),this._addContextMenu()),this.grid.SetOptions(this.options,this._WrapCustomElementRenderer.bind(this)),this.resources.setRTLMode(this._GetReadingDirection()),this.grid.SetResources(this.resources),e?this._SetupResources():this.setupResources(),this.grid.getVisibility()!==D.VISIBILITY_STATE_RENDER&&this.grid.setVisibility(D.VISIBILITY_STATE_REFRESH),this._possiblyRenderOrRefresh()},_updateScrollPositionOnRefresh:function(){var e,t=this.options.selection;if(null!=t&&0!==t.length){e={};var i=t[t.length-1];i&&(i.startKey?(e.rowKey=i.startKey.row,e.columnKey=i.startKey.column):i.startIndex&&(e.rowIndex=0,e.columnIndex=0))}else e={x:0,y:0};this.option("scrollPosition",e,{_context:{internalSet:!0},changed:!1})},_destroy:function(){C(this.root).removeAttr(c._OJ_CONTAINER_ATTR),null!=this.datasource&&this.datasource.Destroy&&this.datasource.Destroy(),this.grid.destroy(),this._unregisterResizeListener(this.root),C(this.root).empty(),this._MakeReady()},_setOptions:function(e,t){if(this.datasource){var i=this._handleOptionUpdate(e,t);this._super(e,t),"refresh"===i?this.refresh():"pass"===i&&this.grid.UpdateOptions(e,t)}else this._super(e,t),null!=e.data&&this.refresh()},_checkSelectionMode:function(e){var t=e.selectionMode;if(t&&t.row&&t.cell&&"none"!==t.row&&"none"!==t.cell)throw new Error("JET DataGrid does not support selectionMode on cell and row simultaneously.")},_NotifyShown:function(){this._super(),this._possiblyRenderOrRefresh()},_NotifyHidden:function(){this._super(),this.grid.getVisibility()===D.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(D.VISIBILITY_STATE_HIDDEN)},_NotifyAttached:function(){this._super(),this._possiblyRenderOrRefresh()&&this.grid._initiateScrollOnAttached()},_NotifyDetached:function(){this._super(),this.grid.getVisibility()===D.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(D.VISIBILITY_STATE_HIDDEN)},_handleOptionUpdate:function(e,t){for(var i="ignore",s=Object.keys(e),n=0;n<s.length;n++){switch(s[n]){case"bandingInterval":case"currentCell":case"editMode":case"gridlines":case"scrollPosition":case"selection":i="pass";break;case"beforeCurrentCell":case"beforeEdit":case"beforeEditEnd":case"cutRequest":case"copyRequest":case"pasteRequest":case"fillRequest":case"create":case"disabled":case"dnd":case"optionChange":case"ready":case"resize":case"rootAttributes":case"scroll":case"sort":break;case"selectionMode":this._checkSelectionMode(e),i="pass";break;case"cell":case"header":var o=t.subkey;if(null!=o){var r=o.split(".");if("resizable"===r[1]||"sortable"===r[1]){i="pass";break}}return"refresh";case"data":return this._updateScrollPositionOnRefresh(),"refresh";case"contextMenu":case"scrollPolicy":default:return"refresh"}}return i},_isResizeEnabled:function(e,t){return!(!this.options.header[e]||!this.options.header[e].resizable)&&"disable"!==this.options.header[e].resizable[t]},_isSortEnabled:function(e){return!!this.options.header[e]&&"disable"!==this.options.header[e].sortable},_removeAllChildren:function(){for(var e=this.root.children,t=e.length-1;t>=0;t--)"TEMPLATE"!==e[t].tagName&&"OJ-SURROGATE"!==e[t].tagName&&("OJ-MENU"!==e[t].tagName||"OJ-MENU"===e[t].tagName&&"contextMenu"!==e[t].slot)&&this._remove(e[t])},_GetDefaultContextMenu:function(){return this._defaultContextMenu},_addContextMenu:function(){var e=this,t=e._IsCustomElement(),i=this._GetContextMenu()?this._GetContextMenu():this._menuContainer;if(i){null==this._menuItemsSetByGrid&&(this._menuItemsSetByGrid=[]),this._menuContainer=i;var s=(i=C(i)).find("[data-oj-command]"),n=[];s.each(function(){var i=e._shouldUpdateListItem(this,t);if(i.shouldUpdate){var s=C(this).attr("data-oj-command").split("-");if(t){var o=e._getContextMenuText(s[s.length-1],t);i.itemToUpdate?(i.itemToUpdate.textContent=o,n.push(i.itemToUpdate)):(i.toFirstChild,this.textContent=o,n.push(this))}else{var r=C(e._buildContextMenuItem(s[s.length-1],t));C(this).replaceWith(r),n.push(r.children("a").get(0))}}}),this._menuItemsSetByGrid=n,i.data("oj-ojMenu")&&(t?i[0].refresh():i.ojMenu("refresh"))}else null!=this.datasource&&(i=this._createDefaultContextMenu())&&(this._defaultContextMenu=i[0]);i&&this._addMenuSelectListener(i)},_shouldUpdateListItem:function(e,t){var i,s=!1;if(t){if(null!=e.firstElementChild&&"opt"===e.firstElementChild.getAttribute("ojmenu")?(i=g.CustomElementUtils.getSlotMap(e.firstElementChild),s=!0):i=g.CustomElementUtils.getSlotMap(e),!i[""]||0===i[""].length)return{shouldUpdate:!0,toFirstChild:s};if(i[""]){var n=this._menuItemsSetByGrid.indexOf(e);if(-1!==n)return{shouldUpdate:!0,itemToUpdate:this._menuItemsSetByGrid[n]}}return{shouldUpdate:!1}}var o=C(e).children("a");return{shouldUpdate:0===o.length||-1!==this._menuItemsSetByGrid.indexOf(o.get(0))}},_addMenuSelectListener:function(e){var t=this._handleContextMenuSelect.bind(this);this._IsCustomElement()?e[0].addEventListener("ojAction",t):e.on("ojselect",t)},_createDefaultContextMenu:function(){let e,t,i,s,n,o,r=null,l=null,a=null;const h=this._IsCustomElement();o=h?this._createCustomElementContextMenu():this._createWidgetContextMenu(),(this._isResizeEnabled("column","height")||this._isResizeEnabled("row","height"))&&(r=this._buildContextMenuItem("resizeHeight",h)),(this._isResizeEnabled("column","width")||this._isResizeEnabled("row","width"))&&(l=this._buildContextMenuItem("resizeWidth",h)),(this._isResizeEnabled("column","width")||this._isResizeEnabled("column","height")||this._isResizeEnabled("row","width")||this._isResizeEnabled("row","height"))&&(a=this._buildContextMenuItem("resizeFitToContent",h));const d=this.datasource.getCapability("sort");if(this._isSortEnabled("column")&&("column"!==d&&"full"!==d||(e=this._buildContextMenuItem("sortCol",h))),this._isSortEnabled("row")&&("row"!==d&&"full"!==d||(t=this._buildContextMenuItem("sortRow",h))),"enable"===this.options.dnd.reorder.row)switch(this.datasource.getCapability("move")){case"none":break;default:h?(s=new DocumentFragment,s.appendChild(this._buildContextMenuOjOption("cut")),s.appendChild(this._buildContextMenuOjOption("paste")),s.appendChild(this._buildContextMenuDivider())):(s=new DocumentFragment,s.appendChild(this._buildContextMenuListItem("cut")),s.appendChild(this._buildContextMenuListItem("paste")))}let c=[];if(c=Object.keys(this.options.dataTransferOptions).filter(e=>"enable"===this.options.dataTransferOptions[e]),c.length){let e=this.options.dataTransferOptions;n=new DocumentFragment,h?("enable"===e.cut&&n.appendChild(this._buildContextMenuOjOption("cutCells")),"enable"===e.copy&&n.appendChild(this._buildContextMenuOjOption("copyCells")),"enable"===e.paste&&n.appendChild(this._buildContextMenuOjOption("pasteCells")),"enable"===e.fill&&n.appendChild(this._buildContextMenuOjOption("autoFill")),n.appendChild(this._buildContextMenuDivider())):("enable"===e.cut&&n.appendChild(this._buildContextMenuListItem("cutCells")),"enable"===e.copy&&n.appendChild(this._buildContextMenuListItem("copyCells")),"enable"===e.paste&&n.appendChild(this._buildContextMenuListItem("pasteCells")),"enable"===e.fill&&n.appendChild(this._buildContextMenuListItem("autoFill")))}return this._isMultipleSelection()&&_.isTouchSupported()&&(this._discontiguousSelection=!1,h?(i=document.createElement("oj-menu-select-many"),i.setAttribute("data-oj-binding-provider","none"),i.appendChild(this._buildContextMenuOjOption("discontiguousSelection"))):i=this._buildContextMenuListItem("discontiguousSelection")),r||l||a||e||t||s||i||n?(n&&o.appendChild(n),r&&o.appendChild(r),l&&o.appendChild(l),a&&o.appendChild(a),(e||t)&&((r||l||a)&&o.appendChild(this._buildContextMenuDivider()),e&&o.appendChild(e),t&&o.appendChild(t)),s&&((r||l||a||e||t)&&o.appendChild(this._buildContextMenuDivider()),o.appendChild(s)),i&&((r||l||a||e||t||s)&&o.appendChild(this._buildContextMenuDivider()),o.appendChild(i)),h||C(o).ojMenu(),this.option("contextMenu",o,{_context:{internalSet:!0}}),C(o)):null},_createCustomElementContextMenu:function(e){const t=document.createElement("oj-menu");t.setAttribute("data-oj-binding-provider","none"),t.style.display="none";let i=e?"contextsubmenu":"contextmenu";return t.setAttribute("id",this.rootId+i),e||this.root.appendChild(t),t},_createWidgetContextMenu:function(e){const t=document.createElement("ul");let i=e?"contextsubmenu":"contextmenu";return t.setAttribute("id",this.rootId+i),t.style.display="none",e||this.root.appendChild(t),t},_buildContextMenuItem:function(e,t){if(t){if("resize"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("resizeRow")),e.appendChild(this._buildContextMenuOjOption("resizeColumn")),e}if("sortCol"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("sortColAsc")),e.appendChild(this._buildContextMenuOjOption("sortColDsc")),e}if("sortRow"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("sortRowAsc")),e.appendChild(this._buildContextMenuOjOption("sortRowDsc")),e}if(-1!==Object.keys(this.resources.commands).indexOf(e))return this._buildContextMenuOjOption(e)}else{if("resize"===e){const e=this._buildContextMenuListItem("resize"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("resizeWidth")),t.appendChild(this._buildContextMenuListItem("resizeHeight")),e.appendChild(t),e}if("sortCol"===e){const e=this._buildContextMenuListItem("sortCol"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("sortColAsc")),t.appendChild(this._buildContextMenuListItem("sortColDsc")),e.appendChild(t),e}if("sortRow"===e){const e=this._buildContextMenuListItem("sortRow"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("sortRowAsc")),t.appendChild(this._buildContextMenuListItem("sortRowDsc")),e.appendChild(t),e}if(-1!==Object.keys(this.resources.commands).indexOf(e))return this._buildContextMenuListItem(e)}},_buildContextMenuOjOption:function(e){const t=document.createElement("oj-option");let i;if(t.setAttribute("data-oj-command",this._getMappedCommand(e)),-1!==["cutCells","copyCells","pasteCells"].indexOf(e)){i=document.createElement("span");let t=e.indexOf("Cells"),s=e.slice(0,t);i=document.createElement("span"),i.setAttribute("slot","startIcon"),i.setAttribute("class","oj-ux-ico-"+s)}return t.textContent=this._getContextMenuText(e),i&&t.appendChild(i),t},_buildContextMenuDivider:function(){const e=document.createElement("oj-option");return e.textContent="---",e},_buildContextMenuListItem:function(e){const t=document.createElement("li");return t.setAttribute("data-oj-command",this._getMappedCommand(e)),t.appendChild(this._buildContextMenuLabel(e)),t},_getContextMenuText:function(e){var t=this._IsCustomElement();t&&"discontiguousSelection"===e&&(e="SelectMultiple"),"resizeWidth"===e?e="resizeColumn":"resizeHeight"===e&&(e="resizeRow");let i="label"+e.charAt(0).toUpperCase()+e.slice(1);return t||"discontiguousSelection"!==e||(i="labelEnableNonContiguous"),this._getTranslation(i)},_buildContextMenuLabel:function(e){const t=this._getContextMenuText(e),i=document.createElement("a");return i.setAttribute("href","#"),i.textContent=t,i},_getDataGridContextMenu:function(){return this._GetContextMenu()||this._GetDefaultContextMenu()},_getTranslation:function(e,t){return this.getTranslatedString(e,t)},_handleResizeDialog:function(e){var t,i;this._IsCustomElement()?(t=document.getElementById(this.rootId+"inputNumber").value,i=document.getElementById(this.rootId+"modal").getAttribute("dimension"),document.getElementById(this.rootId+"modal").close()):(t=C("#"+this.rootId+"inputNumber").ojInputNumber("option","value"),C("#"+this.rootId+"modal").ojDialog("close")),this.grid.handleContextMenuReturn(this.contextMenuEvent,this._getMappedCommand(i),t),this.contextMenuEvent.target.focus()},_buildResizeDialog:function(e,t,i){var s,n,o,r,l,a,h,d,c,u=this._IsCustomElement(),_=this;if(u)if(s=document.getElementById(this.rootId+"inputNumber"),null===(o=document.getElementById(this.rootId+"modal"))||null===s){(o=document.createElement("oj-dialog")).id=this.rootId+"modal",o.setAttribute("data-oj-binding-provider","none"),o.setAttribute("initial-focus","firstFocusable"),o.className=this._getMappedStyle("resizeDialog"),(r=document.createElement("div")).setAttribute("slot","header"),(l=document.createElement("div")).setAttribute("slot","body"),(a=document.createElement("div")).setAttribute("slot","footer"),(c=document.createElement("h5")).textContent=e,r.appendChild(c),r.className=this._getMappedStyle("dialogTitle"),o.appendChild(r),o.appendChild(l),o.appendChild(a),(s=document.createElement("oj-input-number")).id=this.rootId+"inputNumber",s.setAttribute("label-edge","inside"),s.setAttribute("user-assistance-density","efficient"),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dimension","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dimension","resizeHeight")),o.setAttribute("title",e),(h=document.createElement("oj-button")).id=this.rootId+"modalcancel",h.style.margin="5px",(d=document.createElement("oj-button")).id=this.rootId+"modalsubmit",d.style.margin="5px",d.setAttribute("chroming","callToAction"),l.appendChild(s),a.appendChild(h),a.appendChild(d),this.root.appendChild(o),h.textContent=this._getTranslation("labelResizeDialogCancel"),d.textContent=this._getTranslation("labelResizeDialogApply"),n=function(){d.disabled=!1,s.value=0,o.close()},h.addEventListener("click",n),d.addEventListener("click",this._handleResizeDialog.bind(this)),s.setAttribute("max",2e3),s.setAttribute("min",20),s.setAttribute("step",1),s.setAttribute("value",t),s.setAttribute("display-options",'{"converterHint": "none", "validatorHint": "none"}'),s.addEventListener("validChanged",function(e){"valid"===e.detail.value?d.disabled=!1:d.disabled=!0});o.setAttribute("position",JSON.stringify({my:{horizontal:"center",vertical:"center"},at:{horizontal:"center",vertical:"center"},collision:"none"})),m.getContext(o).getBusyContext().whenReady().then(function(){o.open(_.root)})}else s.setAttribute("max",2e3),s.setAttribute("min",20),s.setAttribute("step",1),s.setAttribute("value",t),s.setAttribute("label-edge","inside"),s.setAttribute("user-assistance-density","efficient"),s.setAttribute("display-options",'{"converterHint": "none", "validatorHint": "none"}'),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dimension","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dimension","resizeHeight")),o.setAttribute("dialog-title",e),o.open(_.root);else o=C("#"+this.rootId+"modal"),s=C("#"+this.rootId+"inputNumber"),0===o.length||0===s.length?((o=document.createElement("div")).id=this.rootId+"modal",r=document.createElement("div"),l=document.createElement("div"),a=document.createElement("div"),r.className=this._getMappedStyle("dialogTitle"),o.appendChild(r),o.appendChild(l),o.appendChild(a),(c=document.createElement("h5")).textContent=e,r.appendChild(c),(s=document.createElement("input")).id=this.rootId+"inputNumber",s.setAttribute("label-edge","inside"),(h=document.createElement("oj-button")).id=this.rootId+"modalcancel",h.style.margin="5px",(d=document.createElement("oj-button")).id=this.rootId+"modalsubmit",d.style.margin="5px",l.appendChild(s),a.appendChild(h),a.appendChild(d),this.root.appendChild(o),C(h).ojButton({component:"ojButton",label:this._getTranslation("labelResizeDialogCancel")}),C(d).ojButton({component:"ojButton",label:this._getTranslation("labelResizeDialogApply")}),n=function(){C(d).ojButton({disabled:!1}),C(s).ojInputNumber({value:0}),C(o).ojDialog("close")},h.addEventListener("click",n),d.addEventListener("click",this._handleResizeDialog.bind(this)),C(s).ojInputNumber({component:"ojInputNumber",max:1e3,min:20,step:1,value:t}),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dialog-title","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dialog-title","resizeHeight")),C(s).on("change",function(){C(d).ojButton({disabled:!C(s).ojInputNumber("validate")})}),C(o).ojDialog({initialFocus:"firstFocusable",position:{my:"center center",at:"center center",collision:"none",of:C(this.root)}}),C(o).ojDialog("open")):(s.ojInputNumber("option","value",t),s.setAttribute("label-edge","inside"),o.find("."+this._getMappedStyle("dialogTitle"))[0].firstChild.textContent=e,o.ojDialog("open"))},_handleContextMenuSelect:function(e,t){var i;if(i=t?t.item:C(e.target),this.menuItemFunction=i.attr("data-oj-command"),this.menuItemFunction===this._getMappedCommand("sortColAsc")||this.menuItemFunction===this._getMappedCommand("sortColDsc")||this.menuItemFunction===this._getMappedCommand("sortRowAsc")||this.menuItemFunction===this._getMappedCommand("sortRowDsc")||this.menuItemFunction===this._getMappedCommand("cut")||this.menuItemFunction===this._getMappedCommand("paste")||this.menuItemFunction===this._getMappedCommand("cutCells")||this.menuItemFunction===this._getMappedCommand("pasteCells")||this.menuItemFunction===this._getMappedCommand("copyCells")||this.menuItemFunction===this._getMappedCommand("autoFill"))this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,null);else if(this.menuItemFunction===this._getMappedCommand("resizeWidth")||this.menuItemFunction===this._getMappedCommand("resizeHeight")){var s=C(this.contextMenuEvent.target).closest("."+this._getMappedStyle("cell"));if(0===s.length&&(s=C(this.contextMenuEvent.target).closest("."+this._getMappedStyle("headercell"))),0===s.length&&(s=C(this.contextMenuEvent.target).closest("."+this._getMappedStyle("endheadercell"))),0===s.length&&(s=C(this.contextMenuEvent.target).closest("."+this._getMappedStyle("headerlabel"))),s.length>0){var n=this.menuItemFunction===this._getMappedCommand("resizeWidth")?s.outerWidth():s.outerHeight(),o=this.menuItemFunction===this._getMappedCommand("resizeWidth")?"width":"height",r="width"===o?this._getTranslation("resizeColumnDialog"):this._getTranslation("resizeRowDialog");this._buildResizeDialog(r,n,o)}}else if(this.menuItemFunction===this._getMappedCommand("resizeFitToContent"))this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,null);else if(this.menuItemFunction===this._getMappedCommand("discontiguousSelection")){let e;this._discontiguousSelection=!this._discontiguousSelection,this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,this._discontiguousSelection);e=this._IsCustomElement()?"labelSelectMultiple":this._discontiguousSelection?"labelDisableNonContiguous":"labelEnableNonContiguous",i.children().first().text(this._getTranslation(e))}},_NotifyContextMenuGesture:function(e,t,i){this.grid.handleContextMenuGesture(t,i,this._contextMenuGestureCallback.bind(this))},_contextMenuGestureCallback:function(e,t,i){if(null!=e){this.contextMenuEvent=t.originalEvent;var s=e.launcher,n=e.capabilities;this._manageContextMenu(n);var o="keyboard"===i?{position:{of:s},launcher:C(s)}:{launcher:C(s)};_.isTouchSupported()&&this.grid.m_databodyReorder||this._OpenContextMenu(t,i,o)}},_addContextMenuCapability:function(e){var t=C(this._getDataGridContextMenu());this._IsCustomElement()?t.find("[data-oj-command="+e+"]").attr("disabled")||t.find("[data-oj-command="+e+"]").attr("disabled",!0):t.find("[data-oj-command="+e+"]").hasClass("oj-disabled")||t.find("[data-oj-command="+e+"]").addClass("oj-disabled")},_removeContextMenuCapability:function(e){C(this._getDataGridContextMenu()).find("[data-oj-command="+e+"]").removeClass("oj-disabled").attr("disabled",!1)},_manageContextMenu:function(e){for(var t=Object.keys(e),i=0;i<t.length;i++){var s=t[i],n=this.resources.getMappedCommand(s);"disable"===e[s]?this._addContextMenuCapability(n):this._removeContextMenuCapability(n)}},_findCellIndex:function(e){return e[this._getMappedAttribute("context")].indexes},_setDataSource:function(){null!=this.options.data?this.options.data.fetchByOffset&&!this.options.data.fetchFirst?(null!=this.datasource&&this.datasource.Destroy&&this.datasource.Destroy(),this.datasource=new A(this.options.data)):h.DataProviderFeatureChecker.isDataProvider(this.options.data)?(this.datasource=new S(this.options.data),"randomAccess"!==this.options.data.getCapability("fetchByOffset").implementation&&"scroll"===this.options.scrollPolicy&&(y.error("oj.DataProvider does not support fetchByOffset and scrollPolicy is set to scroll. scrollPolicy will fall back to auto."),this.options.scrollPolicy="auto")):this.datasource=this.options.data:this.datasource=null},_setSelection:function(){var e=this.options.selection;null!=e&&this.grid.SetSelection(e)},_modifyContext:function(e){e.component=c.__GetWidgetConstructor(this.element,"ojDataGrid")},_setAccessibleContext:function(e){this.grid.SetAccessibleContext(e)},_unregisterResizeListener:function(e){e&&this._resizeHandler&&(_.removeResizeListener(e,this._resizeHandler),this._resizeHandler=null)},_registerResizeListener:function(e){e&&(null==this._resizeHandler&&(this._resizeHandler=this._handleResize.bind(this)),_.addResizeListener(e,this._resizeHandler))},_handleResize:function(e,t){e>0&&t>0&&(this._possiblyRenderOrRefresh(),this.grid.HandleResize(e,t))},getNodeBySubId:function(e){var t;if(null==e)return this.element?this.element[0]:null;var i=e.subId;if("oj-datagrid-cell"===i){var s=e.rowIndex,n=e.columnIndex;t=C(this.grid._getCellByIndex({row:s,column:n}))}else if("oj-datagrid-sort-icon"===i||"oj-datagrid-sort-ascending"===i||"oj-datagrid-sort-default"===i||"oj-datagrid-sort-descending"===i||"oj-datagrid-header"===i){var o,r=e.axis,l=e.index,a=null==e.level?0:e.level;if("column"===r?o=this._getHeaderByIndex(l,a,C(document.getElementById(this.rootId+":columnHeader")),this.grid.getStartColumnHeader()):"row"===r?o=this._getHeaderByIndex(l,a,C(document.getElementById(this.rootId+":rowHeader")),this.grid.getStartRowHeader()):"columnEnd"===r?o=this._getHeaderByIndex(l,a,C(document.getElementById(this.rootId+":columnEndHeader")),this.grid.getStartColumnEndHeader()):"rowEnd"===r&&(o=this._getHeaderByIndex(l,a,C(document.getElementById(this.rootId+":rowEndHeader")),this.grid.getStartRowEndHeader())),null==o)return null;if("oj-datagrid-sort-icon"===i)return o.children("."+this._getMappedStyle("sortIcon")).children().get(0);t="oj-datagrid-sort-ascending"===i?o.find("."+this._getMappedStyle("sortascending")):"oj-datagrid-sort-default"===i?o.find("."+this._getMappedStyle("sortdefault")):"oj-datagrid-sort-descending"===i?o.find("."+this._getMappedStyle("sortdescending")):o}else"oj-datagrid-header-label"===i&&(t=C(this.grid._getLabel(e.axis,e.level)));return null!=t&&t.length>0?t[0]:null},getSubIdByNode:function(e){var t,i=C(e).closest("."+this._getMappedStyle("cell"));if(i.length>0){var s=this._findCellIndex(i[0]);return{subId:"oj-datagrid-cell",rowIndex:s.row,columnIndex:s.column}}var n=C(e).closest("."+this._getMappedStyle("headercell"));if(0===n.length&&(n=C(e).closest("."+this._getMappedStyle("endheadercell"))),n.length>0)return t=n[0][this._getMappedAttribute("context")],{subId:C(e).hasClass(this._getMappedStyle("sortascending"))?"oj-datagrid-sort-ascending":C(e).hasClass(this._getMappedStyle("sortdefault"))?"oj-datagrid-sort-default":C(e).hasClass(this._getMappedStyle("sortdescending"))?"oj-datagrid-sort-descending":"oj-datagrid-header",axis:t.axis,index:this._getHeaderIndex(n),level:t.level};var o=C(e).closest("."+this._getMappedStyle("headerlabel"));return o.length>0?{subId:"oj-datagrid-header-label",axis:(t=o[0][this._getMappedAttribute("context")]).axis,level:t.level}:null},getContextByNode:function(e){var t,i,s=C(e).closest("."+this._getMappedStyle("cell"));if(s.length>0)return t=s[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-cell",i;var n=C(e).closest("."+this._getMappedStyle("headercell"));if(0===n.length&&(n=C(e).closest("."+this._getMappedStyle("endheadercell"))),n.length>0)return t=n[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-header",i.index=this._getHeaderIndex(n),i;var o=C(e).closest("."+this._getMappedStyle("headerlabel"));return o.length>0?(t=o[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-header-label",i):null},_getMappedStyle:function(e){return this.resources.getMappedStyle(e)},_getMappedAttribute:function(e){return this.resources.getMappedAttribute(e)},_getMappedCommand:function(e){return this.resources.getMappedCommand(e)},_isDataGridSizingAvailable:function(){return null!=this.root.offsetParent},_possiblyRenderOrRefresh:function(){var e=this.grid.getVisibility(),t=!1;return this._isDataGridSizingAvailable()?(e===D.VISIBILITY_STATE_RENDER?(this.grid.render(this.root),t=!0):e===D.VISIBILITY_STATE_REFRESH&&(this.grid.refresh(this.root),t=!0),this.grid.setVisibility(D.VISIBILITY_STATE_VISIBLE)):e===D.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(D.VISIBILITY_STATE_HIDDEN),t},_getHeaderByIndex:function(e,t,i,s){if(t<0)return null;var n=i.children().first().children().last();if(n.hasClass(this._getMappedStyle("headercell")))return i.children().first().children("."+this._getMappedStyle("headercell")).eq(e-s);if(n.hasClass(this._getMappedStyle("endheadercell")))return i.children().first().children("."+this._getMappedStyle("endheadercell")).eq(e-s);var o=this._getGroupingContainer(e,t,0,i.children().first().children());if(null==o)return null;if(t<=parseInt(o.attr(this._getMappedAttribute("level")),10)+parseInt(o.children().eq(0).attr(this._getMappedAttribute("depth")),10)-1)return o.children().eq(0);var r=e-(s=parseInt(o.attr(this._getMappedAttribute("start")),10))+1;return o.children().eq(r)},_getGroupingContainer:function(e,t,i,s){if(null==s.eq(1)||s.eq(1).hasClass(this._getMappedStyle("headercell"))||s.eq(1).hasClass(this._getMappedStyle("endheadercell")))return t===i?s.eq(0).parent():null;var n,o=s.parent().parent();for(n=o.hasClass(this._getMappedStyle("header"))||o.hasClass(this._getMappedStyle("endheader"))?0:1;n<s.length;n++){var r=parseInt(s.eq(n).attr(this._getMappedAttribute("start")),10),l=parseInt(s.eq(n).attr(this._getMappedAttribute("extent")),10),a=parseInt(s.eq(n).children().eq(0).attr(this._getMappedAttribute("depth")),10);if(e>=r&&e<r+l)return t<i+a?s.eq(n):this._getGroupingContainer(e,t,i+a,s.eq(n).children())}return null},_getHeaderIndex:function(e){var t;if(e.parent().hasClass(this._getMappedStyle("groupingcontainer"))){if(t=parseInt(e.parent().attr(this._getMappedAttribute("start")),10),e.get(0)===e.parent().children(":first").get(0))return t;t-=1}else t=e.hasClass(this._getMappedStyle("rowheadercell"))?this.grid.getStartRowHeader():e.hasClass(this._getMappedStyle("colheadercell"))?this.grid.getStartColumnHeader():e.hasClass(this._getMappedStyle("colendheadercell"))?this.grid.getStartColumnEndHeader():this.grid.getStartRowEndHeader();return t+=e.index()},_isMultipleSelection:function(){return null!=this.options.selectionMode&&("multiple"===this.options.selectionMode.row||"multiple"===this.options.selectionMode.cell)},_remove:function(e){null!=e&&(this.grid._cleanTemplateNodes(e),C(e).remove())},_uniqueId:function(e,t){t?C(e).removeUniqueId():C(e).uniqueId()},_compareValues:function(e,t){return h.Object.compareValues(e,t)},scrollTo:function(e){this.grid.scroll(e)},whenReady:function(){if(this._ready)return Promise.resolve(!0);if(!this._readyPromise){var e=this;this._readyPromise=new Promise(function(t){e._readyPromiseResolve=t})}return this._readyPromise},_NotReady:function(){if(this._ready=!1,!this._readyResolveFunc){var e=m.getContext(this.element[0]).getBusyContext(),t={description:"The component identified by '"+this.element.attr("id")+"' is being loaded."};this._readyResolveFunc=e.addBusyState(t)}},_MakeReady:function(){this._readyPromiseResolve&&(this._readyPromiseResolve(!0),this._readyPromiseResolve=null),this._ready=!0,this._readyPromise=null,this._readyResolveFunc&&(this._readyResolveFunc(),this._readyResolveFunc=null)},_CompareOptionValues:function(e,t,i){switch(e){case"currentCell":case"selection":return h.Object.compareValues(t,i);default:return this._super(e,t,i)}}}),D.prototype.unhighlightFloodFillRange=function(e){null==e&&(e=this.GetFloodFillRange()[0]),null!=e&&this._applyBorderClassesAroundRange(this.getElementsInRange(e),e,!1,"Floodfill")},D.prototype.highlightFloodFillRange=function(e){this._applyBorderClassesAroundRange(this.getElementsInRange(e),e,!0,"Floodfill")},D.prototype.handleDatabodyFloodFillDrag=function(e){var t=e.target,i=this.findCell(t);if(null!=i){var s=this.getCellIndexes(i);this.extendFloodFillSelection(s,e)}},D.prototype.GetFloodFillRange=function(){return null==this.m_floodFillRange&&(this.m_floodFillRange=[]),this.m_floodFillRange},D.prototype.extendFloodFillSelection=function(e,t){if("header"===this.m_active.type)return;var i;if(null==(i={row:this.m_active.indexes.row,column:this.m_active.indexes.column}))return;let s,n=!1;s||(s=this.m_selection);let o,r=s[0].startIndex,l=s[0].endIndex;e.row>=r.row&&e.row<=l.row&&(n=!0,e.column>l.column?o="right":e.column<r.column&&(o="left"),e.row=l.row);let a=!1;e.column>=r.column&&e.column<=l.column&&(a=!0,e.row>l.row?o="bottom":e.row<r.row&&(o="top"));let h=r.row===l.row,d=r.column===l.column;if(h&&e.row===r.row&&a||d&&e.column===r.column&&n)return this.unhighlightFloodFillRange(),void(this.m_floodFillRange=[]);if((!n&&!a||e.column<=l.column&&!n)&&(e.column=l.column),n||a||(e.row>l.row?o="bottom":e.row<r.row&&(o="top")),o){let s=r,n=e;this._createRangeWithKeys(s,n,this._extendFloodFillSelectionCallback.bind(this,t,i,o))}else this.unhighlightFloodFillRange()},D.prototype._extendFloodFillSelectionCallback=function(e,t,i,s){let n=s;"top"===i?n.endIndex.row-=1:"bottom"===i?n.startIndex.row=this.m_selectionRange[0].endIndex.row+1:"left"===i?n.endIndex.column-=1:n.startIndex.column=this.m_selectionRange[0].endIndex.column+1;let o=[];this.unhighlightFloodFillRange(),o.push(n),this.m_floodFillRange=o,this.m_floodFillDirection="flood",this.highlightFloodFillRange(n)},D.prototype._addFloodfillAffordance=function(e){if(null==this.m_bottomFloodFillIconContainer){var t=e.target,i=this.findCell(t);if(i||(i=this.findHeader(t)),!i)return;this._attachFloodFillIcon()}},D.prototype._attachFloodFillIcon=function(){this.m_bottomFloodFillIconContainer=document.createElement("div"),this.m_bottomFloodFillIconContainer.className=this.getMappedStyle("toucharea");var e=document.createElement("div");e.className=this.getMappedStyle("floodfillaffordance"),e.setAttribute("role","button"),this.m_bottomFloodFillIconContainer.appendChild(e),this.m_databody.firstChild.appendChild(this.m_bottomFloodFillIconContainer),this.m_floodFillAffordanceHeight=this.m_bottomFloodFillIconContainer.firstElementChild.offsetHeight,this.m_floodFillAffordanceWidth=this.m_bottomFloodFillIconContainer.firstElementChild.offsetWidth,this.m_options.isFloodFillEnabled()&&(this.m_bottomFloodFillIconContainer.addEventListener("mouseover",this.handleFloodFillAffordanceMouseOver.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mousedown",this.handleFloodFillAffordanceMouseDown.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mouseup",this.handleFloodFillAffordanceMouseUp.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mouseleave",this.handleFloodFillAffordanceMouseLeave.bind(this)))},D.prototype.handleFloodFillAffordanceMouseOver=function(e){0===e.buttons&&(this.m_databody.style.cursor="crosshair",this.m_cursor="crosshair")},D.prototype.handleFloodFillAffordanceMouseDown=function(){this.m_databodyDragState=!0,this.m_floodFillDragState=!0,this.m_selectionRange=null,this.m_floodFillRange=null,this.m_databody.style.cursor="crosshair",this.m_cursor="crosshair"},D.prototype.handleFloodFillAffordanceMouseUp=function(){this.m_databodyDragState=!1,this.m_floodFillDragState=!1,this.m_databody.style.cursor="default",this.m_cursor="default",this.m_selectionRange=null,this.m_floodFillRange=null},D.prototype.handleFloodFillAffordanceMouseLeave=function(e){0===e.buttons&&(this.m_databodyDragState=!1,this.m_floodFillDragState=!1,this.m_databody.style.cursor="default",this.m_cursor="default")},D.prototype._removeFloodFillAffordance=function(){this._isDatabodyCellActive()&&this.m_bottomFloodFillIconContainer&&this.m_bottomFloodFillIconContainer.parentNode&&(this.m_databody.style.cursor="default",this.m_cursor="default",this.m_bottomFloodFillIconContainer.parentNode.removeChild(this.m_bottomFloodFillIconContainer))},D.prototype._moveFloodFillAffordance=function(){var e=this.getResources().isRTLMode()?"right":"left",t=this.GetSelection();if(t.length>0){var i=this._getTouchSelectionAffordanceSize();if(null!=this.m_bottomFloodFillIconContainer){var s=this._getCellByIndex(t[t.length-1].endIndex);s?(this.setElementDir(this.m_bottomFloodFillIconContainer,this.getElementDir(s,"top")+this.getElementHeight(s)-i+this.m_floodFillAffordanceHeight+1,"top"),this.setElementDir(this.m_bottomFloodFillIconContainer,this.getElementDir(s,e)+this.getElementWidth(s)-(i-this.m_floodFillAffordanceWidth)+1,e),this.m_databody.firstChild.appendChild(this.m_bottomFloodFillIconContainer)):this._removeFloodFillAffordance()}}},D.prototype.handleDragStart=function(e){let t,i=e.target,s=this.findHeader(i);if(s){let i=this.getHeaderCellAxis(s),n=this.getHeaderCellLevel(s),o=this.getHeaderCellIndex(s);if(this.m_options._isDragEnabled(i)){let r,l,a,h=this.m_selection,d=0,c=0,m=1,u=this.m_options.options.dnd.drag,_="row"===i||"rowEnd"===i?u.rows.dataTypes:u.columns.dataTypes,p="row"===i||"rowEnd"===i?"rows":"columns",g=[],f=[],C=[],y=JSON.parse(JSON.stringify(h));y.sort((e,t)=>e.startIndex[i]<t.startIndex[i]?-1:1),"row"===i||"rowEnd"===i?(a=-1!==this.m_endRowEndHeader,this.m_rowHeader&&(r=this.m_rowHeaderLevelCount-1),this.m_rowEndHeader&&(l=this.m_rowEndHeaderLevelCount-1)):(a=-1!==this.m_endColEndHeader,this.m_colHeader&&(r=this.m_columnHeaderLevelCount-1),this.m_endColHeader&&(l=this.m_columnEndHeaderLevelCount-1));let v="row"===i||"rowEnd"===i?"row":"column";[g,f]=this._getHeadersInSelection(n,y,v,a),g&&g[r]&&C.push(...g[r]),f&&f[l]&&C.push(...f[l]),[t,m,d,c]=this._getCellsForDndContainer(v,y,C,m),this._cellsDragged=t,this.m_dragIndex=o,this.m_dragHeader=s,this._setDragRowsData(e,_);const E=this.m_utils.containsCSSClassName(s,this.getMappedStyle("endheadercell"));this._setDragImage(e,v,t,d,c,m,E,g,f);for(let e=0;e<h.length;e++){let t=this.getElementsInRange(h[e]);for(let e=0;e<t.length;e++)this._highlightElement(t[e],["dragSourceOpaque"]);this._applyBorderClassesAroundRange(t,h[e],!1,"Selected")}const w=s[[this.getResources().getMappedAttribute("context")]];"expanded"===w.metadata.expanded&&null!==w.metadata.treeDepth&&this._disableChildElements(i);let S={range:y,axis:v};return this._invokeDndCallback("drag",p,"dragStart",e,S)}e.preventDefault()}},D.prototype._getHeadersInSelection=function(e,t,i){let s={},n={};for(let o=0;o<t.length;o++){let r=[...this.getHeadersByRange(t[o],i)];for(let e=r.length-1;e>=0;e--)this.m_utils.containsCSSClassName(r[e],this.getMappedStyle("selected"))||r.splice(e,1);[s,n]=this._getHeadersUnderLevel(e,r,i,s,n)}return[s,n]},D.prototype._getHeadersUnderLevel=function(e,t,i,s,n){let o="row"===i?this.m_rowHeaderLevelCount:this.m_columnHeaderLevelCount,r="row"===i?this.m_rowEndHeaderLevelCount:this.m_columnEndHeaderLevelCount;for(let i=0;i<t.length;i++){let l=this.getHeaderCellLevel(t[i]);const a=this.m_utils.containsCSSClassName(t[i],this.getMappedStyle("endheadercell"));a?a&&(n[l]||(n[l]=[]),(r>1&&l>=e||1===r)&&n[l].push(t[i])):(s[l]||(s[l]=[]),(o>1&&l>=e||1===o)&&s[l].push(t[i]))}return[s,n]},D.prototype.handleRowDragEnd=function(e){return this._destroyDragImage(),this._unhighlightDragSource(),this._removeDropTargetLine("row"),this._removeDropTargetClass(),this._enableChildElements(),this.m_databodyReorder=!1,this._removeDragStyle("row"),this._invokeDndCallback("drag","rows","dragEnd",e,this._cellsDragged)},D.prototype.handleRowDragOver=function(e){this.m_databodyReorder=!0;let t=this._getOverIndex(e,"row"),i=-1===t?0:t,s=this.getResources().isRTLMode()?"right":"left",n=this._getHeaderByIndex(i,this.m_rowHeaderLevelCount,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),o=this._isHeaderWithinSelection(n,"row");if(void 0!==t&&this.m_dragIndex!==t){let r;if(this.m_utils.containsCSSClassName(n,this.getMappedStyle("disabledElement")))this._removeDropTargetLine("row"),this._removeDropTargetClass(),this.m_dropRowIndex=null;else{let l=this._getRelativePosition(e,"row",n,!0),a=this._getDropContext(e,this.m_dropRowIndex,"row");if(r=this._invokeDropCallback("rows","dragOver",e,a),(!1===r||e.defaultPrevented)&&(this._removeDropTargetLine("row"),this._removeDropTargetClass(),!o))if("inside"===l)this._highlightElement(n,["dropTarget"]),this._highlightCellsAlongAxis(t,"row","index","add",["dropTarget"]);else{let e=this.getElementDir(n,"top");e+=-1===t?0:this.getElementHeight(n),this._addDropTargetLine("row",e,s,0,i)}}return r}},D.prototype.handleDatabodyDragOver=function(e){let t;this.m_databodyReorder=!0,t=this._matchDragDataType(e,"rows")?"row":"column";let i=this._getOverIndex(e,t),s=this.getResources().isRTLMode()?"right":"left";if(i){let n=JSON.parse(JSON.stringify(i));-1===i[t]&&(n[t]=0);let o=this._getCellByIndex(n);if(o){let r,l=this._getRelativePosition(e,t,o,!1),a=this.m_utils.containsCSSClassName(o,"selected");if(this.m_utils.containsCSSClassName(o,this.getMappedStyle("disabledElement")))this._removeDropTargetLine(t),this._removeDropTargetClass(),"row"===t?this.m_dropRowIndex=null:this.m_dropColumnIndex=null;else if(r="row"===t?this._invokeDropCallback("rows","dragOver",e,{index:this.m_dropRowIndex,position:l,axis:"row"}):this._invokeDropCallback("columns","dragOver",e,{index:this.m_dropColumnIndex,position:l,axis:"column"}),(!1===r||e.defaultPrevented)&&(this._removeDropTargetLine(t),this._removeDropTargetClass(),!a)){let e;"inside"===l?this._highlightCellsAlongAxis(i,t,"index","add",["dropTarget"]):"row"===t?(e=this.getElementDir(o,"top"),e+=-1===i[t]?0:this.getElementHeight(o),this._addDropTargetLine(t,e,s,0,n)):(e=this.getElementDir(o,s),e+=-1===i[t]?0:this.getElementWidth(o),this._addDropTargetLine(t,0,s,e,n))}return r}}},D.prototype.handleDatabodyDrop=function(e){let t;t=this._matchDragDataType(e,"rows")?"row":"column";let i,s,n=this.getResources().isRTLMode()?"right":"left",o=e.target.getBoundingClientRect();this._destroyDragImage(),this._removeDropTargetLine(t),this._removeDropTargetClass();let r="after";if("row"===t){i=this.m_dropRowIndex,e.clientY-o.top<.4*o.height&&(r="before"),this.m_dropRowIndex=null,s={index:i,position:r,axis:"row"}}else{i=this.m_dropColumnIndex,Math.abs(e.clientX-o[n])<.4*o.width&&(r="before"),this.m_dropColumnIndex=null,s={index:i,position:r,axis:"column"}}this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==i&&this._invokeDropCallback(t+"s","drop",e,s)},D.prototype.handleRowDragEnter=function(e){if(this._getOverIndex(e,"row"),this.m_dropRowIndex){let t=this._getDropContext(e,this.m_dropRowIndex,"row");return this._invokeDropCallback("rows","dragEnter",e,t)}},D.prototype.handleDatabodyDragEnter=function(e){let t;t=this._matchDragDataType(e,"rows")?"row":"column";let i=this._getOverIndex(e,t);if(i){let s=JSON.parse(JSON.stringify(i));-1===i[t]&&(s[t]=0);let n=this._getCellByIndex(s);if(n){let s={index:i,position:this._getRelativePosition(e,t,n,!1),axis:t};if(this.m_dropRowIndex)return this._invokeDropCallback("rows","dragEnter",e,s)}}},D.prototype.handleRowDragLeave=function(e){let t=this._getDropContext(e,this.m_dropRowIndex,"row");var i=this._invokeDndCallback("drop","rows","dragLeave",e,t);return this.m_dropRowIndex=null,i},D.prototype.handleRowDrag=function(e){return!this.m_dragImageAttached&&this.m_utils.isTouchDevice()&&(document.body.appendChild(this.m_dndContainer),this.m_dragImageAttached=!0),this._invokeDndCallback("drag","rows","drag",e)},D.prototype.handleRowDrop=function(e){let t=this.m_dropRowIndex;if(this._destroyDragImage(),this._removeDropTargetLine("row"),this._removeDropTargetClass(),this.m_dropRowIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==t){let i=this._getDropContext(e,t,"row");this._invokeDropCallback("rows","drop",e,i)}},D.prototype.handleColumnDragEnd=function(e){return this._destroyDragImage(),this._unhighlightDragSource(),this._removeDragStyle("column"),this._removeDropTargetLine("column"),this._removeDropTargetClass(),this._enableChildElements(),this._invokeDndCallback("drag","columns","dragEnd",e)},D.prototype.handleColumnDragOver=function(e){this.m_databodyReorder=!0;let t="column",i=this._getOverIndex(e,t),s=-1===i?0:i,n=this.getResources().isRTLMode()?"right":"left",o=this._getHeaderByIndex(s,this.m_columnHeaderLevelCount,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader);if(this.m_utils.containsCSSClassName(o,this.getMappedStyle("disabledElement")))this._removeDropTargetLine(t),this._removeDropTargetClass(),this.m_dropColumnIndex=null;else if(void 0!==i&&o){let r=this._getRelativePosition(e,t,o,!0),l={axis:"column",position:r,index:this.m_dropColumnIndex},a=this._invokeDropCallback("columns","dragOver",e,l);if(!1===a||e.defaultPrevented)if(this._removeDropTargetLine(t),this._removeDropTargetClass(),"inside"===r)this._highlightElement(o,["dropTarget"]),this._highlightCellsAlongAxis(i,t,"index","add",["dropTarget"]);else{let e=this.getElementDir(o,n);e+=-1===i?0:this.getElementWidth(o),this._addDropTargetLine(t,0,n,e,s)}return a}},D.prototype.handleColumnDragEnter=function(e){this._getOverIndex(e,"column");let t=this._getDropContext(e,this.m_dropColumnIndex,"column");return this._invokeDropCallback("columns","dragEnter",e,t)},D.prototype.handleColumnDragLeave=function(e){let t=this._getDropContext(e,this.m_dropColumnIndex,"column");var i=this._invokeDndCallback("drop","columns","dragLeave",e,t);return this.m_dropColumnIndex=null,i},D.prototype.handleColumnDrag=function(e){return this._invokeDndCallback("drag","columns","drag",e)},D.prototype.handleColumnDrop=function(e){let t=this.m_dropColumnIndex;if(this._destroyDragImage(),this._removeDropTargetLine("column"),this._removeDropTargetClass(),this.m_dropColumnIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==t){let i=this._getDropContext(e,t,"column");this._invokeDropCallback("columns","drop",e,i)}},D.prototype._computeDndContainerOffsetHeight=function(e,t,i,s){let n=0;if("row"===e)for(let e=0;e<t.length;e++){n+=t[e].offsetHeight}else{let e=t[0].offsetHeight;i&&(e+=s[0].offsetHeight),n=this.m_databody.offsetHeight+e}return n},D.prototype._computeDndContainerOffsetWidth=function(e,t,i,s){let n=0;if("row"===e){let e=t[0].offsetWidth;i&&(e+=s[0].offsetWidth),n=this.m_databody.offsetWidth+e}else for(let e=0;e<t.length;e++){n+=t[e].offsetWidth}return n},D.prototype._getCellsForDndContainer=function(e,t,i,s){let n,o,r=[],l=this.getResources().isRTLMode()?"right":"left",a=this.m_databody.scrollLeft,h=this.m_databody.scrollTop,d=0,c=0;o="row"===e?-1!==this.m_endRowEndHeader:-1!==this.m_endColEndHeader,n="row"===e?"width":"height";let m=Math.abs(a);"column"===e&&(l="top",m=h);for(let a=0,h=0;a<t.length;a++)for(let u=t[a].startIndex[e];u<=t[a].endIndex[e];u++){let t,a=this._getAxisCellsByIndex(u,e);i[h]&&r.push(i[h]);for(let e=0;e<a.length;e++)if(this.getElementDir(a[e],l)>m){t=e-1;break}a=a.slice(t,a.length);let _=0,p=this.getElementDir(this.m_databody,n);for(let e=0;e<a.length;e++)if(_+=this.getElementDir(a[e],n),_>p){t=e;break}t>0&&(a=a.slice(0,t+1)),r.push(...a),o&&r.push(i[Math.ceil(i.length/2+h)]),"row"!==e||d?"column"===e&&(d+=this.getElementDir(i[h],"width")):d=this._computeContainerDimension(r,"width"),"column"!==e||c?"row"===e&&(c+=this.getElementDir(i[h],"height")):c=this._computeContainerDimension(r,"height"),h+=1,s=a.length}return[r,s,d,c]},D.prototype._computeContainerDimension=function(e,t){let i=0;for(let s=0;s<e.length;s++)i+=this.getElementDir(e[s],t);return i},D.prototype._setDragImage=function(e,t,i,s,n,o,r,l,a){let h=this.getResources().isRTLMode()?"right":"left",d=this._populateDndContainer(i,t,h,o,l,a,s,n),c=Math.max(0,e.offsetX),m=Math.max(0,e.offsetY);r?(c="row"===t&&"left"===h?s-c:c,m="column"===t?n-m:m):c="row"===t&&"left"===h?c:s-c,e.dataTransfer.setDragImage(d,c,m)},D.prototype._computeDndContainerCellCountInRow=function(e,t){let i,s=e,n=1;return i="row"===t||"rowEnd"===t?-1!==this.m_endRowEndHeader:-1!==this.m_endColEndHeader,i&&(n=2),s+=n,s},D.prototype._populateDndContainer=function(e,t,i,s,n,o,r,l){let a=document.getElementById("dndContainer");a||(a=document.createElement("div"),a.setAttribute("id","dndContainer"),a.setAttribute("class","dndContainer"));let h=[this.getMappedStyle("focus"),this.getMappedStyle("hover"),this.getMappedStyle("active"),this.getMappedStyle("topSelected"),this.getMappedStyle("startSelected"),this.getMappedStyle("bottomSelected"),this.getMappedStyle("endSelected"),this.getMappedStyle("selected")],d=0,c=0,m=0,u=0;this._headersDragged=[];let _=this._computeDndContainerCellCountInRow(s,t);[u,m]=this._appendNestedHeadersToContainer(i,t,a,d,c,n,!1),c=u,d=m;for(let s=0;s<e.length;s++){let n=e[s],o=n.cloneNode(!0);o.classList.remove(...h),o.setAttribute("draggable",!1),o.style.top=d+"px",o.style[i]=c+"px","row"===t?(s%_==0?c=u+n.offsetWidth:c+=n.offsetWidth,s%_==_-1&&(d+=n.offsetHeight,s===e.length-1?d=0:c=u)):(s%_==0?d=m+n.offsetHeight:d+=n.offsetHeight,s%_==_-1&&(c+=n.offsetWidth,s===e.length-1?c=0:d=m)),a.appendChild(o),n.classList.add("drag-source-opaque")}return[u,m]=this._appendNestedHeadersToContainer(i,t,a,d,c,o,!0),a.style.width=r+"px",a.style.height=l+"px","column"===t?a.style.height=l+m+"px":a.style.width=r+u+"px",this.m_utils.isTouchDevice()?(this.m_dragImageAttached=!1,this.m_dndContainer=a):document.body.appendChild(a),a},D.prototype._appendNestedHeadersToContainer=function(e,t,i,s,n,o,r){let l;r?(this.m_rowEndHeaderLevelCount||this.m_columnEndHeaderLevelCount)&&(l="row"===t?this.m_rowEndHeaderLevelCount-1:this.m_columnEndHeaderLevelCount-1):l="row"===t?this.m_rowHeaderLevelCount-1:this.m_columnHeaderLevelCount-1;let a=Object.keys(o),h=[this.getMappedStyle("focus"),this.getMappedStyle("hover"),this.getMappedStyle("active"),this.getMappedStyle("selected")];r&&(a=a.reverse());for(let r=0;r<a.length;r++){let d=parseInt(a[r],10);if(d!==l){let r=o[d].length;for(let l=0;l<o[d].length;l++){let a=o[d][l];this._headersDragged.push(a);let c=a.cloneNode(!0);c.classList.remove(...h),c.style.top=s+"px",c.style[e]=n+"px","row"===t?(l%r==0?s=a.offsetHeight:s+=a.offsetHeight,l===r-1&&(n+=a.offsetWidth,s=0)):(l%r==0?n=a.offsetWidth:n+=a.offsetWidth,l===r-1&&(n=0,s+=a.offsetHeight)),i.appendChild(c),a.classList.add("drag-source-opaque")}}}return[n,s]},D.prototype._destroyDragImage=function(){let e=document.getElementById("dndContainer");e&&e.parentNode.removeChild(e),this.m_dragImageAttached=!1,this.m_dndContainer=null},D.prototype._setDragRowsData=function(e,t){if(t){let i=e.dataTransfer,s=JSON.stringify(this.m_selection);if("string"==typeof t)i.setData(t,s);else for(let e=0;e<t.length;e++)i.setData(t[e],s)}},D.prototype._getOverIndex=function(e,t){let i,s,n,o=e.target,r=this.getResources().isRTLMode()?"right":"left",l=o.getBoundingClientRect(),a=this.findHeader(o),h=!1,d=!1;if(a?(s=a[this.getResources().getMappedAttribute("context")],n=s.index,"column"===t?this.m_dropColumnIndex=n:this.m_dropRowIndex=n,h=this._isParentNode(s),d=this._isLeafNode(s)):(i=this.findCell(o),i&&(s=i[this.getResources().getMappedAttribute("context")],n=s.indexes,"column"===t?this.m_dropColumnIndex=s.indexes[t]:this.m_dropRowIndex=s.indexes[t])),void 0!==n){let o,c="width";if("column"===t?o=Math.abs(e.clientX-l[r]):(o=e.clientY-l.top,c="height"),a&&(h||d))o<.25*l[c]&&(n-=1);else if(o<.4*l[c])if(a)n-=1;else if(i&&void 0!==n){let e=s.indexes.row,i=s.indexes.column;n="row"===t?this.createIndex(e-1,i):this.createIndex(e,i-1)}}return n},D.prototype._getRelativePosition=function(e,t,i,s){let n,o=e.target,r=this.getResources().isRTLMode()?"right":"left",l=o.getBoundingClientRect(),a=!1,h=!1,d="before",c=i[this.getResources().getMappedAttribute("context")];s&&(a=this._isParentNode(c),h=this._isLeafNode(c));let m="width";return"column"===t?n=Math.abs(e.clientX-l[r]):(n=e.clientY-l.top,m="height"),i&&(a||h)?n>=.25*l[m]&&n<=.75*l[m]?d="inside":n>.75*l[m]&&(d="after"):n>.4*l[m]&&(d="after"),d},D.prototype._addDropTargetLine=function(e,t,i,s,n){let o="row"===e?"rowDropTargetLine":"colDropTargetLine";this.m_dropTarget=document.createElement("div"),this.m_dropHeaderTarget=document.createElement("div"),this.m_dropEndHeaderTarget=document.createElement("div"),this._setAttribute(this.m_dropTarget,"index",n);let r,l="width",a="width";"row"===e?r=-1!==this.m_endRowEndHeader:(l="height",a="height",r=-1!==this.m_endColEndHeader);let[h,d,c,m,u,_,p]="row"===e?this._calculateRowDropTargetLinePosition(t,s,i):this._calculateColDropTargetLinePosition(t,s,i);this._setDropTargetLineStyle(this.m_dropTarget,o,t,i,s,u,l),this._setDropTargetLineStyle(this.m_dropHeaderTarget,o,h,i,c,_,a),r&&this._setDropTargetLineStyle(this.m_dropEndHeaderTarget,o,d,i,m,p,a),this.m_databody.firstChild.appendChild(this.m_dropTarget),this.m_root.appendChild(this.m_dropHeaderTarget),r&&this.m_root.appendChild(this.m_dropEndHeaderTarget),this.m_dropTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropHeaderTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropEndHeaderTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1),this.m_dropHeaderTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1),this.m_dropEndHeaderTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1)},D.prototype._calculateRowDropTargetLinePosition=function(e,t,i){let s=this.m_rowHeader,n=this.m_rowEndHeader,o=e,r=t,l=e,a=t,h=this._getCornerDimensions("height"),d=0,c=0,m=0;d=this.getElementWidth(this.m_databody.firstChild),c=this.getElementWidth(s.firstChild),m=this.getElementWidth(n.firstChild);let u=Math.abs(this.getElementDir(s.firstChild,"top"));return 0!==u&&(o-=u),o+=h,l=o,this.m_rowEndHeader&&(a=t+this.getElementDir(this.m_rowEndHeader,i)),[o,l,r,a,d,c,m]},D.prototype._calculateColDropTargetLinePosition=function(e,t,i){let s=this.m_rowHeader,n=this.m_rowEndHeader,o=e,r=t,l=e,a=t,h=this._getCornerDimensions("width"),d=0,c=0,m=0;d=this.getElementHeight(this.m_databody.firstChild),c=this.getElementHeight(s.firstChild),m=this.getElementHeight(n.firstChild);let u=Math.abs(this.getElementDir(this.m_colHeader.firstChild,i));return 0!==u&&(r-=u),r+=h,a=r,this.m_colEndHeader&&(l=e+this.getElementDir(this.m_colEndHeader,"top")),[o,l,r,a,d,c,m]},D.prototype._getCornerDimensions=function(e){let t=0,i=0;return this.m_corner&&(t=this.getElementHeight(this.m_corner),i=this.getElementWidth(this.m_corner)),e?"height"===e?t:i:[t,i]},D.prototype._setDropTargetLineStyle=function(e,t,i,s,n,o,r){this.m_utils.addCSSClassName(e,this.getMappedStyle(t)),this.setElementDir(e,i,"top"),this.setElementDir(e,n,s),"width"===r?this.setElementWidth(e,o):this.setElementHeight(e,o)},D.prototype._removeDropTargetLine=function(){this._removeDropTargetEventListeners(),this._remove(this.m_dropTarget),this._remove(this.m_dropHeaderTarget),this.m_dropEndHeaderTarget&&this._remove(this.m_dropEndHeaderTarget)},D.prototype._removeDropTargetEventListeners=function(){this.m_dropTarget&&(this.m_dropTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropTarget.removeEventListener("drop",this.handleDropTargetDrop,!1)),this.m_dropHeaderTarget&&(this.m_dropHeaderTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropHeaderTarget.removeEventListener("drop",this.handleDropTargetDrop,!1)),this.m_dropEndHeaderTarget&&(this.m_dropEndHeaderTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropEndHeaderTarget.removeEventListener("drop",this.handleDropTargetDrop,!1))},D.prototype._removeDropTargetClass=function(){let e=document.querySelectorAll("."+this.getMappedStyle("dropTarget"));e&&e.length&&this._unhighlightElementsByClassName(e,["dropTarget"])},D.prototype._isHeaderWithinSelection=function(e,t){let i=this.getHeaderCellIndex(e),s=!1;if(this.m_selection&&this.m_selection.length)for(let n=0;n<this.m_selection.length;n++){let o=this._getHeadersWithinSelection(this.m_selection[n],i,t);for(let t=0;t<o.length;t++)if(o[t]===e&&o[o.length-1]!==e){s=!0;break}}return s},D.prototype._invokeDndCallback=function(e,t,i,s,n){let o,r=this.m_options.options.dnd[e];if(r&&r[t]){let e=r[t][i];if(e&&"function"==typeof e)try{this.m_customElement?e(s,n):o=e(s,n)}catch(e){throw new Error(e)}}return o},D.prototype._invokeDropCallback=function(e,t,i,s){var n=this._invokeDndCallback("drop",e,t,i,s);return void 0===n&&this._matchDragDataType(i,e)&&i.preventDefault(),n},D.prototype._matchDragDataType=function(e,t){var i=e.dataTransfer.types,s=this.m_options.options.dnd.drop;if(s&&s[t]&&s[t].dataTypes)for(var n=s[t].dataTypes,o="string"==typeof n?[n]:n,r=0;r<i.length;r++)if(o.indexOf(i[r])>=0)return!0;return!1},D.prototype.handleCancelDrag=function(){this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals()},D.prototype._resetDragInternals=function(){this._cellsDragged=[],this._headersDragged=[],this.m_dragIndex=null,this.m_dragHeader=null,this.m_databodyReorder=!1},D.prototype._disableChildElements=function(e){const t=this.getResources().getMappedAttribute("context");let i="row"===e?this.m_rowHeader:this.m_colHeader;i=i.querySelectorAll("."+this.getResources().getMappedStyle("headercell"));let s=this._getLogicalChildHeaderNodes(i,e,this.m_dragHeader,this.m_dragIndex+1);for(let i=0;i<s.length;i++){let n=s[i][t].index;this._highlightCellsAlongAxis(n,e,"index","add",["disabledElement"]),this._highlightElement(s[i],["disabledElement"])}},D.prototype._getLogicalChildHeaderNodes=function(e,t,i,s){const n=this.getResources().getMappedAttribute("context");let o=[];if("row"===t){let t=i[n].metadata.treeDepth;for(let i=s;i<e.length;i++){if(!(t<e[i][n].metadata.treeDepth))break;o.push(e[i])}}else{let t=i[n].level;for(let i=s;i<e.length;i++){if(!(t<e[i][n].level))break;o.push(e[i])}}return o},D.prototype._enableChildElements=function(){let e=this.getMappedStyle("disabledElement"),t=document.querySelectorAll("."+e);this._unhighlightElementsByClassName(t,["disabledElement"])},D.prototype._unhighlightDragSource=function(){if(this._cellsDragged&&this._cellsDragged.length){let e=["draggableItem","dragSourceOpaque"];this._unhighlightElementsByClassName(this._cellsDragged,e),this._unhighlightElementsByClassName(this._headersDragged,e)}},D.prototype._removeDragStyle=function(e){let t="row"===e?this.m_rowHeader:this.m_rowEndHeader,i="row"===e?this.m_colHeader:this.m_colEndHeader,s=this.getMappedStyle("dragging"),n=t.firstChild.querySelectorAll("."+s);this._unhighlightElementsByClassName(n,["dragging"]),-1!==this.m_endRowEndHeader&&(n=i.firstChild.querySelectorAll("."+s),this._unhighlightElementsByClassName(n,["dragging"]))},D.prototype._getDropContext=function(e,t,i){let s=e.target,n=this.findHeader(s);return{index:t,axis:i,position:this._getRelativePosition(e,i,n,!0)}},D.prototype.handleDropTargetDragOver=function(e){let t=e.target,i=this.m_utils.containsCSSClassName(t,this.getMappedStyle("rowDropTargetLine"))?"row":"column",s={axis:i,position:"after",index:this._getAttribute(this.m_dropTarget,"index")},n="row"===i||"rowEnd"===i?"rows":"columns";this._invokeDropCallback(n,"dragOver",e,s)},D.prototype.handleDropTargetDrop=function(e){let t=e.target,i=this.m_utils.containsCSSClassName(t,this.getMappedStyle("rowDropTargetLine"))?"row":"column",s=this._getAttribute(this.m_dropTarget,"index"),n="row"===i||"rowEnd"===i?"rows":"columns";if(this._destroyDragImage(),this._removeDropTargetLine(i),this._removeDropTargetClass(),"row"===i?this.m_dropRowIndex=null:this.m_dropColumnIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==s){let t={axis:i,position:"after",index:s};this._invokeDropCallback(n,"drop",e,t)}}});
|
|
8
|
+
define(["touchr","ojs/ojdatasource-common","ojs/ojdatacollection-utils","ojs/ojinputnumber","ojs/ojmenu","ojs/ojmenuselectmany","ojs/ojdialog","ojs/ojbutton","ojdnd","ojs/ojcore-base","@oracle/oraclejet-preact/hooks/UNSAFE_useFormVariantContext","ojs/ojcomponentcore","ojs/ojcontext","ojs/ojdatacollection-common","ojs/ojdomutils","ojs/ojconfig","ojs/ojcustomelement-utils","ojs/ojkeyboardfocus-utils","jquery","ojs/ojlogger","ojs/ojthemeutils"],function(e,t,i,s,n,o,r,l,a,h,d,c,m,u,_,p,g,f,C,y,v){"use strict";var E;h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h,m=m&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m,C=C&&Object.prototype.hasOwnProperty.call(C,"default")?C.default:C,(E={properties:{bandingInterval:{type:"object",properties:{column:{type:"number",value:0},row:{type:"number",value:0}}},cell:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},currentCell:{type:"object",writeback:!0},data:{type:"DataGridProvider",extension:{webelement:{exceptionStatus:[{type:"unsupported",since:"13.0.0",description:"Data sets from a DataProvider cannot be sent to WebDriverJS; use ViewModels or page variables instead."}]}}},dataTransferOptions:{type:"object",properties:{copy:{type:"string",enumValues:["disable","enable"],value:"disable"},cut:{type:"string",enumValues:["disable","enable"],value:"disable"},fill:{type:"string",enumValues:["disable","enable"],value:"disable"},paste:{type:"string",enumValues:["disable","enable"],value:"disable"}}},dnd:{type:"object",properties:{drag:{type:"object",properties:{columns:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},drag:{type:"function"},dragEnd:{type:"function"},dragStart:{type:"function"}}},rows:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},drag:{type:"function"},dragEnd:{type:"function"},dragStart:{type:"function"}}}}},drop:{type:"object",properties:{columns:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},dragEnter:{type:"function"},dragLeave:{type:"function"},dragOver:{type:"function"},drop:{type:"function"}}},rows:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},dragEnter:{type:"function"},dragLeave:{type:"function"},dragOver:{type:"function"},drop:{type:"function"}}}}},reorder:{type:"object",properties:{row:{type:"string",enumValues:["disable","enable"],value:"disable"}}}}},editMode:{type:"string",writeback:!0,enumValues:["cellEdit","cellNavigation","none"],value:"none"},gridlines:{type:"object",properties:{horizontal:{type:"string",enumValues:["hidden","visible"],value:"visible"},vertical:{type:"string",enumValues:["hidden","visible"],value:"visible"}}},header:{type:"object",properties:{column:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string",enumValues:["disable","enable"],value:"disable"},width:{type:"string|function",enumValues:["disable","enable"],value:"disable"}}},sortable:{type:"function|string",enumValues:["auto","disable","enable"],value:"auto"},style:{type:"function|string"}}},columnEnd:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string",enumValues:["disable","enable"],value:"disable"},width:{type:"string|function",enumValues:["disable","enable"],value:"disable"}}},style:{type:"function|string"}}},row:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string|function",enumValues:["disable","enable"],value:"disable"},width:{type:"string",enumValues:["disable","enable"],value:"disable"}}},sortable:{type:"function|string",enumValues:["auto","disable","enable"],value:"auto"},style:{type:"function|string"}}},rowEnd:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string|function",enumValues:["disable","enable"],value:"disable"},width:{type:"string",enumValues:["disable","enable"],value:"disable"}}},style:{type:"function|string"}}}}},scrollPolicy:{type:"string",enumValues:["auto","loadMoreOnScroll","scroll"],value:"auto"},scrollPolicyOptions:{type:"object",properties:{maxColumnCount:{type:"number",value:500},maxRowCount:{type:"number",value:500}}},scrollPosition:{type:"object",writeback:!0,value:{x:0,y:0},properties:{columnIndex:{type:"number"},columnKey:{type:"any"},offsetX:{type:"number"},offsetY:{type:"number"},rowIndex:{type:"number"},rowKey:{type:"any"},x:{type:"number"},y:{type:"number"}}},scrollToKey:{type:"string",enumValues:["always","auto","capability","never"],value:"auto"},selection:{type:"Array<Object>",writeback:!0,value:[]},selectionMode:{type:"object",properties:{cell:{type:"string",enumValues:["multiple","none","single"],value:"none"},row:{type:"string",enumValues:["multiple","none","single"],value:"none"}}},translations:{type:"object",value:{},properties:{accessibleActionableMode:{type:"string"},accessibleCollapsed:{type:"string"},accessibleColumnContext:{type:"string"},accessibleColumnEndHeaderContext:{type:"string"},accessibleColumnEndHeaderLabelContext:{type:"string"},accessibleColumnHeaderContext:{type:"string"},accessibleColumnHeaderLabelContext:{type:"string"},accessibleColumnHierarchicalFull:{type:"string"},accessibleColumnHierarchicalPartial:{type:"string"},accessibleColumnHierarchicalUnknown:{type:"string"},accessibleColumnSelected:{type:"string"},accessibleColumnSpanContext:{type:"string"},accessibleContainsControls:{type:"string"},accessibleExpanded:{type:"string"},accessibleFirstColumn:{type:"string"},accessibleFirstRow:{type:"string"},accessibleLastColumn:{type:"string"},accessibleLastRow:{type:"string"},accessibleLevelContext:{type:"string"},accessibleLevelHierarchicalContext:{type:"string"},accessibleMultiCellSelected:{type:"string"},accessibleNavigationMode:{type:"string"},accessibleRangeSelectModeOff:{type:"string"},accessibleRangeSelectModeOn:{type:"string"},accessibleRowCollapsed:{type:"string"},accessibleRowContext:{type:"string"},accessibleRowEndHeaderContext:{type:"string"},accessibleRowEndHeaderLabelContext:{type:"string"},accessibleRowExpanded:{type:"string"},accessibleRowHeaderContext:{type:"string"},accessibleRowHeaderLabelContext:{type:"string"},accessibleRowHierarchicalFull:{type:"string"},accessibleRowHierarchicalPartial:{type:"string"},accessibleRowHierarchicalUnknown:{type:"string"},accessibleRowSelected:{type:"string"},accessibleRowSpanContext:{type:"string"},accessibleSelectionAffordanceBottom:{type:"string"},accessibleSelectionAffordanceTop:{type:"string"},accessibleSortAscending:{type:"string"},accessibleSortDescending:{type:"string"},accessibleSortable:{type:"string"},accessibleStateSelected:{type:"string"},accessibleSummaryEstimate:{type:"string"},accessibleSummaryExact:{type:"string"},accessibleSummaryExpanded:{type:"string"},collapsedText:{type:"string"},columnWidth:{type:"string"},expandedText:{type:"string"},labelCopyCells:{type:"string"},labelCut:{type:"string"},labelCutCells:{type:"string"},labelDisableNonContiguous:{type:"string"},labelEnableNonContiguous:{type:"string"},labelFillCells:{type:"string"},labelPaste:{type:"string"},labelPasteCells:{type:"string"},labelResize:{type:"string"},labelResizeColumn:{type:"string"},labelResizeDialogApply:{type:"string"},labelResizeDialogCancel:{type:"string"},labelResizeDialogSubmit:{type:"string"},labelResizeFitToContent:{type:"string"},labelResizeHeight:{type:"string"},labelResizeRow:{type:"string"},labelResizeWidth:{type:"string"},labelSelectMultiple:{type:"string"},labelSortAsc:{type:"string"},labelSortCol:{type:"string"},labelSortColAsc:{type:"string"},labelSortColDsc:{type:"string"},labelSortDsc:{type:"string"},labelSortRow:{type:"string"},labelSortRowAsc:{type:"string"},labelSortRowDsc:{type:"string"},msgFetchingData:{type:"string"},msgNoData:{type:"string"},resizeColumnDialog:{type:"string"},resizeRowDialog:{type:"string"},rowHeight:{type:"string"},tooltipRequired:{type:"string"}}}},methods:{getContextByNode:{},getProperty:{},refresh:{},setProperties:{},setProperty:{},getNodeBySubId:{},getSubIdByNode:{}},events:{ojBeforeCurrentCell:{},ojBeforeEdit:{},ojBeforeEditEnd:{},ojCollapseRequest:{},ojCopyRequest:{},ojCutRequest:{},ojExpandRequest:{},ojFillRequest:{},ojPasteRequest:{},ojResize:{},ojScroll:{},ojSort:{},ojSortRequest:{}},extension:{}}).extension._WIDGET_NAME="ojDataGrid",E.extension._BINDING={provide:[{name:"__oj_private_contexts",default:new Map([[d.FormVariantContext,"embedded"]])}]},h.CustomElementBridge.register("oj-data-grid",{metadata:E});const w=function(e,t,i,s){this.rtlMode=e,this.translationFunction=t,this.defaultOptions=i,this.widgetName=s,this.styles={},this.styles.datagrid="oj-datagrid",this.styles.cell="oj-datagrid-cell",this.styles.banded="oj-datagrid-banded",this.styles.row="oj-datagrid-row",this.styles.databody="oj-datagrid-databody",this.styles.topcorner="oj-datagrid-top-corner",this.styles.bottomcorner="oj-datagrid-bottom-corner",this.styles.rowheaderspacer="oj-datagrid-row-header-spacer",this.styles.colheaderspacer="oj-datagrid-column-header-spacer",this.styles.status="oj-datagrid-status",this.styles.loadingicon="oj-icon oj-datagrid-loading-icon",this.styles.emptytext="oj-datagrid-empty-text",this.styles.header="oj-datagrid-header",this.styles.endheader="oj-datagrid-end-header",this.styles.groupingcontainer="oj-datagrid-header-grouping",this.styles.headercell="oj-datagrid-header-cell",this.styles.rowheader="oj-datagrid-row-header",this.styles.colheader="oj-datagrid-column-header",this.styles.colheadercell="oj-datagrid-column-header-cell",this.styles.rowheadercell="oj-datagrid-row-header-cell",this.styles.endheadercell="oj-datagrid-end-header-cell",this.styles.rowendheader="oj-datagrid-row-end-header",this.styles.colendheader="oj-datagrid-column-end-header",this.styles.colendheadercell="oj-datagrid-column-end-header-cell",this.styles.rowendheadercell="oj-datagrid-row-end-header-cell",this.styles.headerlabel="oj-datagrid-header-label",this.styles.rowheaderlabel="oj-datagrid-row-header-label",this.styles.columnheaderlabel="oj-datagrid-column-header-label",this.styles.rowendheaderlabel="oj-datagrid-row-end-header-label",this.styles.columnendheaderlabel="oj-datagrid-column-end-header-label",this.styles["scroller-mobile"]="oj-datagrid-scroller-touch",this.styles.scroller="oj-datagrid-scroller",this.styles.scrollers="oj-datagrid-scrollers",this.styles.scrollbarForce="oj-scrollbar-force",this.styles.focus="oj-focus",this.styles.hover="oj-hover",this.styles.active="oj-active",this.styles.selected="oj-selected",this.styles.topSelected="oj-datagrid-selected-top",this.styles.bottomSelected="oj-datagrid-selected-bottom",this.styles.startSelected="oj-datagrid-selected-start",this.styles.endSelected="oj-datagrid-selected-end",this.styles.topEdit="oj-datagrid-cell-edit-top",this.styles.bottomEdit="oj-datagrid-cell-edit-bottom",this.styles.startEdit="oj-datagrid-cell-edit-start",this.styles.endEdit="oj-datagrid-cell-edit-end",this.styles.topFloodfill="oj-datagrid-floodfill-top",this.styles.bottomFloodfill="oj-datagrid-floodfill-bottom",this.styles.startFloodfill="oj-datagrid-floodfill-start",this.styles.endFloodfill="oj-datagrid-floodfill-end",this.styles.topResized="oj-datagrid-resized-top",this.styles.bottomResized="oj-datagrid-resized-bottom",this.styles.endResized="oj-datagrid-resized-end",this.styles.startResized="oj-datagrid-resized-start",this.styles.disabled="oj-disabled",this.styles.enabled="oj-enabled",this.styles.default="oj-default",this.styles.sortIcon="oj-datagrid-sort-icon",this.styles.sortascending="oj-datagrid-sort-ascending-icon",this.styles.sortdescending="oj-datagrid-sort-descending-icon",this.styles.sortdefault="oj-datagrid-sort-default-icon",this.styles.icon="oj-component-icon",this.styles.clickableicon="oj-clickable-icon-nocontext",this.styles.info="oj-helper-hidden-accessible",this.styles.rowexpander="oj-rowexpander",this.styles.cut="oj-datagrid-cut",this.styles.selectaffordance="oj-datagrid-touch-selection-affordance",this.styles.selectaffordancetopcornerbounded="oj-datagrid-touch-selection-affordance-top-corner-bounded",this.styles.selectaffordancebottomcornerbounded="oj-datagrid-touch-selection-affordance-bottom-corner-bounded",this.styles.selectaffordancetoprow="oj-datagrid-touch-selection-affordance-top-row",this.styles.selectaffordancebottomrow="oj-datagrid-touch-selection-affordance-bottom-row",this.styles.selectaffordancetopcolumn="oj-datagrid-touch-selection-affordance-top-column",this.styles.selectaffordancebottomcolumn="oj-datagrid-touch-selection-affordance-bottom-column",this.styles.floodfillaffordance="oj-datagrid-floodfill-affordance",this.styles.toucharea="oj-datagrid-touch-area",this.styles.readOnly="oj-read-only",this.styles.editable="oj-datagrid-editable",this.styles.cellEdit="oj-datagrid-cell-edit",this.styles.draggable="oj-draggable",this.styles.drag="oj-drag",this.styles.drop="oj-drop",this.styles.activedrop="oj-active-drop",this.styles.validdrop="oj-valid-drop",this.styles.invaliddrop="oj-invalid-drop",this.styles.formcontrol="oj-form-control-inherit",this.styles.borderHorizontalNone="oj-datagrid-border-horizontal-none",this.styles.borderVerticalNone="oj-datagrid-border-vertical-none",this.styles.borderHorizontalSmall="oj-datagrid-small-content-border-horizontal",this.styles.borderVerticalSmall="oj-datagrid-small-content-border-vertical",this.styles.offsetOutline="oj-datagrid-focus-offset",this.styles.depth="oj-datagrid-depth-",this.styles.popupHeader="oj-datagrid-popup-header",this.styles.popupContent="oj-datagrid-popup-content",this.styles.popupFooter="oj-datagrid-popup-footer",this.styles.dialogTitle="oj-dialog-title",this.styles.resizeDialog="oj-datagrid-resize-dialog",this.styles.headerAllSelected="oj-selected",this.styles.headerPartialSelected="oj-partial-selected",this.styles.disclosureContainer="oj-datagrid-disclosure-icon-container",this.styles.disclosureIcon="oj-datagrid-disclosure-icon",this.styles.expanded="oj-datagrid-expanded-icon",this.styles.collapsed="oj-datagrid-collapsed-icon",this.styles.spacer="oj-datagrid-tree-spacer",this.styles.hierarchicalTree="oj-datagrid-hierarchical-tree",this.styles.hierarchicalGroup="oj-datagrid-hierarchical-group",this.styles.iconContainer="oj-datagrid-icon-container",this.styles.requiredIcon="oj-datagrid-required-icon",this.styles.noDataContainer="oj-datagrid-no-data-container",this.styles.draggableItem="oj-datagrid-draggable",this.styles.dragSourceOpaque="drag-source-opaque",this.styles.rowDropTargetLine="oj-datagrid-row-drop-target-line",this.styles.colDropTargetLine="oj-datagrid-col-drop-target-line",this.styles.dragging="oj-datagrid-drag-active",this.styles.dropTarget="oj-datagrid-drop-target",this.styles.disabledElement="oj-datagrid-disabled-element",this.commands={},this.commands.sortCol="oj-datagrid-sortCol",this.commands.sortColAsc="oj-datagrid-sortColAsc",this.commands.sortColDsc="oj-datagrid-sortColDsc",this.commands.sortRow="oj-datagrid-sortRow",this.commands.sortRowAsc="oj-datagrid-sortRowAsc",this.commands.sortRowDsc="oj-datagrid-sortRowDsc",this.commands.resize="oj-datagrid-resize",this.commands.resizeWidth="oj-datagrid-resizeWidth",this.commands.resizeHeight="oj-datagrid-resizeHeight",this.commands.resizeFitToContent="oj-datagrid-resizeFitToContent",this.commands.cut="oj-datagrid-cut",this.commands.paste="oj-datagrid-paste",this.commands.cutCells="oj-datagrid-cutCells",this.commands.copyCells="oj-datagrid-copyCells",this.commands.pasteCells="oj-datagrid-pasteCells",this.commands.autoFill="oj-datagrid-fillCells",this.commands.discontiguousSelection="oj-datagrid-discontiguousSelection",this.attributes={},this.attributes.busyContext=m._OJ_CONTEXT_ATTRIBUTE,this.attributes.context="data-oj-cellContext",this.attributes.resizable="data-oj-resizable",this.attributes.sortable="data-oj-sortable",this.attributes.sortDir="data-oj-sortdir",this.attributes.expander="data-oj-expander",this.attributes.expanderIndex="data-oj-expander-index",this.attributes.container=c._OJ_CONTAINER_ATTR,this.attributes.extent="data-oj-extent",this.attributes.start="data-oj-start",this.attributes.depth="data-oj-depth",this.attributes.level="data-oj-level",this.attributes.metadata="data-oj-metaData"};h._registerLegacyNamespaceProp("DataGridResources",w),w.prototype.setRTLMode=function(e){this.rtlMode=e},w.prototype.isRTLMode=function(){return"rtl"===this.rtlMode},w.prototype.getTranslatedText=function(e,t){return this.translationFunction(e,t)},w.prototype.getDefaultOption=function(e){return this.defaultOptions[e]},w.prototype.getMappedStyle=function(e){return null!=e?this.styles[e]:null},w.prototype.getMappedCommand=function(e){return null!=e?this.commands[e]:null},w.prototype.getMappedAttribute=function(e){return null!=e?this.attributes[e]:null};const S=function(e){this.dataprovider=e,this.pendingHeaderCallback={},e.options&&e.options.implicitSort&&(this.currentSortCriteria=e.options.implicitSort),this.sortUpdated=!1;var t=this.dataprovider.getCapability("fetchByOffset");this.fetchByOffset=null!=t&&"randomAccess"===t.implementation,this._registerEventListeners(),S.superclass.constructor.call(this)};function H(e,t,i,s){this.indexes=e,this.data=i,this.metadata=t,this.columns=s}function x(e,t,i){this.response=e,this.results=e.results,this.cellRanges=t,this.columns=i,this._setBounds(e,t,i)}function b(e,t,i,s){this.start=e,this.end=t,this.headers=i,this.sortCriteria=s}h.Object.createSubclass(S,h.DataGridDataSource,"DataProviderDataGridDataSource"),S.prototype._registerEventListeners=function(){this._mutationListener=this._handlDataProviderMutationEvent.bind(this),this._refreshListener=this._handlDataProviderRefreshEvent.bind(this),this.dataprovider.addEventListener("mutate",this._mutationListener),this.dataprovider.addEventListener("refresh",this._refreshListener)},S.prototype._handlDataProviderMutationEvent=function(e){var t,i=e.detail.add;if(null!=i){var s={indexes:[],keys:[]},n=[],o=[],r=[];for(t=0;t<i.data.length;t++)s.source=this,s.operation="insert",s.keys.push({row:i.metadata[t].key,column:null}),s.indexes.push({row:i.indexes[t],column:-1}),r.push(i.indexes[t]),n.push(i.data[t]),o.push(i.metadata[t]),t!==i.data.length-1&&i.indexes[t+1]===i.indexes[t]+1||(s.result=new H(r,o,n,this.columns),this.handleEvent("change",s),(s={}).indexes=[],s.keys=[],n=[],o=[],r=[])}var l=e.detail.remove;if(null!=l){var a={source:this,operation:"delete",keys:[],indexes:[]};for(t=0;t<l.data.length;t++)a.keys.push({row:l.metadata[t].key,column:null}),a.indexes.push({row:l.indexes[t],column:-1});this.handleEvent("change",a)}var h=e.detail.update;if(null!=h)for(t=0;t<h.data.length;t++){var d={source:this,operation:"update",keys:{row:h.metadata[t].key,column:null},indexes:{row:h.indexes[t],column:-1}};d.result=new H([h.indexes[t]],[h.metadata[t]],[h.data[t]],this.columns),this.handleEvent("change",d)}},H.prototype.getData=function(e){var t=this,i={};return Object.defineProperty(i,"data",{enumerable:!0,get:function(){return t.data[e.row-t.getStart("row")][t.columns[e.column]]},set:function(i){t.data[e.row-t.getStart("row")][t.columns[e.column]]=i}}),i},H.prototype.getMetadata=function(e){var t=this.metadata[e.row-this.getStart("row")];return t.keys={row:t.key,column:this.columns[e.column]},t},H.prototype.getStart=function(e){return"row"===e?this.indexes[0]:0},H.prototype.getCount=function(e){return"row"===e?this.data.length:"column"===e?this.columns.length:0},H.prototype.getExtent=function(){return{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}},S.prototype._handlDataProviderRefreshEvent=function(){this._asyncIterator=null,this.handleEvent("change",{operation:"refresh"})},S.prototype.fetchHeaders=function(e,t,i){if(null!=t){var s=e.axis,n={headerRange:e,callbacks:t,callbackObjects:i};this.pendingHeaderCallback[s]=n}},S.prototype._processPendingHeaderCallbacks=function(e){var t=this.pendingHeaderCallback[e];if(null!=t){var i=t.headerRange,s=t.callbacks,n=t.callbackObjects;this._handleHeaderFetchSuccess(i,s,n),this.pendingHeaderCallback[e]=null}},S.prototype._handleHeaderFetchSuccess=function(e,t,i){var s,n=e.axis,o=e.start,r=e.count;"column"===n&&null!=this.columns?s=new b(o,Math.min(this.columns.length,o+r),this.columns,this.currentSortCriteria):s=null;null!=t&&t.success&&t.success.call(i.success,s,e,null)},x.prototype._setBounds=function(e,t,i){for(var s=0;s<t.length;s+=1){var n=t[s];"row"===n.axis?(this.rowStart=e.fetchParameters.offset?e.fetchParameters.offset:n.start,this.rowEnd=this.rowStart+e.results.length-1):"column"===n.axis&&(this.colStart=n.start,this.colEnd=Math.min(this.colStart+n.count-1,this.colStart+i.length-1))}},x.prototype.getData=function(e){var t=this,i={};return Object.defineProperty(i,"data",{enumerable:!0,get:function(){return t.results[e.row-t.rowStart].data[t.columns[e.column]]},set:function(i){t.results[e.row-t.rowStart].data[t.columns[e.column]]=i}}),i},x.prototype.getMetadata=function(e){var t=this.results[e.row-this.rowStart].metadata;return t.keys={row:this.results[e.row-this.rowStart].metadata.key,column:this.columns[e.column]},t},x.prototype.getCount=function(e){return"row"===e?this.rowEnd-this.rowStart+1:"column"===e?this.colEnd-this.colStart+1:0},x.prototype.getExtent=function(){return{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}},S.prototype.setUpColumns=function(e){if(null==this.columns||0===this.columns.length){var t=[];if(e.results.length)for(var i=Object.keys(e.results[0].data),s=0;s<i.length;s++)t.push(i[s]);this.columns=t}},S.prototype.getRangeInfo=function(e){for(var t={},i=0;i<e.length;i+=1){var s=e[i];"row"===s.axis?(t.rowStart=s.start,t.rowEnd=t.rowStart+s.count-1):"column"===s.axis&&(t.colStart=s.start,t.colEnd=t.colStart+s.count-1)}return t},S.prototype._createResults=function(e){e.results=[];for(var t=0;t<e.value.data.length;t++){var i={data:e.value.data[t],metadata:e.value.metadata[t]};e.results.push(i)}},S.prototype.handleFetchResult=function(e,t,i,s){var n=s[0];n.results||(this._createResults(n),n.fetchParameters=n.value.fetchParameters),this.setUpColumns(n),this._processPendingHeaderCallbacks("column"),this._processPendingHeaderCallbacks("row");var o=new x(n,e,this.columns);if(null!=t&&null!=t.success){var r=i?i.success:null;t.success.call(r,o,e)}},S.prototype.fetchCells=function(e,t,i){this.getCount("row");var s=this.getRangeInfo(e),n=s.rowEnd-s.rowStart+1;if(this.fetchByOffset){var o=s.rowStart;this._fetchPromise=this.dataprovider.fetchByOffset({size:n,offset:o,sortCriteria:this.currentSortCriteria})}else(null==this._asyncIterator||this.sortUpdated)&&(this._clientId=this._clientId||Symbol(),this._asyncIterator=this.dataprovider.fetchFirst({clientId:this._clientId,size:n,sortCriteria:this.currentSortCriteria})[Symbol.asyncIterator]()),this._fetchPromise=this._asyncIterator.next();this.sortUpdated=!1,Promise.all([this._fetchPromise,this._getCountPromise]).then(this.handleFetchResult.bind(this,e,t,i))},S.prototype.getCapability=function(e){if("sort"===e){var t=this.dataprovider.getCapability(e).attributes;return"multiple"===t||"single"===t?"column":t}return"none"},S.prototype.getCount=function(e){var t=this;if("row"===e){if(void 0!==t.totalRowCount)return t.totalRowCount;t._getCountPromise=this.dataprovider.getTotalSize(),t._getCountPromise.then(function(e){t.totalRowCount=e})}else if("column"===e&&null!=this.columns)return this.columns.length;return-1},S.prototype.getCountPrecision=function(){return"estimate"},S.prototype.indexes=function(){return{row:-1,column:-1}},S.prototype.keys=function(){return{row:null,column:null}},S.prototype.move=function(){return!1},S.prototype.moveOK=function(){return"invalid"},S.prototype.sort=function(e,t,i){this.sortUpdated=!0,this.currentSortCriteria=[{attribute:e.key,direction:e.direction}],null==i&&(i={}),null!=t&&null!=t.success&&t.success.call(i.success)},b.prototype.getData=function(e){return this.headers[e]},b.prototype.getMetadata=function(e){var t=this.getData(e),i={key:t};if(null!=this.sortCriteria)for(var s=0;s<this.sortCriteria.length;s++)this.sortCriteria[s].attribute===t&&(i.sortDirection=this.sortCriteria[s].direction);return i},b.prototype.getLevelCount=function(){return 1},b.prototype.getExtent=function(){return{extent:1,more:{before:!1,after:!1}}},b.prototype.getLabel=function(){return null},b.prototype.getDepth=function(){return 1},b.prototype.getCount=function(){return Math.max(0,this.end-this.start)};const R=function(e){this.grid=e};R.prototype.getAction=function(e,t){var i=e.keyCode,s=this.grid.m_utils.ctrlEquivalent(e),n=e.shiftKey,o=e.altKey,r=this.grid.keyCodes,l=t.cellOrHeader,a=t.readOnly,h=t.currentMode,d=t.activeMove,c=t.activeDrag,m=t.rowMove,u=t.columnSort;let _=t.rowSort;var p=t.selection,g=t.selectionMode,f=t.multipleSelection,C=t.expandCollapse,y=t.copyCells,v=t.cutCells,E=t.pasteCells,w=t.fill;switch(i){case r.TAB_KEY:if("actionable"===h)return n?"TAB_PREV_IN_CELL":"TAB_NEXT_IN_CELL";if(!a)return n?"FOCUS_LEFT":"FOCUS_RIGHT";break;case r.ENTER_KEY:if("actionable"===h)return"NO_OP";if("column"===l&&u||"row"===l&&_)return"SORT";if(!o&&a&&"navigation"===h||"cell"!==l)return"ACTIONABLE";if(!a&&!o)return n?"FOCUS_UP":"FOCUS_DOWN";if(o&&a&&"navigation"===h)return"EDITABLE";if(!a&&("navigation"===h||"edit"===h))return"EDIT";break;case r.ESC_KEY:if("actionable"===h)return"EXIT_ACTIONABLE";if(d)return"CANCEL_REORDER";if(c)return"CANCEL_DRAG";if(a){if(this.grid.m_discontiguousSelection)return"SELECT_DISCONTIGUOUS"}else{if("navigation"===h)return"EXIT_EDITABLE";if("edit"===h)return"CANCEL_EDIT"}break;case r.SPACE_KEY:if(-1!==l.indexOf("row")&&p&&("cell"===g&&f||"row"===g)&&"navigation"===h)return"SELECT_ROW";if(-1!==l.indexOf("column")&&p&&"cell"===g&&f&&"navigation"===h)return"SELECT_COLUMN";if("cell"===l)if(a&&"navigation"===h){if(s&&p&&"cell"===g&&f)return"SELECT_COLUMN";if(n&&p&&("cell"===g&&f||"row"===g))return"SELECT_ROW"}else if("navigation"===h)return"DATA_ENTRY";break;case r.PAGEUP_KEY:if("navigation"===h)return"FOCUS_ROW_FIRST";break;case r.PAGEDOWN_KEY:if("navigation"===h)return"FOCUS_ROW_LAST";break;case r.END_KEY:if("navigation"===h)return s&&"cell"===l?"FOCUS_LAST_CELL_IN_GRID":"FOCUS_COLUMN_LAST";break;case r.HOME_KEY:if("navigation"===h)return s&&"cell"===l?"FOCUS_FIRST_CELL_IN_GRID":"FOCUS_COLUMN_FIRST";break;case r.LEFT_KEY:if(s&&C&&this.grid._isHeaderExpanded(e.target))return"COLLAPSE";if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&"cell"===g&&f?"SELECT_EXTEND_LEFT":s?"FOCUS_LEFT_NON_EMPTY_CELL":"FOCUS_LEFT";break;case r.UP_KEY:if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&f?"SELECT_EXTEND_UP":s?"FOCUS_UP_NON_EMPTY_CELL":"FOCUS_UP";break;case r.RIGHT_KEY:if(s&&C&&this.grid._isHeaderCollapsed(e.target))return"EXPAND";if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&"cell"===g&&f?"SELECT_EXTEND_RIGHT":s?"FOCUS_RIGHT_NON_EMPTY_CELL":"FOCUS_RIGHT";break;case r.DOWN_KEY:if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&f?"SELECT_EXTEND_DOWN":s?"FOCUS_DOWN_NON_EMPTY_CELL":"FOCUS_DOWN";break;case r.F2_KEY:if("actionable"===h)return"EXIT_ACTIONABLE";if("cell"!==l)return"ACTIONABLE";if(a&&"navigation"===h)return"EDITABLE";if(!a&&"navigation"===h)return"EDIT";if(!a&&"edit"===h)return"CANCEL_EDIT";break;case r.F8_KEY:if(n&&p&&f)return"SELECT_DISCONTIGUOUS";break;case r.F10_KEY:if(n)return"NO_OP";break;case r.V_KEY:if("navigation"===h&&s){if(m)return"PASTE";if(E)return"PASTE_CELLS"}if(!a&&"navigation"===h&&"cell"===l)return"DATA_ENTRY";break;case r.X_KEY:if("navigation"===h&&s){if(m)return"CUT";if(v)return"CUT_CELLS"}if(!a&&"navigation"===h&&"cell"===l)return"DATA_ENTRY";break;case r.C_KEY:if("navigation"===h&&s&&y)return"COPY_CELLS";if(!a&&"navigation"===h&&"cell"===l)return"DATA_ENTRY";break;case r.D_KEY:case r.R_KEY:if("navigation"===h&&s&&w)return"FILL";if(!a&&"navigation"===h&&"cell"===l&&!s)return"DATA_ENTRY";break;case r.SHIFT_KEY:case r.CTRL_KEY:case r.ALT_KEY:break;case r.A_KEY:if(s&&p&&f&&"navigation"===h)return"SELECT_ALL";case r.NUM5_KEY:if(s&&o&&"navigation"===h)return"READ_CELL";default:if((i<r.F1_KEY||i>r.F15_KEY)&&!a&&"navigation"===h&&"cell"===l&&!s)return"DATA_ENTRY"}return"NO_OP"},R.prototype.getNoDataAction=function(e,t){var i=e.keyCode,s=e.shiftKey,n=this.grid.keyCodes,o=t.currentMode;switch(i){case n.TAB_KEY:if("actionable"===o)return s?"TAB_PREV_IN_CELL":"TAB_NEXT_IN_CELL";break;case n.ESC_KEY:if("actionable"===o)return"EXIT_ACTIONABLE";break;case n.F2_KEY:return"actionable"===o?"EXIT_ACTIONABLE":"ACTIONABLE";case n.UP_KEY:if("navigation"===o)return"FOCUS_COLUMN_HEADER";break;case n.DOWN_KEY:if("navigation"===o)return"FOCUS_COLUMN_END_HEADER";break;case n.LEFT_KEY:if("navigation"===o)return"FOCUS_ROW_HEADER";break;case n.RIGHT_KEY:if("navigation"===o)return"FOCUS_ROW_END_HEADER"}return"NO_OP"};const I=function(e,t){this.options=e,this.rendererWrapperFunction=t};I.prototype.extract=function(e,t,i,s){if(null!=e){var n=this.options[e];if(null!=t&&null!=n){var o=n[t];if(null!=i&&null!=o){var r=o[i];return null!=s&&null!=r?r[s]:r}return o}return n}return null},I.prototype.evaluate=function(e,t){return"function"==typeof e?e.call(this,t):e},I.prototype.getRawProperty=function(e,t,i){var s,n,o,r;return"row"===t||"column"===t||"rowEnd"===t||"columnEnd"===t?(s="header",n=t,i?(o="label",r=e):o=e):"cell"===t&&(s="cell",n=e),this.extract(s,n,o,r)},I.prototype.getProperty=function(e,t,i,s){return void 0===i?this.extract(e,t,s):this.evaluate(this.getRawProperty(e,t,s),i)},I.prototype.getRowBandingInterval=function(){var e=this.getProperty("bandingInterval","row");return null!=e?e:0},I.prototype.getColumnBandingInterval=function(){var e=this.getProperty("bandingInterval","column");return null!=e?e:0},I.prototype.getEmptyText=function(){return this.getProperty("emptyText")},I.prototype.getHorizontalGridlines=function(){var e=this.extract("gridlines","horizontal");return null!=e?e:"visible"},I.prototype.getVerticalGridlines=function(){var e=this.extract("gridlines","vertical");return null!=e?e:"visible"},I.prototype.getScrollToKey=function(){var e=this.getProperty("scrollToKey");return null!=e?e:"auto"},I.prototype.getScrollPosition=function(){var e=this.getProperty("scrollPosition");return null!=e?e:null},I.prototype.getSelectionCardinality=function(){var e=this.getProperty("selectionMode");if(null==e)return"none";var t=e[this.getSelectionMode()];return null!=t?t:"none"},I.prototype.getSelectionMode=function(){var e=this.getProperty("selectionMode");if(null==e)return"cell";var t=e.row;return null!=t&&"none"!==t?"row":"cell"},I.prototype.getSelection=function(){return this.getProperty("selection")},I.prototype.getCurrentCell=function(){return this.getProperty("currentCell")},I.prototype.getEditMode=function(){return this.getProperty("editMode")},I.prototype.isSortable=function(e,t){return this.getProperty("sortable",e,t)},I.prototype.isResizable=function(e,t,i){var s=this.extract("header",e,"resizable",t);return null!=i?this.evaluate(s,i):s},I.prototype.isMoveable=function(e){return this.extract("dnd","reorder",e)},I.prototype._isDragEnabled=function(e){let t=!1,i="row"===e||"rowEnd"===e?"rows":"columns",s=this.getProperty("dnd").drag;return s&&s[i]&&(t=!0),t},I.prototype._getDraggable=function(){return this.getProperty("dnd").drag},I.prototype.isFloodFillEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","fill")&&(e=!0),e},I.prototype.isCopyEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","copy")&&(e=!0),e},I.prototype.isCutEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","cut")&&(e=!0),e},I.prototype.isPasteEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","paste")&&(e=!0),e},I.prototype.getInlineStyle=function(e,t,i){return this.getProperty("style",e,t,i)},I.prototype.getStyleClass=function(e,t,i){return this.getProperty("className",e,t,i)},I.prototype.getRenderer=function(e,t){return this.rendererWrapperFunction?this.rendererWrapperFunction(this.getRawProperty("renderer",e,t)):this.getRawProperty("renderer",e,t)},I.prototype.getScrollPolicy=function(){var e=this.getProperty("scrollPolicy");return null==e&&(e="auto"),e},I.prototype.getScrollPolicyOptions=function(){return this.getProperty("scrollPolicyOptions")};const M=function(){this.sizes={column:new Map,row:new Map}};M.prototype.setSize=function(e,t,i){this.sizes[e].set(t,i)},M.prototype.getSize=function(e,t){var i=this.sizes[e].get(t);return null!=i||this.sizes[e].forEach(function(e,s){null==i&&h.Object.compareValues(s,t)&&(i=e)}),i},M.prototype.clear=function(){this.sizes.column.clear(),this.sizes.row.clear()};const L=function(e){this.scrollbarSize=-1,this.dataGrid=e};L.prototype._getMaxDivHeightForScrolling=function(){return null==this.m_maxDivHeightForScrolling&&this._setMaxValuesForScrolling(),this.m_maxDivHeightForScrolling},L.prototype._getMaxDivWidthForScrolling=function(){return null==this.m_maxDivWidthForScrolling&&this._setMaxValuesForScrolling(),this.m_maxDivWidthForScrolling},L.prototype._setMaxValuesForScrolling=function(){this._calculateBrowserDefinedValues()},L.prototype._calculateBrowserDefinedValues=function(){var e=document.createElement("div");e.style.width="1000000000px",e.style.height="1000000000px",e.style.display="none";var t=document.createElement("div");t.style.width="100px",t.style.height="100px",t.style.overflow="scroll",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);let i=!1;u.isIE()||u.isEdge()?(this.m_maxDivHeightForScrolling=1e6,this.m_maxDivWidthForScrolling=1e6):(i=!0,document.body.appendChild(e),this.m_maxDivHeightForScrolling=parseInt(parseFloat(window.getComputedStyle(e).height)/2,10),this.m_maxDivWidthForScrolling=parseInt(parseFloat(window.getComputedStyle(e).width)/2,10)),this.scrollbarSize=t.offsetWidth-t.clientWidth,i&&document.body.removeChild(e),document.body.removeChild(t)},L.prototype.getScrollbarSize=function(){return-1===this.scrollbarSize&&this._calculateBrowserDefinedValues(),this.scrollbarSize},L.prototype.getScrollbarSize=function(){return-1===this.scrollbarSize&&this.calculateScrollbarSize(),this.scrollbarSize},L.prototype.isTouchDevice=function(){return null==this.isTouch&&(this.isTouch=u.isMobileTouchDevice()),this.isTouch},L.prototype.isTouchDeviceNotIOS=function(){if(null==this.isTouchNotIOS){let e=this.isTouchDevice();this.isTouchNotIOS=!!e&&!u.isIos()}return this.isTouchNotIOS},L.prototype.addCSSClassName=function(e,t){null!=t&&""!==t&&null!=e&&null!=e.classList&&e.classList.add(t)},L.prototype.removeCSSClassName=function(e,t){null!=t&&""!==t&&null!=e&&null!=e.classList&&e.classList.remove(t)},L.prototype.containsCSSClassName=function(e,t){var i=!1;return null!=t&&null!=e&&null!=e.classList&&(i=e.classList.contains(t)),i},L._getCSSClassNameIndex=function(e,t){if(!e||!e.indexOf)return-1;if(t===e)return 0;var i=t.length,s=e.length,n=e.indexOf(t);if(n>=0){var o=0===n||" "===e.charAt(n-1),r=n+i,l=r===s||" "===e.charAt(r);if(o&&l)return n;var a=e.lastIndexOf(t);if(a!==n)return o=e.charAt(a-1),l=(r=a+i)===s||" "===e.charAt(r),o&&l?a:e.indexOf(" "+t+" ")}return-1},L.prototype.ctrlEquivalent=function(e){return u.isMac()?e.metaKey:e.ctrlKey},L.prototype.getElementScrollLeft=function(e){return Math.abs(e.scrollLeft)},L.prototype.setElementScrollLeft=function(e,t){_.setScrollLeft(e,t)},L.prototype.getMousewheelEvent=function(){return"wheel"},L.prototype.getMousewheelScrollDelta=function(e){var t=-1,i=e.deltaMode;return i===e.DOM_DELTA_PIXEL?t=-1:i!==e.DOM_DELTA_LINE&&i!==e.DOM_DELTA_PAGE||(t=-40),{deltaX:e.deltaX*t,deltaY:e.deltaY*t}},L.prototype.empty=function(e){for(;e.firstChild;)this.dataGrid._remove(e.firstChild)},L.prototype.supportsTransitions=function(){var e=(document.body||document.documentElement).style,t="transition";if(!!u.isIE()&&u.getBrowserVersion()<11)return!1;if("string"==typeof e[t])return!0;var i=["Moz","webkit","Webkit","Khtml","O","ms"];t=t.charAt(0).toUpperCase()+t.substr(1);for(var s=0;s<i.length;s++)if("string"==typeof e[i[s]+t])return!0;return!1},L.prototype._isNodeEditableOrClickable=function(e,t){for(;null!=e&&e!==t;){var i=e.nodeName;if(3===e.nodeType)e=e.parentNode;else{var s=parseInt(e.getAttribute("tabIndex"),10),n=parseInt(e.getAttribute(this.dataGrid.getResources().getMappedAttribute("tabindex")),10);if(null!=s&&s>=0)return!(this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("cell"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("headerlabel"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("headercell"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("endheadercell")));if(i.match(/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA/)&&(-1!==s||-1!==n))return!0;e=e.parentNode}}return!1},L.prototype.shouldOffsetOutline=function(){return!(!u.isMac()||!u.isWebkit())};const A=function(e){this.m_root=e,this.MAX_COLUMN_THRESHOLD=20,this.MAX_ROW_THRESHOLD=30,this.m_utils=new L(this),this.m_discontiguousSelection=!1,this.m_sizingManager=new M,this.m_keyboardHandler=new R(this),this.m_rowHeaderWidth=null,this.m_rowEndHeaderWidth=null,this.m_colHeaderHeight=null,this.m_colEndHeaderHeight=null,this.m_styleClassDimensionMap={width:{},height:{}},this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.m_fetchingForUpdate=!1,this.m_initialized=!1,this.m_shouldFocus=null,this.m_renderCount=0,this.callbacks={},this._setupActions(),this.m_readinessStack=[],this.m_modelEvents=[],this.m_databodyMap=new Map};A.prototype.keyCodes={TAB_KEY:9,ENTER_KEY:13,SHIFT_KEY:16,CTRL_KEY:17,ALT_KEY:18,ESC_KEY:27,SPACE_KEY:32,PAGEUP_KEY:33,PAGEDOWN_KEY:34,END_KEY:35,HOME_KEY:36,LEFT_KEY:37,UP_KEY:38,RIGHT_KEY:39,DOWN_KEY:40,NUM5_KEY:53,V_KEY:86,X_KEY:88,C_KEY:67,D_KEY:68,R_KEY:82,F1_KEY:112,F2_KEY:113,F8_KEY:119,F10_KEY:121,F15_KEY:126,A_KEY:65},A.UPDATE_ANIMATION_FADE_INOUT=1,A.UPDATE_ANIMATION_SLIDE_INOUT=2,A.UPDATE_ANIMATION_DURATION=250,A.EXPAND_ANIMATION_DURATION=500,A.COLLAPSE_ANIMATION_DURATION=400,A.MAX_OVERSCROLL_PIXEL=50,A.BOUNCE_ANIMATION_DURATION=500,A.DECELERATION_FACTOR=6e-4,A.TAP_AND_SCROLL_RESET=300,A.MIN_SWIPE_DURATION=200,A.MAX_SWIPE_DURATION=400,A.MIN_SWIPE_DISTANCE=10,A.MIN_SWIPE_TRANSITION_DURATION=100,A.MAX_SWIPE_TRANSITION_DURATION=500,A.CONTEXT_MENU_TAP_HOLD_DURATION=750,A.HEADER_TAP_SHORT_HOLD_DURATION=300,A.FETCH_PIXEL_THRESHOLD=5,A.VISIBILITY_STATE_HIDDEN="hidden",A.VISIBILITY_STATE_REFRESH="refresh",A.VISIBILITY_STATE_RENDER="render",A.VISIBILITY_STATE_VISIBLE="visible",A.SPACER_DEFAULT_WIDTH=2,A.prototype.SetOptions=function(e,t){this.m_options=new I(e,t)},A.prototype.SetSortOriginalEvent=function(e){this.m_sortInfo&&(this.m_sortInfo.originalEvent=e)},A.prototype.UpdateOptions=function(e,t){var i,s,n=Object.keys(e);for(s=0;s<n.length;s++)(i=n[s])in this.m_options.options&&this.m_options.options[i]!==e[i]&&(this.m_options.options[i]=e[i]);for(s=0;s<n.length;s++)if(i=n[s],!this._updateDataGrid(i,t)){this.empty(),this.refresh(this.m_root);break}},A.prototype._updateDataGrid=function(e,t){var i;switch(e){case"bandingInterval":this._removeBanding(),this.updateColumnBanding(),this.updateRowBanding();break;case"currentCell":i=this.m_options.getCurrentCell(),this._updateActive(i,!0,!1);break;case"editMode":this.m_editMode=this.m_options.getEditMode();break;case"gridlines":this._updateGridlines();break;case"header":i=this.m_options.options.header,this._updateHeaderOptions(i,t);break;case"scrollPosition":i=this.m_options.getScrollPosition(),this._updateScrollPosition(i);break;case"selection":i=this.m_options.getSelection(),this._updateSelection(i);break;case"selectionMode":this._clearSelection(null);break;default:return!1}return!0},A.prototype._updateSelection=function(e){null!=e&&this._isSelectionEnabled()&&this.SetSelection(e)},A.prototype._updateHeaderOptions=function(e,t){if(null!=t&&null!=t.subkey){var i,s=t.subkey.split("."),n=s[0],o=s[1];if("column"===n&&null!=this.m_colHeader&&null!=this.m_colHeader.firstChild?i=this.m_colHeader.firstChild.childNodes:"row"===n&&null!=this.m_rowHeader&&null!=this.m_rowHeader.firstChild?i=this.m_rowHeader.firstChild.childNodes:"columnEnd"===n&&null!=this.m_colEndHeader&&null!=this.m_colEndHeader.firstChild?i=this.m_colEndHeader.firstChild.childNodes:"rowEnd"===n&&null!=this.m_rowEndHeader&&null!=this.m_rowEndHeader.firstChild&&(i=this.m_rowEndHeader.firstChild.childNodes),null!=i)for(var r=0;r<i.length;r++){var l=i[r],a=l[this.getResources().getMappedAttribute("context")];if(a.index=this.getHeaderCellIndex(l),"resizable"===o)this._isHeaderResizeEnabled(n,a)?this._setAttribute(l,o,"true"):this._setAttribute(l,o,"false");else if("sortable"===o){var h=this.m_utils.containsCSSClassName(l.lastChild,this.getMappedStyle("sortIcon"));if(this._isSortEnabled(n,a)){if(!h){var d=this._buildSortIcon(a,l);l.appendChild(d)}this._setAttribute(l,o,"true")}else h&&this._remove(l.lastChild),this._setAttribute(l,o,"false")}}}},A.prototype._updateGridlines=function(){var e=this.m_options.getHorizontalGridlines(),t=this.m_options.getVerticalGridlines(),i=this.getResources().isRTLMode()?"right":"left";if(this.m_databody&&this.m_databody.firstChild){let s=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),n=this._getLastAxis("row"),o=this._getLastAxis("column");for(let r=0;r<s.length;r++){let l=s[r],a=this.getCellIndexes(l);"hidden"===t||a.column===o&&(this.getRowHeaderWidth()+this.getElementDir(l,i)+this.calculateColumnWidth(l)>=this.getWidth()||this.m_endRowEndHeader>-1)?this.m_utils.addCSSClassName(l,this.getMappedStyle("borderVerticalNone")):this.m_utils.removeCSSClassName(l,this.getMappedStyle("borderVerticalNone")),"hidden"===e||a.row===n&&(this.getRowBottom(l,null)>=this.getHeight()||this.m_endColEndHeader>-1)?this.m_utils.addCSSClassName(l,this.getMappedStyle("borderHorizontalNone")):this.m_utils.removeCSSClassName(l,this.getMappedStyle("borderHorizontalNone"))}}},A.prototype._updateEdgeCellBorders=function(e){if(null!=this.m_active&&"cell"===this.m_active.type){var t=this._getActiveElement();null!=t&&((this._isCellEditable()&&""===e||""!==e)&&this._applyBorderClassesAroundRange(t,{startIndex:this.m_active.indexes},""===e,"Edit"),this._isLastRow(this.m_active.indexes.row)&&("none"===e?this.m_utils.addCSSClassName(t,this.getMappedStyle("borderHorizontalNone")):this.m_utils.removeCSSClassName(t,this.getMappedStyle("borderHorizontalNone"))),this._isLastColumn(this.m_active.indexes.column)&&("none"===e?this.m_utils.addCSSClassName(t,this.getMappedStyle("borderVerticalNone")):this.m_utils.removeCSSClassName(t,this.getMappedStyle("borderVerticalNone"))))}},A.prototype.SetResources=function(e){this.m_resources=e},A.prototype.getResources=function(){return this.m_resources},A.prototype.getStartRowHeader=function(){return this.m_startRowHeader},A.prototype.getStartColumnHeader=function(){return this.m_startColHeader},A.prototype.getStartRowEndHeader=function(){return this.m_startRowEndHeader},A.prototype.getStartColumnEndHeader=function(){return this.m_startColEndHeader},A.prototype.getMappedStyle=function(e){return this.getResources().getMappedStyle(e)},A.prototype.SetDataSource=function(e){this.m_modelEvents=[],this.m_dataSource=e},A.prototype.getDataSource=function(){return this.m_dataSource},A.prototype.setVisibility=function(e){this.m_visibility=e},A.prototype.getVisibility=function(){return null==this.m_visibility&&(null!=this.m_root.offsetParent?this.setVisibility(A.VISIBILITY_STATE_VISIBLE):this.setVisibility(A.VISIBILITY_STATE_HIDDEN)),this.m_visibility},A.prototype.SetOptionCallback=function(e){this.m_setOptionCallback=e},A.prototype.SetContextCallback=function(e){this.m_contextCallback=e},A.prototype.SetCustomElementCallback=function(e){this.m_isCustomElementCallback=e},A.prototype.SetRemoveCallback=function(e){this.m_removeCallback=e},A.prototype.SetUniqueIdCallback=function(e){this._uniqueIdCallback=e},A.prototype.SetCompareValuesCallback=function(e){this._compareValuesCallback=e},A.prototype.SetSubtreeAttachedCallback=function(e){this.m_subtreeAttachedCallback=e},A.prototype.SetUpdateScrollPostionOnRefreshCallback=function(e){this.m_updateScrollPostionOnRefreshCallback=e},A.prototype._remove=function(e){null!=e&&(this._uniqueIdCallback(e,!0),this.m_removeCallback.call(null,e))},A.prototype._removeFromArray=function(e){for(var t=0;t<e.length;t++)this._remove(e[t])},A.prototype.SetNotReadyCallback=function(e){this.m_notReady=e},A.prototype.SetMakeReadyCallback=function(e){this.m_makeReady=e},A.prototype._signalTaskStart=function(){this.m_readinessStack&&(0===this.m_readinessStack.length&&this.m_notReady(),this.m_readinessStack.push(1))},A.prototype._signalTaskEnd=function(){this.m_readinessStack&&this.m_readinessStack.length>0&&(this.m_readinessStack.pop(),0===this.m_readinessStack.length&&this.m_makeReady())},A.prototype._indexes=function(e,t){var i=this,s=this.getDataSource().indexes(e);"function"==typeof s.then?(i._signalTaskStart(),s.then(function(s){t.call(i,s,e),i._signalTaskEnd()},function(){t.call(i,{row:-1,column:-1},e),i._signalTaskEnd()})):t.call(i,s,e)},A.prototype._keys=function(e,t){var i=this,s=this._getLocalKeys(e);if(void 0===s){var n=this.getDataSource().keys(e);"function"==typeof n.then?(i._signalTaskStart(),n.then(function(s){t.call(i,s,e),i._signalTaskEnd()},function(){t.call(i,{row:null,column:null},e),i._signalTaskEnd()})):t.call(i,n,e)}else t.call(i,s,e)},A.prototype._getLocalKeys=function(e){var t=this._getCellByIndex(e);if(t)return this.getCellKeys(t);var i,s,n=e.row,o=e.column;if(void 0!==n){if(-1===n)i=null;else{var r=this._getCellOrHeaderByIndex(n,"row");r&&(i=this._getKey(r,"row"))}if(void 0===i)return}if(void 0!==o){if(-1===o)s=null;else{var l=this._getCellOrHeaderByIndex(o,"column");l&&(s=this._getKey(l,"column"))}if(void 0===s)return}return this.createIndex(i,s)},A.prototype.SetCreateContextCallback=function(e){this.m_createContextCallback=e},A.prototype.SetFocusableCallback=function(e,t){this.m_focusInHandler=e,this.m_focusOutHandler=t},A.prototype.SetFixContextCallback=function(e){this.m_fixContextCallback=e},A.prototype.SetCustomElement=function(e){this.m_customElement=e},A.prototype._isHighWatermarkScrolling=function(){return"scroll"!==this.m_options.getScrollPolicy()},A.prototype.destroy=function(){delete this.m_fetching,this._removeDataSourceEventListeners(),this._removeDomEventListeners(),delete this.m_styleClassDimensionMap,this.m_styleClassDimensionMap={width:{},height:{}}},A.prototype._addDataSourceEventListeners=function(){this._removeDataSourceEventListeners(),null!=this.m_dataSource&&(this.m_handleModelEventListener=this.handleModelEvent.bind(this),this.m_handleExpandEventListener=this.handleExpandEvent.bind(this),this.m_handleCollapseEventListener=this.handleCollapseEvent.bind(this),this.m_dataSource.on("change",this.m_handleModelEventListener,this),this.m_dataSource.on("expand",this.m_handleExpandEventListener,this),this.m_dataSource.on("collapse",this.m_handleCollapseEventListener,this))},A.prototype._removeDataSourceEventListeners=function(){null!=this.m_dataSource&&(this.m_dataSource.off("change",this.m_handleModelEventListener),this.m_dataSource.off("expand",this.m_handleExpandEventListener),this.m_dataSource.off("collapse",this.m_handleCollapseEventListener))},A.prototype._addDomEventListeners=function(){this.m_handleDatabodyKeyDown||(this.m_handleDatabodyKeyDown=this.handleDatabodyKeyDown.bind(this)),this.m_handleDatabodyKeyUp||(this.m_handleDatabodyKeyUp=this.handleDatabodyKeyUp.bind(this)),this.m_handleRootFocus||(this.m_handleRootFocus=this.handleRootFocus.bind(this)),this.m_handleRootBlur||(this.m_handleRootBlur=this.handleRootBlur.bind(this)),this.m_root.addEventListener("keydown",this.m_handleDatabodyKeyDown,!1),this.m_root.addEventListener("keyup",this.m_handleDatabodyKeyUp,!1),this.m_root.addEventListener("focus",this.m_handleRootFocus,!0),this.m_root.addEventListener("blur",this.m_handleRootBlur,!0)},A.prototype._removeDomEventListeners=function(){document.removeEventListener("mousemove",this.m_docMouseMoveListener,!1),document.removeEventListener("mouseup",this.m_docMouseUpListener,!1),null!=this.m_root&&(this.m_handleDatabodyKeyDown&&this.m_root.removeEventListener("keydown",this.m_handleDatabodyKeyDown,!1),this.m_handleDatabodyKeyUp&&this.m_root.removeEventListener("keyup",this.m_handleDatabodyKeyUp,!1),this.m_handleRootFocus&&this.m_root.removeEventListener("focus",this.m_handleRootFocus,!0),this.m_handleRootBlur&&this.m_root.removeEventListener("blur",this.m_handleRootBlur,!0))},A.prototype.getRootElement=function(){return this.m_root},A.prototype.getWidth=function(){return null==this.m_width&&(this.m_width=this.getRootElement().clientWidth),this.m_width},A.prototype.getHeight=function(){return null==this.m_height&&(this.m_height=this.getRootElement().clientHeight),this.m_height},A.prototype.getScrollableWidth=function(){var e=this.m_databody.firstChild;return this.getElementWidth(e)},A.prototype.getViewportWidth=function(){var e=this.getWidth();return Math.round(1.5*e)},A.prototype.getViewportHeight=function(){var e=this.getHeight();return Math.round(1.5*e)},A.prototype._getViewportTop=function(){return this.m_currentScrollTop},A.prototype._getViewportBottom=function(){var e=this._getViewportTop(),t=this.getElementHeight(this.m_databody),i=this.m_utils.getScrollbarSize();return this.m_hasHorizontalScroller?e+t-i:e+t},A.prototype._getViewportLeft=function(){return this.m_currentScrollLeft},A.prototype._getViewportRight=function(){var e=this._getViewportLeft(),t=this.getElementWidth(this.m_databody),i=this.m_utils.getScrollbarSize();return this.m_hasVerticalScroller?e+t-i:e+t},A.prototype.getFetchSize=function(e){return"row"===e?(null==this.m_rowFetchSize&&(this.m_rowFetchSize=Math.max(1,Math.round(this.getViewportHeight()/this.getDefaultRowHeight()))),this.m_rowFetchSize):"column"===e?(null==this.m_columnFetchSize&&(this.m_columnFetchSize=Math.max(1,Math.round(this.getViewportWidth()/this.getDefaultColumnWidth()))),this.m_columnFetchSize):0},A.prototype.getEmptyText=function(){var e=this.m_options.getEmptyText();null==e&&(e=this.getResources().getTranslatedText("msgNoData"));return e},A.prototype._buildEmptyText=function(){let e;if(null==this.getDataSource()){let t=this.getWidth(),i=this.getHeight();e=this.buildDatabody(!0),this.setElementWidth(e,t),this.setElementHeight(e,i),this.m_root.insertBefore(e,this.m_status)}const t=this._getTemplateEngine(),i=this._getItemTemplateBySlotName("noData");if(e=this.m_databody,i&&null!=t){let s=document.createElement("div");return s.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),s.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),s.id=this.createSubId("noData"),this.m_utils.addCSSClassName(s,this.getMappedStyle("noDataContainer")),t.execute(this.getRootElement(),i,{},null,e).forEach(function(e){s.appendChild(e)}),this._removeFocusFromChildElements({},s),s}var s=this.getEmptyText(),n=document.createElement("div");return n.id=this.createSubId("empty"),n.className=this.getMappedStyle("emptytext"),n.textContent=s,this.m_empty=n,n},A.prototype.getRowThreshold=function(){return 0},A.prototype.getColumnThreshold=function(){return 0},A.prototype.setDefaultDimensions=function(){var e=document.createElement("div");e.style.visibilty="hidden";var t=this.getResources();e.className=t.getMappedStyle("rowheadercell")+" "+t.getMappedStyle("colheadercell")+" "+t.getMappedStyle("headercell"),this.m_root.appendChild(e);var i=e.getBoundingClientRect();this.m_defaultColumnWidth=Math.round(i.width),this.m_defaultRowHeight=Math.round(i.height),this.getViewportWidth(),this.getViewportHeight(),this.m_root.removeChild(e)},A.prototype.getDefaultRowHeight=function(){return null==this.m_defaultRowHeight&&this.setDefaultDimensions(),this.m_defaultRowHeight},A.prototype.getDefaultColumnWidth=function(){return null==this.m_defaultColumnWidth&&this.setDefaultDimensions(),this.m_defaultColumnWidth},A.prototype._getHeaderDimension=function(e,t,i,s){var n=this.m_sizingManager.getSize(i,t);if(null!=n)return n;if(""!==e.style[s])return n=this.getElementDir(e,s),this.m_sizingManager.setSize(i,t,n),n;var o=e.className;return null==(n=this.m_styleClassDimensionMap[s][o])&&(n=this.getElementDir(e,s)),this.m_sizingManager.setSize(i,t,n),this.m_styleClassDimensionMap[s][o]=n,n},A.prototype.createSubId=function(e){return[this.getRootElement().id,e].join(":")},A.prototype.isHeaderFetchComplete=function(){return!1===this.m_fetching.row&&!1===this.m_fetching.column},A.prototype.isFetchComplete=function(){return null!=this.m_fetching&&this.isHeaderFetchComplete()&&!1===this.m_fetching.cells},A.prototype._isLastRow=function(e){return this._isCountUnknown("row")?e===this.m_endRow&&this.m_stopRowFetch:e+1===this.getDataSource().getCount("row")},A.prototype._isLastColumn=function(e){return this._isCountUnknown("column")?e===this.m_endCol&&this.m_stopColumnFetch:e+1===this.getDataSource().getCount("column")},A.prototype._getLastAxis=function(e){return this._isCountUnknown(e)?("row"===e?this.m_stopRowFetch:this.m_stopColumnFetch)?"row"===e?this.m_endRow:this.m_endCol:"row"===e?this.m_endRow+1:this.m_endCol+1:this.getDataSource().getCount(e)-1},A.prototype.empty=function(){this.m_empty&&this._remove(this.m_empty),this.m_corner&&this._remove(this.m_corner),this.m_bottomCorner&&this._remove(this.m_bottomCorner),this.m_columnHeaderScrollbarSpacer&&this._remove(this.m_columnHeaderScrollbarSpacer),this.m_rowHeaderScrollbarSpacer&&this._remove(this.m_rowHeaderScrollbarSpacer),this.m_root.removeChild(this.m_placeHolder),this.m_root.removeChild(this.m_status),this.m_root.removeChild(this.m_accSummary),this.m_root.removeChild(this.m_accInfo),this.m_root.removeChild(this.m_stateInfo),this.m_root.removeChild(this.m_contextInfo),this._remove(this.m_colHeader),this._remove(this.m_rowHeader),this._remove(this.m_colEndHeader),this._remove(this.m_rowEndHeader),this._remove(this.m_databody),this._clearDatabodyMap()},A.prototype.refresh=function(e){this.resetInternal(),this.render(e)},A.prototype.resetInternal=function(){this.m_initialized=!1,this.m_readinessStack=[],this._signalTaskStart(),this._signalTaskEnd(),this._clearDatabodyMap(),this.m_cursor=null,this.m_corner=null,this.m_bottomCorner=null,this.m_columnHeaderScrollbarSpacer=null,this.m_rowHeaderScrollbarSpacer=null,this.m_colHeader=null,this.m_colEndHeader=null,this.m_rowHeader=null,this.m_rowEndHeader=null,this.m_databody=null,this.m_empty=null,this.m_accInfo=null,this.m_accSummary=null,this.m_contextInfo=null,this.m_placeHolder=null,this.m_stateInfo=null,this.m_status=null,this.m_headerLabels={row:[],column:[],rowEnd:[],columnEnd:[]},this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.m_rowFetchSize=null,this.m_columnFetchSize=null,this.m_fetching=null,this.m_processingModelEvent=!1,this.m_processingEventQueue=!1,this.m_animating=!1,this.m_fetchingForUpdate=!1,this.m_sizingManager.clear(),this.m_styleClassDimensionMap={width:{},height:{}},this.m_height=null,this.m_width=null,this.m_scrollHeight=null,this.m_scrollWidth=null,this.m_avgRowHeight=void 0,this.m_avgColWidth=void 0,this.m_defaultColumnWidth=null,this.m_defaultRowHeight=null,this.m_colHeaderHeight=null,this.m_colEndHeaderHeight=null,this.m_rowHeaderWidth=null,this.m_rowEndHeaderWidth=null,this.m_rowHeaderLevelWidths=[],this.m_rowEndHeaderLevelWidths=[],this.m_columnHeaderLevelHeights=[],this.m_columnEndHeaderLevelHeights=[],this.m_collisionResize=!1,this.m_active=null,this.m_prevActive=null,this.m_trueIndex={},this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_databodyMove=!1,this.m_moveRow=null,this.m_moveRowHeader=null,this.m_dropTarget=null,this.m_dropTargetHeader=null,this.m_floodFillDragState=!1,this.m_dataTransferAction=null,this.m_discontiguousSelection=!1,this.m_selectionFrontier=null,this.m_docMouseMoveListener=null,this.m_docMouseUpListener=null,this.m_modelEvents=[],this.m_hasHorizontalScroller=null,this.m_hasVerticalScroller=null,this.m_currentScrollLeft=null,this.m_currentScrollTop=null,this.m_prevScrollLeft=null,this.m_prevScrollTop=null,this.m_handleScrollOverflow=null,this._clearScrollPositionTimeout(),this.m_resizing=!1,this.m_resizingElement=null,this.m_resizingElementSibling=null,this.m_resizingElementMin=null,this.m_startRow=null,this.m_startCol=null,this.m_endRow=null,this.m_endCol=null,this.m_startRowPixel=null,this.m_startColPixel=null,this.m_endRowPixel=null,this.m_endColPixel=null,this.m_startRowHeader=null,this.m_startColHeader=null,this.m_endRowHeader=null,this.m_endColHeader=null,this.m_startRowHeaderPixel=null,this.m_startColHeaderPixel=null,this.m_endRowHeaderPixel=null,this.m_endColHeaderPixel=null,this.m_rowHeaderLevelCount=null,this.m_columnHeaderLevelCount=null,this.m_startRowEndHeader=null,this.m_startColEndHeader=null,this.m_endRowEndHeader=null,this.m_endColEndHeader=null,this.m_startRowEndHeaderPixel=null,this.m_startColEndHeaderPixel=null,this.m_endRowEndHeaderPixel=null,this.m_endColEndHeaderPixel=null,this.m_rowEndHeaderLevelCount=null,this.m_columnEndHeaderLevelCount=null,this.m_sortInfo=null,this.m_expandCollapseInfo=null,this.m_resizeRequired=null,this.m_externalFocus=null,this.m_currentMode=null,this.m_editMode=null,this.m_hasCells=null,this.m_hasRowHeader=null,this.m_hasRowEndHeader=null,this.m_hasColHeader=null,this.m_hasColEndHeader=null,this.m_isLongScroll=null,this.m_addBorderBottom=null,this.m_addBorderRight=null,this.m_sortContainerWidth=null,this.m_sortContainerHeight=null,this._destroyEditableClone(),this._clearFocusoutTimeout(),this._clearFocusoutBusyState()},A.prototype._shouldInitialize=function(){return this.isFetchComplete()&&!this.m_initialized&&null!=this.m_databody.parentNode},A.prototype._handleInitialization=function(e){!0===e?(this.resizeGrid(),0===this.m_startRow&&0===this.m_startCol&&this.fillViewport(),this.isFetchComplete()&&(this._updateActive(this.m_options.getCurrentCell(),!!this.m_focusOnRefresh,!0),this.m_initialized=!0,this.fireEvent("ready",{}),this._runModelEventQueue())):(this.m_initialized=!0,this.fireEvent("ready",{}),this._runModelEventQueue())},A.prototype._runModelEventQueue=function(){var e;if(null!=this.m_modelEvents){if(this.m_processingEventQueue=!0,0===this.m_modelEvents.length)return void(this.m_processingEventQueue=!1);"expand"===(e=this.m_modelEvents.shift()).operation?this.handleExpandEvent(e,!0):"collapse"===e.operation?this.handleCollapseEvent(e,!0):this.handleModelEvent(e,!0)}else this.m_processingEventQueue=!1},A.prototype.render=function(e){this.m_renderCount+=1,this.m_timingStart=new Date,this.m_fetching={},this.m_startRow=0,this.m_startCol=0,this.m_endRow=-1,this.m_endCol=-1,this.m_startRowPixel=0,this.m_startColPixel=0,this.m_endRowPixel=0,this.m_endColPixel=0,this.m_startRowHeader=0,this.m_startColHeader=0,this.m_endRowHeader=-1,this.m_endColHeader=-1,this.m_startRowHeaderPixel=0,this.m_startColHeaderPixel=0,this.m_endRowHeaderPixel=0,this.m_endColHeaderPixel=0,this.m_startRowEndHeader=0,this.m_startColEndHeader=0,this.m_endRowEndHeader=-1,this.m_endColEndHeader=-1,this.m_startRowEndHeaderPixel=0,this.m_startColEndHeaderPixel=0,this.m_endRowEndHeaderPixel=0,this.m_endColEndHeaderPixel=0,this.m_currentScrollLeft=0,this.m_currentScrollTop=0,this.m_prevScrollLeft=0,this.m_prevScrollTop=0,this.m_handleScrollOverflow=!1,this.m_rowHeaderLevelWidths=[],this.m_rowEndHeaderLevelWidths=[],this.m_columnHeaderLevelHeights=[],this.m_columnEndHeaderLevelHeights=[];var t=this._loadTemplateEngine();t?(this._signalTaskStart("loading template engine"),t.then(()=>{this._signalTaskEnd(),this.m_renderCount-=1,0===this.m_renderCount&&this.buildGrid(e)})):(this.m_renderCount-=1,this.buildGrid(e))},A.prototype._loadTemplateEngine=function(){var e=this._getSlotMap();if(this._isDataGridProvider()&&Object.keys(e).length>1||null==this.getDataSource()&&Object.keys(e).length>0){var t={customElement:this.m_customElement};return new Promise(e=>{p.__getTemplateEngine(t).then(t=>{this.m_engine=t,e(t)},function(e){throw new Error("Error loading template engine: "+e)})})}return null},A.prototype._getTemplateEngine=function(){return this.m_engine},A.prototype._cleanTemplateNodes=function(e){var t=this._getTemplateEngine();null!=t&&t.clean(e)},A.prototype._isDataGridProvider=function(){return this.m_options.options.data&&this.m_options.options.data.fetchByOffset&&!this.m_options.options.data.fetchFirst},A.prototype._getSlotMap=function(){return g.CustomElementUtils.getSlotMap(this.m_root)},A.prototype._getItemTemplateBySlotName=function(e){var t=this._getSlotMap()[e];return t&&t.length>0&&"template"===t[0].tagName.toLowerCase()?t[0]:null},A.prototype.buildGrid=function(e){this.m_root=e,this.m_root.setAttribute("role","application"),this._isCellEditable()?this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("editable")):this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.setDefaultDimensions(),e.tabIndex=0;var t=this.buildStatus();e.appendChild(t),this.m_status=t;var i=this.buildAccSummary();e.appendChild(i),this.m_accSummary=i;var s=this.buildAccInfo();e.appendChild(s),this.m_accInfo=s;var n=this.buildStateInfo();e.appendChild(n),this.m_stateInfo=n;var o=this.buildContextInfo();e.appendChild(o),this.m_contextInfo=o;var r=this.buildPlaceHolder();if(e.appendChild(r),this.m_placeHolder=r,this.m_headerLabels={row:[],column:[],rowEnd:[],columnEnd:[]},null!=this.getDataSource()){this.m_empty=null;var l=this.getResources().isRTLMode(),a=this.buildHeaders("column",this.getMappedStyle("colheader"),this.getMappedStyle("colendheader")),h=a.root,d=a.endRoot;e.insertBefore(h,t),e.insertBefore(d,t);var c=(a=this.buildHeaders("row",this.getMappedStyle("rowheader"),this.getMappedStyle("rowendheader"))).root,m=a.endRoot;e.insertBefore(c,t),e.insertBefore(m,t);var u=this.buildDatabody();if(e.insertBefore(u,t),l&&(h.style.direction="rtl",u.style.direction="rtl"),this.m_isResizing=!1,this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_databodyDragState=!1,this.m_docMouseMoveListener=this.handleMouseMove.bind(this),this.m_docMouseUpListener=this.handleMouseUp.bind(this),this.m_utils.isTouchDevice())u.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),u.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),u.addEventListener("touchend",this.handleTouchEnd.bind(this),!1),u.addEventListener("touchcancel",this.handleTouchCancel.bind(this),!1),h.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),h.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),h.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),h.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),c.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),c.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),c.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),c.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),d.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),d.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),d.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),d.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),m.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),m.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),m.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),m.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1);else{var _=this.m_utils.getMousewheelEvent();u.addEventListener(_,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),u.addEventListener("mousedown",this.handleDatabodyMouseDown.bind(this),!1),u.addEventListener("mousemove",this.handleDatabodyMouseMove.bind(this),!1),u.addEventListener("mouseup",this.handleDatabodyMouseUp.bind(this),!1),u.addEventListener("mouseout",this.handleDatabodyMouseOut.bind(this),!1),u.addEventListener("mouseover",this.handleDatabodyMouseOver.bind(this),!1),u.addEventListener("dblclick",this.handleDatabodyDoubleClick.bind(this),!1),c.addEventListener(_,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),h.addEventListener(_,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),c.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),h.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),c.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),h.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),c.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),h.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),c.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),h.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),c.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),h.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),c.addEventListener("click",this.handleHeaderClick.bind(this),!1),c.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),h.addEventListener("click",this.handleHeaderClick.bind(this),!1),h.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),m.addEventListener(_,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),d.addEventListener(_,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),m.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),d.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),m.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),d.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),m.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),d.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),m.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),d.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),m.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),d.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),m.addEventListener("click",this.handleHeaderClick.bind(this),!1),m.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),d.addEventListener("click",this.handleHeaderClick.bind(this),!1),d.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1)}this._addDnDEventListener(c,m,h,d,u),this._shouldInitialize()&&this._handleInitialization(!0)}else{var p=this._buildEmptyText();this.m_databody.firstChild.appendChild(p),this._handleInitialization(!1)}},A.prototype._addDnDEventListener=function(e,t,i,s,n){e.addEventListener("drag",this.handleRowDrag.bind(this),!1),e.addEventListener("dragstart",this.handleDragStart.bind(this),!1),e.addEventListener("dragend",this.handleRowDragEnd.bind(this),!1),e.addEventListener("dragover",this.handleRowDragOver.bind(this),!1),e.addEventListener("dragenter",this.handleRowDragEnter.bind(this),!1),e.addEventListener("dragleave",this.handleRowDragLeave.bind(this),!1),e.addEventListener("drop",this.handleRowDrop.bind(this),!1),i.addEventListener("dragstart",this.handleDragStart.bind(this),!1),i.addEventListener("dragend",this.handleColumnDragEnd.bind(this),!1),i.addEventListener("dragover",this.handleColumnDragOver.bind(this),!1),i.addEventListener("dragenter",this.handleColumnDragEnter.bind(this),!1),i.addEventListener("dragleave",this.handleColumnDragLeave.bind(this),!1),i.addEventListener("drop",this.handleColumnDrop.bind(this),!1),t.addEventListener("drag",this.handleRowDrag.bind(this),!1),t.addEventListener("dragstart",this.handleDragStart.bind(this),!1),t.addEventListener("dragend",this.handleRowDragEnd.bind(this),!1),t.addEventListener("dragover",this.handleRowDragOver.bind(this),!1),t.addEventListener("dragenter",this.handleRowDragEnter.bind(this),!1),t.addEventListener("dragleave",this.handleRowDragLeave.bind(this),!1),t.addEventListener("drop",this.handleRowDrop.bind(this),!1),s.addEventListener("dragstart",this.handleDragStart.bind(this),!1),s.addEventListener("dragend",this.handleColumnDragEnd.bind(this),!1),s.addEventListener("dragover",this.handleColumnDragOver.bind(this),!1),s.addEventListener("dragenter",this.handleColumnDragEnter.bind(this),!1),s.addEventListener("dragleave",this.handleColumnDragLeave.bind(this),!1),s.addEventListener("drop",this.handleColumnDrop.bind(this),!1),n.addEventListener("dragover",this.handleDatabodyDragOver.bind(this),!1),n.addEventListener("dragenter",this.handleDatabodyDragEnter.bind(this),!1),n.addEventListener("drop",this.handleDatabodyDrop.bind(this),!1)},A.prototype.HandleResize=function(e,t){e=this.getRootElement().clientWidth,t=this.getRootElement().clientHeight,e===this.m_width&&t===this.m_height||(this.m_width=e,this.m_height=t,this.m_rowFetchSize=null,this.m_columnFetchSize=null,this.m_initialized&&(this.resizeGrid(),this.isFetchComplete()&&(this.m_resizeRequired=!0,this.fillViewport())))},A.prototype.resizeGrid=function(){var e=this.getWidth(),t=this.getHeight(),i=this.m_colHeader,s=this.m_colEndHeader,n=this.m_rowHeader,o=this.m_rowEndHeader,r=this.m_databody,l=r.firstChild,a=this.getColumnHeaderHeight(),h=this.getColumnEndHeaderHeight(),d=this.getRowHeaderWidth(),c=this.getRowEndHeaderWidth();this.m_headerLabels.row&&this.m_headerLabels.row.length&&0===a&&(a=this._getCellDimension(this.m_headerLabels.row[0],0,null,"column","height"),this.m_colHeaderHeight=a),this.m_headerLabels.column&&this.m_headerLabels.column.length&&0===d&&(d=this._getCellDimension(this.m_headerLabels.column[0],0,null,"row","width"),this.m_rowHeaderWidth=d);var m,u,_,p=t-a-h,g=e-d-c,f=this.m_utils.getScrollbarSize();this._databodyEmpty()&&(null==this.m_empty?(m=this._buildEmptyText(),u=this.getElementHeight(m),_=this.getElementWidth(m),l=r.firstChild,u>this.getElementHeight(l)&&this.setElementHeight(l,u),_>this.getElementWidth(l)&&this.setElementWidth(l,_),this.m_databody.firstChild.appendChild(m)):m=this.m_empty);var C,y,v,E,w,S=this.getElementWidth(r.firstChild),H=this.getElementHeight(r.firstChild),x=this.isDatabodyHorizontalScrollbarRequired(g);if(x)C=this.isDatabodyVerticalScrollbarRequired(p-f),r.style.overflow="auto";else if(C=this.isDatabodyVerticalScrollbarRequired(p))x=this.isDatabodyHorizontalScrollbarRequired(g-f),r.style.overflow="auto";else{this.m_handleScrollOverflow=!1;var b=this;setTimeout(function(){b.m_handleScrollOverflow||b.m_hasVerticalScroller||b.m_hasHorizontalScroller||(r.style.overflow="hidden",b.m_handleScrollOverflow=!0)},10)}this.m_hasHorizontalScroller=x,this.m_hasVerticalScroller=C,-1!==this.m_endColEndHeader?(y=Math.min(H+(x?f:0),p),v=x?y-f:y):(y=p,v=Math.min(H,x?y-f:y)),-1!==this.m_endRowEndHeader?(E=Math.min(S+(C?f:0),g),w=C?E-f:E):(E=g,w=Math.min(S,C?E-f:E));var R=d+w+(C?f:0),I=a+v+(x?f:0),M=this.getResources().isRTLMode()?"right":"left";this.setElementDir(n,0,M),this.setElementDir(n,a,"top"),this.setElementHeight(n,v),this.setElementDir(o,R,M),this.setElementDir(o,a,"top"),this.setElementHeight(o,v),this.setElementDir(i,d,M),this.setElementWidth(i,w),this.setElementDir(s,d,M),this.setElementDir(s,I,"top"),this.setElementWidth(s,w),this.setElementDir(r,a,"top"),this.setElementDir(r,d,M),this.setElementWidth(r,E),this.setElementHeight(r,y),this.m_scrollWidth=S-w,this.m_scrollHeight=H-v,this.buildCorners(),this._adjustHeaderBorders(),this._updateGridlines(),this.m_resizeRequired=!1},A.prototype._sizeDatabodyScroller=function(){var e,t,i=this.m_databody,s=i.firstChild,n=this._databodyEmptyState(),o=this._isHighWatermarkScrolling(),r=this.m_utils._getMaxDivHeightForScrolling(),l=this.m_utils._getMaxDivWidthForScrolling(),a=this.getDataSource().getCount("row"),h=this.getDataSource().getCount("column"),d=0,c=0;n?(d=Math.max(Math.max(this.m_endRowHeaderPixel,this.m_endRowEndHeaderPixel),1),c=Math.max(Math.max(this.m_endColHeaderPixel,this.m_endColEndHeaderPixel),1)):(d=this.m_endRowPixel,c=this.m_endColPixel),e=-1===a||o?d:a*this.m_avgRowHeight,t=-1===h||o?c:h*this.m_avgColWidth,this.setElementHeight(s,Math.min(r,e)),this.setElementWidth(s,Math.min(l,t)),this.m_initialized&&(this.m_scrollWidth=this.getElementWidth(s)-Math.min(this.getElementWidth(s),this.getElementWidth(i)-(this.m_hasVerticalScroller?this.m_utils.getScrollbarSize():0)),this.m_scrollHeight=this.getElementHeight(s)-Math.min(this.getElementHeight(s),this.getElementHeight(i)-(this.m_hasHorizontalScroller?this.m_utils.getScrollbarSize():0)))},A.prototype._adjustLastHeadersAlongAxis=function(e,t,i,s,n,o){for(var r=0;r<t;){var l=this._getHeaderByIndex(e,r,i,t,s);o?this.m_utils.removeCSSClassName(l,n):this.m_utils.addCSSClassName(l,n),r+=this.getHeaderCellDepth(l)}},A.prototype._adjustHeaderBordersAlongAxis=function(e,t,i,s,n,o,r,l){null!=e&&i>=0&&(s?this.m_utils.addCSSClassName(n,o):this.m_utils.removeCSSClassName(n,o),t(i)&&this._adjustLastHeadersAlongAxis(i,r,e,l,o,s))},A.prototype._adjustHeaderBorders=function(){var e,t,i,s,n,o=this.m_utils.getScrollbarSize(),r=this.getWidth(),l=this.getHeight(),a=this.getColumnHeaderHeight(),h=this.getElementWidth(this.m_colHeader),d=this.getColumnEndHeaderHeight(),c=this.getRowHeaderWidth(),m=this.getElementHeight(this.m_rowHeader),u=c+h+this.getRowEndHeaderWidth()+(this.m_hasVerticalScroller?o:0)<r,_=a+m+d+(this.m_hasHorizontalScroller?o:0)<l;if(u&&this.m_endRowEndHeader>=0?(e=!0,this.m_addBorderRight=!0):!0===this.m_addBorderRight&&(e=!1),null!=e)for(t=this.getMappedStyle("borderVerticalSmall"),null!=this.m_columnHeaderScrollbarSpacer&&(e?this.m_utils.addCSSClassName(this.m_columnHeaderScrollbarSpacer,t):this.m_utils.removeCSSClassName(this.m_columnHeaderScrollbarSpacer,t)),null!=this.m_bottomCorner&&(e?this.m_utils.addCSSClassName(this.m_bottomCorner,t):this.m_utils.removeCSSClassName(this.m_bottomCorner,t)),s=this.m_rowEndHeader.firstChild.childNodes,i=0;i<s.length;i++)e?this.m_utils.addCSSClassName(s[i],t):this.m_utils.removeCSSClassName(s[i],t);else t=this.getMappedStyle("borderVerticalNone"),n=this._isLastColumn.bind(this),this._adjustHeaderBordersAlongAxis(this.m_colHeader,n,this.m_endColHeader,u,this.m_columnHeaderScrollbarSpacer,t,this.m_columnHeaderLevelCount,this.m_startColHeader),this._adjustHeaderBordersAlongAxis(this.m_colEndHeader,n,this.m_endColEndHeader,u,this.m_bottomCorner,t,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader);if(e=null,_&&this.m_endColEndHeader>=0?(this.m_addBorderBottom=!0,e=!0):!0===this.m_addBorderBottom&&(e=!1),null!=e)for(t=this.getMappedStyle("borderHorizontalSmall"),null!=this.m_rowHeaderScrollbarSpacer&&(e?this.m_utils.addCSSClassName(this.m_rowHeaderScrollbarSpacer,t):this.m_utils.removeCSSClassName(this.m_rowHeaderScrollbarSpacer,t)),null!=this.m_bottomCorner&&(e?this.m_utils.addCSSClassName(this.m_bottomCorner,t):this.m_utils.removeCSSClassName(this.m_bottomCorner,t)),s=this.m_colEndHeader.firstChild.childNodes,i=0;i<s.length;i++)e?this.m_utils.addCSSClassName(s[i],t):this.m_utils.removeCSSClassName(s[i],t);else t=this.getMappedStyle("borderHorizontalNone"),n=this._isLastRow.bind(this),this._adjustHeaderBordersAlongAxis(this.m_rowHeader,n,this.m_endRowHeader,_,this.m_rowHeaderScrollbarSpacer,t,this.m_rowHeaderLevelCount,this.m_startRowHeader),this._adjustHeaderBordersAlongAxis(this.m_rowEndHeader,n,this.m_endRowEndHeader,_,this.m_bottomCorner,t,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader)},A.prototype._isHeaderLabelCollision=function(){return this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]},A.prototype.buildCorners=function(){var e,t,i,s,n=this.m_utils.getScrollbarSize(),o=this.getWidth(),r=this.getHeight(),l=this.getColumnHeaderHeight(),a=this.getElementWidth(this.m_colHeader),h=this.getColumnEndHeaderHeight(),d=this.getRowHeaderWidth(),c=this.getRowEndHeaderWidth(),m=this.getElementHeight(this.m_rowHeader),u=this.getResources().isRTLMode()?"right":"left";let _,p,g,f,C,y,v=!0,E=l,w=d;if(-1!==this.m_endRowHeader&&-1!==this.m_endColHeader?(p=this.m_headerLabels.column.length?this.m_columnHeaderLevelHeights[this.m_columnHeaderLevelCount-1]:this.m_colHeaderHeight,_=this.m_headerLabels.row.length?this.m_rowHeaderLevelWidths[this.m_rowHeaderLevelCount-1]:this.m_rowHeaderWidth,C=m+l,y=h+(this.m_hasHorizontalScroller?n:0),g=d+a,f=c+(this.m_hasVerticalScroller?n:0)):-1!==this.m_endRowHeader&&-1===this.m_endColHeader?(p=l,C=m+l,y=h+(this.m_hasHorizontalScroller?n:0),g=d,f=c+a+(this.m_hasVerticalScroller?n:0)):-1===this.m_endRowHeader&&-1!==this.m_endColHeader?(_=d,C=l,y=h+m+(this.m_hasHorizontalScroller?n:0),g=d+a,f=c+(this.m_hasVerticalScroller?n:0)):v=!1,v){if(null!=this.m_corner?e=this.m_corner:((e=document.createElement("div")).id=this.createSubId("corner"),e.className=this.getMappedStyle("topcorner")),this.setElementWidth(e,d),this.setElementHeight(e,l),null==this.m_corner){if(this._attachEventListenersOnCorner(e),this.m_root.appendChild(e),this.m_corner=e,p)for(s=0;s<this.m_headerLabels.row.length;s++)null!=(i=this.m_headerLabels.row[s])&&(this.setElementHeight(i,p),e.appendChild(i));if(_)for(s=0;s<this.m_headerLabels.column.length;s++)null!=(i=this.m_headerLabels.column[s])&&(this.setElementWidth(i,_),e.appendChild(i));if(this.m_subtreeAttachedCallback(e),this._isHeaderLabelCollision()){let e=this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],t=this.getElementHeight(e);return this.m_colHeaderHeight+=t,this.m_columnHeaderLevelHeights[this.m_columnHeaderLevelCount-1]+=t,this.resizeColumnHeightsAndShift(t,this.m_columnHeaderLevelCount-1,!1),this.setElementHeight(this.m_colHeader,this.m_colHeaderHeight),void this.manageResizeScrollbars()}}else{this.m_utils.isTouchDevice()?(e.addEventListener("touchstart",this.handleHeaderLabelMouseDown.bind(this),!1),e.addEventListener("touchmove",this.handleHeaderLabelMouseMove.bind(this),!1)):(e.addEventListener("mousedown",this.handleHeaderLabelMouseDown.bind(this),!1),e.addEventListener("mousemove",this.handleHeaderLabelMouseMove.bind(this),!1))}this._buildCornerOnHeaderAxisDisabled("row",u,0,C,w,y),this._buildCornerOnHeaderAxisDisabled("column",u,g,0,f,E)}else this.m_headerLabels.row=[],this.m_headerLabels.column=[];null!=this.m_corner&&null==e&&(this.m_root.removeChild(this.m_corner),this.m_corner=null),(this.m_hasHorizontalScroller&&this.m_hasVerticalScroller||this.m_hasVerticalScroller&&-1!==this.m_endColEndHeader||this.m_hasHorizontalScroller&&-1!==this.m_endRowEndHeader||-1!==this.m_endRowEndHeader&&-1!==this.m_endColEndHeader)&&(null!=this.m_bottomCorner?t=this.m_bottomCorner:((t=document.createElement("div")).id=this.createSubId("bcorner"),t.className=this.getMappedStyle("bottomcorner")),this.setElementDir(t,m+l,"top"),this.setElementDir(t,d+a,u),-1!==this.m_endRowEndHeader?this.setElementWidth(t,c+(this.m_hasVerticalScroller?n:0)):this.setElementWidth(t,o-a-d),-1!==this.m_endColEndHeader?this.setElementHeight(t,h+(this.m_hasHorizontalScroller?n:0)):this.setElementHeight(t,r-m-l),null==this.m_bottomCorner&&(this.m_root.appendChild(t),this.m_bottomCorner=t)),null!=this.m_bottomCorner&&null==t&&(this.m_root.removeChild(this.m_bottomCorner),this.m_bottomCorner=null)},A.prototype._attachEventListenersOnCorner=function(e){this.m_utils.isTouchDevice()?e.addEventListener("touchstart",this.handleCornerMouseDown.bind(this),{passive:!0}):(e.addEventListener("mousedown",this.handleCornerMouseDown.bind(this),!1),e.addEventListener("mouseover",this.handleCornerMouseOver.bind(this),!1),e.addEventListener("mouseout",this.handleCornerMouseOut.bind(this),!1)),e.addEventListener("click",this.handleCornerClick.bind(this),!1)},A.prototype._buildCornerOnHeaderAxisDisabled=function(e,t,i,s,n,o){let r,l="column"===e?this.m_columnHeaderScrollbarSpacer:this.m_rowHeaderScrollbarSpacer,a=!1;if("column"===e?(this.m_hasVerticalScroller||-1!==this.m_endRowEndHeader)&&(a=!0,null!=this.m_columnHeaderScrollbarSpacer?r=this.m_columnHeaderScrollbarSpacer:(r=document.createElement("div"),r.id=this.createSubId("chSbSpacer"),r.className=this.getMappedStyle("colheaderspacer"))):"row"===e&&(this.m_hasHorizontalScroller||-1!==this.m_endColEndHeader)&&(a=!0,null!=this.m_rowHeaderScrollbarSpacer?r=this.m_rowHeaderScrollbarSpacer:(r=document.createElement("div"),r.id=this.createSubId("rhSbSpacer"),r.className=this.getMappedStyle("rowheaderspacer"))),a){let a,h;if(this.setElementDir(r,i,t),this.setElementDir(r,s,"top"),this.setElementWidth(r,n),this.setElementHeight(r,o),null==l){if(this.m_utils.isTouchDevice()?r.addEventListener("touchstart",this.handleCornerMouseDown.bind(this),{passive:!0}):(r.addEventListener("mousedown",this.handleCornerMouseDown.bind(this),!1),r.addEventListener("mouseover",this.handleCornerMouseOver.bind(this),!1),r.addEventListener("mouseout",this.handleCornerMouseOut.bind(this),!1),"disable"!==this.isResizeEnabled()&&(r.addEventListener("mousedown",this.handleHeaderLabelMouseDown.bind(this),!1),r.addEventListener("mousemove",this.handleHeaderLabelMouseMove.bind(this),!1))),this.m_root.appendChild(r),"column"===e?(this.m_columnHeaderScrollbarSpacer=r,a=this.m_headerLabels.rowEnd):(this.m_rowHeaderScrollbarSpacer=r,a=this.m_headerLabels.columnEnd),a.length)for(let e=0;e<a.length;e++)h=a[e],null!=h&&r.appendChild(h);this.m_subtreeAttachedCallback(r)}}else"column"===e?(null!=this.m_columnHeaderScrollbarSpacer&&this.m_root.removeChild(this.m_columnHeaderScrollbarSpacer),this.m_columnHeaderScrollbarSpacer=null,this.m_headerLabels.rowEnd=[]):(null!=this.m_rowHeaderScrollbarSpacer&&this.m_root.removeChild(this.m_rowHeaderScrollbarSpacer),this.m_rowHeaderScrollbarSpacer=null,this.m_headerLabels.columnEnd=[])},A.prototype._updateScrollPosition=function(e){this._scrollToScrollPositionObject(e)},A.prototype._setScrollPosition=function(){this.m_setOptionCallback("scrollPosition",this._createScrollPositionObject(this.m_currentScrollLeft,this.m_currentScrollTop),{_context:{writeback:!0,internalSet:!0}})},A.prototype._clearScrollPositionKeys=function(){var e=this.m_options.getScrollPosition();e.rowKey=void 0,e.columnKey=void 0,this.m_setOptionCallback("scrollPosition",e,{_context:{internalSet:!0}})},A.prototype._createScrollPositionObject=function(e,t){var i={x:e,y:t},s=this.getResources().isRTLMode()?"right":"left",n=this._getCellAtPixel(e,t);if(null!=n)i.rowIndex=this._getIndex(n,"row"),i.columnIndex=this._getIndex(n,"column"),i.rowKey=this._getKey(n,"row"),i.columnKey=this._getKey(n,"column"),i.offsetX=e-this.getElementDir(n,s),i.offsetY=t-this.getElementDir(n,"top");else{var o=this._getHeaderAtPixel(t,"row");null!=o&&(i.rowIndex=this._getIndex(o),i.rowKey=this._getKey(o),i.offsetY=t-this.getElementDir(o,"top"));var r=this._getHeaderAtPixel(e,"column");null!=r&&(i.columnIndex=this._getIndex(r),i.columnKey=this._getKey(r),i.offsetX=e-this.getElementDir(r,s))}return i},A.prototype._getCellAtPixel=function(e,t){for(var i=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),s=this.getResources().isRTLMode()?"right":"left",n=0;n<i.length;n++){var o=i[n],r=this.getElementDir(o,s),l=r+this.getElementWidth(o);if(r<=e&&e<l){var a=this.getElementDir(o,"top"),h=a+this.getElementHeight(o);if(a<=t&&t<h)return o}}return null},A.prototype._getAxisInnerMostHeaders=function(e){var t,i,s=this.getMappedStyle("headercell");switch(e){case"row":t=this.m_rowHeader,i=this.m_rowHeaderLevelCount;break;case"column":t=this.m_colHeader,i=this.m_columnHeaderLevelCount;break;case"rowEnd":t=this.m_rowEndHeader,i=this.m_rowEndHeaderLevelCount;break;case"columnEnd":t=this.m_colEndHeader,i=this.m_columnEndHeaderLevelCount}var n=[];if(t)for(var o=t.getElementsByClassName(s),r=0;r<o.length;r++){var l=o[r],a=l[this.getResources().getMappedAttribute("context")];a.level+a.depth===i&&n.push(l)}return n},A.prototype._getHeaderAtPixel=function(e,t){var i,s,n,o,r=this;function l(t){for(var i=0;i<t.length;i++){var s=t[i],l=r.getElementDir(s,n),a=l+r.getElementDir(s,o);if(l<=e&&e<a)return s}}i=this._getAxisInnerMostHeaders(t),s=this._getAxisInnerMostHeaders(t+"End"),"row"===t?(n="top",o="height"):"column"===t&&(n=this.getResources().isRTLMode()?"right":"left",o="width");var a=l(i);return null==a&&(a=l(s)),a},A.prototype._checkScrollPosition=function(){null!=this.m_desiredScrollPositionObject?this._scrollToScrollPositionObject(this.m_desiredScrollPositionObject):this._setScrollPosition()},A.prototype._areKeysLocallyAvailable=function(e,t){var i=!0;return e&&null==this._getCellOrHeaderByKey(e,"row")&&(i=!1),t&&null==this._getCellOrHeaderByKey(t,"column")&&(i=!1),i},A.prototype._scrollToScrollPositionObject=function(e){var t=e.x,i=e.y,s=e.rowIndex,n=e.columnIndex,o=e.rowKey,r=e.columnKey,l=e.offsetX?e.offsetX:0,a=e.offsetY?e.offsetY:0,h=this.getResources().isRTLMode()?"right":"left",d=this.m_options.getScrollToKey();if("never"!==d||!o&&!r){if("always"!==d)if(this.getDataSource()instanceof S&&!this._areKeysLocallyAvailable(o,r)){var c=this.m_options.getProperty("data").getCapability("fetchFirst");if(null==c||"immediate"!==c.iterationSpeed)return}var m=this;this._getIndexFromKeyPromise(o,r).then(function(d){var c=Math.floor(m._getPositionEstimate("column",h,r,d.columnIndexFromKey,n,t,l,m.m_currentScrollLeft,m._getMaxRightPixel(),m.m_avgColWidth)),u=Math.floor(m._getPositionEstimate("row","top",o,d.rowIndexFromKey,s,i,a,m.m_currentScrollTop,m._getMaxBottomPixel(),m.m_avgRowHeight));c!==m.m_currentScrollLeft&&(m.m_currentScrollLeft!==m.m_scrollWidth||c<m.m_currentScrollLeft)||u!==m.m_currentScrollTop&&(m.m_currentScrollTop!==m.m_scrollHeight||u<m.m_currentScrollTop)?(null==m.m_desiredScrollPositionObject&&m._signalTaskStart("begin scrolling to new desired location"),m.m_desiredScrollPositionObject=e,m._setScrollPositionTimeout(),m._initiateScroll(c,u)):(null!=m.m_desiredScrollPositionObject&&m._signalTaskEnd("reached desired location"),m.m_desiredScrollPositionObject=null,m._setScrollPosition())})}},A.prototype._setScrollPositionTimeout=function(){this.m_utils.isTouchDeviceNotIOS()||(this.pendingScrollTimeout=setTimeout(function(){null!=this.m_desiredScrollPositionObject&&this._signalTaskEnd("reached desired location"),this.m_desiredScrollPositionObject=null,this._setScrollPosition()}.bind(this),300))},A.prototype._clearScrollPositionTimeout=function(){null!=this.pendingScrollTimeout&&(clearTimeout(this.pendingScrollTimeout),this.pendingScrollTimeout=null)},A.prototype._getPositionEstimate=function(e,t,i,s,n,o,r,l,a,h){var d,c,m=this._isHighWatermarkScrolling();return null!=i&&-1!==s&&(null!=(c=this._getCellOrHeaderByKey(i,e))?d=this.getElementDir(c,t)+r:m?d=a:null!=s&&(d=h*s+r),null!=d)?d:d=null!=n?null!=(c=this._getCellOrHeaderByIndex(n,e))?this.getElementDir(c,t)+r:m?a:h*n:null!=o?o:l},A.prototype.isDatabodyHorizontalScrollbarRequired=function(e){var t=this.m_databody.firstChild;return this.getElementWidth(t)>e},A.prototype.isDatabodyVerticalScrollbarRequired=function(e){var t=this.m_databody.firstChild;return this.getElementHeight(t)>e},A.prototype.buildStatus=function(){var e=document.createElement("div");e.className=this.getMappedStyle("loadingicon");var t=document.createElement("div");return t.id=this.createSubId("status"),t.className=this.getMappedStyle("status"),t.setAttribute("role","status"),t.appendChild(e),t},A.prototype.buildAccInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("info"),e.className=this.getMappedStyle("info"),e.setAttribute("role","status"),e},A.prototype.buildAccSummary=function(){var e=document.createElement("div");return e.id=this.createSubId("summary"),e.className=this.getMappedStyle("info"),e},A.prototype.buildStateInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("state"),e.className=this.getMappedStyle("info"),e},A.prototype.buildContextInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("context"),e.className=this.getMappedStyle("info"),e},A.prototype.buildPlaceHolder=function(){var e=document.createElement("div");return e.id=this.createSubId("placeHolder"),e.className=this.getMappedStyle("info"),e},A.prototype.populateAccInfo=function(){var e=this.getResources().getTranslatedText("accessibleSummaryExact",{rownum:this.m_endRow+1,colnum:this.m_endCol+1});this.getDataSource().getExpandedKeys&&(e=e+". "+this.getResources().getTranslatedText("accessibleSummaryExpanded",{num:this.getDataSource().getExpandedKeys().length}));e+=". ",this.m_accSummary.textContent=e},A.prototype.SetAccessibleContext=function(e){if(null!=e&&(null!=e.context&&(this.m_accessibleContext=e.context),null!=e.state&&(this.m_stateInfo.textContent=e.state),null!=e.ancestors&&this._isDatabodyCellActive())){var t="",i=e.ancestors,s=this.m_active.indexes.column;if(null!=s&&s>=0)for(var n=0;n<i.length;n++){n>0&&(t=t.concat(", "));var o=i[n],r=this._getAxisCellsByKey(o.key,"row");if(null!=r){var l=r[0].textContent;l=null!=l?l.replace(/\n|<br\s*\/?>/gi,"").trim():"",t=t.concat(o.label).concat(" ").concat(l)}}this.m_accessibleContext=t.concat(", ").concat(this.m_accessibleContext)}},A.prototype._updateStateInfo=function(e){for(var t=". ",i=0;i<e.length;i++){var s=this.getResources().getTranslatedText(e[i].key,e[i].args);null!=s&&(t=2===t.length?t+s:t+", "+s)}t=2===t.length?t:t+". ",this.m_stateInfo.textContent=t},A.prototype._updateContextInfo=function(e,t){var i,s;e.indexes&&(i=e.indexes.row,s=e.indexes.column);var n=e.level,o=e.rowHeader,r=e.rowEndHeader,l=e.columnHeader,a=e.columnEndHeader,h=e.rowHeaderLabel,d=e.rowEndHeaderLabel,c=e.columnHeaderLabel,m=e.columnEndHeaderLabel,u="";null!=this.m_accessibleContext||isNaN(i)||"row"===t||(u=this._updateAccessibleInfoString(u,"accessibleRowContext",{index:i+1})),isNaN(s)||"column"===t||(u=this._updateAccessibleInfoString(u,"accessibleColumnContext",{index:s+1})),isNaN(o)||(u=this._updateAccessibleInfoString(u,"accessibleRowHeaderContext",{index:o+1})),isNaN(l)||(u=this._updateAccessibleInfoString(u,"accessibleColumnHeaderContext",{index:l+1})),isNaN(r)||(u=this._updateAccessibleInfoString(u,"accessibleRowEndHeaderContext",{index:r+1})),isNaN(a)||(u=this._updateAccessibleInfoString(u,"accessibleColumnEndHeaderContext",{index:a+1})),isNaN(h)||(u=this._updateAccessibleInfoString(u,"accessibleRowHeaderLabelContext",{level:h+1})),isNaN(c)||(u=this._updateAccessibleInfoString(u,"accessibleColumnHeaderLabelContext",{level:c+1})),isNaN(d)||(u=this._updateAccessibleInfoString(u,"accessibleRowEndHeaderLabelContext",{level:d+1})),isNaN(m)||(u=this._updateAccessibleInfoString(u,"accessibleColumnEndHeaderLabelContext",{level:m+1})),isNaN(n)||(u=this._updateAccessibleInfoString(u,"accessibleLevelContext",{level:n+1})),u=0===u.length?u:u+". ",null!=this.m_accessibleContext&&(u+=this.m_accessibleContext,this.m_accessibleContext=null),this.m_contextInfo.textContent=u},A.prototype._updateAccessibleInfoString=function(e,t,i){var s=this.getResources().getTranslatedText(t,i);return null!=s?0===e.length?s:e+", "+s:e},A.prototype._isCountUnknown=function(e){var t=this.getDataSource();if("row"===e||"rowEnd"===e){var i=t.getCountPrecision("row"),s=t.getCount("row");return this.m_isEstimateRowCount="estimate"===i||s<0,this.m_isEstimateRowCount}if("column"===e||"columnEnd"===e){var n=t.getCountPrecision("column"),o=t.getCount("column");return this.m_isEstimateColumnCount="estimate"===n||o<0,this.m_isEstimateColumnCount}return!1},A.prototype._isCountUnknownOrHighwatermark=function(e){return this._isCountUnknown(e)||this._isHighWatermarkScrolling()},A.prototype._hideHeader=function(e){e.style.display="none"},A.prototype._showHeader=function(e){e.style.display=""},A.prototype.buildHeaders=function(e,t,i){var s=this.getMappedStyle("scroller")+(this.m_utils.isTouchDeviceNotIOS()?" "+this.getMappedStyle("scroller-mobile"):""),n=document.createElement("div");n.id=this.createSubId(e+"Header"),n.className=t+" "+this.getMappedStyle("header");var o=document.createElement("div");o.className=s,n.appendChild(o);var r=document.createElement("div");r.id=this.createSubId(e+"EndHeader"),r.className=i+" "+this.getMappedStyle("endheader");var l=document.createElement("div");if(l.className=s,r.appendChild(l),"column"===e?(this.m_colHeader=n,this.m_colEndHeader=r):"row"===e&&(this.m_rowHeader=n,this.m_rowEndHeader=r),this._isHighWatermarkScrolling()){this.fetchHeaders(e,0,n,r,null,null)}else{var a=this,h=this.m_options.getScrollPosition();this._getIndexesFromScrollPosition(h).then(function(t){var i=t[e];"column"===e?(a.m_startColHeader=i,a.m_startColEndHeader=i):"row"===e&&(a.m_startRowHeader=i,a.m_startRowEndHeader=i),a.m_fetching[e]=!1,a.fetchHeaders(e,i,n,r,null,null)}),this.m_fetching[e]=!0}return{root:n,endRoot:r}},A.prototype.fetchHeaders=function(e,t,i,s,n,o){if(!this.m_fetching[e]){null==n&&(n=this.getFetchCount(e,t));var r,l={axis:e,start:t,count:n,header:i,endHeader:s};this.m_fetching[e]=l,r=null!=o&&null!=o.success?o.success:this.handleHeadersFetchSuccess,this.showStatusText(),this._signalTaskStart(),this.getDataSource().fetchHeaders(l,{success:r,error:this.handleHeadersFetchError},{success:this,error:this})}},A.prototype.isHeaderFetchResponseValid=function(e){var t=e.axis;return null!=this.m_fetching&&e===this.m_fetching[t]},A.prototype.isHeaderFetchResponseInViewport=function(e){if(!this.m_initialized)return!0;var t=e.axis,i=e.start;return("row"===t?this._getLongScrollStart(this.m_currentScrollTop,this.m_prevScrollTop,t):this._getLongScrollStart(this.m_currentScrollLeft,this.m_prevScrollLeft,t)).start===i},A.prototype.handleHeadersFetchSuccess=function(e,t,i,s){var n=this.m_options.getScrollPolicyOptions(),o=n?n.maxRowCount:null,r=n?n.maxColumnCount:null;if(this.isHeaderFetchResponseValid(t)){var l=t.axis;if(this.isLongScroll()&&!this.isHeaderFetchResponseInViewport(t))return this.m_fetching[l]=!1,this.m_headerInvalid=!0,void this._signalTaskEnd();this.m_fetching[l]=!1;var a=t.header,h=t.endHeader,d=t.start,c=this.getDataSource().getCount(l);"column"===l?(null!=e?(this.buildColumnHeaders(a,e,d,c,!1,!1),(e.getCount()<t.count||r&&r>0&&r===d+e.getCount())&&(this.m_stopColumnHeaderFetch=!0)):this.m_stopColumnHeaderFetch=!0,this.m_endColHeader<0?(this._hideHeader(a),this.m_stopColumnHeaderFetch=!0,this.m_startColHeader=0):(this.m_hasColHeader=!0,this._buildHeaderLabels(l,e)),null!=i?(this.buildColumnEndHeaders(h,i,d,c,!1,!1),(i.getCount()<t.count||r&&r>0&&r===d+i.getCount())&&(this.m_stopColumnEndHeaderFetch=!0)):this.m_stopColumnEndHeaderFetch=!0,this.m_endColEndHeader<0?(this._hideHeader(h),this.m_stopColumnEndHeaderFetch=!0,this.m_startColEndHeader=0):(this.m_hasColEndHeader=!0,this._buildHeaderLabels("columnEnd",i))):"row"===l&&(null!=e?(this.buildRowHeaders(a,e,d,c,s,!1),(e.getCount()<t.count||o&&o>0&&o===d+e.getCount())&&(this.m_stopRowHeaderFetch=!0)):this.m_stopRowHeaderFetch=!0,this.m_endRowHeader<0?(this._hideHeader(a),this.m_stopRowHeaderFetch=!0,this.m_startRowHeader=0):(this.m_hasRowHeader=!0,this._buildHeaderLabels(l,e)),null!=i?(this.buildRowEndHeaders(h,i,d,c,s,!1),(i.getCount()<t.count||o&&o>0&&o===d+i.getCount())&&(this.m_stopRowEndHeaderFetch=!0)):this.m_stopRowEndHeaderFetch=!0,this.m_endRowEndHeader<0?(this._hideHeader(h),this.m_stopRowEndHeaderFetch=!0,this.m_startRowEndHeader=0):(this.m_hasRowEndHeader=!0,this._buildHeaderLabels("rowEnd",i))),this.isFetchComplete()&&(this.hideStatusText(),this._shouldInitialize()&&!s&&this._handleInitialization(!0)),this.m_initialized&&this._sizeDatabodyScroller(),this._signalTaskEnd()}else this._signalTaskEnd()},A.prototype.handleHeadersFetchError=function(e,t){var i=t.axis;this.m_fetching[i]=!1,this._signalTaskEnd()},A.prototype.createHeaderContext=function(e,t,i,s,n,o,r,l){var a={axis:e,index:t,data:i};a.component=this,a.datasource=this.m_options.getProperty("data"),a.level=o,a.depth=l,a.extent=r,null!=n&&(a.parentElement=n);for(var h=Object.keys(s),d=0;d<h.length;d++){var c=h[d];a[c]=s[c]}return null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,a),this.m_fixContextCallback.call(this,a)},A.prototype._createLabelContext=function(e,t,i,s,n){var o={axis:e,level:t,data:i};if(o.component=this,o.datasource=this.m_options.getProperty("data"),null!=s&&(o.parentElement=s),null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,o),this._isDataGridProvider()&&null!=n)for(var r=Object.keys(n),l=0;l<r.length;l++){var a=r[l];o[a]=n[a]}return this.m_fixContextCallback.call(this,o)},A.prototype._buildHeaderLabels=function(e,t){if(0===this.m_headerLabels[e].length&&t&&t.getLabel){var i,s=t.getLevelCount();"rowEnd"===e?i=this.getResources().isRTLMode()?"left":"right":"row"===e?i=this.getResources().isRTLMode()?"right":"left":"column"===e?i="top":"columnEnd"===e&&(i="bottom");var n=0;if(s>0)for(var o=0;o<s;o++){var r,l=document.createElement("div"),a=t.getLabel(o);this._isDataGridProvider()&&(r=t.getLabelMetadata(o));var h=this._getLabelDimension(e,o);if(null!=a){var d=this._createLabelContext(e,o,a,l,r);l.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),l.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(l),l[this.getResources().getMappedAttribute("context")]=d;var c=this.m_options.getInlineStyle(e,d,!0);null!=c&&u.applyMergedInlineStyles(l,c,""),l.className=this.getMappedStyle("headerlabel")+" "+this.getMappedStyle(e.toLowerCase()+"headerlabel");var m=this.m_options.getStyleClass(e,d,!0);null!=m&&(l.className+=" "+m),"row"===e||"rowEnd"===e?("rowEnd"===e&&(l.style.height="100%"),this.setElementWidth(l,h),this.setElementDir(l,n,i),this.setElementDir(l,0,"bottom")):("columnEnd"===e&&(l.style.width="100%"),this.setElementHeight(l,h),this.setElementDir(l,n,i),this.setElementDir(l,0,this.getResources().isRTLMode()?"left":"right")),"enable"!==this.m_options.isResizable(e,"width")&&"enable"!==this.m_options.isResizable(e,"height")||this._setAttribute(l,"resizable","true");var _=this.getRendererOrTemplate(e,!0);this._renderContent(_,d,l,a,this.buildLabelTemplateContext(d,r||{})),this.m_headerLabels[e][o]=l}n+=h}}},A.prototype.buildLabelTemplateContext=function(e,t){return{item:{data:e.data,metadata:t.metadata},datasource:e.datasource}},A.prototype.buildHeaderTemplateContext=function(e,t){return{item:{data:e.data,depth:e.depth,extent:e.extent,index:e.index,level:e.level,metadata:t.metadata,axis:e.axis},datasource:e.datasource}},A.prototype.buildCellTemplateContext=function(e,t){return{item:{columnExtent:e.extents.column,columnIndex:e.indexes.column,data:e.data,metadata:t.metadata,rowExtent:e.extents.row,rowIndex:e.indexes.row},datasource:e.datasource,mode:e.mode}},A.prototype.getRendererOrTemplate=function(e,t){var i,s=this.m_options.getRenderer(e,t);return s||(i="cell"===e?"cellTemplate":t?e+"HeaderLabelTemplate":e+"HeaderTemplate",this._getItemTemplateBySlotName(i)||null)},A.prototype.buildColumnHeaders=function(e,t,i,s,n,o){if(null==this.m_columnHeaderLevelCount&&(this.m_columnHeaderLevelCount=t.getLevelCount()),0!==this.m_columnHeaderLevelCount){var r=t.getCount(),l=i>this.m_endColHeader;!1;var a=l?this.m_endColHeaderPixel:this.m_startColHeaderPixel,h=this.m_endColHeader,d=this.m_columnHeaderLevelCount,c=this.getMappedStyle("colheader")+" "+this.getMappedStyle("header"),m=this.getMappedStyle("headercell")+" "+this.getMappedStyle("colheadercell");!1;var u=this.buildAxisHeaders(e,t,"column",i,r,l,!1,null,a,h,d,c,m,!1),_=u.totalHeaderDimension,p=u.totalLevelDimension;if(0===_||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=_/r),this.m_colHeaderHeight||(this.m_colHeaderHeight=p,this.setElementHeight(e,this.m_colHeaderHeight)),l?(this.m_endColHeader=i+r-1,this.m_endColHeaderPixel+=_):(this.m_startColHeader-=r,this.m_startColHeaderPixel-=_),-1===s&&(s=this.m_endColHeader),!this._isCountUnknown("column")&&this._isHighWatermarkScrolling()&&this.m_endColHeader+1>=s?this.m_stopColumnHeaderFetch=!0:this.m_stopColumnHeaderFetch=u.stopFetch,0===this.m_startColHeader&&0!==this.m_startColHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startColHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this.m_endColHeaderPixel-=this.m_startColHeaderPixel,this.m_startColHeaderPixel=0),!this.m_initialized&&this.m_startColHeader>0){var g=Math.round(this.m_avgColWidth*this.m_startColHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startColHeader,g-this.m_startColHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this.m_endColHeaderPixel=g+_,this.m_startColHeaderPixel=g}}},A.prototype.buildColumnEndHeaders=function(e,t,i,s,n,o){if(null==this.m_columnEndHeaderLevelCount&&(this.m_columnEndHeaderLevelCount=t.getLevelCount()),0!==this.m_columnEndHeaderLevelCount){var r=t.getCount(),l=i>this.m_endColEndHeader;!1;var a=l?this.m_endColEndHeaderPixel:this.m_startColEndHeaderPixel,h=this.m_endColEndHeader,d=this.m_columnEndHeaderLevelCount,c=this.getMappedStyle("colendheader")+" "+this.getMappedStyle("endheader"),m=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("colendheadercell");!1;var u=this.buildAxisHeaders(e,t,"columnEnd",i,r,l,!1,null,a,h,d,c,m,!1),_=u.totalHeaderDimension,p=u.totalLevelDimension;if(0===_||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=_/r),this.m_colEndHeaderHeight||(this.m_colEndHeaderHeight=p,this.setElementHeight(e,this.m_colEndHeaderHeight)),l?(this.m_endColEndHeader=i+(r-1),this.m_endColEndHeaderPixel+=_):(this.m_startColEndHeader-=r,this.m_startColEndHeaderPixel-=_),-1===s&&(s=this.m_endColEndHeader),!this._isCountUnknown("column")&&this._isHighWatermarkScrolling()&&this.m_endColEndHeader+1>=s?this.m_stopColumnEndHeaderFetch=!0:this.m_stopColumnEndHeaderFetch=u.stopFetch,0===this.m_startColEndHeader&&0!==this.m_startColEndHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startColEndHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell")),this.m_endColEndHeaderPixel-=this.m_startColEndHeaderPixel,this.m_startColEndHeaderPixel=0),!this.m_initialized&&this.m_startColEndHeader>0){var g=Math.round(this.m_avgColWidth*this.m_startColEndHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startColEndHeader,g-this.m_startColEndHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell")),this.m_endColEndHeaderPixel=g+_,this.m_startColEndHeaderPixel=g}}},A.prototype.buildRowHeaders=function(e,t,i,s,n,o){if(null==this.m_rowHeaderLevelCount&&(this.m_rowHeaderLevelCount=t.getLevelCount()),0!==this.m_rowHeaderLevelCount){var r,l=t.getCount(),a=i>this.m_endRowHeader,h=a?this.m_endRowHeaderPixel:this.m_startRowHeaderPixel;n?(r=e.firstChild.childNodes[i-this.m_startRowHeader],h=this.getElementDir(r,"top")):r=null;var d=this.m_endRowHeader,c=this.m_rowHeaderLevelCount,m=this.getMappedStyle("rowheader")+" "+this.getMappedStyle("header"),u=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell"),_=this.buildAxisHeaders(e,t,"row",i,l,a,n,r,h,d,c,m,u,o),p=_.totalHeaderDimension,g=_.totalLevelDimension;if(o)return _;if(0===p||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=p/l),this.m_rowHeaderWidth||(this.m_rowHeaderWidth=g,this.setElementWidth(e,this.m_rowHeaderWidth)),a){if(-1!==this.m_endRowHeader&&0!==l){var f=e.firstChild.childNodes[this.m_endRowHeader-this.m_startRowHeader];null!=f&&this.m_utils.removeCSSClassName(f,this.getMappedStyle("borderHorizontalNone"))}this.m_endRowHeader=i+(l-1),this.m_endRowHeaderPixel+=p}else n?(i<this.m_startRowHeader&&(this.m_startRowHeader=i,this.m_startRowHeaderPixel=Math.max(0,this.m_startRowHeaderPixel-p)),this.m_endRowHeader+=l,this.m_endRowHeaderPixel=Math.max(0,this.m_endRowHeaderPixel+p),this.pushRowHeadersDown(r,p)):(this.m_startRowHeader=Math.max(0,this.m_startRowHeader-l),this.m_startRowHeaderPixel-=p);if(-1===s&&(s=this.m_endRowHeader),!this._isCountUnknown("row")&&this._isHighWatermarkScrolling()&&this.m_endRowHeader+1>=s?this.m_stopRowHeaderFetch=!0:this.m_stopRowHeaderFetch=_.stopFetch,0===this.m_startRowHeader&&0!==this.m_startRowHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startRowHeaderPixel,"top",this.getMappedStyle("rowheadercell")),this.m_endRowHeaderPixel-=this.m_startRowHeaderPixel,this.m_startRowHeaderPixel=0),!this.m_initialized&&this.m_startRowHeader>0){var C=Math.round(this.m_avgRowHeight*this.m_startRowHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startRowHeader,C-this.m_startRowHeaderPixel,"top",this.getMappedStyle("rowheadercell")),this.m_endRowHeaderPixel=C+p,this.m_startRowHeaderPixel=C}}},A.prototype.buildRowEndHeaders=function(e,t,i,s,n,o){if(null==this.m_rowEndHeaderLevelCount&&(this.m_rowEndHeaderLevelCount=t.getLevelCount()),0!==this.m_rowEndHeaderLevelCount){var r,l=t.getCount(),a=i>this.m_endRowEndHeader,h=a?this.m_endRowEndHeaderPixel:this.m_startRowEndHeaderPixel;n?(r=e.firstChild.childNodes[i-this.m_startRowEndHeader],h=this.getElementDir(r,"top")):r=null;var d=this.m_endRowEndHeader,c=this.m_rowEndHeaderLevelCount,m=this.getMappedStyle("rowendheader")+" "+this.getMappedStyle("endheader"),u=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell"),_=this.buildAxisHeaders(e,t,"rowEnd",i,l,a,n,r,h,d,c,m,u,o);if(o)return _;var p=_.totalHeaderDimension,g=_.totalLevelDimension;if(0===p||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=p/l),this.m_rowEndHeaderWidth||(this.m_rowEndHeaderWidth=g,this.setElementWidth(e,this.m_rowEndHeaderWidth)),a){if(-1!==this.m_endRowEndHeader&&0!==l){var f=e.firstChild.childNodes[this.m_endRowEndHeader-this.m_startRowEndHeader];null!=f&&this.m_utils.removeCSSClassName(f,this.getMappedStyle("borderHorizontalNone"))}this.m_endRowEndHeader=i+(l-1),this.m_endRowEndHeaderPixel+=p}else n?(i<this.m_startRowEndHeader&&(this.m_startRowEndHeader=i,this.m_startRowEndHeaderPixel=Math.max(0,this.m_startRowEndHeaderPixel-p)),this.m_endRowEndHeader+=l,this.m_endRowEndHeaderPixel=Math.max(0,this.m_endRowEndHeaderPixel+p),this.pushRowHeadersDown(r,p)):(this.m_startRowEndHeader=Math.max(0,this.m_startRowEndHeader-l),this.m_startRowEndHeaderPixel-=p);if(-1===s&&(s=this.m_endRowEndHeader),!this._isCountUnknown("row")&&this._isHighWatermarkScrolling()&&this.m_endRowEndHeader+1>=s?this.m_stopRowEndHeaderFetch=!0:this.m_stopRowEndHeaderFetch=_.stopFetch,0===this.m_startRowEndHeader&&0!==this.m_startRowEndHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startRowEndHeaderPixel,"top",this.getMappedStyle("rowendheadercell")),this.m_endRowEndHeaderPixel-=this.m_startRowEndHeaderPixel,this.m_startRowEndHeaderPixel=0),!this.m_initialized&&this.m_startRowEndHeader>0){var C=Math.round(this.m_avgRowHeight*this.m_startRowEndHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startRowEndHeader,C-this.m_startRowEndHeaderPixel,"top",this.getMappedStyle("rowendheadercell")),this.m_endRowEndHeaderPixel=C+p,this.m_startRowEndHeaderPixel=C}}},A.prototype.buildAxisHeaders=function(e,t,i,s,n,o,r,l,a,h,d,c,m,u){var _,p,g=-1!==i.indexOf("column"),f=g?"height":"width",C=!1,y=0,v=0,E=0,w=0;if(!u){if(0===n&&this._isCountUnknown(i))return{totalHeaderDimension:y,totalLevelDimension:v,stopFetch:C=!0};_=e.firstChild,-1===h&&""===e.className&&(e.className=c,e.style[f]="",_.style[f]="")}for(var S=this.getRendererOrTemplate(i),H=document.createDocumentFragment(),x=0;n-x>0;){o||r?(p=s+x,E=g?a+y:0,w=g?0:a+y):(p=s+(n-1-x),E=g?a-y:0,w=g?0:a-y);var b=this.buildLevelHeaders(H,p,0,E,w,o,r,S,t,i,m,d);x+=b.count,y+=b.totalHeaderDimension,b.totalLevelDimension>v&&(v=b.totalLevelDimension)}return u?H:(o?_.appendChild(H):r?_.insertBefore(H,l):_.insertBefore(H,_.firstChild),e.hasChildNodes()||r||e.appendChild(_),this.m_subtreeAttachedCallback(_),{totalHeaderDimension:y,totalLevelDimension:v,stopFetch:C})},A.prototype._renderContent=function(e,t,i,s,n){if(null!=e&&"function"==typeof e){var o=e.call(this,t);null!=o&&(null===o.parentNode||o.parentNode instanceof DocumentFragment?(i.appendChild(o),this.m_isCustomElementCallback()||this.m_subtreeAttachedCallback(o)):null!=o.parentNode||o.toString&&i.appendChild(document.createTextNode(o.toString()))),this._removeFocusFromChildElements(t,i)}else if(null!=e&&"object"==typeof e&&this.m_engine){for(var r=this.m_engine.execute(this.m_root,e,n,null),l=0;l<r.length;l++)i.appendChild(r[l]);this._removeFocusFromChildElements(t,i)}else null!=s&&"object"==typeof s&&Object.prototype.hasOwnProperty.call(s,"data")&&(s=s.data),null==s&&(s=""),i.appendChild(document.createTextNode(s.toString()))},A.prototype._removeFocusFromChildElements=function(e,t){if("edit"!==e.mode){var i=this;this._signalTaskStart(),this.m_contextCallback(t).getBusyContext().whenReady().then(function(){u.disableAllFocusableElements(t),i._signalTaskEnd()})}},A.prototype.buildLevelHeaders=function(e,t,i,s,n,o,r,l,a,h,d,c){var m,_,p,g,f,C,y,v,E,w,S,H,x,b,R,I=0,M=0,L=0,A=0;"row"===h?(m="row",_=this.m_rowHeader,p="width",g=this.m_rowHeaderLevelWidths,f="height",C="top",y=n,v=this.getResources().isRTLMode()?"right":"left",E=s,w=this.m_startRowHeader,S=this.m_endRowHeader):"rowEnd"===h?(m="row",_=this.m_rowEndHeader,p="width",g=this.m_rowEndHeaderLevelWidths,f="height",C="top",y=n,v=this.getResources().isRTLMode()?"left":"right",E=s,w=this.m_startRowEndHeader,S=this.m_endRowEndHeader):"column"===h?(m="column",_=this.m_colHeader,p="height",g=this.m_columnHeaderLevelHeights,f="width",C=this.getResources().isRTLMode()?"right":"left",y=s,v="top",E=n,w=this.m_startColHeader,S=this.m_endColHeader):(m="column",_=this.m_colEndHeader,p="height",g=this.m_columnEndHeaderLevelHeights,f="width",C=this.getResources().isRTLMode()?"right":"left",y=s,v="bottom",E=n,w=this.m_startColEndHeader,S=this.m_endColEndHeader);var D=a.getExtent(t,i),T=D.extent,F=D.more.before,N=D.more.after,O=a.getDepth(t,i);let P;if(F&&t===S+1){for(H=this._getHeaderContainer(t-1,i,0,null,_,c),this._setAttribute(H,"extent",this._getAttribute(H,"extent",!0)+T),P=(x=H.firstChild)[this.getResources().getMappedAttribute("context")],P.extent+=T,I=this.getElementDir(x,p),b=0;b<T;)y+=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(H,t+b,i+O,y,E+I,o,r,l,a,h,d,c):this.buildLevelHeaders(H,t+b,i+O,E+I,y,o,r,l,a,h,d,c)).totalHeaderDimension,L+=R.totalHeaderDimension,A+=R.count,b+=R.count;this.setElementDir(x,this.getElementDir(x,f)+L,f)}else if(N&&t===w-1){for(H=this._getHeaderContainer(t+1,i,0,null,_,c),this._setAttribute(H,"extent",this._getAttribute(H,"extent",!0)+T),this._setAttribute(H,"start",this._getAttribute(H,"start",!0)-T),P=(x=H.firstChild)[this.getResources().getMappedAttribute("context")],P.extent+=T,P.index-=T,I=this.getElementDir(x,p),b=0;b<T;)y-=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(H,t-b,i+O,y,E+I,o,r,l,a,h,d,c):this.buildLevelHeaders(H,t-b,i+O,E+I,y,o,r,l,a,h,d,c)).totalHeaderDimension,L+=R.totalHeaderDimension,A+=R.count,b+=R.count;this.setElementDir(x,this.getElementDir(x,f)+L,f),this.setElementDir(x,y,C)}else{var z=a.getData(t,i),k=a.getMetadata(t,i);x=document.createElement("div"),P=this.createHeaderContext(h,t,z,k,x,i,T,O),x.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),x.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(x),x[this.getResources().getMappedAttribute("context")]=P,x[this.getResources().getMappedAttribute("metadata")]=k,x.extentInfo=D;var B=this.m_options.getInlineStyle(h,P),j=this.m_options.getStyleClass(h,P);null!=B&&u.applyMergedInlineStyles(x,B,""),x.className=d,x.className+=" "+this.getMappedStyle("depth")+O,null!=j&&(x.className+=" "+j),this.setElementDir(x,E,v),this.setElementDir(x,y,C);var W=this._getHeaderDimensions(x,f,p,g,i,m,P.key,O);I=W[p],this.setElementDir(x,I,p);var K=W[f];if(this._setAttribute(x,"depth",O),i!==c-1&&((H=document.createElement("div")).className=this.getMappedStyle("groupingcontainer"),H.appendChild(x),this._setAttribute(H,"start",o||r?t:t-T+1),this._setAttribute(H,"extent",T),this._setAttribute(H,"level",i)),i+O===c)this.setElementDir(x,K,f),L+=K,A+=1,M=I,o||r||(y-=K,this.setElementDir(x,y,C));else{for(b=0;b<T;b++){var U=o||r?t+b:t-b;K=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(H,U,i+O,y,E+I,o,r,l,a,h,d,c):this.buildLevelHeaders(H,U,i+O,E+I,y,o,r,l,a,h,d,c)).totalHeaderDimension,y=o||r?y+K:y-K,L+=K,A+=R.count,b+=R.count-1}M=I,R&&!isNaN(R.totalLevelDimension)&&(M+=R.totalLevelDimension),o||r||this.setElementDir(x,y,C),this.setElementDir(x,L,f)}if("columnEnd"===h&&this.m_addBorderBottom&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderHorizontalSmall")),"rowEnd"===h&&this.m_addBorderRight&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderVerticalSmall")),this._isHeaderResizeEnabled(h,P)&&this._setAttribute(x,"resizable","true"),this.m_isCustomElementCallback()||(null!=H?this.m_root.appendChild(H):this.m_root.appendChild(x)),this._renderContent(l,P,x,z,this.buildHeaderTemplateContext(P,k)),("column"===h||this._isDataGridProvider())&&this._isSortEnabled(h,P)){null!=k.sortDirection&&null==this.m_sortInfo&&(this.m_sortInfo={},this.m_sortInfo.key=k.key,this.m_sortInfo.direction=k.sortDirection,this.m_sortInfo.axis=h);var Y=this._buildSortIcon(P,x,h);x.appendChild(Y),this._setAttribute(x,"sortable","true")}if(this._isRequired(P)){var V=document.createElement("span");this.m_utils.addCSSClassName(V,this.getMappedStyle("iconContainer")),this.m_utils.addCSSClassName(V,this.getMappedStyle("requiredIcon")),V.setAttribute("title",this.getResources().getTranslatedText("tooltipRequired")),x.appendChild(V)}if(this._isParentNode(P)){const e=this._buildDisclosureIcon(P);this._isHierarchicalGroup(P)?this.m_utils.addCSSClassName(x,this.getMappedStyle("hierarchicalGroup")):this.m_utils.addCSSClassName(x,this.getMappedStyle("hierarchicalTree")),x.prepend(e);const t=this._buildSpacer(P);x.prepend(t)}else if(this._isLeafNode(P)){this.m_utils.addCSSClassName(x,this.getMappedStyle("hierarchical"));const e=this._buildSpacer(P);x.prepend(e)}o||r?null!=H?e.appendChild(H):e.appendChild(x):null!=H?e.firstChild?this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("groupingcontainer"))?e.insertBefore(H,e.firstChild):(this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("headercell"))||this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("endheadercell")))&&e.insertBefore(H,e.firstChild.nextSibling):e.appendChild(H):this.m_utils.containsCSSClassName(e,this.getMappedStyle("groupingcontainer"))?e.insertBefore(x,e.firstChild.nextSibling):e.insertBefore(x,e.firstChild)}return"column"===h||"columnEnd"===h?this._isLastColumn(t+(T-1))&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderVerticalNone")):this._isLastRow(t+(T-1))&&!r&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderHorizontalNone")),{totalLevelDimension:M,totalHeaderDimension:L,count:A}},A.prototype._getHeaderDimensions=function(e,t,i,s,n,o,r,l){for(var a={},h=0,d=0;d<l;d++){var c=s[n+d];if(null==c){h=null;break}h+=c}null==h?a=this._computeElementWidthAndHeight(e):a[i]=h,1===l&&(s[n]=a[i]);var m=this.m_sizingManager.getSize(o,r);if(null!=m)return a[t]=m,a;if(""!==e.style[t])return null==a[t]&&(a[t]=this.getElementDir(e,t)),this.m_sizingManager.setSize(o,r,a[t]),a;var u=e.className;return null==a[t]&&(a[t]=this.m_styleClassDimensionMap[t][u],null==a[t]&&(a[t]=this.getElementDir(e,t))),this.m_sizingManager.setSize(o,r,a[t]),this.m_styleClassDimensionMap[t][u]=a[t],a},A.prototype._getHeaderLevelDimension=function(e,t,i,s,n){for(var o=0,r=0;r<n;r++){var l=i[e+r];if(null==l){o=null;break}o+=l}return null!=o||(o=this.getElementDir(t,s),1===n&&(i[e]=o)),o},A.prototype._getHeaderContainer=function(e,t,i,s,n,o){var r;if(null==s?(s=n.firstChild.childNodes,r=0):r=1,i===o-1)return s[0].parentNode;for(;r<s.length;r++){var l=this._getAttribute(s[r],"start",!0),a=this._getAttribute(s[r],"extent",!0),h=this._getAttribute(s[r].firstChild,"depth",!0);if(e>=l&&e<l+a)return t<i+h?s[r]:this._getHeaderContainer(e,t,i+h,s[r].childNodes,n,o)}return null},A.prototype._getHeaderByIndex=function(e,t,i,s,n){var o;if(t<0)return null;if(1===s)return i.firstChild.childNodes[o=e-n];var r=this._getHeaderContainer(e,t,0,null,i,s);return null==r?null:t<=this._getAttribute(r,"level",!0)+this._getAttribute(r.firstChild,"depth",!0)-1?r.firstChild:(o=e-this._getAttribute(r,"start",!0)+1,r.childNodes[o])},A.prototype._getHeadersByIndex=function(e,t,i,s){let n=[],o=1;for(let r=i-1;r>=0;r-=o){let l=this._getHeaderByIndex(e,r,t,i,s);l&&(o=this.getHeaderCellDepth(l),n.push(l))}return n},A.prototype._getAttribute=function(e,t,i){var s=e.getAttribute(this.getResources().getMappedAttribute(t));return i?parseInt(s,10):s},A.prototype._setAttribute=function(e,t,i){e.setAttribute(this.getResources().getMappedAttribute(t),i)},A.prototype.buildDatabody=function(e){var t=document.createElement("div");t.id=this.createSubId("databody"),t.className=this.getMappedStyle("databody")+" "+this.getMappedStyle("scrollbarForce"),t.tabIndex="-1",this.m_databody=t;var i=document.createElement("div");if(i.className=this.getMappedStyle("scroller")+(this.m_utils.isTouchDeviceNotIOS()?" "+this.getMappedStyle("scroller-mobile"):""),t.appendChild(i),!e)if(t.addEventListener?t.addEventListener("scroll",this.handleScroll.bind(this),!1):t.attachEvent("onscroll",this.handleScroll.bind(this)),this._isHighWatermarkScrolling()){this.fetchCells(t,0,0)}else{var s=this,n=this.m_options.getScrollPosition();this._getIndexesFromScrollPosition(n).then(function(e){var i=e.row,n=e.column;s.m_startRow=i,s.m_startCol=n,s.m_fetching.cells=!1,s.fetchCells(t,i,n)}),this.m_fetching.cells=!0}return t},A.prototype._getIndexFromKeyPromise=function(e,t){var i=this;return new Promise(function(s){null!=e||null!=t?i._indexes({row:e,column:t},function(e){s({rowIndexFromKey:e.row,columnIndexFromKey:e.column})}):s({rowIndexFromKey:null,columnIndexFromKey:null})})},A.prototype._getIndexesFromScrollPosition=function(e){var t=this,i=e.rowKey,s=e.columnKey;return this._getIndexFromKeyPromise(i,s).then(function(i){var s={};return null!=i.rowIndexFromKey&&i.rowIndexFromKey>0?s.row=i.rowIndexFromKey:null!=e.rowIndex?s.row=e.rowIndex:null!=e.y?s.row=Math.round(e.y/t.getDefaultRowHeight()):s.row=0,null!=i.columnIndexFromKey&&i.columnIndexFromKey>0?s.column=i.columnIndexFromKey:null!=e.columnIndex?s.column=e.columnIndex:null!=e.x?s.column=Math.round(e.x/t.getDefaultColumnWidth()):s.column=0,s})},A.prototype.getFetchCount=function(e,t){var i=this.getFetchSize(e);if(this._isHighWatermarkScrolling()){var s="row"===e?"maxRowCount":"maxColumnCount",n=this.m_options.getScrollPolicyOptions();n&&null!=n[s]&&n[s]>0&&(i=Math.max(Math.min(i,n[s]-t),0))}return i},A.prototype.fetchCells=function(e,t,i,s,n,o){var r;if(!this.m_fetching.cells){null==s&&(s=this.getFetchCount("row",t)),null==n&&(n=this.getFetchCount("column",i));var l={axis:"row",start:t,count:s},a={axis:"column",start:i,count:n,databody:e};this.m_fetching.cells={rowRange:l,columnRange:a},r=null!=o&&null!=o.success?o.success:this.handleCellsFetchSuccess,this.showStatusText(),this._signalTaskStart(),this.getDataSource().fetchCells([l,a],{success:r,error:this.handleCellsFetchError},{success:this,error:this})}},A.prototype.isCellFetchResponseValid=function(e){if(null==this.m_fetching)return!1;var t=e[0],i=e[1],s=this.m_fetching.cells;return t===s.rowRange&&i===s.columnRange},A.prototype.isLongScroll=function(){return this.m_isLongScroll},A.prototype.isCellFetchResponseInViewport=function(e,t){if(isNaN(this.m_avgRowHeight)||isNaN(this.m_avgColWidth)||null!=this.m_empty||!this.m_initialized)return!0;var i=t[0].start,s=t[1].start,n=this._getLongScrollStart(this.m_currentScrollTop,this.m_prevScrollTop,"row"),o=this._getLongScrollStart(this.m_currentScrollLeft,this.m_prevScrollLeft,"column");return n.start===i&&o.start===s},A.prototype.handleCellsFetchSuccess=function(e,t,i){var s=this.m_options.getScrollPolicyOptions(),n=s?s.maxRowCount:null,o=s?s.maxColumnCount:null,r=this.getDataSource().getCount("row"),l=this.getDataSource().getCount("column");if(void 0===i){if(i=!1,!this.isCellFetchResponseValid(t))return void this._signalTaskEnd();if(this.isLongScroll()&&(!this.isCellFetchResponseInViewport(e,t)||this.m_headerInvalid))return this.m_fetching.cells=!1,this.m_headerInvalid=!1,this.handleLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop),void this._signalTaskEnd();this.m_isLongScroll=!1}var a=t[0],h=a.start,d=e.getCount("row"),c=d>0&&(h>this.m_endRow||h+d<=this.m_startRow);(0===d&&this._isCountUnknown("row")&&a.count>0||c&&this._isHighWatermarkScrolling()&&!this._isCountUnknown("row")&&this.m_endRow+d+1>=r||d<a.count||this._isHighWatermarkScrolling()&&n&&n>0&&h+d===n)&&(this.m_stopRowFetch=!0);var m=t[1],u=m.start,_=e.getCount("column"),p=_>0&&(u>this.m_endCol||u+_===this.m_startCol);(0===_&&this._isCountUnknown("column")&&m.count>0||p&&this._isHighWatermarkScrolling()&&!this._isCountUnknown("column")&&this.m_endCol+_+1>=l||_<m.count||this._isHighWatermarkScrolling()&&o&&o>0&&u+_===o)&&(this.m_stopColumnFetch=!0);var g=this.m_databody;null==g&&(g=m.databody);var f,C,y,v,E,w,S,H,x,b,R=g.firstChild;if(c||i){if(f=!(i||!(h>=this.m_startRow)))C=this.m_endRowPixel;else if(i){var I=this._getCellByIndex({row:h+d,column:this.m_startCol});C=this.getElementDir(I,"top")}else C=this.m_startRowPixel;y=u>=this.m_startCol?this.m_startColPixel:this.m_endColPixel,v=document.createDocumentFragment(),w=(E=this._addCellsToFragment(v,e,h,C,u,y)).totalColumnWidth,S=E.totalRowHeight,H=E.avgWidth,x=S/d,this._populateDatabody(R,v),f?(-1!==this.m_endRow&&0!==d&&this._highlightCellsAlongAxis(this.m_endRow,"row","index","remove",["borderHorizontalNone"]),this.m_endRow=h+(d-1),this.m_endRowPixel+=S):i?(h<this.m_startRow&&(this.m_startRow=h,this.m_startRowPixel=Math.max(0,this.m_startRowPixel-S)),this.m_endRow+=d,this.m_endRowPixel+=S,this.pushRowsDown(h+d,S)):(this.m_startRow-=d,this.m_startRowPixel-=S)}else p&&(y=(f=u>=this.m_startCol)?this.m_endColPixel:this.m_startColPixel,C=h>=this.m_startRow?this.m_startRowPixel:this.m_endRowPixel,v=document.createDocumentFragment(),E=this._addCellsToFragment(v,e,h,C,u,y),this._populateDatabody(R,v),w=E.totalColumnWidth);if(null==H||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=H),null==x||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=x),p&&(u<this.m_startCol?(this.m_startCol-=_,this.m_startColPixel-=w):(this.m_endCol=u+(_-1),this.m_endColPixel+=w)),this._sizeDatabodyScroller(),this.m_endCol>=0&&this.m_endRow>=0?this.m_hasCells=!0:(this.m_startCol=0,this.m_startRow=0),0===this.m_startCol&&0!==this.m_startColPixel&&(this._shiftCellsAlongAxis("column",-this.m_startColPixel,0,!0),this.m_endColPixel-=this.m_startColPixel,this.m_startColPixel=0),0===this.m_startRow&&0!==this.m_startRowPixel&&(this._shiftCellsAlongAxis("row",-this.m_startRowPixel,0,!0),this.m_endRowPixel-=this.m_startRowPixel,this.m_startRowPixel=0),!this.m_initialized&&this.m_startCol>0&&(b=Math.round(this.m_avgColWidth*this.m_startCol),this._shiftCellsAlongAxis("column",b-this.m_startColPixel,this.m_startCol,!0),this.m_endColPixel=b+w,this.m_startColPixel=b),!this.m_initialized&&this.m_startRow>0&&(b=Math.round(this.m_avgRowHeight*this.m_startRow),this._shiftCellsAlongAxis("row",b-this.m_startRowPixel,this.m_startRow,!0),this.m_endRowPixel=b+S,this.m_startRowPixel=b),this.m_fetching.cells=!1,this.isFetchComplete()){if(this.hideStatusText(),this.m_initialized)this._checkScroll&&this._checkScrollPosition();else{if(this.m_utils.isTouchDeviceNotIOS()&&Object.prototype.hasOwnProperty.call(window,"WebKitCSSMatrix")){const e="translate3d(0, 0, 0)";R.style.transform=e,null!=this.m_rowHeader&&(this.m_rowHeader.firstChild.style.transform=e),null!=this.m_colHeader&&(this.m_colHeader.firstChild.style.transform=e),null!=this.m_rowEndHeader&&(this.m_rowEndHeader.firstChild.style.transform=e),null!=this.m_colEndHeader&&(this.m_colEndHeader.firstChild.style.transform=e)}this._updateScrollPosition(this.m_options.getScrollPosition())}if(null!=this.m_scrollIndexAfterFetch?this.scrollToIndex(this.m_scrollIndexAfterFetch):null!=this.m_scrollHeaderAfterFetch?this.scrollToHeader(this.m_scrollHeaderAfterFetch):this.isActionableMode()||null==this._getActiveElement()||this.m_utils.containsCSSClassName(this._getActiveElement(),this.getMappedStyle("focus"))||(!0!==this.m_shouldFocus&&(this.m_shouldFocus=!1),this._highlightActive(),this._manageMoveCursor()),this._isSelectionEnabled()&&this.applySelection(h,h+d,u,u+_),this.populateAccInfo(),this._shouldInitialize())this._handleInitialization(!0);else if(this.m_initialized){var M;(!0===this.m_resizeRequired||this.m_endRowPixel-S<this.getElementHeight(g))&&this.resizeGrid(),c?f?M="top":i||(M="bottom"):p&&(M=u===this.m_startCol?"right":"left"),this._cleanupViewport(M),this.fillViewport(),this.isFetchComplete()&&this.fireEvent("ready",{})}}this._isSelectionEnabled()&&this.isMultipleSelection()&&this._resetHeaderHighLight(),this._signalTaskEnd()},A.prototype._setZIndexBefore=function(e,t,i,s){if("row"===e)for(var n=this.m_startRow,o=this.m_currentScrollTop,r=this.m_rowHeader,l=this.m_rowHeaderLevelCount,a=this.m_startRowHeader,h=this.m_rowEndHeader,d=this.m_rowEndHeaderLevelCount,c=this.m_startRowEndHeader,m=t;m>=n;m--){var u,_=this._getAxisCellsByIndex(m,e);if(this.getElementDir(_[0],"top")<o)break;for(var p=0;p<_.length;p++)this.changeStyleProperty(_[p],this.getCssSupport("z-index"),10);i&&(u=this._getHeaderByIndex(m,0,r,l,a),this.changeStyleProperty(u,this.getCssSupport("z-index"),10)),s&&(u=this._getHeaderByIndex(m,0,h,d,c),this.changeStyleProperty(u,this.getCssSupport("z-index"),10))}},A.prototype._onTransitionEnd=function(e,t,i){var s;function n(){s&&(clearTimeout(s),s=void 0),e.removeEventListener("transitionend",n),t()}e.addEventListener("transitionend",n),s=setTimeout(n,i+100)},A.prototype._insertRowsWithAnimation=function(e,t,i,s,n,o,r,l){var a,h,d,c,m,u,_,p,g,f,C=this,y=0,v=0,E=0;C._signalTaskStart();var w=s>this.m_endRow,S=this.m_databody.firstChild,H=null!=t,x=null!=i;for(s>0&&(E=s-1,f=this._getAxisCellsByIndex(s-1,"row"),y=(v=this.getElementDir(f[0],"top"))+this.getElementHeight(f[0])),this._setZIndexBefore("row",E,H,x),H&&(d=(h=this.m_rowHeader.firstChild).childNodes[s-this.m_startRow-1]),x&&(m=(c=this.m_rowEndHeader.firstChild).childNodes[s-this.m_startRow-1]),a=0;a<e.childNodes.length;a++){var b=e.childNodes[a];p=v-(_=y+this.getElementDir(b,"top"))-this.getElementHeight(b),this.setElementDir(b,_,"top"),this.addTransformMoveStyle(b,0,0,"linear",0,p,0)}if(H)for(a=0;a<t.childNodes.length;a++)u=t.childNodes[a],p=v-(_=y+this.getElementDir(u,"top"))-this.getElementHeight(u),this.setElementDir(u,_,"top"),this.addTransformMoveStyle(u,0,0,"linear",0,p,0);if(x)for(a=0;a<i.childNodes.length;a++)g=i.childNodes[a],p=v-(_=y+this.getElementDir(g,"top"))-this.getElementHeight(g),this.setElementDir(g,_,"top"),this.addTransformMoveStyle(g,0,0,"linear",0,p,0);for(a=s;a<=this.m_endRow;a++){var R=this._getAxisCellsByIndex(a-this.m_startRow,"row");_=o+this.getElementDir(R[0],"top"),p=-o;for(var I=0;I<R.length;I++)this.setElementDir(R[I],_,"top"),this.addTransformMoveStyle(R[I],0,0,"linear",0,p,0);H&&(u=h.childNodes[a],this.setElementDir(u,_,"top"),this.addTransformMoveStyle(u,0,0,"linear",0,p,0)),x&&(g=c.childNodes[a],this.setElementDir(g,_,"top"),this.addTransformMoveStyle(g,0,0,"linear",0,p,0))}this._modifyAxisCellContextIndex("row",s,this.m_endRow-s+1,n),this.m_endRow+=n,this.m_endRowPixel+=o,H&&(this.m_endRowHeader+=t.childNodes.length,this.m_endRowHeaderPixel+=o),x&&(this.m_endRowEndHeader+=i.childNodes.length,this.m_endRowEndHeaderPixel+=o),S.appendChild(e),w?(H&&h.appendChild(t),x&&c.appendChild(i)):(H&&h.insertBefore(t,d.nextSibling),x&&c.insertBefore(i,m.nextSibling)),this.setElementHeight(S,this.getElementHeight(S)+o),this.resizeGrid(),this.updateRowBanding(),this._refreshDatabodyMap(),this._isSelectionEnabled()&&this.applySelection(s,s+n,r,r+l);var M=this._getCellByIndex(this.createIndex(s+(n-1),this.m_endCol));this.m_animating=!0;var L=C.m_processingEventQueue?1:A.EXPAND_ANIMATION_DURATION;this._onTransitionEnd(M,function(){C._handleAnimationEnd()},L),setTimeout(function(){for(var e=A.EXPAND_ANIMATION_DURATION,t=s;t<=C.m_endRow;t++){for(var i=C._getAxisCellsByIndex(t,"row"),n=0;n<i.length;n++)C.addTransformMoveStyle(i[n],e+"ms",0,"ease-out",0,0,0);H&&C.addTransformMoveStyle(h.childNodes[t],e+"ms",0,"ease-out",0,0,0),x&&C.addTransformMoveStyle(c.childNodes[t],e+"ms",0,"ease-out",0,0,0)}},0)},A.prototype._addCellsToFragment=function(e,t,i,s,n,o){for(var r=this.getResources().isRTLMode()?"right":"left",l=this.getRendererOrTemplate("cell"),a=this.m_options.getColumnBandingInterval(),h=this.m_options.getRowBandingInterval(),d=this.m_options.getHorizontalGridlines(),c=this.m_options.getVerticalGridlines(),m=t.getCount("row"),_=t.getCount("column"),p=i>=this.m_startRow,g=n>=this.m_startCol,f=0,C=s,y=[],v=[],E=0;E<m;E+=1){for(var w,S,H,x,b=o,R=p?i+E:i+(m-1-E),I=Math.floor(R/h)%2==1,M=0;M<_;M+=S.column){var L=0;w=0;var A,D=g?n+M:n+(_-1-M);S={row:(A=t.getExtent?t.getExtent(this.createIndex(R,D)):{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}).row.extent,column:A.column.extent},g||(D=D-S.column+1);var T=p?R:R-S.row+1,F=this.createIndex(T,D);if(y[E]&&y[E][M])L=y[E][M].width,b=g?b+L:b-L;else{var N=this._patchExistingCells(A,D,T,y);if(N)L=N.width;else{var O=t.getData(this.createIndex(T,D)),P=t.getMetadata(this.createIndex(T,D));H=document.createElement("div"),x=this.createCellContext(F,O,P,H,S),H.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),H.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(H),H[this.getResources().getMappedAttribute("context")]=x,H[this.getResources().getMappedAttribute("metadata")]=P;var z=this.m_options.getInlineStyle("cell",x);null!=z&&u.applyMergedInlineStyles(H,z,""),""!==H.style.height&&(H.style.height=""),""!==H.style.width&&(H.style.width=""),this.m_utils.addCSSClassName(H,this.getMappedStyle("cell")),this.m_utils.addCSSClassName(H,this.getMappedStyle("formcontrol")),u.isIos()&&(H.setAttribute("aria-labelledby",this.getLabelledBy(this._createActiveObject(H),null,H,!0)),H.setAttribute("role","text")),(I||Math.floor(D/a)%2==1)&&this.m_utils.addCSSClassName(H,this.getMappedStyle("banded"));var k,B=this.m_options.getStyleClass("cell",x);for(null!=B&&(H.className+=" "+B),k=0;k<S.row;k++){var j=0===k?x.keys.row:this._getKey(this._getHeaderByIndex(T+k,0,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),"row");v[E+k]=this._getCellDimension(H,T+k,j,"row","height"),w+=v[E+k]}for(this.setElementHeight(H,w),k=0;k<S.column;k++){var W=0===k?x.keys.column:this._getKey(this._getHeaderByIndex(D+k,0,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),"column");L+=this._getCellDimension(H,D,W,"column","width")}this.setElementWidth(H,L),("hidden"===c||this._isLastColumn(D+(S.column-1))&&(this.getRowHeaderWidth()+b+L>=this.getWidth()||-1!==this.m_endRowEndHeader))&&this.m_utils.addCSSClassName(H,this.getMappedStyle("borderVerticalNone")),("hidden"===d||this._isLastRow(T+(S.row-1))&&(this.getRowBottom(H,C+w)>=this.getHeight()||-1!==this.m_endColEndHeader))&&this.m_utils.addCSSClassName(H,this.getMappedStyle("borderHorizontalNone")),p?this.setElementDir(H,C,"top"):this.setElementDir(H,C-w,"top"),g?this.setElementDir(H,b,r):this.setElementDir(H,b-L,r),this.m_isCustomElementCallback()&&this.m_root.appendChild(H),this._renderContent(l,x,H,O,this.buildCellTemplateContext(x,P)),e.appendChild(H)}this._updateTempArray(y,{width:L},E,M,S.row,S.column),b=g?b+L:b-L,0===E&&(f+=L)}}w=v[E],C=p?C+w:C-w,w}return{avgWidth:f/_,totalRowHeight:v.reduce(function(e,t){return e+t},0),totalColumnWidth:f}},A.prototype._updateCellDimension=function(e,t,i,s,n,o,r,l){var a,h,d,c,m,u=0,_="width"===r?"height":"width",p=this._getCellByIndex(this.createIndex(s,i)),g=this.getElementDir(p,r),f=p[this.getResources().getMappedAttribute("context")];f.extents[o]+=e,"row"===o?(a=s,h=this.m_rowHeader,d=this.m_rowHeaderLevelCount,c=this.m_startRowHeader):(a=i,h=this.m_colHeader,d=this.m_columnHeaderLevelCount,c=this.m_startColHeader);for(var C=1;C<=e;C++){var y=this._getKey(this._getHeaderByIndex(l?a-C:a+C,0,h,d,c),o);u+=this._getCellDimension(p,l?a-C:a+C,y,o,r);for(var v=0;v<t;v++){var E,w;"row"===o?(E=l?s-C:s+C,w=i+v):(E=s+v,w=l?i-C:i+C),this._addIndexToDatabodyMap(this.createIndex(E,w),p.id)}}l&&(m="width"===r?this.getResources().isRTLMode()?"right":"left":"top",this.setElementDir(p,this.getElementDir(p,m)-u,m),f.indexes[o]-=e);this.setElementDir(p,g+u,r);var S={};return S[r]=u,S[_]=this.getElementDir(p,_),S.cell=p,S},A.prototype._patchExistingCells=function(e,t,i,s){var n=e.column.extent,o=e.row.extent,r=e.row.more.before,l=e.row.more.after,a=e.column.more.before,h=e.column.more.after;return t-1===this.m_endCol&&a?this._updateCellDimension(n,o,this.m_endCol,i,s,"column","width",!1):i-1===this.m_endRow&&r?this._updateCellDimension(o,n,t,this.m_endRow,s,"row","height",!1):t+n===this.m_startCol&&h?this._updateCellDimension(n,o,this.m_startCol,i,s,"column","width",!0):!(i+o!==this.m_startRow||!l)&&this._updateCellDimension(o,n,t,this.m_startRow,s,"row","height",!0)},A.prototype._updateTempArray=function(e,t,i,s,n,o){for(var r=0;r<n;r++){null==e[i+r]&&(e[i+r]=[]);for(var l=0;l<o;l++)e[i+r][s+l]=t}},A.prototype._getCellDimension=function(e,t,i,s,n){var o,r,l;if("row"===s?(o=this.getMappedStyle("rowheadercell")+" "+this.getMappedStyle("headercell"),r=this.m_endRowHeader):"column"===s&&(o=this.getMappedStyle("colheadercell")+" "+this.getMappedStyle("headercell"),r=this.m_endColHeader),-1===r){var a=this.createHeaderContext(s,t,null,{key:i},null,0,0,1),h=this.m_options.getInlineStyle(s,a),d=this.m_options.getStyleClass(s,a);l=document.createElement("div"),null!=h&&u.applyMergedInlineStyles(l,h,""),l.className=o+" "+d}else l=e;return this._getHeaderDimension(l,i,s,n)},A.prototype._getLabelDimension=function(e,t){let i,s,n,o,r;"column"===e?(i=this.m_columnHeaderLevelHeights,s="height",n=this.m_startColHeader,o=this.m_columnHeaderLevelCount,r=this.m_colHeader):"columnEnd"===e?(i=this.m_columnEndHeaderLevelHeights,s="height",n=this.m_startColEndHeader,o=this.m_columnEndHeaderLevelCount,r=this.m_colEndHeader):"row"===e?(i=this.m_rowHeaderLevelWidths,s="width",n=this.m_startRowHeader,o=this.m_rowHeaderLevelCount,r=this.m_rowHeader):(i=this.m_rowEndHeaderLevelWidths,s="width",n=this.m_startRowEndHeader,o=this.m_rowEndHeaderLevelCount,r=this.m_rowEndHeader);let l=i[t];if(null!=l)return l;const a=this._getHeaderByIndex(n,t,r,o,n),h=a[this.getResources().getMappedAttribute("context")],d=h.level,c=h.depth,m=this.getElementDir(a,s);let u=0,_=0;for(let e=d;e<d+c;e++){let t=i[e];null!=t?u+=t:_+=1}return 0===_?m:(l=Math.max(0,Math.round((m-u)/_)),i[t]=l,l)},A.prototype._modifyAndPushCells=function(e,t,i,s,n,o){let r=this.getResources().isRTLMode()?"right":"left",l="row"===i?"top":r,a=this.getResources().getMappedAttribute("context"),h=o?1:-1,d=function(i,s,n){i.forEach(i=>{let r=s(i),l=0;if(o)r>=e[0]&&(l=e.length);else for(;l<e.length&&!(e[l]>=r);l++);if(l>0){let e=t.length?t.slice(0,l).reduce((e,t)=>e+t):0;e*=h,l*=h,n(i,e,l,r)}})};d(this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),e=>e[a].indexes[i],(e,t,s)=>{if(0!==t){let i=this.getElementDir(e,l)+t;this.setElementDir(e,i,l)}e[a].indexes[i]+=s}),d(s.querySelectorAll("."+this.getMappedStyle("headercell")),e=>e[a].index,(e,t,i)=>{if(0!==t){let i=this.getElementDir(e,l)+t;this.setElementDir(e,i,l)}e[a].index+=i}),d(s.querySelectorAll("."+this.getMappedStyle("groupingcontainer")),e=>this._getAttribute(e,"start",!0),(e,t,i,s)=>{this._setAttribute(e,"start",s+i)}),d(n.querySelectorAll("."+this.getMappedStyle("endheadercell")),e=>e[a].index,(e,t,i)=>{if(0!==t){let i=this.getElementDir(e,l)+t;this.setElementDir(e,i,l)}e[a].index+=i}),d(n.querySelectorAll("."+this.getMappedStyle("groupingcontainer")),e=>this._getAttribute(e,"start",!0),(e,t,i,s)=>{this._setAttribute(e,"start",s+i)})},A.prototype.pushRowsDown=function(e,t){for(;e<=this.m_endRow;){var i=this._getAxisCellsByIndex(e,"row");if(i.length>0)for(var s=0;s<i.length;s++){var n=i[s],o=this.getElementDir(n,"top")+t;n.style.top=o+"px"}e+=1}},A.prototype.pushRowsUp=function(e,t){this.pushRowsDown(e,-t)},A.prototype.pushRowHeadersDown=function(e,t){for(;e;){var i=this.getElementDir(e,"top")+t;e.style.top=i+"px",e=e.nextSibling}},A.prototype.pushRowHeadersUp=function(e,t){this.pushRowHeadersDown(e,-t)},A.prototype.createCellContext=function(e,t,i,s,n){var o={parentElement:s,indexes:e,cell:t};this._isDataGridProvider()?o.data=t:o.data=null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"data")?t.data:t,o.component=this,o.datasource=this.m_options.getProperty("data"),o.mode="navigation",o.extents=n;for(var r=Object.keys(i),l=0;l<r.length;l++){var a=r[l];o[a]=i[a]}return null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,o),this.m_fixContextCallback.call(this,o)},A.prototype._createUniqueId=function(e){return this._uniqueIdCallback(e,!1)},A.prototype.getRowHeaderWidth=function(){return null===this.m_rowHeaderWidth?0:this.m_rowHeaderWidth},A.prototype.getColumnHeaderHeight=function(){return null===this.m_colHeaderHeight?0:this.m_colHeaderHeight},A.prototype.getRowEndHeaderWidth=function(){return-1===this.m_endRowEndHeader?0:this.m_rowEndHeaderWidth},A.prototype.getColumnEndHeaderHeight=function(){return-1===this.m_endColEndHeader?0:this.m_colEndHeaderHeight},A.prototype.getRowBottom=function(e,t){var i=this.getColumnHeaderHeight();if(null!=t)return i+t;var s=this.getElementDir(e,"top"),n=this.calculateRowHeight(e);return isNaN(s)||isNaN(n)?i:i+s+n},A.prototype.handleCellsFetchError=function(e,t){if(this.m_fetching.cells=!1,this.hideStatusText(),null==this.m_databody.firstChild)this._shouldInitialize()&&this._handleInitialization(!0);else{var i=t[0],s=t[1];s.start+(s.count-1)>this.m_endCol&&(this.m_stopColumnFetch=!0,this.m_stopColumnHeaderFetch=!0,this.m_stopColumnEndHeaderFetch=!0),i.start+(i.count-1)>this.m_endRow&&(this.m_stopRowFetch=!0,this.m_stopRowHeaderFetch=!0,this.m_stopRowEndHeaderFetch=!0)}},A.prototype.showStatusText=function(){var e=this;"block"===this.m_status.style.display||this.m_showStatusTimeout||(this.m_showStatusTimeout=setTimeout(function(){var t=e.getResources().getTranslatedText("msgFetchingData");e.m_status.setAttribute("aria-label",t),e.m_status.style.display="block";var i=e.getWidth()/2-e.m_status.offsetWidth/2,s=e.getHeight()/2-e.m_status.offsetHeight/2;e.m_status.style.left=i+"px",e.m_status.style.top=s+"px",e.m_showStatusTimeout=null},this.getShowStatusDelay()))},A.prototype.getShowStatusDelay=function(){var e=_.getCSSTimeUnitAsMillis(this.getResources().getDefaultOption("showIndicatorDelay"));return isNaN(e)?0:e},A.prototype.hideStatusText=function(){this.m_showStatusTimeout&&(clearTimeout(this.m_showStatusTimeout),this.m_showStatusTimeout=null),this.m_status.style.display="none"},A.prototype._isFocusableElementBeforeCell=function(e){if(null==e||e===this.getRootElement()||this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return!1;var t=e.tagName;return!!("INPUT"===t||"TEXTAREA"===t||"SELECT"===t||"BUTTON"===t||"A"===t||this.m_utils.containsCSSClassName(e,this.getMappedStyle("active"))||null!=e.getAttribute("tabIndex")&&parseInt(e.getAttribute("tabIndex"),10)>=0&&this.findCell(e)!==e)||this._isFocusableElementBeforeCell(e.parentNode)},A.prototype._setFocusToFirstFocusableElement=function(e,t){u.enableAllFocusableElements(e);var i=u.getFocusableElementsInNode(e);if(i.length>0){var s=i[0];if(s.focus(),t&&t.preventDefault(),s.setSelectionRange&&s.value)try{s.setSelectionRange(s.value.length,s.value.length)}catch(e){}return!0===this._overwriteFlag&&"function"==typeof i[0].select&&s.select(),!0}return!1},A.prototype.handleScroll=function(e){if(this._clearScrollPositionTimeout(),this.m_handleScrollOverflow||(this.m_hasVerticalScroller||this.m_hasHorizontalScroller||(this.m_databody.style.overflow="hidden"),this.m_handleScrollOverflow=!0),this.m_animating)e.preventDefault();else if(!this.m_utils.isTouchDeviceNotIOS())if(!0!==this.m_silentScroll){var t;e||(e=window.event),t=e.target?e.target:e.srcElement;var i=this.m_utils.getElementScrollLeft(t),s=t.scrollTop;this.scrollTo(i,s)}else this.m_silentScroll=!1},A.prototype._getMaxScrollWidth=function(){return this._isCountUnknownOrHighwatermark("column")&&!this.m_stopColumnFetch?Number.MAX_VALUE:this.m_scrollWidth},A.prototype._getMaxScrollHeight=function(){return this._isCountUnknownOrHighwatermark("row")&&!this.m_stopRowFetch?Number.MAX_VALUE:this.m_scrollHeight},A.prototype.scroll=function(e){if(null!=e.position){var t={};t.x=Math.max(0,Math.min(this.m_scrollWidth,e.position.scrollX)),t.y=Math.max(0,Math.min(this.m_scrollHeight,e.position.scrollY)),this._scrollToScrollPositionObject(t)}},A.prototype.scrollDelta=function(e,t){this._adjustScrollerSize();var i=Math.max(0,Math.min(this._getMaxScrollWidth(),this.m_currentScrollLeft-e)),s=Math.max(0,Math.min(this._getMaxScrollHeight(),this.m_currentScrollTop-t));this._initiateScroll(i,s)},A.prototype.adjustTouchScroll=function(e,t){return this.m_utils.isTouchDevice()&&0!==e&&0!==t&&(Math.abs(e)>Math.abs(t)?(t=0,this.m_extraScrollOverY=null):(e=0,this.m_extraScrollOverX=null)),[e,t]},A.prototype._initiateScroll=function(e,t){this.m_utils.isTouchDeviceNotIOS()?this.scrollTo(e,t):(this.m_utils.setElementScrollLeft(this.m_databody,e),this.m_databody.scrollTop=t)},A.prototype._initiateScrollOnAttached=function(){this._initiateScroll(this.m_currentScrollLeft,this.m_currentScrollTop)},A.prototype._disableTouchScrollAnimation=function(){this.m_databody.firstChild.style.transitionDuration="0ms",this.m_rowHeader.firstChild.style.transitionDuration="0ms",this.m_colHeader.firstChild.style.transitionDuration="0ms",this.m_rowEndHeader.firstChild.style.transitionDuration="0ms",this.m_colEndHeader.firstChild.style.transitionDuration="0ms"},A.prototype._shouldLongScroll=function(e,t){return!this._isHighWatermarkScrolling()&&(e+this.getViewportWidth()<this._getMaxLeftPixel()||t+this.getViewportHeight()<this._getMaxTopPixel()||e>this._getMaxRightPixel()||t>this._getMaxBottomPixel())},A.prototype.scrollTo=function(e,t){if(this.m_prevScrollLeft=this.m_currentScrollLeft,this.m_currentScrollLeft=e,this.m_prevScrollTop=this.m_currentScrollTop,this.m_currentScrollTop=t,this._checkScroll=!1,this.m_utils.isTouchDeviceNotIOS()||(this._shouldLongScroll(e,t)?this.handleLongScroll(e,t):this.fillViewport(),this._checkScroll=!0),this._syncScroller(),this._adjustScrollerSize(),null!=this.m_cellToFocus){var i=this.m_cellToFocus;this.m_cellToFocus=null,this._setActive(i,this._createActiveObject(i),null,!1,!1,!0)}null!=this.m_scrollIndexAfterFetch&&this._isInViewport(this.m_scrollIndexAfterFetch)===A.INSIDE&&(this._isDatabodyCellActive()&&this.m_scrollIndexAfterFetch.row===this.m_active.indexes.row&&this.m_scrollIndexAfterFetch.column===this.m_active.indexes.column&&this._highlightActive(),this.m_scrollIndexAfterFetch=null),null!=this.m_scrollHeaderAfterFetch&&(this._isDatabodyCellActive()||this.m_scrollHeaderAfterFetch.axis!==this.m_active.axis||this.m_scrollHeaderAfterFetch.index!==this.m_active.index||this.m_scrollHeaderAfterFetch.level!==this.m_active.level||this._highlightActive(),this.m_scrollHeaderAfterFetch=null),this.m_utils.isTouchDeviceNotIOS()||this.m_prevScrollTop===t&&this.m_prevScrollLeft===e||this.fireEvent("scroll",{event:null,ui:{scrollX:e,scrollY:t}}),!this.m_utils.isTouchDeviceNotIOS()&&this.isFetchComplete()&&this._checkScrollPosition()},A.prototype._scrollTransitionEnd=function(){this._isSelectionEnabled()&&this._scrollTouchSelectionAffordance(),this.fireEvent("scroll",{event:null,ui:{scrollX:this.m_currentScrollLeft,scrollY:this.m_currentScrollTop}}),this._shouldLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop)?this.handleLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop):this.fillViewport(),this._checkScroll=!0,this.isFetchComplete()&&this._checkScrollPosition()},A.prototype._bounceBack=function(){var e=this.m_currentScrollLeft,t=this.m_currentScrollTop,i=this.m_databody.firstChild,s=this.m_colHeader.firstChild,n=this.m_rowHeader.firstChild,o=this.m_colEndHeader.firstChild,r=this.m_rowEndHeader.firstChild;i.style.transitionDuration=A.BOUNCE_ANIMATION_DURATION+"ms",n.style.transitionDuration=A.BOUNCE_ANIMATION_DURATION+"ms",r.style.transitionDuration=A.BOUNCE_ANIMATION_DURATION+"ms",s.style.transitionDuration=A.BOUNCE_ANIMATION_DURATION+"ms",o.style.transitionDuration=A.BOUNCE_ANIMATION_DURATION+"ms",null==this.m_scrollTransitionEnd&&(this.m_scrollTransitionEnd=this._scrollTransitionEnd.bind(this)),this._onTransitionEnd(i,this.m_scrollTransitionEnd,A.BOUNCE_ANIMATION_DURATION),this.getResources().isRTLMode()?(i.style.transform="translate3d("+e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+e+"px, 0, 0)",o.style.transform="translate3d("+e+"px, 0, 0)"):(i.style.transform="translate3d("+-e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+-e+"px, 0, 0)",o.style.transform="translate3d("+-e+"px, 0, 0)"),n.style.transform="translate3d(0, "+-t+"px, 0)",r.style.transform="translate3d(0, "+-t+"px, 0)",this.m_extraScrollOverX=null,this.m_extraScrollOverY=null},A.prototype._syncScroller=function(){var e=this.m_currentScrollLeft,t=this.m_currentScrollTop,i=this.m_databody.firstChild,s=this.m_colHeader.firstChild,n=this.m_rowHeader.firstChild,o=this.m_colEndHeader.firstChild,r=this.m_rowEndHeader.firstChild;if(this.m_utils.isTouchDeviceNotIOS()&&Object.prototype.hasOwnProperty.call(window,"WebKitCSSMatrix"))this._checkScroll=!1,null!=this.m_extraScrollOverX||null!=this.m_extraScrollOverY?(null!=this.m_extraScrollOverX?e+=this.m_extraScrollOverX:t+=this.m_extraScrollOverY,null==this.m_bounceBack&&(this.m_bounceBack=this._bounceBack.bind(this)),this._onTransitionEnd(i,this.m_bounceBack,500)):"0ms"===i.style.transitionDuration?this._scrollTransitionEnd():(null==this.m_scrollTransitionEnd&&(this.m_scrollTransitionEnd=this._scrollTransitionEnd.bind(this)),this._onTransitionEnd(i,this.m_scrollTransitionEnd,i.style.transitionDuration)),this.getResources().isRTLMode()?(i.style.transform="translate3d("+e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+e+"px, 0, 0)",o.style.transform="translate3d("+e+"px, 0, 0)"):(i.style.transform="translate3d("+-e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+-e+"px, 0, 0)",o.style.transform="translate3d("+-e+"px, 0, 0)"),n.style.transform="translate3d(0, "+-t+"px, 0)",r.style.transform="translate3d(0, "+-t+"px, 0)";else{var l=this.getResources().isRTLMode()?"right":"left";this.setElementDir(s,-e,l),this.setElementDir(o,-e,l),this.setElementDir(n,-t,"top"),this.setElementDir(r,-t,"top")}},A.prototype._adjustScrollerSize=function(){var e=this.m_databody.firstChild,t=this.getElementHeight(e),i=this.getElementWidth(e),s=this._getEmptyElement(),n=0,o=0;s&&(n=this.getElementHeight(s),o=this.getElementWidth(s)),(this._getMaxBottomPixel()>t||this.getDataSource().getCount("row")===this._getMaxBottom()+1&&!this._isCountUnknown("row")&&this._getMaxBottom()>-1)&&this.setElementHeight(e,Math.max(this._getMaxBottomPixel(),n)),(this._getMaxRightPixel()>i||this.getDataSource().getCount("column")===this._getMaxRight()+1&&!this._isCountUnknown("column")&&this._getMaxRight()>-1)&&this.setElementWidth(e,Math.max(this._getMaxRightPixel(),o))},A.prototype._getLongScrollStart=function(e,t,i){var s,n,o,r,l,a,h,d;if(t!==e){"row"===i?(s=this.getElementHeight(this.m_databody.firstChild),n=this.m_utils._getMaxDivHeightForScrolling(),o=this._getMaxScrollHeight(),r=this.m_avgRowHeight,l=this.m_hasHorizontalScroller?this.m_utils.getScrollbarSize():0,d=Math.max(Math.max(this.getDataSource().getCount(i),this.m_endRow),0)):"column"===i&&(s=this.getElementWidth(this.m_databody.firstChild),n=this.m_utils._getMaxDivWidthForScrolling(),o=this._getMaxScrollWidth(),r=this.m_avgColWidth,l=this.m_hasVerticalScroller?this.m_utils.getScrollbarSize():0,d=Math.max(Math.max(this.getDataSource().getCount(i),this.m_endCol),0));var c=Math.max(Math.min(e/s,1),0),m=this.getFetchSize(i);a=Math.floor(d*c),h=n<=s?Math.min(e,o):a*r,(1===c||e+m*r>s-l)&&(a=Math.max(d-m,0),h=Math.max(s-m*r,0))}else"row"===i?(a=this.m_startRow,h=this.m_startRowPixel):"column"===i&&(a=this.m_startCol,h=this.m_startColPixel);return{start:a,startPixel:h}},A.prototype.handleLongScroll=function(e,t){if(this.m_isLongScroll=!0,this.isFetchComplete()&&this._isScrollBackToEditable(!0)){var i=this._getLongScrollStart(t,this.m_prevScrollTop,"row"),s=i.start,n=i.startPixel,o=this._getLongScrollStart(e,this.m_prevScrollLeft,"column"),r=o.start,l=o.startPixel;this.m_hasCells&&(this.m_startRow=s,this.m_endRow=-1,this.m_startRowPixel=n,this.m_endRowPixel=n,this.m_startCol=r,this.m_endCol=-1,this.m_startColPixel=l,this.m_endColPixel=l),this.m_hasRowHeader&&(this.m_startRowHeader=s,this.m_endRowHeader=-1,this.m_startRowHeaderPixel=n,this.m_endRowHeaderPixel=n),this.m_hasRowEndHeader&&(this.m_startRowEndHeader=s,this.m_endRowEndHeader=-1,this.m_startRowEndHeaderPixel=n,this.m_endRowEndHeaderPixel=n),this.m_hasColHeader&&(this.m_startColHeader=r,this.m_endColHeader=-1,this.m_startColHeaderPixel=l,this.m_endColHeaderPixel=l),this.m_hasColEndHeader&&(this.m_startColEndHeader=r,this.m_endColEndHeader=-1,this.m_startColEndHeaderPixel=l,this.m_endColEndHeaderPixel=l),this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.fetchHeaders("row",s,this.m_rowHeader,this.m_rowEndHeader,void 0,{success:function(e,t,i){this.handleRowHeadersFetchSuccessForLongScroll(e,t,i)}}),this.fetchHeaders("column",r,this.m_colHeader,this.m_colEndHeader,void 0,{success:function(e,t,i){this.handleColumnHeadersFetchSuccessForLongScroll(e,t,i)}}),this.fetchCells(this.m_databody,s,r,null,null,{success:function(e,t){this.handleCellsFetchSuccessForLongScroll(e,t,s,r,n,l)}})}},A.prototype.handleRowHeadersFetchSuccessForLongScroll=function(e,t,i){var s=this.m_rowHeader.firstChild,n=this.m_rowEndHeader.firstChild;null!=s&&this.m_utils.empty(s),null!=n&&this.m_utils.empty(n),this.handleHeadersFetchSuccess(e,t,i,!1)},A.prototype.handleColumnHeadersFetchSuccessForLongScroll=function(e,t,i){var s=this.m_colHeader.firstChild,n=this.m_colEndHeader.firstChild;null!=s&&this.m_utils.empty(s),null!=n&&this.m_utils.empty(n),this.handleHeadersFetchSuccess(e,t,i,!1)},A.prototype.handleCellsFetchSuccessForLongScroll=function(e,t,i,s,n,o){var r=this.m_databody.firstChild;null==r||this._getEmptyElement()||this._emptyDatabody(r),this.handleCellsFetchSuccess(e,t)},A.prototype._cleanupViewport=function(e){if(!this._isHighWatermarkScrolling()&&this._isScrollBackToEditable()){null==e&&(this.m_prevScrollLeft>this.m_currentScrollLeft?e="right":this.m_prevScrollLeft<this.m_currentScrollLeft?e="left":this.m_prevScrollTop>this.m_currentScrollTop?e="bottom":this.m_prevScrollTop<this.m_currentScrollTop&&(e="top"));var t=this._getViewportLeft(),i=this._getViewportRight(),s=this._getViewportTop(),n=this._getViewportBottom();"top"===e&&s>this._getMaxTopPixel()?(this.removeRowsFromTop(this.m_databody),this.removeRowHeadersFromTop()):"bottom"===e&&n<this._getMaxBottomPixel()?(this.removeRowsFromBottom(this.m_databody),this.removeRowHeadersFromBottom()):"left"===e&&t>this._getMaxLeftPixel()?(this.removeColumnsFromLeft(this.m_databody),this.removeColumnHeadersFromLeft()):"right"===e&&i<this._getMaxRightPixel()&&(this.removeColumnsFromRight(this.m_databody),this.removeColumnHeadersFromRight())}},A.prototype.fillViewport=function(){var e,t;if(this.isFetchComplete()){var i=this._getViewportLeft(),s=this._getViewportRight()+A.FETCH_PIXEL_THRESHOLD,n=this._getViewportTop(),o=this._getViewportBottom()+A.FETCH_PIXEL_THRESHOLD;if(this._getMaxBottomPixel()<=o&&(!this.m_stopRowHeaderFetch||!this.m_stopRowEndHeaderFetch||!this.m_stopRowFetch))return e=Math.max(0,this._getMaxBottom()+1),t=Math.max(0,this.getFetchCount("row",e)),this.fetchHeaders("row",e,this.m_rowHeader,this.m_rowEndHeader,t),void this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1);if((this._getMaxTopPixel()>n||0===this.m_currentScrollTop)&&this._getMaxTop()>0)return e=Math.max(0,this._getMaxTop()-this.getFetchSize("row")),t=Math.max(0,this._getMaxTop()-e),this.fetchHeaders("row",e,this.m_rowHeader,this.m_rowEndHeader,t),void this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1);if(this._getMaxRightPixel()<=s&&(!this.m_stopColumnHeaderFetch||!this.m_stopColumnEndHeaderFetch||!this.m_stopColumnFetch))return e=Math.max(0,this._getMaxRight()+1),t=Math.max(0,this.getFetchCount("column",e)),this.fetchHeaders("column",e,this.m_colHeader,this.m_colEndHeader,t),void this.fetchCells(this.m_databody,this.m_startRow,e,this.m_endRow-this.m_startRow+1,t);(this._getMaxLeftPixel()>i||0===this.m_currentScrollLeft)&&this._getMaxLeft()>0&&(e=Math.max(0,this._getMaxLeft()-this.getFetchSize("column")),t=Math.max(0,this._getMaxLeft()-e),this.fetchHeaders("column",e,this.m_colHeader,this.m_colEndHeader,t),this.fetchCells(this.m_databody,this.m_startRow,e,this.m_endRow-this.m_startRow+1,t))}},A.prototype._getMaxRight=function(){return Math.max(Math.max(this.m_endCol,this.m_endColHeader),this.m_endColEndHeader)},A.prototype._getMaxLeft=function(){return Math.max(Math.max(this.m_startCol,this.m_startColHeader),this.m_startColEndHeader)},A.prototype._getMaxRightPixel=function(){return Math.max(Math.max(this.m_endColPixel,this.m_endColHeaderPixel),this.m_endColEndHeaderPixel)},A.prototype._getMaxLeftPixel=function(){return Math.max(Math.max(this.m_startColPixel,this.m_startColHeaderPixel),this.m_startColEndHeaderPixel)},A.prototype._getMaxBottom=function(){return Math.max(Math.max(this.m_endRow,this.m_endRowHeader),this.m_endRowEndHeader)},A.prototype._getMaxTop=function(){return Math.max(Math.max(this.m_startRow,this.m_startRowHeader),this.m_startRowEndHeader)},A.prototype._getMaxBottomPixel=function(){return Math.max(Math.max(this.m_endRowPixel,this.m_endRowHeaderPixel),this.m_endRowEndHeaderPixel)},A.prototype._getMaxTopPixel=function(){return Math.max(Math.max(this.m_startRowPixel,this.m_startRowHeaderPixel),this.m_startRowEndHeaderPixel)},A.prototype._isScrollBackToEditable=function(e){var t=this._getCurrentMode(),i=this._getActiveElement();return"edit"!==t||!e&&!this._isCellGoingToBeRemoved(i)||this._handleExitEdit(null,i)},A.prototype._isCellGoingToBeRemoved=function(e){if(!this._isHighWatermarkScrolling()){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.getElementDir(e.parentNode,"top");if(t+this.getElementHeight(e)<this.m_currentScrollTop||t<this.m_currentScrollTop+this.getViewportHeight())return!0}if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var i=this.getElementDir(e,"left");if(i+this.getElementWidth(e)<this.m_currentScrollLeft||i<this.m_currentScrollLeft+this.getViewportHeight())return!0}}},A.prototype._removeCellsAlongAxis=function(e,t,i){var s,n,o,r,l,a,h,d,c,m,u,_,p,g,f=0,C=0;for("row"===e?(n=this.m_startRow,o=this.m_endRow,r=this.m_rowHeader,l=this.m_rowHeaderLevelCount,a=this.m_startRowHeader,h="height",d=this.m_startRowPixel,c=this.m_endRowPixel,m=this.m_currentScrollTop,u="column",_=this.m_startCol,p=this.m_endCol,g="top",s=i?o:n):(n=this.m_startCol,o=this.m_endCol,r=this.m_colHeader,l=this.m_columnHeaderLevelCount,a=this.m_startColHeader,h="width",d=this.m_startColPixel,c=this.m_endColPixel,m=this.m_currentScrollLeft,u="row",_=this.m_startRow,p=this.m_endRow,g=this.getResources().isRTLMode()?"right":"left",s=i?o:n);s<=o&&s>=n;){var y=this._getKey(this._getHeaderByIndex(s,l-1,r,l,a),e);null==y&&(y=this._getKey(this._getCellByIndex("column"===e?this.createIndex(this.m_startRow,s):this.createIndex(s,this.m_startCol)),e));var v=this._getCellDimension(null,s,y,e,h);if(!(i?c-v-f>t:d+v+f<m-t))break;for(var E,w=_;w<=p;w+=E){var S=this._getCellByIndex("column"===e?this.createIndex(w,s):this.createIndex(s,w)),H=S[this.getResources().getMappedAttribute("context")],x=H.extents[e];E=H.extents[u],1===x?this._remove(S):(H.extents[e]-=1,this.setElementDir(S,this.getElementDir(S,h)-v,h),i||(H.indexes[e]+=1,this.setElementDir(S,this.getElementDir(S,g)+v,g)));for(var b=0;b<E;b++){var R="column"===e?this.createIndex(w+b,s):this.createIndex(s,w+b);this._removeIndexFromDatabodyMap(R)}}f+=v,C+=1,s=i?s-1:s+1}return{dimensionChange:f,extentChange:C}},A.prototype.removeHeadersFromStartOfContainer=function(e,t,i,s,n,o,r,l){var a=0,h=0,d=null==t?e.firstChild:t.nextSibling;if(null==d)return{extentChange:0,dimensionChange:0};for(var c=this.m_utils.containsCSSClassName(d,n),m=c?d:d.firstChild,u=this.getElementDir(m,o);i+u<l-s;){if(this._remove(d),h+=u,a+=c?1:this._getAttribute(d,"extent",!0),i+=u,null==(d=null==t?e.firstChild:t.nextSibling))return{extentChange:a,dimensionChange:h};m=(c=this.m_utils.containsCSSClassName(d,n))?d:d.firstChild,u=this.getElementDir(m,o)}if(!c){var _=this.removeHeadersFromStartOfContainer(d,d.firstChild,i,s,n,o,r,l);this._setAttribute(d,"start",this._getAttribute(d,"start",!0)+_.extentChange),this._setAttribute(d,"extent",this._getAttribute(d,"extent",!0)-_.extentChange),this.setElementDir(m,this.getElementDir(m,r)+_.dimensionChange,r),this.setElementDir(m,this.getElementDir(m,o)-_.dimensionChange,o),a+=_.extentChange,h+=_.dimensionChange}return{extentChange:a,dimensionChange:h}},A.prototype.removeHeadersFromEndOfContainer=function(e,t,i,s,n){for(var o=0,r=0,l=e.lastChild,a=this.m_utils.containsCSSClassName(l,s),h=a?l:l.firstChild,d=this.getElementDir(h,n);t-d>i;)this._remove(l),r+=d,o+=a?1:this._getAttribute(l,"extent",!0),t-=d,l=e.lastChild,h=(a=this.m_utils.containsCSSClassName(l,s))?l:l.firstChild,d=this.getElementDir(h,n);if(!a){var c=this.removeHeadersFromEndOfContainer(l,t,i,s,n);this._setAttribute(l,"extent",this._getAttribute(l,"extent",!0)-c.extentChange),this.setElementDir(h,this.getElementDir(h,n)-c.dimensionChange,n),o+=c.extentChange,r+=c.dimensionChange}return{extentChange:o,dimensionChange:r}},A.prototype.removeColumnHeadersFromLeft=function(){var e,t;if(this.m_endColHeader-this.m_startColHeader>this.MAX_COLUMN_THRESHOLD){var i=this.m_colHeader.firstChild;e=this.getColumnThreshold(),this.m_startColHeaderPixel<=this.m_currentScrollLeft-e&&(t=this.removeHeadersFromStartOfContainer(i,null,this.m_startColHeaderPixel,e,this.getMappedStyle("colheadercell"),"width",this.getResources().isRTLMode()?"right":"left",this.m_currentScrollLeft),this.m_startColHeaderPixel+=t.dimensionChange,this.m_startColHeader+=t.extentChange)}if(this.m_endColEndHeader-this.m_startColEndHeader>this.MAX_COLUMN_THRESHOLD){var s=this.m_colEndHeader.firstChild;e=this.getColumnThreshold(),this.m_startColEndHeaderPixel<this.m_currentScrollLeft-e&&(t=this.removeHeadersFromStartOfContainer(s,null,this.m_startColEndHeaderPixel,e,this.getMappedStyle("colendheadercell"),"width",this.getResources().isRTLMode()?"right":"left",this.m_currentScrollLeft),this.m_startColEndHeaderPixel+=t.dimensionChange,this.m_startColEndHeader+=t.extentChange)}},A.prototype.removeColumnsFromLeft=function(e){if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var t=e.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getColumnThreshold();if(t.length<1)return;var s=this._removeCellsAlongAxis("column",i,!1);this.m_startColPixel+=s.dimensionChange,this.m_startCol+=s.extentChange}},A.prototype.removeColumnHeadersFromRight=function(){var e,t,i=this.m_currentScrollLeft+this.getViewportWidth()+this.getColumnThreshold();this.m_endColHeader-this.m_startColHeader>this.MAX_COLUMN_THRESHOLD&&(e=this.m_colHeader.firstChild,this.m_endColHeaderPixel>i&&(this.m_stopColumnHeaderFetch&&(this.m_stopColumnHeaderFetch=!1),t=this.removeHeadersFromEndOfContainer(e,this.m_endColHeaderPixel,i,this.getMappedStyle("colheadercell"),"width"),this.m_endColHeaderPixel-=t.dimensionChange,this.m_endColHeader-=t.extentChange)),this.m_endColEndHeader-this.m_startColEndHeader>this.MAX_COLUMN_THRESHOLD&&(e=this.m_colEndHeader.firstChild,this.m_endColEndHeaderPixel>i&&(this.m_stopColumnEndHeaderFetch&&(this.m_stopColumnEndHeaderFetch=!1),t=this.removeHeadersFromEndOfContainer(e,this.m_endColEndHeaderPixel,i,this.getMappedStyle("colendheadercell"),"width"),this.m_endColEndHeaderPixel-=t.dimensionChange,this.m_endColEndHeader-=t.extentChange))},A.prototype.removeColumnsFromRight=function(e){if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var t=e.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.m_currentScrollLeft+this.getViewportWidth()+this.getColumnThreshold();if(this.m_endColPixel<=i||t.length<1)return;this.m_stopColumnFetch&&(this.m_stopColumnFetch=!1);var s=this._removeCellsAlongAxis("column",i,!0);this.m_endColPixel-=s.dimensionChange,this.m_endCol-=s.extentChange}},A.prototype.removeRowHeadersFromTop=function(){var e,t;if(this.m_endRowHeader-this.m_startRowHeader>this.MAX_ROW_THRESHOLD){var i=this.m_rowHeader.firstChild;t=this.getRowThreshold(),this.m_startRowHeaderPixel>=this.m_currentScrollTop-t||(e=this.removeHeadersFromStartOfContainer(i,null,this.m_startRowHeaderPixel,t,this.getMappedStyle("rowheadercell"),"height","top",this.m_currentScrollTop),this.m_startRowHeaderPixel+=e.dimensionChange,this.m_startRowHeader+=e.extentChange)}if(this.m_endRowEndHeader-this.m_startRowEndHeader>this.MAX_ROW_THRESHOLD){var s=this.m_rowEndHeader.firstChild;t=this.getRowThreshold(),this.m_startRowEndHeaderPixel>=this.m_currentScrollTop-t||(e=this.removeHeadersFromStartOfContainer(s,null,this.m_startRowEndHeaderPixel,t,this.getMappedStyle("rowendheadercell"),"height","top",this.m_currentScrollTop),this.m_startRowEndHeaderPixel+=e.dimensionChange,this.m_startRowEndHeader+=e.extentChange)}},A.prototype.removeRowsFromTop=function(e){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.getRowThreshold();if(this.m_startRowPixel>=this.m_currentScrollTop-t)return;var i=this._removeCellsAlongAxis("row",t,!1);this.m_startRowPixel+=i.dimensionChange,this.m_startRow+=i.extentChange}},A.prototype.removeRowHeadersFromBottom=function(){var e,t=this.m_currentScrollTop+this.getViewportHeight()+this.getRowThreshold();if(this.m_endRowHeader-this.m_startRowHeader>this.MAX_ROW_THRESHOLD){var i=this.m_rowHeader.firstChild;this.m_endRowHeaderPixel<=t||(this.m_stopRowHeaderFetch&&(this.m_stopRowHeaderFetch=!1),e=this.removeHeadersFromEndOfContainer(i,this.m_endRowHeaderPixel,t,this.getMappedStyle("rowheadercell"),"height"),this.m_endRowHeaderPixel-=e.dimensionChange,this.m_endRowHeader-=e.extentChange)}if(this.m_endRowEndHeader-this.m_startRowEndHeader>this.MAX_ROW_THRESHOLD){var s=this.m_rowEndHeader.firstChild;this.m_endRowEndHeaderPixel<=t||(this.m_stopRowEndHeaderFetch&&(this.m_stopRowEndHeaderFetch=!1),e=this.removeHeadersFromEndOfContainer(s,this.m_endRowEndHeaderPixel,t,this.getMappedStyle("rowendheadercell"),"height"),this.m_endRowEndHeaderPixel-=e.dimensionChange,this.m_endRowEndHeader-=e.extentChange)}},A.prototype.removeRowsFromBottom=function(e){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.m_currentScrollTop+this.getViewportHeight()+this.getRowThreshold();if(this.m_endRowPixel<=t)return;this.m_stopRowFetch&&(this.m_stopRowFetch=!1);var i=this._removeCellsAlongAxis("row",t,!0);this.m_endRowPixel-=i.dimensionChange,this.m_endRow-=i.extentChange}},A.prototype.handleContextMenuGesture=function(e,t,i){var s,n,o,r,l=e.originalEvent.target,a=this.findCell(l),h=!1;if(null===a&&(a=this.findHeader(l))&&(h=!0,r=this.getHeaderCellAxis(a)),"touch"===t&&null!=a){s=h?this.getHeaderCellIndex(a):this.getCellIndexes(a);let t=h?this._isHeaderInsideSelection(s,r):this._isContainSelection(s);(!this.isMultipleSelection()||!t||this._isDatabodyCellActive()&&s.row!==this.m_active.indexes.row&&s.column!==this.m_active.indexes.column)&&(this._isSelectionEnabled()?this.handleDatabodyClickSelection(e.originalEvent):this.handleDatabodyClickActive(e.originalEvent))}if(!this.m_utils._isNodeEditableOrClickable(l,this.m_root)){if(null==a||h)if(null==(a=this.findHeader(l)||this.findLabel(l))){var d="disable";n={resize:d,resizeWidth:d,resizeHeight:d,sortRow:d,sortCol:d,cut:d,paste:d,sortColAsc:d,sortColDsc:d,sortRowAsc:d,sortRowDsc:d},o=a}else(n=this._getHeaderCapability(a)).resizeFitToContent=h?"enable":"disable","column"!==r&&"columnEnd"!==r||!this.m_selectionFrontier||"column"!==this.m_selectionFrontier.axis?"row"!==r&&"rowEnd"!==r||!this.m_selectionFrontier||"row"!==this.m_selectionFrontier.axis||(n.resizeWidth="disable"):n.resizeHeight="disable",o=a;else s=this.getCellIndexes(a),this.isMultipleSelection()&&this._isContainSelection(s)?(o=this._getActiveElement(),this._isDatabodyCellActive()?(null==o&&(o=a),(n="keyboard"===t?this._getCellCapability(o):this._getCellCapability(o,a)).resizeFitToContent="disable"):(n=this._getHeaderCapability(o,a)).resizeFitToContent="enable"):(o=a,(n=this._getCellCapability(o)).resizeFitToContent="disable"),this.m_selectionFrontier&&"row"===this.m_selectionFrontier.axis?n.resizeWidth="disable":this.m_selectionFrontier&&"column"===this.m_selectionFrontier.axis&&(n.resizeHeight="disable");i.call(null,{capabilities:n,launcher:o},e,t)}},A.prototype._getCellCapability=function(e,t){var i=!0,s=!0,n="disable",o="enable",r={resize:n,resizeWidth:n,resizeHeight:n,sortRow:n,sortCol:n,cut:n,cutCells:n,copyCells:n,paste:n,pasteCells:n,autoFill:n,sortColAsc:n,sortColDsc:n,sortRowAsc:n,sortRowDsc:n};if(null!=t&&(i=this._getIndex(e,"column")===this._getIndex(t,"column"),!1===(s=this._getKey(e,"row")===this._getKey(t,"row"))&&!1===i))return r;this.m_options.isCopyEnabled()&&(r.copyCells=o),this.m_options.isCutEnabled()&&(r.cutCells=o),this.m_options.isPasteEnabled()&&(r.pasteCells=o);let l=this.m_selection,a=!1;if(!this.m_discontiguousSelection&&l&&1===l.length){let e=l[0].startIndex.row,t=l[0].startIndex.column,i=l[0].endIndex.row,s=l[0].endIndex.column;e===i&&t===s||(a=!0)}this.m_options.isFloodFillEnabled()&&a&&(r.autoFill=o);var h=this.getHeaderFromCell(e,"row"),d=this.getHeaderFromCell(e,"column"),c=this.getResources().getMappedAttribute("resizable"),m=this.getResources().getMappedAttribute("sortable");if(null!=d&&i&&("true"===d.getAttribute(c)&&(r.resize=o,r.resizeWidth=o),"true"===d.getAttribute(m))){r.sortCol=o,r.sortColAsc=o,r.sortColDsc=o;var u=d.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===u?r.sortColAsc=n:"descending"===u&&(r.sortColDsc=n)}return null!=h&&s&&(this._isMoveEnabled("row")&&(r.cut=o,r.paste=o),"true"===h.getAttribute(m)&&(r.sortRow=o,r.sortRowAsc=o,r.sortRowDsc=o),null!=h&&("true"===h.getAttribute(c)&&(r.resize=o,r.resizeHeight=o),"true"===h.getAttribute(m)&&(r.sortRow=o))),r},A.prototype._getHeaderCapability=function(e,t){var i=!0,s=!0,n="disable",o="enable",r={resize:n,resizeWidth:n,resizeHeight:n,sortRow:n,sortCol:n,cut:n,paste:n,sortColAsc:n,sortColDsc:n,sortRowAsc:n,sortRowDsc:n};if(null!=t&&(i=this.getHeaderCellIndex(e)===this._getIndex(t,"column"),!1===(s=this._getKey(e,"row")===this._getKey(t,"row"))&&!1===i))return r;var l=this.getHeaderCellAxis(e),a=this.getResources().getMappedAttribute("resizable"),h=this.getResources().getMappedAttribute("sortable");if(null!==e)if("column"!==l&&"columnEnd"!==l||!i){if(s&&(this._isMoveEnabled("row")&&(r.cut=o,r.paste=o),"true"===e.getAttribute(a)&&(r.resize=o,r.resizeHeight=o),r.resizeWidth=this.m_options.isResizable(l,"width"),"true"===e.getAttribute(h))){r.sortRow=o,r.sortRowAsc=o,r.sortRowDsc=o;let t=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===t?r.sortRowAsc=n:"descending"===t&&(r.sortRowDsc=n)}}else if("true"===e.getAttribute(a)&&(r.resizeWidth=o,r.resize=o),r.resizeHeight=this.m_options.isResizable(l,"height"),"true"===e.getAttribute(h)){r.sortCol=o,r.sortColAsc=o,r.sortColDsc=o;var d=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===d?r.sortColAsc=n:"descending"===d&&(r.sortColDsc=n)}return r.resize=r.resizeHeight===o||r.resizeWidth===o?o:n,r},A.prototype.handleContextMenuReturn=function(e,t,i){var s,n;if(null!=this.m_active&&(s=this._getActiveElement()),t===this.m_resources.getMappedCommand("resizeHeight")||t===this.m_resources.getMappedCommand("resizeWidth"))this.isResizeEnabled()&&this.handleContextMenuResize(e,t,i,s);else if(t===this.m_resources.getMappedCommand("resizeFitToContent")){let t,i=this.findCell(e.target);i&&(t=this.getHeaderFromCell(i,this.m_selectionFrontier.axis)),t||(t=this.findHeader(e.target)),t||(t=this.findLabel(e.target)),t&&(this.m_resizingElement=t);const s=this.getHeaderCellAxis(this.m_resizingElement),n=this.getHeaderCellLevel(this.m_resizingElement);let o=!1;("row"!==s&&"rowEnd"!==s||n!==this.m_rowHeaderLevelCount-1)&&("column"!==s&&"columnEnd"!==s||n!==this.m_columnHeaderLevelCount-1)||(o=!0),o&&this.isResizeEnabled()&&this._getHeadersForResizeFitToContent(e)}else t===this.m_resources.getMappedCommand("sortColAsc")||t===this.m_resources.getMappedCommand("sortColDsc")?(n=t===this.m_resources.getMappedCommand("sortColAsc")?"ascending":"descending",this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=this.getHeaderFromCell(s,"column")),this._isDOMElementSortable(s)&&this._handleCellSort(e,n,s)):t===this.m_resources.getMappedCommand("sortRowAsc")||t===this.m_resources.getMappedCommand("sortRowDsc")?(n=t===this.m_resources.getMappedCommand("sortRowAsc")?"ascending":"descending",this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=this.getHeaderFromCell(s,"row")),this._isDOMElementSortable(s)&&this._handleCellSort(e,n,s)):t===this.m_resources.getMappedCommand("cut")?this._handleCut(e,s):t===this.m_resources.getMappedCommand("paste")?this._handlePaste(e,s):t===this.m_resources.getMappedCommand("cutCells")?this._handleCutCells(e,s):t===this.m_resources.getMappedCommand("copyCells")?this._handleCopyCells(e,s):t===this.m_resources.getMappedCommand("pasteCells")?this._handlePasteCells(e,s):t===this.m_resources.getMappedCommand("autoFill")?this._handleAutofill(e,s):t===this.m_resources.getMappedCommand("discontiguousSelection")&&this.setDiscontiguousSelectionMode(i)},A.prototype._isSortEnabled=function(e,t){var i=this.getDataSource().getCapability("sort"),s=this.m_options.isSortable(e,t);return!("enable"!==s&&"auto"!==s||"full"!==i&&i!==e)&&(!this._isDataGridProvider()||null!=t.metadata.sortDirection)},A.prototype._isParentNode=function(e){return!!this._isDataGridProvider()&&(e.metadata.expanded&&null!==e.metadata.expanded)},A.prototype._isRequired=function(e){return!!this._isDataGridProvider()&&!0===e.metadata.showRequired},A.prototype._isHierarchicalGroup=function(e){return null==e.metadata.treeDepth},A.prototype._isLeafNode=function(e){if(!e.metadata)return!1;const t=e.metadata.treeDepth;return!!this._isDataGridProvider()&&(null!=t&&0!==t)},A.prototype._isDOMElementSortable=function(e){if(null==e)return!1;var t=this.findHeader(e);return null!=t&&"true"===t.getAttribute(this.getResources().getMappedAttribute("sortable"))},A.prototype._isSelectionEnabled=function(){return"none"!==this.m_options.getSelectionCardinality()},A.prototype.isMultipleSelection=function(){return"multiple"===this.m_options.getSelectionCardinality()},A.prototype.isResizeEnabled=function(){return this.m_options.isResizable("row","width")||this.m_options.isResizable("row","height")||this.m_options.isResizable("column","width")||this.m_options.isResizable("column","height")||this.m_options.isResizable("rowEnd","width")||this.m_options.isResizable("rowEnd","height")||this.m_options.isResizable("columnEnd","width")||this.m_options.isResizable("columnEnd","height")},A.prototype._isHeaderResizeEnabled=function(e,t){return"column"===e||"columnEnd"===e?"enable"===this.m_options.isResizable(e,"width",t):("row"===e||"rowEnd"===e)&&"enable"===this.m_options.isResizable(e,"height",t)},A.prototype.handleMouseMove=function(e){this.isResizeEnabled()&&!1===this.m_databodyDragState&&this.handleResize(e)},A.prototype.handleRowHeaderMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_databodyMove&&!this._isDataGridProvider()?this._handleMove(e):this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("row")||this.m_deselectInfo&&this.m_deselectInfo.axis&&-1!==this.m_deselectInfo.axis.indexOf("row"))?this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress):this.m_isResizing||this.handleMouseMove(e)},A.prototype.handleColumnHeaderMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("column")||this.m_deselectInfo&&this.m_deselectInfo.axis&&-1!==this.m_deselectInfo.axis.indexOf("column"))?this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress):this.m_isResizing||this.handleMouseMove(e)},A.prototype.handleHeaderLabelMouseMove=function(e){this.m_isResizing||this.handleMouseMove(e)},A.prototype.handleHeaderMouseDown=function(e){var t;this._exitActionableMode();var i=e.target;if(this._isEditOrEnter()){var s=this._getActiveElement();if(!1===this._leaveEditing(e,s,!1))return}if(this._isDisclosureIcon(i))this.handleHeaderClickActive(e,null,!0);else{var n=this.m_options.getSelectionMode();if(0===e.button){if((this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdescending")))&&this._isDOMElementSortable(i))return e.preventDefault(),void this._handleSortIconMouseDown(i);if(this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortIcon"))&&this._isDOMElementSortable(i.lastChild))return e.preventDefault(),void this._handleSortIconMouseDown(i.lastChild);this.isResizeEnabled()&&(t=this.handleResizeMouseDown(e),this._highlightResizeMouseDown());var o=this.m_utils.ctrlEquivalent(e);this._isDataGridProvider()||this.m_isResizing||o||!this._isMoveOnElementEnabled(this.findHeader(i))||(this.m_databodyMove=!0,this.m_currentX=e.pageX,this.m_currentY=e.pageY,t=!0);let s=this.findHeader(e.target),n=this.getHeaderCellAxis(s);if(this.m_utils.containsCSSClassName(s,this.getMappedStyle("draggableItem"))&&this.m_utils.addCSSClassName(s,this.getMappedStyle("dragging")),this._isDataGridProvider()&&this.m_options._isDragEnabled(n)&&this.shouldHoverHeader(s)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(s))return}if(!this.m_isResizing&&"default"===this.manageHeaderCursor(e,!1)){this.m_root.contains(document.activeElement)&&document.activeElement!==this.m_root||(this.m_externalFocus=!0);var r=this.findHeader(i)[this.getResources().getMappedAttribute("context")];if(!this._isSelectionEnabled()||!this.isMultipleSelection()||"row"===n&&-1===r.axis.indexOf("row")||this.m_databodyMove)if("row"===n&&-1!==r.axis.indexOf("row")&&this._isSelectionEnabled())this.handleHeaderClickSelection(e);else if("row"===n&&-1!==r.axis.indexOf("column")&&this._isSelectionEnabled()){let t=!1;e.shiftKey||(t=!0),this.handleHeaderClickActive(e,t)}else this.handleHeaderClickActive(e);else 0===e.button&&(this.m_headerDragState=!0),this.handleHeaderClickSelection(e)}this.m_options.isFloodFillEnabled()&&this.m_bottomFloodFillIconContainer&&this.m_bottomFloodFillIconContainer.parentNode&&(this.m_bottomFloodFillIconContainer.parentNode.removeChild(this.m_bottomFloodFillIconContainer),this.m_bottomFloodFillIconContainer.removeEventListener("mouseover",this.handleDatabodyMouseMove)),!0===t&&e.preventDefault()}},A.prototype.handleHeaderLabelMouseDown=function(e){var t;this.isResizeEnabled()&&(t=this.handleResizeMouseDown(e),this._highlightResizeMouseDown()),!0===t&&e.preventDefault()},A.prototype.handleMouseUp=function(e){this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_deselectInProgress=!1,this.m_databodyMove?this._handleMoveMouseUp(e,!1):this.isResizeEnabled()&&this.handleResizeMouseUp(e),this.m_databodyMove=!1},A.prototype.shouldHoverHeader=function(e){const t=null==e?null:this.getHeaderCellAxis(e),i=null===e?null:this.getHeaderCellLevel(e),s="row"===t||"rowEnd"===t,n=this.m_options.getSelectionMode();return this._isSelectionEnabled()&&(this.isMultipleSelection()&&"cell"===n||"row"===n&&s&&(this.isMultipleSelection()||null!==i&&i===this.m_rowHeaderLevelCount-1))},A.prototype.handleHeaderMouseOver=function(e){var t=e.target,i=this.findHeader(t);!this.m_isResizing&&"default"===this.manageHeaderCursor(e,!1)&&this.shouldHoverHeader(i)&&this.m_utils.addCSSClassName(i,this.getMappedStyle("hover"));let s=this.getHeaderCellAxis(i);this._isDataGridProvider()&&this.shouldHoverHeader(i)&&this.m_options._isDragEnabled(s)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(i)},A.prototype.handleHeaderMouseOut=function(e){var t=e.target;this.m_utils.removeCSSClassName(this.findHeader(t),this.getMappedStyle("hover")),!this.m_isResizing&&this.m_resizingElement&&(this.m_resizingElement.style.cursor="",null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor="")),this._isDOMElementSortable(t)&&this._handleSortMouseOut(e)},A.prototype.handleHeaderMouseUp=function(e){this.handleDragAnchorChange(e),this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_deselectInProgress=!1,this.m_floodFillDragState&&(this.unhighlightFloodFillRange(),this.m_selectionRange=null,this.m_floodFillRange=null,this.m_floodFillDirection=null,this.m_databody.style.cursor="default",this.m_cursor="default"),this.m_databodyMove&&this._handleMoveMouseUp(e,!0);let t=this.findHeader(e.target),i=this.getHeaderCellAxis(t);this._isDataGridProvider()&&this.m_options._isDragEnabled(i)&&this.shouldHoverHeader(t)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(t),this.m_utils.containsCSSClassName(t,this.getMappedStyle("dragging"))&&this.m_utils.removeCSSClassName(t,this.getMappedStyle("dragging"))},A.prototype.handleCornerMouseDown=function(e){let t,i=e.target,s=this.m_utils.containsCSSClassName(i,this.getMappedStyle("rowendheaderlabel"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("columnendheaderlabel")),n=this.findLabel(i);null!=n&&(t=s,this._setActive(n,this._createActiveObject(n),e,t),this.handleHeaderLabelMouseDown(e))},A.prototype.handleCornerMouseOver=function(e){var t=e.target;let i=this.findLabel(t);this._isSelectionEnabled()&&this.isMultipleSelection()&&(i?this.m_utils.addCSSClassName(i,this.getMappedStyle("hover")):this.m_utils.addCSSClassName(this.find(t,"topcorner"),this.getMappedStyle("hover"))),this.m_isResizing||null===i||this.handleMouseMove(e)},A.prototype.handleCornerMouseMove=function(e){var t=e.target;let i=this.findLabel(t);this.m_isResizing||null===i||this.handleMouseMove(e)},A.prototype.handleCornerMouseOut=function(e){var t=e.target;let i=this.findLabel(t);i?this.m_utils.removeCSSClassName(i,this.getMappedStyle("hover")):this.m_utils.removeCSSClassName(this.find(t,"topcorner"),this.getMappedStyle("hover"))},A.prototype.handleCornerClick=function(e){this._handleSelectAll(e)},A.prototype.handleHeaderClick=function(e){var t=e.target;(this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortdefault")))&&this._isDOMElementSortable(t)||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortIcon"))&&this._isDOMElementSortable(t.lastChild)?(this._removeTouchSelectionAffordance(),this._handleHeaderSort(e),e.preventDefault()):this._isDisclosureIcon(e.target)&&(this._removeTouchSelectionAffordance(),this._handleExpandCollapseRequest(e),e.preventDefault())},A.prototype.handleHeaderDoubleClick=function(e){if(document.contains(e.target)){let t=!1;if(this.m_cursor=this.manageHeaderCursor(e,t),"col-resize"===this.m_cursor||"row-resize"===this.m_cursor){this.m_resizingElement||(this.m_resizingElement=this.findHeader(e.target));const t=this.getHeaderCellAxis(this.m_resizingElement),i=this.getHeaderCellLevel(this.m_resizingElement);let s=!1;("row"!==t&&"rowEnd"!==t||i!==this.m_rowHeaderLevelCount-1||"row-resize"!==this.m_cursor)&&("column"!==t&&"columnEnd"!==t||i!==this.m_columnHeaderLevelCount-1||"col-resize"!==this.m_cursor)||(s=!0),s&&this.isResizeEnabled()&&this._getHeadersForResizeFitToContent(e)}}},A.prototype._getHeadersForResizeFitToContent=function(e){const t=this.getHeaderCellAxis(this.m_resizingElement),i=this.getHeaderCellIndex(this.m_resizingElement);let s=[];if(this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection.length){let e=this.m_selection[0];s=this._getHeadersWithinSelection(e,i,t)}s.length||s.push(this.m_resizingElement),s.forEach(i=>{this.handleResizeFitToContent(e,i,t)})},A.prototype._getHeadersWithinSelection=function(e,t,i){let s,n,o,r,l,a,h,d=[];if("column"===i?(s=this.m_startColHeader,n=this.m_columnHeaderLevelCount-1,o=this.m_columnHeaderLevelCount,r=this.m_colHeader,l="column"):"columnEnd"===i?(s=this.m_startColEndHeader,n=this.m_columnEndHeaderLevelCount-1,o=this.m_columnEndHeaderLevelCount,r=this.m_colEndHeader,l="column"):"row"===i?(s=this.m_startRowHeader,n=this.m_rowHeaderLevelCount-1,o=this.m_rowHeaderLevelCount,r=this.m_rowHeader,l="row"):(s=this.m_startRowEndHeader,n=this.m_rowEndHeaderLevelCount-1,o=this.m_rowEndHeaderLevelCount,r=this.m_rowEndHeader,l="row"),0===e.startIndex.column&&-1===e.endIndex.column&&0===e.startIndex.row&&-1===e.endIndex.row){a=0,h="row"===l?this.m_endRowHeader-this.m_startRowHeader:this.m_endColHeader-this.m_startColHeader}else 0===e.startIndex.column&&-1===e.endIndex.column||void 0===e.startIndex.column?e.startIndex.row<=t&&t<=e.endIndex.row&&("row"===i||"rowEnd"===i)&&(a=e.startIndex.row,h=e.endIndex.row):(0===e.startIndex.row&&-1===e.endIndex.row||void 0===e.startIndex.row)&&e.startIndex.column<=t&&t<=e.endIndex.column&&("column"===i||"columnEnd"===i)&&(a=e.startIndex.column,h=e.endIndex.column);for(let e=a;e<=h;e++){let t=this._getHeaderByIndex(e,n,r,o,s);t&&d.push(t)}return d},A.prototype._setHeaderDraggable=function(e){let t=!1;if(this.m_selection&&this.m_selection.length){if(this._isSelectionAcrossAxis())return!1;this.m_utils.containsCSSClassName(e,this.getMappedStyle("selected"))&&(t=!0)}return t&&(this.m_utils.addCSSClassName(e,this.getMappedStyle("draggableItem")),e.setAttribute("draggable",!0)),t},A.prototype._isSelectionAcrossAxis=function(){let e,t=!1;for(let i=0;i<this.m_selection.length;i++){let s=this.m_selection[i];if(e&&(-1===s.endIndex.row&&"column"!==e||-1===s.endIndex.column&&"row"!==e)){t=!0;break}-1===s.endIndex.row?e="column":-1===s.endIndex.column&&(e="row")}return t},A.prototype.handleDatabodyMouseDown=function(e){var t=e.target,i=this.findCell(t);if(null!=i){if(this._isEditOrEnter()){var s=this._getActiveElement();if(i===s)return;if(!1===this._leaveEditing(e,s,!1))return}else this._exitActionableMode();var n=this.m_utils.ctrlEquivalent(e);0!==e.button||n||this._isMoveOnElementEnabled(i)&&(this.m_databodyMove=!0,this.m_currentX=e.pageX,this.m_currentY=e.pageY),this.m_root.contains(document.activeElement)&&document.activeElement!==this.m_root||(this.m_externalFocus=!0),this._isGridEditable()&&(this.m_shouldFocus=!this._isFocusableElementBeforeCell(t)),this._isSelectionEnabled()?(this.isMultipleSelection()&&0===e.button&&(this.m_databodyDragState=!0),this.handleDatabodyClickSelection(e)):this.handleDatabodyClickActive(e)}else this.m_scrollbarFocus=!0},A.prototype.handleDatabodyMouseOut=function(e){if(!this.m_databodyMove){var t=e.target,i=this.findCell(t);this._setCellHover(i,"remove")}},A.prototype.handleDatabodyMouseOver=function(e){if(!this.m_databodyMove){var t=e.target,i=this.findCell(t);this._setCellHover(i,"add")}},A.prototype._setCellHover=function(e,t){if(null!=e&&this._isSelectionEnabled()){var i=this.m_options.getSelectionMode();if("cell"===i)"add"===t?this.m_utils.addCSSClassName(e,this.getMappedStyle("hover")):this.m_utils.removeCSSClassName(e,this.getMappedStyle("hover"));else if("row"===i)for(var s=this._getIndex(e,"row"),n=this._getSelectionStartAndEnd(this.createIndex(s,this.m_startCol),this.createIndex(s,this.m_endCol),0),o=n.min.row;o<=n.max.row;o++)this._highlightCellsAlongAxis(o,"row","index",t,["hover"])}},A.prototype.handleDatabodyDoubleClick=function(e){if(this._isGridEditable()){var t=e.target,i=this.findCell(t);if("edit"===this._getCurrentMode()){var s=this._getActiveElement();if(i===s)return;if(!this._handleExitEdit(e,s))return}this._handleEditable(e,i),this._handleEdit(e,i)}},A.prototype.handleDatabodyMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_databodyMove?this._handleMove(e):this.m_databodyDragState?this.m_floodFillDragState?this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionRange||(this.m_selectionRange=this.GetSelection()),this.handleDatabodyFloodFillDrag(e)):this.handleDatabodySelectionDrag(e):this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&(-1!==this.m_selectionFrontier.axis.indexOf("row")||-1!==this.m_selectionFrontier.axis.indexOf("column"))||this.m_deselectInfo&&this.m_deselectInfo.axis&&(-1!==this.m_deselectInfo.axis.indexOf("row")||-1!==this.m_deselectInfo.axis.indexOf("column")))&&this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress)},A.prototype.handleDatabodyMouseUp=function(e){this.m_databodyDragState=!1,this.m_headerDragState=!1,this.m_deselectInProgress=!1,this.m_databodyMove&&this._handleMoveMouseUp(e,!0),this.m_options.isFloodFillEnabled()&&this.m_floodFillDragState&&(this._handleFloodFillMouseUp(e),this.m_floodFillDragState=!1)},A.prototype.handleDatabodyKeyUp=function(e){this.m_deselectInProgress&&(this.m_deselectInProgress=e.shiftKey)},A.prototype.handleDatabodyKeyDown=function(e){var t,i=this.m_utils.ctrlEquivalent(e);if(e.defaultPrevented&&i&&(this.keyCodes.LEFT_KEY||this.keyCodes.RIGHT_KEY)||this.m_animating)return;let s=this._getActiveElement();null!=(t=null!=this.m_active&&"header"===this.m_active.type?this._getActionFromKeyDown(e,this.m_active.axis,!1):null!=this.m_active&&"label"===this.m_active.type?this._getActionFromKeyDown(e,this.m_active.axis,!0):null!=this.m_active&&"empty"===this.m_active.type?this._getActionFromNoDataKeydown(e):this._getActionFromKeyDown(e,"cell",!1))&&t.call(this,e,s)&&e.preventDefault()},A.prototype.findPos=function(e){if(e){var t=this.findPos(e.offsetParent),i=this.getElementTranslationXYZ(e.offsetParent);return[parseInt(t[0],10)+parseInt(e.offsetLeft,10)+i[0],parseInt(t[1],10)+parseInt(e.offsetTop,10)+i[1]]}return[0,0]},A.prototype._findHeaderOffset=function(e,t,i){if(i||(i=[0,0]),e!==t){for(;!e.offsetParent;)e=e.parentElement;return e.offsetLeft&&(i[0]+=parseInt(e.offsetLeft,10)),e.offsetTop&&(i[1]+=parseInt(e.offsetTop,10)),this._findHeaderOffset(e.offsetParent,t,i)}return i},A.prototype.getElementTranslationXYZ=function(e){if(e){var t=document.defaultView.getComputedStyle(e,null),i=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("-moz-transform")||t.getPropertyValue("-ms-transform")||t.getPropertyValue("-o-transform")||t.getPropertyValue("transform"),s=i.substr(7,i.length-8).split(", ");return[isNaN(parseInt(s[4],10))?0:parseInt(s[4],10),isNaN(parseInt(s[5],10))?0:parseInt(s[5],10),isNaN(parseInt(s[6],10))?0:parseInt(s[6],10)]}return[0,0,0]},A.prototype.handleDatabodyMouseWheel=function(e){var t,i=this.find(e.target,"header");if(null==i&&(i=this.find(e.target,"endheader")),i&&(t=i===this.m_rowHeader||i===this.m_rowEndHeader?"row":"column"),("row"!==t||this.m_stopRowHeaderFetch&&this.m_stopRowEndHeaderFetch&&this.m_stopRowFetch)&&("column"!==t||this.m_stopColumnHeaderFetch&&this.m_stopColumnEndHeaderFetch&&this.m_stopColumnFetch)||e.preventDefault(),!this.m_animating){var s=this.m_utils.getMousewheelScrollDelta(e),n=s.deltaX,o=s.deltaY;"row"===t?n=0:"column"===t&&(o=0);var r=Math.max(0,Math.min(this._getMaxScrollHeight(),this.m_currentScrollTop-o));this._getMaxScrollHeight()!==r&&0!==r&&this.find(e.target,"header")&&e.preventDefault(),this.scrollDelta(n,o)}},A.prototype.handleTouchStart=function(e){var t=e.touches.length,i=e.touches[0].target;if(1===t){if(this.m_startX=e.touches[0].pageX,this.m_startY=e.touches[0].pageY,this.m_currentX=this.m_startX,this.m_currentY=this.m_startY,this.m_prevX=this.m_startX,this.m_prevY=this.m_startY,this.m_startTime=(new Date).getTime(),this.m_touchActive=!0,this.isMultipleSelection()){i.classList.contains(this.getMappedStyle("selectaffordance"))&&(i=i.parentNode);var s=null;if(i===this.m_topSelectIconContainer?s="top":i===this.m_bottomSelectIconContainer&&(s="bottom"),s){this.m_touchMultipleSelect=!0;var n=this.GetSelection();this.m_touchSelectAnchor="top"===s?n[n.length-1].endIndex:n[n.length-1].startIndex}}!this.m_touchMultipleSelect&&this._isMoveOnElementEnabled(this.findCell(i))&&(this.m_databodyMove=!0)}else this.handleTouchCancel(e)},A.prototype.handleTouchMove=function(e){var t=e.target;if(this.m_touchActive){e.cancelable&&e.preventDefault(),this.m_currentX=e.touches[0].pageX,this.m_currentY=e.touches[0].pageY;var i=this.m_currentX-this.m_prevX,s=this.m_currentY-this.m_prevY,n=this.adjustTouchScroll(i,s);if(i=n[0],s=n[1],this.getResources().isRTLMode()&&(i*=-1),this.m_touchMultipleSelect)this.handleDatabodySelectionDrag(e),this.m_utils.isTouchDeviceNotIOS()||e.preventDefault();else if(this.m_databodyMove)this._removeTouchSelectionAffordance(),this._handleMove(e),this.m_utils.isTouchDeviceNotIOS()||e.preventDefault();else if(this._isEditOrEnter()&&this.m_utils.isTouchDeviceNotIOS()){var o=this._getActiveElement();this.findCell(t)!==o&&this._handleNonSwipeScroll(i,s)}else this._handleNonSwipeScroll(i,s);this.m_prevX=this.m_currentX,this.m_prevY=this.m_currentY}else this.handleTouchCancel(e)},A.prototype.handleTouchEnd=function(e){var t,i=e.target;if(this._isEditOrEnter()){if(t=this._getActiveElement(),this.findCell(i)===t)return void this.handleTouchCancel(e);this._leaveEditing(e,t,!1)}else this._exitActionableMode();if(null!=this.m_lastTapTime&&this.m_startTime-this.m_lastTapTime<250&&this.m_lastTapTarget===i?(this.m_lastTapTime=null,this.m_lastTapTarget=null,null!=(t=this.findCell(i))&&(this._handleEditable(e,t),this._handleEdit(e,t),e.cancelable&&e.preventDefault())):(this.m_lastTapTarget=e.target,this.m_lastTapTime=(new Date).getTime()),this.m_touchActive&&!e.defaultPrevented)if(this.m_touchMultipleSelect)e.cancelable&&e.preventDefault(),this.m_touchMultipleSelect=!1;else{var s=this.m_lastTapTime-this.m_startTime;if(this.m_currentX===this.m_startX&&this.m_currentY===this.m_startY)return this.m_databodyMove=!1,this._isSelectionEnabled()&&s<A.CONTEXT_MENU_TAP_HOLD_DURATION?void this.handleDatabodyClickSelection(e):void this.handleDatabodyClickActive(e);if(this.m_databodyMove)return e.cancelable&&e.preventDefault(),this.m_databodyMove=!1,void this._handleMoveMouseUp(e,!0);this.m_utils.isTouchDeviceNotIOS()&&this._handleSwipe(e)}this.handleTouchCancel(e)},A.prototype._calculateMomentum=function(e,t,i,s,n,o){var r,l=e-t,a=Math.abs(l)/i,h=a*a/(2*A.DECELERATION_FACTOR)*(l<0?-1:1),d=a/A.DECELERATION_FACTOR;return o&&(h*=-1),s-h>n?(r=Math.max(-1*A.MAX_OVERSCROLL_PIXEL,h),h=s-n,d=(l=n-s)/a):s-h<0&&(r=Math.min(A.MAX_OVERSCROLL_PIXEL,h),h=s,d=(l=s)/a),{destination:Math.round(h),duration:Math.min(Math.max(A.MIN_SWIPE_TRANSITION_DURATION,d),A.MAX_SWIPE_TRANSITION_DURATION),overScroll:r}},A.prototype.handleTouchCancel=function(e){this.m_databodyMove&&(this._handleMoveMouseUp(e,!1),this.m_databodyMove=!1),this.m_touchSelectAnchor=null,this.m_touchMultipleSelect=!1,this.m_touchActive=!1,this.m_startX=0,this.m_startY=0,this.m_prevX=0,this.m_prevY=0,this.m_currentX=0,this.m_currentY=0,this.m_startTime=0},A.prototype.handleHeaderTouchStart=function(e){this.m_touchStart=(new Date).getTime();var t=e.touches.length,i=e.target;if(1===t){this.m_startX=e.touches[0].pageX,this.m_startY=e.touches[0].pageY,this.m_currentX=this.m_startX,this.m_currentY=this.m_startY,this.m_prevX=this.m_startX,this.m_prevY=this.m_startY,this.m_touchActive=!0;var s=this.findHeader(i);this.isResizeEnabled()&&(this.handleResize(e),this.handleResizeMouseDown(e),this._highlightResizeMouseDown()),!this.m_isResizing&&this._isMoveOnElementEnabled(s)&&(this.m_databodyMove=!0);let t=this.getHeaderCellAxis(s);this._isDataGridProvider()&&this.m_options._isDragEnabled(t)&&(this.m_utils.addCSSClassName(s,this.getMappedStyle("draggableItem")),s.setAttribute("draggable",!0))}else this.handleHeaderTouchCancel(e)},A.prototype.handleHeaderTouchMove=function(e){if(this.m_touchActive){e.cancelable&&e.preventDefault(),this.m_currentX=e.touches[0].pageX,this.m_currentY=e.touches[0].pageY;var t=this.m_currentX-this.m_prevX,i=this.m_currentY-this.m_prevY;if(this.m_isResizing&&this.isResizeEnabled())this.handleResize(e);else if(this.m_databodyMove)this._removeTouchSelectionAffordance(),this._handleMove(e);else if(this.m_databodyReorder)this._removeTouchSelectionAffordance();else{var s=e.target,n=this.findHeader(s),o=this.getHeaderCellAxis(n);"column"===o||"columnEnd"===o?this._handleNonSwipeScroll(t,0):this._handleNonSwipeScroll(0,i)}this.m_prevX=this.m_currentX,this.m_prevY=this.m_currentY}else this.handleTouchCancel(e)},A.prototype.handleHeaderTouchEnd=function(e){var t;if(this.m_touchActive&&!e.defaultPrevented){var i=e.target;if(this.m_isResizing&&this.isResizeEnabled())this.handleResizeMouseUp(e),this.m_currentX!==this.m_startX&&this.m_currentY!==this.m_startY&&e.cancelable&&e.preventDefault();else if(this.m_currentX===this.m_startX&&this.m_currentY===this.m_startY){var s=this.m_options.getSelectionMode(),n=(t=this.findHeader(i))[this.getResources().getMappedAttribute("context")],o=this.m_root.getAttribute("id"),r=document.querySelector("#"+o+"contextmenu");r&&"none"===r.style.display&&((this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))&&this._isDOMElementSortable(i)?(e.cancelable&&e.preventDefault(),this._removeTouchSelectionAffordance(),this._handleSortIconMouseDown(i),this._handleHeaderSort(e)):this._isDisclosureIcon(i)?(this._removeTouchSelectionAffordance(),this._handleExpandCollapseRequest(e),e.preventDefault()):!this._isSelectionEnabled()||!this.isMultipleSelection()||"row"===s&&-1===n.axis.indexOf("row")||this.m_databodyMove?"row"===s&&-1!==n.axis.indexOf("row")&&this._isSelectionEnabled()?this.handleHeaderClickSelection(e):this.handleHeaderClickActive(e):(0===e.button&&(this.m_headerDragState=!0),this.handleHeaderClickSelection(e)))}else if(this.m_databodyMove)e.cancelable&&e.preventDefault(),this.m_databodyMove=!1,this._handleMoveMouseUp(e,!0);else if(this.m_databodyReorder){e.cancelable&&e.preventDefault(),this.m_databodyReorder=!1,t=this.findHeader(i),"row"===this.getHeaderCellAxis(t)?this.handleRowDragEnd(e):this.handleColumnDragEnd(e)}else t=this.findHeader(i),this._handleSwipe(e,this.getHeaderCellAxis(t))}this.handleHeaderTouchCancel(e)},A.prototype.handleHeaderTouchCancel=function(e){this.m_databodyMove&&(this._handleMoveMouseUp(e,!1),this.m_databodyMove=!1),this.m_touchActive=!1,this.m_startX=0,this.m_startY=0,this.m_prevX=0,this.m_prevY=0,this.m_currentX=0,this.m_currentY=0},A.prototype._handleNonSwipeScroll=function(e,t){var i=(new Date).getTime();this._disableTouchScrollAnimation();var s=this.adjustTouchScroll(e,t);e=s[0],t=s[1],this.scrollDelta(e,t),i-this.m_startTime>A.TAP_AND_SCROLL_RESET&&(this.m_startX=this.m_currentX,this.m_startY=this.m_currentY,this.m_startTime=(new Date).getTime())},A.prototype._handleSwipe=function(e,t){var i=(new Date).getTime()-this.m_startTime,s=this.getResources().isRTLMode(),n=this.m_currentX-this.m_startX,o=this.m_currentY-this.m_startY;if(s&&(n*=-1),Math.abs(n)<A.MIN_SWIPE_DISTANCE&&Math.abs(o)<A.MIN_SWIPE_DISTANCE&&i<A.MIN_SWIPE_DURATION)e.cancelable&&e.preventDefault(),this._isSelectionEnabled()&&this._scrollTouchSelectionAffordance();else if(i<A.MAX_SWIPE_DURATION){var r,l;if(e.cancelable&&e.preventDefault(),"row"!==t&&"rowEnd"!==t?(r=this._calculateMomentum(this.m_currentX,this.m_startX,i,this.m_currentScrollLeft,this.m_scrollWidth,s),isNaN(r.overScroll)||(r.overScroll>0||this.m_stopColumnFetch)&&(this.m_extraScrollOverX=-1*r.overScroll)):(r={duration:0,destination:0},n=0),"column"!==t&&"columnEnd"!==t?(l=this._calculateMomentum(this.m_currentY,this.m_startY,i,this.m_currentScrollTop,this.m_scrollHeight),isNaN(l.overScroll)||(l.overScroll>0||this.m_stopRowFetch)&&(this.m_extraScrollOverY=-1*l.overScroll)):(l={duration:0,destination:0},o=0),this.m_utils.isTouchDeviceNotIOS()){var a=Math.max(r.duration,l.duration);this.m_databody.firstChild.style.transitionDuration=a+"ms",this.m_rowHeader.firstChild.style.transitionDuration=a+"ms",this.m_colHeader.firstChild.style.transitionDuration=a+"ms",this.m_rowEndHeader.firstChild.style.transitionDuration=a+"ms",this.m_colEndHeader.firstChild.style.transitionDuration=a+"ms"}n+=r.destination,o+=l.destination;var h=this.adjustTouchScroll(n,o);n=h[0],o=h[1],this.scrollDelta(n,o)}},A.prototype.fireEvent=function(e,t){if(null!=e&&null!=t){var i=this.callbacks[e];return null==i||i(t)}},A.prototype.addListener=function(e,t){this.callbacks[e]=t},A.prototype.setElementHeight=function(e,t){e.style.height=t+"px"},A.prototype.getElementHeight=function(e){return this.getElementDir(e,"height")},A.prototype.setElementWidth=function(e,t){e.style.width=t+"px"},A.prototype.getElementWidth=function(e){return this.getElementDir(e,"width")},A.prototype.setElementDir=function(e,t,i){e.style[i]=t+"px"},A.prototype.getElementDir=function(e,t){var i;return e.style[t].indexOf("px")>-1&&-1===e.style[t].indexOf("e")?parseFloat(e.style[t]):(document.body.contains(e)?i=Math.round(e["offset"+t.charAt(0).toUpperCase()+t.slice(1)]):(e.style.visibility="hidden",this.m_root.appendChild(e),i=Math.round(e["offset"+t.charAt(0).toUpperCase()+t.slice(1)]),this.m_root.removeChild(e),e.style.visibility=""),i)},A.prototype._computeElementWidthAndHeight=function(e){var t={};return e.style.width.indexOf("px")>-1&&-1===e.style.width.indexOf("e")&&(t.width=parseFloat(e.style.width)),e.style.height.indexOf("px")>-1&&-1===e.style.height.indexOf("e")&&(t.height=parseFloat(e.style.height)),null!=t.width&&null!=t.height||(document.body.contains(e)?(t.width=Math.round(e.offsetWidth),t.height=Math.round(e.offsetHeight)):(e.style.visibility="hidden",this.m_root.appendChild(e),t.width=Math.round(e.offsetWidth),t.height=Math.round(e.offsetHeight),this.m_root.removeChild(e),e.style.visibility="")),t},A.BEFORE=1,A.AFTER=2,A.INSIDE=3,A.prototype._isInViewport=function(e){var t=e.row,i=e.column;return-1===t&&-1===i?-1:-1===t?this._isColumnIndexInViewport(i):-1===i?this._isRowIndexInViewport(t):i>=this.m_startCol&&i<=this.m_endCol&&t>=this.m_startRow&&t<=this.m_endRow?A.INSIDE:-1},A.prototype._isAxisIndexInViewport=function(e,t){return-1===e?-1:"column"===t?this._isColumnIndexInViewport(e):"row"===t?this._isRowIndexInViewport(e):-1},A.prototype._isColumnIndexInViewport=function(e){return e<this.m_startCol?A.BEFORE:e>this.m_endCol?A.AFTER:A.INSIDE},A.prototype._isRowIndexInViewport=function(e){return e<this.m_startRow?A.BEFORE:e>this.m_endRow?A.AFTER:A.INSIDE},A.prototype._isCellBoundaryInViewport=function(e,t,i,s){var n=this._getViewportTop(),o=this._getViewportBottom(),r=this._getViewportLeft(),l=this._getViewportRight();return(s<=o&&s>n||i>=n&&i<o)&&(t<=l&&t>r||e>=r&&e<l)},A.prototype.queueModelEvent=function(e){return!(this.m_initialized&&!this.m_processingEventQueue&&!this.m_animating&&!this.m_processingModelEvent)&&(null==this.m_modelEvents&&(this.m_modelEvents=[]),this.m_modelEvents.push(e),!0)},A.prototype.handleModelEvent=function(e,t){if(void 0!==t||!this.queueModelEvent(e)){var i=e.operation,s=e.keys,n=e.indexes,o=e.result,r=e.header,l=e.endheader,a=e.silent,h=!1;if(this.m_processingModelEvent=!0,e.detail)"delete"===i&&this._handleDeleteRangeEvent(e.detail),"insert"===i&&this._handleInsertRangeEvent(e.detail),"update"===i&&this._handleUpdateRangeEvent(e.detail),"refresh"===i&&this._handleModelRefreshEvent(e.detail);else if("insert"===i)this._adjustActive(i,n),this.m_shouldFocus=!0,this._adjustSelectionOnModelChange(i,s,n),null!=o?(this._handleModelInsertRangeEvent(o,r,l),h=!0):this._handleModelInsertEvent(n,s);else if("update"===i)this._handleModelUpdateEvent(n,s,o),h=!0;else if("delete"===i){let t;if(this._isEditOrEnter()&&(t=this._getCellByIndex(this.m_active.indexes)),t){let i=this.getCellIndexes(t),s=!1;n.forEach(e=>{e.row!==i.row&&e.column!==i.column||(s=!0)}),s&&(this._handleExitEditable(e,t),this._handleExitEdit(e,t))}this._adjustSelectionOnModelChange(i,s,n),this.m_utils.supportsTransitions()?(Array.isArray(s)||(s=new Array(s)),this._handleModelDeleteEventWithAnimation(e,s),s.length>0&&(h=!0)):(this._handleModelDeleteEvent(n,s,a),this._adjustActive(i,n))}else"refresh"===i||"reset"===i?this._handleModelRefreshEvent():"sync"===i&&this._handleModelSyncEvent(e);this.m_processingModelEvent=!1,!h&&t&&this._runModelEventQueue()}},A.prototype._adjustActive=function(e,t){var i,s;if(null!=this.m_active){if("cell"===this.m_active.type)s=!1,i=this.m_active.indexes.row;else{if("header"!==this.m_active.type||"row"!==this.m_active.axis)return;s=!0,i=this.m_active.index}if(Array.isArray(t)||(t=new Array(t)),!0===this.m_moveActive){if("insert"===e)return void(s?this.m_active.index=t[0].row:this.m_active.indexes.row=t[0].row);if("delete"===e&&t[0].row===i)return}for(var n="insert"===e?1:-1,o=0;o<t.length;o++){var r=this._isDataGridProvider()?t[o]:t[o].row;r<i&&this.m_active?s?this.m_active.index+=n:this.m_active.indexes.row+=n:r===i&&"delete"===e&&this._setActive(null,null)}}},A.prototype._adjustSelectionOnModelChange=function(e,t,i){Array.isArray(t)||(t=new Array(t)),Array.isArray(i)||(i=new Array(i));var s=this.GetSelection();if(null!=t&&null!=i&&t.length===i.length&&0!==s.length)for(var n="insert"===e?1:-1,o=0;o<t.length;o++)for(var r,l=t[o].row,a=i[o].row,h=s.length-1;h>=0;h--){var d=s[h],c=d.startKey.row,m=d.endKey.row,u=d.startIndex.row,_=d.endIndex.row;if(c===l){if(m===l&&"delete"===e){s.splice(h,1);continue}r=this._getKey(this._getAxisCellsByIndex(d.startIndex.row+1,"row")[0],"row"),d.startKey.row=r,d.endIndex.row+=n}else m===l?(r=this._getKey(this._getAxisCellsByIndex(d.startIndex.row-1,"row")[0],"row"),d.endKey.row=r,d.endIndex.row+=n):a<=u?(d.startIndex.row+=n,d.endIndex.row+=n):a<_&&(d.endIndex.row+=n)}else if(this.m_moveActive&&"insert"===e){var p;if(this._isSelectionEnabled()&&this._isDatabodyCellActive())p="cell"===this.m_options.getSelectionMode()?this.createRange(this.m_active.indexes,this.m_active.indexes,t[0],t[0]):this.createRange(i[0],i[0],t[0],t[0]),this.m_selectionFrontier=this.m_active.indexes,s.push(p);this.m_moveActive=!1}},A.prototype._simpleAdjustSelectionOnChange=function(e,t,i){let s=this.GetSelection(),n="insert"===e?1:-1;for(let o=0;o<t.length;o++){let r=t[o];for(let t=s.length-1;t>=0;t--){let o=s[t],l=o.startIndex[i],a=o.endIndex[i];if(l===r){if(a===r&&"delete"===e){s.splice(t,1);continue}if("delete"===e){let e=this._getKey(this._getAxisCellsByIndex(o.startIndex[i]+1,i)[0],i);o.startKey[i]=e}else o.startIndex[i]+=n;o.endIndex[i]+=n}else if(a===r){if("delete"===e){let e=this._getKey(this._getAxisCellsByIndex(o.endIndex[i]-1,i)[0],i);o.endKey[i]=e}o.endIndex[i]+=n}else r<l?(o.startIndex[i]+=n,o.endIndex[i]+=n):r<a&&(o.endIndex[i]+=n)}}},A.prototype._handleInsertRangeEvent=function(e){let t=e.axis,i=e.ranges;if(0===i.length)return void this.fillViewport();i.sort(function(e,t){return e.offset-t.offset});let s=i.shift(),n=s.offset,o=s.count,r=this._isAxisIndexInViewport(n,t);if(r===A.INSIDE){let i=n,r=o,l=this.m_startCol,a=this.m_endCol-this.m_startCol+1;"column"===t&&(i=this.m_startRow,r=this.m_endRow-this.m_startRow+1,l=n,a=o);let h,d=document.createDocumentFragment(),c=document.createDocumentFragment(),m=new Promise(function(e){h=e}),u={axis:t,range:s,headerFragment:d,endHeaderFragment:c,totalDimension:0,promiseResolve:h};this.fetchHeaders(t,n,d,c,o,{success:this._handleInsertRangeHeaderFetchSuccess.bind(this,u),error:this.handleCellsFetchError}),this.fetchCells(this.m_databody,i,l,r,a,{success:this._handleInsertRangeCellFetchSuccess.bind(this,u),error:this.handleCellsFetchError}),m.then(this._handleInsertRangeEvent.bind(this,e))}else if(r===A.BEFORE){let i=this.m_avgRowHeight,s=i*o,r=this.m_rowHeader,l=this.m_rowEndHeader;"row"===t?(this.m_endRow>=0&&(this.m_startRow+=o,this.m_endRow+=o,this.m_startRowPixel+=s,this.m_endRowPixel+=s),this.m_endRowHeader>=0&&(this.m_startRowHeader+=o,this.m_endRowHeader+=o,this.m_startRowHeaderPixel+=s,this.m_endRowHeaderPixel+=s),this.m_endRowEndHeader>=0&&(this.m_startRowEndHeader+=o,this.m_endRowEndHeader+=o,this.m_startRowEndHeaderPixel+=s,this.m_endRowEndHeaderPixel+=s)):(i=this.m_avgColWidth,s=i*o,r=this.m_colHeader,l=this.m_colEndHeader,this.m_endCol>=0&&(this.m_startCol+=o,this.m_endCol+=o,this.m_startColPixel+=s,this.m_endColPixel+=s),this.m_endColHeader>=0&&(this.m_startColHeader+=o,this.m_endColHeader+=o,this.m_startColHeaderPixel+=s,this.m_endColHeaderPixel+=s),this.m_endColEndHeader>=0&&(this.m_startColEndHeader+=o,this.m_endColEndHeader+=o,this.m_startColEndHeaderPixel+=s,this.m_endColEndHeaderPixel+=s));let a=new Array(o).fill(n).map((e,t)=>e+t),h=new Array(o).fill(i);this._modifyAndPushCells(a,h,t,r,l,!0),this._refreshDatabodyMap(),this._handleInsertRangeEvent(e)}else r===A.AFTER&&("row"===t?(this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1):(this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1),this._handleInsertRangeEvent(e))},A.prototype._handleUpdateRangeEvent=function(e){let t=e.ranges;if(0===t.length)return this._highlightActive(),this._resetEditableClone(),this.applySelection(),this._resetHeaderHighLight(),void this.fillViewport();t.sort(function(e,t){return e.offset-t.offset});let i=t.shift(),s=i.rowOffset,n=i.columnOffset,o=-1===i.rowCount?this._getMaxBottom()+1:i.rowCount,r=-1===i.columnCount?this._getMaxRight()+1:i.columnCount,l=s+o-1,a=n+r-1,h=this._isAxisIndexInViewport(s,"row"),d=this._isAxisIndexInViewport(l,"row"),c=this._isAxisIndexInViewport(n,"column"),m=this._isAxisIndexInViewport(a,"column");if(h!==A.AFTER&&d!==A.BEFORE&&c!==A.AFTER&&m!==A.BEFORE){let t;h===A.BEFORE&&(s=this._getMaxTop()),d===A.AFTER&&(l=this._getMaxBottom()),c===A.BEFORE&&(n=this._getMaxLeft()),m===A.AFTER&&(a=this._getMaxRight()),o=l-s+1,r=a-n+1;let u,_,p=!1;-1!==i.rowCount&&-1!==i.columnCount||(p=!0,t=-1===i.rowCount?"column":"row"),"row"===t?(u=s,_=o):"column"===t&&(u=n,_=r);let g,f=document.createDocumentFragment(),C=document.createDocumentFragment(),y=new Promise(function(e){g=e}),v={axis:t,range:i,headerFragment:f,endHeaderFragment:C,totalDimension:0,promiseResolve:g};this.m_fetchingForUpdate=!0,p?(v.editHeader=!0,this.fetchHeaders(t,u,f,void 0,_,{success:this._handleInsertRangeHeaderFetchSuccess.bind(this,v),error:this.handleHeadersFetchError}),this.fetchCells(this.m_databody,s,n,o,r,{success:this._handleUpdateEditableHeader.bind(this,v),error:this.handleCellsFetchError})):this.fetchCells(this.m_databody,s,n,o,r,{success:this._handleUpdateRangeFetchSuccess.bind(this,v),error:this.handleCellsFetchError}),y.then(this._handleUpdateRangeEvent.bind(this,e))}else this._handleUpdateRangeEvent(e)},A.prototype._handleUpdateEditableHeader=function(e,t,i){this.m_fetchingForUpdate=!1;let s,n,o=e,r=o.range,l=o.axis,a=o.editHeader;"column"===l?(s=r.columnOffset,n=r.columnCount):"row"===l&&(s=r.rowOffset,n=r.rowCount);let h={axis:l,ranges:[{offset:s,count:n}],editHeader:a};this._handleDeleteRangeEvent(h),delete o.range,o.range={offset:s,count:n},this._handleInsertRangeCellFetchSuccess(o,t,i),this._signalTaskEnd()},A.prototype._handleInsertRangeHeaderFetchSuccess=function(e,t,i,s){const n=i.axis;this._signalTaskEnd(),this.m_fetching[n]=!1;const o=this.getResources().isRTLMode()?"right":"left",r=i.start,l=e.headerFragment,a=e.endHeaderFragment,h="row"===n?"top":o;let d,c,m,u,_,p,g,f,C,y,v,E,w=0,S=0;if(null!=t){for(f=this.getMappedStyle("headercell"),"row"===n?(d=this.m_rowHeader,c=this.m_startRowHeader,y=this.m_rowHeaderLevelCount,f+=" "+this.getMappedStyle("rowheadercell")):(d=this.m_colHeader,c=this.m_startColHeader,y=this.m_columnHeaderLevelCount,f+=" "+this.getMappedStyle("colheadercell")),m=this._getHeaderByIndex(r,y-1,d,y,c),u=this.getElementDir(m,h),_=t.getCount(),C=this.getRendererOrTemplate(n);_-w>0;)"row"===n?(v=0,E=u+S):(v=u+S,E=0),p=r+w,g=this.buildLevelHeaders(l,p,0,v,E,!0,!1,C,t,n,f,y),w+=g.count,S+=g.totalHeaderDimension;S>e.totalDimension&&(e.totalDimension=S)}if(S=0,w=0,null!=s){for(f=this.getMappedStyle("endheadercell"),"row"===n?(d=this.m_rowEndHeader,c=this.m_startRowEndHeader,y=this.m_rowEndHeaderLevelCount,f+=" "+this.getMappedStyle("rowendheadercell")):(d=this.m_colEndHeader,c=this.m_startColEndHeader,y=this.m_columnEndHeaderLevelCount,f+=" "+this.getMappedStyle("colendheadercell")),m=this._getHeaderByIndex(r,y-1,d,y,c),u=this.getElementDir(m,h),_=s.getCount(),C=this.getRendererOrTemplate(n+"End");_-w>0;)"row"===n?(v=0,E=u+S):(v=u+S,E=0),p=r+w,g=this.buildLevelHeaders(a,p,0,v,E,!0,!1,C,s,n+"End",f,y),w+=g.count,S+=g.totalHeaderDimension;S>e.totalDimension&&(e.totalDimension=S)}},A.prototype._handleInsertRangeCellFetchSuccess=function(e,t,i){const s=e.range,n=e.axis,o=e.editHeader,r=e.headerFragment,l=e.endHeaderFragment;let a=e.totalDimension;const h=this.getResources().isRTLMode()?"right":"left",d=document.createDocumentFragment();let c=this.m_rowHeader,m=this.m_rowEndHeader;if("column"===n&&(c=this.m_colHeader,m=this.m_colEndHeader),this._signalTaskEnd(),this.m_fetching.cells=!1,o||this.unhighlightSelection(),t){const e=i[0].start,s=i[1].start,o=this._getCellByIndex(this.createIndex(e,s));let r,l;o?(r="row"===n?this.getElementDir(o,"top"):this.m_startRowPixel,l="row"===n?this.m_startColPixel:this.getElementDir(o,h)):(r="row"===n?this._getMaxBottomPixel():this.m_startRowPixel,l="row"===n?this.m_startColPixel:this._getMaxRightPixel());const c=this._addCellsToFragment(d,t,e,r,s,l);a=Math.max(a,"row"===n?c.totalRowHeight:c.totalColumnWidth)}const u=s.offset,_=s.count;let p=new Array(_).fill(u).map((e,t)=>e+t),g=new Array(_).fill(a/_),f=d.childNodes.length,C=r.childNodes.length,y=l.childNodes.length;const v=this.m_databody.firstChild;if(this._modifyAndPushCells(p,g,n,c,m,!0),o||this._simpleAdjustSelectionOnChange("insert",p,n),d.childNodes.length&&(v.appendChild(d),this._refreshDatabodyMap()),this._insertHeaders(n,u,r,l),this.hideStatusText(),"row"===n){f&&(this.m_endRow+=_,this.m_endRowPixel+=a,this.m_stopRowFetch=!1),C&&(this.m_endRowHeader+=_,this.m_endRowHeaderPixel+=a,this.m_stopRowHeaderFetch=!1),y&&(this.m_endRowEndHeader+=_,this.m_endRowEndHeaderPixel+=a,this.m_stopRowEndHeaderFetch=!1);let e=this.getElementHeight(v)+a;this.setElementHeight(v,e),this.updateRowBanding()}else if("column"===n){f&&(this.m_endCol+=_,this.m_endColPixel+=a,this.m_stopColumnFetch=!1),C&&(this.m_endColHeader+=_,this.m_endColHeaderPixel+=a,this.m_stopColumnHeaderFetch=!1),y&&(this.m_endColEndHeader+=_,this.m_endColEndHeaderPixel+=a,this.m_stopColumnEndHeaderFetch=!1);var E=this.getElementWidth(v)+a;this.setElementWidth(v,E),this.updateColumnBanding()}o||(this.applySelection(),this._resetHeaderHighLight(),this.resizeGrid()),e.promiseResolve()},A.prototype._insertHeaders=function(e,t,i,s){let n,o=this.m_rowHeader,r=this.m_rowEndHeader,l=this.m_rowHeaderLevelCount,a=this.m_rowEndHeaderLevelCount,h=this.m_startRowHeader,d=this.m_startRowEndHeader,c="height",m="top";"column"===e&&(o=this.m_colHeader,r=this.m_colEndHeader,l=this.m_columnHeaderLevelCount,a=this.m_columnEndHeaderLevelCount,h=this.m_startColHeader,d=this.m_startColEndHeader,c="width",m=this.getResources().isRTLMode()?"right":"left");let u=(e,t,i,s,n,o)=>{for(;e.childNodes.length;){let r,l=e.firstChild;if(this.m_utils.containsCSSClassName(l,this.getMappedStyle("groupingcontainer"))){if(r=l.firstChild,null==r||this.m_utils.containsCSSClassName(r,this.getMappedStyle("groupingcontainer"))){e.removeChild(l);continue}}else r=l;let a=r.extentInfo,h=a.more.before,d=a.more.after,c=r[this.getResources().getMappedAttribute("context")],m=c.index,_=c.extent,p=c.level;if(h){let e=this._getHeaderContainer(m-1,p,0,null,t,i),s=e.firstChild,l=s[this.getResources().getMappedAttribute("context")];c.extent+=l.extent,c.index=l.index;let a=this._getAttribute(e,"extent",!0);this._setAttribute(e,"extent",a+_);let h=this.getElementDir(s,n),d=this.getElementDir(r,n);this.setElementDir(r,h+d,n);let u=this.getElementDir(s,o);this.setElementDir(r,u,o),e.replaceChild(r,s)}else if(d){let e=this._getHeaderContainer(m+_,p,0,null,t,i),s=e.firstChild,l=s[this.getResources().getMappedAttribute("context")];c.extent+=l.extent,c.index=l.index-_;let a=this._getAttribute(e,"extent",!0);this._setAttribute(e,"extent",a+_);let h=this._getAttribute(e,"start",!0);this._setAttribute(e,"start",h-_);let d=this.getElementDir(s,n),u=this.getElementDir(r,n);this.setElementDir(r,d+u,n);let g=this.getElementDir(s,o);this.setElementDir(r,g-u,o),e.replaceChild(r,s)}else{let e=this._getHeaderContainer(m,p,0,null,t,i);if(e){let n=this._getHeaderByIndex(m-1,p,t,i,s);if(null===n||n.parentNode!==e){let t=p===i-1?e.childNodes[1]:e.childNodes[0];e.insertBefore(r,t)}else n.nextSibling&&n.nextSibling.parentNode===e?e.insertBefore(r,n.nextSibling):e.appendChild(r)}else{let e=this._getHeaderContainer(m-1,p,0,null,t,i);if(null===e){let e=t.firstChild;e.firstChild?e.insertBefore(l,e.firstChild):e.appendChild(l)}else e.nextSibling?e.parentNode.insertBefore(l,e.nextSibling):e.parentNode.appendChild(l)}}if(h||d){let e=l.querySelector("."+this.getMappedStyle("groupingcontainer"));e&&u(e,t,i,s,n,o)}}};i.childNodes.length&&(1===l?(n=this._getHeaderByIndex(t,l-1,o,l,h),o.firstChild.insertBefore(i,n)):u(i,o,l,h,c,m)),s.childNodes.length&&(1===a?(n=this._getHeaderByIndex(t,a-1,r,a,d),r.firstChild.insertBefore(s,n)):u(s,r,a,d,c,m))},A.prototype._handleModelInsertEvent=function(e,t){var i=this._isInViewport(e);if(i===A.INSIDE||i===A.AFTER&&e.row===this.m_endRow+1)null!=t.row&&(this._databodyEmpty()?(this.empty(),this.refresh(this.m_root)):(this._modifyAxisCellContextIndex("row",e.row,this.m_endRow-e.row+1,1),this._refreshDatabodyMap(),this.fetchHeaders("row",e.row,this.m_rowHeader,this.m_rowEndHeader,1,{success:this._handleHeaderInsertsFetchSuccess}),this.fetchCells(this.m_databody,e.row,this.m_startCol,1,this.m_endCol-this.m_startCol+1,{success:this._handleCellInsertsFetchSuccess})));else{if(i===A.BEFORE){this._modifyAxisCellContextIndex("row",0,this.m_endRow+1,1),this._refreshDatabodyMap(),this.m_startRow+=1,this.m_startRowHeader+=1,this.m_endRow+=1,this.m_endRowHeader+=1,this.m_startRowPixel+=this.m_avgRowHeight,this.m_startRowHeaderPixel+=this.m_avgRowHeight,this.m_endRowPixel+=this.m_avgRowHeight,this.m_endRowHeaderPixel+=this.m_avgRowHeight;var s=this.m_databody.firstChild.firstChild;null!=s&&this.pushRowsDown(s,this.m_avgRowHeight);var n=this.m_rowHeader.firstChild.firstChild;null!=n&&this.pushRowsDown(n,this.m_avgRowHeight);var o=this.m_rowEndHeader.firstChild.firstChild;null!=o&&this.pushRowsDown(o,this.m_avgRowHeight)}this.scrollToIndex(e)}},A.prototype._handleCellInsertsFetchSuccess=function(e,t){this.m_resizeRequired=!0,this.handleCellsFetchSuccess(e,t,this.m_endRow>=t[0].start);var i=t[0].start;this._scrollRowIntoViewport(i),this._isHighWatermarkScrolling()||this._cleanupViewport("top"),this.updateRowBanding(),this.m_stopRowFetch=!1,-1!==this.m_endRowHeader&&(this.m_stopRowHeaderFetch=!1),-1!==this.m_endRowEndHeader&&(this.m_stopRowEndHeaderFetch=!1),this.fillViewport()},A.prototype._handleHeaderInsertsFetchSuccess=function(e,t,i){this.m_resizeRequired=!0,this.handleHeadersFetchSuccess(e,t,i,this.m_endRowHeader>=t.start)},A.prototype._scrollRowIntoViewport=function(e){var t=this._getAxisCellsByIndex(e,"row");if(null!=t){var i=this._getViewportTop(),s=this._getViewportBottom(),n=this.getElementDir(t[0],"top"),o=i-n;(o>0||(o=s-n)<0)&&this.scrollDelta(0,o)}},A.prototype._handleModelInsertRangeEvent=function(e,t,i){var s,n,o,r,l,a,h,d,c=this._getEmptyElement(),m=e.getStart("row"),u=e.getCount("row"),_=e.getStart("column"),p=e.getCount("column");if(!(m>this.m_endRow+1))if(c)this.empty(),this.refresh(this.m_root);else if(this.m_utils.supportsTransitions()){if(null!=t){s=document.createDocumentFragment();var g=t.getCount();for(r=0,n=0,a=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell"),h=this.getRendererOrTemplate("row");g-n>0;)o=m+n,n+=(l=this.buildLevelHeaders(s,o,0,0,r,!0,m!==this.m_endRowHeader+1,h,t,"row",a,this.m_rowHeaderLevelCount)).count,r+=l.totalHeaderDimension}if(null!=i){d=document.createDocumentFragment();var f=i.getCount();for(r=0,n=0,a=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell"),h=this.getRendererOrTemplate("rowEnd");f-n>0;)o=m+n,n+=(l=this.buildLevelHeaders(d,o,0,0,r,!0,m!==this.m_endRowEndHeader+1,h,i,"rowEnd",a,this.m_rowEndHeaderLevelCount)).count,r+=l.totalHeaderDimension}var C=document.createDocumentFragment();if(l=this._addCellsToFragment(C,e,m,0,_,0),!(0!==C.childNodes.length||null!=s&&0!==s.childNodes.length||null!=d&&0!==d.childNodes.length))return;this._insertRowsWithAnimation(C,s,d,m,e.getCount("row"),l.totalRowHeight,_,p)}else{var y={axis:"row",start:m,count:u},v={axis:"column",start:_,count:p};if(null!=t){var E={axis:"row",header:this.m_rowHeader,endHeader:this.m_rowEndHeader,start:m,count:t.getCount()};this.m_fetching.row=E,this._handleHeaderInsertsFetchSuccess(t,E,i)}this._modifyAxisCellContextIndex("row",m,this.m_endRow-m+1,u),this._refreshDatabodyMap(),this._handleCellInsertsFetchSuccess(e,[y,v])}},A.prototype._handleModelUpdateEvent=function(e,t,i){if(this._isInViewport(e)===A.INSIDE)if(null!=i){var s=this.getRendererOrTemplate("cell"),n=this.m_options.getColumnBandingInterval();this._updateCellsInRow(i,i.getStart("row"),s,this.m_startCol,n)}else-1!==this.m_endRowHeader&&this.fetchHeaders("row",e.row,this.m_rowHeader,this.m_rowEndHeader,1,{success:this._handleHeaderUpdatesFetchSuccess,error:this.handleHeadersFetchError}),this.fetchCells(this.m_databody,e.row,this.m_startCol,1,this.m_endCol-this.m_startCol+1,{success:this._handleCellUpdatesFetchSuccess,error:this.handleCellsFetchError})},A.prototype._handleHeaderUpdatesFetchSuccess=function(e,t,i){var s=t.axis;this.m_fetching[s]=!1;var n=t.start;this._replaceHeaders(this.buildRowHeaders.bind(this),e,this.m_rowHeader,n,this.m_startRowHeader),this._replaceHeaders(this.buildRowEndHeaders.bind(this),i,this.m_rowEndHeader,n,this.m_startRowEndHeader);var o=this.m_rowHeader.firstChild.childNodes[n-this.m_startRowHeader];null==this.m_active||"header"!==this.m_active.type||"row"!==this.m_active.axis&&"rowEnd"!==this.m_active.axis||this._getKey(o,"row")!==this.m_active.key||this._highlightActive(),this._signalTaskEnd()},A.prototype._replaceHeaders=function(e,t,i,s,n){if(null!=t){var o=e(i,t,s,1,!0,!0),r=i.firstChild,l=r.childNodes[s-n];r.replaceChild(o,l)}},A.prototype._handleCellUpdatesFetchSuccess=function(e,t){this.m_fetching.cells=!1;var i=t[0].start,s=this.getRendererOrTemplate("cell"),n=this.m_options.getColumnBandingInterval();this._updateCellsInRow(e,i,s,this.m_startCol,n),this._signalTaskEnd()},A.prototype._getUpdateAnimationDuration=function(){return A.UPDATE_ANIMATION_DURATION},A.prototype._updateCellsInRow=function(e,t,i,s,n){var o,r=this._getUpdateAnimationDuration(),l=this._getAxisCellsByIndex(t,"row"),a=this.getElementDir(l[0],"top");if(0!==r&&this.m_utils.supportsTransitions()){var h=this;h._signalTaskStart(),this._removeFromArray(l),o=document.createDocumentFragment(),this._addCellsToFragment(o,e,t,a,s,this.m_startColPixel),l=o.childNodes;for(var d=this.getElementWidth(this.m_databody),c=0;c<l.length;c++)this.addTransformMoveStyle(l[c],0,0,"linear",d,0,0);this._populateDatabody(this.m_databody.firstChild,o),l=this._getAxisCellsByIndex(t,"row"),this.hideStatusText();this._onTransitionEnd(l[l.length-1],function(){for(var e=0;e<l.length;e++)h.removeTransformMoveStyle(l[e]);h._isSelectionEnabled()&&h.applySelection(),h._highlightActive(),h._signalTaskEnd(),h._runModelEventQueue()},r),setTimeout(function(){for(var e=0;e<l.length;e++)h.addTransformMoveStyle(l[e],r+"ms",0,"linear",0,0,0)},0)}else this._removeFromArray(l),o=document.createDocumentFragment(),this._addCellsToFragment(o,e,t,a,s,this.m_startColPixel),this._populateDatabody(this.m_databody.firstChild,o),this._isSelectionEnabled()&&this.applySelection(),this._highlightActive(),this.hideStatusText()},A.prototype._handleUpdateRangeFetchSuccess=function(e,t,i){this.m_fetching.cells=!1,this.m_fetchingForUpdate=!1;const s=i[0].start,n=s+t.getCount("row")-1,o=i[1].start,r=o+t.getCount("column")-1;var l=this._getCellsInRange(s,o,n,r);const a=this.getElementDir(l[0],"top"),h=this.getResources().isRTLMode()?"right":"left",d=this.getElementDir(l[0],h);this._removeFromArray(l);let c=document.createDocumentFragment();this._addCellsToFragment(c,t,s,a,o,d),this._populateDatabody(this.m_databody.firstChild,c),this.hideStatusText(),this._signalTaskEnd(),e.promiseResolve()},A.prototype._removeAndModifyCells=function(e,t){e.forEach(e=>{let i=e[this.getResources().getMappedAttribute("context")];1===i.extents[t]?this._remove(e):i.extent[t]-=1})},A.prototype._removeAndModifyHeaders=function(e,t,i,s,n){e.forEach(e=>{let o=e[this.getResources().getMappedAttribute("context")],r=o.extent,l=e.parentNode;if(1===r)this._remove(e),0!==l.childNodes.length||l.classList.contains(this.getMappedStyle("scroller"))||this._remove(l);else{let r=this.getElementDir(e,i);this.setElementDir(e,r-t,i),o.extent-=1;let a=o.index;if(a===n){o.index+=1;let i=this.getElementDir(e,s);this.setElementDir(e,i+t,s)}if(l.classList.contains(this.getMappedStyle("groupingcontainer"))){let e=this._getAttribute(l,"extent",!0),t=this._getAttribute(l,"start",!0);this._setAttribute(l,"extent",e-1),a===n&&this._setAttribute(l,"start",t+1)}}})},A.prototype._handleDeleteRangeEvent=function(e){let t=e.ranges,i=new Set,s=e.axis,n=e.editHeader,o=this.getResources().isRTLMode()?"right":"left",r=this.m_selection;for(let e=0;e<r.length;e++)this._applyBorderClassesAroundRange(this.getElementsInRange(r[e]),r[e],!1,"Selected");t.forEach(function(e){let t=e.offset,s=e.count;for(var n=0;n<s;n++)i.add(t+n)});let l=Array.from(i);l.sort(function(e,t){return t-e});let a=0,h=0,d=0,c=0,m=0,u=this.m_rowHeader,_=this.m_startRowHeader,p=this.m_startRowEndHeader,g=this.m_rowEndHeader,f=this.m_rowHeaderLevelCount,C=this.m_rowEndHeaderLevelCount,y=this.m_avgRowHeight,v=-1!==this.m_endRow,E=-1!==this.m_endRowHeader,w=-1!==this.m_endRowEndHeader,S="height",H="top";"column"===s&&(_=this.m_startColHeader,p=this.m_startColEndHeader,u=this.m_colHeader,g=this.m_colEndHeader,f=this.m_columnHeaderLevelCount,C=this.m_columnEndHeaderLevelCount,y=this.m_avgColWidth,v=-1!==this.m_endCol,E=-1!==this.m_endColHeader,w=-1!==this.m_endColEndHeader,S="width",H=o);let x,b=[];if(this._isEditOrEnter()&&(x=this._getCellByIndex(this.m_active.indexes)),x){let t=this.getCellIndexes(x),i=!1;l.forEach(e=>{("row"===s&&e===t.row||"column"===s&&e===t.column)&&(i=!0)}),i&&(this._handleExitEditable(e,x),this._handleExitEdit(e,x))}for(let e=0;e<l.length;e++){let t=l[e],i=0,n=this._isAxisIndexInViewport(t,s);if(n===A.BEFORE||n===A.INSIDE){if(n===A.BEFORE)c+=1,i=y,a+=i;else if(n===A.INSIDE){m+=1,i=this.getElementDir(this._getCellOrHeaderByIndex(t,s),S),h+=i;let e=this._getAxisCellsByIndex(t,s);null!=e&&(this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]),this._removeAndModifyCells(e,s));let n=this._getHeadersByIndex(t,u,f,_);n.length&&this._removeAndModifyHeaders(n,i,S,H,t);let o=this._getHeadersByIndex(t,g,C,p);o.length&&this._removeAndModifyHeaders(o,i,S,H,t)}b.unshift(i)}else n===A.AFTER&&"scroll"===this.m_options.getScrollPolicy()&&(d+=i)}if(l.reverse(),this._modifyAndPushCells(l,b,s,u,g,!1),this._refreshDatabodyMap(),!n){let t;this._adjustActive("delete",l),this._simpleAdjustSelectionOnChange("delete",l.reverse(),s);let i={};if(this.m_active&&"cell"===this.m_active.type&&(Object.assign(i,this.m_active.indexes),t=this._getCellByIndex(i),"row"===s))for(;!t&&i.row-1>0;)i.row-=1,t=this._getCellByIndex(i);t&&(this._setActiveByIndex(i,e),this._highlightActive())}var R=a+h+d,I=this.m_databody.firstChild;if("row"===s){v&&(this.m_startRow-=c,this.m_endRow=this.m_endRow-c-m,this.m_startRowPixel-=a,this.m_endRowPixel=this.m_endRowPixel-a-h,this.m_stopRowFetch=!1),E&&(this.m_startRowHeader-=c,this.m_endRowHeader=this.m_endRowHeader-c-m,this.m_startRowHeaderPixel-=a,this.m_endRowHeaderPixel=this.m_endRowHeaderPixel-a-h,this.m_stopRowHeaderFetch=!1),w&&(this.m_startRowEndHeader-=c,this.m_endRowEndHeader=this.m_endRowEndHeader-c-m,this.m_startRowEndHeaderPixel-=a,this.m_endRowEndHeaderPixel=this.m_endRowEndHeaderPixel-a-h,this.m_stopRowEndHeaderFetch=!1);var M=this.getElementHeight(I)-R;this.setElementHeight(I,M),this.updateRowBanding()}else if("column"===s){v&&(this.m_startCol-=c,this.m_endCol=this.m_endCol-c-m,this.m_startColPixel-=a,this.m_endColPixel=this.m_endColPixel-a-h,this.m_stopColumnFetch=!1),E&&(this.m_startColHeader-=c,this.m_endColHeader=this.m_endColHeader-c-m,this.m_startColHeaderPixel-=a,this.m_endColHeaderPixel=this.m_endColHeaderPixel-a-h,this.m_stopColumnHeaderFetch=!1),w&&(this.m_startColEndHeader-=c,this.m_endColEndHeader=this.m_endColEndHeader-c-m,this.m_startColEndHeaderPixel-=a,this.m_endColEndHeaderPixel=this.m_endColEndHeaderPixel-a-h,this.m_stopColumnEndHeaderFetch=!1);var L=this.getElementWidth(I)-R;this.setElementWidth(I,L),this.updateColumnBanding()}if(!n){this.applySelection(),this.m_utils.isTouchDevice()&&(this.GetSelection().length?this._moveTouchSelectionAffordance():this._removeTouchSelectionAffordance(!0)),this.resizeGrid(),this.m_resizeRequired=!0;let e=this;Promise.resolve().then(()=>{null!=e.m_modelEvents&&0===e.m_modelEvents.length&&e.fillViewport()})}},A.prototype._handleModelDeleteEvent=function(e,t,i){var s,n,o,r;Array.isArray(t)||(t=new Array(t),e=new Array(e));for(var l=0,a=0,h=0,d=0,c=0,m=0;m<t.length;m++){var u=t[m],_=e[m];if(null!=u.row){var p=0,g=u.row,f=this._isInViewport(_);f===A.BEFORE?(this._modifyAxisCellContextIndex("row",this.m_startRow,this.m_endRow-this.m_startRow+1,-1),d+=1,l+=this.m_avgRowHeight,this.m_startRowPixel-=this.m_avgRowHeight,this.m_endRowPixel-=this.m_avgRowHeight,-1!==this.m_endRowHeader&&(this.m_startRowHeaderPixel-=this.m_avgRowHeight,this.m_endRowHeaderPixel-=this.m_avgRowHeight),null!=(r=this._getAxisCellsByKey(g,"row"))&&this.pushRowsUp(this.m_startRow,this.m_avgRowHeight),null!=(n=this.m_rowHeader.firstChild.firstChild)&&this.pushRowHeadersUp(n,this.m_avgRowHeight),null!=(o=this.m_rowEndHeader.firstChild.firstChild)&&this.pushRowHeadersUp(o,this.m_avgRowHeight)):f===A.INSIDE?(c+=1,null!=(r=this._getAxisCellsByKey(g,"row"))&&(p=this.calculateRowHeight(r[0]),_=r[0][this.getResources().getMappedAttribute("context")].indexes.row,this._modifyAxisCellContextIndex("row",_+1,this.m_endRow-_,-1),this._removeFromArray(r),this.pushRowsUp(_,p),this.m_endRowPixel-=p),null!=(n=this._findHeaderByKey(g,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(p=this.calculateRowHeaderHeight(n),s=n.nextSibling,this._remove(n),this.pushRowHeadersUp(s,p),this.m_endRowHeaderPixel-=p),null!=(o=this._findHeaderByKey(g,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")))&&(p=this.calculateRowHeaderHeight(o),s=o.nextSibling,this._remove(o),this.pushRowHeadersUp(s,p),this.m_endRowEndHeaderPixel-=p),a+=p):"scroll"===this.m_options.getScrollPolicy()&&(h+=this.m_avgRowHeight)}}this._refreshDatabodyMap(),this.m_startRow-=d,this.m_endRow=this.m_endRow-d-c,-1!==this.m_endRowHeader&&(this.m_startRowHeader-=d,this.m_endRowHeader=this.m_endRowHeader-d-c),-1!==this.m_endRowEndHeader&&(this.m_startRowEndHeader-=d,this.m_endRowEndHeader=this.m_endRowEndHeader-d-c);var C=l+a+h,y=this.m_databody.firstChild,v=this.getElementHeight(y)-C;this.setElementHeight(y,v),this.resizeGrid(),i||!0===this.m_moveActive||(this.m_resizeRequired=!0,this.m_stopRowFetch=!1,-1!==this.m_endRowHeader&&(this.m_stopRowHeaderFetch=!1),-1!==this.m_endRowEndHeader&&(this.m_stopRowEndHeaderFetch=!1),this.fillViewport()),this.updateRowBanding()},A.prototype._handleModelDeleteEventWithAnimation=function(e,t){this._collapseRowsWithAnimation(e,t)},A.prototype._collapseRowsWithAnimation=function(e,t){var i,s,n,o,r,l,a,h;let d=e.indexes;if(0!==t.length){var c=this;c._signalTaskStart();var m=this.m_processingEventQueue?1:A.COLLAPSE_ANIMATION_DURATION,u=[],_=0,p=-1!==this.m_endRowHeader,g=-1!==this.m_endRowEndHeader,f=this.m_databody.firstChild,C=this._getIndex(this._getAxisCellsByKey(t[0].row,"row")[0],"row")-1;for(s=C;s>=this.m_startRow&&(i=this._getAxisCellsByIndex(s,"row"),!(this.getElementDir(i[0],"top")+this.getElementHeight(i[0])<this.m_currentScrollTop));s--)for(n=0;n<i.length;n++)this.changeStyleProperty(i[n],this.getCssSupport("z-index"),10);if(p)for(r=[],o=this._findHeaderByKey(t[0].row,this.m_rowHeader,this.getMappedStyle("rowheadercell")).previousSibling;o&&!(this.getElementDir(o,"top")+this.getElementHeight(o)<this.m_currentScrollTop);)this.changeStyleProperty(o,this.getCssSupport("z-index"),10),o=o.previousSibling;if(g)for(l=[],o=this._findHeaderByKey(t[0].row,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")).previousSibling;o&&!(this.getElementDir(o,"top")+this.getElementHeight(o)<this.m_currentScrollTop);)this.changeStyleProperty(o,this.getCssSupport("z-index"),10),o=o.previousSibling;for(s=0;s<t.length;s++){var y=t[s].row;if((i=this._getAxisCellsByKey(y,"row")).length)for(u.push(i),_+=this.getElementHeight(i[0]),n=0;n<i.length;n++)this.setElementDir(i[n],this.getElementDir(i[n],"top")-_,"top"),this.addTransformMoveStyle(i[n],0,0,"linear",0,_,0);p&&null!=(a=this._findHeaderByKey(y,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(r.push(a),this.setElementDir(a,this.getElementDir(a,"top")-_,"top"),this.addTransformMoveStyle(a,0,0,"linear",0,_,0)),g&&null!=(h=this._findHeaderByKey(y,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")))&&(l.push(h),this.setElementDir(h,this.getElementDir(h,"top")-_,"top"),this.addTransformMoveStyle(h,0,0,"linear",0,_,0))}for(s=C+t.length+1;s<=this.m_endRow;s++){for(i=this._getAxisCellsByIndex(s,"row"),n=0;n<i.length;n++)this.setElementDir(i[n],this.getElementDir(i[n],"top")-_,"top"),this.addTransformMoveStyle(i[n],0,0,"linear",0,_,0);p&&(a=a.nextSibling,this.setElementDir(a,this.getElementDir(a,"top")-_,"top"),this.addTransformMoveStyle(a,0,0,"linear",0,_,0)),g&&(h=h.nextSibling,this.setElementDir(h,this.getElementDir(h,"top")-_,"top"),this.addTransformMoveStyle(h,0,0,"linear",0,_,0))}var v=this._getCellByIndex(this.createIndex(this.m_endRow,this.m_endCol));c._onTransitionEnd(v,function(){u.length&&c._modifyAxisCellContextIndex("row",C+t.length+1,c.m_endRow-(C+t.length),-1*t.length),p&&r.length&&c._modifyAxisHeaderContextIndex("row",C+t.length+1,c.m_endRow-(C+t.length),-1*t.length),g&&l.length&&c._modifyAxisHeaderContextIndex("rowEnd",C+t.length+1,c.m_endRow-(C+t.length),-1*t.length);for(var e=0;e<u.length;e++){for(var i=0;i<u[e].length;i++)c._remove(u[e][i]);p&&c._remove(r[e]),g&&c._remove(l[e])}c._adjustActive("delete",d),c._refreshDatabodyMap(),c._isEditOrEnter()&&(c._highlightActiveObject(c.m_active,c.m_prevActive),c._updateEdgeCellBorders("")),c.m_endRow-=u.length,c.m_endRowPixel-=_,c.m_stopRowFetch=!1,p&&(c.m_endRowHeader-=r.length,c.m_endRowHeaderPixel-=_,c.m_stopRowHeaderFetch=!1),g&&(c.m_endRowEndHeader-=r.length,c.m_endRowEndHeaderPixel-=_,c.m_stopRowEndHeaderFetch=!1),c.setElementHeight(f,c.m_endRowPixel-c.m_startRowPixel),c.resizeGrid(),c.updateRowBanding(),null==c.m_modelEvents||0!==c.m_modelEvents.length||c.m_moveActive||c.fillViewport(),c._handleAnimationEnd()},m),this.m_animating=!0,setTimeout(function(){for(s=C+1;s<=c.m_endRow;s++){for(i=c._getAxisCellsByIndex(s,"row"),n=0;n<i.length;n++)c.addTransformMoveStyle(i[n],m+"ms",0,"ease-out",0,0,0);p&&(a=c._getHeaderByIndex(s,0,c.m_rowHeader,c.m_rowHeaderLevelCount,c.m_startRowHeader),c.addTransformMoveStyle(a,m+"ms",0,"ease-out",0,0,0)),g&&(h=c._getHeaderByIndex(s,0,c.m_rowEndHeader,c.m_rowEndHeaderLevelCount,c.m_startRowEndHeader),c.addTransformMoveStyle(h,m+"ms",0,"ease-out",0,0,0))}},0)}},A.prototype._handleAnimationEnd=function(){var e,t=this.m_databody.firstChild,i=this.m_rowHeader.firstChild,s=this.m_rowEndHeader.firstChild;for(e=0;e<t.childNodes.length;e++)this.removeTransformMoveStyle(t.childNodes[e]),this.changeStyleProperty(t.childNodes[e],this.getCssSupport("z-index"),null,"remove");if(-1!==this.m_endRowHeader)for(e=0;e<i.childNodes.length;e++)this.removeTransformMoveStyle(i.childNodes[e]),this.changeStyleProperty(i.childNodes[e],this.getCssSupport("z-index"),null,"remove");if(-1!==this.m_endRowEndHeader)for(e=0;e<s.childNodes.length;e++)this.removeTransformMoveStyle(s.childNodes[e]),this.changeStyleProperty(s.childNodes[e],this.getCssSupport("z-index"),null,"remove");this.m_animating=!1,this._runModelEventQueue(),this._signalTaskEnd()},A.prototype._getCellOrHeaderByKey=function(e,t){var i=null,s=this._getAxisCellsByKey(e,t,!0);return null!=s&&s.length>0&&(i=s[0]),null==i&&("row"===t?null==(i=this._findHeaderByKey(e,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(i=this._findHeaderByKey(e,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell"))):"column"===t&&null==(i=this._findHeaderByKey(e,this.m_colHeader,this.getMappedStyle("colheadercell")))&&(i=this._findHeaderByKey(e,this.m_colEndHeader,this.getMappedStyle("colendheadercell")))),i},A.prototype._findHeaderByKey=function(e,t,i){if(null==t)return null;var s;s=t.getElementsByClassName?t.getElementsByClassName(i):t.childNodes;for(var n=0;n<s.length;n++){var o=s[n],r=this._getKey(o);if(this._shallowThenDeepCompare(r,e))return o}return null},A.prototype._handleModelRefreshEvent=function(){var e=this.getVisibility();this.m_focusOnRefresh=this.m_root.contains(document.activeElement),this.m_updateScrollPostionOnRefreshCallback(),e===A.VISIBILITY_STATE_VISIBLE?(this.empty(),null!=this.m_root.offsetParent?this.refresh(this.m_root):this.setVisibility(A.VISIBILITY_STATE_REFRESH)):e===A.VISIBILITY_STATE_HIDDEN&&(this.empty(),this.setVisibility(A.VISIBILITY_STATE_REFRESH))},A.prototype._handleModelSyncEvent=function(e){var t=e.pageSize;this.m_fetching={},this.m_startRow=0,this.m_endRow=-1,this.m_startRowHeader=0,this.m_endRowHeader=-1,this.m_startRowEndHeader=0,this.m_endRowEndHeader=-1,this.m_startRowPixel=0,this.m_endRowPixel=0,this.m_startRowHeaderPixel=0,this.m_endRowHeaderPixel=0,this.m_startRowEndHeaderPixel=0,this.m_endRowEndHeaderPixel=0,this.m_startCol=0,this.m_endCol=-1,this.m_startColHeader=0,this.m_endColHeader=-1,this.m_startColEndHeader=0,this.m_endColEndHeader=-1,this.m_startColPixel=0,this.m_endColPixel=0,this.m_startColHeaderPixel=0,this.m_endColHeaderPixel=0,this.m_startColEndHeaderPixel=0,this.m_endColEndHeaderPixel=0,this.m_rowHeaderLevelCount=void 0,this.m_columnHeaderLevelCount=void 0,this.m_rowEndHeaderLevelCount=void 0,this.m_columnEndHeaderLevelCount=void 0,this.m_avgRowHeight=void 0,this.m_avgColWidth=void 0,this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this._clearScrollPositionKeys(),this.m_selection=null,this.m_selectionRange=null,this.m_active=null,this.m_prevActive=null,this.m_trueIndex={},null!=this.m_empty&&(this.m_databody.firstChild.removeChild(this.m_empty),this.m_empty=null),this._showHeader(this.m_rowHeader),this._showHeader(this.m_colHeader),this._showHeader(this.m_rowEndHeader),this._showHeader(this.m_colEndHeader),this._emptyHeaders(),this._emptyHeaderLabels();var i=this.m_databody.firstChild;null!=i&&this._emptyDatabody(i),this.m_initialized=!1,this.fetchHeaders("row",0,this.m_rowHeader,this.m_rowEndHeader,t,{success:function(e,t,i){this.handleHeadersFetchSuccess(e,t,i,!1)}}),this.fetchHeaders("column",0,this.m_colHeader,this.m_colEndHeader,void 0,{success:function(e,t,i){this.handleHeadersFetchSuccess(e,t,i,!1)}}),this.fetchCells(this.m_databody,0,0,t,null,{success:function(e,t){this.handleCellsFetchSuccess(e,t)}})},A.prototype._emptyHeaders=function(){var e=this.m_rowHeader.firstChild,t=this.m_rowEndHeader.firstChild;null!=e&&this.m_utils.empty(e),null!=t&&this.m_utils.empty(t);var i=this.m_colHeader.firstChild,s=this.m_colEndHeader.firstChild;null!=i&&this.m_utils.empty(i),null!=s&&this.m_utils.empty(s)},A.prototype._emptyHeaderLabels=function(){var e=this.m_headerLabels.row,t=this.m_headerLabels.rowEnd,i=this.m_headerLabels.column,s=this.m_headerLabels.columnEnd;e&&e.length&&e.forEach(e=>{this.m_utils.empty(e)}),t&&t.length&&t.forEach(e=>{this.m_utils.empty(e)}),i&&i.length&&i.forEach(e=>{this.m_utils.empty(e)}),s&&s.length&&s.forEach(e=>{this.m_utils.empty(e)})},A.prototype._setActiveByIndex=function(e,t,i,s,n){return this._setActive(this._getCellByIndex(e),{type:"cell",indexes:e},t,i,s,n)},A.prototype._updateActive=function(e,t,i){var s;if(null==e)this._setActive(null,null,null,!0,!1,i);else if(null!=e.keys)s=this._getCellByKeys(e.keys);else if(null!=e.indexes)s=this._getCellByIndex(e.indexes);else if(null!=e.axis){var n=null==e.level?0:e.level;"column"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_colHeader,this.getMappedStyle("colheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader)):"row"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_rowHeader,this.getMappedStyle("rowheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader)):"columnEnd"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_colEndHeader,this.getMappedStyle("colendheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader)):"rowEnd"===e.axis&&(null!=e.key?s=this._findHeaderByKey(e.key,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader)))}null!=s&&(t||(this.m_shouldFocus=!1),this._setActive(s,e,null,!0,!1,i))},A.prototype._setActive=function(e,t,i,s,n,o){var r;if(null==t||o||this._scrollToActive(t),null!=e)if(r=this._createActiveObject(e),this._compareActive(r,this.m_active)){if(n||this._fireBeforeCurrentCellEvent(r,this.m_active,i))return this.m_prevActive=this.m_active,this.m_active=r,i&&"mousedown"===i.type&&(this.m_trueIndex=null),s&&this._isSelectionEnabled()&&this._clearSelection(i),this._unhighlightActiveObject(this.m_prevActive),this._highlightActiveObject(this.m_active,this.m_prevActive,null,o),this._manageMoveCursor(),this._isGridEditable()&&"cell"===r.type&&(this._setEditableClone(e),this._updateEdgeCellBorders("")),n||this._fireCurrentCellEvent(r,i),this.m_options.isFloodFillEnabled()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"cell"===this.m_active.type&&i&&(this._addFloodfillAffordance(i),this._moveFloodFillAffordance()),!0}else this._highlightActive();else if(!this.m_scrollIndexAfterFetch&&!this.m_scrollHeaderAfterFetch)return(n||this._fireBeforeCurrentCellEvent(r,this.m_active,i))&&(this.m_prevActive=this.m_active,this.m_active=null,this._unhighlightActiveObject(this.m_prevActive),n||this._fireCurrentCellEvent(r,i)),!0;return!1},A.prototype._createActiveObject=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.m_utils.containsCSSClassName(e,this.getMappedStyle("headercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("endheadercell"))?{type:"header",axis:t.axis,index:this.getHeaderCellIndex(e),key:t.key,level:t.level}:this.m_utils.containsCSSClassName(e,this.getMappedStyle("headerlabel"))?{type:"label",axis:t.axis,level:t.level}:this.m_utils.containsCSSClassName(e,this.getMappedStyle("noDataContainer"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("emptytext"))?{type:"empty"}:{type:"cell",indexes:{row:t.indexes.row,column:t.indexes.column},keys:{row:t.keys.row,column:t.keys.column},extents:{row:t.extents.row,column:t.extents.column}}},A.prototype._getActiveElement=function(){return this._getElementFromActiveObject(this.m_active)},A.prototype._getElementFromActiveObject=function(e){if(null!=e){if("header"!==e.type)return"label"===e.type?this._getLabel(e.axis,e.level):"empty"===e.type?this._getEmptyElement():this._getCellByIndex(e.indexes);if("row"===e.axis)return this._findHeaderByKey(e.key,this.m_rowHeader,this.getMappedStyle("rowheadercell"));if("column"===e.axis)return this._findHeaderByKey(e.key,this.m_colHeader,this.getMappedStyle("colheadercell"));if("rowEnd"===e.axis)return this._findHeaderByKey(e.key,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell"));if("columnEnd"===e.axis)return this._findHeaderByKey(e.key,this.m_colEndHeader,this.getMappedStyle("colendheadercell"))}return null},A.prototype._compareActive=function(e,t){if(null==e&&null==t)return!1;if(null==e&&null!=t||null!=e&&null==t)return!0;if(e.type!==t.type)return!0;if("header"===e.type){if(e.index!==t.index||e.key!==t.key||e.axis!==t.axis||e.level!==t.level)return!0}else if("label"===e.type){if(e.axis!==t.axis||e.level!==t.level)return!0}else if(e.indexes.row!==t.indexes.row||e.indexes.column!==t.indexes.column||e.keys.row!==t.keys.row||e.keys.column!==t.keys.column)return!0;return!1},A.prototype._fireBeforeCurrentCellEvent=function(e,t,i){var s={event:i,ui:{currentCell:e,previousCurrentCell:t}};return this.fireEvent("beforeCurrentCell",s)},A.prototype._fireCurrentCellEvent=function(e,t){var i={event:t,ui:e};return this.fireEvent("currentCell",i)},A.prototype._isDatabodyCellActive=function(){return null!=this.m_active&&"cell"===this.m_active.type},A.prototype._updateActiveContext=function(e,t){var i,s,n,o={};if("header"===e.type){i=e.axis;var r=e.index;s=e.level,"row"===e.axis?(this.m_rowHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.rowHeader=r)):"column"===i?(this.m_columnHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.columnHeader=r)):"rowEnd"===e.axis?(this.m_rowEndHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.rowEndHeader=r)):"columnEnd"===i&&(this.m_columnEndHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.columnEndHeader=r)),this._updateContextInfo(o,n)}else"cell"===e.type?(null==t||"cell"!==t.type||null==e||this.m_externalFocus||(e.indexes.row===t.indexes.row?n="row":e.indexes.column===t.indexes.column&&(n="column")),this._updateContextInfo(e,n)):"label"===e.type&&(i=e.axis,s=e.level,(null==t||"label"!==t.type||"label"===t.type&&t.axis!==i||this.m_externalFocus)&&("column"===i?o.columnHeaderLabel=s:"row"===i?o.rowHeaderLabel=s:"rowEnd"===i?o.rowEndHeaderLabel=s:"columnEnd"===i&&(o.columnEndHeaderLabel=s)),this._updateContextInfo(o,n))},A.prototype.handleDatabodyClickActive=function(e){var t=e.target,i=this.findCell(t);null!=i&&this._setActive(i,this._createActiveObject(i),e)},A.prototype.handleHeaderClickActive=function(e,t,i){var s=e.target,n=this.findHeader(s);null!=n&&(t||this._clearSelection(e),this._setActive(n,this._createActiveObject(n),e,null,null,i))},A.prototype._scrollToActive=function(e){"header"===e.type?this.scrollToHeader(e):"cell"===e.type&&this.scrollToIndex(e.indexes)},A.prototype._getCellByKeys=function(e){if(null==e||null==e.row||null==e.column||null==this.m_databody||null==this.m_databody.firstChild)return null;for(var t=this.m_databody.firstChild.getElementsByClassName(this.getMappedStyle("cell")),i=0;i<t.length;i++){var s=t[i],n=this._getKey(s,"row");if(this._shallowThenDeepCompare(n,e.row)){var o=this._getKey(s,"column");if(this._shallowThenDeepCompare(o,e.column))return s}}return null},A.prototype._shallowThenDeepCompare=function(e,t){return e===t||this._compareValuesCallback(e,t)},A.prototype.getCellKeys=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.keys.row,t.keys.column)},A.prototype.getCellIndexes=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.indexes.row,t.indexes.column)},A.prototype.getCellExtents=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.extents.row,t.extents.column)},A.prototype.getCellEndIndexes=function(e){var t=this.getCellIndexes(e),i=this.getCellExtents(e);return this.createIndex(t.row+(i.row-1),t.column+(i.column-1))},A.prototype._getIndex=function(e,t){if(null!=e){if(null==t||!this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return this.getHeaderCellIndex(e);var i=e[this.getResources().getMappedAttribute("context")];if("row"===t)return i.indexes.row;if("column"===t)return i.indexes.column}return null},A.prototype._getExtent=function(e,t){if(null!=e){if(null==t||!this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return parseInt(this._getAttribute(e,"extent",!0),10);var i=e[this.getResources().getMappedAttribute("context")];if("row"===t)return i.extents.row;if("column"===t)return i.extents.column}return null},A.prototype.getHeaderCellIndex=function(e){var t,i,s;switch(this.getHeaderCellAxis(e)){case"column":t=this.m_columnHeaderLevelCount,i=this.m_startColHeader;break;case"row":t=this.m_rowHeaderLevelCount,i=this.m_startRowHeader;break;case"columnEnd":t=this.m_columnEndHeaderLevelCount,i=this.m_startColEndHeader;break;case"rowEnd":t=this.m_rowEndHeaderLevelCount,i=this.m_startRowEndHeader;break;default:return-1}if(t>1){if(s=this._getAttribute(e.parentNode,"start",!0),e===e.parentNode.firstChild)return s;s-=1}else s=i;for(;e.previousSibling;)s+=1,e=e.previousSibling;return s},A.prototype.getHeaderCellAxis=function(e){return this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))?"column":this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowheadercell"))?"row":this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowendheadercell"))?"rowEnd":this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))?"columnEnd":null},A.prototype.getHeaderCellLevel=function(e){if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))){if(1===this.m_columnHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowheadercell"))){if(1===this.m_rowHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))){if(1===this.m_columnEndHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowendheadercell"))&&1===this.m_rowEndHeaderLevelCount)return 0;var t=this._getAttribute(e.parentNode,"level",!0);return e===e.parentNode.firstChild?t:t+this.getHeaderCellDepth(e.parentNode.firstChild)},A.prototype.getHeaderCellDepth=function(e){return this._getAttribute(e,"depth",!0)},A.prototype.getHeaderLabelLevel=function(e){let t=e[this.getResources().getMappedAttribute("context")];return t?t.level:null},A.prototype.getHeaderLabelAxis=function(e){let t=e[this.getResources().getMappedAttribute("context")];return t?t.axis:null},A.prototype._getResizeHeaderMode=function(e){var t="row";return(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnheaderlabel"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnendheaderlabel")))&&(t="column"),t},A.prototype.findCellOrHeader=function(e){var t=this.findCell(e);return null==t&&(t=this.findHeader(e)),t},A.prototype.findCell=function(e){return this.find(e,"cell")},A.prototype.findLabel=function(e){return this.find(e,"headerlabel")},A.prototype.find=function(e,t,i){return null==e||e===this.getRootElement()?null:(null==i&&(i=this.getMappedStyle(t)),null==i?null:this.m_utils.containsCSSClassName(e,i)?e:this.find(e.parentNode,t,i))},A.prototype._highlightActive=function(e){this._highlightActiveObject(this.m_active,this.m_prevActive,e)},A.prototype._unhighlightActive=function(e){this._unhighlightActiveObject(this.m_active,e)},A.prototype._highlightActiveObject=function(e,t,i,s){if(null==i&&this.m_utils.shouldOffsetOutline()&&(i=["offsetOutline"]),null!=e){var n=this._getElementFromActiveObject(e);null!=n&&(this.m_focusInHandler(n),null!=i&&this._highlightElement(n,i),this._isCellEditable()&&"cell"===e.type&&this._applyBorderClassesAroundRange(n,{startIndex:e.indexes},!0,"Edit"),this._setAriaProperties(e,t,n,s))}},A.prototype._unhighlightActiveObject=function(e,t){if(null==t&&this.m_utils.shouldOffsetOutline()&&(t=["offsetOutline"]),null!=e){var i=this._getElementFromActiveObject(e);null!=i&&(this.m_focusOutHandler(i),null!=t&&this._unhighlightElement(i,t),this._isGridEditable()&&"cell"===e.type&&this._applyBorderClassesAroundRange(i,{startIndex:e.indexes},!1,"Edit"),this._unsetAriaProperties(i))}},A.prototype._highlightCellsAlongAxis=function(e,t,i,s,n){for(var o="key"===i?this._getAxisCellsByKey(e,t):this._getAxisCellsByIndex(e,t),r=0;r<o.length;r++)"add"===s?this._highlightElement(o[r],n):this._unhighlightElement(o[r],n)},A.prototype._highlightElement=function(e,t){for(var i=0;i<t.length;i++){var s=this.getMappedStyle(t[i]);this.m_utils.addCSSClassName(e,s)}},A.prototype._unhighlightElement=function(e,t){for(var i=0;i<t.length;i++){var s=this.getMappedStyle(t[i]);this.m_utils.removeCSSClassName(e,s)}},A.prototype._unhighlightElementsByClassName=function(e,t){if(e.length&&t.length)for(var i=0;i<e.length;i++)this._unhighlightElement(e[i],t)},A.prototype._setAriaProperties=function(e,t,i,s){var n=this.getLabelledBy(e,t,i);this._updateActiveContext(e,t),i.setAttribute("tabIndex",0),i.setAttribute("aria-labelledby",n),u.isFirefox()&&i.setAttribute("role","gridcell"),null!=this.m_cellToFocus&&this.m_cellToFocus===i||!1===this.m_shouldFocus||i.focus({preventScroll:s}),this.m_shouldFocus=null},A.prototype._unsetAriaProperties=function(e){null!=e&&(e.setAttribute("tabIndex",-1),e.removeAttribute("aria-labelledby"),u.isFirefox()&&e.removeAttribute("role"))},A.prototype.getLabelledBy=function(e,t,i,s){var n,o,r,l,a="",h=[];const d=i[this.getResources().getMappedAttribute("metadata")];if("header"===e.type){null==t||"header"!==t.type||this.m_externalFocus||("row"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader):"column"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader):"rowEnd"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader):"columnEnd"===t.axis&&(n=this._getHeaderByIndex(t.index,t.level,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader))),a=[this.createSubId("context"),this._getHeaderAndParentIds(i,n)].join(" ");var c=i.getAttribute(this.getResources().getMappedAttribute("sortDir"));if("ascending"===c?o="accessibleSortAscending":"descending"===c?o="accessibleSortDescending":this._getAttribute(i,"sortable")&&(o="accessibleSortable"),null!=o&&h.push({key:o,args:{id:""}}),d&&d.metadata){"expanded"===d.metadata.expanded?h.push({key:"accessibleExpanded",args:{}}):"collapsed"===d.metadata.expanded&&h.push({key:"accessibleCollapsed",args:{}});const t=d.metadata.treeDepth;if(null!=t){let i,s,n,o,r;"row"===e.axis?(i=this.m_stopRowHeaderFetch&&this.m_stopRowEndHeaderFetch&&this.m_stopRowFetch,s=this.m_endRowHeader,n=this.m_startRowHeader):"column"===e.axis&&(s=this.m_endColHeader,n=this.m_startColHeader,i=this.m_stopColumnHeaderFetch&&this.m_stopColumnEndHeaderFetch&&this.m_stopColumnFetch),h.push({key:"accessibleLevelHierarchicalContext",args:{level:t+1}});let l="";const a=[...this.m_root.querySelectorAll(".oj-datagrid-"+e.axis+"-header-cell")];if(t>0){let h,d;a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")],n=s.metadata;n.treeDepth<t&&s.index>e.index&&(!d||s.index<d)&&(d=s.index),n.treeDepth===t-1&&s.index<e.index&&(!h||s.index>h)&&(h=s.index)}),null!=h&&null!=d?l="Full":null!=h&&null==d?(d=s+1,l=i?"Full":"Partial"):null==h&&null!=d?(h=n-1,l="Unknown"):(h=n-1,d=s+1,l="Unknown"),o=0,r=0,a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")];s.metadata.treeDepth===t&&(s.index<=e.index&&s.index>h&&(r+=1),s.index>h&&s.index<d&&(o+=1))})}else{o=0,r=1;l=0===this.m_startRowHeader?i?"Full":"Partial":"Unknown",a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")];s.metadata.treeDepth===t&&(o+=1,s.index<e.index&&(r+=1))})}const d=this._getHierarchicalTranslationKey(l,e.axis);h.push({key:d,args:{posInSet:r,setSize:o}})}}0!==h.length&&(a=a+" "+this.createSubId("state")),i.setAttribute("tabIndex",0)}else if("label"===e.type)a=[this.createSubId("context"),this._getActiveElement().id].join(" ");else if("empty"===e.type)a=this._getActiveElement().id;else{null!=t&&("header"===t.type?(r="row"===t.axis?t.index:null,l="column"===t.axis?t.index:null):"cell"===t.type&&(r=t.indexes.row,l=t.indexes.column));var m=this._getHeaderLabelledBy("row",this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader,this.m_endRowHeader,e.indexes.row,r,i),_=this._getHeaderLabelledBy("rowEnd",this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader,this.m_endRowEndHeader,e.indexes.row,r,i),p=this._getHeaderLabelledBy("column",this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader,this.m_endColHeader,e.indexes.column,l,i),g=this._getHeaderLabelledBy("columnEnd",this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader,this.m_endColEndHeader,e.indexes.column,l,i),f=e.extents.row,C=e.extents.column;f>1&&h.push({key:"accessibleRowSpanContext",args:{extent:f}}),C>1&&h.push({key:"accessibleColumnSpanContext",args:{extent:C}}),a=(a=s?[m,_,p,g,i.id].join(" "):[this.createSubId("context"),m,_,p,g,i.id,this.createSubId("state")].join(" ")).replace(/ +(?= )/g,"")}!0===this.m_externalFocus&&(null!=this.m_root.id&&(a=[this.m_root.id,a].join(" ")),a=[this.createSubId("summary"),a].join(" "),this.m_externalFocus=!1);let y=u.getActionableElementsInNode(i);return y&&y.length>0&&h.push({key:"accessibleContainsControls"}),this._updateStateInfo(h),a},A.prototype._getHierarchicalTranslationKey=function(e,t){return"accessible"+(t.charAt(0).toUpperCase()+t.slice(1))+"Hierarchical"+e},A.prototype.getHeaderFromCell=function(e,t,i){var s,n,o,r,l,a;return"row"===t?null!=this.m_rowHeader&&(s=this._getIndex(e,"row"),n=this._getExtent(e,"row"),o=this.m_rowHeaderLevelCount-1,r=this.m_rowHeader,l=this.m_rowHeaderLevelCount,a=this.m_startRowHeader):"column"===t?null!=this.m_colHeader&&(s=this._getIndex(e,"column"),n=this._getExtent(e,"column"),o=this.m_columnHeaderLevelCount-1,r=this.m_colHeader,l=this.m_columnHeaderLevelCount,a=this.m_startColHeader):"rowEnd"===t?null!=this.m_rowEndHeader&&(s=this._getIndex(e,"row"),n=this._getExtent(e,"row"),o=this.m_rowEndHeaderLevelCount-1,r=this.m_rowEndHeader,l=this.m_rowEndHeaderLevelCount,a=this.m_startRowEndHeader):"columnEnd"===t&&null!=this.m_colEndHeader&&(s=this._getIndex(e,"column"),n=this._getExtent(e,"column"),o=this.m_columnEndHeaderLevelCount-1,r=this.m_colEndHeader,l=this.m_columnEndHeaderLevelCount,a=this.m_startColEndHeader),null!=s&&null!=o&&s>-1?(i&&(s+=n-1),this._getHeaderByIndex(s,o,r,l,a)):null},A.prototype._trimRangeForSelectionMode=function(e){return"row"===this.m_options.getSelectionMode()?this.createRange(this.createIndex(e.startIndex.row),this.createIndex(e.endIndex.row)):e},A.prototype.createRange=function(e,t,i,s){var n,o,r,l,a,h,d,c;return t&&(e.row<t.row||-1===t.row?(n=e.row,o=t.row,i&&(a=i.row,h=s.row)):(n=t.row,o=e.row,i&&(a=s.row,h=i.row)),isNaN(e.column)||isNaN(t.column)?(e={row:n},t={row:o},i&&(i={row:a,column:d},s={row:h,column:c})):(e.column<t.column||-1===t.column?(r=e.column,l=t.column,i&&(d=i.column,c=s.column)):(r=t.column,l=e.column,i&&(d=s.column,c=i.column)),e={row:n,column:r},t={row:o,column:l},i&&(i={row:a,column:d},s={row:h,column:c}))),i?{startIndex:e,endIndex:t,startKey:i,endKey:s}:{startIndex:e,endIndex:t}},A.prototype._createRangeWithKeys=function(e,t,i){this._keys(e,this._createRangeStartKeyCallback.bind(this,t,i))},A.prototype._createRangeStartKeyCallback=function(e,t,i,s){null!=e&&null!=s&&e.row===s.row&&e.column===s.column?this._createRangeEndKeyCallback(i,s,t,i,s):e?this._keys(e,this._createRangeEndKeyCallback.bind(this,i,s,t)):t.call(this,{startIndex:s,endIndex:s,startKey:i,endKey:i})},A.prototype._createRangeEndKeyCallback=function(e,t,i,s,n){i.call(this,this.createRange(t,n,e,s))},A.prototype.getEndIndex=function(e){return null==e.endIndex?e.startIndex:e.endIndex},A.prototype.getElementsInRange=function(e,t,i,s,n){var o,r,l,a,h;null==t&&(t=this.m_startRow),null==i&&(i=this.m_endRow+1);var d=e.startIndex,c=this.getEndIndex(e),m=d.row,u=c.row;if(-1===u&&(u=Number.MAX_VALUE),i<m||u<t)return null;if(!isNaN(d.column)&&!isNaN(c.column)&&(o=d.column,-1===(r=c.column)&&(r=Number.MAX_VALUE),this.m_endCol+1<o||r<this.m_startCol))return null;var _=[];if(null==this.m_databody.firstChild)return null;if(m=Math.max(this.m_startRow,m),u=Math.min(this.m_endRow,u),isNaN(o)||isNaN(r))for(o=Math.max(0,this.m_startCol),r=Math.max(o,this.m_endCol),l=m;l<=u;l+=1)for(a=o;a<=r;a+=1)null!=(h=this._getCellByIndex(this.createIndex(l,a)))&&-1===_.indexOf(h)&&_.push(h);else for(o=Math.max(this.m_startCol,o),r=Math.min(this.m_endCol,r),l=m;l<=u;l+=1)for(a=o;a<=r;a+=1)null!=(h=this._getCellByIndex(this.createIndex(l,a)))&&-1===_.indexOf(h)&&_.push(h);return _},A.prototype._getRangeInView=function(e){let t=e.startIndex,i=this.getEndIndex(e),s=t.row,n=i.row,o=t.column,r=i.column;return-1===n&&(n=Number.MAX_VALUE),-1===r&&(r=Number.MAX_VALUE),s=Math.max(this.m_startRow,s),n=Math.min(this.m_endRow,n),(isNaN(t.column)||isNaN(i.column))&&(o=Math.max(0,this.m_startCol),r=Math.max(o,this.m_endCol)),o=Math.max(this.m_startCol,o),r=Math.min(this.m_endCol,r),this.createRange(this.createIndex(s,o),this.createIndex(n,r))},A.prototype._applyBorderClassesAroundRange=function(e,t,i,s){if(null==this.m_databody.firstChild||null==e||0===e.length)return;let n=this._getRangeInView(t),o=n.startIndex.row,r=n.startIndex.column,l=n.endIndex.row,a=n.endIndex.column,h=0===o,d=0===r,c=h?0:o-1,m=l,u=d?0:r-1,_=a;for(let e=o;e<=l;e++){let t=this._getCellByIndex(this.createIndex(e,u)),n=this._getCellByIndex(this.createIndex(e,_)),o=(d?"start":"end")+s,r="end"+s;i?(this._highlightElement(t,[o]),this._highlightElement(n,[r])):(this._unhighlightElement(t,[o]),this._unhighlightElement(n,[r]))}for(let e=r;e<=a;e++){let t=this._getCellByIndex(this.createIndex(c,e)),n=this._getCellByIndex(this.createIndex(m,e)),o=(h?"top":"bottom")+s,r="bottom"+s;i?(this._highlightElement(t,[o]),this._highlightElement(n,[r])):(this._unhighlightElement(t,[o]),this._unhighlightElement(n,[r]))}},A.prototype.readCurrentContent=function(){var e,t;if(null==this.m_active)return!1;if("header"===this.m_active.type)e={},"row"===this.m_active.axis?(this.m_rowHeaderLevelCount>1&&(e.level=this.m_active.level),e.rowHeader=this.m_active.index):(this.m_columnHeaderLevelCount>1&&(e.level=this.m_active.level),e.columnHeader=this.m_active.index),t=this._getActiveElement();else if("cell"===this.m_active.type){if(e=this.m_active.indexes,this._isSelectionEnabled()&&this.isMultipleSelection()&&null!=this.m_selectionFrontier&&(e=this.m_selectionFrontier),null==e)return!1;var i=this.createRange(e),s=this.getElementsInRange(i);if(null==s||0===s.length)return!1;t=s[0]}else t=this._getActiveElement();this._updateActiveContext(this.m_active,this.m_prevActive),this.m_placeHolder.tabIndex=-1;var n=t.getAttribute("aria-labelledby");return this.m_placeHolder.setAttribute("aria-labelledby",n+" "+t.id),this.m_placeHolder===document.activeElement?t.focus():this.m_placeHolder.focus(),!0},A.prototype._enterActionableMode=function(e,t){return this._setFocusToFirstFocusableElement(e,t)&&(this.m_focusOutHandler(e),this.setActionableMode(!0)),!1},A.prototype._exitActionableMode=function(){if(this.isActionableMode()){var e=this._getActiveElement();this.setActionableMode(!1),u.disableAllFocusableElements(e),this.m_focusInHandler(e)}},A.prototype._reRenderCell=function(e,t,i,s){var n=this.getRendererOrTemplate("cell"),o=e[this.getResources().getMappedAttribute("context")],r=e[this.getResources().getMappedAttribute("metadata")];if(o.mode=t,this.m_utils.empty(e),this.m_utils.containsCSSClassName(e,i)?this.m_utils.removeCSSClassName(e,i):this.m_utils.addCSSClassName(e,i),s){for(;s.hasChildNodes();)e.appendChild(s.firstChild);this._destroyEditableClone()}else this._renderContent(n,o,e,o.data,this.buildCellTemplateContext(o,r))},A.prototype._resetEditableClone=function(){if(this._isGridEditable()&&this.m_active&&"cell"===this.m_active.type){let e=this._getActiveElement();e&&this._setEditableClone(e)}},A.prototype._setEditableClone=function(e){if(this._destroyEditableClone(),null!=e){var t=e.cloneNode(!1);t.removeAttribute("id"),this._createUniqueId(t),t[this.getResources().getMappedAttribute("context")]=e[this.getResources().getMappedAttribute("context")],t[this.getResources().getMappedAttribute("metadata")]=e[this.getResources().getMappedAttribute("metadata")],t[this.getResources().getMappedAttribute("context")].parentElement=t,this.m_root.appendChild(t),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),null),t.style.display="none",t[this.getResources().getMappedAttribute("context")].parentElement=e,this.m_editableClone=t}},A.prototype._destroyEditableClone=function(){this.m_editableClone&&(null!=this.m_editableClone.parentNode?this._remove(this.m_editableClone):this._cleanTemplateNodes(this.m_editableClone),delete this.m_editableClone)},A.prototype.isArrowKey=function(e){return e===this.keyCodes.UP_KEY||e===this.keyCodes.DOWN_KEY||e===this.keyCodes.LEFT_KEY||e===this.keyCodes.RIGHT_KEY},A.prototype.createIndex=function(e,t){var i={};return void 0!==e&&(i.row=e),void 0!==t&&(i.column=t),i},A.prototype.checkCorners=function(e,t,i){return"column"===this.m_selectionFrontier.axis&&this.m_columnHeaderLevelCount!==this.m_selectionFrontier.level||"row"===this.m_selectionFrontier.axis&&this.m_rowHeaderLevelCount!==this.m_selectionFrontier.level||"rowEnd"===this.m_selectionFrontier.axis&&this.m_rowEndHeaderLevelCount!==this.m_selectionFrontier.level||"columnEnd"===this.m_selectionFrontier.axis&&this.m_columnEndHeaderLevelCount!==this.m_selectionFrontier.level||(-1!==e.indexOf("row")?t===i.startIndex.row&&this.m_selectionFrontier.end===i.endIndex.row||t===i.endIndex.row&&this.m_selectionFrontier.end===i.startIndex.row:-1!==e.indexOf("column")&&(t===i.startIndex.column&&this.m_selectionFrontier.end===i.endIndex.column||t===i.endIndex.column&&this.m_selectionFrontier.end===i.startIndex.column))},A.prototype.handleLabelFocusChange=function(e,t,i,s){var n,o,r,l,a;if(!this.isFetchComplete())return!0;this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY));var h=this.m_active.axis,d=this.m_active.level;switch("column"===h?(r=this.m_colHeader,l=this.m_startColHeader,a=this.m_columnHeaderLevelCount):"row"===h&&(r=this.m_rowHeader,l=this.m_startRowHeader,a=this.m_rowHeaderLevelCount),"columnEnd"===h&&(e===this.keyCodes.DOWN_KEY?e=this.keyCodes.UP_KEY:e===this.keyCodes.UP_KEY&&(e=this.keyCodes.DOWN_KEY),r=this.m_colEndHeader,l=this.m_startColEndHeader,a=this.m_columnEndHeaderLevelCount),"rowEnd"===h&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY),r=this.m_rowEndHeader,l=this.m_startRowEndHeader,a=this.m_rowEndHeaderLevelCount),e){case this.keyCodes.DOWN_KEY:"row"!==h&&"rowEnd"!==h||(n=this._getHeaderByIndex(l,d,r,a,l),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:l,level:d,axis:h},t)),"column"!==h&&"columnEnd"!==h||((n=this.m_headerLabels[h][d+1])?this._setActive(n,{type:"label",level:d+1,axis:h},t):"column"===h&&d===a-1&&this.m_headerLabels.row.length?(n=this.m_headerLabels.row[this.m_headerLabels.row.length-1],this._setActive(n,{type:"label",level:this.m_headerLabels.row.length-1,axis:"row"},t)):d===a-1&&(o="column"===h?this.m_startRowHeader:this.m_endRowHeader,n=this._getHeaderByIndex(o,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),n&&this._setActive(n,{type:"header",index:o,level:d,axis:"row"},t)));break;case this.keyCodes.UP_KEY:"row"===h&&d===a-1&&this.m_headerLabels.column.length&&(n=this.m_headerLabels.column[this.m_headerLabels.column.length-1],this._setActive(n,{type:"label",level:this.m_headerLabels.column.length-1,axis:"column"},t)),"column"!==h&&"columnEnd"!==h||(n=this.m_headerLabels[h][d-1])&&this._setActive(n,{type:"label",level:d-1,axis:h},t);break;case this.keyCodes.RIGHT_KEY:"row"!==h&&"rowEnd"!==h||((n=this.m_headerLabels[h][d+1])?this._setActive(n,{type:"label",level:d+1,axis:h},t):d===a-1&&(o="row"===h?this.m_startColHeader:this.m_endColHeader,(n=this._getHeaderByIndex(o,this.m_columnHeaderLevelCount,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader))&&(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:o,level:d,axis:"column"},t)))),"column"!==h&&"columnEnd"!==h||(n=this._getHeaderByIndex(l,d,r,a,l),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:l,level:d,axis:h},t));break;case this.keyCodes.LEFT_KEY:"row"!==h&&"rowEnd"!==h||(n=this.m_headerLabels[h][d-1])&&this._setActive(n,{type:"label",level:d-1,axis:h},t)}return!0},A.prototype.handleHeaderFocusChange=function(e,t,i,s,n){var o,r,l,a,h,d,c,m,u;let _=this._getEmptyElement();if(!this.isFetchComplete())return!0;this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY));var p=this.m_active.axis,g=this.m_active.index,f=this.m_active.level,C=this._getActiveElement(),y=null!=C?this._getAttribute(C,"depth",!0):1;if(p||g||!this.m_active||(p=this.m_selectionFrontier.axis,g=this.m_active.indexes[p]),t.shiftKey&&!i&&this.m_selectionFrontier&&this.isMultipleSelection()&&(i=this.checkHeaderToDatabody(p,e)),!(i&&this.isArrowKey(e)&&this.isHeaderSelectionType(this.m_selectionFrontier)&&this.checkCorners(p,g,this.m_selection[this.m_selection.length-1]))||(p=this.m_selectionFrontier.axis,g=this.m_selectionFrontier.index,f=this.m_selectionFrontier.level,-1===g&&(g=this.m_active.indexes[p]),"cell"!==this.m_active.type||(e!==this.keyCodes.LEFT_KEY&&e!==this.keyCodes.RIGHT_KEY||-1===p.indexOf("row"))&&(e!==this.keyCodes.UP_KEY&&e!==this.keyCodes.DOWN_KEY||-1===p.indexOf("column")))){"column"===p?(h=this.m_colHeader,d=this.m_startColHeader,c=this.m_endColHeader,m=this.m_columnHeaderLevelCount,u=this.m_stopColumnHeaderFetch):"row"===p&&(h=this.m_rowHeader,d=this.m_startRowHeader,c=this.m_endRowHeader,m=this.m_rowHeaderLevelCount,u=this.m_stopRowHeaderFetch),"columnEnd"===p&&(e===this.keyCodes.DOWN_KEY?e=this.keyCodes.UP_KEY:e===this.keyCodes.UP_KEY&&(e=this.keyCodes.DOWN_KEY),h=this.m_colEndHeader,d=this.m_startColEndHeader,c=this.m_endColEndHeader,m=this.m_columnEndHeaderLevelCount,u=this.m_stopColumnEndHeaderFetch),"rowEnd"===p&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY),h=this.m_rowEndHeader,d=this.m_startRowEndHeader,c=this.m_endRowEndHeader,m=this.m_rowEndHeaderLevelCount,u=this.m_stopRowEndHeaderFetch),i&&this.isArrowKey(e)&&this.isHeaderSelectionType(this.m_selectionFrontier)&&(y=null!=(C=this._getHeaderByIndex(g,f,h,m,d))?this._getAttribute(C,"depth",!0):1);var v=this._isSelectionEnabled()?this.selectAndFocus.bind(this):this._setActiveByIndex.bind(this);switch(e){case this.keyCodes.LEFT_KEY:if("column"===p||"columnEnd"===p)if(g>0){if(s&&this.m_headerLabels[p][f]){this._setActive(this.m_headerLabels[p][f],{type:"label",level:f,axis:p},t);break}if("column"===p&&s&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]){this._setActive(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],{type:"label",level:this.m_rowHeaderLevelCount-1,axis:"row"},t);break}if(1===m)l=g-1,r=null!=C?C.previousSibling:null,a=f;else if(l=null!=(r=this._getHeaderByIndex(g-1,f,h,m,d))?this._getAttribute(r.parentNode,"start",!0):g-1,a=null!=r?this.getHeaderCellLevel(r):f,l<0)break;i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"row"!==this.m_options.getSelectionMode()&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive())}else this.m_headerLabels[p][f]?this._setActive(this.m_headerLabels[p][f],{type:"label",level:f,axis:p},t):"column"===p&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],{type:"label",level:this.m_rowHeaderLevelCount-1,axis:"row"},t);else("row"===p||"rowEnd"===p)&&f>0&&(r=this._getHeaderByIndex(g,f-1,h,m,d),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.RIGHT_KEY:if("rowEnd"===p&&s&&-1!==this.m_endRowHeader)r=this._getHeaderByIndex(g,this.m_rowHeaderLevelCount,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:g,level:this.m_rowHeaderLevelCount,axis:p},t),this._highlightActive());else if("row"===p&&s&&-1!==this.m_endRowEndHeader)r=this._getHeaderByIndex(g,this.m_rowEndHeaderLevelCount,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:g,level:this.m_rowEndHeaderLevelCount,axis:p},t),this._highlightActive());else if("row"===p||"rowEnd"===p)if(f+y>=m&&!i)if(this.m_trueIndex={row:g},n){if("row"===p){let e=this._getEmptyCellNeighborIndex({row:g,column:-1},{right:!0},this._getMaxRight(),this.m_endRowEndHeader);if(e)if(e.cell)v(e.cell,t);else if(e.header){let e=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader);this._setActive(e,{type:"header",index:g,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t,!0)}}else if("rowEnd"===p){let e=this._getEmptyCellNeighborIndex({row:g,column:this.m_endCol+1},{left:!0},this._getMaxLeft(),this.m_startRowHeader);if(e.cell)v(e.cell,t);else if(e.header){let e=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader);this._setActive(e,{type:"header",index:g,level:this.m_rowHeaderLevelCount-1,axis:"row"},t,!0)}}}else _?this._setActive(_,{type:"empty"},t,!0):(o="row"===p?this.createIndex(g,0):this._isHighWatermarkScrolling()?this.createIndex(g,this.m_endCol):this.createIndex(g,this.getDataSource().getCount("column")-1),this._isSelectionEnabled()?this.selectAndFocus(o,t):(this._setActiveByIndex(o,t),this._highlightActive()));else r=this._getHeaderByIndex(g,f+y,h,m,d),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive());else"column"===p&&s&&this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1]?this._setActive(this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t):(1===m?(l=g+1,r=null!=C?C.nextSibling:null,a=f):(f===m-1?(l=g+1,r=this._getHeaderByIndex(l,f,h,m,d)):(l=null!=C?this._getAttribute(C.parentNode,"start",!0)+this._getAttribute(C.parentNode,"extent",!0):g+1,r=this._getHeaderByIndex(l,f,h,m,d)),a=null!=r?this.getHeaderCellLevel(r):f),l>c&&u||!(this._isCountUnknown("column")||l<this.getDataSource().getCount("column"))?"column"===p&&this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t):i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"row"!==this.m_options.getSelectionMode()&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.UP_KEY:if("row"===p||"rowEnd"===p){if(s&&this.m_headerLabels[p][f]){this._setActive(this.m_headerLabels[p][f],{type:"label",level:f,axis:p},t);break}if("row"===p&&s&&this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]){this._setActive(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],{type:"label",level:this.m_columnHeaderLevelCount-1,axis:"column"},t);break}if(g>0){if(1===m)l=g-1,r=null!=C?C.previousSibling:null,a=f;else if(f===m-1?(l=g-1,r=this._getHeaderByIndex(l,f,h,m,d)):l=null!=(r=null!=C?this._getHeaderByIndex(this._getAttribute(C.parentNode,"start",!0)-1,f,h,m,d):null)?this._getAttribute(r.parentNode,"start",!0):g-1,a=null!=r?this.getHeaderCellLevel(r):f,l<0)break;i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive())}else this.m_headerLabels[p][f]?this._setActive(this.m_headerLabels[p][f],{type:"label",level:f,axis:p},t):"row"===p&&this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],{type:"label",level:this.m_columnHeaderLevelCount-1,axis:"column"},t)}else("column"===p||"columnEnd"===p)&&f>0&&(r=this._getHeaderByIndex(g,f-1,h,m,d),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.DOWN_KEY:if("columnEnd"===p&&s&&-1!==this.m_endColHeader)r=this._getHeaderByIndex(g,this.m_columnHeaderLevelCount,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(r,{type:"header",index:g,level:this.m_columnHeaderLevelCount,axis:p},t),this._highlightActive());else if("column"===p&&s&&-1!==this.m_endColEndHeader)r=this._getHeaderByIndex(g,this.m_columnEndHeaderLevelCount,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:g,level:this.m_columnEndHeaderLevelCount,axis:p},t),this._highlightActive());else if("column"===p||"columnEnd"===p)if(f+y>=m&&!i)if(this.m_trueIndex={column:g},n){if("column"===p){let e=this._getEmptyCellNeighborIndex({row:0,column:this.m_trueIndex.column},{down:!0},this._getMaxBottom(),this.m_endColEndHeader);if(e)if(e.cell)v(e.cell,t);else if(e.header){let e=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader);this._setActive(e,{type:"header",index:g,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t,!0)}}else if("columnEnd"===p){let e=this._getEmptyCellNeighborIndex({row:this.m_endRow+1,column:this.m_trueIndex.column},{up:!0},this._getMaxTop(),this.m_startColHeader);if(e)if(e.cell)v(e.cell,t);else if(e.header){let e=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader);this._setActive(e,{type:"header",index:g,level:this.m_columnHeaderLevelCount-1,axis:"column"},t,!0)}}}else _?this._setActive(_,{type:"empty"},t,!0):(o="column"===p?this.createIndex(0,g):this._isHighWatermarkScrolling()?this.createIndex(this.m_endRow,g):this.createIndex(this.getDataSource().getCount("row")-1,g),this._isSelectionEnabled()?this.selectAndFocus(o,t):(this._setActiveByIndex(o,t),this._highlightActive()));else r=this._getHeaderByIndex(g,f+y,h,m,d),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive());else"row"===p&&s&&this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1]?this._setActive(this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1],{type:"label",level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t):(1===m?(l=g+1,r=null!=C?C.nextSibling:null,a=f):(f===m-1?(l=g+1,r=this._getHeaderByIndex(l,f,h,m,d)):(l=null!=C?this._getAttribute(C.parentNode,"start",!0)+this._getAttribute(C.parentNode,"extent",!0):g+1,r=this._getHeaderByIndex(l,f,h,m,d)),a=null!=r?this.getHeaderCellLevel(r):f),l>c&&u||!(this._isCountUnknown("row")||l<this.getDataSource().getCount("row"))?"row"===p&&this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.columnEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t):i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.PAGEUP_KEY:"row"!==p&&"rowEnd"!==p||(C=this._getHeaderByIndex(0,f,h,m,d),this._setActive(C,{type:"header",index:0,level:f,axis:p},t));break;case this.keyCodes.PAGEDOWN_KEY:"row"!==p&&"rowEnd"!==p||(g=this._isCountUnknown("row")||this._isHighWatermarkScrolling()?Math.max(0,c):Math.max(0,this.getDataSource().getCount("row")-1),C=this._getHeaderByIndex(g,f,h,m,d),this._setActive(C,{type:"header",index:g,level:f,axis:p},t));break;case this.keyCodes.HOME_KEY:"column"!==p&&"columnEnd"!==p||(C=this._getHeaderByIndex(0,f,h,m,d),this._setActive(C,{type:"header",index:0,level:f,axis:p},t));break;case this.keyCodes.END_KEY:"column"!==p&&"columnEnd"!==p||(g=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?Math.max(0,c):Math.max(0,this.getDataSource().getCount("column")-1),C=this._getHeaderByIndex(g,f,h,m,d),this._setActive(C,{type:"header",index:g,level:f,axis:p},t))}return!0}},A.prototype.checkHeaderToDatabody=function(e,t){return!("row"===e&&this.m_rowHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.RIGHT_KEY||"rowEnd"===e&&this.m_rowEndHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.LEFT_KEY||"column"===e&&this.m_columnHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.DOWN_KEY||"columnEnd"===e&&this.m_columnEndHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.UP_KEY)},A.prototype._getHeaderLabelledBy=function(e,t,i,s,n,o,r,l){var a;if(-1!==n&&(o!==r||this.m_externalFocus)){var h=this.getHeaderFromCell(l,e);return null!=r&&(a=this._getHeaderByIndex(r,i-1,t,i,s)),this._getHeaderAndParentIds(h,a)}return""},A.prototype._getHeaderAndParentIds=function(e,t){var i="",s=[];if(null==e)return"";var n=this._getHeaderAndParents(e);null!=t&&(s=this._getHeaderAndParents(t));for(var o=0;o<n.length;o++)s[o]===n[o]&&o!==n.length-1||(i+=(""===i?"":" ")+n[o].id);return i},A.prototype._getHeaderAndParents=function(e){var t,i=[e],s=this.getHeaderCellAxis(e),n=this.getHeaderCellLevel(e),o=this._getLabel(s,n);if("row"===s?t=this.m_rowHeaderLevelCount:"column"===s?t=this.m_columnHeaderLevelCount:"rowEnd"===s?t=this.m_rowEndHeaderLevelCount:"columnEnd"===s&&(t=this.m_columnEndHeaderLevelCount),o&&i.unshift(o),1===t)return i;for(n===t-1&&(e=e.parentNode.firstChild,i.unshift(e),n-=1,(o=this._getLabel(s,n))&&i.unshift(o));n>0;)e=e.parentNode.parentNode.firstChild,i.unshift(e),n-=1,(o=this._getLabel(s,n))&&i.unshift(o);return i},A.prototype.isHeaderSelectionType=function(e){return!(!e||!e.axis)},A.prototype._isChildEmpty=function(e){if(e){let t=e.textContent.trim();return!(e.children.length>0||t.length>0)}return!1},A.prototype._isNeighborCellEmpty=function(e,t){let i=this._getIndex(e,"row"),s=this._getIndex(e,"column");if("row"===t){let t=this._getCellByIndex({row:i,column:s-1}),n=this._getCellByIndex({row:i,column:s+1});if((this._isChildEmpty(t)||this._isChildEmpty(n))&&!this._isChildEmpty(e))return!0}else if("column"===t){let t=this._getCellByIndex({row:i-1,column:s}),n=this._getCellByIndex({row:i+1,column:s});if((this._isChildEmpty(t)||this._isChildEmpty(n))&&!this._isChildEmpty(e))return!0}return!1},A.prototype._getEmptyCellNeighborIndex=function(e,t,i,s){let n,o,r,l,a,h,d,c=e.row,m=e.column,u=Object.create({}),_=t.left||t.right,p=t.up||t.down,g=t.right||t.down,f=t.left||t.up;_?(n="row",o=m,r=c):p&&(n="column",o=c,l=m),g?(a=1,d=i):f&&(a=-1,d=i-1);let C,y=o;for(;f?y>=i:y<=i;){if(g?C=y<i:f&&(C=y>i),_?l=y===i?d:y+a:p&&(r=y===i?d:y+a),h=this._getCellByIndex({row:r,column:l}),C&&this._isNeighborCellEmpty(h,n))return u.cell=this.createIndex(r,l),u;if(y===i){let e;return g?e=(t.right?this._isLastColumn(y):this._isLastRow(y))&&-1!==s:f&&(e=0===y),e?(u.header=!0,u):(u.cell=this.createIndex(r,l),u)}y+=a}return null},A.prototype.handleNoDataFocusChange=function(e,t,i,s){let n;if(null==this.m_active)return null;switch(this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY)),e){case this.keyCodes.UP_KEY:!t&&s&&-1!==this.m_endColHeader&&(n=this._getHeaderByIndex(this.m_startColHeader,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader,!0),this._setActive(n,{type:"header",index:this.m_startColHeader,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0));break;case this.keyCodes.DOWN_KEY:-1!==this.m_endColEndHeader&&s&&(n=this._getHeaderByIndex(this.m_startColEndHeader,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader,!0),this._setActive(n,{type:"header",index:this.m_startColEndHeader,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0));break;case this.keyCodes.LEFT_KEY:!t&&s&&-1!==this.m_endRowHeader&&(n=this._getHeaderByIndex(this.m_startRowHeader,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader,!0),this._setActive(n,{type:"header",index:this.m_startRowHeader,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0));break;case this.keyCodes.RIGHT_KEY:-1!==this.m_endRowEndHeader&&s&&(n=this._getHeaderByIndex(this.m_startRowEndHeader,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader,!0),this._setActive(n,{type:"header",index:this.m_startRowEndHeader,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0))}return!0},A.prototype.handleFocusChange=function(e,t,i,s,n,o=!1,r=!1){var l,a,h,d=1,c=1;if(!this.isFetchComplete()&&!1===this.m_fetchingForUpdate)return!0;if(t){if(l=this.m_selectionFrontier,this.isHeaderSelectionType(this.m_selectionFrontier))return void this.handleHeaderFocusChange(e,i,t,n)}else l=this.m_active.indexes;if(null!=l){var m,u,_,p,g;switch(null==this.m_trueIndex&&(this.m_trueIndex={}),this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY)),m=this._isSelectionEnabled()?this.selectAndFocus.bind(this):this._setActiveByIndex.bind(this),u=l.row,_=l.column,(p=this._getCellByIndex(l))&&(d=(g=p[this.getResources().getMappedAttribute("context")]).extents.row,c=g.extents.column),e){case this.keyCodes.LEFT_KEY:if(this.m_trueIndex.row||t||(this.m_trueIndex={row:u}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{left:!0},this._getMaxLeft(),this.m_startRowHeader);s&&(s.cell?m(s.cell,i):s.header&&(h=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0)))}else _>0&&(!n||-1===this.m_endRowHeader)?"row"===this.m_options.getSelectionMode()?(a=this.createIndex(this.m_trueIndex.row,_-1),this._setActiveByIndex(a,i)):(t?(a=this.createIndex(u,_-1),this.extendSelection(a,i,e)):m(a=this.createIndex(this.m_trueIndex.row,_-1),i),_-1==0&&this._setAccInfoText("accessibleFirstColumn")):!t&&s&&(h=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"row",h,this.m_rowHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0));break;case this.keyCodes.RIGHT_KEY:if(this.m_trueIndex.row||t||(this.m_trueIndex={row:u}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{right:!0},this._getMaxRight(),this.m_endRowEndHeader);s&&(s.cell?m(s.cell,i):s.header&&(h=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0)))}else this._isLastColumn(_+(c-1))||n&&-1!==this.m_endRowEndHeader?-1!==this.m_endRowEndHeader&&s?(h=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"rowEnd",h,this.m_rowEndHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0)):t||m(l,i):"row"===this.m_options.getSelectionMode()?(a=this.createIndex(this.m_trueIndex.row,_+c),this._setActiveByIndex(a,i)):(t?(a=this.createIndex(u,_+1),this.extendSelection(a,i,e)):m(a=this.createIndex(this.m_trueIndex.row,_+c),i),this._isLastColumn(_+c)&&this._setAccInfoText("accessibleLastColumn"));break;case this.keyCodes.UP_KEY:if(this.m_trueIndex.column||t||(this.m_trueIndex={column:_}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{up:!0},this._getMaxTop(),this.m_startColHeader);s&&(s.cell?m(s.cell,i):s.header&&(h=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0)))}else u>0&&(!n||-1===this.m_endColHeader)?(t?(a=this.createIndex(u-1,_),this.extendSelection(a,i,e)):m(a=this.createIndex(u-1,this.m_trueIndex.column),i),u-1==0&&this._setAccInfoText("accessibleFirstRow")):!t&&s&&(h=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"column",h,this.m_columnHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0));break;case this.keyCodes.DOWN_KEY:if(this.m_trueIndex.column||t||(this.m_trueIndex={column:_}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{down:!0},this._getMaxBottom(),this.m_endColEndHeader);s&&(s.cell?m(s.cell,i):s.header&&(h=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0)))}else this._isLastRow(u+(d-1))||n&&-1!==this.m_endColEndHeader?-1!==this.m_endColEndHeader&&s?(h=this._getHeaderByIndex(this.m_trueIndex.column,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"columnEnd",h,this.m_columnEndHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0)):t||m(l,i):(t?(a=this.createIndex(u+1,_),this.extendSelection(a,i,e)):m(a=this.createIndex(u+d,this.m_trueIndex.column),i),this._isLastRow(u+d)&&this._setAccInfoText("accessibleLastRow"));break;case this.keyCodes.HOME_KEY:if(r)m(this.createIndex(0,0),i);else this.m_trueIndex.row||(this.m_trueIndex={row:u}),m(a=this.createIndex(this.m_trueIndex.row,0),i);break;case this.keyCodes.END_KEY:if(this.m_trueIndex.row||(this.m_trueIndex={row:u,column:_}),r){let e;e=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(Math.max(0,this.m_endRow),Math.max(0,this.m_endCol)):this.createIndex(Math.max(0,this.getDataSource().getCount("row")-1),Math.max(0,this.getDataSource().getCount("column")-1)),m(e,i)}else m(a=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(this.m_trueIndex.row,Math.max(0,this.m_endCol)):this.createIndex(this.m_trueIndex.row,Math.max(0,this.getDataSource().getCount("column")-1)),i);break;case this.keyCodes.PAGEUP_KEY:this.m_trueIndex.column||(this.m_trueIndex={column:_}),m(a=this.createIndex(0,_),i);break;case this.keyCodes.PAGEDOWN_KEY:this.m_trueIndex.column||(this.m_trueIndex={column:_}),m(a=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(Math.max(0,this.m_endRow),this.m_trueIndex.column):this.createIndex(Math.max(0,this.getDataSource().getCount("row")-1),this.m_trueIndex.column),i)}return!0}},A.prototype.scrollToIndex=function(e,t,i){var s,n,o=e.row,r=e.column;t&&(this.m_shouldFocus=!1),i&&(e.scrollToOrigin=!0);var l=this.getResources().isRTLMode()?"right":"left",a=0,h=0,d=this._getViewportTop(),c=this._getViewportBottom(),m=this._getViewportLeft(),u=this._getViewportRight();if(o<this.m_startRow||o>this.m_endRow){var _;_=o<this.m_startRow?this.m_avgRowHeight*o:this.m_avgRowHeight*(o+1)-c+d,h=this.m_currentScrollTop-_,this.m_scrollIndexAfterFetch=e,s=!0}else{var p;null===(n=this._getCellByIndex(e))?(n=this._getFirstCellWithMatchingStartIndex(o,"row"),p=this.m_sizingManager.getSize("row",this._getKey(n,"row"))):p=this.getElementHeight(n);var g=this.getElementDir(n,"top");i||e.scrollToOrigin?h=d-g:g+p>c?h=c-(g+p):g<d&&(h=d-g)}if(!isNaN(r)&&!0!==s)if(r<this.m_startCol||r>this.m_endCol){var f;f=r<this.m_startCol?this.m_avgColWidth*r:this.m_avgColWidth*(r+1)-u+m,a=this.m_currentScrollLeft-f,this.m_scrollIndexAfterFetch=e}else{var C;null===(n=this._getCellByIndex(e))?(n=this._getFirstCellWithMatchingStartIndex(r,"column"),C=this.m_sizingManager.getSize("column",this._getKey(n,"column"))):C=this.getElementWidth(n);var y=this.getElementDir(n,l);i||e.scrollToOrigin||y<m?a=m-y:y+C>u&&(a=u-(y+C))}0!==a||0!==h?(null!=(n=this._getCellByIndex(e))&&!0!==t&&!1!==this.m_shouldFocus&&(this.m_cellToFocus=n),this.scrollDelta(a,h)):null!=this.m_scrollIndexAfterFetch&&(t||!1===this.m_shouldFocus||this._setActiveByIndex(this.m_scrollIndexAfterFetch,null,!1,!1,!0))&&(this.m_scrollIndexAfterFetch=null)},A.prototype.scrollToHeader=function(e){var t,i,s,n,o,r,l,a,h,d=e.axis,c=e.index,m=e.level,u=0;"row"===d?(t=this.m_startRowHeader,i=this.m_endRowHeader,s=this.m_avgRowHeight,n=this.m_currentScrollTop,a=this._getViewportTop(),h=this._getViewportBottom()):"column"===d?(t=this.m_startColHeader,i=this.m_endColHeader,s=this.m_avgColWidth,n=this.m_currentScrollLeft,a=this._getViewportLeft(),h=this._getViewportRight()):"rowEnd"===d?(t=this.m_startRowEndHeader,i=this.m_endRowEndHeader,s=this.m_avgRowHeight,n=this.m_currentScrollTop,a=this._getViewportTop(),h=this._getViewportBottom()):"columnEnd"===d&&(t=this.m_startColEndHeader,i=this.m_endColEndHeader,s=this.m_avgColWidth,n=this.m_currentScrollLeft,a=this._getViewportLeft(),h=this._getViewportRight());var _=h-a;c<t||c>i?(u=n-(c<t?s*c:s*(c+1)-_),this.m_scrollHeaderAfterFetch=e):("row"===d||"rowEnd"===d?(l="row"===d?this._getHeaderByIndex(c,m,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader):this._getHeaderByIndex(c,m,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),o=this.getElementDir(l,"top"),r=this.getElementHeight(l)):"column"!==d&&"columnEnd"!==d||(l="column"===d?this._getHeaderByIndex(c,m,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader):this._getHeaderByIndex(c,m,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),o=this.getElementDir(l,this.getResources().isRTLMode()?"right":"left"),r=this.getElementWidth(l)),_>r?o+r>h?u=h-(o+r):o<a&&(u=a-o):u=a-o),0!==u?(null!=l&&!1!==this.m_shouldFocus&&(this.m_cellToFocus=l),"row"===d||"rowEnd"===d?this.scrollDelta(0,u):this.scrollDelta(u,0)):null!=this.m_scrollHeaderAfterFetch&&(this._updateActive(e,!0,!0),this.m_scrollHeaderAfterFetch=null)},A.prototype.findHeader=function(e,t,i){if(null==t&&(t=this.getMappedStyle("headercell")),null==i&&(i=this.getMappedStyle("endheadercell")),null!=t){if(this.m_utils.containsCSSClassName(e,t)||this.m_utils.containsCSSClassName(e,i))return e;if(e.parentNode)return this.findHeader(e.parentNode,t,i);if(e===this.m_root)return null}return null},A.prototype.updateRowBanding=function(){var e=this.m_options.getRowBandingInterval();if(e>0)for(var t=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getMappedStyle("banded"),s=0;s<t.length;s++){var n=t[s],o=this._getIndex(n,"row");Math.floor(o/e)%2==1?this.m_utils.containsCSSClassName(n,i)||this.m_utils.addCSSClassName(n,i):this.m_utils.containsCSSClassName(n,i)&&this.m_utils.removeCSSClassName(n,i)}},A.prototype.updateColumnBanding=function(){var e=this.m_options.getColumnBandingInterval();if(e>0)for(var t=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getMappedStyle("banded"),s=0;s<t.length;s+=1){var n=t[s],o=this._getIndex(n,"column");Math.floor(o/e)%2==1?this.m_utils.containsCSSClassName(n,i)||this.m_utils.addCSSClassName(n,i):this.m_utils.containsCSSClassName(n,i)&&this.m_utils.removeCSSClassName(n,i)}},A.prototype._removeBanding=function(){for(var e=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),t=this.getMappedStyle("banded"),i=0;i<e.length;i++)this.m_utils.containsCSSClassName(e[i],t)&&this.m_utils.removeCSSClassName(e[i],t)},A.prototype._setAccInfoText=function(e,t){var i=this.getResources().getTranslatedText(e,t);null!=i&&(this.m_accInfo.textContent=i)},A.prototype.handleExpandEvent=function(e,t){void 0===t&&this.queueModelEvent(e)?e.operation="expand":(this._setAccInfoText("accessibleRowExpanded"),this.populateAccInfo(),t&&this._runModelEventQueue())},A.prototype.handleCollapseEvent=function(e,t){void 0===t&&this.queueModelEvent(e)?e.operation="collapse":(this._setAccInfoText("accessibleRowCollapsed"),this.populateAccInfo(),t&&this._runModelEventQueue())},A.prototype._getKey=function(e,t){return null!=e&&e[this.getResources().getMappedAttribute("context")]?null!=t&&this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell"))?e[this.getResources().getMappedAttribute("context")].keys[t]:e[this.getResources().getMappedAttribute("context")].key:null},A.prototype._getActiveKey=function(e,t){if(t&&null!=this.m_prevActive){if("header"===this.m_prevActive.type&&(this.m_prevActive.axis===e||this.m_prevActive.axis===e+"End"))return this.m_prevActive.key;if("cell"===this.m_prevActive.type)return this.m_prevActive.keys[e]}else if(null!=this.m_active){if("header"===this.m_active.type&&(this.m_active.axis===e||this.m_active.axis===e+"End"))return this.m_active.key;if("cell"===this.m_active.type)return this.m_active.keys[e]}return null},A.prototype._handleCut=function(e,t){null==t&&(t=e.target);var i=this.findCellOrHeader(t);if(this._isMoveOnElementEnabled(i)){if(null!=this.m_cutCells)for(var s=0;s<this.m_cutCells.length;s++)this.m_utils.removeCSSClassName(this.m_cutCells[s],this.getMappedStyle("cut"));var n=this._getKey(i,"row");return this.m_cutCells=this._getAxisCellsByKey(n,"row"),this.m_cutRowHeader=this._findHeaderByKey(n,this.m_rowHeader,this.getMappedStyle("rowheadercell")),this.m_cutRowEndHeader=this._findHeaderByKey(n,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")),this._highlightCellsAlongAxis(n,"row","key","add",["cut"]),null!==this.m_cutRowHeader&&this.m_utils.addCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),null!==this.m_cutRowEndHeader&&this.m_utils.addCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),!0}return!1},A.prototype._handleCutCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&this.m_options.isCutEnabled()){this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]);let t=this.m_selection[this.m_selection.length-1];this.m_selectionRange=[t],this.m_dataTransferAction="cut";var i={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0]}};if(!this.fireEvent("cutRequest",i))return!0;this.highlightFloodFillRange(t),this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance()}return!0},A.prototype._handleCopyCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&this.m_options.isCopyEnabled()){this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]);let t=this.m_selection[this.m_selection.length-1];this.m_selectionRange=[t],this.m_dataTransferAction="copy";let i={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0]}};return!this.fireEvent("copyRequest",i)||(this.highlightFloodFillRange(t),this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance(),!0)}return!1},A.prototype._handlePaste=function(e,t){if(null==t&&(t=e.target),null!=this.m_cutCells){for(var i=0;i<this.m_cutCells.length;i++)this.m_utils.removeCSSClassName(this.m_cutCells[i],this.getMappedStyle("cut"));null!==this.m_cutRowHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),this.m_cutRowHeader=null),null!==this.m_cutRowEndHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),this.m_cutRowEndHeader=null);var s=this._getKey(this.findCellOrHeader(t),"row"),n=this._getKey(this.m_cutCells[0],"row");n!==s&&(this._isSelectionEnabled()&&this._clearSelection(e),this._isDatabodyCellActive()&&this._unhighlightActive(),this.m_moveActive=!0,this.getDataSource().move(n,s)),this.m_cutCells=null}return!0},A.prototype._handlePasteCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this.m_options.isPasteEnabled())if(this.m_selectionRange&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&1===this.m_selection.length){let t={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0],targetRange:this.m_selection[0]}};if(!this.fireEvent("pasteRequest",t))return!0;this.unhighlightFloodFillRange(this.m_selectionRange[0]),this.m_selectionRange=null,this.m_dataTransferAction=null}else if(!this.m_selectionRange){let t={event:e,ui:{action:"unknown",sourceRange:{},targetRange:this.m_selection[0]}};if(!this.fireEvent("pasteRequest",t))return!0;this.m_selectionRange=null,this.m_dataTransferAction=null}return!0},A.prototype._handleAutofill=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&this.m_options.isFloodFillEnabled()&&1===this.m_selection.length){let t="down";"keydown"===e.type&&(t="d"===e.key?"down":"end");let s=this.m_selection[0].startIndex,n=this.m_selection[0].endIndex,o=this.createRange(s,n),r=this.createRange(s,n),l=!1;if("down"===t?(o.endIndex.row=o.startIndex.row,r.startIndex.row=o.startIndex.row+1,r.startIndex.row>=o.startIndex.row&&r.startIndex.row<=r.endIndex.row&&(l=!0)):(o.endIndex.column=o.startIndex.column,r.startIndex.column=o.startIndex.column+1,r.startIndex.column>=o.startIndex.column&&r.startIndex.column<=r.endIndex.column&&(l=!0)),l){var i={event:e,ui:{action:t,sourceRange:o,targetRange:r}};if(!this.fireEvent("fillRequest",i))return!0}return this.unhighlightFloodFillRange(this.m_selection[0]),this._removeFloodFillAffordance(),this.m_selectionRange=null,this.m_dataTransferAction=null,this.m_floodFillDirection=null,!0}return!1},A.prototype._handleCancelReorder=function(e,t){if(null!=this.m_cutCells){for(var i=0;i<this.m_cutCells.length;i++)this.m_utils.removeCSSClassName(this.m_cutCells[i],this.getMappedStyle("cut"));return this.m_cutCells=null,null!==this.m_cutRowHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),this.m_cutRowHeader=null),null!==this.m_cutRowEndHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),this.m_cutRowEndHeader=null),!0}null!==this.m_dataTransferAction&&(this.unhighlightFloodFillRange(this.m_selectionRange[0]),this.m_selectionRange=null,this.m_dataTransferAction=null)},A.prototype._handleMove=function(e){if(null==this.m_moveCells){var t=e.target,i=this.findCellOrHeader(t),s=this._getKey(i,"row");this.m_originalMoveIndex=this._getIndex(i,"row"),this.m_moveIndex=this.m_originalMoveIndex,this.m_moveCells=this._getAxisCellsByIndex(this.m_moveIndex,"row"),this.m_moveRowHeader=this._findHeaderByKey(s,this.m_rowHeader,this.getMappedStyle("rowheadercell")),this.m_moveRowEndHeader=this._findHeaderByKey(s,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")),this._highlightCellsAlongAxis(this.m_moveIndex,"row","index","add",["drag"]),this.m_originalTop=this.getElementDir(this.m_moveCells[0],"top"),this.m_dropTarget=document.createElement("div"),this.m_utils.addCSSClassName(this.m_dropTarget,this.getMappedStyle("drop")),this.setElementHeight(this.m_dropTarget,this.calculateRowHeight(this.m_moveCells[0])),this.setElementDir(this.m_dropTarget,this.m_originalTop,"top"),this.m_databody.firstChild.appendChild(this.m_dropTarget),this._addHeaderDropTarget(this.m_moveRowHeader,this.m_rowHeader,!1),this._addHeaderDropTarget(this.m_moveRowEndHeader,this.m_rowEndHeader,!0)}this.m_utils.isTouchDevice()||(this.m_prevY=this.m_currentY,this.m_currentY=e.pageY);for(var n=this.m_currentY-this.m_prevY,o=this.calculateRowHeight(this.m_moveCells[0]),r=0;r<this.m_moveCells.length;r++)this.setElementDir(this.m_moveCells[r],this.getElementDir(this.m_moveCells[r],"top")+n,"top");null!==this.m_moveRowHeader&&this.setElementDir(this.m_moveRowHeader,this.getElementDir(this.m_moveRowHeader,"top")+n,"top"),null!==this.m_moveRowEndHeader&&this.setElementDir(this.m_moveRowEndHeader,this.getElementDir(this.m_moveRowEndHeader,"top")+n,"top");var l=this.m_moveIndex+1,a=this.m_moveIndex-1,h=this._getCellByIndex(this.createIndex(l,this.m_startCol)),d=this._getCellByIndex(this.createIndex(a,this.m_startCol));null!=h&&this.getElementDir(h,"top")<this.getElementDir(this.m_moveCells[0],"top")+o/2?this._moveDropRows("nextSibling",l):null!=d&&this.getElementDir(d,"top")>this.getElementDir(this.m_moveCells[0],"top")-o/2&&this._moveDropRows("previousSibling",a)},A.prototype._addHeaderDropTarget=function(e,t,i){var s;null!==e&&(null==e.style.height&&this.setElementHeight(e,this.calculateRowHeight(e)),this.m_utils.addCSSClassName(e,this.getMappedStyle("drag")),s=document.createElement("div"),this.m_utils.addCSSClassName(s,this.getMappedStyle("drop")),this.setElementHeight(s,this.calculateRowHeight(e)),this.setElementDir(s,this.m_originalTop,"top"),t.firstChild.appendChild(s),i?this.m_dropTargetEndHeader=s:this.m_dropTargetHeader=s)},A.prototype._moveDropRows=function(e,t){var i,s,n,o,r;"nextSibling"===e?(r=this._getAxisCellsByIndex(t,"row"),i=this.m_originalTop+this.calculateRowHeight(r[0]),s=this.m_originalTop):(r=this._getAxisCellsByIndex(t,"row"),s=(i=this.getElementDir(r[0],"top"))+this.calculateRowHeight(r[0])),this.setElementDir(this.m_dropTarget,i,"top");for(var l=0;l<r.length;l++)this.setElementDir(r[l],s,"top");null!==this.m_moveRowHeader&&(n=this.m_moveRowHeader.parentNode,this.setElementDir(this.m_dropTargetHeader,i,"top"),this.setElementDir(this.m_moveRowHeader[e],s,"top")),null!==this.m_moveRowEndHeader&&(o=this.m_moveRowEndHeader.parentNode,this.setElementDir(this.m_dropTargetEndHeader,i,"top"),this.setElementDir(this.m_moveRowEndHeader[e],s,"top")),this.m_originalTop=i,this._highlightCellsAlongAxis(this.m_moveIndex+1,"row","index","remove",["activedrop"]),"nextSibling"===e?(this._modifyAxisCellContextIndex("row",this.m_moveIndex,1,1),this._modifyAxisCellContextIndex("row",this.m_moveIndex+1,1,-1),this.m_moveIndex+=1,null!==this.m_moveRowHeader&&n&&n.insertBefore(this.m_moveRowHeader,this.m_moveRowHeader[e][e]),null!==this.m_moveRowEndHeader&&o&&o.insertBefore(this.m_moveRowEndHeader,this.m_moveRowEndHeader[e][e])):(this._modifyAxisCellContextIndex("row",this.m_moveIndex,1,-1),this._modifyAxisCellContextIndex("row",this.m_moveIndex-1,1,1),this.m_moveIndex-=1,null!==this.m_moveRowHeader&&n&&n.insertBefore(this.m_moveRowHeader,this.m_moveRowHeader[e]),null!==this.m_moveRowEndHeader&&o&&o.insertBefore(this.m_moveRowEndHeader,this.m_moveRowEndHeader[e])),this._refreshDatabodyMap(),this._highlightCellsAlongAxis(this.m_moveIndex+1,"row","index","add",["activedrop"])},A.prototype._isMoveEnabled=function(e){var t=this.getDataSource().getCapability("move");return"enable"===this.m_options.isMoveable("row")&&("full"===t||t===e)},A.prototype._handleMoveMouseUp=function(e,t){if(null!=this.m_moveCells){this._remove(this.m_dropTarget),null!==this.m_moveRowHeader&&this._remove(this.m_dropTargetHeader),null!==this.m_moveRowEndHeader&&this._remove(this.m_dropTargetEndHeader),null!=this.m_active&&"column"!==this.m_active.axis&&(this.m_moveActive=!0),this._isSelectionEnabled()&&this._clearSelection(e);var i=this.m_moveCells[0],s=this._getKey(i,"row");if(!0===t){var n=this.m_moveIndex+1,o=this._getKey(this._getCellByIndex(this.createIndex(n,this.m_startCol)),"row");this.getDataSource().move(s,o)}else this.getDataSource().move(s,s);this.m_moveCells=null,this.m_originalMoveIndex=null,this.m_moveIndex=null}this.m_databodyMove=!1},A.prototype._handleFloodFillMouseUp=function(e){if(this.m_floodFillRange&&this.m_floodFillRange.length){var t={event:e,ui:{action:this.m_floodFillDirection,sourceRange:this.m_selectionRange[0],targetRange:this.m_floodFillRange[0]}};if(!this.fireEvent("fillRequest",t))return!0;this.unhighlightFloodFillRange()}return this.m_selectionRange=null,this.m_floodFillRange=null,this.m_floodFillDirection=null,this.m_databody&&(this.m_databody.style.cursor="default"),this.m_cursor="default",!0},A.prototype._isMoveOnElementEnabled=function(e){return!(null==e||!this._isMoveEnabled("row")||this._getActiveKey("row")!==this._getKey(e,"row"))},A.prototype._manageMoveCursor=function(){if(!this._isDataGridProvider()){var e=this._getActiveKey("row"),t=this._getActiveKey("row",!0),i=this.getMappedStyle("draggable"),s=this.getMappedStyle("rowheadercell"),n=this.getMappedStyle("rowendheadercell");if(null!=t){this._highlightCellsAlongAxis(t,"row","key","remove",["draggable"]);var o=this._findHeaderByKey(t,this.m_rowHeader,s);this.m_utils.containsCSSClassName(o,i)&&this.m_utils.removeCSSClassName(o,i),o=this._findHeaderByKey(t,this.m_rowEndHeader,n),this.m_utils.containsCSSClassName(o,i)&&this.m_utils.removeCSSClassName(o,i)}if(null!=e){var r=this._getAxisCellsByKey(e,"row");if(this._isMoveOnElementEnabled(r[0])){this._highlightCellsAlongAxis(e,"row","key","add",["draggable"]);var l=this._findHeaderByKey(e,this.m_rowHeader,s);this.m_utils.addCSSClassName(l,i);var a=this._findHeaderByKey(e,this.m_rowEndHeader,n);this.m_utils.addCSSClassName(a,i)}}}},A.prototype.handleRootFocus=function(e,t){if(this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("focus")),this._clearFocusoutTimeout(),this._clearFocusoutBusyState(),!t){if(this._clearOpenPopupListeners(),!this.m_root.contains(document.activeElement)||document.activeElement===this.m_root&&0===this.m_root.tabIndex||document.activeElement===this.m_databody&&this.m_scrollbarFocus&&0===this.m_root.tabIndex){this.m_externalFocus=!0,this._isCellEditable()?this._setAccInfoText("accessibleEditableMode"):this._isGridEditable()&&this._setAccInfoText("accessibleNavigationMode");var i=!1;!0===this.m_scrollbarFocus&&(this.m_shouldFocus=!1,this.m_scrollbarFocus=!1,i=!0);let t=this._getEmptyElement();if(null==this.m_active&&t)this._setActive(t,{type:"empty"},e,null,null,i,!0);else if(null!=this.m_active||this._databodyEmpty())null!=this.m_active&&this._highlightActive();else{var s=this.createIndex(0,0);i||this.scrollToIndex(s),this._setActiveByIndex(s,e,null,null,i)}}this.m_root.tabIndex=-1}},A.prototype._handlePopupFocusout=function(e){this.handleRootBlur(e,!0)},A.prototype._handlePopupFocusin=function(e){this.handleRootFocus(e,!0)},A.prototype.handleRootBlur=function(e,t){if(this._clearFocusoutTimeout(),!t){this._clearOpenPopupListeners();var i=f.getLogicalChildPopup(this.m_root);if(null!=i)return this._openPopup=i,t=!1,this._handlePopupFocusinListener=this._handlePopupFocusin.bind(this),this._handlePopupFocusoutListener=this._handlePopupFocusout.bind(this),i.addEventListener("focusin",this._handlePopupFocusinListener),void i.addEventListener("focusout",this._handlePopupFocusoutListener)}this._setFocusoutBusyState(),this.m_focusoutTimeout=setTimeout(function(){if(!this.m_root.contains(document.activeElement)||!0===t){this.m_root.tabIndex=0;var i=this._getActiveElement();null!=i&&(this._unsetAriaProperties(i),this._isEditOrEnter()&&!this.m_animating&&this._leaveEditing(e,i,!1,!1))}this._clearFocusoutBusyState()}.bind(this),100),null==this.m_moveRow&&this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("focus"))},A.prototype._clearOpenPopupListeners=function(){null!=this._openPopup&&(this._openPopup.removeEventListener("focusin",this._handlePopupFocusinListener),this._openPopup.removeEventListener("focusout",this._handlePopupFocusoutListener),this._openPopup=null),this._handlePopupFocusinListener=null,this._handlePopupFocusoutListener=null},A.prototype._handlePopupFocusout=function(e){this.handleRootBlur(e,!0)},A.prototype._handlePopupFocusin=function(e){this.handleRootFocus(e,!0)},A.prototype._clearFocusoutTimeout=function(){this.m_focusoutTimeout&&(clearTimeout(this.m_focusoutTimeout),this.m_focusoutTimeout=null)},A.prototype._setFocusoutBusyState=function(){if(!this.m_focusoutResolveFunc){var e=m.getContext(this.m_root).getBusyContext(),t={description:"Datagrid component 'is handling focusout."};this.m_focusoutResolveFunc=e.addBusyState(t)}},A.prototype._clearFocusoutBusyState=function(){this.m_focusoutResolveFunc&&(this.m_focusoutResolveFunc(),this.m_focusoutResolveFunc=null)},A.prototype.calculateRowHeight=function(e){return""!==e.style.height?this.getElementHeight(e):null!=e.nextSibling?this.getElementDir(e.nextSibling,"top")-this.getElementDir(e,"top"):this.m_endRowPixel-this.getElementDir(e,"top")},A.prototype.calculateRowHeaderHeight=function(e){return""!==e.style.height?this.getElementHeight(e):null!=e.nextSibling?this.getElementDir(e.nextSibling,"top")-this.getElementDir(e,"top"):this.m_endRowHeaderPixel-this.getElementDir(e,"top")},A.prototype.calculateRowHeaderLabelHeight=function(e){return this.getElementHeight(e)},A.prototype.calculateColumnWidth=function(e){if(""!==e.style.width)return this.getElementWidth(e);var t=this.getResources().isRTLMode()?"right":"left";return null!=e.nextSibling?this.getElementDir(e.nextSibling,t)-this.getElementDir(e,t):this.m_endColPixel-this.getElementDir(e,t)},A.prototype.calculateColumnHeaderWidth=function(e){if(""!==e.style.width)return this.getElementWidth(e);var t=this.getResources().isRTLMode()?"right":"left";return null!=e.nextSibling?this.getElementDir(e.nextSibling,t)-this.getElementDir(e,t):this.m_endColHeaderPixel-this.getElementDir(e,t)},A.prototype._databodyEmpty=function(){return null==this.m_databody.firstChild||null==this.m_databody.firstChild.firstChild},A.prototype._databodyEmptyState=function(){return!(null!=this.m_databody.firstChild&&null!=this.m_databody.firstChild.firstChild&&!this._getEmptyElement())},A.prototype._getEmptyElement=function(){let e=this.m_databody.querySelector("."+this.getMappedStyle("noDataContainer")),t=this.m_databody.querySelector("."+this.getMappedStyle("emptytext"));return e||t},A.prototype.changeStyleProperty=function(e,t,i,s){void 0!==t&&(e.style[t]="remove"===s?"":i)},A.prototype.addTransformMoveStyle=function(e,t,i,s,n,o,r){this.changeStyleProperty(e,this.getCssSupport("transition-delay"),i),this.changeStyleProperty(e,this.getCssSupport("transition-timing-function"),s),this.changeStyleProperty(e,this.getCssSupport("transition-duration"),t),this.changeStyleProperty(e,this.getCssSupport("transform"),"translate3d("+n+"px,"+o+"px,"+r+"px)")},A.prototype.removeTransformMoveStyle=function(e){this.changeStyleProperty(e,this.getCssSupport("transition-delay"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transition-timing-function"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transition-duration"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transform"),null,"remove")},A.prototype.getCssSupport=function(e){var t=["","-moz-","-webkit-","-o-","-ms-","-khtml-"],i=document.documentElement;for(var s=0;s<t.length;s++){var n=(t[s]+e).replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()});if("Ms"===n.substr(0,2)&&(n="m"+n.substr(1)),n in i.style)return n}},A.prototype._refreshDatabodyMap=function(){this._clearDatabodyMap(),this._addNodesToDatabodyMap(this.m_databody.firstChild.childNodes)},A.prototype._populateDatabody=function(e,t){this._addNodesToDatabodyMap(t.childNodes),e.appendChild(t),this.m_subtreeAttachedCallback(e)},A.prototype._emptyDatabody=function(e){this._clearDatabodyMap(),this.m_utils.empty(e)},A.prototype._addNodesToDatabodyMap=function(e){for(var t=0;t<e.length;t++){var i=e[t];if(this.m_utils.containsCSSClassName(i,this.getMappedStyle("cell"))){var s=this.getCellIndexes(i),n=this.getCellExtents(i),o=i.id;this._addToDatabodyMap(s,o,n)}}},A.prototype._addToDatabodyMap=function(e,t,i){for(var s=i.row,n=i.column,o=0;o<s;o++)for(var r=0;r<n;r++)this._addIndexToDatabodyMap(this.createIndex(e.row+o,e.column+r),t)},A.prototype._addIndexToDatabodyMap=function(e,t){var i="r"+e.row+"c"+e.column;this.m_databodyMap.set(i,t)},A.prototype._removeIndexFromDatabodyMap=function(e){var t="r"+e.row+"c"+e.column;return this.m_databodyMap.delete(t)},A.prototype._getFromDatabodyMap=function(e){var t="r"+e.row+"c"+e.column;return this.m_databodyMap.get(t)},A.prototype._clearDatabodyMap=function(){return this.m_databodyMap.clear()},A.prototype._modifyAxisCellContextIndex=function(e,t,i,s){for(var n=t;n<t+i;n++)for(var o=this._getAxisCellsByIndex(n,e),r=0;r<o.length;r++){o[r][this.getResources().getMappedAttribute("context")].indexes[e]+=s}},A.prototype._modifyAxisHeaderContextIndex=function(e,t,i,s){for(var n=t;n<t+i;n++){var o;o="row"===e?this._getHeadersByIndex(n,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader):this._getHeadersByIndex(n,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader);for(var r=0;r<o.length;r++){o[r][this.getResources().getMappedAttribute("context")].index+=s}}},A.prototype._getCellOrHeaderByIndex=function(e,t){var i=null,s=this._getAxisCellsByIndex(e,t,!0);return null!=s&&s.length>0&&(i=s[0]),null==i&&("row"===t&&null==(i=this._getHeaderByIndex(e,0,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader))&&(i=this._getHeaderByIndex(e,0,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader)),"column"===t&&null==(i=this._getHeaderByIndex(e,0,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader))&&(i=this._getHeaderByIndex(e,0,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader))),i},A.prototype._getLabel=function(e,t){return this.m_headerLabels[e][t]},A.prototype._getCellByIndex=function(e){var t=this._getFromDatabodyMap(e);return null!=t?this.m_databody.querySelector("#"+t):null},A.prototype._getCellsInRange=function(e,t,i,s){let n=[];for(let o=e;o<=i;o++)for(let e=t;e<=s;e++){let t=this._getCellByIndex(this.createIndex(o,e));t&&n.push(t)}return n},A.prototype._getFirstCellWithMatchingStartIndex=function(e,t){let i,s,n="row"===t?this.m_startCol:this.m_startRow,o="row"===t?this.m_endCol:this.m_endRow;for(let r=n;r<=o;r++)if(i=this.createIndex("row"===t?e:r,"row"===t?r:e),s=this._getCellByIndex(i),this._getIndex(s,t)===e)return s;return null},A.prototype._getAxisCellsByIndex=function(e,t,i){for(var s,n="row"===t?this.m_startCol:this.m_startRow,o="row"===t?this.m_endCol:this.m_endRow,r=[],l=n;l<=o;l+=s){var a=this._getCellByIndex(this.createIndex("row"===t?e:l,"row"===t?l:e));if(null!=a){if(s=this.getCellExtents(a)["row"===t?"column":"row"],r.push(a),i)break}else s=1}return r},A.prototype._getAxisCellsByKey=function(e,t,i){if(null==e||null==this.m_databody||null==this.m_databody.firstChild)return null;for(var s=[],n=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),o=0;o<n.length;o++){var r=n[o];if(this.m_utils.containsCSSClassName(r,this.getMappedStyle("cell")))if(this._getKey(r,t)===e&&(s.push(r),i))break}return s},A.prototype._setupActions=function(){this.actions={ACTIONABLE:this._handleActionable,EXIT_ACTIONABLE:this._handleExitActionable,TAB_NEXT_IN_CELL:u.handleActionableTab,TAB_PREV_IN_CELL:u.handleActionablePrevTab,EDITABLE:this._handleEditable,EXIT_EDITABLE:this._handleExitEditable,DATA_ENTRY:this._handleDataEntry,EXIT_DATA_ENTRY:this._handleExitDataEntry,EDIT:this._handleEdit,EXIT_EDIT:this._handleExitEdit,CANCEL_EDIT:this._handleCancelEdit,NO_OP:this._handleNoOp,FOCUS_LEFT:this._handleFocusLeft,FOCUS_LEFT_NON_EMPTY_CELL:this._handleFocusLeftNonEmptyCell,FOCUS_RIGHT:this._handleFocusRight,FOCUS_RIGHT_NON_EMPTY_CELL:this._handleFocusRightNonEmptyCell,FOCUS_UP:this._handleFocusUp,FOCUS_UP_NON_EMPTY_CELL:this._handleFocusUpNonEmptyCell,FOCUS_DOWN:this._handleFocusDown,FOCUS_DOWN_NON_EMPTY_CELL:this._handleFocusDownNonEmptyCell,FOCUS_ROW_FIRST:this._handleFocusRowFirst,FOCUS_ROW_LAST:this._handleFocusRowLast,FOCUS_COLUMN_FIRST:this._handleFocusColumnFirst,FOCUS_COLUMN_LAST:this._handleFocusColumnLast,FOCUS_COLUMN_HEADER:this._handleFocusColumnHeader,FOCUS_COLUMN_END_HEADER:this._handleFocusColumnEndHeader,FOCUS_ROW_HEADER:this._handleFocusRowHeader,FOCUS_ROW_END_HEADER:this._handleFocusRowEndHeader,FOCUS_FIRST_CELL_IN_GRID:this._handleFocusFirstCellInGrid,FOCUS_LAST_CELL_IN_GRID:this._handleFocusLastCellInGrid,READ_CELL:this.readCurrentContent,SORT:this._handleSortKey,EXPAND:this._handleExpandKey,COLLAPSE:this._handleCollapseKey,SELECT_DISCONTIGUOUS:this._handleSelectDiscontiguous,SELECT_EXTEND_LEFT:this._handleExtendSelectionLeft,SELECT_EXTEND_RIGHT:this._handleExtendSelectionRight,SELECT_EXTEND_UP:this._handleExtendSelectionUp,SELECT_EXTEND_DOWN:this._handleExtendSelectionDown,SELECT_ROW:this._handleSelectRow,SELECT_COLUMN:this._handleSelectColumn,SELECT_ALL:this._handleSelectAll,CUT:this._handleCut,CUT_CELLS:this._handleCutCells,COPY_CELLS:this._handleCopyCells,CANCEL_REORDER:this._handleCancelReorder,PASTE:this._handlePaste,PASTE_CELLS:this._handlePasteCells,FILL:this._handleAutofill,CANCEL_DRAG:this.handleCancelDrag}},A.prototype._getActionFromKeyDown=function(e,t,i){var s={cellOrHeader:t,isLabel:i,readOnly:!this._isCellEditable(),currentMode:this._getCurrentMode(),activeMove:null!=this.m_cutCells||null!=this.m_dataTransferAction,rowMove:this._isMoveEnabled("row"),columnSort:"column"===t&&this._isDOMElementSortable(this._getActiveElement()),rowSort:"row"===t&&this._isDOMElementSortable(this._getActiveElement()),selection:this._isSelectionEnabled(),selectionMode:this.m_options.getSelectionMode(),multipleSelection:this.isMultipleSelection(),expandCollapse:this._isTargetExpandCollapseEnabled(e.target)};return this._isDataGridProvider()&&(s.cutCells=!0,s.copyCells=!0,s.pasteCells=!0,s.activeDrag=!(!this._cellsDragged||!this._cellsDragged.length)),this.m_options.isFloodFillEnabled()&&(s.fill=!0),this.actions[this.m_keyboardHandler.getAction(e,s)]},A.prototype._getActionFromNoDataKeydown=function(e){var t={readOnly:!this._isCellEditable(),currentMode:this._getCurrentMode()};return this.actions[this.m_keyboardHandler.getNoDataAction(e,t)]},A.prototype.isActionableMode=function(){return"actionable"===this.m_currentMode},A.prototype.setActionableMode=function(e){this.m_currentMode=e?"actionable":"navigation",this._setAccInfoText(this.isActionableMode()?"accessibleActionableMode":"accessibleNavigationMode")},A.prototype._handleActionable=function(e,t){return this._enterActionableMode(t,e),!1},A.prototype._handleExitActionable=function(e,t){return this._exitActionableMode(),this._highlightActive(),!1},A.prototype._getEditMode=function(){return null==this.m_editMode&&(this.m_editMode=this.m_options.getEditMode()),this.m_editMode},A.prototype._getCurrentMode=function(){return null==this.m_currentMode&&(this.m_currentMode="navigation"),this.m_currentMode},A.prototype._isEditOrEnter=function(){return"edit"===this._getCurrentMode()},A.prototype._isGridEditable=function(){var e=this._getEditMode();return"cellNavigation"===e||"cellEdit"===e},A.prototype._isCellEditable=function(){return"cellEdit"===this._getEditMode()},A.prototype._handleEditable=function(e,t){return this._isGridEditable()?(this.m_editMode=null,this.m_setOptionCallback("editMode","cellEdit",{_context:{writeback:!0,internalSet:!0}}),this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("editable")),this._updateEdgeCellBorders(""),this._setAccInfoText("accessibleEditableMode"),this._setEditableClone(t)):this._handleActionable(e,t),!1},A.prototype._handleExitEditable=function(e,t){this.m_editMode=null,this.m_setOptionCallback("editMode","cellNavigation",{_context:{writeback:!0,internalSet:!0}}),this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("editable")),this._updateEdgeCellBorders("none"),this._setAccInfoText("accessibleNavigationMode"),this._destroyEditableClone()},A.prototype._handleDataEntry=function(e,t){var i={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")]}};return this.fireEvent("beforeEdit",i)&&(this._removeFloodFillAffordance(),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),this.m_editableClone),this._overwriteFlag=!0,this._setFocusToFirstFocusableElement(t)?this.m_currentMode="edit":this.m_utils.removeCSSClassName(t,this.getMappedStyle("cellEdit")),this._overwriteFlag=!1),!1},A.prototype._handleExitDataEntry=function(e,t){return this._leaveEditing(e,t,!1)},A.prototype._handleEdit=function(e,t){var i={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")]}},s=this.fireEvent("beforeEdit",i);if(s){this._removeFloodFillAffordance(),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),this.m_editableClone),this.m_currentMode="edit";var n=this;m.getContext(t).getBusyContext().whenReady().then(function(){n._setFocusToFirstFocusableElement(t)||(n.m_utils.removeCSSClassName(t,n.getMappedStyle("cellEdit")),n.m_currentMode="navigation")})}else s=!1,this._enterActionableMode(t);return s},A.prototype._handleExitEdit=function(e,t){return this._leaveEditing(e,t,!1)},A.prototype._handleCancelEdit=function(e,t){return!!this._leaveEditing(e,t,!0)&&(this._setEditableClone(t),!0)},A.prototype._leaveEditing=function(e,t,i,s){var n={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")],cancelEdit:i}};i||(u.disableAllFocusableElements(t),!1===s&&(this.m_shouldFocus=s),this._highlightActive());var o=this.fireEvent("beforeEditEnd",n);return o?(this.m_currentMode="navigation",u.disableAllFocusableElements(t),!1===s&&(this.m_shouldFocus=s),this._highlightActive(),this._reRenderCell(t,"navigation",this.getMappedStyle("cellEdit"),this.m_editableClone)):(o=!1,this._scrollToActive(this.m_active),this._setFocusToFirstFocusableElement(t)),o},A.prototype._handleFocusKey=function(e,t,i,s,n,o,r){var l,a=!0,h=!0;if(null!=this.m_active){if("cell"===this.m_active.type){if(this._isEditOrEnter()?(l=!0,a=this._leaveEditing(e,t,!1),h=!1):this.isActionableMode()&&this._exitActionableMode(),a){this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance();var d=this.m_active,c=this.handleFocusChange(i,s,e,h,n,o,r);return this._isGridEditable()&&d!==this.m_active&&l&&this.m_utils.isTouchDevice()?this._handleDataEntry(e,this._getActiveElement()):c}return!0}if("header"===this.m_active.type)return this.handleHeaderFocusChange(i,e,s,n,o);if("label"===this.m_active.type)return this.handleLabelFocusChange(i,e,s,n);if("empty"===this.m_active.type)return this.handleNoDataFocusChange(i,s,e,h)}return!1},A.prototype._handleFocusLeft=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!1)},A.prototype._handleFocusLeftNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!1,!0)},A.prototype._handleFocusRight=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!1)},A.prototype._handleFocusRightNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!1,!0)},A.prototype._handleFocusUp=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!1)},A.prototype._handleFocusUpNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!1,!0)},A.prototype._handleFocusDown=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!1)},A.prototype._handleFocusDownNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!1,!0)},A.prototype._handleFocusRowFirst=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.PAGEUP_KEY,!1,!1)},A.prototype._handleFocusRowLast=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.PAGEDOWN_KEY,!1,!1)},A.prototype._handleFocusColumnFirst=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.HOME_KEY,!1,!1)},A.prototype._handleFocusColumnLast=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.END_KEY,!1,!1)},A.prototype._handleFocusRowHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!0)},A.prototype._handleFocusRowEndHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!0)},A.prototype._handleFocusColumnHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!0)},A.prototype._handleFocusColumnEndHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!0)},A.prototype._handleFocusFirstCellInGrid=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.HOME_KEY,!1,!1,!1,!0)},A.prototype._handleFocusLastCellInGrid=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.END_KEY,!1,!1,!1,!0)},A.prototype._handleSelectRow=function(e,t){var i,s,n,o,r=1;if(!this._isSelectionEnabled()||!this.isMultipleSelection()&&"row"!==this.m_options.getSelectionMode())return!1;if(this.m_utils.containsCSSClassName(t,this.getMappedStyle("cell")))i=o=this.m_active.indexes.row,s=o,n=this.m_rowHeaderLevelCount-1;else{if(null==this.m_active||"header"!==this.m_active.type||-1===this.m_active.axis.indexOf("row"))return!1;if(o=this.m_active.index,n=this.m_active.level,this.m_rowHeaderLevelCount-1===n)i=o,s=o;else{var l=this._getActiveElement();s=(i=this._getAttribute(l.parentNode,"start",!0))+(r=this._getAttribute(l.parentNode,"extent",!0))-1}}if(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("column"))return this._handleSelectAll(e),!0;if(this.setHeaderSelectionFrontier("row",s,o,n,t,!0),this._shouldDeselectHeader(o,r,"row")){var a=this.createIndex(o,0),h=this.createIndex(o+r-1,-1),d=this._getSelectionStartAndEnd(a,h,0),c=this.createRange(this.createIndex(d.min.row,0),this.createIndex(d.max.row,-1)),m=this._trimRangeForSelectionMode(c);return this.m_deselectInfo={selection:this.GetSelection()},this._deselectRange(m,e),!0}return this._selectEntireRow(i,s,e),this._setAccInfoText("accessibleRowSelected",{row:o+1}),!0},A.prototype._handleSelectColumn=function(e,t){var i,s,n,o,r=1;if(!this._isSelectionEnabled()||!this.isMultipleSelection()||"cell"!==this.m_options.getSelectionMode())return!1;if(this.m_utils.containsCSSClassName(t,this.getMappedStyle("cell")))i=o=this.m_active.indexes.column,s=o,n=this.m_columnHeaderLevelCount-1;else{if(null==this.m_active||"header"!==this.m_active.type||-1===this.m_active.axis.indexOf("column"))return!1;if(o=this.m_active.index,n=this.m_active.level,this.m_columnHeaderLevelCount-1===n)i=o,s=o;else{var l=this._getActiveElement();s=(i=this._getAttribute(l.parentNode,"start",!0))+(r=this._getAttribute(l.parentNode,"extent",!0))-1}}if(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("row"))return this._handleSelectAll(e),!0;if(this.setHeaderSelectionFrontier("column",s,o,n,t,!0),this._shouldDeselectHeader(o,r,"column")){var a=this.createIndex(0,o),h=this.createIndex(-1,o+r-1),d=this._getSelectionStartAndEnd(a,h,0),c=this.createRange(this.createIndex(0,d.min.column),this.createIndex(-1,d.max.column)),m=this._trimRangeForSelectionMode(c);return this.m_deselectInfo={selection:this.GetSelection()},this._deselectRange(m,e),!0}return this._selectEntireColumn(i,s,e),this._setAccInfoText("accessibleColumnSelected",{column:o+1}),!0},A.prototype._handleSelectDiscontiguous=function(e,t){return this.setDiscontiguousSelectionMode(!this.m_discontiguousSelection),!0},A.prototype._handleExtendSelectionLeft=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!0,!1)},A.prototype._handleExtendSelectionRight=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!0,!1)},A.prototype._handleExtendSelectionUp=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!0,!1)},A.prototype._handleExtendSelectionDown=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!0,!1)},A.prototype._handleSortKey=function(e,t){return"true"===t.getAttribute(this.getResources().getMappedAttribute("sortable"))?(this._handleKeyboardSort(t,e),!0):this._handleActionable(e,t)},A.prototype._handleExpandKey=function(e,t){return!!this._isHeaderCollapsed(t)&&(this._handleExpandCollapseRequest(e),!0)},A.prototype._handleCollapseKey=function(e,t){return!!this._isHeaderExpanded(t)&&(this._handleExpandCollapseRequest(e),!0)},A.prototype._handleNoOp=function(e,t){return!1},A.RESIZE_OFFSET=5,A.RESIZE_TOUCH_OFFSET=8,A.prototype.handleResize=function(e){if(!1===this.m_isResizing){var t=this.find(e.target,"header"),i=this.find(e.target,"headerlabel");if(null==t&&(t=this.find(e.target,"endheader")),null!=t&&(t===this.m_rowHeader||t===this.m_colHeader||t===this.m_rowEndHeader||t===this.m_colEndHeader)||null!=i){let s=!1;i&&(s=!0),this.m_cursor=this.manageHeaderCursor(e,s),null!=this.m_resizingElement&&("default"===this.m_cursor?(this.m_resizingElement.style.cursor="",this._isSelectionEnabled()&&(t&&this.shouldHoverHeader(t)||i)&&this.m_utils.addCSSClassName(e.target,this.getMappedStyle("hover")),null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor="")):(this.m_resizingElement.style.cursor=this.m_cursor,this.m_utils.removeCSSClassName(e.target,this.getMappedStyle("hover")),null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor=this.m_cursor)))}}else this.handleResizeMouseMove(e)},A.prototype.handleResizeMouseDown=function(e){return("col-resize"===this.m_cursor||"row-resize"===this.m_cursor)&&(this.m_isResizing=!0,this.m_utils.isTouchDevice()?(this.m_lastMouseX=e.touches[0].pageX,this.m_lastMouseY=e.touches[0].pageY):(document.addEventListener("mousemove",this.m_docMouseMoveListener,!1),document.addEventListener("mouseup",this.m_docMouseUpListener,!1),this.m_lastMouseX=e.pageX,this.m_lastMouseY=e.pageY),this.m_overResizeLeft=0,this.m_overResizeMinLeft=0,this.m_overResizeTop=0,this.m_overResizeMinTop=0,this.m_overResizeRight=0,this.m_overResizeBottom=0,this.m_orginalResizeDimensions={width:this.getElementWidth(this.m_resizingElement),height:this.getElementHeight(this.m_resizingElement)},!0)},A.prototype._resizeSelectedHeaders=function(e,t,i,s,n,o){let r,l=this.m_resizingElement,a=this.getHeaderCellAxis(this.m_resizingElement),h=this.getHeaderCellIndex(this.m_resizingElement),d=this._getResizeHeaderMode(this.m_resizingElement),c=this.getHeaderCellLevel(this.m_resizingElement),m=!1;if(("column"===a&&c===this.m_columnHeaderLevelCount-1||"row"===a&&c===this.m_rowHeaderLevelCount-1||"columnEnd"===a&&c===this.m_columnEndHeaderLevelCount-1||"rowEnd"===a&&c===this.m_rowEndHeaderLevelCount-1)&&(m=!0),this.m_selection&&this.m_selection.length&&m&&!this.m_discontiguousSelection&&(r=this._getHeadersWithinSelection(this.m_selection[0],h,a)),r&&r.length)for(let a=0;a<r.length;a++)l!==r[a]&&(this.m_resizingElement=r[a],"column"===d?this.resizeColWidth(this.getElementDir(r[a],"width"),s):this.resizeRowHeight(this.getElementDir(r[a],"height"),n)),this._fireResizeEvent(e,t,i,s,n,o);else"column"===d?this.resizeColWidth(this.getElementDir(this.m_resizingElement,"width"),s):this.resizeRowHeight(this.getElementDir(this.m_resizingElement,"height"),n),this._fireResizeEvent(e,t,i,s,n,o)},A.prototype._fireResizeEvent=function(e,t,i,s,n,o){let r={event:e,ui:{header:this._getKey(this.m_resizingElement),oldDimensions:{width:t,height:i},newDimensions:{width:s,height:n},size:o}};this.fireEvent("resize",r)},A.prototype.handleResizeMouseUp=function(e){if(!0===this.m_isResizing){var t=this.getElementWidth(this.m_resizingElement),i=this.getElementHeight(this.m_resizingElement);let s=this.m_orginalResizeDimensions.width,n=this.m_orginalResizeDimensions.height,o=this.m_resizingElement,r="col-resize"===this.m_cursor?o.style.width:o.style.height;t===this.m_orginalResizeDimensions.width&&i===this.m_orginalResizeDimensions.height||"col-resize"!==this.m_cursor&&"row-resize"!==this.m_cursor||this._resizeSelectedHeaders(e,s,n,t,i,r),o.style.cursor="",this._unhighlightResizeBorderColor(),this.m_isResizing=!1,this.m_cursor="default",null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor=""),this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_resizingElementSibling=null,this.m_orginalResizeDimensions=null,document.removeEventListener("mousemove",this.m_docMouseMoveListener,!1),document.removeEventListener("mouseup",this.m_docMouseUpListener,!1)}},A.prototype._isDOMElementResizable=function(e){return null!=e&&"true"===e.getAttribute(this.getResources().getMappedAttribute("resizable"))},A.prototype.manageHeaderCursor=function(e,t){var i,s,n,o,r,l,a,h,d;if((d=t?this.find(e.target,"headerlabel"):this.find(e.target,"headercell"))||t||(d=this.find(e.target,"endheadercell")),!d)return"default";var c=t?this.getHeaderLabelAxis(d):this.getHeaderCellAxis(d),m=t?this.getHeaderLabelLevel(d):this.getHeaderCellIndex(d),u=t?m:this.getHeaderCellLevel(d);if("column"===c?(r="enable"===this.m_options.isResizable(c,"height"),o=this._isDOMElementResizable(d),t?(a=null,l=null,h=this.m_headerLabels.column[m-1]):((a=this._getHeaderByIndex(m-1,u,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader))||(this.m_headerLabels.column.length?(a=this._getLabel("column",u),u===this.m_columnHeaderLevelCount-1&&this._isHeaderLabelCollision()&&(a=this.m_headerLabels.row[this.m_rowHeaderLevelCount-1])):a=this._getLabel("row",u)),l=this._isDOMElementResizable(a),h=this._getHeaderByIndex(m,u-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader))):"row"===c?(o="enable"===this.m_options.isResizable(c,"width"),r=t?"enable"===this.m_options.isResizable(c,"height"):this._isDOMElementResizable(d),t?(h=this.m_headerLabels.row[m-1],this._isHeaderLabelCollision()&&d===this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]&&(a=this.m_headerLabels.column[this.m_columnHeaderLevelCount-1])):(a=this._getHeaderByIndex(m-1,u,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),l=this._isDOMElementResizable(a),h=this._getHeaderByIndex(m,u-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader))):"columnEnd"===c?(r="enable"===this.m_options.isResizable(c).height,o=this._isDOMElementResizable(d),t?(a=null,l=null,h=this.m_headerLabels.columnEnd[m-1]):((a=this._getHeaderByIndex(m-1,u,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader))||(a=this._getLabel("columnEnd",u)),l=this._isDOMElementResizable(a),h=this._getHeaderByIndex(m,u-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader))):"rowEnd"===c&&(o="enable"===this.m_options.isResizable(c).width,r=this._isDOMElementResizable(d),t?(a=this.m_headerLabels.rowEnd[m-1],l=this._isDOMElementResizable(a)):(a=this._getHeaderByIndex(m-1,u,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),l=this._isDOMElementResizable(a),h=this._getHeaderByIndex(m,u-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader))),this.m_utils.isTouchDevice())i=e.touches[0].pageX,s=e.touches[0].pageY,n=A.RESIZE_TOUCH_OFFSET;else{i=e.offsetX,s=e.offsetY,n=A.RESIZE_OFFSET;var _=this._findHeaderOffset(e.target,d);i+=_[0],s+=_[1]}var p=this.getHeaderEdgePixels(d),g=this.getResources().isRTLMode(),f="columnEnd"===c||"rowEnd"===c,C=i<p[0]+n,y=s<p[1]+n,v=i>p[2]-n,E=s>p[3]-n;if("column"===c||"columnEnd"===c){if(o&&(g?C:v))return this.m_resizingElement=d,"col-resize";if(l&&(g?v:C)){if(this.m_resizingElement=a,this.m_resizingElementSibling=d,null!==this.m_resizingElement)return"col-resize"}else if(r){if(!f&&E||f&&y)return this.m_resizingElement=d,"row-resize";if(!f&&y||f&&E)return this.m_resizingElement=h,this.m_resizingElementSibling=d,"row-resize"}}else if("row"===c||"rowEnd"===c){if(r&&E)return this.m_resizingElement=d,"row-resize";if(l&&y&&!t){if(this.m_resizingElement=a,this.m_resizingElementSibling=d,null!==this.m_resizingElement)return"row-resize"}else if(h&&y&&t&&a&&(this.m_resizingElement=h,this.m_resizingElementSibling=d,null!==this.m_resizingElement))return"row-resize";if(o){if(!f&&(g?C:v)||f&&(g?v:C))return this.m_resizingElement=d,"col-resize";if((!f&&(g?v:C)||f&&(g?C:v))&&(this.m_resizingElement=h,this.m_resizingElementSibling=d,null!==this.m_resizingElement))return"col-resize"}}return"default"},A.prototype.handleResizeMouseMove=function(e){var t,i,s,n,o;this.m_currentMouseX=e.pageX,this.m_currentMouseY=e.pageY,this.m_utils.isTouchDevice()?(this.m_currentMouseX=e.touches[0].pageX,this.m_currentMouseY=e.touches[0].pageY):(this.m_currentMouseX=e.pageX,this.m_currentMouseY=e.pageY),t=this._getResizeHeaderMode(this.m_resizingElement);var r=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"));let l=this.find(this.m_resizingElement,"headerlabel");"col-resize"===this.m_cursor?"column"===t?(r=!l&&r,i=this.calculateColumnHeaderWidth(this.m_resizingElement),s=this.getNewElementWidth("column",i,r,null,l),l?this.resizeRowWidth(s,s-i,r,l):this.resizeColWidth(i,s)):"row"===t&&(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(r=!0),i=this.getElementWidth(this.m_resizingElement),s=this.getNewElementWidth("row",i,r,null,l),this.resizeRowWidth(s,s-i,r,l)):"row-resize"===this.m_cursor&&("row"===t?(n=this.calculateRowHeaderHeight(this.m_resizingElement),o=this.getNewElementHeight("row",n,r,null,l),l?this.resizeColHeight(o,o-n,r):this.resizeRowHeight(n,o)):"column"===t&&(n=this.getElementHeight(this.m_resizingElement),o=this.getNewElementHeight("column",n,r,null,l),this.resizeColHeight(o,o-n,r))),this.buildCorners(),this.m_utils.isTouchDevice()&&this._moveTouchSelectionAffordance(),this.m_lastMouseX=this.m_currentMouseX,this.m_lastMouseY=this.m_currentMouseY},A.prototype.resizeColWidth=function(e,t){var i,s=t-e;if(0!==s){if(null!=this.m_databody.firstChild)i=this.getElementWidth(this.m_databody.firstChild)+s,this.setElementWidth(this.m_databody.firstChild,i);this.resizeColumnWidthAndShift(s),this.m_endColPixel+=s,this.m_endColHeaderPixel+=s,this.m_endColEndHeaderPixel+=s,null!=i&&(this.m_avgColWidth=i/this.getDataSource().getCount("column")),this.manageResizeScrollbars()}},A.prototype.resizeRowHeight=function(e,t){var i,s=t-e;if(0!==s){if(null!=this.m_databody.firstChild)i=this.getElementHeight(this.m_databody.firstChild)+s,this.setElementHeight(this.m_databody.firstChild,i);this.resizeRowHeightAndShift(s),this.m_endRowPixel+=s,this.m_endRowHeaderPixel+=s,this.m_endRowEndHeaderPixel+=s,null!=i&&(this.m_avgRowHeight=i/this.getDataSource().getCount("row")),this.manageResizeScrollbars()}},A.prototype.resizeColHeight=function(e,t,i){if(0!==t){var s,n,o,r=!0,l=this.find(this.m_resizingElement,"headerlabel");if(l?"column"===(o=this.getHeaderLabelAxis(this.m_resizingElement))||"columnEnd"===o?n=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==o&&"rowEnd"!==o||(n=this.m_columnHeaderLevelCount-1,r=!1):(n=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),o=this.getHeaderCellAxis(this.m_resizingElement)),i?this.m_columnEndHeaderLevelHeights[n]+=t:(s=this.m_columnHeaderLevelHeights[n],this.m_columnHeaderLevelHeights[n]+=t),!i&&n===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(r=!1),this.resizeColumnHeightsAndShift(t,n,i,r),i)this.m_colEndHeaderHeight+=t,this.setElementHeight(this.m_colEndHeader,this.m_colEndHeaderHeight);else{if(this.m_colHeaderHeight+=t,this.setElementHeight(this.m_colHeader,this.m_colHeaderHeight),0===this.m_headerLabels.column.length&&-1!==n)this._resizeHeaderLabelDirs(n,t,["row"],"height");else if(null!=this.m_columnHeaderLevelCount&&n===this.m_columnHeaderLevelCount-1)if(this.m_headerLabels.row.length){var a,h;if(l){if("column"===o)h=e,this.m_collisionResize=!0;else if("row"===o)a=t,this.m_collisionResize=!0;else if("rowEnd"===o)if(this._isHeaderLabelCollision()){let e=0;for(let t=0;t<this.m_columnHeaderLevelCount-1;t++)e+=this.getElementHeight(this.m_headerLabels.column[t]);let t=this.m_colHeaderHeight-e,i=this._calculateCollisionDimension(t,s,l,o);a=i.rowHeightChange,h=i.colHeight}else a=t,h=this.m_colHeaderHeight}else if(this._isHeaderLabelCollision()){let t=this._calculateCollisionDimension(e,s,!0,o);a=t.rowHeightChange,h=t.colHeight}else a=t,h=e;var d=this._getLabel("column",this.m_columnHeaderLevelCount-1);d&&this.setElementHeight(d,h),this._resizeHeaderLabelDirs(this.m_rowHeaderLevelCount-1,a,["row"],"height")}else{let t=["bottomResized"],i=this._getLabel("column",this.m_columnHeaderLevelCount-1);this._highlightElement(i.parentNode,t);let s=0;if("rowEnd"===o)for(let e=0;e<this.m_columnHeaderLevelCount-1;e++)s+=this.getElementHeight(this.m_headerLabels.column[e]);let n=e-s;this.setElementHeight(i,n)}else if(n<0){let t=this._getLabel("row",this.m_rowHeaderLevelCount-1),i=["bottomResized"];if(t&&n<0){this._highlightElement(t.parentNode,i);for(let i=0;i<this.m_rowHeaderLevelCount;i++)t=this._getLabel("row",i),this.setElementHeight(t,e)}}let i=this._getLabel("rowEnd",this.m_rowEndHeaderLevelCount-1),r=["bottomResized"];if(i){let t=-1===this.m_endColHeader?e:this.m_colHeaderHeight;this._highlightElement(i.parentNode,r);for(let e=0;e<this.m_rowEndHeaderLevelCount;e++)i=this._getLabel("rowEnd",e),this.setElementHeight(i,t)}}this.manageResizeScrollbars()}},A.prototype._calculateCollisionDimension=function(e,t,i,s){let n,o,r={},l=this._getMinValue("height",s,i);if(this.m_collisionResize){let r=this.getElementDir(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],"height"),a=this.getElementDir(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],"height"),h=r+a,d=a/h,c=r/h;r===l&&a===l?(n=Math.floor(e/2)-Math.floor(t/2),o=Math.ceil(e/2),this.m_collisionResize=!1):d>c?(o=Math.floor(e*d),n=e-o-r,r+n<this._getMinValue("height",s,i)&&(n=0)):(n=Math.floor(e*c)-r,r+n<this._getMinValue("height",s,i)&&(n=0),o=e-(r+n),o=Math.max(o,this._getMinValue("height",s,i)))}else n=Math.floor(e/2)-Math.floor(t/2),o=Math.ceil(e/2);return r.colHeight=o,r.rowHeightChange=n,r},A.prototype.resizeRowWidth=function(e,t,i,s){if(0!==t){var n;if(s){let e=this.getHeaderLabelAxis(this.m_resizingElement);"column"===e||"columnEnd"===e?n=this.m_rowHeaderLevelCount-1:"row"!==e&&"rowEnd"!==e||(n=this.getHeaderLabelLevel(this.m_resizingElement))}else n=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1);if(i?this.m_rowEndHeaderLevelWidths[n]+=t:this.m_rowHeaderLevelWidths[n]+=t,this.resizeRowWidthsAndShift(t,n,i),i)this.m_rowEndHeaderWidth+=t,this.setElementWidth(this.m_rowEndHeader,this.m_rowEndHeaderWidth);else{if(this.m_rowHeaderWidth+=t,n<0){let t=this.getResources().isRTLMode()?["startResized"]:["endResized"],i=this._getLabel("column",this.m_columnHeaderLevelCount-1);this._highlightElement(i.parentNode,t);for(let t=0;t<this.m_columnHeaderLevelCount;t++)i=this._getLabel("column",t),this.setElementWidth(i,e)}else this.setElementWidth(this.m_rowHeader,this.m_rowHeaderWidth),(n===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._resizeHeaderLabelDirs(n,t,["column"],"width");let i=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1),s=this.getResources().isRTLMode()?["startResized"]:["endResized"];if(i){this._highlightElement(i.parentNode,s);let e=this.getElementWidth(i)+t;for(let t=0;t<this.m_columnEndHeaderLevelCount;t++)i=this._getLabel("columnEnd",t),this.setElementWidth(i,e)}}this.manageResizeScrollbars()}},A.prototype._resizeHeaderLabelDirs=function(e,t,i,s){for(var n=0;n<i.length;n++){for(var o=i[n],r=0;r<this.m_headerLabels[o].length;r++){var l=this.m_headerLabels[o][r];if(null!=l){var a=this.getElementDir(l,s)+t;this.setElementDir(l,a,s)}}this._highlightResizeLabelDirs(o,e)}},A.prototype._highlightResizeLabelDirs=function(e,t){let i=this.getResources().isRTLMode()?["startResized"]:["endResized"],s="column"===e?i:["bottomResized"];this.m_corner&&("column"===e&&t===this.m_columnHeaderLevelCount-1||"row"===e&&t===this.m_rowHeaderLevelCount-1)&&this._highlightElement(this.m_corner,s);let n=this._getLabel("rowEnd",this.m_columnHeaderLevelCount-1);n&&this._highlightElement(n.parentNode,s)},A.prototype._unhighlightResizeBorderColor=function(){let e=this.m_root.querySelectorAll(".oj-datagrid-resized-start,\n .oj-datagrid-resized-end, .oj-datagrid-resized-top, .oj-datagrid-resized-bottom");this._unhighlightElementsByClassName(e,["startResized","endResized","topResized","bottomResized"])},A.prototype.getNewElementWidth=function(e,t,i,s,n){var o;o=this._getMinValue("width",e,n),null==s&&(s=this.getResources().isRTLMode()?this.m_lastMouseX-this.m_currentMouseX:this.m_currentMouseX-this.m_lastMouseX),i&&"row"===e&&(s*=-1);var r=t+s+this.m_overResizeLeft+this.m_overResizeMinLeft+this.m_overResizeRight;if(r<o?(this.m_overResizeMinLeft+=s-o+t,r=o):(this.m_overResizeMinLeft=0,this.m_overResizeLeft=0),"row"===e){var l=this.getRowHeaderWidth()+this.getRowEndHeaderWidth()-t,a=Math.round(this.getWidth()-this.m_utils.getScrollbarSize()-1)-l;r>a?(this.m_overResizeRight+=s-a+t,r=a):this.m_overResizeRight=0}return r},A.prototype.getNewElementHeight=function(e,t,i,s,n){var o;let r=this._getMinValue("height",e,!0);if(n){if(o=r,"rowEnd"===this.getHeaderLabelAxis(this.m_resizingElement)&&this.m_headerLabels.column&&this.m_headerLabels.column.length){this._isHeaderLabelCollision()&&(o=2*r);for(let e=0;e<this.m_columnHeaderLevelCount-1;e++)o+=this.getElementHeight(this.m_headerLabels.column[e])}}else o=this._getMinValue("height",e,n);"column"===e&&!i&&this.getHeaderCellLevel(this.m_resizingElement)+this.getHeaderCellDepth(this.m_resizingElement)===this.m_columnHeaderLevelCount&&this._isHeaderLabelCollision()&&(o=2*r),null==s&&(s=this.m_currentMouseY-this.m_lastMouseY),i&&"column"===e&&(s*=-1);var l=t+s+this.m_overResizeTop+this.m_overResizeMinTop+this.m_overResizeBottom;if(l<o?(this.m_overResizeMinTop+=s-o+t,l=o):(this.m_overResizeMinTop=0,this.m_overResizeTop=0),"column"===e){var a=this.getColumnHeaderHeight()+this.getColumnEndHeaderHeight()-t,h=Math.round(this.getHeight()-this.m_utils.getScrollbarSize()-1)-a;l>h?(this.m_overResizeBottom+=s-h+t,l=h):this.m_overResizeBottom=0}return l},A.prototype._getMinValue=function(e,t,i){var s,n,o=this.m_resizingElement,r=this._getCellPaddingBorder(e,o),l=r;if(i)return Math.max(this.m_utils.isTouchDevice()?2*A.RESIZE_TOUCH_OFFSET:2*A.RESIZE_OFFSET,l);var a=this.getHeaderCellLevel(o),h=this.getHeaderCellDepth(o),d=this.getResources().getMappedAttribute("sortable");"true"===o.getAttribute(d)&&this._setSortContainerSize(this._getSortContainer(o),r),"column"===t&&"true"===o.getAttribute(d)&&(l="width"===e?this.m_sortContainerWidth:this.m_sortContainerHeight);var c=Math.max(this.m_utils.isTouchDevice()?2*A.RESIZE_TOUCH_OFFSET:2*A.RESIZE_OFFSET,l);if("column"===t&&(1===this.m_columnHeaderLevelCount||"width"===e&&this.m_columnHeaderLevelCount===a+1||"height"===e&&1===h)||"row"===t&&-1===this.m_endRowHeader||"column"===t&&-1===this.m_endColHeader||"row"===t&&(1===this.m_rowHeaderLevelCount||"height"===e&&this.m_rowHeaderLevelCount===a+1||"width"===e&&1===h))return c;var m=this.getHeaderCellIndex(o),u=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0),_=this.getElementDir(o,e);return"column"===t?"width"===e?(s=this._getHeaderByIndex(m+(u-1),this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),n=this.getElementDir(s,e)):n=this._getHeaderLevelDimension(a+(h-1),o,this.m_columnHeaderLevelHeights,"height",1):"row"===t&&("height"===e?(s=this._getHeaderByIndex(m+(u-1),this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),n=this.getElementDir(s,e)):n=this._getHeaderLevelDimension(a+(h-1),o,this.m_rowHeaderLevelWidths,"width",1)),_-(n-c)},A.prototype._getLabelMinValue=function(e){var t=this.m_resizingElement,i=this._getCellPaddingBorder(e,t);return Math.max(this.m_utils.isTouchDevice()?2*A.RESIZE_TOUCH_OFFSET:2*A.RESIZE_OFFSET,i)},A.prototype._setSortContainerSize=function(e,t){this.m_sortContainerWidth=this.getElementWidth(e)+t,this.m_sortContainerHeight=this.getElementHeight(e)},A.prototype._getCellPaddingBorder=function(e,t){if(null==this.m_resizingElementMin){for(var i=["top","right","bottom","left"],s="width"===e?1:0,n=0,o=window.getComputedStyle(t);s<4;s+=2)n+=parseFloat(o.getPropertyValue("padding-"+i[s])),n+=parseFloat(o.getPropertyValue("border-"+i[s]+"-width"));this.m_resizingElementMin=Math.round(n)}return this.m_resizingElementMin},A.prototype.manageResizeScrollbars=function(){var e=this.getWidth(),t=this.getHeight(),i=this.m_colHeader,s=this.m_colEndHeader,n=this.m_rowHeader,o=this.m_rowEndHeader,r=this.m_databody,l=r.firstChild,a=this.getColumnHeaderHeight(),h=this.getColumnEndHeaderHeight(),d=this.getRowHeaderWidth(),c=this.getRowEndHeaderWidth();if(-1===this.m_endRowHeader&&-1!==this.m_endColHeader){let e=this._getLabel("column",this.m_columnHeaderLevelCount-1);e&&(d=this.getElementWidth(e))}else if(-1!==this.m_endRowHeader&&-1===this.m_endColHeader){let e=this._getLabel("row",this.m_rowHeaderLevelCount-1);e&&(a=this.getElementHeight(e))}var m,u=t-a-h,_=e-d-c,p=this.m_utils.getScrollbarSize(),g=this.getResources().isRTLMode()?"right":"left";if(this._databodyEmpty())if(null==this.m_empty){m=this._buildEmptyText();var f=this.getElementHeight(m),C=this.getElementWidth(m);f>this.getElementHeight(l)&&this.setElementHeight(l,f),C>this.getElementWidth(l)&&this.setElementWidth(l,C),this.m_databody.firstChild.appendChild(m)}else m=this.m_empty,this.setElementDir(m,this.m_endColHeader>=0?a:0,"top");var y,v,E,w,S,H=this.getElementWidth(r.firstChild),x=this.getElementHeight(r.firstChild),b=this.isDatabodyHorizontalScrollbarRequired(_);b?(y=this.isDatabodyVerticalScrollbarRequired(u-p),r.style.overflow="auto"):(y=this.isDatabodyVerticalScrollbarRequired(u))?(b=this.isDatabodyHorizontalScrollbarRequired(_-p),r.style.overflow="auto"):r.style.overflow="hidden",this.m_hasHorizontalScroller=b,this.m_hasVerticalScroller=y,-1!==this.m_endColEndHeader?(v=Math.min(x+(b?p:0),u),E=b?v-p:v):(v=u,E=Math.min(x,b?v-p:v)),-1!==this.m_endRowEndHeader?(w=Math.min(H+(y?p:0),_),S=y?w-p:w):(w=_,S=Math.min(H,y?w-p:w));var R=d+S+(y?p:0),I=a+E+(b?p:0);if(this.setElementDir(n,0,g),this.setElementDir(n,a,"top"),this.setElementHeight(n,E),this.setElementDir(o,R,g),this.setElementDir(o,a,"top"),this.setElementHeight(o,E),this.setElementDir(i,d,g),this.setElementWidth(i,S),this.setElementDir(s,d,g),this.setElementDir(s,I,"top"),this.setElementWidth(s,S),this.setElementDir(r,a,"top"),this.setElementDir(r,d,g),this.setElementWidth(r,w),this.setElementHeight(r,v),-1===this.m_endRowHeader&&-1!==this.m_endColHeader&&this.m_rowHeaderScrollbarSpacer?(this.setElementDir(this.m_rowHeaderScrollbarSpacer,a,"top"),this.setElementHeight(this.m_rowHeaderScrollbarSpacer,v+h),this.setElementWidth(this.m_rowHeaderScrollbarSpacer,d)):-1!==this.m_endRowHeader&&-1===this.m_endColHeader&&this.m_columnHeaderScrollbarSpacer&&(this.setElementDir(this.m_columnHeaderScrollbarSpacer,d,"left"),this.setElementWidth(this.m_columnHeaderScrollbarSpacer,w+c),this.setElementHeight(this.m_columnHeaderScrollbarSpacer,a)),this.m_scrollWidth=H-S,this.m_scrollHeight=x-E,this.buildCorners(),this._adjustHeaderBorders(),this._updateGridlines(),this.m_utils.isTouchDevice()){var M=0,L=0;if(this.m_currentScrollLeft>this.m_scrollWidth&&(M=this.m_scrollWidth-this.m_currentScrollLeft),this.m_currentScrollTop>this.m_scrollHeight&&(L=this.m_scrollHeight-this.m_currentScrollTop),0!==M||0!==L){this.m_utils.isTouchDeviceNotIOS()&&this._disableTouchScrollAnimation();var A=this.adjustTouchScroll(M,L);M=A[0],L=A[1],this.scrollDelta(M,L)}}},A.prototype.resizeColumnWidthAndShift=function(e){var t=this.getResources().isRTLMode()?"right":"left",i=this.m_colHeader.style.display,s=this.m_colEndHeader.style.display;this.m_databody.style.display="none",this.m_colHeader.style.display="none",this.m_colEndHeader.style.display="none";var n=this.getHeaderCellIndex(this.m_resizingElement);this.m_columnHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(n+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);var o,r=this.createIndex(-1,n),l=this.getElementsInRange(this.createRange(r,r));if(l)for(let e=0;e<l.length;e++)o=this.getResources().isRTLMode()?["startResized"]:["endResized"],this._highlightElement(l[e],o);this._shiftHeadersAlongAxisInContainer(this.m_colHeader.firstChild,n,e,t,this.getMappedStyle("colheadercell"),"column"),this._shiftHeadersAlongAxisInContainer(this.m_colEndHeader.firstChild,n,e,t,this.getMappedStyle("colendheadercell"),"column"),this._shiftCellsAlongAxis("column",e,n),this.m_databody.style.display="",this.m_colHeader.style.display=i,this.m_colEndHeader.style.display=s},A.prototype._shiftCellsAlongAxis=function(e,t,i,s){var n,o,r,l,a,h=[];if(null==s&&(s=!1),"row"===e?(n="height",o="top",r=this.m_endRow,l=this.m_startCol,a=this.m_endCol):(n="width",o=this.getResources().isRTLMode()?"right":"left",r=this.m_endCol,l=this.m_startRow,a=this.m_endRow),null!=this.m_databody.firstChild)for(var d=l;d<=a;d++){var c="row"===e?this.createIndex(i,d):this.createIndex(d,i),m=this._getCellByIndex(c),u=m[this.getResources().getMappedAttribute("context")],_=u.indexes[e],p=u.extents[e],g=i-_,f=p-g;h[d]&&h[d][i]||!0===s||(this.setElementDir(m,this.getElementDir(m,n)+t,n),"row"===e?this._updateTempArray(h,!0,d,i,u.extents.column,p-g):this._updateTempArray(h,!0,d,i,u.extents.row,p-g));var C=i;!0!==s&&(C=i+f);for(var y=C;y<=r;y++)if(!h[d]||!h[d][y]){c="row"===e?this.createIndex(y,d):this.createIndex(d,y),p=(u=(m=this._getCellByIndex(c))[this.getResources().getMappedAttribute("context")]).extents[e];var v=this.getElementDir(m,o)+t;this.setElementDir(m,v,o),"row"===e?this._updateTempArray(h,!0,d,y,u.extents.column,p):this._updateTempArray(h,!0,d,y,u.extents.row,p)}}},A.prototype.resizeRowHeightAndShift=function(e){var t=this.m_rowHeader.style.display,i=this.m_rowEndHeader.style.display;this.m_databody.style.display="none",this.m_rowHeader.style.display="none",this.m_rowEndHeader.style.display="none";var s=this.getHeaderCellIndex(this.m_resizingElement);this.m_rowHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(s+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);var n,o=this.createIndex(s,-1),r=this.getElementsInRange(this.createRange(o,o));if(r)for(let e=0;e<r.length;e++)n=["bottomResized"],this._highlightElement(r[e],n);this._shiftHeadersAlongAxisInContainer(this.m_rowHeader.firstChild,s,e,"top",this.getMappedStyle("rowheadercell"),"row"),this._shiftHeadersAlongAxisInContainer(this.m_rowEndHeader.firstChild,s,e,"top",this.getMappedStyle("rowendheadercell"),"row"),this._shiftCellsAlongAxis("row",e,s),this.m_databody.style.display="",this.m_rowHeader.style.display=t,this.m_rowEndHeader.style.display=i},A.prototype._shiftHeadersAlongAxisInContainer=function(e,t,i,s,n,o){var r,l,a,h,d=0,c=e.lastChild;if(null!=c){var m,u=this.m_utils.containsCSSClassName(c,n);for(u?(l=c.parentNode,r=c,a=this.getHeaderCellIndex(r)):(l=c,r=c.firstChild,a=this._getAttribute(l,"start",!0));t<a;)if(u)h=this.getElementDir(r,s)+i,this.setElementDir(r,h,s),c=c.previousSibling,u=this.m_utils.containsCSSClassName(c,n),l=c.parentNode,r=c,a=this.getHeaderCellIndex(r);else{for(var _=l.getElementsByClassName(n),p=0;p<_.length;p++)h=this.getElementDir(_[p],s)+i,this.setElementDir(_[p],h,s);c=c.previousSibling,u=this.m_utils.containsCSSClassName(c,n),l=c,r=c.firstChild,a=this._getAttribute(l,"start",!0)}if(this.m_resizingElement&&(m=this.getHeaderCellLevel(this.m_resizingElement)),"column"===o?(d=this.getElementWidth(r)+i,this.setElementWidth(r,d)):"row"===o?(d=this.getElementHeight(r)+i,this.setElementHeight(r,d)):null==o&&(h=this.getElementDir(r,s)+i,this.setElementDir(r,h,s)),"row"===o||"column"===o){let e=this.getResources().isRTLMode()?["startResized"]:["endResized"],t="row"===o?["bottomResized"]:e;void 0!==m&&this.getHeaderCellLevel(r)>=m&&this._highlightElement(r,t),r!==this.m_resizingElement||r!==l.lastChild&&r!==l.firstChild||this._highlightResizeBorder(t,o)}u||null==r.nextSibling?null!=o&&this.m_sizingManager.setSize(o,this._getKey(r),d):this._shiftHeadersAlongAxisInContainer(c,t,i,s,n,o)}},A.prototype._highlightResizeBorder=function(e,t){let i=this.getHeaderCellIndex(this.m_resizingElement),s="column"===t?this.m_columnHeaderLevelCount:this.m_rowHeaderLevelCount,n=this.m_resizingElement[this.getResources().getMappedAttribute("context")],o=n.index+n.extent-1;for(let n=0;n<s-1;n++){let r;r="row"===t?this._getHeaderByIndex(i,n,this.m_rowHeader,s,this.m_startRowHeader):this._getHeaderByIndex(i,n,this.m_colHeader,s,this.m_startColumnHeader);let l=r[this.getResources().getMappedAttribute("context")];l.index+l.extent-1===o&&this._highlightElement(r,e)}},A.prototype.resizeColumnHeightsAndShift=function(e,t,i,s){var n,o,r,l;i?(n=this.m_colEndHeader,o=this.getMappedStyle("colendheadercell"),r="columnEnd",l="bottom"):(n=this.m_colHeader,o=this.getMappedStyle("colheadercell"),r="column",l="top"),n.style.display="none",this.m_databody.style.display="none",s&&this._shiftLabelsDir(this.m_headerLabels[r],e,t,l,r),this._shiftHeadersDirInContainer(n.firstChild,e,t,l,o,r),n.style.display="",this.m_databody.style.display=""},A.prototype.resizeRowWidthsAndShift=function(e,t,i){var s,n,o,r;i?(s=this.m_rowEndHeader,n=this.getMappedStyle("rowendheadercell"),o="rowEnd",r=this.getResources().isRTLMode()?"left":"right"):(s=this.m_rowHeader,n=this.getMappedStyle("rowheadercell"),o="row",r=this.getResources().isRTLMode()?"right":"left"),s.style.display="none",this.m_databody.style.display="none",this._shiftLabelsDir(this.m_headerLabels[o],e,t,r,o),this._shiftHeadersDirInContainer(s.firstChild,e,t,r,n,o),s.style.display="",this.m_databody.style.display=""},A.prototype._shiftLabelsDir=function(e,t,i,s,n){for(var o=0;o<e.length;o++){var r,l=e[o];if(o===i)if("column"===n||"columnEnd"===n)if(r=this.getElementHeight(l)+t,this.setElementHeight(l,r),"column"===n&&this._isHeaderLabelCollision()&&i===this.m_columnHeaderLevelCount-1){let e=["bottomResized"];this._highlightElement(this.m_corner,e)}else if("columnEnd"===n){let e=["topResized"],t=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1);t&&this._highlightElement(t,e)}else{let e="column"===n?["bottomResized"]:["topResized"];this._highlightElement(l,e)}else{r=this.getElementWidth(l)+t,this.setElementWidth(l,r);let e=this.getResources().isRTLMode()?["startResized"]:["endResized"],i=this.getResources().isRTLMode()?["endResized"]:["startResized"],s="row"===n?e:i;this._highlightElement(l,s);let o=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1);o&&this._highlightElement(o.parentNode,s)}o>i&&(r=this.getElementDir(l,s)+t,this.setElementDir(l,r,s))}},A.prototype._shiftHeadersDirInContainer=function(e,t,i,s,n,o){for(var r=e.childNodes,l=0;l<r.length;l++){var a,h,d=r[l];if(this.m_utils.containsCSSClassName(d,n)){a=this.getHeaderCellLevel(d);var c=this.getHeaderCellDepth(d);if(a<=i&&i<a+c){if("column"===o||"columnEnd"===o){if(h=this.getElementHeight(d)+t,this.setElementHeight(d,h),this.m_resizingElement){var m=this.getMappedStyle("colendheadercell");if(this.m_utils.containsCSSClassName(d,m)){let e=["topResized"];this._highlightElement(d,e)}else{let e=["bottomResized"];this._highlightElement(d,e)}}}else if(h=this.getElementWidth(d)+t,this.setElementWidth(d,h),this.m_resizingElement){var u=this.getMappedStyle("rowendheadercell");if(this.m_utils.containsCSSClassName(d,u)){let e=this.getResources().isRTLMode()?["endResized"]:["startResized"];this._highlightElement(d,e)}else{let e=this.getResources().isRTLMode()?["startResized"]:["endResized"];this._highlightElement(d,e)}}}else a>i&&(h=this.getElementDir(d,s)+t,this.setElementDir(d,h,s))}else if((a=this._getAttribute(d,"level",!0))<=i)this._shiftHeadersDirInContainer(d,t,i,s,n,o);else for(var _=d.getElementsByClassName(n),p=0;p<_.length;p++)h=this.getElementDir(_[p],s)+t,this.setElementDir(_[p],h,s)}},A.prototype.handleContextMenuResize=function(e,t,i,s){this.m_overResizeLeft=0,this.m_overResizeMinLeft=0,this.m_overResizeTop=0,this.m_overResizeMinTop=0,this.m_overResizeRight=0,this.m_overResizeBottom=0;var n=parseFloat(i,10),o=n-this.getElementWidth(s),r=n-this.getElementHeight(s);this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=t===this.m_resources.getMappedCommand("resizeHeight")?this.getHeaderFromCell(s,"row",!0):this.getHeaderFromCell(s,"column",!0)),this.m_isResizing=!0,this.m_resizingElement=s;let l=this.find(this.m_resizingElement,"headerlabel");var a=this.getElementWidth(s),h=this.getElementHeight(s),d=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"));if(t===this.m_resources.getMappedCommand("resizeWidth")){if(a!==n)if("column"===this._getResizeHeaderMode(this.m_resizingElement)){if(this._isDOMElementResizable(this.m_resizingElement))if(l)this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"))&&(d=!1),this.resizeRowWidth(n,n-a,d,l),this._fireResizeEvent(e,a,h,n,h,n);else{let t=this.getNewElementWidth("column",a,d,o,l);this.resizeColWidth(a,t),this._resizeSelectedHeaders(e,a,h,n,h,n)}}else this.resizeRowWidth(n,n-a,d,l),this._fireResizeEvent(e,a,h,n,h,n)}else if(t===this.m_resources.getMappedCommand("resizeHeight")&&h!==n)if("column"===this._getResizeHeaderMode(this.m_resizingElement))this.resizeColHeight(n,n-h,d),this._fireResizeEvent(e,a,h,a,n,n);else if(this._isDOMElementResizable(this.m_resizingElement)){let t=this.getNewElementHeight("row",h,d,r,l);l?(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(d=!1),this.resizeColHeight(t,t-h,d),this._fireResizeEvent(e,a,h,a,n,n)):(this.resizeRowHeight(h,t),this._resizeSelectedHeaders(e,a,h,a,t,n))}var c=this.getElementWidth(s),m=this.getElementHeight(s);c===a&&m===h||(this.buildCorners(),this.m_utils.isTouchDevice()&&this._moveTouchSelectionAffordance()),this._unhighlightResizeBorderColor(),this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_isResizing=!1},A.prototype._getResizeNestedHeaderIndex=function(e,t){let i=this.getHeaderCellIndex(this.m_resizingElement),s=t?this.m_columnEndHeaderLevelCount:this.m_columnHeaderLevelCount,n=t?this.m_rowEndHeaderLevelCount:this.m_rowHeaderLevelCount;return("column"===e||"columnEnd"===e?s:n)>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1),i},A.prototype._highlightResizeMouseDown=function(){let e,t,i=this.getHeaderCellIndex(this.m_resizingElement),s=this._getResizeHeaderMode(this.m_resizingElement),n=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel")),o=this.getResources().isRTLMode()?"right":"left",r=this.find(this.m_resizingElement,"headerlabel");if("col-resize"===this.m_cursor)if("column"===s)if(n=!r&&n,r)t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.m_rowHeaderLevelCount-1:"row"!==t&&"rowEnd"!==t||(e=this.getHeaderLabelLevel(this.m_resizingElement)),this.resizeRowWidthsAndShift(0,e,n),n||(e===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._highlightResizeLabelDirs("column",e);else{this.m_columnHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);let e,t=this.createIndex(-1,i),s=this.getElementsInRange(this.createRange(t,t));if(s)for(let t=0;t<s.length;t++)e=this.getResources().isRTLMode()?["startResized"]:["endResized"],this._highlightElement(s[t],e);this._shiftHeadersAlongAxisInContainer(this.m_colHeader.firstChild,i,0,o,this.getMappedStyle("colheadercell"),"column"),this._shiftHeadersAlongAxisInContainer(this.m_colEndHeader.firstChild,i,0,o,this.getMappedStyle("colendheadercell"),"column")}else"row"===s&&(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(n=!0),r?(t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.m_rowHeaderLevelCount-1:"row"!==t&&"rowEnd"!==t||(e=this.getHeaderLabelLevel(this.m_resizingElement))):e=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),this.resizeRowWidthsAndShift(0,e,n),n||(e===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._highlightResizeLabelDirs("column",e));else if("row-resize"===this.m_cursor)if("row"===s)if(r){let i=!0;t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==t&&"rowEnd"!==t||(e=this.m_columnHeaderLevelCount-1,i=!1),!n&&e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(i=!1),this.resizeColumnHeightsAndShift(0,e,n,i),n||(0===this.m_headerLabels.column.length||e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length)&&this._highlightResizeLabelDirs("row",e)}else{this.m_rowHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);let e,t=this.createIndex(i,-1),s=this.getElementsInRange(this.createRange(t,t));if(s)for(let t=0;t<s.length;t++)e=["bottomResized"],this._highlightElement(s[t],e);this._shiftHeadersAlongAxisInContainer(this.m_rowHeader.firstChild,i,0,"top",this.getMappedStyle("rowheadercell"),"row"),this._shiftHeadersAlongAxisInContainer(this.m_rowEndHeader.firstChild,i,0,"top",this.getMappedStyle("rowendheadercell"),"row")}else{let i=!0;r?(t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==t&&"rowEnd"!==t||(e=this.m_columnHeaderLevelCount-1,i=!1)):(e=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),t=this.getHeaderCellAxis(this.m_resizingElement)),!n&&e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(i=!1),this.resizeColumnHeightsAndShift(0,e,n,i),n||(0===this.m_headerLabels.column.length||e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length)&&this._highlightResizeLabelDirs("row",e)}},A.prototype.handleResizeFitToContent=function(e,t,i){let s=this.find(t,"header")||this.find(t,"endheadercell"),n=this.m_utils.containsCSSClassName(t,this.getMappedStyle("endheadercell"));if(!s){let e=this.findCell(t);if(!e)return;t=this.getHeaderFromCell(e,i)}this.m_resizingElement=t;let o,r,l,a,h,d,c=this.m_resizingElement,m=this.getHeaderCellAxis(c),u=!1;if("column"===m||"columnEnd"===m){let e=s?this._getResizeNestedHeaderIndex(m,n):this.getHeaderCellIndex(c);this.m_resizingElement=n?this._getHeaderByIndex(e,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader):this._getHeaderByIndex(e,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader);let t=this.createIndex(-1,e);o=this.getElementsInRange(this.createRange(t,t)),o.push(c),r=this.calculateColumnHeaderWidth(this.m_resizingElement),l=this.getElementHeight(this.m_resizingElement),a=this._calculateResizeFitToContentValue(o,"column"),h=l,d=a,u=r!==a,this.resizeColWidth(r,a)}else if("row"===m||"rowEnd"===m){let e=s?this._getResizeNestedHeaderIndex(m,n):this.getHeaderCellIndex(c);this.m_resizingElement=n?this._getHeaderByIndex(e,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader):this._getHeaderByIndex(e,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader);let t=this.createIndex(e,-1);o=this.getElementsInRange(this.createRange(t,t)),o.push(c),r=this.getElementWidth(this.m_resizingElement),l=this.calculateRowHeaderHeight(this.m_resizingElement),a=r,h=this._calculateResizeFitToContentValue(o,"row"),d=h,u=l!==h,this.resizeRowHeight(l,h)}u&&this._fireResizeEvent(e,r,l,a,h,d),this._unhighlightResizeBorderColor()},A.prototype._calculateResizeFitToContentValue=function(e,t){let i,s="height";"column"===t&&(s="width");let n=this._getMinValue(s,t,!1),o=document.createElement("div");if("width"===s){o.style.display="inline-flex",o.style.flexFlow="column nowrap",o.style.justifyContent="flex-start",o.style.alignItems="stretch";for(let t=0;t<e.length;t++){let i=e[t].cloneNode(!0);i.classList.remove(...i.classList),i.style[s]="",i.style.whiteSpace="nowrap !important",i.style.overflow="hidden",o.appendChild(i)}}else if("height"===s){o.style.display="flex";for(let t=0;t<e.length;t++){let i=e[t].cloneNode(!0);i.style[s]="",i.style.whiteSpace="break-spaces",o.appendChild(i)}}o.style.visibility="hidden",o.style.top="0px",this.m_root.appendChild(o);let r="column"===t?this.m_databody.offsetWidth:this.m_databody.offsetHeight,l="column"===t?this._getCellPaddingBorder(s,this.m_resizingElement):0;return i=("column"===t?Math.ceil(o.firstElementChild.getBoundingClientRect().width):Math.ceil(o.firstElementChild.getBoundingClientRect().height))+l,i=i<n?n:i,i=i>r?r:i,this.m_root.removeChild(o),i},A.prototype.getHeaderEdgePixels=function(e){var t,i,s=0,n=0;if(this.m_utils.isTouchDevice()){var o=this.findPos(e);s=o[0],n=o[1]}return this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))?(t=this.calculateColumnHeaderWidth(e),i=this.getElementHeight(e)):(t=this.getElementWidth(e),i=this.calculateRowHeaderHeight(e)),[s,n,s+t,n+i]},A.prototype.getHeaderLabelEdgePixels=function(e){var t,i,s=this.findPos(e),n=s[0],o=s[1];return this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnheaderlabel"))?(t=this.calculateColumnHeaderWidth(e),i=this.getElementHeight(e)):(t=this.getElementWidth(e),i=this.calculateRowHeaderLabelHeight(e)),[n,o,n+t,o+i]},A.prototype.unhighlightSelection=function(){for(var e=this.GetSelection(),t=0;t<e.length;t+=1)this.unhighlightRange(e[t]);this.getResources()&&this._clearHeaderHighLight()},A.prototype.unhighlightRange=function(e){var t=this.getElementsInRange(e);this.unhighlightElems(t),this._applyBorderClassesAroundRange(t,e,!1,"Selected")},A.prototype.highlightRange=function(e,t){const i=this.getHeadersByRange(e,"row"),s=this.getHeadersByRange(e,"column");this._highlightHeaders(e,i,s);var n,o=this.getElementsInRange(e);(this.highlightElems(o,e),this._applyBorderClassesAroundRange(o,e,!0,"Selected"),t)&&(n=1===this.GetSelection().length?o.length:this._getCurrentSelectionCellCount(),this._setAccInfoText("accessibleMultiCellSelected",{num:n}))},A.prototype.getHeadersByRange=function(e,t){const i=new Set;let s,n,o,r;if("row"===t&&this.m_rowHeaderLevelCount>0){for(e.endIndex&&e.endIndex.row&&(r=e.endIndex.row),r?-1===r&&(r=this.m_endRowHeader):r=e.startIndex.row,n=Math.max(this.m_startRowHeader,e.startIndex.row);n<=r;n++)for(s=this._getHeadersByIndex(n,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),o=0;o<s.length;o++)i.add(s[o])}else if("column"===t&&this.m_columnHeaderLevelCount>0){for(e.endIndex&&e.endIndex.column&&(r=e.endIndex.column),r?-1===r&&(r=this.m_endColHeader):r=e.startIndex.column,n=Math.max(this.m_startColHeader,e.startIndex.column);n<=r;n++)for(s=this._getHeadersByIndex(n,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),o=0;o<s.length;o++)i.add(s[o])}if("row"===t&&this.m_rowEndHeaderLevelCount>0){for(e.endIndex&&e.endIndex.row&&(r=e.endIndex.row),r?-1===r&&(r=this.m_endRowHeader):r=e.startIndex.row,n=Math.max(this.m_startRowEndHeader,e.startIndex.row);n<=r;n++)for(s=this._getHeadersByIndex(n,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),o=0;o<s.length;o++)i.add(s[o])}else if("column"===t&&this.m_columnEndHeaderLevelCount>0){for(e.endIndex&&e.endIndex.column&&(r=e.endIndex.column),r?-1===r&&(r=this.m_endColHeader):r=e.startIndex.column,n=Math.max(this.m_startColEndHeader,e.startIndex.column);n<=r;n++)for(s=this._getHeadersByIndex(n,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),o=0;o<s.length;o++)i.add(s[o])}return i},A.prototype._highlightHeaders=function(e,t,i){t.forEach(t=>{const i=t[this.getResources().getMappedAttribute("context")];null==e.endIndex.column||-1===e.endIndex.row&&-1===e.endIndex.column||-1===e.endIndex.column&&0===e.startIndex.column&&this._isHeaderSelected(i,"row")?(t.classList.remove(this.getMappedStyle("headerPartialSelected")),t.classList.add(this.getMappedStyle("headerAllSelected"))):(t.classList.remove(this.getMappedStyle("headerAllSelected")),t.classList.add(this.getMappedStyle("headerPartialSelected")))}),i.forEach(t=>{const i=t[this.getResources().getMappedAttribute("context")];-1===e.endIndex.row&&-1===e.endIndex.column||-1===e.endIndex.row&&0===e.startIndex.row&&this._isHeaderSelected(i,"column")?(t.classList.remove(this.getMappedStyle("headerPartialSelected")),t.classList.add(this.getMappedStyle("headerAllSelected"))):(t.classList.remove(this.getMappedStyle("headerAllSelected")),t.classList.add(this.getMappedStyle("headerPartialSelected")))})},A.prototype._isHeaderSelected=function(e,t){let i=!1;return this.GetSelection().forEach(s=>{e.index>=s.startIndex[t]&&e.index+(e.extent-1)<=s.endIndex[t]&&(i=!0)}),i},A.prototype._clearHeaderHighLight=function(){const e="."+this.getMappedStyle("headerPartialSelected")+"."+this.getMappedStyle("headercell"),t=this.m_root.querySelectorAll(e),i="."+this.getMappedStyle("headerPartialSelected")+"."+this.getMappedStyle("endheadercell"),s=[...t,...this.m_root.querySelectorAll(i)];for(let e=0;e<s.length;e++)s[e].classList.remove(this.getMappedStyle("headerPartialSelected")),s[e].classList.remove(this.getMappedStyle("draggableItem"));const n="."+this.getMappedStyle("headerAllSelected")+"."+this.getMappedStyle("headercell"),o=this.m_root.querySelectorAll(n);for(let e=0;e<o.length;e++)o[e].classList.remove(this.getMappedStyle("headerAllSelected")),o[e].classList.remove(this.getMappedStyle("draggableItem"))},A.prototype._getCurrentSelectionCellCount=function(){for(var e=0,t=this.GetSelection(),i=0;i<t.length;i++){var s=this.getElementsInRange(t[i]);null!=s&&(e+=s.length)}return e},A.prototype.unhighlightElems=function(e){if(null!=e&&0!==e.length)for(let t=0;t<e.length;t+=1){let i=e[t],s=["selected","topSelected","bottomSelected","startSelected","endSelected"];this._unhighlightElement(i,s)}},A.prototype.highlightElems=function(e){if(null!=e&&0!==e.length)for(let t=0;t<e.length;t+=1)this._highlightElement(e[t],["selected"])},A.prototype.applySelection=function(e,t,i,s){for(var n=this.GetSelection(),o=0;o<n.length;o+=1){var r=this.getElementsInRange(n[o],e,t,i,s);if(this.highlightElems(r),this._applyBorderClassesAroundRange(r,n[o],!0,"Selected"),this.m_dragIndex&&r&&r.length)for(let e=0;e<r.length;e++)this._highlightElement(r[e],["dragSourceOpaque"])}},A.prototype.handleDatabodySelectionDrag=function(e){var t,i;if(this.m_utils.isTouchDevice()?t=this.findCell(document.elementFromPoint(e.touches[0].clientX,e.touches[0].clientY)):(i=e.target,t=this.findCell(i)),null!=t){var s=this.getCellIndexes(t);this.m_deselectInProgress?this.extendDeselection(s,e):this.isHeaderSelectionType(this.m_selectionFrontier)?this.extendSelectionHeader(t,e):this.extendSelection(s,e)}},A.prototype.handleHeaderClickSelection=function(e){var t,i,s,n,o=e.target,r=this.findHeader(o),l=e.shiftKey,a=this.isMultipleSelection(),h=this.m_utils.ctrlEquivalent(e);if(l&&a||!r||this._setActive(r,this._createActiveObject(r),e),null==this.m_active||"header"!==this.m_active.type&&!e.shiftKey)return!1;var d=r[this.getResources().getMappedAttribute("context")];if(t=d.axis,i=d.index,n=d.extent,h&&this._shouldDeselectHeader(i,n,t)){var c,m,u,_;-1!==t.indexOf("row")?(c=this.createIndex(i,0),m=this.createIndex(i+n-1,-1),_=this._getSelectionStartAndEnd(c,m,0),u=this.createRange(this.createIndex(_.min.row,0),this.createIndex(_.max.row,-1))):(c=this.createIndex(0,i),m=this.createIndex(-1,i+n-1),_=this._getSelectionStartAndEnd(c,m,0),u=this.createRange(this.createIndex(0,_.min.column),this.createIndex(-1,_.max.column)));var p=this._trimRangeForSelectionMode(u);return this.m_deselectInfo={anchor:p.startIndex,selection:this.GetSelection(),axis:-1!==t.indexOf("row")?"row":"column",sourceParent:r},void(this.m_deselectInProgress=this._deselectRange(p,e))}"header"===this.m_active.type&&(t=this.m_active.axis,i=this.m_active.index,s=this.m_active.level),this.m_utils.isTouchDevice()?(this._removeTouchSelectionAffordance(),this._selectHeader(t,i,s,e)):l&&a?(null==t&&(t=d.axis),(-1!==t.indexOf("row")&&-1!==d.axis.indexOf("row")||-1!==t.indexOf("column")&&-1!==d.axis.indexOf("column"))&&this.extendSelectionHeader(r,e)):2!==e.button&&this._selectHeader(t,i,s,e)},A.prototype.discontiguousHeaderSetActiveFromDatabody=function(e,t,i,s){var n=t.replace("End",""),o=this.m_selection[this.m_selection.length-1];this.unhighlightSelection(),o.startIndex.row===this.m_active.indexes.row&&o.endIndex.row===this.m_active.indexes.row&&o.startIndex.column===this.m_active.indexes.column&&o.endIndex.column===this.m_active.indexes.column&&this.m_selection.pop(),this._setActive(i,{type:"header",index:this.m_trueIndex[n],level:s-1,axis:t},e,!1),this.rehighlightSelection()},A.prototype.handleDragAnchorChange=function(e){if(this.m_headerDragState){var t,i,s=e.target,n=this.findHeader(s),o=n[this.getResources().getMappedAttribute("context")],r=this._getActiveElement(),l=r[this.getResources().getMappedAttribute("context")],a=this._getAttribute(r.parentNode,"start",!0),h=a+(this._getAttribute(r.parentNode,"extent",!0)-1);if(!o.extent)return;1===o.extent?(t=o.index,i=o.index):i=(t=this._getAttribute(n.parentNode,"start",!0))+(this._getAttribute(n.parentNode,"extent",!0)-1),1!==l.extent?(t<=a&&i>=h||t>=a&&i<=h)&&this._setActive(n,this._createActiveObject(n),e):t!==i&&t<=a&&a<=i&&this._setActive(n,this._createActiveObject(n),e)}},A.prototype.handleDatabodyClickSelection=function(e){var t,i=e.target,s=this.findCell(i);if(null!=s&&(t=this.getCellIndexes(s)),null!=t){if(this.isMultipleSelection()&&2===e.button&&this._isContainSelection(t))return;var n=this.m_utils.ctrlEquivalent(e),o=e.shiftKey;if(this.m_utils.containsCSSClassName(s,this.getMappedStyle("selected"))&&n){this.m_deselectInfo={anchor:t,selection:this.GetSelection()};var r=this.getCellEndIndexes(s),l=this._trimRangeForSelectionMode(this.createRange(t,r));return void(this.m_deselectInProgress=this._deselectRange(l,e))}this.isMultipleSelection()?(this._removeTouchSelectionAffordance(),this.m_utils.isTouchDevice()?(null!=this.m_active&&this._unhighlightActive(),this.selectAndFocus(t,e,!1)):n?n&&o?this.extendSelection(t,e):this.selectAndFocus(t,e,!0):o?this.extendSelection(t,e):this.selectAndFocus(t,e,!1)):this.selectAndFocus(t,e,!1)}},A.prototype._doRangesOverlap=function(e,t){var i=e.startIndex,s=i.column,n=i.row,o=e.endIndex,r=o.column,l=o.row,a=t.startIndex,h=a.column,d=a.row,c=t.endIndex,m=c.column,u=c.row;return(s<=m||-1===m||void 0===m)&&(r>=h||-1===r||void 0===r)&&(n<=u||-1===u)&&(l>=d||-1===l)},A.prototype._isRangeValid=function(e){return(e.startIndex.row<=e.endIndex.row||e.startIndex.row>=0&&-1===e.endIndex.row)&&(e.startIndex.column<=e.endIndex.column||e.startIndex.column>=0&&-1===e.endIndex.column||void 0===e.startIndex.column&&void 0===e.endIndex.column)},A.prototype._deselectRange=function(e,t){var i=this.m_deselectInfo.selection,s=e.startIndex,n=s.column,o=s.row,r=e.endIndex,l=r.column,a=r.row,h=!1,d=[],c=0,m=[],u=this;return i.forEach(function(t){var i=t.startIndex,s=i.column,r=i.row,_=t.endIndex,p=_.column,g=_.row;if(this._doRangesOverlap(t,e)){var f,C,y=function(e,t,i){return new Promise(function(s){u._createRangeWithKeys(e,t,function(e){d[i]=e,s()})})};h=!0,r<o&&(f=this.createIndex(r,s),C=this.createIndex(o-1,p),this._isRangeValid({startIndex:f,endIndex:C})&&(m.push(y(f,C,c)),c+=1)),-1!==a&&(f=this.createIndex(a+1,s),C=this.createIndex(g,p),this._isRangeValid({startIndex:f,endIndex:C})&&(m.push(y(f,C,c)),c+=1)),s<n&&void 0!==s&&(f=this.createIndex(Math.max(o,r),s),C=this.createIndex(Math.min(-1===a?g:a,-1===g?a:g),n-1),this._isRangeValid({startIndex:f,endIndex:C})&&(m.push(y(f,C,c)),c+=1)),-1!==l&&void 0!==s&&(f=this.createIndex(Math.max(o,r),l+1),C=this.createIndex(Math.min(-1===a?g:a,-1===g?a:g),p),this._isRangeValid({startIndex:f,endIndex:C})&&(m.push(y(f,C,c)),c+=1))}else d[c]=t,c+=1},this),!!h&&(Promise.all(m).then(function(){var e=u.m_selection;u.SetSelection(d),u._compareSelectionAndFire(t,e)}),!0)},A.prototype._shouldDeselectHeader=function(e,t,i){var s,n,o=this.GetSelection();"row"===i||"rowEnd"===i?(s="row",n="column"):(s="column",n="row");var r=!1,l=this.m_options.getSelectionMode();return o.forEach(function(i){var o=i.startIndex[n],a=i.endIndex[n];if(0===o&&-1===a||"row"===l&&"row"===s){var h=i.startIndex[s],d=i.endIndex[s];h<=e&&(d>=e+t-1||-1===d)&&(r=!0)}}),r},A.prototype._handleSelectAll=function(e){return!(!this._isSelectionEnabled()||!this.isMultipleSelection())&&("row"===this.m_options.getSelectionMode()?this._selectRange(this.createIndex(0),this.createIndex(-1),e):this._selectRange(this.createIndex(0,0),this.createIndex(-1,-1),e),this.m_utils.isTouchDevice()&&this.m_topSelectIconContainer&&this.m_bottomSelectIconContainer&&(this.m_topSelectIconContainer.parentNode.removeChild(this.m_topSelectIconContainer),this.m_bottomSelectIconContainer.parentNode.removeChild(this.m_bottomSelectIconContainer)),!0)},A.prototype._isContainSelection=function(e,t){null==t&&(t=this.GetSelection());for(var i=0;i<t.length;i+=1){var s=t[i],n=s.startIndex,o=this.getEndIndex(s),r=n.row,l=o.row;if(e.row>=r&&(-1===l||e.row<=l)){var a=n.column,h=o.column;if(isNaN(a)||isNaN(h))return!0;if(e.column>=a&&(-1===h||e.column<=h))return!0}}return!1},A.prototype._isHeaderInsideSelection=function(e,t){const i=this.GetSelection();for(let s=0;s<i.length;s+=1){let n=i[s],o=n.startIndex,r=this.getEndIndex(n),l=o.row,a=r.row,h=o.column,d=r.column;if("column"===t||"columnEnd"===t){if(e>=h&&(-1===d||e<=d)&&0===l&&-1===a)return!0}else if(("row"===t||"rowEnd"===t)&&e>=l&&(-1===a||e<=a)&&0===h&&-1===d)return!0}return!1},A.prototype._getContainedSelectionCssClass=function(e,t){var i=[],s={contains:!1,class:[]};null==t&&(t=this.GetSelection());for(var n=0;n<t.length;n+=1){var o=t[n],r=o.startIndex,l=this.getEndIndex(o),a=r.row,h=l.row,d=r.column,c=l.column;e.row>=a&&(-1===h||e.row<=h)&&(e.column>=d&&(-1===c||e.column<=c)||isNaN(d)||isNaN(c))&&(e.row===a&&i.push("topSelected"),e.row===h&&i.push("bottomSelected"),(isNaN(d)||isNaN(c))&&(s.contains=!0,s.class=i),e.column>=d&&(-1===c||e.column<=c)&&(e.column===d&&i.push("startSelected"),e.column===c&&i.push("endSelected"),s.contains=!0,s.class=i))}return s},A.prototype._compareSelections=function(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i+=1){for(var s=!1,n=0;n<t.length;n+=1)this._compareIndividualSelectionObjects(e[i],t[n])&&(s=!0);if(!1===s)return!1}return!0},A.prototype._compareIndividualSelectionObjects=function(e,t){return e.startIndex.row===t.startIndex.row&&e.startIndex.column===t.startIndex.column&&e.endIndex.row===t.endIndex.row&&e.endIndex.column===t.endIndex.column},A.prototype._clearSelection=function(e){this.unhighlightSelection(),this._removeTouchSelectionAffordance();var t=this.GetSelection();this.m_selection=[],this._compareSelectionAndFire(e,t)},A.prototype.setDiscontiguousSelectionMode=function(e){this.m_discontiguousSelection=e,this._setAccInfoText(e?"accessibleRangeSelectModeOn":"accessibleRangeSelectModeOff")},A.prototype._selectEntireRow=function(e,t,i){var s=this.createIndex(e,0),n=this.createIndex(t,-1),o=this._getSelectionStartAndEnd(s,n,0);"row"===this.m_options.getSelectionMode()?this._selectRange(this.createIndex(o.min.row),this.createIndex(o.max.row),i):this._selectRange(this.createIndex(o.min.row,0),this.createIndex(o.max.row,-1),i)},A.prototype._selectEntireColumn=function(e,t,i){var s=this.createIndex(0,e),n=this.createIndex(-1,t),o=this._getSelectionStartAndEnd(s,n,0);this._selectRange(this.createIndex(0,o.min.column),this.createIndex(-1,o.max.column),i)},A.prototype._selectRange=function(e,t,i){this.unhighlightSelection(),this._createRangeWithKeys(e,t,this._selectRangeCallback.bind(this,i))},A.prototype._selectRangeCallback=function(e,t){var i,s=this.GetSelection();(i=this.m_discontiguousSelection||!e||this.m_utils.ctrlEquivalent(e)&&this.isMultipleSelection()&&0===e.button?this.m_utils.ctrlEquivalent(e)&&this.isMultipleSelection()&&!0===e.shiftKey?s.slice(0,s.length-1):s.slice(0):[]).push(t),this.m_selection=i,this.rehighlightSelection(),this._isDatabodyCellActive()&&e.target[this.getResources().getMappedAttribute("context")]&&!e.target[this.getResources().getMappedAttribute("context")].axis&&!this.m_selectionFrontier.axis&&(this.m_selectionFrontier=this.m_active.indexes,this._highlightActive()),this._compareSelectionAndFire(e,s)},A.prototype.rehighlightSelection=function(){for(var e=0;e<this.m_selection.length;e++)this.highlightRange(this.m_selection[e])},A.prototype.GetSelection=function(){return null==this.m_selection&&(this.m_selection=[]),this.m_selection},A.prototype.SetSelection=function(e){void 0!==e&&(null===e&&(e=[]),this.unhighlightSelection(),this.m_selection=e,this._resetHeaderHighLight(),null!=this.m_databody&&this.applySelection(this.m_startRow,this.m_endRow,this.m_startCol,this.m_endCol),this.m_bottomFloodFillIconContainer&&(1===this.m_selection.length?this._moveFloodFillAffordance():this._removeFloodFillAffordance()))},A.prototype.fireSelectionEvent=function(e,t){var i={event:e,ui:{selection:this.GetSelection(),previousSelection:t}};this.fireEvent("select",i)},A.prototype.extendSelection=function(e,t,i){if("header"!==this.m_active.type){var s;if(this.m_utils.isTouchDevice())s=this.m_touchSelectAnchor;else s={row:this.m_active.indexes.row,column:this.m_active.indexes.column};if(null!=s){this._resetSelectionFrontierFocus();var n=this._updateSelectionFrontier(s,e,i),o=n.min,r=n.max;if("row"===this.m_options.getSelectionMode()&&(o=this.createIndex(o.row),r=this.createIndex(r.row)),this.m_discontiguousSelection&&(this.m_deselectInProgress||this._isContainSelection(s,this.GetSelection().slice(0,-1)))){this.m_deselectInProgress||(this.m_deselectInfo={anchor:s,selection:this.GetSelection()});var l=this._trimRangeForSelectionMode(this.createRange(o,r));this.m_deselectInProgress=this._deselectRange(l,t)}else this._createRangeWithKeys(o,r,this._extendSelectionCallback.bind(this,t,s))}}},A.prototype.extendDeselection=function(e,t){var i=this.m_deselectInfo.anchor,s=this._updateSelectionFrontier(i,e),n=s.min,o=s.max,r=this._trimRangeForSelectionMode(this.createRange(n,o));this._deselectRange(r,t)},A.prototype.extendSelectionHeader=function(e,t,i,s){if(null!==e){var n=this.findCellOrHeader(e);if(null!==n){var o,r,l,a,h,d=n[this.getResources().getMappedAttribute("context")];if(null==i&&(i=this.m_discontiguousSelection),d){if(d.cell)a=l=-1!==this.m_selectionFrontier.axis.indexOf("column")?d.indexes.column:d.indexes.row,h=l;else{if(this.m_selectionFrontier&&d.index===this.m_selectionFrontier.index&&d.level===this.m_selectionFrontier.level)return;1===d.extent?(l=d.index,a=d.index,h=d.index):a=(l=this._getAttribute(e.parentNode,"start",!0))+(this._getAttribute(e.parentNode,"extent",!0)-1)}var c=s?this.m_deselectInfo.sourceParent:this._getActiveElement();if(c){var m,u,_,p=c[this.getResources().getMappedAttribute("context")];if(s?(r=this.m_deselectInfo.axis,o=this.m_deselectInfo.anchor[r],u=(m=this._getAttribute(c.parentNode,"start",!0))+(this._getAttribute(c.parentNode,"extent",!0)-1)):this.m_utils.isTouchDevice()?(-1===(o=-1!==this.m_selectionFrontier.axis.indexOf("column")?this.m_touchSelectAnchor.column:this.m_touchSelectAnchor.row)&&(o=0),m=o,u=o,r=this.m_selectionFrontier.axis):(u=(m=this._getAttribute(c.parentNode,"start",!0))+(this._getAttribute(c.parentNode,"extent",!0)-1),"header"===this.m_active.type&&(r=this.m_active.axis,o=this.m_active.index)),"cell"===this.m_active.type?(_=1,o=-1!==(r=d.axis).indexOf("row")?this.m_active.indexes.row:this.m_active.indexes.column):_=p.extent,i&&!s){var g=this.m_selection[this.m_selection.length-1];this.unhighlightSelection(),g&&this.checkCorners(r,o,g)&&this.m_selection.pop()}if(1!==_?l<=m&&a>=u||l>=m&&a<=u?(this.m_headerDragState||this._setActive(n,this._createActiveObject(n),t),o=l,h=a):l>m&&a>u?(o=m,h=a):l<m&&a<u&&(o=l,h=u):1===_&&l!==a&&(l<=o&&o<=a?(this.m_headerDragState||"cell"===this.m_active.type||this._setActive(n,this._createActiveObject(n),t),o=l,h=a):l<=o&&a<=o?(h=o,o=l):l>=o&&a>=o&&(h=a)),d.cell?this.setHeaderSelectionFrontier(r,h,h,this.m_selectionFrontier.level,n,!0):this.setHeaderSelectionFrontier(r,h,d.index,d.level,n,!0),!s&&r)-1!==r.indexOf("column")?this._selectEntireColumn(o,h,t):-1!==r.indexOf("row")&&this._selectEntireRow(o,h,t);else{var f,C=Math.min(o,h),y=Math.max(o,h);f=null!=r&&-1!==r.indexOf("row")?this.createRange(this.createIndex(C,0),this.createIndex(y,-1)):this.createRange(this.createIndex(0,C),this.createIndex(-1,y));var v=this._trimRangeForSelectionMode(f);this._deselectRange(v,t)}}}}}},A.prototype._updateSelectionFrontier=function(e,t,i){var s,n,o;if("row"===this.m_options.getSelectionMode()?(s=this.createIndex(e.row,this.m_startCol),n=this.createIndex(t.row,this.m_endCol)):(s=e,n=t),null!=i){if(this.m_deselectInProgress)o=this.createRange(this.m_deselectInfo.anchor,this.m_selectionFrontier);else{var r=this.GetSelection();o=r[this._getLastAnchoredSelectionIndex(r,s)]}var l=o.startIndex,a=o.endIndex;l.row===this.m_selectionFrontier.row&&s.row!==l.row?s.row=a.row:a.row===this.m_selectionFrontier.row&&s.row!==a.row&&(s.row=l.row),l.column===this.m_selectionFrontier.column&&s.column!==l.column?s.column=a.column:a.column===this.m_selectionFrontier.column&&s.column!==a.column&&(s.column=l.column)}var h=this._getSelectionStartAndEnd(s,n,0),d=n;if(null!=i){var c=h.min,m=h.max;for("row"===this.m_options.getSelectionMode()&&(c=this.createIndex(c.row),m=this.createIndex(m.row));this._compareIndividualSelectionObjects(o,this.createRange(c,m));){if(i===this.keyCodes.LEFT_KEY){if(0===n.column)break;n.column-=1}else if(i===this.keyCodes.RIGHT_KEY){if(n.column===this.m_endCol)break;n.column+=1}else if(i===this.keyCodes.UP_KEY){if(0===n.row)break;n.row-=1}else{if(i!==this.keyCodes.DOWN_KEY)break;if(n.row===this.m_endRow)break;n.row+=1}c=(h=this._getSelectionStartAndEnd(s,n,0)).min,m=h.max,"row"===this.m_options.getSelectionMode()&&(c=this.createIndex(c.row),m=this.createIndex(m.row))}i===this.keyCodes.LEFT_KEY?(d.column=c.column<s.column?c.column:m.column,d.row=c.row<s.row?c.row:m.row):i===this.keyCodes.RIGHT_KEY?(d.column=m.column>s.column?m.column:c.column,d.row=c.row<s.row?c.row:m.row):i===this.keyCodes.UP_KEY?(d.row=c.row<s.row?c.row:m.row,d.column=c.column<s.column?c.column:m.column):i===this.keyCodes.DOWN_KEY&&(d.row=m.row>s.row?m.row:c.row,d.column=c.column<s.column?c.column:m.column)}else d=this.getCellIndexes(this._getCellByIndex(d));return"row"===this.m_options.getSelectionMode()&&(d=this.createIndex(d.row,this.m_active.indexes.column)),this.m_selectionFrontier=d,h},A.prototype._getMinOrMax=function(e,t,i){return isNaN(e)?isNaN(t)?null:t:isNaN(t)?e:i(e,t)},A.prototype._getSelectionStartAndEnd=function(e,t,i){var s=this.getElementsInRange(this.createRange(e,t));if(null==s||s.length===i)return{min:e,max:t};for(var n={row:this._getMinOrMax(e.row,t.row,Math.min),column:this._getMinOrMax(e.column,t.column,Math.min)},o={row:this._getMinOrMax(e.row,t.row,Math.max),column:this._getMinOrMax(e.column,t.column,Math.max)},r=0;r<s.length;r++){var l=this.getCellIndexes(s[r]),a=this.getCellEndIndexes(s[r]);(l.row<n.row||null==n.row)&&(n.row=l.row),(l.column<n.column||null==n.column)&&(n.column=l.column),(a.row>o.row||null==o.row)&&(o.row=a.row),(a.column>o.column||null==o.column)&&(o.column=a.column)}return this._getSelectionStartAndEnd(n,o,s.length)},A.prototype._getLastAnchoredSelectionIndex=function(e,t){var i;for(i=e.length-1;i>-1;i--)if(this._isContainSelection(t,[e[i]]))return i;return i-1},A.prototype._extendSelectionCallback=function(e,t,i){var s=this.GetSelection(),n=this._getLastAnchoredSelectionIndex(s,t),o=s[n];if(null!=o){var r=o.startIndex.row===i.startIndex.row;null!=o.startIndex.column&&null!=i.startIndex.column&&(r=r&&o.startIndex.column===i.startIndex.column);var l=o.endIndex.row===i.endIndex.row;if(null!=o.endIndex.column&&null!=i.endIndex.column&&(l=l&&o.endIndex.column===i.endIndex.column),!r||!l){var a;if(this.m_discontiguousSelection||e&&this.m_utils.ctrlEquivalent(e)&&0===e.button?(a=s.slice(0),this.unhighlightRange(o),a.splice(n,1)):(a=[],this.unhighlightSelection()),a.push(i),this.m_selection=a,this.m_discontiguousSelection||e&&this.m_utils.ctrlEquivalent(e)&&0===e.button)for(var h=0;h<this.m_selection.length;h++)this.highlightRange(this.m_selection[h]);else this.highlightRange(i,!0);this._makeSelectionFrontierFocus(),this._compareSelectionAndFire(e,s)}}},A.prototype._resetSelectionFrontierFocus=function(){if(!(null==this.m_selectionFrontier||this._isDatabodyCellActive()&&this.m_selectionFrontier.row===this.m_active.indexes.row&&this.m_selectionFrontier.column===this.m_active.indexes.column)){var e=this.createRange(this.m_selectionFrontier),t=this.getElementsInRange(e);null!=t&&t.length>0&&this._unsetAriaProperties(t[0])}},A.prototype._makeSelectionFrontierFocus=function(){if(!(null==this.m_selectionFrontier||this._isDatabodyCellActive()&&this.m_selectionFrontier.row===this.m_active.indexes.row&&this.m_selectionFrontier.column===this.m_active.indexes.column)){if(this._isDatabodyCellActive()){var e=this.createRange(this.m_active.indexes),t=this.getElementsInRange(e);null!=t&&t.length>0&&this._unsetAriaProperties(t[0])}var i=this.createRange(this.m_selectionFrontier),s=this.getElementsInRange(i);if(null!=s&&0!==s.length){this._updateContextInfo(this.m_selectionFrontier);var n=this.m_utils.containsCSSClassName(s[0],this.getMappedStyle("row"))?s[0].firstChild:s[0];this._setAriaProperties(this._createActiveObject(n),null,n)}}},A.prototype._selectHeader=function(e,t,i,s){var n,o;if(-1!==e.indexOf("row")&&this.m_rowHeaderLevelCount-1===i||-1!==e.indexOf("column")&&this.m_columnHeaderLevelCount-1===i)n=t,o=t;else{var r=this._getActiveElement();o=(n=this._getAttribute(r.parentNode,"start",!0))+(this._getAttribute(r.parentNode,"extent",!0)-1)}-1!==e.indexOf("row")?((n===o&&!this.isMultipleSelection()||this.isMultipleSelection())&&(this.setHeaderSelectionFrontier(e,o,t,i,s.target,!0),this._selectEntireRow(n,o,s)),this._setAccInfoText("accessibleRowSelected",{row:t+1})):-1!==e.indexOf("column")&&(this.setHeaderSelectionFrontier(e,o,t,i,s.target,!0),this._selectEntireColumn(n,o,s),this._setAccInfoText("accessibleColumnSelected",{column:t+1})),this.isMultipleSelection()&&(this.m_headerDragState=!0)},A.prototype.setHeaderSelectionFrontier=function(e,t,i,s,n,o){o&&(this.m_selectionFrontier={}),this.m_selectionFrontier.axis=e,this.m_selectionFrontier.end=t,this.m_selectionFrontier.index=i,this.m_selectionFrontier.level=s,this.m_selectionFrontier.target=n},A.prototype._resetHeaderHighLight=function(){this.GetSelection().forEach(e=>{var t=this.getHeadersByRange(e,"row"),i=this.getHeadersByRange(e,"column");this._highlightHeaders(e,t,i)})},A.prototype.updateSelectionHeader=function(){this.m_selectionFrontier&&this.m_selectionFrontier.target&&(this.m_utils.isTouchDevice()&&this.m_selection.length&&(this.m_touchSelectAnchor=this.m_selection[this.m_selection.length-1].startIndex),this.extendSelectionHeader(this.m_selectionFrontier.target,null)),this._resetHeaderHighLight()},A.prototype.selectAndFocus=function(e,t,i){null==i&&(i=!1),this._resetSelectionFrontierFocus(),this._setActiveByIndex(e,t),"row"===this.m_options.getSelectionMode()&&(e=this.createIndex(e.row));var s=this._getSelectionStartAndEnd(e,e,0),n=s.min,o=s.max;"row"===this.m_options.getSelectionMode()&&(n=this.createIndex(n.row),o=this.createIndex(o.row)),this._createRangeWithKeys(n,o,this._selectAndFocusRangeCallback.bind(this,n,t,i))},A.prototype._selectAndFocusRangeCallback=function(e,t,i,s){var n=this.GetSelection(),o=n.slice(0);i||(this.m_discontiguousSelection||!t||this.isMultipleSelection()&&this.m_utils.ctrlEquivalent(t)&&0===t.button?!this._isDatabodyCellActive()||null==this.m_prevActive||"cell"!==this.m_prevActive.type||this.m_selectionFrontier.row!==this.m_prevActive.indexes.row||this.m_selectionFrontier.column!==this.m_prevActive.indexes.column||this.m_utils.isTouchDevice()||!t.keyCode&&this.isMultipleSelection()||(o.pop(),this._unhighlightDiscontiguousSelection(o)):(this.unhighlightSelection(),o=[])),this.m_selectionFrontier=e,o.push(s),this.m_selection=o,this.highlightRange(s),this._compareSelectionAndFire(t,n)},A.prototype._getSurrondingCellIndexes=function(e,t,i){let s={};return Object.assign(s,t),s[e]+=i,s},A.prototype._unhighlightDiscontiguousSelection=function(e){var t=this._getContainedSelectionCssClass(this.m_prevActive.indexes,e);let i=this._getSurrondingCellIndexes("row",this.m_prevActive.indexes,-1),s=this._getSurrondingCellIndexes("column",this.m_prevActive.indexes,-1),n=this._getSurrondingCellIndexes("row",this.m_prevActive.indexes,1),o=this._getSurrondingCellIndexes("column",this.m_prevActive.indexes,1),r=this._getContainedSelectionCssClass(s,e),l=this._getContainedSelectionCssClass(i,e),a=this._getContainedSelectionCssClass(o,e),h=this._getContainedSelectionCssClass(n,e);if(t.contains){let e=t.class,n=-1!==e.indexOf("topSelected"),o=-1!==e.indexOf("bottomSelected"),d=-1!==e.indexOf("startSelected"),c=-1!==e.indexOf("endSelected"),m=[];e.length?(n&&o?c&&d||(c&&this.unhighlightPreviousColumnCell(r,s),d&&this.getNextColumnCellSelectedClass(a,m),d||c||(this.getNextColumnCellSelectedClass(a,m),this.unhighlightPreviousColumnCell(r,s)),n||this.unhighlightPreviousRowCell(l,i),o||this.getNextRowCellSelectedClass(h,m)):(n&&this.getNextRowCellSelectedClass(h,m),o&&this.unhighlightPreviousRowCell(l,i),n||o||(this.getNextRowCellSelectedClass(h,m),this.unhighlightPreviousRowCell(l,i)),d||this.unhighlightPreviousColumnCell(r,s),c||this.getNextColumnCellSelectedClass(a,m)),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),m)):(this.getNextRowCellSelectedClass(h,m),c||this.getNextColumnCellSelectedClass(a,m),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),m),d||this.unhighlightPreviousColumnCell(r,s),this.unhighlightPreviousRowCell(l,i))}else{let e=["selected","topSelected","startSelected"];h.contains||e.push("bottomSelected"),a.contains||e.push("endSelected"),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),e),l.contains||this._unhighlightElement(this._getCellByIndex(i),["bottomSelected"]),r.contains||this._unhighlightElement(this._getCellByIndex(s),["endSelected"])}},A.prototype.unhighlightPreviousRowCell=function(e,t){e.contains?-1===e.class.indexOf("bottomSelected")&&this._unhighlightElement(this._getCellByIndex(t),["bottomSelected"]):this._unhighlightElement(this._getCellByIndex(t),["bottomSelected"])},A.prototype.unhighlightPreviousColumnCell=function(e,t){e.contains?-1===e.class.indexOf("endSelected")&&this._unhighlightElement(this._getCellByIndex(t),["endSelected"]):this._unhighlightElement(this._getCellByIndex(t),["endSelected"])},A.prototype.getNextColumnCellSelectedClass=function(e,t){e.contains?-1===e.class.indexOf("startSelected")&&t.push("endSelected"):t.push("endSelected")},A.prototype.getNextRowCellSelectedClass=function(e,t){e.contains?-1===e.class.indexOf("topSelected")&&t.push("bottomSelected"):t.push("bottomSelected")},A.prototype._compareSelectionAndFire=function(e,t){var i=this.GetSelection();this.isMultipleSelection()&&i.length>0&&(this.m_utils.isTouchDevice()?(this._addTouchSelectionAffordance(e),this._moveTouchSelectionAffordance()):this.m_options.isFloodFillEnabled()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"cell"===this.m_active.type&&(this._addFloodfillAffordance(e),this._moveFloodFillAffordance())),this._compareSelections(i,t)||(this._resetHeaderHighLight(),this.fireSelectionEvent(e,t))},A.prototype._addTouchSelectionAffordance=function(e){if(null==this.m_topSelectIconContainer&&null==this.m_bottomSelectIconContainer){var t=e.target,i=this.findCell(t);if(i||(i=this.findHeader(t)),!i)return;this.m_topSelectIconContainer=document.createElement("div"),this.m_topSelectIconContainer.className=this.getMappedStyle("toucharea");var s=document.createElement("div");s.className=this.getMappedStyle("selectaffordance"),s.setAttribute("role","button"),s.setAttribute("aria-label",this.getResources().getTranslatedText("accessibleSelectionAffordanceTop")),this.m_topSelectIconContainer.appendChild(s),this.m_bottomSelectIconContainer=document.createElement("div"),this.m_bottomSelectIconContainer.className=this.getMappedStyle("toucharea");var n=document.createElement("div");n.className=this.getMappedStyle("selectaffordance"),n.setAttribute("role","button"),n.setAttribute("aria-label",this.getResources().getTranslatedText("accessibleSelectionAffordanceBottom")),this.m_bottomSelectIconContainer.appendChild(n),this.m_databody.firstChild.appendChild(this.m_topSelectIconContainer),this.m_databody.firstChild.appendChild(this.m_bottomSelectIconContainer),this.m_touchSelectionAffordanceHeight=this.m_topSelectIconContainer.firstElementChild.offsetHeight,this.m_touchSelectionAffordanceWidth=this.m_topSelectIconContainer.firstElementChild.offsetWidth}},A.prototype._addRoundedAffordanceClasses=function(e,t,i,s){if(e&&t)i||"row"!==s?i||"column"!==s?(e.classList.add(this.getMappedStyle("selectaffordancetopcornerbounded")),t.classList.add(this.getMappedStyle("selectaffordancebottomcornerbounded"))):(e.classList.add(this.getMappedStyle("selectaffordancetopcolumn")),t.classList.add(this.getMappedStyle("selectaffordancebottomcolumn"))):(e.classList.add(this.getMappedStyle("selectaffordancetoprow")),t.classList.add(this.getMappedStyle("selectaffordancebottomrow")));else if(t){let e;e=i||"row"!==s?i||"column"!==s?"selectaffordancebottomcornerbounded":"selectaffordancebottomcolumn":"selectaffordancebottomrow",t.classList.add(this.getMappedStyle(e))}},A.prototype._clearRoundedAffordanceClasses=function(e,t){e&&(e.classList.remove(this.getMappedStyle("selectaffordancetopcornerbounded")),e.classList.remove(this.getMappedStyle("selectaffordancetopcolumn")),e.classList.remove(this.getMappedStyle("selectaffordancetoprow"))),t.classList.remove(this.getMappedStyle("selectaffordancebottomcornerbounded")),t.classList.remove(this.getMappedStyle("selectaffordancebottomcolumn")),t.classList.remove(this.getMappedStyle("selectaffordancebottomrow"))},A.prototype._removeTouchSelectionAffordance=function(e){(this._isDatabodyCellActive()||e)&&this.m_topSelectIconContainer&&this.m_topSelectIconContainer.parentNode&&(this.m_topSelectIconContainer.parentNode.removeChild(this.m_topSelectIconContainer),this.m_bottomSelectIconContainer.parentNode.removeChild(this.m_bottomSelectIconContainer))},A.prototype._moveTouchSelectionAffordance=function(){var e,t,i=this.getResources().isRTLMode()?"right":"left",s=this.GetSelection();if(s.length>0){var n=this.m_options.getSelectionMode(),o=this._getTouchSelectionAffordanceSize();if(null!=this.m_topSelectIconContainer&&null!=this.m_bottomSelectIconContainer){var r=this.m_topSelectIconContainer.firstElementChild,l=this.m_bottomSelectIconContainer.firstElementChild;if(this._clearRoundedAffordanceClasses(r,l),"row"===n||-1!==s[s.length-1].endIndex.row&&-1===s[s.length-1].endIndex.column){this._addRoundedAffordanceClasses(r,l,!1,"row");const n=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft-o/2;let a;if(this.setElementDir(this.m_topSelectIconContainer,n,i),this.setElementDir(this.m_bottomSelectIconContainer,n,i),e=this._getAxisCellsByKey(s[s.length-1].startKey.row,"row"),(t=this._getAxisCellsByKey(s[s.length-1].endKey.row,"row"))&&t.length&&(a=t[0]),!a){let e=this.createIndex(-1,0),t=this.getElementsInRange(this.createRange(e,e));a=t[t.length-1]}this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(e[0],"top")-this.m_touchSelectionAffordanceHeight-1,"top"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(a,"top")+this.getElementHeight(a)-o+this.m_touchSelectionAffordanceHeight,"top")}else if(-1!==s[s.length-1].endIndex.column&&-1===s[s.length-1].endIndex.row){this._addRoundedAffordanceClasses(r,l,!1,"column"),e=this._getAxisCellsByKey(s[s.length-1].startKey.column,"column"),t=this._getAxisCellsByKey(s[s.length-1].endKey.column,"column");var a=this.getElementHeight(this.m_databody)/2+this.m_currentScrollTop-o/2;this.setElementDir(this.m_topSelectIconContainer,a,"top"),this.setElementDir(this.m_bottomSelectIconContainer,a,"top"),this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(e[0],"left")-this.m_touchSelectionAffordanceWidth-2,"left"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(t[0],"left")+this.getElementWidth(t[0])-(o-this.m_touchSelectionAffordanceWidth-1),"left")}else{this._addRoundedAffordanceClasses(r,l,!0);var h=this._getCellByIndex(s[s.length-1].startIndex),d=this._getCellByIndex(s[s.length-1].endIndex);if(!d){let e=this.createIndex(-1,-1),t=this.getElementsInRange(this.createRange(e,e));d=t[t.length-1]}this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(h,"top")-this.m_touchSelectionAffordanceHeight-1,"top"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(d,"top")+this.getElementHeight(d)-o+this.m_touchSelectionAffordanceWidth,"top"),this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(h,i)-this.m_touchSelectionAffordanceWidth-2,i),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(d,i)+this.getElementWidth(d)-(o-this.m_touchSelectionAffordanceWidth),i)}null==this.m_topSelectIconContainer.parentNode&&(this.m_databody.firstChild.appendChild(this.m_topSelectIconContainer),this.m_databody.firstChild.appendChild(this.m_bottomSelectIconContainer))}}},A.prototype._scrollTouchSelectionAffordance=function(){var e,t,i=this.m_options.getSelectionMode();if("row"===i)null!=this.m_topSelectIconContainer&&(t=this.getResources().isRTLMode()?"right":"left",e=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft,this.setElementDir(this.m_topSelectIconContainer,e,t),this.setElementDir(this.m_bottomSelectIconContainer,e,t));else if("cell"===i&&this.isHeaderSelectionType(this.m_selectionFrontier)&&null!=this.m_topSelectIconContainer)if(-1!==this.m_selectionFrontier.axis.indexOf("row"))t=this.getResources().isRTLMode()?"right":"left",e=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft,this.setElementDir(this.m_topSelectIconContainer,e,t),this.setElementDir(this.m_bottomSelectIconContainer,e,t);else{var s=this.getElementHeight(this.m_databody)/2+this.m_currentScrollTop;this.setElementDir(this.m_topSelectIconContainer,s,"top"),this.setElementDir(this.m_bottomSelectIconContainer,s,"top")}},A.prototype._getTouchSelectionAffordanceSize=function(){if(null==this.m_touchSelectionAffordanceSize){var e=document.createElement("div");e.className=this.getMappedStyle("toucharea"),e.style.visibilty="hidden",e.style.top="0px",e.style.visibilty="0px",this.m_root.appendChild(e);var t=e.offsetWidth;this.m_root.removeChild(e),this.m_touchSelectionAffordanceSize=t}return this.m_touchSelectionAffordanceSize},A.SORT_ANIMATION_DURATION=800,A.prototype._handleSortContainerMouseOver=function(e){var t=e.target,i=this.findHeader(t),s=this._getSortIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("sortIcon"))&&(this.m_utils.addCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("disabled")))},A.prototype._handleSortMouseOut=function(e){if(!this._databodyEmpty()){var t,i=e.target,s=e.relatedTarget,n=this.findHeader(i);null!=n&&null!=s&&n===this.findHeader(s)||this._displaySortIcon(n),(t=this._getSortIcon(n))&&(this.m_utils.removeCSSClassName(t,this.getMappedStyle("hover")),this.m_utils.containsCSSClassName(t,this.getMappedStyle("selected"))||(this.m_utils.addCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("enabled"))));var o=this._getSortContainer(n);o&&(this.m_utils.removeCSSClassName(o,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(o,this.getMappedStyle("selected")))}},A.prototype._handleSortIconMouseDown=function(e){this._databodyEmpty()||(this.m_utils.addCSSClassName(e,this.getMappedStyle("selected")),this.m_utils.removeCSSClassName(e,this.getMappedStyle("disabled")))},A.prototype._toggleSortIconDirection=function(e,t){if(null!=e){var i=this._getSortIcon(e);"descending"===t&&(this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))?(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortascending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdefault")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortdescending"))):"ascending"===t&&(this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))?(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdescending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdefault")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortascending"))):"default"===t&&(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdescending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortascending")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortdefault")))}},A.prototype._displaySortIcon=function(e){var t=!1;if(null!=e){var i=this._getSortIcon(e);null!=this.m_sortInfo&&(t=this.m_sortInfo.key===this._getKey(e)),t&&this.m_utils.addCSSClassName(i,this.getMappedStyle("default"))}},A.prototype._buildSortIcon=function(e,t,i){var s=document.createElement("div");this.m_utils.addCSSClassName(s,this.getMappedStyle("iconContainer")),this.m_utils.addCSSClassName(s,this.getMappedStyle("sortIcon"));var n=document.createElement("div"),o=this.getMappedStyle("icon")+" "+this.getMappedStyle("clickableicon"),r=null!=this.m_sortInfo&&this.m_sortInfo.axis===i?this.m_sortInfo.key:null;if(e.key===r){var l=null!=this.m_sortInfo&&this.m_sortInfo.axis===i?this.m_sortInfo.direction:null;"ascending"===l?(n.className=this.getMappedStyle("sortascending")+" "+o,t.setAttribute(this.getResources().getMappedAttribute("sortDir"),l),n.setAttribute("title",this.getResources().getTranslatedText("labelSortDsc"))):"descending"===l?(n.className=this.getMappedStyle("sortdescending")+" "+o,t.setAttribute(this.getResources().getMappedAttribute("sortDir"),l),n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc"))):(n.className=this.getMappedStyle("sortdefault")+" "+o,n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc")))}else o+=" "+this.getMappedStyle("disabled"),n.className=this.getMappedStyle("sortdefault")+" "+o,n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc"));return s.appendChild(n),s.addEventListener("mouseover",this._handleSortContainerMouseOver.bind(this)),s},A.prototype._handleKeyboardSort=function(e,t){if(!this._databodyEmpty()){var i=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));i=null==i||"descending"===i?"ascending":"descending",this._doHeaderSort(t,e,i)}},A.prototype._handleHeaderSort=function(e,t){if(!this._databodyEmpty()){var i=e.target,s=this.findHeader(i);null!=s&&(null==t&&(t=null!=this.m_sortInfo&&this.m_sortInfo.key===this._getKey(s)&&"ascending"===this.m_sortInfo.direction?"descending":"ascending"),this._doHeaderSort(e,s,t))}},A.prototype._handleCellSort=function(e,t,i){null==i||this._databodyEmpty()||(this._removeTouchSelectionAffordance(),this._doHeaderSort(e,i,t))},A.prototype._doHeaderSort=function(e,t,i){if(!0!==this.m_isSorting){this.m_delayedSort=null;var s=this._getKey(t),n=this._getAxis(t);if(this._removeSortSelection(),t.setAttribute(this.getResources().getMappedAttribute("sortDir"),i),this.m_sortInfo={event:e,key:s,axis:n,direction:i,header:t},this._toggleSortIconDirection(t,i),this._addSortSelection(),this._setAccInfoText("ascending"===i?"accessibleSortAscending":"accessibleSortDescending",{id:s}),null!=i&&null!=s&&null!=n)if(this._isDataGridProvider())this._fireSortRequestEvent(n);else{this.m_isSorting=!0,this.showStatusText();var o={axis:n,key:s,direction:i};this.getDataSource().sort(o,{success:this._handleSortSuccess.bind(this),error:this._handleSortError.bind(this)})}}else this.m_delayedSort={event:e,header:t,direction:i}},A.prototype._handleSortError=function(){this.hideStatusText()},A.prototype._removeSortSelection=function(){if(null!=this.m_sortInfo){var e;if(!(e="column"===this.m_sortInfo.axis?this._findHeaderByKey(this.m_sortInfo.key,this.m_colHeader,this.getMappedStyle("colheadercell")):this._findHeaderByKey(this.m_sortInfo.key,this.m_rowHeader,this.getMappedStyle("rowheadercell"))))return;e.removeAttribute(this.getResources().getMappedAttribute("sortDir"));var t=this._getSortIcon(e);this._toggleSortIconDirection(e,"default"),"descending"===this.m_sortInfo.direction&&(this.m_utils.removeCSSClassName(t,this.getMappedStyle("sortdescending")),this.m_utils.addCSSClassName(t,this.getMappedStyle("sortascending"))),this.m_utils.addCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("default")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("selected")),this.m_utils.removeCSSClassName(this._getSortContainer(e),this.getMappedStyle("enabled"))}},A.prototype._addSortSelection=function(){if(null!=this.m_sortInfo){var e;e="column"===this.m_sortInfo.axis?this._findHeaderByKey(this.m_sortInfo.key,this.m_colHeader,this.getMappedStyle("colheadercell")):this._findHeaderByKey(this.m_sortInfo.key,this.m_rowHeader,this.getMappedStyle("rowheadercell"));var t=this._getSortIcon(e);this.m_utils.addCSSClassName(t,this.getMappedStyle("default")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.addCSSClassName(t,this.getMappedStyle("selected"))}},A.prototype._getAxis=function(e){var t=this.getMappedStyle("colheadercell"),i=this.getMappedStyle("rowheadercell");return this.m_utils.containsCSSClassName(e,t)?"column":this.m_utils.containsCSSClassName(e,i)?"row":null},A.prototype._handleSortSuccess=function(){this.hideStatusText(),this._isDatabodyCellActive()?this._indexes({row:this.m_active.keys.row,column:this.m_active.keys.column},this._handlePreSortScrolling):this._fetchForSort(this.m_startRow,this.m_endRow-this.m_startRow+1,!1)},A.prototype._handlePreSortScrolling=function(e){var t=(-1===e.row?0:e.row)*this.m_avgRowHeight,i=t+this.m_avgRowHeight,s=this._isHighWatermarkScrolling();if(this.m_currentScrollTop<=t&&i<=this.m_currentScrollTop+this.getElementHeight(this.m_databody)||s)this._fetchForSort(this.m_startRow,this.m_endRow-this.m_startRow+1,!1);else{this.m_currentScrollTop=Math.min(t,this._getMaxScrollHeight());var n=Math.floor(this.m_currentScrollTop/this.m_avgRowHeight),o=n*this.m_avgRowHeight;this.m_startRow=n,this.m_endRow=-1,this.m_startRowHeader=n,this.m_endRowHeader=-1,this.m_startRowPixel=o,this.m_endRowPixel=o,this.m_startRowHeaderPixel=o,this.m_endRowHeaderPixel=o,this._fetchForSort(n,null,!0)}},A.prototype._fetchForSort=function(e,t,i){var s=document.createDocumentFragment(),n=document.createDocumentFragment();this.fetchHeaders("row",e,s,n,t,{success:this.handleHeadersFetchSuccessForSort.bind(this),error:this.handleCellsFetchError}),this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1,{success:this.handleCellsFetchSuccessForSort.bind(this,s,n,i),error:this.handleCellsFetchError})},A.prototype.handleHeadersFetchSuccessForSort=function(e,t,i,s){var n,o,r,l,a,h,d,c=t.axis,m=t.start,u=t.header,_=t.endHeader;if(this.m_fetching[c]=!1,null!=e){for(n=e.getCount(),l=0,o=0,h=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell"),d=this.getRendererOrTemplate("row");n-o>0;)r=m+o,o+=(a=this.buildLevelHeaders(u,r,0,0,this.m_startRowPixel+l,!0,s,d,e,"row",h,this.m_rowHeaderLevelCount)).count,l+=a.totalHeaderDimension;this.m_endRowHeader=this.m_startRowHeader+(n-1),this.m_endRowHeaderPixel=this.m_startRowHeaderPixel+l}if(null!=i){for(n=i.getCount(),l=0,o=0,h=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell"),d=this.getRendererOrTemplate("rowEnd");n-o>0;)r=m+o,o+=(a=this.buildLevelHeaders(_,r,0,0,this.m_startRowPixel+l,!0,s,d,i,"rowEnd",h,this.m_rowEndHeaderLevelCount)).count,l+=a.totalHeaderDimension;this.m_endRowEndHeader=this.m_startRowEndHeader+(n-1),this.m_endRowEndHeaderPixel=this.m_startRowEndHeaderPixel+l}this._signalTaskEnd()},A.prototype.handleCellsFetchSuccessForSort=function(e,t,i,s,n){var o;this.m_fetching.cells=!1;var r=A.SORT_ANIMATION_DURATION;this.isFetchComplete()&&this.hideStatusText();var l=n[0].start,a=s.getCount("row"),h=n[1].start,d=document.createDocumentFragment(),c=this._addCellsToFragment(d,s,l,this.m_startRowPixel,h,this.m_startColPixel);this.m_endRow=this.m_startRow+(a-1),this.m_endRowPixel=this.m_startRowPixel+c.totalRowHeight;var u=this.m_databody.firstChild,_=this.m_rowHeader.firstChild,p=this.m_rowEndHeader.firstChild;if(!0===i&&(o=this._isHighWatermarkScrolling(),this.m_utils.isTouchDeviceNotIOS()?(this._disableTouchScrollAnimation(),this.scrollTo(this.m_currentScrollLeft,this.m_currentScrollTop)):(this.m_silentScroll=!0,this.m_databody.scrollTop=this.m_currentScrollTop,this._syncScroller())),!r||!this.m_utils.supportsTransitions()||1===a||this.m_rowHeaderLevelCount>1&&null!=this.m_rowHeaderLevelCount||!1===o)this._signalTaskStart(),this._handleSortEnd(d,e,t);else if(this.m_isCustomElementCallback()){this._signalTaskStart("processing sort render");let i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("div");i.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),s.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),n.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),i.className=this.getMappedStyle("info"),s.className=this.getMappedStyle("info"),n.className=this.getMappedStyle("info"),i.appendChild(d),s.appendChild(e),n.appendChild(t),this.m_root.appendChild(i),this.m_root.appendChild(s),this.m_root.appendChild(n);var g=m.getContext(i).getBusyContext().whenReady(),f=m.getContext(s).getBusyContext().whenReady(),C=m.getContext(n).getBusyContext().whenReady();Promise.all([g,f,C]).then(function(){for(;i.childNodes.length>0;)d.appendChild(i.childNodes[0]);for(;s.childNodes.length>0;)e.appendChild(s.childNodes[0]);for(;n.childNodes.length>0;)t.appendChild(n.childNodes[0]);this.m_root.removeChild(i),this.m_root.removeChild(s),this.m_root.removeChild(n),this._signalTaskEnd(),this.processSortAnimationToPosition(r,0,"ease-in",_,e,u,d,p,t)}.bind(this))}else this.processSortAnimationToPosition(r,0,"ease-in",_,e,u,d,p,t);this._signalTaskEnd()},A.prototype._handleSortEnd=function(e,t,i,s,n,o){var r;if(t.childNodes.length>1){if(r=this.m_rowHeader.firstChild,n)for(let e=0;e<n.length;e++){let i=n[e];t.insertBefore(i.element,t.childNodes[i.index])}this.m_utils.empty(r),r.appendChild(t),this.m_subtreeAttachedCallback(r)}if(i.childNodes.length>1){if(r=this.m_rowEndHeader.firstChild,o)for(let e=0;e<o.length;e++){let t=o[e];i.insertBefore(t.element,i.childNodes[t.index])}this.m_utils.empty(r),r.appendChild(i),this.m_subtreeAttachedCallback(r)}var l=this.m_databody.firstChild,a=this.m_rowHeader.firstChild,h=this.m_rowEndHeader.firstChild;if(s)for(let t=0;t<s.length;t++)e.appendChild(s[t]);this._emptyDatabody(l),this._populateDatabody(l,e),this._fireSortEvent(),this._restoreActive(),this.m_isSorting=!1,this._doDelayedSort(),this.m_animating=!1;for(let e=0;e<l.childNodes.length;e++)this.removeTransformMoveStyle(l.childNodes[e]);if(-1!==this.m_endRowHeader)for(let e=0;e<a.childNodes.length;e++)this.removeTransformMoveStyle(a.childNodes[e]);if(-1!==this.m_endRowEndHeader)for(let e=0;e<h.childNodes.length;e++)this.removeTransformMoveStyle(h.childNodes[e]);this._signalTaskEnd(),this._runModelEventQueue()},A.prototype.processSortAnimationToPosition=function(e,t,i,s,n,o,r,l,a){var h,d,c,m,u,_,p,g,f,C,y=this;this._signalTaskStart();var v=n.childNodes.length>1,E=a.childNodes.length>1,w=this.getResources().isRTLMode()?"right":"left",S=this._getViewportBottom(),H=this._getViewportLeft(),x=this._getViewportRight(),b={},R={},I=[];for(m=0;m<o.childNodes.length;m++)u=o.childNodes[m],h=this._getKey(u,"row"),C=(f=this.getElementDir(u,w))+this.getElementWidth(u),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(f,C,d,_)&&(b[h]?b[h].cell.push(u):(c=S,b[h]={cell:[u],oldTop:d,newTop:c}),c-d!=0&&(g=u));for(m=0;m<s.childNodes.length;m++)v&&(u=s.childNodes[m],h=this._getKey(u,"row"),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(H,x,d,_)&&(c=S,b[h]||(b[h]={oldTop:d,newTop:c}),b[h].rowHeader=u));for(m=0;m<l.childNodes.length;m++)v&&(u=l.childNodes[m],h=this._getKey(u,"row"),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(H,x,d,_)&&(c=S,b[h]||(b[h]={oldTop:d,newTop:c}),b[h].rowEndHeader=u));for(m=0;m<r.childNodes.length;m++)u=r.childNodes[m],h=this._getKey(u,"row"),c=this.getElementDir(u,"top"),b[h]?b[h].newTop=c:(d=S,p=c+this.getElementHeight(u),C=(f=this.getElementDir(u,w))+this.getElementWidth(u),this._isCellBoundaryInViewport(f,C,c,p)&&(this.changeStyleProperty(u,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),I.push(u),R[h]?R[h].cell.push(u):R[h]={cell:[u],oldTop:d,newTop:c,add:!0},c-d!=0&&(g=u)));for(let e=0;e<I.length;e++)o.appendChild(I[e]);var M=[];for(m=0;m<n.childNodes.length;m++)if(v){var L=n.childNodes[m];h=this._getKey(L,"row"),b[h]||(p=(c=this.getElementDir(L,"top"))+this.getElementHeight(L),d=S,this._isCellBoundaryInViewport(H,x,c,p)&&(this.changeStyleProperty(L,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),M.push({element:L,index:m}),R[h]||(R[h]={oldTop:d,newTop:c,add:!0}),R[h].rowHeader=L))}for(let e=0;e<M.length;e++)s.appendChild(M[e].element);var A=[];for(m=0;m<a.childNodes.length;m++)if(E){var D=a.childNodes[m];h=this._getKey(D,"row"),b[h]||(p=(c=this.getElementDir(D,"top"))+this.getElementHeight(D),d=S,this._isCellBoundaryInViewport(H,-1,c,p)&&(this.changeStyleProperty(D,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),A.push({element:D,index:m}),R[h].rowEndHeader=D,R[h]||(R[h]={oldTop:d,newTop:c,add:!0})))}for(let e=0;e<A.length;e++)l.appendChild(A[e].element);if(null!=g){var T=this._handleSortEnd.bind(this,r,n,a,I,M,A);y._onTransitionEnd(g,T,e),this.m_animating=!0,setTimeout(function(){var s,n,o,r,l=0,a=Object.keys(b);for(r=0;r<a.length;r++){if(h=a[r],o=b[a[r]],n=t+"ms",s=o.newTop-o.oldTop,o.cell)for(l=0;l<o.cell.length;l++)y.addTransformMoveStyle(o.cell[l],e/2+"ms",n,i,0,s,0);v&&o.rowHeader&&y.addTransformMoveStyle(o.rowHeader,e/2+"ms",n,i,0,s,0),E&&o.rowEndHeader&&y.addTransformMoveStyle(o.rowEndHeader,e/2+"ms",n,i,0,s,0)}for(a=Object.keys(R),r=0;r<a.length;r++){if(h=a[r],o=R[a[r]],n=t*l+"ms",s=0,o.cell)for(var d=0;d<o.cell.length;d++)y.addTransformMoveStyle(o.cell[d],e/2+"ms",n,i,0,s,0);v&&o.rowHeader&&y.addTransformMoveStyle(o.rowHeader,e/2+"ms",n,i,0,s,0),E&&o.rowEndHeader&&y.addTransformMoveStyle(o.rowEndHeader,e/2+"ms",n,i,0,s,0)}},0)}else this._handleSortEnd(r,n,a)},A.prototype._restoreActive=function(){if(null!=this.m_active){var e=this.m_active.axis,t=this.m_sortInfo.originalEvent;if("cell"===this.m_active.type){var i=this._getCellByKeys(this.m_active.keys);if(null!=i){var s=this.getCellIndexes(i);this._isSelectionEnabled()?this.selectAndFocus(s,t):this._setActiveByIndex(s,t)}else this._setActive(null,null,t,!0),this._isSelectionEnabled()&&this._clearSelection(t)}else if("row"===e||"rowEnd"===e){var n="row"===e?this.m_rowHeader:this.m_rowEndHeader,o="row"===e?this.getMappedStyle("rowheadercell"):this.getMappedStyle("rowendheadercell"),r=this._findHeaderByKey(this.m_active.key,n,o);if(null!=r){var l=r[this.getResources().getMappedAttribute("context")];this._setActive(r,{type:"header",axis:e,index:l.index,key:l.key,level:l.level},t)}else this._setActive(null,null,t)}}},A.prototype._getSortIcon=function(e){return e.lastChild.firstChild},A.prototype._getSortContainer=function(e){return e.lastChild},A.prototype._fireSortEvent=function(){var e={event:this.m_sortInfo.event,ui:{header:this.m_sortInfo.key,direction:this.m_sortInfo.direction}};this.fireEvent("sort",e)},A.prototype._fireSortRequestEvent=function(){let e=this.m_sortInfo.header[this.getResources().getMappedAttribute("context")],t=this.m_sortInfo.header[this.getResources().getMappedAttribute("metadata")],i=this.buildHeaderTemplateContext(e,t).item;var s={event:this.m_sortInfo.event,ui:{direction:this.m_sortInfo.direction,item:i,axis:this.m_sortInfo.axis}};this.fireEvent("sortRequest",s)},A.prototype._doDelayedSort=function(){null!=this.m_delayedSort?this._doHeaderSort(this.m_delayedSort.event,this.m_delayedSort.header,this.m_delayedSort.direction):this.fillViewport()},A.prototype._fireExpandRequestEvent=function(e){const t=this.findHeader(e.target),i=t[this.getResources().getMappedAttribute("context")],s=t[this.getResources().getMappedAttribute("metadata")],n={item:this.buildHeaderTemplateContext(i,s).item,axis:i.axis},o=this._getDisclosureIcon(t);this.m_utils.removeCSSClassName(o,this.getMappedStyle("collapsed")),this.m_utils.addCSSClassName(o,this.getMappedStyle("expanded")),this.fireEvent("expandRequest",n)},A.prototype._fireCollapseRequestEvent=function(e){const t=this.findHeader(e.target),i=t[this.getResources().getMappedAttribute("context")],s=t[this.getResources().getMappedAttribute("metadata")],n={item:this.buildHeaderTemplateContext(i,s).item,axis:i.axis},o=this._getDisclosureIcon(t);this.m_utils.removeCSSClassName(o,this.getMappedStyle("expanded")),this.m_utils.addCSSClassName(o,this.getMappedStyle("collapsed")),this.fireEvent("collapseRequest",n)},A.prototype._handleExpandCollapseRequest=function(e){this._isHeaderExpanded(e.target)?this._fireCollapseRequestEvent(e):this._isHeaderCollapsed(e.target)&&this._fireExpandRequestEvent(e)},A.prototype._isTargetExpandCollapseEnabled=function(e){return this._isHeaderCollapsed(e)||this._isHeaderExpanded(e)},A.prototype._isHeaderCollapsed=function(e){const t=this._getDisclosureIcon(e);return!!t&&this.m_utils.containsCSSClassName(t,this.getMappedStyle("collapsed"))},A.prototype._isHeaderExpanded=function(e){const t=this._getDisclosureIcon(e);return!!t&&this.m_utils.containsCSSClassName(t,this.getMappedStyle("expanded"))},A.prototype._buildDisclosureIcon=function(e){const t=document.createElement("div");t.classList.add(this.getMappedStyle("iconContainer")),t.classList.add(this.getMappedStyle("disclosureIcon"));const i=document.createElement("div");let s;return i.classList.add(this.getMappedStyle("icon")),i.classList.add(this.getMappedStyle("clickableicon")),"expanded"===e.metadata.expanded?(i.classList.add(this.getMappedStyle("expanded")),s=this.getResources().getTranslatedText("collapsedText")):"collapsed"===e.metadata.expanded&&(i.classList.add(this.getMappedStyle("collapsed")),s=this.getResources().getTranslatedText("expandedText")),t.setAttribute("title",s),t.appendChild(i),t.addEventListener("mouseover",this._handleExpandCollapseContainerMouseOver.bind(this)),t.addEventListener("mouseout",this._handleDisclosureMouseOut.bind(this)),t},A.prototype._handleExpandCollapseContainerMouseOver=function(e){const t=e.target,i=this.findHeader(t),s=this._getDisclosureIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("disclosureIcon"))&&(this.m_utils.addCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("disabled")))},A.prototype._buildSpacer=function(e){const t=document.createElement("span");return this._addDataGridSpacerClass(t),this._addIndentation(e,t),t},A.prototype._getTreeDepth=function(e){return e.metadata.treeDepth?e.metadata.treeDepth:null},A.prototype._addDataGridSpacerClass=function(e){this.m_utils.addCSSClassName(e,this.getMappedStyle("spacer"))},A.prototype._isLeaf=function(e){return!e.metadata.expanded||null===e.metadata.expanded},A.prototype._addIndentation=function(e,t){let i=this._getTreeDepth(e);null!==i&&this._appendSpacerClass(i,t,e)},A.prototype._appendSpacerClass=function(e,t,i){t.style.width=e*A.SPACER_DEFAULT_WIDTH+(this._isLeaf(i)?A.SPACER_DEFAULT_WIDTH:0)+"rem"},A.prototype._handleDisclosureMouseOut=function(e){const t=e.target,i=this.findHeader(t),s=this._getDisclosureIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("disclosureIcon"))&&(this.m_utils.removeCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("enabled")))},A.prototype._isDisclosureIcon=function(e){return this.m_utils.containsCSSClassName(e,this.getMappedStyle("icon"))},A.prototype._getDisclosureIcon=function(e){return this.m_utils.containsCSSClassName(e,this.getMappedStyle("icon"))?e:e.getElementsByClassName(this.getMappedStyle("icon"))[0]},A.prototype._getDisclosureIconContainer=function(e){return e.firstChild};const D=function(e){this.datagridprovider=e,this.pendingHeaderCallback={},this._registerEventListeners(),this.totalRowCount=-1,this.totalColumnCount=-1,this.rowKeyMap=new N,this.columnKeyMap=new N,D.superclass.constructor.call(this)};function T(e,t,i){this.results=e,this.rowKeyMap=t,this.columnKeyMap=i,this.databodyResults=e.results.databody,this.rowStart=this.results.rowOffset,this.rowCount=this.results.rowCount,this.rowEnd=this.rowStart+this.rowCount-1,this.columnStart=this.results.columnOffset,this.columnCount=this.results.columnCount,this.columnEnd=this.columnStart+this.columnCount-1,this.lastItem=null}function F(e,t,i){this.results=e,this.axis=t,this.axisResults=e.results[this.axis+"Header"],this.axisLabels=e.results[this.axis+"HeaderLabel"],"row"===this.axis||"rowEnd"===this.axis?(this.start=this.results.rowOffset,this.count=this.results.rowCount):(this.start=this.results.columnOffset,this.count=this.results.columnCount),this.end=this.start+this.count-1,this.lastItem=null,this.keyMap=i,this.levelCount=null}function N(){this.keyMap=new Map,this.nextKey=0,this.set=(e,t,i,s)=>{const n=""+this.nextKey;null==s&&(s=1);for(let o=0;o<s;o++){let s=null==t?t:t+o,r=this.pairIndexLevel(e,s,i);this.keyMap.set(r,n)}return this.nextKey+=1,n},this.get=(e,t,i,s)=>{const n=this.pairIndexLevel(e,t,i);let o=this.keyMap.get(n);return null==o&&(o=this.set(e,t,i,s)),o},this.pairIndexLevel=(e,t,i)=>null==t||null!=i&&t===i-1?""+e:e+","+t,this.handleChange=(e,t)=>{let i=new Set;e.forEach(function(e){let t=e.offset,s=e.count;for(var n=0;n<s;n++)i.add(t+n)});let s=Array.from(i);s.sort(function(e,t){return e-t});let n=new Map;this.keyMap.forEach((e,i)=>{let o=i.split(","),r=parseInt(o[0],10),l=o[1];if(t&&s.some(e=>e===r))return;let a=0;if(r>=s[0]){let e=r;a=s.findIndex(i=>(!t&&e>=i&&(e+=1),i>e)),-1===a&&(a=s.length)}let h=t?r-a:r+a,d=this.pairIndexLevel(h,l);n.set(d,e)}),this.keyMap=n}}h.Object.createSubclass(D,h.DataGridDataSource,"DataGridProviderDataGridDataSource"),D.prototype.fetchHeaders=function(e,t,i){if(null!=t){var s=e.axis,n={headerRange:e,callbacks:t,callbackObjects:i};this.pendingHeaderCallback[s]=n}},D.prototype.fetchCells=function(e,t,i){let s,n,o,r;for(let t=0;t<e.length;t+=1){let i=e[t];"row"===i.axis?(s=i.start,n=i.count):"column"===i.axis&&(o=i.start,r=i.count)}let l,a=this.pendingHeaderCallback.row,h=this.pendingHeaderCallback.column;this.pendingHeaderCallback={},l=a&&h?["all"]:a?["databody","rowHeader","rowEndHeader","rowHeaderLabel","rowEndHeaderLabel"]:h?["databody","columnHeader","columnEndHeader","columnHeaderLabel","columnEndHeaderLabel"]:["databody"];let d={rowOffset:s,columnOffset:o,rowCount:n,columnCount:r,fetchRegions:new Set(l)},c=(s,n)=>{let o,r,l;null!=n?(s.results=Object.assign({},s.results,n.results),null!=n.next&&(o=n.next)):null!=s.next&&(o=s.next),this.totalRowCount=s.totalRowCount,this.totalColumnCount=s.totalColumnCount;let d=s.results;if(h&&(!o||null!=d.columnHeader&&null!=d.columnEndHeader&&null!=d.columnHeaderLabel&&null!=d.columnEndHeaderLabel)&&(r=h.callbacks,null!=r&&null!=r.success)){let e,t;l=h.callbackObjects,null!=d.columnHeader&&(e=new F(s,"column",this.columnKeyMap)),null!=d.columnEndHeader&&(t=new F(s,"columnEnd",this.columnKeyMap)),r.success.call(l.success,e,h.headerRange,t),h=null}if(a&&(!o||null!=d.rowHeader&&null!=d.rowEndHeader&&null!=d.rowHeaderLabel&&null!=d.rowEndHeaderLabel)&&(r=a.callbacks,null!=r&&null!=r.success)){let e,t;l=a.callbackObjects,null!=d.rowHeader&&(e=new F(s,"row",this.rowKeyMap)),null!=d.rowEndHeader&&(t=new F(s,"rowEnd",this.rowKeyMap)),r.success.call(l.success,e,a.headerRange,t),a=null}if(null!=t&&null!=t.success&&!o){let n=new T(s,this.rowKeyMap,this.columnKeyMap);t.success.call(i.success,n,e)}o&&o.then(c.bind(this,s))};this.datagridprovider.fetchByOffset(d).then(c)},D.prototype.getCapability=function(e){return"sort"===e?"full":"sort"===e||"move"===e?"none":null},D.prototype.getCount=function(e){return"row"===e?this.totalRowCount:"column"===e?this.totalColumnCount:-1},D.prototype.getCountPrecision=function(){return"exact"},D.prototype.indexes=function(){return{row:-1,column:-1}},D.prototype.keys=function(){return{row:null,column:null}},D.prototype.move=function(){},D.prototype.moveOK=function(){return"invalid"},D.prototype.sort=function(){},D.prototype._registerEventListeners=function(){this._addListener=this._handleDataGridProviderAddEvent.bind(this),this._removeListener=this._handleDataGridProviderRemoveEvent.bind(this),this._updateListener=this._handleDataGridProviderUpdateEvent.bind(this),this._refreshListener=this._handleDataGridProviderRefreshEvent.bind(this),this.datagridprovider.addEventListener("add",this._addListener),this.datagridprovider.addEventListener("remove",this._removeListener),this.datagridprovider.addEventListener("update",this._updateListener),this.datagridprovider.addEventListener("refresh",this._refreshListener)},D.prototype.Destroy=function(){this.datagridprovider.removeEventListener("add",this._addListener),this.datagridprovider.removeEventListener("remove",this._removeListener),this.datagridprovider.removeEventListener("update",this._updateListener),this.datagridprovider.removeEventListener("refresh",this._refreshListener)},D.prototype._handleDataGridProviderAddEvent=function(e){var t={source:this,operation:"insert",detail:e.detail};("row"===e.detail.axis?this.rowKeyMap:this.columnKeyMap).handleChange(e.detail.ranges,!1),this.handleEvent("change",t)},D.prototype._handleDataGridProviderRemoveEvent=function(e){var t={source:this,operation:"delete",detail:e.detail};("row"===e.detail.axis?this.rowKeyMap:this.columnKeyMap).handleChange(e.detail.ranges,!0),this.handleEvent("change",t)},D.prototype._handleDataGridProviderUpdateEvent=function(e){var t={source:this,operation:"update",detail:e.detail};this.handleEvent("change",t)},D.prototype._handleDataGridProviderRefreshEvent=function(){this.rowKeyMap=new N,this.columnKeyMap=new N;var e={source:this,operation:"refresh"};this.handleEvent("change",e)},T.prototype.getData=function(e){return this._findItemByIndex(e.row,e.column).data},T.prototype.getMetadata=function(e){let t=this._findItemByIndex(e.row,e.column);return{metadata:t.metadata,keys:{row:this.rowKeyMap.get(t.rowIndex),column:this.columnKeyMap.get(t.columnIndex)}}},T.prototype.getCount=function(e){if(null!=this.databodyResults){if("row"===e)return this.rowCount;if("column"===e)return this.columnCount}return 0},T.prototype.getExtent=function(e){let t=!1,i=!1,s=!1,n=!1,o=this._findItemByIndex(e.row,e.column),r=o.rowIndex,l=o.rowExtent,a=r+l-1,h=o.columnIndex,d=o.columnExtent,c=h+d-1;return r<this.rowStart&&(l-=this.rowStart-r,t=!0),a>this.rowEnd&&(l-=a-this.rowEnd,i=!0),h<this.columnStart&&(d-=this.columnStart-h,s=!0),c>this.columnEnd&&(d-=c-this.columnEnd,n=!0),{row:{extent:l,more:{before:t,after:i}},column:{extent:d,more:{before:s,after:n}}}},T.prototype._findItemByIndex=function(e,t){let i=i=>{let s=i.rowIndex,n=i.rowExtent,o=i.columnIndex,r=i.columnExtent;return e>=s&&e<s+n&&t>=o&&t<o+r};return null!=this.lastItem&&i(this.lastItem)||(this.lastItem=this.databodyResults.find(i)),this.lastItem},F.prototype.getData=function(e,t){return this._findItemByIndexLevel(e,t).data},F.prototype.getMetadata=function(e,t){let i=this._findItemByIndexLevel(e,t),s=i.metadata.sortDirection;return null!=s&&(s="unsorted"===i.metadata.sortDirection?null:s),{metadata:i.metadata,key:this.keyMap.get(i.index,i.level,this.getLevelCount(),i.depth),sortDirection:s}},F.prototype.getLevelCount=function(){if(null==this.levelCount){let e=0;null!=this.axisResults&&this.axisResults.forEach(t=>{let i=t.level+t.depth-1;i>e&&(e=i)}),this.levelCount=e+1}return this.levelCount},F.prototype.getExtent=function(e,t){let i=this._findItemByIndexLevel(e,t),s=i.extent,n=i.index,o=i.index+s-1,r=!1,l=!1;return n<this.start&&(s-=this.start-n,r=!0),o>this.end&&(s-=o-this.end,l=!0),{extent:s,more:{before:r,after:l}}},F.prototype.getLabel=function(e){return null!=this.axisLabels?this.axisLabels[e].data:null},F.prototype.getLabelMetadata=function(e){return null!=this.axisLabels?{metadata:this.axisLabels[e].metadata}:null},F.prototype.getDepth=function(e,t){return this._findItemByIndexLevel(e,t).depth},F.prototype.getCount=function(){return null!=this.axisResults?this.count:0},F.prototype._findItemByIndexLevel=function(e,t){let i=i=>{let s=i.index,n=i.extent,o=i.level,r=i.depth;return e>=s&&e<s+n&&t>=o&&t<o+r};return null!=this.lastItem&&i(this.lastItem)||(this.lastItem=this.axisResults.find(i)),this.lastItem},h.__registerWidget("oj.ojDataGrid",C.oj.baseComponent,{widgetEventPrefix:"oj",options:{bandingInterval:{row:0,column:0},data:null,gridlines:{horizontal:"visible",vertical:"visible"},scrollToKey:"auto",scrollPosition:{x:0,y:0},selectionMode:{cell:"none",row:"none"},dnd:{reorder:{row:"disable"},drag:null,drop:null},dataTransferOptions:{cut:"disable",copy:"disable",paste:"disable",fill:"disable"},scrollPolicy:"auto",scrollPolicyOptions:{maxRowCount:500,maxColumnCount:500},selection:[],currentCell:null,editMode:"none",header:{row:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},sortable:"auto",style:null},column:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},sortable:"auto",style:null},columnEnd:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},style:null},rowEnd:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},style:null}},cell:{className:null,renderer:null,style:null},resize:null,sort:null,sortRequest:null,collapseRequest:null,expandRequest:null,ready:null,scroll:null,beforeCurrentCell:null,beforeEdit:null,beforeEditEnd:null,cutRequest:null,copyRequest:null,pasteRequest:null,fillRequest:null},_ComponentCreate:function(){this._super(),this.root=this.element[0],this.rootId=this.root.getAttribute("id"),this.grid=new A(this.root),this.grid.setVisibility(A.VISIBILITY_STATE_RENDER),C(this.root).addClass("oj-datagrid oj-component"),C(this.root).attr(c._OJ_CONTAINER_ATTR,this.widgetName),u.disableDefaultBrowserStyling(this.root),this.redrawSet={data:"all",header:["className","renderer","style","template"]}},_AfterCreate:function(){var e=this;this._unregisterResizeListener(this.root),this._removeAllChildren(),this._super(),this.resources=new w(this._GetReadingDirection(),this._getTranslation.bind(e),{showIndicatorDelay:v.getCachedCSSVarValues(["--oj-private-core-global-loading-indicator-delay-duration"])[0]},this.widgetName),this._setDataSource(),this._setSelection(),null!=this.datasource&&(this.grid.SetDataSource(this.datasource),this._addContextMenu(),this._isCreate=!0,this.grid._addDataSourceEventListeners()),this._checkSelectionMode(this.options),this.grid.SetOptions(this.options,this._WrapCustomElementRenderer.bind(e)),this.grid.SetResources(this.resources),this.grid.SetCreateContextCallback(this._modifyContext.bind(e)),this.grid.SetFixContextCallback(this._FixRendererContext.bind(e)),this.grid.SetRemoveCallback(this._remove.bind(e)),this.grid.SetUniqueIdCallback(this._uniqueId.bind(e)),this.grid.SetCompareValuesCallback(this._compareValues.bind(e)),this.grid.SetNotReadyCallback(this._NotReady.bind(e)),this.grid.SetMakeReadyCallback(this._MakeReady.bind(e)),this.grid.SetOptionCallback(this.option.bind(e)),this.grid.SetSubtreeAttachedCallback(c.subtreeAttached),this.grid.SetContextCallback(m.getContext),this.grid.SetCustomElementCallback(this._IsCustomElement.bind(e)),this.grid.SetUpdateScrollPostionOnRefreshCallback(this._updateScrollPositionOnRefresh.bind(e)),this.grid.SetCustomElement(this._GetCustomElement()),this._focusable({applyHighlight:!0,setupHandlers:function(t,i){e.grid.SetFocusableCallback.call(e.grid,function(e){return t(C(e))},function(e){return i(C(e))})}}),this._registerEventListeners(),this._possiblyRenderOrRefresh()},_SetupResources:function(){this._super(),this.setupResources()},setupResources:function(){null!=this.datasource&&(this._isCreate||this.grid._addDataSourceEventListeners(),this.grid._addDomEventListeners(),this._registerResizeListener(this.root)),this._isCreate=!1},_ReleaseResources:function(){this._super(),this.releaseResources()},releaseResources:function(){this.grid._removeDataSourceEventListeners(),this.grid._removeDomEventListeners(),this._unregisterResizeListener(this.root),this.contextMenuEvent=null},_registerEventListeners:function(){var e=this;this.grid.addListener("resize",function(t){e._trigger("resize",t.event,t.ui)}),this.grid.addListener("select",function(t){e.option("selection",t.ui.selection,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("currentCell",function(t){e.option("currentCell",t.ui,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("beforeCurrentCell",function(t){return e._trigger("beforeCurrentCell",t.event,t.ui)}),this.grid.addListener("sort",function(t){var i=e._trigger2("sort",t.event,t.ui);e.grid.SetSortOriginalEvent(i.event)}),this.grid.addListener("sortRequest",function(t){return e._trigger("sortRequest",t.event,t.ui)}),this.grid.addListener("expandRequest",function(t){return e._trigger("expandRequest",t.event,t)}),this.grid.addListener("collapseRequest",function(t){return e._trigger("collapseRequest",t.event,t)}),this.grid.addListener("keydown",function(t){return e._trigger("keydown",t.event,t.ui)}),this.grid.addListener("ready",function(){e._trigger("ready",null,{})}),this.grid.addListener("scroll",function(t){e._trigger("scroll",t.event,t.ui)}),this.grid.addListener("beforeEdit",function(t){return e._trigger("beforeEdit",t.event,t.ui)}),this.grid.addListener("beforeEditEnd",function(t){return e._trigger("beforeEditEnd",t.event,t.ui)}),this.grid.addListener("cutRequest",function(t){return e._trigger("cutRequest",t.event,t.ui)}),this.grid.addListener("copyRequest",function(t){return e._trigger("copyRequest",t.event,t.ui)}),this.grid.addListener("pasteRequest",function(t){return e._trigger("pasteRequest",t.event,t.ui)}),this.grid.addListener("fillRequest",function(t){return e._trigger("fillRequest",t.event,t.ui)})},refresh:function(){this._super();let e=!this._IsCustomElement()||null!=this._defaultContextMenu;e?this._ReleaseResources():this.releaseResources(),this._removeAllChildren(),this._defaultContextMenu&&(this.options.contextMenu=null,this._defaultContextMenu=null),this._setDataSource(),null!=this.datasource&&(h.FlattenedTreeDataGridDataSource&&this.datasource instanceof h.FlattenedTreeDataGridDataSource&&(this.datasource.Destroy(),this.datasource.Init()),this.grid.SetDataSource(this.datasource),this._addContextMenu()),this.grid.SetOptions(this.options,this._WrapCustomElementRenderer.bind(this)),this.resources.setRTLMode(this._GetReadingDirection()),this.grid.SetResources(this.resources),e?this._SetupResources():this.setupResources(),this.grid.getVisibility()!==A.VISIBILITY_STATE_RENDER&&this.grid.setVisibility(A.VISIBILITY_STATE_REFRESH),this._possiblyRenderOrRefresh()},_updateScrollPositionOnRefresh:function(){var e,t=this.options.selection;if(null!=t&&0!==t.length){e={};var i=t[t.length-1];i&&(i.startKey?(e.rowKey=i.startKey.row,e.columnKey=i.startKey.column):i.startIndex&&(e.rowIndex=0,e.columnIndex=0))}else e={x:0,y:0};this.option("scrollPosition",e,{_context:{internalSet:!0},changed:!1})},_destroy:function(){C(this.root).removeAttr(c._OJ_CONTAINER_ATTR),null!=this.datasource&&this.datasource.Destroy&&this.datasource.Destroy(),this.grid.destroy(),this._unregisterResizeListener(this.root),C(this.root).empty(),this._MakeReady()},_setOptions:function(e,t){if(this.datasource){var i=this._handleOptionUpdate(e,t);this._super(e,t),"refresh"===i?this.refresh():"pass"===i&&this.grid.UpdateOptions(e,t)}else this._super(e,t),null!=e.data&&this.refresh()},_checkSelectionMode:function(e){var t=e.selectionMode;if(t&&t.row&&t.cell&&"none"!==t.row&&"none"!==t.cell)throw new Error("JET DataGrid does not support selectionMode on cell and row simultaneously.")},_NotifyShown:function(){this._super(),this._possiblyRenderOrRefresh()},_NotifyHidden:function(){this._super(),this.grid.getVisibility()===A.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(A.VISIBILITY_STATE_HIDDEN)},_NotifyAttached:function(){this._super(),this._possiblyRenderOrRefresh()&&this.grid._initiateScrollOnAttached()},_NotifyDetached:function(){this._super(),this.grid.getVisibility()===A.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(A.VISIBILITY_STATE_HIDDEN)},_handleOptionUpdate:function(e,t){for(var i="ignore",s=Object.keys(e),n=0;n<s.length;n++){switch(s[n]){case"bandingInterval":case"currentCell":case"editMode":case"gridlines":case"scrollPosition":case"selection":i="pass";break;case"beforeCurrentCell":case"beforeEdit":case"beforeEditEnd":case"cutRequest":case"copyRequest":case"pasteRequest":case"fillRequest":case"create":case"disabled":case"dnd":case"optionChange":case"ready":case"resize":case"rootAttributes":case"scroll":case"sort":break;case"selectionMode":this._checkSelectionMode(e),i="pass";break;case"cell":case"header":var o=t.subkey;if(null!=o){var r=o.split(".");if("resizable"===r[1]||"sortable"===r[1]){i="pass";break}}return"refresh";case"data":return this._updateScrollPositionOnRefresh(),"refresh";case"contextMenu":case"scrollPolicy":default:return"refresh"}}return i},_isResizeEnabled:function(e,t){return!(!this.options.header[e]||!this.options.header[e].resizable)&&"disable"!==this.options.header[e].resizable[t]},_isSortEnabled:function(e){return!!this.options.header[e]&&"disable"!==this.options.header[e].sortable},_removeAllChildren:function(){for(var e=this.root.children,t=e.length-1;t>=0;t--)"TEMPLATE"!==e[t].tagName&&"OJ-SURROGATE"!==e[t].tagName&&("OJ-MENU"!==e[t].tagName||"OJ-MENU"===e[t].tagName&&"contextMenu"!==e[t].slot)&&this._remove(e[t])},_GetDefaultContextMenu:function(){return this._defaultContextMenu},_addContextMenu:function(){var e=this,t=e._IsCustomElement(),i=this._GetContextMenu()?this._GetContextMenu():this._menuContainer;if(i){null==this._menuItemsSetByGrid&&(this._menuItemsSetByGrid=[]),this._menuContainer=i;var s=(i=C(i)).find("[data-oj-command]"),n=[];s.each(function(){var i=e._shouldUpdateListItem(this,t);if(i.shouldUpdate){var s=C(this).attr("data-oj-command").split("-");if(t){var o=e._getContextMenuText(s[s.length-1],t);i.itemToUpdate?(i.itemToUpdate.textContent=o,n.push(i.itemToUpdate)):(i.toFirstChild,this.textContent=o,n.push(this))}else{var r=C(e._buildContextMenuItem(s[s.length-1],t));C(this).replaceWith(r),n.push(r.children("a").get(0))}}}),this._menuItemsSetByGrid=n,i.data("oj-ojMenu")&&(t?i[0].refresh():i.ojMenu("refresh"))}else null!=this.datasource&&(i=this._createDefaultContextMenu())&&(this._defaultContextMenu=i[0]);i&&this._addMenuSelectListener(i)},_shouldUpdateListItem:function(e,t){var i,s=!1;if(t){if(null!=e.firstElementChild&&"opt"===e.firstElementChild.getAttribute("ojmenu")?(i=g.CustomElementUtils.getSlotMap(e.firstElementChild),s=!0):i=g.CustomElementUtils.getSlotMap(e),!i[""]||0===i[""].length)return{shouldUpdate:!0,toFirstChild:s};if(i[""]){var n=this._menuItemsSetByGrid.indexOf(e);if(-1!==n)return{shouldUpdate:!0,itemToUpdate:this._menuItemsSetByGrid[n]}}return{shouldUpdate:!1}}var o=C(e).children("a");return{shouldUpdate:0===o.length||-1!==this._menuItemsSetByGrid.indexOf(o.get(0))}},_addMenuSelectListener:function(e){var t=this._handleContextMenuSelect.bind(this);this._IsCustomElement()?e[0].addEventListener("ojAction",t):e.on("ojselect",t)},_createDefaultContextMenu:function(){let e,t,i,s,n,o,r=null,l=null,a=null;const h=this._IsCustomElement();o=h?this._createCustomElementContextMenu():this._createWidgetContextMenu(),(this._isResizeEnabled("column","height")||this._isResizeEnabled("row","height"))&&(r=this._buildContextMenuItem("resizeHeight",h)),(this._isResizeEnabled("column","width")||this._isResizeEnabled("row","width"))&&(l=this._buildContextMenuItem("resizeWidth",h)),(this._isResizeEnabled("column","width")||this._isResizeEnabled("column","height")||this._isResizeEnabled("row","width")||this._isResizeEnabled("row","height"))&&(a=this._buildContextMenuItem("resizeFitToContent",h));const d=this.datasource.getCapability("sort");if(this._isSortEnabled("column")&&("column"!==d&&"full"!==d||(e=this._buildContextMenuItem("sortCol",h))),this._isSortEnabled("row")&&("row"!==d&&"full"!==d||(t=this._buildContextMenuItem("sortRow",h))),"enable"===this.options.dnd.reorder.row)switch(this.datasource.getCapability("move")){case"none":break;default:h?(s=new DocumentFragment,s.appendChild(this._buildContextMenuOjOption("cut")),s.appendChild(this._buildContextMenuOjOption("paste")),s.appendChild(this._buildContextMenuDivider())):(s=new DocumentFragment,s.appendChild(this._buildContextMenuListItem("cut")),s.appendChild(this._buildContextMenuListItem("paste")))}let c=[];if(c=Object.keys(this.options.dataTransferOptions).filter(e=>"enable"===this.options.dataTransferOptions[e]),c.length){let e=this.options.dataTransferOptions;n=new DocumentFragment,h?("enable"===e.cut&&n.appendChild(this._buildContextMenuOjOption("cutCells")),"enable"===e.copy&&n.appendChild(this._buildContextMenuOjOption("copyCells")),"enable"===e.paste&&n.appendChild(this._buildContextMenuOjOption("pasteCells")),"enable"===e.fill&&n.appendChild(this._buildContextMenuOjOption("autoFill")),n.appendChild(this._buildContextMenuDivider())):("enable"===e.cut&&n.appendChild(this._buildContextMenuListItem("cutCells")),"enable"===e.copy&&n.appendChild(this._buildContextMenuListItem("copyCells")),"enable"===e.paste&&n.appendChild(this._buildContextMenuListItem("pasteCells")),"enable"===e.fill&&n.appendChild(this._buildContextMenuListItem("autoFill")))}return this._isMultipleSelection()&&_.isTouchSupported()&&(this._discontiguousSelection=!1,h?(i=document.createElement("oj-menu-select-many"),i.setAttribute("data-oj-binding-provider","none"),i.appendChild(this._buildContextMenuOjOption("discontiguousSelection"))):i=this._buildContextMenuListItem("discontiguousSelection")),r||l||a||e||t||s||i||n?(n&&o.appendChild(n),r&&o.appendChild(r),l&&o.appendChild(l),a&&o.appendChild(a),(e||t)&&((r||l||a)&&o.appendChild(this._buildContextMenuDivider()),e&&o.appendChild(e),t&&o.appendChild(t)),s&&((r||l||a||e||t)&&o.appendChild(this._buildContextMenuDivider()),o.appendChild(s)),i&&((r||l||a||e||t||s)&&o.appendChild(this._buildContextMenuDivider()),o.appendChild(i)),h||C(o).ojMenu(),this.option("contextMenu",o,{_context:{internalSet:!0}}),C(o)):null},_createCustomElementContextMenu:function(e){const t=document.createElement("oj-menu");t.setAttribute("data-oj-binding-provider","none"),t.style.display="none";let i=e?"contextsubmenu":"contextmenu";return t.setAttribute("id",this.rootId+i),e||this.root.appendChild(t),t},_createWidgetContextMenu:function(e){const t=document.createElement("ul");let i=e?"contextsubmenu":"contextmenu";return t.setAttribute("id",this.rootId+i),t.style.display="none",e||this.root.appendChild(t),t},_buildContextMenuItem:function(e,t){if(t){if("resize"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("resizeRow")),e.appendChild(this._buildContextMenuOjOption("resizeColumn")),e}if("sortCol"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("sortColAsc")),e.appendChild(this._buildContextMenuOjOption("sortColDsc")),e}if("sortRow"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("sortRowAsc")),e.appendChild(this._buildContextMenuOjOption("sortRowDsc")),e}if(-1!==Object.keys(this.resources.commands).indexOf(e))return this._buildContextMenuOjOption(e)}else{if("resize"===e){const e=this._buildContextMenuListItem("resize"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("resizeWidth")),t.appendChild(this._buildContextMenuListItem("resizeHeight")),e.appendChild(t),e}if("sortCol"===e){const e=this._buildContextMenuListItem("sortCol"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("sortColAsc")),t.appendChild(this._buildContextMenuListItem("sortColDsc")),e.appendChild(t),e}if("sortRow"===e){const e=this._buildContextMenuListItem("sortRow"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("sortRowAsc")),t.appendChild(this._buildContextMenuListItem("sortRowDsc")),e.appendChild(t),e}if(-1!==Object.keys(this.resources.commands).indexOf(e))return this._buildContextMenuListItem(e)}},_buildContextMenuOjOption:function(e){const t=document.createElement("oj-option");let i;if(t.setAttribute("data-oj-command",this._getMappedCommand(e)),-1!==["cutCells","copyCells","pasteCells"].indexOf(e)){i=document.createElement("span");let t=e.indexOf("Cells"),s=e.slice(0,t);i=document.createElement("span"),i.setAttribute("slot","startIcon"),i.setAttribute("class","oj-ux-ico-"+s)}return t.textContent=this._getContextMenuText(e),i&&t.appendChild(i),t},_buildContextMenuDivider:function(){const e=document.createElement("oj-option");return e.textContent="---",e},_buildContextMenuListItem:function(e){const t=document.createElement("li");return t.setAttribute("data-oj-command",this._getMappedCommand(e)),t.appendChild(this._buildContextMenuLabel(e)),t},_getContextMenuText:function(e){var t=this._IsCustomElement();t&&"discontiguousSelection"===e&&(e="SelectMultiple"),"resizeWidth"===e?e="resizeColumn":"resizeHeight"===e&&(e="resizeRow");let i="label"+e.charAt(0).toUpperCase()+e.slice(1);return t||"discontiguousSelection"!==e||(i="labelEnableNonContiguous"),this._getTranslation(i)},_buildContextMenuLabel:function(e){const t=this._getContextMenuText(e),i=document.createElement("a");return i.setAttribute("href","#"),i.textContent=t,i},_getDataGridContextMenu:function(){return this._GetContextMenu()||this._GetDefaultContextMenu()},_getTranslation:function(e,t){return this.getTranslatedString(e,t)},_handleResizeDialog:function(e){var t,i;this._IsCustomElement()?(t=document.getElementById(this.rootId+"inputNumber").value,i=document.getElementById(this.rootId+"modal").getAttribute("dimension"),document.getElementById(this.rootId+"modal").close()):(t=C("#"+this.rootId+"inputNumber").ojInputNumber("option","value"),C("#"+this.rootId+"modal").ojDialog("close")),this.grid.handleContextMenuReturn(this.contextMenuEvent,this._getMappedCommand(i),t),this.contextMenuEvent.target.focus()},_buildResizeDialog:function(e,t,i){var s,n,o,r,l,a,h,d,c,u=this._IsCustomElement(),_=this;if(u)if(s=document.getElementById(this.rootId+"inputNumber"),null===(o=document.getElementById(this.rootId+"modal"))||null===s){(o=document.createElement("oj-dialog")).id=this.rootId+"modal",o.setAttribute("data-oj-binding-provider","none"),o.setAttribute("initial-focus","firstFocusable"),o.className=this._getMappedStyle("resizeDialog"),(r=document.createElement("div")).setAttribute("slot","header"),(l=document.createElement("div")).setAttribute("slot","body"),(a=document.createElement("div")).setAttribute("slot","footer"),(c=document.createElement("h5")).textContent=e,r.appendChild(c),r.className=this._getMappedStyle("dialogTitle"),o.appendChild(r),o.appendChild(l),o.appendChild(a),(s=document.createElement("oj-input-number")).id=this.rootId+"inputNumber",s.setAttribute("label-edge","inside"),s.setAttribute("user-assistance-density","efficient"),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dimension","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dimension","resizeHeight")),o.setAttribute("title",e),(h=document.createElement("oj-button")).id=this.rootId+"modalcancel",h.style.margin="5px",(d=document.createElement("oj-button")).id=this.rootId+"modalsubmit",d.style.margin="5px",d.setAttribute("chroming","callToAction"),l.appendChild(s),a.appendChild(h),a.appendChild(d),this.root.appendChild(o),h.textContent=this._getTranslation("labelResizeDialogCancel"),d.textContent=this._getTranslation("labelResizeDialogApply"),n=function(){d.disabled=!1,s.value=0,o.close()},h.addEventListener("click",n),d.addEventListener("click",this._handleResizeDialog.bind(this)),s.setAttribute("max",2e3),s.setAttribute("min",20),s.setAttribute("step",1),s.setAttribute("value",t),s.setAttribute("display-options",'{"converterHint": "none", "validatorHint": "none"}'),s.addEventListener("validChanged",function(e){"valid"===e.detail.value?d.disabled=!1:d.disabled=!0});o.setAttribute("position",JSON.stringify({my:{horizontal:"center",vertical:"center"},at:{horizontal:"center",vertical:"center"},collision:"none"})),m.getContext(o).getBusyContext().whenReady().then(function(){o.open(_.root)})}else s.setAttribute("max",2e3),s.setAttribute("min",20),s.setAttribute("step",1),s.setAttribute("value",t),s.setAttribute("label-edge","inside"),s.setAttribute("user-assistance-density","efficient"),s.setAttribute("display-options",'{"converterHint": "none", "validatorHint": "none"}'),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dimension","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dimension","resizeHeight")),o.setAttribute("dialog-title",e),o.open(_.root);else o=C("#"+this.rootId+"modal"),s=C("#"+this.rootId+"inputNumber"),0===o.length||0===s.length?((o=document.createElement("div")).id=this.rootId+"modal",r=document.createElement("div"),l=document.createElement("div"),a=document.createElement("div"),r.className=this._getMappedStyle("dialogTitle"),o.appendChild(r),o.appendChild(l),o.appendChild(a),(c=document.createElement("h5")).textContent=e,r.appendChild(c),(s=document.createElement("input")).id=this.rootId+"inputNumber",s.setAttribute("label-edge","inside"),(h=document.createElement("oj-button")).id=this.rootId+"modalcancel",h.style.margin="5px",(d=document.createElement("oj-button")).id=this.rootId+"modalsubmit",d.style.margin="5px",l.appendChild(s),a.appendChild(h),a.appendChild(d),this.root.appendChild(o),C(h).ojButton({component:"ojButton",label:this._getTranslation("labelResizeDialogCancel")}),C(d).ojButton({component:"ojButton",label:this._getTranslation("labelResizeDialogApply")}),n=function(){C(d).ojButton({disabled:!1}),C(s).ojInputNumber({value:0}),C(o).ojDialog("close")},h.addEventListener("click",n),d.addEventListener("click",this._handleResizeDialog.bind(this)),C(s).ojInputNumber({component:"ojInputNumber",max:1e3,min:20,step:1,value:t}),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dialog-title","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dialog-title","resizeHeight")),C(s).on("change",function(){C(d).ojButton({disabled:!C(s).ojInputNumber("validate")})}),C(o).ojDialog({initialFocus:"firstFocusable",position:{my:"center center",at:"center center",collision:"none",of:C(this.root)}}),C(o).ojDialog("open")):(s.ojInputNumber("option","value",t),s.setAttribute("label-edge","inside"),o.find("."+this._getMappedStyle("dialogTitle"))[0].firstChild.textContent=e,o.ojDialog("open"))},_handleContextMenuSelect:function(e,t){var i;if(i=t?t.item:C(e.target),this.menuItemFunction=i.attr("data-oj-command"),this.menuItemFunction===this._getMappedCommand("sortColAsc")||this.menuItemFunction===this._getMappedCommand("sortColDsc")||this.menuItemFunction===this._getMappedCommand("sortRowAsc")||this.menuItemFunction===this._getMappedCommand("sortRowDsc")||this.menuItemFunction===this._getMappedCommand("cut")||this.menuItemFunction===this._getMappedCommand("paste")||this.menuItemFunction===this._getMappedCommand("cutCells")||this.menuItemFunction===this._getMappedCommand("pasteCells")||this.menuItemFunction===this._getMappedCommand("copyCells")||this.menuItemFunction===this._getMappedCommand("autoFill"))this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,null);else if(this.menuItemFunction===this._getMappedCommand("resizeWidth")||this.menuItemFunction===this._getMappedCommand("resizeHeight")){var s=C(this.contextMenuEvent.target).closest("."+this._getMappedStyle("cell"));if(0===s.length&&(s=C(this.contextMenuEvent.target).closest("."+this._getMappedStyle("headercell"))),0===s.length&&(s=C(this.contextMenuEvent.target).closest("."+this._getMappedStyle("endheadercell"))),0===s.length&&(s=C(this.contextMenuEvent.target).closest("."+this._getMappedStyle("headerlabel"))),s.length>0){var n=this.menuItemFunction===this._getMappedCommand("resizeWidth")?s.outerWidth():s.outerHeight(),o=this.menuItemFunction===this._getMappedCommand("resizeWidth")?"width":"height",r="width"===o?this._getTranslation("resizeColumnDialog"):this._getTranslation("resizeRowDialog");this._buildResizeDialog(r,n,o)}}else if(this.menuItemFunction===this._getMappedCommand("resizeFitToContent"))this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,null);else if(this.menuItemFunction===this._getMappedCommand("discontiguousSelection")){let e;this._discontiguousSelection=!this._discontiguousSelection,this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,this._discontiguousSelection);e=this._IsCustomElement()?"labelSelectMultiple":this._discontiguousSelection?"labelDisableNonContiguous":"labelEnableNonContiguous",i.children().first().text(this._getTranslation(e))}},_NotifyContextMenuGesture:function(e,t,i){this.grid.handleContextMenuGesture(t,i,this._contextMenuGestureCallback.bind(this))},_contextMenuGestureCallback:function(e,t,i){if(null!=e){this.contextMenuEvent=t.originalEvent;var s=e.launcher,n=e.capabilities;this._manageContextMenu(n);var o="keyboard"===i?{position:{of:s},launcher:C(s)}:{launcher:C(s)};_.isTouchSupported()&&this.grid.m_databodyReorder||this._OpenContextMenu(t,i,o)}},_addContextMenuCapability:function(e){var t=C(this._getDataGridContextMenu());this._IsCustomElement()?t.find("[data-oj-command="+e+"]").attr("disabled")||t.find("[data-oj-command="+e+"]").attr("disabled",!0):t.find("[data-oj-command="+e+"]").hasClass("oj-disabled")||t.find("[data-oj-command="+e+"]").addClass("oj-disabled")},_removeContextMenuCapability:function(e){C(this._getDataGridContextMenu()).find("[data-oj-command="+e+"]").removeClass("oj-disabled").attr("disabled",!1)},_manageContextMenu:function(e){for(var t=Object.keys(e),i=0;i<t.length;i++){var s=t[i],n=this.resources.getMappedCommand(s);"disable"===e[s]?this._addContextMenuCapability(n):this._removeContextMenuCapability(n)}},_findCellIndex:function(e){return e[this._getMappedAttribute("context")].indexes},_setDataSource:function(){null!=this.options.data?this.options.data.fetchByOffset&&!this.options.data.fetchFirst?(null!=this.datasource&&this.datasource.Destroy&&this.datasource.Destroy(),this.datasource=new D(this.options.data)):h.DataProviderFeatureChecker.isDataProvider(this.options.data)?(this.datasource=new S(this.options.data),"randomAccess"!==this.options.data.getCapability("fetchByOffset").implementation&&"scroll"===this.options.scrollPolicy&&(y.error("oj.DataProvider does not support fetchByOffset and scrollPolicy is set to scroll. scrollPolicy will fall back to auto."),this.options.scrollPolicy="auto")):this.datasource=this.options.data:this.datasource=null},_setSelection:function(){var e=this.options.selection;null!=e&&this.grid.SetSelection(e)},_modifyContext:function(e){e.component=c.__GetWidgetConstructor(this.element,"ojDataGrid")},_setAccessibleContext:function(e){this.grid.SetAccessibleContext(e)},_unregisterResizeListener:function(e){e&&this._resizeHandler&&(_.removeResizeListener(e,this._resizeHandler),this._resizeHandler=null)},_registerResizeListener:function(e){e&&(null==this._resizeHandler&&(this._resizeHandler=this._handleResize.bind(this)),_.addResizeListener(e,this._resizeHandler))},_handleResize:function(e,t){e>0&&t>0&&(this._possiblyRenderOrRefresh(),this.grid.HandleResize(e,t))},getNodeBySubId:function(e){var t;if(null==e)return this.element?this.element[0]:null;var i=e.subId;if("oj-datagrid-cell"===i){var s=e.rowIndex,n=e.columnIndex;t=C(this.grid._getCellByIndex({row:s,column:n}))}else if("oj-datagrid-sort-icon"===i||"oj-datagrid-sort-ascending"===i||"oj-datagrid-sort-default"===i||"oj-datagrid-sort-descending"===i||"oj-datagrid-header"===i){var o,r=e.axis,l=e.index,a=null==e.level?0:e.level;if("column"===r?o=this._getHeaderByIndex(l,a,C(document.getElementById(this.rootId+":columnHeader")),this.grid.getStartColumnHeader()):"row"===r?o=this._getHeaderByIndex(l,a,C(document.getElementById(this.rootId+":rowHeader")),this.grid.getStartRowHeader()):"columnEnd"===r?o=this._getHeaderByIndex(l,a,C(document.getElementById(this.rootId+":columnEndHeader")),this.grid.getStartColumnEndHeader()):"rowEnd"===r&&(o=this._getHeaderByIndex(l,a,C(document.getElementById(this.rootId+":rowEndHeader")),this.grid.getStartRowEndHeader())),null==o)return null;if("oj-datagrid-sort-icon"===i)return o.children("."+this._getMappedStyle("sortIcon")).children().get(0);t="oj-datagrid-sort-ascending"===i?o.find("."+this._getMappedStyle("sortascending")):"oj-datagrid-sort-default"===i?o.find("."+this._getMappedStyle("sortdefault")):"oj-datagrid-sort-descending"===i?o.find("."+this._getMappedStyle("sortdescending")):o}else"oj-datagrid-header-label"===i&&(t=C(this.grid._getLabel(e.axis,e.level)));return null!=t&&t.length>0?t[0]:null},getSubIdByNode:function(e){var t,i=C(e).closest("."+this._getMappedStyle("cell"));if(i.length>0){var s=this._findCellIndex(i[0]);return{subId:"oj-datagrid-cell",rowIndex:s.row,columnIndex:s.column}}var n=C(e).closest("."+this._getMappedStyle("headercell"));if(0===n.length&&(n=C(e).closest("."+this._getMappedStyle("endheadercell"))),n.length>0)return t=n[0][this._getMappedAttribute("context")],{subId:C(e).hasClass(this._getMappedStyle("sortascending"))?"oj-datagrid-sort-ascending":C(e).hasClass(this._getMappedStyle("sortdefault"))?"oj-datagrid-sort-default":C(e).hasClass(this._getMappedStyle("sortdescending"))?"oj-datagrid-sort-descending":"oj-datagrid-header",axis:t.axis,index:this._getHeaderIndex(n),level:t.level};var o=C(e).closest("."+this._getMappedStyle("headerlabel"));return o.length>0?{subId:"oj-datagrid-header-label",axis:(t=o[0][this._getMappedAttribute("context")]).axis,level:t.level}:null},getContextByNode:function(e){var t,i,s=C(e).closest("."+this._getMappedStyle("cell"));if(s.length>0)return t=s[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-cell",i;var n=C(e).closest("."+this._getMappedStyle("headercell"));if(0===n.length&&(n=C(e).closest("."+this._getMappedStyle("endheadercell"))),n.length>0)return t=n[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-header",i.index=this._getHeaderIndex(n),i;var o=C(e).closest("."+this._getMappedStyle("headerlabel"));return o.length>0?(t=o[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-header-label",i):null},_getMappedStyle:function(e){return this.resources.getMappedStyle(e)},_getMappedAttribute:function(e){return this.resources.getMappedAttribute(e)},_getMappedCommand:function(e){return this.resources.getMappedCommand(e)},_isDataGridSizingAvailable:function(){return null!=this.root.offsetParent},_possiblyRenderOrRefresh:function(){var e=this.grid.getVisibility(),t=!1;return this._isDataGridSizingAvailable()?(e===A.VISIBILITY_STATE_RENDER?(this.grid.render(this.root),t=!0):e===A.VISIBILITY_STATE_REFRESH&&(this.grid.refresh(this.root),t=!0),this.grid.setVisibility(A.VISIBILITY_STATE_VISIBLE)):e===A.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(A.VISIBILITY_STATE_HIDDEN),t},_getHeaderByIndex:function(e,t,i,s){if(t<0)return null;var n=i.children().first().children().last();if(n.hasClass(this._getMappedStyle("headercell")))return i.children().first().children("."+this._getMappedStyle("headercell")).eq(e-s);if(n.hasClass(this._getMappedStyle("endheadercell")))return i.children().first().children("."+this._getMappedStyle("endheadercell")).eq(e-s);var o=this._getGroupingContainer(e,t,0,i.children().first().children());if(null==o)return null;if(t<=parseInt(o.attr(this._getMappedAttribute("level")),10)+parseInt(o.children().eq(0).attr(this._getMappedAttribute("depth")),10)-1)return o.children().eq(0);var r=e-(s=parseInt(o.attr(this._getMappedAttribute("start")),10))+1;return o.children().eq(r)},_getGroupingContainer:function(e,t,i,s){if(null==s.eq(1)||s.eq(1).hasClass(this._getMappedStyle("headercell"))||s.eq(1).hasClass(this._getMappedStyle("endheadercell")))return t===i?s.eq(0).parent():null;var n,o=s.parent().parent();for(n=o.hasClass(this._getMappedStyle("header"))||o.hasClass(this._getMappedStyle("endheader"))?0:1;n<s.length;n++){var r=parseInt(s.eq(n).attr(this._getMappedAttribute("start")),10),l=parseInt(s.eq(n).attr(this._getMappedAttribute("extent")),10),a=parseInt(s.eq(n).children().eq(0).attr(this._getMappedAttribute("depth")),10);if(e>=r&&e<r+l)return t<i+a?s.eq(n):this._getGroupingContainer(e,t,i+a,s.eq(n).children())}return null},_getHeaderIndex:function(e){var t;if(e.parent().hasClass(this._getMappedStyle("groupingcontainer"))){if(t=parseInt(e.parent().attr(this._getMappedAttribute("start")),10),e.get(0)===e.parent().children(":first").get(0))return t;t-=1}else t=e.hasClass(this._getMappedStyle("rowheadercell"))?this.grid.getStartRowHeader():e.hasClass(this._getMappedStyle("colheadercell"))?this.grid.getStartColumnHeader():e.hasClass(this._getMappedStyle("colendheadercell"))?this.grid.getStartColumnEndHeader():this.grid.getStartRowEndHeader();return t+=e.index()},_isMultipleSelection:function(){return null!=this.options.selectionMode&&("multiple"===this.options.selectionMode.row||"multiple"===this.options.selectionMode.cell)},_remove:function(e){null!=e&&(this.grid._cleanTemplateNodes(e),C(e).remove())},_uniqueId:function(e,t){t?C(e).removeUniqueId():C(e).uniqueId()},_compareValues:function(e,t){return h.Object.compareValues(e,t)},scrollTo:function(e){this.grid.scroll(e)},whenReady:function(){if(this._ready)return Promise.resolve(!0);if(!this._readyPromise){var e=this;this._readyPromise=new Promise(function(t){e._readyPromiseResolve=t})}return this._readyPromise},_NotReady:function(){if(this._ready=!1,!this._readyResolveFunc){var e=m.getContext(this.element[0]).getBusyContext(),t={description:"The component identified by '"+this.element.attr("id")+"' is being loaded."};this._readyResolveFunc=e.addBusyState(t)}},_MakeReady:function(){this._readyPromiseResolve&&(this._readyPromiseResolve(!0),this._readyPromiseResolve=null),this._ready=!0,this._readyPromise=null,this._readyResolveFunc&&(this._readyResolveFunc(),this._readyResolveFunc=null)},_CompareOptionValues:function(e,t,i){switch(e){case"currentCell":case"selection":return h.Object.compareValues(t,i);default:return this._super(e,t,i)}}}),A.prototype.unhighlightFloodFillRange=function(e){null==e&&(e=this.GetFloodFillRange()[0]),null!=e&&this._applyBorderClassesAroundRange(this.getElementsInRange(e),e,!1,"Floodfill")},A.prototype.highlightFloodFillRange=function(e){this._applyBorderClassesAroundRange(this.getElementsInRange(e),e,!0,"Floodfill")},A.prototype.handleDatabodyFloodFillDrag=function(e){var t=e.target,i=this.findCell(t);if(null!=i){var s=this.getCellIndexes(i);this.extendFloodFillSelection(s,e)}},A.prototype.GetFloodFillRange=function(){return null==this.m_floodFillRange&&(this.m_floodFillRange=[]),this.m_floodFillRange},A.prototype.extendFloodFillSelection=function(e,t){if("header"===this.m_active.type)return;var i;if(null==(i={row:this.m_active.indexes.row,column:this.m_active.indexes.column}))return;let s,n=!1;s||(s=this.m_selection);let o,r=s[0].startIndex,l=s[0].endIndex;e.row>=r.row&&e.row<=l.row&&(n=!0,e.column>l.column?o="right":e.column<r.column&&(o="left"),e.row=l.row);let a=!1;e.column>=r.column&&e.column<=l.column&&(a=!0,e.row>l.row?o="bottom":e.row<r.row&&(o="top"));let h=r.row===l.row,d=r.column===l.column;if(h&&e.row===r.row&&a||d&&e.column===r.column&&n)return this.unhighlightFloodFillRange(),void(this.m_floodFillRange=[]);if((!n&&!a||e.column<=l.column&&!n)&&(e.column=l.column),n||a||(e.row>l.row?o="bottom":e.row<r.row&&(o="top")),o){let s=r,n=e;this._createRangeWithKeys(s,n,this._extendFloodFillSelectionCallback.bind(this,t,i,o))}else this.unhighlightFloodFillRange()},A.prototype._extendFloodFillSelectionCallback=function(e,t,i,s){let n=s;"top"===i?n.endIndex.row-=1:"bottom"===i?n.startIndex.row=this.m_selectionRange[0].endIndex.row+1:"left"===i?n.endIndex.column-=1:n.startIndex.column=this.m_selectionRange[0].endIndex.column+1;let o=[];this.unhighlightFloodFillRange(),o.push(n),this.m_floodFillRange=o,this.m_floodFillDirection="flood",this.highlightFloodFillRange(n)},A.prototype._addFloodfillAffordance=function(e){if(null==this.m_bottomFloodFillIconContainer){var t=e.target,i=this.findCell(t);if(i||(i=this.findHeader(t)),!i)return;this._attachFloodFillIcon()}},A.prototype._attachFloodFillIcon=function(){this.m_bottomFloodFillIconContainer=document.createElement("div"),this.m_bottomFloodFillIconContainer.className=this.getMappedStyle("toucharea");var e=document.createElement("div");e.className=this.getMappedStyle("floodfillaffordance"),e.setAttribute("role","button"),this.m_bottomFloodFillIconContainer.appendChild(e),this.m_databody.firstChild.appendChild(this.m_bottomFloodFillIconContainer),this.m_floodFillAffordanceHeight=this.m_bottomFloodFillIconContainer.firstElementChild.offsetHeight,this.m_floodFillAffordanceWidth=this.m_bottomFloodFillIconContainer.firstElementChild.offsetWidth,this.m_options.isFloodFillEnabled()&&(this.m_bottomFloodFillIconContainer.addEventListener("mouseover",this.handleFloodFillAffordanceMouseOver.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mousedown",this.handleFloodFillAffordanceMouseDown.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mouseup",this.handleFloodFillAffordanceMouseUp.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mouseleave",this.handleFloodFillAffordanceMouseLeave.bind(this)))},A.prototype.handleFloodFillAffordanceMouseOver=function(e){0===e.buttons&&(this.m_databody.style.cursor="crosshair",this.m_cursor="crosshair")},A.prototype.handleFloodFillAffordanceMouseDown=function(){this.m_databodyDragState=!0,this.m_floodFillDragState=!0,this.m_selectionRange=null,this.m_floodFillRange=null,this.m_databody.style.cursor="crosshair",this.m_cursor="crosshair"},A.prototype.handleFloodFillAffordanceMouseUp=function(){this.m_databodyDragState=!1,this.m_floodFillDragState=!1,this.m_databody.style.cursor="default",this.m_cursor="default",this.m_selectionRange=null,this.m_floodFillRange=null},A.prototype.handleFloodFillAffordanceMouseLeave=function(e){0===e.buttons&&(this.m_databodyDragState=!1,this.m_floodFillDragState=!1,this.m_databody.style.cursor="default",this.m_cursor="default")},A.prototype._removeFloodFillAffordance=function(){this._isDatabodyCellActive()&&this.m_bottomFloodFillIconContainer&&this.m_bottomFloodFillIconContainer.parentNode&&(this.m_databody.style.cursor="default",this.m_cursor="default",this.m_bottomFloodFillIconContainer.parentNode.removeChild(this.m_bottomFloodFillIconContainer))},A.prototype._moveFloodFillAffordance=function(){var e=this.getResources().isRTLMode()?"right":"left",t=this.GetSelection();if(t.length>0){var i=this._getTouchSelectionAffordanceSize();if(null!=this.m_bottomFloodFillIconContainer){var s=this._getCellByIndex(t[t.length-1].endIndex);s?(this.setElementDir(this.m_bottomFloodFillIconContainer,this.getElementDir(s,"top")+this.getElementHeight(s)-i+this.m_floodFillAffordanceHeight+1,"top"),this.setElementDir(this.m_bottomFloodFillIconContainer,this.getElementDir(s,e)+this.getElementWidth(s)-(i-this.m_floodFillAffordanceWidth)+1,e),this.m_databody.firstChild.appendChild(this.m_bottomFloodFillIconContainer)):this._removeFloodFillAffordance()}}},A.prototype.handleDragStart=function(e){let t,i=e.target,s=this.findHeader(i);if(s){let i=this.getHeaderCellAxis(s),n=this.getHeaderCellLevel(s),o=this.getHeaderCellIndex(s);if(this.m_options._isDragEnabled(i)){let r,l,a,h=this.m_selection,d=0,c=0,m=1,u=this.m_options.options.dnd.drag,_="row"===i||"rowEnd"===i?u.rows.dataTypes:u.columns.dataTypes,p="row"===i||"rowEnd"===i?"rows":"columns",g=[],f=[],C=[],y=JSON.parse(JSON.stringify(h));y.sort((e,t)=>e.startIndex[i]<t.startIndex[i]?-1:1),"row"===i||"rowEnd"===i?(a=-1!==this.m_endRowEndHeader,this.m_rowHeader&&(r=this.m_rowHeaderLevelCount-1),this.m_rowEndHeader&&(l=this.m_rowEndHeaderLevelCount-1)):(a=-1!==this.m_endColEndHeader,this.m_colHeader&&(r=this.m_columnHeaderLevelCount-1),this.m_endColHeader&&(l=this.m_columnEndHeaderLevelCount-1));let v="row"===i||"rowEnd"===i?"row":"column";[g,f]=this._getHeadersInSelection(n,y,v,a),g&&g[r]&&C.push(...g[r]),f&&f[l]&&C.push(...f[l]),[t,m,d,c]=this._getCellsForDndContainer(v,y,C,m),this._cellsDragged=t,this.m_dragIndex=o,this.m_dragHeader=s,this._setDragRowsData(e,_);const E=this.m_utils.containsCSSClassName(s,this.getMappedStyle("endheadercell"));this._setDragImage(e,v,t,d,c,m,E,g,f);for(let e=0;e<h.length;e++){let t=this.getElementsInRange(h[e]);for(let e=0;e<t.length;e++)this._highlightElement(t[e],["dragSourceOpaque"]);this._applyBorderClassesAroundRange(t,h[e],!1,"Selected")}const w=s[[this.getResources().getMappedAttribute("context")]];"expanded"===w.metadata.expanded&&null!==w.metadata.treeDepth&&this._disableChildElements(i);let S={range:y,axis:v};return this._invokeDndCallback("drag",p,"dragStart",e,S)}e.preventDefault()}},A.prototype._getHeadersInSelection=function(e,t,i){let s={},n={};for(let o=0;o<t.length;o++){let r=[...this.getHeadersByRange(t[o],i)];for(let e=r.length-1;e>=0;e--)this.m_utils.containsCSSClassName(r[e],this.getMappedStyle("selected"))||r.splice(e,1);[s,n]=this._getHeadersUnderLevel(e,r,i,s,n)}return[s,n]},A.prototype._getHeadersUnderLevel=function(e,t,i,s,n){let o="row"===i?this.m_rowHeaderLevelCount:this.m_columnHeaderLevelCount,r="row"===i?this.m_rowEndHeaderLevelCount:this.m_columnEndHeaderLevelCount;for(let i=0;i<t.length;i++){let l=this.getHeaderCellLevel(t[i]);const a=this.m_utils.containsCSSClassName(t[i],this.getMappedStyle("endheadercell"));a?a&&(n[l]||(n[l]=[]),(r>1&&l>=e||1===r)&&n[l].push(t[i])):(s[l]||(s[l]=[]),(o>1&&l>=e||1===o)&&s[l].push(t[i]))}return[s,n]},A.prototype.handleRowDragEnd=function(e){return this._destroyDragImage(),this._unhighlightDragSource(),this._removeDropTargetLine("row"),this._removeDropTargetClass(),this._enableChildElements(),this.m_databodyReorder=!1,this._removeDragStyle("row"),this._invokeDndCallback("drag","rows","dragEnd",e,this._cellsDragged)},A.prototype.handleRowDragOver=function(e){this.m_databodyReorder=!0;let t=this._getOverIndex(e,"row"),i=-1===t?0:t,s=this.getResources().isRTLMode()?"right":"left",n=this._getHeaderByIndex(i,this.m_rowHeaderLevelCount,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),o=this._isHeaderWithinSelection(n,"row");if(void 0!==t&&this.m_dragIndex!==t){let r;if(this.m_utils.containsCSSClassName(n,this.getMappedStyle("disabledElement")))this._removeDropTargetLine("row"),this._removeDropTargetClass(),this.m_dropRowIndex=null;else{let l=this._getRelativePosition(e,"row",n,!0),a=this._getDropContext(e,this.m_dropRowIndex,"row");if(r=this._invokeDropCallback("rows","dragOver",e,a),(!1===r||e.defaultPrevented)&&(this._removeDropTargetLine("row"),this._removeDropTargetClass(),!o))if("inside"===l)this._highlightElement(n,["dropTarget"]),this._highlightCellsAlongAxis(t,"row","index","add",["dropTarget"]);else{let e=this.getElementDir(n,"top");e+=-1===t?0:this.getElementHeight(n),this._addDropTargetLine("row",e,s,0,i)}}return r}},A.prototype.handleDatabodyDragOver=function(e){let t;this.m_databodyReorder=!0,t=this._matchDragDataType(e,"rows")?"row":"column";let i=this._getOverIndex(e,t),s=this.getResources().isRTLMode()?"right":"left";if(i){let n=JSON.parse(JSON.stringify(i));-1===i[t]&&(n[t]=0);let o=this._getCellByIndex(n);if(o){let r,l=this._getRelativePosition(e,t,o,!1),a=this.m_utils.containsCSSClassName(o,"selected");if(this.m_utils.containsCSSClassName(o,this.getMappedStyle("disabledElement")))this._removeDropTargetLine(t),this._removeDropTargetClass(),"row"===t?this.m_dropRowIndex=null:this.m_dropColumnIndex=null;else if(r="row"===t?this._invokeDropCallback("rows","dragOver",e,{index:this.m_dropRowIndex,position:l,axis:"row"}):this._invokeDropCallback("columns","dragOver",e,{index:this.m_dropColumnIndex,position:l,axis:"column"}),(!1===r||e.defaultPrevented)&&(this._removeDropTargetLine(t),this._removeDropTargetClass(),!a)){let e;"inside"===l?this._highlightCellsAlongAxis(i,t,"index","add",["dropTarget"]):"row"===t?(e=this.getElementDir(o,"top"),e+=-1===i[t]?0:this.getElementHeight(o),this._addDropTargetLine(t,e,s,0,n)):(e=this.getElementDir(o,s),e+=-1===i[t]?0:this.getElementWidth(o),this._addDropTargetLine(t,0,s,e,n))}return r}}},A.prototype.handleDatabodyDrop=function(e){let t;t=this._matchDragDataType(e,"rows")?"row":"column";let i,s,n=this.getResources().isRTLMode()?"right":"left",o=e.target.getBoundingClientRect();this._destroyDragImage(),this._removeDropTargetLine(t),this._removeDropTargetClass();let r="after";if("row"===t){i=this.m_dropRowIndex,e.clientY-o.top<.4*o.height&&(r="before"),this.m_dropRowIndex=null,s={index:i,position:r,axis:"row"}}else{i=this.m_dropColumnIndex,Math.abs(e.clientX-o[n])<.4*o.width&&(r="before"),this.m_dropColumnIndex=null,s={index:i,position:r,axis:"column"}}this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==i&&this._invokeDropCallback(t+"s","drop",e,s)},A.prototype.handleRowDragEnter=function(e){if(this._getOverIndex(e,"row"),this.m_dropRowIndex){let t=this._getDropContext(e,this.m_dropRowIndex,"row");return this._invokeDropCallback("rows","dragEnter",e,t)}},A.prototype.handleDatabodyDragEnter=function(e){let t;t=this._matchDragDataType(e,"rows")?"row":"column";let i=this._getOverIndex(e,t);if(i){let s=JSON.parse(JSON.stringify(i));-1===i[t]&&(s[t]=0);let n=this._getCellByIndex(s);if(n){let s={index:i,position:this._getRelativePosition(e,t,n,!1),axis:t};if(this.m_dropRowIndex)return this._invokeDropCallback("rows","dragEnter",e,s)}}},A.prototype.handleRowDragLeave=function(e){let t=this._getDropContext(e,this.m_dropRowIndex,"row");var i=this._invokeDndCallback("drop","rows","dragLeave",e,t);return this.m_dropRowIndex=null,i},A.prototype.handleRowDrag=function(e){return!this.m_dragImageAttached&&this.m_utils.isTouchDevice()&&(document.body.appendChild(this.m_dndContainer),this.m_dragImageAttached=!0),this._invokeDndCallback("drag","rows","drag",e)},A.prototype.handleRowDrop=function(e){let t=this.m_dropRowIndex;if(this._destroyDragImage(),this._removeDropTargetLine("row"),this._removeDropTargetClass(),this.m_dropRowIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==t){let i=this._getDropContext(e,t,"row");this._invokeDropCallback("rows","drop",e,i)}},A.prototype.handleColumnDragEnd=function(e){return this._destroyDragImage(),this._unhighlightDragSource(),this._removeDragStyle("column"),this._removeDropTargetLine("column"),this._removeDropTargetClass(),this._enableChildElements(),this._invokeDndCallback("drag","columns","dragEnd",e)},A.prototype.handleColumnDragOver=function(e){this.m_databodyReorder=!0;let t="column",i=this._getOverIndex(e,t),s=-1===i?0:i,n=this.getResources().isRTLMode()?"right":"left",o=this._getHeaderByIndex(s,this.m_columnHeaderLevelCount,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader);if(this.m_utils.containsCSSClassName(o,this.getMappedStyle("disabledElement")))this._removeDropTargetLine(t),this._removeDropTargetClass(),this.m_dropColumnIndex=null;else if(void 0!==i&&o){let r=this._getRelativePosition(e,t,o,!0),l={axis:"column",position:r,index:this.m_dropColumnIndex},a=this._invokeDropCallback("columns","dragOver",e,l);if(!1===a||e.defaultPrevented)if(this._removeDropTargetLine(t),this._removeDropTargetClass(),"inside"===r)this._highlightElement(o,["dropTarget"]),this._highlightCellsAlongAxis(i,t,"index","add",["dropTarget"]);else{let e=this.getElementDir(o,n);e+=-1===i?0:this.getElementWidth(o),this._addDropTargetLine(t,0,n,e,s)}return a}},A.prototype.handleColumnDragEnter=function(e){this._getOverIndex(e,"column");let t=this._getDropContext(e,this.m_dropColumnIndex,"column");return this._invokeDropCallback("columns","dragEnter",e,t)},A.prototype.handleColumnDragLeave=function(e){let t=this._getDropContext(e,this.m_dropColumnIndex,"column");var i=this._invokeDndCallback("drop","columns","dragLeave",e,t);return this.m_dropColumnIndex=null,i},A.prototype.handleColumnDrag=function(e){return this._invokeDndCallback("drag","columns","drag",e)},A.prototype.handleColumnDrop=function(e){let t=this.m_dropColumnIndex;if(this._destroyDragImage(),this._removeDropTargetLine("column"),this._removeDropTargetClass(),this.m_dropColumnIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==t){let i=this._getDropContext(e,t,"column");this._invokeDropCallback("columns","drop",e,i)}},A.prototype._computeDndContainerOffsetHeight=function(e,t,i,s){let n=0;if("row"===e)for(let e=0;e<t.length;e++){n+=t[e].offsetHeight}else{let e=t[0].offsetHeight;i&&(e+=s[0].offsetHeight),n=this.m_databody.offsetHeight+e}return n},A.prototype._computeDndContainerOffsetWidth=function(e,t,i,s){let n=0;if("row"===e){let e=t[0].offsetWidth;i&&(e+=s[0].offsetWidth),n=this.m_databody.offsetWidth+e}else for(let e=0;e<t.length;e++){n+=t[e].offsetWidth}return n},A.prototype._getCellsForDndContainer=function(e,t,i,s){let n,o,r=[],l=this.getResources().isRTLMode()?"right":"left",a=this.m_databody.scrollLeft,h=this.m_databody.scrollTop,d=0,c=0;o="row"===e?-1!==this.m_endRowEndHeader:-1!==this.m_endColEndHeader,n="row"===e?"width":"height";let m=Math.abs(a);"column"===e&&(l="top",m=h);for(let a=0,h=0;a<t.length;a++)for(let u=t[a].startIndex[e];u<=t[a].endIndex[e];u++){let t,a=this._getAxisCellsByIndex(u,e);i[h]&&r.push(i[h]);for(let e=0;e<a.length;e++)if(this.getElementDir(a[e],l)>m){t=e-1;break}a=a.slice(t,a.length);let _=0,p=this.getElementDir(this.m_databody,n);for(let e=0;e<a.length;e++)if(_+=this.getElementDir(a[e],n),_>p){t=e;break}t>0&&(a=a.slice(0,t+1)),r.push(...a),o&&r.push(i[Math.ceil(i.length/2+h)]),"row"!==e||d?"column"===e&&(d+=this.getElementDir(i[h],"width")):d=this._computeContainerDimension(r,"width"),"column"!==e||c?"row"===e&&(c+=this.getElementDir(i[h],"height")):c=this._computeContainerDimension(r,"height"),h+=1,s=a.length}return[r,s,d,c]},A.prototype._computeContainerDimension=function(e,t){let i=0;for(let s=0;s<e.length;s++)i+=this.getElementDir(e[s],t);return i},A.prototype._setDragImage=function(e,t,i,s,n,o,r,l,a){let h=this.getResources().isRTLMode()?"right":"left",d=this._populateDndContainer(i,t,h,o,l,a,s,n),c=Math.max(0,e.offsetX),m=Math.max(0,e.offsetY);r?(c="row"===t&&"left"===h?s-c:c,m="column"===t?n-m:m):c="row"===t&&"left"===h?c:s-c,e.dataTransfer.setDragImage(d,c,m)},A.prototype._computeDndContainerCellCountInRow=function(e,t){let i,s=e,n=1;return i="row"===t||"rowEnd"===t?-1!==this.m_endRowEndHeader:-1!==this.m_endColEndHeader,i&&(n=2),s+=n,s},A.prototype._populateDndContainer=function(e,t,i,s,n,o,r,l){let a=document.getElementById("dndContainer");a||(a=document.createElement("div"),a.setAttribute("id","dndContainer"),a.setAttribute("class","dndContainer"));let h=[this.getMappedStyle("focus"),this.getMappedStyle("hover"),this.getMappedStyle("active"),this.getMappedStyle("topSelected"),this.getMappedStyle("startSelected"),this.getMappedStyle("bottomSelected"),this.getMappedStyle("endSelected"),this.getMappedStyle("selected")],d=0,c=0,m=0,u=0;this._headersDragged=[];let _=this._computeDndContainerCellCountInRow(s,t);[u,m]=this._appendNestedHeadersToContainer(i,t,a,d,c,n,!1),c=u,d=m;for(let s=0;s<e.length;s++){let n=e[s],o=n.cloneNode(!0);o.classList.remove(...h),o.setAttribute("draggable",!1),o.style.top=d+"px",o.style[i]=c+"px","row"===t?(s%_==0?c=u+n.offsetWidth:c+=n.offsetWidth,s%_==_-1&&(d+=n.offsetHeight,s===e.length-1?d=0:c=u)):(s%_==0?d=m+n.offsetHeight:d+=n.offsetHeight,s%_==_-1&&(c+=n.offsetWidth,s===e.length-1?c=0:d=m)),a.appendChild(o),n.classList.add("drag-source-opaque")}return[u,m]=this._appendNestedHeadersToContainer(i,t,a,d,c,o,!0),a.style.width=r+"px",a.style.height=l+"px","column"===t?a.style.height=l+m+"px":a.style.width=r+u+"px",this.m_utils.isTouchDevice()?(this.m_dragImageAttached=!1,this.m_dndContainer=a):document.body.appendChild(a),a},A.prototype._appendNestedHeadersToContainer=function(e,t,i,s,n,o,r){let l;r?(this.m_rowEndHeaderLevelCount||this.m_columnEndHeaderLevelCount)&&(l="row"===t?this.m_rowEndHeaderLevelCount-1:this.m_columnEndHeaderLevelCount-1):l="row"===t?this.m_rowHeaderLevelCount-1:this.m_columnHeaderLevelCount-1;let a=Object.keys(o),h=[this.getMappedStyle("focus"),this.getMappedStyle("hover"),this.getMappedStyle("active"),this.getMappedStyle("selected")];r&&(a=a.reverse());for(let r=0;r<a.length;r++){let d=parseInt(a[r],10);if(d!==l){let r=o[d].length;for(let l=0;l<o[d].length;l++){let a=o[d][l];this._headersDragged.push(a);let c=a.cloneNode(!0);c.classList.remove(...h),c.style.top=s+"px",c.style[e]=n+"px","row"===t?(l%r==0?s=a.offsetHeight:s+=a.offsetHeight,l===r-1&&(n+=a.offsetWidth,s=0)):(l%r==0?n=a.offsetWidth:n+=a.offsetWidth,l===r-1&&(n=0,s+=a.offsetHeight)),i.appendChild(c),a.classList.add("drag-source-opaque")}}}return[n,s]},A.prototype._destroyDragImage=function(){let e=document.getElementById("dndContainer");e&&e.parentNode.removeChild(e),this.m_dragImageAttached=!1,this.m_dndContainer=null},A.prototype._setDragRowsData=function(e,t){if(t){let i=e.dataTransfer,s=JSON.stringify(this.m_selection);if("string"==typeof t)i.setData(t,s);else for(let e=0;e<t.length;e++)i.setData(t[e],s)}},A.prototype._getOverIndex=function(e,t){let i,s,n,o=e.target,r=this.getResources().isRTLMode()?"right":"left",l=o.getBoundingClientRect(),a=this.findHeader(o),h=!1,d=!1;if(a?(s=a[this.getResources().getMappedAttribute("context")],n=s.index,"column"===t?this.m_dropColumnIndex=n:this.m_dropRowIndex=n,h=this._isParentNode(s),d=this._isLeafNode(s)):(i=this.findCell(o),i&&(s=i[this.getResources().getMappedAttribute("context")],n=s.indexes,"column"===t?this.m_dropColumnIndex=s.indexes[t]:this.m_dropRowIndex=s.indexes[t])),void 0!==n){let o,c="width";if("column"===t?o=Math.abs(e.clientX-l[r]):(o=e.clientY-l.top,c="height"),a&&(h||d))o<.25*l[c]&&(n-=1);else if(o<.4*l[c])if(a)n-=1;else if(i&&void 0!==n){let e=s.indexes.row,i=s.indexes.column;n="row"===t?this.createIndex(e-1,i):this.createIndex(e,i-1)}}return n},A.prototype._getRelativePosition=function(e,t,i,s){let n,o=e.target,r=this.getResources().isRTLMode()?"right":"left",l=o.getBoundingClientRect(),a=!1,h=!1,d="before",c=i[this.getResources().getMappedAttribute("context")];s&&(a=this._isParentNode(c),h=this._isLeafNode(c));let m="width";return"column"===t?n=Math.abs(e.clientX-l[r]):(n=e.clientY-l.top,m="height"),i&&(a||h)?n>=.25*l[m]&&n<=.75*l[m]?d="inside":n>.75*l[m]&&(d="after"):n>.4*l[m]&&(d="after"),d},A.prototype._addDropTargetLine=function(e,t,i,s,n){let o="row"===e?"rowDropTargetLine":"colDropTargetLine";this.m_dropTarget=document.createElement("div"),this.m_dropHeaderTarget=document.createElement("div"),this.m_dropEndHeaderTarget=document.createElement("div"),this._setAttribute(this.m_dropTarget,"index",n);let r,l="width",a="width";"row"===e?r=-1!==this.m_endRowEndHeader:(l="height",a="height",r=-1!==this.m_endColEndHeader);let[h,d,c,m,u,_,p]="row"===e?this._calculateRowDropTargetLinePosition(t,s,i):this._calculateColDropTargetLinePosition(t,s,i);this._setDropTargetLineStyle(this.m_dropTarget,o,t,i,s,u,l),this._setDropTargetLineStyle(this.m_dropHeaderTarget,o,h,i,c,_,a),r&&this._setDropTargetLineStyle(this.m_dropEndHeaderTarget,o,d,i,m,p,a),this.m_databody.firstChild.appendChild(this.m_dropTarget),this.m_root.appendChild(this.m_dropHeaderTarget),r&&this.m_root.appendChild(this.m_dropEndHeaderTarget),this.m_dropTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropHeaderTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropEndHeaderTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1),this.m_dropHeaderTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1),this.m_dropEndHeaderTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1)},A.prototype._calculateRowDropTargetLinePosition=function(e,t,i){let s=this.m_rowHeader,n=this.m_rowEndHeader,o=e,r=t,l=e,a=t,h=this._getCornerDimensions("height"),d=0,c=0,m=0;d=this.getElementWidth(this.m_databody.firstChild),c=this.getElementWidth(s.firstChild),m=this.getElementWidth(n.firstChild);let u=Math.abs(this.getElementDir(s.firstChild,"top"));return 0!==u&&(o-=u),o+=h,l=o,this.m_rowEndHeader&&(a=t+this.getElementDir(this.m_rowEndHeader,i)),[o,l,r,a,d,c,m]},A.prototype._calculateColDropTargetLinePosition=function(e,t,i){let s=this.m_rowHeader,n=this.m_rowEndHeader,o=e,r=t,l=e,a=t,h=this._getCornerDimensions("width"),d=0,c=0,m=0;d=this.getElementHeight(this.m_databody.firstChild),c=this.getElementHeight(s.firstChild),m=this.getElementHeight(n.firstChild);let u=Math.abs(this.getElementDir(this.m_colHeader.firstChild,i));return 0!==u&&(r-=u),r+=h,a=r,this.m_colEndHeader&&(l=e+this.getElementDir(this.m_colEndHeader,"top")),[o,l,r,a,d,c,m]},A.prototype._getCornerDimensions=function(e){let t=0,i=0;return this.m_corner&&(t=this.getElementHeight(this.m_corner),i=this.getElementWidth(this.m_corner)),e?"height"===e?t:i:[t,i]},A.prototype._setDropTargetLineStyle=function(e,t,i,s,n,o,r){this.m_utils.addCSSClassName(e,this.getMappedStyle(t)),this.setElementDir(e,i,"top"),this.setElementDir(e,n,s),"width"===r?this.setElementWidth(e,o):this.setElementHeight(e,o)},A.prototype._removeDropTargetLine=function(){this._removeDropTargetEventListeners(),this._remove(this.m_dropTarget),this._remove(this.m_dropHeaderTarget),this.m_dropEndHeaderTarget&&this._remove(this.m_dropEndHeaderTarget)},A.prototype._removeDropTargetEventListeners=function(){this.m_dropTarget&&(this.m_dropTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropTarget.removeEventListener("drop",this.handleDropTargetDrop,!1)),this.m_dropHeaderTarget&&(this.m_dropHeaderTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropHeaderTarget.removeEventListener("drop",this.handleDropTargetDrop,!1)),this.m_dropEndHeaderTarget&&(this.m_dropEndHeaderTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropEndHeaderTarget.removeEventListener("drop",this.handleDropTargetDrop,!1))},A.prototype._removeDropTargetClass=function(){let e=document.querySelectorAll("."+this.getMappedStyle("dropTarget"));e&&e.length&&this._unhighlightElementsByClassName(e,["dropTarget"])},A.prototype._isHeaderWithinSelection=function(e,t){let i=this.getHeaderCellIndex(e),s=!1;if(this.m_selection&&this.m_selection.length)for(let n=0;n<this.m_selection.length;n++){let o=this._getHeadersWithinSelection(this.m_selection[n],i,t);for(let t=0;t<o.length;t++)if(o[t]===e&&o[o.length-1]!==e){s=!0;break}}return s},A.prototype._invokeDndCallback=function(e,t,i,s,n){let o,r=this.m_options.options.dnd[e];if(r&&r[t]){let e=r[t][i];if(e&&"function"==typeof e)try{this.m_customElement?e(s,n):o=e(s,n)}catch(e){throw new Error(e)}}return o},A.prototype._invokeDropCallback=function(e,t,i,s){var n=this._invokeDndCallback("drop",e,t,i,s);return void 0===n&&this._matchDragDataType(i,e)&&i.preventDefault(),n},A.prototype._matchDragDataType=function(e,t){var i=e.dataTransfer.types,s=this.m_options.options.dnd.drop;if(s&&s[t]&&s[t].dataTypes)for(var n=s[t].dataTypes,o="string"==typeof n?[n]:n,r=0;r<i.length;r++)if(o.indexOf(i[r])>=0)return!0;return!1},A.prototype.handleCancelDrag=function(){this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals()},A.prototype._resetDragInternals=function(){this._cellsDragged=[],this._headersDragged=[],this.m_dragIndex=null,this.m_dragHeader=null,this.m_databodyReorder=!1},A.prototype._disableChildElements=function(e){const t=this.getResources().getMappedAttribute("context");let i="row"===e?this.m_rowHeader:this.m_colHeader;i=i.querySelectorAll("."+this.getResources().getMappedStyle("headercell"));let s=this._getLogicalChildHeaderNodes(i,e,this.m_dragHeader,this.m_dragIndex+1);for(let i=0;i<s.length;i++){let n=s[i][t].index;this._highlightCellsAlongAxis(n,e,"index","add",["disabledElement"]),this._highlightElement(s[i],["disabledElement"])}},A.prototype._getLogicalChildHeaderNodes=function(e,t,i,s){const n=this.getResources().getMappedAttribute("context");let o=[];if("row"===t){let t=i[n].metadata.treeDepth;for(let i=s;i<e.length;i++){if(!(t<e[i][n].metadata.treeDepth))break;o.push(e[i])}}else{let t=i[n].level;for(let i=s;i<e.length;i++){if(!(t<e[i][n].level))break;o.push(e[i])}}return o},A.prototype._enableChildElements=function(){let e=this.getMappedStyle("disabledElement"),t=document.querySelectorAll("."+e);this._unhighlightElementsByClassName(t,["disabledElement"])},A.prototype._unhighlightDragSource=function(){if(this._cellsDragged&&this._cellsDragged.length){let e=["draggableItem","dragSourceOpaque"];this._unhighlightElementsByClassName(this._cellsDragged,e),this._unhighlightElementsByClassName(this._headersDragged,e)}},A.prototype._removeDragStyle=function(e){let t="row"===e?this.m_rowHeader:this.m_rowEndHeader,i="row"===e?this.m_colHeader:this.m_colEndHeader,s=this.getMappedStyle("dragging"),n=t.firstChild.querySelectorAll("."+s);this._unhighlightElementsByClassName(n,["dragging"]),-1!==this.m_endRowEndHeader&&(n=i.firstChild.querySelectorAll("."+s),this._unhighlightElementsByClassName(n,["dragging"]))},A.prototype._getDropContext=function(e,t,i){let s=e.target,n=this.findHeader(s);return{index:t,axis:i,position:this._getRelativePosition(e,i,n,!0)}},A.prototype.handleDropTargetDragOver=function(e){let t=e.target,i=this.m_utils.containsCSSClassName(t,this.getMappedStyle("rowDropTargetLine"))?"row":"column",s={axis:i,position:"after",index:this._getAttribute(this.m_dropTarget,"index")},n="row"===i||"rowEnd"===i?"rows":"columns";this._invokeDropCallback(n,"dragOver",e,s)},A.prototype.handleDropTargetDrop=function(e){let t=e.target,i=this.m_utils.containsCSSClassName(t,this.getMappedStyle("rowDropTargetLine"))?"row":"column",s=this._getAttribute(this.m_dropTarget,"index"),n="row"===i||"rowEnd"===i?"rows":"columns";if(this._destroyDragImage(),this._removeDropTargetLine(i),this._removeDropTargetClass(),"row"===i?this.m_dropRowIndex=null:this.m_dropColumnIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==s){let t={axis:i,position:"after",index:s};this._invokeDropCallback(n,"drop",e,t)}}});
|
|
9
9
|
//# sourceMappingURL=ojdatagrid.js.map
|