@localazy/cdn-client 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
7
7
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
8
  return value;
9
9
  };
10
- /* @localazy/cdn-client@1.2.0
10
+ /* @localazy/cdn-client@1.2.1
11
11
  * (c) 2024 Localazy <team@localazy.com>
12
12
  * @license MIT */
13
13
 
@@ -1,5 +1,5 @@
1
1
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("isomorphic-fetch")):"function"==typeof define&&define.amd?define(["exports","isomorphic-fetch"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).LocalazyCDN={})}(this,(function(t){"use strict";var e=Object.defineProperty,r=(t,r,n)=>(((t,r,n)=>{r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n})(t,"symbol"!=typeof r?r+"":r,n),n);
2
- /* @localazy/cdn-client@1.2.0
2
+ /* @localazy/cdn-client@1.2.1
3
3
  * (c) 2024 Localazy <team@localazy.com>
4
4
  * @license MIT */
5
5
  class n{constructor(t){r(this,"context"),this.context=t}async fetchLocale(t){return this.context.cache.has(t)?new Promise((e=>{e(this.context.cache.get(t))})):this.context.client.get(t.metafileLocale.uri)}async fetchMetafile(){return await this.context.client.get(this.context.metafile.params.jsonPath)}}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o="object"==typeof a&&a&&a.Object===Object&&a,s=o,c="object"==typeof self&&self&&self.Object===Object&&self,u=s||c||Function("return this")(),l=u.Symbol,f=l,h=Object.prototype,p=h.hasOwnProperty,v=h.toString,d=f?f.toStringTag:void 0;var b=function(t){var e=p.call(t,d),r=t[d];try{t[d]=void 0;var n=!0}catch(t){}var a=v.call(t);return n&&(e?t[d]=r:delete t[d]),a},y=Object.prototype.toString;var g=b,m=function(t){return y.call(t)},j=l?l.toStringTag:void 0;var w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":j&&j in Object(t)?g(t):m(t)};var _=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},x=w,O=_;var F=function(t){if(!O(t))return!1;var e=x(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const A=i(F);var L,M=u["__core-js_shared__"],S=(L=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"";var E=function(t){return!!S&&S in t},R=Function.prototype.toString;var U=function(t){if(null!=t){try{return R.call(t)}catch(t){}try{return t+""}catch(t){}}return""},q=F,I=E,P=_,$=U,z=/^\[object .+?Constructor\]$/,C=Function.prototype,B=Object.prototype,T=C.toString,k=B.hasOwnProperty,D=RegExp("^"+T.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var N=function(t){return!(!P(t)||I(t))&&(q(t)?D:z).test($(t))},V=function(t,e){return null==t?void 0:t[e]};var W=function(t,e){var r=V(t,e);return N(r)?r:void 0},G=W(Object,"create"),H=G;var J=function(){this.__data__=H?H(null):{},this.size=0};var K=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Q=G,X=Object.prototype.hasOwnProperty;var Y=function(t){var e=this.__data__;if(Q){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return X.call(e,t)?e[t]:void 0},Z=G,tt=Object.prototype.hasOwnProperty;var et=G;var rt=J,nt=K,at=Y,it=function(t){var e=this.__data__;return Z?void 0!==e[t]:tt.call(e,t)},ot=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=et&&void 0===e?"__lodash_hash_undefined__":e,this};function st(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}st.prototype.clear=rt,st.prototype.delete=nt,st.prototype.get=at,st.prototype.has=it,st.prototype.set=ot;var ct=st;var ut=function(){this.__data__=[],this.size=0};var lt=function(t,e){return t===e||t!=t&&e!=e},ft=lt;var ht=function(t,e){for(var r=t.length;r--;)if(ft(t[r][0],e))return r;return-1},pt=ht,vt=Array.prototype.splice;var dt=ht;var bt=ht;var yt=ht;var gt=ut,mt=function(t){var e=this.__data__,r=pt(e,t);return!(r<0)&&(r==e.length-1?e.pop():vt.call(e,r,1),--this.size,!0)},jt=function(t){var e=this.__data__,r=dt(e,t);return r<0?void 0:e[r][1]},wt=function(t){return bt(this.__data__,t)>-1},_t=function(t,e){var r=this.__data__,n=yt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function xt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}xt.prototype.clear=gt,xt.prototype.delete=mt,xt.prototype.get=jt,xt.prototype.has=wt,xt.prototype.set=_t;var Ot=xt,Ft=W(u,"Map"),At=ct,Lt=Ot,Mt=Ft;var St=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Et=function(t,e){var r=t.__data__;return St(e)?r["string"==typeof e?"string":"hash"]:r.map},Rt=Et;var Ut=Et;var qt=Et;var It=Et;var Pt=function(){this.size=0,this.__data__={hash:new At,map:new(Mt||Lt),string:new At}},$t=function(t){var e=Rt(this,t).delete(t);return this.size-=e?1:0,e},zt=function(t){return Ut(this,t).get(t)},Ct=function(t){return qt(this,t).has(t)},Bt=function(t,e){var r=It(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Tt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Tt.prototype.clear=Pt,Tt.prototype.delete=$t,Tt.prototype.get=zt,Tt.prototype.has=Ct,Tt.prototype.set=Bt;var kt=Tt;var Dt=kt,Nt=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Vt=function(t){return this.__data__.has(t)};function Wt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Dt;++e<r;)this.add(t[e])}Wt.prototype.add=Wt.prototype.push=Nt,Wt.prototype.has=Vt;var Gt=Wt;var Ht=function(t,e,r,n){for(var a=t.length,i=r+(n?1:-1);n?i--:++i<a;)if(e(t[i],i,t))return i;return-1};var Jt=Ht,Kt=function(t){return t!=t},Qt=function(t,e,r){for(var n=r-1,a=t.length;++n<a;)if(t[n]===e)return n;return-1};var Xt=function(t,e,r){return e==e?Qt(t,e,r):Jt(t,Kt,r)};var Yt=function(t,e){return!!(null==t?0:t.length)&&Xt(t,e,0)>-1};var Zt=function(t,e,r){for(var n=-1,a=null==t?0:t.length;++n<a;)if(r(e,t[n]))return!0;return!1};var te=function(t,e){return t.has(e)},ee=W(u,"Set");var re=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},ne=ee,ae=function(){},ie=ne&&1/re(new ne([,-0]))[1]==1/0?function(t){return new ne(t)}:ae,oe=Gt,se=Yt,ce=Zt,ue=te,le=ie,fe=re;var he=function(t,e,r){var n=-1,a=se,i=t.length,o=!0,s=[],c=s;if(r)o=!1,a=ce;else if(i>=200){var u=e?null:le(t);if(u)return fe(u);o=!1,a=ue,c=new oe}else c=e?[]:s;t:for(;++n<i;){var l=t[n],f=e?e(l):l;if(l=r||0!==l?l:0,o&&f==f){for(var h=c.length;h--;)if(c[h]===f)continue t;e&&c.push(f),s.push(l)}else a(c,f,r)||(c!==s&&c.push(f),s.push(l))}return s},pe=he;const ve=i((function(t){return t&&t.length?pe(t):[]}));class de{constructor(){r(this,"map"),this.map=new Map}get(t){return this.map.get(t)}has(t){return this.map.has(t)}set(t,e){this.map.set(t,e)}flush(){this.map=new Map}}class be{constructor(t){r(this,"context"),r(this,"cacheAdapter"),this.context=t,this.cacheAdapter=new de}setIfMissed(t){const{metafileFile:e,metafileLocale:r,data:n}=t,a=this.keyFromMetafile({metafileFile:e,metafileLocale:r});this.cacheAdapter.has(a)||this.cacheAdapter.set(a,n)}has(t){const e=this.keyFromMetafile(t);return this.cacheAdapter.has(e)}get(t){const e=this.keyFromMetafile(t);return this.cacheAdapter.get(e)}flush(){this.cacheAdapter.flush()}keyFromMetafile(t){const{metafileFile:e,metafileLocale:r}=t,n=[...ve(e.productFlavors)].sort().join("-");return[this.context.metafile.params.cdnId,e.id,e.file,e.path,e.library,e.module,e.buildType,n,r.locale,r.timestamp.toString()].filter((t=>""!==t)).join("-")}}var ye=Array.isArray;const ge=i(ye);var me=function(t){return null!=t&&"object"==typeof t},je=w,we=ye,_e=me;const xe=i((function(t){return"string"==typeof t||!we(t)&&_e(t)&&"[object String]"==je(t)}));class Oe{constructor(t){r(this,"context"),this.context=t}}class Fe extends Oe{constructor(){super(...arguments),r(this,"flush",(()=>{this.context.cache.flush()}))}}var Ae=Ot;var Le=Ot,Me=Ft,Se=kt;var Ee=Ot,Re=function(){this.__data__=new Ae,this.size=0},Ue=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},qe=function(t){return this.__data__.get(t)},Ie=function(t){return this.__data__.has(t)},Pe=function(t,e){var r=this.__data__;if(r instanceof Le){var n=r.__data__;if(!Me||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Se(n)}return r.set(t,e),this.size=r.size,this};function $e(t){var e=this.__data__=new Ee(t);this.size=e.size}$e.prototype.clear=Re,$e.prototype.delete=Ue,$e.prototype.get=qe,$e.prototype.has=Ie,$e.prototype.set=Pe;var ze=$e;var Ce=Gt,Be=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1},Te=te;var ke=function(t,e,r,n,a,i){var o=1&r,s=t.length,c=e.length;if(s!=c&&!(o&&c>s))return!1;var u=i.get(t),l=i.get(e);if(u&&l)return u==e&&l==t;var f=-1,h=!0,p=2&r?new Ce:void 0;for(i.set(t,e),i.set(e,t);++f<s;){var v=t[f],d=e[f];if(n)var b=o?n(d,v,f,e,t,i):n(v,d,f,t,e,i);if(void 0!==b){if(b)continue;h=!1;break}if(p){if(!Be(e,(function(t,e){if(!Te(p,e)&&(v===t||a(v,t,r,n,i)))return p.push(e)}))){h=!1;break}}else if(v!==d&&!a(v,d,r,n,i)){h=!1;break}}return i.delete(t),i.delete(e),h},De=u.Uint8Array;var Ne=De,Ve=lt,We=ke,Ge=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r},He=re,Je=l?l.prototype:void 0,Ke=Je?Je.valueOf:void 0;var Qe=function(t,e,r,n,a,i,o){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new Ne(t),new Ne(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ve(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=Ge;case"[object Set]":var c=1&n;if(s||(s=He),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;n|=2,o.set(t,e);var l=We(s(t),s(e),n,a,i,o);return o.delete(t),l;case"[object Symbol]":if(Ke)return Ke.call(t)==Ke.call(e)}return!1};var Xe=function(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t},Ye=Xe,Ze=ye;var tr=function(t,e,r){var n=e(t);return Ze(t)?n:Ye(n,r(t))};var er=function(t,e){for(var r=-1,n=null==t?0:t.length,a=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[a++]=o)}return i};var rr=function(){return[]},nr=er,ar=rr,ir=Object.prototype.propertyIsEnumerable,or=Object.getOwnPropertySymbols,sr=or?function(t){return null==t?[]:(t=Object(t),nr(or(t),(function(e){return ir.call(t,e)})))}:ar;var cr=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n},ur=w,lr=me;var fr,hr,pr,vr,dr,br,yr,gr,mr=function(t){return lr(t)&&"[object Arguments]"==ur(t)},jr=me,wr=Object.prototype,_r=wr.hasOwnProperty,xr=wr.propertyIsEnumerable,Or=mr(function(){return arguments}())?mr:function(t){return jr(t)&&_r.call(t,"callee")&&!xr.call(t,"callee")},Fr=Or,Ar={exports:{}};fr=Ar,pr=u,vr=function(){return!1},dr=(hr=Ar.exports)&&!hr.nodeType&&hr,br=dr&&fr&&!fr.nodeType&&fr,yr=br&&br.exports===dr?pr.Buffer:void 0,gr=(yr?yr.isBuffer:void 0)||vr,fr.exports=gr;var Lr=Ar.exports,Mr=/^(?:0|[1-9]\d*)$/;var Sr=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Mr.test(t))&&t>-1&&t%1==0&&t<e};var Er=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Rr=w,Ur=Er,qr=me,Ir={};Ir["[object Float32Array]"]=Ir["[object Float64Array]"]=Ir["[object Int8Array]"]=Ir["[object Int16Array]"]=Ir["[object Int32Array]"]=Ir["[object Uint8Array]"]=Ir["[object Uint8ClampedArray]"]=Ir["[object Uint16Array]"]=Ir["[object Uint32Array]"]=!0,Ir["[object Arguments]"]=Ir["[object Array]"]=Ir["[object ArrayBuffer]"]=Ir["[object Boolean]"]=Ir["[object DataView]"]=Ir["[object Date]"]=Ir["[object Error]"]=Ir["[object Function]"]=Ir["[object Map]"]=Ir["[object Number]"]=Ir["[object Object]"]=Ir["[object RegExp]"]=Ir["[object Set]"]=Ir["[object String]"]=Ir["[object WeakMap]"]=!1;var Pr=function(t){return qr(t)&&Ur(t.length)&&!!Ir[Rr(t)]};var $r=function(t){return function(e){return t(e)}},zr={exports:{}};!function(t,e){var r=o,n=e&&!e.nodeType&&e,a=n&&t&&!t.nodeType&&t,i=a&&a.exports===n&&r.process,s=function(){try{var t=a&&a.require&&a.require("util").types;return t||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=s}(zr,zr.exports);var Cr=zr.exports,Br=Pr,Tr=$r,kr=Cr&&Cr.isTypedArray,Dr=kr?Tr(kr):Br,Nr=cr,Vr=Fr,Wr=ye,Gr=Lr,Hr=Sr,Jr=Dr,Kr=Object.prototype.hasOwnProperty;var Qr=function(t,e){var r=Wr(t),n=!r&&Vr(t),a=!r&&!n&&Gr(t),i=!r&&!n&&!a&&Jr(t),o=r||n||a||i,s=o?Nr(t.length,String):[],c=s.length;for(var u in t)!e&&!Kr.call(t,u)||o&&("length"==u||a&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Hr(u,c))||s.push(u);return s},Xr=Object.prototype;var Yr=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Xr)};var Zr=function(t,e){return function(r){return t(e(r))}},tn=Zr(Object.keys,Object),en=Yr,rn=tn,nn=Object.prototype.hasOwnProperty;var an=F,on=Er;var sn=function(t){return null!=t&&on(t.length)&&!an(t)},cn=Qr,un=function(t){if(!en(t))return rn(t);var e=[];for(var r in Object(t))nn.call(t,r)&&"constructor"!=r&&e.push(r);return e},ln=sn;var fn=function(t){return ln(t)?cn(t):un(t)},hn=tr,pn=sr,vn=fn;var dn=function(t){return hn(t,vn,pn)},bn=dn,yn=Object.prototype.hasOwnProperty;var gn=function(t,e,r,n,a,i){var o=1&r,s=bn(t),c=s.length;if(c!=bn(e).length&&!o)return!1;for(var u=c;u--;){var l=s[u];if(!(o?l in e:yn.call(e,l)))return!1}var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var p=!0;i.set(t,e),i.set(e,t);for(var v=o;++u<c;){var d=t[l=s[u]],b=e[l];if(n)var y=o?n(b,d,l,e,t,i):n(d,b,l,t,e,i);if(!(void 0===y?d===b||a(d,b,r,n,i):y)){p=!1;break}v||(v="constructor"==l)}if(p&&!v){var g=t.constructor,m=e.constructor;g==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m||(p=!1)}return i.delete(t),i.delete(e),p},mn=W(u,"DataView"),jn=Ft,wn=W(u,"Promise"),_n=ee,xn=W(u,"WeakMap"),On=w,Fn=U,An="[object Map]",Ln="[object Promise]",Mn="[object Set]",Sn="[object WeakMap]",En="[object DataView]",Rn=Fn(mn),Un=Fn(jn),qn=Fn(wn),In=Fn(_n),Pn=Fn(xn),$n=On;(mn&&$n(new mn(new ArrayBuffer(1)))!=En||jn&&$n(new jn)!=An||wn&&$n(wn.resolve())!=Ln||_n&&$n(new _n)!=Mn||xn&&$n(new xn)!=Sn)&&($n=function(t){var e=On(t),r="[object Object]"==e?t.constructor:void 0,n=r?Fn(r):"";if(n)switch(n){case Rn:return En;case Un:return An;case qn:return Ln;case In:return Mn;case Pn:return Sn}return e});var zn=$n,Cn=ze,Bn=ke,Tn=Qe,kn=gn,Dn=zn,Nn=ye,Vn=Lr,Wn=Dr,Gn="[object Arguments]",Hn="[object Array]",Jn="[object Object]",Kn=Object.prototype.hasOwnProperty;var Qn=function(t,e,r,n,a,i){var o=Nn(t),s=Nn(e),c=o?Hn:Dn(t),u=s?Hn:Dn(e),l=(c=c==Gn?Jn:c)==Jn,f=(u=u==Gn?Jn:u)==Jn,h=c==u;if(h&&Vn(t)){if(!Vn(e))return!1;o=!0,l=!1}if(h&&!l)return i||(i=new Cn),o||Wn(t)?Bn(t,e,r,n,a,i):Tn(t,e,c,r,n,a,i);if(!(1&r)){var p=l&&Kn.call(t,"__wrapped__"),v=f&&Kn.call(e,"__wrapped__");if(p||v){var d=p?t.value():t,b=v?e.value():e;return i||(i=new Cn),a(d,b,r,n,i)}}return!!h&&(i||(i=new Cn),kn(t,e,r,n,a,i))},Xn=me;var Yn=function t(e,r,n,a,i){return e===r||(null==e||null==r||!Xn(e)&&!Xn(r)?e!=e&&r!=r:Qn(e,r,n,a,t,i))},Zn=ze,ta=Yn;var ea=_;var ra=function(t){return t==t&&!ea(t)},na=ra,aa=fn;var ia=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}},oa=function(t,e,r,n){var a=r.length,i=a,o=!n;if(null==t)return!i;for(t=Object(t);a--;){var s=r[a];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){var c=(s=r[a])[0],u=t[c],l=s[1];if(o&&s[2]){if(void 0===u&&!(c in t))return!1}else{var f=new Zn;if(n)var h=n(u,l,c,t,e,f);if(!(void 0===h?ta(l,u,3,n,f):h))return!1}}return!0},sa=function(t){for(var e=aa(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,na(a)]}return e},ca=ia;var ua=function(t){var e=sa(t);return 1==e.length&&e[0][2]?ca(e[0][0],e[0][1]):function(r){return r===t||oa(r,t,e)}},la=w,fa=me;var ha=function(t){return"symbol"==typeof t||fa(t)&&"[object Symbol]"==la(t)},pa=ye,va=ha,da=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ba=/^\w*$/;var ya=function(t,e){if(pa(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!va(t))||(ba.test(t)||!da.test(t)||null!=e&&t in Object(e))},ga=kt;function ma(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(ma.Cache||ga),r}ma.Cache=ga;var ja=ma;var wa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_a=/\\(\\)?/g,xa=function(t){var e=ja(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(wa,(function(t,r,n,a){e.push(n?a.replace(_a,"$1"):r||t)})),e}));var Oa=function(t,e){for(var r=-1,n=null==t?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a},Fa=ye,Aa=ha,La=l?l.prototype:void 0,Ma=La?La.toString:void 0;var Sa=function t(e){if("string"==typeof e)return e;if(Fa(e))return Oa(e,t)+"";if(Aa(e))return Ma?Ma.call(e):"";var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r},Ea=Sa;var Ra=ye,Ua=ya,qa=xa,Ia=function(t){return null==t?"":Ea(t)};var Pa=function(t,e){return Ra(t)?t:Ua(t,e)?[t]:qa(Ia(t))},$a=ha;var za=function(t){if("string"==typeof t||$a(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e},Ca=Pa,Ba=za;var Ta=function(t,e){for(var r=0,n=(e=Ca(e,t)).length;null!=t&&r<n;)t=t[Ba(e[r++])];return r&&r==n?t:void 0},ka=Ta;var Da=Pa,Na=Fr,Va=ye,Wa=Sr,Ga=Er,Ha=za;var Ja=function(t,e){return null!=t&&e in Object(t)},Ka=function(t,e,r){for(var n=-1,a=(e=Da(e,t)).length,i=!1;++n<a;){var o=Ha(e[n]);if(!(i=null!=t&&r(t,o)))break;t=t[o]}return i||++n!=a?i:!!(a=null==t?0:t.length)&&Ga(a)&&Wa(o,a)&&(Va(t)||Na(t))};var Qa=Yn,Xa=function(t,e,r){var n=null==t?void 0:ka(t,e);return void 0===n?r:n},Ya=function(t,e){return null!=t&&Ka(t,e,Ja)},Za=ya,ti=ra,ei=ia,ri=za;var ni=Ta;var ai=function(t){return function(e){return null==e?void 0:e[t]}},ii=function(t){return function(e){return ni(e,t)}},oi=ya,si=za;var ci=ua,ui=function(t,e){return Za(t)&&ti(e)?ei(ri(t),e):function(r){var n=Xa(r,t);return void 0===n&&n===e?Ya(r,t):Qa(e,n,3)}},li=function(t){return t},fi=ye,hi=function(t){return oi(t)?ai(si(t)):ii(t)};var pi=function(t){return"function"==typeof t?t:null==t?li:"object"==typeof t?fi(t)?ui(t[0],t[1]):ci(t):hi(t)},vi=pi,di=he;const bi=i((function(t,e){return t&&t.length?di(t,vi(e)):[]}));class yi{constructor(t,e){r(this,"language"),r(this,"region"),r(this,"script"),r(this,"isRtl"),r(this,"name"),r(this,"localizedName"),r(this,"uri"),r(this,"timestamp"),r(this,"baseLocale"),this.language=t.language,this.region=t.region,this.script=t.script,this.isRtl=t.isRtl,this.name=t.name,this.localizedName=t.localizedName,this.uri=t.uri,this.timestamp=t.timestamp,this.baseLocale=e}get locale(){return this.language&&this.region&&this.script?`${this.language}_${this.region}#${this.script}`:this.language&&this.script?`${this.language}#${this.script}`:this.language&&this.region?`${this.language}_${this.region}`:this.language}get isBaseLocale(){return this.locale===this.baseLocale}toCdnLocale(){return{locale:this.locale,isBaseLocale:this.isBaseLocale,language:this.language,region:this.region,script:this.script,isRtl:this.isRtl,name:this.name,localizedName:this.localizedName}}}class gi{constructor(t){r(this,"id"),r(this,"file"),r(this,"path"),r(this,"library"),r(this,"module"),r(this,"buildType"),r(this,"timestamp"),r(this,"productFlavors"),r(this,"locales"),r(this,"baseUrl"),this.id=t.id,this.file=t.file,this.path=t.path,this.library=t.library,this.module=t.module,this.buildType=t.buildType,this.timestamp=t.timestamp,this.productFlavors=t.productFlavors,this.locales=t.locales,this.baseUrl=t.baseUrl}toCdnFile(){return{id:this.id,file:this.file,path:this.path,library:this.library,module:this.module,buildType:this.buildType,productFlavors:this.productFlavors,locales:this.locales.map((t=>({locale:t.locale,isBaseLocale:t.isBaseLocale,uri:`${this.baseUrl}${t.uri}`})))}}}class mi{constructor(t,e){r(this,"projectUrl"),r(this,"baseLocale"),r(this,"locales"),r(this,"timestamp"),r(this,"files"),r(this,"filesMap"),this.projectUrl=t.projectUrl,this.timestamp=t.timestamp,this.files=mi.filesFactory(t.files,t.baseLocale,e),this.filesMap=mi.filesMapFactory(this.files),this.locales=mi.localesFactory(this.files),this.baseLocale=this.locales.find((t=>t.isBaseLocale))}static createEmpty(t){return new mi({projectUrl:"",baseLocale:"",timestamp:0,files:{}},t)}static filesFactory(t,e,r){return Object.keys(t).reduce(((n,a)=>{const i=t[a].locales.map((t=>new yi(t,e)));return n.push(new gi({...t[a],id:a,locales:i,baseUrl:r.baseUrl})),n}),[])}static filesMapFactory(t){return t.reduce(((t,e)=>(t[e.id]=e,t)),{})}static localesFactory(t){const e=t.reduce(((t,e)=>(t.push(...e.locales.map((t=>t.toCdnLocale()))),t)),[]);return bi(e,(t=>t.locale))}}class ji{constructor(t){r(this,"options"),this.options=ji.parseMetafileUrl(t)}get url(){return this.options.url}get baseUrl(){return this.options.baseUrl}get cdnId(){return this.options.cdnId}get jsonPath(){return this.options.jsonPath}static parseMetafileUrl(t){let e;try{e=new URL(t)}catch(t){throw new Error('Invalid param: "options.metafile" cannot be parsed as url.')}const r=e.pathname.match(/^\/(.*?)\/(.*?)\.(v2.json|js|ts)$/);if(null===r||4!==r.length)throw new Error('Invalid param: "options.metafile" contains invalid metafile url.');const n=r[1],a=r[2];return{url:t,baseUrl:e.origin,cdnId:n,jsonPath:`/${n}/${a}.v2.json`}}}class wi{constructor(t){r(this,"params"),r(this,"parsedData"),r(this,"data"),this.params=new ji(t.metafile),this.parsedData=null,this.data=mi.createEmpty(this.params)}setMetafile(t){this.parsedData=t,this.data=new mi(t,this.params)}}class _i{constructor(t){r(this,"context"),this.context=t}createCdnResponse(t){const{requests:e,responses:r,hasSingleFileResponse:n,hasSingleLocaleResponse:a}=t;return 0===r.length?{}:(this.cacheResponses(e,r),n&&a?r[0]:_i.transformResponses(t))}cacheResponses(t,e){e.forEach(((e,r)=>{const{metafileFile:n,metafileLocale:a}=t[r];n&&a&&this.context.cache.setIfMissed({metafileFile:n,metafileLocale:a,data:e})}))}static transformResponses(t){const{requests:e,responses:r,hasSingleFileResponse:n}=t;return r.reduce(((t,r,a)=>{const{metafileFile:i,metafileLocale:o}=e[a];return i&&o&&(n?t[o.locale]=r:(t[i.id]||(t[i.id]={}),t[i.id][o.locale]=r)),t}),{})}}class xi{constructor(t){r(this,"metafile"),r(this,"cdn"),r(this,"client"),r(this,"api"),r(this,"cache"),r(this,"responseFactory"),this.metafile=t.metafileContext,this.cdn=t.cdn,this.client=t.client,this.api=new n(this),this.cache=new be(this),this.responseFactory=new _i(this)}}var Oi=function(t){return function(e,r,n){for(var a=-1,i=Object(e),o=n(e),s=o.length;s--;){var c=o[t?s:++a];if(!1===r(i[c],c,i))break}return e}}(),Fi=fn;var Ai=sn;var Li=function(t,e){return function(r,n){if(null==r)return r;if(!Ai(r))return t(r,n);for(var a=r.length,i=e?a:-1,o=Object(r);(e?i--:++i<a)&&!1!==n(o[i],i,o););return r}}((function(t,e){return t&&Oi(t,e,Fi)}));var Mi=er,Si=function(t,e){var r=[];return Li(t,(function(t,n,a){e(t,n,a)&&r.push(t)})),r},Ei=pi,Ri=ye;const Ui=i((function(t,e){return(Ri(t)?Mi:Si)(t,Ei(e))}));var qi=pi,Ii=sn,Pi=fn;var $i=function(t){return function(e,r,n){var a=Object(e);if(!Ii(e)){var i=qi(r);e=Pi(e),r=function(t){return i(a[t],t,a)}}var o=t(e,r,n);return o>-1?a[i?e[o]:o]:void 0}},zi=/\s/;var Ci=function(t){for(var e=t.length;e--&&zi.test(t.charAt(e)););return e},Bi=/^\s+/;var Ti=function(t){return t?t.slice(0,Ci(t)+1).replace(Bi,""):t},ki=_,Di=ha,Ni=/^[-+]0x[0-9a-f]+$/i,Vi=/^0b[01]+$/i,Wi=/^0o[0-7]+$/i,Gi=parseInt;var Hi=function(t){if("number"==typeof t)return t;if(Di(t))return NaN;if(ki(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ki(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ti(t);var r=Vi.test(t);return r||Wi.test(t)?Gi(t.slice(2),r?2:8):Ni.test(t)?NaN:+t},Ji=1/0;var Ki=function(t){return t?(t=Hi(t))===Ji||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0};var Qi=Ht,Xi=pi,Yi=function(t){var e=Ki(t),r=e%1;return e==e?r?e-r:e:0},Zi=Math.max;const to=i($i((function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var a=null==r?0:Yi(r);return a<0&&(a=Zi(n+a,0)),Qi(t,Xi(e),a)})));var eo=Zr(Object.getPrototypeOf,Object),ro=w,no=eo,ao=me,io=Function.prototype,oo=Object.prototype,so=io.toString,co=oo.hasOwnProperty,uo=so.call(Object);const lo=i((function(t){if(!ao(t)||"[object Object]"!=ro(t))return!1;var e=no(t);if(null===e)return!0;var r=co.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&so.call(r)==uo}));var fo=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t},ho=W,po=function(){try{var t=ho(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var vo=function(t,e,r){"__proto__"==e&&po?po(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r},bo=vo,yo=lt,go=Object.prototype.hasOwnProperty;var mo=function(t,e,r){var n=t[e];go.call(t,e)&&yo(n,r)&&(void 0!==r||e in t)||bo(t,e,r)},jo=mo,wo=vo;var _o=function(t,e,r,n){var a=!r;r||(r={});for(var i=-1,o=e.length;++i<o;){var s=e[i],c=n?n(r[s],t[s],s,r,t):void 0;void 0===c&&(c=t[s]),a?wo(r,s,c):jo(r,s,c)}return r},xo=_o,Oo=fn;var Fo=function(t,e){return t&&xo(e,Oo(e),t)};var Ao=_,Lo=Yr,Mo=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e},So=Object.prototype.hasOwnProperty;var Eo=Qr,Ro=function(t){if(!Ao(t))return Mo(t);var e=Lo(t),r=[];for(var n in t)("constructor"!=n||!e&&So.call(t,n))&&r.push(n);return r},Uo=sn;var qo=function(t){return Uo(t)?Eo(t,!0):Ro(t)},Io=_o,Po=qo;var $o=function(t,e){return t&&Io(e,Po(e),t)},zo={exports:{}};!function(t,e){var r=u,n=e&&!e.nodeType&&e,a=n&&t&&!t.nodeType&&t,i=a&&a.exports===n?r.Buffer:void 0,o=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=o?o(r):new t.constructor(r);return t.copy(n),n}}(zo,zo.exports);var Co=zo.exports;var Bo=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e},To=_o,ko=sr;var Do=function(t,e){return To(t,ko(t),e)},No=Xe,Vo=eo,Wo=sr,Go=rr,Ho=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)No(e,Wo(t)),t=Vo(t);return e}:Go,Jo=_o,Ko=Ho;var Qo=function(t,e){return Jo(t,Ko(t),e)},Xo=tr,Yo=Ho,Zo=qo;var ts=function(t){return Xo(t,Zo,Yo)},es=Object.prototype.hasOwnProperty;var rs=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&es.call(t,"index")&&(r.index=t.index,r.input=t.input),r},ns=De;var as=function(t){var e=new t.constructor(t.byteLength);return new ns(e).set(new ns(t)),e},is=as;var os=function(t,e){var r=e?is(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)},ss=/\w*$/;var cs=function(t){var e=new t.constructor(t.source,ss.exec(t));return e.lastIndex=t.lastIndex,e},us=l?l.prototype:void 0,ls=us?us.valueOf:void 0;var fs=as;var hs=as,ps=os,vs=cs,ds=function(t){return ls?Object(ls.call(t)):{}},bs=function(t,e){var r=e?fs(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)};var ys=function(t,e,r){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return hs(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return ps(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return bs(t,r);case"[object Map]":case"[object Set]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return vs(t);case"[object Symbol]":return ds(t)}},gs=_,ms=Object.create,js=function(){function t(){}return function(e){if(!gs(e))return{};if(ms)return ms(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),ws=eo,_s=Yr;var xs=function(t){return"function"!=typeof t.constructor||_s(t)?{}:js(ws(t))},Os=zn,Fs=me;var As=function(t){return Fs(t)&&"[object Map]"==Os(t)},Ls=$r,Ms=Cr&&Cr.isMap,Ss=Ms?Ls(Ms):As,Es=zn,Rs=me;var Us=function(t){return Rs(t)&&"[object Set]"==Es(t)},qs=$r,Is=Cr&&Cr.isSet,Ps=Is?qs(Is):Us,$s=ze,zs=fo,Cs=mo,Bs=Fo,Ts=$o,ks=Co,Ds=Bo,Ns=Do,Vs=Qo,Ws=dn,Gs=ts,Hs=zn,Js=rs,Ks=ys,Qs=xs,Xs=ye,Ys=Lr,Zs=Ss,tc=_,ec=Ps,rc=fn,nc=qo,ac="[object Arguments]",ic="[object Function]",oc="[object Object]",sc={};sc[ac]=sc["[object Array]"]=sc["[object ArrayBuffer]"]=sc["[object DataView]"]=sc["[object Boolean]"]=sc["[object Date]"]=sc["[object Float32Array]"]=sc["[object Float64Array]"]=sc["[object Int8Array]"]=sc["[object Int16Array]"]=sc["[object Int32Array]"]=sc["[object Map]"]=sc["[object Number]"]=sc[oc]=sc["[object RegExp]"]=sc["[object Set]"]=sc["[object String]"]=sc["[object Symbol]"]=sc["[object Uint8Array]"]=sc["[object Uint8ClampedArray]"]=sc["[object Uint16Array]"]=sc["[object Uint32Array]"]=!0,sc["[object Error]"]=sc[ic]=sc["[object WeakMap]"]=!1;var cc=function t(e,r,n,a,i,o){var s,c=1&r,u=2&r,l=4&r;if(n&&(s=i?n(e,a,i,o):n(e)),void 0!==s)return s;if(!tc(e))return e;var f=Xs(e);if(f){if(s=Js(e),!c)return Ds(e,s)}else{var h=Hs(e),p=h==ic||"[object GeneratorFunction]"==h;if(Ys(e))return ks(e,c);if(h==oc||h==ac||p&&!i){if(s=u||p?{}:Qs(e),!c)return u?Vs(e,Ts(s,e)):Ns(e,Bs(s,e))}else{if(!sc[h])return i?e:{};s=Ks(e,h,c)}}o||(o=new $s);var v=o.get(e);if(v)return v;o.set(e,s),ec(e)?e.forEach((function(a){s.add(t(a,r,n,a,e,o))})):Zs(e)&&e.forEach((function(a,i){s.set(i,t(a,r,n,i,e,o))}));var d=f?void 0:(l?u?Gs:Ws:u?nc:rc)(e);return zs(d||e,(function(a,i){d&&(a=e[i=a]),Cs(s,i,t(a,r,n,i,e,o))})),s},uc=cc,lc=ua;const fc=i((function(t){return lc(uc(t,1))})),hc=class t extends Oe{constructor(){super(...arguments),r(this,"list",(()=>t.transformFiles(this.context.metafile.data.files))),r(this,"filter",(e=>{if(!e)throw new Error('Invalid param: missing required "options" parameter.');if(!A(e)&&!lo(e))throw new Error('Invalid param: "options" must be function or object.');const r=t.transformFiles(this.context.metafile.data.files);return A(e)?r.filter(e):Ui(r,fc(e))})),r(this,"find",(e=>{if(!e)throw new Error('Invalid param: missing required "options" parameter.');if(!A(e)&&!lo(e))throw new Error('Invalid param: "options" must be function or object.');const r=t.transformFiles(this.context.metafile.data.files);return A(e)?r.find(e):to(r,fc(e))})),r(this,"first",(()=>{if(0===this.context.metafile.data.files.length)throw new Error("File is missing in downloaded metafile.");return t.transformFiles(this.context.metafile.data.files)[0]}))}};r(hc,"transformFiles",(t=>t.map((t=>t.toCdnFile()))));let pc=hc;class vc extends Oe{constructor(t){super(t),r(this,"files"),r(this,"locales",(t=>{const{excludeBaseLocale:e}=t||{},{locales:r}=this.context.metafile.data;return e?r.filter((t=>!t.isBaseLocale)):r})),r(this,"refresh",(async()=>{const t=await this.context.api.fetchMetafile();this.context.metafile.setMetafile(t)})),r(this,"switch",(async t=>{this.context.metafile.params=new ji(t.metafile),await this.refresh()})),this.files=new pc(t)}get projectUrl(){return this.context.metafile.data.projectUrl}get baseLocale(){return this.context.metafile.data.baseLocale}get url(){return this.context.metafile.params.url}}const dc=i((function(t){return void 0===t}));class bc{constructor(t){r(this,"data"),r(this,"context"),this.context=t.context,this.data=t.data||{}}}class yc{constructor(t){r(this,"files"),r(this,"localesMap"),r(this,"hasSingleFileResponse"),r(this,"hasSingleLocaleResponse"),r(this,"context"),this.files=[],this.localesMap=new bc({context:t}),this.hasSingleFileResponse=!1,this.hasSingleLocaleResponse=!1,this.context=t}async execute(){const t=this.getPromises(),e=t.map((t=>t[0])),r=t.map((t=>t[1])),n=await Promise.all(e);return this.context.responseFactory.createCdnResponse({requests:r,responses:n,localesMap:this.localesMap,hasSingleFileResponse:this.hasSingleFileResponse,hasSingleLocaleResponse:this.hasSingleLocaleResponse})}getPromises(){return this.files.reduce(((t,e)=>(this.localesMap.data[e.id]&&t.push(...this.localesMap.data[e.id].map((t=>{const r={metafileFile:e,metafileLocale:t};return[this.context.api.fetchLocale(r),r]}))),t)),[])}}class gc{constructor(t){r(this,"context"),r(this,"request"),this.context=t,this.request=new yc(this.context)}addFiles(t){if(!(lo(t)||xe(t)||dc(t)||ge(t)))throw new Error('Invalid param: "request.files" must be object, array, string or undefined.');if(ge(t)&&t.forEach((t=>{if(!lo(t)&&!xe(t))throw new Error('Invalid param: array "request.files" must contain objects or strings.')})),xe(t)){this.request.hasSingleFileResponse=!0;const e=this.context.metafile.data.files.find((e=>e.id===t));if(!(e instanceof gi))throw new Error(`File not found: "${t}".`);this.request.files=[e]}else if(dc(t))this.request.files=[...this.context.metafile.data.files];else if(ge(t))this.request.files=t.map((t=>{let e;if(xe(t)){const r=this.context.metafile.data.files.find((e=>e.id===t));if(dc(r))throw new Error(`File not found: "${t}".`);e=r}else{const r=this.context.metafile.data.files.find((e=>e.id===t.id));if(dc(r))throw new Error(`File not found: "${t.id}".`);e=r}return e}));else if(lo(t)){this.request.hasSingleFileResponse=!0;const e=this.context.metafile.data.files.find((e=>e.id===t.id));if(dc(e))throw new Error(`File not found: "${t.id}".`);this.request.files=[e]}return this}addLocales(t,e){if(!(xe(t)||dc(t)||ge(t)))throw new Error('Invalid param: "request.locales" must be array, string or undefined.');return ge(t)&&t.forEach((t=>{if(!xe(t))throw new Error('Invalid param: array "request.locales" must contain strings.')})),xe(t)?(this.request.hasSingleLocaleResponse=!0,this.request.files.reduce(((e,r)=>(e.data[r.id]=r.locales.filter((e=>e.locale===t)),e)),this.request.localesMap)):dc(t)?this.request.files.reduce(((t,r)=>(t.data[r.id]=e?r.locales.filter((t=>!t.isBaseLocale)):r.locales,t)),this.request.localesMap):ge(t)&&this.request.files.reduce(((e,r)=>(e.data[r.id]=r.locales.filter((e=>t.includes(e.locale))),e)),this.request.localesMap),this}getCdnRequest(){const t=this.request;return this.request=new yc(this.context),t}}class mc{constructor(t){r(this,"baseUrl"),this.baseUrl=t}async get(t){const e=await fetch(`${this.baseUrl}${t}`),r=e.headers.get("content-type")||"",n=["application/json5","application/json"].includes(r);if(e.status>=400)throw new Error(`Request failed with status code ${e.status}`);let a="";if(n)try{a=await e.json()}catch(t){a={}}else try{a=await e.text()}catch(t){a=""}return a}}class jc{constructor(t){r(this,"metafile"),r(this,"cache"),r(this,"context"),r(this,"fetch",(async t=>{const{files:e,locales:r,excludeBaseLocale:n}=t||{};return new gc(this.context).addFiles(e).addLocales(r,n).getCdnRequest().execute()}));const e=new wi(t),n=new mc(e.params.baseUrl);this.context=new xi({metafileContext:e,cdn:this,client:n}),this.metafile=new vc(this.context),this.cache=new Fe(this.context)}static async create(t){if(!t)throw new Error('Invalid param: missing required "options" parameter.');if(!xe(t.metafile))throw new Error('Invalid param: "options.metafile" must be string.');const e=new jc(t);return await e.metafile.refresh(),e}}t.Api=n,t.CdnBase=Oe,t.CdnCache=Fe,t.CdnClient=jc,t.CdnMetafile=vc,t.CdnMetafileFiles=pc,t.Context=xi,t.FetchHttpAdapter=mc,t.LocalesCache=be,t.LocalesMap=bc,t.MemoryCacheAdapter=de,t.MetafileContext=wi,t.MetafileData=mi,t.MetafileFile=gi,t.MetafileLocale=yi,t.MetafileParams=ji,t.Request=yc,t.RequestBuilder=gc,t.ResponseFactory=_i,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- /* @localazy/cdn-client@1.2.0
7
+ /* @localazy/cdn-client@1.2.1
8
8
  * (c) 2024 Localazy <team@localazy.com>
9
9
  * @license MIT */
10
10
  import "isomorphic-fetch";
@@ -1,5 +1,5 @@
1
1
  var t=Object.defineProperty,e=(e,r,n)=>(((e,r,n)=>{r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n})(e,"symbol"!=typeof r?r+"":r,n),n);
2
- /* @localazy/cdn-client@1.2.0
2
+ /* @localazy/cdn-client@1.2.1
3
3
  * (c) 2024 Localazy <team@localazy.com>
4
4
  * @license MIT */
5
5
  import"isomorphic-fetch";class r{constructor(t){e(this,"context"),this.context=t}async fetchLocale(t){return this.context.cache.has(t)?new Promise((e=>{e(this.context.cache.get(t))})):this.context.client.get(t.metafileLocale.uri)}async fetchMetafile(){return await this.context.client.get(this.context.metafile.params.jsonPath)}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i="object"==typeof n&&n&&n.Object===Object&&n,o=i,s="object"==typeof self&&self&&self.Object===Object&&self,c=o||s||Function("return this")(),u=c.Symbol,l=u,f=Object.prototype,h=f.hasOwnProperty,p=f.toString,v=l?l.toStringTag:void 0;var d=function(t){var e=h.call(t,v),r=t[v];try{t[v]=void 0;var n=!0}catch(t){}var a=p.call(t);return n&&(e?t[v]=r:delete t[v]),a},b=Object.prototype.toString;var y=d,g=function(t){return b.call(t)},m=u?u.toStringTag:void 0;var j=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":m&&m in Object(t)?y(t):g(t)};var w=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},_=j,x=w;var O=function(t){if(!x(t))return!1;var e=_(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const F=a(O);var A,L=c["__core-js_shared__"],S=(A=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var M=function(t){return!!S&&S in t},E=Function.prototype.toString;var U=function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""},I=O,R=M,$=w,q=U,P=/^\[object .+?Constructor\]$/,z=Function.prototype,B=Object.prototype,T=z.toString,k=B.hasOwnProperty,C=RegExp("^"+T.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var N=function(t){return!(!$(t)||R(t))&&(I(t)?C:P).test(q(t))},D=function(t,e){return null==t?void 0:t[e]};var V=function(t,e){var r=D(t,e);return N(r)?r:void 0},W=V(Object,"create"),G=W;var H=function(){this.__data__=G?G(null):{},this.size=0};var J=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},K=W,Q=Object.prototype.hasOwnProperty;var X=function(t){var e=this.__data__;if(K){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Q.call(e,t)?e[t]:void 0},Y=W,Z=Object.prototype.hasOwnProperty;var tt=W;var et=H,rt=J,nt=X,at=function(t){var e=this.__data__;return Y?void 0!==e[t]:Z.call(e,t)},it=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=tt&&void 0===e?"__lodash_hash_undefined__":e,this};function ot(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ot.prototype.clear=et,ot.prototype.delete=rt,ot.prototype.get=nt,ot.prototype.has=at,ot.prototype.set=it;var st=ot;var ct=function(){this.__data__=[],this.size=0};var ut=function(t,e){return t===e||t!=t&&e!=e},lt=ut;var ft=function(t,e){for(var r=t.length;r--;)if(lt(t[r][0],e))return r;return-1},ht=ft,pt=Array.prototype.splice;var vt=ft;var dt=ft;var bt=ft;var yt=ct,gt=function(t){var e=this.__data__,r=ht(e,t);return!(r<0)&&(r==e.length-1?e.pop():pt.call(e,r,1),--this.size,!0)},mt=function(t){var e=this.__data__,r=vt(e,t);return r<0?void 0:e[r][1]},jt=function(t){return dt(this.__data__,t)>-1},wt=function(t,e){var r=this.__data__,n=bt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function _t(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_t.prototype.clear=yt,_t.prototype.delete=gt,_t.prototype.get=mt,_t.prototype.has=jt,_t.prototype.set=wt;var xt=_t,Ot=V(c,"Map"),Ft=st,At=xt,Lt=Ot;var St=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Mt=function(t,e){var r=t.__data__;return St(e)?r["string"==typeof e?"string":"hash"]:r.map},Et=Mt;var Ut=Mt;var It=Mt;var Rt=Mt;var $t=function(){this.size=0,this.__data__={hash:new Ft,map:new(Lt||At),string:new Ft}},qt=function(t){var e=Et(this,t).delete(t);return this.size-=e?1:0,e},Pt=function(t){return Ut(this,t).get(t)},zt=function(t){return It(this,t).has(t)},Bt=function(t,e){var r=Rt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Tt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Tt.prototype.clear=$t,Tt.prototype.delete=qt,Tt.prototype.get=Pt,Tt.prototype.has=zt,Tt.prototype.set=Bt;var kt=Tt;var Ct=kt,Nt=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dt=function(t){return this.__data__.has(t)};function Vt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Ct;++e<r;)this.add(t[e])}Vt.prototype.add=Vt.prototype.push=Nt,Vt.prototype.has=Dt;var Wt=Vt;var Gt=function(t,e,r,n){for(var a=t.length,i=r+(n?1:-1);n?i--:++i<a;)if(e(t[i],i,t))return i;return-1};var Ht=Gt,Jt=function(t){return t!=t},Kt=function(t,e,r){for(var n=r-1,a=t.length;++n<a;)if(t[n]===e)return n;return-1};var Qt=function(t,e,r){return e==e?Kt(t,e,r):Ht(t,Jt,r)};var Xt=function(t,e){return!!(null==t?0:t.length)&&Qt(t,e,0)>-1};var Yt=function(t,e,r){for(var n=-1,a=null==t?0:t.length;++n<a;)if(r(e,t[n]))return!0;return!1};var Zt=function(t,e){return t.has(e)},te=V(c,"Set");var ee=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},re=te,ne=function(){},ae=re&&1/ee(new re([,-0]))[1]==1/0?function(t){return new re(t)}:ne,ie=Wt,oe=Xt,se=Yt,ce=Zt,ue=ae,le=ee;var fe=function(t,e,r){var n=-1,a=oe,i=t.length,o=!0,s=[],c=s;if(r)o=!1,a=se;else if(i>=200){var u=e?null:ue(t);if(u)return le(u);o=!1,a=ce,c=new ie}else c=e?[]:s;t:for(;++n<i;){var l=t[n],f=e?e(l):l;if(l=r||0!==l?l:0,o&&f==f){for(var h=c.length;h--;)if(c[h]===f)continue t;e&&c.push(f),s.push(l)}else a(c,f,r)||(c!==s&&c.push(f),s.push(l))}return s},he=fe;const pe=a((function(t){return t&&t.length?he(t):[]}));class ve{constructor(){e(this,"map"),this.map=new Map}get(t){return this.map.get(t)}has(t){return this.map.has(t)}set(t,e){this.map.set(t,e)}flush(){this.map=new Map}}class de{constructor(t){e(this,"context"),e(this,"cacheAdapter"),this.context=t,this.cacheAdapter=new ve}setIfMissed(t){const{metafileFile:e,metafileLocale:r,data:n}=t,a=this.keyFromMetafile({metafileFile:e,metafileLocale:r});this.cacheAdapter.has(a)||this.cacheAdapter.set(a,n)}has(t){const e=this.keyFromMetafile(t);return this.cacheAdapter.has(e)}get(t){const e=this.keyFromMetafile(t);return this.cacheAdapter.get(e)}flush(){this.cacheAdapter.flush()}keyFromMetafile(t){const{metafileFile:e,metafileLocale:r}=t,n=[...pe(e.productFlavors)].sort().join("-");return[this.context.metafile.params.cdnId,e.id,e.file,e.path,e.library,e.module,e.buildType,n,r.locale,r.timestamp.toString()].filter((t=>""!==t)).join("-")}}var be=Array.isArray;const ye=a(be);var ge=function(t){return null!=t&&"object"==typeof t},me=j,je=be,we=ge;const _e=a((function(t){return"string"==typeof t||!je(t)&&we(t)&&"[object String]"==me(t)}));class xe{constructor(t){e(this,"context"),this.context=t}}class Oe extends xe{constructor(){super(...arguments),e(this,"flush",(()=>{this.context.cache.flush()}))}}var Fe=xt;var Ae=xt,Le=Ot,Se=kt;var Me=xt,Ee=function(){this.__data__=new Fe,this.size=0},Ue=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Ie=function(t){return this.__data__.get(t)},Re=function(t){return this.__data__.has(t)},$e=function(t,e){var r=this.__data__;if(r instanceof Ae){var n=r.__data__;if(!Le||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Se(n)}return r.set(t,e),this.size=r.size,this};function qe(t){var e=this.__data__=new Me(t);this.size=e.size}qe.prototype.clear=Ee,qe.prototype.delete=Ue,qe.prototype.get=Ie,qe.prototype.has=Re,qe.prototype.set=$e;var Pe=qe;var ze=Wt,Be=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1},Te=Zt;var ke=function(t,e,r,n,a,i){var o=1&r,s=t.length,c=e.length;if(s!=c&&!(o&&c>s))return!1;var u=i.get(t),l=i.get(e);if(u&&l)return u==e&&l==t;var f=-1,h=!0,p=2&r?new ze:void 0;for(i.set(t,e),i.set(e,t);++f<s;){var v=t[f],d=e[f];if(n)var b=o?n(d,v,f,e,t,i):n(v,d,f,t,e,i);if(void 0!==b){if(b)continue;h=!1;break}if(p){if(!Be(e,(function(t,e){if(!Te(p,e)&&(v===t||a(v,t,r,n,i)))return p.push(e)}))){h=!1;break}}else if(v!==d&&!a(v,d,r,n,i)){h=!1;break}}return i.delete(t),i.delete(e),h},Ce=c.Uint8Array;var Ne=Ce,De=ut,Ve=ke,We=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r},Ge=ee,He=u?u.prototype:void 0,Je=He?He.valueOf:void 0;var Ke=function(t,e,r,n,a,i,o){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new Ne(t),new Ne(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return De(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=We;case"[object Set]":var c=1&n;if(s||(s=Ge),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;n|=2,o.set(t,e);var l=Ve(s(t),s(e),n,a,i,o);return o.delete(t),l;case"[object Symbol]":if(Je)return Je.call(t)==Je.call(e)}return!1};var Qe=function(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t},Xe=Qe,Ye=be;var Ze=function(t,e,r){var n=e(t);return Ye(t)?n:Xe(n,r(t))};var tr=function(t,e){for(var r=-1,n=null==t?0:t.length,a=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[a++]=o)}return i};var er=function(){return[]},rr=tr,nr=er,ar=Object.prototype.propertyIsEnumerable,ir=Object.getOwnPropertySymbols,or=ir?function(t){return null==t?[]:(t=Object(t),rr(ir(t),(function(e){return ar.call(t,e)})))}:nr;var sr=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n},cr=j,ur=ge;var lr,fr,hr,pr,vr,dr,br,yr,gr=function(t){return ur(t)&&"[object Arguments]"==cr(t)},mr=ge,jr=Object.prototype,wr=jr.hasOwnProperty,_r=jr.propertyIsEnumerable,xr=gr(function(){return arguments}())?gr:function(t){return mr(t)&&wr.call(t,"callee")&&!_r.call(t,"callee")},Or={exports:{}};lr=Or,hr=c,pr=function(){return!1},vr=(fr=Or.exports)&&!fr.nodeType&&fr,dr=vr&&lr&&!lr.nodeType&&lr,br=dr&&dr.exports===vr?hr.Buffer:void 0,yr=(br?br.isBuffer:void 0)||pr,lr.exports=yr;var Fr=Or.exports,Ar=/^(?:0|[1-9]\d*)$/;var Lr=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Ar.test(t))&&t>-1&&t%1==0&&t<e};var Sr=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Mr=j,Er=Sr,Ur=ge,Ir={};Ir["[object Float32Array]"]=Ir["[object Float64Array]"]=Ir["[object Int8Array]"]=Ir["[object Int16Array]"]=Ir["[object Int32Array]"]=Ir["[object Uint8Array]"]=Ir["[object Uint8ClampedArray]"]=Ir["[object Uint16Array]"]=Ir["[object Uint32Array]"]=!0,Ir["[object Arguments]"]=Ir["[object Array]"]=Ir["[object ArrayBuffer]"]=Ir["[object Boolean]"]=Ir["[object DataView]"]=Ir["[object Date]"]=Ir["[object Error]"]=Ir["[object Function]"]=Ir["[object Map]"]=Ir["[object Number]"]=Ir["[object Object]"]=Ir["[object RegExp]"]=Ir["[object Set]"]=Ir["[object String]"]=Ir["[object WeakMap]"]=!1;var Rr=function(t){return Ur(t)&&Er(t.length)&&!!Ir[Mr(t)]};var $r=function(t){return function(e){return t(e)}},qr={exports:{}};!function(t,e){var r=i,n=e&&!e.nodeType&&e,a=n&&t&&!t.nodeType&&t,o=a&&a.exports===n&&r.process,s=function(){try{var t=a&&a.require&&a.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=s}(qr,qr.exports);var Pr=qr.exports,zr=Rr,Br=$r,Tr=Pr&&Pr.isTypedArray,kr=Tr?Br(Tr):zr,Cr=sr,Nr=xr,Dr=be,Vr=Fr,Wr=Lr,Gr=kr,Hr=Object.prototype.hasOwnProperty;var Jr=function(t,e){var r=Dr(t),n=!r&&Nr(t),a=!r&&!n&&Vr(t),i=!r&&!n&&!a&&Gr(t),o=r||n||a||i,s=o?Cr(t.length,String):[],c=s.length;for(var u in t)!e&&!Hr.call(t,u)||o&&("length"==u||a&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Wr(u,c))||s.push(u);return s},Kr=Object.prototype;var Qr=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Kr)};var Xr=function(t,e){return function(r){return t(e(r))}},Yr=Xr(Object.keys,Object),Zr=Qr,tn=Yr,en=Object.prototype.hasOwnProperty;var rn=O,nn=Sr;var an=function(t){return null!=t&&nn(t.length)&&!rn(t)},on=Jr,sn=function(t){if(!Zr(t))return tn(t);var e=[];for(var r in Object(t))en.call(t,r)&&"constructor"!=r&&e.push(r);return e},cn=an;var un=function(t){return cn(t)?on(t):sn(t)},ln=Ze,fn=or,hn=un;var pn=function(t){return ln(t,hn,fn)},vn=pn,dn=Object.prototype.hasOwnProperty;var bn=function(t,e,r,n,a,i){var o=1&r,s=vn(t),c=s.length;if(c!=vn(e).length&&!o)return!1;for(var u=c;u--;){var l=s[u];if(!(o?l in e:dn.call(e,l)))return!1}var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var p=!0;i.set(t,e),i.set(e,t);for(var v=o;++u<c;){var d=t[l=s[u]],b=e[l];if(n)var y=o?n(b,d,l,e,t,i):n(d,b,l,t,e,i);if(!(void 0===y?d===b||a(d,b,r,n,i):y)){p=!1;break}v||(v="constructor"==l)}if(p&&!v){var g=t.constructor,m=e.constructor;g==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m||(p=!1)}return i.delete(t),i.delete(e),p},yn=V(c,"DataView"),gn=Ot,mn=V(c,"Promise"),jn=te,wn=V(c,"WeakMap"),_n=j,xn=U,On="[object Map]",Fn="[object Promise]",An="[object Set]",Ln="[object WeakMap]",Sn="[object DataView]",Mn=xn(yn),En=xn(gn),Un=xn(mn),In=xn(jn),Rn=xn(wn),$n=_n;(yn&&$n(new yn(new ArrayBuffer(1)))!=Sn||gn&&$n(new gn)!=On||mn&&$n(mn.resolve())!=Fn||jn&&$n(new jn)!=An||wn&&$n(new wn)!=Ln)&&($n=function(t){var e=_n(t),r="[object Object]"==e?t.constructor:void 0,n=r?xn(r):"";if(n)switch(n){case Mn:return Sn;case En:return On;case Un:return Fn;case In:return An;case Rn:return Ln}return e});var qn=$n,Pn=Pe,zn=ke,Bn=Ke,Tn=bn,kn=qn,Cn=be,Nn=Fr,Dn=kr,Vn="[object Arguments]",Wn="[object Array]",Gn="[object Object]",Hn=Object.prototype.hasOwnProperty;var Jn=function(t,e,r,n,a,i){var o=Cn(t),s=Cn(e),c=o?Wn:kn(t),u=s?Wn:kn(e),l=(c=c==Vn?Gn:c)==Gn,f=(u=u==Vn?Gn:u)==Gn,h=c==u;if(h&&Nn(t)){if(!Nn(e))return!1;o=!0,l=!1}if(h&&!l)return i||(i=new Pn),o||Dn(t)?zn(t,e,r,n,a,i):Bn(t,e,c,r,n,a,i);if(!(1&r)){var p=l&&Hn.call(t,"__wrapped__"),v=f&&Hn.call(e,"__wrapped__");if(p||v){var d=p?t.value():t,b=v?e.value():e;return i||(i=new Pn),a(d,b,r,n,i)}}return!!h&&(i||(i=new Pn),Tn(t,e,r,n,a,i))},Kn=ge;var Qn=function t(e,r,n,a,i){return e===r||(null==e||null==r||!Kn(e)&&!Kn(r)?e!=e&&r!=r:Jn(e,r,n,a,t,i))},Xn=Pe,Yn=Qn;var Zn=w;var ta=function(t){return t==t&&!Zn(t)},ea=ta,ra=un;var na=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}},aa=function(t,e,r,n){var a=r.length,i=a,o=!n;if(null==t)return!i;for(t=Object(t);a--;){var s=r[a];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){var c=(s=r[a])[0],u=t[c],l=s[1];if(o&&s[2]){if(void 0===u&&!(c in t))return!1}else{var f=new Xn;if(n)var h=n(u,l,c,t,e,f);if(!(void 0===h?Yn(l,u,3,n,f):h))return!1}}return!0},ia=function(t){for(var e=ra(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,ea(a)]}return e},oa=na;var sa=function(t){var e=ia(t);return 1==e.length&&e[0][2]?oa(e[0][0],e[0][1]):function(r){return r===t||aa(r,t,e)}},ca=j,ua=ge;var la=function(t){return"symbol"==typeof t||ua(t)&&"[object Symbol]"==ca(t)},fa=be,ha=la,pa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,va=/^\w*$/;var da=function(t,e){if(fa(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ha(t))||(va.test(t)||!pa.test(t)||null!=e&&t in Object(e))},ba=kt;function ya(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(ya.Cache||ba),r}ya.Cache=ba;var ga=ya;var ma=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ja=/\\(\\)?/g,wa=function(t){var e=ga(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ma,(function(t,r,n,a){e.push(n?a.replace(ja,"$1"):r||t)})),e}));var _a=function(t,e){for(var r=-1,n=null==t?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a},xa=be,Oa=la,Fa=u?u.prototype:void 0,Aa=Fa?Fa.toString:void 0;var La=function t(e){if("string"==typeof e)return e;if(xa(e))return _a(e,t)+"";if(Oa(e))return Aa?Aa.call(e):"";var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r},Sa=La;var Ma=be,Ea=da,Ua=wa,Ia=function(t){return null==t?"":Sa(t)};var Ra=function(t,e){return Ma(t)?t:Ea(t,e)?[t]:Ua(Ia(t))},$a=la;var qa=function(t){if("string"==typeof t||$a(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e},Pa=Ra,za=qa;var Ba=function(t,e){for(var r=0,n=(e=Pa(e,t)).length;null!=t&&r<n;)t=t[za(e[r++])];return r&&r==n?t:void 0},Ta=Ba;var ka=Ra,Ca=xr,Na=be,Da=Lr,Va=Sr,Wa=qa;var Ga=function(t,e){return null!=t&&e in Object(t)},Ha=function(t,e,r){for(var n=-1,a=(e=ka(e,t)).length,i=!1;++n<a;){var o=Wa(e[n]);if(!(i=null!=t&&r(t,o)))break;t=t[o]}return i||++n!=a?i:!!(a=null==t?0:t.length)&&Va(a)&&Da(o,a)&&(Na(t)||Ca(t))};var Ja=Qn,Ka=function(t,e,r){var n=null==t?void 0:Ta(t,e);return void 0===n?r:n},Qa=function(t,e){return null!=t&&Ha(t,e,Ga)},Xa=da,Ya=ta,Za=na,ti=qa;var ei=Ba;var ri=function(t){return function(e){return null==e?void 0:e[t]}},ni=function(t){return function(e){return ei(e,t)}},ai=da,ii=qa;var oi=sa,si=function(t,e){return Xa(t)&&Ya(e)?Za(ti(t),e):function(r){var n=Ka(r,t);return void 0===n&&n===e?Qa(r,t):Ja(e,n,3)}},ci=function(t){return t},ui=be,li=function(t){return ai(t)?ri(ii(t)):ni(t)};var fi=function(t){return"function"==typeof t?t:null==t?ci:"object"==typeof t?ui(t)?si(t[0],t[1]):oi(t):li(t)},hi=fi,pi=fe;const vi=a((function(t,e){return t&&t.length?pi(t,hi(e)):[]}));class di{constructor(t,r){e(this,"language"),e(this,"region"),e(this,"script"),e(this,"isRtl"),e(this,"name"),e(this,"localizedName"),e(this,"uri"),e(this,"timestamp"),e(this,"baseLocale"),this.language=t.language,this.region=t.region,this.script=t.script,this.isRtl=t.isRtl,this.name=t.name,this.localizedName=t.localizedName,this.uri=t.uri,this.timestamp=t.timestamp,this.baseLocale=r}get locale(){return this.language&&this.region&&this.script?`${this.language}_${this.region}#${this.script}`:this.language&&this.script?`${this.language}#${this.script}`:this.language&&this.region?`${this.language}_${this.region}`:this.language}get isBaseLocale(){return this.locale===this.baseLocale}toCdnLocale(){return{locale:this.locale,isBaseLocale:this.isBaseLocale,language:this.language,region:this.region,script:this.script,isRtl:this.isRtl,name:this.name,localizedName:this.localizedName}}}class bi{constructor(t){e(this,"id"),e(this,"file"),e(this,"path"),e(this,"library"),e(this,"module"),e(this,"buildType"),e(this,"timestamp"),e(this,"productFlavors"),e(this,"locales"),e(this,"baseUrl"),this.id=t.id,this.file=t.file,this.path=t.path,this.library=t.library,this.module=t.module,this.buildType=t.buildType,this.timestamp=t.timestamp,this.productFlavors=t.productFlavors,this.locales=t.locales,this.baseUrl=t.baseUrl}toCdnFile(){return{id:this.id,file:this.file,path:this.path,library:this.library,module:this.module,buildType:this.buildType,productFlavors:this.productFlavors,locales:this.locales.map((t=>({locale:t.locale,isBaseLocale:t.isBaseLocale,uri:`${this.baseUrl}${t.uri}`})))}}}class yi{constructor(t,r){e(this,"projectUrl"),e(this,"baseLocale"),e(this,"locales"),e(this,"timestamp"),e(this,"files"),e(this,"filesMap"),this.projectUrl=t.projectUrl,this.timestamp=t.timestamp,this.files=yi.filesFactory(t.files,t.baseLocale,r),this.filesMap=yi.filesMapFactory(this.files),this.locales=yi.localesFactory(this.files),this.baseLocale=this.locales.find((t=>t.isBaseLocale))}static createEmpty(t){return new yi({projectUrl:"",baseLocale:"",timestamp:0,files:{}},t)}static filesFactory(t,e,r){return Object.keys(t).reduce(((n,a)=>{const i=t[a].locales.map((t=>new di(t,e)));return n.push(new bi({...t[a],id:a,locales:i,baseUrl:r.baseUrl})),n}),[])}static filesMapFactory(t){return t.reduce(((t,e)=>(t[e.id]=e,t)),{})}static localesFactory(t){const e=t.reduce(((t,e)=>(t.push(...e.locales.map((t=>t.toCdnLocale()))),t)),[]);return vi(e,(t=>t.locale))}}class gi{constructor(t){e(this,"options"),this.options=gi.parseMetafileUrl(t)}get url(){return this.options.url}get baseUrl(){return this.options.baseUrl}get cdnId(){return this.options.cdnId}get jsonPath(){return this.options.jsonPath}static parseMetafileUrl(t){let e;try{e=new URL(t)}catch(t){throw new Error('Invalid param: "options.metafile" cannot be parsed as url.')}const r=e.pathname.match(/^\/(.*?)\/(.*?)\.(v2.json|js|ts)$/);if(null===r||4!==r.length)throw new Error('Invalid param: "options.metafile" contains invalid metafile url.');const n=r[1],a=r[2];return{url:t,baseUrl:e.origin,cdnId:n,jsonPath:`/${n}/${a}.v2.json`}}}class mi{constructor(t){e(this,"params"),e(this,"parsedData"),e(this,"data"),this.params=new gi(t.metafile),this.parsedData=null,this.data=yi.createEmpty(this.params)}setMetafile(t){this.parsedData=t,this.data=new yi(t,this.params)}}class ji{constructor(t){e(this,"context"),this.context=t}createCdnResponse(t){const{requests:e,responses:r,hasSingleFileResponse:n,hasSingleLocaleResponse:a}=t;return 0===r.length?{}:(this.cacheResponses(e,r),n&&a?r[0]:ji.transformResponses(t))}cacheResponses(t,e){e.forEach(((e,r)=>{const{metafileFile:n,metafileLocale:a}=t[r];n&&a&&this.context.cache.setIfMissed({metafileFile:n,metafileLocale:a,data:e})}))}static transformResponses(t){const{requests:e,responses:r,hasSingleFileResponse:n}=t;return r.reduce(((t,r,a)=>{const{metafileFile:i,metafileLocale:o}=e[a];return i&&o&&(n?t[o.locale]=r:(t[i.id]||(t[i.id]={}),t[i.id][o.locale]=r)),t}),{})}}class wi{constructor(t){e(this,"metafile"),e(this,"cdn"),e(this,"client"),e(this,"api"),e(this,"cache"),e(this,"responseFactory"),this.metafile=t.metafileContext,this.cdn=t.cdn,this.client=t.client,this.api=new r(this),this.cache=new de(this),this.responseFactory=new ji(this)}}var _i=function(t){return function(e,r,n){for(var a=-1,i=Object(e),o=n(e),s=o.length;s--;){var c=o[t?s:++a];if(!1===r(i[c],c,i))break}return e}}(),xi=un;var Oi=an;var Fi=function(t,e){return function(r,n){if(null==r)return r;if(!Oi(r))return t(r,n);for(var a=r.length,i=e?a:-1,o=Object(r);(e?i--:++i<a)&&!1!==n(o[i],i,o););return r}}((function(t,e){return t&&_i(t,e,xi)}));var Ai=tr,Li=function(t,e){var r=[];return Fi(t,(function(t,n,a){e(t,n,a)&&r.push(t)})),r},Si=fi,Mi=be;const Ei=a((function(t,e){return(Mi(t)?Ai:Li)(t,Si(e))}));var Ui=fi,Ii=an,Ri=un;var $i=function(t){return function(e,r,n){var a=Object(e);if(!Ii(e)){var i=Ui(r);e=Ri(e),r=function(t){return i(a[t],t,a)}}var o=t(e,r,n);return o>-1?a[i?e[o]:o]:void 0}},qi=/\s/;var Pi=function(t){for(var e=t.length;e--&&qi.test(t.charAt(e)););return e},zi=/^\s+/;var Bi=function(t){return t?t.slice(0,Pi(t)+1).replace(zi,""):t},Ti=w,ki=la,Ci=/^[-+]0x[0-9a-f]+$/i,Ni=/^0b[01]+$/i,Di=/^0o[0-7]+$/i,Vi=parseInt;var Wi=function(t){if("number"==typeof t)return t;if(ki(t))return NaN;if(Ti(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ti(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Bi(t);var r=Ni.test(t);return r||Di.test(t)?Vi(t.slice(2),r?2:8):Ci.test(t)?NaN:+t},Gi=1/0;var Hi=function(t){return t?(t=Wi(t))===Gi||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0};var Ji=Gt,Ki=fi,Qi=function(t){var e=Hi(t),r=e%1;return e==e?r?e-r:e:0},Xi=Math.max;const Yi=a($i((function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var a=null==r?0:Qi(r);return a<0&&(a=Xi(n+a,0)),Ji(t,Ki(e),a)})));var Zi=Xr(Object.getPrototypeOf,Object),to=j,eo=Zi,ro=ge,no=Function.prototype,ao=Object.prototype,io=no.toString,oo=ao.hasOwnProperty,so=io.call(Object);const co=a((function(t){if(!ro(t)||"[object Object]"!=to(t))return!1;var e=eo(t);if(null===e)return!0;var r=oo.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&io.call(r)==so}));var uo=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t},lo=V,fo=function(){try{var t=lo(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var ho=function(t,e,r){"__proto__"==e&&fo?fo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r},po=ho,vo=ut,bo=Object.prototype.hasOwnProperty;var yo=function(t,e,r){var n=t[e];bo.call(t,e)&&vo(n,r)&&(void 0!==r||e in t)||po(t,e,r)},go=yo,mo=ho;var jo=function(t,e,r,n){var a=!r;r||(r={});for(var i=-1,o=e.length;++i<o;){var s=e[i],c=n?n(r[s],t[s],s,r,t):void 0;void 0===c&&(c=t[s]),a?mo(r,s,c):go(r,s,c)}return r},wo=jo,_o=un;var xo=function(t,e){return t&&wo(e,_o(e),t)};var Oo=w,Fo=Qr,Ao=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e},Lo=Object.prototype.hasOwnProperty;var So=Jr,Mo=function(t){if(!Oo(t))return Ao(t);var e=Fo(t),r=[];for(var n in t)("constructor"!=n||!e&&Lo.call(t,n))&&r.push(n);return r},Eo=an;var Uo=function(t){return Eo(t)?So(t,!0):Mo(t)},Io=jo,Ro=Uo;var $o=function(t,e){return t&&Io(e,Ro(e),t)},qo={exports:{}};!function(t,e){var r=c,n=e&&!e.nodeType&&e,a=n&&t&&!t.nodeType&&t,i=a&&a.exports===n?r.Buffer:void 0,o=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=o?o(r):new t.constructor(r);return t.copy(n),n}}(qo,qo.exports);var Po=qo.exports;var zo=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e},Bo=jo,To=or;var ko=function(t,e){return Bo(t,To(t),e)},Co=Qe,No=Zi,Do=or,Vo=er,Wo=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Co(e,Do(t)),t=No(t);return e}:Vo,Go=jo,Ho=Wo;var Jo=function(t,e){return Go(t,Ho(t),e)},Ko=Ze,Qo=Wo,Xo=Uo;var Yo=function(t){return Ko(t,Xo,Qo)},Zo=Object.prototype.hasOwnProperty;var ts=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Zo.call(t,"index")&&(r.index=t.index,r.input=t.input),r},es=Ce;var rs=function(t){var e=new t.constructor(t.byteLength);return new es(e).set(new es(t)),e},ns=rs;var as=function(t,e){var r=e?ns(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)},is=/\w*$/;var os=function(t){var e=new t.constructor(t.source,is.exec(t));return e.lastIndex=t.lastIndex,e},ss=u?u.prototype:void 0,cs=ss?ss.valueOf:void 0;var us=rs;var ls=rs,fs=as,hs=os,ps=function(t){return cs?Object(cs.call(t)):{}},vs=function(t,e){var r=e?us(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)};var ds=function(t,e,r){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return ls(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return fs(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return vs(t,r);case"[object Map]":case"[object Set]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return hs(t);case"[object Symbol]":return ps(t)}},bs=w,ys=Object.create,gs=function(){function t(){}return function(e){if(!bs(e))return{};if(ys)return ys(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),ms=Zi,js=Qr;var ws=function(t){return"function"!=typeof t.constructor||js(t)?{}:gs(ms(t))},_s=qn,xs=ge;var Os=function(t){return xs(t)&&"[object Map]"==_s(t)},Fs=$r,As=Pr&&Pr.isMap,Ls=As?Fs(As):Os,Ss=qn,Ms=ge;var Es=function(t){return Ms(t)&&"[object Set]"==Ss(t)},Us=$r,Is=Pr&&Pr.isSet,Rs=Is?Us(Is):Es,$s=Pe,qs=uo,Ps=yo,zs=xo,Bs=$o,Ts=Po,ks=zo,Cs=ko,Ns=Jo,Ds=pn,Vs=Yo,Ws=qn,Gs=ts,Hs=ds,Js=ws,Ks=be,Qs=Fr,Xs=Ls,Ys=w,Zs=Rs,tc=un,ec=Uo,rc="[object Arguments]",nc="[object Function]",ac="[object Object]",ic={};ic[rc]=ic["[object Array]"]=ic["[object ArrayBuffer]"]=ic["[object DataView]"]=ic["[object Boolean]"]=ic["[object Date]"]=ic["[object Float32Array]"]=ic["[object Float64Array]"]=ic["[object Int8Array]"]=ic["[object Int16Array]"]=ic["[object Int32Array]"]=ic["[object Map]"]=ic["[object Number]"]=ic[ac]=ic["[object RegExp]"]=ic["[object Set]"]=ic["[object String]"]=ic["[object Symbol]"]=ic["[object Uint8Array]"]=ic["[object Uint8ClampedArray]"]=ic["[object Uint16Array]"]=ic["[object Uint32Array]"]=!0,ic["[object Error]"]=ic[nc]=ic["[object WeakMap]"]=!1;var oc=function t(e,r,n,a,i,o){var s,c=1&r,u=2&r,l=4&r;if(n&&(s=i?n(e,a,i,o):n(e)),void 0!==s)return s;if(!Ys(e))return e;var f=Ks(e);if(f){if(s=Gs(e),!c)return ks(e,s)}else{var h=Ws(e),p=h==nc||"[object GeneratorFunction]"==h;if(Qs(e))return Ts(e,c);if(h==ac||h==rc||p&&!i){if(s=u||p?{}:Js(e),!c)return u?Ns(e,Bs(s,e)):Cs(e,zs(s,e))}else{if(!ic[h])return i?e:{};s=Hs(e,h,c)}}o||(o=new $s);var v=o.get(e);if(v)return v;o.set(e,s),Zs(e)?e.forEach((function(a){s.add(t(a,r,n,a,e,o))})):Xs(e)&&e.forEach((function(a,i){s.set(i,t(a,r,n,i,e,o))}));var d=f?void 0:(l?u?Vs:Ds:u?ec:tc)(e);return qs(d||e,(function(a,i){d&&(a=e[i=a]),Ps(s,i,t(a,r,n,i,e,o))})),s},sc=oc,cc=sa;const uc=a((function(t){return cc(sc(t,1))})),lc=class t extends xe{constructor(){super(...arguments),e(this,"list",(()=>t.transformFiles(this.context.metafile.data.files))),e(this,"filter",(e=>{if(!e)throw new Error('Invalid param: missing required "options" parameter.');if(!F(e)&&!co(e))throw new Error('Invalid param: "options" must be function or object.');const r=t.transformFiles(this.context.metafile.data.files);return F(e)?r.filter(e):Ei(r,uc(e))})),e(this,"find",(e=>{if(!e)throw new Error('Invalid param: missing required "options" parameter.');if(!F(e)&&!co(e))throw new Error('Invalid param: "options" must be function or object.');const r=t.transformFiles(this.context.metafile.data.files);return F(e)?r.find(e):Yi(r,uc(e))})),e(this,"first",(()=>{if(0===this.context.metafile.data.files.length)throw new Error("File is missing in downloaded metafile.");return t.transformFiles(this.context.metafile.data.files)[0]}))}};e(lc,"transformFiles",(t=>t.map((t=>t.toCdnFile()))));let fc=lc;class hc extends xe{constructor(t){super(t),e(this,"files"),e(this,"locales",(t=>{const{excludeBaseLocale:e}=t||{},{locales:r}=this.context.metafile.data;return e?r.filter((t=>!t.isBaseLocale)):r})),e(this,"refresh",(async()=>{const t=await this.context.api.fetchMetafile();this.context.metafile.setMetafile(t)})),e(this,"switch",(async t=>{this.context.metafile.params=new gi(t.metafile),await this.refresh()})),this.files=new fc(t)}get projectUrl(){return this.context.metafile.data.projectUrl}get baseLocale(){return this.context.metafile.data.baseLocale}get url(){return this.context.metafile.params.url}}const pc=a((function(t){return void 0===t}));class vc{constructor(t){e(this,"data"),e(this,"context"),this.context=t.context,this.data=t.data||{}}}class dc{constructor(t){e(this,"files"),e(this,"localesMap"),e(this,"hasSingleFileResponse"),e(this,"hasSingleLocaleResponse"),e(this,"context"),this.files=[],this.localesMap=new vc({context:t}),this.hasSingleFileResponse=!1,this.hasSingleLocaleResponse=!1,this.context=t}async execute(){const t=this.getPromises(),e=t.map((t=>t[0])),r=t.map((t=>t[1])),n=await Promise.all(e);return this.context.responseFactory.createCdnResponse({requests:r,responses:n,localesMap:this.localesMap,hasSingleFileResponse:this.hasSingleFileResponse,hasSingleLocaleResponse:this.hasSingleLocaleResponse})}getPromises(){return this.files.reduce(((t,e)=>(this.localesMap.data[e.id]&&t.push(...this.localesMap.data[e.id].map((t=>{const r={metafileFile:e,metafileLocale:t};return[this.context.api.fetchLocale(r),r]}))),t)),[])}}class bc{constructor(t){e(this,"context"),e(this,"request"),this.context=t,this.request=new dc(this.context)}addFiles(t){if(!(co(t)||_e(t)||pc(t)||ye(t)))throw new Error('Invalid param: "request.files" must be object, array, string or undefined.');if(ye(t)&&t.forEach((t=>{if(!co(t)&&!_e(t))throw new Error('Invalid param: array "request.files" must contain objects or strings.')})),_e(t)){this.request.hasSingleFileResponse=!0;const e=this.context.metafile.data.files.find((e=>e.id===t));if(!(e instanceof bi))throw new Error(`File not found: "${t}".`);this.request.files=[e]}else if(pc(t))this.request.files=[...this.context.metafile.data.files];else if(ye(t))this.request.files=t.map((t=>{let e;if(_e(t)){const r=this.context.metafile.data.files.find((e=>e.id===t));if(pc(r))throw new Error(`File not found: "${t}".`);e=r}else{const r=this.context.metafile.data.files.find((e=>e.id===t.id));if(pc(r))throw new Error(`File not found: "${t.id}".`);e=r}return e}));else if(co(t)){this.request.hasSingleFileResponse=!0;const e=this.context.metafile.data.files.find((e=>e.id===t.id));if(pc(e))throw new Error(`File not found: "${t.id}".`);this.request.files=[e]}return this}addLocales(t,e){if(!(_e(t)||pc(t)||ye(t)))throw new Error('Invalid param: "request.locales" must be array, string or undefined.');return ye(t)&&t.forEach((t=>{if(!_e(t))throw new Error('Invalid param: array "request.locales" must contain strings.')})),_e(t)?(this.request.hasSingleLocaleResponse=!0,this.request.files.reduce(((e,r)=>(e.data[r.id]=r.locales.filter((e=>e.locale===t)),e)),this.request.localesMap)):pc(t)?this.request.files.reduce(((t,r)=>(t.data[r.id]=e?r.locales.filter((t=>!t.isBaseLocale)):r.locales,t)),this.request.localesMap):ye(t)&&this.request.files.reduce(((e,r)=>(e.data[r.id]=r.locales.filter((e=>t.includes(e.locale))),e)),this.request.localesMap),this}getCdnRequest(){const t=this.request;return this.request=new dc(this.context),t}}class yc{constructor(t){e(this,"baseUrl"),this.baseUrl=t}async get(t){const e=await fetch(`${this.baseUrl}${t}`),r=e.headers.get("content-type")||"",n=["application/json5","application/json"].includes(r);if(e.status>=400)throw new Error(`Request failed with status code ${e.status}`);let a="";if(n)try{a=await e.json()}catch(t){a={}}else try{a=await e.text()}catch(t){a=""}return a}}class gc{constructor(t){e(this,"metafile"),e(this,"cache"),e(this,"context"),e(this,"fetch",(async t=>{const{files:e,locales:r,excludeBaseLocale:n}=t||{};return new bc(this.context).addFiles(e).addLocales(r,n).getCdnRequest().execute()}));const r=new mi(t),n=new yc(r.params.baseUrl);this.context=new wi({metafileContext:r,cdn:this,client:n}),this.metafile=new hc(this.context),this.cache=new Oe(this.context)}static async create(t){if(!t)throw new Error('Invalid param: missing required "options" parameter.');if(!_e(t.metafile))throw new Error('Invalid param: "options.metafile" must be string.');const e=new gc(t);return await e.metafile.refresh(),e}}export{r as Api,xe as CdnBase,Oe as CdnCache,gc as CdnClient,hc as CdnMetafile,fc as CdnMetafileFiles,wi as Context,yc as FetchHttpAdapter,de as LocalesCache,vc as LocalesMap,ve as MemoryCacheAdapter,mi as MetafileContext,yi as MetafileData,bi as MetafileFile,di as MetafileLocale,gi as MetafileParams,dc as Request,bc as RequestBuilder,ji as ResponseFactory};
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
6
  return value;
7
7
  };
8
- /* @localazy/cdn-client@1.2.0
8
+ /* @localazy/cdn-client@1.2.1
9
9
  * (c) 2024 Localazy <team@localazy.com>
10
10
  * @license MIT */
11
11
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
@@ -1,5 +1,5 @@
1
1
  "use strict";var t=Object.defineProperty,e=(e,r,n)=>(((e,r,n)=>{r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n})(e,"symbol"!=typeof r?r+"":r,n),n);
2
- /* @localazy/cdn-client@1.2.0
2
+ /* @localazy/cdn-client@1.2.1
3
3
  * (c) 2024 Localazy <team@localazy.com>
4
4
  * @license MIT */
5
5
  Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("isomorphic-fetch");class r{constructor(t){e(this,"context"),this.context=t}async fetchLocale(t){return this.context.cache.has(t)?new Promise((e=>{e(this.context.cache.get(t))})):this.context.client.get(t.metafileLocale.uri)}async fetchMetafile(){return await this.context.client.get(this.context.metafile.params.jsonPath)}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i="object"==typeof n&&n&&n.Object===Object&&n,o=i,s="object"==typeof self&&self&&self.Object===Object&&self,c=o||s||Function("return this")(),u=c.Symbol,l=u,f=Object.prototype,h=f.hasOwnProperty,p=f.toString,v=l?l.toStringTag:void 0;var d=function(t){var e=h.call(t,v),r=t[v];try{t[v]=void 0;var n=!0}catch(t){}var a=p.call(t);return n&&(e?t[v]=r:delete t[v]),a},b=Object.prototype.toString;var y=d,g=function(t){return b.call(t)},m=u?u.toStringTag:void 0;var j=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":m&&m in Object(t)?y(t):g(t)};var w=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},_=j,x=w;var O=function(t){if(!x(t))return!1;var e=_(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const F=a(O);var A,M=c["__core-js_shared__"],L=(A=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var S=function(t){return!!L&&L in t},E=Function.prototype.toString;var R=function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""},U=O,q=S,I=w,P=R,$=/^\[object .+?Constructor\]$/,z=Function.prototype,C=Object.prototype,B=z.toString,T=C.hasOwnProperty,k=RegExp("^"+B.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var D=function(t){return!(!I(t)||q(t))&&(U(t)?k:$).test(P(t))},N=function(t,e){return null==t?void 0:t[e]};var V=function(t,e){var r=N(t,e);return D(r)?r:void 0},W=V(Object,"create"),G=W;var H=function(){this.__data__=G?G(null):{},this.size=0};var J=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},K=W,Q=Object.prototype.hasOwnProperty;var X=function(t){var e=this.__data__;if(K){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Q.call(e,t)?e[t]:void 0},Y=W,Z=Object.prototype.hasOwnProperty;var tt=W;var et=H,rt=J,nt=X,at=function(t){var e=this.__data__;return Y?void 0!==e[t]:Z.call(e,t)},it=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=tt&&void 0===e?"__lodash_hash_undefined__":e,this};function ot(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ot.prototype.clear=et,ot.prototype.delete=rt,ot.prototype.get=nt,ot.prototype.has=at,ot.prototype.set=it;var st=ot;var ct=function(){this.__data__=[],this.size=0};var ut=function(t,e){return t===e||t!=t&&e!=e},lt=ut;var ft=function(t,e){for(var r=t.length;r--;)if(lt(t[r][0],e))return r;return-1},ht=ft,pt=Array.prototype.splice;var vt=ft;var dt=ft;var bt=ft;var yt=ct,gt=function(t){var e=this.__data__,r=ht(e,t);return!(r<0)&&(r==e.length-1?e.pop():pt.call(e,r,1),--this.size,!0)},mt=function(t){var e=this.__data__,r=vt(e,t);return r<0?void 0:e[r][1]},jt=function(t){return dt(this.__data__,t)>-1},wt=function(t,e){var r=this.__data__,n=bt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function _t(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_t.prototype.clear=yt,_t.prototype.delete=gt,_t.prototype.get=mt,_t.prototype.has=jt,_t.prototype.set=wt;var xt=_t,Ot=V(c,"Map"),Ft=st,At=xt,Mt=Ot;var Lt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var St=function(t,e){var r=t.__data__;return Lt(e)?r["string"==typeof e?"string":"hash"]:r.map},Et=St;var Rt=St;var Ut=St;var qt=St;var It=function(){this.size=0,this.__data__={hash:new Ft,map:new(Mt||At),string:new Ft}},Pt=function(t){var e=Et(this,t).delete(t);return this.size-=e?1:0,e},$t=function(t){return Rt(this,t).get(t)},zt=function(t){return Ut(this,t).has(t)},Ct=function(t,e){var r=qt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Bt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Bt.prototype.clear=It,Bt.prototype.delete=Pt,Bt.prototype.get=$t,Bt.prototype.has=zt,Bt.prototype.set=Ct;var Tt=Bt;var kt=Tt,Dt=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Nt=function(t){return this.__data__.has(t)};function Vt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new kt;++e<r;)this.add(t[e])}Vt.prototype.add=Vt.prototype.push=Dt,Vt.prototype.has=Nt;var Wt=Vt;var Gt=function(t,e,r,n){for(var a=t.length,i=r+(n?1:-1);n?i--:++i<a;)if(e(t[i],i,t))return i;return-1};var Ht=Gt,Jt=function(t){return t!=t},Kt=function(t,e,r){for(var n=r-1,a=t.length;++n<a;)if(t[n]===e)return n;return-1};var Qt=function(t,e,r){return e==e?Kt(t,e,r):Ht(t,Jt,r)};var Xt=function(t,e){return!!(null==t?0:t.length)&&Qt(t,e,0)>-1};var Yt=function(t,e,r){for(var n=-1,a=null==t?0:t.length;++n<a;)if(r(e,t[n]))return!0;return!1};var Zt=function(t,e){return t.has(e)},te=V(c,"Set");var ee=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},re=te,ne=function(){},ae=re&&1/ee(new re([,-0]))[1]==1/0?function(t){return new re(t)}:ne,ie=Wt,oe=Xt,se=Yt,ce=Zt,ue=ae,le=ee;var fe=function(t,e,r){var n=-1,a=oe,i=t.length,o=!0,s=[],c=s;if(r)o=!1,a=se;else if(i>=200){var u=e?null:ue(t);if(u)return le(u);o=!1,a=ce,c=new ie}else c=e?[]:s;t:for(;++n<i;){var l=t[n],f=e?e(l):l;if(l=r||0!==l?l:0,o&&f==f){for(var h=c.length;h--;)if(c[h]===f)continue t;e&&c.push(f),s.push(l)}else a(c,f,r)||(c!==s&&c.push(f),s.push(l))}return s},he=fe;const pe=a((function(t){return t&&t.length?he(t):[]}));class ve{constructor(){e(this,"map"),this.map=new Map}get(t){return this.map.get(t)}has(t){return this.map.has(t)}set(t,e){this.map.set(t,e)}flush(){this.map=new Map}}class de{constructor(t){e(this,"context"),e(this,"cacheAdapter"),this.context=t,this.cacheAdapter=new ve}setIfMissed(t){const{metafileFile:e,metafileLocale:r,data:n}=t,a=this.keyFromMetafile({metafileFile:e,metafileLocale:r});this.cacheAdapter.has(a)||this.cacheAdapter.set(a,n)}has(t){const e=this.keyFromMetafile(t);return this.cacheAdapter.has(e)}get(t){const e=this.keyFromMetafile(t);return this.cacheAdapter.get(e)}flush(){this.cacheAdapter.flush()}keyFromMetafile(t){const{metafileFile:e,metafileLocale:r}=t,n=[...pe(e.productFlavors)].sort().join("-");return[this.context.metafile.params.cdnId,e.id,e.file,e.path,e.library,e.module,e.buildType,n,r.locale,r.timestamp.toString()].filter((t=>""!==t)).join("-")}}var be=Array.isArray;const ye=a(be);var ge=function(t){return null!=t&&"object"==typeof t},me=j,je=be,we=ge;const _e=a((function(t){return"string"==typeof t||!je(t)&&we(t)&&"[object String]"==me(t)}));class xe{constructor(t){e(this,"context"),this.context=t}}class Oe extends xe{constructor(){super(...arguments),e(this,"flush",(()=>{this.context.cache.flush()}))}}var Fe=xt;var Ae=xt,Me=Ot,Le=Tt;var Se=xt,Ee=function(){this.__data__=new Fe,this.size=0},Re=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Ue=function(t){return this.__data__.get(t)},qe=function(t){return this.__data__.has(t)},Ie=function(t,e){var r=this.__data__;if(r instanceof Ae){var n=r.__data__;if(!Me||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Le(n)}return r.set(t,e),this.size=r.size,this};function Pe(t){var e=this.__data__=new Se(t);this.size=e.size}Pe.prototype.clear=Ee,Pe.prototype.delete=Re,Pe.prototype.get=Ue,Pe.prototype.has=qe,Pe.prototype.set=Ie;var $e=Pe;var ze=Wt,Ce=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1},Be=Zt;var Te=function(t,e,r,n,a,i){var o=1&r,s=t.length,c=e.length;if(s!=c&&!(o&&c>s))return!1;var u=i.get(t),l=i.get(e);if(u&&l)return u==e&&l==t;var f=-1,h=!0,p=2&r?new ze:void 0;for(i.set(t,e),i.set(e,t);++f<s;){var v=t[f],d=e[f];if(n)var b=o?n(d,v,f,e,t,i):n(v,d,f,t,e,i);if(void 0!==b){if(b)continue;h=!1;break}if(p){if(!Ce(e,(function(t,e){if(!Be(p,e)&&(v===t||a(v,t,r,n,i)))return p.push(e)}))){h=!1;break}}else if(v!==d&&!a(v,d,r,n,i)){h=!1;break}}return i.delete(t),i.delete(e),h},ke=c.Uint8Array;var De=ke,Ne=ut,Ve=Te,We=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r},Ge=ee,He=u?u.prototype:void 0,Je=He?He.valueOf:void 0;var Ke=function(t,e,r,n,a,i,o){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new De(t),new De(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ne(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=We;case"[object Set]":var c=1&n;if(s||(s=Ge),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;n|=2,o.set(t,e);var l=Ve(s(t),s(e),n,a,i,o);return o.delete(t),l;case"[object Symbol]":if(Je)return Je.call(t)==Je.call(e)}return!1};var Qe=function(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t},Xe=Qe,Ye=be;var Ze=function(t,e,r){var n=e(t);return Ye(t)?n:Xe(n,r(t))};var tr=function(t,e){for(var r=-1,n=null==t?0:t.length,a=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[a++]=o)}return i};var er=function(){return[]},rr=tr,nr=er,ar=Object.prototype.propertyIsEnumerable,ir=Object.getOwnPropertySymbols,or=ir?function(t){return null==t?[]:(t=Object(t),rr(ir(t),(function(e){return ar.call(t,e)})))}:nr;var sr=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n},cr=j,ur=ge;var lr,fr,hr,pr,vr,dr,br,yr,gr=function(t){return ur(t)&&"[object Arguments]"==cr(t)},mr=ge,jr=Object.prototype,wr=jr.hasOwnProperty,_r=jr.propertyIsEnumerable,xr=gr(function(){return arguments}())?gr:function(t){return mr(t)&&wr.call(t,"callee")&&!_r.call(t,"callee")},Or={exports:{}};lr=Or,hr=c,pr=function(){return!1},vr=(fr=Or.exports)&&!fr.nodeType&&fr,dr=vr&&lr&&!lr.nodeType&&lr,br=dr&&dr.exports===vr?hr.Buffer:void 0,yr=(br?br.isBuffer:void 0)||pr,lr.exports=yr;var Fr=Or.exports,Ar=/^(?:0|[1-9]\d*)$/;var Mr=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Ar.test(t))&&t>-1&&t%1==0&&t<e};var Lr=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Sr=j,Er=Lr,Rr=ge,Ur={};Ur["[object Float32Array]"]=Ur["[object Float64Array]"]=Ur["[object Int8Array]"]=Ur["[object Int16Array]"]=Ur["[object Int32Array]"]=Ur["[object Uint8Array]"]=Ur["[object Uint8ClampedArray]"]=Ur["[object Uint16Array]"]=Ur["[object Uint32Array]"]=!0,Ur["[object Arguments]"]=Ur["[object Array]"]=Ur["[object ArrayBuffer]"]=Ur["[object Boolean]"]=Ur["[object DataView]"]=Ur["[object Date]"]=Ur["[object Error]"]=Ur["[object Function]"]=Ur["[object Map]"]=Ur["[object Number]"]=Ur["[object Object]"]=Ur["[object RegExp]"]=Ur["[object Set]"]=Ur["[object String]"]=Ur["[object WeakMap]"]=!1;var qr=function(t){return Rr(t)&&Er(t.length)&&!!Ur[Sr(t)]};var Ir=function(t){return function(e){return t(e)}},Pr={exports:{}};!function(t,e){var r=i,n=e&&!e.nodeType&&e,a=n&&t&&!t.nodeType&&t,o=a&&a.exports===n&&r.process,s=function(){try{var t=a&&a.require&&a.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=s}(Pr,Pr.exports);var $r=Pr.exports,zr=qr,Cr=Ir,Br=$r&&$r.isTypedArray,Tr=Br?Cr(Br):zr,kr=sr,Dr=xr,Nr=be,Vr=Fr,Wr=Mr,Gr=Tr,Hr=Object.prototype.hasOwnProperty;var Jr=function(t,e){var r=Nr(t),n=!r&&Dr(t),a=!r&&!n&&Vr(t),i=!r&&!n&&!a&&Gr(t),o=r||n||a||i,s=o?kr(t.length,String):[],c=s.length;for(var u in t)!e&&!Hr.call(t,u)||o&&("length"==u||a&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Wr(u,c))||s.push(u);return s},Kr=Object.prototype;var Qr=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Kr)};var Xr=function(t,e){return function(r){return t(e(r))}},Yr=Xr(Object.keys,Object),Zr=Qr,tn=Yr,en=Object.prototype.hasOwnProperty;var rn=O,nn=Lr;var an=function(t){return null!=t&&nn(t.length)&&!rn(t)},on=Jr,sn=function(t){if(!Zr(t))return tn(t);var e=[];for(var r in Object(t))en.call(t,r)&&"constructor"!=r&&e.push(r);return e},cn=an;var un=function(t){return cn(t)?on(t):sn(t)},ln=Ze,fn=or,hn=un;var pn=function(t){return ln(t,hn,fn)},vn=pn,dn=Object.prototype.hasOwnProperty;var bn=function(t,e,r,n,a,i){var o=1&r,s=vn(t),c=s.length;if(c!=vn(e).length&&!o)return!1;for(var u=c;u--;){var l=s[u];if(!(o?l in e:dn.call(e,l)))return!1}var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var p=!0;i.set(t,e),i.set(e,t);for(var v=o;++u<c;){var d=t[l=s[u]],b=e[l];if(n)var y=o?n(b,d,l,e,t,i):n(d,b,l,t,e,i);if(!(void 0===y?d===b||a(d,b,r,n,i):y)){p=!1;break}v||(v="constructor"==l)}if(p&&!v){var g=t.constructor,m=e.constructor;g==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m||(p=!1)}return i.delete(t),i.delete(e),p},yn=V(c,"DataView"),gn=Ot,mn=V(c,"Promise"),jn=te,wn=V(c,"WeakMap"),_n=j,xn=R,On="[object Map]",Fn="[object Promise]",An="[object Set]",Mn="[object WeakMap]",Ln="[object DataView]",Sn=xn(yn),En=xn(gn),Rn=xn(mn),Un=xn(jn),qn=xn(wn),In=_n;(yn&&In(new yn(new ArrayBuffer(1)))!=Ln||gn&&In(new gn)!=On||mn&&In(mn.resolve())!=Fn||jn&&In(new jn)!=An||wn&&In(new wn)!=Mn)&&(In=function(t){var e=_n(t),r="[object Object]"==e?t.constructor:void 0,n=r?xn(r):"";if(n)switch(n){case Sn:return Ln;case En:return On;case Rn:return Fn;case Un:return An;case qn:return Mn}return e});var Pn=In,$n=$e,zn=Te,Cn=Ke,Bn=bn,Tn=Pn,kn=be,Dn=Fr,Nn=Tr,Vn="[object Arguments]",Wn="[object Array]",Gn="[object Object]",Hn=Object.prototype.hasOwnProperty;var Jn=function(t,e,r,n,a,i){var o=kn(t),s=kn(e),c=o?Wn:Tn(t),u=s?Wn:Tn(e),l=(c=c==Vn?Gn:c)==Gn,f=(u=u==Vn?Gn:u)==Gn,h=c==u;if(h&&Dn(t)){if(!Dn(e))return!1;o=!0,l=!1}if(h&&!l)return i||(i=new $n),o||Nn(t)?zn(t,e,r,n,a,i):Cn(t,e,c,r,n,a,i);if(!(1&r)){var p=l&&Hn.call(t,"__wrapped__"),v=f&&Hn.call(e,"__wrapped__");if(p||v){var d=p?t.value():t,b=v?e.value():e;return i||(i=new $n),a(d,b,r,n,i)}}return!!h&&(i||(i=new $n),Bn(t,e,r,n,a,i))},Kn=ge;var Qn=function t(e,r,n,a,i){return e===r||(null==e||null==r||!Kn(e)&&!Kn(r)?e!=e&&r!=r:Jn(e,r,n,a,t,i))},Xn=$e,Yn=Qn;var Zn=w;var ta=function(t){return t==t&&!Zn(t)},ea=ta,ra=un;var na=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}},aa=function(t,e,r,n){var a=r.length,i=a,o=!n;if(null==t)return!i;for(t=Object(t);a--;){var s=r[a];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){var c=(s=r[a])[0],u=t[c],l=s[1];if(o&&s[2]){if(void 0===u&&!(c in t))return!1}else{var f=new Xn;if(n)var h=n(u,l,c,t,e,f);if(!(void 0===h?Yn(l,u,3,n,f):h))return!1}}return!0},ia=function(t){for(var e=ra(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,ea(a)]}return e},oa=na;var sa=function(t){var e=ia(t);return 1==e.length&&e[0][2]?oa(e[0][0],e[0][1]):function(r){return r===t||aa(r,t,e)}},ca=j,ua=ge;var la=function(t){return"symbol"==typeof t||ua(t)&&"[object Symbol]"==ca(t)},fa=be,ha=la,pa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,va=/^\w*$/;var da=function(t,e){if(fa(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ha(t))||(va.test(t)||!pa.test(t)||null!=e&&t in Object(e))},ba=Tt;function ya(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(ya.Cache||ba),r}ya.Cache=ba;var ga=ya;var ma=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ja=/\\(\\)?/g,wa=function(t){var e=ga(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ma,(function(t,r,n,a){e.push(n?a.replace(ja,"$1"):r||t)})),e}));var _a=function(t,e){for(var r=-1,n=null==t?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a},xa=be,Oa=la,Fa=u?u.prototype:void 0,Aa=Fa?Fa.toString:void 0;var Ma=function t(e){if("string"==typeof e)return e;if(xa(e))return _a(e,t)+"";if(Oa(e))return Aa?Aa.call(e):"";var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r},La=Ma;var Sa=be,Ea=da,Ra=wa,Ua=function(t){return null==t?"":La(t)};var qa=function(t,e){return Sa(t)?t:Ea(t,e)?[t]:Ra(Ua(t))},Ia=la;var Pa=function(t){if("string"==typeof t||Ia(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e},$a=qa,za=Pa;var Ca=function(t,e){for(var r=0,n=(e=$a(e,t)).length;null!=t&&r<n;)t=t[za(e[r++])];return r&&r==n?t:void 0},Ba=Ca;var Ta=qa,ka=xr,Da=be,Na=Mr,Va=Lr,Wa=Pa;var Ga=function(t,e){return null!=t&&e in Object(t)},Ha=function(t,e,r){for(var n=-1,a=(e=Ta(e,t)).length,i=!1;++n<a;){var o=Wa(e[n]);if(!(i=null!=t&&r(t,o)))break;t=t[o]}return i||++n!=a?i:!!(a=null==t?0:t.length)&&Va(a)&&Na(o,a)&&(Da(t)||ka(t))};var Ja=Qn,Ka=function(t,e,r){var n=null==t?void 0:Ba(t,e);return void 0===n?r:n},Qa=function(t,e){return null!=t&&Ha(t,e,Ga)},Xa=da,Ya=ta,Za=na,ti=Pa;var ei=Ca;var ri=function(t){return function(e){return null==e?void 0:e[t]}},ni=function(t){return function(e){return ei(e,t)}},ai=da,ii=Pa;var oi=sa,si=function(t,e){return Xa(t)&&Ya(e)?Za(ti(t),e):function(r){var n=Ka(r,t);return void 0===n&&n===e?Qa(r,t):Ja(e,n,3)}},ci=function(t){return t},ui=be,li=function(t){return ai(t)?ri(ii(t)):ni(t)};var fi=function(t){return"function"==typeof t?t:null==t?ci:"object"==typeof t?ui(t)?si(t[0],t[1]):oi(t):li(t)},hi=fi,pi=fe;const vi=a((function(t,e){return t&&t.length?pi(t,hi(e)):[]}));class di{constructor(t,r){e(this,"language"),e(this,"region"),e(this,"script"),e(this,"isRtl"),e(this,"name"),e(this,"localizedName"),e(this,"uri"),e(this,"timestamp"),e(this,"baseLocale"),this.language=t.language,this.region=t.region,this.script=t.script,this.isRtl=t.isRtl,this.name=t.name,this.localizedName=t.localizedName,this.uri=t.uri,this.timestamp=t.timestamp,this.baseLocale=r}get locale(){return this.language&&this.region&&this.script?`${this.language}_${this.region}#${this.script}`:this.language&&this.script?`${this.language}#${this.script}`:this.language&&this.region?`${this.language}_${this.region}`:this.language}get isBaseLocale(){return this.locale===this.baseLocale}toCdnLocale(){return{locale:this.locale,isBaseLocale:this.isBaseLocale,language:this.language,region:this.region,script:this.script,isRtl:this.isRtl,name:this.name,localizedName:this.localizedName}}}class bi{constructor(t){e(this,"id"),e(this,"file"),e(this,"path"),e(this,"library"),e(this,"module"),e(this,"buildType"),e(this,"timestamp"),e(this,"productFlavors"),e(this,"locales"),e(this,"baseUrl"),this.id=t.id,this.file=t.file,this.path=t.path,this.library=t.library,this.module=t.module,this.buildType=t.buildType,this.timestamp=t.timestamp,this.productFlavors=t.productFlavors,this.locales=t.locales,this.baseUrl=t.baseUrl}toCdnFile(){return{id:this.id,file:this.file,path:this.path,library:this.library,module:this.module,buildType:this.buildType,productFlavors:this.productFlavors,locales:this.locales.map((t=>({locale:t.locale,isBaseLocale:t.isBaseLocale,uri:`${this.baseUrl}${t.uri}`})))}}}class yi{constructor(t,r){e(this,"projectUrl"),e(this,"baseLocale"),e(this,"locales"),e(this,"timestamp"),e(this,"files"),e(this,"filesMap"),this.projectUrl=t.projectUrl,this.timestamp=t.timestamp,this.files=yi.filesFactory(t.files,t.baseLocale,r),this.filesMap=yi.filesMapFactory(this.files),this.locales=yi.localesFactory(this.files),this.baseLocale=this.locales.find((t=>t.isBaseLocale))}static createEmpty(t){return new yi({projectUrl:"",baseLocale:"",timestamp:0,files:{}},t)}static filesFactory(t,e,r){return Object.keys(t).reduce(((n,a)=>{const i=t[a].locales.map((t=>new di(t,e)));return n.push(new bi({...t[a],id:a,locales:i,baseUrl:r.baseUrl})),n}),[])}static filesMapFactory(t){return t.reduce(((t,e)=>(t[e.id]=e,t)),{})}static localesFactory(t){const e=t.reduce(((t,e)=>(t.push(...e.locales.map((t=>t.toCdnLocale()))),t)),[]);return vi(e,(t=>t.locale))}}class gi{constructor(t){e(this,"options"),this.options=gi.parseMetafileUrl(t)}get url(){return this.options.url}get baseUrl(){return this.options.baseUrl}get cdnId(){return this.options.cdnId}get jsonPath(){return this.options.jsonPath}static parseMetafileUrl(t){let e;try{e=new URL(t)}catch(t){throw new Error('Invalid param: "options.metafile" cannot be parsed as url.')}const r=e.pathname.match(/^\/(.*?)\/(.*?)\.(v2.json|js|ts)$/);if(null===r||4!==r.length)throw new Error('Invalid param: "options.metafile" contains invalid metafile url.');const n=r[1],a=r[2];return{url:t,baseUrl:e.origin,cdnId:n,jsonPath:`/${n}/${a}.v2.json`}}}class mi{constructor(t){e(this,"params"),e(this,"parsedData"),e(this,"data"),this.params=new gi(t.metafile),this.parsedData=null,this.data=yi.createEmpty(this.params)}setMetafile(t){this.parsedData=t,this.data=new yi(t,this.params)}}class ji{constructor(t){e(this,"context"),this.context=t}createCdnResponse(t){const{requests:e,responses:r,hasSingleFileResponse:n,hasSingleLocaleResponse:a}=t;return 0===r.length?{}:(this.cacheResponses(e,r),n&&a?r[0]:ji.transformResponses(t))}cacheResponses(t,e){e.forEach(((e,r)=>{const{metafileFile:n,metafileLocale:a}=t[r];n&&a&&this.context.cache.setIfMissed({metafileFile:n,metafileLocale:a,data:e})}))}static transformResponses(t){const{requests:e,responses:r,hasSingleFileResponse:n}=t;return r.reduce(((t,r,a)=>{const{metafileFile:i,metafileLocale:o}=e[a];return i&&o&&(n?t[o.locale]=r:(t[i.id]||(t[i.id]={}),t[i.id][o.locale]=r)),t}),{})}}class wi{constructor(t){e(this,"metafile"),e(this,"cdn"),e(this,"client"),e(this,"api"),e(this,"cache"),e(this,"responseFactory"),this.metafile=t.metafileContext,this.cdn=t.cdn,this.client=t.client,this.api=new r(this),this.cache=new de(this),this.responseFactory=new ji(this)}}var _i=function(t){return function(e,r,n){for(var a=-1,i=Object(e),o=n(e),s=o.length;s--;){var c=o[t?s:++a];if(!1===r(i[c],c,i))break}return e}}(),xi=un;var Oi=an;var Fi=function(t,e){return function(r,n){if(null==r)return r;if(!Oi(r))return t(r,n);for(var a=r.length,i=e?a:-1,o=Object(r);(e?i--:++i<a)&&!1!==n(o[i],i,o););return r}}((function(t,e){return t&&_i(t,e,xi)}));var Ai=tr,Mi=function(t,e){var r=[];return Fi(t,(function(t,n,a){e(t,n,a)&&r.push(t)})),r},Li=fi,Si=be;const Ei=a((function(t,e){return(Si(t)?Ai:Mi)(t,Li(e))}));var Ri=fi,Ui=an,qi=un;var Ii=function(t){return function(e,r,n){var a=Object(e);if(!Ui(e)){var i=Ri(r);e=qi(e),r=function(t){return i(a[t],t,a)}}var o=t(e,r,n);return o>-1?a[i?e[o]:o]:void 0}},Pi=/\s/;var $i=function(t){for(var e=t.length;e--&&Pi.test(t.charAt(e)););return e},zi=/^\s+/;var Ci=function(t){return t?t.slice(0,$i(t)+1).replace(zi,""):t},Bi=w,Ti=la,ki=/^[-+]0x[0-9a-f]+$/i,Di=/^0b[01]+$/i,Ni=/^0o[0-7]+$/i,Vi=parseInt;var Wi=function(t){if("number"==typeof t)return t;if(Ti(t))return NaN;if(Bi(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Bi(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ci(t);var r=Di.test(t);return r||Ni.test(t)?Vi(t.slice(2),r?2:8):ki.test(t)?NaN:+t},Gi=1/0;var Hi=function(t){return t?(t=Wi(t))===Gi||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0};var Ji=Gt,Ki=fi,Qi=function(t){var e=Hi(t),r=e%1;return e==e?r?e-r:e:0},Xi=Math.max;const Yi=a(Ii((function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var a=null==r?0:Qi(r);return a<0&&(a=Xi(n+a,0)),Ji(t,Ki(e),a)})));var Zi=Xr(Object.getPrototypeOf,Object),to=j,eo=Zi,ro=ge,no=Function.prototype,ao=Object.prototype,io=no.toString,oo=ao.hasOwnProperty,so=io.call(Object);const co=a((function(t){if(!ro(t)||"[object Object]"!=to(t))return!1;var e=eo(t);if(null===e)return!0;var r=oo.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&io.call(r)==so}));var uo=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t},lo=V,fo=function(){try{var t=lo(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var ho=function(t,e,r){"__proto__"==e&&fo?fo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r},po=ho,vo=ut,bo=Object.prototype.hasOwnProperty;var yo=function(t,e,r){var n=t[e];bo.call(t,e)&&vo(n,r)&&(void 0!==r||e in t)||po(t,e,r)},go=yo,mo=ho;var jo=function(t,e,r,n){var a=!r;r||(r={});for(var i=-1,o=e.length;++i<o;){var s=e[i],c=n?n(r[s],t[s],s,r,t):void 0;void 0===c&&(c=t[s]),a?mo(r,s,c):go(r,s,c)}return r},wo=jo,_o=un;var xo=function(t,e){return t&&wo(e,_o(e),t)};var Oo=w,Fo=Qr,Ao=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e},Mo=Object.prototype.hasOwnProperty;var Lo=Jr,So=function(t){if(!Oo(t))return Ao(t);var e=Fo(t),r=[];for(var n in t)("constructor"!=n||!e&&Mo.call(t,n))&&r.push(n);return r},Eo=an;var Ro=function(t){return Eo(t)?Lo(t,!0):So(t)},Uo=jo,qo=Ro;var Io=function(t,e){return t&&Uo(e,qo(e),t)},Po={exports:{}};!function(t,e){var r=c,n=e&&!e.nodeType&&e,a=n&&t&&!t.nodeType&&t,i=a&&a.exports===n?r.Buffer:void 0,o=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=o?o(r):new t.constructor(r);return t.copy(n),n}}(Po,Po.exports);var $o=Po.exports;var zo=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e},Co=jo,Bo=or;var To=function(t,e){return Co(t,Bo(t),e)},ko=Qe,Do=Zi,No=or,Vo=er,Wo=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)ko(e,No(t)),t=Do(t);return e}:Vo,Go=jo,Ho=Wo;var Jo=function(t,e){return Go(t,Ho(t),e)},Ko=Ze,Qo=Wo,Xo=Ro;var Yo=function(t){return Ko(t,Xo,Qo)},Zo=Object.prototype.hasOwnProperty;var ts=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Zo.call(t,"index")&&(r.index=t.index,r.input=t.input),r},es=ke;var rs=function(t){var e=new t.constructor(t.byteLength);return new es(e).set(new es(t)),e},ns=rs;var as=function(t,e){var r=e?ns(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)},is=/\w*$/;var os=function(t){var e=new t.constructor(t.source,is.exec(t));return e.lastIndex=t.lastIndex,e},ss=u?u.prototype:void 0,cs=ss?ss.valueOf:void 0;var us=rs;var ls=rs,fs=as,hs=os,ps=function(t){return cs?Object(cs.call(t)):{}},vs=function(t,e){var r=e?us(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)};var ds=function(t,e,r){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return ls(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return fs(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return vs(t,r);case"[object Map]":case"[object Set]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return hs(t);case"[object Symbol]":return ps(t)}},bs=w,ys=Object.create,gs=function(){function t(){}return function(e){if(!bs(e))return{};if(ys)return ys(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),ms=Zi,js=Qr;var ws=function(t){return"function"!=typeof t.constructor||js(t)?{}:gs(ms(t))},_s=Pn,xs=ge;var Os=function(t){return xs(t)&&"[object Map]"==_s(t)},Fs=Ir,As=$r&&$r.isMap,Ms=As?Fs(As):Os,Ls=Pn,Ss=ge;var Es=function(t){return Ss(t)&&"[object Set]"==Ls(t)},Rs=Ir,Us=$r&&$r.isSet,qs=Us?Rs(Us):Es,Is=$e,Ps=uo,$s=yo,zs=xo,Cs=Io,Bs=$o,Ts=zo,ks=To,Ds=Jo,Ns=pn,Vs=Yo,Ws=Pn,Gs=ts,Hs=ds,Js=ws,Ks=be,Qs=Fr,Xs=Ms,Ys=w,Zs=qs,tc=un,ec=Ro,rc="[object Arguments]",nc="[object Function]",ac="[object Object]",ic={};ic[rc]=ic["[object Array]"]=ic["[object ArrayBuffer]"]=ic["[object DataView]"]=ic["[object Boolean]"]=ic["[object Date]"]=ic["[object Float32Array]"]=ic["[object Float64Array]"]=ic["[object Int8Array]"]=ic["[object Int16Array]"]=ic["[object Int32Array]"]=ic["[object Map]"]=ic["[object Number]"]=ic[ac]=ic["[object RegExp]"]=ic["[object Set]"]=ic["[object String]"]=ic["[object Symbol]"]=ic["[object Uint8Array]"]=ic["[object Uint8ClampedArray]"]=ic["[object Uint16Array]"]=ic["[object Uint32Array]"]=!0,ic["[object Error]"]=ic[nc]=ic["[object WeakMap]"]=!1;var oc=function t(e,r,n,a,i,o){var s,c=1&r,u=2&r,l=4&r;if(n&&(s=i?n(e,a,i,o):n(e)),void 0!==s)return s;if(!Ys(e))return e;var f=Ks(e);if(f){if(s=Gs(e),!c)return Ts(e,s)}else{var h=Ws(e),p=h==nc||"[object GeneratorFunction]"==h;if(Qs(e))return Bs(e,c);if(h==ac||h==rc||p&&!i){if(s=u||p?{}:Js(e),!c)return u?Ds(e,Cs(s,e)):ks(e,zs(s,e))}else{if(!ic[h])return i?e:{};s=Hs(e,h,c)}}o||(o=new Is);var v=o.get(e);if(v)return v;o.set(e,s),Zs(e)?e.forEach((function(a){s.add(t(a,r,n,a,e,o))})):Xs(e)&&e.forEach((function(a,i){s.set(i,t(a,r,n,i,e,o))}));var d=f?void 0:(l?u?Vs:Ns:u?ec:tc)(e);return Ps(d||e,(function(a,i){d&&(a=e[i=a]),$s(s,i,t(a,r,n,i,e,o))})),s},sc=oc,cc=sa;const uc=a((function(t){return cc(sc(t,1))})),lc=class t extends xe{constructor(){super(...arguments),e(this,"list",(()=>t.transformFiles(this.context.metafile.data.files))),e(this,"filter",(e=>{if(!e)throw new Error('Invalid param: missing required "options" parameter.');if(!F(e)&&!co(e))throw new Error('Invalid param: "options" must be function or object.');const r=t.transformFiles(this.context.metafile.data.files);return F(e)?r.filter(e):Ei(r,uc(e))})),e(this,"find",(e=>{if(!e)throw new Error('Invalid param: missing required "options" parameter.');if(!F(e)&&!co(e))throw new Error('Invalid param: "options" must be function or object.');const r=t.transformFiles(this.context.metafile.data.files);return F(e)?r.find(e):Yi(r,uc(e))})),e(this,"first",(()=>{if(0===this.context.metafile.data.files.length)throw new Error("File is missing in downloaded metafile.");return t.transformFiles(this.context.metafile.data.files)[0]}))}};e(lc,"transformFiles",(t=>t.map((t=>t.toCdnFile()))));let fc=lc;class hc extends xe{constructor(t){super(t),e(this,"files"),e(this,"locales",(t=>{const{excludeBaseLocale:e}=t||{},{locales:r}=this.context.metafile.data;return e?r.filter((t=>!t.isBaseLocale)):r})),e(this,"refresh",(async()=>{const t=await this.context.api.fetchMetafile();this.context.metafile.setMetafile(t)})),e(this,"switch",(async t=>{this.context.metafile.params=new gi(t.metafile),await this.refresh()})),this.files=new fc(t)}get projectUrl(){return this.context.metafile.data.projectUrl}get baseLocale(){return this.context.metafile.data.baseLocale}get url(){return this.context.metafile.params.url}}const pc=a((function(t){return void 0===t}));class vc{constructor(t){e(this,"data"),e(this,"context"),this.context=t.context,this.data=t.data||{}}}class dc{constructor(t){e(this,"files"),e(this,"localesMap"),e(this,"hasSingleFileResponse"),e(this,"hasSingleLocaleResponse"),e(this,"context"),this.files=[],this.localesMap=new vc({context:t}),this.hasSingleFileResponse=!1,this.hasSingleLocaleResponse=!1,this.context=t}async execute(){const t=this.getPromises(),e=t.map((t=>t[0])),r=t.map((t=>t[1])),n=await Promise.all(e);return this.context.responseFactory.createCdnResponse({requests:r,responses:n,localesMap:this.localesMap,hasSingleFileResponse:this.hasSingleFileResponse,hasSingleLocaleResponse:this.hasSingleLocaleResponse})}getPromises(){return this.files.reduce(((t,e)=>(this.localesMap.data[e.id]&&t.push(...this.localesMap.data[e.id].map((t=>{const r={metafileFile:e,metafileLocale:t};return[this.context.api.fetchLocale(r),r]}))),t)),[])}}class bc{constructor(t){e(this,"context"),e(this,"request"),this.context=t,this.request=new dc(this.context)}addFiles(t){if(!(co(t)||_e(t)||pc(t)||ye(t)))throw new Error('Invalid param: "request.files" must be object, array, string or undefined.');if(ye(t)&&t.forEach((t=>{if(!co(t)&&!_e(t))throw new Error('Invalid param: array "request.files" must contain objects or strings.')})),_e(t)){this.request.hasSingleFileResponse=!0;const e=this.context.metafile.data.files.find((e=>e.id===t));if(!(e instanceof bi))throw new Error(`File not found: "${t}".`);this.request.files=[e]}else if(pc(t))this.request.files=[...this.context.metafile.data.files];else if(ye(t))this.request.files=t.map((t=>{let e;if(_e(t)){const r=this.context.metafile.data.files.find((e=>e.id===t));if(pc(r))throw new Error(`File not found: "${t}".`);e=r}else{const r=this.context.metafile.data.files.find((e=>e.id===t.id));if(pc(r))throw new Error(`File not found: "${t.id}".`);e=r}return e}));else if(co(t)){this.request.hasSingleFileResponse=!0;const e=this.context.metafile.data.files.find((e=>e.id===t.id));if(pc(e))throw new Error(`File not found: "${t.id}".`);this.request.files=[e]}return this}addLocales(t,e){if(!(_e(t)||pc(t)||ye(t)))throw new Error('Invalid param: "request.locales" must be array, string or undefined.');return ye(t)&&t.forEach((t=>{if(!_e(t))throw new Error('Invalid param: array "request.locales" must contain strings.')})),_e(t)?(this.request.hasSingleLocaleResponse=!0,this.request.files.reduce(((e,r)=>(e.data[r.id]=r.locales.filter((e=>e.locale===t)),e)),this.request.localesMap)):pc(t)?this.request.files.reduce(((t,r)=>(t.data[r.id]=e?r.locales.filter((t=>!t.isBaseLocale)):r.locales,t)),this.request.localesMap):ye(t)&&this.request.files.reduce(((e,r)=>(e.data[r.id]=r.locales.filter((e=>t.includes(e.locale))),e)),this.request.localesMap),this}getCdnRequest(){const t=this.request;return this.request=new dc(this.context),t}}class yc{constructor(t){e(this,"baseUrl"),this.baseUrl=t}async get(t){const e=await fetch(`${this.baseUrl}${t}`),r=e.headers.get("content-type")||"",n=["application/json5","application/json"].includes(r);if(e.status>=400)throw new Error(`Request failed with status code ${e.status}`);let a="";if(n)try{a=await e.json()}catch(t){a={}}else try{a=await e.text()}catch(t){a=""}return a}}class gc{constructor(t){e(this,"metafile"),e(this,"cache"),e(this,"context"),e(this,"fetch",(async t=>{const{files:e,locales:r,excludeBaseLocale:n}=t||{};return new bc(this.context).addFiles(e).addLocales(r,n).getCdnRequest().execute()}));const r=new mi(t),n=new yc(r.params.baseUrl);this.context=new wi({metafileContext:r,cdn:this,client:n}),this.metafile=new hc(this.context),this.cache=new Oe(this.context)}static async create(t){if(!t)throw new Error('Invalid param: missing required "options" parameter.');if(!_e(t.metafile))throw new Error('Invalid param: "options.metafile" must be string.');const e=new gc(t);return await e.metafile.refresh(),e}}exports.Api=r,exports.CdnBase=xe,exports.CdnCache=Oe,exports.CdnClient=gc,exports.CdnMetafile=hc,exports.CdnMetafileFiles=fc,exports.Context=wi,exports.FetchHttpAdapter=yc,exports.LocalesCache=de,exports.LocalesMap=vc,exports.MemoryCacheAdapter=ve,exports.MetafileContext=mi,exports.MetafileData=yi,exports.MetafileFile=bi,exports.MetafileLocale=di,exports.MetafileParams=gi,exports.Request=dc,exports.RequestBuilder=bc,exports.ResponseFactory=ji;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@localazy/cdn-client",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Node.js module that allows you to easily interact with the Localazy CDN.",
5
5
  "author": "Localazy <team@localazy.com>",
6
6
  "license": "MIT",
@@ -27,10 +27,10 @@
27
27
  "g11n"
28
28
  ],
29
29
  "type": "module",
30
- "main": "./dist/node/localazy-cdn.cjs",
31
- "module": "./dist/localazy-cdn.js",
32
- "unpkg": "./dist/browser/localazy-cdn.umd.min.js",
33
- "jsdelivr": "./dist/browser/localazy-cdn.umd.min.js",
30
+ "main": "./dist/node/localazy-cdn-client.cjs",
31
+ "module": "./dist/localazy-cdn-client.js",
32
+ "unpkg": "./dist/browser/localazy-cdn-client.umd.min.js",
33
+ "jsdelivr": "./dist/browser/localazy-cdn-client.umd.min.js",
34
34
  "types": "./dist/index.d.ts",
35
35
  "exports": {
36
36
  ".": {
@@ -38,11 +38,11 @@
38
38
  "default": "./dist/index.d.ts"
39
39
  },
40
40
  "browser": {
41
- "default": "./dist/browser/localazy-cdn.umd.min.js"
41
+ "default": "./dist/browser/localazy-cdn-client.umd.min.js"
42
42
  },
43
43
  "default": {
44
- "require": "./dist/node/localazy-cdn.cjs",
45
- "default": "./dist/localazy-cdn.js"
44
+ "require": "./dist/node/localazy-cdn-client.cjs",
45
+ "default": "./dist/localazy-cdn-client.js"
46
46
  }
47
47
  }
48
48
  },