zmp-sdk 2.11.10 → 2.11.11

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.
package/dist/index.js CHANGED
@@ -15,4 +15,4 @@ PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
16
  function gt(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function vt(t,e){return function(n,r){e(n,r,t)}}function _t(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function mt(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function yt(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}var wt=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}},bt=Object.prototype.toString;function kt(t){return"[object Array]"===bt.call(t)}function Et(t){return void 0===t}function At(t){return null!==t&&"object"==typeof t}function St(t){if("[object Object]"!==bt.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function Ct(t){return"[object Function]"===bt.call(t)}function xt(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),kt(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}var Tt={isArray:kt,isArrayBuffer:function(t){return"[object ArrayBuffer]"===bt.call(t)},isBuffer:function(t){return null!==t&&!Et(t)&&null!==t.constructor&&!Et(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:At,isPlainObject:St,isUndefined:Et,isDate:function(t){return"[object Date]"===bt.call(t)},isFile:function(t){return"[object File]"===bt.call(t)},isBlob:function(t){return"[object Blob]"===bt.call(t)},isFunction:Ct,isStream:function(t){return At(t)&&Ct(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:xt,merge:function t(){var e={};function n(n,r){St(e[r])&&St(n)?e[r]=t(e[r],n):St(n)?e[r]=t({},n):kt(n)?e[r]=n.slice():e[r]=n}for(var r=0,i=arguments.length;r<i;r++)xt(arguments[r],n);return e},extend:function(t,e,n){return xt(e,(function(e,r){t[r]=n&&"function"==typeof e?wt(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}};function Rt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Ot=function(t,e,n){if(!e)return t;var r;if(n)r=n(e);else if(Tt.isURLSearchParams(e))r=e.toString();else{var i=[];Tt.forEach(e,(function(t,e){null!=t&&(Tt.isArray(t)?e+="[]":t=[t],Tt.forEach(t,(function(t){Tt.isDate(t)?t=t.toISOString():Tt.isObject(t)&&(t=JSON.stringify(t)),i.push(Rt(e)+"="+Rt(t))})))})),r=i.join("&")}if(r){var o=t.indexOf("#");-1!==o&&(t=t.slice(0,o)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t};function It(){this.handlers=[]}It.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},It.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},It.prototype.forEach=function(t){Tt.forEach(this.handlers,(function(e){null!==e&&t(e)}))};var Nt=It,jt=function(t,e,n){return Tt.forEach(n,(function(n){t=n(t,e)})),t},Lt=function(t){return!(!t||!t.__CANCEL__)},Bt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Pt(){throw new Error("setTimeout has not been defined")}function Ut(){throw new Error("clearTimeout has not been defined")}var Mt=Pt,zt=Ut;function Dt(t){if(Mt===setTimeout)return setTimeout(t,0);if((Mt===Pt||!Mt)&&setTimeout)return Mt=setTimeout,setTimeout(t,0);try{return Mt(t,0)}catch(e){try{return Mt.call(null,t,0)}catch(e){return Mt.call(this,t,0)}}}"function"==typeof Bt.setTimeout&&(Mt=setTimeout),"function"==typeof Bt.clearTimeout&&(zt=clearTimeout);var Ft,qt=[],Zt=!1,Wt=-1;function Ht(){Zt&&Ft&&(Zt=!1,Ft.length?qt=Ft.concat(qt):Wt=-1,qt.length&&$t())}function $t(){if(!Zt){var t=Dt(Ht);Zt=!0;for(var e=qt.length;e;){for(Ft=qt,qt=[];++Wt<e;)Ft&&Ft[Wt].run();Wt=-1,e=qt.length}Ft=null,Zt=!1,function(t){if(zt===clearTimeout)return clearTimeout(t);if((zt===Ut||!zt)&&clearTimeout)return zt=clearTimeout,clearTimeout(t);try{zt(t)}catch(e){try{return zt.call(null,t)}catch(e){return zt.call(this,t)}}}(t)}}function Kt(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];qt.push(new Yt(t,e)),1!==qt.length||Zt||Dt($t)}function Yt(t,e){this.fun=t,this.array=e}Yt.prototype.run=function(){this.fun.apply(null,this.array)};function Gt(){}var Jt=Gt,Vt=Gt,Xt=Gt,Qt=Gt,te=Gt,ee=Gt,ne=Gt;var re=Bt.performance||{},ie=re.now||re.mozNow||re.msNow||re.oNow||re.webkitNow||function(){return(new Date).getTime()};var oe=new Date;var ae={nextTick:Kt,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Jt,addListener:Vt,once:Xt,off:Qt,removeListener:te,removeAllListeners:ee,emit:ne,binding:function(t){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(t){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*ie.call(re),n=Math.floor(e),r=Math.floor(e%1*1e9);return t&&(n-=t[0],(r-=t[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-oe)/1e3}},se=function(t,e){Tt.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))},ue=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t},ce=function(t,e,n,r,i){var o=new Error(t);return ue(o,e,n,r,i)},le=function(t,e,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(ce("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)},fe=Tt.isStandardBrowserEnv()?{write:function(t,e,n,r,i,o){var a=[];a.push(t+"="+encodeURIComponent(e)),Tt.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Tt.isString(r)&&a.push("path="+r),Tt.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},he=function(t,e){return t&&!function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e},de=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],pe=Tt.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=r(window.location.href),function(e){var n=Tt.isString(e)?r(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0},ge=function(t){return new Promise((function(e,n){var r=t.data,i=t.headers;Tt.isFormData(r)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(t.auth){var a=t.auth.username||"",s=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(a+":"+s)}var u=he(t.baseURL,t.url);if(o.open(t.method.toUpperCase(),Ot(u,t.params,t.paramsSerializer),!0),o.timeout=t.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var r,i,a,s,u,c="getAllResponseHeaders"in o?(r=o.getAllResponseHeaders(),u={},r?(Tt.forEach(r.split("\n"),(function(t){if(s=t.indexOf(":"),i=Tt.trim(t.substr(0,s)).toLowerCase(),a=Tt.trim(t.substr(s+1)),i){if(u[i]&&de.indexOf(i)>=0)return;u[i]="set-cookie"===i?(u[i]?u[i]:[]).concat([a]):u[i]?u[i]+", "+a:a}})),u):u):null,l={data:t.responseType&&"text"!==t.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:c,config:t,request:o};le(e,n,l),o=null}},o.onabort=function(){o&&(n(ce("Request aborted",t,"ECONNABORTED",o)),o=null)},o.onerror=function(){n(ce("Network Error",t,null,o)),o=null},o.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(ce(e,t,"ECONNABORTED",o)),o=null},Tt.isStandardBrowserEnv()){var c=(t.withCredentials||pe(u))&&t.xsrfCookieName?fe.read(t.xsrfCookieName):void 0;c&&(i[t.xsrfHeaderName]=c)}if("setRequestHeader"in o&&Tt.forEach(i,(function(t,e){void 0===r&&"content-type"===e.toLowerCase()?delete i[e]:o.setRequestHeader(e,t)})),Tt.isUndefined(t.withCredentials)||(o.withCredentials=!!t.withCredentials),t.responseType)try{o.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&o.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){o&&(o.abort(),n(t),o=null)})),r||(r=null),o.send(r)}))},ve=[],_e=[],me="undefined"!=typeof Uint8Array?Uint8Array:Array,ye=!1;function we(){ye=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,n=t.length;e<n;++e)ve[e]=t[e],_e[t.charCodeAt(e)]=e;_e["-".charCodeAt(0)]=62,_e["_".charCodeAt(0)]=63}function be(t,e,n){for(var r,i,o=[],a=e;a<n;a+=3)r=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(ve[(i=r)>>18&63]+ve[i>>12&63]+ve[i>>6&63]+ve[63&i]);return o.join("")}function ke(t){var e;ye||we();for(var n=t.length,r=n%3,i="",o=[],a=16383,s=0,u=n-r;s<u;s+=a)o.push(be(t,s,s+a>u?u:s+a));return 1===r?(e=t[n-1],i+=ve[e>>2],i+=ve[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=ve[e>>10],i+=ve[e>>4&63],i+=ve[e<<2&63],i+="="),o.push(i),o.join("")}function Ee(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?i-1:0,h=n?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)}function Ae(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+d]=255&a,d+=p,a/=256,c-=8);t[n+d-p]|=128*g}var Se={}.toString,Ce=Array.isArray||function(t){return"[object Array]"==Se.call(t)};function xe(){return Re.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Te(t,e){if(xe()<e)throw new RangeError("Invalid typed array length");return Re.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Re.prototype:(null===t&&(t=new Re(e)),t.length=e),t}function Re(t,e,n){if(!(Re.TYPED_ARRAY_SUPPORT||this instanceof Re))return new Re(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return Ne(this,t)}return Oe(this,t,e,n)}function Oe(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);Re.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Re.prototype:t=je(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!Re.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Pe(e,n),i=(t=Te(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(Be(e)){var n=0|Le(e.length);return 0===(t=Te(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?Te(t,0):je(t,e);if("Buffer"===e.type&&Ce(e.data))return je(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function Ie(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ne(t,e){if(Ie(e),t=Te(t,e<0?0:0|Le(e)),!Re.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function je(t,e){var n=e.length<0?0:0|Le(e.length);t=Te(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function Le(t){if(t>=xe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+xe().toString(16)+" bytes");return 0|t}function Be(t){return!(null==t||!t._isBuffer)}function Pe(t,e){if(Be(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return cn(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return ln(t).length;default:if(r)return cn(t).length;e=(""+e).toLowerCase(),r=!0}}function Ue(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Ve(this,e,n);case"utf8":case"utf-8":return Ye(this,e,n);case"ascii":return Ge(this,e,n);case"latin1":case"binary":return Je(this,e,n);case"base64":return Ke(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xe(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function Me(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ze(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=Re.from(e,r)),Be(e))return 0===e.length?-1:De(t,e,n,r,i);if("number"==typeof e)return e&=255,Re.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):De(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function De(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(t,o+h)!==c(e,h)){f=!1;break}if(f)return o}return-1}function Fe(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function qe(t,e,n,r){return fn(cn(e,t.length-n),t,n,r)}function Ze(t,e,n,r){return fn(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function We(t,e,n,r){return Ze(t,e,n,r)}function He(t,e,n,r){return fn(ln(e),t,n,r)}function $e(t,e,n,r){return fn(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=(n=t.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function Ke(t,e,n){return 0===e&&n===t.length?ke(t):ke(t.slice(e,n))}function Ye(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,u,c=t[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}Re.TYPED_ARRAY_SUPPORT=void 0===Bt.TYPED_ARRAY_SUPPORT||Bt.TYPED_ARRAY_SUPPORT,Re.poolSize=8192,Re._augment=function(t){return t.__proto__=Re.prototype,t},Re.from=function(t,e,n){return Oe(null,t,e,n)},Re.TYPED_ARRAY_SUPPORT&&(Re.prototype.__proto__=Uint8Array.prototype,Re.__proto__=Uint8Array),Re.alloc=function(t,e,n){return function(t,e,n,r){return Ie(e),e<=0?Te(t,e):void 0!==n?"string"==typeof r?Te(t,e).fill(n,r):Te(t,e).fill(n):Te(t,e)}(null,t,e,n)},Re.allocUnsafe=function(t){return Ne(null,t)},Re.allocUnsafeSlow=function(t){return Ne(null,t)},Re.isBuffer=hn,Re.compare=function(t,e){if(!Be(t)||!Be(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},Re.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Re.concat=function(t,e){if(!Ce(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Re.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=Re.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!Be(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},Re.byteLength=Pe,Re.prototype._isBuffer=!0,Re.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)Me(this,e,e+1);return this},Re.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)Me(this,e,e+3),Me(this,e+1,e+2);return this},Re.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)Me(this,e,e+7),Me(this,e+1,e+6),Me(this,e+2,e+5),Me(this,e+3,e+4);return this},Re.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Ye(this,0,t):Ue.apply(this,arguments)},Re.prototype.equals=function(t){if(!Be(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Re.compare(this,t)},Re.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},Re.prototype.compare=function(t,e,n,r,i){if(!Be(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=t.slice(e,n),l=0;l<s;++l)if(u[l]!==c[l]){o=u[l],a=c[l];break}return o<a?-1:a<o?1:0},Re.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},Re.prototype.indexOf=function(t,e,n){return ze(this,t,e,n,!0)},Re.prototype.lastIndexOf=function(t,e,n){return ze(this,t,e,n,!1)},Re.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return Fe(this,t,e,n);case"utf8":case"utf-8":return qe(this,t,e,n);case"ascii":return Ze(this,t,e,n);case"latin1":case"binary":return We(this,t,e,n);case"base64":return He(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $e(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Re.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ge(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function Je(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function Ve(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=un(t[o]);return i}function Xe(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Qe(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function tn(t,e,n,r,i,o){if(!Be(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function en(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function nn(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function rn(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function on(t,e,n,r,i){return i||rn(t,0,n,4),Ae(t,e,n,r,23,4),n+4}function an(t,e,n,r,i){return i||rn(t,0,n,8),Ae(t,e,n,r,52,8),n+8}Re.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),Re.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=Re.prototype;else{var i=e-t;n=new Re(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},Re.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||Qe(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},Re.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||Qe(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},Re.prototype.readUInt8=function(t,e){return e||Qe(t,1,this.length),this[t]},Re.prototype.readUInt16LE=function(t,e){return e||Qe(t,2,this.length),this[t]|this[t+1]<<8},Re.prototype.readUInt16BE=function(t,e){return e||Qe(t,2,this.length),this[t]<<8|this[t+1]},Re.prototype.readUInt32LE=function(t,e){return e||Qe(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Re.prototype.readUInt32BE=function(t,e){return e||Qe(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Re.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||Qe(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},Re.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||Qe(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},Re.prototype.readInt8=function(t,e){return e||Qe(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Re.prototype.readInt16LE=function(t,e){e||Qe(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},Re.prototype.readInt16BE=function(t,e){e||Qe(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},Re.prototype.readInt32LE=function(t,e){return e||Qe(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Re.prototype.readInt32BE=function(t,e){return e||Qe(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Re.prototype.readFloatLE=function(t,e){return e||Qe(t,4,this.length),Ee(this,t,!0,23,4)},Re.prototype.readFloatBE=function(t,e){return e||Qe(t,4,this.length),Ee(this,t,!1,23,4)},Re.prototype.readDoubleLE=function(t,e){return e||Qe(t,8,this.length),Ee(this,t,!0,52,8)},Re.prototype.readDoubleBE=function(t,e){return e||Qe(t,8,this.length),Ee(this,t,!1,52,8)},Re.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||tn(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},Re.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||tn(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},Re.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||tn(this,t,e,1,255,0),Re.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Re.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||tn(this,t,e,2,65535,0),Re.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):en(this,t,e,!0),e+2},Re.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||tn(this,t,e,2,65535,0),Re.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):en(this,t,e,!1),e+2},Re.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||tn(this,t,e,4,4294967295,0),Re.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):nn(this,t,e,!0),e+4},Re.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||tn(this,t,e,4,4294967295,0),Re.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):nn(this,t,e,!1),e+4},Re.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);tn(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},Re.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);tn(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},Re.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||tn(this,t,e,1,127,-128),Re.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Re.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||tn(this,t,e,2,32767,-32768),Re.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):en(this,t,e,!0),e+2},Re.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||tn(this,t,e,2,32767,-32768),Re.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):en(this,t,e,!1),e+2},Re.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||tn(this,t,e,4,2147483647,-2147483648),Re.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):nn(this,t,e,!0),e+4},Re.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||tn(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Re.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):nn(this,t,e,!1),e+4},Re.prototype.writeFloatLE=function(t,e,n){return on(this,t,e,!0,n)},Re.prototype.writeFloatBE=function(t,e,n){return on(this,t,e,!1,n)},Re.prototype.writeDoubleLE=function(t,e,n){return an(this,t,e,!0,n)},Re.prototype.writeDoubleBE=function(t,e,n){return an(this,t,e,!1,n)},Re.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!Re.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},Re.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Re.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=Be(t)?t:cn(new Re(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var sn=/[^+\/0-9A-Za-z-_]/g;function un(t){return t<16?"0"+t.toString(16):t.toString(16)}function cn(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function ln(t){return function(t){var e,n,r,i,o,a;ye||we();var s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[s-2]?2:"="===t[s-1]?1:0,a=new me(3*s/4-o),r=o>0?s-4:s;var u=0;for(e=0,n=0;e<r;e+=4,n+=3)i=_e[t.charCodeAt(e)]<<18|_e[t.charCodeAt(e+1)]<<12|_e[t.charCodeAt(e+2)]<<6|_e[t.charCodeAt(e+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=_e[t.charCodeAt(e)]<<2|_e[t.charCodeAt(e+1)]>>4,a[u++]=255&i):1===o&&(i=_e[t.charCodeAt(e)]<<10|_e[t.charCodeAt(e+1)]<<4|_e[t.charCodeAt(e+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(sn,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function fn(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function hn(t){return null!=t&&(!!t._isBuffer||dn(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&dn(t.slice(0,0))}(t))}function dn(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var pn,gn,vn=Sn(Bt.fetch)&&Sn(Bt.ReadableStream);function _n(t){gn||(gn=new Bt.XMLHttpRequest).open("GET",Bt.location.host?"/":"https://example.com");try{return gn.responseType=t,gn.responseType===t}catch(t){return!1}}var mn=void 0!==Bt.ArrayBuffer,yn=mn&&Sn(Bt.ArrayBuffer.prototype.slice),wn=mn&&_n("arraybuffer"),bn=!vn&&yn&&_n("ms-stream"),kn=!vn&&mn&&_n("moz-chunked-arraybuffer"),En=Sn(gn.overrideMimeType),An=Sn(Bt.VBArray);function Sn(t){return"function"==typeof t}gn=null;var Cn="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},xn=/%[sdj%]/g;function Tn(t){if(!Wn(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(jn(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(t).replace(xn,(function(t){if("%%"===t)return"%";if(n>=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),a=r[n];n<i;a=r[++n])Fn(a)||!Kn(a)?o+=" "+a:o+=" "+jn(a);return o}function Rn(t,e){if(Hn(Bt.process))return function(){return Rn(t,e).apply(this,arguments)};if(!0===ae.noDeprecation)return t;var n=!1;return function(){if(!n){if(ae.throwDeprecation)throw new Error(e);ae.traceDeprecation?console.trace(e):console.error(e),n=!0}return t.apply(this,arguments)}}var On,In={};function Nn(t){if(Hn(On)&&(On=ae.env.NODE_DEBUG||""),t=t.toUpperCase(),!In[t])if(new RegExp("\\b"+t+"\\b","i").test(On)){In[t]=function(){var e=Tn.apply(null,arguments);console.error("%s %d: %s",t,0,e)}}else In[t]=function(){};return In[t]}function jn(t,e){var n={seen:[],stylize:Bn};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),Dn(e)?n.showHidden=e:e&&nr(n,e),Hn(n.showHidden)&&(n.showHidden=!1),Hn(n.depth)&&(n.depth=2),Hn(n.colors)&&(n.colors=!1),Hn(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=Ln),Pn(n,t,n.depth)}function Ln(t,e){var n=jn.styles[e];return n?"["+jn.colors[n][0]+"m"+t+"["+jn.colors[n][1]+"m":t}function Bn(t,e){return t}function Pn(t,e,n){if(t.customInspect&&e&&Jn(e.inspect)&&e.inspect!==jn&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return Wn(r)||(r=Pn(t,r,n)),r}var i=function(t,e){if(Hn(e))return t.stylize("undefined","undefined");if(Wn(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(Zn(e))return t.stylize(""+e,"number");if(Dn(e))return t.stylize(""+e,"boolean");if(Fn(e))return t.stylize("null","null")}(t,e);if(i)return i;var o=Object.keys(e),a=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Gn(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Un(e);if(0===o.length){if(Jn(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if($n(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Yn(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Gn(e))return Un(e)}var u,c="",l=!1,f=["{","}"];(zn(e)&&(l=!0,f=["[","]"]),Jn(e))&&(c=" [Function"+(e.name?": "+e.name:"")+"]");return $n(e)&&(c=" "+RegExp.prototype.toString.call(e)),Yn(e)&&(c=" "+Date.prototype.toUTCString.call(e)),Gn(e)&&(c=" "+Un(e)),0!==o.length||l&&0!=e.length?n<0?$n(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=l?function(t,e,n,r,i){for(var o=[],a=0,s=e.length;a<s;++a)rr(e,String(a))?o.push(Mn(t,e,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(Mn(t,e,n,r,i,!0))})),o}(t,e,n,a,o):o.map((function(r){return Mn(t,e,n,a,r,l)})),t.seen.pop(),function(t,e,n){if(t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(u,c,f)):f[0]+c+f[1]}function Un(t){return"["+Error.prototype.toString.call(t)+"]"}function Mn(t,e,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),rr(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=Fn(n)?Pn(t,u.value,null):Pn(t,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),Hn(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function zn(t){return Array.isArray(t)}function Dn(t){return"boolean"==typeof t}function Fn(t){return null===t}function qn(t){return null==t}function Zn(t){return"number"==typeof t}function Wn(t){return"string"==typeof t}function Hn(t){return void 0===t}function $n(t){return Kn(t)&&"[object RegExp]"===Xn(t)}function Kn(t){return"object"==typeof t&&null!==t}function Yn(t){return Kn(t)&&"[object Date]"===Xn(t)}function Gn(t){return Kn(t)&&("[object Error]"===Xn(t)||t instanceof Error)}function Jn(t){return"function"==typeof t}function Vn(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function Xn(t){return Object.prototype.toString.call(t)}function Qn(t){return t<10?"0"+t.toString(10):t.toString(10)}jn.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},jn.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var tr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function er(){var t=new Date,e=[Qn(t.getHours()),Qn(t.getMinutes()),Qn(t.getSeconds())].join(":");return[t.getDate(),tr[t.getMonth()],e].join(" ")}function nr(t,e){if(!e||!Kn(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}function rr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var ir={inherits:Cn,_extend:nr,log:function(){console.log("%s - %s",er(),Tn.apply(null,arguments))},isBuffer:function(t){return Re.isBuffer(t)},isPrimitive:Vn,isFunction:Jn,isError:Gn,isDate:Yn,isObject:Kn,isRegExp:$n,isUndefined:Hn,isSymbol:function(t){return"symbol"==typeof t},isString:Wn,isNumber:Zn,isNullOrUndefined:qn,isNull:Fn,isBoolean:Dn,isArray:zn,inspect:jn,deprecate:Rn,format:Tn,debuglog:Nn};function or(){}function ar(){ar.init.call(this)}function sr(t){return void 0===t._maxListeners?ar.defaultMaxListeners:t._maxListeners}function ur(t,e,n){if(e)t.call(n);else for(var r=t.length,i=vr(t,r),o=0;o<r;++o)i[o].call(n)}function cr(t,e,n,r){if(e)t.call(n,r);else for(var i=t.length,o=vr(t,i),a=0;a<i;++a)o[a].call(n,r)}function lr(t,e,n,r,i){if(e)t.call(n,r,i);else for(var o=t.length,a=vr(t,o),s=0;s<o;++s)a[s].call(n,r,i)}function fr(t,e,n,r,i,o){if(e)t.call(n,r,i,o);else for(var a=t.length,s=vr(t,a),u=0;u<a;++u)s[u].call(n,r,i,o)}function hr(t,e,n,r){if(e)t.apply(n,r);else for(var i=t.length,o=vr(t,i),a=0;a<i;++a)o[a].apply(n,r)}function dr(t,e,n,r){var i,o,a,s;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((o=t._events)?(o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]):(o=t._events=new or,t._eventsCount=0),a){if("function"==typeof a?a=o[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),!a.warned&&(i=sr(t))&&i>0&&a.length>i){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[e]=n,++t._eventsCount;return t}function pr(t,e,n){var r=!1;function i(){t.removeListener(e,i),r||(r=!0,n.apply(t,arguments))}return i.listener=n,i}function gr(t){var e=this._events;if(e){var n=e[t];if("function"==typeof n)return 1;if(n)return n.length}return 0}function vr(t,e){for(var n=new Array(e);e--;)n[e]=t[e];return n}function _r(){this.head=null,this.tail=null,this.length=0}or.prototype=Object.create(null),ar.EventEmitter=ar,ar.usingDomains=!1,ar.prototype.domain=void 0,ar.prototype._events=void 0,ar.prototype._maxListeners=void 0,ar.defaultMaxListeners=10,ar.init=function(){this.domain=null,ar.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new or,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ar.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},ar.prototype.getMaxListeners=function(){return sr(this)},ar.prototype.emit=function(t){var e,n,r,i,o,a,s,u="error"===t;if(a=this._events)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(e=arguments[1],!s){if(e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=s,e.domainThrown=!1,s.emit("error",e),!1}if(!(n=a[t]))return!1;var l="function"==typeof n;switch(r=arguments.length){case 1:ur(n,l,this);break;case 2:cr(n,l,this,arguments[1]);break;case 3:lr(n,l,this,arguments[1],arguments[2]);break;case 4:fr(n,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];hr(n,l,this,i)}return!0},ar.prototype.addListener=function(t,e){return dr(this,t,e,!1)},ar.prototype.on=ar.prototype.addListener,ar.prototype.prependListener=function(t,e){return dr(this,t,e,!0)},ar.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,pr(this,t,e)),this},ar.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,pr(this,t,e)),this},ar.prototype.removeListener=function(t,e){var n,r,i,o,a;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[t]))return this;if(n===e||n.listener&&n.listener===e)0==--this._eventsCount?this._events=new or:(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length;o-- >0;)if(n[o]===e||n[o].listener&&n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new or,this;delete r[t]}else!function(t,e){for(var n=e,r=n+1,i=t.length;r<i;n+=1,r+=1)t[n]=t[r];t.pop()}(n,i);r.removeListener&&this.emit("removeListener",t,a||e)}return this},ar.prototype.removeAllListeners=function(t){var e,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new or,this._eventsCount=0):n[t]&&(0==--this._eventsCount?this._events=new or:delete n[t]),this;if(0===arguments.length){for(var r,i=Object.keys(n),o=0;o<i.length;++o)"removeListener"!==(r=i[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new or,this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},ar.prototype.listeners=function(t){var e,n=this._events;return n&&(e=n[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(e):[]},ar.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):gr.call(t,e)},ar.prototype.listenerCount=gr,ar.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]},_r.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},_r.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},_r.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},_r.prototype.clear=function(){this.head=this.tail=null,this.length=0},_r.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},_r.prototype.concat=function(t){if(0===this.length)return Re.alloc(0);if(1===this.length)return this.head.data;for(var e=Re.allocUnsafe(t>>>0),n=this.head,r=0;n;)n.data.copy(e,r),r+=n.data.length,n=n.next;return e};var mr=Re.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function yr(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!mr(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=br;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=kr;break;default:return void(this.write=wr)}this.charBuffer=new Re(6),this.charReceived=0,this.charLength=0}function wr(t){return t.toString(this.encoding)}function br(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function kr(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}yr.prototype.write=function(t){for(var e="";this.charLength;){var n=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";if(t=t.slice(n,t.length),!((i=(e=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(e.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var r=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,r),r-=this.charReceived);var i;r=(e+=t.toString(this.encoding,0,r)).length-1;if((i=e.charCodeAt(r))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,r)}return e},yr.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(e<=2&&n>>4==14){this.charLength=3;break}if(e<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=e},yr.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,n).toString(i)}return e},Sr.ReadableState=Ar;var Er=Nn("stream");function Ar(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof Xr&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new _r,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(this.decoder=new yr(t.encoding),this.encoding=t.encoding)}function Sr(t){if(!(this instanceof Sr))return new Sr(t);this._readableState=new Ar(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),ar.call(this)}function Cr(t,e,n,r,i){var o=function(t,e){var n=null;Re.isBuffer(e)||"string"==typeof e||null==e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));return n}(e,n);if(o)t.emit("error",o);else if(null===n)e.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,Tr(t)}(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!i){var a=new Error("stream.push() after EOF");t.emit("error",a)}else if(e.endEmitted&&i){var s=new Error("stream.unshift() after end event");t.emit("error",s)}else{var u;!e.decoder||i||r||(n=e.decoder.write(n),u=!e.objectMode&&0===n.length),i||(e.reading=!1),u||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&Tr(t))),function(t,e){e.readingMore||(e.readingMore=!0,Kt(Or,t,e))}(t,e)}else i||(e.reading=!1);return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(e)}Cn(Sr,ar),Sr.prototype.push=function(t,e){var n=this._readableState;return n.objectMode||"string"!=typeof t||(e=e||n.defaultEncoding)!==n.encoding&&(t=Re.from(t,e),e=""),Cr(this,n,t,e,!1)},Sr.prototype.unshift=function(t){return Cr(this,this._readableState,t,"",!0)},Sr.prototype.isPaused=function(){return!1===this._readableState.flowing},Sr.prototype.setEncoding=function(t){return this._readableState.decoder=new yr(t),this._readableState.encoding=t,this};function xr(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function Tr(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(Er("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?Kt(Rr,t):Rr(t))}function Rr(t){Er("emit readable"),t.emit("readable"),jr(t)}function Or(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(Er("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function Ir(t){Er("readable nexttick read 0"),t.read(0)}function Nr(t,e){e.reading||(Er("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),jr(t),e.flowing&&!e.reading&&t.read(0)}function jr(t){var e=t._readableState;for(Er("flow",e.flowing);e.flowing&&null!==t.read(););}function Lr(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,r=1,i=n.data;t-=i.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=Re.allocUnsafe(t),r=e.head,i=1;r.data.copy(n),t-=r.data.length;for(;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,a),0===(t-=a)){a===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++i}return e.length-=i,n}(t,e);return r}(t,e.buffer,e.decoder),n);var n}function Br(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,Kt(Pr,e,t))}function Pr(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function Ur(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function Mr(){}function zr(t,e,n){this.chunk=t,this.encoding=e,this.callback=n,this.next=null}function Dr(t,e){Object.defineProperty(this,"buffer",{get:Rn((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),t=t||{},this.objectMode=!!t.objectMode,e instanceof Xr&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===t.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?Kt(i,r):i(r);t._writableState.errorEmitted=!0,t.emit("error",r)}(t,n,r,e,i);else{var o=Hr(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||Wr(t,n),r?Kt(Zr,t,n,o,i):Zr(t,n,o,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Yr(this)}function Fr(t){if(!(this instanceof Fr||this instanceof Xr))return new Fr(t);this._writableState=new Dr(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),ar.call(this)}function qr(t,e,n,r,i,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function Zr(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),Kr(t,e)}function Wr(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var a=0;n;)i[a]=n,n=n.next,a+=1;qr(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Yr(e)}else{for(;n;){var s=n.chunk,u=n.encoding,c=n.callback;if(qr(t,e,!1,e.objectMode?1:s.length,s,u,c),n=n.next,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=n,e.bufferProcessing=!1}function Hr(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function $r(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function Kr(t,e){var n=Hr(e);return n&&(0===e.pendingcb?($r(t,e),e.finished=!0,t.emit("finish")):$r(t,e)),n}function Yr(t){var e=this;this.next=null,this.entry=null,this.finish=function(n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}Sr.prototype.read=function(t){Er("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return Er("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Br(this):Tr(this),null;if(0===(t=xr(t,e))&&e.ended)return 0===e.length&&Br(this),null;var r,i=e.needReadable;return Er("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&Er("length less than watermark",i=!0),e.ended||e.reading?Er("reading or ended",i=!1):i&&(Er("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=xr(n,e))),null===(r=t>0?Lr(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&Br(this)),null!==r&&this.emit("data",r),r},Sr.prototype._read=function(t){this.emit("error",new Error("not implemented"))},Sr.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,Er("pipe count=%d opts=%j",r.pipesCount,e);var i=!e||!1!==e.end?a:c;function o(t){Er("onunpipe"),t===n&&c()}function a(){Er("onend"),t.end()}r.endEmitted?Kt(i):n.once("end",i),t.on("unpipe",o);var s=function(t){return function(){var e=t._readableState;Er("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&t.listeners("data").length&&(e.flowing=!0,jr(t))}}(n);t.on("drain",s);var u=!1;function c(){Er("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",s),t.removeListener("error",h),t.removeListener("unpipe",o),n.removeListener("end",a),n.removeListener("end",c),n.removeListener("data",f),u=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||s()}var l=!1;function f(e){Er("ondata"),l=!1,!1!==t.write(e)||l||((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==Ur(r.pipes,t))&&!u&&(Er("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,l=!0),n.pause())}function h(e){Er("onerror",e),g(),t.removeListener("error",h),0===function(t,e){return t.listeners(e).length}(t,"error")&&t.emit("error",e)}function d(){t.removeListener("finish",p),g()}function p(){Er("onfinish"),t.removeListener("close",d),g()}function g(){Er("unpipe"),n.unpipe(t)}return n.on("data",f),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",h),t.once("close",d),t.once("finish",p),t.emit("pipe",n),r.flowing||(Er("pipe resume"),n.resume()),t},Sr.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){var n=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var o=Ur(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this)),this},Sr.prototype.on=function(t,e){var n=ar.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&Tr(this):Kt(Ir,this))}return n},Sr.prototype.addListener=Sr.prototype.on,Sr.prototype.resume=function(){var t=this._readableState;return t.flowing||(Er("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Kt(Nr,t,e))}(this,t)),this},Sr.prototype.pause=function(){return Er("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(Er("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Sr.prototype.wrap=function(t){var e=this._readableState,n=!1,r=this;for(var i in t.on("end",(function(){if(Er("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&r.push(t)}r.push(null)})),t.on("data",(function(i){(Er("wrapped data"),e.decoder&&(i=e.decoder.write(i)),e.objectMode&&null==i)||(e.objectMode||i&&i.length)&&(r.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));return function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}(["error","close","destroy","pause","resume"],(function(e){t.on(e,r.emit.bind(r,e))})),r._read=function(e){Er("wrapped _read",e),n&&(n=!1,t.resume())},r},Sr._fromList=Lr,Fr.WritableState=Dr,Cn(Fr,ar),Dr.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},Fr.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Fr.prototype.write=function(t,e,n){var r=this._writableState,i=!1;return"function"==typeof e&&(n=e,e=null),Re.isBuffer(t)?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof n&&(n=Mr),r.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),Kt(e,n)}(this,n):function(t,e,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):Re.isBuffer(n)||"string"==typeof n||void 0===n||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),Kt(r,o),i=!1),i}(this,r,t,n)&&(r.pendingcb++,i=function(t,e,n,r,i){n=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=Re.from(e,n));return e}(e,n,r),Re.isBuffer(n)&&(r="buffer");var o=e.objectMode?1:n.length;e.length+=o;var a=e.length<e.highWaterMark;a||(e.needDrain=!0);if(e.writing||e.corked){var s=e.lastBufferedRequest;e.lastBufferedRequest=new zr(n,r,i),s?s.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else qr(t,e,!1,o,n,r,i);return a}(this,r,t,e,n)),i},Fr.prototype.cork=function(){this._writableState.corked++},Fr.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||Wr(this,t))},Fr.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Fr.prototype._write=function(t,e,n){n(new Error("not implemented"))},Fr.prototype._writev=null,Fr.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,Kr(t,e),n&&(e.finished?Kt(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n)},Cn(Xr,Sr);for(var Gr=Object.keys(Fr.prototype),Jr=0;Jr<Gr.length;Jr++){var Vr=Gr[Jr];Xr.prototype[Vr]||(Xr.prototype[Vr]=Fr.prototype[Vr])}function Xr(t){if(!(this instanceof Xr))return new Xr(t);Sr.call(this,t),Fr.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Qr)}function Qr(){this.allowHalfOpen||this._writableState.ended||Kt(ti,this)}function ti(t){t.end()}function ei(t){this.afterTransform=function(e,n){return function(t,e,n){var r=t._transformState;r.transforming=!1;var i=r.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!=n&&t.push(n);i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function ni(t){if(!(this instanceof ni))return new ni(t);Xr.call(this,t),this._transformState=new ei(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(t){ri(e,t)})):ri(e)}))}function ri(t,e){if(e)return t.emit("error",e);var n=t._writableState,r=t._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}function ii(t){if(!(this instanceof ii))return new ii(t);ni.call(this,t)}function oi(){ar.call(this)}Cn(ni,Xr),ni.prototype.push=function(t,e){return this._transformState.needTransform=!1,Xr.prototype.push.call(this,t,e)},ni.prototype._transform=function(t,e,n){throw new Error("Not implemented")},ni.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},ni.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},Cn(ii,ni),ii.prototype._transform=function(t,e,n){n(null,t)},Cn(oi,ar),oi.Readable=Sr,oi.Writable=Fr,oi.Duplex=Xr,oi.Transform=ni,oi.PassThrough=ii,oi.Stream=oi,oi.prototype.pipe=function(t,e){var n=this;function r(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),t.on("drain",i),t._isStdio||e&&!1===e.end||(n.on("end",a),n.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(c(),0===ar.listenerCount(this,"error"))throw t}function c(){n.removeListener("data",r),t.removeListener("drain",i),n.removeListener("end",a),n.removeListener("close",s),n.removeListener("error",u),t.removeListener("error",u),n.removeListener("end",c),n.removeListener("close",c),t.removeListener("close",c)}return n.on("error",u),t.on("error",u),n.on("end",c),n.on("close",c),t.on("close",c),t.emit("pipe",n),t};var ai=3,si=4;function ui(t,e,n){var r,i=this;if(Sr.call(i),i._mode=n,i.headers={},i.rawHeaders=[],i.trailers={},i.rawTrailers=[],i.on("end",(function(){ae.nextTick((function(){i.emit("close")}))})),"fetch"===n){i._fetchResponse=e,i.url=e.url,i.statusCode=e.status,i.statusMessage=e.statusText;for(var o,a,s=e.headers[Symbol.iterator]();o=(a=s.next()).value,!a.done;)i.headers[o[0].toLowerCase()]=o[1],i.rawHeaders.push(o[0],o[1]);var u=e.body.getReader();(r=function(){u.read().then((function(t){i._destroyed||(t.done?i.push(null):(i.push(new Re(t.value)),r()))}))})()}else{if(i._xhr=t,i._pos=0,i.url=t.responseURL,i.statusCode=t.status,i.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var n=e[1].toLowerCase();"set-cookie"===n?(void 0===i.headers[n]&&(i.headers[n]=[]),i.headers[n].push(e[2])):void 0!==i.headers[n]?i.headers[n]+=", "+e[2]:i.headers[n]=e[2],i.rawHeaders.push(e[1],e[2])}})),i._charset="x-user-defined",!En){var c=i.rawHeaders["mime-type"];if(c){var l=c.match(/;\s*charset=([^;])(;|$)/);l&&(i._charset=l[1].toLowerCase())}i._charset||(i._charset="utf-8")}}}function ci(t){var e,n=this;Fr.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader("Authorization","Basic "+new Re(t.auth).toString("base64")),Object.keys(t.headers).forEach((function(e){n.setHeader(e,t.headers[e])}));var r=!0;if("disable-fetch"===t.mode)r=!1,e=!0;else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!En;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}n._mode=function(t,e){return vn&&e?"fetch":kn?"moz-chunked-arraybuffer":bn?"ms-stream":wn&&t?"arraybuffer":An&&t?"text:vbarray":"text"}(e,r),n.on("finish",(function(){n._onFinish()}))}Cn(ui,Sr),ui.prototype._read=function(){},ui.prototype._onXHRProgress=function(){var t=this,e=t._xhr,n=null;switch(t._mode){case"text:vbarray":if(e.readyState!==si)break;try{n=new Bt.VBArray(e.responseBody).toArray()}catch(t){}if(null!==n){t.push(new Re(n));break}case"text":try{n=e.responseText}catch(e){t._mode="text:vbarray";break}if(n.length>t._pos){var r=n.substr(t._pos);if("x-user-defined"===t._charset){for(var i=new Re(r.length),o=0;o<r.length;o++)i[o]=255&r.charCodeAt(o);t.push(i)}else t.push(r,t._charset);t._pos=n.length}break;case"arraybuffer":if(e.readyState!==si||!e.response)break;n=e.response,t.push(new Re(new Uint8Array(n)));break;case"moz-chunked-arraybuffer":if(n=e.response,e.readyState!==ai||!n)break;t.push(new Re(new Uint8Array(n)));break;case"ms-stream":if(n=e.response,e.readyState!==ai)break;var a=new Bt.MSStreamReader;a.onprogress=function(){a.result.byteLength>t._pos&&(t.push(new Re(new Uint8Array(a.result.slice(t._pos)))),t._pos=a.result.byteLength)},a.onload=function(){t.push(null)},a.readAsArrayBuffer(n)}t._xhr.readyState===si&&"ms-stream"!==t._mode&&t.push(null)},Cn(ci,Fr);var li=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];ci.prototype.setHeader=function(t,e){var n=t.toLowerCase();-1===li.indexOf(n)&&(this._headers[n]={name:t,value:e})},ci.prototype.getHeader=function(t){return this._headers[t.toLowerCase()].value},ci.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},ci.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e,n=t._opts,r=t._headers;if("POST"!==n.method&&"PUT"!==n.method&&"PATCH"!==n.method||(e=function(){if(void 0!==pn)return pn;try{new Bt.Blob([new ArrayBuffer(1)]),pn=!0}catch(t){pn=!1}return pn}()?new Bt.Blob(t._body.map((function(t){return function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if("function"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(hn(t)){for(var e=new Uint8Array(t.length),n=t.length,r=0;r<n;r++)e[r]=t[r];return e.buffer}throw new Error("Argument must be a Buffer")}(t)})),{type:(r["content-type"]||{}).value||""}):Re.concat(t._body).toString()),"fetch"===t._mode){var i=Object.keys(r).map((function(t){return[r[t].name,r[t].value]}));Bt.fetch(t._opts.url,{method:t._opts.method,headers:i,body:e,mode:"cors",credentials:n.withCredentials?"include":"same-origin"}).then((function(e){t._fetchResponse=e,t._connect()}),(function(e){t.emit("error",e)}))}else{var o=t._xhr=new Bt.XMLHttpRequest;try{o.open(t._opts.method,t._opts.url,!0)}catch(e){return void ae.nextTick((function(){t.emit("error",e)}))}"responseType"in o&&(o.responseType=t._mode.split(":")[0]),"withCredentials"in o&&(o.withCredentials=!!n.withCredentials),"text"===t._mode&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),Object.keys(r).forEach((function(t){o.setRequestHeader(r[t].name,r[t].value)})),t._response=null,o.onreadystatechange=function(){switch(o.readyState){case ai:case si:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(o.onprogress=function(){t._onXHRProgress()}),o.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{o.send(e)}catch(e){return void ae.nextTick((function(){t.emit("error",e)}))}}}},ci.prototype._onXHRProgress=function(){var t=this;(function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}})(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress())},ci.prototype._connect=function(){var t=this;t._destroyed||(t._response=new ui(t._xhr,t._fetchResponse,t._mode),t.emit("response",t._response))},ci.prototype._write=function(t,e,n){this._body.push(t),n()},ci.prototype.abort=ci.prototype.destroy=function(){var t=this;t._destroyed=!0,t._response&&(t._response._destroyed=!0),t._xhr&&t._xhr.abort()},ci.prototype.end=function(t,e,n){"function"==typeof t&&(n=t,t=void 0),Fr.prototype.end.call(this,t,e,n)},ci.prototype.flushHeaders=function(){},ci.prototype.setTimeout=function(){},ci.prototype.setNoDelay=function(){},ci.prototype.setSocketKeepAlive=function(){};
17
17
  /*! https://mths.be/punycode v1.4.1 by @mathias */
18
- var fi=/[^\x20-\x7E]/,hi=/[\x2E\u3002\uFF0E\uFF61]/g,di={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},pi=Math.floor,gi=String.fromCharCode;function vi(t){throw new RangeError(di[t])}function _i(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function mi(t,e,n){var r=0;for(t=n?pi(t/700):t>>1,t+=pi(t/e);t>455;r+=36)t=pi(t/35);return pi(r+36*t/(t+38))}function yi(t){return function(t,e){var n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]);var i=function(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}((t=t.replace(hi,".")).split("."),e).join(".");return r+i}(t,(function(t){return fi.test(t)?"xn--"+function(t){var e,n,r,i,o,a,s,u,c,l,f,h,d,p,g,v=[];for(h=(t=function(t){for(var e,n,r=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--):r.push(e);return r}(t)).length,e=128,n=0,o=72,a=0;a<h;++a)(f=t[a])<128&&v.push(gi(f));for(r=i=v.length,i&&v.push("-");r<h;){for(s=2147483647,a=0;a<h;++a)(f=t[a])>=e&&f<s&&(s=f);for(s-e>pi((2147483647-n)/(d=r+1))&&vi("overflow"),n+=(s-e)*d,e=s,a=0;a<h;++a)if((f=t[a])<e&&++n>2147483647&&vi("overflow"),f==e){for(u=n,c=36;!(u<(l=c<=o?1:c>=o+26?26:c-o));c+=36)g=u-l,p=36-l,v.push(gi(_i(l+g%p,0))),u=pi(g/p);v.push(gi(_i(u,0))),o=mi(n,d,r==i),n=0,++r}++n,++e}return v.join("")}(t):t}))}function wi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var bi=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function ki(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}function Ei(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n}var Ai=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e};function Si(t,e,n,r){e=e||"&",n=n||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\+/g;t=t.split(e);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var s=t.length;a>0&&s>a&&(s=a);for(var u=0;u<s;++u){var c,l,f,h,d=t[u].replace(o,"%20"),p=d.indexOf(n);p>=0?(c=d.substr(0,p),l=d.substr(p+1)):(c=d,l=""),f=decodeURIComponent(c),h=decodeURIComponent(l),wi(i,f)?bi(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i}var Ci={parse:Di,resolve:function(t,e){return Di(t,!1,!0).resolve(e)},resolveObject:function(t,e){return t?Di(t,!1,!0).resolveObject(e):e},format:function(t){Wn(t)&&(t=Fi({},t));return qi(t)},Url:xi};function xi(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Ti=/^([a-z0-9.+-]+:)/i,Ri=/:[0-9]*$/,Oi=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ii=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Ni=["'"].concat(Ii),ji=["%","/","?",";","#"].concat(Ni),Li=["/","?","#"],Bi=/^[+a-z0-9A-Z_-]{0,63}$/,Pi=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ui={javascript:!0,"javascript:":!0},Mi={javascript:!0,"javascript:":!0},zi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Di(t,e,n){if(t&&Kn(t)&&t instanceof xi)return t;var r=new xi;return r.parse(t,e,n),r}function Fi(t,e,n,r){if(!Wn(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),o=-1!==i&&i<e.indexOf("#")?"?":"#",a=e.split(o);a[0]=a[0].replace(/\\/g,"/");var s=e=a.join(o);if(s=s.trim(),!r&&1===e.split("#").length){var u=Oi.exec(s);if(u)return t.path=s,t.href=s,t.pathname=u[1],u[2]?(t.search=u[2],t.query=n?Si(t.search.substr(1)):t.search.substr(1)):n&&(t.search="",t.query={}),t}var c,l,f,h,d=Ti.exec(s);if(d){var p=(d=d[0]).toLowerCase();t.protocol=p,s=s.substr(d.length)}if(r||d||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var g="//"===s.substr(0,2);!g||d&&Mi[d]||(s=s.substr(2),t.slashes=!0)}if(!Mi[d]&&(g||d&&!zi[d])){var v,_,m=-1;for(c=0;c<Li.length;c++)-1!==(l=s.indexOf(Li[c]))&&(-1===m||l<m)&&(m=l);for(-1!==(_=-1===m?s.lastIndexOf("@"):s.lastIndexOf("@",m))&&(v=s.slice(0,_),s=s.slice(_+1),t.auth=decodeURIComponent(v)),m=-1,c=0;c<ji.length;c++)-1!==(l=s.indexOf(ji[c]))&&(-1===m||l<m)&&(m=l);-1===m&&(m=s.length),t.host=s.slice(0,m),s=s.slice(m),Zi(t),t.hostname=t.hostname||"";var y="["===t.hostname[0]&&"]"===t.hostname[t.hostname.length-1];if(!y){var w=t.hostname.split(/\./);for(c=0,f=w.length;c<f;c++){var b=w[c];if(b&&!b.match(Bi)){for(var k="",E=0,A=b.length;E<A;E++)b.charCodeAt(E)>127?k+="x":k+=b[E];if(!k.match(Bi)){var S=w.slice(0,c),C=w.slice(c+1),x=b.match(Pi);x&&(S.push(x[1]),C.unshift(x[2])),C.length&&(s="/"+C.join(".")+s),t.hostname=S.join(".");break}}}}t.hostname.length>255?t.hostname="":t.hostname=t.hostname.toLowerCase(),y||(t.hostname=yi(t.hostname)),h=t.port?":"+t.port:"";var T=t.hostname||"";t.host=T+h,t.href+=t.host,y&&(t.hostname=t.hostname.substr(1,t.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!Ui[p])for(c=0,f=Ni.length;c<f;c++){var R=Ni[c];if(-1!==s.indexOf(R)){var O=encodeURIComponent(R);O===R&&(O=escape(R)),s=s.split(R).join(O)}}var I=s.indexOf("#");-1!==I&&(t.hash=s.substr(I),s=s.slice(0,I));var N=s.indexOf("?");if(-1!==N?(t.search=s.substr(N),t.query=s.substr(N+1),n&&(t.query=Si(t.query)),s=s.slice(0,N)):n&&(t.search="",t.query={}),s&&(t.pathname=s),zi[p]&&t.hostname&&!t.pathname&&(t.pathname="/"),t.pathname||t.search){h=t.pathname||"";var j=t.search||"";t.path=h+j}return t.href=qi(t),t}function qi(t){var e=t.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var n=t.protocol||"",r=t.pathname||"",i=t.hash||"",o=!1,a="";t.host?o=e+t.host:t.hostname&&(o=e+(-1===t.hostname.indexOf(":")?t.hostname:"["+this.hostname+"]"),t.port&&(o+=":"+t.port)),t.query&&Kn(t.query)&&Object.keys(t.query).length&&(a=function(t,e,n,r){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Ei(Ai(t),(function(r){var i=encodeURIComponent(ki(r))+n;return bi(t[r])?Ei(t[r],(function(t){return i+encodeURIComponent(ki(t))})).join(e):i+encodeURIComponent(ki(t[r]))})).join(e):r?encodeURIComponent(ki(r))+n+encodeURIComponent(ki(t)):""}(t.query));var s=t.search||a&&"?"+a||"";return n&&":"!==n.substr(-1)&&(n+=":"),t.slashes||(!n||zi[n])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),n+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+i}function Zi(t){var e=t.host,n=Ri.exec(e);n&&(":"!==(n=n[0])&&(t.port=n.substr(1)),e=e.substr(0,e.length-n.length)),e&&(t.hostname=e)}function Wi(t,e){"string"==typeof t&&(t=Di(t));var n=-1===Bt.location.protocol.search(/^https?:$/)?"http:":"",r=t.protocol||n,i=t.hostname||t.host,o=t.port,a=t.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),t.url=(i?r+"//"+i:"")+(o?":"+o:"")+a,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var s=new ci(t);return e&&s.on("response",e),s}function Hi(){}xi.prototype.parse=function(t,e,n){return Fi(this,t,e,n)},xi.prototype.format=function(){return qi(this)},xi.prototype.resolve=function(t){return this.resolveObject(Di(t,!1,!0)).format()},xi.prototype.resolveObject=function(t){if(Wn(t)){var e=new xi;e.parse(t,!1,!0),t=e}for(var n,r=new xi,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];r[a]=this[a]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(r[c]=t[c])}return zi[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!zi[t.protocol]){for(var l=Object.keys(t),f=0;f<l.length;f++){var h=l[f];r[h]=t[h]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||Mi[t.protocol])r.pathname=t.pathname;else{for(n=(t.pathname||"").split("/");n.length&&!(t.host=n.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),r.pathname=n.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var g,v=r.pathname&&"/"===r.pathname.charAt(0),_=t.host||t.pathname&&"/"===t.pathname.charAt(0),m=_||v||r.host&&t.pathname,y=m,w=r.pathname&&r.pathname.split("/")||[],b=r.protocol&&!zi[r.protocol];if(n=t.pathname&&t.pathname.split("/")||[],b&&(r.hostname="",r.port=null,r.host&&(""===w[0]?w[0]=r.host:w.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===n[0]?n[0]=t.host:n.unshift(t.host)),t.host=null),m=m&&(""===n[0]||""===w[0])),_)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,w=n;else if(n.length)w||(w=[]),w.pop(),w=w.concat(n),r.search=t.search,r.query=t.query;else if(!qn(t.search))return b&&(r.hostname=r.host=w.shift(),(g=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=g.shift(),r.host=r.hostname=g.shift())),r.search=t.search,r.query=t.query,Fn(r.pathname)&&Fn(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=w.slice(-1)[0],E=(r.host||t.host||w.length>1)&&("."===k||".."===k)||""===k,A=0,S=w.length;S>=0;S--)"."===(k=w[S])?w.splice(S,1):".."===k?(w.splice(S,1),A++):A&&(w.splice(S,1),A--);if(!m&&!y)for(;A--;A)w.unshift("..");!m||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),E&&"/"!==w.join("/").substr(-1)&&w.push("");var C=""===w[0]||w[0]&&"/"===w[0].charAt(0);return b&&(r.hostname=r.host=C?"":w.length?w.shift():"",(g=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=g.shift(),r.host=r.hostname=g.shift())),(m=m||r.host&&w.length)&&!C&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),Fn(r.pathname)&&Fn(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},xi.prototype.parseHost=function(){return Zi(this)},Hi.defaultMaxSockets=4;var $i={request:Wi,get:function(t,e){var n=Wi(t,e);return n.end(),n},Agent:Hi,METHODS:["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],STATUS_CODES:{100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}};function Ki(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0}var Yi,Gi=Object.prototype.hasOwnProperty,Ji=Object.keys||function(t){var e=[];for(var n in t)Gi.call(t,n)&&e.push(n);return e},Vi=Array.prototype.slice;function Xi(){return void 0!==Yi?Yi:Yi="foo"===function(){}.name}function Qi(t){return Object.prototype.toString.call(t)}function to(t){return!hn(t)&&("function"==typeof Bt.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}function eo(t,e){t||so(t,!0,e,"==",uo)}var no=/\s*function\s+([^\(\s]*)\s*/;function ro(t){if(Jn(t)){if(Xi())return t.name;var e=t.toString().match(no);return e&&e[1]}}function io(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return oo(ao(t.actual),128)+" "+t.operator+" "+oo(ao(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||so;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,i=ro(e),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}}function oo(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function ao(t){if(Xi()||!Jn(t))return jn(t);var e=ro(t);return"[Function"+(e?": "+e:"")+"]"}function so(t,e,n,r,i){throw new io({message:n,actual:t,expected:e,operator:r,stackStartFunction:i})}function uo(t,e){t||so(t,!0,e,"==",uo)}function co(t,e,n,r){if(t===e)return!0;if(hn(t)&&hn(e))return 0===Ki(t,e);if(Yn(t)&&Yn(e))return t.getTime()===e.getTime();if($n(t)&&$n(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(to(t)&&to(e)&&Qi(t)===Qi(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===Ki(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(hn(t)!==hn(e))return!1;var i=(r=r||{actual:[],expected:[]}).actual.indexOf(t);return-1!==i&&i===r.expected.indexOf(e)||(r.actual.push(t),r.expected.push(e),function(t,e,n,r){if(null==t||null==e)return!1;if(Vn(t)||Vn(e))return t===e;if(n&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=lo(t),o=lo(e);if(i&&!o||!i&&o)return!1;if(i)return co(t=Vi.call(t),e=Vi.call(e),n);var a,s,u=Ji(t),c=Ji(e);if(u.length!==c.length)return!1;for(u.sort(),c.sort(),s=u.length-1;s>=0;s--)if(u[s]!==c[s])return!1;for(s=u.length-1;s>=0;s--)if(!co(t[a=u[s]],e[a],n,r))return!1;return!0}(t,e,n,r))}return n?t===e:t==e}function lo(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function fo(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function ho(t,e,n,r){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&so(i,n,"Missing expected exception"+r);var o="string"==typeof r,a=!t&&i&&!n;if((!t&&Gn(i)&&o&&fo(i,n)||a)&&so(i,n,"Got unwanted exception"+r),t&&i&&n&&!fo(i,n)||!t&&i)throw i}eo.AssertionError=io,Cn(io,Error),eo.fail=so,eo.ok=uo,eo.equal=function t(e,n,r){e!=n&&so(e,n,r,"==",t)},eo.notEqual=function t(e,n,r){e==n&&so(e,n,r,"!=",t)},eo.deepEqual=function t(e,n,r){co(e,n,!1)||so(e,n,r,"deepEqual",t)},eo.deepStrictEqual=function t(e,n,r){co(e,n,!0)||so(e,n,r,"deepStrictEqual",t)},eo.notDeepEqual=function t(e,n,r){co(e,n,!1)&&so(e,n,r,"notDeepEqual",t)},eo.notDeepStrictEqual=function t(e,n,r){co(e,n,!0)&&so(e,n,r,"notDeepStrictEqual",t)},eo.strictEqual=function t(e,n,r){e!==n&&so(e,n,r,"===",t)},eo.notStrictEqual=function t(e,n,r){e===n&&so(e,n,r,"!==",t)},eo.throws=function(t,e,n){ho(!0,t,e,n)},eo.doesNotThrow=function(t,e,n){ho(!1,t,e,n)},eo.ifError=function(t){if(t)throw t};var po=1e3,go=60*po,vo=60*go,_o=24*vo,mo=7*_o,yo=365.25*_o,wo=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*yo;case"weeks":case"week":case"w":return n*mo;case"days":case"day":case"d":return n*_o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*vo;case"minutes":case"minute":case"mins":case"min":case"m":return n*go;case"seconds":case"second":case"secs":case"sec":case"s":return n*po;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(t);if("number"===n&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=_o)return bo(t,e,_o,"day");if(e>=vo)return bo(t,e,vo,"hour");if(e>=go)return bo(t,e,go,"minute");if(e>=po)return bo(t,e,po,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=_o)return Math.round(t/_o)+"d";if(e>=vo)return Math.round(t/vo)+"h";if(e>=go)return Math.round(t/go)+"m";if(e>=po)return Math.round(t/po)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function bo(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}var ko=function(t){function e(t){let r,i=null;function o(...t){if(!o.enabled)return;const n=o,i=Number(new Date),a=i-(r||i);n.diff=a,n.prev=r,n.curr=i,r=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];r=o.call(n,e),t.splice(s,1),s--}return r})),e.formatArgs.call(n,t);(n.log||e.log).apply(n,t)}return o.namespace=t,o.useColors=e.useColors(),o.color=e.selectColor(t),o.extend=n,o.destroy=e.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null===i?e.enabled(t):i,set:t=>{i=t}}),"function"==typeof e.init&&e.init(o),o}function n(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function r(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(r),...e.skips.map(r).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=wo,e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e},Eo=e((function(t,e){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&void 0!==ae&&"env"in ae&&(t=ae.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=ko(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}));Eo.formatArgs,Eo.save,Eo.load,Eo.useColors,Eo.storage,Eo.destroy,Eo.colors,Eo.log;var Ao,So={isatty:function(){return!1},ReadStream:function(){throw new Error("tty.ReadStream is not implemented")},WriteStream:function(){throw new Error("tty.ReadStream is not implemented")}};function Co(){return"/tmp"}var xo={EOL:"\n",tmpdir:Co,tmpDir:Co,networkInterfaces:function(){},getNetworkInterfaces:function(){},release:function(){return void 0!==Bt.navigator?Bt.navigator.appVersion:""},type:function(){return"Browser"},cpus:function(){return[]},totalmem:function(){return Number.MAX_VALUE},freemem:function(){return Number.MAX_VALUE},uptime:function(){return 0},loadavg:function(){return[]},hostname:function(){return void 0!==Bt.location?Bt.location.hostname:""},endianness:function(){if(void 0===Ao){var t=new ArrayBuffer(2),e=new Uint8Array(t),n=new Uint16Array(t);if(e[0]=1,e[1]=2,258===n[0])Ao="BE";else{if(513!==n[0])throw new Error("unable to figure out endianess");Ao="LE"}}return Ao}},To=(t,e=ae.argv)=>{const n=t.startsWith("-")?"":1===t.length?"-":"--",r=e.indexOf(n+t),i=e.indexOf("--");return-1!==r&&(-1===i||r<i)};const{env:Ro}=ae;let Oo;function Io(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function No(t,e){if(0===Oo)return 0;if(To("color=16m")||To("color=full")||To("color=truecolor"))return 3;if(To("color=256"))return 2;if(t&&!e&&void 0===Oo)return 0;const n=Oo||0;if("dumb"===Ro.TERM)return n;if("win32"===ae.platform){const t=xo.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in Ro)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((t=>t in Ro))||"codeship"===Ro.CI_NAME?1:n;if("TEAMCITY_VERSION"in Ro)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ro.TEAMCITY_VERSION)?1:0;if("truecolor"===Ro.COLORTERM)return 3;if("TERM_PROGRAM"in Ro){const t=parseInt((Ro.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ro.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ro.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ro.TERM)||"COLORTERM"in Ro?1:n}To("no-color")||To("no-colors")||To("color=false")||To("color=never")?Oo=0:(To("color")||To("colors")||To("color=true")||To("color=always"))&&(Oo=1),"FORCE_COLOR"in Ro&&(Oo="true"===Ro.FORCE_COLOR?1:"false"===Ro.FORCE_COLOR?0:0===Ro.FORCE_COLOR.length?1:Math.min(parseInt(Ro.FORCE_COLOR,10),3));var jo={supportsColor:function(t){return Io(No(t,t&&t.isTTY))},stdout:Io(No(!0,So.isatty(1))),stderr:Io(No(!0,So.isatty(2)))},Lo=e((function(t,e){e.init=function(t){t.inspectOpts={};const n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]},e.log=function(...t){return ae.stderr.write(ir.format(...t)+"\n")},e.formatArgs=function(n){const{namespace:r,useColors:i}=this;if(i){const e=this.color,i="[3"+(e<8?e:"8;5;"+e),o=` ${i};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(i+"m+"+t.exports.humanize(this.diff)+"")}else n[0]=function(){if(e.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},e.save=function(t){t?ae.env.DEBUG=t:delete ae.env.DEBUG},e.load=function(){return ae.env.DEBUG},e.useColors=function(){return"colors"in e.inspectOpts?Boolean(e.inspectOpts.colors):So.isatty(ae.stderr.fd)},e.destroy=ir.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{const t=jo;t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}e.inspectOpts=Object.keys(ae.env).filter((t=>/^debug_/i.test(t))).reduce(((t,e)=>{const n=e.substring(6).toLowerCase().replace(/_([a-z])/g,((t,e)=>e.toUpperCase()));let r=ae.env[e];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),t[n]=r,t}),{}),t.exports=ko(e);const{formatters:n}=t.exports;n.o=function(t){return this.inspectOpts.colors=this.useColors,ir.inspect(t,this.inspectOpts).split("\n").map((t=>t.trim())).join(" ")},n.O=function(t){return this.inspectOpts.colors=this.useColors,ir.inspect(t,this.inspectOpts)}}));Lo.init,Lo.log,Lo.formatArgs,Lo.save,Lo.load,Lo.useColors,Lo.destroy,Lo.colors,Lo.inspectOpts;var Bo,Po=e((function(t){void 0===ae||"renderer"===ae.type||!0===ae.browser||ae.__nwjs?t.exports=Eo:t.exports=Lo})),Uo=function(){if(!Bo)try{Bo=Po("follow-redirects")}catch(t){Bo=function(){}}Bo.apply(null,arguments)},Mo=Ci.URL,zo=oi.Writable,Do=["abort","aborted","connect","error","socket","timeout"],Fo=Object.create(null);Do.forEach((function(t){Fo[t]=function(e,n,r){this._redirectable.emit(t,e,n,r)}}));var qo=Jo("ERR_FR_REDIRECTION_FAILURE",""),Zo=Jo("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),Wo=Jo("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Ho=Jo("ERR_STREAM_WRITE_AFTER_END","write after end");function $o(t,e){zo.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var n=this;this._onNativeResponse=function(t){n._processResponse(t)},this._performRequest()}function Ko(t){var e={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(t).forEach((function(r){var i=r+":",o=n[i]=t[r],a=e[r]=Object.create(o);Object.defineProperties(a,{request:{value:function(t,r,o){if("string"==typeof t){var a=t;try{t=function(t){var e={protocol:t.protocol,hostname:t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:t.pathname+t.search,href:t.href};""!==t.port&&(e.port=Number(t.port));return e}(new Mo(a))}catch(e){t=Ci.parse(a)}}else o=r,r=t,t={protocol:i};return"function"==typeof r&&(o=r,r=null),(r=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},t,r)).nativeProtocols=n,eo.equal(r.protocol,i,"protocol mismatch"),Uo("options",r),new $o(r,o)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(t,e,n){var r=a.request(t,e,n);return r.end(),r},configurable:!0,enumerable:!0,writable:!0}})})),e}function Yo(){}function Go(t,e){var n;for(var r in e)t.test(r)&&(n=e[r],delete e[r]);return n}function Jo(t,e){function n(t){Error.captureStackTrace(this,this.constructor),this.message=t||e}return n.prototype=new Error,n.prototype.constructor=n,n.prototype.name="Error ["+t+"]",n.prototype.code=t,n}function Vo(t){for(var e=0;e<Do.length;e++)t.removeListener(Do[e],Fo[Do[e]]);t.on("error",Yo),t.abort()}$o.prototype=Object.create(zo.prototype),$o.prototype.abort=function(){Vo(this._currentRequest),this.emit("abort")},$o.prototype.write=function(t,e,n){if(this._ending)throw new Ho;if(!("string"==typeof t||"object"==typeof t&&"length"in t))throw new TypeError("data should be a string, Buffer or Uint8Array");"function"==typeof e&&(n=e,e=null),0!==t.length?this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,n)):(this.emit("error",new Wo),this.abort()):n&&n()},$o.prototype.end=function(t,e,n){if("function"==typeof t?(n=t,t=e=null):"function"==typeof e&&(n=e,e=null),t){var r=this,i=this._currentRequest;this.write(t,e,(function(){r._ended=!0,i.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},$o.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)},$o.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)},$o.prototype.setTimeout=function(t,e){var n=this;function r(e){e.setTimeout(t),e.removeListener("timeout",e.destroy),e.addListener("timeout",e.destroy)}function i(e){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),o()}),t),r(e)}function o(){clearTimeout(this._timeout),e&&n.removeListener("timeout",e),this.socket||n._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",r),this.once("response",o),this.once("error",o),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(t){$o.prototype[t]=function(e,n){return this._currentRequest[t](e,n)}})),["aborted","connection","socket"].forEach((function(t){Object.defineProperty($o.prototype,t,{get:function(){return this._currentRequest[t]}})})),$o.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}},$o.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(e){if(this._options.agents){var n=t.substr(0,t.length-1);this._options.agent=this._options.agents[n]}var r=this._currentRequest=e.request(this._options,this._onNativeResponse);this._currentUrl=Ci.format(this._options),r._redirectable=this;for(var i=0;i<Do.length;i++)r.on(Do[i],Fo[Do[i]]);if(this._isRedirect){var o=0,a=this,s=this._requestBodyBuffers;!function t(e){if(r===a._currentRequest)if(e)a.emit("error",e);else if(o<s.length){var n=s[o++];r.finished||r.write(n.data,n.encoding,t)}else a._ended&&r.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+t))},$o.prototype._processResponse=function(t){var e=t.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:t.headers,statusCode:e});var n=t.headers.location;if(n&&!1!==this._options.followRedirects&&e>=300&&e<400){if(Vo(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects)return void this.emit("error",new Zo);((301===e||302===e)&&"POST"===this._options.method||303===e&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Go(/^content-/i,this._options.headers));var r=Go(/^host$/i,this._options.headers)||Ci.parse(this._currentUrl).hostname,i=Ci.resolve(this._currentUrl,n);Uo("redirecting to",i),this._isRedirect=!0;var o=Ci.parse(i);if(Object.assign(this._options,o),o.hostname!==r&&Go(/^authorization$/i,this._options.headers),"function"==typeof this._options.beforeRedirect){var a={headers:t.headers};try{this._options.beforeRedirect.call(null,this._options,a)}catch(t){return void this.emit("error",t)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(t){var s=new qo("Redirected request failed: "+t.message);s.cause=t,this.emit("error",s)}}else t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),this._requestBodyBuffers=[]};var Xo=Ko({http:$i,https:$i}),Qo=Ko;Xo.wrap=Qo;var ta={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function ea(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function na(t,e,n,r,i){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+r),i);else for(var o=0;o<r;o++)t[i+o]=e[n+o]}var ra=Uint8Array,ia=Uint16Array,oa=Int32Array;function aa(t){for(var e=t.length;--e>=0;)t[e]=0}var sa=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ua=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ca=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],la=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa=new Array(576);aa(fa);var ha=new Array(60);aa(ha);var da=new Array(512);aa(da);var pa=new Array(256);aa(pa);var ga=new Array(29);aa(ga);var va,_a,ma,ya=new Array(30);function wa(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}function ba(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function ka(t){return t<256?da[t]:da[256+(t>>>7)]}function Ea(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function Aa(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,Ea(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function Sa(t,e,n){Aa(t,n[2*e],n[2*e+1])}function Ca(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}function xa(t,e,n){var r,i,o=new Array(16),a=0;for(r=1;r<=15;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=Ca(o[s]++,s))}}function Ta(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Ra(t){t.bi_valid>8?Ea(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function Oa(t,e,n,r){var i=2*e,o=2*n;return t[i]<t[o]||t[i]===t[o]&&r[e]<=r[n]}function Ia(t,e,n){for(var r=t.heap[n],i=n<<1;i<=t.heap_len&&(i<t.heap_len&&Oa(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Oa(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function Na(t,e,n){var r,i,o,a,s=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*s]<<8|t.pending_buf[t.d_buf+2*s+1],i=t.pending_buf[t.l_buf+s],s++,0===r?Sa(t,i,e):(Sa(t,(o=pa[i])+256+1,e),0!==(a=sa[o])&&Aa(t,i-=ga[o],a),Sa(t,o=ka(--r),n),0!==(a=ua[o])&&Aa(t,r-=ya[o],a))}while(s<t.last_lit);Sa(t,256,e)}function ja(t,e){var n,r,i,o=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,u=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<u;n++)0!==o[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(i=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=c,n=t.heap_len>>1;n>=1;n--)Ia(t,o,n);i=u;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Ia(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*i]=o[2*n]+o[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,o[2*n+1]=o[2*r+1]=i,t.heap[1]=i++,Ia(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,r,i,o,a,s,u=e.dyn_tree,c=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,h=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)(o=u[2*u[2*(r=t.heap[n])+1]+1]+1)>p&&(o=p,g++),u[2*r+1]=o,r>c||(t.bl_count[o]++,a=0,r>=d&&(a=h[r-d]),s=u[2*r],t.opt_len+=s*(o+a),f&&(t.static_len+=s*(l[2*r+1]+a)));if(0!==g){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(r=t.bl_count[o];0!==r;)(i=t.heap[--n])>c||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}(t,e),xa(o,c,t.bl_count)}function La(t,e,n){var r,i,o=-1,a=e[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=e[2*(r+1)+1],++s<u&&i===a||(s<c?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))}function Ba(t,e,n){var r,i,o=-1,a=e[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),r=0;r<=n;r++)if(i=a,a=e[2*(r+1)+1],!(++s<u&&i===a)){if(s<c)do{Sa(t,i,t.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(Sa(t,i,t.bl_tree),s--),Sa(t,16,t.bl_tree),Aa(t,s-3,2)):s<=10?(Sa(t,17,t.bl_tree),Aa(t,s-3,3)):(Sa(t,18,t.bl_tree),Aa(t,s-11,7));s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4)}}aa(ya);var Pa=!1;function Ua(t){Pa||(!function(){var t,e,n,r,i,o=new Array(16);for(n=0,r=0;r<28;r++)for(ga[r]=n,t=0;t<1<<sa[r];t++)pa[n++]=r;for(pa[n-1]=r,i=0,r=0;r<16;r++)for(ya[r]=i,t=0;t<1<<ua[r];t++)da[i++]=r;for(i>>=7;r<30;r++)for(ya[r]=i<<7,t=0;t<1<<ua[r]-7;t++)da[256+i++]=r;for(e=0;e<=15;e++)o[e]=0;for(t=0;t<=143;)fa[2*t+1]=8,t++,o[8]++;for(;t<=255;)fa[2*t+1]=9,t++,o[9]++;for(;t<=279;)fa[2*t+1]=7,t++,o[7]++;for(;t<=287;)fa[2*t+1]=8,t++,o[8]++;for(xa(fa,287,o),t=0;t<30;t++)ha[2*t+1]=5,ha[2*t]=Ca(t,5);va=new wa(fa,sa,257,286,15),_a=new wa(ha,ua,0,30,15),ma=new wa(new Array(0),ca,0,19,7)}(),Pa=!0),t.l_desc=new ba(t.dyn_ltree,va),t.d_desc=new ba(t.dyn_dtree,_a),t.bl_desc=new ba(t.bl_tree,ma),t.bi_buf=0,t.bi_valid=0,Ta(t)}function Ma(t,e,n,r){Aa(t,0+(r?1:0),3),function(t,e,n,r){Ra(t),r&&(Ea(t,n),Ea(t,~n)),na(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n,!0)}function za(t){Aa(t,2,3),Sa(t,256,fa),function(t){16===t.bi_valid?(Ea(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}function Da(t,e,n,r){var i,o,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),ja(t,t.l_desc),ja(t,t.d_desc),a=function(t){var e;for(La(t,t.dyn_ltree,t.l_desc.max_code),La(t,t.dyn_dtree,t.d_desc.max_code),ja(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*la[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==e?Ma(t,e,n,r):4===t.strategy||o===i?(Aa(t,2+(r?1:0),3),Na(t,fa,ha)):(Aa(t,4+(r?1:0),3),function(t,e,n,r){var i;for(Aa(t,e-257,5),Aa(t,n-1,5),Aa(t,r-4,4),i=0;i<r;i++)Aa(t,t.bl_tree[2*la[i]+1],3);Ba(t,t.dyn_ltree,e-1),Ba(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),Na(t,t.dyn_ltree,t.dyn_dtree)),Ta(t),r&&Ra(t)}function Fa(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(pa[n]+256+1)]++,t.dyn_dtree[2*ka(e)]++),t.last_lit===t.lit_bufsize-1}function qa(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+e[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}var Za=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();function Wa(t,e,n,r){var i=Za,o=r+n;t^=-1;for(var a=r;a<o;a++)t=t>>>8^i[255&(t^e[a])];return-1^t}var Ha;function $a(t,e){return t.msg=ta[e],e}function Ka(t){return(t<<1)-(t>4?9:0)}function Ya(t){for(var e=t.length;--e>=0;)t[e]=0}function Ga(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(na(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function Ja(t,e){Da(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Ga(t.strm)}function Va(t,e){t.pending_buf[t.pending++]=e}function Xa(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function Qa(t,e){var n,r,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,c=t.window,l=t.w_mask,f=t.prev,h=t.strstart+258,d=c[o+a-1],p=c[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(c[(n=e)+a]===p&&c[n+a-1]===d&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<h);if(r=258-(h-o),o=h-258,r>a){if(t.match_start=e,a=r,r>=s)break;d=c[o+a-1],p=c[o+a]}}}while((e=f[e&l])>u&&0!=--i);return a<=t.lookahead?a:t.lookahead}function ts(t){var e,n,r,i,o,a,s,u,c,l,f=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-262)){na(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=n=t.hash_size;do{r=t.head[--e],t.head[e]=r>=f?r-f:0}while(--n);e=n=f;do{r=t.prev[--e],t.prev[e]=r>=f?r-f:0}while(--n);i+=f}if(0===t.strm.avail_in)break;if(a=t.strm,s=t.window,u=t.strstart+t.lookahead,c=i,l=void 0,(l=a.avail_in)>c&&(l=c),n=0===l?0:(a.avail_in-=l,na(s,a.input,a.next_in,l,u),1===a.state.wrap?a.adler=qa(a.adler,s,l,u):2===a.state.wrap&&(a.adler=Wa(a.adler,s,l,u)),a.next_in+=l,a.total_in+=l,l),t.lookahead+=n,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+3-1])&t.hash_mask,t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function es(t,e){for(var n,r;;){if(t.lookahead<262){if(ts(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-262&&(t.match_length=Qa(t,n)),t.match_length>=3)if(r=Fa(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=Fa(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(Ja(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Ja(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ja(t,!1),0===t.strm.avail_out)?1:2}function ns(t,e){for(var n,r,i;;){if(t.lookahead<262){if(ts(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-262&&(t.match_length=Qa(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,r=Fa(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(Ja(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=Fa(t,0,t.window[t.strstart-1]))&&Ja(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=Fa(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Ja(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ja(t,!1),0===t.strm.avail_out)?1:2}function rs(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}function is(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ia(1146),this.dyn_dtree=new ia(122),this.bl_tree=new ia(78),Ya(this.dyn_ltree),Ya(this.dyn_dtree),Ya(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ia(16),this.heap=new ia(573),Ya(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ia(573),Ya(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function os(t){var e=function(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=0,Ua(e),0):$a(t,-2)}(t);return 0===e&&function(t){t.window_size=2*t.w_size,Ya(t.head),t.max_lazy_match=Ha[t.level].max_lazy,t.good_match=Ha[t.level].good_length,t.nice_match=Ha[t.level].nice_length,t.max_chain_length=Ha[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),e}function as(t,e){var n,r,i,o;if(!t||!t.state||e>5||e<0)return t?$a(t,-2):-2;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||666===r.status&&4!==e)return $a(t,0===t.avail_out?-5:-2);if(r.strm=t,n=r.last_flush,r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Va(r,31),Va(r,139),Va(r,8),r.gzhead?(Va(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Va(r,255&r.gzhead.time),Va(r,r.gzhead.time>>8&255),Va(r,r.gzhead.time>>16&255),Va(r,r.gzhead.time>>24&255),Va(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Va(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Va(r,255&r.gzhead.extra.length),Va(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Wa(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Va(r,0),Va(r,0),Va(r,0),Va(r,0),Va(r,0),Va(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Va(r,3),r.status=113);else{var a=8+(r.w_bits-8<<4)<<8;a|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=113,Xa(r,a),0!==r.strstart&&(Xa(r,t.adler>>>16),Xa(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),Ga(t),i=r.pending,r.pending!==r.pending_buf_size));)Va(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),Ga(t),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Va(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),Ga(t),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Va(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Ga(t),r.pending+2<=r.pending_buf_size&&(Va(r,255&t.adler),Va(r,t.adler>>8&255),t.adler=0,r.status=113)):r.status=113),0!==r.pending){if(Ga(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&Ka(e)<=Ka(n)&&4!==e)return $a(t,-5);if(666===r.status&&0!==t.avail_in)return $a(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&666!==r.status){var s=2===r.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(ts(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=Fa(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(Ja(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Ja(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ja(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var n,r,i,o,a=t.window;;){if(t.lookahead<=258){if(ts(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=a[i=t.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){o=t.strstart+258;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);t.match_length=258-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=Fa(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Fa(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(Ja(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Ja(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ja(t,!1),0===t.strm.avail_out)?1:2}(r,e):Ha[r.level].func(r,e);if(3!==s&&4!==s||(r.status=666),1===s||3===s)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===s&&(1===e?za(r):5!==e&&(Ma(r,0,0,!1),3===e&&(Ya(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Ga(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Va(r,255&t.adler),Va(r,t.adler>>8&255),Va(r,t.adler>>16&255),Va(r,t.adler>>24&255),Va(r,255&t.total_in),Va(r,t.total_in>>8&255),Va(r,t.total_in>>16&255),Va(r,t.total_in>>24&255)):(Xa(r,t.adler>>>16),Xa(r,65535&t.adler)),Ga(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)}Ha=[new rs(0,0,0,0,(function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ts(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,Ja(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(Ja(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Ja(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ja(t,!1),t.strm.avail_out),1)})),new rs(4,4,8,4,es),new rs(4,5,16,8,es),new rs(4,6,32,32,es),new rs(4,4,16,16,ns),new rs(8,16,32,32,ns),new rs(8,16,128,128,ns),new rs(8,32,128,256,ns),new rs(32,128,258,1024,ns),new rs(32,258,258,4096,ns)];function ss(t,e){var n,r,i,o,a,s,u,c,l,f,h,d,p,g,v,_,m,y,w,b,k,E,A,S,C;n=t.state,r=t.next_in,S=t.input,i=r+(t.avail_in-5),o=t.next_out,C=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),u=n.dmax,c=n.wsize,l=n.whave,f=n.wnext,h=n.window,d=n.hold,p=n.bits,g=n.lencode,v=n.distcode,_=(1<<n.lenbits)-1,m=(1<<n.distbits)-1;t:do{p<15&&(d+=S[r++]<<p,p+=8,d+=S[r++]<<p,p+=8),y=g[d&_];e:for(;;){if(d>>>=w=y>>>24,p-=w,0===(w=y>>>16&255))C[o++]=65535&y;else{if(!(16&w)){if(0==(64&w)){y=g[(65535&y)+(d&(1<<w)-1)];continue e}if(32&w){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}b=65535&y,(w&=15)&&(p<w&&(d+=S[r++]<<p,p+=8),b+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=S[r++]<<p,p+=8,d+=S[r++]<<p,p+=8),y=v[d&m];n:for(;;){if(d>>>=w=y>>>24,p-=w,!(16&(w=y>>>16&255))){if(0==(64&w)){y=v[(65535&y)+(d&(1<<w)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(k=65535&y,p<(w&=15)&&(d+=S[r++]<<p,(p+=8)<w&&(d+=S[r++]<<p,p+=8)),(k+=d&(1<<w)-1)>u){t.msg="invalid distance too far back",n.mode=30;break t}if(d>>>=w,p-=w,k>(w=o-a)){if((w=k-w)>l&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(E=0,A=h,0===f){if(E+=c-w,w<b){b-=w;do{C[o++]=h[E++]}while(--w);E=o-k,A=C}}else if(f<w){if(E+=c+f-w,(w-=f)<b){b-=w;do{C[o++]=h[E++]}while(--w);if(E=0,f<b){b-=w=f;do{C[o++]=h[E++]}while(--w);E=o-k,A=C}}}else if(E+=f-w,w<b){b-=w;do{C[o++]=h[E++]}while(--w);E=o-k,A=C}for(;b>2;)C[o++]=A[E++],C[o++]=A[E++],C[o++]=A[E++],b-=3;b&&(C[o++]=A[E++],b>1&&(C[o++]=A[E++]))}else{E=o-k;do{C[o++]=C[E++],C[o++]=C[E++],C[o++]=C[E++],b-=3}while(b>2);b&&(C[o++]=C[E++],b>1&&(C[o++]=C[E++]))}break}}break}}while(r<i&&o<s);r-=b=p>>3,d&=(1<<(p-=b<<3))-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=o<s?s-o+257:257-(o-s),n.hold=d,n.bits=p}var us=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],cs=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],ls=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],fs=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function hs(t,e,n,r,i,o,a,s){var u,c,l,f,h,d,p,g,v,_=s.bits,m=0,y=0,w=0,b=0,k=0,E=0,A=0,S=0,C=0,x=0,T=null,R=0,O=new ia(16),I=new ia(16),N=null,j=0;for(m=0;m<=15;m++)O[m]=0;for(y=0;y<r;y++)O[e[n+y]]++;for(k=_,b=15;b>=1&&0===O[b];b--);if(k>b&&(k=b),0===b)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(w=1;w<b&&0===O[w];w++);for(k<w&&(k=w),S=1,m=1;m<=15;m++)if(S<<=1,(S-=O[m])<0)return-1;if(S>0&&(0===t||1!==b))return-1;for(I[1]=0,m=1;m<15;m++)I[m+1]=I[m]+O[m];for(y=0;y<r;y++)0!==e[n+y]&&(a[I[e[n+y]]++]=y);if(0===t?(T=N=a,d=19):1===t?(T=us,R-=257,N=cs,j-=257,d=256):(T=ls,N=fs,d=-1),x=0,y=0,m=w,h=o,E=k,A=0,l=-1,f=(C=1<<k)-1,1===t&&C>852||2===t&&C>592)return 1;for(;;){p=m-A,a[y]<d?(g=0,v=a[y]):a[y]>d?(g=N[j+a[y]],v=T[R+a[y]]):(g=96,v=0),u=1<<m-A,w=c=1<<E;do{i[h+(x>>A)+(c-=u)]=p<<24|g<<16|v|0}while(0!==c);for(u=1<<m-1;x&u;)u>>=1;if(0!==u?(x&=u-1,x+=u):x=0,y++,0==--O[m]){if(m===b)break;m=e[n+a[y]]}if(m>k&&(x&f)!==l){for(0===A&&(A=k),h+=w,S=1<<(E=m-A);E+A<b&&!((S-=O[E+A])<=0);)E++,S<<=1;if(C+=1<<E,1===t&&C>852||2===t&&C>592)return 1;i[l=x&f]=k<<24|E<<16|h-o|0}}return 0!==x&&(i[h+x]=m-A<<24|64<<16|0),s.bits=k,0}function ds(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function ps(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new ia(320),this.work=new ia(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function gs(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,function(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new oa(852),e.distcode=e.distdyn=new oa(592),e.sane=1,e.back=-1,0):-2}(t)):-2}function vs(t,e){var n,r;return t?(r=new ps,t.state=r,r.window=null,0!==(n=function(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,gs(t))):-2}(t,e))&&(t.state=null),n):-2}var _s,ms,ys=!0;function ws(t){if(ys){var e;for(_s=new oa(512),ms=new oa(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(hs(1,t.lens,0,288,_s,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;hs(2,t.lens,0,32,ms,0,t.work,{bits:5}),ys=!1}t.lencode=_s,t.lenbits=9,t.distcode=ms,t.distbits=5}function bs(t,e){var n,r,i,o,a,s,u,c,l,f,h,d,p,g,v,_,m,y,w,b,k,E,A,S,C=0,x=new ra(4),T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(n=t.state).mode&&(n.mode=13),a=t.next_out,i=t.output,u=t.avail_out,o=t.next_in,r=t.input,s=t.avail_in,c=n.hold,l=n.bits,f=s,h=u,E=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;l<16;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(2&n.wrap&&35615===c){n.check=0,x[0]=255&c,x[1]=c>>>8&255,n.check=Wa(n.check,x,2,0),c=0,l=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&c)){t.msg="unknown compression method",n.mode=30;break}if(l-=4,k=8+(15&(c>>>=4)),0===n.wbits)n.wbits=k;else if(k>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<k,t.adler=n.check=1,n.mode=512&c?10:12,c=0,l=0;break;case 2:for(;l<16;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(n.flags=c,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&(x[0]=255&c,x[1]=c>>>8&255,n.check=Wa(n.check,x,2,0)),c=0,l=0,n.mode=3;case 3:for(;l<32;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.head&&(n.head.time=c),512&n.flags&&(x[0]=255&c,x[1]=c>>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,n.check=Wa(n.check,x,4,0)),c=0,l=0,n.mode=4;case 4:for(;l<16;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&(x[0]=255&c,x[1]=c>>>8&255,n.check=Wa(n.check,x,2,0)),c=0,l=0,n.mode=5;case 5:if(1024&n.flags){for(;l<16;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&(x[0]=255&c,x[1]=c>>>8&255,n.check=Wa(n.check,x,2,0)),c=0,l=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((d=n.length)>s&&(d=s),d&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),na(n.head.extra,r,o,d,k)),512&n.flags&&(n.check=Wa(n.check,r,d,o)),s-=d,o+=d,n.length-=d),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===s)break t;d=0;do{k=r[o+d++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k))}while(k&&d<s);if(512&n.flags&&(n.check=Wa(n.check,r,d,o)),s-=d,o+=d,k)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===s)break t;d=0;do{k=r[o+d++],n.head&&k&&n.length<65536&&(n.head.comment+=String.fromCharCode(k))}while(k&&d<s);if(512&n.flags&&(n.check=Wa(n.check,r,d,o)),s-=d,o+=d,k)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;l<16;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(c!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}c=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;l<32;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}t.adler=n.check=ds(c),c=0,l=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=a,t.avail_out=u,t.next_in=o,t.avail_in=s,n.hold=c,n.bits=l,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){c>>>=7&l,l-=7&l,n.mode=27;break}for(;l<3;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}switch(n.last=1&c,l-=1,3&(c>>>=1)){case 0:n.mode=14;break;case 1:if(ws(n),n.mode=20,6===e){c>>>=2,l-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}c>>>=2,l-=2;break;case 14:for(c>>>=7&l,l-=7&l;l<32;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&c,c=0,l=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(d=n.length){if(d>s&&(d=s),d>u&&(d=u),0===d)break t;na(i,r,o,d,a),s-=d,o+=d,u-=d,a+=d,n.length-=d;break}n.mode=12;break;case 17:for(;l<14;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(n.nlen=257+(31&c),c>>>=5,l-=5,n.ndist=1+(31&c),c>>>=5,l-=5,n.ncode=4+(15&c),c>>>=4,l-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;l<3;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.lens[T[n.have++]]=7&c,c>>>=3,l-=3}for(;n.have<19;)n.lens[T[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,A={bits:n.lenbits},E=hs(0,n.lens,0,19,n.lencode,0,n.work,A),n.lenbits=A.bits,E){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;_=(C=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=l);){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(m<16)c>>>=v,l-=v,n.lens[n.have++]=m;else{if(16===m){for(S=v+2;l<S;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(c>>>=v,l-=v,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}k=n.lens[n.have-1],d=3+(3&c),c>>>=2,l-=2}else if(17===m){for(S=v+3;l<S;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}l-=v,k=0,d=3+(7&(c>>>=v)),c>>>=3,l-=3}else{for(S=v+7;l<S;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}l-=v,k=0,d=11+(127&(c>>>=v)),c>>>=7,l-=7}if(n.have+d>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;d--;)n.lens[n.have++]=k}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,A={bits:n.lenbits},E=hs(1,n.lens,0,n.nlen,n.lencode,0,n.work,A),n.lenbits=A.bits,E){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,A={bits:n.distbits},E=hs(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,A),n.distbits=A.bits,E){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(s>=6&&u>=258){t.next_out=a,t.avail_out=u,t.next_in=o,t.avail_in=s,n.hold=c,n.bits=l,ss(t,h),a=t.next_out,i=t.output,u=t.avail_out,o=t.next_in,r=t.input,s=t.avail_in,c=n.hold,l=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;_=(C=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=l);){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(_&&0==(240&_)){for(y=v,w=_,b=m;_=(C=n.lencode[b+((c&(1<<y+w)-1)>>y)])>>>16&255,m=65535&C,!(y+(v=C>>>24)<=l);){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=v,l-=v,n.back+=v,n.length=m,0===_){n.mode=26;break}if(32&_){n.back=-1,n.mode=12;break}if(64&_){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&_,n.mode=22;case 22:if(n.extra){for(S=n.extra;l<S;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;_=(C=n.distcode[c&(1<<n.distbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=l);){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(0==(240&_)){for(y=v,w=_,b=m;_=(C=n.distcode[b+((c&(1<<y+w)-1)>>y)])>>>16&255,m=65535&C,!(y+(v=C>>>24)<=l);){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=v,l-=v,n.back+=v,64&_){t.msg="invalid distance code",n.mode=30;break}n.offset=m,n.extra=15&_,n.mode=24;case 24:if(n.extra){for(S=n.extra;l<S;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===u)break t;if(d=h-u,n.offset>d){if((d=n.offset-d)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),g=n.window}else g=i,p=a-n.offset,d=n.length;d>u&&(d=u),u-=d,n.length-=d;do{i[a++]=g[p++]}while(--d);0===n.length&&(n.mode=21);break;case 26:if(0===u)break t;i[a++]=n.length,u--,n.mode=21;break;case 27:if(n.wrap){for(;l<32;){if(0===s)break t;s--,c|=r[o++]<<l,l+=8}if(h-=u,t.total_out+=h,n.total+=h,h&&(t.adler=n.check=n.flags?Wa(n.check,i,h,a-h):qa(n.check,i,h,a-h)),h=u,(n.flags?c:ds(c))!==n.check){t.msg="incorrect data check",n.mode=30;break}c=0,l=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;l<32;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(c!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}c=0,l=0}n.mode=29;case 29:E=1;break t;case 30:E=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=a,t.avail_out=u,t.next_in=o,t.avail_in=s,n.hold=c,n.bits=l,(n.wsize||h!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&function(t,e,n,r){var i,o=t.state;null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new ra(o.wsize)),r>=o.wsize?(na(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>r&&(i=r),na(o.window,e,n-r,i,o.wnext),(r-=i)?(na(o.window,e,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i)))}(t,t.output,t.next_out,h-t.avail_out),f-=t.avail_in,h-=t.avail_out,t.total_in+=f,t.total_out+=h,n.total+=h,n.wrap&&h&&(t.adler=n.check=n.flags?Wa(n.check,i,h,t.next_out-h):qa(n.check,i,h,t.next_out-h)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===f&&0===h||4===e)&&0===E&&(E=-5),E}var ks;function Es(t){if(t<1||t>7)throw new TypeError("Bad argument");this.mode=t,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function As(t,e){for(var n=0;n<t.length;n++)this[e+n]=t[n]}Es.prototype.init=function(t,e,n,r,i){var o;switch(this.windowBits=t,this.level=e,this.memLevel=n,this.strategy=r,3!==this.mode&&4!==this.mode||(this.windowBits+=16),7===this.mode&&(this.windowBits+=32),5!==this.mode&&6!==this.mode||(this.windowBits=-this.windowBits),this.strm=new ea,this.mode){case 1:case 3:case 5:o=function(t,e,n,r,i,o){if(!t)return-2;var a=1;if(-1===e&&(e=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||8!==n||r<8||r>15||e<0||e>9||o<0||o>4)return $a(t,-2);8===r&&(r=9);var s=new is;return t.state=s,s.strm=t,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new ra(2*s.w_size),s.head=new ia(s.hash_size),s.prev=new ia(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new ra(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=e,s.strategy=o,s.method=n,os(t)}(this.strm,this.level,8,this.windowBits,this.memLevel,this.strategy);break;case 2:case 4:case 6:case 7:o=vs(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}0===o?(this.write_in_progress=!1,this.init_done=!0):this._error(o)},Es.prototype.params=function(){throw new Error("deflateParams Not supported")},Es.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(0===this.mode)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},Es.prototype.write=function(t,e,n,r,i,o,a){this._writeCheck(),this.write_in_progress=!0;var s=this;return ae.nextTick((function(){s.write_in_progress=!1;var u=s._write(t,e,n,r,i,o,a);s.callback(u[0],u[1]),s.pending_close&&s.close()})),this},Es.prototype.writeSync=function(t,e,n,r,i,o,a){return this._writeCheck(),this._write(t,e,n,r,i,o,a)},Es.prototype._write=function(t,e,n,r,i,o,a){if(this.write_in_progress=!0,0!==t&&1!==t&&2!==t&&3!==t&&4!==t&&5!==t)throw new Error("Invalid flush value");null==e&&(e=new Re(0),r=0,n=0),i._set?i.set=i._set:i.set=As;var s,u=this.strm;switch(u.avail_in=r,u.input=e,u.next_in=n,u.avail_out=a,u.output=i,u.next_out=o,this.mode){case 1:case 3:case 5:s=as(u,t);break;case 7:case 2:case 4:case 6:s=bs(u,t);break;default:throw new Error("Unknown mode "+this.mode)}return 1!==s&&0!==s&&this._error(s),this.write_in_progress=!1,[u.avail_in,u.avail_out]},Es.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,1===this.mode||3===this.mode||5===this.mode?function(t){var e;t&&t.state&&(42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?$a(t,-2):(t.state=null,113===e&&$a(t,-3)))}(this.strm):function(t){if(!t||!t.state)return-2;var e=t.state;e.window&&(e.window=null),t.state=null}(this.strm),this.mode=0)},Es.prototype.reset=function(){switch(this.mode){case 1:case 5:ks=os(this.strm);break;case 2:case 6:ks=gs(this.strm)}0!==ks&&this._error(ks)},Es.prototype._error=function(t){this.onerror(ta[t]+": "+this.strm.msg,t),this.write_in_progress=!1,this.pending_close&&this.close()};var Ss=Object.freeze({__proto__:null,NONE:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8,Zlib:Es});var Cs={};Object.keys(Ss).forEach((function(t){Cs[t]=Ss[t]})),Cs.Z_MIN_WINDOWBITS=8,Cs.Z_MAX_WINDOWBITS=15,Cs.Z_DEFAULT_WINDOWBITS=15,Cs.Z_MIN_CHUNK=64,Cs.Z_MAX_CHUNK=1/0,Cs.Z_DEFAULT_CHUNK=16384,Cs.Z_MIN_MEMLEVEL=1,Cs.Z_MAX_MEMLEVEL=9,Cs.Z_DEFAULT_MEMLEVEL=8,Cs.Z_MIN_LEVEL=-1,Cs.Z_MAX_LEVEL=9,Cs.Z_DEFAULT_LEVEL=Cs.Z_DEFAULT_COMPRESSION;var xs={Z_OK:Cs.Z_OK,Z_STREAM_END:Cs.Z_STREAM_END,Z_NEED_DICT:Cs.Z_NEED_DICT,Z_ERRNO:Cs.Z_ERRNO,Z_STREAM_ERROR:Cs.Z_STREAM_ERROR,Z_DATA_ERROR:Cs.Z_DATA_ERROR,Z_MEM_ERROR:Cs.Z_MEM_ERROR,Z_BUF_ERROR:Cs.Z_BUF_ERROR,Z_VERSION_ERROR:Cs.Z_VERSION_ERROR};function Ts(t,e,n){var r=[],i=0;function o(){for(var e;null!==(e=t.read());)r.push(e),i+=e.length;t.once("readable",o)}function a(){var e=Re.concat(r,i);r=[],n(null,e),t.close()}t.on("error",(function(e){t.removeListener("end",a),t.removeListener("readable",o),n(e)})),t.on("end",a),t.end(e),o()}function Rs(t,e){if("string"==typeof e&&(e=new Re(e)),!Re.isBuffer(e))throw new TypeError("Not a string or buffer");var n=Cs.Z_FINISH;return t._processChunk(e,n)}function Os(t){if(!(this instanceof Os))return new Os(t);Us.call(this,t,Cs.DEFLATE)}function Is(t){if(!(this instanceof Is))return new Is(t);Us.call(this,t,Cs.INFLATE)}function Ns(t){if(!(this instanceof Ns))return new Ns(t);Us.call(this,t,Cs.GZIP)}function js(t){if(!(this instanceof js))return new js(t);Us.call(this,t,Cs.GUNZIP)}function Ls(t){if(!(this instanceof Ls))return new Ls(t);Us.call(this,t,Cs.DEFLATERAW)}function Bs(t){if(!(this instanceof Bs))return new Bs(t);Us.call(this,t,Cs.INFLATERAW)}function Ps(t){if(!(this instanceof Ps))return new Ps(t);Us.call(this,t,Cs.UNZIP)}function Us(t,e){if(this._opts=t=t||{},this._chunkSize=t.chunkSize||Cs.Z_DEFAULT_CHUNK,ni.call(this,t),t.flush&&t.flush!==Cs.Z_NO_FLUSH&&t.flush!==Cs.Z_PARTIAL_FLUSH&&t.flush!==Cs.Z_SYNC_FLUSH&&t.flush!==Cs.Z_FULL_FLUSH&&t.flush!==Cs.Z_FINISH&&t.flush!==Cs.Z_BLOCK)throw new Error("Invalid flush flag: "+t.flush);if(this._flushFlag=t.flush||Cs.Z_NO_FLUSH,t.chunkSize&&(t.chunkSize<Cs.Z_MIN_CHUNK||t.chunkSize>Cs.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBits<Cs.Z_MIN_WINDOWBITS||t.windowBits>Cs.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.level<Cs.Z_MIN_LEVEL||t.level>Cs.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevel<Cs.Z_MIN_MEMLEVEL||t.memLevel>Cs.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=Cs.Z_FILTERED&&t.strategy!=Cs.Z_HUFFMAN_ONLY&&t.strategy!=Cs.Z_RLE&&t.strategy!=Cs.Z_FIXED&&t.strategy!=Cs.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!Re.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new Cs.Zlib(e);var n=this;this._hadError=!1,this._binding.onerror=function(t,e){n._binding=null,n._hadError=!0;var r=new Error(t);r.errno=e,r.code=Cs.codes[e],n.emit("error",r)};var r=Cs.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(r=t.level);var i=Cs.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(i=t.strategy),this._binding.init(t.windowBits||Cs.Z_DEFAULT_WINDOWBITS,r,t.memLevel||Cs.Z_DEFAULT_MEMLEVEL,i,t.dictionary),this._buffer=new Re(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=i,this.once("end",this.close)}Object.keys(xs).forEach((function(t){xs[xs[t]]=t})),Cn(Us,ni),Us.prototype.params=function(t,e,n){if(t<Cs.Z_MIN_LEVEL||t>Cs.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+t);if(e!=Cs.Z_FILTERED&&e!=Cs.Z_HUFFMAN_ONLY&&e!=Cs.Z_RLE&&e!=Cs.Z_FIXED&&e!=Cs.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+e);if(this._level!==t||this._strategy!==e){var r=this;this.flush(Cs.Z_SYNC_FLUSH,(function(){r._binding.params(t,e),r._hadError||(r._level=t,r._strategy=e,n&&n())}))}else ae.nextTick(n)},Us.prototype.reset=function(){return this._binding.reset()},Us.prototype._flush=function(t){this._transform(new Re(0),"",t)},Us.prototype.flush=function(t,e){var n=this._writableState;if(("function"==typeof t||void 0===t&&!e)&&(e=t,t=Cs.Z_FULL_FLUSH),n.ended)e&&ae.nextTick(e);else if(n.ending)e&&this.once("end",e);else if(n.needDrain){var r=this;this.once("drain",(function(){r.flush(e)}))}else this._flushFlag=t,this.write(new Re(0),"",e)},Us.prototype.close=function(t){if(t&&ae.nextTick(t),!this._closed){this._closed=!0,this._binding.close();var e=this;ae.nextTick((function(){e.emit("close")}))}},Us.prototype._transform=function(t,e,n){var r,i=this._writableState,o=(i.ending||i.ended)&&(!t||i.length===t.length);if(null===!t&&!Re.isBuffer(t))return n(new Error("invalid input"));o?r=Cs.Z_FINISH:(r=this._flushFlag,t.length>=i.length&&(this._flushFlag=this._opts.flush||Cs.Z_NO_FLUSH)),this._processChunk(t,r,n)},Us.prototype._processChunk=function(t,e,n){var r=t&&t.length,i=this._chunkSize-this._offset,o=0,a=this,s="function"==typeof n;if(!s){var u,c=[],l=0;this.on("error",(function(t){u=t}));do{var f=this._binding.writeSync(e,t,o,r,this._buffer,this._offset,i)}while(!this._hadError&&p(f[0],f[1]));if(this._hadError)throw u;var h=Re.concat(c,l);return this.close(),h}var d=this._binding.write(e,t,o,r,this._buffer,this._offset,i);function p(u,f){if(!a._hadError){var h=i-f;if(function(t,e){if(!t)throw new Error(e)}(h>=0,"have should not go down"),h>0){var d=a._buffer.slice(a._offset,a._offset+h);a._offset+=h,s?a.push(d):(c.push(d),l+=d.length)}if((0===f||a._offset>=a._chunkSize)&&(i=a._chunkSize,a._offset=0,a._buffer=new Re(a._chunkSize)),0===f){if(o+=r-u,r=u,!s)return!0;var g=a._binding.write(e,t,o,r,a._buffer,a._offset,a._chunkSize);return g.callback=p,void(g.buffer=t)}if(!s)return!1;n()}}d.buffer=t,d.callback=p},Cn(Os,Us),Cn(Is,Us),Cn(Ns,Us),Cn(js,Us),Cn(Ls,Us),Cn(Bs,Us),Cn(Ps,Us);var Ms,zs={codes:xs,createDeflate:function(t){return new Os(t)},createInflate:function(t){return new Is(t)},createDeflateRaw:function(t){return new Ls(t)},createInflateRaw:function(t){return new Bs(t)},createGzip:function(t){return new Ns(t)},createGunzip:function(t){return new js(t)},createUnzip:function(t){return new Ps(t)},deflate:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Os(e),t,n)},deflateSync:function(t,e){return Rs(new Os(e),t)},gzip:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Ns(e),t,n)},gzipSync:function(t,e){return Rs(new Ns(e),t)},deflateRaw:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Ls(e),t,n)},deflateRawSync:function(t,e){return Rs(new Ls(e),t)},unzip:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Ps(e),t,n)},unzipSync:function(t,e){return Rs(new Ps(e),t)},inflate:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Is(e),t,n)},inflateSync:function(t,e){return Rs(new Is(e),t)},gunzip:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new js(e),t,n)},gunzipSync:function(t,e){return Rs(new js(e),t)},inflateRaw:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Bs(e),t,n)},inflateRawSync:function(t,e){return Rs(new Bs(e),t)},Deflate:Os,Inflate:Is,Gzip:Ns,Gunzip:js,DeflateRaw:Ls,InflateRaw:Bs,Unzip:Ps,Zlib:Us},Ds="Promise based HTTP client for the browser and node.js",Fs={test:"grunt test && bundlesize",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},qs={type:"git",url:"https://github.com/axios/axios.git"},Zs=["xhr","http","ajax","promise","node"],Ws={url:"https://github.com/axios/axios/issues"},Hs="https://github.com/axios/axios",$s={bundlesize:"^0.17.0",coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.0.2","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^20.1.0","grunt-karma":"^2.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^1.0.18","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^1.3.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^1.2.0","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.7.0","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^5.2.0",sinon:"^4.5.0",typescript:"^2.8.1","url-search-params":"^0.10.0",webpack:"^1.13.1","webpack-dev-server":"^1.14.1"},Ks={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},Ys="dist/axios.min.js",Gs={"follow-redirects":"^1.10.0"},Js=[{path:"./dist/axios.min.js",threshold:"5kB"}],Vs={name:"axios",version:"0.21.1",description:Ds,main:"index.js",scripts:Fs,repository:qs,keywords:Zs,author:"Matt Zabriskie",license:"MIT",bugs:Ws,homepage:Hs,devDependencies:$s,browser:Ks,jsdelivr:"dist/axios.min.js",unpkg:Ys,typings:"./index.d.ts",dependencies:Gs,bundlesize:Js},Xs=(Ms=Object.freeze({__proto__:null,name:"axios",version:"0.21.1",description:Ds,main:"index.js",scripts:Fs,repository:qs,keywords:Zs,author:"Matt Zabriskie",license:"MIT",bugs:Ws,homepage:Hs,devDependencies:$s,browser:Ks,jsdelivr:"dist/axios.min.js",unpkg:Ys,typings:"./index.d.ts",dependencies:Gs,bundlesize:Js,default:Vs}))&&Ms.default||Ms,Qs=Xo.http,tu=Xo.https,eu=/https:?/;function nu(t,e,n){if(t.hostname=e.host,t.host=e.host,t.port=e.port,t.path=n,e.auth){var r=Re.from(e.auth.username+":"+e.auth.password,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+r}t.beforeRedirect=function(t){t.headers.host=t.host,nu(t,e,t.href)}}var ru=function(t){return new Promise((function(e,n){var r=function(t){e(t)},i=function(t){n(t)},o=t.data,a=t.headers;if(a["User-Agent"]||a["user-agent"]||(a["User-Agent"]="axios/"+Xs.version),o&&!Tt.isStream(o)){if(Re.isBuffer(o));else if(Tt.isArrayBuffer(o))o=Re.from(new Uint8Array(o));else{if(!Tt.isString(o))return i(ce("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",t));o=Re.from(o,"utf-8")}a["Content-Length"]=o.length}var s=void 0;t.auth&&(s=(t.auth.username||"")+":"+(t.auth.password||""));var u=he(t.baseURL,t.url),c=Ci.parse(u),l=c.protocol||"http:";if(!s&&c.auth){var f=c.auth.split(":");s=(f[0]||"")+":"+(f[1]||"")}s&&delete a.Authorization;var h=eu.test(l),d=h?t.httpsAgent:t.httpAgent,p={path:Ot(c.path,t.params,t.paramsSerializer).replace(/^\?/,""),method:t.method.toUpperCase(),headers:a,agent:d,agents:{http:t.httpAgent,https:t.httpsAgent},auth:s};t.socketPath?p.socketPath=t.socketPath:(p.hostname=c.hostname,p.port=c.port);var g,v=t.proxy;if(!v&&!1!==v){var _=l.slice(0,-1)+"_proxy",m=ae.env[_]||ae.env[_.toUpperCase()];if(m){var y=Ci.parse(m),w=ae.env.no_proxy||ae.env.NO_PROXY,b=!0;if(w)b=!w.split(",").map((function(t){return t.trim()})).some((function(t){return!!t&&("*"===t||("."===t[0]&&c.hostname.substr(c.hostname.length-t.length)===t||c.hostname===t))}));if(b&&(v={host:y.hostname,port:y.port,protocol:y.protocol},y.auth)){var k=y.auth.split(":");v.auth={username:k[0],password:k[1]}}}}v&&(p.headers.host=c.hostname+(c.port?":"+c.port:""),nu(p,v,l+"//"+c.hostname+(c.port?":"+c.port:"")+p.path));var E=h&&(!v||eu.test(v.protocol));t.transport?g=t.transport:0===t.maxRedirects?g=$i:(t.maxRedirects&&(p.maxRedirects=t.maxRedirects),g=E?tu:Qs),t.maxBodyLength>-1&&(p.maxBodyLength=t.maxBodyLength);var A=g.request(p,(function(e){if(!A.aborted){var n=e,o=e.req||A;if(204!==e.statusCode&&"HEAD"!==o.method&&!1!==t.decompress)switch(e.headers["content-encoding"]){case"gzip":case"compress":case"deflate":n=n.pipe(zs.createUnzip()),delete e.headers["content-encoding"]}var a={status:e.statusCode,statusText:e.statusMessage,headers:e.headers,config:t,request:o};if("stream"===t.responseType)a.data=n,le(r,i,a);else{var s=[];n.on("data",(function(e){s.push(e),t.maxContentLength>-1&&Re.concat(s).length>t.maxContentLength&&(n.destroy(),i(ce("maxContentLength size of "+t.maxContentLength+" exceeded",t,null,o)))})),n.on("error",(function(e){A.aborted||i(ue(e,t,null,o))})),n.on("end",(function(){var e=Re.concat(s);"arraybuffer"!==t.responseType&&(e=e.toString(t.responseEncoding),t.responseEncoding&&"utf8"!==t.responseEncoding||(e=Tt.stripBOM(e))),a.data=e,le(r,i,a)}))}}}));A.on("error",(function(e){A.aborted&&"ERR_FR_TOO_MANY_REDIRECTS"!==e.code||i(ue(e,t,null,A))})),t.timeout&&A.setTimeout(t.timeout,(function(){A.abort(),i(ce("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",A))})),t.cancelToken&&t.cancelToken.promise.then((function(t){A.aborted||(A.abort(),i(t))})),Tt.isStream(o)?o.on("error",(function(e){i(ue(e,t,null,A))})).pipe(A):A.end(o)}))},iu={"Content-Type":"application/x-www-form-urlencoded"};function ou(t,e){!Tt.isUndefined(t)&&Tt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var au,su={adapter:("undefined"!=typeof XMLHttpRequest?au=ge:void 0!==ae&&"[object process]"===Object.prototype.toString.call(ae)&&(au=ru),au),transformRequest:[function(t,e){return se(e,"Accept"),se(e,"Content-Type"),Tt.isFormData(t)||Tt.isArrayBuffer(t)||Tt.isBuffer(t)||Tt.isStream(t)||Tt.isFile(t)||Tt.isBlob(t)?t:Tt.isArrayBufferView(t)?t.buffer:Tt.isURLSearchParams(t)?(ou(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):Tt.isObject(t)?(ou(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};su.headers={common:{Accept:"application/json, text/plain, */*"}},Tt.forEach(["delete","get","head"],(function(t){su.headers[t]={}})),Tt.forEach(["post","put","patch"],(function(t){su.headers[t]=Tt.merge(iu)}));var uu=su;function cu(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var lu=function(t){return cu(t),t.headers=t.headers||{},t.data=jt(t.data,t.headers,t.transformRequest),t.headers=Tt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Tt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||uu.adapter)(t).then((function(e){return cu(t),e.data=jt(e.data,e.headers,t.transformResponse),e}),(function(e){return Lt(e)||(cu(t),e&&e.response&&(e.response.data=jt(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},fu=function(t,e){e=e||{};var n={},r=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(t,e){return Tt.isPlainObject(t)&&Tt.isPlainObject(e)?Tt.merge(t,e):Tt.isPlainObject(e)?Tt.merge({},e):Tt.isArray(e)?e.slice():e}function u(r){Tt.isUndefined(e[r])?Tt.isUndefined(t[r])||(n[r]=s(void 0,t[r])):n[r]=s(t[r],e[r])}Tt.forEach(r,(function(t){Tt.isUndefined(e[t])||(n[t]=s(void 0,e[t]))})),Tt.forEach(i,u),Tt.forEach(o,(function(r){Tt.isUndefined(e[r])?Tt.isUndefined(t[r])||(n[r]=s(void 0,t[r])):n[r]=s(void 0,e[r])})),Tt.forEach(a,(function(r){r in e?n[r]=s(t[r],e[r]):r in t&&(n[r]=s(void 0,t[r]))}));var c=r.concat(i).concat(o).concat(a),l=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===c.indexOf(t)}));return Tt.forEach(l,u),n};function hu(t){this.defaults=t,this.interceptors={request:new Nt,response:new Nt}}hu.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=fu(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[lu,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)n=n.then(e.shift(),e.shift());return n},hu.prototype.getUri=function(t){return t=fu(this.defaults,t),Ot(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Tt.forEach(["delete","get","head","options"],(function(t){hu.prototype[t]=function(e,n){return this.request(fu(n||{},{method:t,url:e,data:(n||{}).data}))}})),Tt.forEach(["post","put","patch"],(function(t){hu.prototype[t]=function(e,n,r){return this.request(fu(r||{},{method:t,url:e,data:n}))}}));var du=hu;function pu(t){this.message=t}pu.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},pu.prototype.__CANCEL__=!0;var gu=pu;function vu(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new gu(t),e(n.reason))}))}vu.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},vu.source=function(){var t;return{token:new vu((function(e){t=e})),cancel:t}};var _u=vu;function mu(t){var e=new du(t),n=wt(du.prototype.request,e);return Tt.extend(n,du.prototype,e),Tt.extend(n,e),n}var yu=mu(uu);yu.Axios=du,yu.create=function(t){return mu(fu(yu.defaults,t))},yu.Cancel=gu,yu.CancelToken=_u,yu.isCancel=Lt,yu.all=function(t){return Promise.all(t)},yu.spread=function(t){return function(e){return t.apply(null,e)}},yu.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError};var wu=yu,bu=yu;wu.default=bu;var ku=wu,Eu=(()=>{const t=ot();return{MINI_APP_LINK:"https://zalo.me/app/link/zapps",MINI_APP_INTERNAL_LINK:"https://h5.zdn.vn/zapps",COOKIE_NAME:{ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSiON:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd"},APIS:{GET_USER_INFO:"https://graph.zalo.me/v2.0/me"},STORAGE_DATA_LIMIT:102400,STORAGE_LIMIT:5242880,NETWORK_TYPE:{NONE:t.isAndroid?-2:0,WIFI:t.isAndroid?0:1,"2G":(t.isAndroid,2),"3G":t.isAndroid?15:2,"4G":t.isAndroid?13:2}}})();const Au={encode:function(t){var e=[];for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(void 0===r)return;if(null===r)return void e.push(n);e.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return e.join("&")},decode:function(t,e){var n={};if(""===t)return n;for(var r=t.split("&"),i=0;i<r.length;i++){var o=r[i].split("=",2),a=decodeURIComponent(o[0]);if(e&&Object.prototype.hasOwnProperty.call(n,a))throw new URIError("Duplicate key: "+a);n[a]=2===o.length?decodeURIComponent(o[1]):null}return n},appendToUrl:function(t,e){return t+(-1!==t.indexOf("?")?"&":"?")+("string"==typeof e?e:Au.encode(e))},getParameterByName:function(t,e){e||(e=window.location.href),t=t.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(t){var e={};return t?(t.split("&").map((function(t){var n=t.split("=");n&&2==n.length&&(e[n[0]]=decodeURIComponent(n[1]))})),e):e},toQueryString:function(t){if(!t)return"";if("object"!=(void 0===t?"undefined":typeof t))return t;var e=Object.keys(t),n=[];return e.map((function(e){var r=t[e],i=[e,r="object"==(void 0===r?"undefined":typeof r)?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}};var Su={},Cu=function(t,e,n){var r=e||"default";return function(){var e=r in Su?Su[r](t,n):t;return e.apply(this,arguments)}};Cu.setWrapper=function(t){var e=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];Su[e]=t};var xu={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Tu(t){try{return null===t?xu:JSON.parse(t)}catch(t){return xu}}var Ru={execute:function(t,e,n,r){n.suppress_http_code=1;var i=Au.encode(n);"post"!=e&&(t=Au.appendToUrl(t,i),i="");var o=function(t,e){if(!self.XMLHttpRequest)return null;var n=new XMLHttpRequest,r=function(){};if(!("withCredentials"in n))return null;n.open(t,e,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i={send:function(t){n.send(t)}},o=Cu((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Cu((function(){a=r,"onerror"in i&&i.onerror(n)}),"entry","XMLHttpRequest:error");return n.onload=function(){o()},n.onerror=function(){a()},n.onreadystatechange=function(){4==n.readyState&&(200==n.status?o():a())},i}(e,t);return!!o&&(o.onload=function(t){r(Tu(t.responseText))},o.onerror=function(t){t.responseText?r(Tu(t.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:t.status,type:"http"}})},o.send(i),!0)}};class Ou{constructor(){this._accessTk=ft("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=ft("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=it(),this._device=ot(),this._jsCallFuncCallbacks={},this._listenerEvent={},this.registerListenerEvent("h5.event.paused","",(()=>{if(this.results.length>0){let t=this.results;this.results=[];try{this.sendLogData(t)}catch(t){}}})),this.sendLogTimer?clearInterval(this.sendLogTimer):this.sendLogTimer=setInterval((()=>{if(this.results.length>0){let t=this.results;this.results=[];try{this.sendLogData(t)}catch(t){}}}),5e3)}static getInstance(){return Ou.instance||(Ou.instance=new Ou),Ou.instance}set accessTk(t){this._accessTk=t}set jsAccessTk(t){this._jsAccessTk=t}sendLogData(t){try{Ru.execute("https://h5.zalo.me/log/async","post",{appId:window.APP_ID,data:JSON.stringify(t)},(t=>{}))}catch(t){}}onJSCall(t,e){try{const n=ht(e);if(this._jsCallFuncCallbacks[t]){const e=this._jsCallFuncCallbacks[t].callback,r=this._jsCallFuncCallbacks[t].timeout;if(e){try{e.call(this,n)}catch(t){console.error("Call callback error",t)}r&&clearTimeout(r),this._jsCallFuncCallbacks[t]=null,delete this._jsCallFuncCallbacks[t]}}this.results.push({action:n.action,error:n.error_code})}catch(t){console.log("onJSCall","error",t)}}onMultiJSCall(t,e){try{const n=ht(e);if(this._jsCallFuncCallbacks[t]){const e=this._jsCallFuncCallbacks[t].callback,r=this._jsCallFuncCallbacks[t].timeout;if(e){try{e.call(this,n)}catch(t){console.error("Call callback error",t)}r&&clearTimeout(r)}}this.results.push({action:n.action,error:n.error_code})}catch(t){console.log("onMultiJSCall","error",t)}}jsCallback(t,e,n){ZaloJavaScriptInterface.jsH5EventCallback(t,e,n)}registerListenerEvent(t,e,n){console.log("register "+t+" : "+e),this._listenerEvent[t]={handler:n,data:e}}nativeEventHandler(t,e,n){if(console.log("eventId:",t,"eventName",e,"eventData",n),this._listenerEvent[e]){const{handler:r,data:i}=this._listenerEvent[e];this.jsCallback(t,e,i);try{r(n)}catch(t){console.log("nativeEventHandler","H5 handle event fail",e,t)}}}defaultCallback(t){null!=t&&(t=ht(t))}jsCall(t,e,n,r=!1,i=3,o=!0){try{const a=((t="")=>`${t.normalize("NFD").replace(tt,"").replace(et,"d").replace(nt,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(t);if(!this._device.isMobile||f.isEmpty(t))return this.onJSCall(a,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:t}),!1;null==e&&(e={}),n||(n=this.defaultCallback);const s={error_code:-14,error_message:"Request Timeout!",data:{},action:t};this._jsCallFuncCallbacks[a]={timeout:o&&K.includes(t)&&setTimeout((()=>{this.onJSCall(a,s)}),8e3),callback:n};try{return e=dt(e),r?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,t,this._accessTk,e,window.onMultiJSCall(a)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,t,this._accessTk,e,`window.onMultiJSCall('${a}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,t,this._accessTk,e,window.onJSCall(a)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,t,this._accessTk,e,`window.onJSCall('${a}')`)}catch(o){if(!(i-- >0)){const n={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:e,jsToken:this._jsAccessTk,access_token:this._accessTk},action:t,js_error:o};return this.onJSCall(a,n),!1}setTimeout((()=>{this.jsCall(t,e,n,r,i)}),500)}}catch(t){console.log("jsCall","error",t)}return!1}}class Iu{constructor(t,e,n){this.code=t,this.message=e,this.api=n}}class Nu extends Iu{constructor(t,e){super(t,e),this.message=`${e}. ${V.READ_MORE}`,this.handler()}handler(){switch(this.code){case exports.NativeCode.token_invalid:this.code=G,this.message=V.LOGIN_REQUIRED;break;case exports.NativeCode.not_permission:this.code=J,this.message=V.NOT_PERMISSION;break;case exports.NativeCode.client_not_support:this.message=V.CLIENT_NOT_SUPPORT;break;case exports.NativeCode.decode_failed:this.message=V.DECODE_FAILED}}}const ju={handler:null,setHandler(t){this.handler=t}};ju.setHandler(((t,e)=>e instanceof Iu?(e.api=t,e):new Iu(-2001,f.isNull(e.message)?"Unknown Error":e.message,t)));const Lu=(t,e,n)=>{const r=n.value;return n.value=function(...t){return _t(this,void 0,void 0,(function*(){const{success:n,fail:i}=Array.isArray(t)&&t.length>0&&t[0];return new Promise(((o,a)=>_t(this,void 0,void 0,(function*(){try{const e=yield r.apply(this,t);!f.isNull(n)&&f.isFunction(n)?n.call(null,e,this):o(e)}catch(t){const{handler:n}=ju,r=n.call(null,e,t,this);!f.isNull(i)&&f.isFunction(i)?i.call(null,r,this):console.error("Error:",r)}}))))}))},n},Bu=(t,e,n)=>{const r=n.value;return n.value=function(...t){try{return r.apply(this,t)}catch(t){const{handler:n}=ju;!f.isNull(n)&&f.isFunction(n)?n.call(null,e,t,this):console.warn(t.message)}},n};var Pu;class Uu{constructor(){Pu.set(this,void 0),yt(this,Pu,Ou.getInstance())}setZAccSession(t){mt(this,Pu).accessTk=t}setJSToken(t){mt(this,Pu).jsAccessTk=t}callNative(t,e,n){return new Promise(((r,i)=>{mt(this,Pu).jsCall(t,e,(e=>{if(e&&e.error_code>=0&&e.action==t)r(e.data||{}),(null==n?void 0:n.callback)&&n.callback(e,null);else if(e&&e.error_code<0){const t=new Nu(e.error_code,`${e.action}: ${e.error_message}`);i(t),(null==n?void 0:n.callback)&&n.callback(e,t)}}),null==n?void 0:n.isMultiCallback,null==n?void 0:n.nRetry,null==n?void 0:n.haveTimeout)}))}listenerEventNative(t,e,n){mt(this,Pu).registerListenerEvent(t,e,n)}}Pu=new WeakMap;const Mu={loginFailed:()=>new Iu(G,V.LOGIN_FAILED),loginRequired:()=>new Iu(Y,V.LOGIN_REQUIRED),missingParam:t=>new Iu(Y,`Missing required argument: ${t}`),wrongTypeParam:(t,e,n)=>new Iu(Y,`Wrong type of parameter '${t}'. Expected ${e}, but got ${n}`)};var zu,Du,Fu,qu,Zu;class Wu{static getVersion(){return"2.11.10"}static getSystemInfo(){return{version:at("version-id")||"",apiVersion:"2.11.10",zaloVersion:st(),platform:ut(),language:navigator.language}}static getAppInfo(){return _t(this,void 0,void 0,(function*(){let t={};const e=this.getAppId(),n=this.getSystemInfo(),r=Au.appendToUrl(`https://h5.zalo.me/${X}`,{appId:e,versionStatus:0,currentVersion:n.version}),i=yield fetch(r,{credentials:"include"});if(i.ok){const e=yield i.json();if(e.err<0||!e.data)throw new Error(e);t={name:e.data.name,version:e.data.version,description:e.data.description,appUrl:e.data.appUrl,qrCodeUrl:e.data.qrCodeUrl}}return t}))}}class Hu{static setNavigationBarTitle(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(E,{title:t.title},{haveTimeout:!1})}))}static setNavigationBarColor(t){return _t(this,void 0,void 0,(function*(){if(f.isString(t.color)&&t.color.length>0){const e={};f.isEmpty(t.color)||(e.backgroundColor=t.color),f.isEmpty(t.textColor)||(e.textColor=t.textColor),yield this.callNative(W,{actionbarType:5,dataConfig:e,homeConfig:{enable:this.isShowHomeButton?1:0,url:`${Eu.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}},{haveTimeout:!1}),this.isShowNavBar=!0}else{const e={};f.isEmpty(t.statusBarColor)||(e.backgroundColor=t.statusBarColor),f.isEmpty(t.textColor)||(e.textColor=t.textColor),yield this.callNative(W,{actionbarType:6,dataConfig:e},{haveTimeout:!1}),this.isShowNavBar=!1}}))}static setNavigationBarLeftButton(t){return _t(this,void 0,void 0,(function*(){let e={};switch(t.type){case"none":this.isShowHomeButton=!1,e={buttonType:3,dataConfig:{confirmToExit:1},homeConfig:{enable:0,url:`${Eu.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"back":this.isShowHomeButton=!1,e={buttonType:0,dataConfig:{confirmToExit:1},homeConfig:{enable:0,url:`${Eu.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"home":this.isShowHomeButton=!0,e={buttonType:3,dataConfig:{confirmToExit:1},homeConfig:{enable:1,url:`${Eu.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"both":this.isShowHomeButton=!0,e={buttonType:0,dataConfig:{confirmToExit:1},homeConfig:{enable:1,url:`${Eu.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}}}yield this.callNative(x,Object.assign({},e),{haveTimeout:!1})}))}static onBackButtonClick(t){return _t(this,void 0,void 0,(function*(){yield this.listenerEventNative("h5.event.action.back",'{"handle_h5": 1}',(()=>{t.handler()}))}))}static setNavigationBarRightButton(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(S,{supportToolBar:t.supportToolBar,reset:t.reset,menuListItems:t.menuListItems,zapp:this.getAppId()})}))}}class $u{static setBackgroundColor(t){return _t(this,void 0,void 0,(function*(){f.isString(t.backgroundColor)&&t.backgroundColor.length>0&&(yield this.callNative(W,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:t.backgroundColor,textColor:t.textColor}}))}))}}class Ku{constructor(t,e,n,r){this.title=r,this.severity=e;const i=new Date;if(this.time=i.toLocaleTimeString(),this.content=t,n>0){const t=(new Error).stack;this.stack=t?t.replace("Error\n",""):""}}toString(){return(this.content.stack?[this.title,this.severity.toUpperCase(),this.time,this.content,this.content.stack.replace("Error:","")]:[this.title,this.severity.toUpperCase(),this.time,JSON.stringify(this.content),this.stack]).join(" ")}}zu=new WeakMap,Du=new WeakMap,Fu=new WeakMap,qu=new WeakMap,Zu=new WeakMap;const Yu=new class{constructor(){zu.set(this,3),Du.set(this,["none","error","warn","info"]),Fu.set(this,"[zmp] > "),qu.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),Zu.set(this,((t,e,n)=>{mt(this,qu)[mt(this,Du)[t]]++;const r=mt(this,Du)[t];if(yt(this,Fu,mt(this,Fu)+("string"!=typeof e?new Ku(e,r,t,n).toString():e)),!(t>mt(this,zu)))switch(t){case 1:console.error(mt(this,Fu));break;case 2:console.warn(mt(this,Fu));break;case 3:console.info(mt(this,Fu));break;default:throw new Error("internal")}}))}setLogLevel(t){yt(this,zu,t)}info(t){mt(this,Zu).call(this,3,t)}warn(t,e){mt(this,Zu).call(this,2,t,e)}error(t,e){mt(this,Zu).call(this,1,t,e)}getMetrics(){return mt(this,qu)}};class Gu{static setDeviceOrientation(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(D,{autoRotate:exports.OrientationType[t.rotate]})}))}static getNetworkType(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(A,{url:window.location.href,featureId:""}).then((t=>{let e;switch(t.network){case Eu.NETWORK_TYPE.NONE:e=exports.NetworkType.none;break;case Eu.NETWORK_TYPE.WIFI:e=exports.NetworkType.wifi;break;case Eu.NETWORK_TYPE["2G"]:case Eu.NETWORK_TYPE["3G"]:case Eu.NETWORK_TYPE["4G"]:e=exports.NetworkType.cellular;break;default:e=exports.NetworkType.unknown}return{networkType:e}}))}))}static onNetworkStatusChange(t){return _t(this,void 0,void 0,(function*(){yield this.listenerEventNative("h5.event.connection.changed","",(e=>{const n=JSON.parse(e),r=n&&n.state;this.getNetworkType().then((e=>{const n={isConnected:"CONNECTED"===r,networkType:e&&e.networkType};t(n)})).catch((t=>{Yu.error(t,"onNetworkStatusChange")}))}))}))}static startBeaconDiscovery(t){var e,n,r,i,o;return _t(this,void 0,void 0,(function*(){const a={subaction:0,scanning_type:f.isNumber(null==t?void 0:t.scanningType)?t.scanningType:0,data:{scan_from_source:f.isString(null==t?void 0:t.scanFromSource)?t.scanFromSource:"",expire:f.isNumber(null==t?void 0:t.expire)?t.expire:3e3,monitor_interval:f.isNumber(null==t?void 0:t.monitorInterval)?t.monitorInterval:60,domain:f.isString(null==t?void 0:t.domain)?t.domain:"",scan_config:{scan_time:f.isNumber(null===(e=null==t?void 0:t.scanConfig)||void 0===e?void 0:e.scanTime)?t.scanConfig.scanTime:15e3,time_between_scan:f.isNumber(null===(n=null==t?void 0:t.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?t.scanConfig.timeBetweenScan:1e4,beacon_timeout:f.isNumber(null===(r=null==t?void 0:t.scanConfig)||void 0===r?void 0:r.beaconTimeout)?t.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:f.isNumber(null===(i=null==t?void 0:t.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?t.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:f.isNumber(null===(o=null==t?void 0:t.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?t.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==t?void 0:t.items)?null==t?void 0:t.items:[]}};return yield this.callNative(F,Object.assign({},a)),!0}))}static stopBeaconDiscovery(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(F,Object.assign({},{subaction:2})),!0}))}static getBeacons(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(F,Object.assign({},{subaction:1}),{isMultiCallback:!0}).then((t=>{const e={beacons:[]};return Array.isArray(t)&&t.forEach((t=>{const n={uuid:t.uuid,major:t.major,minor:t.minor,distance:t.distance,rssi:t.rssi};e.beacons.push(n)})),e}))}))}static stopBluetoothDevicesDiscovery(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static startBluetoothDevicesDiscovery(t){return _t(this,void 0,void 0,(function*(){return this.callNative("",Object.assign({},t))}))}static openBluetoothAdapter(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static onBluetoothDeviceFound(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static onBluetoothAdapterStateChange(){return _t(this,void 0,void 0,(function*(){return Promise.resolve()}))}static getConnectedBluetoothDevices(t){return _t(this,void 0,void 0,(function*(){const e={services:t.services||[]};return this.callNative("",e)}))}static getBluetoothDevices(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static getBluetoothAdapterState(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static closeBluetoothAdapter(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static scanQRCode(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(P,{skipOpenLink:!0})}))}static showToast(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(j,{toast:t.message})}))}static hideKeyboard(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(L,{})}))}static openPhone(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(B,{phoneNum:t.phoneNumber,phoneCode:t.phoneNumber})}))}static openSMS(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(U,{content:t.content,phoneCode:t.phoneNumber})}))}static keepScreen(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(z,{data:{keep_screen_on:t.keepScreenOn?1:0}})}))}static openBioAuthentication(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(R,{secret_data:t.secretData,app_id:this.getZAppId(),ui:{title:t.ui.title,sub_title:t.ui.subTitle,negative_text:t.ui.negativeButtonText},require_fingerprint:t.requireFingerprint?1:0}).then((t=>{var e,n,r,i;return{code:null==t?void 0:t.error_code,message:null==t?void 0:t.error_message,data:{domain:null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.domain,code:null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.error_code,message:null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.error_message,payToken:null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.pay_token}}}))}))}static checkStateBioAuthentication(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(O,{}).then((t=>({bioState:null==t?void 0:t.bio_state})))}))}static vibrate(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(H,{type:exports.VibrateType[t.type],vibrate_time:t.milliseconds})}))}}var Ju,Vu,Xu,Qu,tc,ec,nc,rc,ic,oc,ac,sc,uc,cc,lc,fc,hc,dc,pc,gc,vc,_c,mc;class yc{constructor(t){Ju.set(this,localStorage),Vu.set(this,void 0),Xu.set(this,void 0),ot(),yt(this,Xu,{keys:new Set,currentSize:0,limitSize:Eu.STORAGE_LIMIT}),yt(this,Vu,t),this.findAllCurrentDataByApp(t)}findAllCurrentDataByApp(t){try{let e;for(e in mt(this,Ju)){if(t){if(e.split("_")[0]!==t)continue}mt(this,Xu).keys.add(e)}}catch(t){Yu.error(t,"LocalResourceStorage > findAllCurrentDataByApp")}}get(t){let e=new Map;return t.forEach((t=>{e.set(t,this.getSync(t))})),Promise.resolve(e)}getSync(t){return mt(this,Vu)&&(t=`${mt(this,Vu)}_${t}`),mt(this,Xu).keys.has(t)?mt(this,Ju).getItem(t):null}set(t){return _t(this,void 0,void 0,(function*(){return Object.entries(t).forEach((([t,e])=>{this.setSync(t,e.replace(/\\"/g,'"'))})),Promise.resolve({errorKeys:[]})}))}setSync(t,e){mt(this,Vu)&&(t=`${mt(this,Vu)}_${t}`),mt(this,Ju).setItem(t,e),mt(this,Xu).keys.add(t)}getInfo(){return _t(this,void 0,void 0,(function*(){return Promise.resolve(this.getInfoSync())}))}getInfoSync(){const t=((t,e)=>{let n,r,i=0;for(r in t){const o=r.split("_")[0];t.hasOwnProperty(r)&&(e&&o!==e||(n=2*(t[r].length+r.length),i+=n))}return i})(mt(this,Ju),mt(this,Vu));return{currentSize:f.isNumber(t)?Number((t/1024).toFixed(2)):0,limitSize:Number((Eu.STORAGE_LIMIT/1024).toFixed(2))}}remove(t){return _t(this,void 0,void 0,(function*(){return t.forEach((t=>{this.removeSync(t)})),Promise.resolve({errorKeys:[]})}))}removeSync(t){mt(this,Vu)&&(t=`${mt(this,Vu)}_${t}`),mt(this,Xu).keys.has(t)&&(mt(this,Ju).removeItem(t),mt(this,Xu).keys.delete(t))}clear(){return _t(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){mt(this,Xu).keys.forEach((t=>{mt(this,Vu)&&t.indexOf(mt(this,Vu))<0||(mt(this,Ju).removeItem(t),mt(this,Xu).keys.delete(t))}))}}Ju=new WeakMap,Vu=new WeakMap,Xu=new WeakMap;class wc extends Uu{constructor(t){super(),Qu.set(this,void 0),tc.set(this,void 0),yt(this,tc,{keys:new Set,currentSize:0,limitSize:Eu.STORAGE_LIMIT}),yt(this,Qu,t)}get(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative($,{mpds_action:"mpds.get",mpds_data:{keys:t},appId:mt(this,Qu)},{isMultiCallback:!1}).then((t=>{let e=new Map;return t&&t.mpds_data&&t.mpds_data.map&&(e=new Map(Object.entries(t.mpds_data.map))),e}))}))}set(t){return _t(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative($,{mpds_action:"mpds.set",mpds_data:{map:t},appId:mt(this,Qu)},{isMultiCallback:!1}).then((t=>{let e=[];return t&&t.mpds_data&&t.mpds_data.error_keys&&(e=t.mpds_data.error_keys),e}))}}))}getInfo(){return _t(this,void 0,void 0,(function*(){const t=yield this.callNative($,{mpds_action:"mpds.get.size",mpds_data:{},appId:mt(this,Qu)},{isMultiCallback:!1}).then((t=>{let e=0;return t&&t.mpds_data&&t.mpds_data.size&&(e=t.mpds_data.size),e}));return{currentSize:f.isNumber(t)?Number(t/1024):0,limitSize:Number(Eu.STORAGE_LIMIT/1024)}}))}remove(t){return _t(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative($,{mpds_action:"mpds.remove.key",mpds_data:{keys:t},appId:mt(this,Qu)},{isMultiCallback:!1}).then((t=>{let e=[];return t&&t.mpds_data&&t.mpds_data.error_keys&&(e=t.mpds_data.error_keys),e}))}}))}clear(){return _t(this,void 0,void 0,(function*(){yield this.callNative($,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:mt(this,Qu)})}))}}Qu=new WeakMap,tc=new WeakMap;class bc{getDataFromStorage(t){return _t(this,void 0,void 0,(function*(){const e=this.getInstance(),n=yield e.get(t),r={};return n.forEach(((t,e)=>{try{if(t){const n=t.replace(/\\/g,"").replace(/&#39;/g,"'");r[e]=JSON.parse(n)}else r[e]=null}catch(n){r[e]=t}})),r}))}putDataToStorage(t){return _t(this,void 0,void 0,(function*(){const e=this.getInstance(),n={};return Object.entries(t).forEach((([t,e])=>{f.isUndefined(e)||f.isNull(e)||(n[t]=JSON.stringify(e).replace(/"/g,'\\"').replace(/'/g,"&#39;"))})),yield e.set(n)}))}removeDataFromStorage(t){return _t(this,void 0,void 0,(function*(){const e=this.getInstance();return yield e.remove(t)}))}clearStorage(){return _t(this,void 0,void 0,(function*(){const t=this.getInstance();yield t.clear()}))}getStorageInfo(){return _t(this,void 0,void 0,(function*(){const t=this.getInstance();return yield t.getInfo()}))}}class kc extends bc{constructor(t){super(),ec.set(this,void 0),yt(this,ec,t)}getInstance(){return new yc(mt(this,ec))}}ec=new WeakMap;class Ec extends bc{constructor(t){super(),nc.set(this,void 0),yt(this,nc,t)}getInstance(){return new wc(mt(this,nc))}}nc=new WeakMap;class Ac{static setStorage(t){return _t(this,void 0,void 0,(function*(){let e=new kc(this.getAppId());return pt()&&(e=new Ec(this.getAppId())),yield e.putDataToStorage(t.data)}))}static getStorage(t){return _t(this,void 0,void 0,(function*(){let e=new kc(this.getAppId());pt()&&(e=new Ec(this.getAppId()));return yield e.getDataFromStorage(t.keys)}))}static getStorageInfo(t){return _t(this,void 0,void 0,(function*(){let t=new kc(this.getAppId());return pt()&&(t=new Ec(this.getAppId())),yield t.getStorageInfo()}))}static removeStorage(t){return _t(this,void 0,void 0,(function*(){let e=new kc(this.getAppId());return pt()&&(e=new Ec(this.getAppId())),yield e.removeDataFromStorage(t.keys)}))}static clearStorage(t={}){return _t(this,void 0,void 0,(function*(){let t=new kc(this.getAppId());pt()&&(t=new Ec(this.getAppId())),yield t.clearStorage()}))}}class Sc{static getUserInfo(t){return _t(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();return{userInfo:yield ku.get(Eu.APIS.GET_USER_INFO,{params:{fields:"id,birthday,name,gender,picture",access_token:t}}).then((t=>{const e=t.data;return{id:e.id,name:e.name,birthday:e.birthday,gender:e.gender,avatar:e.picture&&e.picture.data&&e.picture.data.url}}))}}))}}class Cc{static closeApp(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(T,{})}))}static openMiniApp(t){return _t(this,void 0,void 0,(function*(){const e=null==t?void 0:t.appId,n=(null==t?void 0:t.params)||{},r=Object.entries(n).map((function([t,e]){return[t,e].join("=")})).join("&");yield this.callNative(Z,{mpUrl:`${Eu.MINI_APP_INTERNAL_LINK}/${e}/${r.length>0?"?"+r:""}`,mpInfo:{appId:e}})}))}static openWebview(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(v,{url:t.url})}))}}class xc{static getLocation(t){return new Promise(((t,e)=>{this.callNative(I,{silent_request:!1,permission_description:""},{isMultiCallback:!0,callback:(n,r)=>{if(r&&e(r),0===n.error_code){const e=n.data,r={latitude:e.latitude,longitude:e.longitude,timestamp:e.timestamp,provider:e.provider};t(r)}}})}))}static sendLocation(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(N,{title:t.title,touserid:t.toUserId,zapp:this.getZAppId()})}))}}class Tc{static requestCameraPermission(t){return new Promise(((t,e)=>{this.callNative(k,{},{callback:(n,r)=>{-2===n.error_code||n.error_code>=0?t({userAllow:-2!==n.error_code,message:n.error_message}):e(r)}})}))}static saveImageToPhotosAlbum(t){return _t(this,void 0,void 0,(function*(){let e={};return e=f.isEmpty(t.imageBase64Data)?Object.assign(Object.assign({},e),{imageUrl:t.imageUrl}):Object.assign(Object.assign({},e),{imageBase64Data:t.imageBase64Data}),yield this.callNative(q,Object.assign({},e))}))}}class Rc{static viewOAQr(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(M,{dpn:t.displayName,uid:t.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openProfile(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(g,{uId:t.id,type:exports.ProfileType[t.type],zapp:this.getZAppId()})}))}static openChat(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(_,{uId:t.id,type:exports.ChatType[t.type],zapp:this.getZAppId()})}))}static openPostFeed(t){return _t(this,void 0,void 0,(function*(){let e={};switch(t.type){case"image":e={photoUrl:t.data.imageUrl};break;case"link":e={link:t.data.link,title:t.data.title,thumb:t.data.thumb,description:t.data.description};break;case"profile":e={avt:t.data.avatar,uid:t.data.id,dpn:t.data.displayName}}return yield this.callNative(m,Object.assign(Object.assign({type:exports.PostFeedType[t.type]},e),{zapp:this.getZAppId()})).then((t=>({status:t.status,shareType:t.share_type,numberOfUser:t.uid_to_size})))}))}static followOA(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(y,{uid:t.id,showDialogConfirm:!0,zapp:this.getZAppId()},{haveTimeout:!1})}))}static unfollowOA(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(w,{uid:t.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(t){return _t(this,void 0,void 0,(function*(){let e={};switch(t.type){case"image":e={photoUrl:t.data.imageUrl};break;case"gif":e={photoUrl:t.data.imageUrl,gifUrl:t.data.gifUrl,width:t.data.width,height:t.data.height};break;case"video":e={videoThumb:t.data.videoThumb,videoUrl:t.data.videoUrl,width:t.data.width,height:t.data.height};break;case"link":e={link:t.data.link,chatOnly:t.data.chatOnly?1:0};break;case"oa":e={uid:t.data.id}}return yield this.callNative(b,Object.assign(Object.assign({type:exports.ShareSheetType[t.type]},e),{zapp:this.getZAppId()}),{haveTimeout:!1}).then((t=>({status:t.status,shareType:t.share_type,numberOfUser:t.uid_to_size})))}))}static createShortcut(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(C,{url:`${Eu.MINI_APP_LINK}/${this.getAppId()}/`,title:document.title,iconUrl:`https:${at("og:image:url")}`})}))}}class Oc{static getRouteParams(){let t={};const e=window.location.href;try{let n=new URL(e).searchParams.toString();n&&(t=Au.getParamsAsObject(n))}catch(t){throw new Error("Url không hợp lệ")}return t}}class Ic extends Uu{constructor(){super(),rc.set(this,window.zAppID),ic.set(this,window.APP_ID),oc.set(this,window.APP_CONFIG||{}),ac.set(this,void 0),sc.set(this,void 0),uc.set(this,{timer:{getToken:0}}),cc.set(this,(()=>{const t=mt(this,oc).app||null;if(t){const e=t.title,n=t.headerColor,r=t.textColor,i=t.statusBarColor,o=t.leftButton;if(f.isString(e)&&this.setNavigationBarTitle({title:e}),f.isString(n)){const t={color:n};!f.isString(r)||"black"!==r&&"white"!==r||(t.textColor=r),f.isString(i)&&(t.statusBarColor=i),this.setNavigationBarColor(t)}f.isString(o)&&this.setNavigationBarLeftButton({type:o})}})),lc.set(this,(()=>{try{mt(this,cc).call(this)}catch(t){console.error(t)}})),fc.set(this,(()=>new Promise(((t,e)=>{this.callNative("action.jump.login",{}).then((e=>{const n=e&&e.cookiesOAuthLogins||[],r=n.find((t=>t.name===Eu.COOKIE_NAME.JS_TOKEN));r&&(this.setJSToken(r.value),window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(r.value)),t(n)})).catch((t=>{e(t)}))})))),hc.set(this,Hu.setNavigationBarRightButton),this.getVersion=Wu.getVersion,this.getSystemInfo=Wu.getSystemInfo,this.setNavigationBarTitle=Hu.setNavigationBarTitle,this.setNavigationBarColor=Hu.setNavigationBarColor,this.setNavigationBarLeftButton=Hu.setNavigationBarLeftButton,this.setBackgroundColor=$u.setBackgroundColor,this.setDeviceOrientation=Gu.setDeviceOrientation,this.setStorage=Ac.setStorage,this.getStorage=Ac.getStorage,this.getStorageInfo=Ac.getStorageInfo,this.removeStorage=Ac.removeStorage,this.clearStorage=Ac.clearStorage,this.getUserInfo=Sc.getUserInfo,this.getNetworkType=Gu.getNetworkType,this.onNetworkStatusChange=Gu.onNetworkStatusChange,this.startBeaconDiscovery=Gu.startBeaconDiscovery,this.stopBeaconDiscovery=Gu.stopBeaconDiscovery,this.getBeacons=Gu.getBeacons,this.closeApp=Cc.closeApp,this.getLocation=xc.getLocation,this.onBackButtonClick=Hu.onBackButtonClick,this.stopBluetoothDevicesDiscovery=Gu.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=Gu.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=Gu.openBluetoothAdapter,this.onBluetoothDeviceFound=Gu.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=Gu.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=Gu.getConnectedBluetoothDevices,this.getBluetoothDevices=Gu.getBluetoothDevices,this.getBluetoothAdapterState=Gu.getBluetoothAdapterState,this.closeBluetoothAdapter=Gu.closeBluetoothAdapter,this.scanQRCode=Gu.scanQRCode,this.openProfile=Rc.openProfile,this.openChat=Rc.openChat,this.openPostFeed=Rc.openPostFeed,this.followOA=Rc.followOA,this.unFollowOA=Rc.unfollowOA,this.openShareSheet=Rc.openShareSheet,this.requestCameraPermission=Tc.requestCameraPermission,this.createShortcut=Rc.createShortcut,this.openBioAuthentication=Gu.openBioAuthentication,this.checkStateBioAuthentication=Gu.checkStateBioAuthentication,this.sendLocation=xc.sendLocation,this.showToast=Gu.showToast,this.hideKeyboard=Gu.hideKeyboard,this.openPhone=Gu.openPhone,this.openSMS=Gu.openSMS,this.viewOAQr=Rc.viewOAQr,this.keepScreen=Gu.keepScreen,this.saveImageToPhotosAlbum=Tc.saveImageToPhotosAlbum,this.openMiniApp=Cc.openMiniApp,this.vibrate=Gu.vibrate,this.openWebview=Cc.openWebview,this.getRouteParams=Oc.getRouteParams,this.getAppInfo=Wu.getAppInfo,yt(this,ac,null),yt(this,sc,null),this.isShowNavBar=!0,this.isShowHomeButton=!0}static getInstance(){return Ic.instance||(Ic.instance=new Ic),Ic.instance}getAppId(){return mt(this,ic)}getZAppId(){return mt(this,rc)}login(t){return _t(this,void 0,void 0,(function*(){const t=(yield mt(this,fc).call(this)).find((t=>t.name===Eu.COOKIE_NAME.ZOAUTH));if(!f.isUndefined(t)&&!f.isNull(t)&&f.isString(t.value)){yt(this,ac,t.value);const e=()=>_t(this,void 0,void 0,(function*(){return(f.isUndefined(mt(this,ac))||f.isNull(mt(this,ac)))&&clearInterval(mt(this,uc).timer.getToken),yield ku.get("https://oauth.zaloapp.com/v3/access_token",{params:{app_id:mt(this,rc),redirect_uri:`https://h5.zdn.vn/zapps/${mt(this,ic)}/`,code:mt(this,ac),isSDK:!0}}).then((t=>{let n=t.data;if(n.access_token){yt(this,sc,n.access_token);const t=1e3*parseInt(n.expires_in);return mt(this,uc).timer.getToken||(mt(this,uc).timer.getToken=window.setInterval(e,t)),this.setZAccSession(mt(this,sc)||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(mt(this,sc)||""),mt(this,sc)}return null}))}));return clearInterval(mt(this,uc).timer.getToken),yield e(),"Login Success!"}throw Mu.loginFailed()}))}getAccessToken(t){return _t(this,void 0,void 0,(function*(){if(mt(this,sc))return mt(this,sc);throw Mu.loginRequired()}))}}rc=new WeakMap,ic=new WeakMap,oc=new WeakMap,ac=new WeakMap,sc=new WeakMap,uc=new WeakMap,cc=new WeakMap,lc=new WeakMap,fc=new WeakMap,hc=new WeakMap;class Nc{constructor(){dc.set(this,window.zAppID),pc.set(this,window.APP_CONFIG||{}),gc.set(this,"DEFAULT ZOAUTH"),vc.set(this,"DEFAULT ACCESS TOKEN"),_c.set(this,{timer:{getToken:0}}),this.getAppId=()=>mt(this,dc),this.login=()=>Promise.resolve(mt(this,gc)),this.getAccessToken=()=>Promise.resolve(mt(this,vc)),this.getVersion=Wu.getVersion,this.getSystemInfo=Wu.getSystemInfo,this.setNavigationBarTitle=()=>Promise.resolve(),this.setNavigationBarColor=()=>Promise.resolve(),this.setBackgroundColor=()=>Promise.resolve(),this.setNavigationBarLeftButton=()=>Promise.resolve(),this.setDeviceOrientation=()=>Promise.resolve(),this.setStorage=t=>_t(this,void 0,void 0,(function*(){const e=new kc(this.getAppId());return yield e.putDataToStorage(t.data),{errorKeys:[]}})),this.getStorage=t=>_t(this,void 0,void 0,(function*(){const e=new kc(this.getAppId());return yield e.getDataFromStorage(t.keys)})),this.getStorageInfo=t=>_t(this,void 0,void 0,(function*(){const t=new kc(this.getAppId());return yield t.getStorageInfo()})),this.removeStorage=t=>_t(this,void 0,void 0,(function*(){const e=new kc(this.getAppId());return yield e.removeDataFromStorage(t.keys)})),this.clearStorage=t=>_t(this,void 0,void 0,(function*(){const t=new kc(this.getAppId());return yield t.clearStorage()})),this.getUserInfo=()=>Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",birthday:"01/01/1990",gender:"male",avatar:"https://h5.zdn.vn/static/images/avatar.png"}}),this.getNetworkType=()=>{let t;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"none":t=exports.NetworkType.none;break;case"4g":t=exports.NetworkType.wifi;break;case"3g":case"2g":t=exports.NetworkType.cellular;break;default:t=exports.NetworkType.unknown}const e={networkType:t};return Promise.resolve(e)},this.onNetworkStatusChange=t=>{const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=e.effectiveType;return e.addEventListener("change",(function(){let e;switch(n){case"none":e=exports.NetworkType.none;break;case"4g":e=exports.NetworkType.wifi;break;case"3g":case"2g":e=exports.NetworkType.cellular;break;default:e=exports.NetworkType.unknown}t({isConnected:!0,networkType:e})})),Promise.resolve()},this.startBeaconDiscovery=t=>Promise.resolve(!0),this.stopBeaconDiscovery=t=>Promise.resolve(!0),this.getBeacons=t=>Promise.resolve({beacons:[]}),this.closeApp=()=>Promise.resolve(),this.getLocation=()=>Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"}),this.onBackButtonClick=()=>Promise.resolve(),this.stopBluetoothDevicesDiscovery=()=>Promise.resolve(),this.startBluetoothDevicesDiscovery=()=>Promise.resolve(),this.openBluetoothAdapter=()=>Promise.resolve(),this.onBluetoothDeviceFound=()=>Promise.resolve(),this.onBluetoothAdapterStateChange=()=>Promise.resolve(),this.getConnectedBluetoothDevices=()=>Promise.resolve(),this.getBluetoothDevices=()=>Promise.resolve(),this.getBluetoothAdapterState=()=>Promise.resolve(),this.closeBluetoothAdapter=()=>Promise.resolve(),this.scanQRCode=()=>Promise.resolve({content:"132"}),this.openProfile=()=>Promise.resolve(),this.openChat=()=>Promise.resolve(),this.openPostFeed=()=>Promise.resolve({status:1,shareType:0,numberOfUser:0}),this.followOA=()=>Promise.resolve(),this.unFollowOA=()=>Promise.resolve(),this.openShareSheet=()=>Promise.resolve({status:2,shareType:0,numberOfUser:0}),this.requestCameraPermission=()=>Promise.resolve({userAllow:!0,message:"Success"}),this.createShortcut=()=>Promise.resolve(),this.openBioAuthentication=()=>Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}}),this.checkStateBioAuthentication=()=>Promise.resolve({bioState:""}),this.sendLocation=()=>Promise.resolve(),this.showToast=()=>Promise.resolve(),this.hideKeyboard=()=>Promise.resolve(),this.openPhone=()=>Promise.resolve(),this.openSMS=()=>Promise.resolve(),this.viewOAQr=()=>Promise.resolve(),this.keepScreen=()=>Promise.resolve(),this.saveImageToPhotosAlbum=()=>Promise.resolve(),this.openMiniApp=t=>Promise.resolve(),this.vibrate=()=>Promise.resolve(),this.openWebview=t=>(location.replace(t.url),Promise.resolve()),this.getRouteParams=Oc.getRouteParams,this.getAppInfo=()=>Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})}}dc=new WeakMap,pc=new WeakMap,gc=new WeakMap,vc=new WeakMap,_c=new WeakMap,function(e){!function(n){var r="object"==typeof t?t:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(e);function o(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===r.Reflect?r.Reflect=e:i=o(r.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return rt(Object.create(null))}:a?function(){return rt({__proto__:null})}:function(){return rt({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),l="object"==typeof ae&&ae.env&&"true"===ae.env.REFLECT_METADATA_USE_MAP_POLYFILL,f=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,h=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,d=new(l||"function"!=typeof WeakMap?nt():WeakMap);function p(t,e,n,r){if(B(n)){if(!W(t))throw new TypeError;if(!$(e))throw new TypeError;return A(t,e)}if(!W(t))throw new TypeError;if(!M(e))throw new TypeError;if(!M(r)&&!B(r)&&!P(r))throw new TypeError;return P(r)&&(r=void 0),S(t,e,n=Z(n),r)}function g(t,e){function n(n,r){if(!M(n))throw new TypeError;if(!B(r)&&!K(r))throw new TypeError;I(t,e,n,r)}return n}function v(t,e,n,r){if(!M(n))throw new TypeError;return B(r)||(r=Z(r)),I(t,e,n,r)}function _(t,e,n){if(!M(e))throw new TypeError;return B(n)||(n=Z(n)),x(t,e,n)}function m(t,e,n){if(!M(e))throw new TypeError;return B(n)||(n=Z(n)),T(t,e,n)}function y(t,e,n){if(!M(e))throw new TypeError;return B(n)||(n=Z(n)),R(t,e,n)}function w(t,e,n){if(!M(e))throw new TypeError;return B(n)||(n=Z(n)),O(t,e,n)}function b(t,e){if(!M(t))throw new TypeError;return B(e)||(e=Z(e)),N(t,e)}function k(t,e){if(!M(t))throw new TypeError;return B(e)||(e=Z(e)),j(t,e)}function E(t,e,n){if(!M(e))throw new TypeError;B(n)||(n=Z(n));var r=C(e,n,!1);if(B(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=d.get(e);return i.delete(n),i.size>0||d.delete(e),!0}function A(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!B(r)&&!P(r)){if(!$(r))throw new TypeError;e=r}}return e}function S(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!B(o)&&!P(o)){if(!M(o))throw new TypeError;r=o}}return r}function C(t,e,n){var r=d.get(t);if(B(r)){if(!n)return;r=new f,d.set(t,r)}var i=r.get(e);if(B(i)){if(!n)return;i=new f,r.set(e,i)}return i}function x(t,e,n){if(T(t,e,n))return!0;var r=Q(e);return!P(r)&&x(t,r,n)}function T(t,e,n){var r=C(e,n,!1);return!B(r)&&F(r.has(t))}function R(t,e,n){if(T(t,e,n))return O(t,e,n);var r=Q(e);return P(r)?void 0:R(t,r,n)}function O(t,e,n){var r=C(e,n,!1);if(!B(r))return r.get(t)}function I(t,e,n,r){C(n,r,!0).set(t,e)}function N(t,e){var n=j(t,e),r=Q(t);if(null===r)return n;var i=N(r,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new h,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,f=i;l<f.length;l++){c=f[l];o.has(c)||(o.add(c),a.push(c))}return a}function j(t,e){var n=[],r=C(t,e,!1);if(B(r))return n;for(var i=G(r.keys()),o=0;;){var a=V(i);if(!a)return n.length=o,n;var s=J(a);try{n[o]=s}catch(t){try{X(i)}finally{throw t}}o++}}function L(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function B(t){return void 0===t}function P(t){return null===t}function U(t){return"symbol"==typeof t}function M(t){return"object"==typeof t?null!==t:"function"==typeof t}function z(t,e){switch(L(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=Y(t,r);if(void 0!==i){var o=i.call(t,n);if(M(o))throw new TypeError;return o}return D(t,"default"===n?"number":n)}function D(t,e){if("string"===e){var n=t.toString;if(H(n))if(!M(i=n.call(t)))return i;if(H(r=t.valueOf))if(!M(i=r.call(t)))return i}else{var r;if(H(r=t.valueOf))if(!M(i=r.call(t)))return i;var i,o=t.toString;if(H(o))if(!M(i=o.call(t)))return i}throw new TypeError}function F(t){return!!t}function q(t){return""+t}function Z(t){var e=z(t,3);return U(e)?e:q(e)}function W(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function H(t){return"function"==typeof t}function $(t){return"function"==typeof t}function K(t){switch(L(t)){case 3:case 4:return!0;default:return!1}}function Y(t,e){var n=t[e];if(null!=n){if(!H(n))throw new TypeError;return n}}function G(t){var e=Y(t,i);if(!H(e))throw new TypeError;var n=e.call(t);if(!M(n))throw new TypeError;return n}function J(t){return t.value}function V(t){var e=t.next();return!e.done&&e}function X(t){var e=t.return;e&&e.call(t)}function Q(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new f}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}()}function nt(){var t=16,n=u.create(),r=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var t;do{t="@@WeakMap@@"+c()}while(u.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,r)){if(!n)return;Object.defineProperty(t,r,{value:u.create()})}return t[r]}function a(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function s(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function c(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;r<t;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function rt(t){return t.__=void 0,delete t.__,t}t("decorate",p),t("metadata",g),t("defineMetadata",v),t("hasMetadata",_),t("hasOwnMetadata",m),t("getMetadata",y),t("getOwnMetadata",w),t("getMetadataKeys",b),t("getOwnMetadataKeys",k),t("deleteMetadata",E)}(i)}()}(mc||(mc={}));const jc=Symbol("required"),Lc=Symbol("checkType"),Bc=(...t)=>(e,n,r)=>{let i=Reflect.getOwnMetadata(jc,e,n)||[];i.push({parameterIndex:r,fields:t}),Reflect.defineMetadata(jc,i,e,n)},Pc=(t,e,n)=>(r,i,o)=>{let a=Reflect.getOwnMetadata(Lc,r,i)||[];a.push({parameterIndex:o,type:t,properties:e,key:n}),Reflect.defineMetadata(Lc,a,r,i)};const Uc=(t,e,n)=>{const r=n.value,i=r.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",");return n.value=function(){const n=Reflect.getOwnMetadata(jc,t,e),o=Reflect.getOwnMetadata(Lc,t,e);return o&&o.forEach((t=>{const{parameterIndex:e,type:n,properties:r,key:o}=t;let a=arguments[e],s=i[e];if(!f.isEmpty(o)){const t=null==o?void 0:o.split(".");Array.isArray(t)&&t.length>0&&t.forEach((t=>{a=a[t],s=`${s}.${t}`}))}const u=typeof a;if(!f.isUndefined(a)){if(!ct(a,n))throw Mu.wrongTypeParam(s,n,Array.isArray(a)?"array":null===a?"null":u);"object"===n&&Object.entries(r).forEach((([t,e])=>{const n=a[t];if(!f.isUndefined(n)){if(Array.isArray(e)&&!e.includes(n))throw Mu.wrongTypeParam(`${s}.${t}`,`${e}`.replace(/,/g,"|"),`'${n}'`);if(!Array.isArray(e)&&!ct(n,e))throw Mu.wrongTypeParam(`${s}.${t}`,e,Array.isArray(n)?"array":null===n?"null":typeof n)}}))}})),n&&n.forEach((t=>{const{parameterIndex:e,fields:n}=t,r=arguments[e],o=i[e],a=typeof r;if(!Array.isArray(r)&&"object"===a&&n.some((t=>f.isUndefined(r[t]))))throw Mu.missingParam(`${n} in ${o}`);if("object"!==a&&(e>=arguments.length||f.isUndefined(r)))throw Mu.missingParam(o)})),r.apply(this,arguments)},n};var Mc;class zc{constructor(){Mc.set(this,void 0),yt(this,Mc,this.getInstance())}login(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).login(t)}))}getAccessToken(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getAccessToken(t)}))}getVersion(){return mt(this,Mc).getVersion()}getSystemInfo(){return mt(this,Mc).getSystemInfo()}setNavigationBarTitle(t){return _t(this,void 0,void 0,(function*(){return mt(this,Mc).setNavigationBarTitle(t)}))}setNavigationBarColor(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).setNavigationBarColor(t)}))}setBackgroundColor(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).setBackgroundColor(t)}))}setNavigationBarLeftButton(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).setNavigationBarLeftButton(t)}))}setDeviceOrientation(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).setDeviceOrientation(t)}))}setStorage(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).setStorage(t)}))}getStorage(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getStorage(t)}))}getStorageInfo(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getStorageInfo(t)}))}removeStorage(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).removeStorage(t)}))}clearStorage(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).clearStorage(t)}))}getUserInfo(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getUserInfo(t)}))}getNetworkType(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getNetworkType(t)}))}onNetworkStatusChange(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).onNetworkStatusChange(t)}))}startBeaconDiscovery(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).startBeaconDiscovery(t)}))}stopBeaconDiscovery(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).stopBeaconDiscovery(t)}))}getBeacons(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getBeacons(t)}))}closeApp(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).closeApp(t)}))}getLocation(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getLocation(t)}))}onBackButtonClick(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).onBackButtonClick(t)}))}stopBluetoothDevicesDiscovery(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).startBluetoothDevicesDiscovery(t)}))}openBluetoothAdapter(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).openBluetoothAdapter()}))}onBluetoothDeviceFound(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getConnectedBluetoothDevices(t)}))}getBluetoothDevices(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getBluetoothDevices()}))}getBluetoothAdapterState(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getBluetoothAdapterState()}))}closeBluetoothAdapter(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).closeBluetoothAdapter()}))}scanQRCode(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).scanQRCode(t)}))}openProfile(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).openProfile(t)}))}openChat(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).openChat(t)}))}openPostFeed(t){return _t(this,void 0,void 0,(function*(){const e=t.type;if("image"===e&&lt(t.data.imageUrl))throw Mu.wrongTypeParam("object.data.imageUrl","valid url","invalid");if("link"===e&&(lt(t.data.link)||!rt(t.data.link)))throw Mu.wrongTypeParam("object.data.link","valid url","invalid");if("profile"===e){if(lt(t.data.id))throw Mu.wrongTypeParam("object.data.id","valid id","empty");if(lt(t.data.avatar)||!rt(t.data.avatar))throw Mu.wrongTypeParam("object.data.avatar","valid url","invalid");if(lt(t.data.displayName))throw Mu.wrongTypeParam("object.data.displayName","valid displayName","empty")}return yield mt(this,Mc).openPostFeed(t)}))}followOA(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).followOA(t)}))}unfollowOA(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).unFollowOA(t)}))}openShareSheet(t){return _t(this,void 0,void 0,(function*(){const e=t.type;if("image"===e&&lt(t.data.imageUrl))throw Mu.wrongTypeParam("object.data.imageUrl","valid url","invalid");if("gif"===e&&(lt(t.data.gifUrl)||!rt(t.data.gifUrl)))throw Mu.wrongTypeParam("object.data.gifUrl","valid url","invalid");if("video"===e){if(lt(t.data.videoThumb)||!rt(t.data.videoThumb))throw Mu.wrongTypeParam("object.data.videoThumb","valid url","invalid");if(lt(t.data.videoUrl)||!rt(t.data.videoUrl))throw Mu.wrongTypeParam("object.data.videoUrl","valid url","invalid")}else{if("link"===e&&(lt(t.data.link)||!rt(t.data.link)))throw Mu.wrongTypeParam("object.data.link","valid url","invalid");if("oa"===e&&lt(t.data.id))throw Mu.wrongTypeParam("object.data.id","valid id","empty")}return yield mt(this,Mc).openShareSheet(t)}))}requestCameraPermission(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).requestCameraPermission(t)}))}createShortcut(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).createShortcut(t)}))}openBioAuthentication(t){var e;return _t(this,void 0,void 0,(function*(){return f.isUndefined(t.requireFingerprint)&&(t.requireFingerprint=!0),lt(null===(e=t.ui)||void 0===e?void 0:e.title)&&(t.ui=Object.assign(Object.assign({},t.ui),{title:"Xác thực"})),lt(t.ui.subTitle)&&(t.ui=Object.assign(Object.assign({},t.ui),{subTitle:"Sử dụng sinh trắc học của bạn để xác thực"})),lt(t.ui.negativeButtonText)&&(t.ui=Object.assign(Object.assign({},t.ui),{negativeButtonText:"Đóng"})),yield mt(this,Mc).openBioAuthentication(t)}))}checkStateBioAuthentication(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).checkStateBioAuthentication(t)}))}sendLocation(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).sendLocation(t)}))}showToast(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).showToast(t)}))}hideKeyboard(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).hideKeyboard(t)}))}openPhone(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).openPhone(t)}))}openSMS(t){return _t(this,void 0,void 0,(function*(){if(!/^\+?\d+$/.test(t.phoneNumber))throw Mu.wrongTypeParam("object.phoneNumber","valid phone","invalid");yield mt(this,Mc).openSMS(t)}))}viewOAQr(t){return _t(this,void 0,void 0,(function*(){(f.isUndefined(t.displayName)||f.isNull(t.displayName))&&(t.displayName=""),yield mt(this,Mc).viewOAQr(t)}))}keepScreen(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).keepScreen(t)}))}saveImageToPhotosAlbum(t){return _t(this,void 0,void 0,(function*(){if(lt(t.imageBase64Data)&&lt(t.imageUrl))throw Mu.wrongTypeParam("object.imageBase64Data | object.imageUrl","valid data","invalid");if(!lt(t.imageUrl)&&!rt(t.imageUrl))throw Mu.wrongTypeParam("object.imageUrl","valid url","invalid");return yield mt(this,Mc).saveImageToPhotosAlbum(t)}))}openMiniApp(t){return _t(this,void 0,void 0,(function*(){if(!f.isEmpty(t.params)){const e=t.params||{};Object.keys(e).forEach((t=>{"object"==typeof e[t]&&(e[t]=JSON.stringify(e[t])),e[t]=""+encodeURIComponent(e[t])})),t.params=e}yield mt(this,Mc).openMiniApp(t)}))}vibrate(t){return _t(this,void 0,void 0,(function*(){lt(t.type)&&(t.type="oneShot"),lt(t.milliseconds)&&(t.milliseconds=500),yield mt(this,Mc).vibrate(t)}))}openWebview(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).openWebview(t)}))}getRouteParams(){return mt(this,Mc).getRouteParams()}getAppInfo(t){return mt(this,Mc).getAppInfo()}}Mc=new WeakMap,gt([Lu],zc.prototype,"login",null),gt([Lu],zc.prototype,"getAccessToken",null),gt([Bu],zc.prototype,"getVersion",null),gt([Bu],zc.prototype,"getSystemInfo",null),gt([Lu,Uc,vt(0,Pc("object",{title:"string"})),vt(0,Bc("title"))],zc.prototype,"setNavigationBarTitle",null),gt([Lu,Uc,vt(0,Pc("object",{color:"string",textColor:["white","black"],statusBarColor:"string"})),vt(0,Bc("color"))],zc.prototype,"setNavigationBarColor",null),gt([Lu,Uc,vt(0,Pc("object",{backgroundColor:"string",textColor:["white","black"]})),vt(0,Bc("backgroundColor"))],zc.prototype,"setBackgroundColor",null),gt([Lu,Uc,vt(0,Pc("object",{type:["none","back","home","both"]})),vt(0,Bc("type"))],zc.prototype,"setNavigationBarLeftButton",null),gt([Lu,Uc,vt(0,Pc("object",{rotate:["auto","portrait","landscape"]})),vt(0,Bc("rotate"))],zc.prototype,"setDeviceOrientation",null),gt([Lu,Uc,vt(0,Pc("object",{data:"object"})),vt(0,Bc("data"))],zc.prototype,"setStorage",null),gt([Lu,Uc,vt(0,Pc("object",{keys:"array<string>"})),vt(0,Bc("keys"))],zc.prototype,"getStorage",null),gt([Lu],zc.prototype,"getStorageInfo",null),gt([Lu,Uc,vt(0,Pc("object",{keys:"array<string>"})),vt(0,Bc("keys"))],zc.prototype,"removeStorage",null),gt([Lu],zc.prototype,"clearStorage",null),gt([Lu],zc.prototype,"getUserInfo",null),gt([Lu],zc.prototype,"getNetworkType",null),gt([Lu],zc.prototype,"onNetworkStatusChange",null),gt([Lu],zc.prototype,"startBeaconDiscovery",null),gt([Lu],zc.prototype,"stopBeaconDiscovery",null),gt([Lu],zc.prototype,"getBeacons",null),gt([Lu],zc.prototype,"closeApp",null),gt([Lu],zc.prototype,"getLocation",null),gt([Lu],zc.prototype,"onBackButtonClick",null),gt([Lu],zc.prototype,"stopBluetoothDevicesDiscovery",null),gt([Lu],zc.prototype,"startBluetoothDevicesDiscovery",null),gt([Lu],zc.prototype,"openBluetoothAdapter",null),gt([Lu],zc.prototype,"onBluetoothDeviceFound",null),gt([Lu],zc.prototype,"onBluetoothAdapterStateChange",null),gt([Lu],zc.prototype,"getConnectedBluetoothDevices",null),gt([Lu],zc.prototype,"getBluetoothDevices",null),gt([Lu],zc.prototype,"getBluetoothAdapterState",null),gt([Lu],zc.prototype,"closeBluetoothAdapter",null),gt([Lu],zc.prototype,"scanQRCode",null),gt([Lu,Uc,vt(0,Pc("object",{type:["user","oa","aliasOA"],id:"string"})),vt(0,Bc("type","id"))],zc.prototype,"openProfile",null),gt([Lu,Uc,vt(0,Pc("object",{type:["user","oa"],id:"string"})),vt(0,Bc("type","id"))],zc.prototype,"openChat",null),gt([Lu,Uc,vt(0,Pc("object",{type:["image","link","profile"],data:"object"})),vt(0,Pc("object",{imageUrl:"string",link:"string",title:"string",thumb:"string",description:"string",avatar:"string",id:"string",displayName:"string"},"data")),vt(0,Bc("type","data"))],zc.prototype,"openPostFeed",null),gt([Lu,Uc,vt(0,Pc("object",{id:"string",showDialogConfirm:"boolean"})),vt(0,Bc("id"))],zc.prototype,"followOA",null),gt([Lu,Uc,vt(0,Pc("object",{id:"string"})),vt(0,Bc("id"))],zc.prototype,"unfollowOA",null),gt([Lu,Uc,vt(0,Pc("object",{type:["image","gif","video","link","oa"],data:"object"})),vt(0,Pc("object",{imageUrl:"string",gifUrl:"string",width:"number",height:"number",videoThumb:"string",videoUrl:"string",link:"string",chatOnly:"boolean",id:"string"},"data")),vt(0,Bc("type","data"))],zc.prototype,"openShareSheet",null),gt([Lu],zc.prototype,"requestCameraPermission",null),gt([Lu],zc.prototype,"createShortcut",null),gt([Lu,Uc,vt(0,Bc("secretData")),vt(0,Pc("object",{secretData:"string",ui:"object",requireFingerprint:"boolean"})),vt(0,Pc("object",{title:"string",subTitle:"string",negativeButtonText:"string"},"ui"))],zc.prototype,"openBioAuthentication",null),gt([Lu],zc.prototype,"checkStateBioAuthentication",null),gt([Lu,Uc,vt(0,Bc("toUserId"))],zc.prototype,"sendLocation",null),gt([Lu,Uc,vt(0,Bc("message"))],zc.prototype,"showToast",null),gt([Lu],zc.prototype,"hideKeyboard",null),gt([Lu,Uc,vt(0,Bc("phoneNumber")),vt(0,Pc("object",{phoneNumber:"string"}))],zc.prototype,"openPhone",null),gt([Lu,Uc,vt(0,Bc("content","phoneNumber")),vt(0,Pc("object",{content:"string",phoneNumber:"string"}))],zc.prototype,"openSMS",null),gt([Lu,Uc,vt(0,Bc("id")),vt(0,Pc("object",{id:"string",displayName:"string"}))],zc.prototype,"viewOAQr",null),gt([Lu],zc.prototype,"keepScreen",null),gt([Lu,Uc,vt(0,Pc("object",{imageBase64Data:"string",imageUrl:"string",type:"string"}))],zc.prototype,"saveImageToPhotosAlbum",null),gt([Lu,Uc,vt(0,Bc("appId")),vt(0,Pc("object",{appId:"string",params:"object"}))],zc.prototype,"openMiniApp",null),gt([Lu,Uc,vt(0,Pc("object",{type:["oneShot"],milliseconds:"number"}))],zc.prototype,"vibrate",null),gt([Lu,Uc,vt(0,Bc("url")),vt(0,Pc("object",{url:"string"}))],zc.prototype,"openWebview",null),gt([Bu],zc.prototype,"getRouteParams",null),gt([Lu],zc.prototype,"getAppInfo",null);class Dc extends zc{getInstance(){return Ic.getInstance()}}class Fc extends zc{getInstance(){return new Nc}}const qc=ot();exports.default=void 0,window.onJSCall=t=>function(e){Ou.getInstance().onJSCall(t,e)},window.onMultiJSCall=t=>function(e){Ou.getInstance().onMultiJSCall(t,e)},window.zaloJSV2={zalo_h5_event_handler:function(t,e,n){Ou.getInstance().nativeEventHandler(t,e,n)}},qc.isZalo?exports.default=new Dc:exports.default=new Fc,window.ZaloMiniAppSDK=exports.default,exports.SDKCreator=zc,exports.default=exports.default;
18
+ var fi=/[^\x20-\x7E]/,hi=/[\x2E\u3002\uFF0E\uFF61]/g,di={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},pi=Math.floor,gi=String.fromCharCode;function vi(t){throw new RangeError(di[t])}function _i(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function mi(t,e,n){var r=0;for(t=n?pi(t/700):t>>1,t+=pi(t/e);t>455;r+=36)t=pi(t/35);return pi(r+36*t/(t+38))}function yi(t){return function(t,e){var n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]);var i=function(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}((t=t.replace(hi,".")).split("."),e).join(".");return r+i}(t,(function(t){return fi.test(t)?"xn--"+function(t){var e,n,r,i,o,a,s,u,c,l,f,h,d,p,g,v=[];for(h=(t=function(t){for(var e,n,r=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--):r.push(e);return r}(t)).length,e=128,n=0,o=72,a=0;a<h;++a)(f=t[a])<128&&v.push(gi(f));for(r=i=v.length,i&&v.push("-");r<h;){for(s=2147483647,a=0;a<h;++a)(f=t[a])>=e&&f<s&&(s=f);for(s-e>pi((2147483647-n)/(d=r+1))&&vi("overflow"),n+=(s-e)*d,e=s,a=0;a<h;++a)if((f=t[a])<e&&++n>2147483647&&vi("overflow"),f==e){for(u=n,c=36;!(u<(l=c<=o?1:c>=o+26?26:c-o));c+=36)g=u-l,p=36-l,v.push(gi(_i(l+g%p,0))),u=pi(g/p);v.push(gi(_i(u,0))),o=mi(n,d,r==i),n=0,++r}++n,++e}return v.join("")}(t):t}))}function wi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var bi=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function ki(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}function Ei(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n}var Ai=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e};function Si(t,e,n,r){e=e||"&",n=n||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\+/g;t=t.split(e);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var s=t.length;a>0&&s>a&&(s=a);for(var u=0;u<s;++u){var c,l,f,h,d=t[u].replace(o,"%20"),p=d.indexOf(n);p>=0?(c=d.substr(0,p),l=d.substr(p+1)):(c=d,l=""),f=decodeURIComponent(c),h=decodeURIComponent(l),wi(i,f)?bi(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i}var Ci={parse:Di,resolve:function(t,e){return Di(t,!1,!0).resolve(e)},resolveObject:function(t,e){return t?Di(t,!1,!0).resolveObject(e):e},format:function(t){Wn(t)&&(t=Fi({},t));return qi(t)},Url:xi};function xi(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Ti=/^([a-z0-9.+-]+:)/i,Ri=/:[0-9]*$/,Oi=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ii=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Ni=["'"].concat(Ii),ji=["%","/","?",";","#"].concat(Ni),Li=["/","?","#"],Bi=/^[+a-z0-9A-Z_-]{0,63}$/,Pi=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ui={javascript:!0,"javascript:":!0},Mi={javascript:!0,"javascript:":!0},zi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Di(t,e,n){if(t&&Kn(t)&&t instanceof xi)return t;var r=new xi;return r.parse(t,e,n),r}function Fi(t,e,n,r){if(!Wn(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),o=-1!==i&&i<e.indexOf("#")?"?":"#",a=e.split(o);a[0]=a[0].replace(/\\/g,"/");var s=e=a.join(o);if(s=s.trim(),!r&&1===e.split("#").length){var u=Oi.exec(s);if(u)return t.path=s,t.href=s,t.pathname=u[1],u[2]?(t.search=u[2],t.query=n?Si(t.search.substr(1)):t.search.substr(1)):n&&(t.search="",t.query={}),t}var c,l,f,h,d=Ti.exec(s);if(d){var p=(d=d[0]).toLowerCase();t.protocol=p,s=s.substr(d.length)}if(r||d||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var g="//"===s.substr(0,2);!g||d&&Mi[d]||(s=s.substr(2),t.slashes=!0)}if(!Mi[d]&&(g||d&&!zi[d])){var v,_,m=-1;for(c=0;c<Li.length;c++)-1!==(l=s.indexOf(Li[c]))&&(-1===m||l<m)&&(m=l);for(-1!==(_=-1===m?s.lastIndexOf("@"):s.lastIndexOf("@",m))&&(v=s.slice(0,_),s=s.slice(_+1),t.auth=decodeURIComponent(v)),m=-1,c=0;c<ji.length;c++)-1!==(l=s.indexOf(ji[c]))&&(-1===m||l<m)&&(m=l);-1===m&&(m=s.length),t.host=s.slice(0,m),s=s.slice(m),Zi(t),t.hostname=t.hostname||"";var y="["===t.hostname[0]&&"]"===t.hostname[t.hostname.length-1];if(!y){var w=t.hostname.split(/\./);for(c=0,f=w.length;c<f;c++){var b=w[c];if(b&&!b.match(Bi)){for(var k="",E=0,A=b.length;E<A;E++)b.charCodeAt(E)>127?k+="x":k+=b[E];if(!k.match(Bi)){var S=w.slice(0,c),C=w.slice(c+1),x=b.match(Pi);x&&(S.push(x[1]),C.unshift(x[2])),C.length&&(s="/"+C.join(".")+s),t.hostname=S.join(".");break}}}}t.hostname.length>255?t.hostname="":t.hostname=t.hostname.toLowerCase(),y||(t.hostname=yi(t.hostname)),h=t.port?":"+t.port:"";var T=t.hostname||"";t.host=T+h,t.href+=t.host,y&&(t.hostname=t.hostname.substr(1,t.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!Ui[p])for(c=0,f=Ni.length;c<f;c++){var R=Ni[c];if(-1!==s.indexOf(R)){var O=encodeURIComponent(R);O===R&&(O=escape(R)),s=s.split(R).join(O)}}var I=s.indexOf("#");-1!==I&&(t.hash=s.substr(I),s=s.slice(0,I));var N=s.indexOf("?");if(-1!==N?(t.search=s.substr(N),t.query=s.substr(N+1),n&&(t.query=Si(t.query)),s=s.slice(0,N)):n&&(t.search="",t.query={}),s&&(t.pathname=s),zi[p]&&t.hostname&&!t.pathname&&(t.pathname="/"),t.pathname||t.search){h=t.pathname||"";var j=t.search||"";t.path=h+j}return t.href=qi(t),t}function qi(t){var e=t.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var n=t.protocol||"",r=t.pathname||"",i=t.hash||"",o=!1,a="";t.host?o=e+t.host:t.hostname&&(o=e+(-1===t.hostname.indexOf(":")?t.hostname:"["+this.hostname+"]"),t.port&&(o+=":"+t.port)),t.query&&Kn(t.query)&&Object.keys(t.query).length&&(a=function(t,e,n,r){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Ei(Ai(t),(function(r){var i=encodeURIComponent(ki(r))+n;return bi(t[r])?Ei(t[r],(function(t){return i+encodeURIComponent(ki(t))})).join(e):i+encodeURIComponent(ki(t[r]))})).join(e):r?encodeURIComponent(ki(r))+n+encodeURIComponent(ki(t)):""}(t.query));var s=t.search||a&&"?"+a||"";return n&&":"!==n.substr(-1)&&(n+=":"),t.slashes||(!n||zi[n])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),n+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+i}function Zi(t){var e=t.host,n=Ri.exec(e);n&&(":"!==(n=n[0])&&(t.port=n.substr(1)),e=e.substr(0,e.length-n.length)),e&&(t.hostname=e)}function Wi(t,e){"string"==typeof t&&(t=Di(t));var n=-1===Bt.location.protocol.search(/^https?:$/)?"http:":"",r=t.protocol||n,i=t.hostname||t.host,o=t.port,a=t.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),t.url=(i?r+"//"+i:"")+(o?":"+o:"")+a,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var s=new ci(t);return e&&s.on("response",e),s}function Hi(){}xi.prototype.parse=function(t,e,n){return Fi(this,t,e,n)},xi.prototype.format=function(){return qi(this)},xi.prototype.resolve=function(t){return this.resolveObject(Di(t,!1,!0)).format()},xi.prototype.resolveObject=function(t){if(Wn(t)){var e=new xi;e.parse(t,!1,!0),t=e}for(var n,r=new xi,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];r[a]=this[a]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(r[c]=t[c])}return zi[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!zi[t.protocol]){for(var l=Object.keys(t),f=0;f<l.length;f++){var h=l[f];r[h]=t[h]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||Mi[t.protocol])r.pathname=t.pathname;else{for(n=(t.pathname||"").split("/");n.length&&!(t.host=n.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),r.pathname=n.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var g,v=r.pathname&&"/"===r.pathname.charAt(0),_=t.host||t.pathname&&"/"===t.pathname.charAt(0),m=_||v||r.host&&t.pathname,y=m,w=r.pathname&&r.pathname.split("/")||[],b=r.protocol&&!zi[r.protocol];if(n=t.pathname&&t.pathname.split("/")||[],b&&(r.hostname="",r.port=null,r.host&&(""===w[0]?w[0]=r.host:w.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===n[0]?n[0]=t.host:n.unshift(t.host)),t.host=null),m=m&&(""===n[0]||""===w[0])),_)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,w=n;else if(n.length)w||(w=[]),w.pop(),w=w.concat(n),r.search=t.search,r.query=t.query;else if(!qn(t.search))return b&&(r.hostname=r.host=w.shift(),(g=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=g.shift(),r.host=r.hostname=g.shift())),r.search=t.search,r.query=t.query,Fn(r.pathname)&&Fn(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=w.slice(-1)[0],E=(r.host||t.host||w.length>1)&&("."===k||".."===k)||""===k,A=0,S=w.length;S>=0;S--)"."===(k=w[S])?w.splice(S,1):".."===k?(w.splice(S,1),A++):A&&(w.splice(S,1),A--);if(!m&&!y)for(;A--;A)w.unshift("..");!m||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),E&&"/"!==w.join("/").substr(-1)&&w.push("");var C=""===w[0]||w[0]&&"/"===w[0].charAt(0);return b&&(r.hostname=r.host=C?"":w.length?w.shift():"",(g=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=g.shift(),r.host=r.hostname=g.shift())),(m=m||r.host&&w.length)&&!C&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),Fn(r.pathname)&&Fn(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},xi.prototype.parseHost=function(){return Zi(this)},Hi.defaultMaxSockets=4;var $i={request:Wi,get:function(t,e){var n=Wi(t,e);return n.end(),n},Agent:Hi,METHODS:["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],STATUS_CODES:{100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}};function Ki(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0}var Yi,Gi=Object.prototype.hasOwnProperty,Ji=Object.keys||function(t){var e=[];for(var n in t)Gi.call(t,n)&&e.push(n);return e},Vi=Array.prototype.slice;function Xi(){return void 0!==Yi?Yi:Yi="foo"===function(){}.name}function Qi(t){return Object.prototype.toString.call(t)}function to(t){return!hn(t)&&("function"==typeof Bt.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}function eo(t,e){t||so(t,!0,e,"==",uo)}var no=/\s*function\s+([^\(\s]*)\s*/;function ro(t){if(Jn(t)){if(Xi())return t.name;var e=t.toString().match(no);return e&&e[1]}}function io(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return oo(ao(t.actual),128)+" "+t.operator+" "+oo(ao(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||so;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,i=ro(e),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}}function oo(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function ao(t){if(Xi()||!Jn(t))return jn(t);var e=ro(t);return"[Function"+(e?": "+e:"")+"]"}function so(t,e,n,r,i){throw new io({message:n,actual:t,expected:e,operator:r,stackStartFunction:i})}function uo(t,e){t||so(t,!0,e,"==",uo)}function co(t,e,n,r){if(t===e)return!0;if(hn(t)&&hn(e))return 0===Ki(t,e);if(Yn(t)&&Yn(e))return t.getTime()===e.getTime();if($n(t)&&$n(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(to(t)&&to(e)&&Qi(t)===Qi(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===Ki(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(hn(t)!==hn(e))return!1;var i=(r=r||{actual:[],expected:[]}).actual.indexOf(t);return-1!==i&&i===r.expected.indexOf(e)||(r.actual.push(t),r.expected.push(e),function(t,e,n,r){if(null==t||null==e)return!1;if(Vn(t)||Vn(e))return t===e;if(n&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=lo(t),o=lo(e);if(i&&!o||!i&&o)return!1;if(i)return co(t=Vi.call(t),e=Vi.call(e),n);var a,s,u=Ji(t),c=Ji(e);if(u.length!==c.length)return!1;for(u.sort(),c.sort(),s=u.length-1;s>=0;s--)if(u[s]!==c[s])return!1;for(s=u.length-1;s>=0;s--)if(!co(t[a=u[s]],e[a],n,r))return!1;return!0}(t,e,n,r))}return n?t===e:t==e}function lo(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function fo(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function ho(t,e,n,r){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&so(i,n,"Missing expected exception"+r);var o="string"==typeof r,a=!t&&i&&!n;if((!t&&Gn(i)&&o&&fo(i,n)||a)&&so(i,n,"Got unwanted exception"+r),t&&i&&n&&!fo(i,n)||!t&&i)throw i}eo.AssertionError=io,Cn(io,Error),eo.fail=so,eo.ok=uo,eo.equal=function t(e,n,r){e!=n&&so(e,n,r,"==",t)},eo.notEqual=function t(e,n,r){e==n&&so(e,n,r,"!=",t)},eo.deepEqual=function t(e,n,r){co(e,n,!1)||so(e,n,r,"deepEqual",t)},eo.deepStrictEqual=function t(e,n,r){co(e,n,!0)||so(e,n,r,"deepStrictEqual",t)},eo.notDeepEqual=function t(e,n,r){co(e,n,!1)&&so(e,n,r,"notDeepEqual",t)},eo.notDeepStrictEqual=function t(e,n,r){co(e,n,!0)&&so(e,n,r,"notDeepStrictEqual",t)},eo.strictEqual=function t(e,n,r){e!==n&&so(e,n,r,"===",t)},eo.notStrictEqual=function t(e,n,r){e===n&&so(e,n,r,"!==",t)},eo.throws=function(t,e,n){ho(!0,t,e,n)},eo.doesNotThrow=function(t,e,n){ho(!1,t,e,n)},eo.ifError=function(t){if(t)throw t};var po=1e3,go=60*po,vo=60*go,_o=24*vo,mo=7*_o,yo=365.25*_o,wo=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*yo;case"weeks":case"week":case"w":return n*mo;case"days":case"day":case"d":return n*_o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*vo;case"minutes":case"minute":case"mins":case"min":case"m":return n*go;case"seconds":case"second":case"secs":case"sec":case"s":return n*po;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(t);if("number"===n&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=_o)return bo(t,e,_o,"day");if(e>=vo)return bo(t,e,vo,"hour");if(e>=go)return bo(t,e,go,"minute");if(e>=po)return bo(t,e,po,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=_o)return Math.round(t/_o)+"d";if(e>=vo)return Math.round(t/vo)+"h";if(e>=go)return Math.round(t/go)+"m";if(e>=po)return Math.round(t/po)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function bo(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}var ko=function(t){function e(t){let r,i=null;function o(...t){if(!o.enabled)return;const n=o,i=Number(new Date),a=i-(r||i);n.diff=a,n.prev=r,n.curr=i,r=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];r=o.call(n,e),t.splice(s,1),s--}return r})),e.formatArgs.call(n,t);(n.log||e.log).apply(n,t)}return o.namespace=t,o.useColors=e.useColors(),o.color=e.selectColor(t),o.extend=n,o.destroy=e.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null===i?e.enabled(t):i,set:t=>{i=t}}),"function"==typeof e.init&&e.init(o),o}function n(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function r(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(r),...e.skips.map(r).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=wo,e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e},Eo=e((function(t,e){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&void 0!==ae&&"env"in ae&&(t=ae.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=ko(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}));Eo.formatArgs,Eo.save,Eo.load,Eo.useColors,Eo.storage,Eo.destroy,Eo.colors,Eo.log;var Ao,So={isatty:function(){return!1},ReadStream:function(){throw new Error("tty.ReadStream is not implemented")},WriteStream:function(){throw new Error("tty.ReadStream is not implemented")}};function Co(){return"/tmp"}var xo={EOL:"\n",tmpdir:Co,tmpDir:Co,networkInterfaces:function(){},getNetworkInterfaces:function(){},release:function(){return void 0!==Bt.navigator?Bt.navigator.appVersion:""},type:function(){return"Browser"},cpus:function(){return[]},totalmem:function(){return Number.MAX_VALUE},freemem:function(){return Number.MAX_VALUE},uptime:function(){return 0},loadavg:function(){return[]},hostname:function(){return void 0!==Bt.location?Bt.location.hostname:""},endianness:function(){if(void 0===Ao){var t=new ArrayBuffer(2),e=new Uint8Array(t),n=new Uint16Array(t);if(e[0]=1,e[1]=2,258===n[0])Ao="BE";else{if(513!==n[0])throw new Error("unable to figure out endianess");Ao="LE"}}return Ao}},To=(t,e=ae.argv)=>{const n=t.startsWith("-")?"":1===t.length?"-":"--",r=e.indexOf(n+t),i=e.indexOf("--");return-1!==r&&(-1===i||r<i)};const{env:Ro}=ae;let Oo;function Io(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function No(t,e){if(0===Oo)return 0;if(To("color=16m")||To("color=full")||To("color=truecolor"))return 3;if(To("color=256"))return 2;if(t&&!e&&void 0===Oo)return 0;const n=Oo||0;if("dumb"===Ro.TERM)return n;if("win32"===ae.platform){const t=xo.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in Ro)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((t=>t in Ro))||"codeship"===Ro.CI_NAME?1:n;if("TEAMCITY_VERSION"in Ro)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ro.TEAMCITY_VERSION)?1:0;if("truecolor"===Ro.COLORTERM)return 3;if("TERM_PROGRAM"in Ro){const t=parseInt((Ro.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ro.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ro.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ro.TERM)||"COLORTERM"in Ro?1:n}To("no-color")||To("no-colors")||To("color=false")||To("color=never")?Oo=0:(To("color")||To("colors")||To("color=true")||To("color=always"))&&(Oo=1),"FORCE_COLOR"in Ro&&(Oo="true"===Ro.FORCE_COLOR?1:"false"===Ro.FORCE_COLOR?0:0===Ro.FORCE_COLOR.length?1:Math.min(parseInt(Ro.FORCE_COLOR,10),3));var jo={supportsColor:function(t){return Io(No(t,t&&t.isTTY))},stdout:Io(No(!0,So.isatty(1))),stderr:Io(No(!0,So.isatty(2)))},Lo=e((function(t,e){e.init=function(t){t.inspectOpts={};const n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]},e.log=function(...t){return ae.stderr.write(ir.format(...t)+"\n")},e.formatArgs=function(n){const{namespace:r,useColors:i}=this;if(i){const e=this.color,i="[3"+(e<8?e:"8;5;"+e),o=` ${i};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(i+"m+"+t.exports.humanize(this.diff)+"")}else n[0]=function(){if(e.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},e.save=function(t){t?ae.env.DEBUG=t:delete ae.env.DEBUG},e.load=function(){return ae.env.DEBUG},e.useColors=function(){return"colors"in e.inspectOpts?Boolean(e.inspectOpts.colors):So.isatty(ae.stderr.fd)},e.destroy=ir.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{const t=jo;t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}e.inspectOpts=Object.keys(ae.env).filter((t=>/^debug_/i.test(t))).reduce(((t,e)=>{const n=e.substring(6).toLowerCase().replace(/_([a-z])/g,((t,e)=>e.toUpperCase()));let r=ae.env[e];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),t[n]=r,t}),{}),t.exports=ko(e);const{formatters:n}=t.exports;n.o=function(t){return this.inspectOpts.colors=this.useColors,ir.inspect(t,this.inspectOpts).split("\n").map((t=>t.trim())).join(" ")},n.O=function(t){return this.inspectOpts.colors=this.useColors,ir.inspect(t,this.inspectOpts)}}));Lo.init,Lo.log,Lo.formatArgs,Lo.save,Lo.load,Lo.useColors,Lo.destroy,Lo.colors,Lo.inspectOpts;var Bo,Po=e((function(t){void 0===ae||"renderer"===ae.type||!0===ae.browser||ae.__nwjs?t.exports=Eo:t.exports=Lo})),Uo=function(){if(!Bo)try{Bo=Po("follow-redirects")}catch(t){Bo=function(){}}Bo.apply(null,arguments)},Mo=Ci.URL,zo=oi.Writable,Do=["abort","aborted","connect","error","socket","timeout"],Fo=Object.create(null);Do.forEach((function(t){Fo[t]=function(e,n,r){this._redirectable.emit(t,e,n,r)}}));var qo=Jo("ERR_FR_REDIRECTION_FAILURE",""),Zo=Jo("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),Wo=Jo("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Ho=Jo("ERR_STREAM_WRITE_AFTER_END","write after end");function $o(t,e){zo.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var n=this;this._onNativeResponse=function(t){n._processResponse(t)},this._performRequest()}function Ko(t){var e={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(t).forEach((function(r){var i=r+":",o=n[i]=t[r],a=e[r]=Object.create(o);Object.defineProperties(a,{request:{value:function(t,r,o){if("string"==typeof t){var a=t;try{t=function(t){var e={protocol:t.protocol,hostname:t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:t.pathname+t.search,href:t.href};""!==t.port&&(e.port=Number(t.port));return e}(new Mo(a))}catch(e){t=Ci.parse(a)}}else o=r,r=t,t={protocol:i};return"function"==typeof r&&(o=r,r=null),(r=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},t,r)).nativeProtocols=n,eo.equal(r.protocol,i,"protocol mismatch"),Uo("options",r),new $o(r,o)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(t,e,n){var r=a.request(t,e,n);return r.end(),r},configurable:!0,enumerable:!0,writable:!0}})})),e}function Yo(){}function Go(t,e){var n;for(var r in e)t.test(r)&&(n=e[r],delete e[r]);return n}function Jo(t,e){function n(t){Error.captureStackTrace(this,this.constructor),this.message=t||e}return n.prototype=new Error,n.prototype.constructor=n,n.prototype.name="Error ["+t+"]",n.prototype.code=t,n}function Vo(t){for(var e=0;e<Do.length;e++)t.removeListener(Do[e],Fo[Do[e]]);t.on("error",Yo),t.abort()}$o.prototype=Object.create(zo.prototype),$o.prototype.abort=function(){Vo(this._currentRequest),this.emit("abort")},$o.prototype.write=function(t,e,n){if(this._ending)throw new Ho;if(!("string"==typeof t||"object"==typeof t&&"length"in t))throw new TypeError("data should be a string, Buffer or Uint8Array");"function"==typeof e&&(n=e,e=null),0!==t.length?this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,n)):(this.emit("error",new Wo),this.abort()):n&&n()},$o.prototype.end=function(t,e,n){if("function"==typeof t?(n=t,t=e=null):"function"==typeof e&&(n=e,e=null),t){var r=this,i=this._currentRequest;this.write(t,e,(function(){r._ended=!0,i.end(null,null,n)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},$o.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)},$o.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)},$o.prototype.setTimeout=function(t,e){var n=this;function r(e){e.setTimeout(t),e.removeListener("timeout",e.destroy),e.addListener("timeout",e.destroy)}function i(e){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout((function(){n.emit("timeout"),o()}),t),r(e)}function o(){clearTimeout(this._timeout),e&&n.removeListener("timeout",e),this.socket||n._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",r),this.once("response",o),this.once("error",o),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(t){$o.prototype[t]=function(e,n){return this._currentRequest[t](e,n)}})),["aborted","connection","socket"].forEach((function(t){Object.defineProperty($o.prototype,t,{get:function(){return this._currentRequest[t]}})})),$o.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}},$o.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(e){if(this._options.agents){var n=t.substr(0,t.length-1);this._options.agent=this._options.agents[n]}var r=this._currentRequest=e.request(this._options,this._onNativeResponse);this._currentUrl=Ci.format(this._options),r._redirectable=this;for(var i=0;i<Do.length;i++)r.on(Do[i],Fo[Do[i]]);if(this._isRedirect){var o=0,a=this,s=this._requestBodyBuffers;!function t(e){if(r===a._currentRequest)if(e)a.emit("error",e);else if(o<s.length){var n=s[o++];r.finished||r.write(n.data,n.encoding,t)}else a._ended&&r.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+t))},$o.prototype._processResponse=function(t){var e=t.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:t.headers,statusCode:e});var n=t.headers.location;if(n&&!1!==this._options.followRedirects&&e>=300&&e<400){if(Vo(this._currentRequest),t.destroy(),++this._redirectCount>this._options.maxRedirects)return void this.emit("error",new Zo);((301===e||302===e)&&"POST"===this._options.method||303===e&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Go(/^content-/i,this._options.headers));var r=Go(/^host$/i,this._options.headers)||Ci.parse(this._currentUrl).hostname,i=Ci.resolve(this._currentUrl,n);Uo("redirecting to",i),this._isRedirect=!0;var o=Ci.parse(i);if(Object.assign(this._options,o),o.hostname!==r&&Go(/^authorization$/i,this._options.headers),"function"==typeof this._options.beforeRedirect){var a={headers:t.headers};try{this._options.beforeRedirect.call(null,this._options,a)}catch(t){return void this.emit("error",t)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(t){var s=new qo("Redirected request failed: "+t.message);s.cause=t,this.emit("error",s)}}else t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),this._requestBodyBuffers=[]};var Xo=Ko({http:$i,https:$i}),Qo=Ko;Xo.wrap=Qo;var ta={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function ea(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function na(t,e,n,r,i){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+r),i);else for(var o=0;o<r;o++)t[i+o]=e[n+o]}var ra=Uint8Array,ia=Uint16Array,oa=Int32Array;function aa(t){for(var e=t.length;--e>=0;)t[e]=0}var sa=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ua=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ca=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],la=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa=new Array(576);aa(fa);var ha=new Array(60);aa(ha);var da=new Array(512);aa(da);var pa=new Array(256);aa(pa);var ga=new Array(29);aa(ga);var va,_a,ma,ya=new Array(30);function wa(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}function ba(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function ka(t){return t<256?da[t]:da[256+(t>>>7)]}function Ea(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function Aa(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,Ea(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function Sa(t,e,n){Aa(t,n[2*e],n[2*e+1])}function Ca(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}function xa(t,e,n){var r,i,o=new Array(16),a=0;for(r=1;r<=15;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=Ca(o[s]++,s))}}function Ta(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Ra(t){t.bi_valid>8?Ea(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function Oa(t,e,n,r){var i=2*e,o=2*n;return t[i]<t[o]||t[i]===t[o]&&r[e]<=r[n]}function Ia(t,e,n){for(var r=t.heap[n],i=n<<1;i<=t.heap_len&&(i<t.heap_len&&Oa(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Oa(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function Na(t,e,n){var r,i,o,a,s=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*s]<<8|t.pending_buf[t.d_buf+2*s+1],i=t.pending_buf[t.l_buf+s],s++,0===r?Sa(t,i,e):(Sa(t,(o=pa[i])+256+1,e),0!==(a=sa[o])&&Aa(t,i-=ga[o],a),Sa(t,o=ka(--r),n),0!==(a=ua[o])&&Aa(t,r-=ya[o],a))}while(s<t.last_lit);Sa(t,256,e)}function ja(t,e){var n,r,i,o=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,u=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<u;n++)0!==o[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(i=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=c,n=t.heap_len>>1;n>=1;n--)Ia(t,o,n);i=u;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Ia(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*i]=o[2*n]+o[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,o[2*n+1]=o[2*r+1]=i,t.heap[1]=i++,Ia(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,r,i,o,a,s,u=e.dyn_tree,c=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,h=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)(o=u[2*u[2*(r=t.heap[n])+1]+1]+1)>p&&(o=p,g++),u[2*r+1]=o,r>c||(t.bl_count[o]++,a=0,r>=d&&(a=h[r-d]),s=u[2*r],t.opt_len+=s*(o+a),f&&(t.static_len+=s*(l[2*r+1]+a)));if(0!==g){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(r=t.bl_count[o];0!==r;)(i=t.heap[--n])>c||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}(t,e),xa(o,c,t.bl_count)}function La(t,e,n){var r,i,o=-1,a=e[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=e[2*(r+1)+1],++s<u&&i===a||(s<c?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))}function Ba(t,e,n){var r,i,o=-1,a=e[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),r=0;r<=n;r++)if(i=a,a=e[2*(r+1)+1],!(++s<u&&i===a)){if(s<c)do{Sa(t,i,t.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(Sa(t,i,t.bl_tree),s--),Sa(t,16,t.bl_tree),Aa(t,s-3,2)):s<=10?(Sa(t,17,t.bl_tree),Aa(t,s-3,3)):(Sa(t,18,t.bl_tree),Aa(t,s-11,7));s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4)}}aa(ya);var Pa=!1;function Ua(t){Pa||(!function(){var t,e,n,r,i,o=new Array(16);for(n=0,r=0;r<28;r++)for(ga[r]=n,t=0;t<1<<sa[r];t++)pa[n++]=r;for(pa[n-1]=r,i=0,r=0;r<16;r++)for(ya[r]=i,t=0;t<1<<ua[r];t++)da[i++]=r;for(i>>=7;r<30;r++)for(ya[r]=i<<7,t=0;t<1<<ua[r]-7;t++)da[256+i++]=r;for(e=0;e<=15;e++)o[e]=0;for(t=0;t<=143;)fa[2*t+1]=8,t++,o[8]++;for(;t<=255;)fa[2*t+1]=9,t++,o[9]++;for(;t<=279;)fa[2*t+1]=7,t++,o[7]++;for(;t<=287;)fa[2*t+1]=8,t++,o[8]++;for(xa(fa,287,o),t=0;t<30;t++)ha[2*t+1]=5,ha[2*t]=Ca(t,5);va=new wa(fa,sa,257,286,15),_a=new wa(ha,ua,0,30,15),ma=new wa(new Array(0),ca,0,19,7)}(),Pa=!0),t.l_desc=new ba(t.dyn_ltree,va),t.d_desc=new ba(t.dyn_dtree,_a),t.bl_desc=new ba(t.bl_tree,ma),t.bi_buf=0,t.bi_valid=0,Ta(t)}function Ma(t,e,n,r){Aa(t,0+(r?1:0),3),function(t,e,n,r){Ra(t),r&&(Ea(t,n),Ea(t,~n)),na(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n,!0)}function za(t){Aa(t,2,3),Sa(t,256,fa),function(t){16===t.bi_valid?(Ea(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}function Da(t,e,n,r){var i,o,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),ja(t,t.l_desc),ja(t,t.d_desc),a=function(t){var e;for(La(t,t.dyn_ltree,t.l_desc.max_code),La(t,t.dyn_dtree,t.d_desc.max_code),ja(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*la[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==e?Ma(t,e,n,r):4===t.strategy||o===i?(Aa(t,2+(r?1:0),3),Na(t,fa,ha)):(Aa(t,4+(r?1:0),3),function(t,e,n,r){var i;for(Aa(t,e-257,5),Aa(t,n-1,5),Aa(t,r-4,4),i=0;i<r;i++)Aa(t,t.bl_tree[2*la[i]+1],3);Ba(t,t.dyn_ltree,e-1),Ba(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),Na(t,t.dyn_ltree,t.dyn_dtree)),Ta(t),r&&Ra(t)}function Fa(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(pa[n]+256+1)]++,t.dyn_dtree[2*ka(e)]++),t.last_lit===t.lit_bufsize-1}function qa(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+e[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}var Za=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();function Wa(t,e,n,r){var i=Za,o=r+n;t^=-1;for(var a=r;a<o;a++)t=t>>>8^i[255&(t^e[a])];return-1^t}var Ha;function $a(t,e){return t.msg=ta[e],e}function Ka(t){return(t<<1)-(t>4?9:0)}function Ya(t){for(var e=t.length;--e>=0;)t[e]=0}function Ga(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(na(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function Ja(t,e){Da(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Ga(t.strm)}function Va(t,e){t.pending_buf[t.pending++]=e}function Xa(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function Qa(t,e){var n,r,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,c=t.window,l=t.w_mask,f=t.prev,h=t.strstart+258,d=c[o+a-1],p=c[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(c[(n=e)+a]===p&&c[n+a-1]===d&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<h);if(r=258-(h-o),o=h-258,r>a){if(t.match_start=e,a=r,r>=s)break;d=c[o+a-1],p=c[o+a]}}}while((e=f[e&l])>u&&0!=--i);return a<=t.lookahead?a:t.lookahead}function ts(t){var e,n,r,i,o,a,s,u,c,l,f=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-262)){na(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=n=t.hash_size;do{r=t.head[--e],t.head[e]=r>=f?r-f:0}while(--n);e=n=f;do{r=t.prev[--e],t.prev[e]=r>=f?r-f:0}while(--n);i+=f}if(0===t.strm.avail_in)break;if(a=t.strm,s=t.window,u=t.strstart+t.lookahead,c=i,l=void 0,(l=a.avail_in)>c&&(l=c),n=0===l?0:(a.avail_in-=l,na(s,a.input,a.next_in,l,u),1===a.state.wrap?a.adler=qa(a.adler,s,l,u):2===a.state.wrap&&(a.adler=Wa(a.adler,s,l,u)),a.next_in+=l,a.total_in+=l,l),t.lookahead+=n,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+3-1])&t.hash_mask,t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function es(t,e){for(var n,r;;){if(t.lookahead<262){if(ts(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-262&&(t.match_length=Qa(t,n)),t.match_length>=3)if(r=Fa(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=Fa(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(Ja(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Ja(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ja(t,!1),0===t.strm.avail_out)?1:2}function ns(t,e){for(var n,r,i;;){if(t.lookahead<262){if(ts(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-262&&(t.match_length=Qa(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,r=Fa(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(Ja(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=Fa(t,0,t.window[t.strstart-1]))&&Ja(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=Fa(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Ja(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ja(t,!1),0===t.strm.avail_out)?1:2}function rs(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}function is(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ia(1146),this.dyn_dtree=new ia(122),this.bl_tree=new ia(78),Ya(this.dyn_ltree),Ya(this.dyn_dtree),Ya(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ia(16),this.heap=new ia(573),Ya(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ia(573),Ya(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function os(t){var e=function(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=0,Ua(e),0):$a(t,-2)}(t);return 0===e&&function(t){t.window_size=2*t.w_size,Ya(t.head),t.max_lazy_match=Ha[t.level].max_lazy,t.good_match=Ha[t.level].good_length,t.nice_match=Ha[t.level].nice_length,t.max_chain_length=Ha[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),e}function as(t,e){var n,r,i,o;if(!t||!t.state||e>5||e<0)return t?$a(t,-2):-2;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||666===r.status&&4!==e)return $a(t,0===t.avail_out?-5:-2);if(r.strm=t,n=r.last_flush,r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Va(r,31),Va(r,139),Va(r,8),r.gzhead?(Va(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Va(r,255&r.gzhead.time),Va(r,r.gzhead.time>>8&255),Va(r,r.gzhead.time>>16&255),Va(r,r.gzhead.time>>24&255),Va(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Va(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Va(r,255&r.gzhead.extra.length),Va(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Wa(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Va(r,0),Va(r,0),Va(r,0),Va(r,0),Va(r,0),Va(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Va(r,3),r.status=113);else{var a=8+(r.w_bits-8<<4)<<8;a|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=113,Xa(r,a),0!==r.strstart&&(Xa(r,t.adler>>>16),Xa(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),Ga(t),i=r.pending,r.pending!==r.pending_buf_size));)Va(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),Ga(t),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Va(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),Ga(t),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Va(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(t.adler=Wa(t.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Ga(t),r.pending+2<=r.pending_buf_size&&(Va(r,255&t.adler),Va(r,t.adler>>8&255),t.adler=0,r.status=113)):r.status=113),0!==r.pending){if(Ga(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&Ka(e)<=Ka(n)&&4!==e)return $a(t,-5);if(666===r.status&&0!==t.avail_in)return $a(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&666!==r.status){var s=2===r.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(ts(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=Fa(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(Ja(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Ja(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ja(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var n,r,i,o,a=t.window;;){if(t.lookahead<=258){if(ts(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=a[i=t.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){o=t.strstart+258;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);t.match_length=258-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=Fa(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Fa(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(Ja(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Ja(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ja(t,!1),0===t.strm.avail_out)?1:2}(r,e):Ha[r.level].func(r,e);if(3!==s&&4!==s||(r.status=666),1===s||3===s)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===s&&(1===e?za(r):5!==e&&(Ma(r,0,0,!1),3===e&&(Ya(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Ga(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Va(r,255&t.adler),Va(r,t.adler>>8&255),Va(r,t.adler>>16&255),Va(r,t.adler>>24&255),Va(r,255&t.total_in),Va(r,t.total_in>>8&255),Va(r,t.total_in>>16&255),Va(r,t.total_in>>24&255)):(Xa(r,t.adler>>>16),Xa(r,65535&t.adler)),Ga(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)}Ha=[new rs(0,0,0,0,(function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ts(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,Ja(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(Ja(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Ja(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ja(t,!1),t.strm.avail_out),1)})),new rs(4,4,8,4,es),new rs(4,5,16,8,es),new rs(4,6,32,32,es),new rs(4,4,16,16,ns),new rs(8,16,32,32,ns),new rs(8,16,128,128,ns),new rs(8,32,128,256,ns),new rs(32,128,258,1024,ns),new rs(32,258,258,4096,ns)];function ss(t,e){var n,r,i,o,a,s,u,c,l,f,h,d,p,g,v,_,m,y,w,b,k,E,A,S,C;n=t.state,r=t.next_in,S=t.input,i=r+(t.avail_in-5),o=t.next_out,C=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),u=n.dmax,c=n.wsize,l=n.whave,f=n.wnext,h=n.window,d=n.hold,p=n.bits,g=n.lencode,v=n.distcode,_=(1<<n.lenbits)-1,m=(1<<n.distbits)-1;t:do{p<15&&(d+=S[r++]<<p,p+=8,d+=S[r++]<<p,p+=8),y=g[d&_];e:for(;;){if(d>>>=w=y>>>24,p-=w,0===(w=y>>>16&255))C[o++]=65535&y;else{if(!(16&w)){if(0==(64&w)){y=g[(65535&y)+(d&(1<<w)-1)];continue e}if(32&w){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}b=65535&y,(w&=15)&&(p<w&&(d+=S[r++]<<p,p+=8),b+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=S[r++]<<p,p+=8,d+=S[r++]<<p,p+=8),y=v[d&m];n:for(;;){if(d>>>=w=y>>>24,p-=w,!(16&(w=y>>>16&255))){if(0==(64&w)){y=v[(65535&y)+(d&(1<<w)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(k=65535&y,p<(w&=15)&&(d+=S[r++]<<p,(p+=8)<w&&(d+=S[r++]<<p,p+=8)),(k+=d&(1<<w)-1)>u){t.msg="invalid distance too far back",n.mode=30;break t}if(d>>>=w,p-=w,k>(w=o-a)){if((w=k-w)>l&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(E=0,A=h,0===f){if(E+=c-w,w<b){b-=w;do{C[o++]=h[E++]}while(--w);E=o-k,A=C}}else if(f<w){if(E+=c+f-w,(w-=f)<b){b-=w;do{C[o++]=h[E++]}while(--w);if(E=0,f<b){b-=w=f;do{C[o++]=h[E++]}while(--w);E=o-k,A=C}}}else if(E+=f-w,w<b){b-=w;do{C[o++]=h[E++]}while(--w);E=o-k,A=C}for(;b>2;)C[o++]=A[E++],C[o++]=A[E++],C[o++]=A[E++],b-=3;b&&(C[o++]=A[E++],b>1&&(C[o++]=A[E++]))}else{E=o-k;do{C[o++]=C[E++],C[o++]=C[E++],C[o++]=C[E++],b-=3}while(b>2);b&&(C[o++]=C[E++],b>1&&(C[o++]=C[E++]))}break}}break}}while(r<i&&o<s);r-=b=p>>3,d&=(1<<(p-=b<<3))-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=o<s?s-o+257:257-(o-s),n.hold=d,n.bits=p}var us=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],cs=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],ls=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],fs=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function hs(t,e,n,r,i,o,a,s){var u,c,l,f,h,d,p,g,v,_=s.bits,m=0,y=0,w=0,b=0,k=0,E=0,A=0,S=0,C=0,x=0,T=null,R=0,O=new ia(16),I=new ia(16),N=null,j=0;for(m=0;m<=15;m++)O[m]=0;for(y=0;y<r;y++)O[e[n+y]]++;for(k=_,b=15;b>=1&&0===O[b];b--);if(k>b&&(k=b),0===b)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(w=1;w<b&&0===O[w];w++);for(k<w&&(k=w),S=1,m=1;m<=15;m++)if(S<<=1,(S-=O[m])<0)return-1;if(S>0&&(0===t||1!==b))return-1;for(I[1]=0,m=1;m<15;m++)I[m+1]=I[m]+O[m];for(y=0;y<r;y++)0!==e[n+y]&&(a[I[e[n+y]]++]=y);if(0===t?(T=N=a,d=19):1===t?(T=us,R-=257,N=cs,j-=257,d=256):(T=ls,N=fs,d=-1),x=0,y=0,m=w,h=o,E=k,A=0,l=-1,f=(C=1<<k)-1,1===t&&C>852||2===t&&C>592)return 1;for(;;){p=m-A,a[y]<d?(g=0,v=a[y]):a[y]>d?(g=N[j+a[y]],v=T[R+a[y]]):(g=96,v=0),u=1<<m-A,w=c=1<<E;do{i[h+(x>>A)+(c-=u)]=p<<24|g<<16|v|0}while(0!==c);for(u=1<<m-1;x&u;)u>>=1;if(0!==u?(x&=u-1,x+=u):x=0,y++,0==--O[m]){if(m===b)break;m=e[n+a[y]]}if(m>k&&(x&f)!==l){for(0===A&&(A=k),h+=w,S=1<<(E=m-A);E+A<b&&!((S-=O[E+A])<=0);)E++,S<<=1;if(C+=1<<E,1===t&&C>852||2===t&&C>592)return 1;i[l=x&f]=k<<24|E<<16|h-o|0}}return 0!==x&&(i[h+x]=m-A<<24|64<<16|0),s.bits=k,0}function ds(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function ps(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new ia(320),this.work=new ia(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function gs(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,function(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new oa(852),e.distcode=e.distdyn=new oa(592),e.sane=1,e.back=-1,0):-2}(t)):-2}function vs(t,e){var n,r;return t?(r=new ps,t.state=r,r.window=null,0!==(n=function(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,gs(t))):-2}(t,e))&&(t.state=null),n):-2}var _s,ms,ys=!0;function ws(t){if(ys){var e;for(_s=new oa(512),ms=new oa(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(hs(1,t.lens,0,288,_s,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;hs(2,t.lens,0,32,ms,0,t.work,{bits:5}),ys=!1}t.lencode=_s,t.lenbits=9,t.distcode=ms,t.distbits=5}function bs(t,e){var n,r,i,o,a,s,u,c,l,f,h,d,p,g,v,_,m,y,w,b,k,E,A,S,C=0,x=new ra(4),T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(n=t.state).mode&&(n.mode=13),a=t.next_out,i=t.output,u=t.avail_out,o=t.next_in,r=t.input,s=t.avail_in,c=n.hold,l=n.bits,f=s,h=u,E=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;l<16;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(2&n.wrap&&35615===c){n.check=0,x[0]=255&c,x[1]=c>>>8&255,n.check=Wa(n.check,x,2,0),c=0,l=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&c)){t.msg="unknown compression method",n.mode=30;break}if(l-=4,k=8+(15&(c>>>=4)),0===n.wbits)n.wbits=k;else if(k>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<k,t.adler=n.check=1,n.mode=512&c?10:12,c=0,l=0;break;case 2:for(;l<16;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(n.flags=c,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&(x[0]=255&c,x[1]=c>>>8&255,n.check=Wa(n.check,x,2,0)),c=0,l=0,n.mode=3;case 3:for(;l<32;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.head&&(n.head.time=c),512&n.flags&&(x[0]=255&c,x[1]=c>>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,n.check=Wa(n.check,x,4,0)),c=0,l=0,n.mode=4;case 4:for(;l<16;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&(x[0]=255&c,x[1]=c>>>8&255,n.check=Wa(n.check,x,2,0)),c=0,l=0,n.mode=5;case 5:if(1024&n.flags){for(;l<16;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&(x[0]=255&c,x[1]=c>>>8&255,n.check=Wa(n.check,x,2,0)),c=0,l=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((d=n.length)>s&&(d=s),d&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),na(n.head.extra,r,o,d,k)),512&n.flags&&(n.check=Wa(n.check,r,d,o)),s-=d,o+=d,n.length-=d),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===s)break t;d=0;do{k=r[o+d++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k))}while(k&&d<s);if(512&n.flags&&(n.check=Wa(n.check,r,d,o)),s-=d,o+=d,k)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===s)break t;d=0;do{k=r[o+d++],n.head&&k&&n.length<65536&&(n.head.comment+=String.fromCharCode(k))}while(k&&d<s);if(512&n.flags&&(n.check=Wa(n.check,r,d,o)),s-=d,o+=d,k)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;l<16;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(c!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}c=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;l<32;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}t.adler=n.check=ds(c),c=0,l=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=a,t.avail_out=u,t.next_in=o,t.avail_in=s,n.hold=c,n.bits=l,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){c>>>=7&l,l-=7&l,n.mode=27;break}for(;l<3;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}switch(n.last=1&c,l-=1,3&(c>>>=1)){case 0:n.mode=14;break;case 1:if(ws(n),n.mode=20,6===e){c>>>=2,l-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}c>>>=2,l-=2;break;case 14:for(c>>>=7&l,l-=7&l;l<32;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&c,c=0,l=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(d=n.length){if(d>s&&(d=s),d>u&&(d=u),0===d)break t;na(i,r,o,d,a),s-=d,o+=d,u-=d,a+=d,n.length-=d;break}n.mode=12;break;case 17:for(;l<14;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(n.nlen=257+(31&c),c>>>=5,l-=5,n.ndist=1+(31&c),c>>>=5,l-=5,n.ncode=4+(15&c),c>>>=4,l-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;l<3;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.lens[T[n.have++]]=7&c,c>>>=3,l-=3}for(;n.have<19;)n.lens[T[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,A={bits:n.lenbits},E=hs(0,n.lens,0,19,n.lencode,0,n.work,A),n.lenbits=A.bits,E){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;_=(C=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=l);){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(m<16)c>>>=v,l-=v,n.lens[n.have++]=m;else{if(16===m){for(S=v+2;l<S;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(c>>>=v,l-=v,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}k=n.lens[n.have-1],d=3+(3&c),c>>>=2,l-=2}else if(17===m){for(S=v+3;l<S;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}l-=v,k=0,d=3+(7&(c>>>=v)),c>>>=3,l-=3}else{for(S=v+7;l<S;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}l-=v,k=0,d=11+(127&(c>>>=v)),c>>>=7,l-=7}if(n.have+d>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;d--;)n.lens[n.have++]=k}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,A={bits:n.lenbits},E=hs(1,n.lens,0,n.nlen,n.lencode,0,n.work,A),n.lenbits=A.bits,E){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,A={bits:n.distbits},E=hs(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,A),n.distbits=A.bits,E){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(s>=6&&u>=258){t.next_out=a,t.avail_out=u,t.next_in=o,t.avail_in=s,n.hold=c,n.bits=l,ss(t,h),a=t.next_out,i=t.output,u=t.avail_out,o=t.next_in,r=t.input,s=t.avail_in,c=n.hold,l=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;_=(C=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=l);){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(_&&0==(240&_)){for(y=v,w=_,b=m;_=(C=n.lencode[b+((c&(1<<y+w)-1)>>y)])>>>16&255,m=65535&C,!(y+(v=C>>>24)<=l);){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=v,l-=v,n.back+=v,n.length=m,0===_){n.mode=26;break}if(32&_){n.back=-1,n.mode=12;break}if(64&_){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&_,n.mode=22;case 22:if(n.extra){for(S=n.extra;l<S;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;_=(C=n.distcode[c&(1<<n.distbits)-1])>>>16&255,m=65535&C,!((v=C>>>24)<=l);){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(0==(240&_)){for(y=v,w=_,b=m;_=(C=n.distcode[b+((c&(1<<y+w)-1)>>y)])>>>16&255,m=65535&C,!(y+(v=C>>>24)<=l);){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=v,l-=v,n.back+=v,64&_){t.msg="invalid distance code",n.mode=30;break}n.offset=m,n.extra=15&_,n.mode=24;case 24:if(n.extra){for(S=n.extra;l<S;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===u)break t;if(d=h-u,n.offset>d){if((d=n.offset-d)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),g=n.window}else g=i,p=a-n.offset,d=n.length;d>u&&(d=u),u-=d,n.length-=d;do{i[a++]=g[p++]}while(--d);0===n.length&&(n.mode=21);break;case 26:if(0===u)break t;i[a++]=n.length,u--,n.mode=21;break;case 27:if(n.wrap){for(;l<32;){if(0===s)break t;s--,c|=r[o++]<<l,l+=8}if(h-=u,t.total_out+=h,n.total+=h,h&&(t.adler=n.check=n.flags?Wa(n.check,i,h,a-h):qa(n.check,i,h,a-h)),h=u,(n.flags?c:ds(c))!==n.check){t.msg="incorrect data check",n.mode=30;break}c=0,l=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;l<32;){if(0===s)break t;s--,c+=r[o++]<<l,l+=8}if(c!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}c=0,l=0}n.mode=29;case 29:E=1;break t;case 30:E=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=a,t.avail_out=u,t.next_in=o,t.avail_in=s,n.hold=c,n.bits=l,(n.wsize||h!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&function(t,e,n,r){var i,o=t.state;null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new ra(o.wsize)),r>=o.wsize?(na(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>r&&(i=r),na(o.window,e,n-r,i,o.wnext),(r-=i)?(na(o.window,e,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i)))}(t,t.output,t.next_out,h-t.avail_out),f-=t.avail_in,h-=t.avail_out,t.total_in+=f,t.total_out+=h,n.total+=h,n.wrap&&h&&(t.adler=n.check=n.flags?Wa(n.check,i,h,t.next_out-h):qa(n.check,i,h,t.next_out-h)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===f&&0===h||4===e)&&0===E&&(E=-5),E}var ks;function Es(t){if(t<1||t>7)throw new TypeError("Bad argument");this.mode=t,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function As(t,e){for(var n=0;n<t.length;n++)this[e+n]=t[n]}Es.prototype.init=function(t,e,n,r,i){var o;switch(this.windowBits=t,this.level=e,this.memLevel=n,this.strategy=r,3!==this.mode&&4!==this.mode||(this.windowBits+=16),7===this.mode&&(this.windowBits+=32),5!==this.mode&&6!==this.mode||(this.windowBits=-this.windowBits),this.strm=new ea,this.mode){case 1:case 3:case 5:o=function(t,e,n,r,i,o){if(!t)return-2;var a=1;if(-1===e&&(e=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||8!==n||r<8||r>15||e<0||e>9||o<0||o>4)return $a(t,-2);8===r&&(r=9);var s=new is;return t.state=s,s.strm=t,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new ra(2*s.w_size),s.head=new ia(s.hash_size),s.prev=new ia(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new ra(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=e,s.strategy=o,s.method=n,os(t)}(this.strm,this.level,8,this.windowBits,this.memLevel,this.strategy);break;case 2:case 4:case 6:case 7:o=vs(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}0===o?(this.write_in_progress=!1,this.init_done=!0):this._error(o)},Es.prototype.params=function(){throw new Error("deflateParams Not supported")},Es.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(0===this.mode)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},Es.prototype.write=function(t,e,n,r,i,o,a){this._writeCheck(),this.write_in_progress=!0;var s=this;return ae.nextTick((function(){s.write_in_progress=!1;var u=s._write(t,e,n,r,i,o,a);s.callback(u[0],u[1]),s.pending_close&&s.close()})),this},Es.prototype.writeSync=function(t,e,n,r,i,o,a){return this._writeCheck(),this._write(t,e,n,r,i,o,a)},Es.prototype._write=function(t,e,n,r,i,o,a){if(this.write_in_progress=!0,0!==t&&1!==t&&2!==t&&3!==t&&4!==t&&5!==t)throw new Error("Invalid flush value");null==e&&(e=new Re(0),r=0,n=0),i._set?i.set=i._set:i.set=As;var s,u=this.strm;switch(u.avail_in=r,u.input=e,u.next_in=n,u.avail_out=a,u.output=i,u.next_out=o,this.mode){case 1:case 3:case 5:s=as(u,t);break;case 7:case 2:case 4:case 6:s=bs(u,t);break;default:throw new Error("Unknown mode "+this.mode)}return 1!==s&&0!==s&&this._error(s),this.write_in_progress=!1,[u.avail_in,u.avail_out]},Es.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,1===this.mode||3===this.mode||5===this.mode?function(t){var e;t&&t.state&&(42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?$a(t,-2):(t.state=null,113===e&&$a(t,-3)))}(this.strm):function(t){if(!t||!t.state)return-2;var e=t.state;e.window&&(e.window=null),t.state=null}(this.strm),this.mode=0)},Es.prototype.reset=function(){switch(this.mode){case 1:case 5:ks=os(this.strm);break;case 2:case 6:ks=gs(this.strm)}0!==ks&&this._error(ks)},Es.prototype._error=function(t){this.onerror(ta[t]+": "+this.strm.msg,t),this.write_in_progress=!1,this.pending_close&&this.close()};var Ss=Object.freeze({__proto__:null,NONE:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8,Zlib:Es});var Cs={};Object.keys(Ss).forEach((function(t){Cs[t]=Ss[t]})),Cs.Z_MIN_WINDOWBITS=8,Cs.Z_MAX_WINDOWBITS=15,Cs.Z_DEFAULT_WINDOWBITS=15,Cs.Z_MIN_CHUNK=64,Cs.Z_MAX_CHUNK=1/0,Cs.Z_DEFAULT_CHUNK=16384,Cs.Z_MIN_MEMLEVEL=1,Cs.Z_MAX_MEMLEVEL=9,Cs.Z_DEFAULT_MEMLEVEL=8,Cs.Z_MIN_LEVEL=-1,Cs.Z_MAX_LEVEL=9,Cs.Z_DEFAULT_LEVEL=Cs.Z_DEFAULT_COMPRESSION;var xs={Z_OK:Cs.Z_OK,Z_STREAM_END:Cs.Z_STREAM_END,Z_NEED_DICT:Cs.Z_NEED_DICT,Z_ERRNO:Cs.Z_ERRNO,Z_STREAM_ERROR:Cs.Z_STREAM_ERROR,Z_DATA_ERROR:Cs.Z_DATA_ERROR,Z_MEM_ERROR:Cs.Z_MEM_ERROR,Z_BUF_ERROR:Cs.Z_BUF_ERROR,Z_VERSION_ERROR:Cs.Z_VERSION_ERROR};function Ts(t,e,n){var r=[],i=0;function o(){for(var e;null!==(e=t.read());)r.push(e),i+=e.length;t.once("readable",o)}function a(){var e=Re.concat(r,i);r=[],n(null,e),t.close()}t.on("error",(function(e){t.removeListener("end",a),t.removeListener("readable",o),n(e)})),t.on("end",a),t.end(e),o()}function Rs(t,e){if("string"==typeof e&&(e=new Re(e)),!Re.isBuffer(e))throw new TypeError("Not a string or buffer");var n=Cs.Z_FINISH;return t._processChunk(e,n)}function Os(t){if(!(this instanceof Os))return new Os(t);Us.call(this,t,Cs.DEFLATE)}function Is(t){if(!(this instanceof Is))return new Is(t);Us.call(this,t,Cs.INFLATE)}function Ns(t){if(!(this instanceof Ns))return new Ns(t);Us.call(this,t,Cs.GZIP)}function js(t){if(!(this instanceof js))return new js(t);Us.call(this,t,Cs.GUNZIP)}function Ls(t){if(!(this instanceof Ls))return new Ls(t);Us.call(this,t,Cs.DEFLATERAW)}function Bs(t){if(!(this instanceof Bs))return new Bs(t);Us.call(this,t,Cs.INFLATERAW)}function Ps(t){if(!(this instanceof Ps))return new Ps(t);Us.call(this,t,Cs.UNZIP)}function Us(t,e){if(this._opts=t=t||{},this._chunkSize=t.chunkSize||Cs.Z_DEFAULT_CHUNK,ni.call(this,t),t.flush&&t.flush!==Cs.Z_NO_FLUSH&&t.flush!==Cs.Z_PARTIAL_FLUSH&&t.flush!==Cs.Z_SYNC_FLUSH&&t.flush!==Cs.Z_FULL_FLUSH&&t.flush!==Cs.Z_FINISH&&t.flush!==Cs.Z_BLOCK)throw new Error("Invalid flush flag: "+t.flush);if(this._flushFlag=t.flush||Cs.Z_NO_FLUSH,t.chunkSize&&(t.chunkSize<Cs.Z_MIN_CHUNK||t.chunkSize>Cs.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBits<Cs.Z_MIN_WINDOWBITS||t.windowBits>Cs.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.level<Cs.Z_MIN_LEVEL||t.level>Cs.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevel<Cs.Z_MIN_MEMLEVEL||t.memLevel>Cs.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=Cs.Z_FILTERED&&t.strategy!=Cs.Z_HUFFMAN_ONLY&&t.strategy!=Cs.Z_RLE&&t.strategy!=Cs.Z_FIXED&&t.strategy!=Cs.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!Re.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new Cs.Zlib(e);var n=this;this._hadError=!1,this._binding.onerror=function(t,e){n._binding=null,n._hadError=!0;var r=new Error(t);r.errno=e,r.code=Cs.codes[e],n.emit("error",r)};var r=Cs.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(r=t.level);var i=Cs.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(i=t.strategy),this._binding.init(t.windowBits||Cs.Z_DEFAULT_WINDOWBITS,r,t.memLevel||Cs.Z_DEFAULT_MEMLEVEL,i,t.dictionary),this._buffer=new Re(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=i,this.once("end",this.close)}Object.keys(xs).forEach((function(t){xs[xs[t]]=t})),Cn(Us,ni),Us.prototype.params=function(t,e,n){if(t<Cs.Z_MIN_LEVEL||t>Cs.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+t);if(e!=Cs.Z_FILTERED&&e!=Cs.Z_HUFFMAN_ONLY&&e!=Cs.Z_RLE&&e!=Cs.Z_FIXED&&e!=Cs.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+e);if(this._level!==t||this._strategy!==e){var r=this;this.flush(Cs.Z_SYNC_FLUSH,(function(){r._binding.params(t,e),r._hadError||(r._level=t,r._strategy=e,n&&n())}))}else ae.nextTick(n)},Us.prototype.reset=function(){return this._binding.reset()},Us.prototype._flush=function(t){this._transform(new Re(0),"",t)},Us.prototype.flush=function(t,e){var n=this._writableState;if(("function"==typeof t||void 0===t&&!e)&&(e=t,t=Cs.Z_FULL_FLUSH),n.ended)e&&ae.nextTick(e);else if(n.ending)e&&this.once("end",e);else if(n.needDrain){var r=this;this.once("drain",(function(){r.flush(e)}))}else this._flushFlag=t,this.write(new Re(0),"",e)},Us.prototype.close=function(t){if(t&&ae.nextTick(t),!this._closed){this._closed=!0,this._binding.close();var e=this;ae.nextTick((function(){e.emit("close")}))}},Us.prototype._transform=function(t,e,n){var r,i=this._writableState,o=(i.ending||i.ended)&&(!t||i.length===t.length);if(null===!t&&!Re.isBuffer(t))return n(new Error("invalid input"));o?r=Cs.Z_FINISH:(r=this._flushFlag,t.length>=i.length&&(this._flushFlag=this._opts.flush||Cs.Z_NO_FLUSH)),this._processChunk(t,r,n)},Us.prototype._processChunk=function(t,e,n){var r=t&&t.length,i=this._chunkSize-this._offset,o=0,a=this,s="function"==typeof n;if(!s){var u,c=[],l=0;this.on("error",(function(t){u=t}));do{var f=this._binding.writeSync(e,t,o,r,this._buffer,this._offset,i)}while(!this._hadError&&p(f[0],f[1]));if(this._hadError)throw u;var h=Re.concat(c,l);return this.close(),h}var d=this._binding.write(e,t,o,r,this._buffer,this._offset,i);function p(u,f){if(!a._hadError){var h=i-f;if(function(t,e){if(!t)throw new Error(e)}(h>=0,"have should not go down"),h>0){var d=a._buffer.slice(a._offset,a._offset+h);a._offset+=h,s?a.push(d):(c.push(d),l+=d.length)}if((0===f||a._offset>=a._chunkSize)&&(i=a._chunkSize,a._offset=0,a._buffer=new Re(a._chunkSize)),0===f){if(o+=r-u,r=u,!s)return!0;var g=a._binding.write(e,t,o,r,a._buffer,a._offset,a._chunkSize);return g.callback=p,void(g.buffer=t)}if(!s)return!1;n()}}d.buffer=t,d.callback=p},Cn(Os,Us),Cn(Is,Us),Cn(Ns,Us),Cn(js,Us),Cn(Ls,Us),Cn(Bs,Us),Cn(Ps,Us);var Ms,zs={codes:xs,createDeflate:function(t){return new Os(t)},createInflate:function(t){return new Is(t)},createDeflateRaw:function(t){return new Ls(t)},createInflateRaw:function(t){return new Bs(t)},createGzip:function(t){return new Ns(t)},createGunzip:function(t){return new js(t)},createUnzip:function(t){return new Ps(t)},deflate:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Os(e),t,n)},deflateSync:function(t,e){return Rs(new Os(e),t)},gzip:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Ns(e),t,n)},gzipSync:function(t,e){return Rs(new Ns(e),t)},deflateRaw:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Ls(e),t,n)},deflateRawSync:function(t,e){return Rs(new Ls(e),t)},unzip:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Ps(e),t,n)},unzipSync:function(t,e){return Rs(new Ps(e),t)},inflate:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Is(e),t,n)},inflateSync:function(t,e){return Rs(new Is(e),t)},gunzip:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new js(e),t,n)},gunzipSync:function(t,e){return Rs(new js(e),t)},inflateRaw:function(t,e,n){return"function"==typeof e&&(n=e,e={}),Ts(new Bs(e),t,n)},inflateRawSync:function(t,e){return Rs(new Bs(e),t)},Deflate:Os,Inflate:Is,Gzip:Ns,Gunzip:js,DeflateRaw:Ls,InflateRaw:Bs,Unzip:Ps,Zlib:Us},Ds="Promise based HTTP client for the browser and node.js",Fs={test:"grunt test && bundlesize",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},qs={type:"git",url:"https://github.com/axios/axios.git"},Zs=["xhr","http","ajax","promise","node"],Ws={url:"https://github.com/axios/axios/issues"},Hs="https://github.com/axios/axios",$s={bundlesize:"^0.17.0",coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.0.2","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^20.1.0","grunt-karma":"^2.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^1.0.18","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^1.3.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^1.2.0","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.7.0","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^5.2.0",sinon:"^4.5.0",typescript:"^2.8.1","url-search-params":"^0.10.0",webpack:"^1.13.1","webpack-dev-server":"^1.14.1"},Ks={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},Ys="dist/axios.min.js",Gs={"follow-redirects":"^1.10.0"},Js=[{path:"./dist/axios.min.js",threshold:"5kB"}],Vs={name:"axios",version:"0.21.1",description:Ds,main:"index.js",scripts:Fs,repository:qs,keywords:Zs,author:"Matt Zabriskie",license:"MIT",bugs:Ws,homepage:Hs,devDependencies:$s,browser:Ks,jsdelivr:"dist/axios.min.js",unpkg:Ys,typings:"./index.d.ts",dependencies:Gs,bundlesize:Js},Xs=(Ms=Object.freeze({__proto__:null,name:"axios",version:"0.21.1",description:Ds,main:"index.js",scripts:Fs,repository:qs,keywords:Zs,author:"Matt Zabriskie",license:"MIT",bugs:Ws,homepage:Hs,devDependencies:$s,browser:Ks,jsdelivr:"dist/axios.min.js",unpkg:Ys,typings:"./index.d.ts",dependencies:Gs,bundlesize:Js,default:Vs}))&&Ms.default||Ms,Qs=Xo.http,tu=Xo.https,eu=/https:?/;function nu(t,e,n){if(t.hostname=e.host,t.host=e.host,t.port=e.port,t.path=n,e.auth){var r=Re.from(e.auth.username+":"+e.auth.password,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+r}t.beforeRedirect=function(t){t.headers.host=t.host,nu(t,e,t.href)}}var ru=function(t){return new Promise((function(e,n){var r=function(t){e(t)},i=function(t){n(t)},o=t.data,a=t.headers;if(a["User-Agent"]||a["user-agent"]||(a["User-Agent"]="axios/"+Xs.version),o&&!Tt.isStream(o)){if(Re.isBuffer(o));else if(Tt.isArrayBuffer(o))o=Re.from(new Uint8Array(o));else{if(!Tt.isString(o))return i(ce("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",t));o=Re.from(o,"utf-8")}a["Content-Length"]=o.length}var s=void 0;t.auth&&(s=(t.auth.username||"")+":"+(t.auth.password||""));var u=he(t.baseURL,t.url),c=Ci.parse(u),l=c.protocol||"http:";if(!s&&c.auth){var f=c.auth.split(":");s=(f[0]||"")+":"+(f[1]||"")}s&&delete a.Authorization;var h=eu.test(l),d=h?t.httpsAgent:t.httpAgent,p={path:Ot(c.path,t.params,t.paramsSerializer).replace(/^\?/,""),method:t.method.toUpperCase(),headers:a,agent:d,agents:{http:t.httpAgent,https:t.httpsAgent},auth:s};t.socketPath?p.socketPath=t.socketPath:(p.hostname=c.hostname,p.port=c.port);var g,v=t.proxy;if(!v&&!1!==v){var _=l.slice(0,-1)+"_proxy",m=ae.env[_]||ae.env[_.toUpperCase()];if(m){var y=Ci.parse(m),w=ae.env.no_proxy||ae.env.NO_PROXY,b=!0;if(w)b=!w.split(",").map((function(t){return t.trim()})).some((function(t){return!!t&&("*"===t||("."===t[0]&&c.hostname.substr(c.hostname.length-t.length)===t||c.hostname===t))}));if(b&&(v={host:y.hostname,port:y.port,protocol:y.protocol},y.auth)){var k=y.auth.split(":");v.auth={username:k[0],password:k[1]}}}}v&&(p.headers.host=c.hostname+(c.port?":"+c.port:""),nu(p,v,l+"//"+c.hostname+(c.port?":"+c.port:"")+p.path));var E=h&&(!v||eu.test(v.protocol));t.transport?g=t.transport:0===t.maxRedirects?g=$i:(t.maxRedirects&&(p.maxRedirects=t.maxRedirects),g=E?tu:Qs),t.maxBodyLength>-1&&(p.maxBodyLength=t.maxBodyLength);var A=g.request(p,(function(e){if(!A.aborted){var n=e,o=e.req||A;if(204!==e.statusCode&&"HEAD"!==o.method&&!1!==t.decompress)switch(e.headers["content-encoding"]){case"gzip":case"compress":case"deflate":n=n.pipe(zs.createUnzip()),delete e.headers["content-encoding"]}var a={status:e.statusCode,statusText:e.statusMessage,headers:e.headers,config:t,request:o};if("stream"===t.responseType)a.data=n,le(r,i,a);else{var s=[];n.on("data",(function(e){s.push(e),t.maxContentLength>-1&&Re.concat(s).length>t.maxContentLength&&(n.destroy(),i(ce("maxContentLength size of "+t.maxContentLength+" exceeded",t,null,o)))})),n.on("error",(function(e){A.aborted||i(ue(e,t,null,o))})),n.on("end",(function(){var e=Re.concat(s);"arraybuffer"!==t.responseType&&(e=e.toString(t.responseEncoding),t.responseEncoding&&"utf8"!==t.responseEncoding||(e=Tt.stripBOM(e))),a.data=e,le(r,i,a)}))}}}));A.on("error",(function(e){A.aborted&&"ERR_FR_TOO_MANY_REDIRECTS"!==e.code||i(ue(e,t,null,A))})),t.timeout&&A.setTimeout(t.timeout,(function(){A.abort(),i(ce("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",A))})),t.cancelToken&&t.cancelToken.promise.then((function(t){A.aborted||(A.abort(),i(t))})),Tt.isStream(o)?o.on("error",(function(e){i(ue(e,t,null,A))})).pipe(A):A.end(o)}))},iu={"Content-Type":"application/x-www-form-urlencoded"};function ou(t,e){!Tt.isUndefined(t)&&Tt.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var au,su={adapter:("undefined"!=typeof XMLHttpRequest?au=ge:void 0!==ae&&"[object process]"===Object.prototype.toString.call(ae)&&(au=ru),au),transformRequest:[function(t,e){return se(e,"Accept"),se(e,"Content-Type"),Tt.isFormData(t)||Tt.isArrayBuffer(t)||Tt.isBuffer(t)||Tt.isStream(t)||Tt.isFile(t)||Tt.isBlob(t)?t:Tt.isArrayBufferView(t)?t.buffer:Tt.isURLSearchParams(t)?(ou(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):Tt.isObject(t)?(ou(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};su.headers={common:{Accept:"application/json, text/plain, */*"}},Tt.forEach(["delete","get","head"],(function(t){su.headers[t]={}})),Tt.forEach(["post","put","patch"],(function(t){su.headers[t]=Tt.merge(iu)}));var uu=su;function cu(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var lu=function(t){return cu(t),t.headers=t.headers||{},t.data=jt(t.data,t.headers,t.transformRequest),t.headers=Tt.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Tt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||uu.adapter)(t).then((function(e){return cu(t),e.data=jt(e.data,e.headers,t.transformResponse),e}),(function(e){return Lt(e)||(cu(t),e&&e.response&&(e.response.data=jt(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))},fu=function(t,e){e=e||{};var n={},r=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function s(t,e){return Tt.isPlainObject(t)&&Tt.isPlainObject(e)?Tt.merge(t,e):Tt.isPlainObject(e)?Tt.merge({},e):Tt.isArray(e)?e.slice():e}function u(r){Tt.isUndefined(e[r])?Tt.isUndefined(t[r])||(n[r]=s(void 0,t[r])):n[r]=s(t[r],e[r])}Tt.forEach(r,(function(t){Tt.isUndefined(e[t])||(n[t]=s(void 0,e[t]))})),Tt.forEach(i,u),Tt.forEach(o,(function(r){Tt.isUndefined(e[r])?Tt.isUndefined(t[r])||(n[r]=s(void 0,t[r])):n[r]=s(void 0,e[r])})),Tt.forEach(a,(function(r){r in e?n[r]=s(t[r],e[r]):r in t&&(n[r]=s(void 0,t[r]))}));var c=r.concat(i).concat(o).concat(a),l=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===c.indexOf(t)}));return Tt.forEach(l,u),n};function hu(t){this.defaults=t,this.interceptors={request:new Nt,response:new Nt}}hu.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=fu(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[lu,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)n=n.then(e.shift(),e.shift());return n},hu.prototype.getUri=function(t){return t=fu(this.defaults,t),Ot(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},Tt.forEach(["delete","get","head","options"],(function(t){hu.prototype[t]=function(e,n){return this.request(fu(n||{},{method:t,url:e,data:(n||{}).data}))}})),Tt.forEach(["post","put","patch"],(function(t){hu.prototype[t]=function(e,n,r){return this.request(fu(r||{},{method:t,url:e,data:n}))}}));var du=hu;function pu(t){this.message=t}pu.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},pu.prototype.__CANCEL__=!0;var gu=pu;function vu(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new gu(t),e(n.reason))}))}vu.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},vu.source=function(){var t;return{token:new vu((function(e){t=e})),cancel:t}};var _u=vu;function mu(t){var e=new du(t),n=wt(du.prototype.request,e);return Tt.extend(n,du.prototype,e),Tt.extend(n,e),n}var yu=mu(uu);yu.Axios=du,yu.create=function(t){return mu(fu(yu.defaults,t))},yu.Cancel=gu,yu.CancelToken=_u,yu.isCancel=Lt,yu.all=function(t){return Promise.all(t)},yu.spread=function(t){return function(e){return t.apply(null,e)}},yu.isAxiosError=function(t){return"object"==typeof t&&!0===t.isAxiosError};var wu=yu,bu=yu;wu.default=bu;var ku=wu,Eu=(()=>{const t=ot();return{MINI_APP_LINK:"https://zalo.me/app/link/zapps",MINI_APP_INTERNAL_LINK:"https://h5.zdn.vn/zapps",COOKIE_NAME:{ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSiON:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd"},APIS:{GET_USER_INFO:"https://graph.zalo.me/v2.0/me"},STORAGE_DATA_LIMIT:102400,STORAGE_LIMIT:5242880,NETWORK_TYPE:{NONE:t.isAndroid?-2:0,WIFI:t.isAndroid?0:1,"2G":(t.isAndroid,2),"3G":t.isAndroid?15:2,"4G":t.isAndroid?13:2}}})();const Au={encode:function(t){var e=[];for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(void 0===r)return;if(null===r)return void e.push(n);e.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return e.join("&")},decode:function(t,e){var n={};if(""===t)return n;for(var r=t.split("&"),i=0;i<r.length;i++){var o=r[i].split("=",2),a=decodeURIComponent(o[0]);if(e&&Object.prototype.hasOwnProperty.call(n,a))throw new URIError("Duplicate key: "+a);n[a]=2===o.length?decodeURIComponent(o[1]):null}return n},appendToUrl:function(t,e){return t+(-1!==t.indexOf("?")?"&":"?")+("string"==typeof e?e:Au.encode(e))},getParameterByName:function(t,e){e||(e=window.location.href),t=t.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(t){var e={};return t?(t.split("&").map((function(t){var n=t.split("=");n&&2==n.length&&(e[n[0]]=decodeURIComponent(n[1].replace(/\+/g," ")))})),e):e},toQueryString:function(t){if(!t)return"";if("object"!=(void 0===t?"undefined":typeof t))return t;var e=Object.keys(t),n=[];return e.map((function(e){var r=t[e],i=[e,r="object"==(void 0===r?"undefined":typeof r)?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}};var Su={},Cu=function(t,e,n){var r=e||"default";return function(){var e=r in Su?Su[r](t,n):t;return e.apply(this,arguments)}};Cu.setWrapper=function(t){var e=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];Su[e]=t};var xu={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Tu(t){try{return null===t?xu:JSON.parse(t)}catch(t){return xu}}var Ru={execute:function(t,e,n,r){n.suppress_http_code=1;var i=Au.encode(n);"post"!=e&&(t=Au.appendToUrl(t,i),i="");var o=function(t,e){if(!self.XMLHttpRequest)return null;var n=new XMLHttpRequest,r=function(){};if(!("withCredentials"in n))return null;n.open(t,e,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i={send:function(t){n.send(t)}},o=Cu((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Cu((function(){a=r,"onerror"in i&&i.onerror(n)}),"entry","XMLHttpRequest:error");return n.onload=function(){o()},n.onerror=function(){a()},n.onreadystatechange=function(){4==n.readyState&&(200==n.status?o():a())},i}(e,t);return!!o&&(o.onload=function(t){r(Tu(t.responseText))},o.onerror=function(t){t.responseText?r(Tu(t.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:t.status,type:"http"}})},o.send(i),!0)}};class Ou{constructor(){this._accessTk=ft("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=ft("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=it(),this._device=ot(),this._jsCallFuncCallbacks={},this._listenerEvent={},this.registerListenerEvent("h5.event.paused","",(()=>{if(this.results.length>0){let t=this.results;this.results=[];try{this.sendLogData(t)}catch(t){}}})),this.sendLogTimer?clearInterval(this.sendLogTimer):this.sendLogTimer=setInterval((()=>{if(this.results.length>0){let t=this.results;this.results=[];try{this.sendLogData(t)}catch(t){}}}),5e3)}static getInstance(){return Ou.instance||(Ou.instance=new Ou),Ou.instance}set accessTk(t){this._accessTk=t}set jsAccessTk(t){this._jsAccessTk=t}sendLogData(t){try{Ru.execute("https://h5.zalo.me/log/async","post",{appId:window.APP_ID,data:JSON.stringify(t)},(t=>{}))}catch(t){}}onJSCall(t,e){try{const n=ht(e);if(this._jsCallFuncCallbacks[t]){const e=this._jsCallFuncCallbacks[t].callback,r=this._jsCallFuncCallbacks[t].timeout;if(e){try{e.call(this,n)}catch(t){console.error("Call callback error",t)}r&&clearTimeout(r),this._jsCallFuncCallbacks[t]=null,delete this._jsCallFuncCallbacks[t]}}this.results.push({action:n.action,error:n.error_code})}catch(t){console.log("onJSCall","error",t)}}onMultiJSCall(t,e){try{const n=ht(e);if(this._jsCallFuncCallbacks[t]){const e=this._jsCallFuncCallbacks[t].callback,r=this._jsCallFuncCallbacks[t].timeout;if(e){try{e.call(this,n)}catch(t){console.error("Call callback error",t)}r&&clearTimeout(r)}}this.results.push({action:n.action,error:n.error_code})}catch(t){console.log("onMultiJSCall","error",t)}}jsCallback(t,e,n){ZaloJavaScriptInterface.jsH5EventCallback(t,e,n)}registerListenerEvent(t,e,n){console.log("register "+t+" : "+e),this._listenerEvent[t]={handler:n,data:e}}nativeEventHandler(t,e,n){if(console.log("eventId:",t,"eventName",e,"eventData",n),this._listenerEvent[e]){const{handler:r,data:i}=this._listenerEvent[e];this.jsCallback(t,e,i);try{r(n)}catch(t){console.log("nativeEventHandler","H5 handle event fail",e,t)}}}defaultCallback(t){null!=t&&(t=ht(t))}jsCall(t,e,n,r=!1,i=3,o=!0){try{const a=((t="")=>`${t.normalize("NFD").replace(tt,"").replace(et,"d").replace(nt,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(t);if(!this._device.isMobile||f.isEmpty(t))return this.onJSCall(a,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:t}),!1;null==e&&(e={}),n||(n=this.defaultCallback);const s={error_code:-14,error_message:"Request Timeout!",data:{},action:t};this._jsCallFuncCallbacks[a]={timeout:o&&K.includes(t)&&setTimeout((()=>{this.onJSCall(a,s)}),8e3),callback:n};try{return e=dt(e),r?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,t,this._accessTk,e,window.onMultiJSCall(a)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,t,this._accessTk,e,`window.onMultiJSCall('${a}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,t,this._accessTk,e,window.onJSCall(a)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,t,this._accessTk,e,`window.onJSCall('${a}')`)}catch(o){if(!(i-- >0)){const n={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:e,jsToken:this._jsAccessTk,access_token:this._accessTk},action:t,js_error:o};return this.onJSCall(a,n),!1}setTimeout((()=>{this.jsCall(t,e,n,r,i)}),500)}}catch(t){console.log("jsCall","error",t)}return!1}}class Iu{constructor(t,e,n){this.code=t,this.message=e,this.api=n}}class Nu extends Iu{constructor(t,e){super(t,e),this.message=`${e}. ${V.READ_MORE}`,this.handler()}handler(){switch(this.code){case exports.NativeCode.token_invalid:this.code=G,this.message=V.LOGIN_REQUIRED;break;case exports.NativeCode.not_permission:this.code=J,this.message=V.NOT_PERMISSION;break;case exports.NativeCode.client_not_support:this.message=V.CLIENT_NOT_SUPPORT;break;case exports.NativeCode.decode_failed:this.message=V.DECODE_FAILED}}}const ju={handler:null,setHandler(t){this.handler=t}};ju.setHandler(((t,e)=>e instanceof Iu?(e.api=t,e):new Iu(-2001,f.isNull(e.message)?"Unknown Error":e.message,t)));const Lu=(t,e,n)=>{const r=n.value;return n.value=function(...t){return _t(this,void 0,void 0,(function*(){const{success:n,fail:i}=Array.isArray(t)&&t.length>0&&t[0];return new Promise(((o,a)=>_t(this,void 0,void 0,(function*(){try{const e=yield r.apply(this,t);!f.isNull(n)&&f.isFunction(n)?n.call(null,e,this):o(e)}catch(t){const{handler:n}=ju,r=n.call(null,e,t,this);!f.isNull(i)&&f.isFunction(i)?i.call(null,r,this):console.error("Error:",r)}}))))}))},n},Bu=(t,e,n)=>{const r=n.value;return n.value=function(...t){try{return r.apply(this,t)}catch(t){const{handler:n}=ju;!f.isNull(n)&&f.isFunction(n)?n.call(null,e,t,this):console.warn(t.message)}},n};var Pu;class Uu{constructor(){Pu.set(this,void 0),yt(this,Pu,Ou.getInstance())}setZAccSession(t){mt(this,Pu).accessTk=t}setJSToken(t){mt(this,Pu).jsAccessTk=t}callNative(t,e,n){return new Promise(((r,i)=>{mt(this,Pu).jsCall(t,e,(e=>{if(e&&e.error_code>=0&&e.action==t)r(e.data||{}),(null==n?void 0:n.callback)&&n.callback(e,null);else if(e&&e.error_code<0){const t=new Nu(e.error_code,`${e.action}: ${e.error_message}`);i(t),(null==n?void 0:n.callback)&&n.callback(e,t)}}),null==n?void 0:n.isMultiCallback,null==n?void 0:n.nRetry,null==n?void 0:n.haveTimeout)}))}listenerEventNative(t,e,n){mt(this,Pu).registerListenerEvent(t,e,n)}}Pu=new WeakMap;const Mu={loginFailed:()=>new Iu(G,V.LOGIN_FAILED),loginRequired:()=>new Iu(Y,V.LOGIN_REQUIRED),missingParam:t=>new Iu(Y,`Missing required argument: ${t}`),wrongTypeParam:(t,e,n)=>new Iu(Y,`Wrong type of parameter '${t}'. Expected ${e}, but got ${n}`)};var zu,Du,Fu,qu,Zu;class Wu{static getVersion(){return"2.11.11"}static getSystemInfo(){return{version:at("version-id")||"",apiVersion:"2.11.11",zaloVersion:st(),platform:ut(),language:navigator.language}}static getAppInfo(){return _t(this,void 0,void 0,(function*(){let t={};const e=this.getAppId(),n=this.getSystemInfo(),r=Au.appendToUrl(`https://h5.zalo.me/${X}`,{appId:e,versionStatus:0,currentVersion:n.version}),i=yield fetch(r,{credentials:"include"});if(i.ok){const e=yield i.json();if(e.err<0||!e.data)throw new Error(e);t={name:e.data.name,version:e.data.version,description:e.data.description,appUrl:e.data.appUrl,qrCodeUrl:e.data.qrCodeUrl}}return t}))}}class Hu{static setNavigationBarTitle(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(E,{title:t.title},{haveTimeout:!1})}))}static setNavigationBarColor(t){return _t(this,void 0,void 0,(function*(){if(f.isString(t.color)&&t.color.length>0){const e={};f.isEmpty(t.color)||(e.backgroundColor=t.color),f.isEmpty(t.textColor)||(e.textColor=t.textColor),yield this.callNative(W,{actionbarType:5,dataConfig:e,homeConfig:{enable:this.isShowHomeButton?1:0,url:`${Eu.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}},{haveTimeout:!1}),this.isShowNavBar=!0}else{const e={};f.isEmpty(t.statusBarColor)||(e.backgroundColor=t.statusBarColor),f.isEmpty(t.textColor)||(e.textColor=t.textColor),yield this.callNative(W,{actionbarType:6,dataConfig:e},{haveTimeout:!1}),this.isShowNavBar=!1}}))}static setNavigationBarLeftButton(t){return _t(this,void 0,void 0,(function*(){let e={};switch(t.type){case"none":this.isShowHomeButton=!1,e={buttonType:3,dataConfig:{confirmToExit:1},homeConfig:{enable:0,url:`${Eu.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"back":this.isShowHomeButton=!1,e={buttonType:0,dataConfig:{confirmToExit:1},homeConfig:{enable:0,url:`${Eu.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"home":this.isShowHomeButton=!0,e={buttonType:3,dataConfig:{confirmToExit:1},homeConfig:{enable:1,url:`${Eu.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}};break;case"both":this.isShowHomeButton=!0,e={buttonType:0,dataConfig:{confirmToExit:1},homeConfig:{enable:1,url:`${Eu.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/`}}}yield this.callNative(x,Object.assign({},e),{haveTimeout:!1})}))}static onBackButtonClick(t){return _t(this,void 0,void 0,(function*(){yield this.listenerEventNative("h5.event.action.back",'{"handle_h5": 1}',(()=>{t.handler()}))}))}static setNavigationBarRightButton(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(S,{supportToolBar:t.supportToolBar,reset:t.reset,menuListItems:t.menuListItems,zapp:this.getAppId()})}))}}class $u{static setBackgroundColor(t){return _t(this,void 0,void 0,(function*(){f.isString(t.backgroundColor)&&t.backgroundColor.length>0&&(yield this.callNative(W,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:t.backgroundColor,textColor:t.textColor}}))}))}}class Ku{constructor(t,e,n,r){this.title=r,this.severity=e;const i=new Date;if(this.time=i.toLocaleTimeString(),this.content=t,n>0){const t=(new Error).stack;this.stack=t?t.replace("Error\n",""):""}}toString(){return(this.content.stack?[this.title,this.severity.toUpperCase(),this.time,this.content,this.content.stack.replace("Error:","")]:[this.title,this.severity.toUpperCase(),this.time,JSON.stringify(this.content),this.stack]).join(" ")}}zu=new WeakMap,Du=new WeakMap,Fu=new WeakMap,qu=new WeakMap,Zu=new WeakMap;const Yu=new class{constructor(){zu.set(this,3),Du.set(this,["none","error","warn","info"]),Fu.set(this,"[zmp] > "),qu.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),Zu.set(this,((t,e,n)=>{mt(this,qu)[mt(this,Du)[t]]++;const r=mt(this,Du)[t];if(yt(this,Fu,mt(this,Fu)+("string"!=typeof e?new Ku(e,r,t,n).toString():e)),!(t>mt(this,zu)))switch(t){case 1:console.error(mt(this,Fu));break;case 2:console.warn(mt(this,Fu));break;case 3:console.info(mt(this,Fu));break;default:throw new Error("internal")}}))}setLogLevel(t){yt(this,zu,t)}info(t){mt(this,Zu).call(this,3,t)}warn(t,e){mt(this,Zu).call(this,2,t,e)}error(t,e){mt(this,Zu).call(this,1,t,e)}getMetrics(){return mt(this,qu)}};class Gu{static setDeviceOrientation(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(D,{autoRotate:exports.OrientationType[t.rotate]})}))}static getNetworkType(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(A,{url:window.location.href,featureId:""}).then((t=>{let e;switch(t.network){case Eu.NETWORK_TYPE.NONE:e=exports.NetworkType.none;break;case Eu.NETWORK_TYPE.WIFI:e=exports.NetworkType.wifi;break;case Eu.NETWORK_TYPE["2G"]:case Eu.NETWORK_TYPE["3G"]:case Eu.NETWORK_TYPE["4G"]:e=exports.NetworkType.cellular;break;default:e=exports.NetworkType.unknown}return{networkType:e}}))}))}static onNetworkStatusChange(t){return _t(this,void 0,void 0,(function*(){yield this.listenerEventNative("h5.event.connection.changed","",(e=>{const n=JSON.parse(e),r=n&&n.state;this.getNetworkType().then((e=>{const n={isConnected:"CONNECTED"===r,networkType:e&&e.networkType};t(n)})).catch((t=>{Yu.error(t,"onNetworkStatusChange")}))}))}))}static startBeaconDiscovery(t){var e,n,r,i,o;return _t(this,void 0,void 0,(function*(){const a={subaction:0,scanning_type:f.isNumber(null==t?void 0:t.scanningType)?t.scanningType:0,data:{scan_from_source:f.isString(null==t?void 0:t.scanFromSource)?t.scanFromSource:"",expire:f.isNumber(null==t?void 0:t.expire)?t.expire:3e3,monitor_interval:f.isNumber(null==t?void 0:t.monitorInterval)?t.monitorInterval:60,domain:f.isString(null==t?void 0:t.domain)?t.domain:"",scan_config:{scan_time:f.isNumber(null===(e=null==t?void 0:t.scanConfig)||void 0===e?void 0:e.scanTime)?t.scanConfig.scanTime:15e3,time_between_scan:f.isNumber(null===(n=null==t?void 0:t.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?t.scanConfig.timeBetweenScan:1e4,beacon_timeout:f.isNumber(null===(r=null==t?void 0:t.scanConfig)||void 0===r?void 0:r.beaconTimeout)?t.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:f.isNumber(null===(i=null==t?void 0:t.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?t.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:f.isNumber(null===(o=null==t?void 0:t.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?t.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==t?void 0:t.items)?null==t?void 0:t.items:[]}};return yield this.callNative(F,Object.assign({},a)),!0}))}static stopBeaconDiscovery(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(F,Object.assign({},{subaction:2})),!0}))}static getBeacons(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(F,Object.assign({},{subaction:1}),{isMultiCallback:!0}).then((t=>{const e={beacons:[]};return Array.isArray(t)&&t.forEach((t=>{const n={uuid:t.uuid,major:t.major,minor:t.minor,distance:t.distance,rssi:t.rssi};e.beacons.push(n)})),e}))}))}static stopBluetoothDevicesDiscovery(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static startBluetoothDevicesDiscovery(t){return _t(this,void 0,void 0,(function*(){return this.callNative("",Object.assign({},t))}))}static openBluetoothAdapter(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static onBluetoothDeviceFound(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static onBluetoothAdapterStateChange(){return _t(this,void 0,void 0,(function*(){return Promise.resolve()}))}static getConnectedBluetoothDevices(t){return _t(this,void 0,void 0,(function*(){const e={services:t.services||[]};return this.callNative("",e)}))}static getBluetoothDevices(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static getBluetoothAdapterState(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static closeBluetoothAdapter(){return _t(this,void 0,void 0,(function*(){return this.callNative("",{})}))}static scanQRCode(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(P,{skipOpenLink:!0})}))}static showToast(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(j,{toast:t.message})}))}static hideKeyboard(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(L,{})}))}static openPhone(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(B,{phoneNum:t.phoneNumber,phoneCode:t.phoneNumber})}))}static openSMS(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(U,{content:t.content,phoneCode:t.phoneNumber})}))}static keepScreen(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(z,{data:{keep_screen_on:t.keepScreenOn?1:0}})}))}static openBioAuthentication(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(R,{secret_data:t.secretData,app_id:this.getZAppId(),ui:{title:t.ui.title,sub_title:t.ui.subTitle,negative_text:t.ui.negativeButtonText},require_fingerprint:t.requireFingerprint?1:0}).then((t=>{var e,n,r,i;return{code:null==t?void 0:t.error_code,message:null==t?void 0:t.error_message,data:{domain:null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.domain,code:null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.error_code,message:null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.error_message,payToken:null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.pay_token}}}))}))}static checkStateBioAuthentication(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(O,{}).then((t=>({bioState:null==t?void 0:t.bio_state})))}))}static vibrate(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(H,{type:exports.VibrateType[t.type],vibrate_time:t.milliseconds})}))}}var Ju,Vu,Xu,Qu,tc,ec,nc,rc,ic,oc,ac,sc,uc,cc,lc,fc,hc,dc,pc,gc,vc,_c,mc;class yc{constructor(t){Ju.set(this,localStorage),Vu.set(this,void 0),Xu.set(this,void 0),ot(),yt(this,Xu,{keys:new Set,currentSize:0,limitSize:Eu.STORAGE_LIMIT}),yt(this,Vu,t),this.findAllCurrentDataByApp(t)}findAllCurrentDataByApp(t){try{let e;for(e in mt(this,Ju)){if(t){if(e.split("_")[0]!==t)continue}mt(this,Xu).keys.add(e)}}catch(t){Yu.error(t,"LocalResourceStorage > findAllCurrentDataByApp")}}get(t){let e=new Map;return t.forEach((t=>{e.set(t,this.getSync(t))})),Promise.resolve(e)}getSync(t){return mt(this,Vu)&&(t=`${mt(this,Vu)}_${t}`),mt(this,Xu).keys.has(t)?mt(this,Ju).getItem(t):null}set(t){return _t(this,void 0,void 0,(function*(){return Object.entries(t).forEach((([t,e])=>{this.setSync(t,e.replace(/\\"/g,'"'))})),Promise.resolve({errorKeys:[]})}))}setSync(t,e){mt(this,Vu)&&(t=`${mt(this,Vu)}_${t}`),mt(this,Ju).setItem(t,e),mt(this,Xu).keys.add(t)}getInfo(){return _t(this,void 0,void 0,(function*(){return Promise.resolve(this.getInfoSync())}))}getInfoSync(){const t=((t,e)=>{let n,r,i=0;for(r in t){const o=r.split("_")[0];t.hasOwnProperty(r)&&(e&&o!==e||(n=2*(t[r].length+r.length),i+=n))}return i})(mt(this,Ju),mt(this,Vu));return{currentSize:f.isNumber(t)?Number((t/1024).toFixed(2)):0,limitSize:Number((Eu.STORAGE_LIMIT/1024).toFixed(2))}}remove(t){return _t(this,void 0,void 0,(function*(){return t.forEach((t=>{this.removeSync(t)})),Promise.resolve({errorKeys:[]})}))}removeSync(t){mt(this,Vu)&&(t=`${mt(this,Vu)}_${t}`),mt(this,Xu).keys.has(t)&&(mt(this,Ju).removeItem(t),mt(this,Xu).keys.delete(t))}clear(){return _t(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){mt(this,Xu).keys.forEach((t=>{mt(this,Vu)&&t.indexOf(mt(this,Vu))<0||(mt(this,Ju).removeItem(t),mt(this,Xu).keys.delete(t))}))}}Ju=new WeakMap,Vu=new WeakMap,Xu=new WeakMap;class wc extends Uu{constructor(t){super(),Qu.set(this,void 0),tc.set(this,void 0),yt(this,tc,{keys:new Set,currentSize:0,limitSize:Eu.STORAGE_LIMIT}),yt(this,Qu,t)}get(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative($,{mpds_action:"mpds.get",mpds_data:{keys:t},appId:mt(this,Qu)},{isMultiCallback:!1}).then((t=>{let e=new Map;return t&&t.mpds_data&&t.mpds_data.map&&(e=new Map(Object.entries(t.mpds_data.map))),e}))}))}set(t){return _t(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative($,{mpds_action:"mpds.set",mpds_data:{map:t},appId:mt(this,Qu)},{isMultiCallback:!1}).then((t=>{let e=[];return t&&t.mpds_data&&t.mpds_data.error_keys&&(e=t.mpds_data.error_keys),e}))}}))}getInfo(){return _t(this,void 0,void 0,(function*(){const t=yield this.callNative($,{mpds_action:"mpds.get.size",mpds_data:{},appId:mt(this,Qu)},{isMultiCallback:!1}).then((t=>{let e=0;return t&&t.mpds_data&&t.mpds_data.size&&(e=t.mpds_data.size),e}));return{currentSize:f.isNumber(t)?Number(t/1024):0,limitSize:Number(Eu.STORAGE_LIMIT/1024)}}))}remove(t){return _t(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative($,{mpds_action:"mpds.remove.key",mpds_data:{keys:t},appId:mt(this,Qu)},{isMultiCallback:!1}).then((t=>{let e=[];return t&&t.mpds_data&&t.mpds_data.error_keys&&(e=t.mpds_data.error_keys),e}))}}))}clear(){return _t(this,void 0,void 0,(function*(){yield this.callNative($,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:mt(this,Qu)})}))}}Qu=new WeakMap,tc=new WeakMap;class bc{getDataFromStorage(t){return _t(this,void 0,void 0,(function*(){const e=this.getInstance(),n=yield e.get(t),r={};return n.forEach(((t,e)=>{try{if(t){const n=t.replace(/\\/g,"").replace(/&#39;/g,"'");r[e]=JSON.parse(n)}else r[e]=null}catch(n){r[e]=t}})),r}))}putDataToStorage(t){return _t(this,void 0,void 0,(function*(){const e=this.getInstance(),n={};return Object.entries(t).forEach((([t,e])=>{f.isUndefined(e)||f.isNull(e)||(n[t]=JSON.stringify(e).replace(/"/g,'\\"').replace(/'/g,"&#39;"))})),yield e.set(n)}))}removeDataFromStorage(t){return _t(this,void 0,void 0,(function*(){const e=this.getInstance();return yield e.remove(t)}))}clearStorage(){return _t(this,void 0,void 0,(function*(){const t=this.getInstance();yield t.clear()}))}getStorageInfo(){return _t(this,void 0,void 0,(function*(){const t=this.getInstance();return yield t.getInfo()}))}}class kc extends bc{constructor(t){super(),ec.set(this,void 0),yt(this,ec,t)}getInstance(){return new yc(mt(this,ec))}}ec=new WeakMap;class Ec extends bc{constructor(t){super(),nc.set(this,void 0),yt(this,nc,t)}getInstance(){return new wc(mt(this,nc))}}nc=new WeakMap;class Ac{static setStorage(t){return _t(this,void 0,void 0,(function*(){let e=new kc(this.getAppId());return pt()&&(e=new Ec(this.getAppId())),yield e.putDataToStorage(t.data)}))}static getStorage(t){return _t(this,void 0,void 0,(function*(){let e=new kc(this.getAppId());pt()&&(e=new Ec(this.getAppId()));return yield e.getDataFromStorage(t.keys)}))}static getStorageInfo(t){return _t(this,void 0,void 0,(function*(){let t=new kc(this.getAppId());return pt()&&(t=new Ec(this.getAppId())),yield t.getStorageInfo()}))}static removeStorage(t){return _t(this,void 0,void 0,(function*(){let e=new kc(this.getAppId());return pt()&&(e=new Ec(this.getAppId())),yield e.removeDataFromStorage(t.keys)}))}static clearStorage(t={}){return _t(this,void 0,void 0,(function*(){let t=new kc(this.getAppId());pt()&&(t=new Ec(this.getAppId())),yield t.clearStorage()}))}}class Sc{static getUserInfo(t){return _t(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();return{userInfo:yield ku.get(Eu.APIS.GET_USER_INFO,{params:{fields:"id,birthday,name,gender,picture",access_token:t}}).then((t=>{const e=t.data;return{id:e.id,name:e.name,birthday:e.birthday,gender:e.gender,avatar:e.picture&&e.picture.data&&e.picture.data.url}}))}}))}}class Cc{static closeApp(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(T,{})}))}static openMiniApp(t){return _t(this,void 0,void 0,(function*(){const e=null==t?void 0:t.appId,n=(null==t?void 0:t.params)||{},r=Object.entries(n).map((function([t,e]){return[t,e].join("=")})).join("&");yield this.callNative(Z,{mpUrl:`${Eu.MINI_APP_INTERNAL_LINK}/${e}/${r.length>0?"?"+r:""}`,mpInfo:{appId:e}})}))}static openWebview(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(v,{url:t.url})}))}}class xc{static getLocation(t){return new Promise(((t,e)=>{this.callNative(I,{silent_request:!1,permission_description:""},{isMultiCallback:!0,callback:(n,r)=>{if(r&&e(r),0===n.error_code){const e=n.data,r={latitude:e.latitude,longitude:e.longitude,timestamp:e.timestamp,provider:e.provider};t(r)}}})}))}static sendLocation(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(N,{title:t.title,touserid:t.toUserId,zapp:this.getZAppId()})}))}}class Tc{static requestCameraPermission(t){return new Promise(((t,e)=>{this.callNative(k,{},{callback:(n,r)=>{-2===n.error_code||n.error_code>=0?t({userAllow:-2!==n.error_code,message:n.error_message}):e(r)}})}))}static saveImageToPhotosAlbum(t){return _t(this,void 0,void 0,(function*(){let e={};return e=f.isEmpty(t.imageBase64Data)?Object.assign(Object.assign({},e),{imageUrl:t.imageUrl}):Object.assign(Object.assign({},e),{imageBase64Data:t.imageBase64Data}),yield this.callNative(q,Object.assign({},e))}))}}class Rc{static viewOAQr(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(M,{dpn:t.displayName,uid:t.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openProfile(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(g,{uId:t.id,type:exports.ProfileType[t.type],zapp:this.getZAppId()})}))}static openChat(t){return _t(this,void 0,void 0,(function*(){return yield this.callNative(_,{uId:t.id,type:exports.ChatType[t.type],zapp:this.getZAppId()})}))}static openPostFeed(t){return _t(this,void 0,void 0,(function*(){let e={};switch(t.type){case"image":e={photoUrl:t.data.imageUrl};break;case"link":e={link:t.data.link,title:t.data.title,thumb:t.data.thumb,description:t.data.description};break;case"profile":e={avt:t.data.avatar,uid:t.data.id,dpn:t.data.displayName}}return yield this.callNative(m,Object.assign(Object.assign({type:exports.PostFeedType[t.type]},e),{zapp:this.getZAppId()})).then((t=>({status:t.status,shareType:t.share_type,numberOfUser:t.uid_to_size})))}))}static followOA(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(y,{uid:t.id,showDialogConfirm:!0,zapp:this.getZAppId()},{haveTimeout:!1})}))}static unfollowOA(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(w,{uid:t.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(t){return _t(this,void 0,void 0,(function*(){let e={};switch(t.type){case"image":e={photoUrl:t.data.imageUrl};break;case"gif":e={photoUrl:t.data.imageUrl,gifUrl:t.data.gifUrl,width:t.data.width,height:t.data.height};break;case"video":e={videoThumb:t.data.videoThumb,videoUrl:t.data.videoUrl,width:t.data.width,height:t.data.height};break;case"link":e={link:t.data.link,chatOnly:t.data.chatOnly?1:0};break;case"oa":e={uid:t.data.id}}return yield this.callNative(b,Object.assign(Object.assign({type:exports.ShareSheetType[t.type]},e),{zapp:this.getZAppId()}),{haveTimeout:!1}).then((t=>({status:t.status,shareType:t.share_type,numberOfUser:t.uid_to_size})))}))}static createShortcut(t){return _t(this,void 0,void 0,(function*(){yield this.callNative(C,{url:`${Eu.MINI_APP_LINK}/${this.getAppId()}/`,title:document.title,iconUrl:`https:${at("og:image:url")}`})}))}}class Oc{static getRouteParams(){let t={};const e=window.location.href;try{let n=new URL(e).searchParams.toString();n&&(t=Au.getParamsAsObject(n))}catch(t){throw new Error("Url không hợp lệ")}return t}}class Ic extends Uu{constructor(){super(),rc.set(this,window.zAppID),ic.set(this,window.APP_ID),oc.set(this,window.APP_CONFIG||{}),ac.set(this,void 0),sc.set(this,void 0),uc.set(this,{timer:{getToken:0}}),cc.set(this,(()=>{const t=mt(this,oc).app||null;if(t){const e=t.title,n=t.headerColor,r=t.textColor,i=t.statusBarColor,o=t.leftButton;if(f.isString(e)&&this.setNavigationBarTitle({title:e}),f.isString(n)){const t={color:n};!f.isString(r)||"black"!==r&&"white"!==r||(t.textColor=r),f.isString(i)&&(t.statusBarColor=i),this.setNavigationBarColor(t)}f.isString(o)&&this.setNavigationBarLeftButton({type:o})}})),lc.set(this,(()=>{try{mt(this,cc).call(this)}catch(t){console.error(t)}})),fc.set(this,(()=>new Promise(((t,e)=>{this.callNative("action.jump.login",{}).then((e=>{const n=e&&e.cookiesOAuthLogins||[],r=n.find((t=>t.name===Eu.COOKIE_NAME.JS_TOKEN));r&&(this.setJSToken(r.value),window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(r.value)),t(n)})).catch((t=>{e(t)}))})))),hc.set(this,Hu.setNavigationBarRightButton),this.getVersion=Wu.getVersion,this.getSystemInfo=Wu.getSystemInfo,this.setNavigationBarTitle=Hu.setNavigationBarTitle,this.setNavigationBarColor=Hu.setNavigationBarColor,this.setNavigationBarLeftButton=Hu.setNavigationBarLeftButton,this.setBackgroundColor=$u.setBackgroundColor,this.setDeviceOrientation=Gu.setDeviceOrientation,this.setStorage=Ac.setStorage,this.getStorage=Ac.getStorage,this.getStorageInfo=Ac.getStorageInfo,this.removeStorage=Ac.removeStorage,this.clearStorage=Ac.clearStorage,this.getUserInfo=Sc.getUserInfo,this.getNetworkType=Gu.getNetworkType,this.onNetworkStatusChange=Gu.onNetworkStatusChange,this.startBeaconDiscovery=Gu.startBeaconDiscovery,this.stopBeaconDiscovery=Gu.stopBeaconDiscovery,this.getBeacons=Gu.getBeacons,this.closeApp=Cc.closeApp,this.getLocation=xc.getLocation,this.onBackButtonClick=Hu.onBackButtonClick,this.stopBluetoothDevicesDiscovery=Gu.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=Gu.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=Gu.openBluetoothAdapter,this.onBluetoothDeviceFound=Gu.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=Gu.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=Gu.getConnectedBluetoothDevices,this.getBluetoothDevices=Gu.getBluetoothDevices,this.getBluetoothAdapterState=Gu.getBluetoothAdapterState,this.closeBluetoothAdapter=Gu.closeBluetoothAdapter,this.scanQRCode=Gu.scanQRCode,this.openProfile=Rc.openProfile,this.openChat=Rc.openChat,this.openPostFeed=Rc.openPostFeed,this.followOA=Rc.followOA,this.unFollowOA=Rc.unfollowOA,this.openShareSheet=Rc.openShareSheet,this.requestCameraPermission=Tc.requestCameraPermission,this.createShortcut=Rc.createShortcut,this.openBioAuthentication=Gu.openBioAuthentication,this.checkStateBioAuthentication=Gu.checkStateBioAuthentication,this.sendLocation=xc.sendLocation,this.showToast=Gu.showToast,this.hideKeyboard=Gu.hideKeyboard,this.openPhone=Gu.openPhone,this.openSMS=Gu.openSMS,this.viewOAQr=Rc.viewOAQr,this.keepScreen=Gu.keepScreen,this.saveImageToPhotosAlbum=Tc.saveImageToPhotosAlbum,this.openMiniApp=Cc.openMiniApp,this.vibrate=Gu.vibrate,this.openWebview=Cc.openWebview,this.getRouteParams=Oc.getRouteParams,this.getAppInfo=Wu.getAppInfo,yt(this,ac,null),yt(this,sc,null),this.isShowNavBar=!0,this.isShowHomeButton=!0}static getInstance(){return Ic.instance||(Ic.instance=new Ic),Ic.instance}getAppId(){return mt(this,ic)}getZAppId(){return mt(this,rc)}login(t){return _t(this,void 0,void 0,(function*(){const t=(yield mt(this,fc).call(this)).find((t=>t.name===Eu.COOKIE_NAME.ZOAUTH));if(!f.isUndefined(t)&&!f.isNull(t)&&f.isString(t.value)){yt(this,ac,t.value);const e=()=>_t(this,void 0,void 0,(function*(){return(f.isUndefined(mt(this,ac))||f.isNull(mt(this,ac)))&&clearInterval(mt(this,uc).timer.getToken),yield ku.get("https://oauth.zaloapp.com/v3/access_token",{params:{app_id:mt(this,rc),redirect_uri:`https://h5.zdn.vn/zapps/${mt(this,ic)}/`,code:mt(this,ac),isSDK:!0}}).then((t=>{let n=t.data;if(n.access_token){yt(this,sc,n.access_token);const t=1e3*parseInt(n.expires_in);return mt(this,uc).timer.getToken||(mt(this,uc).timer.getToken=window.setInterval(e,t)),this.setZAccSession(mt(this,sc)||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(mt(this,sc)||""),mt(this,sc)}return null}))}));return clearInterval(mt(this,uc).timer.getToken),yield e(),"Login Success!"}throw Mu.loginFailed()}))}getAccessToken(t){return _t(this,void 0,void 0,(function*(){if(mt(this,sc))return mt(this,sc);throw Mu.loginRequired()}))}}rc=new WeakMap,ic=new WeakMap,oc=new WeakMap,ac=new WeakMap,sc=new WeakMap,uc=new WeakMap,cc=new WeakMap,lc=new WeakMap,fc=new WeakMap,hc=new WeakMap;class Nc{constructor(){dc.set(this,window.zAppID),pc.set(this,window.APP_CONFIG||{}),gc.set(this,"DEFAULT ZOAUTH"),vc.set(this,"DEFAULT ACCESS TOKEN"),_c.set(this,{timer:{getToken:0}}),this.getAppId=()=>mt(this,dc),this.login=()=>Promise.resolve(mt(this,gc)),this.getAccessToken=()=>Promise.resolve(mt(this,vc)),this.getVersion=Wu.getVersion,this.getSystemInfo=Wu.getSystemInfo,this.setNavigationBarTitle=()=>Promise.resolve(),this.setNavigationBarColor=()=>Promise.resolve(),this.setBackgroundColor=()=>Promise.resolve(),this.setNavigationBarLeftButton=()=>Promise.resolve(),this.setDeviceOrientation=()=>Promise.resolve(),this.setStorage=t=>_t(this,void 0,void 0,(function*(){const e=new kc(this.getAppId());return yield e.putDataToStorage(t.data),{errorKeys:[]}})),this.getStorage=t=>_t(this,void 0,void 0,(function*(){const e=new kc(this.getAppId());return yield e.getDataFromStorage(t.keys)})),this.getStorageInfo=t=>_t(this,void 0,void 0,(function*(){const t=new kc(this.getAppId());return yield t.getStorageInfo()})),this.removeStorage=t=>_t(this,void 0,void 0,(function*(){const e=new kc(this.getAppId());return yield e.removeDataFromStorage(t.keys)})),this.clearStorage=t=>_t(this,void 0,void 0,(function*(){const t=new kc(this.getAppId());return yield t.clearStorage()})),this.getUserInfo=()=>Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",birthday:"01/01/1990",gender:"male",avatar:"https://h5.zdn.vn/static/images/avatar.png"}}),this.getNetworkType=()=>{let t;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"none":t=exports.NetworkType.none;break;case"4g":t=exports.NetworkType.wifi;break;case"3g":case"2g":t=exports.NetworkType.cellular;break;default:t=exports.NetworkType.unknown}const e={networkType:t};return Promise.resolve(e)},this.onNetworkStatusChange=t=>{const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=e.effectiveType;return e.addEventListener("change",(function(){let e;switch(n){case"none":e=exports.NetworkType.none;break;case"4g":e=exports.NetworkType.wifi;break;case"3g":case"2g":e=exports.NetworkType.cellular;break;default:e=exports.NetworkType.unknown}t({isConnected:!0,networkType:e})})),Promise.resolve()},this.startBeaconDiscovery=t=>Promise.resolve(!0),this.stopBeaconDiscovery=t=>Promise.resolve(!0),this.getBeacons=t=>Promise.resolve({beacons:[]}),this.closeApp=()=>Promise.resolve(),this.getLocation=()=>Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"}),this.onBackButtonClick=()=>Promise.resolve(),this.stopBluetoothDevicesDiscovery=()=>Promise.resolve(),this.startBluetoothDevicesDiscovery=()=>Promise.resolve(),this.openBluetoothAdapter=()=>Promise.resolve(),this.onBluetoothDeviceFound=()=>Promise.resolve(),this.onBluetoothAdapterStateChange=()=>Promise.resolve(),this.getConnectedBluetoothDevices=()=>Promise.resolve(),this.getBluetoothDevices=()=>Promise.resolve(),this.getBluetoothAdapterState=()=>Promise.resolve(),this.closeBluetoothAdapter=()=>Promise.resolve(),this.scanQRCode=()=>Promise.resolve({content:"132"}),this.openProfile=()=>Promise.resolve(),this.openChat=()=>Promise.resolve(),this.openPostFeed=()=>Promise.resolve({status:1,shareType:0,numberOfUser:0}),this.followOA=()=>Promise.resolve(),this.unFollowOA=()=>Promise.resolve(),this.openShareSheet=()=>Promise.resolve({status:2,shareType:0,numberOfUser:0}),this.requestCameraPermission=()=>Promise.resolve({userAllow:!0,message:"Success"}),this.createShortcut=()=>Promise.resolve(),this.openBioAuthentication=()=>Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}}),this.checkStateBioAuthentication=()=>Promise.resolve({bioState:""}),this.sendLocation=()=>Promise.resolve(),this.showToast=()=>Promise.resolve(),this.hideKeyboard=()=>Promise.resolve(),this.openPhone=()=>Promise.resolve(),this.openSMS=()=>Promise.resolve(),this.viewOAQr=()=>Promise.resolve(),this.keepScreen=()=>Promise.resolve(),this.saveImageToPhotosAlbum=()=>Promise.resolve(),this.openMiniApp=t=>Promise.resolve(),this.vibrate=()=>Promise.resolve(),this.openWebview=t=>(location.replace(t.url),Promise.resolve()),this.getRouteParams=Oc.getRouteParams,this.getAppInfo=()=>Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})}}dc=new WeakMap,pc=new WeakMap,gc=new WeakMap,vc=new WeakMap,_c=new WeakMap,function(e){!function(n){var r="object"==typeof t?t:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(e);function o(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===r.Reflect?r.Reflect=e:i=o(r.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return rt(Object.create(null))}:a?function(){return rt({__proto__:null})}:function(){return rt({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),l="object"==typeof ae&&ae.env&&"true"===ae.env.REFLECT_METADATA_USE_MAP_POLYFILL,f=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,h=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,d=new(l||"function"!=typeof WeakMap?nt():WeakMap);function p(t,e,n,r){if(B(n)){if(!W(t))throw new TypeError;if(!$(e))throw new TypeError;return A(t,e)}if(!W(t))throw new TypeError;if(!M(e))throw new TypeError;if(!M(r)&&!B(r)&&!P(r))throw new TypeError;return P(r)&&(r=void 0),S(t,e,n=Z(n),r)}function g(t,e){function n(n,r){if(!M(n))throw new TypeError;if(!B(r)&&!K(r))throw new TypeError;I(t,e,n,r)}return n}function v(t,e,n,r){if(!M(n))throw new TypeError;return B(r)||(r=Z(r)),I(t,e,n,r)}function _(t,e,n){if(!M(e))throw new TypeError;return B(n)||(n=Z(n)),x(t,e,n)}function m(t,e,n){if(!M(e))throw new TypeError;return B(n)||(n=Z(n)),T(t,e,n)}function y(t,e,n){if(!M(e))throw new TypeError;return B(n)||(n=Z(n)),R(t,e,n)}function w(t,e,n){if(!M(e))throw new TypeError;return B(n)||(n=Z(n)),O(t,e,n)}function b(t,e){if(!M(t))throw new TypeError;return B(e)||(e=Z(e)),N(t,e)}function k(t,e){if(!M(t))throw new TypeError;return B(e)||(e=Z(e)),j(t,e)}function E(t,e,n){if(!M(e))throw new TypeError;B(n)||(n=Z(n));var r=C(e,n,!1);if(B(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=d.get(e);return i.delete(n),i.size>0||d.delete(e),!0}function A(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!B(r)&&!P(r)){if(!$(r))throw new TypeError;e=r}}return e}function S(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!B(o)&&!P(o)){if(!M(o))throw new TypeError;r=o}}return r}function C(t,e,n){var r=d.get(t);if(B(r)){if(!n)return;r=new f,d.set(t,r)}var i=r.get(e);if(B(i)){if(!n)return;i=new f,r.set(e,i)}return i}function x(t,e,n){if(T(t,e,n))return!0;var r=Q(e);return!P(r)&&x(t,r,n)}function T(t,e,n){var r=C(e,n,!1);return!B(r)&&F(r.has(t))}function R(t,e,n){if(T(t,e,n))return O(t,e,n);var r=Q(e);return P(r)?void 0:R(t,r,n)}function O(t,e,n){var r=C(e,n,!1);if(!B(r))return r.get(t)}function I(t,e,n,r){C(n,r,!0).set(t,e)}function N(t,e){var n=j(t,e),r=Q(t);if(null===r)return n;var i=N(r,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new h,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,f=i;l<f.length;l++){c=f[l];o.has(c)||(o.add(c),a.push(c))}return a}function j(t,e){var n=[],r=C(t,e,!1);if(B(r))return n;for(var i=G(r.keys()),o=0;;){var a=V(i);if(!a)return n.length=o,n;var s=J(a);try{n[o]=s}catch(t){try{X(i)}finally{throw t}}o++}}function L(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function B(t){return void 0===t}function P(t){return null===t}function U(t){return"symbol"==typeof t}function M(t){return"object"==typeof t?null!==t:"function"==typeof t}function z(t,e){switch(L(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=Y(t,r);if(void 0!==i){var o=i.call(t,n);if(M(o))throw new TypeError;return o}return D(t,"default"===n?"number":n)}function D(t,e){if("string"===e){var n=t.toString;if(H(n))if(!M(i=n.call(t)))return i;if(H(r=t.valueOf))if(!M(i=r.call(t)))return i}else{var r;if(H(r=t.valueOf))if(!M(i=r.call(t)))return i;var i,o=t.toString;if(H(o))if(!M(i=o.call(t)))return i}throw new TypeError}function F(t){return!!t}function q(t){return""+t}function Z(t){var e=z(t,3);return U(e)?e:q(e)}function W(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function H(t){return"function"==typeof t}function $(t){return"function"==typeof t}function K(t){switch(L(t)){case 3:case 4:return!0;default:return!1}}function Y(t,e){var n=t[e];if(null!=n){if(!H(n))throw new TypeError;return n}}function G(t){var e=Y(t,i);if(!H(e))throw new TypeError;var n=e.call(t);if(!M(n))throw new TypeError;return n}function J(t){return t.value}function V(t){var e=t.next();return!e.done&&e}function X(t){var e=t.return;e&&e.call(t)}function Q(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new f}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}()}function nt(){var t=16,n=u.create(),r=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var t;do{t="@@WeakMap@@"+c()}while(u.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,r)){if(!n)return;Object.defineProperty(t,r,{value:u.create()})}return t[r]}function a(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function s(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function c(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;r<t;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function rt(t){return t.__=void 0,delete t.__,t}t("decorate",p),t("metadata",g),t("defineMetadata",v),t("hasMetadata",_),t("hasOwnMetadata",m),t("getMetadata",y),t("getOwnMetadata",w),t("getMetadataKeys",b),t("getOwnMetadataKeys",k),t("deleteMetadata",E)}(i)}()}(mc||(mc={}));const jc=Symbol("required"),Lc=Symbol("checkType"),Bc=(...t)=>(e,n,r)=>{let i=Reflect.getOwnMetadata(jc,e,n)||[];i.push({parameterIndex:r,fields:t}),Reflect.defineMetadata(jc,i,e,n)},Pc=(t,e,n)=>(r,i,o)=>{let a=Reflect.getOwnMetadata(Lc,r,i)||[];a.push({parameterIndex:o,type:t,properties:e,key:n}),Reflect.defineMetadata(Lc,a,r,i)};const Uc=(t,e,n)=>{const r=n.value,i=r.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",");return n.value=function(){const n=Reflect.getOwnMetadata(jc,t,e),o=Reflect.getOwnMetadata(Lc,t,e);return o&&o.forEach((t=>{const{parameterIndex:e,type:n,properties:r,key:o}=t;let a=arguments[e],s=i[e];if(!f.isEmpty(o)){const t=null==o?void 0:o.split(".");Array.isArray(t)&&t.length>0&&t.forEach((t=>{a=a[t],s=`${s}.${t}`}))}const u=typeof a;if(!f.isUndefined(a)){if(!ct(a,n))throw Mu.wrongTypeParam(s,n,Array.isArray(a)?"array":null===a?"null":u);"object"===n&&Object.entries(r).forEach((([t,e])=>{const n=a[t];if(!f.isUndefined(n)){if(Array.isArray(e)&&!e.includes(n))throw Mu.wrongTypeParam(`${s}.${t}`,`${e}`.replace(/,/g,"|"),`'${n}'`);if(!Array.isArray(e)&&!ct(n,e))throw Mu.wrongTypeParam(`${s}.${t}`,e,Array.isArray(n)?"array":null===n?"null":typeof n)}}))}})),n&&n.forEach((t=>{const{parameterIndex:e,fields:n}=t,r=arguments[e],o=i[e],a=typeof r;if(!Array.isArray(r)&&"object"===a&&n.some((t=>f.isUndefined(r[t]))))throw Mu.missingParam(`${n} in ${o}`);if("object"!==a&&(e>=arguments.length||f.isUndefined(r)))throw Mu.missingParam(o)})),r.apply(this,arguments)},n};var Mc;class zc{constructor(){Mc.set(this,void 0),yt(this,Mc,this.getInstance())}login(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).login(t)}))}getAccessToken(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getAccessToken(t)}))}getVersion(){return mt(this,Mc).getVersion()}getSystemInfo(){return mt(this,Mc).getSystemInfo()}setNavigationBarTitle(t){return _t(this,void 0,void 0,(function*(){return mt(this,Mc).setNavigationBarTitle(t)}))}setNavigationBarColor(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).setNavigationBarColor(t)}))}setBackgroundColor(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).setBackgroundColor(t)}))}setNavigationBarLeftButton(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).setNavigationBarLeftButton(t)}))}setDeviceOrientation(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).setDeviceOrientation(t)}))}setStorage(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).setStorage(t)}))}getStorage(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getStorage(t)}))}getStorageInfo(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getStorageInfo(t)}))}removeStorage(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).removeStorage(t)}))}clearStorage(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).clearStorage(t)}))}getUserInfo(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getUserInfo(t)}))}getNetworkType(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getNetworkType(t)}))}onNetworkStatusChange(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).onNetworkStatusChange(t)}))}startBeaconDiscovery(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).startBeaconDiscovery(t)}))}stopBeaconDiscovery(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).stopBeaconDiscovery(t)}))}getBeacons(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getBeacons(t)}))}closeApp(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).closeApp(t)}))}getLocation(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getLocation(t)}))}onBackButtonClick(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).onBackButtonClick(t)}))}stopBluetoothDevicesDiscovery(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).startBluetoothDevicesDiscovery(t)}))}openBluetoothAdapter(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).openBluetoothAdapter()}))}onBluetoothDeviceFound(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getConnectedBluetoothDevices(t)}))}getBluetoothDevices(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getBluetoothDevices()}))}getBluetoothAdapterState(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).getBluetoothAdapterState()}))}closeBluetoothAdapter(){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).closeBluetoothAdapter()}))}scanQRCode(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).scanQRCode(t)}))}openProfile(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).openProfile(t)}))}openChat(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).openChat(t)}))}openPostFeed(t){return _t(this,void 0,void 0,(function*(){const e=t.type;if("image"===e&&lt(t.data.imageUrl))throw Mu.wrongTypeParam("object.data.imageUrl","valid url","invalid");if("link"===e&&(lt(t.data.link)||!rt(t.data.link)))throw Mu.wrongTypeParam("object.data.link","valid url","invalid");if("profile"===e){if(lt(t.data.id))throw Mu.wrongTypeParam("object.data.id","valid id","empty");if(lt(t.data.avatar)||!rt(t.data.avatar))throw Mu.wrongTypeParam("object.data.avatar","valid url","invalid");if(lt(t.data.displayName))throw Mu.wrongTypeParam("object.data.displayName","valid displayName","empty")}return yield mt(this,Mc).openPostFeed(t)}))}followOA(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).followOA(t)}))}unfollowOA(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).unFollowOA(t)}))}openShareSheet(t){return _t(this,void 0,void 0,(function*(){const e=t.type;if("image"===e&&lt(t.data.imageUrl))throw Mu.wrongTypeParam("object.data.imageUrl","valid url","invalid");if("gif"===e&&(lt(t.data.gifUrl)||!rt(t.data.gifUrl)))throw Mu.wrongTypeParam("object.data.gifUrl","valid url","invalid");if("video"===e){if(lt(t.data.videoThumb)||!rt(t.data.videoThumb))throw Mu.wrongTypeParam("object.data.videoThumb","valid url","invalid");if(lt(t.data.videoUrl)||!rt(t.data.videoUrl))throw Mu.wrongTypeParam("object.data.videoUrl","valid url","invalid")}else{if("link"===e&&(lt(t.data.link)||!rt(t.data.link)))throw Mu.wrongTypeParam("object.data.link","valid url","invalid");if("oa"===e&&lt(t.data.id))throw Mu.wrongTypeParam("object.data.id","valid id","empty")}return yield mt(this,Mc).openShareSheet(t)}))}requestCameraPermission(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).requestCameraPermission(t)}))}createShortcut(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).createShortcut(t)}))}openBioAuthentication(t){var e;return _t(this,void 0,void 0,(function*(){return f.isUndefined(t.requireFingerprint)&&(t.requireFingerprint=!0),lt(null===(e=t.ui)||void 0===e?void 0:e.title)&&(t.ui=Object.assign(Object.assign({},t.ui),{title:"Xác thực"})),lt(t.ui.subTitle)&&(t.ui=Object.assign(Object.assign({},t.ui),{subTitle:"Sử dụng sinh trắc học của bạn để xác thực"})),lt(t.ui.negativeButtonText)&&(t.ui=Object.assign(Object.assign({},t.ui),{negativeButtonText:"Đóng"})),yield mt(this,Mc).openBioAuthentication(t)}))}checkStateBioAuthentication(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).checkStateBioAuthentication(t)}))}sendLocation(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).sendLocation(t)}))}showToast(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).showToast(t)}))}hideKeyboard(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).hideKeyboard(t)}))}openPhone(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).openPhone(t)}))}openSMS(t){return _t(this,void 0,void 0,(function*(){if(!/^\+?\d+$/.test(t.phoneNumber))throw Mu.wrongTypeParam("object.phoneNumber","valid phone","invalid");yield mt(this,Mc).openSMS(t)}))}viewOAQr(t){return _t(this,void 0,void 0,(function*(){(f.isUndefined(t.displayName)||f.isNull(t.displayName))&&(t.displayName=""),yield mt(this,Mc).viewOAQr(t)}))}keepScreen(t){return _t(this,void 0,void 0,(function*(){return yield mt(this,Mc).keepScreen(t)}))}saveImageToPhotosAlbum(t){return _t(this,void 0,void 0,(function*(){if(lt(t.imageBase64Data)&&lt(t.imageUrl))throw Mu.wrongTypeParam("object.imageBase64Data | object.imageUrl","valid data","invalid");if(!lt(t.imageUrl)&&!rt(t.imageUrl))throw Mu.wrongTypeParam("object.imageUrl","valid url","invalid");return yield mt(this,Mc).saveImageToPhotosAlbum(t)}))}openMiniApp(t){return _t(this,void 0,void 0,(function*(){if(!f.isEmpty(t.params)){const e=t.params||{};Object.keys(e).forEach((t=>{"object"==typeof e[t]&&(e[t]=JSON.stringify(e[t])),e[t]=""+encodeURIComponent(e[t])})),t.params=e}yield mt(this,Mc).openMiniApp(t)}))}vibrate(t){return _t(this,void 0,void 0,(function*(){lt(t.type)&&(t.type="oneShot"),lt(t.milliseconds)&&(t.milliseconds=500),yield mt(this,Mc).vibrate(t)}))}openWebview(t){return _t(this,void 0,void 0,(function*(){yield mt(this,Mc).openWebview(t)}))}getRouteParams(){return mt(this,Mc).getRouteParams()}getAppInfo(t){return mt(this,Mc).getAppInfo()}}Mc=new WeakMap,gt([Lu],zc.prototype,"login",null),gt([Lu],zc.prototype,"getAccessToken",null),gt([Bu],zc.prototype,"getVersion",null),gt([Bu],zc.prototype,"getSystemInfo",null),gt([Lu,Uc,vt(0,Pc("object",{title:"string"})),vt(0,Bc("title"))],zc.prototype,"setNavigationBarTitle",null),gt([Lu,Uc,vt(0,Pc("object",{color:"string",textColor:["white","black"],statusBarColor:"string"})),vt(0,Bc("color"))],zc.prototype,"setNavigationBarColor",null),gt([Lu,Uc,vt(0,Pc("object",{backgroundColor:"string",textColor:["white","black"]})),vt(0,Bc("backgroundColor"))],zc.prototype,"setBackgroundColor",null),gt([Lu,Uc,vt(0,Pc("object",{type:["none","back","home","both"]})),vt(0,Bc("type"))],zc.prototype,"setNavigationBarLeftButton",null),gt([Lu,Uc,vt(0,Pc("object",{rotate:["auto","portrait","landscape"]})),vt(0,Bc("rotate"))],zc.prototype,"setDeviceOrientation",null),gt([Lu,Uc,vt(0,Pc("object",{data:"object"})),vt(0,Bc("data"))],zc.prototype,"setStorage",null),gt([Lu,Uc,vt(0,Pc("object",{keys:"array<string>"})),vt(0,Bc("keys"))],zc.prototype,"getStorage",null),gt([Lu],zc.prototype,"getStorageInfo",null),gt([Lu,Uc,vt(0,Pc("object",{keys:"array<string>"})),vt(0,Bc("keys"))],zc.prototype,"removeStorage",null),gt([Lu],zc.prototype,"clearStorage",null),gt([Lu],zc.prototype,"getUserInfo",null),gt([Lu],zc.prototype,"getNetworkType",null),gt([Lu],zc.prototype,"onNetworkStatusChange",null),gt([Lu],zc.prototype,"startBeaconDiscovery",null),gt([Lu],zc.prototype,"stopBeaconDiscovery",null),gt([Lu],zc.prototype,"getBeacons",null),gt([Lu],zc.prototype,"closeApp",null),gt([Lu],zc.prototype,"getLocation",null),gt([Lu],zc.prototype,"onBackButtonClick",null),gt([Lu],zc.prototype,"stopBluetoothDevicesDiscovery",null),gt([Lu],zc.prototype,"startBluetoothDevicesDiscovery",null),gt([Lu],zc.prototype,"openBluetoothAdapter",null),gt([Lu],zc.prototype,"onBluetoothDeviceFound",null),gt([Lu],zc.prototype,"onBluetoothAdapterStateChange",null),gt([Lu],zc.prototype,"getConnectedBluetoothDevices",null),gt([Lu],zc.prototype,"getBluetoothDevices",null),gt([Lu],zc.prototype,"getBluetoothAdapterState",null),gt([Lu],zc.prototype,"closeBluetoothAdapter",null),gt([Lu],zc.prototype,"scanQRCode",null),gt([Lu,Uc,vt(0,Pc("object",{type:["user","oa","aliasOA"],id:"string"})),vt(0,Bc("type","id"))],zc.prototype,"openProfile",null),gt([Lu,Uc,vt(0,Pc("object",{type:["user","oa"],id:"string"})),vt(0,Bc("type","id"))],zc.prototype,"openChat",null),gt([Lu,Uc,vt(0,Pc("object",{type:["image","link","profile"],data:"object"})),vt(0,Pc("object",{imageUrl:"string",link:"string",title:"string",thumb:"string",description:"string",avatar:"string",id:"string",displayName:"string"},"data")),vt(0,Bc("type","data"))],zc.prototype,"openPostFeed",null),gt([Lu,Uc,vt(0,Pc("object",{id:"string",showDialogConfirm:"boolean"})),vt(0,Bc("id"))],zc.prototype,"followOA",null),gt([Lu,Uc,vt(0,Pc("object",{id:"string"})),vt(0,Bc("id"))],zc.prototype,"unfollowOA",null),gt([Lu,Uc,vt(0,Pc("object",{type:["image","gif","video","link","oa"],data:"object"})),vt(0,Pc("object",{imageUrl:"string",gifUrl:"string",width:"number",height:"number",videoThumb:"string",videoUrl:"string",link:"string",chatOnly:"boolean",id:"string"},"data")),vt(0,Bc("type","data"))],zc.prototype,"openShareSheet",null),gt([Lu],zc.prototype,"requestCameraPermission",null),gt([Lu],zc.prototype,"createShortcut",null),gt([Lu,Uc,vt(0,Bc("secretData")),vt(0,Pc("object",{secretData:"string",ui:"object",requireFingerprint:"boolean"})),vt(0,Pc("object",{title:"string",subTitle:"string",negativeButtonText:"string"},"ui"))],zc.prototype,"openBioAuthentication",null),gt([Lu],zc.prototype,"checkStateBioAuthentication",null),gt([Lu,Uc,vt(0,Bc("toUserId"))],zc.prototype,"sendLocation",null),gt([Lu,Uc,vt(0,Bc("message"))],zc.prototype,"showToast",null),gt([Lu],zc.prototype,"hideKeyboard",null),gt([Lu,Uc,vt(0,Bc("phoneNumber")),vt(0,Pc("object",{phoneNumber:"string"}))],zc.prototype,"openPhone",null),gt([Lu,Uc,vt(0,Bc("content","phoneNumber")),vt(0,Pc("object",{content:"string",phoneNumber:"string"}))],zc.prototype,"openSMS",null),gt([Lu,Uc,vt(0,Bc("id")),vt(0,Pc("object",{id:"string",displayName:"string"}))],zc.prototype,"viewOAQr",null),gt([Lu],zc.prototype,"keepScreen",null),gt([Lu,Uc,vt(0,Pc("object",{imageBase64Data:"string",imageUrl:"string",type:"string"}))],zc.prototype,"saveImageToPhotosAlbum",null),gt([Lu,Uc,vt(0,Bc("appId")),vt(0,Pc("object",{appId:"string",params:"object"}))],zc.prototype,"openMiniApp",null),gt([Lu,Uc,vt(0,Pc("object",{type:["oneShot"],milliseconds:"number"}))],zc.prototype,"vibrate",null),gt([Lu,Uc,vt(0,Bc("url")),vt(0,Pc("object",{url:"string"}))],zc.prototype,"openWebview",null),gt([Bu],zc.prototype,"getRouteParams",null),gt([Lu],zc.prototype,"getAppInfo",null);class Dc extends zc{getInstance(){return Ic.getInstance()}}class Fc extends zc{getInstance(){return new Nc}}const qc=ot();exports.default=void 0,window.onJSCall=t=>function(e){Ou.getInstance().onJSCall(t,e)},window.onMultiJSCall=t=>function(e){Ou.getInstance().onMultiJSCall(t,e)},window.zaloJSV2={zalo_h5_event_handler:function(t,e,n){Ou.getInstance().nativeEventHandler(t,e,n)}},qc.isZalo?exports.default=new Dc:exports.default=new Fc,window.ZaloMiniAppSDK=exports.default,exports.SDKCreator=zc,exports.default=exports.default;