isite
Version:
Create High Level Multi-Language Web Site [Fast and Easy]
1 lines • 4.8 kB
JavaScript
(function(t,n){var r,e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(r=t.Base64,e=n(),e.noConflict=function(){return t.Base64=r,e},t.Meteor&&(Base64=e),t.Base64=e)})("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this,function(){"use strict";var t,n,r="3.7.2",e=r,o="function"==typeof atob,u="function"==typeof btoa,i="function"==typeof Buffer,f="function"==typeof TextDecoder?new TextDecoder:void 0,c="function"==typeof TextEncoder?new TextEncoder:void 0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=Array.prototype.slice.call(a),s=(t=d,n={},t.forEach(function(t,r){return n[t]=r}),n),l=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,h=String.fromCharCode.bind(String),p="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(t,n){return void 0===n&&(n=function(t){return t}),new Uint8Array(Array.prototype.slice.call(t,0).map(n))},y=function(t){return t.replace(/=/g,"").replace(/[+\/]/g,function(t){return"+"==t?"-":"_"})},A=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},b=function(t){for(var n,r,e,o,u="",i=t.length%3,f=0;f<t.length;){if((r=t.charCodeAt(f++))>255||(e=t.charCodeAt(f++))>255||(o=t.charCodeAt(f++))>255)throw new TypeError("invalid character found");n=r<<16|e<<8|o,u+=d[n>>18&63]+d[n>>12&63]+d[n>>6&63]+d[63&n]}return i?u.slice(0,i-3)+"===".substring(i):u},g=u?function(t){return btoa(t)}:i?function(t){return Buffer.from(t,"binary").toString("base64")}:b,B=i?function(t){return Buffer.from(t).toString("base64")}:function(t){for(var n=4096,r=[],e=0,o=t.length;e<o;e+=n)r.push(h.apply(null,t.subarray(e,e+n)));return g(r.join(""))},x=function(t,n){return void 0===n&&(n=!1),n?y(B(t)):B(t)},C=function(t){if(t.length<2){var n=t.charCodeAt(0);return n<128?t:n<2048?h(192|n>>>6)+h(128|63&n):h(224|n>>>12&15)+h(128|n>>>6&63)+h(128|63&n)}n=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return h(240|n>>>18&7)+h(128|n>>>12&63)+h(128|n>>>6&63)+h(128|63&n)},m=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,v=function(t){return t.replace(m,C)},U=i?function(t){return Buffer.from(t,"utf8").toString("base64")}:c?function(t){return B(c.encode(t))}:function(t){return g(v(t))},F=function(t,n){return void 0===n&&(n=!1),n?y(U(t)):U(t)},w=function(t){return F(t,!0)},S=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,E=function(t){switch(t.length){case 4:var n=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=n-65536;return h(55296+(r>>>10))+h(56320+(1023&r));case 3:return h((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return h((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},D=function(t){return t.replace(S,E)},R=function(t){if(t=t.replace(/\s+/g,""),!l.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var n,r,e,o="",u=0;u<t.length;)n=s[t.charAt(u++)]<<18|s[t.charAt(u++)]<<12|(r=s[t.charAt(u++)])<<6|(e=s[t.charAt(u++)]),o+=64===r?h(n>>16&255):64===e?h(n>>16&255,n>>8&255):h(n>>16&255,n>>8&255,255&n);return o},z=o?function(t){return atob(A(t))}:i?function(t){return Buffer.from(t,"base64").toString("binary")}:R,T=i?function(t){return p(Buffer.from(t,"base64"))}:function(t){return p(z(t),function(t){return t.charCodeAt(0)})},Z=function(t){return T(I(t))},j=i?function(t){return Buffer.from(t,"base64").toString("utf8")}:f?function(t){return f.decode(T(t))}:function(t){return D(z(t))},I=function(t){return A(t.replace(/[-_]/g,function(t){return"-"==t?"+":"/"}))},O=function(t){return j(I(t))},P=function(t){if("string"!=typeof t)return!1;var n=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(n)||!/[^\s0-9a-zA-Z\-_]/.test(n)},L=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},V=function(){var t=function(t,n){return Object.defineProperty(String.prototype,t,L(n))};t("fromBase64",function(){return O(this)}),t("toBase64",function(t){return F(this,t)}),t("toBase64URI",function(){return F(this,!0)}),t("toBase64URL",function(){return F(this,!0)}),t("toUint8Array",function(){return Z(this)})},_=function(){var t=function(t,n){return Object.defineProperty(Uint8Array.prototype,t,L(n))};t("toBase64",function(t){return x(this,t)}),t("toBase64URI",function(){return x(this,!0)}),t("toBase64URL",function(){return x(this,!0)})},k=function(){V(),_()},M={version:r,VERSION:e,atob:z,atobPolyfill:R,btoa:g,btoaPolyfill:b,fromBase64:O,toBase64:F,encode:F,encodeURI:w,encodeURL:w,utob:v,btou:D,decode:O,isValid:P,fromUint8Array:x,toUint8Array:Z,extendString:V,extendUint8Array:_,extendBuiltins:k,Base64:{}};return Object.keys(M).forEach(function(t){return M.Base64[t]=M[t]}),M});