diff --git a/dist/imgix-js-core.umd.js b/dist/imgix-js-core.umd.js index 1540a972..16526e63 100644 --- a/dist/imgix-js-core.umd.js +++ b/dist/imgix-js-core.umd.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).ImgixClient=e()}(this,function(){"use strict";function e(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function s(n){for(var t=1;tt.length)&&(e=t.length);for(var r=0,n=new Array(e);r>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r>>6*(3-o)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],r=0,n=0;r>>6-2*n);return e}},t.exports=r}),u={utf8:{stringToBytes:function(t){return u.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(u.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r>>24)|4278255360&(r[u]<<24|r[u]>>>8);r[t>>>5]|=128<>>9<<4)]=t;for(var s=w._ff,c=w._gg,l=w._hh,f=w._ii,u=0;u>>0,o=o+d>>>0,i=i+p>>>0,a=a+g>>>0}return y.endian([n,o,i,a])})._ff=function(t,e,r,n,o,i,a){a=t+(e&r|~e&n)+(o>>>0)+a;return(a<>>32-i)+e},w._gg=function(t,e,r,n,o,i,a){a=t+(e&n|r&~n)+(o>>>0)+a;return(a<>>32-i)+e},w._hh=function(t,e,r,n,o,i,a){a=t+(e^r^n)+(o>>>0)+a;return(a<>>32-i)+e},w._ii=function(t,e,r,n,o,i,a){a=t+(r^(e|~n))+(o>>>0)+a;return(a<>>32-i)+e},w._blocksize=16,w._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);t=y.wordsToBytes(w(t,e));return e&&e.asBytes?t:e&&e.asString?v.bytesToString(t):y.bytesToHex(t)}}),p="3.6.0",g="function"==typeof atob,y="function"==typeof btoa,b="function"==typeof Buffer;const m="function"==typeof TextDecoder?new TextDecoder:void 0,v="function"==typeof TextEncoder?new TextEncoder:void 0;const w=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],A=(t=>{let r={};return t.forEach((t,e)=>r[t]=e),r})(w),S=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,T=String.fromCharCode.bind(String),x="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(t,e=t=>t)=>new Uint8Array(Array.prototype.slice.call(t,0).map(e)),P=t=>t.replace(/[+\/]/g,t=>"+"==t?"-":"_").replace(/=+$/m,""),U=t=>t.replace(/[^A-Za-z0-9\+\/]/g,"");var B=e=>{let r,n,o,i,a="";var t=e.length%3;for(let t=0;t>18&63]+w[r>>12&63]+w[r>>6&63]+w[63&r]}return t?a.slice(0,t-3)+"===".substring(t):a};const C=y?t=>btoa(t):b?t=>Buffer.from(t,"binary").toString("base64"):B,R=b?t=>Buffer.from(t).toString("base64"):r=>{let n=[];for(let t=0,e=r.length;te?P(R(t)):R(t),j=t=>{if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?T(192|e>>>6)+T(128|63&e):T(224|e>>>12&15)+T(128|e>>>6&63)+T(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return T(240|e>>>18&7)+T(128|e>>>12&63)+T(128|e>>>6&63)+T(128|63&e)},O=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,I=t=>t.replace(O,j),E=b?t=>Buffer.from(t,"utf8").toString("base64"):v?t=>R(v.encode(t)):t=>C(I(t)),L=(t,e=!1)=>e?P(E(t)):E(t);var k=t=>L(t,!0);const F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,z=t=>{switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return T(55296+(e>>>10))+T(56320+(1023&e));case 3:return T((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return T((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},D=t=>t.replace(F,z);y=e=>{if(e=e.replace(/\s+/g,""),!S.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let r,n="",o,i;for(let t=0;t>16&255):64===i?T(r>>16&255,r>>8&255):T(r>>16&255,r>>8&255,255&r);return n};const W=g?t=>atob(U(t)):b?t=>Buffer.from(t,"base64").toString("binary"):y,H=b?t=>x(Buffer.from(t,"base64")):t=>x(W(t),t=>t.charCodeAt(0)),M=t=>H(q(t)),Z=b?t=>Buffer.from(t,"base64").toString("utf8"):m?t=>m.decode(H(t)):t=>D(W(t)),q=t=>U(t.replace(/[-_]/g,t=>"-"==t?"+":"/")),N=t=>Z(q(t));const V=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),$=function(){var t=(t,e)=>Object.defineProperty(String.prototype,t,V(e));t("fromBase64",function(){return N(this)}),t("toBase64",function(t){return L(this,t)}),t("toBase64URI",function(){return L(this,!0)}),t("toBase64URL",function(){return L(this,!0)}),t("toUint8Array",function(){return M(this)})},Q=function(){var t=(t,e)=>Object.defineProperty(Uint8Array.prototype,t,V(e));t("toBase64",function(t){return _(this,t)}),t("toBase64URI",function(){return _(this,!0)}),t("toBase64URL",function(){return _(this,!0)})};const G={version:p,VERSION:"3.6.0",atob:W,atobPolyfill:y,btoa:C,btoaPolyfill:B,fromBase64:N,toBase64:L,encode:L,encodeURI:k,encodeURL:k,utob:I,btou:D,decode:N,isValid:t=>{if("string"!=typeof t)return!1;t=t.replace(/\s+/g,"").replace(/=+$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:_,toUint8Array:M,extendString:$,extendUint8Array:Q,extendBuiltins:()=>{$(),Q()}},J=/\+/g;function K(e=""){try{return decodeURIComponent(""+e)}catch(t){return""+e}}function X(t=""){const e={};for(const o of(t="?"===t[0]?t.substr(1):t).split("&")){var r,n=o.match(/([^=]+)=?(.*)/)||[];n.length<2||"__proto__"!==(r=K(n[1]))&&"constructor"!==r&&(n=K((n[2]||"").replace(J," ")),e[r]?Array.isArray(e[r])?e[r].push(n):e[r]=[e[r],n]:e[r]=n)}return e}function Y(t,e=!1){return/^\w+:\/\/.+/.test(t)||e&&/^\/\/[^/]+/.test(t)}function tt(t){return X(et(t).search)}function et(t="",e){if(!Y(t,!0))return e?et(e+t):rt(t);const[r="",n,o]=(t.match(/([^:/]+:)?\/\/([^/@]+@)?(.*)/)||[]).splice(1);var[i="",a=""]=(o.match(/([^/]*)(.*)?/)||[]).splice(1),{pathname:e,search:t,hash:a}=rt(a);return{protocol:r,auth:n?n.substr(0,n.length-1):"",host:i,pathname:e,search:t,hash:a}}function rt(t=""){var[e="",r="",t=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:r,hash:t}}var nt=/^(?:[a-z\d\-_]{1,62}\.){0,125}(?:[a-z\d](?:\-(?=\-*[a-z\d])|[a-z]|\d){0,62}\.)[a-z\d]{1,63}$/i,ot={1:75,2:50,3:35,4:23,5:20},it={domain:null,useHTTPS:!0,includeLibraryParam:!0,urlPrefix:"https://",secureURLToken:null};function at(t,e){if(!Number.isInteger(t)||!Number.isInteger(e)||t<=0||e<=0||et.length)&&(e=t.length);for(var r=0,n=new Array(e);r>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r>>6*(3-o)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],r=0,n=0;r>>6-2*n);return e}},t.exports=r}),u={utf8:{stringToBytes:function(t){return u.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(u.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r>>24)|4278255360&(r[u]<<24|r[u]>>>8);r[t>>>5]|=128<>>9<<4)]=t;for(var s=w._ff,c=w._gg,l=w._hh,f=w._ii,u=0;u>>0,o=o+d>>>0,i=i+p>>>0,a=a+g>>>0}return y.endian([n,o,i,a])})._ff=function(t,e,r,n,o,i,a){a=t+(e&r|~e&n)+(o>>>0)+a;return(a<>>32-i)+e},w._gg=function(t,e,r,n,o,i,a){a=t+(e&n|r&~n)+(o>>>0)+a;return(a<>>32-i)+e},w._hh=function(t,e,r,n,o,i,a){a=t+(e^r^n)+(o>>>0)+a;return(a<>>32-i)+e},w._ii=function(t,e,r,n,o,i,a){a=t+(r^(e|~n))+(o>>>0)+a;return(a<>>32-i)+e},w._blocksize=16,w._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);t=y.wordsToBytes(w(t,e));return e&&e.asBytes?t:e&&e.asString?v.bytesToString(t):y.bytesToHex(t)}}),p="3.6.0",g="function"==typeof atob,y="function"==typeof btoa,b="function"==typeof Buffer;const m="function"==typeof TextDecoder?new TextDecoder:void 0,v="function"==typeof TextEncoder?new TextEncoder:void 0;const w=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],A=(t=>{let r={};return t.forEach((t,e)=>r[t]=e),r})(w),S=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,T=String.fromCharCode.bind(String),x="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(t,e=t=>t)=>new Uint8Array(Array.prototype.slice.call(t,0).map(e)),P=t=>t.replace(/[+\/]/g,t=>"+"==t?"-":"_").replace(/=+$/m,""),U=t=>t.replace(/[^A-Za-z0-9\+\/]/g,"");var B=e=>{let r,n,o,i,a="";var t=e.length%3;for(let t=0;t>18&63]+w[r>>12&63]+w[r>>6&63]+w[63&r]}return t?a.slice(0,t-3)+"===".substring(t):a};const C=y?t=>btoa(t):b?t=>Buffer.from(t,"binary").toString("base64"):B,R=b?t=>Buffer.from(t).toString("base64"):r=>{let n=[];for(let t=0,e=r.length;te?P(R(t)):R(t),j=t=>{if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?T(192|e>>>6)+T(128|63&e):T(224|e>>>12&15)+T(128|e>>>6&63)+T(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return T(240|e>>>18&7)+T(128|e>>>12&63)+T(128|e>>>6&63)+T(128|63&e)},O=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,I=t=>t.replace(O,j),E=b?t=>Buffer.from(t,"utf8").toString("base64"):v?t=>R(v.encode(t)):t=>C(I(t)),L=(t,e=!1)=>e?P(E(t)):E(t);var k=t=>L(t,!0);const F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,z=t=>{switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return T(55296+(e>>>10))+T(56320+(1023&e));case 3:return T((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return T((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},D=t=>t.replace(F,z);y=e=>{if(e=e.replace(/\s+/g,""),!S.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let r,n="",o,i;for(let t=0;t>16&255):64===i?T(r>>16&255,r>>8&255):T(r>>16&255,r>>8&255,255&r);return n};const W=g?t=>atob(U(t)):b?t=>Buffer.from(t,"base64").toString("binary"):y,H=b?t=>x(Buffer.from(t,"base64")):t=>x(W(t),t=>t.charCodeAt(0)),M=t=>H(q(t)),Z=b?t=>Buffer.from(t,"base64").toString("utf8"):m?t=>m.decode(H(t)):t=>D(W(t)),q=t=>U(t.replace(/[-_]/g,t=>"-"==t?"+":"/")),N=t=>Z(q(t));const V=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),$=function(){var t=(t,e)=>Object.defineProperty(String.prototype,t,V(e));t("fromBase64",function(){return N(this)}),t("toBase64",function(t){return L(this,t)}),t("toBase64URI",function(){return L(this,!0)}),t("toBase64URL",function(){return L(this,!0)}),t("toUint8Array",function(){return M(this)})},Q=function(){var t=(t,e)=>Object.defineProperty(Uint8Array.prototype,t,V(e));t("toBase64",function(t){return _(this,t)}),t("toBase64URI",function(){return _(this,!0)}),t("toBase64URL",function(){return _(this,!0)})};const G={version:p,VERSION:"3.6.0",atob:W,atobPolyfill:y,btoa:C,btoaPolyfill:B,fromBase64:N,toBase64:L,encode:L,encodeURI:k,encodeURL:k,utob:I,btou:D,decode:N,isValid:t=>{if("string"!=typeof t)return!1;t=t.replace(/\s+/g,"").replace(/=+$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:_,toUint8Array:M,extendString:$,extendUint8Array:Q,extendBuiltins:()=>{$(),Q()}},J=/\+/g;function K(e=""){try{return decodeURIComponent(""+e)}catch(t){return""+e}}function X(t=""){const e={};for(const o of(t="?"===t[0]?t.substr(1):t).split("&")){var r,n=o.match(/([^=]+)=?(.*)/)||[];n.length<2||"__proto__"!==(r=K(n[1]))&&"constructor"!==r&&(n=K((n[2]||"").replace(J," ")),e[r]?Array.isArray(e[r])?e[r].push(n):e[r]=[e[r],n]:e[r]=n)}return e}function Y(t,e=!1){return/^\w+:\/\/.+/.test(t)||e&&/^\/\/[^/]+/.test(t)}function tt(t){return X(et(t).search)}function et(t="",e){if(!Y(t,!0))return e?et(e+t):rt(t);const[r="",n,o]=(t.match(/([^:/]+:)?\/\/([^/@]+@)?(.*)/)||[]).splice(1);var[i="",a=""]=(o.match(/([^/]*)(.*)?/)||[]).splice(1),{pathname:e,search:t,hash:a}=rt(a);return{protocol:r,auth:n?n.substr(0,n.length-1):"",host:i,pathname:e,search:t,hash:a}}function rt(t=""){var[e="",r="",t=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:r,hash:t}}var nt=/^(?:[a-z\d\-_]{1,62}\.){0,125}(?:[a-z\d](?:\-(?=\-*[a-z\d])|[a-z]|\d){0,62}\.)[a-z\d]{1,63}$/i,ot={1:75,2:50,3:35,4:23,5:20},it={domain:null,useHTTPS:!0,includeLibraryParam:!0,urlPrefix:"https://",secureURLToken:null};function at(t,e){if(!Number.isInteger(t)||!Number.isInteger(e)||t<=0||e<=0||e