"use strict";
// TODO remove libs reexport
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
// React stuff
var react_1 = __importDefault(require("react"));
exports.React = react_1.default;
var prop_types_1 = __importDefault(require("prop-types"));
exports.PropTypes = prop_types_1.default;
var immutability_helper_1 = __importDefault(require("immutability-helper"));
exports.ReactUpdate = immutability_helper_1.default;
var react_dom_1 = __importDefault(require("react-dom"));
exports.ReactDOM = react_dom_1.default;
var ReactRouter = __importStar(require("react-router"));
exports.ReactRouter = ReactRouter;
var ReactRouterBootstrap = __importStar(require("react-router-bootstrap"));
exports.ReactRouterBootstrap = ReactRouterBootstrap;
var history_1 = __importDefault(require("history"));
exports.History = history_1.default;
var md5_1 = __importDefault(require("md5"));
exports.md5 = md5_1.default;
var Redux = __importStar(require("redux"));
exports.Redux = Redux;
var ReactRedux = __importStar(require("react-redux"));
exports.ReactRedux = ReactRedux;
var Popup_1 = require("./ui/popups/Popup");
exports.Popup = Popup_1.Popup;
var Notification_1 = require("./ui/Notification");
exports.Notification = Notification_1.Notification;
var Filter_1 = require("./ui/Filter");
exports.Filter = Filter_1.Filter;
var Menu_1 = require("./ui/Menu");
exports.Menu = Menu_1.Menu;
var MenuItem_1 = require("./ui/MenuItem");
exports.MenuItem = MenuItem_1.MenuItem;
var TabPanel_1 = require("./ui/TabPanel");
exports.TabPanel = TabPanel_1.TabPanel;
var TabPanelOverflowContainer_1 = require("./ui/TabPanelOverflowContainer");
exports.TabPanelOverflowContainer = TabPanelOverflowContainer_1.TabPanelOverflowContainer;
var TabItem_1 = require("./ui/TabItem");
exports.TabItem = TabItem_1.TabItem;
var Button_1 = require("./ui/Button");
exports.Button = Button_1.Button;
var Spinner_1 = require("./ui/Spinner/Spinner");
exports.Spinner = Spinner_1.Spinner;
var Loader_1 = require("./ui/Loader");
exports.Loader = Loader_1.Loader;
var GlobalLoader_1 = require("./ui/GlobalLoader");
exports.GlobalLoader = GlobalLoader_1.GlobalLoader;
var SplitButton_1 = require("./ui/SplitButton");
exports.SplitButton = SplitButton_1.SplitButton;
var CTAContainer_1 = require("./ui/CTAContainer");
exports.CTAContainer = CTAContainer_1.CTAContainer;
var CTAControl_1 = require("./ui/CTAControl");
exports.CTAControl = CTAControl_1.CTAControl;
var Form_1 = require("./ui/form/Form");
exports.Form = Form_1.Form;
var TextInput_1 = require("./ui/form/TextInput");
exports.TextInput = TextInput_1.TextInput;
var TextArea_1 = require("./ui/form/TextArea");
exports.TextArea = TextArea_1.TextArea;
var PureCheckbox_1 = require("./ui/form/PureCheckbox");
exports.PureCheckbox = PureCheckbox_1.PureCheckbox;
var Checkbox_1 = require("./ui/form/Checkbox");
exports.Checkbox = Checkbox_1.Checkbox;
var CheckboxGroup_1 = require("./ui/form/CheckboxGroup");
exports.CheckboxGroup = CheckboxGroup_1.CheckboxGroup;
var Radio_1 = require("./ui/form/Radio");
exports.Radio = Radio_1.Radio;
var Select_1 = require("./ui/form/Select");
exports.Select = Select_1.Select;
var FormGroup_1 = require("./ui/form/FormGroup"); //FIXME Remove legacy declaration
exports.FormGroup = FormGroup_1.FormGroup;
exports.Input = FormGroup_1.FormGroup;
var FormControl_1 = require("./ui/form/FormControl"); //FIXME Remove legacy declaration
exports.FormControl = FormControl_1.FormControl;
exports.FormInput = FormControl_1.FormControl;
var FormErrorAutoFocusContainer_1 = require("./ui/form/FormErrorAutoFocusContainer"); //FIXME Remove legacy declaration
exports.FormErrorAutoFocusContainer = FormErrorAutoFocusContainer_1.FormErrorAutoFocusContainer;
var TextInputControl_1 = require("./ui/form/TextInputControl");
exports.TextInputControl = TextInputControl_1.TextInputControl;
var TextAreaControl_1 = require("./ui/form/TextAreaControl");
exports.TextAreaControl = TextAreaControl_1.TextAreaControl;
var CheckboxControl_1 = require("./ui/form/CheckboxControl");
exports.CheckboxControl = CheckboxControl_1.CheckboxControl;
var RadioControl_1 = require("./ui/form/RadioControl");
exports.RadioControl = RadioControl_1.RadioControl;
var SelectControl_1 = require("./ui/form/SelectControl");
exports.SelectControl = SelectControl_1.SelectControl;
var MultiSelect_1 = require("./ui/form/MultiSelect");
exports.MultiSelect = MultiSelect_1.MultiSelect;
var TreeFilterControl_1 = require("./ui/form/TreeFilterControl");
exports.TreeFilterControl = TreeFilterControl_1.TreeFilterControl;
var InputCounter_1 = require("./ui/form/InputCounter");
exports.InputCounter = InputCounter_1.InputCounter;
var Autosuggest_1 = require("./ui/form/Autosuggest");
exports.Autosuggest = Autosuggest_1.Autosuggest;
var AutosuggestControl_1 = require("./ui/form/AutosuggestControl");
exports.AutosuggestControl = AutosuggestControl_1.AutosuggestControl;
var Translate_1 = require("./ui/Translate");
exports.Translate = Translate_1.Translate;
var DangerousHTML_1 = require("./ui/DangerousHTML");
exports.DangerousHTML = DangerousHTML_1.DangerousHTML;
var ListControlCheckbox_1 = require("./ui/list/withStore/ListControlCheckbox");
exports.ListControlCheckbox = ListControlCheckbox_1.ListControlCheckbox;
var ListHighlight_1 = require("./ui/list/withStore/ListHighlight");
exports.ListHighlight = ListHighlight_1.ListHighlight;
var ListSorter_1 = require("./ui/list/withStore/ListSorter");
exports.ListSorter = ListSorter_1.ListSorter;
var ListRow_1 = require("./ui/list/ListRow");
exports.ListRow = ListRow_1.ListRow;
var GridSorter_1 = require("./ui/list/withStore/GridSorter");
exports.GridSorter = GridSorter_1.GridSorter;
var GridHeaderCell_1 = require("./ui/list/withStore/GridHeaderCell");
exports.GridHeaderCell = GridHeaderCell_1.GridHeaderCell;
var GridCell_1 = require("./ui/list/withStore/GridCell");
exports.GridCell = GridCell_1.GridCell;
var GridRowActions_1 = require("./ui/GridRowActions");
exports.GridRowActions = GridRowActions_1.GridRowActions;
var CollapsibleList_1 = require("./ui/CollapsibleList");
exports.CollapsibleList = CollapsibleList_1.CollapsibleList;
var CollapsibleToolbar_1 = require("./ui/CollapsibleToolbar");
exports.CollapsibleToolbar = CollapsibleToolbar_1.CollapsibleToolbar;
var Icon_1 = require("./ui/Icon");
exports.Icon = Icon_1.Icon;
var HeaderIcon_1 = require("./ui/HeaderIcon");
exports.HeaderIcon = HeaderIcon_1.HeaderIcon;
var Panel_1 = require("./ui/Panel");
exports.Panel = Panel_1.Panel;
var Block_1 = require("./ui/Block");
exports.Block = Block_1.Block;
var Dropdown_1 = require("./ui/Dropdown");
exports.Dropdown = Dropdown_1.Dropdown;
var DropdownButton_1 = require("./ui/DropdownButton");
exports.DropdownButton = DropdownButton_1.DropdownButton;
var Row_1 = require("./ui/Row");
exports.Row = Row_1.Row;
var Col_1 = require("./ui/Col");
exports.Col = Col_1.Col;
var Message_1 = require("./ui/Message");
exports.Message = Message_1.Message;
var Wizard_1 = require("./ui/Wizard");
exports.Wizard = Wizard_1.Wizard;
var Tooltip_1 = require("./ui/Tooltip");
exports.Tooltip = Tooltip_1.Tooltip;
var BorderedList_1 = require("./ui/BorderedList");
exports.BorderedList = BorderedList_1.BorderedList;
exports.BorderedListItem = BorderedList_1.BorderedListItem;
var BrandedImage_1 = require("./ui/BrandedImage");
exports.BrandedImage = BrandedImage_1.BrandedImage;
var MoreButton_1 = require("./ui/MoreButton");
exports.MoreButton = MoreButton_1.MoreButton;
var Pagination_1 = require("./ui/list/withStore/Pagination");
exports.Pagination = Pagination_1.Pagination;
var HeaderToolbar_1 = require("./ui/HeaderToolbar");
exports.HeaderToolbar = HeaderToolbar_1.HeaderToolbar;
var Highlighter_1 = require("./ui/Highlighter");
exports.Highlighter = Highlighter_1.Highlighter;
var Note_1 = require("./ui/Note");
exports.Note = Note_1.Note;
var StoreCounterText_1 = require("./ui/list/withStore/StoreCounterText");
exports.StoreCounterText = StoreCounterText_1.StoreCounterText;
var SelectedRecordsSwitcher_1 = require("./ui/SelectedRecordsSwitcher");
exports.SelectedRecordsSwitcher = SelectedRecordsSwitcher_1.SelectedRecordsSwitcher;
var List_1 = require("./ui/list/withStore/List");
exports.List = List_1.List;
var ListLayout_1 = require("./ui/list/withStore/ListLayout");
exports.ListLayout = ListLayout_1.ListLayout;
var WizardStep_1 = require("./ui/WizardStep");
exports.WizardStep = WizardStep_1.WizardStep;
var Alert_1 = require("./ui/popups/Alert");
exports.Alert = Alert_1.Alert;
var Confirm_1 = require("./ui/popups/Confirm");
exports.Confirm = Confirm_1.Confirm;
var DismissibleAlert_1 = require("./ui/DismissibleAlert");
exports.DismissibleAlert = DismissibleAlert_1.DismissibleAlert;
var TiledGrid_1 = require("./ui/TiledGrid");
exports.TiledGrid = TiledGrid_1.TiledGrid;
var Banner_1 = require("./ui/Banner");
exports.Banner = Banner_1.Banner;
var AudioPlayer_1 = require("./ui/media/AudioPlayer");
exports.AudioPlayer = AudioPlayer_1.AudioPlayer;
var AudioRecorder_1 = require("./ui/media/AudioRecorder");
exports.AudioRecorder = AudioRecorder_1.AudioRecorder;
var Static_1 = require("./ui/form/Static");
exports.Static = Static_1.Static;
var Toggle_1 = require("./ui/form/Toggle");
exports.Toggle = Toggle_1.Toggle;
var ToggleControl_1 = require("./ui/form/ToggleControl");
exports.ToggleControl = ToggleControl_1.ToggleControl;
var FileUploadControl_1 = require("./ui/form/FileUploadControl");
exports.FileUploadControl = FileUploadControl_1.FileUploadControl;
var FileUpload_1 = require("./ui/form/FileUpload");
exports.FileUpload = FileUpload_1.FileUpload;
var PrintArea_1 = require("./ui/PrintArea");
exports.PrintArea = PrintArea_1.PrintArea;
var NoPrint_1 = require("./ui/NoPrint");
exports.NoPrint = NoPrint_1.NoPrint;
var ColumnTreeView_1 = require("./ui/ColumnTreeView");
exports.ColumnTreeView = ColumnTreeView_1.ColumnTreeView;
var BreadCrumbs_1 = require("./ui/BreadCrumbs");
exports.BreadCrumbs = BreadCrumbs_1.BreadCrumbs;
var Dropzone_1 = require("./ui/Dropzone");
exports.Dropzone = Dropzone_1.Dropzone;
var KeyDownable_1 = require("./ui/KeyDownable");
exports.KeyDownable = KeyDownable_1.KeyDownable;
var NavDropdown_1 = require("./ui/NavDropdown");
exports.NavDropdown = NavDropdown_1.NavDropdown;
var flexBlock_1 = require("./ui/flexBlock");
exports.FlexBlock = flexBlock_1.FlexBlock;
exports.FlexBlockItem = flexBlock_1.FlexBlockItem;
var TestAutomationPanel_1 = require("./ui/TestAutomationPanel/TestAutomationPanel");
exports.TestAutomationPanel = TestAutomationPanel_1.TestAutomationPanel;
var TreeList_1 = require("./ui/list/TreeList");
exports.TreeList = TreeList_1.TreeList;
var SingleDatePickerInputControl_1 = require("./ui/form/DateTimePicker/SingleDatePickerInputControl");
exports.DatePickerControl = SingleDatePickerInputControl_1.SingleDatePickerInputControl;
var SingleDatePicker_1 = require("./ui/form/DateTimePicker/SingleDatePicker");
exports.DatePicker = SingleDatePicker_1.SingleDatePicker;
var DayRangePickerControl_1 = require("./ui/form/DateTimePicker/DayRangePickerControl");
exports.DateRangePickerControl = DayRangePickerControl_1.DayRangePickerControl;
var DayRangePicker_1 = require("./ui/form/DateTimePicker/DayRangePicker");
exports.DateRangePicker = DayRangePicker_1.DayRangePicker;
var accordion_1 = require("./ui/accordion");
exports.Accordion = accordion_1.Accordion;
exports.AccordionItem = accordion_1.AccordionItem;
var DateRangePickerWithPresets_1 = require("./ui/form/DateRangePickerWithPresets");
exports.DateRangePickerWithPresets = DateRangePickerWithPresets_1.DateRangePickerWithPresets;
var catalog_1 = require("./ui/catalog");
exports.CatalogItemIcon = catalog_1.CatalogItemIcon;
exports.CatalogListItem = catalog_1.CatalogListItem;
exports.CatalogGridItem = catalog_1.CatalogGridItem;
exports.CatalogListDetails = catalog_1.CatalogListDetails;
exports.CatalogGridDetails = catalog_1.CatalogGridDetails;
exports.CatalogSearchResultItem = catalog_1.CatalogSearchResultItem;
exports.CatalogSimplePrice = catalog_1.CatalogSimplePrice;
var Search_1 = require("./ui/Search");
exports.Search = Search_1.Search;
var PureList_1 = require("./ui/list/PureList");
exports.PureList = PureList_1.PureList;
var PurePagination_1 = require("./ui/list/PurePagination");
exports.PurePagination = PurePagination_1.PurePagination;
var CounterText_1 = require("./ui/list/CounterText");
exports.CounterText = CounterText_1.CounterText;
var ListManager_1 = require("./ui/list/ListManager");
exports.ListManager = ListManager_1.ListManager;
exports.passedListManagerPropsTypes = ListManager_1.passedListManagerPropsTypes;
var PureListSorter_1 = require("./ui/list/PureListSorter");
exports.PureListSorter = PureListSorter_1.PureListSorter;
var PureListHighlight_1 = require("./ui/list/PureListHighlight");
exports.PureListHighlight = PureListHighlight_1.PureListHighlight;
var PureListLayout_1 = require("./ui/list/PureListLayout");
exports.PureListLayout = PureListLayout_1.PureListLayout;
var PurePaginationWithCounter_1 = require("./ui/list/PurePaginationWithCounter");
exports.PurePaginationWithCounter = PurePaginationWithCounter_1.PurePaginationWithCounter;
var Switcher_1 = require("./ui/switcher/Switcher");
exports.Switcher = Switcher_1.Switcher;
var SwitcherItem_1 = require("./ui/switcher/SwitcherItem");
exports.SwitcherItem = SwitcherItem_1.SwitcherItem;
var withSelectedIds_1 = require("./ui/HOCs/withSelectedIds");
exports.withSelectedIds = withSelectedIds_1.withSelectedIds;
exports.passedWithSelectedIdsPropsTypes = withSelectedIds_1.passedWithSelectedIdsPropsTypes;
var ExternalLink_1 = require("./ui/ExternalLink");
exports.ExternalLink = ExternalLink_1.ExternalLink;
var ToolsMenu_1 = require("./ui/ToolsMenu");
exports.ToolsMenu = ToolsMenu_1.ToolsMenu;
exports.ToolsDropdown = ToolsMenu_1.ToolsDropdown;
// Utils
var format_message_1 = __importDefault(require("format-message"));
exports.formatMessage = format_message_1.default;
var validator_1 = __importDefault(require("validator"));
exports.validator = validator_1.default;
var lodash_1 = __importDefault(require("lodash"));
exports._ = lodash_1.default;
var moment_1 = __importDefault(require("moment"));
exports.moment = moment_1.default;
var classnames_1 = __importDefault(require("classnames"));
exports.classnames = classnames_1.default;
var tiny_emitter_1 = __importDefault(require("tiny-emitter"));
exports.TinyEmitter = tiny_emitter_1.default;
// React Bootstrap Non-Wrapped
var ButtonToolbar_1 = __importDefault(require("react-bootstrap/lib/ButtonToolbar"));
exports.ButtonToolbar = ButtonToolbar_1.default;
var ButtonGroup_1 = __importDefault(require("react-bootstrap/lib/ButtonGroup"));
exports.ButtonGroup = ButtonGroup_1.default;
var OverlayTrigger_1 = __importDefault(require("react-bootstrap/lib/OverlayTrigger"));
exports.OverlayTrigger = OverlayTrigger_1.default;
var Overlay_1 = __importDefault(require("react-bootstrap/lib/Overlay"));
exports.Overlay = Overlay_1.default;
var Popover_1 = __importDefault(require("react-bootstrap/lib/Popover"));
exports.Popover = Popover_1.default;
var Navbar_1 = __importDefault(require("react-bootstrap/lib/Navbar"));
exports.Navbar = Navbar_1.default;
var NavItem_1 = __importDefault(require("react-bootstrap/lib/NavItem"));
exports.NavItem = NavItem_1.default;
var Nav_1 = __importDefault(require("react-bootstrap/lib/Nav"));
exports.Nav = Nav_1.default;
var Table_1 = __importDefault(require("react-bootstrap/lib/Table"));
exports.Table = Table_1.default;
var Collapse_1 = __importDefault(require("react-bootstrap/lib/Collapse"));
exports.Collapse = Collapse_1.default;
var FormControlStatic_1 = __importDefault(require("react-bootstrap/lib/FormControlStatic"));
exports.StaticControl = FormControlStatic_1.default;
var Alert_2 = __importDefault(require("react-bootstrap/lib/Alert"));
exports.BootstrapAlert = Alert_2.default;
var ControlLabel_1 = __importDefault(require("react-bootstrap/lib/ControlLabel"));
exports.ControlLabel = ControlLabel_1.default;
var HelpBlock_1 = __importDefault(require("react-bootstrap/lib/HelpBlock"));
exports.HelpBlock = HelpBlock_1.default;
var InputGroup_1 = __importDefault(require("react-bootstrap/lib/InputGroup"));
exports.InputGroup = InputGroup_1.default;
var InputGroupAddon_1 = __importDefault(require("react-bootstrap/lib/InputGroupAddon"));
exports.InputGroupAddon = InputGroupAddon_1.default;
var InputGroupButton_1 = __importDefault(require("react-bootstrap/lib/InputGroupButton"));
exports.InputGroupButton = InputGroupButton_1.default;
var Media_1 = __importDefault(require("react-bootstrap/lib/Media"));
exports.Media = Media_1.default;
var ProgressBar_1 = __importDefault(require("react-bootstrap/lib/ProgressBar"));
exports.ProgressBar = ProgressBar_1.default;
var FormControlFeedback_1 = __importDefault(require("react-bootstrap/lib/FormControlFeedback"));
exports.FormControlFeedback = FormControlFeedback_1.default;
// Data
var Transport_1 = __importDefault(require("./data/Transport"));
exports.Transport = Transport_1.default;
var Store_1 = require("./data/Store");
exports.Store = Store_1.Store;
var ColumnsStore_1 = require("./data/ColumnsStore");
exports.ColumnsStore = ColumnsStore_1.ColumnsStore;
var TreeItemHelpers = __importStar(require("./data/TreeItemMap"));
exports.TreeItemHelpers = TreeItemHelpers;
var TreeStore_1 = require("./data/TreeStore");
exports.TreeStore = TreeStore_1.TreeStore;
// Utils
var EventBus_1 = __importDefault(require("./utils/EventBus"));
exports.EventBus = EventBus_1.default;
var BrandedFileLoader_1 = __importDefault(require("./utils/BrandedFileLoader"));
exports.BrandedFileLoader = BrandedFileLoader_1.default;
var functions_1 = require("./utils/functions");
exports.getSilentRouterHistory = functions_1.getSilentRouterHistory;
exports.setDocumentTitle = functions_1.setDocumentTitle;
exports.isReactComponent = functions_1.isReactComponent;
exports.isReactElement = functions_1.isReactElement;
exports.mountComponent = functions_1.mountComponent;
exports.isSafeStringValue = functions_1.isSafeStringValue;
exports.OS = functions_1.OS;
exports.fillBrandName = functions_1.fillBrandName;
exports.extendFormState = functions_1.extendFormState;
exports.cleanFormState = functions_1.cleanFormState;
exports.wait = functions_1.wait;
exports.filterKeyCodes = functions_1.filterKeyCodes;
var utils_1 = require("./ui/utils");
exports.scrollToNode = utils_1.scrollToNode;
var FocusHelper_1 = require("./utils/FocusHelper");
exports.FocusHelper = FocusHelper_1.FocusHelper;
var ValidationUtils_1 = require("./utils/ValidationUtils");
exports.ValidationUtils = {
    validate: ValidationUtils_1.validate,
    stripErrors: ValidationUtils_1.stripErrors
};
var functions_2 = require("./ui/functions");
exports.showPopup = functions_2.showPopup;
exports.showAlert = functions_2.showAlert;
exports.showConfirmation = functions_2.showConfirmation;
exports.showNotification = functions_2.showNotification;
exports.scrollToTop = functions_2.scrollToTop;
exports.playMessage = functions_2.playMessage;
var showLoader = function () { };
var hideLoader = function () { };
function loadPackage(modules, callback, errback) {
    if (!Array.isArray(modules)) {
        modules = [modules];
    }
    showLoader();
    // guard against Webpack context parser
    //TODO Try ro require('requirejs')
    window['require'](modules.map(function (p) {
        return p.indexOf('app/') !== -1 && p.indexOf('/index') !== -1
            ? p
            : 'app/' + p + '/index'; //TODO Make app prefix configurable
    }), function () {
        hideLoader();
        callback.apply(null, arguments);
    }, function () {
        hideLoader();
        if (errback) {
            errback.apply(null, arguments);
        }
        else {
            // eslint-disable-next-line
            if (arguments[0] && arguments[0].stack)
                console.error(arguments[0].stack);
            // eslint-disable-next-line
            console.error(arguments);
        }
    });
}
exports.loadPackage = loadPackage;
function bootstrap(options) {
    showLoader = options.showLoader || showLoader;
    hideLoader = options.hideLoader || hideLoader;
    // @ts-ignore
    setup(options.config, options.locale);
    loadPackage(['app/lang/common/index-en_US'], function (langCommon) {
        var skin = options.skin || options.config.brandId;
        loadPackage(['app/core/all/index-' + skin], options.done, function () {
            // eslint-disable-next-line
            console.warn('Skin for', skin, 'cannot be loaded, fallback to default');
            loadPackage(['app/core/all/index-default'], options.done);
        });
    });
}
exports.bootstrap = bootstrap;
//# sourceMappingURL=index.js.map