diff --git a/assets/core/core.js b/assets/core/core.js
index 6de3016..1a3f3c4 100644
--- a/assets/core/core.js
+++ b/assets/core/core.js
@@ -848,6 +848,34 @@ kit.config = kit.config || {};
}.bind(this));
}
};
+ /**
+ * @param {(string|string[])} deps
+ * @param {function} callback
+ * @memberOf kit
+ */
+
+ PluginManager.prototype.loaded = function(deps, callback = undefined) {
+ var self = this;
+ if(typeof deps === 'function') {
+ callback = deps;
+ deps = [];
+ }
+ if(typeof callback !== 'function') {
+ callback = function (){};
+ }
+ self.__loaded(self.exec, [deps, callback], self);
+ };
+ PluginManager.prototype.__loaded = function(fn, args = [], context = window) {
+ var self = this;
+ context = context || this;
+ if (/complete|interactive|loaded/.test(document.readyState)) {
+ fn.apply(context, args);
+ } else {
+ window.addEventListener("load", function () {
+ fn.apply(context, args);
+ }.bind(this));
+ }
+ };
PluginManager.prototype.require = function (pluginId, callback) {
@@ -885,6 +913,7 @@ kit.config = kit.config || {};
var manager = new PluginManager(global);
global.ready = manager.ready.bind(manager);
+ global.loaded = manager.loaded.bind(manager);
global.exec = manager.exec.bind(manager);
global.require = manager.require.bind(manager);
manager.register('pluginManager', {
@@ -932,6 +961,9 @@ kit.config = kit.config || {};
document.addEventListener("DOMContentLoaded", function () {
console.log('%cDOMContentLoaded', 'color:#2053ff');
});
+ window.addEventListener("load", (event) => {
+ console.log('%cWindowLoaded', 'color:#2053ff');
+ });
}());
},
onInstall: function(plugin){
diff --git a/assets/core/core.min.js b/assets/core/core.min.js
index 60b257e..db0890f 100644
--- a/assets/core/core.min.js
+++ b/assets/core/core.min.js
@@ -1 +1 @@
-window.kit=window.kit||{},kit.service=kit.service||{},kit.config=kit.config||{},!function(global){var defaultConfig={version:"2.0",assetsPath:"",requiredDependencies:[],autoloadPluginList:[],debug:!0},stateList={undefined:0,registered:1,loading:3,loaded:4,installing:5,installed:6},MD_TYPE={ES:"ES",UMD:"UMD",HMD:"HMD",default:"default"};function Plugin(e,t={}){this.id=e,this.state=stateList.undefined,this.state2=stateList.undefined,this.module={code:"",exports:{}},this.config={autoRequire:!1,loadJsAfterModule:!1,isSetTimestamp:!0,path:"",module:"",type:"default",handler:void 0,onRegister:function(e){},onLoad:function(e){},onInstall:function(e){},js:[],css:[],alias:[],deps:[],debug:!1},this.pluginManager=void 0,this.promise=new Promise(function(e,t){e()}),this.errors=[],this.register(t)}function isAssetLoaded(e){return e=e.match(/^[^#?]*/)[0],document.querySelector('script[src^="'+e+'"]')||document.querySelector('link[href^="'+e+'"]')||document.querySelector('meta[property="kit:file-load"][content="'+e+'"]')}function getUrlWithTimestamp(t){var n=3600*((new Date).getTime()/1e3/3600>>0);try{var e=new URL(t);e.searchParams.append("__pm",String(n)),t=e.toString()}catch(e){t=(t=String(t).split("?")[0])+"?__pm"+n}return t}Plugin.prototype.setPluginManager=function(e){this.pluginManager=e},Plugin.prototype.queuePush=function(n,i=[]){"function"==typeof n&&(this.promise=this.promise.then(function(e){var t=n.apply(this,i);if(t)return t}))},Plugin.prototype.__queue=function(e,n,i=[],o=void 0){var t=this;void 0===o&&(o=t),t.__checkState(e)?n.apply(o,i):t.promise=t.promise.then(function(){return new Promise(function(e,t){n.apply(o,i),e()})}.bind(t))},Plugin.prototype.__exec=function(e,t,n=[],i=void 0){var o=this;void 0===i&&(i=o),o.__checkState(e)?t.apply(i,n):o.promise=o.promise.then(function(){t.apply(i,n)}.bind(o))},Plugin.prototype.__checkState=function(e,t=void 0){return void 0===t?this.state>=e:this.state>=e&&this.state<=t},Plugin.prototype.__check2State=function(e,t=void 0){return void 0===t?this.state2>=e:this.state2>=e&&this.state2<=t},Plugin.prototype.__getValidConfig=function(e={}){e=Object.assign({},e);return"function"!=typeof e.onLoad&&(e.onLoad=function(e){}),"function"!=typeof e.onInstall&&(e.onInstall=function(e){}),"function"!=typeof e.onRegister&&(e.onRegister=function(e){}),"string"!=typeof e.path&&(e.path=""),"string"==typeof e.js?e.js=[e.js]:Array.isArray(e.js)||(e.js=[]),"string"==typeof e.css?e.css=[e.css]:Array.isArray(e.css)||(e.css=[]),"string"==typeof e.alias?e.alias=[e.alias]:Array.isArray(e.alias)||(e.alias=[]),e.autoRequire=!!e.hasOwnProperty("autoRequire")&&!!e.autoRequire,e.loadJsAfterModule=!!e.hasOwnProperty("loadJsAfterModule")&&!!e.loadJsAfterModule,e.isSetTimestamp=!e.hasOwnProperty("isSetTimestamp")||!!e.isSetTimestamp,e.type=e.type||"default","string"==typeof e.deps?e.deps=[e.deps]:Array.isArray(e.deps)||(e.deps=[]),e},Plugin.prototype.__setState=function(e,t=!1){var n=this;(t||n.__checkState(e))&&(n.state=e)},Plugin.prototype.register=function(e={}){var t,n=this,i=n.id;if(this.__checkState(stateList.installed))throw new Error("Plugin "+i+" уже невозможно конфигурировать ("+n.state+"/"+n.state2+")");if("function"==typeof e)t=e,(e=this.config).handler=t,e.type=MD_TYPE.HMD;else{if(this.__checkState(stateList.loaded)||this.__check2State(stateList.loading))throw new Error("Plugin "+i+" уже невозможно конфигурировать ("+n.state+")");if("object"!=typeof e)throw new Error("Plugin.register: plugin "+i+" is not a valid format");e=this.__getValidConfig(e),Object.assign(this.config,e)}this.__checkState(stateList.registered)||(n.config.debug&&console.log(`Plugin ${n.id}: onRegister + event.`),this.state=stateList.registered,this.config.onRegister(this),t=new CustomEvent("onRegister"+this.id+"Plugin",{detail:{plugin:this}}),document.dispatchEvent(t)),e.autoRequire},Plugin.prototype.load=function(e){var i,t,n,o,s,r=this,l=("function"!=typeof e&&(e=function(){}),r.id);return r.__checkState(stateList.registered)?r.__checkState(stateList.loaded)?e():r.__check2State(stateList.loading)?r.__exec(stateList.loaded,e):(r.state2=stateList.loading,(i=r.config).css.forEach(function(e,t,n){r.getStylePromise(i.path+e)}),r.pluginManager&&(t=r.pluginManager.__getDepsPromiseCallback(r.config.deps),r.queuePush(t)),o=i.path+i.module,n="string"==typeof i.module&&""!==i.module&&"ES"===i.type?function(){return r.getESModulePromise(o).then(function(e){e.__esModule=!0,r.module.exports=e}.bind(r))}:"string"==typeof i.module&&""!==i.module&&"UMD"===i.type?isAssetLoaded(o)?void(r.config.debug&&console.warn(`Plugin ${r.id}: Скрипт ${o} уже загружен!`)):function(){return r.httpGet(o).then(function(e){r.module.code=e}.bind(r))}:"HMD"!==i.type||i.hasOwnProperty("handler")&&"function"==typeof i.handler?"string"==typeof i.module&&""!==i.module&&"default"===i.type?isAssetLoaded(o)?void(r.config.debug&&console.warn(`Plugin ${r.id}: Скрипт ${o} уже загружен!`)):function(){return r.getScriptPromise(o)}:void 0:function(){return r.getScriptPromise(o)},s=r.getJsAssetsPromiseCallback(i.js),i.loadJsAfterModule?(r.queuePush(n),r.queuePush(s)):(r.queuePush(s),r.queuePush(n)),t||n||s||(r.state=stateList.loaded),r.__queue(stateList.loaded,function(){r.config.debug&&console.log(`Plugin ${r.id}: onLoad + event.`),r.isLoaded()||(r.state=stateList.loaded),i.onLoad.call(r,r);var e=new CustomEvent("onLoad"+r.id+"Plugin",{detail:{plugin:r}});document.dispatchEvent(e)}),r.__exec(stateList.loaded,function(){e()}.bind(r))):console.warn(`Plugin.load(${l}): is not register!.`),r},Plugin.prototype.install=function(callback){var self=this,global=self.pluginManager.global,require=self.pluginManager.require.bind(self.pluginManager),pluginId=("function"!=typeof callback&&(callback=function(){}),self.id),setGlobals,module,installer;return self.__checkState(stateList.registered)?self.__checkState(stateList.installed)?callback():self.__check2State(stateList.installing)?self.__exec(stateList.installed,callback):(self.__checkState(stateList.loaded)||this.load(),self.state2=stateList.installing,setGlobals=function(t,n){var e,i;void 0!==n&&(e=self.id,i=self.config.alias,t.hasOwnProperty(e)||(t[e]=n),Array.isArray(i))&&i.length&&i.forEach(function(e){t.hasOwnProperty(e)||(t[e]=n)})},module=self.module,installer=function(){var __exports=void 0,event=("ES"===self.config.type&&"string"==typeof self.config.module&&""!==self.config.module?__exports="object"==typeof self.module.exports&&void 0!==self.module.exports.default?self.module.exports.default:self.module.exports:"UMD"===self.config.type&&"string"==typeof self.config.module&&""!==self.config.module?(function(require,exports,module,global){var self=global;eval(module.code)}.bind(global).call(global,require,self.module.exports,module,global),__exports="object"==typeof self.module.exports&&void 0!==self.module.exports.default?self.module.exports.default:self.module.exports):"HMD"===self.config.type&&"function"==typeof self.config.handler&&(__exports=self.config.handler.bind(global).call(global,require,self.module.exports,module,global),void 0===__exports)&&self.module.exports&&(__exports=self.module.exports),"object"==typeof global&&setGlobals(global,__exports),self.state=stateList.installed,console.log(`%cPlugin ${pluginId}: installed.`,"color: green;"),self.config.onInstall.call(self,self),new CustomEvent("onInstall"+self.id+"Plugin",{detail:{plugin:self}}));return document.dispatchEvent(event),!0}.bind(this),this.__queue(stateList.loaded,installer),this.__exec(stateList.loaded,function(){callback()})):console.warn(`Plugin ${pluginId}: is not register!`),self},Plugin.prototype.exec=function(e,t=[],n=void 0){var i=this;void 0===n&&(n=i),i.__checkState(stateList.installed)||(i.load(),i.install()),i.__exec(stateList.installed,e,t,n)},Plugin.prototype.getESModulePromise=function(e){var i=this;return new Promise(function(t,n){import(e).then(function(e){t(e)},function(e){i.errors.push(e),console.log(`%cPlugin ${i.id}: error import module!`,"color: red;"),n(e)})})},Plugin.prototype.httpGet=function(i){var o=this;return new Promise(function(t,n){o.config.debug&&console.log(`Plugin ${o.id}: httpGet `+i);var e=new XMLHttpRequest;e.open("GET",i,!0),e.onload=function(){var e;200==this.status?t(this.response):(console.log(`%cPlugin.load(${o.id}): error load file!`,"color: red;"),(e=new Error(this.statusText)).code=this.status,n(e))},e.onerror=function(){console.log(`%cPlugin.load(${o.id}): error load file!`,"color: red;"),n(new Error("Network Error"))},e.send()})},Plugin.prototype.getScriptPromise=function(i){var o=this;if(!isAssetLoaded(i))return new Promise(function(e,t){o.config.debug&&console.log(`Plugin ${o.id}: load script `+i);var n=document.createElement("script");n.src=i,o.config.isSetTimestamp&&(n.src=getUrlWithTimestamp(i)),n.onload=function(){e(n)},n.onerror=function(){var e=new Error("Ошибка загрузки скрипта "+i);o.errors.push(e),console.log(`%cPlugin.load(${o.id}): error load script!`,"color: red;"),t(e)},document.head.append(n)});o.config.debug&&console.warn(`Plugin ${o.id}: Скрипт ${i} уже загружен!`)},Plugin.prototype.getStylePromise=function(i){var o=this;return new Promise(function(e,t){var n;isAssetLoaded(i)?(o.config.debug&&console.warn(`Plugin ${o.id}: Стиль ${i} уже загружен`),e()):((n=document.createElement("link")).rel="stylesheet",n.type="text/css",n.media="all",n.href=i,o.config.isSetTimestamp&&(n.href=getUrlWithTimestamp(i)),document.head.append(n),e(n))})},Plugin.prototype.getAsyncScriptListPromise=function(e){e=e.map(this.getScriptPromise.bind(this)).filter(e=>void 0!==e);if(e.length)return Promise.all(e)},Plugin.prototype.getJsAssetsPromiseCallback=function(e=[]){var o=this;if(e.length)return function(){var i=new Promise(function(e,t){e()});return e.forEach(function(e,t,n){i=Array.isArray(e)?i.then(function(){return o.getAsyncScriptListPromise(e)}):i.then(function(){return o.getScriptPromise(o.config.path+e)})}),i}},Plugin.prototype.__getRealId=function(e){var t,n=e.toLowerCase();if(this.id.toLowerCase()===n)return this.id;for(t of this.config.alias)if(n===t.toLowerCase())return this.id},Plugin.prototype.__is=function(e){return this.id===this.__getRealId(e)},Plugin.prototype.isLoaded=function(){return this.__checkState(stateList.loaded)},Plugin.prototype.isInstalled=function(){return this.__checkState(stateList.installed)},Plugin.prototype.require=function(){return this.isInstalled()||this.config.debug&&console.warn(`Plugin ${this.id}: not instaled!`),this.module.exports};var PluginManager=function(e){this.plugins={},this.global=e};function init(e){var o=new PluginManager(e);e.ready=o.ready.bind(o),e.exec=o.exec.bind(o),e.require=o.require.bind(o),o.register("pluginManager",{alias:"pm",type:MD_TYPE.HMD,handler:function(e,t,n,i){return i.PluginManagerClass=PluginManager,"object"==typeof window&&(window.__PluginManager__=o,window.__pmGlobal__=i),n.exports=o},onInstall:function(e){}}),o.install("pluginManager"),o.register("config",{type:MD_TYPE.HMD,handler:function(e,t,n,i){var o=document.currentScript;if(o)try{var s=new URL(o.src);defaultConfig.assetsPath=s.pathname.split("/").slice(0,-2).join("/")}catch(e){s=o.src.split("?")[0];defaultConfig.assetsPath=s.split("/").slice(0,-2).join("/")}o=i.config||{},o=Object.assign({},defaultConfig,o);"object"==typeof window&&(window.__pmConfig__=i.config=o),document.addEventListener("DOMContentLoaded",function(){console.log("%cDOMContentLoaded","color:#2053ff")})},onInstall:function(e){"object"==typeof window&&window.hasOwnProperty("__PluginManagerConfigHandler__")&&"function"==typeof __PluginManagerConfigHandler__&&o.registerPlugins(__PluginManagerConfigHandler__())}}),o.install("config")}PluginManager.prototype.registerPlugins=function(e){for(var t in e)e.hasOwnProperty(t)&&this.register(t,e[t]);return this},PluginManager.prototype.register=function(e,t={}){var n;"string"!=typeof e||""===e?console.warn("Invalid pluginId!",e):(n=this.__getPlugin(e))?n.register(t):((n=new Plugin(e,t)).setPluginManager(this),this.plugins[e]=n)},PluginManager.prototype.__getPlugin=function(e){var t,n;for(t in this.plugins)if(this.plugins.hasOwnProperty(t)&&(n=this.plugins[t]).__is(e))return n},PluginManager.prototype.__getDepsPromiseCallback=function(e=[]){var n=this,t=e.map(function(e){var t=n.__getPlugin(e);if(t)return t.install(),t.isInstalled()?void 0:t.promise;console.log(`%cPluginManager: plugin ${e} not found!`,"color: red;")}).filter(e=>void 0!==e);if(t.length)return function(){return Promise.all(t)}},PluginManager.prototype.__getRealIdList=function(e=[]){var t=this;return e.map(function(e){e=t.__getPlugin(e);if(e)return e.id})},PluginManager.prototype.exec=function(e,t,n=[],i=void 0){"function"==typeof e&&(i=n,n=t,t=e,e=[]),"string"==typeof e&&(e=[e]),void 0===i&&(i=this),void 0===n&&(n=[]),"function"==typeof t&&(global.config&&global.config.requiredDependencies&&(e=Array.from(new Set(e.concat(global.config.requiredDependencies)))),(e=this.__getDepsPromiseCallback(e))?e().then(function(){t.apply(i,n)}):t.apply(i,n))},PluginManager.prototype.exec2=function(e,t){var n=this,i=this,o=n.__getDepsPromiseCallback(e),s=function(){var t=[];return e.forEach(function(e){n.__getPlugin(e)?t.push(n.require(e)):t.push(void 0)}.bind(n)),t}.bind(n);o?o().then(function(){t.apply(i,s())}):t.apply(i,s())},PluginManager.prototype.ready=function(e,t=void 0){"function"==typeof e&&(t=e,e=[]),this.__ready(this.exec,[e,t="function"!=typeof t?function(){}:t],this)},PluginManager.prototype.__ready=function(e,t=[],n=window){n=n||this,/complete|interactive|loaded/.test(document.readyState)?e.apply(n,t):document.addEventListener("DOMContentLoaded",function(){e.apply(n,t)}.bind(this))},PluginManager.prototype.require=function(e,t){var n,i=this.__getPlugin(e);if(i)return e=i.id,n=i.module,i.install(t="function"!=typeof t?function(){}:t),n.exports;console.warn("PluginManager.require: plugin "+e+" not found!")},PluginManager.prototype.install=function(e,t){var n=this.__getPlugin(e);n?(e=n.id,n.module,n.install(t)):console.warn("PluginManager.install: plugin "+e+" not found!")},init(global)}(kit);
\ No newline at end of file
+window.kit=window.kit||{},kit.service=kit.service||{},kit.config=kit.config||{},!function(global){var defaultConfig={version:"2.0",assetsPath:"",requiredDependencies:[],autoloadPluginList:[],debug:!0},stateList={undefined:0,registered:1,loading:3,loaded:4,installing:5,installed:6},MD_TYPE={ES:"ES",UMD:"UMD",HMD:"HMD",default:"default"};function Plugin(e,t={}){this.id=e,this.state=stateList.undefined,this.state2=stateList.undefined,this.module={code:"",exports:{}},this.config={autoRequire:!1,loadJsAfterModule:!1,isSetTimestamp:!0,path:"",module:"",type:"default",handler:void 0,onRegister:function(e){},onLoad:function(e){},onInstall:function(e){},js:[],css:[],alias:[],deps:[],debug:!1},this.pluginManager=void 0,this.promise=new Promise(function(e,t){e()}),this.errors=[],this.register(t)}function isAssetLoaded(e){return e=e.match(/^[^#?]*/)[0],document.querySelector('script[src^="'+e+'"]')||document.querySelector('link[href^="'+e+'"]')||document.querySelector('meta[property="kit:file-load"][content="'+e+'"]')}function getUrlWithTimestamp(t){var n=3600*((new Date).getTime()/1e3/3600>>0);try{var e=new URL(t);e.searchParams.append("__pm",String(n)),t=e.toString()}catch(e){t=(t=String(t).split("?")[0])+"?__pm"+n}return t}Plugin.prototype.setPluginManager=function(e){this.pluginManager=e},Plugin.prototype.queuePush=function(n,i=[]){"function"==typeof n&&(this.promise=this.promise.then(function(e){var t=n.apply(this,i);if(t)return t}))},Plugin.prototype.__queue=function(e,n,i=[],o=void 0){var t=this;void 0===o&&(o=t),t.__checkState(e)?n.apply(o,i):t.promise=t.promise.then(function(){return new Promise(function(e,t){n.apply(o,i),e()})}.bind(t))},Plugin.prototype.__exec=function(e,t,n=[],i=void 0){var o=this;void 0===i&&(i=o),o.__checkState(e)?t.apply(i,n):o.promise=o.promise.then(function(){t.apply(i,n)}.bind(o))},Plugin.prototype.__checkState=function(e,t=void 0){return void 0===t?this.state>=e:this.state>=e&&this.state<=t},Plugin.prototype.__check2State=function(e,t=void 0){return void 0===t?this.state2>=e:this.state2>=e&&this.state2<=t},Plugin.prototype.__getValidConfig=function(e={}){e=Object.assign({},e);return"function"!=typeof e.onLoad&&(e.onLoad=function(e){}),"function"!=typeof e.onInstall&&(e.onInstall=function(e){}),"function"!=typeof e.onRegister&&(e.onRegister=function(e){}),"string"!=typeof e.path&&(e.path=""),"string"==typeof e.js?e.js=[e.js]:Array.isArray(e.js)||(e.js=[]),"string"==typeof e.css?e.css=[e.css]:Array.isArray(e.css)||(e.css=[]),"string"==typeof e.alias?e.alias=[e.alias]:Array.isArray(e.alias)||(e.alias=[]),e.autoRequire=!!e.hasOwnProperty("autoRequire")&&!!e.autoRequire,e.loadJsAfterModule=!!e.hasOwnProperty("loadJsAfterModule")&&!!e.loadJsAfterModule,e.isSetTimestamp=!e.hasOwnProperty("isSetTimestamp")||!!e.isSetTimestamp,e.type=e.type||"default","string"==typeof e.deps?e.deps=[e.deps]:Array.isArray(e.deps)||(e.deps=[]),e},Plugin.prototype.__setState=function(e,t=!1){var n=this;(t||n.__checkState(e))&&(n.state=e)},Plugin.prototype.register=function(e={}){var t,n=this,i=n.id;if(this.__checkState(stateList.installed))throw new Error("Plugin "+i+" уже невозможно конфигурировать ("+n.state+"/"+n.state2+")");if("function"==typeof e)t=e,(e=this.config).handler=t,e.type=MD_TYPE.HMD;else{if(this.__checkState(stateList.loaded)||this.__check2State(stateList.loading))throw new Error("Plugin "+i+" уже невозможно конфигурировать ("+n.state+")");if("object"!=typeof e)throw new Error("Plugin.register: plugin "+i+" is not a valid format");e=this.__getValidConfig(e),Object.assign(this.config,e)}this.__checkState(stateList.registered)||(n.config.debug&&console.log(`Plugin ${n.id}: onRegister + event.`),this.state=stateList.registered,this.config.onRegister(this),t=new CustomEvent("onRegister"+this.id+"Plugin",{detail:{plugin:this}}),document.dispatchEvent(t)),e.autoRequire},Plugin.prototype.load=function(e){var i,t,n,o,s,r=this,l=("function"!=typeof e&&(e=function(){}),r.id);return r.__checkState(stateList.registered)?r.__checkState(stateList.loaded)?e():r.__check2State(stateList.loading)?r.__exec(stateList.loaded,e):(r.state2=stateList.loading,(i=r.config).css.forEach(function(e,t,n){r.getStylePromise(i.path+e)}),r.pluginManager&&(t=r.pluginManager.__getDepsPromiseCallback(r.config.deps),r.queuePush(t)),o=i.path+i.module,n="string"==typeof i.module&&""!==i.module&&"ES"===i.type?function(){return r.getESModulePromise(o).then(function(e){e.__esModule=!0,r.module.exports=e}.bind(r))}:"string"==typeof i.module&&""!==i.module&&"UMD"===i.type?isAssetLoaded(o)?void(r.config.debug&&console.warn(`Plugin ${r.id}: Скрипт ${o} уже загружен!`)):function(){return r.httpGet(o).then(function(e){r.module.code=e}.bind(r))}:"HMD"!==i.type||i.hasOwnProperty("handler")&&"function"==typeof i.handler?"string"==typeof i.module&&""!==i.module&&"default"===i.type?isAssetLoaded(o)?void(r.config.debug&&console.warn(`Plugin ${r.id}: Скрипт ${o} уже загружен!`)):function(){return r.getScriptPromise(o)}:void 0:function(){return r.getScriptPromise(o)},s=r.getJsAssetsPromiseCallback(i.js),i.loadJsAfterModule?(r.queuePush(n),r.queuePush(s)):(r.queuePush(s),r.queuePush(n)),t||n||s||(r.state=stateList.loaded),r.__queue(stateList.loaded,function(){r.config.debug&&console.log(`Plugin ${r.id}: onLoad + event.`),r.isLoaded()||(r.state=stateList.loaded),i.onLoad.call(r,r);var e=new CustomEvent("onLoad"+r.id+"Plugin",{detail:{plugin:r}});document.dispatchEvent(e)}),r.__exec(stateList.loaded,function(){e()}.bind(r))):console.warn(`Plugin.load(${l}): is not register!.`),r},Plugin.prototype.install=function(callback){var self=this,global=self.pluginManager.global,require=self.pluginManager.require.bind(self.pluginManager),pluginId=("function"!=typeof callback&&(callback=function(){}),self.id),setGlobals,module,installer;return self.__checkState(stateList.registered)?self.__checkState(stateList.installed)?callback():self.__check2State(stateList.installing)?self.__exec(stateList.installed,callback):(self.__checkState(stateList.loaded)||this.load(),self.state2=stateList.installing,setGlobals=function(t,n){var e,i;void 0!==n&&(e=self.id,i=self.config.alias,t.hasOwnProperty(e)||(t[e]=n),Array.isArray(i))&&i.length&&i.forEach(function(e){t.hasOwnProperty(e)||(t[e]=n)})},module=self.module,installer=function(){var __exports=void 0,event=("ES"===self.config.type&&"string"==typeof self.config.module&&""!==self.config.module?__exports="object"==typeof self.module.exports&&void 0!==self.module.exports.default?self.module.exports.default:self.module.exports:"UMD"===self.config.type&&"string"==typeof self.config.module&&""!==self.config.module?(function(require,exports,module,global){var self=global;eval(module.code)}.bind(global).call(global,require,self.module.exports,module,global),__exports="object"==typeof self.module.exports&&void 0!==self.module.exports.default?self.module.exports.default:self.module.exports):"HMD"===self.config.type&&"function"==typeof self.config.handler&&(__exports=self.config.handler.bind(global).call(global,require,self.module.exports,module,global),void 0===__exports)&&self.module.exports&&(__exports=self.module.exports),"object"==typeof global&&setGlobals(global,__exports),self.state=stateList.installed,console.log(`%cPlugin ${pluginId}: installed.`,"color: green;"),self.config.onInstall.call(self,self),new CustomEvent("onInstall"+self.id+"Plugin",{detail:{plugin:self}}));return document.dispatchEvent(event),!0}.bind(this),this.__queue(stateList.loaded,installer),this.__exec(stateList.loaded,function(){callback()})):console.warn(`Plugin ${pluginId}: is not register!`),self},Plugin.prototype.exec=function(e,t=[],n=void 0){var i=this;void 0===n&&(n=i),i.__checkState(stateList.installed)||(i.load(),i.install()),i.__exec(stateList.installed,e,t,n)},Plugin.prototype.getESModulePromise=function(e){var i=this;return new Promise(function(t,n){import(e).then(function(e){t(e)},function(e){i.errors.push(e),console.log(`%cPlugin ${i.id}: error import module!`,"color: red;"),n(e)})})},Plugin.prototype.httpGet=function(i){var o=this;return new Promise(function(t,n){o.config.debug&&console.log(`Plugin ${o.id}: httpGet `+i);var e=new XMLHttpRequest;e.open("GET",i,!0),e.onload=function(){var e;200==this.status?t(this.response):(console.log(`%cPlugin.load(${o.id}): error load file!`,"color: red;"),(e=new Error(this.statusText)).code=this.status,n(e))},e.onerror=function(){console.log(`%cPlugin.load(${o.id}): error load file!`,"color: red;"),n(new Error("Network Error"))},e.send()})},Plugin.prototype.getScriptPromise=function(i){var o=this;if(!isAssetLoaded(i))return new Promise(function(e,t){o.config.debug&&console.log(`Plugin ${o.id}: load script `+i);var n=document.createElement("script");n.src=i,o.config.isSetTimestamp&&(n.src=getUrlWithTimestamp(i)),n.onload=function(){e(n)},n.onerror=function(){var e=new Error("Ошибка загрузки скрипта "+i);o.errors.push(e),console.log(`%cPlugin.load(${o.id}): error load script!`,"color: red;"),t(e)},document.head.append(n)});o.config.debug&&console.warn(`Plugin ${o.id}: Скрипт ${i} уже загружен!`)},Plugin.prototype.getStylePromise=function(i){var o=this;return new Promise(function(e,t){var n;isAssetLoaded(i)?(o.config.debug&&console.warn(`Plugin ${o.id}: Стиль ${i} уже загружен`),e()):((n=document.createElement("link")).rel="stylesheet",n.type="text/css",n.media="all",n.href=i,o.config.isSetTimestamp&&(n.href=getUrlWithTimestamp(i)),document.head.append(n),e(n))})},Plugin.prototype.getAsyncScriptListPromise=function(e){e=e.map(this.getScriptPromise.bind(this)).filter(e=>void 0!==e);if(e.length)return Promise.all(e)},Plugin.prototype.getJsAssetsPromiseCallback=function(e=[]){var o=this;if(e.length)return function(){var i=new Promise(function(e,t){e()});return e.forEach(function(e,t,n){i=Array.isArray(e)?i.then(function(){return o.getAsyncScriptListPromise(e)}):i.then(function(){return o.getScriptPromise(o.config.path+e)})}),i}},Plugin.prototype.__getRealId=function(e){var t,n=e.toLowerCase();if(this.id.toLowerCase()===n)return this.id;for(t of this.config.alias)if(n===t.toLowerCase())return this.id},Plugin.prototype.__is=function(e){return this.id===this.__getRealId(e)},Plugin.prototype.isLoaded=function(){return this.__checkState(stateList.loaded)},Plugin.prototype.isInstalled=function(){return this.__checkState(stateList.installed)},Plugin.prototype.require=function(){return this.isInstalled()||this.config.debug&&console.warn(`Plugin ${this.id}: not instaled!`),this.module.exports};var PluginManager=function(e){this.plugins={},this.global=e};function init(e){var o=new PluginManager(e);e.ready=o.ready.bind(o),e.loaded=o.loaded.bind(o),e.exec=o.exec.bind(o),e.require=o.require.bind(o),o.register("pluginManager",{alias:"pm",type:MD_TYPE.HMD,handler:function(e,t,n,i){return i.PluginManagerClass=PluginManager,"object"==typeof window&&(window.__PluginManager__=o,window.__pmGlobal__=i),n.exports=o},onInstall:function(e){}}),o.install("pluginManager"),o.register("config",{type:MD_TYPE.HMD,handler:function(e,t,n,i){var o=document.currentScript;if(o)try{var s=new URL(o.src);defaultConfig.assetsPath=s.pathname.split("/").slice(0,-2).join("/")}catch(e){s=o.src.split("?")[0];defaultConfig.assetsPath=s.split("/").slice(0,-2).join("/")}o=i.config||{},o=Object.assign({},defaultConfig,o);"object"==typeof window&&(window.__pmConfig__=i.config=o),document.addEventListener("DOMContentLoaded",function(){console.log("%cDOMContentLoaded","color:#2053ff")}),window.addEventListener("load",e=>{console.log("%cWindowLoaded","color:#2053ff")})},onInstall:function(e){"object"==typeof window&&window.hasOwnProperty("__PluginManagerConfigHandler__")&&"function"==typeof __PluginManagerConfigHandler__&&o.registerPlugins(__PluginManagerConfigHandler__())}}),o.install("config")}PluginManager.prototype.registerPlugins=function(e){for(var t in e)e.hasOwnProperty(t)&&this.register(t,e[t]);return this},PluginManager.prototype.register=function(e,t={}){var n;"string"!=typeof e||""===e?console.warn("Invalid pluginId!",e):(n=this.__getPlugin(e))?n.register(t):((n=new Plugin(e,t)).setPluginManager(this),this.plugins[e]=n)},PluginManager.prototype.__getPlugin=function(e){var t,n;for(t in this.plugins)if(this.plugins.hasOwnProperty(t)&&(n=this.plugins[t]).__is(e))return n},PluginManager.prototype.__getDepsPromiseCallback=function(e=[]){var n=this,t=e.map(function(e){var t=n.__getPlugin(e);if(t)return t.install(),t.isInstalled()?void 0:t.promise;console.log(`%cPluginManager: plugin ${e} not found!`,"color: red;")}).filter(e=>void 0!==e);if(t.length)return function(){return Promise.all(t)}},PluginManager.prototype.__getRealIdList=function(e=[]){var t=this;return e.map(function(e){e=t.__getPlugin(e);if(e)return e.id})},PluginManager.prototype.exec=function(e,t,n=[],i=void 0){"function"==typeof e&&(i=n,n=t,t=e,e=[]),"string"==typeof e&&(e=[e]),void 0===i&&(i=this),void 0===n&&(n=[]),"function"==typeof t&&(global.config&&global.config.requiredDependencies&&(e=Array.from(new Set(e.concat(global.config.requiredDependencies)))),(e=this.__getDepsPromiseCallback(e))?e().then(function(){t.apply(i,n)}):t.apply(i,n))},PluginManager.prototype.exec2=function(e,t){var n=this,i=this,o=n.__getDepsPromiseCallback(e),s=function(){var t=[];return e.forEach(function(e){n.__getPlugin(e)?t.push(n.require(e)):t.push(void 0)}.bind(n)),t}.bind(n);o?o().then(function(){t.apply(i,s())}):t.apply(i,s())},PluginManager.prototype.ready=function(e,t=void 0){"function"==typeof e&&(t=e,e=[]),this.__ready(this.exec,[e,t="function"!=typeof t?function(){}:t],this)},PluginManager.prototype.__ready=function(e,t=[],n=window){n=n||this,/complete|interactive|loaded/.test(document.readyState)?e.apply(n,t):document.addEventListener("DOMContentLoaded",function(){e.apply(n,t)}.bind(this))},PluginManager.prototype.loaded=function(e,t=void 0){"function"==typeof e&&(t=e,e=[]),this.__loaded(this.exec,[e,t="function"!=typeof t?function(){}:t],this)},PluginManager.prototype.__loaded=function(e,t=[],n=window){n=n||this,/complete|interactive|loaded/.test(document.readyState)?e.apply(n,t):window.addEventListener("load",function(){e.apply(n,t)}.bind(this))},PluginManager.prototype.require=function(e,t){var n,i=this.__getPlugin(e);if(i)return e=i.id,n=i.module,i.install(t="function"!=typeof t?function(){}:t),n.exports;console.warn("PluginManager.require: plugin "+e+" not found!")},PluginManager.prototype.install=function(e,t){var n=this.__getPlugin(e);n?(e=n.id,n.module,n.install(t)):console.warn("PluginManager.install: plugin "+e+" not found!")},init(global)}(kit);
\ No newline at end of file
diff --git a/assets/core/core.plugins.config.js b/assets/core/core.plugins.config.js
index 35dc6aa..86356e8 100644
--- a/assets/core/core.plugins.config.js
+++ b/assets/core/core.plugins.config.js
@@ -201,7 +201,7 @@ var __PluginManagerConfigHandler__ = function() {
},
toolkit: {
path: root + '/toolkit',
- module: '/toolkit.js',
+ module: '/toolkit.min.js',
type: 'HMD',
css: ['/toolkit.css'],
deps: ['jQuery', 'mask', 'support'],
diff --git a/assets/core/core.plugins.config.min.js b/assets/core/core.plugins.config.min.js
index 6fd91b0..d2a1092 100644
--- a/assets/core/core.plugins.config.min.js
+++ b/assets/core/core.plugins.config.min.js
@@ -1 +1 @@
-var __PluginManagerConfigHandler__=function(){var e=__pmConfig__.assetsPath;return{menu:{path:e+"/menu",module:"/menu.js",css:["/menu.css"],type:"HMD",deps:["lib","align","dataStructures","animations","userAction","Collection","support","ActionCollection","Action","Viewer"]},lib:{path:e+"/lib",module:"/lib.js",type:"HMD"},align:{path:e+"/align",module:"/align.js",type:"HMD",deps:["support"]},flexKit:{path:e+"/flex-kit",css:"/flex-kit.css"},support:{path:e+"/support",module:"/support.min.js",type:"HMD"},jqueryProxy:{type:"HMD",handler:function(e,t,s,o){init=function(s,e="$",t=[]){return s.push([e,t]),new Proxy({},{get(e,t){return function(){return init(s,t,arguments)}}})};var l=function(){l.init||(l.init=!1,__PluginManager__.ready("jquery"));var e=[];return l.queue.push(e),init(e,"$",arguments)};function i(){}l.queue=[],l.init=!1,i.prototype.J=l,i.prototype.hasJQuery=function(){return window.hasOwnProperty("jQuery")&&window.jQuery.hasOwnProperty("fn")},i.prototype.hasJQueryIniter=function(){return window.hasOwnProperty("jQuery")&&Object.is(window.jQuery,l)},i.prototype.onJQueryRegister=function(e){var t;this.hasJQuery()||((t=window).$=t.jQuery=l,e.module.initer=l)},i.prototype.onJQueryInstall=function(e){var t=window,s=e.module.initer.queue;if(this.hasJQueryIniter()){t.$=t.jQuery=e.module.exports;for(var o of s){var l,i=t;for(l of o)i=i[l[0]].apply(i,l[1])}}},s.exports=new i}},jquery:{path:e+"/jquery",module:"/jquery.min.js",type:"UMD",alias:["$","jQuery"],onRegister:function(e){kit.require("jqueryProxy").onJQueryRegister(e)},onInstall:function(e){kit.require("jqueryProxy").onJQueryInstall(e)}},popper:{path:e+"/popper",alias:"popper.js",module:"/popper.js",type:"HMD",css:"/popper.css"},bsCore:{path:e+"/bsCore",module:"/bsCore.min.js",type:"HMD",css:["/bsCore.css"]},bsToast:{path:e+"/bsToast",module:"/bsToast.js",type:"HMD",deps:["bsCore"]},bsToastService:{path:e+"/bsToastService",module:"/bsToastService.js",type:"HMD",css:["/bsToastService.css"],deps:["bsToast","support","Collection"]},Tooltip:{path:e+"/tooltip",module:"/tooltip.js",type:"HMD",css:"/tooltip.css",onInstall:function(e){[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(e){return __pmGlobal__.Tooltip.getOrCreateInstance(e,{sanitize:!1})})},deps:["popper","bsCore"]},Tooltip2:{path:e+"/tooltip2",module:"/tooltip2.js",type:"HMD",css:"/tooltip2.css",onInstall:function(e){console.log("tt2 install"),document.addEventListener("mouseover",function(e){e.target&&"autoload"===e.target.dataset.kitTooltip2&&!kit.support.getNodeData(e.target,"tooltip2")&&((e=new __pmGlobal__.Tooltip2(e.target)).run(),e.show())})},deps:["Viewer","support","ActionCollection","Action","userAction","align","Collection","animations"]},Popover:{path:e+"/popover",module:"/popover.js",type:"HMD",css:"/popover.css",onInstall:function(){[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map(function(e){return new __pmGlobal__.Popover(e)})},deps:["popper","bsCore","Tooltip"]},mask:{path:e+"/mask",module:"/mask.js",type:"HMD",deps:["jQuery"]},toolkit:{path:e+"/toolkit",module:"/toolkit.js",type:"HMD",css:["/toolkit.css"],deps:["jQuery","mask","support"]},Modal:{path:e+"/modal",module:"/modal.min.js",type:"HMD",css:["/modal.css"],deps:["bsCore"],onRegister:function(e){e.onLoadConditionHandler=function(t){t.target&&t.target.dataset&&t.target.dataset.bsTarget&&"modal"===t.target.dataset.bsToggle&&kit.exec(e.id,function(){var e=new Event("click");t.target.dispatchEvent(e)})},window.addEventListener("click",e.onLoadConditionHandler,!1)},onInstall:function(e){e.onLoadConditionHandler&&window.removeEventListener("click",e.onLoadConditionHandler,!1)}},collapse:{path:e+"/collapse",module:"/collapse.min.js",type:"HMD",css:["/collapse.css"],deps:["bsCore"]},datepicker:{path:e+"/datepicker",module:"/js/datepicker.js",type:"HMD",css:["/css/datepicker.css"],deps:["jQuery"]},cookie:{path:e+"/cookie",module:"/cookie.min.js",type:"HMD"},animations:{path:e+"/animations",css:"/animations.css",module:"/animations.js",type:"HMD"},Collection:{path:e+"/collection",module:"/collection.js",type:"HMD",deps:["support"]},dataStructures:{path:e+"/dataStructures",module:"/dataStructures.min.js",type:"HMD"},userAction:{path:e+"/userAction",module:"/userAction.js",type:"HMD",deps:["support","ActionCollection","Action","Viewer"]},Viewer:{path:e+"/Viewer",module:"/Viewer.js",type:"HMD",deps:["Collection","support","ActionCollection","Action"]},ActionCollection:{path:e+"/ActionCollection",module:"/ActionCollection.js",type:"HMD",deps:["Collection","support","Action"]},Action:{path:e+"/Action",module:"/Action.js",type:"HMD",deps:["support"]},date:{path:e+"/date",module:"/date.js",type:"HMD",deps:[]},testing:{path:e+"/testing",module:"/testing.js",type:"module",deps:["log"]},log:{path:e+"/log",module:"/log.js",css:"/log.css",type:"HMD",deps:["support","Collection","lib"]},fancybox:{path:e+"/fancybox",css:"/fancybox.css",js:"/fancybox.umd.js"},lightGallery:{path:e+"/lightGallery",css:"/lightGallery.css",js:"/lightGallery.js",deps:["jQuery"]},owlCarousel:{path:e+"/owlCarousel",css:"/owlCarousel.css",js:"/owlCarousel.js",deps:["jQuery"]},Chosen:{path:e+"/chosen",css:"/chosen.css",js:"/chosen.jquery.js",deps:["jQuery"]},makeCSSAnimations:{path:e+"/makeCSSAnimations",js:"/makeCSSAnimations.js",deps:["jQuery","support"]},mCustomScrollbar:{path:e+"/mCustomScrollbar",alias:"malihu-custom-scrollbar-plugin",js:"/mCustomScrollbar.js",css:"/jquery.mCustomScrollbar.css",deps:["jQuery","jqueryMousewheel"],onInstall:function(e){e.module.exports(kit.require("jQuery"))}},jqueryMousewheel:{path:e+"/jqueryMousewheel",alias:"jquery-mousewheel",js:"/jquery.mousewheel.js",deps:["jQuery"],onInstall:function(e){e.module.exports(kit.require("jQuery"))}},jqueryLazy:{path:e+"/jquery-lazy",alias:"jquery-lazy",js:["/jquery.lazy.min.js","/jquery.lazy.plugins.min.js"],deps:["jQuery"]},slickCarousel:{path:e+"/slickCarousel",alias:["slick","slick-carousel"],js:"/slick.min.js",css:["/slick.css","/slick-theme.css"],deps:["jQuery"]},mustache:{path:e+"/mustache",alias:["mustache.js"],js:"/mustache.js",deps:[]},bxSlider:{path:e+"/bxSlider",module:"/jquery.bxslider.min.js",css:["/jquery.bxslider.min.css"],type:"default",deps:["jQuery"]},selectric:{path:e+"/selectric",module:"/jquery.selectric.min.js",css:["/selectric.css"],type:"UMD",alias:["jquerySelectric"],deps:["jQuery"]},jBox:{path:e+"/jBox",module:"/jBox.min.js",css:["/jBox.min.css"],type:"UMD",deps:["jQuery"]},intlTelInput:{path:e+"/intl-tel-input",module:"/js/intlTelInput.min.js",css:["/css/intlTelInput.min.css"],type:"UMD",alias:["intl-tel-input"]},autoComplete:{path:e+"/autoComplete",module:"/autoComplete.min.js",css:["/css/autoComplete.css"],type:"HMD"}}};
\ No newline at end of file
+var __PluginManagerConfigHandler__=function(){var e=__pmConfig__.assetsPath;return{menu:{path:e+"/menu",module:"/menu.js",css:["/menu.css"],type:"HMD",deps:["lib","align","dataStructures","animations","userAction","Collection","support","ActionCollection","Action","Viewer"]},lib:{path:e+"/lib",module:"/lib.js",type:"HMD"},align:{path:e+"/align",module:"/align.js",type:"HMD",deps:["support"]},flexKit:{path:e+"/flex-kit",css:"/flex-kit.css"},support:{path:e+"/support",module:"/support.min.js",type:"HMD"},jqueryProxy:{type:"HMD",handler:function(e,t,s,o){init=function(s,e="$",t=[]){return s.push([e,t]),new Proxy({},{get(e,t){return function(){return init(s,t,arguments)}}})};var l=function(){l.init||(l.init=!1,__PluginManager__.ready("jquery"));var e=[];return l.queue.push(e),init(e,"$",arguments)};function i(){}l.queue=[],l.init=!1,i.prototype.J=l,i.prototype.hasJQuery=function(){return window.hasOwnProperty("jQuery")&&window.jQuery.hasOwnProperty("fn")},i.prototype.hasJQueryIniter=function(){return window.hasOwnProperty("jQuery")&&Object.is(window.jQuery,l)},i.prototype.onJQueryRegister=function(e){var t;this.hasJQuery()||((t=window).$=t.jQuery=l,e.module.initer=l)},i.prototype.onJQueryInstall=function(e){var t=window,s=e.module.initer.queue;if(this.hasJQueryIniter()){t.$=t.jQuery=e.module.exports;for(var o of s){var l,i=t;for(l of o)i=i[l[0]].apply(i,l[1])}}},s.exports=new i}},jquery:{path:e+"/jquery",module:"/jquery.min.js",type:"UMD",alias:["$","jQuery"],onRegister:function(e){kit.require("jqueryProxy").onJQueryRegister(e)},onInstall:function(e){kit.require("jqueryProxy").onJQueryInstall(e)}},popper:{path:e+"/popper",alias:"popper.js",module:"/popper.js",type:"HMD",css:"/popper.css"},bsCore:{path:e+"/bsCore",module:"/bsCore.min.js",type:"HMD",css:["/bsCore.css"]},bsToast:{path:e+"/bsToast",module:"/bsToast.js",type:"HMD",deps:["bsCore"]},bsToastService:{path:e+"/bsToastService",module:"/bsToastService.js",type:"HMD",css:["/bsToastService.css"],deps:["bsToast","support","Collection"]},Tooltip:{path:e+"/tooltip",module:"/tooltip.js",type:"HMD",css:"/tooltip.css",onInstall:function(e){[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(e){return __pmGlobal__.Tooltip.getOrCreateInstance(e,{sanitize:!1})})},deps:["popper","bsCore"]},Tooltip2:{path:e+"/tooltip2",module:"/tooltip2.js",type:"HMD",css:"/tooltip2.css",onInstall:function(e){console.log("tt2 install"),document.addEventListener("mouseover",function(e){e.target&&"autoload"===e.target.dataset.kitTooltip2&&!kit.support.getNodeData(e.target,"tooltip2")&&((e=new __pmGlobal__.Tooltip2(e.target)).run(),e.show())})},deps:["Viewer","support","ActionCollection","Action","userAction","align","Collection","animations"]},Popover:{path:e+"/popover",module:"/popover.js",type:"HMD",css:"/popover.css",onInstall:function(){[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map(function(e){return new __pmGlobal__.Popover(e)})},deps:["popper","bsCore","Tooltip"]},mask:{path:e+"/mask",module:"/mask.js",type:"HMD",deps:["jQuery"]},toolkit:{path:e+"/toolkit",module:"/toolkit.min.js",type:"HMD",css:["/toolkit.css"],deps:["jQuery","mask","support"]},Modal:{path:e+"/modal",module:"/modal.min.js",type:"HMD",css:["/modal.css"],deps:["bsCore"],onRegister:function(e){e.onLoadConditionHandler=function(t){t.target&&t.target.dataset&&t.target.dataset.bsTarget&&"modal"===t.target.dataset.bsToggle&&kit.exec(e.id,function(){var e=new Event("click");t.target.dispatchEvent(e)})},window.addEventListener("click",e.onLoadConditionHandler,!1)},onInstall:function(e){e.onLoadConditionHandler&&window.removeEventListener("click",e.onLoadConditionHandler,!1)}},collapse:{path:e+"/collapse",module:"/collapse.min.js",type:"HMD",css:["/collapse.css"],deps:["bsCore"]},datepicker:{path:e+"/datepicker",module:"/js/datepicker.js",type:"HMD",css:["/css/datepicker.css"],deps:["jQuery"]},cookie:{path:e+"/cookie",module:"/cookie.min.js",type:"HMD"},animations:{path:e+"/animations",css:"/animations.css",module:"/animations.js",type:"HMD"},Collection:{path:e+"/collection",module:"/collection.js",type:"HMD",deps:["support"]},dataStructures:{path:e+"/dataStructures",module:"/dataStructures.min.js",type:"HMD"},userAction:{path:e+"/userAction",module:"/userAction.js",type:"HMD",deps:["support","ActionCollection","Action","Viewer"]},Viewer:{path:e+"/Viewer",module:"/Viewer.js",type:"HMD",deps:["Collection","support","ActionCollection","Action"]},ActionCollection:{path:e+"/ActionCollection",module:"/ActionCollection.js",type:"HMD",deps:["Collection","support","Action"]},Action:{path:e+"/Action",module:"/Action.js",type:"HMD",deps:["support"]},date:{path:e+"/date",module:"/date.js",type:"HMD",deps:[]},testing:{path:e+"/testing",module:"/testing.js",type:"module",deps:["log"]},log:{path:e+"/log",module:"/log.js",css:"/log.css",type:"HMD",deps:["support","Collection","lib"]},fancybox:{path:e+"/fancybox",css:"/fancybox.css",js:"/fancybox.umd.js"},lightGallery:{path:e+"/lightGallery",css:"/lightGallery.css",js:"/lightGallery.js",deps:["jQuery"]},owlCarousel:{path:e+"/owlCarousel",css:"/owlCarousel.css",js:"/owlCarousel.js",deps:["jQuery"]},Chosen:{path:e+"/chosen",css:"/chosen.css",js:"/chosen.jquery.js",deps:["jQuery"]},makeCSSAnimations:{path:e+"/makeCSSAnimations",js:"/makeCSSAnimations.js",deps:["jQuery","support"]},mCustomScrollbar:{path:e+"/mCustomScrollbar",alias:"malihu-custom-scrollbar-plugin",js:"/mCustomScrollbar.js",css:"/jquery.mCustomScrollbar.css",deps:["jQuery","jqueryMousewheel"],onInstall:function(e){e.module.exports(kit.require("jQuery"))}},jqueryMousewheel:{path:e+"/jqueryMousewheel",alias:"jquery-mousewheel",js:"/jquery.mousewheel.js",deps:["jQuery"],onInstall:function(e){e.module.exports(kit.require("jQuery"))}},jqueryLazy:{path:e+"/jquery-lazy",alias:"jquery-lazy",js:["/jquery.lazy.min.js","/jquery.lazy.plugins.min.js"],deps:["jQuery"]},slickCarousel:{path:e+"/slickCarousel",alias:["slick","slick-carousel"],js:"/slick.min.js",css:["/slick.css","/slick-theme.css"],deps:["jQuery"]},mustache:{path:e+"/mustache",alias:["mustache.js"],js:"/mustache.js",deps:[]},bxSlider:{path:e+"/bxSlider",module:"/jquery.bxslider.min.js",css:["/jquery.bxslider.min.css"],type:"default",deps:["jQuery"]},selectric:{path:e+"/selectric",module:"/jquery.selectric.min.js",css:["/selectric.css"],type:"UMD",alias:["jquerySelectric"],deps:["jQuery"]},jBox:{path:e+"/jBox",module:"/jBox.min.js",css:["/jBox.min.css"],type:"UMD",deps:["jQuery"]},intlTelInput:{path:e+"/intl-tel-input",module:"/js/intlTelInput.min.js",css:["/css/intlTelInput.min.css"],type:"UMD",alias:["intl-tel-input"]},autoComplete:{path:e+"/autoComplete",module:"/autoComplete.min.js",css:["/css/autoComplete.css"],type:"HMD"}}};
\ No newline at end of file
diff --git a/assets/toolkit/toolkit.min.js b/assets/toolkit/toolkit.min.js
new file mode 100644
index 0000000..cedad45
--- /dev/null
+++ b/assets/toolkit/toolkit.min.js
@@ -0,0 +1 @@
+__PluginManager__.register("toolkit",function(e,t,i,n){var l=e("jQuery"),o=e("support");function r(){}r.prototype.triggerEvent=function(e,t){var i=document.createEvent("HTMLEvents");return i.initEvent(t,!0,!1),e.dispatchEvent(i)};var a,u=new r;function s(){}a=void 0,s.prototype.isMobile=function(){var e;return void 0===a&&(e=navigator.userAgent||navigator.vendor||window.opera,a=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))),a};e=new s;function c(){this.submitForm()}c.prototype.submitForm=function(){l("form.js-kit-form").attr("novalidate",!0),l(document).on("submit.kit-event","form.js-kit-form",function(t){t.preventDefault(),w.clearForm(t.target),p.clear(t.target,!0);var e=l(t.target),i=e.serializeArray(),e=e.attr("action");l.post(e,i,function(e){console.log("success"),"object"==typeof e&&f.ajaxProcessingSuccess(e,l(t.target))},"json").done(function(e){}).fail(function(e){console.log("fail"),console.log(e)}).always(function(e){})})};new c;function d(){this.selector=".kit-message"}d.prototype.clear=function(e,t=!1){function i(e){e.removeClass("kit-message-error kit-message-success kit-message-warning").html("")}(e=l(e)).length&&(e.is(this.selector)&&i(e),t)&&i(e.find(this.selector))};var p=new d;function m(){}m.prototype.ajaxProcessingSuccess=function(e,n){console.log("ajaxProcessingSuccess"),n=l(n),e.hasOwnProperty("inputs")&&Array.isArray(e.inputs)&&e.inputs.forEach(function(e){var t=l('[name="'+e.name+'"]');t.length&&(e.hasOwnProperty("error")&&w.showFieldError(t,e.error),e.hasOwnProperty("readonly")&&t.prop("readonly",e.readonly),e.hasOwnProperty("disabled")&&t.prop("disabled",e.disabled),e.hasOwnProperty("type"))&&(t.prop("type",e.type),"hidden"===e.type?t.parent().removeClass("kit-hidden").addClass("kit-hidden"):t.parent().removeClass("kit-hidden"))}),e.hasOwnProperty("do")&&Array.isArray(e.do)&&e.do.forEach(function(e){var t=!1,i=l(document);e.hasOwnProperty("form")&&!0===e.form&&(i=n).length&&(t=!0),(t=e.hasOwnProperty("selector")&&(i=l(e.selector)).length?!0:t)&&(e.hasOwnProperty("html")&&i.html(e.html),e.hasOwnProperty("replace")&&i.replaceWith(e.replace),e.hasOwnProperty("addClass")&&i.addClass(e.addClass),e.hasOwnProperty("removeClass")&&i.removeClass(e.removeClass),e.hasOwnProperty("disabled")&&i.prop("disabled",e.disabled),e.hasOwnProperty("trigger"))&&i.trigger(e.trigger),e.hasOwnProperty("hide")&&e.hide&&i.find(e.hide).hide(),e.hasOwnProperty("show")&&e.show&&i.find(e.show).show()}),e.hasOwnProperty("success")&&this.showMessageSmart(e.success,n,"success"),e.hasOwnProperty("warning")&&this.showMessageSmart(e.warning,n,"warning"),e.hasOwnProperty("errors")&&this.showMessageSmart(e.errors,n,"error")},m.prototype.showMessageSmart=function(e,t,i="error"){console.log("showMessageSmart"),console.log(e),console.log(t),console.log(i),t=l(t),console.log(t);var n,o,r,a=[];if(Object.keys(e).length){for(r in e)n=e[r],console.log(n),(o=t.find("[name='"+r+"']")).length?"success"===i?w.showFieldSuccess(o,n):"warning"===i?w.showFieldWarning(o,n):w.showFieldError(o,n):a[a.length]=n;console.log("unknownMessage"),console.log(a);var s=t.find(".kit-message");a.length?(console.log("1"),console.log(s.length?"messageNode.length":"no messageNode.length"),s.length&&s.html(a.join("
")).addClass("kit-message-"+i)):console.log(a)}};var f=new m;function g(){}g.prototype.init=function(){var t=this;this.initFields(),window.addEventListener("resize",function(){return t.refresh()},!1),document.addEventListener("inputs.reset",function(){return t.refresh()},!1),document.addEventListener("tabs.toggle",function(){return t.refresh()},!1),document.addEventListener("modal.open",function(){return t.refresh()},!1),document.addEventListener("input",function(e){return t.changeFiled(e)},!1),document.addEventListener("paste",function(e){return t.changeFiled(e)},!1),document.addEventListener("drop",function(e){return t.changeFiled(e)},!1),document.addEventListener("cut",function(e){return t.changeFiled(e)},!1),document.addEventListener("change",function(e){return t.switchField(e)},!1)},g.prototype.setDirty=function(e){var t=!1;return e.placeholder.length?(e.setAttribute("data-dirty","true"),!0):(t=e.mask?!!e.mask.getRaw().length:!!e.value,e.setAttribute("data-dirty",t?"true":"false"),t)},g.prototype.changeFiled=function(e){var e=e.target||e,t="INPUT"===e.tagName,i="TEXTAREA"===e.tagName;e.classList.contains("kit-field__input")&&(t||i)&&(this.setDirty(e),t=l(e).attr("value_min"),i=l(e).attr("value_max"),""!==t&&Number(t)>Number(e.value)?this.showFieldError(e,"Минимальное значение "+t):""!==i&&Number(i)'),i.textContent=n,i.setAttribute("data-index",e),A(i,"kit-dropdown__option"),A(i,r),s&&i.appendChild(o),t.disabled&&A(i,"kit-disabled"),t.selected&&A(i,"kit-active"),a.appendChild(i)}),u.triggerEvent(t,"beforeOpen"),document.body.appendChild(a),a.style.position="absolute",a.style.minWidth=h+"px",a.style.top=_(e).top,a.style.left=_(e).left,a.style.minHeight=function(e){e=e.offsetHeight;return k=Number(e.value))}),d)),s.textContent="",l&&(s.textContent=t.textContent),C(a,"kit-select--open"),e.setAttribute("data-dirty",l?"true":"false"),C(e,"kit-field--error"),x(n,function(e,t){i[function(e){var t=arguments;return e.replace(/^data-/g,"").replace(/(\-\w)/g,function(){return t[0][1].toUpperCase()})}(t.nodeName)]=t.nodeValue}),e.data=i,setTimeout(function(){u.triggerEvent(e,"kit-select-change")},0))}function _(e){var t=S(e).top,i=S(e).left,n=(window.pageYOffset,window.pageXOffset);return{top:t+e.offsetHeight+window.pageYOffset+"px",left:(L().width-h>i||e.offsetWidth>=h?i+n:i+n+e.offsetWidth-h)+"px"}}function E(e){var t=S(e).top,t=L().height+window.pageYOffset-t-e.offsetHeight-window.pageYOffset;return y