require("./bootstrap");

Vue.component('tinymce', require('./components/tinymce').default);

import tinymce from 'vue-tinymce-editor'
Vue.component('tinymce', tinymce);

/**
 * Add in moment.js for time functionality
 * Currently used in cms admin panel
 */
window.moment = require('moment');

/**
 * Add in Dropzone.js for image uploads
 * Used in shop image upload, supported everywhere
 */
window.Dropzone = require('dropzone');
Dropzone.autoDiscover = false;

require("../../core/js/jquery.ui");

require("../../core/js/tinymce");

require("../../core/js/plugins/mtc_chop");
require("../../core/js/plugins/mtc_chosen");
require("../../core/js/plugins/mtc_cookies");
require("../../core/js/plugins/mtc_easing");
require("../../core/js/plugins/mtc_hover_intent");
require("../../core/js/plugins/mtc_jquery_ui_touch_punch");
require("../../core/js/plugins/mtc_loadify");
require("../../core/js/plugins/mtc_match_height");
require("../../core/js/plugins/mtc_mobile_menu");
require("../../core/js/plugins/mtc_multi_currency");
require("../../core/js/plugins/mtc_number_arrows");
require("../../core/js/plugins/mtc_overlay");
require("../../core/js/plugins/mtc_perfect_scroll");
require("../../core/js/plugins/mtc_placeholder");
require("../../core/js/plugins/mtc_responsive_tables");
require("../../core/js/plugins/mtc_slick");
require("../../core/js/plugins/mtc_tabs");
require("../../core/js/plugins/mtc_waypoints");
require("../../core/admin/js/plugins/colorpicker");
require("../../core/admin/js/plugins/jcrop");
require("../../core/admin/js/plugins/jquery.combobox");
require("../../core/admin/js/plugins/jquery.coordinate_picker");
require("../../core/admin/js/plugins/jquery.mjs.nestedSortable");
require("../../core/admin/js/plugins/jquery.smodal");
require("../../core/admin/js/plugins/jquery-ui-timepicker-addon");
require("../../core/admin/js/plugins/jquery.uploadifive.min");
require("../../core/admin/js/history");
require("../../core/admin/js/admin_navigation");
require("../../core/admin/js/jquery.datetimepicker");
require("../../core/admin/js/plugins");
require("../../core/admin/js/script");
require("../../core/admin/js/libs/xds");

// Auto-load all js files in ./vendor/admin/*.js (with sub-dirs)
// This allows us to use vendor packages and publish their JS assets to this location
const files = require.context('./vendor/admin/', true, /\.js$/i);
files.keys().forEach(files);

require("./dynamic_admin");

require("../../core/js/global");

$(() => {
    init_tinymce();
});
