Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

includejs

Package Overview
Dependencies
Maintainers
1
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

includejs - npm Package Compare versions

Comparing version 0.11.36 to 0.12.37

2

bower.json
{
"name": "includejs",
"version": "0.11.36",
"version": "0.12.37",
"homepage": "https://github.com/atmajs/IncludeJS",

@@ -5,0 +5,0 @@ "authors": [

@@ -700,7 +700,5 @@

resolve: function(namespace, template) {
var questionMark = template.indexOf('?'),
aliasIndex = template.indexOf('::'),
var aliasIndex = template.indexOf('::'),
alias,
path,
params,
route,

@@ -717,14 +715,3 @@ i,

if (questionMark !== -1) {
arr = template.substring(questionMark + 1).split('&');
params = {};
for (i = 0, length = arr.length; i < length; i++) {
x = arr[i].split('=');
params[x[0]] = x[1];
}
template = template.substring(0, questionMark);
}
template = template.split('/');

@@ -736,3 +723,3 @@ route = routes[namespace];

path: template.join('/'),
params: params,
params: null,
alias: alias

@@ -769,3 +756,3 @@ };

path: path,
params: params,
params: null,
alias: alias

@@ -955,5 +942,3 @@ };

global.include = resource;
global.iparams = resource.route.params;
function resourceLoaded(e) {

@@ -2777,3 +2762,2 @@

"use strict";
var iparams = include && include.route.params;
/* if !DEBUG

@@ -2780,0 +2764,0 @@ try {

@@ -1,2 +0,2 @@

function __eval(e,n){"use strict";n&&n.route.params;return eval.call(window,e)}!function(e,n){"use strict";var t,r;return"undefined"==typeof exports||e!==exports&&null!=e||(t=r=global),null==t&&(t="undefined"==typeof window?global:window),null==r&&(r=e||t),"undefined"!=typeof include&&"function"==typeof include.js?(r.include=include,void(r.includeLib=include.Lib||t.includeLib)):void n(t,r,t.document)}(this,function(global,exports,document){"use strict";function fn_proxy(e,n){return function(){e.apply(n,arguments)}}function fn_doNothing(e){"function"==typeof e&&e()}function arr_invoke(e,n,t){if(null!=e&&e instanceof Array!=!1)for(var r=0,o=e.length;r<o;r++)"function"==typeof e[r]&&(null==n?e[r].call(t):e[r].apply(t,n))}function arr_ensure(e,n){if(!n)return e;for(var t,r=n.split("."),o=r.length-1,i=0;i<o;i++)t=r[i],e=e[t]||(e[t]={});return t=r[o],e[t]||(e[t]=[])}var isWeb=!("undefined"==typeof location||!location.protocol||!/^https?:/.test(location.protocol)),reg_subFolder=/([^\/]+\/)?\.\.\//,reg_hasProtocol=/^(file|https?):/i,handler={},hasOwnProp={}.hasOwnProperty,emptyResponse={load:{}},__array_slice=Array.prototype.slice,XMLHttpRequest=global.XMLHttpRequest,isBrowser=!0,isNode=!1,isBrowser=!1,isNode=!0,Helper={reportError:function(e){console.error("IncludeJS Error:",e,e.message,e.url),"function"==typeof handler.onerror&&handler.onerror(e)}},XHR=function(e,n){var t=new XMLHttpRequest;t.onreadystatechange=function(){4===t.readyState&&n&&n(e,t.responseText)};var r="object"==typeof e?e.url:e,o=cfg.sync!==!0;isBrowser&&cfg.version&&(r=(r.indexOf("?")===-1?"?":"&")+"v="+cfg.version),"/"===r[0]&&cfg.lockedToFolder===!0&&(r=r.substring(1)),t.open("GET",r,o),t.send()},XHR_LOAD=function(e,n){var t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState)return 200!==t.status?void n(t.status):void n(null,t.responseText)},t.open("GET",e,cfg.sync!==!0),t.send()},obj_inherit,obj_getProperty,obj_setProperty;!function(){obj_inherit=function(e){"function"==typeof e&&(e=e.prototype);for(var n,t,r=1,o=arguments.length;r<o;r++){n="function"==typeof arguments[r]?arguments[r].prototype:arguments[r];for(t in n)e[t]=n[t]}return e},obj_getProperty=function(e,n){for(var t=n.split("."),r=t.length,o=0;o<r;o++){if(null==e)return null;e=e[t[o]]}return e},obj_setProperty=function(e,n,t){for(var r,o=n.split("."),i=o.length-1,s=-1;++s<i;)r=o[s],null==e[r]&&(e[r]={}),e=e[r];e[o[s]]=t}}();var path_getDir,path_getFile,path_getExtension,path_resolveCurrent,path_normalize,path_win32Normalize,path_resolveUrl,path_combine,path_isRelative;!function(){function e(e){for(;e.indexOf("../")!==-1;)e=e.replace(reg_subFolder,"");return e.replace(/\/\.\//g,"/")}path_getDir=function(e){return e.substring(0,e.lastIndexOf("/")+1)},path_getFile=function(e){return e=e.replace("file://","").replace(/\\/g,"/").replace(/\?[^\n]+$/,""),/^\/\w+:\/[^\/]/i.test(e)?e.substring(1):e},path_getExtension=function(e){var n=e.indexOf("?");return n===-1?e.substring(e.lastIndexOf(".")+1):e.substring(e.lastIndexOf(".",n)+1,n)},path_resolveCurrent=function(){if(null==document)return"undefined"==typeof module?"":path_win32Normalize(module.parent.filename);var e=document.getElementsByTagName("script"),n=e[e.length-1],t=n&&n.getAttribute("src")||"";if("/"===t[0])return t;var r=window.location.pathname.replace(/\/[^\/]+\.\w+$/,"");return"/"!==r[r.length-1]&&(r+="/"),r+t},path_normalize=function(e){var n=e.replace(/\\/g,"/").replace(/([^:\/])\/{2,}/g,"$1/");return/^file:\/\/[^\/]/.test(n)&&(n=n.replace("file://","file:///")),n},path_win32Normalize=function(e){return e=path_normalize(e),"file:"===e.substring(0,5)?e:"file:///"+e},path_resolveUrl=function(n,t){return reg_hasProtocol.test(n)?e(n):("./"===n.substring(0,2)&&(n=n.substring(2)),"/"===n[0]&&null!=t&&null!=t.base&&(n=path_combine(t.base,n),reg_hasProtocol.test(n))?e(n):"/"===n[0]&&cfg.path&&0!==n.indexOf(cfg.path)&&(n=path_combine(cfg.path,n),reg_hasProtocol.test(n))?e(n):("/"!==n[0]&&null!=t&&null!=t.location&&(n=path_combine(t.location,n)),"/"!==n[0]&&reg_hasProtocol.test(n)===!1&&(n="/"+n),e(n)))},path_isRelative=function(e){var n=e.charCodeAt(0);switch(n){case 47:return!1;case 102:case 104:return reg_hasProtocol.test(e)===!1}return!0},path_combine=function(){for(var e,n="",t=arguments.length,r=-1;++r<t;)e=arguments[r],e&&(e=path_normalize(e),""!==n?("/"!==n[n.length-1]&&(n+="/"),"/"===e[0]&&(e=e.substring(1)),n+=e):n=e);return n}}();var tree_resolveUsage;!function(){function e(n,t,r){if(null==t){console.warn("<include> Usage Not Found:",n),console.warn("- Ensure to have it included before with the correct alias"),console.warn("- Initiator Stacktrace:");for(var o=[],i=r;null!=i;)o.push(i.url),i=i.parent;return console.warn(o.join("\n")),null}for(var s,a,u=t.includes,l=-1,c=u.length;++l<c;)if(s=u[l],a=s.route.alias||Routes.parseAlias(s.route),a===n)return s.resource;return e(n,t.parent,r)}tree_resolveUsage=function(n,t,r){for(var o,i,s,a,u,l=[],c=t.length,f=-1;++f<c;){if(s=i=t[f],a=i.indexOf("."),a!==-1&&(s=i.substring(0,a),i=i.substring(a+1)),u=e(s,n.parent,n),null==u)return null;if(4!==u.state)return n.state=3,u.on(4,r,u,"push"),null;o=u.exports,s!==i&&(o=obj_getProperty(o,i)),"object"==typeof o&&null==o&&console.warn("<include:use> Used resource has no exports",s,n.url),l[f]=o}return l}}();var res_groupByType;!function(){function e(e){var n=r.exec(e);return null==n?"js":n[1]}function n(e){return o[e]||"load"}function t(e,n,t){var r=e[n];null==r&&(r=e[n]=[]),r.push(t)}res_groupByType=function(r){for(var o={},i=r.length,s=-1;++s<i;){var a=r[s],u=e(a),l=n(u);t(o,l,a)}return o};var r=/\.([\w]+)($|\?|:)/,o={js:"js",es6:"js",css:"css",less:"css",sass:"css",json:"ajax",mask:"mask"}}();var cfg,Config;!function(){function e(e,t,r){switch(t){case"loader":for(var o in r)CustomLoader.register(o,r[o]);return;case"modules":return void(r===!0&&n());case"commonjs":return void(r===!0&&CommonJS.enable());case"amd":return void(r===!0&&Amd.enable());case"map":return void PathResolver.configMap(r);case"extentionDefault":return void PathResolver.configExt({def:r});case"extentionTypes":return void PathResolver.configExt({types:r})}t in e==!1&&console.warn("Not supported config",t),e[t]=r}function n(){return"undefined"==typeof Object.defineProperty?void console.warn("Browser do not support Object.defineProperty"):(Object.defineProperty(global,"module",{get:function(){return global.include}}),void Object.defineProperty(global,"exports",{get:function(){var e=global.include;return e.exports||(e.exports={})},set:function(e){global.include.exports=e}}))}Config=function(){},Config.prototype={path:null,loader:null,version:null,lockedToFolder:!1,sync:!1,eval:null==document,es6Exports:!1,call:function(n,t,r){if(null==t)return this;var o=typeof t;if("string"===o&&null==r)return this[t];if("string"===o&&null!=r)return e(this,t,r),n;if("object"===o&&null==r)for(var i in t)e(this,i,t[i]);return n}},cfg=new Config}();var bin,Bin;!function(){Bin={add:function(e,n,t){bin[e][n]=t,bin.all[n]=t},get:function(e,n){if(null!=n){var t=bin[e][n];if(null==t&&/^https?:\//.test(n)&&"undefined"!=typeof location&&(n=n.replace(location.origin,""),t=bin[e][n]||bin.all[n]),null==t&&cfg.lockedToFolder){var r=path_getDir(location.pathname);n=path_combine("/",n.replace(r,"")),t=bin[e][n]||bin.all[n]}return t||bin.all[n]}}},bin={js:{},css:{},load:{},ajax:{},embed:{},mask:{},all:{}}}();var Routes,RoutesLib;!function(){function e(){var e={},n=/([^\\\/]+)\.\w+$/;return{register:function(n,t,r){if("string"==typeof t&&path_isRelative(t)){var o=r||include,i=o.location||path_getDir(o.url||path_resolveCurrent());path_isRelative(i)&&(i="/"+i),t=i+t}e[n]=t instanceof Array?t:t.split(/[\{\}]/g)},resolve:function(n,t){var r,o,i,s,a,u,l,c,f=t.indexOf("?"),d=t.indexOf("::");if(d!==-1&&(r=t.substring(d+2),t=t.substring(0,d)),f!==-1){for(c=t.substring(f+1).split("&"),i={},a=0,l=c.length;a<l;a++)u=c[a].split("="),i[u[0]]=u[1];t=t.substring(0,f)}if(t=t.split("/"),s=e[n],null==s)return{path:t.join("/"),params:i,alias:r};for(o=s[0],a=1;a<s.length;a++)if(a%2===0)o+=s[a];else{var h=s[a]<<0;if(h>t.length-1&&(h=t.length-1),o+=t[h],a===s.length-2)for(h++;h<t.length;h++)o+="/"+t[h]}return{path:o,params:i,alias:r}},each:function(e,n,t,r,o){if(null!=n)if("lazy"!==e||null!=o)if(n instanceof Array)for(var i=0;i<n.length;i++)this.each(e,n[i],t,r,o);else if("object"!=typeof n){if("string"==typeof n){var s=this.resolve(r,n);return r&&(r+="."+n),void t(r,s,o)}console.error("Include Package is invalid",arguments)}else for(var a in n)this.each(e,n[a],t,a,o);else for(var a in n)this.each(e,n[a],t,null,a)},getRoutes:function(){return e},parseAlias:function(e){var t=e.path,r=n.exec(t);return r&&r[1]}}}RoutesLib=e,Routes=e()}();var Events=function(e){function n(){Events.ready=fn_doNothing,null!=t&&(arr_invoke(t),t=null)}if(null==e)return{ready:fn_doNothing,load:fn_doNothing};var t=[];return"onreadystatechange"in e?e.onreadystatechange=function(){/complete|interactive/g.test(e.readyState)!==!1&&n()}:e.addEventListener?e.addEventListener("DOMContentLoaded",n):window.onload=n,{ready:function(e){t.unshift(e)}}}(document),ScriptStack=function(){function e(e,n){cfg.version&&(e+=(e.indexOf("?")===-1?"?":"&")+"v="+cfg.version),"/"===e[0]&&cfg.lockedToFolder===!0&&(e=e.substring(1));var t=document.createElement("script");t.type="text/javascript",t.src=e,"onreadystatechange"in t?t.onreadystatechange=function(){("complete"===this.readyState||"loaded"===this.readyState)&&n()}:t.onload=t.onerror=n,null==s&&(s=document.getElementsByTagName("head")[0]),s.appendChild(t)}function n(){function t(e){e&&"error"===e.type&&console.log("Script Loaded Error",r.url);for(var t=0,o=l.length;t<o;t++)if(l[t]===r){l.splice(t,1);break}return t===o?void console.error("Loaded Resource not found in stack",r):(2.5!==r.state&&r.readystatechanged(3),a=null,void n())}if(!u){if(0===l.length)return void i();if(null==a){var r=a=l[0];if(1!==r.state)return r.state=1,global.include=r,global.iparams=r.route.params,r.source?(__eval(r.source,r),void t()):void e(r.url,t)}}}function t(){if(!u){if(0===l.length)return void i();if(null==a){var e=l[0];e.state<2||(a=e,a.state=1,global.include=e,__eval(e.source,e),o(e),2.5!==e.state&&e.readystatechanged(3),a=null,t())}}}function r(){if(!u){if(0===l.length)return void i();var e=l.shift();e.state<2||(a=e,a.state=3,global.include=e,__eval(e.source,e),e.readystatechanged(3),a=null,r())}}function o(e){for(var n=l.length,t=-1;++t<n;)if(l[t]===e)return void l.splice(t,1)}function i(){for(var e=-1,n=c.length;++e<n;)c[e]();c.length=0}var s,a,u,l=[],c=[];return{load:function(e,o,i){return this.add(e,o),!cfg.eval||i?void n():e.source?(e.state=2,void t()):void XHR(e,function(e,n){return n||(console.error("Not Loaded:",e.url),console.error("- Initiator:",e.parent&&e.parent.url||"<root resource>")),e.source=n,e.state=2,cfg.sync?void r():void t()})},add:function(e,n){if(1===e.priority)return l.unshift(e);if(null==n)return l.push(e);for(var t=l.length,r=-1;++r<t;)if(l[r]===n)return l.splice(r,0,e);l.push(e)},moveToParent:function(e,n){var t,r=l.length,o=-1,i=-1;for(t=0;t<r;t++)if(l[t]===e){i=t;break}if(i!==-1){for(t=0;t<r;t++)if(l[t]===n){o=t;break}o!==-1&&(i<o||(l.splice(i,1),l.splice(o,0,e)))}},pause:function(){u=!0},resume:function(){u=!1,null==a&&this.touch()},touch:function(){var e=cfg.eval?t:n;e()},complete:function(e){return u!==!0&&0===l.length?void e():void c.push(e)}}}(),InstanceStack;!function(){function e(){var e=i.length;0!==e&&(i.shift(),1!==e&&o(i[0]))}function n(e,n){setTimeout(function(){e.on(4,function(){setTimeout(n)})})}function t(e){e.state=1,e.bag=new r(e);for(var n,t=a;--t!==-1;)n=s[t],e[n]=e.bag[n].bind(e.bag)}function r(e){this.arr=[],this.include=e}function o(e){for(var n=a;--n>-1;){var t=s[n];e[t]=Include.prototype[t]}if(e.state=3,e.inject=e.js,e.bag)for(var n=-1,r=e.bag.arr,o=r.length;++n<o;){var i=r[n];e[i[0]].apply(e,[i[1]])}}InstanceStack={add:function(r){i.push(r),t(r),1===i.length&&n(global.include,function(){o(r)}),n(r,e)}};var i=[],s=["js","css","load","ajax","embed","lazy","mask","inject"],a=s.length;!function(){function e(e){return function(){var n=t.call(arguments);return this.arr.push([e,n]),this.include}}for(var n=a,t=Array.prototype.slice;--n>-1;){var o=s[n];r.prototype[o]=e(s[n])}}()}();var IncludeDeferred=function(){this.callbacks=[],this.state=-1};IncludeDeferred.prototype={on:function(e,n,t,r){return this===t&&this.state===-1?(n(this),this):(null==r&&(r=this.state<3||this===t?"unshift":"push"),e<=this.state?n(this):this.callbacks[r]({state:e,callback:n}),this)},readystatechanged:function(e){var n,t,r,o;if(e>this.state&&(this.state=e),3===this.state){var i=this.includes;if(null!=i&&i.length)for(n=0;n<i.length;n++)if(4!==i[n].resource.state)return;this.state=4}if(n=0,t=this.callbacks.length,0!==t){for("js"===this.type&&4===this.state&&(o=global.include,global.include=this);n<t&&(r=this.callbacks[n],null==r||r.state>this.state||(this.callbacks.splice(n,1),t--,n--,r.callback(this),!(this.state<4)));n++);null!=o&&"js"===o.type&&(global.include=o)}},ready:function(e){var n=this;return this.on(4,function(){Events.ready(function(){n.resolve(e)})},this)},done:function(e){var n=this;return this.on(4,function(){n.resolve(e)},this)},resolve:function(e){var n=this.includes,t=null==n?0:n.length;if(t>0&&null==this.response){this.response={};for(var r,o,i,s=0;s<t;s++)if(i=n[s],r=i.resource,o=i.route,"undefined"!=typeof r.exports){var a=r.type;switch(a){case"js":case"load":case"ajax":case"mask":var u=o.alias||Routes.parseAlias(o),l="js"===a?this.response:this.response[a]||(this.response[a]={});if(null!=u){var c=r.exports;cfg.es6Exports&&null!=c&&"object"==typeof c&&(c=c.default||c),l[u]=c;break}console.warn("<includejs> Alias is undefined",r)}}}var f=this.response||emptyResponse,d=this;if(!(null==this._use&&null!=this._usage&&(this._use=tree_resolveUsage(this,this._usage,function(){d.state=4,d.resolve(e),d.readystatechanged(4)}),this.state<4)))return this._use?void e.apply(null,[f].concat(this._use)):void e(f)}};var Include,IncludeLib={loadBags:[document]};!function(IncludeDeferred){function incl_getResource(e,n){var t=e;if(path_isRelative(e)===!0&&(t="/"+t),null!=n)return bin[n][t];for(var r in bin)if(bin[r].hasOwnProperty(t))return bin[r][t];return null}function embedPlugin(source){eval(source)}function includePackage(e,n,t){var r=1===t.length?t[0]:__array_slice.call(t);return e instanceof Resource?e.include(n,r):new Resource("js").include(n,r)}function createIncluder(e){return function(){return includePackage(this,e,arguments)}}function doNothing(){return this}function stub_freeze(e){e.js=e.css=e.load=e.ajax=e.embed=e.lazy=e.inject=e.mask=doNothing}function stub_release(e){for(var n=["js","css","load","ajax","embed","lazy","mask"],t=n.length;--t!==-1;)e[n[t]]=createIncluder(n[t]);e.inject=e.js}Include=function(){IncludeDeferred.call(this)},stub_release(Include.prototype),obj_inherit(Include,IncludeDeferred,{_use:null,_usage:null,isBrowser:isBrowser,isNode:isNode,setCurrent:function(e){var n=e.url,t=this.getResourceById(n,"js");if(null==t){"/"===n[0]&&this.base&&(n=this.base+n.substring(1));var t=new Resource("js",{path:n},e.namespace,null,null,n)}t.state<3&&console.error("<include> Resource should be loaded",e),t.state=3,global.include=t},cfg:function(e,n){return cfg.call(this,e,n)},routes:function(e){if(null==e)return Routes.getRoutes();if(2===arguments.length)return Routes.register(e,arguments[1],this),this;for(var n in e)Routes.register(n,e[n],this);return this},promise:function(e){for(var n=e.split("."),t=global;n.length;){var r=n.shift();t=t[r]||(t[r]={})}return t},register:function(e){function n(e){return null==u?e:("/"===e.url[0]&&(e.url=u+e.url.substring(1)),"/"===e.parent[0]&&(e.parent=u+e.parent.substring(1)),e.id=e.url,e)}function t(e,n){e.exports=n,e.readystatechanged(4)}var r,o,i,s,a,u=this.base;for(r in e)for(i=e[r],s=i.length,a=-1;++a<s;){o=n(i[a]);var l=o.url,c=o.url,f=o.namespace,d=o.parent&&incl_getResource(o.parent,"js"),h=new Resource,p=o.state;if(l||c){switch(c&&("/"===c[0]&&(c=c.substring(1)),h.location=path_getDir(c)),h.state=null==p?"js"===r?3:4:p,h.namespace=f,h.type=r,h.url=c||l,h.parent=d,h.base=d&&d.base||u,r){case"load":case"lazy":for(var g='[data-bundler-path="/'+c+'"]',v=IncludeLib.loadBags,b=v.length,y=null;--b>-1&&null==y;)null!=v[b]&&(y=v[b].querySelector(g));if(null==y){console.error('"%s" Data was not embedded into html',l);break}h.exports=y.innerHTML,CustomLoader.exists(h)&&(h.state=3,CustomLoader.load(h,t))}(bin[r]||(bin[r]={}))[l]=h}}},instance:function(e,n){var t;return null==e?(t=new Include,t.state=4,t):(t=new Resource("js"),t.state=4,t.url=path_resolveUrl(e,n),t.location=path_getDir(t.url),t.parent=n,cfg.sync!==!0&&InstanceStack.add(t),t)},getResource:function(e,n){return this.base&&"/"===e[0]&&(e=this.base+e.substring(1)),incl_getResource(e,n)},getResourceById:function(e,n){var t=bin[n],r=t[e];return null!=r?r:this.base&&"/"===e[0]&&(r=t[path_combine(this.base,e)],null!=r)?r:this.base&&this.location&&(r=t[path_combine(this.base,this.location,e)],null!=r)?r:this.location&&(r=t[path_combine(this.location,e)],null!=r)?r:null},getResources:function(){return bin},plugin:function(e,n){var t=[],r=0,o=0,i=0,s=function(e,t){o++,embedPlugin(t),o===r-1&&n&&(n(),n=null)};for(Routes.each("",e,function(e,n){t.push("/"===n.path[0]?n.path.substring(1):n.path)}),r=t.length;i<r;i++)XHR(t[i],s);return this},client:function(){return cfg.server===!0&&stub_freeze(this),this},server:function(){return cfg.server!==!0&&stub_freeze(this),this},use:function(){return null==this.parent?(console.error("<include.use> Parent resource is undefined"),this):(this._usage=arguments,this)},pauseStack:fn_proxy(ScriptStack.pause,ScriptStack),resumeStack:fn_proxy(ScriptStack.resume,ScriptStack),allDone:function(e){ScriptStack.complete(function(){function n(){--r<1&&e()}var t=include.getPending(),r=t.length;if(0===r)return void e();for(var o=-1,i=r;++o<i;)t[o].on(4,n,null,"push")})},getPending:function(e){var n,t,r,o=[];for(t in bin)if("all"!==t&&(null==e||e===t))for(r in bin[t])n=bin[t][r],n.state<4&&o.push(n);return o},Lib:IncludeLib})}(IncludeDeferred);var CustomLoader=function(){function e(e){return"string"!=typeof e&&("function"==typeof e.ready||"function"==typeof e.process)}function n(n){var t=path_getExtension(n),r=cfg.loader[t];if(e(r))return r;var o,i=r;if("object"==typeof i)for(var s in i){o=s,i=i[s];break}return cfg.loader[t]=new Resource("js",Routes.resolve(o,i),o,null,null,null,1)}function t(e,n){return function(t){e(n,t)}}function r(e,n,r,o){if(null==r.process)return void o(n,e);var i=t(o,n),s=r.process(e,n,i);"undefined"!=typeof s&&o(n,s)}function o(e,n,t){function o(e,o){r(o,e,n,t)}return"string"==typeof e.exports?void r(e.exports,e,n,t):n.load?n.load(e,o):void XHR(e,o)}var i={process:function(e,n){try{return JSON.parse(e)}catch(n){return console.error(n,e),null}}},s={process:function(e,n){var t=document.createElement("div");return t.innerHTML=e,IncludeLib.loadBags.push(t),null}};return cfg.loader={json:i,load:s},{load:function(e,t){var r=n(e.url);return r.process?void o(e,r,t):void r.on(4,function(){o(e,r.exports,t)},null,"push")},exists:function(e){if(!e.url)return!1;var n=path_getExtension(e.url);return cfg.loader.hasOwnProperty(n)},register:function(e,n){if("string"==typeof n){var t=include;null==t.location&&(t={location:path_getDir(path_resolveCurrent())}),n=path_resolveUrl(n,t)}cfg.loader[e]=n}}}(),LazyModule={create:function(e,n){for(var t=e.split("."),r=global,o=t[t.length-1];t.length>1;){var i=t.shift();r=r[i]||(r[i]={})}t=null,Object.defineProperty(r,o,{get:function(){delete r[o];try{var t=__eval(n,global.include);null==t||t instanceof Resource||(r[o]=t)}catch(n){n.xpath=e,Helper.reportError(n)}finally{return n=null,e=null,r[o]}}})}},Resource;!function(e,n,t,r){function o(e){var n=e.type,o=e.parent,s=e.url;if(null==document&&"css"===n)return e.state=4,e;if(r.exists(e)===!1)switch(n){case"js":case"embed":t.load(e,o,"embed"===n);break;case"ajax":case"load":case"lazy":case"mask":XHR(e,i);break;case"css":e.state=4;var a=document.createElement("link");a.href=s,a.rel="stylesheet",a.type="text/css",document.body.appendChild(a)}else"js"!==n&&"embed"!==n||t.add(e,e.parent),r.load(e,i);return e}function i(e,n){switch(n||console.warn("Resource can`t be loaded",e.url),e.type){case"js":case"embed":return e.source=n,e.state=2,void t.touch();case"load":case"ajax":e.exports=n;break;case"lazy":LazyModule.create(e.xpath,n);break;case"css":var r=document.createElement("style");r.type="text/css",r.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(r);break;case"mask":if(n){var o=global.mask;return null==o&&(o=global.require("mask")),void o.Module.registerModule(n,{path:e.url}).done(function(n){e.exports=n.exports,e.readystatechanged(4)}).fail(function(n){console.error(n),e.readystatechanged(4)})}}e.readystatechanged(4)}function s(e,n,t){if(null==e)return null;null==t&&(t=[]);for(var r,o=e.length,i=-1;++i<o;)r=e[i].resource,n===r.type&&t.push(r),null!=r.includes&&s(r.includes,n,t);return t}Resource=function(n,r,i,s,a,u,l){e.call(this);var c=r&&r.path;null!=c&&(c=path_normalize(c),c=PathResolver.resolveBasic(c,n,a)),null==u&&c&&(u=c);var f=Bin.get(n,u);if(f)return f.state<4&&"js"===n&&t.moveToParent(f,a),f;if(this.id=u,this.url=c,this.type=n,this.xpath=s,this.route=r,this.parent=a,this.priority=l,this.namespace=i,this.base=a&&a.base,this.childLoaded=fn_proxy(this.childLoaded,this),null==c)return this.state=3,this.location=path_getDir(path_resolveCurrent()),this;if(this.state=0,this.location=path_getDir(c),Bin.add(n,u,this),PathResolver.isNpm(this.url)===!1)return o(this),this;var d=this;return PathResolver.resolveNpm(this.url,this.type,this.parent,function(e,n){return e?void d.readystatechanged(4):(d.url=n,void o(d))}),this},Resource.prototype=obj_inherit(Resource,e,{state:null,location:null,includes:null,response:null,url:null,base:null,type:null,xpath:null,route:null,parent:null,priority:null,namespace:null,setBase:function(e){return this.base=e,this},childLoaded:function(e){var n=this,t=n.includes;if(t&&t.length){if(n.state<3)return;for(var r=0;r<t.length;r++)if(4!==t[r].resource.state)return}n.readystatechanged(4)},create:function(e,n,t,r,o){var i;return this.state=this.state>=3?3:2,this.response=null,null==this.includes&&(this.includes=[]),i=new Resource(e,n,t,r,this,o),this.includes.push({resource:i,route:n}),i},include:function(e,t){var r,o=this,i=[];n.each(e,t,function(n,t,s){null!=o.route&&o.route.path===t.path||(r=o.create(e,t,n,s),i.push(r))});for(var s=-1,a=i.length;++s<a;)i[s].on(4,this.childLoaded);return this},require:function(e){null==this.exports&&(this.exports={}),this.includes=[];var n=res_groupByType(e);for(var t in n)this.include(t,n[t]);return this},pause:function(){this.state=2.5;var e=this;return function(n){1===arguments.length&&(e.exports=n),e.readystatechanged(3)}},getNestedOfType:function(e){return s(this.includes,e)}})}(Include,Routes,ScriptStack,CustomLoader);var __nativeRequire,__includeRequire;if(global.require){var name=global.require.name;"amd"!==name&&"commonjs"!==name&&(__nativeRequire=global.require)}var CommonJS;!function(){function e(){global.require=CommonJS.require}function n(){if("undefined"==typeof module){if("undefined"==typeof Object.defineProperty)return void console.warn("Browser do not support Object.defineProperty");Object.defineProperty(global,"module",{get:function(){return global.include},configurable:!0}),Object.defineProperty(global,"exports",{get:function(){var e=global.include;return e.exports||(e.exports={})},set:function(e){global.include.exports=e},configurable:!0})}}CommonJS={exports:null,require:function(e){if(46!==e.charCodeAt(0)&&null!=__nativeRequire)return __nativeRequire(e);var n=cfg.sync,t=cfg.eval,r=include,o=null;return cfg.sync=!0,cfg.eval=!0,include.js(e+"::Module").done(function(e){o=e.Module}),include=r,cfg.sync=n,cfg.eval=t,o},enable:function(){"function"!=typeof __nativeRequire&&(n(),e())}}}();var Amd;!function(){function e(n,t){for(var r in t){var o=t[r];null!=o&&("load"!==r&&"ajax"!==r?n[+r]=o:e(n,o))}}Amd={enable:function(){n()}};var n;!function(){function t(e,n){var t=-1,o=e.length;e:for(;++t<o;){var i=e[t][0];if(i.length===n.length){for(var s=-1,a=i.length;++s<a;){var u=i[s];if(u(n[s])===!1)continue e}return e[t][1]}}return console.warn("Define function arguments are invalid",n),r}function r(){}function o(n,t,r,o){if(null!=t&&(bin.js[t]=n),null==r)return void(n.exports=i(o)||n.exports);var a=s(r,n),u=a.array,l=a.linked;return 0===l.length?void(n.exports=i(o,u)||n.exports):void n.require(a.linked).done(function(t){e(u,t),n.exports=i(o,u)||n.exports})}function i(e,n){return"function"==typeof e?e.apply(null,n||[]):e}function s(e,n){for(var t=new Array(e.length),r=[],o=e.length,i=-1;++i<o;){var s=f[e[i]];null!=s?t[i]=s(n):r.push(e[i]+"::"+i)}return{array:t,linked:r}}function a(e){return"string"==typeof e}function u(e){return!0}function l(e){return e instanceof Array}n=function(){var e=global.define=function(e,n,r){for(var o=arguments.length,i=new Array(o);--o>-1;)i[o]=arguments[o];var s=t(c,i),a=global.include;s(a,e,n,r)};__includeRequire=global.require=function(){return isNode&&__nativeRequire&&1===arguments.length?__nativeRequire.apply(null,arguments):e.apply(null,arguments)},"undefined"!=typeof require&&(require=__includeRequire)};var c=[[[u],function(e,n){o(e,null,null,n)}],[[a,u],function(e,n,t){o(e,n,null,t)}],[[a,l,u],function(e,n,t,r){o(e,n,t,r)}],[[l,u],function(e,n,t){o(e,null,n,t)}]],f={module:function(e){return e},exports:function(e){return e.exports={}},require:function(e){return CommonJS.require}}}()}();var PathResolver;!function(){function e(e){return s[e]||e}function n(e){return/\.[\w]{1,8}($|\?)/.test(e)}function t(e){return/^([\w\-]+)(\/[\w\-_]+)*$/.test(e)}function r(e,t,r){function o(){var e=u+"/node_modules/"+i+"/",n=e+"package.json";XHR_LOAD(n,function(n,t){var i;if(t)try{i=JSON.parse(t)}catch(e){}if(null!=n||null==i){var l=u.replace(/[^\/]+$/,"");return l===u?void r("Not found"):void o()}return s?void r(null,e+s):i.main?void r(null,path_combine(e,i.main)):void r(null,e+"index."+a.js)})}var i=/^([\w\-]+)/.exec(t)[0],s=t.substring(i.length+1);s&&n(s)===!1&&(s+="."+a.js);var u=e.replace(/[^\/]+\.[\w]{1,8}$/,"");o()}function o(e,t){if(n(e))return e;var r=a[t];return null==r?(console.warn("Extension is not defined for "+t),e):e+"."+r}function i(e){var n=/\.([\w]{1,8})($|\?)/.exec(e);if(null===n)return a.js;var t=n[1],r=u[t];if(null==r)throw Error("Unknown type for extension: "+t);return r}PathResolver={configMap:function(e){for(var n in e)s[n]=e},configExt:function(e){var n=e.def,t=e.types;for(var r in n)a[r]=n[r];for(var r in t)u[r]=t[r]},resolveBasic:function(n,r,i){if("js"===r&&t(n))return n;var s=path_resolveUrl(e(n),i);return o(s,r)},isNpm:t,getType:i,resolveNpm:function(o,i,s,u){var l=e(o);if(l.indexOf(".")>-1)return void u(null,l);if("js"===i&&t(l)){var c=s&&s.location||path_resolveCurrent();return void r(c,l,u)}n(l)===!1&&(l+="."+a[i]),u(null,l)}};var s={},a={js:"js",css:"css",mask:"mask"},u={js:"js",es6:"js",ts:"js",css:"css",less:"css",scss:"css",mask:"mask",json:"load",yml:"load"}}(),IncludeLib.Routes=RoutesLib,IncludeLib.Resource=Resource,IncludeLib.ScriptStack=ScriptStack,IncludeLib.PathResolver=PathResolver,IncludeLib.Config=Config,IncludeLib.registerLoader=CustomLoader.register,exports.include=new Include,exports.includeLib=IncludeLib});
function __eval(e,n){"use strict";return eval.call(window,e)}!function(e,n){"use strict";var t,r;return"undefined"==typeof exports||e!==exports&&null!=e||(t=r=global),null==t&&(t="undefined"==typeof window?global:window),null==r&&(r=e||t),"undefined"!=typeof include&&"function"==typeof include.js?(r.include=include,void(r.includeLib=include.Lib||t.includeLib)):void n(t,r,t.document)}(this,function(global,exports,document){"use strict";function fn_proxy(e,n){return function(){e.apply(n,arguments)}}function fn_doNothing(e){"function"==typeof e&&e()}function arr_invoke(e,n,t){if(null!=e&&e instanceof Array!=!1)for(var r=0,o=e.length;r<o;r++)"function"==typeof e[r]&&(null==n?e[r].call(t):e[r].apply(t,n))}function arr_ensure(e,n){if(!n)return e;for(var t,r=n.split("."),o=r.length-1,i=0;i<o;i++)t=r[i],e=e[t]||(e[t]={});return t=r[o],e[t]||(e[t]=[])}var isWeb=!("undefined"==typeof location||!location.protocol||!/^https?:/.test(location.protocol)),reg_subFolder=/([^\/]+\/)?\.\.\//,reg_hasProtocol=/^(file|https?):/i,handler={},hasOwnProp={}.hasOwnProperty,emptyResponse={load:{}},__array_slice=Array.prototype.slice,XMLHttpRequest=global.XMLHttpRequest,isBrowser=!0,isNode=!1,isBrowser=!1,isNode=!0,Helper={reportError:function(e){console.error("IncludeJS Error:",e,e.message,e.url),"function"==typeof handler.onerror&&handler.onerror(e)}},XHR=function(e,n){var t=new XMLHttpRequest;t.onreadystatechange=function(){4===t.readyState&&n&&n(e,t.responseText)};var r="object"==typeof e?e.url:e,o=cfg.sync!==!0;isBrowser&&cfg.version&&(r=(r.indexOf("?")===-1?"?":"&")+"v="+cfg.version),"/"===r[0]&&cfg.lockedToFolder===!0&&(r=r.substring(1)),t.open("GET",r,o),t.send()},XHR_LOAD=function(e,n){var t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState)return 200!==t.status?void n(t.status):void n(null,t.responseText)},t.open("GET",e,cfg.sync!==!0),t.send()},obj_inherit,obj_getProperty,obj_setProperty;!function(){obj_inherit=function(e){"function"==typeof e&&(e=e.prototype);for(var n,t,r=1,o=arguments.length;r<o;r++){n="function"==typeof arguments[r]?arguments[r].prototype:arguments[r];for(t in n)e[t]=n[t]}return e},obj_getProperty=function(e,n){for(var t=n.split("."),r=t.length,o=0;o<r;o++){if(null==e)return null;e=e[t[o]]}return e},obj_setProperty=function(e,n,t){for(var r,o=n.split("."),i=o.length-1,s=-1;++s<i;)r=o[s],null==e[r]&&(e[r]={}),e=e[r];e[o[s]]=t}}();var path_getDir,path_getFile,path_getExtension,path_resolveCurrent,path_normalize,path_win32Normalize,path_resolveUrl,path_combine,path_isRelative;!function(){function e(e){for(;e.indexOf("../")!==-1;)e=e.replace(reg_subFolder,"");return e.replace(/\/\.\//g,"/")}path_getDir=function(e){return e.substring(0,e.lastIndexOf("/")+1)},path_getFile=function(e){return e=e.replace("file://","").replace(/\\/g,"/").replace(/\?[^\n]+$/,""),/^\/\w+:\/[^\/]/i.test(e)?e.substring(1):e},path_getExtension=function(e){var n=e.indexOf("?");return n===-1?e.substring(e.lastIndexOf(".")+1):e.substring(e.lastIndexOf(".",n)+1,n)},path_resolveCurrent=function(){if(null==document)return"undefined"==typeof module?"":path_win32Normalize(module.parent.filename);var e=document.getElementsByTagName("script"),n=e[e.length-1],t=n&&n.getAttribute("src")||"";if("/"===t[0])return t;var r=window.location.pathname.replace(/\/[^\/]+\.\w+$/,"");return"/"!==r[r.length-1]&&(r+="/"),r+t},path_normalize=function(e){var n=e.replace(/\\/g,"/").replace(/([^:\/])\/{2,}/g,"$1/");return/^file:\/\/[^\/]/.test(n)&&(n=n.replace("file://","file:///")),n},path_win32Normalize=function(e){return e=path_normalize(e),"file:"===e.substring(0,5)?e:"file:///"+e},path_resolveUrl=function(n,t){return reg_hasProtocol.test(n)?e(n):("./"===n.substring(0,2)&&(n=n.substring(2)),"/"===n[0]&&null!=t&&null!=t.base&&(n=path_combine(t.base,n),reg_hasProtocol.test(n))?e(n):"/"===n[0]&&cfg.path&&0!==n.indexOf(cfg.path)&&(n=path_combine(cfg.path,n),reg_hasProtocol.test(n))?e(n):("/"!==n[0]&&null!=t&&null!=t.location&&(n=path_combine(t.location,n)),"/"!==n[0]&&reg_hasProtocol.test(n)===!1&&(n="/"+n),e(n)))},path_isRelative=function(e){var n=e.charCodeAt(0);switch(n){case 47:return!1;case 102:case 104:return reg_hasProtocol.test(e)===!1}return!0},path_combine=function(){for(var e,n="",t=arguments.length,r=-1;++r<t;)e=arguments[r],e&&(e=path_normalize(e),""!==n?("/"!==n[n.length-1]&&(n+="/"),"/"===e[0]&&(e=e.substring(1)),n+=e):n=e);return n}}();var tree_resolveUsage;!function(){function e(n,t,r){if(null==t){console.warn("<include> Usage Not Found:",n),console.warn("- Ensure to have it included before with the correct alias"),console.warn("- Initiator Stacktrace:");for(var o=[],i=r;null!=i;)o.push(i.url),i=i.parent;return console.warn(o.join("\n")),null}for(var s,a,u=t.includes,l=-1,c=u.length;++l<c;)if(s=u[l],a=s.route.alias||Routes.parseAlias(s.route),a===n)return s.resource;return e(n,t.parent,r)}tree_resolveUsage=function(n,t,r){for(var o,i,s,a,u,l=[],c=t.length,f=-1;++f<c;){if(s=i=t[f],a=i.indexOf("."),a!==-1&&(s=i.substring(0,a),i=i.substring(a+1)),u=e(s,n.parent,n),null==u)return null;if(4!==u.state)return n.state=3,u.on(4,r,u,"push"),null;o=u.exports,s!==i&&(o=obj_getProperty(o,i)),"object"==typeof o&&null==o&&console.warn("<include:use> Used resource has no exports",s,n.url),l[f]=o}return l}}();var res_groupByType;!function(){function e(e){var n=r.exec(e);return null==n?"js":n[1]}function n(e){return o[e]||"load"}function t(e,n,t){var r=e[n];null==r&&(r=e[n]=[]),r.push(t)}res_groupByType=function(r){for(var o={},i=r.length,s=-1;++s<i;){var a=r[s],u=e(a),l=n(u);t(o,l,a)}return o};var r=/\.([\w]+)($|\?|:)/,o={js:"js",es6:"js",css:"css",less:"css",sass:"css",json:"ajax",mask:"mask"}}();var cfg,Config;!function(){function e(e,t,r){switch(t){case"loader":for(var o in r)CustomLoader.register(o,r[o]);return;case"modules":return void(r===!0&&n());case"commonjs":return void(r===!0&&CommonJS.enable());case"amd":return void(r===!0&&Amd.enable());case"map":return void PathResolver.configMap(r);case"extentionDefault":return void PathResolver.configExt({def:r});case"extentionTypes":return void PathResolver.configExt({types:r})}t in e==!1&&console.warn("Not supported config",t),e[t]=r}function n(){return"undefined"==typeof Object.defineProperty?void console.warn("Browser do not support Object.defineProperty"):(Object.defineProperty(global,"module",{get:function(){return global.include}}),void Object.defineProperty(global,"exports",{get:function(){var e=global.include;return e.exports||(e.exports={})},set:function(e){global.include.exports=e}}))}Config=function(){},Config.prototype={path:null,loader:null,version:null,lockedToFolder:!1,sync:!1,eval:null==document,es6Exports:!1,call:function(n,t,r){if(null==t)return this;var o=typeof t;if("string"===o&&null==r)return this[t];if("string"===o&&null!=r)return e(this,t,r),n;if("object"===o&&null==r)for(var i in t)e(this,i,t[i]);return n}},cfg=new Config}();var bin,Bin;!function(){Bin={add:function(e,n,t){bin[e][n]=t,bin.all[n]=t},get:function(e,n){if(null!=n){var t=bin[e][n];if(null==t&&/^https?:\//.test(n)&&"undefined"!=typeof location&&(n=n.replace(location.origin,""),t=bin[e][n]||bin.all[n]),null==t&&cfg.lockedToFolder){var r=path_getDir(location.pathname);n=path_combine("/",n.replace(r,"")),t=bin[e][n]||bin.all[n]}return t||bin.all[n]}}},bin={js:{},css:{},load:{},ajax:{},embed:{},mask:{},all:{}}}();var Routes,RoutesLib;!function(){function e(){var e={},n=/([^\\\/]+)\.\w+$/;return{register:function(n,t,r){if("string"==typeof t&&path_isRelative(t)){var o=r||include,i=o.location||path_getDir(o.url||path_resolveCurrent());path_isRelative(i)&&(i="/"+i),t=i+t}e[n]=t instanceof Array?t:t.split(/[\{\}]/g)},resolve:function(n,t){var r,o,i,s,a=t.indexOf("::");if(a!==-1&&(r=t.substring(a+2),t=t.substring(0,a)),t=t.split("/"),i=e[n],null==i)return{path:t.join("/"),params:null,alias:r};for(o=i[0],s=1;s<i.length;s++)if(s%2===0)o+=i[s];else{var u=i[s]<<0;if(u>t.length-1&&(u=t.length-1),o+=t[u],s===i.length-2)for(u++;u<t.length;u++)o+="/"+t[u]}return{path:o,params:null,alias:r}},each:function(e,n,t,r,o){if(null!=n)if("lazy"!==e||null!=o)if(n instanceof Array)for(var i=0;i<n.length;i++)this.each(e,n[i],t,r,o);else if("object"!=typeof n){if("string"==typeof n){var s=this.resolve(r,n);return r&&(r+="."+n),void t(r,s,o)}console.error("Include Package is invalid",arguments)}else for(var a in n)this.each(e,n[a],t,a,o);else for(var a in n)this.each(e,n[a],t,null,a)},getRoutes:function(){return e},parseAlias:function(e){var t=e.path,r=n.exec(t);return r&&r[1]}}}RoutesLib=e,Routes=e()}();var Events=function(e){function n(){Events.ready=fn_doNothing,null!=t&&(arr_invoke(t),t=null)}if(null==e)return{ready:fn_doNothing,load:fn_doNothing};var t=[];return"onreadystatechange"in e?e.onreadystatechange=function(){/complete|interactive/g.test(e.readyState)!==!1&&n()}:e.addEventListener?e.addEventListener("DOMContentLoaded",n):window.onload=n,{ready:function(e){t.unshift(e)}}}(document),ScriptStack=function(){function e(e,n){cfg.version&&(e+=(e.indexOf("?")===-1?"?":"&")+"v="+cfg.version),"/"===e[0]&&cfg.lockedToFolder===!0&&(e=e.substring(1));var t=document.createElement("script");t.type="text/javascript",t.src=e,"onreadystatechange"in t?t.onreadystatechange=function(){("complete"===this.readyState||"loaded"===this.readyState)&&n()}:t.onload=t.onerror=n,null==s&&(s=document.getElementsByTagName("head")[0]),s.appendChild(t)}function n(){function t(e){e&&"error"===e.type&&console.log("Script Loaded Error",r.url);for(var t=0,o=l.length;t<o;t++)if(l[t]===r){l.splice(t,1);break}return t===o?void console.error("Loaded Resource not found in stack",r):(2.5!==r.state&&r.readystatechanged(3),a=null,void n())}if(!u){if(0===l.length)return void i();if(null==a){var r=a=l[0];if(1!==r.state)return r.state=1,global.include=r,r.source?(__eval(r.source,r),void t()):void e(r.url,t)}}}function t(){if(!u){if(0===l.length)return void i();if(null==a){var e=l[0];e.state<2||(a=e,a.state=1,global.include=e,__eval(e.source,e),o(e),2.5!==e.state&&e.readystatechanged(3),a=null,t())}}}function r(){if(!u){if(0===l.length)return void i();var e=l.shift();e.state<2||(a=e,a.state=3,global.include=e,__eval(e.source,e),e.readystatechanged(3),a=null,r())}}function o(e){for(var n=l.length,t=-1;++t<n;)if(l[t]===e)return void l.splice(t,1)}function i(){for(var e=-1,n=c.length;++e<n;)c[e]();c.length=0}var s,a,u,l=[],c=[];return{load:function(e,o,i){return this.add(e,o),!cfg.eval||i?void n():e.source?(e.state=2,void t()):void XHR(e,function(e,n){return n||(console.error("Not Loaded:",e.url),console.error("- Initiator:",e.parent&&e.parent.url||"<root resource>")),e.source=n,e.state=2,cfg.sync?void r():void t()})},add:function(e,n){if(1===e.priority)return l.unshift(e);if(null==n)return l.push(e);for(var t=l.length,r=-1;++r<t;)if(l[r]===n)return l.splice(r,0,e);l.push(e)},moveToParent:function(e,n){var t,r=l.length,o=-1,i=-1;for(t=0;t<r;t++)if(l[t]===e){i=t;break}if(i!==-1){for(t=0;t<r;t++)if(l[t]===n){o=t;break}o!==-1&&(i<o||(l.splice(i,1),l.splice(o,0,e)))}},pause:function(){u=!0},resume:function(){u=!1,null==a&&this.touch()},touch:function(){var e=cfg.eval?t:n;e()},complete:function(e){return u!==!0&&0===l.length?void e():void c.push(e)}}}(),InstanceStack;!function(){function e(){var e=i.length;0!==e&&(i.shift(),1!==e&&o(i[0]))}function n(e,n){setTimeout(function(){e.on(4,function(){setTimeout(n)})})}function t(e){e.state=1,e.bag=new r(e);for(var n,t=a;--t!==-1;)n=s[t],e[n]=e.bag[n].bind(e.bag)}function r(e){this.arr=[],this.include=e}function o(e){for(var n=a;--n>-1;){var t=s[n];e[t]=Include.prototype[t]}if(e.state=3,e.inject=e.js,e.bag)for(var n=-1,r=e.bag.arr,o=r.length;++n<o;){var i=r[n];e[i[0]].apply(e,[i[1]])}}InstanceStack={add:function(r){i.push(r),t(r),1===i.length&&n(global.include,function(){o(r)}),n(r,e)}};var i=[],s=["js","css","load","ajax","embed","lazy","mask","inject"],a=s.length;!function(){function e(e){return function(){var n=t.call(arguments);return this.arr.push([e,n]),this.include}}for(var n=a,t=Array.prototype.slice;--n>-1;){var o=s[n];r.prototype[o]=e(s[n])}}()}();var IncludeDeferred=function(){this.callbacks=[],this.state=-1};IncludeDeferred.prototype={on:function(e,n,t,r){return this===t&&this.state===-1?(n(this),this):(null==r&&(r=this.state<3||this===t?"unshift":"push"),e<=this.state?n(this):this.callbacks[r]({state:e,callback:n}),this)},readystatechanged:function(e){var n,t,r,o;if(e>this.state&&(this.state=e),3===this.state){var i=this.includes;if(null!=i&&i.length)for(n=0;n<i.length;n++)if(4!==i[n].resource.state)return;this.state=4}if(n=0,t=this.callbacks.length,0!==t){for("js"===this.type&&4===this.state&&(o=global.include,global.include=this);n<t&&(r=this.callbacks[n],null==r||r.state>this.state||(this.callbacks.splice(n,1),t--,n--,r.callback(this),!(this.state<4)));n++);null!=o&&"js"===o.type&&(global.include=o)}},ready:function(e){var n=this;return this.on(4,function(){Events.ready(function(){n.resolve(e)})},this)},done:function(e){var n=this;return this.on(4,function(){n.resolve(e)},this)},resolve:function(e){var n=this.includes,t=null==n?0:n.length;if(t>0&&null==this.response){this.response={};for(var r,o,i,s=0;s<t;s++)if(i=n[s],r=i.resource,o=i.route,"undefined"!=typeof r.exports){var a=r.type;switch(a){case"js":case"load":case"ajax":case"mask":var u=o.alias||Routes.parseAlias(o),l="js"===a?this.response:this.response[a]||(this.response[a]={});if(null!=u){var c=r.exports;cfg.es6Exports&&null!=c&&"object"==typeof c&&(c=c.default||c),l[u]=c;break}console.warn("<includejs> Alias is undefined",r)}}}var f=this.response||emptyResponse,d=this;if(!(null==this._use&&null!=this._usage&&(this._use=tree_resolveUsage(this,this._usage,function(){d.state=4,d.resolve(e),d.readystatechanged(4)}),this.state<4)))return this._use?void e.apply(null,[f].concat(this._use)):void e(f)}};var Include,IncludeLib={loadBags:[document]};!function(IncludeDeferred){function incl_getResource(e,n){var t=e;if(path_isRelative(e)===!0&&(t="/"+t),null!=n)return bin[n][t];for(var r in bin)if(bin[r].hasOwnProperty(t))return bin[r][t];return null}function embedPlugin(source){eval(source)}function includePackage(e,n,t){var r=1===t.length?t[0]:__array_slice.call(t);return e instanceof Resource?e.include(n,r):new Resource("js").include(n,r)}function createIncluder(e){return function(){return includePackage(this,e,arguments)}}function doNothing(){return this}function stub_freeze(e){e.js=e.css=e.load=e.ajax=e.embed=e.lazy=e.inject=e.mask=doNothing}function stub_release(e){for(var n=["js","css","load","ajax","embed","lazy","mask"],t=n.length;--t!==-1;)e[n[t]]=createIncluder(n[t]);e.inject=e.js}Include=function(){IncludeDeferred.call(this)},stub_release(Include.prototype),obj_inherit(Include,IncludeDeferred,{_use:null,_usage:null,isBrowser:isBrowser,isNode:isNode,setCurrent:function(e){var n=e.url,t=this.getResourceById(n,"js");if(null==t){"/"===n[0]&&this.base&&(n=this.base+n.substring(1));var t=new Resource("js",{path:n},e.namespace,null,null,n)}t.state<3&&console.error("<include> Resource should be loaded",e),t.state=3,global.include=t},cfg:function(e,n){return cfg.call(this,e,n)},routes:function(e){if(null==e)return Routes.getRoutes();if(2===arguments.length)return Routes.register(e,arguments[1],this),this;for(var n in e)Routes.register(n,e[n],this);return this},promise:function(e){for(var n=e.split("."),t=global;n.length;){var r=n.shift();t=t[r]||(t[r]={})}return t},register:function(e){function n(e){return null==u?e:("/"===e.url[0]&&(e.url=u+e.url.substring(1)),"/"===e.parent[0]&&(e.parent=u+e.parent.substring(1)),e.id=e.url,e)}function t(e,n){e.exports=n,e.readystatechanged(4)}var r,o,i,s,a,u=this.base;for(r in e)for(i=e[r],s=i.length,a=-1;++a<s;){o=n(i[a]);var l=o.url,c=o.url,f=o.namespace,d=o.parent&&incl_getResource(o.parent,"js"),h=new Resource,p=o.state;if(l||c){switch(c&&("/"===c[0]&&(c=c.substring(1)),h.location=path_getDir(c)),h.state=null==p?"js"===r?3:4:p,h.namespace=f,h.type=r,h.url=c||l,h.parent=d,h.base=d&&d.base||u,r){case"load":case"lazy":for(var v='[data-bundler-path="/'+c+'"]',g=IncludeLib.loadBags,b=g.length,y=null;--b>-1&&null==y;)null!=g[b]&&(y=g[b].querySelector(v));if(null==y){console.error('"%s" Data was not embedded into html',l);break}h.exports=y.innerHTML,CustomLoader.exists(h)&&(h.state=3,CustomLoader.load(h,t))}(bin[r]||(bin[r]={}))[l]=h}}},instance:function(e,n){var t;return null==e?(t=new Include,t.state=4,t):(t=new Resource("js"),t.state=4,t.url=path_resolveUrl(e,n),t.location=path_getDir(t.url),t.parent=n,cfg.sync!==!0&&InstanceStack.add(t),t)},getResource:function(e,n){return this.base&&"/"===e[0]&&(e=this.base+e.substring(1)),incl_getResource(e,n)},getResourceById:function(e,n){var t=bin[n],r=t[e];return null!=r?r:this.base&&"/"===e[0]&&(r=t[path_combine(this.base,e)],null!=r)?r:this.base&&this.location&&(r=t[path_combine(this.base,this.location,e)],null!=r)?r:this.location&&(r=t[path_combine(this.location,e)],null!=r)?r:null},getResources:function(){return bin},plugin:function(e,n){var t=[],r=0,o=0,i=0,s=function(e,t){o++,embedPlugin(t),o===r-1&&n&&(n(),n=null)};for(Routes.each("",e,function(e,n){t.push("/"===n.path[0]?n.path.substring(1):n.path)}),r=t.length;i<r;i++)XHR(t[i],s);return this},client:function(){return cfg.server===!0&&stub_freeze(this),this},server:function(){return cfg.server!==!0&&stub_freeze(this),this},use:function(){return null==this.parent?(console.error("<include.use> Parent resource is undefined"),this):(this._usage=arguments,this)},pauseStack:fn_proxy(ScriptStack.pause,ScriptStack),resumeStack:fn_proxy(ScriptStack.resume,ScriptStack),allDone:function(e){ScriptStack.complete(function(){function n(){--r<1&&e()}var t=include.getPending(),r=t.length;if(0===r)return void e();for(var o=-1,i=r;++o<i;)t[o].on(4,n,null,"push")})},getPending:function(e){var n,t,r,o=[];for(t in bin)if("all"!==t&&(null==e||e===t))for(r in bin[t])n=bin[t][r],n.state<4&&o.push(n);return o},Lib:IncludeLib})}(IncludeDeferred);var CustomLoader=function(){function e(e){return"string"!=typeof e&&("function"==typeof e.ready||"function"==typeof e.process)}function n(n){var t=path_getExtension(n),r=cfg.loader[t];if(e(r))return r;var o,i=r;if("object"==typeof i)for(var s in i){o=s,i=i[s];break}return cfg.loader[t]=new Resource("js",Routes.resolve(o,i),o,null,null,null,1)}function t(e,n){return function(t){e(n,t)}}function r(e,n,r,o){if(null==r.process)return void o(n,e);var i=t(o,n),s=r.process(e,n,i);"undefined"!=typeof s&&o(n,s)}function o(e,n,t){function o(e,o){r(o,e,n,t)}return"string"==typeof e.exports?void r(e.exports,e,n,t):n.load?n.load(e,o):void XHR(e,o)}var i={process:function(e,n){try{return JSON.parse(e)}catch(n){return console.error(n,e),null}}},s={process:function(e,n){var t=document.createElement("div");return t.innerHTML=e,IncludeLib.loadBags.push(t),null}};return cfg.loader={json:i,load:s},{load:function(e,t){var r=n(e.url);return r.process?void o(e,r,t):void r.on(4,function(){o(e,r.exports,t)},null,"push")},exists:function(e){if(!e.url)return!1;var n=path_getExtension(e.url);return cfg.loader.hasOwnProperty(n)},register:function(e,n){if("string"==typeof n){var t=include;null==t.location&&(t={location:path_getDir(path_resolveCurrent())}),n=path_resolveUrl(n,t)}cfg.loader[e]=n}}}(),LazyModule={create:function(e,n){for(var t=e.split("."),r=global,o=t[t.length-1];t.length>1;){var i=t.shift();r=r[i]||(r[i]={})}t=null,Object.defineProperty(r,o,{get:function(){delete r[o];try{var t=__eval(n,global.include);null==t||t instanceof Resource||(r[o]=t)}catch(n){n.xpath=e,Helper.reportError(n)}finally{return n=null,e=null,r[o]}}})}},Resource;!function(e,n,t,r){function o(e){var n=e.type,o=e.parent,s=e.url;if(null==document&&"css"===n)return e.state=4,e;if(r.exists(e)===!1)switch(n){case"js":case"embed":t.load(e,o,"embed"===n);break;case"ajax":case"load":case"lazy":case"mask":XHR(e,i);break;case"css":e.state=4;var a=document.createElement("link");a.href=s,a.rel="stylesheet",a.type="text/css",document.body.appendChild(a)}else"js"!==n&&"embed"!==n||t.add(e,e.parent),r.load(e,i);return e}function i(e,n){switch(n||console.warn("Resource can`t be loaded",e.url),e.type){case"js":case"embed":return e.source=n,e.state=2,void t.touch();case"load":case"ajax":e.exports=n;break;case"lazy":LazyModule.create(e.xpath,n);break;case"css":var r=document.createElement("style");r.type="text/css",r.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(r);break;case"mask":if(n){var o=global.mask;return null==o&&(o=global.require("mask")),void o.Module.registerModule(n,{path:e.url}).done(function(n){e.exports=n.exports,e.readystatechanged(4)}).fail(function(n){console.error(n),e.readystatechanged(4)})}}e.readystatechanged(4)}function s(e,n,t){if(null==e)return null;null==t&&(t=[]);for(var r,o=e.length,i=-1;++i<o;)r=e[i].resource,n===r.type&&t.push(r),null!=r.includes&&s(r.includes,n,t);return t}Resource=function(n,r,i,s,a,u,l){e.call(this);var c=r&&r.path;null!=c&&(c=path_normalize(c),c=PathResolver.resolveBasic(c,n,a)),null==u&&c&&(u=c);var f=Bin.get(n,u);if(f)return f.state<4&&"js"===n&&t.moveToParent(f,a),f;if(this.id=u,this.url=c,this.type=n,this.xpath=s,this.route=r,this.parent=a,this.priority=l,this.namespace=i,this.base=a&&a.base,this.childLoaded=fn_proxy(this.childLoaded,this),null==c)return this.state=3,this.location=path_getDir(path_resolveCurrent()),this;if(this.state=0,this.location=path_getDir(c),Bin.add(n,u,this),PathResolver.isNpm(this.url)===!1)return o(this),this;var d=this;return PathResolver.resolveNpm(this.url,this.type,this.parent,function(e,n){return e?void d.readystatechanged(4):(d.url=n,void o(d))}),this},Resource.prototype=obj_inherit(Resource,e,{state:null,location:null,includes:null,response:null,url:null,base:null,type:null,xpath:null,route:null,parent:null,priority:null,namespace:null,setBase:function(e){return this.base=e,this},childLoaded:function(e){var n=this,t=n.includes;if(t&&t.length){if(n.state<3)return;for(var r=0;r<t.length;r++)if(4!==t[r].resource.state)return}n.readystatechanged(4)},create:function(e,n,t,r,o){var i;return this.state=this.state>=3?3:2,this.response=null,null==this.includes&&(this.includes=[]),i=new Resource(e,n,t,r,this,o),this.includes.push({resource:i,route:n}),i},include:function(e,t){var r,o=this,i=[];n.each(e,t,function(n,t,s){null!=o.route&&o.route.path===t.path||(r=o.create(e,t,n,s),i.push(r))});for(var s=-1,a=i.length;++s<a;)i[s].on(4,this.childLoaded);return this},require:function(e){null==this.exports&&(this.exports={}),this.includes=[];var n=res_groupByType(e);for(var t in n)this.include(t,n[t]);return this},pause:function(){this.state=2.5;var e=this;return function(n){1===arguments.length&&(e.exports=n),e.readystatechanged(3)}},getNestedOfType:function(e){return s(this.includes,e)}})}(Include,Routes,ScriptStack,CustomLoader);var __nativeRequire,__includeRequire;if(global.require){var name=global.require.name;"amd"!==name&&"commonjs"!==name&&(__nativeRequire=global.require)}var CommonJS;!function(){function e(){global.require=CommonJS.require}function n(){if("undefined"==typeof module){if("undefined"==typeof Object.defineProperty)return void console.warn("Browser do not support Object.defineProperty");Object.defineProperty(global,"module",{get:function(){return global.include},configurable:!0}),Object.defineProperty(global,"exports",{get:function(){var e=global.include;return e.exports||(e.exports={})},set:function(e){global.include.exports=e},configurable:!0})}}CommonJS={exports:null,require:function(e){if(46!==e.charCodeAt(0)&&null!=__nativeRequire)return __nativeRequire(e);var n=cfg.sync,t=cfg.eval,r=include,o=null;return cfg.sync=!0,cfg.eval=!0,include.js(e+"::Module").done(function(e){o=e.Module}),include=r,cfg.sync=n,cfg.eval=t,o},enable:function(){"function"!=typeof __nativeRequire&&(n(),e())}}}();var Amd;!function(){function e(n,t){for(var r in t){var o=t[r];null!=o&&("load"!==r&&"ajax"!==r?n[+r]=o:e(n,o))}}Amd={enable:function(){n()}};var n;!function(){function t(e,n){var t=-1,o=e.length;e:for(;++t<o;){var i=e[t][0];if(i.length===n.length){for(var s=-1,a=i.length;++s<a;){var u=i[s];if(u(n[s])===!1)continue e}return e[t][1]}}return console.warn("Define function arguments are invalid",n),r}function r(){}function o(n,t,r,o){if(null!=t&&(bin.js[t]=n),null==r)return void(n.exports=i(o)||n.exports);var a=s(r,n),u=a.array,l=a.linked;return 0===l.length?void(n.exports=i(o,u)||n.exports):void n.require(a.linked).done(function(t){e(u,t),n.exports=i(o,u)||n.exports})}function i(e,n){return"function"==typeof e?e.apply(null,n||[]):e}function s(e,n){for(var t=new Array(e.length),r=[],o=e.length,i=-1;++i<o;){var s=f[e[i]];null!=s?t[i]=s(n):r.push(e[i]+"::"+i)}return{array:t,linked:r}}function a(e){return"string"==typeof e}function u(e){return!0}function l(e){return e instanceof Array}n=function(){var e=global.define=function(e,n,r){for(var o=arguments.length,i=new Array(o);--o>-1;)i[o]=arguments[o];var s=t(c,i),a=global.include;s(a,e,n,r)};__includeRequire=global.require=function(){return isNode&&__nativeRequire&&1===arguments.length?__nativeRequire.apply(null,arguments):e.apply(null,arguments)},"undefined"!=typeof require&&(require=__includeRequire)};var c=[[[u],function(e,n){o(e,null,null,n)}],[[a,u],function(e,n,t){o(e,n,null,t)}],[[a,l,u],function(e,n,t,r){o(e,n,t,r)}],[[l,u],function(e,n,t){o(e,null,n,t)}]],f={module:function(e){return e},exports:function(e){return e.exports={}},require:function(e){return CommonJS.require}}}()}();var PathResolver;!function(){function e(e){return s[e]||e}function n(e){return/\.[\w]{1,8}($|\?)/.test(e)}function t(e){return/^([\w\-]+)(\/[\w\-_]+)*$/.test(e)}function r(e,t,r){function o(){var e=u+"/node_modules/"+i+"/",n=e+"package.json";XHR_LOAD(n,function(n,t){var i;if(t)try{i=JSON.parse(t)}catch(e){}if(null!=n||null==i){var l=u.replace(/[^\/]+$/,"");return l===u?void r("Not found"):void o()}return s?void r(null,e+s):i.main?void r(null,path_combine(e,i.main)):void r(null,e+"index."+a.js)})}var i=/^([\w\-]+)/.exec(t)[0],s=t.substring(i.length+1);s&&n(s)===!1&&(s+="."+a.js);var u=e.replace(/[^\/]+\.[\w]{1,8}$/,"");o()}function o(e,t){if(n(e))return e;var r=a[t];return null==r?(console.warn("Extension is not defined for "+t),e):e+"."+r}function i(e){var n=/\.([\w]{1,8})($|\?)/.exec(e);if(null===n)return a.js;var t=n[1],r=u[t];if(null==r)throw Error("Unknown type for extension: "+t);return r}PathResolver={configMap:function(e){for(var n in e)s[n]=e},configExt:function(e){var n=e.def,t=e.types;for(var r in n)a[r]=n[r];for(var r in t)u[r]=t[r]},resolveBasic:function(n,r,i){if("js"===r&&t(n))return n;var s=path_resolveUrl(e(n),i);return o(s,r)},isNpm:t,getType:i,resolveNpm:function(o,i,s,u){var l=e(o);if(l.indexOf(".")>-1)return void u(null,l);if("js"===i&&t(l)){var c=s&&s.location||path_resolveCurrent();return void r(c,l,u)}n(l)===!1&&(l+="."+a[i]),u(null,l)}};var s={},a={js:"js",css:"css",mask:"mask"},u={js:"js",es6:"js",ts:"js",css:"css",less:"css",scss:"css",mask:"mask",json:"load",yml:"load"}}(),IncludeLib.Routes=RoutesLib,IncludeLib.Resource=Resource,IncludeLib.ScriptStack=ScriptStack,IncludeLib.PathResolver=PathResolver,IncludeLib.Config=Config,IncludeLib.registerLoader=CustomLoader.register,exports.include=new Include,exports.includeLib=IncludeLib});
//# sourceMappingURL=include.min.js.map

@@ -694,7 +694,5 @@ // source ../src/head-module.js

resolve: function(namespace, template) {
var questionMark = template.indexOf('?'),
aliasIndex = template.indexOf('::'),
var aliasIndex = template.indexOf('::'),
alias,
path,
params,
route,

@@ -711,14 +709,3 @@ i,

if (questionMark !== -1) {
arr = template.substring(questionMark + 1).split('&');
params = {};
for (i = 0, length = arr.length; i < length; i++) {
x = arr[i].split('=');
params[x[0]] = x[1];
}
template = template.substring(0, questionMark);
}
template = template.split('/');

@@ -730,3 +717,3 @@ route = routes[namespace];

path: template.join('/'),
params: params,
params: null,
alias: alias

@@ -763,3 +750,3 @@ };

path: path,
params: params,
params: null,
alias: alias

@@ -949,5 +936,3 @@ };

global.include = resource;
global.iparams = resource.route.params;
function resourceLoaded(e) {

@@ -2769,3 +2754,2 @@

"use strict";
var iparams = include && include.route.params;
/* if !DEBUG

@@ -2772,0 +2756,0 @@ try {

{
"name": "includejs",
"description": "Resource Loader",
"version": "0.11.36",
"version": "0.12.37",
"homepage": "http://atmajs.com/include",

@@ -6,0 +6,0 @@ "contributors": [],

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc