-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlil.min.js
3 lines (3 loc) · 12.5 KB
/
lil.min.js
1
2
3
/*! lil.js - v0.1.13 - MIT License - https://github.com/lil-js/all */
(function(t){var e=t.lil=t.lil||{};e.VERSION="0.1.13";e.alias=e.globalize=function(){t._=e}})(window);(function(t,e){if(typeof define==="function"&&define.amd){define(["exports"],e)}else if(typeof exports==="object"){e(exports);if(typeof module==="object"&&module!==null){module.exports=exports=exports.http}}else{e(t.lil=t.lil||{})}})(this,function(t){"use strict";var e="0.1.15";var n=Object.prototype.toString;var r=Array.prototype.slice;var o=Object.prototype.hasOwnProperty;var i=typeof Function.prototype.bind==="function";var u=location.origin;var s=/^(http[s]?:\/\/[a-z0-9\-\.\:]+)[\/]?/i;var a=/application\/json/;var l=typeof XDomainRequest!=="undefined";var f=function(){};var c={method:"GET",timeout:30*1e3,auth:null,data:null,headers:null,withCredentials:false,responseType:"text"};function p(t){return t&&n.call(t)==="[object Object]"||false}function h(t){var e,n,i,u,s=r.call(arguments).slice(1);for(e=0,n=s.length;e<n;e+=1){u=s[e];for(i in u)if(o.call(u,i))t[i]=u[i]}return t}function y(t){var e=false;return function(){if(e===false){e=true;t.apply(null,arguments)}}}function d(t,e){if(p(e)){e["Content-Type"]=e["Content-Type"]||k.defaultContent;for(var n in e)if(o.call(e,n)){t.setRequestHeader(n,e[n])}}}function m(t){var e={},n=t.getAllResponseHeaders().trim().split("\n");n.forEach(function(t){var n=t.trim().split(":");var r=n.shift().trim();var o=n.join(":").trim();e[r]=o});return e}function v(t){return a.test(t.getResponseHeader("Content-Type"))}function b(t){return Object.getOwnPropertyNames(t).filter(function(e){return t[e]!==undefined}).map(function(e){var n=t[e]===null?"":t[e];return encodeURIComponent(e)+(n?"="+encodeURIComponent(n):"")}).join("&").replace(/%20/g,"+")}function g(t){var e=null;if(t.responseType==="text"){e=t.responseText;if(v(t)&&e)e=JSON.parse(e)}else{e=t.response}return e}function j(t){return t===1223?204:t}function A(t){var e={xhr:t,status:j(t.status),statusText:t.statusText,data:null,headers:{}};if(t.readyState===4){e.data=g(t);e.headers=m(t)}return e}function x(t,e){var n=A(t);n.error=e;if(e.stack)n.stack=e.stack;return n}function O(t){t.onreadystatechange=t.onerror=t.ontimeout=null}function F(t){var e=j(t.status);return e>=200&&e<300||e===304}function E(t,e){return y(function(n){e(x(t,n),null)})}function S(t,e,n){return function(t){if(e.readyState===4){O(e);if(F(e)){n(null,A(e))}else{E(e,n)(t)}}}}function T(t){var e=t.match(s);return e&&e[1]===u}function w(t){var e=t.url;if(p(t.params)){e+=(e.indexOf("?")===-1?"?":"&")+b(t.params)}return e}function R(t){if(l&&T(t)){return new XDomainRequest}else{return new XMLHttpRequest}}function C(t){var e=(t.method||"GET").toUpperCase();var n=t.auth;var r=w(t);var o=R(r);if(n){o.open(e,r,true,n.user,n.password)}else{o.open(e,r)}o.withCredentials=t.withCredentials;o.responseType=t.responseType;o.timeout=t.timeout;d(o,t.headers);return o}function N(t,e){return function(t){if(t.lengthComputable){e(t,t.loaded/t.total)}else{e(t)}}}function q(t){return t&&p(t.headers)&&(t.headers["content-type"]||t.headers["Content-Type"])||false}function B(t,e){var n=e.data;if(p(e.data)||Array.isArray(e.data)){if(q(e)===false){t.setRequestHeader("Content-Type","application/json")}n=JSON.stringify(e.data)}return n}function I(t,e){return function(){clearTimeout(e);t.apply(null,arguments)}}function U(t,e,n){var r=C(t);var o=B(r,t);var u=E(r,e);if(i){r.ontimeout=u}else{var s=setTimeout(function l(){if(r.readyState!==4){r.abort()}},t.timeout);e=I(e,s);u=E(r,e)}r.onreadystatechange=S(t,r,e);r.onerror=u;if(typeof n==="function"){r.onprogress=N(r,n)}try{r.send(o?o:null)}catch(a){u(a)}return{xhr:r,config:t}}function P(t){return function(e,n,o,i){var u,s,a=null;var l=h({},c,{method:t});var y=r.call(arguments);for(u=0,s=y.length;u<s;u+=1){a=y[u];if(typeof a==="function"){if(y.length===u+1&&typeof y[u-1]==="function"){i=a}else{o=a}}else if(p(a)){h(l,a)}else if(typeof a==="string"&&!l.url){l.url=a}}return U(l,o||f,i)}}function k(t,e,n,r){return P("GET").apply(null,arguments)}k.VERSION=e;k.defaults=c;k.defaultContent="text/plain";k.get=P("GET");k.post=P("POST");k.put=P("PUT");k.del=P("DELETE");k.patch=P("PATCH");k.head=P("HEAD");return t.http=k});(function(t,e){if(typeof define==="function"&&define.amd){define(["exports"],e)}else if(typeof exports==="object"){e(exports);if(typeof module==="object"&&module!==null){module.exports=exports.Event}}else{e(t.lil=t.lil||{})}})(this,function(t){"use strict";var e="0.1.3";var n=Array.prototype.slice;var r=Object.prototype.hasOwnProperty;function o(){}o.prototype.constructor=o;o.prototype.addListener=o.prototype.on=function(t,e,n){if(typeof t!=="string")throw new TypeError("First argument must be a string");if(typeof e!=="function")throw new TypeError("Second argument must be a function");if(!i.call(this,t,e)){u.call(this,t).push({fn:e,once:n||false})}return this};o.prototype.removeListener=o.prototype.off=function(t,e){var n;var r=u.call(this,t);var o=i.call(this,t,e);if(o){n=r.indexOf(o);if(n>=0)r.splice(n,1)}return this};o.prototype.addOnceListener=o.prototype.once=function(t,e,n){this.addListener(t,e,true);return this};o.prototype.emit=o.prototype.fire=function(t){var e,r,o,i=n.call(arguments).slice(1);var s=u.call(this,t);if(t){for(e=0,r=s.length;e<r;e+=1){o=s[e];if(o.once)s.splice(e,1);o.fn.apply(null,i)}}return this};o.prototype.removeAllListeners=o.prototype.offAll=function(t){if(t&&r.call(this._events,t)){this._events[t].splice(0)}return this};function i(t,e){var n,r,o,i=u.call(this,t);for(n=0,r=i.length;n<r;n+=1){o=i[n];if(o.fn===e)return o}}function u(t,e){var n=s.call(this);return r.call(n,t)?n[t]:n[t]=[]}function s(){return this._events||(this._events={})}o.VERSION=e;t.Event=o});(function(t,e){if(typeof define==="function"&&define.amd){define(["exports"],e)}else if(typeof exports==="object"){e(exports);if(typeof module==="object"&&module!==null){module.exports=exports.uuid}}else{e(t.lil=t.lil||{})}})(this,function(t){var e="0.1.0";var n={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};function r(){var t="",e,n;for(e=0;e<32;e++){n=Math.random()*16|0;if(e===8||e===12||e===16||e===20)t+="-";t+=(e===12?4:e===16?n&3|8:n).toString(16)}return t}function o(t,e){var r=n[e?String(e):"all"];return r&&r.test(t)}r.isUUID=o;r.VERSION=e;t.uuid=r;t.isUUID=o});(function(t,e){if(typeof define==="function"&&define.amd){define(["exports"],e)}else if(typeof exports==="object"){e(exports);if(typeof module==="object"&&module!==null){module.exports=exports=exports.uri}}else{e(t.lil=t.lil||{})}})(this,function(t){"use strict";var e="0.1.2";var n=/^(?:([^:\/?#]+):\/\/)?((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?)?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i;function r(t){return typeof t==="string"}function o(t){var e={};if(typeof t==="string"){t.split("&").forEach(function(t){t=t.split("=");if(e.hasOwnProperty(t[0])){e[t[0]]=Array.isArray(e[t[0]])?e[t[0]]:[e[t[0]]];e[t[0]].push(t[1])}else{e[t[0]]=t[1]}});return e}}function i(t){return function(e){if(e){this.parts[t]=r(e)?decodeURIComponent(e):e;return this}this.parts=this.parse(this.build());return this.parts[t]}}function u(t){this.uri=t||null;if(r(t)&&t.length){this.parts=this.parse(t)}else{this.parts={}}}u.prototype.parse=function(t){var e=decodeURIComponent(t||"").match(n);var r=(e[3]||"").split(":");var i=r.length?(e[2]||"").replace(/(.*\@)/,""):e[2];return{uri:e[0],protocol:e[1],host:i,hostname:e[4],port:e[5],auth:e[3],user:r[0],password:r[1],path:e[6],search:e[7],query:o(e[7]),hash:e[8]}};u.prototype.protocol=function(t){return i("protocol").call(this,t)};u.prototype.host=function(t){return i("host").call(this,t)};u.prototype.hostname=function(t){return i("hostname").call(this,t)};u.prototype.port=function(t){return i("port").call(this,t)};u.prototype.auth=function(t){return i("host").call(this,t)};u.prototype.user=function(t){return i("user").call(this,t)};u.prototype.password=function(t){return i("password").call(this,t)};u.prototype.path=function(t){return i("path").call(this,t)};u.prototype.search=function(t){return i("search").call(this,t)};u.prototype.query=function(t){return t&&typeof t==="object"?i("query").call(this,t):this.parts.query};u.prototype.hash=function(t){return i("hash").call(this,t)};u.prototype.get=function(t){return this.parts[t]||""};u.prototype.build=u.prototype.toString=u.prototype.valueOf=function(){var t=this.parts,e=[];if(t.protocol)e.push(t.protocol+"://");if(t.auth)e.push(t.auth+"@");else if(t.user)e.push(t.user+(t.password?":"+t.password:"")+"@");if(t.host){e.push(t.host)}else{if(t.hostname)e.push(t.hostname);if(t.port)e.push(":"+t.port)}if(t.path)e.push(t.path);if(t.query&&typeof t.query==="object"){if(!t.path)e.push("/");e.push("?"+Object.keys(t.query).map(function(e){if(Array.isArray(t.query[e])){return t.query[e].map(function(t){return e+(t?"="+t:"")}).join("&")}else{return e+(t.query[e]?"="+t.query[e]:"")}}).join("&"))}else if(t.search){e.push("?"+t.search)}if(t.hash){if(!t.path)e.push("/");e.push("#"+t.hash)}return this.url=e.filter(function(t){return r(t)}).join("")};function s(t){return new u(t)}function a(t){return typeof t==="string"&&n.test(t)}s.VERSION=e;s.is=s.isURL=a;s.URI=u;t.uri=s});(function(t,e){if(typeof define==="function"&&define.amd){define(["exports"],e)}else if(typeof exports==="object"){e(exports);if(typeof module==="object"&&module!==null){module.exports=exports}}else{e(t.lil=t.lil||{})}})(this,function(t){"use strict";var e="0.1.2";var n=Object.prototype.toString;var r=isFinite;var o=Array.isArray;var i=Object.keys;var u=/[U]?Int|Float[0-9]{1,2}Array\]$/i;var s=["Boolean","NaN","Number","String","Null","Undefined","RegExp","Date","Function","Symbol","Arguments","Error","Array","Element","Generator","Map","WeakMap","WeakSet","Binary","Object"];t.type={VERSION:e};function a(t){return t===null}t.isNull=a;function l(t){return t&&n.call(t)==="[object Object]"||false}t.isObject=l;t.isPlainObject=function C(t){return l(t)&&l(Object.getPrototypeOf(t))&&a(Object.getPrototypeOf(Object.getPrototypeOf(t)))};function f(t){return o?o(t):t&&n.call(t)==="[object Array]"||false}t.isArray=f;function c(t){return t&&u.test(n.call(t))||false}t.isTypedArray=c;function p(t){return typeof t==="function"}t.isFn=t.isFunction=p;function h(t){return t===true||t===false||t&&n.call(t)==="[object Boolean]"||false}t.isBool=t.isBoolean=h;function y(t){return t&&n.call(t)==="[object Date]"||false}t.isDate=y;t.isElement=function N(t){return t&&t.nodeType===1||false};function d(t){return typeof t==="string"||t&&typeof t==="object"&&n.call(t)==="[object String]"||false}t.isString=d;function m(t){return typeof t==="number"||t&&typeof t==="object"&&n.call(t)==="[object Number]"||false}t.isNumber=m;function v(t){return t&&n.call(t)==="[object RegExp]"||false}t.isRegExp=v;function b(t){return m(t)&&t!=+t}t.isNaN=b;t.isFinite=function q(t){return r(t)&&!b(parseFloat(t))||false};function g(t){return t&&n.call(t).indexOf("Error")!==-1||false}t.isError=g;var j=t.isMap=function B(t){return t&&n.call(t)==="[object Map]"||false};var A=t.isWeakMap=O("WeakMap");var x=t.isWeakSet=O("WeakSet");function O(t){return function e(r){return r&&n.call(r)==="[object "+t+"]"||false}}t.isPromise=function I(t){return l(t)&&p(t.then)||false};t.isGenerator=function U(t){return l(t)&&p(t.next)&&p(t.send)||false};t.isBuffer=function P(t){return t&&n.call(t)==="[object Buffer]"||n.call(t)==="[object ArrayBuffer]"||n.call(t)==="[object DataView]"||false};function F(t){return t&&n.call(t)==="[object Blob]"||n.call(t)==="[object BlobBuilder]"||false}t.isBlob=F;function E(t){return t&&n.call(t)==="[object File]"||n.call(t)==="[object FileReader]"||false}t.isBlob=E;t.isBinary=function k(t){return t&&F(t)||E(t)||c(t)||false};function S(t){return typeof t==="undefined"}t.isUndefined=S;function T(t){return t&&n.call(t)==="[object Symbol]"||false}t.isSymbol=T;function w(t){return t&&n.call(t)==="[object Arguments]"||false}t.isArguments=w;function R(t){if(!t)return true;if(d(t)||f(t))return t.length===0;if(l(t))return i(t).length===0;return false}t.isEmpty=R;t.notEmpty=function(t){return!R(t)};t.isMutable=function D(t){return l(t)||f(t)||g(t)||w(t)||y(t)||p(t)||false};t.isIterable=function L(t){return l(t)||f(t)||w(t)||j(t)||A(t)||x(t)||false};t.isPrimitive=function(t){return h(t)||d(t)||m(t)||p(t)||a(t)||S(t)||v(t)||T(t)||false};t.is=t.isType=function M(e){for(var n=0,r=s.length;n<r;n+=1){if(t["is"+s[n]](e)){return s[n].toLowerCase()}}return"undefined"}});
//# sourceMappingURL=http://cdn.rawgit.com/lil-js/all/0.1.13/lil.min.js.map